@ariestools/toolchain 8.7.25 → 8.7.27

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 (55) hide show
  1. package/dist/actions/deplint/checkPackage/getUnsatisfiedPeerDependencies.d.ts +10 -5
  2. package/dist/actions/deplint/checkPackage/getUnsatisfiedPeerDependencies.d.ts.map +1 -1
  3. package/dist/actions/deplint/engine.d.ts.map +1 -1
  4. package/dist/actions/deplint/findFiles.d.ts +25 -1
  5. package/dist/actions/deplint/findFiles.d.ts.map +1 -1
  6. package/dist/actions/deplint/getExternalImportsFromFiles.d.ts +8 -3
  7. package/dist/actions/deplint/getExternalImportsFromFiles.d.ts.map +1 -1
  8. package/dist/actions/deplint/isTerminalPackage.d.ts +72 -14
  9. package/dist/actions/deplint/isTerminalPackage.d.ts.map +1 -1
  10. package/dist/actions/deplint/rules.d.ts.map +1 -1
  11. package/dist/actions/deplint/snapshot.d.ts +9 -0
  12. package/dist/actions/deplint/snapshot.d.ts.map +1 -1
  13. package/dist/actions/deplint/types.d.ts +20 -2
  14. package/dist/actions/deplint/types.d.ts.map +1 -1
  15. package/dist/actions/package/compile/XyConfig.d.ts +23 -11
  16. package/dist/actions/package/compile/XyConfig.d.ts.map +1 -1
  17. package/dist/actions/skills/defaults.d.ts +18 -1
  18. package/dist/actions/skills/defaults.d.ts.map +1 -1
  19. package/dist/actions/skills/detectProfile.d.ts +8 -0
  20. package/dist/actions/skills/detectProfile.d.ts.map +1 -1
  21. package/dist/actions/skills/lint.d.ts.map +1 -1
  22. package/dist/actions/skills/skillRules.d.ts +12 -1
  23. package/dist/actions/skills/skillRules.d.ts.map +1 -1
  24. package/dist/bin/package/build.mjs +915 -2503
  25. package/dist/bin/package/build.mjs.map +1 -1
  26. package/dist/bin/package/clean.mjs +368 -2056
  27. package/dist/bin/package/clean.mjs.map +1 -1
  28. package/dist/bin/package/compile.mjs +717 -2401
  29. package/dist/bin/package/compile.mjs.map +1 -1
  30. package/dist/bin/package/copy-assets-cjs.mjs +159 -86
  31. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
  32. package/dist/bin/package/copy-assets-esm.mjs +159 -86
  33. package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
  34. package/dist/bin/package/fix.mjs +259 -148
  35. package/dist/bin/package/fix.mjs.map +1 -1
  36. package/dist/bin/package/lint-verbose.mjs +259 -148
  37. package/dist/bin/package/lint-verbose.mjs.map +1 -1
  38. package/dist/bin/package/lint.mjs +259 -148
  39. package/dist/bin/package/lint.mjs.map +1 -1
  40. package/dist/bin/package/publint.mjs +393 -2027
  41. package/dist/bin/package/publint.mjs.map +1 -1
  42. package/dist/bin/package/recompile.mjs +719 -2403
  43. package/dist/bin/package/recompile.mjs.map +1 -1
  44. package/dist/bin/package/relint.mjs +259 -148
  45. package/dist/bin/package/relint.mjs.map +1 -1
  46. package/dist/bin/package/sync-layout.mjs +232 -1961
  47. package/dist/bin/package/sync-layout.mjs.map +1 -1
  48. package/dist/bin/run-or-exec.mjs +157 -84
  49. package/dist/bin/run-or-exec.mjs.map +1 -1
  50. package/dist/bin/skills.mjs +4375 -670
  51. package/dist/bin/skills.mjs.map +1 -1
  52. package/dist/bin/xy.mjs +1205 -2347
  53. package/dist/bin/xy.mjs.map +1 -1
  54. package/dist/xy/common/skills/index.d.ts.map +1 -1
  55. package/package.json +4 -4
@@ -8,11 +8,41 @@ import { fileURLToPath, pathToFileURL } from "node:url";
8
8
  import { execFile } from "node:child_process";
9
9
  import { promisify } from "node:util";
10
10
  import { ESLint } from "eslint";
11
- //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
11
+ //#region ../../node_modules/.pnpm/chalk@6.0.0/node_modules/chalk/source/utilities.js
12
+ function stringReplaceAll(string, substring, postfix) {
13
+ let index = string.indexOf(substring);
14
+ if (index === -1) return string;
15
+ const substringLength = substring.length;
16
+ let endIndex = 0;
17
+ let returnValue = "";
18
+ do {
19
+ returnValue += string.slice(endIndex, index) + substring + postfix;
20
+ endIndex = index + substringLength;
21
+ index = string.indexOf(substring, endIndex);
22
+ } while (index !== -1);
23
+ returnValue += string.slice(endIndex);
24
+ return returnValue;
25
+ }
26
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
27
+ let endIndex = 0;
28
+ let returnValue = "";
29
+ do {
30
+ const isGotCR = string[index - 1] === "\r";
31
+ returnValue += string.slice(endIndex, isGotCR ? index - 1 : index) + prefix + (isGotCR ? "\r\n" : "\n") + postfix;
32
+ endIndex = index + 1;
33
+ index = string.indexOf("\n", endIndex);
34
+ } while (index !== -1);
35
+ returnValue += string.slice(endIndex);
36
+ return returnValue;
37
+ }
38
+ //#endregion
39
+ //#region ../../node_modules/.pnpm/chalk@6.0.0/node_modules/chalk/source/vendor/ansi-styles/index.js
12
40
  const ANSI_BACKGROUND_OFFSET = 10;
13
- const wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
14
- const wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
15
- const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
41
+ const ANSI_UNDERLINE_OFFSET = 20;
42
+ const wrapAnsi16 = (offset = 0) => (code) => `\u{1B}[${code + offset}m`;
43
+ const wrapAnsi256 = (offset = 0) => (code) => `\u{1B}[${38 + offset};5;${code}m`;
44
+ const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u{1B}[${38 + offset};2;${red};${green};${blue}m`;
45
+ const wrapUnderlineAnsi = (code) => `\u{1B}[58;5;${code < 90 ? code - 30 : code - 90 + 8}m`;
16
46
  const styles$1 = {
17
47
  modifier: {
18
48
  reset: [0, 0],
@@ -20,6 +50,10 @@ const styles$1 = {
20
50
  dim: [2, 22],
21
51
  italic: [3, 23],
22
52
  underline: [4, 24],
53
+ underlineDouble: ["4:2", 24],
54
+ underlineCurly: ["4:3", 24],
55
+ underlineDotted: ["4:4", 24],
56
+ underlineDashed: ["4:5", 24],
23
57
  overline: [53, 55],
24
58
  inverse: [7, 27],
25
59
  hidden: [8, 28],
@@ -64,22 +98,43 @@ const styles$1 = {
64
98
  bgMagentaBright: [105, 49],
65
99
  bgCyanBright: [106, 49],
66
100
  bgWhiteBright: [107, 49]
101
+ },
102
+ underlineColor: {
103
+ underlineBlack: ["58;5;0", 59],
104
+ underlineRed: ["58;5;1", 59],
105
+ underlineGreen: ["58;5;2", 59],
106
+ underlineYellow: ["58;5;3", 59],
107
+ underlineBlue: ["58;5;4", 59],
108
+ underlineMagenta: ["58;5;5", 59],
109
+ underlineCyan: ["58;5;6", 59],
110
+ underlineWhite: ["58;5;7", 59],
111
+ underlineBlackBright: ["58;5;8", 59],
112
+ underlineGray: ["58;5;8", 59],
113
+ underlineGrey: ["58;5;8", 59],
114
+ underlineRedBright: ["58;5;9", 59],
115
+ underlineGreenBright: ["58;5;10", 59],
116
+ underlineYellowBright: ["58;5;11", 59],
117
+ underlineBlueBright: ["58;5;12", 59],
118
+ underlineMagentaBright: ["58;5;13", 59],
119
+ underlineCyanBright: ["58;5;14", 59],
120
+ underlineWhiteBright: ["58;5;15", 59]
67
121
  }
68
122
  };
69
123
  Object.keys(styles$1.modifier);
70
124
  const foregroundColorNames = Object.keys(styles$1.color);
71
125
  const backgroundColorNames = Object.keys(styles$1.bgColor);
126
+ Object.keys(styles$1.underlineColor);
72
127
  [...foregroundColorNames, ...backgroundColorNames];
73
128
  function assembleStyles() {
74
129
  const codes = /* @__PURE__ */ new Map();
75
130
  for (const [groupName, group] of Object.entries(styles$1)) {
76
131
  for (const [styleName, style] of Object.entries(group)) {
77
132
  styles$1[styleName] = {
78
- open: `\u001B[${style[0]}m`,
79
- close: `\u001B[${style[1]}m`
133
+ open: `\u{1B}[${style[0]}m`,
134
+ close: `\u{1B}[${style[1]}m`
80
135
  };
81
136
  group[styleName] = styles$1[styleName];
82
- codes.set(style[0], style[1]);
137
+ codes.set(Number.parseInt(style[0], 10), style[1]);
83
138
  }
84
139
  Object.defineProperty(styles$1, groupName, {
85
140
  value: group,
@@ -92,12 +147,16 @@ function assembleStyles() {
92
147
  });
93
148
  styles$1.color.close = "\x1B[39m";
94
149
  styles$1.bgColor.close = "\x1B[49m";
150
+ styles$1.underlineColor.close = "\x1B[59m";
95
151
  styles$1.color.ansi = wrapAnsi16();
96
152
  styles$1.color.ansi256 = wrapAnsi256();
97
153
  styles$1.color.ansi16m = wrapAnsi16m();
98
154
  styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
99
155
  styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
100
156
  styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
157
+ styles$1.underlineColor.ansi = wrapUnderlineAnsi;
158
+ styles$1.underlineColor.ansi256 = wrapAnsi256(ANSI_UNDERLINE_OFFSET);
159
+ styles$1.underlineColor.ansi16m = wrapAnsi16m(ANSI_UNDERLINE_OFFSET);
101
160
  Object.defineProperties(styles$1, {
102
161
  rgbToAnsi256: {
103
162
  value(red, green, blue) {
@@ -112,7 +171,7 @@ function assembleStyles() {
112
171
  },
113
172
  hexToRgb: {
114
173
  value(hex) {
115
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
174
+ const matches = /[\da-f]{6}|[\da-f]{3}/i.exec(hex.toString(16));
116
175
  if (!matches) return [
117
176
  0,
118
177
  0,
@@ -172,7 +231,7 @@ function assembleStyles() {
172
231
  }
173
232
  const ansiStyles = assembleStyles();
174
233
  //#endregion
175
- //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
234
+ //#region ../../node_modules/.pnpm/chalk@6.0.0/node_modules/chalk/source/vendor/supports-color/index.js
176
235
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
177
236
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
178
237
  const position = argv.indexOf(prefix + flag);
@@ -183,12 +242,15 @@ const { env } = process$1;
183
242
  let flagForceColor;
184
243
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
185
244
  else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
245
+ function hasNumericForceColor() {
246
+ return /^\d+$/.test(env.FORCE_COLOR);
247
+ }
186
248
  function envForceColor() {
187
- if ("FORCE_COLOR" in env) {
188
- if (env.FORCE_COLOR === "true") return 1;
189
- if (env.FORCE_COLOR === "false") return 0;
190
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
191
- }
249
+ if (!("FORCE_COLOR" in env)) return;
250
+ if (env.FORCE_COLOR === "false") return 0;
251
+ if (env.FORCE_COLOR === "true" || env.FORCE_COLOR.length === 0) return 1;
252
+ if (!hasNumericForceColor()) return;
253
+ return Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
192
254
  }
193
255
  function translateLevel(level) {
194
256
  if (level === 0) return false;
@@ -208,6 +270,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
208
270
  if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
209
271
  if (hasFlag("color=256")) return 2;
210
272
  }
273
+ if (forceColor !== void 0 && hasNumericForceColor()) return forceColor;
211
274
  if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
212
275
  if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
213
276
  const min = forceColor || 0;
@@ -232,19 +295,19 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
232
295
  ].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
233
296
  return min;
234
297
  }
235
- if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
298
+ if ("TEAMCITY_VERSION" in env) return /^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
236
299
  if (env.COLORTERM === "truecolor") return 3;
237
300
  if (env.TERM === "xterm-kitty") return 3;
238
301
  if (env.TERM === "xterm-ghostty") return 3;
239
302
  if (env.TERM === "wezterm") return 3;
240
303
  if ("TERM_PROGRAM" in env) {
241
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
304
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".", 1)[0], 10);
242
305
  switch (env.TERM_PROGRAM) {
243
306
  case "iTerm.app": return version >= 3 ? 3 : 2;
244
307
  case "Apple_Terminal": return 2;
245
308
  }
246
309
  }
247
- if (/-256(color)?$/i.test(env.TERM)) return 2;
310
+ if (/-256(?:color)?$/i.test(env.TERM)) return 2;
248
311
  if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
249
312
  if ("COLORTERM" in env) return 1;
250
313
  return min;
@@ -255,55 +318,34 @@ function createSupportsColor(stream, options = {}) {
255
318
  ...options
256
319
  }));
257
320
  }
258
- const supportsColor = {
321
+ //#endregion
322
+ //#region ../../node_modules/.pnpm/chalk@6.0.0/node_modules/chalk/source/index.js
323
+ const { stdout: stdoutColor, stderr: stderrColor } = {
259
324
  stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
260
325
  stderr: createSupportsColor({ isTTY: tty.isatty(2) })
261
326
  };
262
- //#endregion
263
- //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
264
- function stringReplaceAll(string, substring, replacer) {
265
- let index = string.indexOf(substring);
266
- if (index === -1) return string;
267
- const substringLength = substring.length;
268
- let endIndex = 0;
269
- let returnValue = "";
270
- do {
271
- returnValue += string.slice(endIndex, index) + substring + replacer;
272
- endIndex = index + substringLength;
273
- index = string.indexOf(substring, endIndex);
274
- } while (index !== -1);
275
- returnValue += string.slice(endIndex);
276
- return returnValue;
277
- }
278
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
279
- let endIndex = 0;
280
- let returnValue = "";
281
- do {
282
- const gotCR = string[index - 1] === "\r";
283
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
284
- endIndex = index + 1;
285
- index = string.indexOf("\n", endIndex);
286
- } while (index !== -1);
287
- returnValue += string.slice(endIndex);
288
- return returnValue;
289
- }
290
- //#endregion
291
- //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
292
- const { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
293
327
  const GENERATOR = Symbol("GENERATOR");
294
328
  const STYLER = Symbol("STYLER");
295
329
  const IS_EMPTY = Symbol("IS_EMPTY");
296
- const levelMapping = [
297
- "ansi",
298
- "ansi",
299
- "ansi256",
300
- "ansi16m"
301
- ];
330
+ const LEVEL = Symbol("LEVEL");
302
331
  const styles = Object.create(null);
332
+ const assertValidLevel = (level) => {
333
+ if (!Number.isSafeInteger(level) || level < 0 || level > 3) throw new Error("The `level` should be an integer from 0 to 3");
334
+ };
335
+ const levelDescriptor = {
336
+ enumerable: true,
337
+ get() {
338
+ return this[LEVEL];
339
+ },
340
+ set(level) {
341
+ assertValidLevel(level);
342
+ this[LEVEL] = level;
343
+ }
344
+ };
303
345
  const applyOptions = (object, options = {}) => {
304
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
346
+ if (options.level !== void 0) assertValidLevel(options.level);
305
347
  const colorLevel = stdoutColor ? stdoutColor.level : 0;
306
- object.level = options.level === void 0 ? colorLevel : options.level;
348
+ object[LEVEL] = options.level === void 0 ? colorLevel : options.level;
307
349
  };
308
350
  const chalkFactory = (options) => {
309
351
  const chalk = (...strings) => strings.join(" ");
@@ -325,35 +367,58 @@ styles.visible = { get() {
325
367
  Object.defineProperty(this, "visible", { value: builder });
326
368
  return builder;
327
369
  } };
328
- const getModelAnsi = (model, level, type, ...arguments_) => {
370
+ const createModelConverters = (model, type) => {
371
+ const style = ansiStyles[type];
329
372
  if (model === "rgb") {
330
- if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
331
- if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
332
- return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
373
+ const ansi = (red, green, blue) => style.ansi(ansiStyles.rgbToAnsi(red, green, blue));
374
+ const ansi256 = (red, green, blue) => style.ansi256(ansiStyles.rgbToAnsi256(red, green, blue));
375
+ return [
376
+ ansi,
377
+ ansi,
378
+ ansi256,
379
+ style.ansi16m
380
+ ];
333
381
  }
334
- if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
335
- return ansiStyles[type][model](...arguments_);
382
+ if (model === "hex") {
383
+ const ansi = (hex) => style.ansi(ansiStyles.hexToAnsi(hex));
384
+ const ansi256 = (hex) => style.ansi256(ansiStyles.hexToAnsi256(hex));
385
+ return [
386
+ ansi,
387
+ ansi,
388
+ ansi256,
389
+ (hex) => style.ansi16m(...ansiStyles.hexToRgb(hex))
390
+ ];
391
+ }
392
+ const ansi = (code) => style.ansi(ansiStyles.ansi256ToAnsi(code));
393
+ return [
394
+ ansi,
395
+ ansi,
396
+ style.ansi256,
397
+ style.ansi256
398
+ ];
336
399
  };
337
400
  for (const model of [
338
401
  "rgb",
339
402
  "hex",
340
403
  "ansi256"
341
404
  ]) {
342
- styles[model] = { get() {
343
- const { level } = this;
344
- return function(...arguments_) {
345
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
346
- return createBuilder(this, styler, this[IS_EMPTY]);
347
- };
348
- } };
349
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
350
- styles[bgModel] = { get() {
351
- const { level } = this;
352
- return function(...arguments_) {
353
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
354
- return createBuilder(this, styler, this[IS_EMPTY]);
355
- };
356
- } };
405
+ const capitalizedModel = model[0].toUpperCase() + model.slice(1);
406
+ for (const [styleName, type] of [
407
+ [model, "color"],
408
+ ["bg" + capitalizedModel, "bgColor"],
409
+ ["underline" + capitalizedModel, "underlineColor"]
410
+ ]) {
411
+ const { close } = ansiStyles[type];
412
+ const converters = createModelConverters(model, type);
413
+ styles[styleName] = { get() {
414
+ const styleFunction = function(first, second, third) {
415
+ const open = converters[this.level](first, second, third);
416
+ return createBuilder(this, createStyler(open, close, this[STYLER]), this[IS_EMPTY]);
417
+ };
418
+ Object.defineProperty(this, styleName, { value: styleFunction });
419
+ return styleFunction;
420
+ } };
421
+ }
357
422
  }
358
423
  const proto = Object.defineProperties(() => {}, {
359
424
  ...styles,
@@ -386,15 +451,19 @@ const createStyler = (open, close, parent) => {
386
451
  };
387
452
  };
388
453
  const createBuilder = (self, _styler, _isEmpty) => {
389
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
454
+ const builder = (...arguments_) => {
455
+ if (arguments_.length === 1) return applyStyle(builder, "" + arguments_[0]);
456
+ if (arguments_.length === 2) return applyStyle(builder, arguments_[0] + " " + arguments_[1]);
457
+ return applyStyle(builder, arguments_.join(" "));
458
+ };
390
459
  Object.setPrototypeOf(builder, proto);
391
- builder[GENERATOR] = self;
460
+ builder[GENERATOR] = self[GENERATOR] ?? self;
392
461
  builder[STYLER] = _styler;
393
462
  builder[IS_EMPTY] = _isEmpty;
394
463
  return builder;
395
464
  };
396
465
  const applyStyle = (self, string) => {
397
- if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
466
+ if (self[GENERATOR][LEVEL] <= 0 || !string) return self[IS_EMPTY] ? "" : string;
398
467
  let styler = self[STYLER];
399
468
  if (styler === void 0) return string;
400
469
  const { openAll, closeAll } = styler;
@@ -406,7 +475,10 @@ const applyStyle = (self, string) => {
406
475
  if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
407
476
  return openAll + string + closeAll;
408
477
  };
409
- Object.defineProperties(createChalk.prototype, styles);
478
+ Object.defineProperties(createChalk.prototype, {
479
+ ...styles,
480
+ level: levelDescriptor
481
+ });
410
482
  const chalk = createChalk();
411
483
  createChalk({ level: stderrColor ? stderrColor.level : 0 });
412
484
  //#endregion
@@ -463,7 +535,7 @@ const range = (a, b, str) => {
463
535
  return result;
464
536
  };
465
537
  //#endregion
466
- //#region ../../node_modules/.pnpm/brace-expansion@5.0.7/node_modules/brace-expansion/dist/esm/index.js
538
+ //#region ../../node_modules/.pnpm/brace-expansion@5.0.9/node_modules/brace-expansion/dist/esm/index.js
467
539
  const escSlash = "\0SLASH" + Math.random() + "\0";
468
540
  const escOpen = "\0OPEN" + Math.random() + "\0";
469
541
  const escClose = "\0CLOSE" + Math.random() + "\0";
@@ -480,6 +552,7 @@ const closePattern = /\\}/g;
480
552
  const commaPattern = /\\,/g;
481
553
  const periodPattern = /\\\./g;
482
554
  const EXPANSION_MAX = 1e5;
555
+ const EXPANSION_MAX_LENGTH = 4e6;
483
556
  function numeric(str) {
484
557
  return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
485
558
  }
@@ -512,9 +585,9 @@ function parseCommaParts(str) {
512
585
  }
513
586
  function expand(str, options = {}) {
514
587
  if (!str) return [];
515
- const { max = EXPANSION_MAX } = options;
588
+ const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options;
516
589
  if (str.slice(0, 2) === "{}") str = "\\{\\}" + str.slice(2);
517
- return expand_(escapeBraces(str), max, true).map(unescapeBraces);
590
+ return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
518
591
  }
519
592
  function embrace(str) {
520
593
  return "{" + str + "}";
@@ -528,20 +601,72 @@ function lte(i, y) {
528
601
  function gte(i, y) {
529
602
  return i >= y;
530
603
  }
531
- function expand_(str, max, isTop) {
532
- /** @type {string[]} */
533
- const expansions = [];
604
+ function combine(acc, pre, values, max, maxLength, dropEmpties) {
605
+ const out = [];
606
+ let length = 0;
607
+ for (let a = 0; a < acc.length; a++) for (let v = 0; v < values.length; v++) {
608
+ if (out.length >= max) return out;
609
+ const expansion = acc[a] + pre + values[v];
610
+ if (dropEmpties && !expansion) continue;
611
+ if (length + expansion.length > maxLength) return out;
612
+ out.push(expansion);
613
+ length += expansion.length;
614
+ }
615
+ return out;
616
+ }
617
+ function expandSequence(body, isAlphaSequence, max, maxLength) {
618
+ const n = body.split(/\.\./);
619
+ const N = [];
620
+ /* c8 ignore start */
621
+ if (n[0] === void 0 || n[1] === void 0) return N;
622
+ /* c8 ignore stop */
623
+ const x = numeric(n[0]);
624
+ const y = numeric(n[1]);
625
+ const width = Math.max(n[0].length, n[1].length);
626
+ let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
627
+ let test = lte;
628
+ if (y < x) {
629
+ incr *= -1;
630
+ test = gte;
631
+ }
632
+ const pad = n.some(isPadded);
633
+ let length = 0;
634
+ for (let i = x; test(i, y) && N.length < max; i += incr) {
635
+ let c;
636
+ if (isAlphaSequence) {
637
+ c = String.fromCharCode(i);
638
+ if (c === "\\") c = "";
639
+ } else {
640
+ c = String(i);
641
+ if (pad) {
642
+ const need = width - c.length;
643
+ if (need > 0) {
644
+ const z = new Array(need + 1).join("0");
645
+ if (i < 0) c = "-" + z + c.slice(1);
646
+ else c = z + c;
647
+ }
648
+ }
649
+ }
650
+ if (length + c.length > maxLength) break;
651
+ N.push(c);
652
+ length += c.length;
653
+ }
654
+ return N;
655
+ }
656
+ function expand_(str, max, maxLength, isTop) {
657
+ let acc = [""];
658
+ let dropEmpties = false;
659
+ let firstGroup = true;
534
660
  for (;;) {
535
661
  const m = balanced("{", "}", str);
536
- if (!m) return [str];
662
+ if (!m) return combine(acc, str, [""], max, maxLength, dropEmpties);
537
663
  const pre = m.pre;
538
- if (/\$$/.test(m.pre)) {
539
- const post = m.post.length ? expand_(m.post, max, false) : [""];
540
- for (let k = 0; k < post.length && k < max; k++) {
541
- const expansion = pre + "{" + m.body + "}" + post[k];
542
- expansions.push(expansion);
543
- }
544
- return expansions;
664
+ if (/\$$/.test(pre)) {
665
+ acc = combine(acc, pre + "{" + m.body + "}", [""], max, maxLength, dropEmpties && !m.post.length);
666
+ firstGroup = false;
667
+ if (!m.post.length) break;
668
+ str = m.post;
669
+ continue;
545
670
  }
546
671
  const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
547
672
  const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
@@ -553,70 +678,56 @@ function expand_(str, max, isTop) {
553
678
  isTop = true;
554
679
  continue;
555
680
  }
556
- return [str];
681
+ return combine(acc, pre + "{" + m.body + "}" + m.post, [""], max, maxLength, dropEmpties);
557
682
  }
558
- const post = m.post.length ? expand_(m.post, max, false) : [""];
559
- let n;
560
- if (isSequence) n = m.body.split(/\.\./);
683
+ if (firstGroup) {
684
+ dropEmpties = isTop && !isSequence;
685
+ firstGroup = false;
686
+ }
687
+ let values;
688
+ if (isSequence) values = expandSequence(m.body, isAlphaSequence, max, maxLength);
561
689
  else {
562
- n = parseCommaParts(m.body);
690
+ let n = parseCommaParts(m.body);
563
691
  if (n.length === 1 && n[0] !== void 0) {
564
- n = expand_(n[0], max, false).map(embrace);
692
+ n = expand_(n[0], max, maxLength, false).map(embrace);
565
693
  /* c8 ignore start */
566
- if (n.length === 1) return post.map((p) => m.pre + n[0] + p);
567
- }
568
- }
569
- let N;
570
- if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
571
- const x = numeric(n[0]);
572
- const y = numeric(n[1]);
573
- const width = Math.max(n[0].length, n[1].length);
574
- let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
575
- let test = lte;
576
- if (y < x) {
577
- incr *= -1;
578
- test = gte;
694
+ if (n.length === 1) {
695
+ acc = combine(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length);
696
+ if (!m.post.length) break;
697
+ str = m.post;
698
+ continue;
699
+ }
579
700
  }
580
- const pad = n.some(isPadded);
581
- N = [];
582
- for (let i = x; test(i, y) && N.length < max; i += incr) {
583
- let c;
584
- if (isAlphaSequence) {
585
- c = String.fromCharCode(i);
586
- if (c === "\\") c = "";
587
- } else {
588
- c = String(i);
589
- if (pad) {
590
- const need = width - c.length;
591
- if (need > 0) {
592
- const z = new Array(need + 1).join("0");
593
- if (i < 0) c = "-" + z + c.slice(1);
594
- else c = z + c;
595
- }
596
- }
701
+ let dropsEmpties = dropEmpties && !m.post.length && !pre;
702
+ for (let d = 0; dropsEmpties && d < acc.length; d++) if (acc[d]) dropsEmpties = false;
703
+ values = [];
704
+ let valuesLength = 0;
705
+ outer: for (let j = 0; j < n.length; j++) {
706
+ const expanded = expand_(n[j], max, maxLength, false);
707
+ for (let k = 0; k < expanded.length; k++) {
708
+ const v = expanded[k];
709
+ if (dropsEmpties && !v) continue;
710
+ if (values.length >= max || valuesLength + v.length > maxLength) break outer;
711
+ values.push(v);
712
+ valuesLength += v.length;
597
713
  }
598
- N.push(c);
599
714
  }
600
- } else {
601
- N = [];
602
- for (let j = 0; j < n.length; j++) N.push.apply(N, expand_(n[j], max, false));
603
- }
604
- for (let j = 0; j < N.length; j++) for (let k = 0; k < post.length && expansions.length < max; k++) {
605
- const expansion = pre + N[j] + post[k];
606
- if (!isTop || isSequence || expansion) expansions.push(expansion);
607
715
  }
608
- return expansions;
716
+ acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
717
+ if (!m.post.length) break;
718
+ str = m.post;
609
719
  }
720
+ return acc;
610
721
  }
611
722
  //#endregion
612
- //#region ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js
613
- const MAX_PATTERN_LENGTH = 1024 * 64;
723
+ //#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js
724
+ const MAX_PATTERN_LENGTH = 65536;
614
725
  const assertValidPattern = (pattern) => {
615
726
  if (typeof pattern !== "string") throw new TypeError("invalid pattern");
616
727
  if (pattern.length > MAX_PATTERN_LENGTH) throw new TypeError("pattern is too long");
617
728
  };
618
729
  //#endregion
619
- //#region ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/brace-expressions.js
730
+ //#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js
620
731
  const posixClasses = {
621
732
  "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
622
733
  "[:alpha:]": ["\\p{L}\\p{Nl}", true],
@@ -740,7 +851,7 @@ const parseClass = (glob, position) => {
740
851
  ];
741
852
  };
742
853
  //#endregion
743
- //#region ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js
854
+ //#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js
744
855
  /**
745
856
  * Un-escape a string that has been escaped with {@link escape}.
746
857
  *
@@ -765,7 +876,7 @@ const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}
765
876
  return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
766
877
  };
767
878
  //#endregion
768
- //#region ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js
879
+ //#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js
769
880
  var _a;
770
881
  const types = /* @__PURE__ */ new Set([
771
882
  "!",
@@ -1274,7 +1385,7 @@ var AST = class {
1274
1385
  };
1275
1386
  _a = AST;
1276
1387
  //#endregion
1277
- //#region ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/escape.js
1388
+ //#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js
1278
1389
  /**
1279
1390
  * Escape all magic characters in a glob pattern.
1280
1391
  *
@@ -1292,7 +1403,7 @@ const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {})
1292
1403
  return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
1293
1404
  };
1294
1405
  //#endregion
1295
- //#region ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js
1406
+ //#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js
1296
1407
  const minimatch = (p, pattern, options = {}) => {
1297
1408
  assertValidPattern(pattern);
1298
1409
  if (!options.nocomment && pattern.charAt(0) === "#") return false;