@closedrouter/cli 1.1.4 → 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 +260 -222
- 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,67 @@ 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;
|
|
5198
|
+
|
|
5199
|
+
// src/index.ts
|
|
5200
|
+
import { readFileSync as readFileSync9 } from "node:fs";
|
|
5164
5201
|
|
|
5165
5202
|
// ../node_modules/.bun/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
|
|
5166
5203
|
import { stripVTControlCharacters as S2 } from "node:util";
|
|
@@ -5691,19 +5728,19 @@ var b2 = (t) => {
|
|
|
5691
5728
|
}
|
|
5692
5729
|
};
|
|
5693
5730
|
var G2 = (t) => {
|
|
5694
|
-
const { cursor: n, options:
|
|
5695
|
-
let
|
|
5696
|
-
n >=
|
|
5697
|
-
const $
|
|
5698
|
-
return
|
|
5699
|
-
const
|
|
5700
|
-
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);
|
|
5701
5738
|
});
|
|
5702
5739
|
};
|
|
5703
5740
|
var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
|
|
5704
5741
|
const n = `${import_picocolors2.default.gray(o)}
|
|
5705
5742
|
${b2(this.state)} ${t.message}
|
|
5706
|
-
`,
|
|
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;
|
|
5707
5744
|
switch (this.state) {
|
|
5708
5745
|
case "error":
|
|
5709
5746
|
return `${n.trim()}
|
|
@@ -5724,7 +5761,7 @@ ${import_picocolors2.default.cyan(d2)}
|
|
|
5724
5761
|
var ge = (t) => new MD({ validate: t.validate, mask: t.mask ?? $e, render() {
|
|
5725
5762
|
const n = `${import_picocolors2.default.gray(o)}
|
|
5726
5763
|
${b2(this.state)} ${t.message}
|
|
5727
|
-
`,
|
|
5764
|
+
`, r = this.valueWithCursor, i = this.masked;
|
|
5728
5765
|
switch (this.state) {
|
|
5729
5766
|
case "error":
|
|
5730
5767
|
return `${n.trim()}
|
|
@@ -5737,17 +5774,17 @@ ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(th
|
|
|
5737
5774
|
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i ?? ""))}${i ? `
|
|
5738
5775
|
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
5739
5776
|
default:
|
|
5740
|
-
return `${n}${import_picocolors2.default.cyan(o)} ${
|
|
5777
|
+
return `${n}${import_picocolors2.default.cyan(o)} ${r}
|
|
5741
5778
|
${import_picocolors2.default.cyan(d2)}
|
|
5742
5779
|
`;
|
|
5743
5780
|
}
|
|
5744
5781
|
} }).prompt();
|
|
5745
5782
|
var ye = (t) => {
|
|
5746
|
-
const n = t.active ?? "Yes",
|
|
5747
|
-
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() {
|
|
5748
5785
|
const i = `${import_picocolors2.default.gray(o)}
|
|
5749
5786
|
${b2(this.state)} ${t.message}
|
|
5750
|
-
`, s = this.value ? n :
|
|
5787
|
+
`, s = this.value ? n : r;
|
|
5751
5788
|
switch (this.state) {
|
|
5752
5789
|
case "submit":
|
|
5753
5790
|
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
|
|
@@ -5755,20 +5792,20 @@ ${b2(this.state)} ${t.message}
|
|
|
5755
5792
|
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
|
|
5756
5793
|
${import_picocolors2.default.gray(o)}`;
|
|
5757
5794
|
default:
|
|
5758
|
-
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}`}
|
|
5759
5796
|
${import_picocolors2.default.cyan(d2)}
|
|
5760
5797
|
`;
|
|
5761
5798
|
}
|
|
5762
5799
|
} }).prompt();
|
|
5763
5800
|
};
|
|
5764
5801
|
var ve = (t) => {
|
|
5765
|
-
const n = (
|
|
5766
|
-
const s =
|
|
5802
|
+
const n = (r, i) => {
|
|
5803
|
+
const s = r.label ?? String(r.value);
|
|
5767
5804
|
switch (i) {
|
|
5768
5805
|
case "selected":
|
|
5769
5806
|
return `${import_picocolors2.default.dim(s)}`;
|
|
5770
5807
|
case "active":
|
|
5771
|
-
return `${import_picocolors2.default.green(k2)} ${s} ${
|
|
5808
|
+
return `${import_picocolors2.default.green(k2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}`;
|
|
5772
5809
|
case "cancelled":
|
|
5773
5810
|
return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
|
|
5774
5811
|
default:
|
|
@@ -5776,17 +5813,17 @@ var ve = (t) => {
|
|
|
5776
5813
|
}
|
|
5777
5814
|
};
|
|
5778
5815
|
return new LD({ options: t.options, initialValue: t.initialValue, render() {
|
|
5779
|
-
const
|
|
5816
|
+
const r = `${import_picocolors2.default.gray(o)}
|
|
5780
5817
|
${b2(this.state)} ${t.message}
|
|
5781
5818
|
`;
|
|
5782
5819
|
switch (this.state) {
|
|
5783
5820
|
case "submit":
|
|
5784
|
-
return `${
|
|
5821
|
+
return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
5785
5822
|
case "cancel":
|
|
5786
|
-
return `${
|
|
5823
|
+
return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
5787
5824
|
${import_picocolors2.default.gray(o)}`;
|
|
5788
5825
|
default:
|
|
5789
|
-
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(`
|
|
5790
5827
|
${import_picocolors2.default.cyan(o)} `)}
|
|
5791
5828
|
${import_picocolors2.default.cyan(d2)}
|
|
5792
5829
|
`;
|
|
@@ -5794,16 +5831,16 @@ ${import_picocolors2.default.cyan(d2)}
|
|
|
5794
5831
|
} }).prompt();
|
|
5795
5832
|
};
|
|
5796
5833
|
var fe = (t) => {
|
|
5797
|
-
const n = (
|
|
5798
|
-
const s =
|
|
5799
|
-
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)}`;
|
|
5800
5837
|
};
|
|
5801
|
-
return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(
|
|
5802
|
-
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)
|
|
5803
5840
|
return `Please select at least one option.
|
|
5804
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`))}`;
|
|
5805
5842
|
}, render() {
|
|
5806
|
-
const
|
|
5843
|
+
const r = `${import_picocolors2.default.gray(o)}
|
|
5807
5844
|
${b2(this.state)} ${t.message}
|
|
5808
5845
|
`, i = (s, c) => {
|
|
5809
5846
|
const a = this.value.includes(s.value);
|
|
@@ -5811,23 +5848,23 @@ ${b2(this.state)} ${t.message}
|
|
|
5811
5848
|
};
|
|
5812
5849
|
switch (this.state) {
|
|
5813
5850
|
case "submit":
|
|
5814
|
-
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")}`;
|
|
5815
5852
|
case "cancel": {
|
|
5816
5853
|
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
5817
|
-
return `${
|
|
5854
|
+
return `${r}${import_picocolors2.default.gray(o)} ${s.trim() ? `${s}
|
|
5818
5855
|
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
5819
5856
|
}
|
|
5820
5857
|
case "error": {
|
|
5821
5858
|
const s = this.error.split(`
|
|
5822
5859
|
`).map((c, a) => a === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(c)}` : ` ${c}`).join(`
|
|
5823
5860
|
`);
|
|
5824
|
-
return `${
|
|
5861
|
+
return `${r + import_picocolors2.default.yellow(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
|
|
5825
5862
|
${import_picocolors2.default.yellow(o)} `)}
|
|
5826
5863
|
${s}
|
|
5827
5864
|
`;
|
|
5828
5865
|
}
|
|
5829
5866
|
default:
|
|
5830
|
-
return `${
|
|
5867
|
+
return `${r}${import_picocolors2.default.cyan(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
|
|
5831
5868
|
${import_picocolors2.default.cyan(o)} `)}
|
|
5832
5869
|
${import_picocolors2.default.cyan(d2)}
|
|
5833
5870
|
`;
|
|
@@ -5835,13 +5872,13 @@ ${import_picocolors2.default.cyan(d2)}
|
|
|
5835
5872
|
} }).prompt();
|
|
5836
5873
|
};
|
|
5837
5874
|
var Me = (t = "", n = "") => {
|
|
5838
|
-
const
|
|
5875
|
+
const r = `
|
|
5839
5876
|
${t}
|
|
5840
5877
|
`.split(`
|
|
5841
|
-
`), i = S2(n).length, s = Math.max(
|
|
5842
|
-
const $
|
|
5843
|
-
return
|
|
5844
|
-
}, 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(`
|
|
5845
5882
|
`);
|
|
5846
5883
|
process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
5847
5884
|
${import_picocolors2.default.green(C)} ${import_picocolors2.default.reset(n)} ${import_picocolors2.default.gray(_2.repeat(Math.max(s - i - 1, 1)) + me)}
|
|
@@ -5865,13 +5902,13 @@ ${import_picocolors2.default.gray(d2)} ${t}
|
|
|
5865
5902
|
`);
|
|
5866
5903
|
};
|
|
5867
5904
|
var M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
|
|
5868
|
-
const
|
|
5905
|
+
const r = [`${import_picocolors2.default.gray(o)}`];
|
|
5869
5906
|
if (t) {
|
|
5870
5907
|
const [i, ...s] = t.split(`
|
|
5871
5908
|
`);
|
|
5872
|
-
|
|
5909
|
+
r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors2.default.gray(o)} ${c}`));
|
|
5873
5910
|
}
|
|
5874
|
-
process.stdout.write(`${
|
|
5911
|
+
process.stdout.write(`${r.join(`
|
|
5875
5912
|
`)}
|
|
5876
5913
|
`);
|
|
5877
5914
|
}, info: (t) => {
|
|
@@ -5889,54 +5926,54 @@ var M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) }
|
|
|
5889
5926
|
} };
|
|
5890
5927
|
var J2 = `${import_picocolors2.default.gray(o)} `;
|
|
5891
5928
|
var Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
5892
|
-
const n = V2 ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"],
|
|
5893
|
-
let s, c, a = false,
|
|
5894
|
-
const
|
|
5895
|
-
const
|
|
5896
|
-
a &&
|
|
5897
|
-
},
|
|
5898
|
-
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);
|
|
5899
5936
|
}, E = () => {
|
|
5900
|
-
process.removeListener("uncaughtExceptionMonitor",
|
|
5901
|
-
},
|
|
5902
|
-
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)
|
|
5903
5940
|
return;
|
|
5904
5941
|
i && process.stdout.write(`
|
|
5905
5942
|
`);
|
|
5906
|
-
const
|
|
5943
|
+
const m = $.split(`
|
|
5907
5944
|
`);
|
|
5908
|
-
process.stdout.write(import_sisteransi2.cursor.move(-999,
|
|
5909
|
-
},
|
|
5910
|
-
const
|
|
5911
|
-
return
|
|
5912
|
-
},
|
|
5913
|
-
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)}
|
|
5914
5951
|
`);
|
|
5915
|
-
let
|
|
5916
|
-
|
|
5917
|
-
if (i &&
|
|
5952
|
+
let h = 0, w = 0;
|
|
5953
|
+
j(), c = setInterval(() => {
|
|
5954
|
+
if (i && l === $)
|
|
5918
5955
|
return;
|
|
5919
|
-
|
|
5920
|
-
const
|
|
5956
|
+
B(), $ = l;
|
|
5957
|
+
const I = import_picocolors2.default.magenta(n[h]);
|
|
5921
5958
|
if (i)
|
|
5922
|
-
process.stdout.write(`${
|
|
5959
|
+
process.stdout.write(`${I} ${l}...`);
|
|
5923
5960
|
else if (t === "timer")
|
|
5924
|
-
process.stdout.write(`${
|
|
5961
|
+
process.stdout.write(`${I} ${l} ${O(g)}`);
|
|
5925
5962
|
else {
|
|
5926
|
-
const
|
|
5927
|
-
process.stdout.write(`${
|
|
5928
|
-
}
|
|
5929
|
-
|
|
5930
|
-
},
|
|
5931
|
-
},
|
|
5932
|
-
a = false, clearInterval(c),
|
|
5933
|
-
const
|
|
5934
|
-
|
|
5935
|
-
`) : 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}
|
|
5936
5973
|
`), E(), s();
|
|
5937
5974
|
};
|
|
5938
|
-
return { start:
|
|
5939
|
-
|
|
5975
|
+
return { start: H, stop: N, message: (m = "") => {
|
|
5976
|
+
l = R(m ?? l);
|
|
5940
5977
|
} };
|
|
5941
5978
|
};
|
|
5942
5979
|
|
|
@@ -7019,7 +7056,7 @@ class EnvScanner {
|
|
|
7019
7056
|
providerTypes = ["openai_api", "anthropic_api", "gemini_api", "xai_api", "cursor_sdk"];
|
|
7020
7057
|
description = "API keys in environment variables (OPENAI, ANTHROPIC, GEMINI, GROK, CURSOR)";
|
|
7021
7058
|
isAvailable() {
|
|
7022
|
-
return ENV_MAPPINGS.some((
|
|
7059
|
+
return ENV_MAPPINGS.some((m) => Boolean(process.env[m.envVar]?.trim()));
|
|
7023
7060
|
}
|
|
7024
7061
|
scan() {
|
|
7025
7062
|
const accounts = [];
|
|
@@ -7195,11 +7232,11 @@ function formatProviderBadge(providerType) {
|
|
|
7195
7232
|
}
|
|
7196
7233
|
}
|
|
7197
7234
|
function formatPlanBadge(plan) {
|
|
7198
|
-
const
|
|
7199
|
-
if (
|
|
7235
|
+
const p = plan.toLowerCase();
|
|
7236
|
+
if (p.includes("team") || p.includes("enterprise") || p.includes("business")) {
|
|
7200
7237
|
return import_picocolors3.default.magenta(`[${plan.toUpperCase()}]`);
|
|
7201
7238
|
}
|
|
7202
|
-
if (
|
|
7239
|
+
if (p.includes("pro") || p.includes("plus")) {
|
|
7203
7240
|
return import_picocolors3.default.cyan(`[${plan.toUpperCase()}]`);
|
|
7204
7241
|
}
|
|
7205
7242
|
return import_picocolors3.default.dim(`[${plan}]`);
|
|
@@ -7283,7 +7320,7 @@ Or run the interactive wizard:
|
|
|
7283
7320
|
}
|
|
7284
7321
|
const s = Y2();
|
|
7285
7322
|
s.start("Scanning local environment...");
|
|
7286
|
-
const filterProviders = options.provider?.split(",").map((
|
|
7323
|
+
const filterProviders = options.provider?.split(",").map((s) => s.trim().toLowerCase());
|
|
7287
7324
|
const accounts = await scanAllLocal(filterProviders);
|
|
7288
7325
|
if (accounts.length === 0) {
|
|
7289
7326
|
s.stop(import_picocolors4.default.yellow("No local accounts found to import."));
|
|
@@ -7423,12 +7460,12 @@ class ClaudeExecutor {
|
|
|
7423
7460
|
}
|
|
7424
7461
|
}
|
|
7425
7462
|
mapModel(model) {
|
|
7426
|
-
const
|
|
7427
|
-
if (
|
|
7463
|
+
const m = model.toLowerCase();
|
|
7464
|
+
if (m.includes("opus-5") || m.includes("opus-4-6"))
|
|
7428
7465
|
return "claude-opus-5-5";
|
|
7429
|
-
if (
|
|
7466
|
+
if (m.includes("sonnet-4-6") || m.includes("3-7-sonnet") || m.includes("sonnet"))
|
|
7430
7467
|
return "claude-sonnet-4-6";
|
|
7431
|
-
if (
|
|
7468
|
+
if (m.includes("haiku"))
|
|
7432
7469
|
return "claude-haiku-4-5";
|
|
7433
7470
|
return model;
|
|
7434
7471
|
}
|
|
@@ -7884,19 +7921,19 @@ If your account is not in a workspace, accept an owner invitation first.`, "Brid
|
|
|
7884
7921
|
console.log(import_picocolors5.default.italic("All requests sent to Claude Code on ClosedRouter will route through this machine."));
|
|
7885
7922
|
console.log(import_picocolors5.default.dim(`Press Ctrl+C to disconnect and stop the gateway.
|
|
7886
7923
|
`));
|
|
7887
|
-
tunnel.on("job_start", (
|
|
7888
|
-
const timeStr = new Date(
|
|
7889
|
-
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]")}`);
|
|
7890
7927
|
});
|
|
7891
|
-
tunnel.on("job_done", (
|
|
7928
|
+
tunnel.on("job_done", (e) => {
|
|
7892
7929
|
const timeStr = new Date().toLocaleTimeString();
|
|
7893
|
-
const latency =
|
|
7894
|
-
const tokens =
|
|
7895
|
-
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})`)}`);
|
|
7896
7933
|
});
|
|
7897
|
-
tunnel.on("job_error", (
|
|
7934
|
+
tunnel.on("job_error", (e) => {
|
|
7898
7935
|
const timeStr = new Date().toLocaleTimeString();
|
|
7899
|
-
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"}`)}`);
|
|
7900
7937
|
});
|
|
7901
7938
|
tunnel.on("disconnected", (info) => {
|
|
7902
7939
|
console.log(import_picocolors5.default.yellow(`
|
|
@@ -7952,12 +7989,12 @@ async function keysCommand(action, keyName) {
|
|
|
7952
7989
|
return;
|
|
7953
7990
|
name = res;
|
|
7954
7991
|
}
|
|
7955
|
-
const
|
|
7956
|
-
|
|
7992
|
+
const s = Y2();
|
|
7993
|
+
s.start("Generating API key...");
|
|
7957
7994
|
try {
|
|
7958
7995
|
const res = await client.createApiKey(name);
|
|
7959
7996
|
const key = res.key || res.token || res.apiKey;
|
|
7960
|
-
|
|
7997
|
+
s.stop(import_picocolors6.default.green(`Key created successfully!`));
|
|
7961
7998
|
saveConfig({ apiKey: key });
|
|
7962
7999
|
Me(`${import_picocolors6.default.bold("Key Secret :")} ${import_picocolors6.default.green(key)}
|
|
7963
8000
|
${import_picocolors6.default.bold("Key ID :")} ${res.id}
|
|
@@ -7966,7 +8003,7 @@ ${import_picocolors6.default.bold("Name :")} ${name}
|
|
|
7966
8003
|
${import_picocolors6.default.yellow("Save this key securely. It has been set as your active local CLI key.")}`, "New Platform Key");
|
|
7967
8004
|
console.log(formatCliInstructions(config.serverUrl, key));
|
|
7968
8005
|
} catch (err) {
|
|
7969
|
-
|
|
8006
|
+
s.stop(import_picocolors6.default.red("Failed to create key"));
|
|
7970
8007
|
Me(err instanceof Error ? err.message : String(err), "Error");
|
|
7971
8008
|
process.exitCode = 1;
|
|
7972
8009
|
}
|
|
@@ -7983,13 +8020,13 @@ ${import_picocolors6.default.yellow("Save this key securely. It has been set as
|
|
|
7983
8020
|
Create one via:
|
|
7984
8021
|
${import_picocolors6.default.bold("closedrouter keys create")}`, "No Keys");
|
|
7985
8022
|
} else {
|
|
7986
|
-
const rows = keys.map((
|
|
7987
|
-
const active =
|
|
7988
|
-
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;
|
|
7989
8026
|
const budget = budgetLimit == null ? "unlimited" : `${Number(budgetLimit).toLocaleString()} tokens`;
|
|
7990
|
-
const used = `${Number(
|
|
7991
|
-
return ` ${import_picocolors6.default.dim((i + 1).toString().padStart(2, " "))}. ${import_picocolors6.default.bold(
|
|
7992
|
-
${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}`;
|
|
7993
8030
|
});
|
|
7994
8031
|
console.log(rows.join(`
|
|
7995
8032
|
|
|
@@ -8519,10 +8556,10 @@ You can add keys in the web dashboard at http://localhost:5173`, "Scan Results")
|
|
|
8519
8556
|
// src/commands/scan.ts
|
|
8520
8557
|
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
8521
8558
|
async function scanCommand(options) {
|
|
8522
|
-
const filterProviders = options.provider?.split(",").map((
|
|
8559
|
+
const filterProviders = options.provider?.split(",").map((s) => s.trim().toLowerCase());
|
|
8523
8560
|
if (options.json) {
|
|
8524
|
-
const
|
|
8525
|
-
const sanitized =
|
|
8561
|
+
const accounts = await scanAllLocal(filterProviders);
|
|
8562
|
+
const sanitized = accounts.map((a) => ({
|
|
8526
8563
|
source: a.source,
|
|
8527
8564
|
providerType: a.providerType,
|
|
8528
8565
|
authKind: a.authKind,
|
|
@@ -8969,8 +9006,9 @@ process.on("warning", (warning) => {
|
|
|
8969
9006
|
return;
|
|
8970
9007
|
console.warn(warning.name, warning.message);
|
|
8971
9008
|
});
|
|
8972
|
-
var program2 = new
|
|
8973
|
-
|
|
9009
|
+
var program2 = new Command2;
|
|
9010
|
+
var cliVersion = JSON.parse(readFileSync9(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
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) => {
|
|
8974
9012
|
await onboardCommand({ server: options.server });
|
|
8975
9013
|
});
|
|
8976
9014
|
program2.command("onboard").description("Run the full interactive onboarding wizard").option("-s, --server <url>", "ClosedRouter server base URL").option("-a, --all", "Automatically import all discovered accounts").option("--shared", "Contribute accounts to the shared team pool").action(async (options) => {
|
package/package.json
CHANGED