@polka-codes/runner 0.9.40 → 0.9.42
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/dist/index.js +467 -33
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -521,7 +521,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
521
521
|
this._name = name;
|
|
522
522
|
break;
|
|
523
523
|
}
|
|
524
|
-
if (this._name.
|
|
524
|
+
if (this._name.endsWith("...")) {
|
|
525
525
|
this.variadic = true;
|
|
526
526
|
this._name = this._name.slice(0, -3);
|
|
527
527
|
}
|
|
@@ -529,11 +529,12 @@ var require_argument = __commonJS((exports) => {
|
|
|
529
529
|
name() {
|
|
530
530
|
return this._name;
|
|
531
531
|
}
|
|
532
|
-
|
|
532
|
+
_collectValue(value, previous) {
|
|
533
533
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
534
534
|
return [value];
|
|
535
535
|
}
|
|
536
|
-
|
|
536
|
+
previous.push(value);
|
|
537
|
+
return previous;
|
|
537
538
|
}
|
|
538
539
|
default(value, description) {
|
|
539
540
|
this.defaultValue = value;
|
|
@@ -551,7 +552,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
551
552
|
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
552
553
|
}
|
|
553
554
|
if (this.variadic) {
|
|
554
|
-
return this.
|
|
555
|
+
return this._collectValue(arg, previous);
|
|
555
556
|
}
|
|
556
557
|
return arg;
|
|
557
558
|
};
|
|
@@ -998,11 +999,12 @@ var require_option = __commonJS((exports) => {
|
|
|
998
999
|
this.hidden = !!hide;
|
|
999
1000
|
return this;
|
|
1000
1001
|
}
|
|
1001
|
-
|
|
1002
|
+
_collectValue(value, previous) {
|
|
1002
1003
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
1003
1004
|
return [value];
|
|
1004
1005
|
}
|
|
1005
|
-
|
|
1006
|
+
previous.push(value);
|
|
1007
|
+
return previous;
|
|
1006
1008
|
}
|
|
1007
1009
|
choices(values) {
|
|
1008
1010
|
this.argChoices = values.slice();
|
|
@@ -1011,7 +1013,7 @@ var require_option = __commonJS((exports) => {
|
|
|
1011
1013
|
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
1012
1014
|
}
|
|
1013
1015
|
if (this.variadic) {
|
|
1014
|
-
return this.
|
|
1016
|
+
return this._collectValue(arg, previous);
|
|
1015
1017
|
}
|
|
1016
1018
|
return arg;
|
|
1017
1019
|
};
|
|
@@ -1317,7 +1319,10 @@ var require_command = __commonJS((exports) => {
|
|
|
1317
1319
|
configureOutput(configuration) {
|
|
1318
1320
|
if (configuration === undefined)
|
|
1319
1321
|
return this._outputConfiguration;
|
|
1320
|
-
this._outputConfiguration =
|
|
1322
|
+
this._outputConfiguration = {
|
|
1323
|
+
...this._outputConfiguration,
|
|
1324
|
+
...configuration
|
|
1325
|
+
};
|
|
1321
1326
|
return this;
|
|
1322
1327
|
}
|
|
1323
1328
|
showHelpAfterError(displayHelp = true) {
|
|
@@ -1366,7 +1371,7 @@ var require_command = __commonJS((exports) => {
|
|
|
1366
1371
|
}
|
|
1367
1372
|
addArgument(argument) {
|
|
1368
1373
|
const previousArgument = this.registeredArguments.slice(-1)[0];
|
|
1369
|
-
if (previousArgument
|
|
1374
|
+
if (previousArgument?.variadic) {
|
|
1370
1375
|
throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
|
|
1371
1376
|
}
|
|
1372
1377
|
if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
|
|
@@ -1521,7 +1526,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1521
1526
|
if (val !== null && option.parseArg) {
|
|
1522
1527
|
val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
1523
1528
|
} else if (val !== null && option.variadic) {
|
|
1524
|
-
val = option.
|
|
1529
|
+
val = option._collectValue(val, oldValue);
|
|
1525
1530
|
}
|
|
1526
1531
|
if (val == null) {
|
|
1527
1532
|
if (option.negate) {
|
|
@@ -1896,7 +1901,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1896
1901
|
this.processedArgs = processedArgs;
|
|
1897
1902
|
}
|
|
1898
1903
|
_chainOrCall(promise, fn) {
|
|
1899
|
-
if (promise
|
|
1904
|
+
if (promise?.then && typeof promise.then === "function") {
|
|
1900
1905
|
return promise.then(() => fn());
|
|
1901
1906
|
}
|
|
1902
1907
|
return fn();
|
|
@@ -1973,7 +1978,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1973
1978
|
promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
|
|
1974
1979
|
return promiseChain;
|
|
1975
1980
|
}
|
|
1976
|
-
if (this.parent
|
|
1981
|
+
if (this.parent?.listenerCount(commandEvent)) {
|
|
1977
1982
|
checkForUnknownOptions();
|
|
1978
1983
|
this._processArguments();
|
|
1979
1984
|
this.parent.emit(commandEvent, operands, unknown);
|
|
@@ -2035,11 +2040,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2035
2040
|
cmd._checkForConflictingLocalOptions();
|
|
2036
2041
|
});
|
|
2037
2042
|
}
|
|
2038
|
-
parseOptions(
|
|
2043
|
+
parseOptions(args) {
|
|
2039
2044
|
const operands = [];
|
|
2040
2045
|
const unknown = [];
|
|
2041
2046
|
let dest = operands;
|
|
2042
|
-
const args = argv.slice();
|
|
2043
2047
|
function maybeOption(arg) {
|
|
2044
2048
|
return arg.length > 1 && arg[0] === "-";
|
|
2045
2049
|
}
|
|
@@ -2049,12 +2053,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2049
2053
|
return !this._getCommandAndAncestors().some((cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short)));
|
|
2050
2054
|
};
|
|
2051
2055
|
let activeVariadicOption = null;
|
|
2052
|
-
|
|
2053
|
-
|
|
2056
|
+
let activeGroup = null;
|
|
2057
|
+
let i = 0;
|
|
2058
|
+
while (i < args.length || activeGroup) {
|
|
2059
|
+
const arg = activeGroup ?? args[i++];
|
|
2060
|
+
activeGroup = null;
|
|
2054
2061
|
if (arg === "--") {
|
|
2055
2062
|
if (dest === unknown)
|
|
2056
2063
|
dest.push(arg);
|
|
2057
|
-
dest.push(...args);
|
|
2064
|
+
dest.push(...args.slice(i));
|
|
2058
2065
|
break;
|
|
2059
2066
|
}
|
|
2060
2067
|
if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
|
|
@@ -2066,14 +2073,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2066
2073
|
const option = this._findOption(arg);
|
|
2067
2074
|
if (option) {
|
|
2068
2075
|
if (option.required) {
|
|
2069
|
-
const value = args
|
|
2076
|
+
const value = args[i++];
|
|
2070
2077
|
if (value === undefined)
|
|
2071
2078
|
this.optionMissingArgument(option);
|
|
2072
2079
|
this.emit(`option:${option.name()}`, value);
|
|
2073
2080
|
} else if (option.optional) {
|
|
2074
2081
|
let value = null;
|
|
2075
|
-
if (args.length
|
|
2076
|
-
value = args
|
|
2082
|
+
if (i < args.length && (!maybeOption(args[i]) || negativeNumberArg(args[i]))) {
|
|
2083
|
+
value = args[i++];
|
|
2077
2084
|
}
|
|
2078
2085
|
this.emit(`option:${option.name()}`, value);
|
|
2079
2086
|
} else {
|
|
@@ -2090,7 +2097,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2090
2097
|
this.emit(`option:${option.name()}`, arg.slice(2));
|
|
2091
2098
|
} else {
|
|
2092
2099
|
this.emit(`option:${option.name()}`);
|
|
2093
|
-
|
|
2100
|
+
activeGroup = `-${arg.slice(2)}`;
|
|
2094
2101
|
}
|
|
2095
2102
|
continue;
|
|
2096
2103
|
}
|
|
@@ -2109,25 +2116,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2109
2116
|
if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
|
|
2110
2117
|
if (this._findCommand(arg)) {
|
|
2111
2118
|
operands.push(arg);
|
|
2112
|
-
|
|
2113
|
-
unknown.push(...args);
|
|
2119
|
+
unknown.push(...args.slice(i));
|
|
2114
2120
|
break;
|
|
2115
2121
|
} else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
|
|
2116
|
-
operands.push(arg);
|
|
2117
|
-
if (args.length > 0)
|
|
2118
|
-
operands.push(...args);
|
|
2122
|
+
operands.push(arg, ...args.slice(i));
|
|
2119
2123
|
break;
|
|
2120
2124
|
} else if (this._defaultCommandName) {
|
|
2121
|
-
unknown.push(arg);
|
|
2122
|
-
if (args.length > 0)
|
|
2123
|
-
unknown.push(...args);
|
|
2125
|
+
unknown.push(arg, ...args.slice(i));
|
|
2124
2126
|
break;
|
|
2125
2127
|
}
|
|
2126
2128
|
}
|
|
2127
2129
|
if (this._passThroughOptions) {
|
|
2128
|
-
dest.push(arg);
|
|
2129
|
-
if (args.length > 0)
|
|
2130
|
-
dest.push(...args);
|
|
2130
|
+
dest.push(arg, ...args.slice(i));
|
|
2131
2131
|
break;
|
|
2132
2132
|
}
|
|
2133
2133
|
dest.push(arg);
|
|
@@ -27521,6 +27521,439 @@ var require_mimeScore = __commonJS((exports, module) => {
|
|
|
27521
27521
|
};
|
|
27522
27522
|
});
|
|
27523
27523
|
|
|
27524
|
+
// ../../node_modules/has-flag/index.js
|
|
27525
|
+
var require_has_flag = __commonJS((exports, module) => {
|
|
27526
|
+
module.exports = (flag, argv = process.argv) => {
|
|
27527
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
27528
|
+
const position = argv.indexOf(prefix + flag);
|
|
27529
|
+
const terminatorPosition = argv.indexOf("--");
|
|
27530
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
27531
|
+
};
|
|
27532
|
+
});
|
|
27533
|
+
|
|
27534
|
+
// ../../node_modules/chalk/node_modules/supports-color/index.js
|
|
27535
|
+
var require_supports_color = __commonJS((exports, module) => {
|
|
27536
|
+
var os = __require("os");
|
|
27537
|
+
var tty = __require("tty");
|
|
27538
|
+
var hasFlag = require_has_flag();
|
|
27539
|
+
var { env } = process;
|
|
27540
|
+
var forceColor;
|
|
27541
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
27542
|
+
forceColor = 0;
|
|
27543
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
27544
|
+
forceColor = 1;
|
|
27545
|
+
}
|
|
27546
|
+
if ("FORCE_COLOR" in env) {
|
|
27547
|
+
if (env.FORCE_COLOR === "true") {
|
|
27548
|
+
forceColor = 1;
|
|
27549
|
+
} else if (env.FORCE_COLOR === "false") {
|
|
27550
|
+
forceColor = 0;
|
|
27551
|
+
} else {
|
|
27552
|
+
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
27553
|
+
}
|
|
27554
|
+
}
|
|
27555
|
+
function translateLevel(level) {
|
|
27556
|
+
if (level === 0) {
|
|
27557
|
+
return false;
|
|
27558
|
+
}
|
|
27559
|
+
return {
|
|
27560
|
+
level,
|
|
27561
|
+
hasBasic: true,
|
|
27562
|
+
has256: level >= 2,
|
|
27563
|
+
has16m: level >= 3
|
|
27564
|
+
};
|
|
27565
|
+
}
|
|
27566
|
+
function supportsColor(haveStream, streamIsTTY) {
|
|
27567
|
+
if (forceColor === 0) {
|
|
27568
|
+
return 0;
|
|
27569
|
+
}
|
|
27570
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
27571
|
+
return 3;
|
|
27572
|
+
}
|
|
27573
|
+
if (hasFlag("color=256")) {
|
|
27574
|
+
return 2;
|
|
27575
|
+
}
|
|
27576
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
27577
|
+
return 0;
|
|
27578
|
+
}
|
|
27579
|
+
const min = forceColor || 0;
|
|
27580
|
+
if (env.TERM === "dumb") {
|
|
27581
|
+
return min;
|
|
27582
|
+
}
|
|
27583
|
+
if (process.platform === "win32") {
|
|
27584
|
+
const osRelease = os.release().split(".");
|
|
27585
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
27586
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
27587
|
+
}
|
|
27588
|
+
return 1;
|
|
27589
|
+
}
|
|
27590
|
+
if ("CI" in env) {
|
|
27591
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
|
|
27592
|
+
return 1;
|
|
27593
|
+
}
|
|
27594
|
+
return min;
|
|
27595
|
+
}
|
|
27596
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
27597
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
27598
|
+
}
|
|
27599
|
+
if (env.COLORTERM === "truecolor") {
|
|
27600
|
+
return 3;
|
|
27601
|
+
}
|
|
27602
|
+
if ("TERM_PROGRAM" in env) {
|
|
27603
|
+
const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
27604
|
+
switch (env.TERM_PROGRAM) {
|
|
27605
|
+
case "iTerm.app":
|
|
27606
|
+
return version3 >= 3 ? 3 : 2;
|
|
27607
|
+
case "Apple_Terminal":
|
|
27608
|
+
return 2;
|
|
27609
|
+
}
|
|
27610
|
+
}
|
|
27611
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
27612
|
+
return 2;
|
|
27613
|
+
}
|
|
27614
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
27615
|
+
return 1;
|
|
27616
|
+
}
|
|
27617
|
+
if ("COLORTERM" in env) {
|
|
27618
|
+
return 1;
|
|
27619
|
+
}
|
|
27620
|
+
return min;
|
|
27621
|
+
}
|
|
27622
|
+
function getSupportLevel(stream) {
|
|
27623
|
+
const level = supportsColor(stream, stream && stream.isTTY);
|
|
27624
|
+
return translateLevel(level);
|
|
27625
|
+
}
|
|
27626
|
+
module.exports = {
|
|
27627
|
+
supportsColor: getSupportLevel,
|
|
27628
|
+
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
27629
|
+
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
27630
|
+
};
|
|
27631
|
+
});
|
|
27632
|
+
|
|
27633
|
+
// ../../node_modules/chalk/source/util.js
|
|
27634
|
+
var require_util = __commonJS((exports, module) => {
|
|
27635
|
+
var stringReplaceAll = (string4, substring, replacer) => {
|
|
27636
|
+
let index = string4.indexOf(substring);
|
|
27637
|
+
if (index === -1) {
|
|
27638
|
+
return string4;
|
|
27639
|
+
}
|
|
27640
|
+
const substringLength = substring.length;
|
|
27641
|
+
let endIndex = 0;
|
|
27642
|
+
let returnValue = "";
|
|
27643
|
+
do {
|
|
27644
|
+
returnValue += string4.substr(endIndex, index - endIndex) + substring + replacer;
|
|
27645
|
+
endIndex = index + substringLength;
|
|
27646
|
+
index = string4.indexOf(substring, endIndex);
|
|
27647
|
+
} while (index !== -1);
|
|
27648
|
+
returnValue += string4.substr(endIndex);
|
|
27649
|
+
return returnValue;
|
|
27650
|
+
};
|
|
27651
|
+
var stringEncaseCRLFWithFirstIndex = (string4, prefix, postfix, index) => {
|
|
27652
|
+
let endIndex = 0;
|
|
27653
|
+
let returnValue = "";
|
|
27654
|
+
do {
|
|
27655
|
+
const gotCR = string4[index - 1] === "\r";
|
|
27656
|
+
returnValue += string4.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? `\r
|
|
27657
|
+
` : `
|
|
27658
|
+
`) + postfix;
|
|
27659
|
+
endIndex = index + 1;
|
|
27660
|
+
index = string4.indexOf(`
|
|
27661
|
+
`, endIndex);
|
|
27662
|
+
} while (index !== -1);
|
|
27663
|
+
returnValue += string4.substr(endIndex);
|
|
27664
|
+
return returnValue;
|
|
27665
|
+
};
|
|
27666
|
+
module.exports = {
|
|
27667
|
+
stringReplaceAll,
|
|
27668
|
+
stringEncaseCRLFWithFirstIndex
|
|
27669
|
+
};
|
|
27670
|
+
});
|
|
27671
|
+
|
|
27672
|
+
// ../../node_modules/chalk/source/templates.js
|
|
27673
|
+
var require_templates = __commonJS((exports, module) => {
|
|
27674
|
+
var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
27675
|
+
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
27676
|
+
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
27677
|
+
var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
27678
|
+
var ESCAPES = new Map([
|
|
27679
|
+
["n", `
|
|
27680
|
+
`],
|
|
27681
|
+
["r", "\r"],
|
|
27682
|
+
["t", "\t"],
|
|
27683
|
+
["b", "\b"],
|
|
27684
|
+
["f", "\f"],
|
|
27685
|
+
["v", "\v"],
|
|
27686
|
+
["0", "\x00"],
|
|
27687
|
+
["\\", "\\"],
|
|
27688
|
+
["e", "\x1B"],
|
|
27689
|
+
["a", "\x07"]
|
|
27690
|
+
]);
|
|
27691
|
+
function unescape(c) {
|
|
27692
|
+
const u = c[0] === "u";
|
|
27693
|
+
const bracket = c[1] === "{";
|
|
27694
|
+
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
27695
|
+
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
27696
|
+
}
|
|
27697
|
+
if (u && bracket) {
|
|
27698
|
+
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
27699
|
+
}
|
|
27700
|
+
return ESCAPES.get(c) || c;
|
|
27701
|
+
}
|
|
27702
|
+
function parseArguments(name17, arguments_) {
|
|
27703
|
+
const results = [];
|
|
27704
|
+
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
27705
|
+
let matches;
|
|
27706
|
+
for (const chunk of chunks) {
|
|
27707
|
+
const number4 = Number(chunk);
|
|
27708
|
+
if (!Number.isNaN(number4)) {
|
|
27709
|
+
results.push(number4);
|
|
27710
|
+
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
27711
|
+
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
27712
|
+
} else {
|
|
27713
|
+
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name17}')`);
|
|
27714
|
+
}
|
|
27715
|
+
}
|
|
27716
|
+
return results;
|
|
27717
|
+
}
|
|
27718
|
+
function parseStyle(style) {
|
|
27719
|
+
STYLE_REGEX.lastIndex = 0;
|
|
27720
|
+
const results = [];
|
|
27721
|
+
let matches;
|
|
27722
|
+
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
27723
|
+
const name17 = matches[1];
|
|
27724
|
+
if (matches[2]) {
|
|
27725
|
+
const args = parseArguments(name17, matches[2]);
|
|
27726
|
+
results.push([name17].concat(args));
|
|
27727
|
+
} else {
|
|
27728
|
+
results.push([name17]);
|
|
27729
|
+
}
|
|
27730
|
+
}
|
|
27731
|
+
return results;
|
|
27732
|
+
}
|
|
27733
|
+
function buildStyle(chalk, styles) {
|
|
27734
|
+
const enabled = {};
|
|
27735
|
+
for (const layer of styles) {
|
|
27736
|
+
for (const style of layer.styles) {
|
|
27737
|
+
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
27738
|
+
}
|
|
27739
|
+
}
|
|
27740
|
+
let current = chalk;
|
|
27741
|
+
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
27742
|
+
if (!Array.isArray(styles2)) {
|
|
27743
|
+
continue;
|
|
27744
|
+
}
|
|
27745
|
+
if (!(styleName in current)) {
|
|
27746
|
+
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
27747
|
+
}
|
|
27748
|
+
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
27749
|
+
}
|
|
27750
|
+
return current;
|
|
27751
|
+
}
|
|
27752
|
+
module.exports = (chalk, temporary) => {
|
|
27753
|
+
const styles = [];
|
|
27754
|
+
const chunks = [];
|
|
27755
|
+
let chunk = [];
|
|
27756
|
+
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
27757
|
+
if (escapeCharacter) {
|
|
27758
|
+
chunk.push(unescape(escapeCharacter));
|
|
27759
|
+
} else if (style) {
|
|
27760
|
+
const string4 = chunk.join("");
|
|
27761
|
+
chunk = [];
|
|
27762
|
+
chunks.push(styles.length === 0 ? string4 : buildStyle(chalk, styles)(string4));
|
|
27763
|
+
styles.push({ inverse, styles: parseStyle(style) });
|
|
27764
|
+
} else if (close) {
|
|
27765
|
+
if (styles.length === 0) {
|
|
27766
|
+
throw new Error("Found extraneous } in Chalk template literal");
|
|
27767
|
+
}
|
|
27768
|
+
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
27769
|
+
chunk = [];
|
|
27770
|
+
styles.pop();
|
|
27771
|
+
} else {
|
|
27772
|
+
chunk.push(character);
|
|
27773
|
+
}
|
|
27774
|
+
});
|
|
27775
|
+
chunks.push(chunk.join(""));
|
|
27776
|
+
if (styles.length > 0) {
|
|
27777
|
+
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
27778
|
+
throw new Error(errMessage);
|
|
27779
|
+
}
|
|
27780
|
+
return chunks.join("");
|
|
27781
|
+
};
|
|
27782
|
+
});
|
|
27783
|
+
|
|
27784
|
+
// ../../node_modules/chalk/source/index.js
|
|
27785
|
+
var require_source = __commonJS((exports, module) => {
|
|
27786
|
+
var ansiStyles = require_ansi_styles();
|
|
27787
|
+
var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
|
|
27788
|
+
var {
|
|
27789
|
+
stringReplaceAll,
|
|
27790
|
+
stringEncaseCRLFWithFirstIndex
|
|
27791
|
+
} = require_util();
|
|
27792
|
+
var { isArray } = Array;
|
|
27793
|
+
var levelMapping = [
|
|
27794
|
+
"ansi",
|
|
27795
|
+
"ansi",
|
|
27796
|
+
"ansi256",
|
|
27797
|
+
"ansi16m"
|
|
27798
|
+
];
|
|
27799
|
+
var styles = Object.create(null);
|
|
27800
|
+
var applyOptions = (object3, options = {}) => {
|
|
27801
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
27802
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
27803
|
+
}
|
|
27804
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
27805
|
+
object3.level = options.level === undefined ? colorLevel : options.level;
|
|
27806
|
+
};
|
|
27807
|
+
|
|
27808
|
+
class ChalkClass {
|
|
27809
|
+
constructor(options) {
|
|
27810
|
+
return chalkFactory(options);
|
|
27811
|
+
}
|
|
27812
|
+
}
|
|
27813
|
+
var chalkFactory = (options) => {
|
|
27814
|
+
const chalk2 = {};
|
|
27815
|
+
applyOptions(chalk2, options);
|
|
27816
|
+
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
27817
|
+
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
27818
|
+
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
27819
|
+
chalk2.template.constructor = () => {
|
|
27820
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
27821
|
+
};
|
|
27822
|
+
chalk2.template.Instance = ChalkClass;
|
|
27823
|
+
return chalk2.template;
|
|
27824
|
+
};
|
|
27825
|
+
function Chalk(options) {
|
|
27826
|
+
return chalkFactory(options);
|
|
27827
|
+
}
|
|
27828
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
27829
|
+
styles[styleName] = {
|
|
27830
|
+
get() {
|
|
27831
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
27832
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
27833
|
+
return builder;
|
|
27834
|
+
}
|
|
27835
|
+
};
|
|
27836
|
+
}
|
|
27837
|
+
styles.visible = {
|
|
27838
|
+
get() {
|
|
27839
|
+
const builder = createBuilder(this, this._styler, true);
|
|
27840
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
27841
|
+
return builder;
|
|
27842
|
+
}
|
|
27843
|
+
};
|
|
27844
|
+
var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
27845
|
+
for (const model of usedModels) {
|
|
27846
|
+
styles[model] = {
|
|
27847
|
+
get() {
|
|
27848
|
+
const { level } = this;
|
|
27849
|
+
return function(...arguments_) {
|
|
27850
|
+
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
27851
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
27852
|
+
};
|
|
27853
|
+
}
|
|
27854
|
+
};
|
|
27855
|
+
}
|
|
27856
|
+
for (const model of usedModels) {
|
|
27857
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
27858
|
+
styles[bgModel] = {
|
|
27859
|
+
get() {
|
|
27860
|
+
const { level } = this;
|
|
27861
|
+
return function(...arguments_) {
|
|
27862
|
+
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
27863
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
27864
|
+
};
|
|
27865
|
+
}
|
|
27866
|
+
};
|
|
27867
|
+
}
|
|
27868
|
+
var proto = Object.defineProperties(() => {}, {
|
|
27869
|
+
...styles,
|
|
27870
|
+
level: {
|
|
27871
|
+
enumerable: true,
|
|
27872
|
+
get() {
|
|
27873
|
+
return this._generator.level;
|
|
27874
|
+
},
|
|
27875
|
+
set(level) {
|
|
27876
|
+
this._generator.level = level;
|
|
27877
|
+
}
|
|
27878
|
+
}
|
|
27879
|
+
});
|
|
27880
|
+
var createStyler = (open, close, parent) => {
|
|
27881
|
+
let openAll;
|
|
27882
|
+
let closeAll;
|
|
27883
|
+
if (parent === undefined) {
|
|
27884
|
+
openAll = open;
|
|
27885
|
+
closeAll = close;
|
|
27886
|
+
} else {
|
|
27887
|
+
openAll = parent.openAll + open;
|
|
27888
|
+
closeAll = close + parent.closeAll;
|
|
27889
|
+
}
|
|
27890
|
+
return {
|
|
27891
|
+
open,
|
|
27892
|
+
close,
|
|
27893
|
+
openAll,
|
|
27894
|
+
closeAll,
|
|
27895
|
+
parent
|
|
27896
|
+
};
|
|
27897
|
+
};
|
|
27898
|
+
var createBuilder = (self2, _styler, _isEmpty) => {
|
|
27899
|
+
const builder = (...arguments_) => {
|
|
27900
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
27901
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
27902
|
+
}
|
|
27903
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
27904
|
+
};
|
|
27905
|
+
Object.setPrototypeOf(builder, proto);
|
|
27906
|
+
builder._generator = self2;
|
|
27907
|
+
builder._styler = _styler;
|
|
27908
|
+
builder._isEmpty = _isEmpty;
|
|
27909
|
+
return builder;
|
|
27910
|
+
};
|
|
27911
|
+
var applyStyle = (self2, string4) => {
|
|
27912
|
+
if (self2.level <= 0 || !string4) {
|
|
27913
|
+
return self2._isEmpty ? "" : string4;
|
|
27914
|
+
}
|
|
27915
|
+
let styler = self2._styler;
|
|
27916
|
+
if (styler === undefined) {
|
|
27917
|
+
return string4;
|
|
27918
|
+
}
|
|
27919
|
+
const { openAll, closeAll } = styler;
|
|
27920
|
+
if (string4.indexOf("\x1B") !== -1) {
|
|
27921
|
+
while (styler !== undefined) {
|
|
27922
|
+
string4 = stringReplaceAll(string4, styler.close, styler.open);
|
|
27923
|
+
styler = styler.parent;
|
|
27924
|
+
}
|
|
27925
|
+
}
|
|
27926
|
+
const lfIndex = string4.indexOf(`
|
|
27927
|
+
`);
|
|
27928
|
+
if (lfIndex !== -1) {
|
|
27929
|
+
string4 = stringEncaseCRLFWithFirstIndex(string4, closeAll, openAll, lfIndex);
|
|
27930
|
+
}
|
|
27931
|
+
return openAll + string4 + closeAll;
|
|
27932
|
+
};
|
|
27933
|
+
var template;
|
|
27934
|
+
var chalkTag = (chalk2, ...strings) => {
|
|
27935
|
+
const [firstString] = strings;
|
|
27936
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
27937
|
+
return strings.join(" ");
|
|
27938
|
+
}
|
|
27939
|
+
const arguments_ = strings.slice(1);
|
|
27940
|
+
const parts = [firstString.raw[0]];
|
|
27941
|
+
for (let i = 1;i < firstString.length; i++) {
|
|
27942
|
+
parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
|
|
27943
|
+
}
|
|
27944
|
+
if (template === undefined) {
|
|
27945
|
+
template = require_templates();
|
|
27946
|
+
}
|
|
27947
|
+
return template(chalk2, parts.join(""));
|
|
27948
|
+
};
|
|
27949
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
27950
|
+
var chalk = Chalk();
|
|
27951
|
+
chalk.supportsColor = stdoutColor;
|
|
27952
|
+
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
27953
|
+
chalk.stderr.supportsColor = stderrColor;
|
|
27954
|
+
module.exports = chalk;
|
|
27955
|
+
});
|
|
27956
|
+
|
|
27524
27957
|
// ../../node_modules/ws/lib/constants.js
|
|
27525
27958
|
var require_constants = __commonJS((exports, module) => {
|
|
27526
27959
|
var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
|
|
@@ -30379,7 +30812,7 @@ var {
|
|
|
30379
30812
|
Help
|
|
30380
30813
|
} = import__.default;
|
|
30381
30814
|
// package.json
|
|
30382
|
-
var version = "0.9.
|
|
30815
|
+
var version = "0.9.42";
|
|
30383
30816
|
|
|
30384
30817
|
// src/runner.ts
|
|
30385
30818
|
import { execSync } from "node:child_process";
|
|
@@ -62277,6 +62710,7 @@ var getProvider = (options = {}) => {
|
|
|
62277
62710
|
return provider2;
|
|
62278
62711
|
};
|
|
62279
62712
|
// ../cli-shared/src/utils/eventHandler.ts
|
|
62713
|
+
var import_chalk = __toESM(require_source(), 1);
|
|
62280
62714
|
var toolCallStats = new Map;
|
|
62281
62715
|
// ../../node_modules/ws/wrapper.mjs
|
|
62282
62716
|
var import_stream2 = __toESM(require_stream(), 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polka-codes/runner",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.42",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"author": "github@polka.codes",
|
|
6
6
|
"type": "module",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"build": "bun build src/index.ts --outdir dist --target node"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@polka-codes/cli-shared": "0.9.
|
|
21
|
-
"@polka-codes/core": "0.9.
|
|
20
|
+
"@polka-codes/cli-shared": "0.9.41",
|
|
21
|
+
"@polka-codes/core": "0.9.41",
|
|
22
22
|
"commander": "^14.0.0",
|
|
23
23
|
"dotenv": "^17.2.3",
|
|
24
24
|
"ignore": "^7.0.3",
|