@vertaaux/cli 0.5.0 → 0.5.1
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.
- package/CHANGELOG.md +19 -0
- package/README.md +28 -1
- package/dist/app/interactive-app.d.ts +2 -0
- package/dist/app/interactive-app.d.ts.map +1 -1
- package/dist/app/interactive-app.js +26 -7
- package/dist/app/menu/categories.d.ts +2 -2
- package/dist/app/menu/categories.d.ts.map +1 -1
- package/dist/app/menu/categories.js +3 -18
- package/dist/app/views/command-runner.d.ts.map +1 -1
- package/dist/app/views/command-runner.js +52 -9
- package/dist/app/views/help-overlay.d.ts +1 -1
- package/dist/app/views/help-overlay.d.ts.map +1 -1
- package/dist/app/views/help-overlay.js +5 -4
- package/dist/commands/a11y.d.ts +4 -2
- package/dist/commands/a11y.d.ts.map +1 -1
- package/dist/commands/a11y.js +82 -9
- package/dist/commands/audit/index.d.ts.map +1 -1
- package/dist/commands/audit/index.js +33 -8
- package/dist/commands/audit/output.d.ts.map +1 -1
- package/dist/commands/audit/output.js +3 -4
- package/dist/commands/audit/policy.d.ts +10 -2
- package/dist/commands/audit/policy.d.ts.map +1 -1
- package/dist/commands/audit/policy.js +47 -2
- package/dist/commands/audit/types.d.ts +1 -0
- package/dist/commands/audit/types.d.ts.map +1 -1
- package/dist/commands/baseline.d.ts +1 -0
- package/dist/commands/baseline.d.ts.map +1 -1
- package/dist/commands/baseline.js +26 -12
- package/dist/commands/comment.d.ts.map +1 -1
- package/dist/commands/comment.js +8 -7
- package/dist/commands/compare.js +3 -3
- package/dist/commands/diff.d.ts +2 -0
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +23 -12
- package/dist/commands/doc.js +2 -2
- package/dist/commands/doctor.js +2 -2
- package/dist/commands/explain.js +3 -3
- package/dist/commands/fix-all.js +2 -2
- package/dist/commands/fix-plan.d.ts.map +1 -1
- package/dist/commands/fix-plan.js +4 -3
- package/dist/commands/fix.js +5 -5
- package/dist/commands/patch-review.js +2 -2
- package/dist/commands/policy.js +2 -2
- package/dist/commands/release-notes.js +3 -3
- package/dist/commands/suggest.d.ts.map +1 -1
- package/dist/commands/suggest.js +28 -2
- package/dist/commands/triage.js +3 -3
- package/dist/commands/verify.js +3 -3
- package/dist/config/schema.d.ts +4 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/output/envelope.d.ts +8 -1
- package/dist/output/envelope.d.ts.map +1 -1
- package/dist/output/envelope.js +24 -6
- package/dist/policy/schema.d.ts +137 -0
- package/dist/policy/schema.d.ts.map +1 -1
- package/dist/policy/schema.js +107 -0
- package/dist/prompts/command-catalog.js +9 -9
- package/dist/utils/client.d.ts.map +1 -1
- package/dist/utils/client.js +30 -28
- package/dist/utils/root-args.d.ts +12 -0
- package/dist/utils/root-args.d.ts.map +1 -0
- package/dist/utils/root-args.js +44 -0
- package/dist/utils/stdin.d.ts +7 -0
- package/dist/utils/stdin.d.ts.map +1 -1
- package/dist/utils/stdin.js +32 -2
- package/node_modules/@vertaaux/tui/dist/index.cjs +505 -9
- package/node_modules/@vertaaux/tui/dist/index.cjs.map +1 -1
- package/node_modules/@vertaaux/tui/dist/index.js +502 -8
- package/node_modules/@vertaaux/tui/dist/index.js.map +1 -1
- package/node_modules/@vertaaux/tui/package.json +2 -3
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +83 -0
- package/node_modules/chalk/readme.md +297 -0
- package/node_modules/chalk/source/index.d.ts +325 -0
- package/node_modules/chalk/source/index.js +225 -0
- package/node_modules/chalk/source/utilities.js +33 -0
- package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
- package/package.json +9 -2
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var process2 = require('process');
|
|
4
|
+
var os = require('os');
|
|
5
|
+
var tty = require('tty');
|
|
4
6
|
var events = require('events');
|
|
5
7
|
|
|
6
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
9
|
|
|
8
|
-
var
|
|
10
|
+
var process2__default = /*#__PURE__*/_interopDefault(process2);
|
|
11
|
+
var os__default = /*#__PURE__*/_interopDefault(os);
|
|
12
|
+
var tty__default = /*#__PURE__*/_interopDefault(tty);
|
|
9
13
|
|
|
10
14
|
var __defProp = Object.defineProperty;
|
|
11
15
|
var __export = (target, all) => {
|
|
@@ -142,6 +146,498 @@ function truncate(str, maxWidth) {
|
|
|
142
146
|
if (maxWidth <= 3) return stripped.slice(0, maxWidth);
|
|
143
147
|
return stripped.slice(0, maxWidth - 1) + "\u2026";
|
|
144
148
|
}
|
|
149
|
+
|
|
150
|
+
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
151
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
152
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
153
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
154
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
155
|
+
var styles = {
|
|
156
|
+
modifier: {
|
|
157
|
+
reset: [0, 0],
|
|
158
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
159
|
+
bold: [1, 22],
|
|
160
|
+
dim: [2, 22],
|
|
161
|
+
italic: [3, 23],
|
|
162
|
+
underline: [4, 24],
|
|
163
|
+
overline: [53, 55],
|
|
164
|
+
inverse: [7, 27],
|
|
165
|
+
hidden: [8, 28],
|
|
166
|
+
strikethrough: [9, 29]
|
|
167
|
+
},
|
|
168
|
+
color: {
|
|
169
|
+
black: [30, 39],
|
|
170
|
+
red: [31, 39],
|
|
171
|
+
green: [32, 39],
|
|
172
|
+
yellow: [33, 39],
|
|
173
|
+
blue: [34, 39],
|
|
174
|
+
magenta: [35, 39],
|
|
175
|
+
cyan: [36, 39],
|
|
176
|
+
white: [37, 39],
|
|
177
|
+
// Bright color
|
|
178
|
+
blackBright: [90, 39],
|
|
179
|
+
gray: [90, 39],
|
|
180
|
+
// Alias of `blackBright`
|
|
181
|
+
grey: [90, 39],
|
|
182
|
+
// Alias of `blackBright`
|
|
183
|
+
redBright: [91, 39],
|
|
184
|
+
greenBright: [92, 39],
|
|
185
|
+
yellowBright: [93, 39],
|
|
186
|
+
blueBright: [94, 39],
|
|
187
|
+
magentaBright: [95, 39],
|
|
188
|
+
cyanBright: [96, 39],
|
|
189
|
+
whiteBright: [97, 39]
|
|
190
|
+
},
|
|
191
|
+
bgColor: {
|
|
192
|
+
bgBlack: [40, 49],
|
|
193
|
+
bgRed: [41, 49],
|
|
194
|
+
bgGreen: [42, 49],
|
|
195
|
+
bgYellow: [43, 49],
|
|
196
|
+
bgBlue: [44, 49],
|
|
197
|
+
bgMagenta: [45, 49],
|
|
198
|
+
bgCyan: [46, 49],
|
|
199
|
+
bgWhite: [47, 49],
|
|
200
|
+
// Bright color
|
|
201
|
+
bgBlackBright: [100, 49],
|
|
202
|
+
bgGray: [100, 49],
|
|
203
|
+
// Alias of `bgBlackBright`
|
|
204
|
+
bgGrey: [100, 49],
|
|
205
|
+
// Alias of `bgBlackBright`
|
|
206
|
+
bgRedBright: [101, 49],
|
|
207
|
+
bgGreenBright: [102, 49],
|
|
208
|
+
bgYellowBright: [103, 49],
|
|
209
|
+
bgBlueBright: [104, 49],
|
|
210
|
+
bgMagentaBright: [105, 49],
|
|
211
|
+
bgCyanBright: [106, 49],
|
|
212
|
+
bgWhiteBright: [107, 49]
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
Object.keys(styles.modifier);
|
|
216
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
217
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
218
|
+
[...foregroundColorNames, ...backgroundColorNames];
|
|
219
|
+
function assembleStyles() {
|
|
220
|
+
const codes = /* @__PURE__ */ new Map();
|
|
221
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
222
|
+
for (const [styleName, style2] of Object.entries(group)) {
|
|
223
|
+
styles[styleName] = {
|
|
224
|
+
open: `\x1B[${style2[0]}m`,
|
|
225
|
+
close: `\x1B[${style2[1]}m`
|
|
226
|
+
};
|
|
227
|
+
group[styleName] = styles[styleName];
|
|
228
|
+
codes.set(style2[0], style2[1]);
|
|
229
|
+
}
|
|
230
|
+
Object.defineProperty(styles, groupName, {
|
|
231
|
+
value: group,
|
|
232
|
+
enumerable: false
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
Object.defineProperty(styles, "codes", {
|
|
236
|
+
value: codes,
|
|
237
|
+
enumerable: false
|
|
238
|
+
});
|
|
239
|
+
styles.color.close = "\x1B[39m";
|
|
240
|
+
styles.bgColor.close = "\x1B[49m";
|
|
241
|
+
styles.color.ansi = wrapAnsi16();
|
|
242
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
243
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
244
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
245
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
246
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
247
|
+
Object.defineProperties(styles, {
|
|
248
|
+
rgbToAnsi256: {
|
|
249
|
+
value(red, green, blue) {
|
|
250
|
+
if (red === green && green === blue) {
|
|
251
|
+
if (red < 8) {
|
|
252
|
+
return 16;
|
|
253
|
+
}
|
|
254
|
+
if (red > 248) {
|
|
255
|
+
return 231;
|
|
256
|
+
}
|
|
257
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
258
|
+
}
|
|
259
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
260
|
+
},
|
|
261
|
+
enumerable: false
|
|
262
|
+
},
|
|
263
|
+
hexToRgb: {
|
|
264
|
+
value(hex) {
|
|
265
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
266
|
+
if (!matches) {
|
|
267
|
+
return [0, 0, 0];
|
|
268
|
+
}
|
|
269
|
+
let [colorString] = matches;
|
|
270
|
+
if (colorString.length === 3) {
|
|
271
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
272
|
+
}
|
|
273
|
+
const integer = Number.parseInt(colorString, 16);
|
|
274
|
+
return [
|
|
275
|
+
/* eslint-disable no-bitwise */
|
|
276
|
+
integer >> 16 & 255,
|
|
277
|
+
integer >> 8 & 255,
|
|
278
|
+
integer & 255
|
|
279
|
+
/* eslint-enable no-bitwise */
|
|
280
|
+
];
|
|
281
|
+
},
|
|
282
|
+
enumerable: false
|
|
283
|
+
},
|
|
284
|
+
hexToAnsi256: {
|
|
285
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
286
|
+
enumerable: false
|
|
287
|
+
},
|
|
288
|
+
ansi256ToAnsi: {
|
|
289
|
+
value(code) {
|
|
290
|
+
if (code < 8) {
|
|
291
|
+
return 30 + code;
|
|
292
|
+
}
|
|
293
|
+
if (code < 16) {
|
|
294
|
+
return 90 + (code - 8);
|
|
295
|
+
}
|
|
296
|
+
let red;
|
|
297
|
+
let green;
|
|
298
|
+
let blue;
|
|
299
|
+
if (code >= 232) {
|
|
300
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
301
|
+
green = red;
|
|
302
|
+
blue = red;
|
|
303
|
+
} else {
|
|
304
|
+
code -= 16;
|
|
305
|
+
const remainder = code % 36;
|
|
306
|
+
red = Math.floor(code / 36) / 5;
|
|
307
|
+
green = Math.floor(remainder / 6) / 5;
|
|
308
|
+
blue = remainder % 6 / 5;
|
|
309
|
+
}
|
|
310
|
+
const value = Math.max(red, green, blue) * 2;
|
|
311
|
+
if (value === 0) {
|
|
312
|
+
return 30;
|
|
313
|
+
}
|
|
314
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
315
|
+
if (value === 2) {
|
|
316
|
+
result += 60;
|
|
317
|
+
}
|
|
318
|
+
return result;
|
|
319
|
+
},
|
|
320
|
+
enumerable: false
|
|
321
|
+
},
|
|
322
|
+
rgbToAnsi: {
|
|
323
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
324
|
+
enumerable: false
|
|
325
|
+
},
|
|
326
|
+
hexToAnsi: {
|
|
327
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
328
|
+
enumerable: false
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
return styles;
|
|
332
|
+
}
|
|
333
|
+
var ansiStyles = assembleStyles();
|
|
334
|
+
var ansi_styles_default = ansiStyles;
|
|
335
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2__default.default.argv) {
|
|
336
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
337
|
+
const position = argv.indexOf(prefix + flag);
|
|
338
|
+
const terminatorPosition = argv.indexOf("--");
|
|
339
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
340
|
+
}
|
|
341
|
+
var { env } = process2__default.default;
|
|
342
|
+
var flagForceColor;
|
|
343
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
344
|
+
flagForceColor = 0;
|
|
345
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
346
|
+
flagForceColor = 1;
|
|
347
|
+
}
|
|
348
|
+
function envForceColor() {
|
|
349
|
+
if ("FORCE_COLOR" in env) {
|
|
350
|
+
if (env.FORCE_COLOR === "true") {
|
|
351
|
+
return 1;
|
|
352
|
+
}
|
|
353
|
+
if (env.FORCE_COLOR === "false") {
|
|
354
|
+
return 0;
|
|
355
|
+
}
|
|
356
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function translateLevel(level) {
|
|
360
|
+
if (level === 0) {
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
363
|
+
return {
|
|
364
|
+
level,
|
|
365
|
+
hasBasic: true,
|
|
366
|
+
has256: level >= 2,
|
|
367
|
+
has16m: level >= 3
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
371
|
+
const noFlagForceColor = envForceColor();
|
|
372
|
+
if (noFlagForceColor !== void 0) {
|
|
373
|
+
flagForceColor = noFlagForceColor;
|
|
374
|
+
}
|
|
375
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
376
|
+
if (forceColor === 0) {
|
|
377
|
+
return 0;
|
|
378
|
+
}
|
|
379
|
+
if (sniffFlags) {
|
|
380
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
381
|
+
return 3;
|
|
382
|
+
}
|
|
383
|
+
if (hasFlag("color=256")) {
|
|
384
|
+
return 2;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
388
|
+
return 1;
|
|
389
|
+
}
|
|
390
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
391
|
+
return 0;
|
|
392
|
+
}
|
|
393
|
+
const min = forceColor || 0;
|
|
394
|
+
if (env.TERM === "dumb") {
|
|
395
|
+
return min;
|
|
396
|
+
}
|
|
397
|
+
if (process2__default.default.platform === "win32") {
|
|
398
|
+
const osRelease = os__default.default.release().split(".");
|
|
399
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
400
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
401
|
+
}
|
|
402
|
+
return 1;
|
|
403
|
+
}
|
|
404
|
+
if ("CI" in env) {
|
|
405
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
|
406
|
+
return 3;
|
|
407
|
+
}
|
|
408
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
409
|
+
return 1;
|
|
410
|
+
}
|
|
411
|
+
return min;
|
|
412
|
+
}
|
|
413
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
414
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
415
|
+
}
|
|
416
|
+
if (env.COLORTERM === "truecolor") {
|
|
417
|
+
return 3;
|
|
418
|
+
}
|
|
419
|
+
if (env.TERM === "xterm-kitty") {
|
|
420
|
+
return 3;
|
|
421
|
+
}
|
|
422
|
+
if (env.TERM === "xterm-ghostty") {
|
|
423
|
+
return 3;
|
|
424
|
+
}
|
|
425
|
+
if (env.TERM === "wezterm") {
|
|
426
|
+
return 3;
|
|
427
|
+
}
|
|
428
|
+
if ("TERM_PROGRAM" in env) {
|
|
429
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
430
|
+
switch (env.TERM_PROGRAM) {
|
|
431
|
+
case "iTerm.app": {
|
|
432
|
+
return version >= 3 ? 3 : 2;
|
|
433
|
+
}
|
|
434
|
+
case "Apple_Terminal": {
|
|
435
|
+
return 2;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
440
|
+
return 2;
|
|
441
|
+
}
|
|
442
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
443
|
+
return 1;
|
|
444
|
+
}
|
|
445
|
+
if ("COLORTERM" in env) {
|
|
446
|
+
return 1;
|
|
447
|
+
}
|
|
448
|
+
return min;
|
|
449
|
+
}
|
|
450
|
+
function createSupportsColor(stream, options = {}) {
|
|
451
|
+
const level = _supportsColor(stream, {
|
|
452
|
+
streamIsTTY: stream && stream.isTTY,
|
|
453
|
+
...options
|
|
454
|
+
});
|
|
455
|
+
return translateLevel(level);
|
|
456
|
+
}
|
|
457
|
+
var supportsColor = {
|
|
458
|
+
stdout: createSupportsColor({ isTTY: tty__default.default.isatty(1) }),
|
|
459
|
+
stderr: createSupportsColor({ isTTY: tty__default.default.isatty(2) })
|
|
460
|
+
};
|
|
461
|
+
var supports_color_default = supportsColor;
|
|
462
|
+
|
|
463
|
+
// node_modules/chalk/source/utilities.js
|
|
464
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
465
|
+
let index = string.indexOf(substring);
|
|
466
|
+
if (index === -1) {
|
|
467
|
+
return string;
|
|
468
|
+
}
|
|
469
|
+
const substringLength = substring.length;
|
|
470
|
+
let endIndex = 0;
|
|
471
|
+
let returnValue = "";
|
|
472
|
+
do {
|
|
473
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
474
|
+
endIndex = index + substringLength;
|
|
475
|
+
index = string.indexOf(substring, endIndex);
|
|
476
|
+
} while (index !== -1);
|
|
477
|
+
returnValue += string.slice(endIndex);
|
|
478
|
+
return returnValue;
|
|
479
|
+
}
|
|
480
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
481
|
+
let endIndex = 0;
|
|
482
|
+
let returnValue = "";
|
|
483
|
+
do {
|
|
484
|
+
const gotCR = string[index - 1] === "\r";
|
|
485
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
486
|
+
endIndex = index + 1;
|
|
487
|
+
index = string.indexOf("\n", endIndex);
|
|
488
|
+
} while (index !== -1);
|
|
489
|
+
returnValue += string.slice(endIndex);
|
|
490
|
+
return returnValue;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// node_modules/chalk/source/index.js
|
|
494
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
495
|
+
var GENERATOR = /* @__PURE__ */ Symbol("GENERATOR");
|
|
496
|
+
var STYLER = /* @__PURE__ */ Symbol("STYLER");
|
|
497
|
+
var IS_EMPTY = /* @__PURE__ */ Symbol("IS_EMPTY");
|
|
498
|
+
var levelMapping = [
|
|
499
|
+
"ansi",
|
|
500
|
+
"ansi",
|
|
501
|
+
"ansi256",
|
|
502
|
+
"ansi16m"
|
|
503
|
+
];
|
|
504
|
+
var styles2 = /* @__PURE__ */ Object.create(null);
|
|
505
|
+
var applyOptions = (object, options = {}) => {
|
|
506
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
507
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
508
|
+
}
|
|
509
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
510
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
511
|
+
};
|
|
512
|
+
var chalkFactory = (options) => {
|
|
513
|
+
const chalk2 = (...strings) => strings.join(" ");
|
|
514
|
+
applyOptions(chalk2, options);
|
|
515
|
+
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
516
|
+
return chalk2;
|
|
517
|
+
};
|
|
518
|
+
function createChalk(options) {
|
|
519
|
+
return chalkFactory(options);
|
|
520
|
+
}
|
|
521
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
522
|
+
for (const [styleName, style2] of Object.entries(ansi_styles_default)) {
|
|
523
|
+
styles2[styleName] = {
|
|
524
|
+
get() {
|
|
525
|
+
const builder = createBuilder(this, createStyler(style2.open, style2.close, this[STYLER]), this[IS_EMPTY]);
|
|
526
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
527
|
+
return builder;
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
styles2.visible = {
|
|
532
|
+
get() {
|
|
533
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
534
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
535
|
+
return builder;
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
539
|
+
if (model === "rgb") {
|
|
540
|
+
if (level === "ansi16m") {
|
|
541
|
+
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
542
|
+
}
|
|
543
|
+
if (level === "ansi256") {
|
|
544
|
+
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
545
|
+
}
|
|
546
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
547
|
+
}
|
|
548
|
+
if (model === "hex") {
|
|
549
|
+
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
550
|
+
}
|
|
551
|
+
return ansi_styles_default[type][model](...arguments_);
|
|
552
|
+
};
|
|
553
|
+
var usedModels = ["rgb", "hex", "ansi256"];
|
|
554
|
+
for (const model of usedModels) {
|
|
555
|
+
styles2[model] = {
|
|
556
|
+
get() {
|
|
557
|
+
const { level } = this;
|
|
558
|
+
return function(...arguments_) {
|
|
559
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
560
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
565
|
+
styles2[bgModel] = {
|
|
566
|
+
get() {
|
|
567
|
+
const { level } = this;
|
|
568
|
+
return function(...arguments_) {
|
|
569
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
570
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
var proto = Object.defineProperties(() => {
|
|
576
|
+
}, {
|
|
577
|
+
...styles2,
|
|
578
|
+
level: {
|
|
579
|
+
enumerable: true,
|
|
580
|
+
get() {
|
|
581
|
+
return this[GENERATOR].level;
|
|
582
|
+
},
|
|
583
|
+
set(level) {
|
|
584
|
+
this[GENERATOR].level = level;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
var createStyler = (open, close, parent) => {
|
|
589
|
+
let openAll;
|
|
590
|
+
let closeAll;
|
|
591
|
+
if (parent === void 0) {
|
|
592
|
+
openAll = open;
|
|
593
|
+
closeAll = close;
|
|
594
|
+
} else {
|
|
595
|
+
openAll = parent.openAll + open;
|
|
596
|
+
closeAll = close + parent.closeAll;
|
|
597
|
+
}
|
|
598
|
+
return {
|
|
599
|
+
open,
|
|
600
|
+
close,
|
|
601
|
+
openAll,
|
|
602
|
+
closeAll,
|
|
603
|
+
parent
|
|
604
|
+
};
|
|
605
|
+
};
|
|
606
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
607
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
608
|
+
Object.setPrototypeOf(builder, proto);
|
|
609
|
+
builder[GENERATOR] = self;
|
|
610
|
+
builder[STYLER] = _styler;
|
|
611
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
612
|
+
return builder;
|
|
613
|
+
};
|
|
614
|
+
var applyStyle = (self, string) => {
|
|
615
|
+
if (self.level <= 0 || !string) {
|
|
616
|
+
return self[IS_EMPTY] ? "" : string;
|
|
617
|
+
}
|
|
618
|
+
let styler = self[STYLER];
|
|
619
|
+
if (styler === void 0) {
|
|
620
|
+
return string;
|
|
621
|
+
}
|
|
622
|
+
const { openAll, closeAll } = styler;
|
|
623
|
+
if (string.includes("\x1B")) {
|
|
624
|
+
while (styler !== void 0) {
|
|
625
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
626
|
+
styler = styler.parent;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
const lfIndex = string.indexOf("\n");
|
|
630
|
+
if (lfIndex !== -1) {
|
|
631
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
632
|
+
}
|
|
633
|
+
return openAll + string + closeAll;
|
|
634
|
+
};
|
|
635
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
|
636
|
+
var chalk = createChalk();
|
|
637
|
+
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
638
|
+
var source_default = chalk;
|
|
639
|
+
|
|
640
|
+
// src/theme.ts
|
|
145
641
|
var brand = {
|
|
146
642
|
lime: "#78FFB4",
|
|
147
643
|
tealLight: "#6BEEBD",
|
|
@@ -202,26 +698,26 @@ var tokens = {
|
|
|
202
698
|
var _colorEnabled = true;
|
|
203
699
|
function setColorEnabled(enabled) {
|
|
204
700
|
_colorEnabled = enabled;
|
|
205
|
-
|
|
701
|
+
source_default.level = enabled ? 3 : 0;
|
|
206
702
|
}
|
|
207
703
|
function isColorEnabled() {
|
|
208
704
|
return _colorEnabled;
|
|
209
705
|
}
|
|
210
706
|
function colorize(text, hex) {
|
|
211
707
|
if (!_colorEnabled) return text;
|
|
212
|
-
return
|
|
708
|
+
return source_default.hex(hex)(text);
|
|
213
709
|
}
|
|
214
710
|
function boldColor(text, hex) {
|
|
215
711
|
if (!_colorEnabled) return text;
|
|
216
|
-
return
|
|
712
|
+
return source_default.hex(hex).bold(text);
|
|
217
713
|
}
|
|
218
714
|
function dim(text) {
|
|
219
715
|
if (!_colorEnabled) return text;
|
|
220
|
-
return
|
|
716
|
+
return source_default.dim(text);
|
|
221
717
|
}
|
|
222
718
|
function bold(text) {
|
|
223
719
|
if (!_colorEnabled) return text;
|
|
224
|
-
return
|
|
720
|
+
return source_default.bold(text);
|
|
225
721
|
}
|
|
226
722
|
function severityColor(level) {
|
|
227
723
|
const normalized = (level || "info").toLowerCase();
|
|
@@ -232,7 +728,7 @@ function severityColor(level) {
|
|
|
232
728
|
}
|
|
233
729
|
function bgColor(text, hex) {
|
|
234
730
|
if (!_colorEnabled) return text;
|
|
235
|
-
return
|
|
731
|
+
return source_default.bgHex(hex)(text);
|
|
236
732
|
}
|
|
237
733
|
function applyGradient(text, colors = gradient) {
|
|
238
734
|
if (!_colorEnabled) return text;
|
|
@@ -241,7 +737,7 @@ function applyGradient(text, colors = gradient) {
|
|
|
241
737
|
let idx = 0;
|
|
242
738
|
for (const char of text) {
|
|
243
739
|
if (char !== " " && char !== "\n") {
|
|
244
|
-
result +=
|
|
740
|
+
result += source_default.hex(colors[idx % colorCount])(char);
|
|
245
741
|
idx++;
|
|
246
742
|
} else {
|
|
247
743
|
result += char;
|