@closedrouter/cli 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +255 -221
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18,22 +18,33 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
18
18
|
return cached;
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
if (canCache)
|
|
29
31
|
cache.set(mod, to);
|
|
30
32
|
return to;
|
|
31
33
|
};
|
|
32
34
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
35
|
+
var __exportCjs = (target, getters, setters) => {
|
|
36
|
+
for (var name in getters)
|
|
37
|
+
__defProp(target, name, {
|
|
38
|
+
get: getters[name],
|
|
39
|
+
set: setters[name],
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
};
|
|
33
44
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
34
45
|
|
|
35
46
|
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/error.js
|
|
36
|
-
var require_error = __commonJS((exports)
|
|
47
|
+
var require_error = __commonJS(function(exports) {
|
|
37
48
|
class CommanderError extends Error {
|
|
38
49
|
constructor(exitCode, code, message) {
|
|
39
50
|
super(message);
|
|
@@ -57,7 +68,7 @@ var require_error = __commonJS((exports) => {
|
|
|
57
68
|
});
|
|
58
69
|
|
|
59
70
|
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/argument.js
|
|
60
|
-
var require_argument = __commonJS((exports)
|
|
71
|
+
var require_argument = __commonJS(function(exports) {
|
|
61
72
|
var { InvalidArgumentError } = require_error();
|
|
62
73
|
|
|
63
74
|
class Argument {
|
|
@@ -137,7 +148,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
137
148
|
});
|
|
138
149
|
|
|
139
150
|
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/help.js
|
|
140
|
-
var require_help = __commonJS((exports)
|
|
151
|
+
var require_help = __commonJS(function(exports) {
|
|
141
152
|
var { humanReadableArgName } = require_argument();
|
|
142
153
|
|
|
143
154
|
class Help {
|
|
@@ -152,7 +163,7 @@ var require_help = __commonJS((exports) => {
|
|
|
152
163
|
this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
|
|
153
164
|
}
|
|
154
165
|
visibleCommands(cmd) {
|
|
155
|
-
const visibleCommands = cmd.commands.filter((
|
|
166
|
+
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
|
|
156
167
|
const helpCommand = cmd._getHelpCommand();
|
|
157
168
|
if (helpCommand && !helpCommand._hidden) {
|
|
158
169
|
visibleCommands.push(helpCommand);
|
|
@@ -494,7 +505,7 @@ ${itemIndentStr}`);
|
|
|
494
505
|
});
|
|
495
506
|
|
|
496
507
|
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/option.js
|
|
497
|
-
var require_option = __commonJS((exports)
|
|
508
|
+
var require_option = __commonJS(function(exports) {
|
|
498
509
|
var { InvalidArgumentError } = require_error();
|
|
499
510
|
|
|
500
511
|
class Option {
|
|
@@ -632,8 +643,8 @@ var require_option = __commonJS((exports) => {
|
|
|
632
643
|
}
|
|
633
644
|
}
|
|
634
645
|
function camelcase(str) {
|
|
635
|
-
return str.split("-").reduce((
|
|
636
|
-
return
|
|
646
|
+
return str.split("-").reduce((str, word) => {
|
|
647
|
+
return str + word[0].toUpperCase() + word.slice(1);
|
|
637
648
|
});
|
|
638
649
|
}
|
|
639
650
|
function splitOptionFlags(flags) {
|
|
@@ -678,7 +689,7 @@ var require_option = __commonJS((exports) => {
|
|
|
678
689
|
});
|
|
679
690
|
|
|
680
691
|
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
|
|
681
|
-
var require_suggestSimilar = __commonJS((exports)
|
|
692
|
+
var require_suggestSimilar = __commonJS(function(exports) {
|
|
682
693
|
var maxDistance = 3;
|
|
683
694
|
function editDistance(a, b) {
|
|
684
695
|
if (Math.abs(a.length - b.length) > maxDistance)
|
|
@@ -751,7 +762,7 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
751
762
|
});
|
|
752
763
|
|
|
753
764
|
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/command.js
|
|
754
|
-
var require_command = __commonJS((exports)
|
|
765
|
+
var require_command = __commonJS(function(exports) {
|
|
755
766
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
756
767
|
var childProcess = __require("node:child_process");
|
|
757
768
|
var path = __require("node:path");
|
|
@@ -1004,7 +1015,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1004
1015
|
this._exitCallback = (err) => {
|
|
1005
1016
|
if (err.code !== "commander.executeSubCommandAsync") {
|
|
1006
1017
|
throw err;
|
|
1007
|
-
}
|
|
1018
|
+
}
|
|
1008
1019
|
};
|
|
1009
1020
|
}
|
|
1010
1021
|
return this;
|
|
@@ -1204,44 +1215,44 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1204
1215
|
});
|
|
1205
1216
|
return source;
|
|
1206
1217
|
}
|
|
1207
|
-
_prepareUserArgs(
|
|
1208
|
-
if (
|
|
1218
|
+
_prepareUserArgs(argv2, parseOptions) {
|
|
1219
|
+
if (argv2 !== undefined && !Array.isArray(argv2)) {
|
|
1209
1220
|
throw new Error("first parameter to parse must be array or undefined");
|
|
1210
1221
|
}
|
|
1211
1222
|
parseOptions = parseOptions || {};
|
|
1212
|
-
if (
|
|
1223
|
+
if (argv2 === undefined && parseOptions.from === undefined) {
|
|
1213
1224
|
if (process2.versions?.electron) {
|
|
1214
1225
|
parseOptions.from = "electron";
|
|
1215
1226
|
}
|
|
1216
|
-
const
|
|
1217
|
-
if (
|
|
1227
|
+
const execArgv2 = process2.execArgv ?? [];
|
|
1228
|
+
if (execArgv2.includes("-e") || execArgv2.includes("--eval") || execArgv2.includes("-p") || execArgv2.includes("--print")) {
|
|
1218
1229
|
parseOptions.from = "eval";
|
|
1219
1230
|
}
|
|
1220
1231
|
}
|
|
1221
|
-
if (
|
|
1222
|
-
|
|
1232
|
+
if (argv2 === undefined) {
|
|
1233
|
+
argv2 = process2.argv;
|
|
1223
1234
|
}
|
|
1224
|
-
this.rawArgs =
|
|
1235
|
+
this.rawArgs = argv2.slice();
|
|
1225
1236
|
let userArgs;
|
|
1226
1237
|
switch (parseOptions.from) {
|
|
1227
1238
|
case undefined:
|
|
1228
1239
|
case "node":
|
|
1229
|
-
this._scriptPath =
|
|
1230
|
-
userArgs =
|
|
1240
|
+
this._scriptPath = argv2[1];
|
|
1241
|
+
userArgs = argv2.slice(2);
|
|
1231
1242
|
break;
|
|
1232
1243
|
case "electron":
|
|
1233
1244
|
if (process2.defaultApp) {
|
|
1234
|
-
this._scriptPath =
|
|
1235
|
-
userArgs =
|
|
1245
|
+
this._scriptPath = argv2[1];
|
|
1246
|
+
userArgs = argv2.slice(2);
|
|
1236
1247
|
} else {
|
|
1237
|
-
userArgs =
|
|
1248
|
+
userArgs = argv2.slice(1);
|
|
1238
1249
|
}
|
|
1239
1250
|
break;
|
|
1240
1251
|
case "user":
|
|
1241
|
-
userArgs =
|
|
1252
|
+
userArgs = argv2.slice(0);
|
|
1242
1253
|
break;
|
|
1243
1254
|
case "eval":
|
|
1244
|
-
userArgs =
|
|
1255
|
+
userArgs = argv2.slice(1);
|
|
1245
1256
|
break;
|
|
1246
1257
|
default:
|
|
1247
1258
|
throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
|
|
@@ -1764,18 +1775,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1764
1775
|
this.error(message, { code: "commander.missingMandatoryOptionValue" });
|
|
1765
1776
|
}
|
|
1766
1777
|
_conflictingOption(option, conflictingOption) {
|
|
1767
|
-
const findBestOptionFromValue = (
|
|
1768
|
-
const optionKey =
|
|
1778
|
+
const findBestOptionFromValue = (option) => {
|
|
1779
|
+
const optionKey = option.attributeName();
|
|
1769
1780
|
const optionValue = this.getOptionValue(optionKey);
|
|
1770
1781
|
const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
|
|
1771
1782
|
const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
|
|
1772
1783
|
if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) {
|
|
1773
1784
|
return negativeOption;
|
|
1774
1785
|
}
|
|
1775
|
-
return positiveOption ||
|
|
1786
|
+
return positiveOption || option;
|
|
1776
1787
|
};
|
|
1777
|
-
const getErrorMessage = (
|
|
1778
|
-
const bestOption = findBestOptionFromValue(
|
|
1788
|
+
const getErrorMessage = (option) => {
|
|
1789
|
+
const bestOption = findBestOptionFromValue(option);
|
|
1779
1790
|
const optionKey = bestOption.attributeName();
|
|
1780
1791
|
const source = this.getOptionValueSource(optionKey);
|
|
1781
1792
|
if (source === "env") {
|
|
@@ -1929,10 +1940,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1929
1940
|
this._name = path.basename(filename, path.extname(filename));
|
|
1930
1941
|
return this;
|
|
1931
1942
|
}
|
|
1932
|
-
executableDir(
|
|
1933
|
-
if (
|
|
1943
|
+
executableDir(path) {
|
|
1944
|
+
if (path === undefined)
|
|
1934
1945
|
return this._executableDir;
|
|
1935
|
-
this._executableDir =
|
|
1946
|
+
this._executableDir = path;
|
|
1936
1947
|
return this;
|
|
1937
1948
|
}
|
|
1938
1949
|
helpInformation(contextOptions) {
|
|
@@ -2029,11 +2040,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2029
2040
|
}
|
|
2030
2041
|
help(contextOptions) {
|
|
2031
2042
|
this.outputHelp(contextOptions);
|
|
2032
|
-
let
|
|
2033
|
-
if (
|
|
2034
|
-
|
|
2043
|
+
let exitCode2 = Number(process2.exitCode ?? 0);
|
|
2044
|
+
if (exitCode2 === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
|
|
2045
|
+
exitCode2 = 1;
|
|
2035
2046
|
}
|
|
2036
|
-
this._exit(
|
|
2047
|
+
this._exit(exitCode2, "commander.help", "(outputHelp)");
|
|
2037
2048
|
}
|
|
2038
2049
|
addHelpText(position, text) {
|
|
2039
2050
|
const allowedValues = ["beforeAll", "before", "after", "afterAll"];
|
|
@@ -2105,28 +2116,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2105
2116
|
exports.useColor = useColor;
|
|
2106
2117
|
});
|
|
2107
2118
|
|
|
2108
|
-
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/index.js
|
|
2109
|
-
var require_commander = __commonJS((exports) => {
|
|
2110
|
-
var { Argument } = require_argument();
|
|
2111
|
-
var { Command } = require_command();
|
|
2112
|
-
var { CommanderError, InvalidArgumentError } = require_error();
|
|
2113
|
-
var { Help } = require_help();
|
|
2114
|
-
var { Option } = require_option();
|
|
2115
|
-
exports.program = new Command;
|
|
2116
|
-
exports.createCommand = (name) => new Command(name);
|
|
2117
|
-
exports.createOption = (flags, description) => new Option(flags, description);
|
|
2118
|
-
exports.createArgument = (name, description) => new Argument(name, description);
|
|
2119
|
-
exports.Command = Command;
|
|
2120
|
-
exports.Option = Option;
|
|
2121
|
-
exports.Argument = Argument;
|
|
2122
|
-
exports.Help = Help;
|
|
2123
|
-
exports.CommanderError = CommanderError;
|
|
2124
|
-
exports.InvalidArgumentError = InvalidArgumentError;
|
|
2125
|
-
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
2126
|
-
});
|
|
2127
|
-
|
|
2128
2119
|
// ../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
2129
|
-
var require_src = __commonJS((exports, module)
|
|
2120
|
+
var require_src = __commonJS(function(exports, module) {
|
|
2130
2121
|
var ESC = "\x1B";
|
|
2131
2122
|
var CSI = `${ESC}[`;
|
|
2132
2123
|
var beep = "\x07";
|
|
@@ -2184,7 +2175,7 @@ var require_src = __commonJS((exports, module) => {
|
|
|
2184
2175
|
});
|
|
2185
2176
|
|
|
2186
2177
|
// ../node_modules/.bun/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
2187
|
-
var require_picocolors = __commonJS((exports, module)
|
|
2178
|
+
var require_picocolors = __commonJS(function(exports, module) {
|
|
2188
2179
|
var p = process || {};
|
|
2189
2180
|
var argv = p.argv || [];
|
|
2190
2181
|
var env = p.env || {};
|
|
@@ -2254,7 +2245,7 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
2254
2245
|
});
|
|
2255
2246
|
|
|
2256
2247
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/constants.js
|
|
2257
|
-
var require_constants = __commonJS((exports, module)
|
|
2248
|
+
var require_constants = __commonJS(function(exports, module) {
|
|
2258
2249
|
var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
|
|
2259
2250
|
var hasBlob = typeof Blob !== "undefined";
|
|
2260
2251
|
if (hasBlob)
|
|
@@ -2274,7 +2265,7 @@ var require_constants = __commonJS((exports, module) => {
|
|
|
2274
2265
|
});
|
|
2275
2266
|
|
|
2276
2267
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/buffer-util.js
|
|
2277
|
-
var require_buffer_util = __commonJS((exports, module)
|
|
2268
|
+
var require_buffer_util = __commonJS(function(exports, module) {
|
|
2278
2269
|
var { EMPTY_BUFFER } = require_constants();
|
|
2279
2270
|
var FastBuffer = Buffer[Symbol.species];
|
|
2280
2271
|
function concat(list, totalLength) {
|
|
@@ -2335,11 +2326,11 @@ var require_buffer_util = __commonJS((exports, module) => {
|
|
|
2335
2326
|
if (!process.env.WS_NO_BUFFER_UTIL) {
|
|
2336
2327
|
try {
|
|
2337
2328
|
const bufferUtil = (()=>{throw new Error("Cannot require module "+"bufferutil");})();
|
|
2338
|
-
module.exports.mask = function(source,
|
|
2329
|
+
module.exports.mask = function(source, mask2, output, offset, length) {
|
|
2339
2330
|
if (length < 48)
|
|
2340
|
-
_mask(source,
|
|
2331
|
+
_mask(source, mask2, output, offset, length);
|
|
2341
2332
|
else
|
|
2342
|
-
bufferUtil.mask(source,
|
|
2333
|
+
bufferUtil.mask(source, mask2, output, offset, length);
|
|
2343
2334
|
};
|
|
2344
2335
|
module.exports.unmask = function(buffer, mask) {
|
|
2345
2336
|
if (buffer.length < 32)
|
|
@@ -2347,12 +2338,12 @@ var require_buffer_util = __commonJS((exports, module) => {
|
|
|
2347
2338
|
else
|
|
2348
2339
|
bufferUtil.unmask(buffer, mask);
|
|
2349
2340
|
};
|
|
2350
|
-
} catch (
|
|
2341
|
+
} catch (e) {}
|
|
2351
2342
|
}
|
|
2352
2343
|
});
|
|
2353
2344
|
|
|
2354
2345
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/limiter.js
|
|
2355
|
-
var require_limiter = __commonJS((exports, module)
|
|
2346
|
+
var require_limiter = __commonJS(function(exports, module) {
|
|
2356
2347
|
var kDone = Symbol("kDone");
|
|
2357
2348
|
var kRun = Symbol("kRun");
|
|
2358
2349
|
|
|
@@ -2384,7 +2375,7 @@ var require_limiter = __commonJS((exports, module) => {
|
|
|
2384
2375
|
});
|
|
2385
2376
|
|
|
2386
2377
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/permessage-deflate.js
|
|
2387
|
-
var require_permessage_deflate = __commonJS((exports, module)
|
|
2378
|
+
var require_permessage_deflate = __commonJS(function(exports, module) {
|
|
2388
2379
|
var zlib = __require("zlib");
|
|
2389
2380
|
var bufferUtil = require_buffer_util();
|
|
2390
2381
|
var Limiter = require_limiter();
|
|
@@ -2572,7 +2563,7 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
2572
2563
|
callback(err);
|
|
2573
2564
|
return;
|
|
2574
2565
|
}
|
|
2575
|
-
const
|
|
2566
|
+
const data = bufferUtil.concat(this._inflate[kBuffers], this._inflate[kTotalLength]);
|
|
2576
2567
|
if (this._inflate._readableState.endEmitted) {
|
|
2577
2568
|
this._inflate.close();
|
|
2578
2569
|
this._inflate = null;
|
|
@@ -2583,7 +2574,7 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
2583
2574
|
this._inflate.reset();
|
|
2584
2575
|
}
|
|
2585
2576
|
}
|
|
2586
|
-
callback(null,
|
|
2577
|
+
callback(null, data);
|
|
2587
2578
|
});
|
|
2588
2579
|
}
|
|
2589
2580
|
_compress(data, fin, callback) {
|
|
@@ -2605,9 +2596,9 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
2605
2596
|
if (!this._deflate) {
|
|
2606
2597
|
return;
|
|
2607
2598
|
}
|
|
2608
|
-
let
|
|
2599
|
+
let data = bufferUtil.concat(this._deflate[kBuffers], this._deflate[kTotalLength]);
|
|
2609
2600
|
if (fin) {
|
|
2610
|
-
|
|
2601
|
+
data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);
|
|
2611
2602
|
}
|
|
2612
2603
|
this._deflate[kCallback] = null;
|
|
2613
2604
|
this._deflate[kTotalLength] = 0;
|
|
@@ -2615,7 +2606,7 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
2615
2606
|
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
|
|
2616
2607
|
this._deflate.reset();
|
|
2617
2608
|
}
|
|
2618
|
-
callback(null,
|
|
2609
|
+
callback(null, data);
|
|
2619
2610
|
});
|
|
2620
2611
|
}
|
|
2621
2612
|
}
|
|
@@ -2648,7 +2639,7 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
2648
2639
|
});
|
|
2649
2640
|
|
|
2650
2641
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/validation.js
|
|
2651
|
-
var require_validation = __commonJS((exports, module)
|
|
2642
|
+
var require_validation = __commonJS(function(exports, module) {
|
|
2652
2643
|
var { isUtf8 } = __require("buffer");
|
|
2653
2644
|
var { hasBlob } = require_constants();
|
|
2654
2645
|
var tokenChars = [
|
|
@@ -2830,12 +2821,12 @@ var require_validation = __commonJS((exports, module) => {
|
|
|
2830
2821
|
module.exports.isValidUTF8 = function(buf) {
|
|
2831
2822
|
return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
|
|
2832
2823
|
};
|
|
2833
|
-
} catch (
|
|
2824
|
+
} catch (e) {}
|
|
2834
2825
|
}
|
|
2835
2826
|
});
|
|
2836
2827
|
|
|
2837
2828
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/receiver.js
|
|
2838
|
-
var require_receiver = __commonJS((exports, module)
|
|
2829
|
+
var require_receiver = __commonJS(function(exports, module) {
|
|
2839
2830
|
var { Writable } = __require("stream");
|
|
2840
2831
|
var PerMessageDeflate = require_permessage_deflate();
|
|
2841
2832
|
var {
|
|
@@ -3229,7 +3220,7 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
3229
3220
|
});
|
|
3230
3221
|
|
|
3231
3222
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/sender.js
|
|
3232
|
-
var require_sender = __commonJS((exports, module)
|
|
3223
|
+
var require_sender = __commonJS(function(exports, module) {
|
|
3233
3224
|
var { Duplex } = __require("stream");
|
|
3234
3225
|
var { randomFillSync } = __require("crypto");
|
|
3235
3226
|
var {
|
|
@@ -3535,7 +3526,7 @@ var require_sender = __commonJS((exports, module) => {
|
|
|
3535
3526
|
const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
|
|
3536
3527
|
this._bufferedBytes += options[kByteLength];
|
|
3537
3528
|
this._state = DEFLATING;
|
|
3538
|
-
perMessageDeflate.compress(data, options.fin, (
|
|
3529
|
+
perMessageDeflate.compress(data, options.fin, (_, buf) => {
|
|
3539
3530
|
if (this._socket.destroyed) {
|
|
3540
3531
|
const err = new Error("The socket was closed while data was being compressed");
|
|
3541
3532
|
callCallbacks(this, err, cb);
|
|
@@ -3588,7 +3579,7 @@ var require_sender = __commonJS((exports, module) => {
|
|
|
3588
3579
|
});
|
|
3589
3580
|
|
|
3590
3581
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/event-target.js
|
|
3591
|
-
var require_event_target = __commonJS((exports, module)
|
|
3582
|
+
var require_event_target = __commonJS(function(exports, module) {
|
|
3592
3583
|
var { kForOnEventAttribute, kListener } = require_constants();
|
|
3593
3584
|
var kCode = Symbol("kCode");
|
|
3594
3585
|
var kData = Symbol("kData");
|
|
@@ -3739,7 +3730,7 @@ var require_event_target = __commonJS((exports, module) => {
|
|
|
3739
3730
|
});
|
|
3740
3731
|
|
|
3741
3732
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/extension.js
|
|
3742
|
-
var require_extension = __commonJS((exports, module)
|
|
3733
|
+
var require_extension = __commonJS(function(exports, module) {
|
|
3743
3734
|
var { tokenChars } = require_validation();
|
|
3744
3735
|
function push(dest, name, elem) {
|
|
3745
3736
|
if (dest[name] === undefined)
|
|
@@ -3891,11 +3882,11 @@ var require_extension = __commonJS((exports, module) => {
|
|
|
3891
3882
|
if (!Array.isArray(configurations))
|
|
3892
3883
|
configurations = [configurations];
|
|
3893
3884
|
return configurations.map((params) => {
|
|
3894
|
-
return [extension].concat(Object.keys(params).map((
|
|
3895
|
-
let values = params[
|
|
3885
|
+
return [extension].concat(Object.keys(params).map((k) => {
|
|
3886
|
+
let values = params[k];
|
|
3896
3887
|
if (!Array.isArray(values))
|
|
3897
3888
|
values = [values];
|
|
3898
|
-
return values.map((
|
|
3889
|
+
return values.map((v) => v === true ? k : `${k}=${v}`).join("; ");
|
|
3899
3890
|
})).join("; ");
|
|
3900
3891
|
}).join(", ");
|
|
3901
3892
|
}).join(", ");
|
|
@@ -3904,7 +3895,7 @@ var require_extension = __commonJS((exports, module) => {
|
|
|
3904
3895
|
});
|
|
3905
3896
|
|
|
3906
3897
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/websocket.js
|
|
3907
|
-
var require_websocket = __commonJS((exports, module)
|
|
3898
|
+
var require_websocket = __commonJS(function(exports, module) {
|
|
3908
3899
|
var EventEmitter = __require("events");
|
|
3909
3900
|
var https = __require("https");
|
|
3910
3901
|
var http = __require("http");
|
|
@@ -4340,7 +4331,7 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
4340
4331
|
}
|
|
4341
4332
|
const defaultPort = isSecure ? 443 : 80;
|
|
4342
4333
|
const key = randomBytes(16).toString("base64");
|
|
4343
|
-
const
|
|
4334
|
+
const request3 = isSecure ? https.request : http.request;
|
|
4344
4335
|
const protocolSet = new Set;
|
|
4345
4336
|
let perMessageDeflate;
|
|
4346
4337
|
opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
|
|
@@ -4399,8 +4390,8 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
4399
4390
|
const headers = options && options.headers;
|
|
4400
4391
|
options = { ...options, headers: {} };
|
|
4401
4392
|
if (headers) {
|
|
4402
|
-
for (const [
|
|
4403
|
-
options.headers[
|
|
4393
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
4394
|
+
options.headers[key.toLowerCase()] = value;
|
|
4404
4395
|
}
|
|
4405
4396
|
}
|
|
4406
4397
|
} else if (websocket.listenerCount("redirect") === 0) {
|
|
@@ -4416,12 +4407,12 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
4416
4407
|
if (opts.auth && !options.headers.authorization) {
|
|
4417
4408
|
options.headers.authorization = "Basic " + Buffer.from(opts.auth).toString("base64");
|
|
4418
4409
|
}
|
|
4419
|
-
req = websocket._req =
|
|
4410
|
+
req = websocket._req = request3(opts);
|
|
4420
4411
|
if (websocket._redirects) {
|
|
4421
4412
|
websocket.emit("redirect", websocket.url, req);
|
|
4422
4413
|
}
|
|
4423
4414
|
} else {
|
|
4424
|
-
req = websocket._req =
|
|
4415
|
+
req = websocket._req = request3(opts);
|
|
4425
4416
|
}
|
|
4426
4417
|
if (opts.timeout) {
|
|
4427
4418
|
req.on("timeout", () => {
|
|
@@ -4446,7 +4437,7 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
4446
4437
|
let addr;
|
|
4447
4438
|
try {
|
|
4448
4439
|
addr = new URL2(location, address);
|
|
4449
|
-
} catch (
|
|
4440
|
+
} catch (e) {
|
|
4450
4441
|
const err = new SyntaxError(`Invalid URL: ${location}`);
|
|
4451
4442
|
emitErrorAndClose(websocket, err);
|
|
4452
4443
|
return;
|
|
@@ -4689,7 +4680,7 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
4689
4680
|
});
|
|
4690
4681
|
|
|
4691
4682
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/stream.js
|
|
4692
|
-
var require_stream = __commonJS((exports, module)
|
|
4683
|
+
var require_stream = __commonJS(function(exports, module) {
|
|
4693
4684
|
var WebSocket = require_websocket();
|
|
4694
4685
|
var { Duplex } = __require("stream");
|
|
4695
4686
|
function emitClose(stream) {
|
|
@@ -4739,9 +4730,9 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
4739
4730
|
return;
|
|
4740
4731
|
}
|
|
4741
4732
|
let called = false;
|
|
4742
|
-
ws.once("error", function error(
|
|
4733
|
+
ws.once("error", function error(err) {
|
|
4743
4734
|
called = true;
|
|
4744
|
-
callback(
|
|
4735
|
+
callback(err);
|
|
4745
4736
|
});
|
|
4746
4737
|
ws.once("close", function close() {
|
|
4747
4738
|
if (!called)
|
|
@@ -4792,7 +4783,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
4792
4783
|
});
|
|
4793
4784
|
|
|
4794
4785
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/subprotocol.js
|
|
4795
|
-
var require_subprotocol = __commonJS((exports, module)
|
|
4786
|
+
var require_subprotocol = __commonJS(function(exports, module) {
|
|
4796
4787
|
var { tokenChars } = require_validation();
|
|
4797
4788
|
function parse(header) {
|
|
4798
4789
|
const protocols = new Set;
|
|
@@ -4813,11 +4804,11 @@ var require_subprotocol = __commonJS((exports, module) => {
|
|
|
4813
4804
|
}
|
|
4814
4805
|
if (end === -1)
|
|
4815
4806
|
end = i;
|
|
4816
|
-
const
|
|
4817
|
-
if (protocols.has(
|
|
4818
|
-
throw new SyntaxError(`The "${
|
|
4807
|
+
const protocol = header.slice(start, end);
|
|
4808
|
+
if (protocols.has(protocol)) {
|
|
4809
|
+
throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
|
|
4819
4810
|
}
|
|
4820
|
-
protocols.add(
|
|
4811
|
+
protocols.add(protocol);
|
|
4821
4812
|
start = end = -1;
|
|
4822
4813
|
} else {
|
|
4823
4814
|
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
@@ -4837,7 +4828,7 @@ var require_subprotocol = __commonJS((exports, module) => {
|
|
|
4837
4828
|
});
|
|
4838
4829
|
|
|
4839
4830
|
// ../node_modules/.bun/ws@8.22.0/node_modules/ws/lib/websocket-server.js
|
|
4840
|
-
var require_websocket_server = __commonJS((exports, module)
|
|
4831
|
+
var require_websocket_server = __commonJS(function(exports, module) {
|
|
4841
4832
|
var EventEmitter = __require("events");
|
|
4842
4833
|
var http = __require("http");
|
|
4843
4834
|
var { Duplex } = __require("stream");
|
|
@@ -5130,7 +5121,7 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
5130
5121
|
};
|
|
5131
5122
|
socket.once("finish", socket.destroy);
|
|
5132
5123
|
socket.end(`HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r
|
|
5133
|
-
` + Object.keys(headers).map((
|
|
5124
|
+
` + Object.keys(headers).map((h) => `${h}: ${headers[h]}`).join(`\r
|
|
5134
5125
|
`) + `\r
|
|
5135
5126
|
\r
|
|
5136
5127
|
` + message);
|
|
@@ -5146,21 +5137,64 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
5146
5137
|
}
|
|
5147
5138
|
});
|
|
5148
5139
|
|
|
5140
|
+
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/index.js
|
|
5141
|
+
var exports_commander = {};
|
|
5142
|
+
__exportCjs(exports_commander, {
|
|
5143
|
+
program: () => $program,
|
|
5144
|
+
createCommand: () => $createCommand,
|
|
5145
|
+
createOption: () => $createOption,
|
|
5146
|
+
createArgument: () => $createArgument,
|
|
5147
|
+
Command: () => $Command,
|
|
5148
|
+
Option: () => $Option,
|
|
5149
|
+
Argument: () => $Argument,
|
|
5150
|
+
Help: () => $Help,
|
|
5151
|
+
CommanderError: () => $CommanderError,
|
|
5152
|
+
InvalidArgumentError: () => $InvalidArgumentError,
|
|
5153
|
+
InvalidOptionArgumentError: () => $InvalidOptionArgumentError
|
|
5154
|
+
}, {
|
|
5155
|
+
program: (value) => $program = value,
|
|
5156
|
+
createCommand: (value) => $createCommand = value,
|
|
5157
|
+
createOption: (value) => $createOption = value,
|
|
5158
|
+
createArgument: (value) => $createArgument = value,
|
|
5159
|
+
Command: (value) => $Command = value,
|
|
5160
|
+
Option: (value) => $Option = value,
|
|
5161
|
+
Argument: (value) => $Argument = value,
|
|
5162
|
+
Help: (value) => $Help = value,
|
|
5163
|
+
CommanderError: (value) => $CommanderError = value,
|
|
5164
|
+
InvalidArgumentError: (value) => $InvalidArgumentError = value,
|
|
5165
|
+
InvalidOptionArgumentError: (value) => $InvalidOptionArgumentError = value
|
|
5166
|
+
});
|
|
5167
|
+
var { Argument } = require_argument();
|
|
5168
|
+
var { Command } = require_command();
|
|
5169
|
+
var { CommanderError, InvalidArgumentError } = require_error();
|
|
5170
|
+
var { Help } = require_help();
|
|
5171
|
+
var { Option } = require_option();
|
|
5172
|
+
var $program = new Command;
|
|
5173
|
+
var $createCommand = (name) => new Command(name);
|
|
5174
|
+
var $createOption = (flags, description) => new Option(flags, description);
|
|
5175
|
+
var $createArgument = (name, description) => new Argument(name, description);
|
|
5176
|
+
var $Command = Command;
|
|
5177
|
+
var $Option = Option;
|
|
5178
|
+
var $Argument = Argument;
|
|
5179
|
+
var $Help = Help;
|
|
5180
|
+
var $CommanderError = CommanderError;
|
|
5181
|
+
var $InvalidArgumentError = InvalidArgumentError;
|
|
5182
|
+
var $InvalidOptionArgumentError = InvalidArgumentError;
|
|
5183
|
+
|
|
5149
5184
|
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/esm.mjs
|
|
5150
|
-
var import__ = __toESM(require_commander(), 1);
|
|
5151
5185
|
var {
|
|
5152
5186
|
program,
|
|
5153
5187
|
createCommand,
|
|
5154
5188
|
createArgument,
|
|
5155
5189
|
createOption,
|
|
5156
|
-
CommanderError,
|
|
5157
|
-
InvalidArgumentError,
|
|
5190
|
+
CommanderError: CommanderError2,
|
|
5191
|
+
InvalidArgumentError: InvalidArgumentError2,
|
|
5158
5192
|
InvalidOptionArgumentError,
|
|
5159
|
-
Command,
|
|
5160
|
-
Argument,
|
|
5161
|
-
Option,
|
|
5162
|
-
Help
|
|
5163
|
-
} =
|
|
5193
|
+
Command: Command2,
|
|
5194
|
+
Argument: Argument2,
|
|
5195
|
+
Option: Option2,
|
|
5196
|
+
Help: Help2
|
|
5197
|
+
} = exports_commander;
|
|
5164
5198
|
|
|
5165
5199
|
// src/index.ts
|
|
5166
5200
|
import { readFileSync as readFileSync9 } from "node:fs";
|
|
@@ -5694,19 +5728,19 @@ var b2 = (t) => {
|
|
|
5694
5728
|
}
|
|
5695
5729
|
};
|
|
5696
5730
|
var G2 = (t) => {
|
|
5697
|
-
const { cursor: n, options:
|
|
5698
|
-
let
|
|
5699
|
-
n >=
|
|
5700
|
-
const $
|
|
5701
|
-
return
|
|
5702
|
-
const
|
|
5703
|
-
return
|
|
5731
|
+
const { cursor: n, options: r, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
|
|
5732
|
+
let l = 0;
|
|
5733
|
+
n >= l + a - 3 ? l = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l + 2 && (l = Math.max(n - 2, 0));
|
|
5734
|
+
const $ = a < r.length && l > 0, g = a < r.length && l + a < r.length;
|
|
5735
|
+
return r.slice(l, l + a).map((p, v, f) => {
|
|
5736
|
+
const j = v === 0 && $, E = v === f.length - 1 && g;
|
|
5737
|
+
return j || E ? import_picocolors2.default.dim("...") : i(p, v + l === n);
|
|
5704
5738
|
});
|
|
5705
5739
|
};
|
|
5706
5740
|
var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
|
|
5707
5741
|
const n = `${import_picocolors2.default.gray(o)}
|
|
5708
5742
|
${b2(this.state)} ${t.message}
|
|
5709
|
-
`,
|
|
5743
|
+
`, r = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r;
|
|
5710
5744
|
switch (this.state) {
|
|
5711
5745
|
case "error":
|
|
5712
5746
|
return `${n.trim()}
|
|
@@ -5727,7 +5761,7 @@ ${import_picocolors2.default.cyan(d2)}
|
|
|
5727
5761
|
var ge = (t) => new MD({ validate: t.validate, mask: t.mask ?? $e, render() {
|
|
5728
5762
|
const n = `${import_picocolors2.default.gray(o)}
|
|
5729
5763
|
${b2(this.state)} ${t.message}
|
|
5730
|
-
`,
|
|
5764
|
+
`, r = this.valueWithCursor, i = this.masked;
|
|
5731
5765
|
switch (this.state) {
|
|
5732
5766
|
case "error":
|
|
5733
5767
|
return `${n.trim()}
|
|
@@ -5740,17 +5774,17 @@ ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(th
|
|
|
5740
5774
|
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i ?? ""))}${i ? `
|
|
5741
5775
|
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
5742
5776
|
default:
|
|
5743
|
-
return `${n}${import_picocolors2.default.cyan(o)} ${
|
|
5777
|
+
return `${n}${import_picocolors2.default.cyan(o)} ${r}
|
|
5744
5778
|
${import_picocolors2.default.cyan(d2)}
|
|
5745
5779
|
`;
|
|
5746
5780
|
}
|
|
5747
5781
|
} }).prompt();
|
|
5748
5782
|
var ye = (t) => {
|
|
5749
|
-
const n = t.active ?? "Yes",
|
|
5750
|
-
return new dD({ active: n, inactive:
|
|
5783
|
+
const n = t.active ?? "Yes", r = t.inactive ?? "No";
|
|
5784
|
+
return new dD({ active: n, inactive: r, initialValue: t.initialValue ?? true, render() {
|
|
5751
5785
|
const i = `${import_picocolors2.default.gray(o)}
|
|
5752
5786
|
${b2(this.state)} ${t.message}
|
|
5753
|
-
`, s = this.value ? n :
|
|
5787
|
+
`, s = this.value ? n : r;
|
|
5754
5788
|
switch (this.state) {
|
|
5755
5789
|
case "submit":
|
|
5756
5790
|
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
|
|
@@ -5758,20 +5792,20 @@ ${b2(this.state)} ${t.message}
|
|
|
5758
5792
|
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
|
|
5759
5793
|
${import_picocolors2.default.gray(o)}`;
|
|
5760
5794
|
default:
|
|
5761
|
-
return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(
|
|
5795
|
+
return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r)}` : `${import_picocolors2.default.green(k2)} ${r}`}
|
|
5762
5796
|
${import_picocolors2.default.cyan(d2)}
|
|
5763
5797
|
`;
|
|
5764
5798
|
}
|
|
5765
5799
|
} }).prompt();
|
|
5766
5800
|
};
|
|
5767
5801
|
var ve = (t) => {
|
|
5768
|
-
const n = (
|
|
5769
|
-
const s =
|
|
5802
|
+
const n = (r, i) => {
|
|
5803
|
+
const s = r.label ?? String(r.value);
|
|
5770
5804
|
switch (i) {
|
|
5771
5805
|
case "selected":
|
|
5772
5806
|
return `${import_picocolors2.default.dim(s)}`;
|
|
5773
5807
|
case "active":
|
|
5774
|
-
return `${import_picocolors2.default.green(k2)} ${s} ${
|
|
5808
|
+
return `${import_picocolors2.default.green(k2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}`;
|
|
5775
5809
|
case "cancelled":
|
|
5776
5810
|
return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
|
|
5777
5811
|
default:
|
|
@@ -5779,17 +5813,17 @@ var ve = (t) => {
|
|
|
5779
5813
|
}
|
|
5780
5814
|
};
|
|
5781
5815
|
return new LD({ options: t.options, initialValue: t.initialValue, render() {
|
|
5782
|
-
const
|
|
5816
|
+
const r = `${import_picocolors2.default.gray(o)}
|
|
5783
5817
|
${b2(this.state)} ${t.message}
|
|
5784
5818
|
`;
|
|
5785
5819
|
switch (this.state) {
|
|
5786
5820
|
case "submit":
|
|
5787
|
-
return `${
|
|
5821
|
+
return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
5788
5822
|
case "cancel":
|
|
5789
|
-
return `${
|
|
5823
|
+
return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
5790
5824
|
${import_picocolors2.default.gray(o)}`;
|
|
5791
5825
|
default:
|
|
5792
|
-
return `${
|
|
5826
|
+
return `${r}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
|
|
5793
5827
|
${import_picocolors2.default.cyan(o)} `)}
|
|
5794
5828
|
${import_picocolors2.default.cyan(d2)}
|
|
5795
5829
|
`;
|
|
@@ -5797,16 +5831,16 @@ ${import_picocolors2.default.cyan(d2)}
|
|
|
5797
5831
|
} }).prompt();
|
|
5798
5832
|
};
|
|
5799
5833
|
var fe = (t) => {
|
|
5800
|
-
const n = (
|
|
5801
|
-
const s =
|
|
5802
|
-
return i === "active" ? `${import_picocolors2.default.cyan(A2)} ${s} ${
|
|
5834
|
+
const n = (r, i) => {
|
|
5835
|
+
const s = r.label ?? String(r.value);
|
|
5836
|
+
return i === "active" ? `${import_picocolors2.default.cyan(A2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors2.default.green(T)} ${import_picocolors2.default.dim(s)} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : i === "active-selected" ? `${import_picocolors2.default.green(T)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.dim(F)} ${import_picocolors2.default.dim(s)}`;
|
|
5803
5837
|
};
|
|
5804
|
-
return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(
|
|
5805
|
-
if (this.required &&
|
|
5838
|
+
return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r) {
|
|
5839
|
+
if (this.required && r.length === 0)
|
|
5806
5840
|
return `Please select at least one option.
|
|
5807
5841
|
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
5808
5842
|
}, render() {
|
|
5809
|
-
const
|
|
5843
|
+
const r = `${import_picocolors2.default.gray(o)}
|
|
5810
5844
|
${b2(this.state)} ${t.message}
|
|
5811
5845
|
`, i = (s, c) => {
|
|
5812
5846
|
const a = this.value.includes(s.value);
|
|
@@ -5814,23 +5848,23 @@ ${b2(this.state)} ${t.message}
|
|
|
5814
5848
|
};
|
|
5815
5849
|
switch (this.state) {
|
|
5816
5850
|
case "submit":
|
|
5817
|
-
return `${
|
|
5851
|
+
return `${r}${import_picocolors2.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
|
|
5818
5852
|
case "cancel": {
|
|
5819
5853
|
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
5820
|
-
return `${
|
|
5854
|
+
return `${r}${import_picocolors2.default.gray(o)} ${s.trim() ? `${s}
|
|
5821
5855
|
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
5822
5856
|
}
|
|
5823
5857
|
case "error": {
|
|
5824
5858
|
const s = this.error.split(`
|
|
5825
5859
|
`).map((c, a) => a === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(c)}` : ` ${c}`).join(`
|
|
5826
5860
|
`);
|
|
5827
|
-
return `${
|
|
5861
|
+
return `${r + import_picocolors2.default.yellow(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
|
|
5828
5862
|
${import_picocolors2.default.yellow(o)} `)}
|
|
5829
5863
|
${s}
|
|
5830
5864
|
`;
|
|
5831
5865
|
}
|
|
5832
5866
|
default:
|
|
5833
|
-
return `${
|
|
5867
|
+
return `${r}${import_picocolors2.default.cyan(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
|
|
5834
5868
|
${import_picocolors2.default.cyan(o)} `)}
|
|
5835
5869
|
${import_picocolors2.default.cyan(d2)}
|
|
5836
5870
|
`;
|
|
@@ -5838,13 +5872,13 @@ ${import_picocolors2.default.cyan(d2)}
|
|
|
5838
5872
|
} }).prompt();
|
|
5839
5873
|
};
|
|
5840
5874
|
var Me = (t = "", n = "") => {
|
|
5841
|
-
const
|
|
5875
|
+
const r = `
|
|
5842
5876
|
${t}
|
|
5843
5877
|
`.split(`
|
|
5844
|
-
`), i = S2(n).length, s = Math.max(
|
|
5845
|
-
const $
|
|
5846
|
-
return
|
|
5847
|
-
}, 0), i) + 2, c =
|
|
5878
|
+
`), i = S2(n).length, s = Math.max(r.reduce((a, l) => {
|
|
5879
|
+
const $ = S2(l);
|
|
5880
|
+
return $.length > a ? $.length : a;
|
|
5881
|
+
}, 0), i) + 2, c = r.map((a) => `${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(a)}${" ".repeat(s - S2(a).length)}${import_picocolors2.default.gray(o)}`).join(`
|
|
5848
5882
|
`);
|
|
5849
5883
|
process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
5850
5884
|
${import_picocolors2.default.green(C)} ${import_picocolors2.default.reset(n)} ${import_picocolors2.default.gray(_2.repeat(Math.max(s - i - 1, 1)) + me)}
|
|
@@ -5868,13 +5902,13 @@ ${import_picocolors2.default.gray(d2)} ${t}
|
|
|
5868
5902
|
`);
|
|
5869
5903
|
};
|
|
5870
5904
|
var M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
|
|
5871
|
-
const
|
|
5905
|
+
const r = [`${import_picocolors2.default.gray(o)}`];
|
|
5872
5906
|
if (t) {
|
|
5873
5907
|
const [i, ...s] = t.split(`
|
|
5874
5908
|
`);
|
|
5875
|
-
|
|
5909
|
+
r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors2.default.gray(o)} ${c}`));
|
|
5876
5910
|
}
|
|
5877
|
-
process.stdout.write(`${
|
|
5911
|
+
process.stdout.write(`${r.join(`
|
|
5878
5912
|
`)}
|
|
5879
5913
|
`);
|
|
5880
5914
|
}, info: (t) => {
|
|
@@ -5892,54 +5926,54 @@ var M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) }
|
|
|
5892
5926
|
} };
|
|
5893
5927
|
var J2 = `${import_picocolors2.default.gray(o)} `;
|
|
5894
5928
|
var Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
5895
|
-
const n = V2 ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"],
|
|
5896
|
-
let s, c, a = false,
|
|
5897
|
-
const
|
|
5898
|
-
const
|
|
5899
|
-
a &&
|
|
5900
|
-
},
|
|
5901
|
-
process.on("uncaughtExceptionMonitor",
|
|
5929
|
+
const n = V2 ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"], r = V2 ? 80 : 120, i = process.env.CI === "true";
|
|
5930
|
+
let s, c, a = false, l = "", $, g = performance.now();
|
|
5931
|
+
const p = (m) => {
|
|
5932
|
+
const h = m > 1 ? "Something went wrong" : "Canceled";
|
|
5933
|
+
a && N(h, m);
|
|
5934
|
+
}, v = () => p(2), f = () => p(1), j = () => {
|
|
5935
|
+
process.on("uncaughtExceptionMonitor", v), process.on("unhandledRejection", v), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p);
|
|
5902
5936
|
}, E = () => {
|
|
5903
|
-
process.removeListener("uncaughtExceptionMonitor",
|
|
5904
|
-
},
|
|
5905
|
-
if ($
|
|
5937
|
+
process.removeListener("uncaughtExceptionMonitor", v), process.removeListener("unhandledRejection", v), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p);
|
|
5938
|
+
}, B = () => {
|
|
5939
|
+
if ($ === undefined)
|
|
5906
5940
|
return;
|
|
5907
5941
|
i && process.stdout.write(`
|
|
5908
5942
|
`);
|
|
5909
|
-
const
|
|
5943
|
+
const m = $.split(`
|
|
5910
5944
|
`);
|
|
5911
|
-
process.stdout.write(import_sisteransi2.cursor.move(-999,
|
|
5912
|
-
},
|
|
5913
|
-
const
|
|
5914
|
-
return
|
|
5915
|
-
},
|
|
5916
|
-
a = true, s = fD(),
|
|
5945
|
+
process.stdout.write(import_sisteransi2.cursor.move(-999, m.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m.length));
|
|
5946
|
+
}, R = (m) => m.replace(/\.+$/, ""), O = (m) => {
|
|
5947
|
+
const h = (performance.now() - m) / 1000, w = Math.floor(h / 60), I = Math.floor(h % 60);
|
|
5948
|
+
return w > 0 ? `[${w}m ${I}s]` : `[${I}s]`;
|
|
5949
|
+
}, H = (m = "") => {
|
|
5950
|
+
a = true, s = fD(), l = R(m), g = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
5917
5951
|
`);
|
|
5918
|
-
let
|
|
5919
|
-
|
|
5920
|
-
if (i &&
|
|
5952
|
+
let h = 0, w = 0;
|
|
5953
|
+
j(), c = setInterval(() => {
|
|
5954
|
+
if (i && l === $)
|
|
5921
5955
|
return;
|
|
5922
|
-
|
|
5923
|
-
const
|
|
5956
|
+
B(), $ = l;
|
|
5957
|
+
const I = import_picocolors2.default.magenta(n[h]);
|
|
5924
5958
|
if (i)
|
|
5925
|
-
process.stdout.write(`${
|
|
5959
|
+
process.stdout.write(`${I} ${l}...`);
|
|
5926
5960
|
else if (t === "timer")
|
|
5927
|
-
process.stdout.write(`${
|
|
5961
|
+
process.stdout.write(`${I} ${l} ${O(g)}`);
|
|
5928
5962
|
else {
|
|
5929
|
-
const
|
|
5930
|
-
process.stdout.write(`${
|
|
5931
|
-
}
|
|
5932
|
-
|
|
5933
|
-
},
|
|
5934
|
-
},
|
|
5935
|
-
a = false, clearInterval(c),
|
|
5936
|
-
const
|
|
5937
|
-
|
|
5938
|
-
`) : process.stdout.write(`${
|
|
5963
|
+
const z = ".".repeat(Math.floor(w)).slice(0, 3);
|
|
5964
|
+
process.stdout.write(`${I} ${l}${z}`);
|
|
5965
|
+
}
|
|
5966
|
+
h = h + 1 < n.length ? h + 1 : 0, w = w < n.length ? w + 0.125 : 0;
|
|
5967
|
+
}, r);
|
|
5968
|
+
}, N = (m = "", h = 0) => {
|
|
5969
|
+
a = false, clearInterval(c), B();
|
|
5970
|
+
const w = h === 0 ? import_picocolors2.default.green(C) : h === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
|
|
5971
|
+
l = R(m ?? l), t === "timer" ? process.stdout.write(`${w} ${l} ${O(g)}
|
|
5972
|
+
`) : process.stdout.write(`${w} ${l}
|
|
5939
5973
|
`), E(), s();
|
|
5940
5974
|
};
|
|
5941
|
-
return { start:
|
|
5942
|
-
|
|
5975
|
+
return { start: H, stop: N, message: (m = "") => {
|
|
5976
|
+
l = R(m ?? l);
|
|
5943
5977
|
} };
|
|
5944
5978
|
};
|
|
5945
5979
|
|
|
@@ -7022,7 +7056,7 @@ class EnvScanner {
|
|
|
7022
7056
|
providerTypes = ["openai_api", "anthropic_api", "gemini_api", "xai_api", "cursor_sdk"];
|
|
7023
7057
|
description = "API keys in environment variables (OPENAI, ANTHROPIC, GEMINI, GROK, CURSOR)";
|
|
7024
7058
|
isAvailable() {
|
|
7025
|
-
return ENV_MAPPINGS.some((
|
|
7059
|
+
return ENV_MAPPINGS.some((m) => Boolean(process.env[m.envVar]?.trim()));
|
|
7026
7060
|
}
|
|
7027
7061
|
scan() {
|
|
7028
7062
|
const accounts = [];
|
|
@@ -7198,11 +7232,11 @@ function formatProviderBadge(providerType) {
|
|
|
7198
7232
|
}
|
|
7199
7233
|
}
|
|
7200
7234
|
function formatPlanBadge(plan) {
|
|
7201
|
-
const
|
|
7202
|
-
if (
|
|
7235
|
+
const p = plan.toLowerCase();
|
|
7236
|
+
if (p.includes("team") || p.includes("enterprise") || p.includes("business")) {
|
|
7203
7237
|
return import_picocolors3.default.magenta(`[${plan.toUpperCase()}]`);
|
|
7204
7238
|
}
|
|
7205
|
-
if (
|
|
7239
|
+
if (p.includes("pro") || p.includes("plus")) {
|
|
7206
7240
|
return import_picocolors3.default.cyan(`[${plan.toUpperCase()}]`);
|
|
7207
7241
|
}
|
|
7208
7242
|
return import_picocolors3.default.dim(`[${plan}]`);
|
|
@@ -7286,7 +7320,7 @@ Or run the interactive wizard:
|
|
|
7286
7320
|
}
|
|
7287
7321
|
const s = Y2();
|
|
7288
7322
|
s.start("Scanning local environment...");
|
|
7289
|
-
const filterProviders = options.provider?.split(",").map((
|
|
7323
|
+
const filterProviders = options.provider?.split(",").map((s) => s.trim().toLowerCase());
|
|
7290
7324
|
const accounts = await scanAllLocal(filterProviders);
|
|
7291
7325
|
if (accounts.length === 0) {
|
|
7292
7326
|
s.stop(import_picocolors4.default.yellow("No local accounts found to import."));
|
|
@@ -7426,12 +7460,12 @@ class ClaudeExecutor {
|
|
|
7426
7460
|
}
|
|
7427
7461
|
}
|
|
7428
7462
|
mapModel(model) {
|
|
7429
|
-
const
|
|
7430
|
-
if (
|
|
7463
|
+
const m = model.toLowerCase();
|
|
7464
|
+
if (m.includes("opus-5") || m.includes("opus-4-6"))
|
|
7431
7465
|
return "claude-opus-5-5";
|
|
7432
|
-
if (
|
|
7466
|
+
if (m.includes("sonnet-4-6") || m.includes("3-7-sonnet") || m.includes("sonnet"))
|
|
7433
7467
|
return "claude-sonnet-4-6";
|
|
7434
|
-
if (
|
|
7468
|
+
if (m.includes("haiku"))
|
|
7435
7469
|
return "claude-haiku-4-5";
|
|
7436
7470
|
return model;
|
|
7437
7471
|
}
|
|
@@ -7887,19 +7921,19 @@ If your account is not in a workspace, accept an owner invitation first.`, "Brid
|
|
|
7887
7921
|
console.log(import_picocolors5.default.italic("All requests sent to Claude Code on ClosedRouter will route through this machine."));
|
|
7888
7922
|
console.log(import_picocolors5.default.dim(`Press Ctrl+C to disconnect and stop the gateway.
|
|
7889
7923
|
`));
|
|
7890
|
-
tunnel.on("job_start", (
|
|
7891
|
-
const timeStr = new Date(
|
|
7892
|
-
console.log(`${import_picocolors5.default.dim(`[${timeStr}]`)} ${import_picocolors5.default.blue("⚡ JOB INCOMING:")} ${import_picocolors5.default.bold(
|
|
7924
|
+
tunnel.on("job_start", (e) => {
|
|
7925
|
+
const timeStr = new Date(e.timestamp).toLocaleTimeString();
|
|
7926
|
+
console.log(`${import_picocolors5.default.dim(`[${timeStr}]`)} ${import_picocolors5.default.blue("⚡ JOB INCOMING:")} ${import_picocolors5.default.bold(e.model)} ${import_picocolors5.default.dim(`(${e.jobId})`)} ${e.isStream ? import_picocolors5.default.cyan("[stream]") : import_picocolors5.default.dim("[json]")}`);
|
|
7893
7927
|
});
|
|
7894
|
-
tunnel.on("job_done", (
|
|
7928
|
+
tunnel.on("job_done", (e) => {
|
|
7895
7929
|
const timeStr = new Date().toLocaleTimeString();
|
|
7896
|
-
const latency =
|
|
7897
|
-
const tokens =
|
|
7898
|
-
console.log(`${import_picocolors5.default.dim(`[${timeStr}]`)} ${import_picocolors5.default.green("✔ COMPLETED:")} ${import_picocolors5.default.bold(
|
|
7930
|
+
const latency = e.latencyMs ? `${e.latencyMs}ms` : "0ms";
|
|
7931
|
+
const tokens = e.tokens ? `${e.tokens} tokens` : "";
|
|
7932
|
+
console.log(`${import_picocolors5.default.dim(`[${timeStr}]`)} ${import_picocolors5.default.green("✔ COMPLETED:")} ${import_picocolors5.default.bold(e.model)} ${import_picocolors5.default.dim("→")} ${import_picocolors5.default.green(latency)} ${import_picocolors5.default.dim(`(${tokens})`)}`);
|
|
7899
7933
|
});
|
|
7900
|
-
tunnel.on("job_error", (
|
|
7934
|
+
tunnel.on("job_error", (e) => {
|
|
7901
7935
|
const timeStr = new Date().toLocaleTimeString();
|
|
7902
|
-
console.log(`${import_picocolors5.default.dim(`[${timeStr}]`)} ${import_picocolors5.default.red("✖ FAILED:")} ${import_picocolors5.default.bold(
|
|
7936
|
+
console.log(`${import_picocolors5.default.dim(`[${timeStr}]`)} ${import_picocolors5.default.red("✖ FAILED:")} ${import_picocolors5.default.bold(e.model)} ${import_picocolors5.default.red(`Error: ${e.error || "Unknown"}`)}`);
|
|
7903
7937
|
});
|
|
7904
7938
|
tunnel.on("disconnected", (info) => {
|
|
7905
7939
|
console.log(import_picocolors5.default.yellow(`
|
|
@@ -7955,12 +7989,12 @@ async function keysCommand(action, keyName) {
|
|
|
7955
7989
|
return;
|
|
7956
7990
|
name = res;
|
|
7957
7991
|
}
|
|
7958
|
-
const
|
|
7959
|
-
|
|
7992
|
+
const s = Y2();
|
|
7993
|
+
s.start("Generating API key...");
|
|
7960
7994
|
try {
|
|
7961
7995
|
const res = await client.createApiKey(name);
|
|
7962
7996
|
const key = res.key || res.token || res.apiKey;
|
|
7963
|
-
|
|
7997
|
+
s.stop(import_picocolors6.default.green(`Key created successfully!`));
|
|
7964
7998
|
saveConfig({ apiKey: key });
|
|
7965
7999
|
Me(`${import_picocolors6.default.bold("Key Secret :")} ${import_picocolors6.default.green(key)}
|
|
7966
8000
|
${import_picocolors6.default.bold("Key ID :")} ${res.id}
|
|
@@ -7969,7 +8003,7 @@ ${import_picocolors6.default.bold("Name :")} ${name}
|
|
|
7969
8003
|
${import_picocolors6.default.yellow("Save this key securely. It has been set as your active local CLI key.")}`, "New Platform Key");
|
|
7970
8004
|
console.log(formatCliInstructions(config.serverUrl, key));
|
|
7971
8005
|
} catch (err) {
|
|
7972
|
-
|
|
8006
|
+
s.stop(import_picocolors6.default.red("Failed to create key"));
|
|
7973
8007
|
Me(err instanceof Error ? err.message : String(err), "Error");
|
|
7974
8008
|
process.exitCode = 1;
|
|
7975
8009
|
}
|
|
@@ -7986,13 +8020,13 @@ ${import_picocolors6.default.yellow("Save this key securely. It has been set as
|
|
|
7986
8020
|
Create one via:
|
|
7987
8021
|
${import_picocolors6.default.bold("closedrouter keys create")}`, "No Keys");
|
|
7988
8022
|
} else {
|
|
7989
|
-
const rows = keys.map((
|
|
7990
|
-
const active =
|
|
7991
|
-
const budgetLimit =
|
|
8023
|
+
const rows = keys.map((k, i) => {
|
|
8024
|
+
const active = k.is_active ? import_picocolors6.default.green("● active") : import_picocolors6.default.red("○ revoked");
|
|
8025
|
+
const budgetLimit = k.budget_limit_tokens ?? k.budget_tokens;
|
|
7992
8026
|
const budget = budgetLimit == null ? "unlimited" : `${Number(budgetLimit).toLocaleString()} tokens`;
|
|
7993
|
-
const used = `${Number(
|
|
7994
|
-
return ` ${import_picocolors6.default.dim((i + 1).toString().padStart(2, " "))}. ${import_picocolors6.default.bold(
|
|
7995
|
-
${import_picocolors6.default.dim("Created:")} ${new Date(
|
|
8027
|
+
const used = `${Number(k.used_tokens ?? 0).toLocaleString()} tokens`;
|
|
8028
|
+
return ` ${import_picocolors6.default.dim((i + 1).toString().padStart(2, " "))}. ${import_picocolors6.default.bold(k.name || "Unnamed Key")} [${k.key_prefix || "cr-sk-..."}] ${active}
|
|
8029
|
+
${import_picocolors6.default.dim("Created:")} ${new Date(k.created_at).toLocaleDateString()} | ${import_picocolors6.default.dim("Budget:")} ${budget} | ${import_picocolors6.default.dim("Used:")} ${used}`;
|
|
7996
8030
|
});
|
|
7997
8031
|
console.log(rows.join(`
|
|
7998
8032
|
|
|
@@ -8522,10 +8556,10 @@ You can add keys in the web dashboard at http://localhost:5173`, "Scan Results")
|
|
|
8522
8556
|
// src/commands/scan.ts
|
|
8523
8557
|
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
8524
8558
|
async function scanCommand(options) {
|
|
8525
|
-
const filterProviders = options.provider?.split(",").map((
|
|
8559
|
+
const filterProviders = options.provider?.split(",").map((s) => s.trim().toLowerCase());
|
|
8526
8560
|
if (options.json) {
|
|
8527
|
-
const
|
|
8528
|
-
const sanitized =
|
|
8561
|
+
const accounts = await scanAllLocal(filterProviders);
|
|
8562
|
+
const sanitized = accounts.map((a) => ({
|
|
8529
8563
|
source: a.source,
|
|
8530
8564
|
providerType: a.providerType,
|
|
8531
8565
|
authKind: a.authKind,
|
|
@@ -8972,7 +9006,7 @@ process.on("warning", (warning) => {
|
|
|
8972
9006
|
return;
|
|
8973
9007
|
console.warn(warning.name, warning.message);
|
|
8974
9008
|
});
|
|
8975
|
-
var program2 = new
|
|
9009
|
+
var program2 = new Command2;
|
|
8976
9010
|
var cliVersion = JSON.parse(readFileSync9(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
8977
9011
|
program2.name("closedrouter").description("ClosedRouter CLI: Import local AI subscriptions & API keys into your shared token pool").version(cliVersion).option("-s, --server <url>", "ClosedRouter server base URL (default: http://localhost:8000)").action(async (options) => {
|
|
8978
9012
|
await onboardCommand({ server: options.server });
|
package/package.json
CHANGED