@donotdev/cli 0.1.45 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dependencies-matrix.json +191 -150
  2. package/dist/bin/commands/agent-setup.js +632 -524
  3. package/dist/bin/commands/build.js +1239 -935
  4. package/dist/bin/commands/bump.js +1285 -946
  5. package/dist/bin/commands/cacheout.js +543 -405
  6. package/dist/bin/commands/coach.js +546 -408
  7. package/dist/bin/commands/create-app.js +1198 -862
  8. package/dist/bin/commands/create-project.js +1238 -902
  9. package/dist/bin/commands/db.js +139128 -93775
  10. package/dist/bin/commands/deploy.js +2308 -1936
  11. package/dist/bin/commands/dev.js +912 -662
  12. package/dist/bin/commands/doctor.js +634 -526
  13. package/dist/bin/commands/emu.js +1093 -785
  14. package/dist/bin/commands/format.js +588 -450
  15. package/dist/bin/commands/get-demo.js +1043 -756
  16. package/dist/bin/commands/make-admin.js +20974 -38424
  17. package/dist/bin/commands/preview.js +913 -663
  18. package/dist/bin/commands/seed.js +139129 -93776
  19. package/dist/bin/commands/setup-cicd.js +1130 -817
  20. package/dist/bin/commands/setup.js +1299 -960
  21. package/dist/bin/commands/staging.js +2308 -1936
  22. package/dist/bin/commands/sync-secrets.js +996 -733
  23. package/dist/bin/commands/type-check.js +733 -598
  24. package/dist/bin/commands/wai.js +533 -395
  25. package/dist/bin/dndev.js +9 -8
  26. package/dist/index.js +2720 -2290
  27. package/package.json +3 -3
  28. package/templates/app-next/src/app/ClientLayout.tsx.example +11 -1
  29. package/templates/app-next/src/app/layout.tsx.example +19 -1
  30. package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +8 -18
  31. package/templates/functions-firebase/src/billing/index.ts.example +0 -1
  32. package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +4 -8
  33. package/templates/functions-firebase/src/index.ts.example +0 -1
  34. package/templates/functions-supabase/supabase/config.toml.example +4 -0
  35. package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +12 -0
  36. package/templates/functions-supabase/supabase/migrations/20250101000005_webhook_events.sql +133 -0
  37. package/templates/functions-vercel/.env.example +9 -0
  38. package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +12 -14
  39. package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +4 -14
  40. package/templates/overlay-supabase/src/config/providers.ts.example +2 -2
  41. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +32 -0
  42. package/templates/root-consumer/.claude/hooks/record-lookup.sh.example +22 -0
  43. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +7 -0
  44. package/templates/root-consumer/.claude/rules/framework.md.example +6 -0
  45. package/templates/root-consumer/.claude/settings.json.example +11 -1
  46. package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
  47. package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
@@ -5,16 +5,25 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
8
+ get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
9
9
  }) : x)(function(x) {
10
10
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
11
  throw Error('Dynamic require of "' + x + '" is not supported');
12
12
  });
13
- var __esm = (fn, res) => function __init() {
14
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
+ var __esm = (fn, res, err) => function __init() {
14
+ if (err) throw err[0];
15
+ try {
16
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
+ } catch (e) {
18
+ throw err = [e], e;
19
+ }
15
20
  };
16
21
  var __commonJS = (cb, mod) => function __require2() {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
22
+ try {
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
+ } catch (e) {
25
+ throw mod = 0, e;
26
+ }
18
27
  };
19
28
  var __copyProps = (to, from, except, desc) => {
20
29
  if (from && typeof from === "object" || typeof from === "function") {
@@ -33,31 +42,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
42
  mod
34
43
  ));
35
44
 
36
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
37
- var isAmbiguous, isFullWidth, isWide;
45
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
46
+ var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
38
47
  var init_utils = __esm({
39
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js"() {
48
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
40
49
  init_utils2();
41
- isAmbiguous = (x) => {
42
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
43
- };
50
+ getCodePointsLength = /* @__PURE__ */ (() => {
51
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
52
+ return (input) => {
53
+ let surrogatePairsNr = 0;
54
+ SURROGATE_PAIR_RE.lastIndex = 0;
55
+ while (SURROGATE_PAIR_RE.test(input)) {
56
+ surrogatePairsNr += 1;
57
+ }
58
+ return input.length - surrogatePairsNr;
59
+ };
60
+ })();
44
61
  isFullWidth = (x) => {
45
62
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
46
63
  };
47
- isWide = (x) => {
48
- return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9800 && x <= 9811 || x === 9855 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101632 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
64
+ isWideNotCJKTNotEmoji = (x) => {
65
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
49
66
  };
50
67
  }
51
68
  });
52
69
 
53
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
54
- var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
70
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
71
+ var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
55
72
  var init_dist = __esm({
56
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js"() {
73
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
57
74
  init_utils2();
58
75
  init_utils();
59
- ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
76
+ ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
60
77
  CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
78
+ CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
61
79
  TAB_RE = /\t{1,1000}/y;
62
80
  EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
63
81
  LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -67,14 +85,21 @@ var init_dist = __esm({
67
85
  const LIMIT = truncationOptions.limit ?? Infinity;
68
86
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
69
87
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
70
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
88
+ const ANSI_WIDTH = 0;
71
89
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
72
90
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
73
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
74
91
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
75
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
92
+ const FULL_WIDTH_WIDTH = 2;
76
93
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
77
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
94
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
95
+ const PARSE_BLOCKS = [
96
+ [LATIN_RE, REGULAR_WIDTH],
97
+ [ANSI_RE, ANSI_WIDTH],
98
+ [CONTROL_RE, CONTROL_WIDTH],
99
+ [TAB_RE, TAB_WIDTH],
100
+ [EMOJI_RE, EMOJI_WIDTH],
101
+ [CJKT_WIDE_RE, WIDE_WIDTH]
102
+ ];
78
103
  let indexPrev = 0;
79
104
  let index = 0;
80
105
  let length = input.length;
@@ -94,10 +119,8 @@ var init_dist = __esm({
94
119
  const codePoint = char.codePointAt(0) || 0;
95
120
  if (isFullWidth(codePoint)) {
96
121
  widthExtra = FULL_WIDTH_WIDTH;
97
- } else if (isWide(codePoint)) {
122
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
98
123
  widthExtra = WIDE_WIDTH;
99
- } else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
100
- widthExtra = AMBIGUOUS_WIDTH;
101
124
  } else {
102
125
  widthExtra = REGULAR_WIDTH;
103
126
  }
@@ -113,88 +136,28 @@ var init_dist = __esm({
113
136
  }
114
137
  unmatchedStart = unmatchedEnd = 0;
115
138
  }
116
- if (index >= length)
117
- break;
118
- LATIN_RE.lastIndex = index;
119
- if (LATIN_RE.test(input)) {
120
- lengthExtra = LATIN_RE.lastIndex - index;
121
- widthExtra = lengthExtra * REGULAR_WIDTH;
122
- if (width + widthExtra > truncationLimit) {
123
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
124
- }
125
- if (width + widthExtra > LIMIT) {
126
- truncationEnabled = true;
127
- break;
128
- }
129
- width += widthExtra;
130
- unmatchedStart = indexPrev;
131
- unmatchedEnd = index;
132
- index = indexPrev = LATIN_RE.lastIndex;
133
- continue;
134
- }
135
- ANSI_RE.lastIndex = index;
136
- if (ANSI_RE.test(input)) {
137
- if (width + ANSI_WIDTH > truncationLimit) {
138
- truncationIndex = Math.min(truncationIndex, index);
139
- }
140
- if (width + ANSI_WIDTH > LIMIT) {
141
- truncationEnabled = true;
142
- break;
143
- }
144
- width += ANSI_WIDTH;
145
- unmatchedStart = indexPrev;
146
- unmatchedEnd = index;
147
- index = indexPrev = ANSI_RE.lastIndex;
148
- continue;
139
+ if (index >= length) {
140
+ break outer;
149
141
  }
150
- CONTROL_RE.lastIndex = index;
151
- if (CONTROL_RE.test(input)) {
152
- lengthExtra = CONTROL_RE.lastIndex - index;
153
- widthExtra = lengthExtra * CONTROL_WIDTH;
154
- if (width + widthExtra > truncationLimit) {
155
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
156
- }
157
- if (width + widthExtra > LIMIT) {
158
- truncationEnabled = true;
159
- break;
160
- }
161
- width += widthExtra;
162
- unmatchedStart = indexPrev;
163
- unmatchedEnd = index;
164
- index = indexPrev = CONTROL_RE.lastIndex;
165
- continue;
166
- }
167
- TAB_RE.lastIndex = index;
168
- if (TAB_RE.test(input)) {
169
- lengthExtra = TAB_RE.lastIndex - index;
170
- widthExtra = lengthExtra * TAB_WIDTH;
171
- if (width + widthExtra > truncationLimit) {
172
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
173
- }
174
- if (width + widthExtra > LIMIT) {
175
- truncationEnabled = true;
176
- break;
177
- }
178
- width += widthExtra;
179
- unmatchedStart = indexPrev;
180
- unmatchedEnd = index;
181
- index = indexPrev = TAB_RE.lastIndex;
182
- continue;
183
- }
184
- EMOJI_RE.lastIndex = index;
185
- if (EMOJI_RE.test(input)) {
186
- if (width + EMOJI_WIDTH > truncationLimit) {
187
- truncationIndex = Math.min(truncationIndex, index);
188
- }
189
- if (width + EMOJI_WIDTH > LIMIT) {
190
- truncationEnabled = true;
191
- break;
142
+ for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
143
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
144
+ BLOCK_RE.lastIndex = index;
145
+ if (BLOCK_RE.test(input)) {
146
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
147
+ widthExtra = lengthExtra * BLOCK_WIDTH;
148
+ if (width + widthExtra > truncationLimit) {
149
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
150
+ }
151
+ if (width + widthExtra > LIMIT) {
152
+ truncationEnabled = true;
153
+ break outer;
154
+ }
155
+ width += widthExtra;
156
+ unmatchedStart = indexPrev;
157
+ unmatchedEnd = index;
158
+ index = indexPrev = BLOCK_RE.lastIndex;
159
+ continue outer;
192
160
  }
193
- width += EMOJI_WIDTH;
194
- unmatchedStart = indexPrev;
195
- unmatchedEnd = index;
196
- index = indexPrev = EMOJI_RE.lastIndex;
197
- continue;
198
161
  }
199
162
  index += 1;
200
163
  }
@@ -209,10 +172,10 @@ var init_dist = __esm({
209
172
  }
210
173
  });
211
174
 
212
- // node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
175
+ // node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
213
176
  var NO_TRUNCATION2, fastStringWidth, dist_default2;
214
177
  var init_dist2 = __esm({
215
- "node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js"() {
178
+ "node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
216
179
  init_utils2();
217
180
  init_dist();
218
181
  NO_TRUNCATION2 = {
@@ -227,13 +190,13 @@ var init_dist2 = __esm({
227
190
  }
228
191
  });
229
192
 
230
- // node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
193
+ // node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
231
194
  function wrapAnsi(string, columns, options) {
232
195
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
233
196
  }
234
197
  var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
235
198
  var init_main = __esm({
236
- "node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js"() {
199
+ "node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
237
200
  init_utils2();
238
201
  init_dist2();
239
202
  ESC = "\x1B";
@@ -397,16 +360,19 @@ var init_main = __esm({
397
360
  }
398
361
  const preString = rows.join("\n");
399
362
  let inSurrogate = false;
400
- for (let i = 0; i < preString.length; i++) {
401
- const character = preString[i];
363
+ for (let i2 = 0; i2 < preString.length; i2++) {
364
+ const character = preString[i2];
402
365
  returnValue += character;
403
366
  if (!inSurrogate) {
404
367
  inSurrogate = character >= "\uD800" && character <= "\uDBFF";
368
+ if (inSurrogate) {
369
+ continue;
370
+ }
405
371
  } else {
406
- continue;
372
+ inSurrogate = false;
407
373
  }
408
374
  if (character === ESC || character === CSI) {
409
- GROUP_REGEX.lastIndex = i + 1;
375
+ GROUP_REGEX.lastIndex = i2 + 1;
410
376
  const groupsResult = GROUP_REGEX.exec(preString);
411
377
  const groups = groupsResult?.groups;
412
378
  if (groups?.code !== void 0) {
@@ -416,7 +382,7 @@ var init_main = __esm({
416
382
  escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
417
383
  }
418
384
  }
419
- if (preString[i + 1] === "\n") {
385
+ if (preString[i2 + 1] === "\n") {
420
386
  if (escapeUrl) {
421
387
  returnValue += wrapAnsiHyperlink("");
422
388
  }
@@ -447,7 +413,7 @@ var require_src = __commonJS({
447
413
  var ESC2 = "\x1B";
448
414
  var CSI2 = `${ESC2}[`;
449
415
  var beep = "\x07";
450
- var cursor = {
416
+ var cursor3 = {
451
417
  to(x, y2) {
452
418
  if (!y2) return `${CSI2}${x + 1}G`;
453
419
  return `${CSI2}${y2 + 1};${x + 1}H`;
@@ -476,7 +442,7 @@ var require_src = __commonJS({
476
442
  up: (count = 1) => `${CSI2}S`.repeat(count),
477
443
  down: (count = 1) => `${CSI2}T`.repeat(count)
478
444
  };
479
- var erase = {
445
+ var erase3 = {
480
446
  screen: `${CSI2}2J`,
481
447
  up: (count = 1) => `${CSI2}1J`.repeat(count),
482
448
  down: (count = 1) => `${CSI2}J`.repeat(count),
@@ -485,67 +451,137 @@ var require_src = __commonJS({
485
451
  lineStart: `${CSI2}1K`,
486
452
  lines(count) {
487
453
  let clear = "";
488
- for (let i = 0; i < count; i++)
489
- clear += this.line + (i < count - 1 ? cursor.up() : "");
454
+ for (let i2 = 0; i2 < count; i2++)
455
+ clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
490
456
  if (count)
491
- clear += cursor.left;
457
+ clear += cursor3.left;
492
458
  return clear;
493
459
  }
494
460
  };
495
- module.exports = { cursor, scroll, erase, beep };
461
+ module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
496
462
  }
497
463
  });
498
464
 
499
- // node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
500
- import { styleText as y } from "node:util";
501
- import { stdout as S, stdin as $ } from "node:process";
502
- import P from "node:readline";
503
- import { ReadStream as D } from "node:tty";
504
- function d(r, t2, e) {
505
- if (!e.some((o) => !o.disabled)) return r;
506
- const s = r + t2, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
507
- return e[n].disabled ? d(n, t2 < 0 ? -1 : 1, e) : n;
465
+ // node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
466
+ import { styleText } from "node:util";
467
+ import { stdout, stdin } from "node:process";
468
+ import l__default from "node:readline";
469
+ import { ReadStream } from "node:tty";
470
+ function findCursor(s, o, l) {
471
+ if (!l.some((r2) => !r2.disabled))
472
+ return s;
473
+ const t2 = s + o, n3 = Math.max(l.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
474
+ return l[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l) : e;
475
+ }
476
+ function isAccessible(n3) {
477
+ if (n3 !== void 0) return n3;
478
+ if (settings.accessible !== void 0) return settings.accessible;
479
+ const e = process.env.ACCESSIBLE;
480
+ return e !== void 0 && e !== "" && e !== "0" && e !== "false";
508
481
  }
509
- function V(r, t2) {
510
- if (typeof r == "string") return u.aliases.get(r) === t2;
511
- for (const e of r) if (e !== void 0 && V(e, t2)) return true;
482
+ function isActionKey(n3, e) {
483
+ if (typeof n3 == "string")
484
+ return settings.aliases.get(n3) === e;
485
+ for (const s of n3)
486
+ if (s !== void 0 && isActionKey(s, e))
487
+ return true;
512
488
  return false;
513
489
  }
514
- function j(r, t2) {
515
- if (r === t2) return;
516
- const e = r.split(`
517
- `), s = t2.split(`
518
- `), i = Math.max(e.length, s.length), n = [];
519
- for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
520
- return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
490
+ function diffLines(i2, s) {
491
+ if (i2 === s) return;
492
+ const e = i2.split(`
493
+ `), t2 = s.split(`
494
+ `), r2 = Math.max(e.length, t2.length), f = [];
495
+ for (let n3 = 0; n3 < r2; n3++)
496
+ e[n3] !== t2[n3] && f.push(n3);
497
+ return {
498
+ lines: f,
499
+ numLinesBefore: e.length,
500
+ numLinesAfter: t2.length,
501
+ numLines: r2
502
+ };
521
503
  }
522
- function q(r) {
523
- return r === C;
504
+ function isCancel(e) {
505
+ return e === CANCEL_SYMBOL;
524
506
  }
525
- function w(r, t2) {
526
- const e = r;
527
- e.isTTY && e.setRawMode(t2);
507
+ function setRawMode(e, r2) {
508
+ const o = e;
509
+ o.isTTY && o.setRawMode(r2);
528
510
  }
529
- function R(r, t2, e, s = e) {
530
- const i = O(r ?? S);
531
- return wrapAnsi(t2, i - e.length, { hard: true, trim: false }).split(`
532
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
511
+ function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
512
+ const f = getColumns(e ?? stdout);
513
+ return wrapAnsi(r2, f - o.length, {
514
+ hard: true,
515
+ trim: false
516
+ }).split(`
517
+ `).map((c2, i2, m) => {
518
+ const d = t2 ? t2(c2, i2) : c2;
519
+ return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
520
+ }).join(`
533
521
  `);
534
522
  }
535
- var import_sisteransi, E, G, u, Y, C, O, A, p, nt;
523
+ function runValidation(e, a2) {
524
+ if ("~standard" in e) {
525
+ const n3 = e["~standard"].validate(a2);
526
+ return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
527
+ }
528
+ return e(a2);
529
+ }
530
+ var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, n$1;
536
531
  var init_dist3 = __esm({
537
- "node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs"() {
532
+ "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
538
533
  init_utils2();
539
534
  init_main();
540
535
  import_sisteransi = __toESM(require_src(), 1);
541
- E = ["up", "down", "left", "right", "space", "enter", "cancel"];
542
- G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
543
- u = { actions: new Set(E), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...G], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t2) => `There are only ${r} days in ${t2}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
544
- Y = globalThis.process.platform.startsWith("win");
545
- C = /* @__PURE__ */ Symbol("clack:cancel");
546
- O = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80;
547
- A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
548
- p = class {
536
+ a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
537
+ t = [
538
+ "January",
539
+ "February",
540
+ "March",
541
+ "April",
542
+ "May",
543
+ "June",
544
+ "July",
545
+ "August",
546
+ "September",
547
+ "October",
548
+ "November",
549
+ "December"
550
+ ];
551
+ settings = {
552
+ actions: new Set(a$1),
553
+ aliases: /* @__PURE__ */ new Map([
554
+ // vim support
555
+ ["k", "up"],
556
+ ["j", "down"],
557
+ ["h", "left"],
558
+ ["l", "right"],
559
+ ["", "cancel"],
560
+ // opinionated defaults!
561
+ ["escape", "cancel"]
562
+ ]),
563
+ messages: {
564
+ cancel: "Canceled",
565
+ error: "Something went wrong"
566
+ },
567
+ withGuide: true,
568
+ accessible: void 0,
569
+ date: {
570
+ monthNames: [...t],
571
+ messages: {
572
+ required: "Please enter a valid date",
573
+ invalidMonth: "There are only 12 months in a year",
574
+ invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
575
+ afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
576
+ beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
577
+ }
578
+ }
579
+ };
580
+ R = globalThis.process.platform.startsWith("win");
581
+ CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
582
+ getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
583
+ getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
584
+ y = class {
549
585
  input;
550
586
  output;
551
587
  _abortSignal;
@@ -560,46 +596,92 @@ var init_dist3 = __esm({
560
596
  error = "";
561
597
  value;
562
598
  userInput = "";
599
+ /**
600
+ * Whether accessible (static, screen-reader friendly) output is enabled for
601
+ * this prompt, resolved from the `accessible` option, the global setting,
602
+ * and the `ACCESSIBLE` env var.
603
+ */
604
+ get accessible() {
605
+ return isAccessible(this.opts.accessible);
606
+ }
563
607
  constructor(t2, e = true) {
564
- const { input: s = $, output: i = S, render: n, signal: o, ...a } = t2;
565
- this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = e, this._abortSignal = o, this.input = s, this.output = i;
608
+ const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
609
+ this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n3, this.input = i2, this.output = s;
566
610
  }
611
+ /**
612
+ * Unsubscribe all listeners
613
+ */
567
614
  unsubscribe() {
568
615
  this._subscribers.clear();
569
616
  }
617
+ /**
618
+ * Set a subscriber with opts
619
+ * @param event - The event name
620
+ */
570
621
  setSubscriber(t2, e) {
571
- const s = this._subscribers.get(t2) ?? [];
572
- s.push(e), this._subscribers.set(t2, s);
622
+ const i2 = this._subscribers.get(t2) ?? [];
623
+ i2.push(e), this._subscribers.set(t2, i2);
573
624
  }
625
+ /**
626
+ * Subscribe to an event
627
+ * @param event - The event name
628
+ * @param cb - The callback
629
+ */
574
630
  on(t2, e) {
575
631
  this.setSubscriber(t2, { cb: e });
576
632
  }
633
+ /**
634
+ * Subscribe to an event once
635
+ * @param event - The event name
636
+ * @param cb - The callback
637
+ */
577
638
  once(t2, e) {
578
639
  this.setSubscriber(t2, { cb: e, once: true });
579
640
  }
641
+ /**
642
+ * Emit an event with data
643
+ * @param event - The event name
644
+ * @param data - The data to pass to the callback
645
+ */
580
646
  emit(t2, ...e) {
581
- const s = this._subscribers.get(t2) ?? [], i = [];
582
- for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
583
- for (const n of i) n();
647
+ const i2 = this._subscribers.get(t2) ?? [], s = [];
648
+ for (const r2 of i2)
649
+ r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
650
+ for (const r2 of s)
651
+ r2();
584
652
  }
585
653
  prompt() {
586
654
  return new Promise((t2) => {
587
655
  if (this._abortSignal) {
588
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t2(C);
589
- this._abortSignal.addEventListener("abort", () => {
590
- this.state = "cancel", this.close();
591
- }, { once: true });
656
+ if (this._abortSignal.aborted)
657
+ return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
658
+ this._abortSignal.addEventListener(
659
+ "abort",
660
+ () => {
661
+ this.state = "cancel", this.close();
662
+ },
663
+ { once: true }
664
+ );
592
665
  }
593
- this.rl = P.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
594
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(this.value);
666
+ this.rl = l__default.createInterface({
667
+ input: this.input,
668
+ tabSize: 2,
669
+ prompt: "",
670
+ escapeCodeTimeout: 50,
671
+ terminal: true
672
+ }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
673
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
595
674
  }), this.once("cancel", () => {
596
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(C);
675
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
597
676
  });
598
677
  });
599
678
  }
600
679
  _isActionKey(t2, e) {
601
680
  return t2 === " ";
602
681
  }
682
+ _shouldSubmit(t2, e) {
683
+ return true;
684
+ }
603
685
  _setValue(t2) {
604
686
  this.value = t2, this.emit("value", this.value);
605
687
  }
@@ -609,19 +691,22 @@ var init_dist3 = __esm({
609
691
  _clearUserInput() {
610
692
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
611
693
  }
612
- onKeypress(t2, e) {
613
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2?.toLowerCase(), e), e?.name === "return") {
614
- if (this.opts.validate) {
615
- const s = this.opts.validate(this.value);
616
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
694
+ async onKeypress(t2, e) {
695
+ if (this.state !== "validating") {
696
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
697
+ if (this.opts.validate) {
698
+ const i2 = runValidation(this.opts.validate, this.value);
699
+ let s;
700
+ i2 instanceof Promise ? (this.state = "validating", this.render(), s = await i2) : s = i2, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
701
+ }
702
+ this.state !== "error" && (this.state = "submit");
617
703
  }
618
- this.state !== "error" && (this.state = "submit");
704
+ isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
619
705
  }
620
- V([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
621
706
  }
622
707
  close() {
623
708
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
624
- `), w(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
709
+ `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
625
710
  }
626
711
  restoreCursor() {
627
712
  const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
@@ -629,34 +714,39 @@ var init_dist3 = __esm({
629
714
  this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
630
715
  }
631
716
  render() {
632
- const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
717
+ const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
718
+ hard: true,
719
+ trim: false
720
+ });
633
721
  if (t2 !== this._prevFrame) {
634
- if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
722
+ if (this.state === "initial")
723
+ this.output.write(import_sisteransi.cursor.hide);
635
724
  else {
636
- const e = j(this._prevFrame, t2), s = A(this.output);
725
+ const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
637
726
  if (this.restoreCursor(), e) {
638
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
639
- let o = e.lines.find((a) => a >= i);
640
- if (o === void 0) {
727
+ const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
728
+ let n3 = e.lines.find((o) => o >= s);
729
+ if (n3 === void 0) {
641
730
  this._prevFrame = t2;
642
731
  return;
643
732
  }
644
733
  if (e.lines.length === 1) {
645
- this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
646
- const a = t2.split(`
734
+ this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
735
+ const o = t2.split(`
647
736
  `);
648
- this.output.write(a[o]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
737
+ this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
649
738
  return;
650
739
  } else if (e.lines.length > 1) {
651
- if (i < n) o = i;
740
+ if (s < r2)
741
+ n3 = s;
652
742
  else {
653
- const h = o - n;
654
- h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
743
+ const h2 = n3 - r2;
744
+ h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
655
745
  }
656
746
  this.output.write(import_sisteransi.erase.down());
657
- const a = t2.split(`
658
- `).slice(o);
659
- this.output.write(a.join(`
747
+ const f = t2.split(`
748
+ `).slice(n3);
749
+ this.output.write(f.join(`
660
750
  `)), this._prevFrame = t2;
661
751
  return;
662
752
  }
@@ -667,27 +757,28 @@ var init_dist3 = __esm({
667
757
  }
668
758
  }
669
759
  };
670
- nt = class extends p {
760
+ n$1 = class n extends y {
671
761
  options;
672
762
  cursor = 0;
673
763
  get _selectedValue() {
674
764
  return this.options[this.cursor];
675
765
  }
676
766
  changeValue() {
677
- this.value = this._selectedValue.value;
678
- }
679
- constructor(t2) {
680
- super(t2, false), this.options = t2.options;
681
- const e = this.options.findIndex(({ value: i }) => i === t2.initialValue), s = e === -1 ? 0 : e;
682
- this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
683
- switch (i) {
767
+ const e = this._selectedValue;
768
+ this.value = e === void 0 ? void 0 : e.value;
769
+ }
770
+ constructor(e) {
771
+ super(e, false), this.options = e.options;
772
+ const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
773
+ this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
774
+ switch (s) {
684
775
  case "left":
685
776
  case "up":
686
- this.cursor = d(this.cursor, -1, this.options);
777
+ this.cursor = findCursor(this.cursor, -1, this.options);
687
778
  break;
688
779
  case "down":
689
780
  case "right":
690
- this.cursor = d(this.cursor, 1, this.options);
781
+ this.cursor = findCursor(this.cursor, 1, this.options);
691
782
  break;
692
783
  }
693
784
  this.changeValue();
@@ -697,206 +788,323 @@ var init_dist3 = __esm({
697
788
  }
698
789
  });
699
790
 
700
- // node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
701
- import { styleText as t, stripVTControlCharacters as ne } from "node:util";
702
- import P2 from "node:process";
703
- import { existsSync as Xe, lstatSync as we, readdirSync as ze } from "node:fs";
704
- import { dirname as be, join as Qe } from "node:path";
705
- function Ze() {
706
- return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
791
+ // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
792
+ import { styleText as styleText2, stripVTControlCharacters } from "node:util";
793
+ import process$1 from "node:process";
794
+ import { existsSync, lstatSync, readdirSync } from "node:fs";
795
+ import { dirname, join } from "node:path";
796
+ function isUnicodeSupported() {
797
+ if (process$1.platform !== "win32") {
798
+ return process$1.env.TERM !== "linux";
799
+ }
800
+ return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
707
801
  }
708
- var import_sisteransi2, ee, w2, _e, oe, ue, F, le, d2, E2, Ie, Ee, z2, H2, te, U, J, xe, se, ce, Ge, $e, de, Oe, he, pe, me, ge, V2, ye, et2, Y2, O2, pt, ft, vt, wt, Ve, re, _t, je;
802
+ function formatInstructionFooter(o, e) {
803
+ const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
804
+ return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
805
+ }
806
+ var import_sisteransi2, unicode, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, MULTISELECT_INSTRUCTIONS, log, cancel, W$1, C, note, u2, SELECT_INSTRUCTIONS, c, select, i;
709
807
  var init_dist4 = __esm({
710
- "node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs"() {
808
+ "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
711
809
  init_utils2();
712
810
  init_dist3();
713
811
  init_dist3();
714
812
  init_main();
715
813
  init_dist2();
716
814
  import_sisteransi2 = __toESM(require_src(), 1);
717
- ee = Ze();
718
- w2 = (e, i) => ee ? e : i;
719
- _e = w2("\u25C6", "*");
720
- oe = w2("\u25A0", "x");
721
- ue = w2("\u25B2", "x");
722
- F = w2("\u25C7", "o");
723
- le = w2("\u250C", "T");
724
- d2 = w2("\u2502", "|");
725
- E2 = w2("\u2514", "\u2014");
726
- Ie = w2("\u2510", "T");
727
- Ee = w2("\u2518", "\u2014");
728
- z2 = w2("\u25CF", ">");
729
- H2 = w2("\u25CB", " ");
730
- te = w2("\u25FB", "[\u2022]");
731
- U = w2("\u25FC", "[+]");
732
- J = w2("\u25FB", "[ ]");
733
- xe = w2("\u25AA", "\u2022");
734
- se = w2("\u2500", "-");
735
- ce = w2("\u256E", "+");
736
- Ge = w2("\u251C", "+");
737
- $e = w2("\u256F", "+");
738
- de = w2("\u2570", "+");
739
- Oe = w2("\u256D", "+");
740
- he = w2("\u25CF", "\u2022");
741
- pe = w2("\u25C6", "*");
742
- me = w2("\u25B2", "!");
743
- ge = w2("\u25A0", "x");
744
- V2 = (e) => {
745
- switch (e) {
815
+ unicode = isUnicodeSupported();
816
+ unicodeOr = (o, e) => unicode ? o : e;
817
+ S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
818
+ S_STEP_CANCEL = unicodeOr("\u25A0", "x");
819
+ S_STEP_ERROR = unicodeOr("\u25B2", "x");
820
+ S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
821
+ S_BAR_START = unicodeOr("\u250C", "T");
822
+ S_BAR = unicodeOr("\u2502", "|");
823
+ S_BAR_END = unicodeOr("\u2514", "\u2014");
824
+ S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
825
+ S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
826
+ S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
827
+ S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
828
+ S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
829
+ S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
830
+ S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
831
+ S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
832
+ S_BAR_H = unicodeOr("\u2500", "-");
833
+ S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
834
+ S_CONNECT_LEFT = unicodeOr("\u251C", "+");
835
+ S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
836
+ S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
837
+ S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
838
+ S_INFO = unicodeOr("\u25CF", "\u2022");
839
+ S_SUCCESS = unicodeOr("\u25C6", "*");
840
+ S_WARN = unicodeOr("\u25B2", "!");
841
+ S_ERROR = unicodeOr("\u25A0", "x");
842
+ symbol = (o) => {
843
+ switch (o) {
746
844
  case "initial":
747
845
  case "active":
748
- return t("cyan", _e);
846
+ return styleText2("cyan", S_STEP_ACTIVE);
749
847
  case "cancel":
750
- return t("red", oe);
848
+ return styleText2("red", S_STEP_CANCEL);
751
849
  case "error":
752
- return t("yellow", ue);
850
+ return styleText2("yellow", S_STEP_ERROR);
753
851
  case "submit":
754
- return t("green", F);
852
+ return styleText2("green", S_STEP_SUBMIT);
853
+ case "validating":
854
+ return styleText2("dim", S_STEP_ACTIVE);
755
855
  }
756
856
  };
757
- ye = (e) => {
758
- switch (e) {
857
+ symbolBar = (o) => {
858
+ switch (o) {
759
859
  case "initial":
760
860
  case "active":
761
- return t("cyan", d2);
861
+ return styleText2("cyan", S_BAR);
762
862
  case "cancel":
763
- return t("red", d2);
863
+ return styleText2("red", S_BAR);
764
864
  case "error":
765
- return t("yellow", d2);
865
+ return styleText2("yellow", S_BAR);
766
866
  case "submit":
767
- return t("green", d2);
768
- }
769
- };
770
- et2 = (e, i, s, r, u2) => {
771
- let n = i, o = 0;
772
- for (let c2 = s; c2 < r; c2++) {
773
- const a = e[c2];
774
- if (n = n - a.length, o++, n <= u2) break;
775
- }
776
- return { lineCount: n, removals: o };
777
- };
778
- Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
779
- const c2 = O(r) - n, a = A(r), l = t("dim", "..."), $2 = Math.max(a - o, 0), y2 = Math.max(Math.min(u2, $2), 5);
780
- let p2 = 0;
781
- e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
782
- let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
783
- const S2 = Math.min(p2 + y2, i.length), h = [];
867
+ return styleText2("green", S_BAR);
868
+ }
869
+ };
870
+ I = (l, e, w, p, b, C2 = false) => {
871
+ let r2 = e, O = 0;
872
+ if (C2)
873
+ for (let i2 = p - 1; i2 >= w; i2--) {
874
+ const m = l[i2];
875
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
876
+ }
877
+ else
878
+ for (let i2 = w; i2 < p; i2++) {
879
+ const m = l[i2];
880
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
881
+ }
882
+ return { lineCount: r2, removals: O };
883
+ };
884
+ limitOptions = ({
885
+ cursor: l,
886
+ options: e,
887
+ style: w,
888
+ output: p = process.stdout,
889
+ maxItems: b = Number.POSITIVE_INFINITY,
890
+ columnPadding: C2 = 0,
891
+ rowPadding: r2 = 4
892
+ }) => {
893
+ const i2 = getColumns(p) - C2, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
784
894
  let f = 0;
785
- m && f++, g && f++;
786
- const v = p2 + (m ? 1 : 0), T = S2 - (g ? 1 : 0);
787
- for (let b = v; b < T; b++) {
788
- const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
895
+ l >= a2 - 3 && (f = Math.max(
896
+ Math.min(l - a2 + 3, e.length - a2),
897
+ 0
898
+ ));
899
+ let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
900
+ const W = Math.min(
901
+ f + a2,
902
+ e.length
903
+ ), s = [];
904
+ let g = 0;
905
+ d && g++, c2 && g++;
906
+ const T = f + (d ? 1 : 0), y2 = W - (c2 ? 1 : 0);
907
+ for (let t2 = T; t2 < y2; t2++) {
908
+ const n3 = e[t2], o = n3 ? w(n3, t2 === l) : "", h2 = wrapAnsi(o, i2, {
909
+ hard: true,
910
+ trim: false
911
+ }).split(`
789
912
  `);
790
- h.push(x), f += x.length;
791
- }
792
- if (f > $2) {
793
- let b = 0, x = 0, G2 = f;
794
- const M2 = e - v, R2 = (j2, D2) => et2(h, G2, j2, D2, $2);
795
- m ? ({ lineCount: G2, removals: b } = R2(0, M2), G2 > $2 && ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length))) : ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length), G2 > $2 && ({ lineCount: G2, removals: b } = R2(0, M2))), b > 0 && (m = true, h.splice(0, b)), x > 0 && (g = true, h.splice(h.length - x, x));
796
- }
797
- const C2 = [];
798
- m && C2.push(l);
799
- for (const b of h) for (const x of b) C2.push(x);
800
- return g && C2.push(l), C2;
801
- };
802
- O2 = { message: (e = [], { symbol: i = t("gray", d2), secondarySymbol: s = t("gray", d2), output: r = process.stdout, spacing: u2 = 1, withGuide: n } = {}) => {
803
- const o = [], c2 = n ?? u.withGuide, a = c2 ? s : "", l = c2 ? `${i} ` : "", $2 = c2 ? `${s} ` : "";
804
- for (let p2 = 0; p2 < u2; p2++) o.push(a);
805
- const y2 = Array.isArray(e) ? e : e.split(`
913
+ s.push(h2), g += h2.length;
914
+ }
915
+ if (g > v) {
916
+ let t2 = 0, n3 = 0, o = g;
917
+ const h2 = l - T;
918
+ let u3 = v;
919
+ const L = () => I(s, o, 0, h2, u3), E = () => I(
920
+ s,
921
+ o,
922
+ h2 + 1,
923
+ s.length,
924
+ u3,
925
+ true
926
+ );
927
+ d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E())) : (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c2 = true, s.splice(s.length - n3, n3));
928
+ }
929
+ const x = [];
930
+ d && x.push(M);
931
+ for (const t2 of s)
932
+ for (const n3 of t2)
933
+ x.push(n3);
934
+ return c2 && x.push(M), x;
935
+ };
936
+ MULTISELECT_INSTRUCTIONS = [
937
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
938
+ `${styleText2("dim", "Space:")} select`,
939
+ `${styleText2("dim", "Enter:")} confirm`
940
+ ];
941
+ log = {
942
+ message: (s = [], {
943
+ symbol: e = styleText2("gray", S_BAR),
944
+ secondarySymbol: r2 = styleText2("gray", S_BAR),
945
+ output: m = process.stdout,
946
+ spacing: l = 1,
947
+ withGuide: c2
948
+ } = {}) => {
949
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
950
+ for (let i2 = 0; i2 < l; i2++)
951
+ t2.push(f);
952
+ const g = Array.isArray(s) ? s : s.split(`
806
953
  `);
807
- if (y2.length > 0) {
808
- const [p2, ...m] = y2;
809
- p2.length > 0 ? o.push(`${l}${p2}`) : o.push(c2 ? i : "");
810
- for (const g of m) g.length > 0 ? o.push(`${$2}${g}`) : o.push(c2 ? s : "");
811
- }
812
- r.write(`${o.join(`
954
+ if (g.length > 0) {
955
+ const [i2, ...y2] = g;
956
+ i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
957
+ for (const p of y2)
958
+ p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
959
+ }
960
+ m.write(`${t2.join(`
813
961
  `)}
814
962
  `);
815
- }, info: (e, i) => {
816
- O2.message(e, { ...i, symbol: t("blue", he) });
817
- }, success: (e, i) => {
818
- O2.message(e, { ...i, symbol: t("green", pe) });
819
- }, step: (e, i) => {
820
- O2.message(e, { ...i, symbol: t("green", F) });
821
- }, warn: (e, i) => {
822
- O2.message(e, { ...i, symbol: t("yellow", me) });
823
- }, warning: (e, i) => {
824
- O2.warn(e, i);
825
- }, error: (e, i) => {
826
- O2.message(e, { ...i, symbol: t("red", ge) });
827
- } };
828
- pt = (e = "", i) => {
829
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", E2)} ` : "";
830
- s.write(`${r}${t("red", e)}
963
+ },
964
+ info: (s, e) => {
965
+ log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
966
+ },
967
+ success: (s, e) => {
968
+ log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
969
+ },
970
+ step: (s, e) => {
971
+ log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
972
+ },
973
+ warn: (s, e) => {
974
+ log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
975
+ },
976
+ /** alias for `log.warn()`. */
977
+ warning: (s, e) => {
978
+ log.warn(s, e);
979
+ },
980
+ error: (s, e) => {
981
+ log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
982
+ }
983
+ };
984
+ cancel = (o = "", t2) => {
985
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
986
+ i2.write(`${e}${styleText2("red", o)}
831
987
 
832
988
  `);
833
989
  };
834
- ft = (e) => t("dim", e);
835
- vt = (e, i, s) => {
836
- const r = { hard: true, trim: false }, u2 = wrapAnsi(e, i, r).split(`
837
- `), n = u2.reduce((a, l) => Math.max(dist_default2(l), a), 0), o = u2.map(s).reduce((a, l) => Math.max(dist_default2(l), a), 0), c2 = i - (o - n);
838
- return wrapAnsi(e, c2, r);
839
- };
840
- wt = (e = "", i = "", s) => {
841
- const r = s?.output ?? P2.stdout, u2 = s?.withGuide ?? u.withGuide, n = s?.format ?? ft, o = ["", ...vt(e, O(r) - 6, n).split(`
842
- `).map(n), ""], c2 = dist_default2(i), a = Math.max(o.reduce((p2, m) => {
843
- const g = dist_default2(m);
844
- return g > p2 ? g : p2;
845
- }, 0), c2) + 2, l = o.map((p2) => `${t("gray", d2)} ${p2}${" ".repeat(a - dist_default2(p2))}${t("gray", d2)}`).join(`
846
- `), $2 = u2 ? `${t("gray", d2)}
847
- ` : "", y2 = u2 ? Ge : de;
848
- r.write(`${$2}${t("green", F)} ${t("reset", i)} ${t("gray", se.repeat(Math.max(a - c2 - 1, 1)) + ce)}
849
- ${l}
850
- ${t("gray", y2 + se.repeat(a + 2) + $e)}
851
- `);
990
+ W$1 = (o) => o;
991
+ C = (o, e, s) => {
992
+ const a2 = {
993
+ hard: true,
994
+ trim: false
995
+ }, i2 = wrapAnsi(o, e, a2).split(`
996
+ `), c2 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u3 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g = e - (u3 - c2);
997
+ return wrapAnsi(o, g, a2);
998
+ };
999
+ note = (o = "", e = "", s) => {
1000
+ const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c2 = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c2).split(`
1001
+ `).map(c2), ""], n3 = dist_default2(e), t2 = Math.max(
1002
+ g.reduce((m, F) => {
1003
+ const O = dist_default2(F);
1004
+ return O > m ? O : m;
1005
+ }, 0),
1006
+ n3
1007
+ ) + 2, h2 = g.map(
1008
+ (m) => `${styleText2("gray", S_BAR)} ${m}${" ".repeat(t2 - dist_default2(m))}${styleText2("gray", S_BAR)}`
1009
+ ).join(`
1010
+ `), T = i2 ? `${styleText2("gray", S_BAR)}
1011
+ ` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
1012
+ a2.write(
1013
+ `${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
1014
+ "gray",
1015
+ S_BAR_H.repeat(Math.max(t2 - n3 - 1, 1)) + S_CORNER_TOP_RIGHT
1016
+ )}
1017
+ ${h2}
1018
+ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
1019
+ `
1020
+ );
852
1021
  };
853
- Ve = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
854
- re = (e, i) => e.includes(`
855
- `) ? e.split(`
856
- `).map((s) => i(s)).join(`
857
- `) : i(e);
858
- _t = (e) => {
859
- const i = (s, r) => {
860
- const u2 = s.label ?? String(s.value);
861
- switch (r) {
1022
+ u2 = {
1023
+ light: unicodeOr("\u2500", "-"),
1024
+ heavy: unicodeOr("\u2501", "="),
1025
+ block: unicodeOr("\u2588", "#")
1026
+ };
1027
+ SELECT_INSTRUCTIONS = [
1028
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
1029
+ `${styleText2("dim", "Enter:")} confirm`
1030
+ ];
1031
+ c = (t2, o) => t2.includes(`
1032
+ `) ? t2.split(`
1033
+ `).map((d) => o(d)).join(`
1034
+ `) : o(t2);
1035
+ select = (t2) => {
1036
+ const o = (n3, m) => {
1037
+ if (n3 === void 0)
1038
+ return "";
1039
+ const s = n3.label ?? String(n3.value);
1040
+ switch (m) {
862
1041
  case "disabled":
863
- return `${t("gray", H2)} ${re(u2, (n) => t("gray", n))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1042
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
864
1043
  case "selected":
865
- return `${re(u2, (n) => t("dim", n))}`;
1044
+ return `${c(s, (i2) => styleText2("dim", i2))}`;
866
1045
  case "active":
867
- return `${t("green", z2)} ${u2}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
1046
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
868
1047
  case "cancelled":
869
- return `${re(u2, (n) => t(["strikethrough", "dim"], n))}`;
1048
+ return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
870
1049
  default:
871
- return `${t("dim", H2)} ${re(u2, (n) => t("dim", n))}`;
872
- }
873
- };
874
- return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
875
- const s = e.withGuide ?? u.withGuide, r = `${V2(this.state)} `, u2 = `${ye(this.state)} `, n = R(e.output, e.message, u2, r), o = `${s ? `${t("gray", d2)}
876
- ` : ""}${n}
1050
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
1051
+ }
1052
+ }, d = t2.showInstructions ?? true;
1053
+ return new n$1({
1054
+ options: t2.options,
1055
+ signal: t2.signal,
1056
+ input: t2.input,
1057
+ output: t2.output,
1058
+ initialValue: t2.initialValue,
1059
+ render() {
1060
+ const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
1061
+ t2.output,
1062
+ t2.message,
1063
+ s,
1064
+ m
1065
+ ), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
1066
+ ` : ""}${i2}
877
1067
  `;
878
- switch (this.state) {
879
- case "submit": {
880
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "selected"), c2);
881
- return `${o}${a}`;
882
- }
883
- case "cancel": {
884
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
885
- return `${o}${a}${s ? `
886
- ${t("gray", d2)}` : ""}`;
887
- }
888
- default: {
889
- const c2 = s ? `${t("cyan", d2)} ` : "", a = s ? t("cyan", E2) : "", l = o.split(`
890
- `).length, $2 = s ? 2 : 1;
891
- return `${o}${c2}${Y2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: c2.length, rowPadding: l + $2, style: (y2, p2) => i(y2, y2.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
892
- ${c2}`)}
893
- ${a}
1068
+ switch (this.state) {
1069
+ case "submit": {
1070
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1071
+ t2.output,
1072
+ o(this.options[this.cursor], "selected"),
1073
+ r2
1074
+ );
1075
+ return `${u3}${a2}`;
1076
+ }
1077
+ case "cancel": {
1078
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1079
+ t2.output,
1080
+ o(this.options[this.cursor], "cancelled"),
1081
+ r2
1082
+ );
1083
+ return `${u3}${a2}${n3 ? `
1084
+ ${styleText2("gray", S_BAR)}` : ""}`;
1085
+ }
1086
+ default: {
1087
+ const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1088
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1089
+ `), b = p.length + 1;
1090
+ return `${u3}${r2}${limitOptions({
1091
+ output: t2.output,
1092
+ cursor: this.cursor,
1093
+ options: this.options,
1094
+ maxItems: t2.maxItems,
1095
+ columnPadding: r2.length,
1096
+ rowPadding: a2 + b,
1097
+ style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
1098
+ }).join(`
1099
+ ${r2}`)}
1100
+ ${f}
894
1101
  `;
1102
+ }
895
1103
  }
896
1104
  }
897
- } }).prompt();
1105
+ }).prompt();
898
1106
  };
899
- je = `${t("gray", d2)} `;
1107
+ i = `${styleText2("gray", S_BAR)} `;
900
1108
  }
901
1109
  });
902
1110
 
@@ -909,9 +1117,9 @@ function supportsColor() {
909
1117
  }
910
1118
  return process.stdout.isTTY === true;
911
1119
  }
912
- function colorize(text, color) {
913
- if (!supportsColor()) return text;
914
- return `${color}${text}${colors.reset}`;
1120
+ function colorize(text2, color) {
1121
+ if (!supportsColor()) return text2;
1122
+ return `${color}${text2}${colors.reset}`;
915
1123
  }
916
1124
  function stringify(value) {
917
1125
  if (typeof value === "string") return value;
@@ -941,7 +1149,7 @@ function stringify(value) {
941
1149
  function formatMessage(...args) {
942
1150
  return args.map(stringify).join(" ");
943
1151
  }
944
- var colors, currentLogLevel, log, error, warn, info, success;
1152
+ var colors, currentLogLevel, log2, error, warn, info, success;
945
1153
  var init_cli_output = __esm({
946
1154
  "packages/tooling/src/utils/cli-output.ts"() {
947
1155
  "use strict";
@@ -974,7 +1182,7 @@ var init_cli_output = __esm({
974
1182
  currentLogLevel = envLevel;
975
1183
  }
976
1184
  }
977
- log = {
1185
+ log2 = {
978
1186
  /**
979
1187
  * Logs an error message (always shows unless Quiet level)
980
1188
  * Uses clack's log.error + explicit red color
@@ -982,7 +1190,7 @@ var init_cli_output = __esm({
982
1190
  error(...args) {
983
1191
  if (currentLogLevel < 0 /* Quiet */) return;
984
1192
  const message = formatMessage(...args);
985
- O2.error(colorize(message, colors.brightRed));
1193
+ log.error(colorize(message, colors.brightRed));
986
1194
  },
987
1195
  /**
988
1196
  * Logs a warning message (shows at Normal level and above)
@@ -991,7 +1199,7 @@ var init_cli_output = __esm({
991
1199
  warn(...args) {
992
1200
  if (currentLogLevel < 1 /* Normal */) return;
993
1201
  const message = formatMessage(...args);
994
- O2.warn(colorize(message, colors.brightYellow));
1202
+ log.warn(colorize(message, colors.brightYellow));
995
1203
  },
996
1204
  /**
997
1205
  * Logs an info message (shows at Normal level and above)
@@ -1000,7 +1208,7 @@ var init_cli_output = __esm({
1000
1208
  info(...args) {
1001
1209
  if (currentLogLevel < 1 /* Normal */) return;
1002
1210
  const message = formatMessage(...args);
1003
- O2.info(colorize(message, colors.brightCyan));
1211
+ log.info(colorize(message, colors.brightCyan));
1004
1212
  },
1005
1213
  /**
1006
1214
  * Logs a success message (shows at Normal level and above)
@@ -1009,7 +1217,7 @@ var init_cli_output = __esm({
1009
1217
  success(...args) {
1010
1218
  if (currentLogLevel < 1 /* Normal */) return;
1011
1219
  const message = formatMessage(...args);
1012
- O2.success(colorize(message, colors.brightGreen));
1220
+ log.success(colorize(message, colors.brightGreen));
1013
1221
  },
1014
1222
  /**
1015
1223
  * Logs a debug message (only shows at Verbose level and above)
@@ -1018,7 +1226,7 @@ var init_cli_output = __esm({
1018
1226
  debug(...args) {
1019
1227
  if (currentLogLevel < 2 /* Verbose */) return;
1020
1228
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1021
- O2.message(
1229
+ log.message(
1022
1230
  colorize(
1023
1231
  `[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
1024
1232
  colors.gray
@@ -1032,7 +1240,7 @@ var init_cli_output = __esm({
1032
1240
  trace(...args) {
1033
1241
  if (currentLogLevel < 3 /* Debug */) return;
1034
1242
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1035
- O2.message(
1243
+ log.message(
1036
1244
  colorize(
1037
1245
  `[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
1038
1246
  colors.gray
@@ -1040,10 +1248,10 @@ var init_cli_output = __esm({
1040
1248
  );
1041
1249
  }
1042
1250
  };
1043
- error = log.error.bind(log);
1044
- warn = log.warn.bind(log);
1045
- info = log.info.bind(log);
1046
- success = log.success.bind(log);
1251
+ error = log2.error.bind(log2);
1252
+ warn = log2.warn.bind(log2);
1253
+ info = log2.info.bind(log2);
1254
+ success = log2.success.bind(log2);
1047
1255
  }
1048
1256
  });
1049
1257
 
@@ -1403,9 +1611,9 @@ var require_is_glob = __commonJS({
1403
1611
  index += 2;
1404
1612
  var close = chars[open];
1405
1613
  if (close) {
1406
- var n = str.indexOf(close, index);
1407
- if (n !== -1) {
1408
- index = n + 1;
1614
+ var n3 = str.indexOf(close, index);
1615
+ if (n3 !== -1) {
1616
+ index = n3 + 1;
1409
1617
  }
1410
1618
  }
1411
1619
  if (str[index] === "!") {
@@ -1431,9 +1639,9 @@ var require_is_glob = __commonJS({
1431
1639
  index += 2;
1432
1640
  var close = chars[open];
1433
1641
  if (close) {
1434
- var n = str.indexOf(close, index);
1435
- if (n !== -1) {
1436
- index = n + 1;
1642
+ var n3 = str.indexOf(close, index);
1643
+ if (n3 !== -1) {
1644
+ index = n3 + 1;
1437
1645
  }
1438
1646
  }
1439
1647
  if (str[index] === "!") {
@@ -1511,8 +1719,8 @@ var require_utils = __commonJS({
1511
1719
  if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
1512
1720
  return (Number(max) - Number(min)) / Number(step) >= limit;
1513
1721
  };
1514
- exports.escapeNode = (block, n = 0, type) => {
1515
- const node = block.nodes[n];
1722
+ exports.escapeNode = (block2, n3 = 0, type) => {
1723
+ const node = block2.nodes[n3];
1516
1724
  if (!node) return;
1517
1725
  if (type && node.type === type || node.type === "open" || node.type === "close") {
1518
1726
  if (node.escaped !== true) {
@@ -1529,15 +1737,15 @@ var require_utils = __commonJS({
1529
1737
  }
1530
1738
  return false;
1531
1739
  };
1532
- exports.isInvalidBrace = (block) => {
1533
- if (block.type !== "brace") return false;
1534
- if (block.invalid === true || block.dollar) return true;
1535
- if (block.commas >> 0 + block.ranges >> 0 === 0) {
1536
- block.invalid = true;
1740
+ exports.isInvalidBrace = (block2) => {
1741
+ if (block2.type !== "brace") return false;
1742
+ if (block2.invalid === true || block2.dollar) return true;
1743
+ if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
1744
+ block2.invalid = true;
1537
1745
  return true;
1538
1746
  }
1539
- if (block.open !== true || block.close !== true) {
1540
- block.invalid = true;
1747
+ if (block2.open !== true || block2.close !== true) {
1748
+ block2.invalid = true;
1541
1749
  return true;
1542
1750
  }
1543
1751
  return false;
@@ -1556,8 +1764,8 @@ var require_utils = __commonJS({
1556
1764
  exports.flatten = (...args) => {
1557
1765
  const result = [];
1558
1766
  const flat = (arr) => {
1559
- for (let i = 0; i < arr.length; i++) {
1560
- const ele = arr[i];
1767
+ for (let i2 = 0; i2 < arr.length; i2++) {
1768
+ const ele = arr[i2];
1561
1769
  if (Array.isArray(ele)) {
1562
1770
  flat(ele);
1563
1771
  continue;
@@ -1651,9 +1859,9 @@ var require_to_regex_range = __commonJS({
1651
1859
  if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
1652
1860
  return toRegexRange.cache[cacheKey].result;
1653
1861
  }
1654
- let a = Math.min(min, max);
1862
+ let a2 = Math.min(min, max);
1655
1863
  let b = Math.max(min, max);
1656
- if (Math.abs(a - b) === 1) {
1864
+ if (Math.abs(a2 - b) === 1) {
1657
1865
  let result = min + "|" + max;
1658
1866
  if (opts.capture) {
1659
1867
  return `(${result})`;
@@ -1664,20 +1872,20 @@ var require_to_regex_range = __commonJS({
1664
1872
  return `(?:${result})`;
1665
1873
  }
1666
1874
  let isPadded = hasPadding(min) || hasPadding(max);
1667
- let state = { min, max, a, b };
1875
+ let state = { min, max, a: a2, b };
1668
1876
  let positives = [];
1669
1877
  let negatives = [];
1670
1878
  if (isPadded) {
1671
1879
  state.isPadded = isPadded;
1672
1880
  state.maxLen = String(state.max).length;
1673
1881
  }
1674
- if (a < 0) {
1882
+ if (a2 < 0) {
1675
1883
  let newMin = b < 0 ? Math.abs(b) : 1;
1676
- negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
1677
- a = state.a = 0;
1884
+ negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
1885
+ a2 = state.a = 0;
1678
1886
  }
1679
1887
  if (b >= 0) {
1680
- positives = splitToPatterns(a, b, state, opts);
1888
+ positives = splitToPatterns(a2, b, state, opts);
1681
1889
  }
1682
1890
  state.negatives = negatives;
1683
1891
  state.positives = positives;
@@ -1725,8 +1933,8 @@ var require_to_regex_range = __commonJS({
1725
1933
  let digits = zipped.length;
1726
1934
  let pattern = "";
1727
1935
  let count = 0;
1728
- for (let i = 0; i < digits; i++) {
1729
- let [startDigit, stopDigit] = zipped[i];
1936
+ for (let i2 = 0; i2 < digits; i2++) {
1937
+ let [startDigit, stopDigit] = zipped[i2];
1730
1938
  if (startDigit === stopDigit) {
1731
1939
  pattern += startDigit;
1732
1940
  } else if (startDigit !== "0" || stopDigit !== "9") {
@@ -1745,8 +1953,8 @@ var require_to_regex_range = __commonJS({
1745
1953
  let tokens = [];
1746
1954
  let start = min;
1747
1955
  let prev;
1748
- for (let i = 0; i < ranges.length; i++) {
1749
- let max2 = ranges[i];
1956
+ for (let i2 = 0; i2 < ranges.length; i2++) {
1957
+ let max2 = ranges[i2];
1750
1958
  let obj = rangeToPattern(String(start), String(max2), options);
1751
1959
  let zeros = "";
1752
1960
  if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
@@ -1781,13 +1989,13 @@ var require_to_regex_range = __commonJS({
1781
1989
  }
1782
1990
  return result;
1783
1991
  }
1784
- function zip(a, b) {
1992
+ function zip(a2, b) {
1785
1993
  let arr = [];
1786
- for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
1994
+ for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
1787
1995
  return arr;
1788
1996
  }
1789
- function compare(a, b) {
1790
- return a > b ? 1 : b > a ? -1 : 0;
1997
+ function compare(a2, b) {
1998
+ return a2 > b ? 1 : b > a2 ? -1 : 0;
1791
1999
  }
1792
2000
  function contains(arr, key, val) {
1793
2001
  return arr.some((ele) => ele[key] === val);
@@ -1805,8 +2013,8 @@ var require_to_regex_range = __commonJS({
1805
2013
  }
1806
2014
  return "";
1807
2015
  }
1808
- function toCharacterClass(a, b, options) {
1809
- return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
2016
+ function toCharacterClass(a2, b, options) {
2017
+ return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
1810
2018
  }
1811
2019
  function hasPadding(str) {
1812
2020
  return /^-?(0+)\d/.test(str);
@@ -1885,8 +2093,8 @@ var require_fill_range = __commonJS({
1885
2093
  return negative ? "-" + input : input;
1886
2094
  };
1887
2095
  var toSequence = (parts, options, maxLen) => {
1888
- parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
1889
- parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
2096
+ parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
2097
+ parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
1890
2098
  let prefix = options.capture ? "" : "?:";
1891
2099
  let positives = "";
1892
2100
  let negatives = "";
@@ -1907,12 +2115,12 @@ var require_fill_range = __commonJS({
1907
2115
  }
1908
2116
  return result;
1909
2117
  };
1910
- var toRange = (a, b, isNumbers, options) => {
2118
+ var toRange = (a2, b, isNumbers, options) => {
1911
2119
  if (isNumbers) {
1912
- return toRegexRange(a, b, { wrap: false, ...options });
2120
+ return toRegexRange(a2, b, { wrap: false, ...options });
1913
2121
  }
1914
- let start = String.fromCharCode(a);
1915
- if (a === b) return start;
2122
+ let start = String.fromCharCode(a2);
2123
+ if (a2 === b) return start;
1916
2124
  let stop = String.fromCharCode(b);
1917
2125
  return `[${start}-${stop}]`;
1918
2126
  };
@@ -1938,15 +2146,15 @@ var require_fill_range = __commonJS({
1938
2146
  return [];
1939
2147
  };
1940
2148
  var fillNumbers = (start, end, step = 1, options = {}) => {
1941
- let a = Number(start);
2149
+ let a2 = Number(start);
1942
2150
  let b = Number(end);
1943
- if (!Number.isInteger(a) || !Number.isInteger(b)) {
2151
+ if (!Number.isInteger(a2) || !Number.isInteger(b)) {
1944
2152
  if (options.strictRanges === true) throw rangeError([start, end]);
1945
2153
  return [];
1946
2154
  }
1947
- if (a === 0) a = 0;
2155
+ if (a2 === 0) a2 = 0;
1948
2156
  if (b === 0) b = 0;
1949
- let descending = a > b;
2157
+ let descending = a2 > b;
1950
2158
  let startString = String(start);
1951
2159
  let endString = String(end);
1952
2160
  let stepString = String(step);
@@ -1962,13 +2170,13 @@ var require_fill_range = __commonJS({
1962
2170
  let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
1963
2171
  let range = [];
1964
2172
  let index = 0;
1965
- while (descending ? a >= b : a <= b) {
2173
+ while (descending ? a2 >= b : a2 <= b) {
1966
2174
  if (options.toRegex === true && step > 1) {
1967
- push(a);
2175
+ push(a2);
1968
2176
  } else {
1969
- range.push(pad(format(a, index), maxLen, toNumber));
2177
+ range.push(pad(format(a2, index), maxLen, toNumber));
1970
2178
  }
1971
- a = descending ? a - step : a + step;
2179
+ a2 = descending ? a2 - step : a2 + step;
1972
2180
  index++;
1973
2181
  }
1974
2182
  if (options.toRegex === true) {
@@ -1981,19 +2189,19 @@ var require_fill_range = __commonJS({
1981
2189
  return invalidRange(start, end, options);
1982
2190
  }
1983
2191
  let format = options.transform || ((val) => String.fromCharCode(val));
1984
- let a = `${start}`.charCodeAt(0);
2192
+ let a2 = `${start}`.charCodeAt(0);
1985
2193
  let b = `${end}`.charCodeAt(0);
1986
- let descending = a > b;
1987
- let min = Math.min(a, b);
1988
- let max = Math.max(a, b);
2194
+ let descending = a2 > b;
2195
+ let min = Math.min(a2, b);
2196
+ let max = Math.max(a2, b);
1989
2197
  if (options.toRegex && step === 1) {
1990
2198
  return toRange(min, max, false, options);
1991
2199
  }
1992
2200
  let range = [];
1993
2201
  let index = 0;
1994
- while (descending ? a >= b : a <= b) {
1995
- range.push(format(a, index));
1996
- a = descending ? a - step : a + step;
2202
+ while (descending ? a2 >= b : a2 <= b) {
2203
+ range.push(format(a2, index));
2204
+ a2 = descending ? a2 - step : a2 + step;
1997
2205
  index++;
1998
2206
  }
1999
2207
  if (options.toRegex === true) {
@@ -2116,18 +2324,18 @@ var require_expand = __commonJS({
2116
2324
  const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
2117
2325
  const walk = (node, parent = {}) => {
2118
2326
  node.queue = [];
2119
- let p2 = parent;
2120
- let q2 = parent.queue;
2121
- while (p2.type !== "brace" && p2.type !== "root" && p2.parent) {
2122
- p2 = p2.parent;
2123
- q2 = p2.queue;
2327
+ let p = parent;
2328
+ let q = parent.queue;
2329
+ while (p.type !== "brace" && p.type !== "root" && p.parent) {
2330
+ p = p.parent;
2331
+ q = p.queue;
2124
2332
  }
2125
2333
  if (node.invalid || node.dollar) {
2126
- q2.push(append(q2.pop(), stringify2(node, options)));
2334
+ q.push(append(q.pop(), stringify2(node, options)));
2127
2335
  return;
2128
2336
  }
2129
2337
  if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
2130
- q2.push(append(q2.pop(), ["{}"]));
2338
+ q.push(append(q.pop(), ["{}"]));
2131
2339
  return;
2132
2340
  }
2133
2341
  if (node.nodes && node.ranges > 0) {
@@ -2139,26 +2347,26 @@ var require_expand = __commonJS({
2139
2347
  if (range.length === 0) {
2140
2348
  range = stringify2(node, options);
2141
2349
  }
2142
- q2.push(append(q2.pop(), range));
2350
+ q.push(append(q.pop(), range));
2143
2351
  node.nodes = [];
2144
2352
  return;
2145
2353
  }
2146
2354
  const enclose = utils.encloseBrace(node);
2147
2355
  let queue = node.queue;
2148
- let block = node;
2149
- while (block.type !== "brace" && block.type !== "root" && block.parent) {
2150
- block = block.parent;
2151
- queue = block.queue;
2356
+ let block2 = node;
2357
+ while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
2358
+ block2 = block2.parent;
2359
+ queue = block2.queue;
2152
2360
  }
2153
- for (let i = 0; i < node.nodes.length; i++) {
2154
- const child = node.nodes[i];
2361
+ for (let i2 = 0; i2 < node.nodes.length; i2++) {
2362
+ const child = node.nodes[i2];
2155
2363
  if (child.type === "comma" && node.type === "brace") {
2156
- if (i === 1) queue.push("");
2364
+ if (i2 === 1) queue.push("");
2157
2365
  queue.push("");
2158
2366
  continue;
2159
2367
  }
2160
2368
  if (child.type === "close") {
2161
- q2.push(append(q2.pop(), queue, enclose));
2369
+ q.push(append(q.pop(), queue, enclose));
2162
2370
  continue;
2163
2371
  }
2164
2372
  if (child.value && child.type !== "open") {
@@ -2325,7 +2533,7 @@ var require_parse = __commonJS({
2325
2533
  }
2326
2534
  const ast = { type: "root", input, nodes: [] };
2327
2535
  const stack = [ast];
2328
- let block = ast;
2536
+ let block2 = ast;
2329
2537
  let prev = ast;
2330
2538
  let brackets = 0;
2331
2539
  const length = input.length;
@@ -2341,15 +2549,15 @@ var require_parse = __commonJS({
2341
2549
  prev.value += node.value;
2342
2550
  return;
2343
2551
  }
2344
- block.nodes.push(node);
2345
- node.parent = block;
2552
+ block2.nodes.push(node);
2553
+ node.parent = block2;
2346
2554
  node.prev = prev;
2347
2555
  prev = node;
2348
2556
  return node;
2349
2557
  };
2350
2558
  push({ type: "bos" });
2351
2559
  while (index < length) {
2352
- block = stack[stack.length - 1];
2560
+ block2 = stack[stack.length - 1];
2353
2561
  value = advance();
2354
2562
  if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
2355
2563
  continue;
@@ -2386,19 +2594,19 @@ var require_parse = __commonJS({
2386
2594
  continue;
2387
2595
  }
2388
2596
  if (value === CHAR_LEFT_PARENTHESES) {
2389
- block = push({ type: "paren", nodes: [] });
2390
- stack.push(block);
2597
+ block2 = push({ type: "paren", nodes: [] });
2598
+ stack.push(block2);
2391
2599
  push({ type: "text", value });
2392
2600
  continue;
2393
2601
  }
2394
2602
  if (value === CHAR_RIGHT_PARENTHESES) {
2395
- if (block.type !== "paren") {
2603
+ if (block2.type !== "paren") {
2396
2604
  push({ type: "text", value });
2397
2605
  continue;
2398
2606
  }
2399
- block = stack.pop();
2607
+ block2 = stack.pop();
2400
2608
  push({ type: "text", value });
2401
- block = stack[stack.length - 1];
2609
+ block2 = stack[stack.length - 1];
2402
2610
  continue;
2403
2611
  }
2404
2612
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
@@ -2423,7 +2631,7 @@ var require_parse = __commonJS({
2423
2631
  }
2424
2632
  if (value === CHAR_LEFT_CURLY_BRACE) {
2425
2633
  depth++;
2426
- const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
2634
+ const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
2427
2635
  const brace = {
2428
2636
  type: "brace",
2429
2637
  open: true,
@@ -2434,52 +2642,52 @@ var require_parse = __commonJS({
2434
2642
  ranges: 0,
2435
2643
  nodes: []
2436
2644
  };
2437
- block = push(brace);
2438
- stack.push(block);
2645
+ block2 = push(brace);
2646
+ stack.push(block2);
2439
2647
  push({ type: "open", value });
2440
2648
  continue;
2441
2649
  }
2442
2650
  if (value === CHAR_RIGHT_CURLY_BRACE) {
2443
- if (block.type !== "brace") {
2651
+ if (block2.type !== "brace") {
2444
2652
  push({ type: "text", value });
2445
2653
  continue;
2446
2654
  }
2447
2655
  const type = "close";
2448
- block = stack.pop();
2449
- block.close = true;
2656
+ block2 = stack.pop();
2657
+ block2.close = true;
2450
2658
  push({ type, value });
2451
2659
  depth--;
2452
- block = stack[stack.length - 1];
2660
+ block2 = stack[stack.length - 1];
2453
2661
  continue;
2454
2662
  }
2455
2663
  if (value === CHAR_COMMA && depth > 0) {
2456
- if (block.ranges > 0) {
2457
- block.ranges = 0;
2458
- const open = block.nodes.shift();
2459
- block.nodes = [open, { type: "text", value: stringify2(block) }];
2664
+ if (block2.ranges > 0) {
2665
+ block2.ranges = 0;
2666
+ const open = block2.nodes.shift();
2667
+ block2.nodes = [open, { type: "text", value: stringify2(block2) }];
2460
2668
  }
2461
2669
  push({ type: "comma", value });
2462
- block.commas++;
2670
+ block2.commas++;
2463
2671
  continue;
2464
2672
  }
2465
- if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
2466
- const siblings = block.nodes;
2673
+ if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
2674
+ const siblings = block2.nodes;
2467
2675
  if (depth === 0 || siblings.length === 0) {
2468
2676
  push({ type: "text", value });
2469
2677
  continue;
2470
2678
  }
2471
2679
  if (prev.type === "dot") {
2472
- block.range = [];
2680
+ block2.range = [];
2473
2681
  prev.value += value;
2474
2682
  prev.type = "range";
2475
- if (block.nodes.length !== 3 && block.nodes.length !== 5) {
2476
- block.invalid = true;
2477
- block.ranges = 0;
2683
+ if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
2684
+ block2.invalid = true;
2685
+ block2.ranges = 0;
2478
2686
  prev.type = "text";
2479
2687
  continue;
2480
2688
  }
2481
- block.ranges++;
2482
- block.args = [];
2689
+ block2.ranges++;
2690
+ block2.args = [];
2483
2691
  continue;
2484
2692
  }
2485
2693
  if (prev.type === "range") {
@@ -2487,7 +2695,7 @@ var require_parse = __commonJS({
2487
2695
  const before = siblings[siblings.length - 1];
2488
2696
  before.value += prev.value + value;
2489
2697
  prev = before;
2490
- block.ranges--;
2698
+ block2.ranges--;
2491
2699
  continue;
2492
2700
  }
2493
2701
  push({ type: "dot", value });
@@ -2496,9 +2704,9 @@ var require_parse = __commonJS({
2496
2704
  push({ type: "text", value });
2497
2705
  }
2498
2706
  do {
2499
- block = stack.pop();
2500
- if (block.type !== "root") {
2501
- block.nodes.forEach((node) => {
2707
+ block2 = stack.pop();
2708
+ if (block2.type !== "root") {
2709
+ block2.nodes.forEach((node) => {
2502
2710
  if (!node.nodes) {
2503
2711
  if (node.type === "open") node.isOpen = true;
2504
2712
  if (node.type === "close") node.isClose = true;
@@ -2507,8 +2715,8 @@ var require_parse = __commonJS({
2507
2715
  }
2508
2716
  });
2509
2717
  const parent = stack[stack.length - 1];
2510
- const index2 = parent.nodes.indexOf(block);
2511
- parent.nodes.splice(index2, 1, ...block.nodes);
2718
+ const index2 = parent.nodes.indexOf(block2);
2719
+ parent.nodes.splice(index2, 1, ...block2.nodes);
2512
2720
  }
2513
2721
  } while (stack.length > 0);
2514
2722
  push({ type: "eos" });
@@ -3141,9 +3349,9 @@ var require_scan = __commonJS({
3141
3349
  if (opts.parts === true || opts.tokens === true) {
3142
3350
  let prevIndex;
3143
3351
  for (let idx = 0; idx < slashes.length; idx++) {
3144
- const n = prevIndex ? prevIndex + 1 : start;
3145
- const i = slashes[idx];
3146
- const value = input.slice(n, i);
3352
+ const n3 = prevIndex ? prevIndex + 1 : start;
3353
+ const i2 = slashes[idx];
3354
+ const value = input.slice(n3, i2);
3147
3355
  if (opts.tokens) {
3148
3356
  if (idx === 0 && start !== 0) {
3149
3357
  tokens[idx].isPrefix = true;
@@ -3157,7 +3365,7 @@ var require_scan = __commonJS({
3157
3365
  if (idx !== 0 || value !== "") {
3158
3366
  parts.push(value);
3159
3367
  }
3160
- prevIndex = i;
3368
+ prevIndex = i2;
3161
3369
  }
3162
3370
  if (prevIndex && prevIndex + 1 < input.length) {
3163
3371
  const value = input.slice(prevIndex + 1);
@@ -3286,15 +3494,15 @@ var require_parse2 = __commonJS({
3286
3494
  };
3287
3495
  var hasRepeatedCharPrefixOverlap = (branches) => {
3288
3496
  const values = branches.map(normalizeSimpleBranch).filter(Boolean);
3289
- for (let i = 0; i < values.length; i++) {
3290
- for (let j2 = i + 1; j2 < values.length; j2++) {
3291
- const a = values[i];
3292
- const b = values[j2];
3293
- const char = a[0];
3294
- if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
3497
+ for (let i2 = 0; i2 < values.length; i2++) {
3498
+ for (let j = i2 + 1; j < values.length; j++) {
3499
+ const a2 = values[i2];
3500
+ const b = values[j];
3501
+ const char = a2[0];
3502
+ if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
3295
3503
  continue;
3296
3504
  }
3297
- if (a === b || a.startsWith(b) || b.startsWith(a)) {
3505
+ if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
3298
3506
  return true;
3299
3507
  }
3300
3508
  }
@@ -3309,8 +3517,8 @@ var require_parse2 = __commonJS({
3309
3517
  let paren = 0;
3310
3518
  let quote = 0;
3311
3519
  let escaped = false;
3312
- for (let i = 1; i < pattern.length; i++) {
3313
- const ch = pattern[i];
3520
+ for (let i2 = 1; i2 < pattern.length; i2++) {
3521
+ const ch = pattern[i2];
3314
3522
  if (escaped === true) {
3315
3523
  escaped = false;
3316
3524
  continue;
@@ -3344,13 +3552,13 @@ var require_parse2 = __commonJS({
3344
3552
  if (ch === ")") {
3345
3553
  paren--;
3346
3554
  if (paren === 0) {
3347
- if (requireEnd === true && i !== pattern.length - 1) {
3555
+ if (requireEnd === true && i2 !== pattern.length - 1) {
3348
3556
  return;
3349
3557
  }
3350
3558
  return {
3351
3559
  type: pattern[0],
3352
- body: pattern.slice(2, i),
3353
- end: i
3560
+ body: pattern.slice(2, i2),
3561
+ end: i2
3354
3562
  };
3355
3563
  }
3356
3564
  }
@@ -3482,7 +3690,7 @@ var require_parse2 = __commonJS({
3482
3690
  let prev = bos;
3483
3691
  let value;
3484
3692
  const eos = () => state.index === len - 1;
3485
- const peek = state.peek = (n = 1) => input[state.index + n];
3693
+ const peek = state.peek = (n3 = 1) => input[state.index + n3];
3486
3694
  const advance = state.advance = () => input[++state.index] || "";
3487
3695
  const remaining = () => input.slice(state.index + 1);
3488
3696
  const consume = (value2 = "", num = 0) => {
@@ -3563,10 +3771,10 @@ var require_parse2 = __commonJS({
3563
3771
  open.type = "text";
3564
3772
  open.value = literal;
3565
3773
  open.output = safeOutput || utils.escapeRegex(literal);
3566
- for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
3567
- tokens[i].value = "";
3568
- tokens[i].output = "";
3569
- delete tokens[i].suffix;
3774
+ for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
3775
+ tokens[i2].value = "";
3776
+ tokens[i2].output = "";
3777
+ delete tokens[i2].suffix;
3570
3778
  }
3571
3779
  state.output = token.output + open.output;
3572
3780
  state.backtrack = true;
@@ -3809,13 +4017,13 @@ var require_parse2 = __commonJS({
3809
4017
  if (brace.dots === true) {
3810
4018
  const arr = tokens.slice();
3811
4019
  const range = [];
3812
- for (let i = arr.length - 1; i >= 0; i--) {
4020
+ for (let i2 = arr.length - 1; i2 >= 0; i2--) {
3813
4021
  tokens.pop();
3814
- if (arr[i].type === "brace") {
4022
+ if (arr[i2].type === "brace") {
3815
4023
  break;
3816
4024
  }
3817
- if (arr[i].type !== "dots") {
3818
- range.unshift(arr[i].value);
4025
+ if (arr[i2].type !== "dots") {
4026
+ range.unshift(arr[i2].value);
3819
4027
  }
3820
4028
  }
3821
4029
  output = expandRange(range, opts);
@@ -4274,7 +4482,7 @@ var require_picomatch = __commonJS({
4274
4482
  };
4275
4483
  picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
4276
4484
  picomatch.parse = (pattern, options) => {
4277
- if (Array.isArray(pattern)) return pattern.map((p2) => picomatch.parse(p2, options));
4485
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
4278
4486
  return parse2(pattern, { ...options, fastpaths: false });
4279
4487
  };
4280
4488
  picomatch.scan = (input, options) => scan(input, options);
@@ -4358,8 +4566,8 @@ var require_micromatch = __commonJS({
4358
4566
  options.onResult(state);
4359
4567
  }
4360
4568
  };
4361
- for (let i = 0; i < patterns.length; i++) {
4362
- let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
4569
+ for (let i2 = 0; i2 < patterns.length; i2++) {
4570
+ let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
4363
4571
  let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
4364
4572
  if (negated) negatives++;
4365
4573
  for (let item of list) {
@@ -4381,7 +4589,7 @@ var require_micromatch = __commonJS({
4381
4589
  throw new Error(`No matches found for "${patterns.join(", ")}"`);
4382
4590
  }
4383
4591
  if (options.nonull === true || options.nullglob === true) {
4384
- return options.unescape ? patterns.map((p2) => p2.replace(/\\/g, "")) : patterns;
4592
+ return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
4385
4593
  }
4386
4594
  }
4387
4595
  return matches;
@@ -4411,7 +4619,7 @@ var require_micromatch = __commonJS({
4411
4619
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4412
4620
  }
4413
4621
  if (Array.isArray(pattern)) {
4414
- return pattern.some((p2) => micromatch.contains(str, p2, options));
4622
+ return pattern.some((p) => micromatch.contains(str, p, options));
4415
4623
  }
4416
4624
  if (typeof pattern === "string") {
4417
4625
  if (isEmptyString(str) || isEmptyString(pattern)) {
@@ -4456,7 +4664,7 @@ var require_micromatch = __commonJS({
4456
4664
  if (typeof str !== "string") {
4457
4665
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4458
4666
  }
4459
- return [].concat(patterns).every((p2) => picomatch(p2, options)(str));
4667
+ return [].concat(patterns).every((p) => picomatch(p, options)(str));
4460
4668
  };
4461
4669
  micromatch.capture = (glob, input, options) => {
4462
4670
  let posix = utils.isWindows(options);
@@ -4607,7 +4815,7 @@ var require_pattern = __commonJS({
4607
4815
  exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
4608
4816
  function expandBraceExpansion(pattern) {
4609
4817
  const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
4610
- patterns.sort((a, b) => a.length - b.length);
4818
+ patterns.sort((a2, b) => a2.length - b.length);
4611
4819
  return patterns.filter((pattern2) => pattern2 !== "");
4612
4820
  }
4613
4821
  exports.expandBraceExpansion = expandBraceExpansion;
@@ -4688,8 +4896,8 @@ var require_merge2 = __commonJS({
4688
4896
  }
4689
4897
  const mergedStream = PassThrough(options);
4690
4898
  function addStream() {
4691
- for (let i = 0, len = arguments.length; i < len; i++) {
4692
- streamsQueue.push(pauseStreams(arguments[i], options));
4899
+ for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
4900
+ streamsQueue.push(pauseStreams(arguments[i2], options));
4693
4901
  }
4694
4902
  mergeStream();
4695
4903
  return this;
@@ -4738,8 +4946,8 @@ var require_merge2 = __commonJS({
4738
4946
  stream.pipe(mergedStream, { end: false });
4739
4947
  stream.resume();
4740
4948
  }
4741
- for (let i = 0; i < streams.length; i++) {
4742
- pipe(streams[i]);
4949
+ for (let i2 = 0; i2 < streams.length; i2++) {
4950
+ pipe(streams[i2]);
4743
4951
  }
4744
4952
  next();
4745
4953
  }
@@ -4770,8 +4978,8 @@ var require_merge2 = __commonJS({
4770
4978
  }
4771
4979
  streams.pause();
4772
4980
  } else {
4773
- for (let i = 0, len = streams.length; i < len; i++) {
4774
- streams[i] = pauseStreams(streams[i], options);
4981
+ for (let i2 = 0, len = streams.length; i2 < len; i2++) {
4982
+ streams[i2] = pauseStreams(streams[i2], options);
4775
4983
  }
4776
4984
  }
4777
4985
  return streams;
@@ -4853,13 +5061,13 @@ var require_tasks = __commonJS({
4853
5061
  Object.defineProperty(exports, "__esModule", { value: true });
4854
5062
  exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
4855
5063
  var utils = require_utils3();
4856
- function generate(input, settings) {
4857
- const patterns = processPatterns(input, settings);
4858
- const ignore = processPatterns(settings.ignore, settings);
5064
+ function generate(input, settings2) {
5065
+ const patterns = processPatterns(input, settings2);
5066
+ const ignore = processPatterns(settings2.ignore, settings2);
4859
5067
  const positivePatterns = getPositivePatterns(patterns);
4860
5068
  const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
4861
- const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
4862
- const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
5069
+ const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
5070
+ const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
4863
5071
  const staticTasks = convertPatternsToTasks(
4864
5072
  staticPatterns,
4865
5073
  negativePatterns,
@@ -4875,12 +5083,12 @@ var require_tasks = __commonJS({
4875
5083
  return staticTasks.concat(dynamicTasks);
4876
5084
  }
4877
5085
  exports.generate = generate;
4878
- function processPatterns(input, settings) {
5086
+ function processPatterns(input, settings2) {
4879
5087
  let patterns = input;
4880
- if (settings.braceExpansion) {
5088
+ if (settings2.braceExpansion) {
4881
5089
  patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
4882
5090
  }
4883
- if (settings.baseNameMatch) {
5091
+ if (settings2.baseNameMatch) {
4884
5092
  patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
4885
5093
  }
4886
5094
  return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
@@ -4911,7 +5119,7 @@ var require_tasks = __commonJS({
4911
5119
  }
4912
5120
  exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
4913
5121
  function groupPatternsByBaseDirectory(patterns) {
4914
- const group = {};
5122
+ const group2 = {};
4915
5123
  return patterns.reduce((collection, pattern) => {
4916
5124
  const base = utils.pattern.getBaseDirectory(pattern);
4917
5125
  if (base in collection) {
@@ -4920,7 +5128,7 @@ var require_tasks = __commonJS({
4920
5128
  collection[base] = [pattern];
4921
5129
  }
4922
5130
  return collection;
4923
- }, group);
5131
+ }, group2);
4924
5132
  }
4925
5133
  exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
4926
5134
  function convertPatternGroupsToTasks(positive, negative, dynamic) {
@@ -4949,26 +5157,26 @@ var require_async = __commonJS({
4949
5157
  init_utils2();
4950
5158
  Object.defineProperty(exports, "__esModule", { value: true });
4951
5159
  exports.read = void 0;
4952
- function read(path, settings, callback) {
4953
- settings.fs.lstat(path, (lstatError, lstat) => {
5160
+ function read(path, settings2, callback) {
5161
+ settings2.fs.lstat(path, (lstatError, lstat) => {
4954
5162
  if (lstatError !== null) {
4955
5163
  callFailureCallback(callback, lstatError);
4956
5164
  return;
4957
5165
  }
4958
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5166
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
4959
5167
  callSuccessCallback(callback, lstat);
4960
5168
  return;
4961
5169
  }
4962
- settings.fs.stat(path, (statError, stat) => {
5170
+ settings2.fs.stat(path, (statError, stat) => {
4963
5171
  if (statError !== null) {
4964
- if (settings.throwErrorOnBrokenSymbolicLink) {
5172
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
4965
5173
  callFailureCallback(callback, statError);
4966
5174
  return;
4967
5175
  }
4968
5176
  callSuccessCallback(callback, lstat);
4969
5177
  return;
4970
5178
  }
4971
- if (settings.markSymbolicLink) {
5179
+ if (settings2.markSymbolicLink) {
4972
5180
  stat.isSymbolicLink = () => true;
4973
5181
  }
4974
5182
  callSuccessCallback(callback, stat);
@@ -4992,19 +5200,19 @@ var require_sync = __commonJS({
4992
5200
  init_utils2();
4993
5201
  Object.defineProperty(exports, "__esModule", { value: true });
4994
5202
  exports.read = void 0;
4995
- function read(path, settings) {
4996
- const lstat = settings.fs.lstatSync(path);
4997
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5203
+ function read(path, settings2) {
5204
+ const lstat = settings2.fs.lstatSync(path);
5205
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
4998
5206
  return lstat;
4999
5207
  }
5000
5208
  try {
5001
- const stat = settings.fs.statSync(path);
5002
- if (settings.markSymbolicLink) {
5209
+ const stat = settings2.fs.statSync(path);
5210
+ if (settings2.markSymbolicLink) {
5003
5211
  stat.isSymbolicLink = () => true;
5004
5212
  }
5005
5213
  return stat;
5006
5214
  } catch (error2) {
5007
- if (!settings.throwErrorOnBrokenSymbolicLink) {
5215
+ if (!settings2.throwErrorOnBrokenSymbolicLink) {
5008
5216
  return lstat;
5009
5217
  }
5010
5218
  throw error2;
@@ -5081,8 +5289,8 @@ var require_out = __commonJS({
5081
5289
  }
5082
5290
  exports.stat = stat;
5083
5291
  function statSync3(path, optionsOrSettings) {
5084
- const settings = getSettings(optionsOrSettings);
5085
- return sync.read(path, settings);
5292
+ const settings2 = getSettings(optionsOrSettings);
5293
+ return sync.read(path, settings2);
5086
5294
  }
5087
5295
  exports.statSync = statSync3;
5088
5296
  function getSettings(settingsOrOptions = {}) {
@@ -5130,8 +5338,8 @@ var require_run_parallel = __commonJS({
5130
5338
  if (isSync) queueMicrotask2(end);
5131
5339
  else end();
5132
5340
  }
5133
- function each(i, err, result) {
5134
- results[i] = result;
5341
+ function each(i2, err, result) {
5342
+ results[i2] = result;
5135
5343
  if (--pending === 0 || err) {
5136
5344
  done(err);
5137
5345
  }
@@ -5145,9 +5353,9 @@ var require_run_parallel = __commonJS({
5145
5353
  });
5146
5354
  });
5147
5355
  } else {
5148
- tasks.forEach(function(task, i) {
5356
+ tasks.forEach(function(task, i2) {
5149
5357
  task(function(err, result) {
5150
- each(i, err, result);
5358
+ each(i2, err, result);
5151
5359
  });
5152
5360
  });
5153
5361
  }
@@ -5222,11 +5430,11 @@ var require_common = __commonJS({
5222
5430
  init_utils2();
5223
5431
  Object.defineProperty(exports, "__esModule", { value: true });
5224
5432
  exports.joinPathSegments = void 0;
5225
- function joinPathSegments(a, b, separator) {
5226
- if (a.endsWith(separator)) {
5227
- return a + b;
5433
+ function joinPathSegments(a2, b, separator) {
5434
+ if (a2.endsWith(separator)) {
5435
+ return a2 + b;
5228
5436
  }
5229
- return a + separator + b;
5437
+ return a2 + separator + b;
5230
5438
  }
5231
5439
  exports.joinPathSegments = joinPathSegments;
5232
5440
  }
@@ -5244,16 +5452,16 @@ var require_async2 = __commonJS({
5244
5452
  var constants_1 = require_constants3();
5245
5453
  var utils = require_utils4();
5246
5454
  var common = require_common();
5247
- function read(directory, settings, callback) {
5248
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5249
- readdirWithFileTypes(directory, settings, callback);
5455
+ function read(directory, settings2, callback) {
5456
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5457
+ readdirWithFileTypes(directory, settings2, callback);
5250
5458
  return;
5251
5459
  }
5252
- readdir(directory, settings, callback);
5460
+ readdir(directory, settings2, callback);
5253
5461
  }
5254
5462
  exports.read = read;
5255
- function readdirWithFileTypes(directory, settings, callback) {
5256
- settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5463
+ function readdirWithFileTypes(directory, settings2, callback) {
5464
+ settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5257
5465
  if (readdirError !== null) {
5258
5466
  callFailureCallback(callback, readdirError);
5259
5467
  return;
@@ -5261,13 +5469,13 @@ var require_async2 = __commonJS({
5261
5469
  const entries = dirents.map((dirent) => ({
5262
5470
  dirent,
5263
5471
  name: dirent.name,
5264
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5472
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5265
5473
  }));
5266
- if (!settings.followSymbolicLinks) {
5474
+ if (!settings2.followSymbolicLinks) {
5267
5475
  callSuccessCallback(callback, entries);
5268
5476
  return;
5269
5477
  }
5270
- const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
5478
+ const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
5271
5479
  rpl(tasks, (rplError, rplEntries) => {
5272
5480
  if (rplError !== null) {
5273
5481
  callFailureCallback(callback, rplError);
@@ -5278,15 +5486,15 @@ var require_async2 = __commonJS({
5278
5486
  });
5279
5487
  }
5280
5488
  exports.readdirWithFileTypes = readdirWithFileTypes;
5281
- function makeRplTaskEntry(entry, settings) {
5489
+ function makeRplTaskEntry(entry, settings2) {
5282
5490
  return (done) => {
5283
5491
  if (!entry.dirent.isSymbolicLink()) {
5284
5492
  done(null, entry);
5285
5493
  return;
5286
5494
  }
5287
- settings.fs.stat(entry.path, (statError, stats) => {
5495
+ settings2.fs.stat(entry.path, (statError, stats) => {
5288
5496
  if (statError !== null) {
5289
- if (settings.throwErrorOnBrokenSymbolicLink) {
5497
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5290
5498
  done(statError);
5291
5499
  return;
5292
5500
  }
@@ -5298,16 +5506,16 @@ var require_async2 = __commonJS({
5298
5506
  });
5299
5507
  };
5300
5508
  }
5301
- function readdir(directory, settings, callback) {
5302
- settings.fs.readdir(directory, (readdirError, names) => {
5509
+ function readdir(directory, settings2, callback) {
5510
+ settings2.fs.readdir(directory, (readdirError, names) => {
5303
5511
  if (readdirError !== null) {
5304
5512
  callFailureCallback(callback, readdirError);
5305
5513
  return;
5306
5514
  }
5307
5515
  const tasks = names.map((name) => {
5308
- const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5516
+ const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5309
5517
  return (done) => {
5310
- fsStat.stat(path, settings.fsStatSettings, (error2, stats) => {
5518
+ fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
5311
5519
  if (error2 !== null) {
5312
5520
  done(error2);
5313
5521
  return;
@@ -5317,7 +5525,7 @@ var require_async2 = __commonJS({
5317
5525
  path,
5318
5526
  dirent: utils.fs.createDirentFromStats(name, stats)
5319
5527
  };
5320
- if (settings.stats) {
5528
+ if (settings2.stats) {
5321
5529
  entry.stats = stats;
5322
5530
  }
5323
5531
  done(null, entry);
@@ -5354,27 +5562,27 @@ var require_sync2 = __commonJS({
5354
5562
  var constants_1 = require_constants3();
5355
5563
  var utils = require_utils4();
5356
5564
  var common = require_common();
5357
- function read(directory, settings) {
5358
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5359
- return readdirWithFileTypes(directory, settings);
5565
+ function read(directory, settings2) {
5566
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5567
+ return readdirWithFileTypes(directory, settings2);
5360
5568
  }
5361
- return readdir(directory, settings);
5569
+ return readdir(directory, settings2);
5362
5570
  }
5363
5571
  exports.read = read;
5364
- function readdirWithFileTypes(directory, settings) {
5365
- const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
5572
+ function readdirWithFileTypes(directory, settings2) {
5573
+ const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
5366
5574
  return dirents.map((dirent) => {
5367
5575
  const entry = {
5368
5576
  dirent,
5369
5577
  name: dirent.name,
5370
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5578
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5371
5579
  };
5372
- if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
5580
+ if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
5373
5581
  try {
5374
- const stats = settings.fs.statSync(entry.path);
5582
+ const stats = settings2.fs.statSync(entry.path);
5375
5583
  entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
5376
5584
  } catch (error2) {
5377
- if (settings.throwErrorOnBrokenSymbolicLink) {
5585
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5378
5586
  throw error2;
5379
5587
  }
5380
5588
  }
@@ -5383,17 +5591,17 @@ var require_sync2 = __commonJS({
5383
5591
  });
5384
5592
  }
5385
5593
  exports.readdirWithFileTypes = readdirWithFileTypes;
5386
- function readdir(directory, settings) {
5387
- const names = settings.fs.readdirSync(directory);
5594
+ function readdir(directory, settings2) {
5595
+ const names = settings2.fs.readdirSync(directory);
5388
5596
  return names.map((name) => {
5389
- const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5390
- const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
5597
+ const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5598
+ const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
5391
5599
  const entry = {
5392
5600
  name,
5393
5601
  path: entryPath,
5394
5602
  dirent: utils.fs.createDirentFromStats(name, stats)
5395
5603
  };
5396
- if (settings.stats) {
5604
+ if (settings2.stats) {
5397
5605
  entry.stats = stats;
5398
5606
  }
5399
5607
  return entry;
@@ -5480,8 +5688,8 @@ var require_out2 = __commonJS({
5480
5688
  }
5481
5689
  exports.scandir = scandir;
5482
5690
  function scandirSync(path, optionsOrSettings) {
5483
- const settings = getSettings(optionsOrSettings);
5484
- return sync.read(path, settings);
5691
+ const settings2 = getSettings(optionsOrSettings);
5692
+ return sync.read(path, settings2);
5485
5693
  }
5486
5694
  exports.scandirSync = scandirSync;
5487
5695
  function getSettings(settingsOrOptions = {}) {
@@ -5525,9 +5733,9 @@ var require_reusify = __commonJS({
5525
5733
  }
5526
5734
  });
5527
5735
 
5528
- // node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js
5736
+ // node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
5529
5737
  var require_queue = __commonJS({
5530
- "node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js"(exports, module) {
5738
+ "node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
5531
5739
  "use strict";
5532
5740
  init_utils2();
5533
5741
  var reusify = require_reusify();
@@ -5707,11 +5915,12 @@ var require_queue = __commonJS({
5707
5915
  current.value = null;
5708
5916
  current.callback = noop;
5709
5917
  current.errorHandler = null;
5918
+ current.next = null;
5710
5919
  if (errorHandler2) {
5711
5920
  errorHandler2(new Error("abort"), val);
5712
5921
  }
5713
5922
  callback.call(context2, new Error("abort"));
5714
- current.release(current);
5923
+ cache.release(current);
5715
5924
  current = next;
5716
5925
  }
5717
5926
  self.drain = noop;
@@ -5762,7 +5971,7 @@ var require_queue = __commonJS({
5762
5971
  queue.drained = drained;
5763
5972
  return queue;
5764
5973
  function push(value) {
5765
- var p2 = new Promise(function(resolve4, reject) {
5974
+ var p = new Promise(function(resolve4, reject) {
5766
5975
  pushCb(value, function(err, result) {
5767
5976
  if (err) {
5768
5977
  reject(err);
@@ -5771,11 +5980,11 @@ var require_queue = __commonJS({
5771
5980
  resolve4(result);
5772
5981
  });
5773
5982
  });
5774
- p2.catch(noop);
5775
- return p2;
5983
+ p.catch(noop);
5984
+ return p;
5776
5985
  }
5777
5986
  function unshift(value) {
5778
- var p2 = new Promise(function(resolve4, reject) {
5987
+ var p = new Promise(function(resolve4, reject) {
5779
5988
  unshiftCb(value, function(err, result) {
5780
5989
  if (err) {
5781
5990
  reject(err);
@@ -5784,11 +5993,11 @@ var require_queue = __commonJS({
5784
5993
  resolve4(result);
5785
5994
  });
5786
5995
  });
5787
- p2.catch(noop);
5788
- return p2;
5996
+ p.catch(noop);
5997
+ return p;
5789
5998
  }
5790
5999
  function drained() {
5791
- var p2 = new Promise(function(resolve4) {
6000
+ var p = new Promise(function(resolve4) {
5792
6001
  process.nextTick(function() {
5793
6002
  if (queue.idle()) {
5794
6003
  resolve4();
@@ -5802,7 +6011,7 @@ var require_queue = __commonJS({
5802
6011
  }
5803
6012
  });
5804
6013
  });
5805
- return p2;
6014
+ return p;
5806
6015
  }
5807
6016
  }
5808
6017
  module.exports = fastqueue;
@@ -5817,11 +6026,11 @@ var require_common2 = __commonJS({
5817
6026
  init_utils2();
5818
6027
  Object.defineProperty(exports, "__esModule", { value: true });
5819
6028
  exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
5820
- function isFatalError(settings, error2) {
5821
- if (settings.errorFilter === null) {
6029
+ function isFatalError(settings2, error2) {
6030
+ if (settings2.errorFilter === null) {
5822
6031
  return true;
5823
6032
  }
5824
- return !settings.errorFilter(error2);
6033
+ return !settings2.errorFilter(error2);
5825
6034
  }
5826
6035
  exports.isFatalError = isFatalError;
5827
6036
  function isAppliedFilter(filter, value) {
@@ -5832,14 +6041,14 @@ var require_common2 = __commonJS({
5832
6041
  return filepath.split(/[/\\]/).join(separator);
5833
6042
  }
5834
6043
  exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
5835
- function joinPathSegments(a, b, separator) {
5836
- if (a === "") {
6044
+ function joinPathSegments(a2, b, separator) {
6045
+ if (a2 === "") {
5837
6046
  return b;
5838
6047
  }
5839
- if (a.endsWith(separator)) {
5840
- return a + b;
6048
+ if (a2.endsWith(separator)) {
6049
+ return a2 + b;
5841
6050
  }
5842
- return a + separator + b;
6051
+ return a2 + separator + b;
5843
6052
  }
5844
6053
  exports.joinPathSegments = joinPathSegments;
5845
6054
  }
@@ -6186,14 +6395,14 @@ var require_out3 = __commonJS({
6186
6395
  }
6187
6396
  exports.walk = walk;
6188
6397
  function walkSync(directory, optionsOrSettings) {
6189
- const settings = getSettings(optionsOrSettings);
6190
- const provider = new sync_1.default(directory, settings);
6398
+ const settings2 = getSettings(optionsOrSettings);
6399
+ const provider = new sync_1.default(directory, settings2);
6191
6400
  return provider.read();
6192
6401
  }
6193
6402
  exports.walkSync = walkSync;
6194
6403
  function walkStream(directory, optionsOrSettings) {
6195
- const settings = getSettings(optionsOrSettings);
6196
- const provider = new stream_1.default(directory, settings);
6404
+ const settings2 = getSettings(optionsOrSettings);
6405
+ const provider = new stream_1.default(directory, settings2);
6197
6406
  return provider.read();
6198
6407
  }
6199
6408
  exports.walkStream = walkStream;
@@ -6279,8 +6488,8 @@ var require_stream3 = __commonJS({
6279
6488
  done();
6280
6489
  }).catch(done);
6281
6490
  };
6282
- for (let i = 0; i < filepaths.length; i++) {
6283
- stream.write(i);
6491
+ for (let i2 = 0; i2 < filepaths.length; i2++) {
6492
+ stream.write(i2);
6284
6493
  }
6285
6494
  return stream;
6286
6495
  }
@@ -6941,14 +7150,14 @@ var require_out4 = __commonJS({
6941
7150
  function generateTasks(source, options) {
6942
7151
  assertPatternsInput(source);
6943
7152
  const patterns = [].concat(source);
6944
- const settings = new settings_1.default(options);
6945
- return taskManager.generate(patterns, settings);
7153
+ const settings2 = new settings_1.default(options);
7154
+ return taskManager.generate(patterns, settings2);
6946
7155
  }
6947
7156
  FastGlob2.generateTasks = generateTasks;
6948
7157
  function isDynamicPattern(source, options) {
6949
7158
  assertPatternsInput(source);
6950
- const settings = new settings_1.default(options);
6951
- return utils.pattern.isDynamicPattern(source, settings);
7159
+ const settings2 = new settings_1.default(options);
7160
+ return utils.pattern.isDynamicPattern(source, settings2);
6952
7161
  }
6953
7162
  FastGlob2.isDynamicPattern = isDynamicPattern;
6954
7163
  function escapePath(source) {
@@ -6990,9 +7199,9 @@ var require_out4 = __commonJS({
6990
7199
  })(FastGlob || (FastGlob = {}));
6991
7200
  function getWorks(source, _Provider, options) {
6992
7201
  const patterns = [].concat(source);
6993
- const settings = new settings_1.default(options);
6994
- const tasks = taskManager.generate(patterns, settings);
6995
- const provider = new _Provider(settings);
7202
+ const settings2 = new settings_1.default(options);
7203
+ const tasks = taskManager.generate(patterns, settings2);
7204
+ const provider = new _Provider(settings2);
6996
7205
  return tasks.map(provider.read, provider);
6997
7206
  }
6998
7207
  function assertPatternsInput(input) {
@@ -7170,14 +7379,14 @@ import "node:fs";
7170
7379
  import { createRequire } from "node:module";
7171
7380
  import {
7172
7381
  resolve,
7173
- join,
7174
- dirname,
7382
+ join as join2,
7383
+ dirname as dirname2,
7175
7384
  relative,
7176
7385
  normalize,
7177
7386
  sep,
7178
7387
  extname
7179
7388
  } from "node:path";
7180
- import "node:url";
7389
+ import { fileURLToPath } from "node:url";
7181
7390
  function safeExecuteAsync(fn, message) {
7182
7391
  return fn().catch((error2) => {
7183
7392
  throw new Error(
@@ -7185,7 +7394,7 @@ function safeExecuteAsync(fn, message) {
7185
7394
  );
7186
7395
  });
7187
7396
  }
7188
- var import_fast_glob, constants, log2, PACKAGE_PATHS, PathResolver;
7397
+ var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
7189
7398
  var init_PathResolver = __esm({
7190
7399
  "packages/core/config/utils/PathResolver.ts"() {
7191
7400
  "use strict";
@@ -7198,7 +7407,7 @@ var init_PathResolver = __esm({
7198
7407
  getPatternsFor: getPatternsFor || void 0,
7199
7408
  I18N_PATHS: I18N_PATHS || void 0
7200
7409
  };
7201
- log2 = {
7410
+ log3 = {
7202
7411
  error: (message, error2) => {
7203
7412
  },
7204
7413
  warn: (message, error2) => {
@@ -7234,6 +7443,7 @@ var init_PathResolver = __esm({
7234
7443
  options;
7235
7444
  _repoRoot;
7236
7445
  _appRoot = null;
7446
+ _writtenPaths = null;
7237
7447
  /**
7238
7448
  * Get or create singleton instance
7239
7449
  * @param options - Configuration options
@@ -7319,7 +7529,7 @@ var init_PathResolver = __esm({
7319
7529
  */
7320
7530
  getDirname(path) {
7321
7531
  if (!path) return "";
7322
- return this.normalizePath(dirname(path));
7532
+ return this.normalizePath(dirname2(path));
7323
7533
  }
7324
7534
  /**
7325
7535
  * Resolve package path using Node's module resolution
@@ -7331,7 +7541,7 @@ var init_PathResolver = __esm({
7331
7541
  resolvePackage(packageSpecifier, fromPath = null) {
7332
7542
  try {
7333
7543
  const basePath = fromPath || this.getAppRoot();
7334
- const require3 = createRequire(join(basePath, "package.json"));
7544
+ const require3 = createRequire(join2(basePath, "package.json"));
7335
7545
  const resolved = require3.resolve(packageSpecifier);
7336
7546
  return this.normalizePath(resolved);
7337
7547
  } catch (error2) {
@@ -7483,7 +7693,7 @@ var init_PathResolver = __esm({
7483
7693
  return cleanContent;
7484
7694
  } catch (error2) {
7485
7695
  if (this.options.debug) {
7486
- log2.warn(`Failed to read file: ${filePath}`, error2);
7696
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7487
7697
  }
7488
7698
  return null;
7489
7699
  }
@@ -7511,7 +7721,7 @@ var init_PathResolver = __esm({
7511
7721
  return cleanContent;
7512
7722
  } catch (error2) {
7513
7723
  if (this.options.debug) {
7514
- log2.warn(`Failed to read file: ${filePath}`, error2);
7724
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7515
7725
  }
7516
7726
  return null;
7517
7727
  }
@@ -7533,16 +7743,16 @@ var init_PathResolver = __esm({
7533
7743
  verbose = false
7534
7744
  } = options;
7535
7745
  const normalizedPath = this.normalizePath(filePath);
7536
- const dir = this.normalizePath(dirname(normalizedPath));
7746
+ const dir = this.normalizePath(dirname2(normalizedPath));
7537
7747
  const fileExists = this.pathExists(normalizedPath);
7538
7748
  if (fileExists && !overwrite) {
7539
7749
  if (verbose) {
7540
- log2.info(`Skipping existing file: ${normalizedPath}`);
7750
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7541
7751
  }
7542
7752
  return false;
7543
7753
  }
7544
7754
  if (dryRun) {
7545
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7755
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7546
7756
  return true;
7547
7757
  }
7548
7758
  try {
@@ -7552,22 +7762,23 @@ var init_PathResolver = __esm({
7552
7762
  }
7553
7763
  const detectedFormat = this._detectFormat(filePath, format);
7554
7764
  let writeContent;
7555
- if (Buffer.isBuffer(content)) {
7765
+ if (Buffer2.isBuffer(content)) {
7556
7766
  writeContent = content;
7557
7767
  } else if (detectedFormat === "json" && typeof content === "object") {
7558
- writeContent = JSON.stringify(content, null, 2);
7768
+ writeContent = `${JSON.stringify(content, null, 2)}
7769
+ `;
7559
7770
  } else {
7560
7771
  writeContent = String(content);
7561
7772
  }
7562
7773
  try {
7563
7774
  return await safeExecuteAsync(async () => {
7564
- if (Buffer.isBuffer(writeContent)) {
7775
+ if (Buffer2.isBuffer(writeContent)) {
7565
7776
  await fs.promises.writeFile(normalizedPath, writeContent);
7566
7777
  } else {
7567
7778
  await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
7568
7779
  }
7569
7780
  if (verbose) {
7570
- log2.info(
7781
+ log3.info(
7571
7782
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7572
7783
  );
7573
7784
  }
@@ -7594,16 +7805,16 @@ var init_PathResolver = __esm({
7594
7805
  verbose = false
7595
7806
  } = options;
7596
7807
  const normalizedPath = this.normalizePath(filePath);
7597
- const dir = this.normalizePath(dirname(normalizedPath));
7808
+ const dir = this.normalizePath(dirname2(normalizedPath));
7598
7809
  const fileExists = this.pathExists(normalizedPath);
7599
7810
  if (fileExists && !overwrite) {
7600
7811
  if (verbose) {
7601
- log2.info(`Skipping existing file: ${normalizedPath}`);
7812
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7602
7813
  }
7603
7814
  return false;
7604
7815
  }
7605
7816
  if (dryRun) {
7606
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7817
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7607
7818
  return true;
7608
7819
  }
7609
7820
  try {
@@ -7613,21 +7824,23 @@ var init_PathResolver = __esm({
7613
7824
  }
7614
7825
  const detectedFormat = this._detectFormat(filePath, format);
7615
7826
  let writeContent;
7616
- if (Buffer.isBuffer(content)) {
7827
+ if (Buffer2.isBuffer(content)) {
7617
7828
  writeContent = content;
7618
7829
  } else if (detectedFormat === "json" && typeof content === "object") {
7619
- writeContent = JSON.stringify(content, null, 2);
7830
+ writeContent = `${JSON.stringify(content, null, 2)}
7831
+ `;
7620
7832
  } else {
7621
7833
  writeContent = String(content);
7622
7834
  }
7623
7835
  try {
7624
- if (Buffer.isBuffer(writeContent)) {
7836
+ if (Buffer2.isBuffer(writeContent)) {
7625
7837
  fs.writeFileSync(normalizedPath, writeContent);
7626
7838
  } else {
7627
7839
  fs.writeFileSync(normalizedPath, writeContent, "utf8");
7628
7840
  }
7841
+ this._writtenPaths?.add(normalizedPath);
7629
7842
  if (verbose) {
7630
- log2.info(
7843
+ log3.info(
7631
7844
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7632
7845
  );
7633
7846
  }
@@ -7652,15 +7865,15 @@ var init_PathResolver = __esm({
7652
7865
  const fileExists = this.pathExists(normalizedDestPath);
7653
7866
  if (fileExists && !overwrite) {
7654
7867
  if (verbose) {
7655
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
7868
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7656
7869
  }
7657
7870
  return false;
7658
7871
  }
7659
7872
  if (dryRun) {
7660
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7873
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7661
7874
  return true;
7662
7875
  }
7663
- const dir = this.normalizePath(dirname(normalizedDestPath));
7876
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7664
7877
  try {
7665
7878
  await fs.promises.mkdir(dir, { recursive: true });
7666
7879
  } catch (error2) {
@@ -7670,7 +7883,7 @@ var init_PathResolver = __esm({
7670
7883
  return await safeExecuteAsync(async () => {
7671
7884
  await fs.promises.copyFile(srcPath, normalizedDestPath);
7672
7885
  if (verbose) {
7673
- log2.info(
7886
+ log3.info(
7674
7887
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7675
7888
  );
7676
7889
  }
@@ -7694,15 +7907,15 @@ var init_PathResolver = __esm({
7694
7907
  const fileExists = this.pathExists(normalizedDestPath);
7695
7908
  if (fileExists && !overwrite) {
7696
7909
  if (verbose) {
7697
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
7910
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7698
7911
  }
7699
7912
  return false;
7700
7913
  }
7701
7914
  if (dryRun) {
7702
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7915
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7703
7916
  return true;
7704
7917
  }
7705
- const dir = this.normalizePath(dirname(normalizedDestPath));
7918
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7706
7919
  try {
7707
7920
  fs.mkdirSync(dir, { recursive: true });
7708
7921
  } catch (error2) {
@@ -7710,8 +7923,9 @@ var init_PathResolver = __esm({
7710
7923
  }
7711
7924
  try {
7712
7925
  fs.copyFileSync(srcPath, normalizedDestPath);
7926
+ this._writtenPaths?.add(normalizedDestPath);
7713
7927
  if (verbose) {
7714
- log2.info(
7928
+ log3.info(
7715
7929
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7716
7930
  );
7717
7931
  }
@@ -7728,7 +7942,7 @@ var init_PathResolver = __esm({
7728
7942
  return fs.existsSync(filePath);
7729
7943
  } catch (error2) {
7730
7944
  if (!silent) {
7731
- log2.error(`Error checking path existence: ${filePath}`, error2);
7945
+ log3.error(`Error checking path existence: ${filePath}`, error2);
7732
7946
  }
7733
7947
  return false;
7734
7948
  }
@@ -7754,7 +7968,7 @@ var init_PathResolver = __esm({
7754
7968
  return fs.readdirSync(dirPath, options);
7755
7969
  } catch (error2) {
7756
7970
  if (this.options.debug) {
7757
- log2.warn(`Failed to read directory: ${dirPath}`, error2);
7971
+ log3.warn(`Failed to read directory: ${dirPath}`, error2);
7758
7972
  }
7759
7973
  const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
7760
7974
  return isObjectOptions && options.withFileTypes ? [] : [];
@@ -7772,11 +7986,29 @@ var init_PathResolver = __esm({
7772
7986
  return fs.statSync(filePath);
7773
7987
  } catch (error2) {
7774
7988
  if (this.options.debug) {
7775
- log2.warn(`Failed to stat file: ${filePath}`, error2);
7989
+ log3.warn(`Failed to stat file: ${filePath}`, error2);
7776
7990
  }
7777
7991
  return null;
7778
7992
  }
7779
7993
  }
7994
+ /**
7995
+ * Resolve the real path of a file, following symlinks
7996
+ * @param filePath - Path to resolve
7997
+ * @returns Resolved real path
7998
+ */
7999
+ realpathSync(filePath) {
8000
+ return fs.realpathSync(filePath);
8001
+ }
8002
+ /**
8003
+ * Watch a directory for changes
8004
+ * @param dirPath - Directory to watch
8005
+ * @param options - fs.watch options
8006
+ * @param callback - Callback for change events
8007
+ * @returns FSWatcher instance
8008
+ */
8009
+ watch(dirPath, options, callback) {
8010
+ return fs.watch(dirPath, options, callback);
8011
+ }
7780
8012
  /**
7781
8013
  * Get file stats synchronously (follows symlinks)
7782
8014
  * Returns null if file doesn't exist (graceful degradation)
@@ -7789,7 +8021,7 @@ var init_PathResolver = __esm({
7789
8021
  return fs.lstatSync(filePath);
7790
8022
  } catch (error2) {
7791
8023
  if (this.options.debug) {
7792
- log2.warn(`Failed to lstat file: ${filePath}`, error2);
8024
+ log3.warn(`Failed to lstat file: ${filePath}`, error2);
7793
8025
  }
7794
8026
  return null;
7795
8027
  }
@@ -7856,6 +8088,28 @@ var init_PathResolver = __esm({
7856
8088
  * Get app root (where vite.config.ts is, Vite's config.root)
7857
8089
  * Falls back to repoRoot if not set
7858
8090
  */
8091
+ /**
8092
+ * Start recording every path written by writeSync/copySync.
8093
+ * Lets a generator know exactly which files the current run produced,
8094
+ * without comparing file timestamps to a clock.
8095
+ */
8096
+ startWriteRecording() {
8097
+ this._writtenPaths = /* @__PURE__ */ new Set();
8098
+ }
8099
+ /**
8100
+ * Stop recording and return the normalized paths written since
8101
+ * startWriteRecording().
8102
+ */
8103
+ stopWriteRecording() {
8104
+ if (!this._writtenPaths) {
8105
+ throw new Error(
8106
+ "stopWriteRecording() called without startWriteRecording()"
8107
+ );
8108
+ }
8109
+ const written = this._writtenPaths;
8110
+ this._writtenPaths = null;
8111
+ return written;
8112
+ }
7859
8113
  getAppRoot() {
7860
8114
  if (!this._appRoot) {
7861
8115
  return this._repoRoot;
@@ -7878,7 +8132,7 @@ var init_PathResolver = __esm({
7878
8132
  * @returns True if repoRoot is the monorepo (has packages directory)
7879
8133
  */
7880
8134
  isMonorepo() {
7881
- const packagesDir = join(this._repoRoot, "packages");
8135
+ const packagesDir = join2(this._repoRoot, "packages");
7882
8136
  return this.pathExists(packagesDir);
7883
8137
  }
7884
8138
  /**
@@ -7895,7 +8149,7 @@ var init_PathResolver = __esm({
7895
8149
  * Find files matching pattern within directory
7896
8150
  */
7897
8151
  async findFiles(directory, pattern, options = {}) {
7898
- const searchPattern = this.normalizePath(join(directory, pattern));
8152
+ const searchPattern = this.normalizePath(join2(directory, pattern));
7899
8153
  const appRoot = this.getAppRoot();
7900
8154
  const normalizeAppRoot = this.normalizePath(appRoot);
7901
8155
  const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
@@ -7942,7 +8196,7 @@ var init_PathResolver = __esm({
7942
8196
  return null;
7943
8197
  }
7944
8198
  const resolvedPath = this.normalizePath(
7945
- join(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
8199
+ join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
7946
8200
  );
7947
8201
  const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
7948
8202
  if (this.pathExists(resolvedDir)) {
@@ -8113,6 +8367,15 @@ var init_PathResolver = __esm({
8113
8367
  const cjsPath = this.getEmptyCjsModulePath();
8114
8368
  return cjsPath.replace(/\.cjs$/, ".js");
8115
8369
  }
8370
+ /**
8371
+ * Get absolute path to empty flag component module.
8372
+ * Returns `export default () => null;` — used by flag filtering plugins
8373
+ * to replace unused flag files at build time.
8374
+ */
8375
+ getEmptyFlagModulePath() {
8376
+ const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8377
+ return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8378
+ }
8116
8379
  /**
8117
8380
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8118
8381
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8138,13 +8401,13 @@ var init_PathResolver = __esm({
8138
8401
  const maxLevels = this.options.maxLevels;
8139
8402
  while (levelsChecked < maxLevels) {
8140
8403
  const toolingPath = this.normalizePath(
8141
- join(currentDir, PACKAGE_PATHS.TOOLING)
8404
+ join2(currentDir, PACKAGE_PATHS.TOOLING)
8142
8405
  );
8143
- const corePath = this.normalizePath(join(currentDir, PACKAGE_PATHS.CORE));
8406
+ const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
8144
8407
  if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
8145
8408
  return currentDir;
8146
8409
  }
8147
- const appsDir = join(currentDir, "apps");
8410
+ const appsDir = join2(currentDir, "apps");
8148
8411
  if (this.pathExists(appsDir)) {
8149
8412
  const appsDirStat = this.statSync(appsDir);
8150
8413
  if (appsDirStat?.isDirectory()) {
@@ -8152,15 +8415,15 @@ var init_PathResolver = __esm({
8152
8415
  }
8153
8416
  }
8154
8417
  const packageJsonPath = this.normalizePath(
8155
- join(currentDir, "package.json")
8418
+ join2(currentDir, "package.json")
8156
8419
  );
8157
8420
  if (this.pathExists(packageJsonPath)) {
8158
- const parentDir2 = this.normalizePath(dirname(currentDir));
8421
+ const parentDir2 = this.normalizePath(dirname2(currentDir));
8159
8422
  if (parentDir2 === currentDir) {
8160
8423
  return currentDir;
8161
8424
  }
8162
8425
  }
8163
- const parentDir = this.normalizePath(dirname(currentDir));
8426
+ const parentDir = this.normalizePath(dirname2(currentDir));
8164
8427
  if (parentDir === currentDir) {
8165
8428
  break;
8166
8429
  }
@@ -8176,8 +8439,8 @@ var init_PathResolver = __esm({
8176
8439
  // packages/tooling/src/utils/pathResolver.ts
8177
8440
  import { createRequire as createRequire2 } from "node:module";
8178
8441
  import {
8179
- join as join2,
8180
- dirname as dirname2,
8442
+ join as join3,
8443
+ dirname as dirname3,
8181
8444
  basename as basename2,
8182
8445
  extname as extname2,
8183
8446
  relative as relative2,
@@ -8186,7 +8449,7 @@ import {
8186
8449
  isAbsolute as pathIsAbsolute
8187
8450
  } from "node:path";
8188
8451
  import { fileURLToPath as fileURLToPath2 } from "node:url";
8189
- function readdirSync2(dirPath, options) {
8452
+ function readdirSync3(dirPath, options) {
8190
8453
  return pathResolverInstance.readdirSync(dirPath, options);
8191
8454
  }
8192
8455
  var pathResolverInstance, getRepoRoot, normalizePath, pathExists, readSync, statSync2, getRelativePathBetween, getDirname, joinPath;
@@ -8198,7 +8461,7 @@ var init_pathResolver = __esm({
8198
8461
  pathResolverInstance = PathResolver.getInstance({ debug: false });
8199
8462
  getRepoRoot = () => pathResolverInstance.getRepoRoot();
8200
8463
  normalizePath = (...pathSegments) => {
8201
- return pathResolverInstance.normalizePath(join2(...pathSegments));
8464
+ return pathResolverInstance.normalizePath(join3(...pathSegments));
8202
8465
  };
8203
8466
  pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
8204
8467
  readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
@@ -8207,7 +8470,7 @@ var init_pathResolver = __esm({
8207
8470
  return normalizePath(relative2(from, to));
8208
8471
  };
8209
8472
  getDirname = (filePath) => {
8210
- return normalizePath(dirname2(filePath));
8473
+ return normalizePath(dirname3(filePath));
8211
8474
  };
8212
8475
  joinPath = (...pathSegments) => {
8213
8476
  return normalizePath(...pathSegments);
@@ -8216,10 +8479,10 @@ var init_pathResolver = __esm({
8216
8479
  });
8217
8480
 
8218
8481
  // packages/tooling/src/bundler/utils.ts
8219
- import { Buffer } from "node:buffer";
8482
+ import { Buffer as Buffer2 } from "node:buffer";
8220
8483
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
8221
8484
  import { createRequire as createRequire3 } from "node:module";
8222
- import { dirname as dirname3, resolve as resolve3 } from "node:path";
8485
+ import { dirname as dirname4, resolve as resolve3 } from "node:path";
8223
8486
  import process from "node:process";
8224
8487
  import { fileURLToPath as fileURLToPath3 } from "node:url";
8225
8488
  var require2, __filename, __dirname;
@@ -8228,12 +8491,12 @@ var init_utils2 = __esm({
8228
8491
  "use strict";
8229
8492
  require2 = createRequire3(import.meta.url);
8230
8493
  __filename = fileURLToPath3(import.meta.url);
8231
- __dirname = dirname3(__filename);
8494
+ __dirname = dirname4(__filename);
8232
8495
  if (typeof globalThis !== "undefined") {
8233
8496
  globalThis.require = require2;
8234
8497
  globalThis.__filename = __filename;
8235
8498
  globalThis.__dirname = __dirname;
8236
- globalThis.Buffer = Buffer;
8499
+ globalThis.Buffer = Buffer2;
8237
8500
  globalThis.process = process;
8238
8501
  if (typeof global === "undefined") {
8239
8502
  globalThis.global = globalThis;
@@ -8249,13 +8512,13 @@ async function askForSelection(message, choices, defaultValue = 0) {
8249
8512
  label: choice.title,
8250
8513
  hint: choice.hint
8251
8514
  }));
8252
- const result = await _t({
8515
+ const result = await select({
8253
8516
  message,
8254
8517
  options,
8255
8518
  initialValue: choices[defaultValue]?.value
8256
8519
  });
8257
- if (q(result)) {
8258
- pt("Operation cancelled.");
8520
+ if (isCancel(result)) {
8521
+ cancel("Operation cancelled.");
8259
8522
  process.exit(0);
8260
8523
  }
8261
8524
  return result;
@@ -8323,9 +8586,9 @@ async function validateToken(token) {
8323
8586
  return { username: data.user.username, email: data.user.email };
8324
8587
  }
8325
8588
  async function fetchProjectDetails(token, projectId, orgId) {
8326
- const q2 = orgId ? `?teamId=${encodeURIComponent(orgId)}` : "";
8589
+ const q = orgId ? `?teamId=${encodeURIComponent(orgId)}` : "";
8327
8590
  const res = await fetch(
8328
- `${VERCEL_API}/v9/projects/${encodeURIComponent(projectId)}${q2}`,
8591
+ `${VERCEL_API}/v9/projects/${encodeURIComponent(projectId)}${q}`,
8329
8592
  {
8330
8593
  headers: { Authorization: `Bearer ${token}` }
8331
8594
  }
@@ -8426,7 +8689,7 @@ function resolveSecret(name, projectRoot, opts) {
8426
8689
  if (value) {
8427
8690
  if (!opts?.silent && !warnedLegacy.has(name)) {
8428
8691
  warnedLegacy.add(name);
8429
- log.warn(
8692
+ log2.warn(
8430
8693
  `${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
8431
8694
  );
8432
8695
  }
@@ -8437,7 +8700,7 @@ function resolveSecret(name, projectRoot, opts) {
8437
8700
  if (aliasValue) {
8438
8701
  if (!opts?.silent && !warnedLegacy.has(name)) {
8439
8702
  warnedLegacy.add(name);
8440
- log.warn(
8703
+ log2.warn(
8441
8704
  `${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
8442
8705
  );
8443
8706
  }
@@ -8516,7 +8779,7 @@ function parseEnvFile2(filePath) {
8516
8779
  }
8517
8780
  const result = parseEnvFile(filePath);
8518
8781
  if (Object.keys(result).length === 0) {
8519
- log.debug(`No key-value pairs found in ${filePath}`);
8782
+ log2.debug(`No key-value pairs found in ${filePath}`);
8520
8783
  }
8521
8784
  return result;
8522
8785
  }
@@ -8525,7 +8788,7 @@ function parseSecretsWithFallback(envFilePath, projectRoot) {
8525
8788
  if (pathExists(dndevSecretsPath)) {
8526
8789
  const secrets = parseEnvFile(dndevSecretsPath);
8527
8790
  if (Object.keys(secrets).length > 0) {
8528
- log.info(`Reading secrets from: ${dndevSecretsPath}`);
8791
+ log2.info(`Reading secrets from: ${dndevSecretsPath}`);
8529
8792
  return secrets;
8530
8793
  }
8531
8794
  }
@@ -8539,7 +8802,7 @@ function detectPlatform() {
8539
8802
  if (pathExists(joinPath(currentDir, "vercel.json")) || pathExists(joinPath(currentDir, ".vercel"))) {
8540
8803
  return "vercel";
8541
8804
  }
8542
- log.warn("No platform detected, defaulting to Firebase");
8805
+ log2.warn("No platform detected, defaulting to Firebase");
8543
8806
  return "firebase";
8544
8807
  }
8545
8808
  function findFirebaseProjectDir(envFilePath) {
@@ -8618,7 +8881,7 @@ function detectAppsWithFunctions() {
8618
8881
  }
8619
8882
  const apps = [];
8620
8883
  try {
8621
- const appsList = readdirSync2(appsDir).filter((item) => {
8884
+ const appsList = readdirSync3(appsDir).filter((item) => {
8622
8885
  const itemPath = joinPath(appsDir, item);
8623
8886
  const stat = statSync2(itemPath);
8624
8887
  return stat?.isDirectory() === true;
@@ -8635,7 +8898,7 @@ function detectAppsWithFunctions() {
8635
8898
  }
8636
8899
  } catch {
8637
8900
  }
8638
- return apps.sort((a, b) => a.name.localeCompare(b.name));
8901
+ return apps.sort((a2, b) => a2.name.localeCompare(b.name));
8639
8902
  }
8640
8903
  async function setFirebaseSecret(key, value, projectId, dryRun = false, cwd) {
8641
8904
  if (isFirebaseReservedKey(key)) {
@@ -8645,11 +8908,11 @@ async function setFirebaseSecret(key, value, projectId, dryRun = false, cwd) {
8645
8908
  "FIREBASE_AUTH_DOMAIN"
8646
8909
  ];
8647
8910
  if (configOnlyKeys.includes(key)) {
8648
- log.debug(
8911
+ log2.debug(
8649
8912
  `\u23ED\uFE0F Skipping ${key}: Configuration variable (stays in .env, not synced as secret)`
8650
8913
  );
8651
8914
  } else {
8652
- log.warn(
8915
+ log2.warn(
8653
8916
  `\u23ED\uFE0F Skipping ${key}: Reserved Firebase prefix (X_GOOGLE_, FIREBASE_, EXT_, GCLOUD_)`
8654
8917
  );
8655
8918
  }
@@ -8657,7 +8920,7 @@ async function setFirebaseSecret(key, value, projectId, dryRun = false, cwd) {
8657
8920
  }
8658
8921
  const finalProjectId = projectId || detectFirebaseProjectId(cwd);
8659
8922
  if (dryRun) {
8660
- log.info(
8923
+ log2.info(
8661
8924
  `[DRY RUN] Would set Firebase secret: ${key}${finalProjectId ? ` (project: ${finalProjectId})` : ""}`
8662
8925
  );
8663
8926
  return;
@@ -8677,7 +8940,7 @@ async function setFirebaseSecret(key, value, projectId, dryRun = false, cwd) {
8677
8940
  );
8678
8941
  }
8679
8942
  try {
8680
- log.info(`Setting Firebase secret: ${key} (project: ${finalProjectId})`);
8943
+ log2.info(`Setting Firebase secret: ${key} (project: ${finalProjectId})`);
8681
8944
  const tempFile = "";
8682
8945
  try {
8683
8946
  const args = ["functions:secrets:set", key, "--project", finalProjectId];
@@ -8700,8 +8963,8 @@ async function setFirebaseSecret(key, value, projectId, dryRun = false, cwd) {
8700
8963
  }
8701
8964
  if (result.status !== 0) {
8702
8965
  const stderr = result.stderr?.toString() || "";
8703
- const stdout = result.stdout?.toString() || "";
8704
- const errorOutput = stderr || stdout;
8966
+ const stdout2 = result.stdout?.toString() || "";
8967
+ const errorOutput = stderr || stdout2;
8705
8968
  const errorLower = errorOutput.toLowerCase();
8706
8969
  if (errorLower.includes("not logged in") || errorLower.includes("authentication required") || errorLower.includes("please login") || errorLower.includes("run firebase login") || errorLower.includes("unauthorized") || errorOutput.includes("401")) {
8707
8970
  throw new DoNotDevError(
@@ -8751,12 +9014,12 @@ async function setFirebaseSecret(key, value, projectId, dryRun = false, cwd) {
8751
9014
  ${errorOutput}`
8752
9015
  );
8753
9016
  }
8754
- log.success(`Firebase secret ${key} set successfully`);
9017
+ log2.success(`Firebase secret ${key} set successfully`);
8755
9018
  } finally {
8756
9019
  }
8757
9020
  } catch (err) {
8758
9021
  if (err instanceof DoNotDevError) throw err;
8759
- log.error(`Failed to set Firebase secret ${key}:`, err);
9022
+ log2.error(`Failed to set Firebase secret ${key}:`, err);
8760
9023
  throw new DoNotDevError(
8761
9024
  `Failed to set Firebase secret ${key}`,
8762
9025
  "command-failed",
@@ -8793,24 +9056,24 @@ async function resolveVercelCredentialsForSync(appDir, projectIdOverride, dryRun
8793
9056
  projectId: projectIdOverride ?? credResult.credentials.projectId
8794
9057
  };
8795
9058
  if (!dryRun) {
8796
- log.info("Validating Vercel credentials...");
9059
+ log2.info("Validating Vercel credentials...");
8797
9060
  const user = await validateToken(credentials.token);
8798
- log.success(`Vercel token valid (${user.username})`);
9061
+ log2.success(`Vercel token valid (${user.username})`);
8799
9062
  const project = await validateProject(
8800
9063
  credentials.token,
8801
9064
  credentials.projectId,
8802
9065
  credentials.orgId
8803
9066
  );
8804
- log.success(`Vercel project accessible (${project.projectName})`);
9067
+ log2.success(`Vercel project accessible (${project.projectName})`);
8805
9068
  }
8806
9069
  return credentials;
8807
9070
  }
8808
9071
  async function setVercelSecret(key, value, credentials, dryRun = false) {
8809
9072
  if (dryRun) {
8810
- log.info(`[DRY RUN] Would set Vercel environment variable: ${key}`);
9073
+ log2.info(`[DRY RUN] Would set Vercel environment variable: ${key}`);
8811
9074
  return;
8812
9075
  }
8813
- log.info(`Setting Vercel environment variable: ${key}`);
9076
+ log2.info(`Setting Vercel environment variable: ${key}`);
8814
9077
  try {
8815
9078
  const { token, orgId, projectId } = credentials;
8816
9079
  const params = ["upsert=true"];
@@ -8835,9 +9098,9 @@ async function setVercelSecret(key, value, credentials, dryRun = false) {
8835
9098
  const body = await res.text();
8836
9099
  throw formatVercelError(res.status, body, `set env var ${key}`);
8837
9100
  }
8838
- log.success(`Vercel environment variable ${key} set successfully`);
9101
+ log2.success(`Vercel environment variable ${key} set successfully`);
8839
9102
  } catch (err) {
8840
- log.error(`Failed to set Vercel environment variable ${key}:`, err);
9103
+ log2.error(`Failed to set Vercel environment variable ${key}:`, err);
8841
9104
  if (err instanceof DoNotDevError) throw err;
8842
9105
  throw new DoNotDevError(
8843
9106
  `Failed to set Vercel environment variable ${key}`,
@@ -8871,13 +9134,13 @@ function detectGitHubRepo() {
8871
9134
  }
8872
9135
  function setGitHubSecret(key, value, repo, dryRun = false) {
8873
9136
  if (dryRun) {
8874
- log.info(
9137
+ log2.info(
8875
9138
  `[DRY RUN] Would set GitHub secret: ${key}${repo ? ` (repo: ${repo})` : ""}`
8876
9139
  );
8877
9140
  return;
8878
9141
  }
8879
9142
  try {
8880
- log.info(`Setting GitHub secret: ${key}${repo ? ` (repo: ${repo})` : ""}`);
9143
+ log2.info(`Setting GitHub secret: ${key}${repo ? ` (repo: ${repo})` : ""}`);
8881
9144
  const args = ["secret", "set", key];
8882
9145
  if (repo) {
8883
9146
  args.push("--repo", repo);
@@ -8892,8 +9155,8 @@ function setGitHubSecret(key, value, repo, dryRun = false) {
8892
9155
  }
8893
9156
  if (result.status !== 0) {
8894
9157
  const stderr = result.stderr?.toString() || "";
8895
- const stdout = result.stdout?.toString() || "";
8896
- const errorOutput = stderr || stdout;
9158
+ const stdout2 = result.stdout?.toString() || "";
9159
+ const errorOutput = stderr || stdout2;
8897
9160
  if (errorOutput.includes("not logged in") || errorOutput.includes("authentication")) {
8898
9161
  throw new DoNotDevError(
8899
9162
  `GitHub CLI authentication required. Run 'gh auth login' to authenticate.`,
@@ -8906,10 +9169,10 @@ function setGitHubSecret(key, value, repo, dryRun = false) {
8906
9169
  ${errorOutput}`
8907
9170
  );
8908
9171
  }
8909
- log.success(`GitHub secret ${key} set successfully`);
9172
+ log2.success(`GitHub secret ${key} set successfully`);
8910
9173
  } catch (err) {
8911
9174
  if (err instanceof DoNotDevError) throw err;
8912
- log.error(`Failed to set GitHub secret ${key}:`, err);
9175
+ log2.error(`Failed to set GitHub secret ${key}:`, err);
8913
9176
  throw new DoNotDevError(
8914
9177
  `Failed to set GitHub secret ${key}`,
8915
9178
  "command-failed",
@@ -8928,13 +9191,13 @@ function uploadServiceAccountToGitHub(appDir, repo, dryRun = false, staging = fa
8928
9191
  const secretName = staging ? "FIREBASE_SERVICE_ACCOUNT_STAGING" : "FIREBASE_SERVICE_ACCOUNT";
8929
9192
  const filePath = joinPath(appDir, fileName);
8930
9193
  if (!pathExists(filePath)) {
8931
- log.debug(`No ${fileName} found in ${appDir}, skipping GitHub upload`);
9194
+ log2.debug(`No ${fileName} found in ${appDir}, skipping GitHub upload`);
8932
9195
  return;
8933
9196
  }
8934
9197
  const contentRaw = readSync(filePath, { format: "text" });
8935
9198
  const content = typeof contentRaw === "string" ? contentRaw : null;
8936
9199
  if (!content) return;
8937
- const encoded = Buffer.from(content).toString("base64");
9200
+ const encoded = Buffer2.from(content).toString("base64");
8938
9201
  setGitHubSecret(secretName, encoded, repo, dryRun);
8939
9202
  }
8940
9203
  async function main(options = {}) {
@@ -8949,7 +9212,7 @@ async function main(options = {}) {
8949
9212
  verbose: options.verbose ?? false
8950
9213
  };
8951
9214
  if (process.argv.includes("--help")) {
8952
- log.info(`
9215
+ log2.info(`
8953
9216
  Secrets Sync Tool
8954
9217
 
8955
9218
  Usage: bun run sync-secrets [options]
@@ -8984,7 +9247,7 @@ Examples:
8984
9247
  let selectedApp;
8985
9248
  if (appsWithFunctions.length === 1) {
8986
9249
  selectedApp = appsWithFunctions[0];
8987
- wt(`Using app: ${selectedApp.name}`, "Auto-detected");
9250
+ note(`Using app: ${selectedApp.name}`, "Auto-detected");
8988
9251
  } else {
8989
9252
  const appName = await askForSelection(
8990
9253
  "Which app would you like to sync secrets for?",
@@ -8994,7 +9257,7 @@ Examples:
8994
9257
  hint: `functions/.env in ${app.name}`
8995
9258
  }))
8996
9259
  );
8997
- selectedApp = appsWithFunctions.find((a) => a.name === appName);
9260
+ selectedApp = appsWithFunctions.find((a2) => a2.name === appName);
8998
9261
  }
8999
9262
  if (selectedApp) {
9000
9263
  const envFileAbsolute = normalizePath(selectedApp.envFile);
@@ -9015,19 +9278,19 @@ Examples:
9015
9278
  if (syncTarget === "github") {
9016
9279
  const repo = config.repo || detectGitHubRepo();
9017
9280
  if (!repo) {
9018
- log.error(
9281
+ log2.error(
9019
9282
  "Could not detect GitHub repository. Use --repo owner/repo or ensure a GitHub remote is configured."
9020
9283
  );
9021
9284
  return 1;
9022
9285
  }
9023
- log.info(`Syncing secrets to GitHub repository: ${repo}`);
9286
+ log2.info(`Syncing secrets to GitHub repository: ${repo}`);
9024
9287
  const secrets2 = parseSecretsWithFallback(envFilePath, currentDir);
9025
9288
  const secretKeys2 = Object.keys(secrets2);
9026
9289
  if (secretKeys2.length === 0) {
9027
- log.info("No secrets found in .env file");
9290
+ log2.info("No secrets found in .env file");
9028
9291
  } else {
9029
- log.info(`Found ${secretKeys2.length} secrets to sync to GitHub:`);
9030
- secretKeys2.forEach((key) => log.info(` ${key}`));
9292
+ log2.info(`Found ${secretKeys2.length} secrets to sync to GitHub:`);
9293
+ secretKeys2.forEach((key) => log2.info(` ${key}`));
9031
9294
  for (const [key, value] of Object.entries(secrets2)) {
9032
9295
  setGitHubSecret(key, value, repo, config.dryRun);
9033
9296
  }
@@ -9050,37 +9313,37 @@ Examples:
9050
9313
  uploadServiceAccountToGitHub(currentDir, repo, config.dryRun, true);
9051
9314
  }
9052
9315
  if (config.dryRun) {
9053
- log.success("\nDry run completed. No GitHub secrets were set.");
9316
+ log2.success("\nDry run completed. No GitHub secrets were set.");
9054
9317
  } else {
9055
- log.success("\nAll secrets synced to GitHub successfully!");
9318
+ log2.success("\nAll secrets synced to GitHub successfully!");
9056
9319
  }
9057
9320
  return 0;
9058
9321
  }
9059
9322
  const platform = config.platform || detectPlatform();
9060
9323
  if (config.verbose) {
9061
- log.debug(`Working directory: ${currentDir}`);
9062
- log.debug(`Environment file: ${envFilePath}`);
9063
- log.debug(`Platform: ${platform}`);
9064
- log.debug(`Dry run mode: ${config.dryRun}`);
9324
+ log2.debug(`Working directory: ${currentDir}`);
9325
+ log2.debug(`Environment file: ${envFilePath}`);
9326
+ log2.debug(`Platform: ${platform}`);
9327
+ log2.debug(`Dry run mode: ${config.dryRun}`);
9065
9328
  }
9066
9329
  const secrets = parseSecretsWithFallback(envFilePath, currentDir);
9067
9330
  const secretKeys = Object.keys(secrets);
9068
9331
  if (secretKeys.length === 0) {
9069
- log.info("No secrets found in .env file");
9332
+ log2.info("No secrets found in .env file");
9070
9333
  return 0;
9071
9334
  }
9072
- log.info(`Found ${secretKeys.length} secrets to sync to ${platform}:`);
9335
+ log2.info(`Found ${secretKeys.length} secrets to sync to ${platform}:`);
9073
9336
  secretKeys.forEach((key) => {
9074
9337
  if (config.verbose) {
9075
9338
  const value = secrets[key];
9076
- log.debug(` ${key}: ${value ? "***" : "undefined"}`);
9339
+ log2.debug(` ${key}: ${value ? "***" : "undefined"}`);
9077
9340
  } else {
9078
- log.info(` ${key}`);
9341
+ log2.info(` ${key}`);
9079
9342
  }
9080
9343
  });
9081
9344
  const finalFirebaseProjectDir = platform === "firebase" ? firebaseProjectDir || findFirebaseProjectDir(config.envFile) : void 0;
9082
9345
  if (config.verbose && finalFirebaseProjectDir) {
9083
- log.debug(`Firebase project directory: ${finalFirebaseProjectDir}`);
9346
+ log2.debug(`Firebase project directory: ${finalFirebaseProjectDir}`);
9084
9347
  }
9085
9348
  const vercelCredentials = platform === "vercel" ? await resolveVercelCredentialsForSync(
9086
9349
  currentDir,
@@ -9101,17 +9364,17 @@ Examples:
9101
9364
  }
9102
9365
  }
9103
9366
  if (config.dryRun) {
9104
- log.success(
9367
+ log2.success(
9105
9368
  `
9106
9369
  Dry run completed. No secrets were actually set to ${platform}.`
9107
9370
  );
9108
9371
  } else {
9109
- log.success(`
9372
+ log2.success(`
9110
9373
  All secrets synced successfully to ${platform}!`);
9111
9374
  }
9112
9375
  return 0;
9113
9376
  } catch (err) {
9114
- log.error(
9377
+ log2.error(
9115
9378
  "Error syncing secrets:",
9116
9379
  DoNotDevError.from(err, "Sync-secrets failed", "cli-execution-error")
9117
9380
  );
@@ -9122,13 +9385,13 @@ var init_sync_secrets = __esm({
9122
9385
  "packages/tooling/src/apps/sync-secrets.ts"() {
9123
9386
  "use strict";
9124
9387
  init_utils2();
9388
+ init_vercel_api();
9389
+ init_vercel_token();
9125
9390
  init_cli_input();
9126
9391
  init_cli_output();
9127
9392
  init_errors();
9128
9393
  init_pathResolver();
9129
9394
  init_secrets_resolver();
9130
- init_vercel_token();
9131
- init_vercel_api();
9132
9395
  }
9133
9396
  });
9134
9397