@kevisual/cli 0.0.77 → 0.0.79
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/assistant-server.js +523 -278
- package/dist/assistant.js +6159 -253
- package/dist/envision.js +1159 -20154
- package/package.json +7 -6
package/dist/assistant-server.js
CHANGED
|
@@ -23937,7 +23937,7 @@ var require_safer = __commonJS((exports, module) => {
|
|
|
23937
23937
|
module.exports = safer;
|
|
23938
23938
|
});
|
|
23939
23939
|
|
|
23940
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
23940
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/lib/bom-handling.js
|
|
23941
23941
|
var require_bom_handling = __commonJS((exports) => {
|
|
23942
23942
|
var BOMChar = "\uFEFF";
|
|
23943
23943
|
exports.PrependBOM = PrependBOMWrapper;
|
|
@@ -23980,7 +23980,7 @@ var require_bom_handling = __commonJS((exports) => {
|
|
|
23980
23980
|
};
|
|
23981
23981
|
});
|
|
23982
23982
|
|
|
23983
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
23983
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/lib/helpers/merge-exports.js
|
|
23984
23984
|
var require_merge_exports = __commonJS((exports, module) => {
|
|
23985
23985
|
var hasOwn = typeof Object.hasOwn === "undefined" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn;
|
|
23986
23986
|
function mergeModules(target, module2) {
|
|
@@ -23993,7 +23993,7 @@ var require_merge_exports = __commonJS((exports, module) => {
|
|
|
23993
23993
|
module.exports = mergeModules;
|
|
23994
23994
|
});
|
|
23995
23995
|
|
|
23996
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
23996
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/internal.js
|
|
23997
23997
|
var require_internal = __commonJS((exports, module) => {
|
|
23998
23998
|
var Buffer5 = require_safer().Buffer;
|
|
23999
23999
|
module.exports = {
|
|
@@ -24166,7 +24166,7 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
24166
24166
|
};
|
|
24167
24167
|
});
|
|
24168
24168
|
|
|
24169
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
24169
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/utf32.js
|
|
24170
24170
|
var require_utf32 = __commonJS((exports) => {
|
|
24171
24171
|
var Buffer5 = require_safer().Buffer;
|
|
24172
24172
|
exports._utf32 = Utf32Codec;
|
|
@@ -24400,7 +24400,7 @@ var require_utf32 = __commonJS((exports) => {
|
|
|
24400
24400
|
}
|
|
24401
24401
|
});
|
|
24402
24402
|
|
|
24403
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
24403
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/utf16.js
|
|
24404
24404
|
var require_utf16 = __commonJS((exports) => {
|
|
24405
24405
|
var Buffer5 = require_safer().Buffer;
|
|
24406
24406
|
exports.utf16be = Utf16BECodec;
|
|
@@ -24543,7 +24543,7 @@ var require_utf16 = __commonJS((exports) => {
|
|
|
24543
24543
|
}
|
|
24544
24544
|
});
|
|
24545
24545
|
|
|
24546
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
24546
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/utf7.js
|
|
24547
24547
|
var require_utf7 = __commonJS((exports) => {
|
|
24548
24548
|
var Buffer5 = require_safer().Buffer;
|
|
24549
24549
|
exports.utf7 = Utf7Codec;
|
|
@@ -24757,7 +24757,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
24757
24757
|
};
|
|
24758
24758
|
});
|
|
24759
24759
|
|
|
24760
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
24760
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/sbcs-codec.js
|
|
24761
24761
|
var require_sbcs_codec = __commonJS((exports) => {
|
|
24762
24762
|
var Buffer5 = require_safer().Buffer;
|
|
24763
24763
|
exports._sbcs = SBCSCodec;
|
|
@@ -24814,7 +24814,7 @@ var require_sbcs_codec = __commonJS((exports) => {
|
|
|
24814
24814
|
SBCSDecoder.prototype.end = function() {};
|
|
24815
24815
|
});
|
|
24816
24816
|
|
|
24817
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
24817
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/sbcs-data.js
|
|
24818
24818
|
var require_sbcs_data = __commonJS((exports, module) => {
|
|
24819
24819
|
module.exports = {
|
|
24820
24820
|
10029: "maccenteuro",
|
|
@@ -24962,7 +24962,7 @@ var require_sbcs_data = __commonJS((exports, module) => {
|
|
|
24962
24962
|
};
|
|
24963
24963
|
});
|
|
24964
24964
|
|
|
24965
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
24965
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/sbcs-data-generated.js
|
|
24966
24966
|
var require_sbcs_data_generated = __commonJS((exports, module) => {
|
|
24967
24967
|
module.exports = {
|
|
24968
24968
|
"437": "cp437",
|
|
@@ -25419,7 +25419,7 @@ var require_sbcs_data_generated = __commonJS((exports, module) => {
|
|
|
25419
25419
|
};
|
|
25420
25420
|
});
|
|
25421
25421
|
|
|
25422
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
25422
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/dbcs-codec.js
|
|
25423
25423
|
var require_dbcs_codec = __commonJS((exports) => {
|
|
25424
25424
|
var Buffer5 = require_safer().Buffer;
|
|
25425
25425
|
exports._dbcs = DBCSCodec;
|
|
@@ -25877,7 +25877,7 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
25877
25877
|
}
|
|
25878
25878
|
});
|
|
25879
25879
|
|
|
25880
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
25880
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/tables/shiftjis.json
|
|
25881
25881
|
var require_shiftjis = __commonJS((exports, module) => {
|
|
25882
25882
|
module.exports = [
|
|
25883
25883
|
["0", "\x00", 128],
|
|
@@ -26006,7 +26006,7 @@ var require_shiftjis = __commonJS((exports, module) => {
|
|
|
26006
26006
|
];
|
|
26007
26007
|
});
|
|
26008
26008
|
|
|
26009
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
26009
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/tables/eucjp.json
|
|
26010
26010
|
var require_eucjp = __commonJS((exports, module) => {
|
|
26011
26011
|
module.exports = [
|
|
26012
26012
|
["0", "\x00", 127],
|
|
@@ -26192,7 +26192,7 @@ var require_eucjp = __commonJS((exports, module) => {
|
|
|
26192
26192
|
];
|
|
26193
26193
|
});
|
|
26194
26194
|
|
|
26195
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
26195
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/tables/cp936.json
|
|
26196
26196
|
var require_cp936 = __commonJS((exports, module) => {
|
|
26197
26197
|
module.exports = [
|
|
26198
26198
|
["0", "\x00", 127, "€"],
|
|
@@ -26460,7 +26460,7 @@ var require_cp936 = __commonJS((exports, module) => {
|
|
|
26460
26460
|
];
|
|
26461
26461
|
});
|
|
26462
26462
|
|
|
26463
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
26463
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/tables/gbk-added.json
|
|
26464
26464
|
var require_gbk_added = __commonJS((exports, module) => {
|
|
26465
26465
|
module.exports = [
|
|
26466
26466
|
["a140", "", 62],
|
|
@@ -26520,12 +26520,12 @@ var require_gbk_added = __commonJS((exports, module) => {
|
|
|
26520
26520
|
];
|
|
26521
26521
|
});
|
|
26522
26522
|
|
|
26523
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
26523
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json
|
|
26524
26524
|
var require_gb18030_ranges = __commonJS((exports, module) => {
|
|
26525
26525
|
module.exports = { uChars: [128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536], gbChars: [0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189000] };
|
|
26526
26526
|
});
|
|
26527
26527
|
|
|
26528
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
26528
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/tables/cp949.json
|
|
26529
26529
|
var require_cp949 = __commonJS((exports, module) => {
|
|
26530
26530
|
module.exports = [
|
|
26531
26531
|
["0", "\x00", 127],
|
|
@@ -26802,7 +26802,7 @@ var require_cp949 = __commonJS((exports, module) => {
|
|
|
26802
26802
|
];
|
|
26803
26803
|
});
|
|
26804
26804
|
|
|
26805
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
26805
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/tables/cp950.json
|
|
26806
26806
|
var require_cp950 = __commonJS((exports, module) => {
|
|
26807
26807
|
module.exports = [
|
|
26808
26808
|
["0", "\x00", 127],
|
|
@@ -26983,7 +26983,7 @@ var require_cp950 = __commonJS((exports, module) => {
|
|
|
26983
26983
|
];
|
|
26984
26984
|
});
|
|
26985
26985
|
|
|
26986
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
26986
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/tables/big5-added.json
|
|
26987
26987
|
var require_big5_added = __commonJS((exports, module) => {
|
|
26988
26988
|
module.exports = [
|
|
26989
26989
|
["8740", "䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"],
|
|
@@ -27109,7 +27109,7 @@ var require_big5_added = __commonJS((exports, module) => {
|
|
|
27109
27109
|
];
|
|
27110
27110
|
});
|
|
27111
27111
|
|
|
27112
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
27112
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/dbcs-data.js
|
|
27113
27113
|
var require_dbcs_data = __commonJS((exports, module) => {
|
|
27114
27114
|
module.exports = {
|
|
27115
27115
|
shiftjis: {
|
|
@@ -27280,7 +27280,7 @@ var require_dbcs_data = __commonJS((exports, module) => {
|
|
|
27280
27280
|
};
|
|
27281
27281
|
});
|
|
27282
27282
|
|
|
27283
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
27283
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/encodings/index.js
|
|
27284
27284
|
var require_encodings = __commonJS((exports, module) => {
|
|
27285
27285
|
var mergeModules = require_merge_exports();
|
|
27286
27286
|
var modules = [
|
|
@@ -27302,7 +27302,7 @@ var require_encodings = __commonJS((exports, module) => {
|
|
|
27302
27302
|
var i;
|
|
27303
27303
|
});
|
|
27304
27304
|
|
|
27305
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
27305
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/lib/streams.js
|
|
27306
27306
|
var require_streams = __commonJS((exports, module) => {
|
|
27307
27307
|
var Buffer5 = require_safer().Buffer;
|
|
27308
27308
|
module.exports = function(streamModule) {
|
|
@@ -27400,60 +27400,59 @@ var require_streams = __commonJS((exports, module) => {
|
|
|
27400
27400
|
};
|
|
27401
27401
|
});
|
|
27402
27402
|
|
|
27403
|
-
// ../node_modules/.pnpm/iconv-lite@0.7.
|
|
27403
|
+
// ../node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/lib/index.js
|
|
27404
27404
|
var require_lib3 = __commonJS((exports, module) => {
|
|
27405
27405
|
var Buffer5 = require_safer().Buffer;
|
|
27406
27406
|
var bomHandling = require_bom_handling();
|
|
27407
27407
|
var mergeModules = require_merge_exports();
|
|
27408
|
-
|
|
27409
|
-
|
|
27410
|
-
|
|
27411
|
-
|
|
27412
|
-
iconv.encode = function encode(str, encoding, options) {
|
|
27408
|
+
exports.encodings = null;
|
|
27409
|
+
exports.defaultCharUnicode = "�";
|
|
27410
|
+
exports.defaultCharSingleByte = "?";
|
|
27411
|
+
exports.encode = function encode(str, encoding, options) {
|
|
27413
27412
|
str = "" + (str || "");
|
|
27414
|
-
var encoder =
|
|
27413
|
+
var encoder = exports.getEncoder(encoding, options);
|
|
27415
27414
|
var res = encoder.write(str);
|
|
27416
27415
|
var trail = encoder.end();
|
|
27417
27416
|
return trail && trail.length > 0 ? Buffer5.concat([res, trail]) : res;
|
|
27418
27417
|
};
|
|
27419
|
-
|
|
27418
|
+
exports.decode = function decode(buf, encoding, options) {
|
|
27420
27419
|
if (typeof buf === "string") {
|
|
27421
|
-
if (!
|
|
27420
|
+
if (!exports.skipDecodeWarning) {
|
|
27422
27421
|
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
|
|
27423
|
-
|
|
27422
|
+
exports.skipDecodeWarning = true;
|
|
27424
27423
|
}
|
|
27425
27424
|
buf = Buffer5.from("" + (buf || ""), "binary");
|
|
27426
27425
|
}
|
|
27427
|
-
var decoder =
|
|
27426
|
+
var decoder = exports.getDecoder(encoding, options);
|
|
27428
27427
|
var res = decoder.write(buf);
|
|
27429
27428
|
var trail = decoder.end();
|
|
27430
27429
|
return trail ? res + trail : res;
|
|
27431
27430
|
};
|
|
27432
|
-
|
|
27431
|
+
exports.encodingExists = function encodingExists(enc) {
|
|
27433
27432
|
try {
|
|
27434
|
-
|
|
27433
|
+
exports.getCodec(enc);
|
|
27435
27434
|
return true;
|
|
27436
27435
|
} catch (e) {
|
|
27437
27436
|
return false;
|
|
27438
27437
|
}
|
|
27439
27438
|
};
|
|
27440
|
-
|
|
27441
|
-
|
|
27442
|
-
|
|
27443
|
-
|
|
27444
|
-
if (!
|
|
27439
|
+
exports.toEncoding = exports.encode;
|
|
27440
|
+
exports.fromEncoding = exports.decode;
|
|
27441
|
+
exports._codecDataCache = { __proto__: null };
|
|
27442
|
+
exports.getCodec = function getCodec(encoding) {
|
|
27443
|
+
if (!exports.encodings) {
|
|
27445
27444
|
var raw = require_encodings();
|
|
27446
|
-
|
|
27447
|
-
mergeModules(
|
|
27445
|
+
exports.encodings = { __proto__: null };
|
|
27446
|
+
mergeModules(exports.encodings, raw);
|
|
27448
27447
|
}
|
|
27449
|
-
var enc =
|
|
27448
|
+
var enc = exports._canonicalizeEncoding(encoding);
|
|
27450
27449
|
var codecOptions = {};
|
|
27451
27450
|
while (true) {
|
|
27452
|
-
var codec =
|
|
27451
|
+
var codec = exports._codecDataCache[enc];
|
|
27453
27452
|
if (codec) {
|
|
27454
27453
|
return codec;
|
|
27455
27454
|
}
|
|
27456
|
-
var codecDef =
|
|
27455
|
+
var codecDef = exports.encodings[enc];
|
|
27457
27456
|
switch (typeof codecDef) {
|
|
27458
27457
|
case "string":
|
|
27459
27458
|
enc = codecDef;
|
|
@@ -27471,56 +27470,56 @@ var require_lib3 = __commonJS((exports, module) => {
|
|
|
27471
27470
|
if (!codecOptions.encodingName) {
|
|
27472
27471
|
codecOptions.encodingName = enc;
|
|
27473
27472
|
}
|
|
27474
|
-
codec = new codecDef(codecOptions,
|
|
27475
|
-
|
|
27473
|
+
codec = new codecDef(codecOptions, exports);
|
|
27474
|
+
exports._codecDataCache[codecOptions.encodingName] = codec;
|
|
27476
27475
|
return codec;
|
|
27477
27476
|
default:
|
|
27478
27477
|
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')");
|
|
27479
27478
|
}
|
|
27480
27479
|
}
|
|
27481
27480
|
};
|
|
27482
|
-
|
|
27481
|
+
exports._canonicalizeEncoding = function(encoding) {
|
|
27483
27482
|
return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
|
|
27484
27483
|
};
|
|
27485
|
-
|
|
27486
|
-
var codec =
|
|
27484
|
+
exports.getEncoder = function getEncoder(encoding, options) {
|
|
27485
|
+
var codec = exports.getCodec(encoding);
|
|
27487
27486
|
var encoder = new codec.encoder(options, codec);
|
|
27488
27487
|
if (codec.bomAware && options && options.addBOM) {
|
|
27489
27488
|
encoder = new bomHandling.PrependBOM(encoder, options);
|
|
27490
27489
|
}
|
|
27491
27490
|
return encoder;
|
|
27492
27491
|
};
|
|
27493
|
-
|
|
27494
|
-
var codec =
|
|
27492
|
+
exports.getDecoder = function getDecoder(encoding, options) {
|
|
27493
|
+
var codec = exports.getCodec(encoding);
|
|
27495
27494
|
var decoder = new codec.decoder(options, codec);
|
|
27496
27495
|
if (codec.bomAware && !(options && options.stripBOM === false)) {
|
|
27497
27496
|
decoder = new bomHandling.StripBOM(decoder, options);
|
|
27498
27497
|
}
|
|
27499
27498
|
return decoder;
|
|
27500
27499
|
};
|
|
27501
|
-
|
|
27502
|
-
if (
|
|
27500
|
+
exports.enableStreamingAPI = function enableStreamingAPI(streamModule2) {
|
|
27501
|
+
if (exports.supportsStreams) {
|
|
27503
27502
|
return;
|
|
27504
27503
|
}
|
|
27505
27504
|
var streams = require_streams()(streamModule2);
|
|
27506
|
-
|
|
27507
|
-
|
|
27508
|
-
|
|
27509
|
-
return new
|
|
27505
|
+
exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream;
|
|
27506
|
+
exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
|
|
27507
|
+
exports.encodeStream = function encodeStream(encoding, options) {
|
|
27508
|
+
return new exports.IconvLiteEncoderStream(exports.getEncoder(encoding, options), options);
|
|
27510
27509
|
};
|
|
27511
|
-
|
|
27512
|
-
return new
|
|
27510
|
+
exports.decodeStream = function decodeStream(encoding, options) {
|
|
27511
|
+
return new exports.IconvLiteDecoderStream(exports.getDecoder(encoding, options), options);
|
|
27513
27512
|
};
|
|
27514
|
-
|
|
27513
|
+
exports.supportsStreams = true;
|
|
27515
27514
|
};
|
|
27516
27515
|
var streamModule;
|
|
27517
27516
|
try {
|
|
27518
27517
|
streamModule = __require("stream");
|
|
27519
27518
|
} catch (e) {}
|
|
27520
27519
|
if (streamModule && streamModule.Transform) {
|
|
27521
|
-
|
|
27520
|
+
exports.enableStreamingAPI(streamModule);
|
|
27522
27521
|
} else {
|
|
27523
|
-
|
|
27522
|
+
exports.encodeStream = exports.decodeStream = function() {
|
|
27524
27523
|
throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
|
|
27525
27524
|
};
|
|
27526
27525
|
}
|
|
@@ -41464,7 +41463,7 @@ var require_commander = __commonJS((exports) => {
|
|
|
41464
41463
|
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
41465
41464
|
});
|
|
41466
41465
|
|
|
41467
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
41466
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.51_supports-color@10.2.2/node_modules/@kevisual/router/dist/router.js
|
|
41468
41467
|
import require$$1, { webcrypto } from "node:crypto";
|
|
41469
41468
|
import require$$2 from "node:http";
|
|
41470
41469
|
import require$$1$1 from "node:https";
|
|
@@ -41994,13 +41993,13 @@ class QueryRouter {
|
|
|
41994
41993
|
hasRoute(path, key = "") {
|
|
41995
41994
|
return this.routes.find((r) => r.path === path && r.key === key);
|
|
41996
41995
|
}
|
|
41997
|
-
createRouteList(force = false) {
|
|
41998
|
-
const hasListRoute = this.hasRoute("
|
|
41996
|
+
createRouteList(force = false, filter) {
|
|
41997
|
+
const hasListRoute = this.hasRoute("router", "list");
|
|
41999
41998
|
if (!hasListRoute || force) {
|
|
42000
|
-
const listRoute = new Route("
|
|
41999
|
+
const listRoute = new Route("router", "list", {
|
|
42001
42000
|
description: "列出当前应用下的所有的路由信息",
|
|
42002
42001
|
run: async (ctx) => {
|
|
42003
|
-
const list = this.getList();
|
|
42002
|
+
const list = this.getList(filter);
|
|
42004
42003
|
ctx.body = list;
|
|
42005
42004
|
}
|
|
42006
42005
|
});
|
|
@@ -42010,7 +42009,7 @@ class QueryRouter {
|
|
|
42010
42009
|
wait(params, opts) {
|
|
42011
42010
|
const getList = opts?.getList ?? true;
|
|
42012
42011
|
if (getList) {
|
|
42013
|
-
this.createRouteList();
|
|
42012
|
+
this.createRouteList(opts?.force ?? false, opts?.filter);
|
|
42014
42013
|
}
|
|
42015
42014
|
return listenProcess({ app: this, params, ...opts });
|
|
42016
42015
|
}
|
|
@@ -46054,7 +46053,7 @@ class App {
|
|
|
46054
46053
|
}
|
|
46055
46054
|
}
|
|
46056
46055
|
|
|
46057
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
46056
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.51_supports-color@10.2.2/node_modules/@kevisual/router/dist/router-sign.js
|
|
46058
46057
|
import require$$12 from "node:crypto";
|
|
46059
46058
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
46060
46059
|
function getAugmentedNamespace(n) {
|
|
@@ -58841,13 +58840,122 @@ function requireSelfsigned() {
|
|
|
58841
58840
|
return "SHA-1";
|
|
58842
58841
|
}
|
|
58843
58842
|
}
|
|
58844
|
-
function getSigningAlgorithm(
|
|
58845
|
-
const hashAlg = getAlgorithmName(
|
|
58843
|
+
function getSigningAlgorithm(hashKey, keyType) {
|
|
58844
|
+
const hashAlg = getAlgorithmName(hashKey);
|
|
58845
|
+
if (keyType === "ec") {
|
|
58846
|
+
return {
|
|
58847
|
+
name: "ECDSA",
|
|
58848
|
+
hash: hashAlg
|
|
58849
|
+
};
|
|
58850
|
+
}
|
|
58851
|
+
return {
|
|
58852
|
+
name: "RSASSA-PKCS1-v1_5",
|
|
58853
|
+
hash: hashAlg
|
|
58854
|
+
};
|
|
58855
|
+
}
|
|
58856
|
+
function getKeyAlgorithm(options) {
|
|
58857
|
+
const keyType = options.keyType || "rsa";
|
|
58858
|
+
const hashAlg = getAlgorithmName(options.algorithm || "sha1");
|
|
58859
|
+
if (keyType === "ec") {
|
|
58860
|
+
const curve = options.curve || "P-256";
|
|
58861
|
+
return {
|
|
58862
|
+
name: "ECDSA",
|
|
58863
|
+
namedCurve: curve
|
|
58864
|
+
};
|
|
58865
|
+
}
|
|
58846
58866
|
return {
|
|
58847
58867
|
name: "RSASSA-PKCS1-v1_5",
|
|
58868
|
+
modulusLength: options.keySize || 2048,
|
|
58869
|
+
publicExponent: new Uint8Array([1, 0, 1]),
|
|
58848
58870
|
hash: hashAlg
|
|
58849
58871
|
};
|
|
58850
58872
|
}
|
|
58873
|
+
function buildExtensions(userExtensions, commonName) {
|
|
58874
|
+
if (!userExtensions || userExtensions.length === 0) {
|
|
58875
|
+
return [
|
|
58876
|
+
new BasicConstraintsExtension2(false, undefined, true),
|
|
58877
|
+
new KeyUsagesExtension2(KeyUsageFlags2.digitalSignature | KeyUsageFlags2.keyEncipherment, true),
|
|
58878
|
+
new ExtendedKeyUsageExtension2([ExtendedKeyUsage3.serverAuth, ExtendedKeyUsage3.clientAuth], false),
|
|
58879
|
+
new SubjectAlternativeNameExtension2([
|
|
58880
|
+
{ type: "dns", value: commonName },
|
|
58881
|
+
...commonName === "localhost" ? [{ type: "ip", value: "127.0.0.1" }] : []
|
|
58882
|
+
], false)
|
|
58883
|
+
];
|
|
58884
|
+
}
|
|
58885
|
+
const extensions = [];
|
|
58886
|
+
for (const ext of userExtensions) {
|
|
58887
|
+
const critical = ext.critical || false;
|
|
58888
|
+
switch (ext.name) {
|
|
58889
|
+
case "basicConstraints":
|
|
58890
|
+
extensions.push(new BasicConstraintsExtension2(ext.cA || false, ext.pathLenConstraint, critical));
|
|
58891
|
+
break;
|
|
58892
|
+
case "keyUsage":
|
|
58893
|
+
let flags = 0;
|
|
58894
|
+
if (ext.digitalSignature)
|
|
58895
|
+
flags |= KeyUsageFlags2.digitalSignature;
|
|
58896
|
+
if (ext.nonRepudiation || ext.contentCommitment)
|
|
58897
|
+
flags |= KeyUsageFlags2.nonRepudiation;
|
|
58898
|
+
if (ext.keyEncipherment)
|
|
58899
|
+
flags |= KeyUsageFlags2.keyEncipherment;
|
|
58900
|
+
if (ext.dataEncipherment)
|
|
58901
|
+
flags |= KeyUsageFlags2.dataEncipherment;
|
|
58902
|
+
if (ext.keyAgreement)
|
|
58903
|
+
flags |= KeyUsageFlags2.keyAgreement;
|
|
58904
|
+
if (ext.keyCertSign)
|
|
58905
|
+
flags |= KeyUsageFlags2.keyCertSign;
|
|
58906
|
+
if (ext.cRLSign)
|
|
58907
|
+
flags |= KeyUsageFlags2.cRLSign;
|
|
58908
|
+
if (ext.encipherOnly)
|
|
58909
|
+
flags |= KeyUsageFlags2.encipherOnly;
|
|
58910
|
+
if (ext.decipherOnly)
|
|
58911
|
+
flags |= KeyUsageFlags2.decipherOnly;
|
|
58912
|
+
extensions.push(new KeyUsagesExtension2(flags, critical));
|
|
58913
|
+
break;
|
|
58914
|
+
case "extKeyUsage":
|
|
58915
|
+
const usages = [];
|
|
58916
|
+
if (ext.serverAuth)
|
|
58917
|
+
usages.push(ExtendedKeyUsage3.serverAuth);
|
|
58918
|
+
if (ext.clientAuth)
|
|
58919
|
+
usages.push(ExtendedKeyUsage3.clientAuth);
|
|
58920
|
+
if (ext.codeSigning)
|
|
58921
|
+
usages.push(ExtendedKeyUsage3.codeSigning);
|
|
58922
|
+
if (ext.emailProtection)
|
|
58923
|
+
usages.push(ExtendedKeyUsage3.emailProtection);
|
|
58924
|
+
if (ext.timeStamping)
|
|
58925
|
+
usages.push(ExtendedKeyUsage3.timeStamping);
|
|
58926
|
+
extensions.push(new ExtendedKeyUsageExtension2(usages, critical));
|
|
58927
|
+
break;
|
|
58928
|
+
case "subjectAltName":
|
|
58929
|
+
const altNames = (ext.altNames || []).map((alt) => {
|
|
58930
|
+
switch (alt.type) {
|
|
58931
|
+
case 1:
|
|
58932
|
+
return { type: "email", value: alt.value };
|
|
58933
|
+
case 2:
|
|
58934
|
+
return { type: "dns", value: alt.value };
|
|
58935
|
+
case 6:
|
|
58936
|
+
return { type: "url", value: alt.value };
|
|
58937
|
+
case 7:
|
|
58938
|
+
return { type: "ip", value: alt.ip || alt.value };
|
|
58939
|
+
default:
|
|
58940
|
+
if (alt.ip)
|
|
58941
|
+
return { type: "ip", value: alt.ip };
|
|
58942
|
+
if (alt.dns)
|
|
58943
|
+
return { type: "dns", value: alt.dns };
|
|
58944
|
+
if (alt.email)
|
|
58945
|
+
return { type: "email", value: alt.email };
|
|
58946
|
+
if (alt.uri || alt.url)
|
|
58947
|
+
return { type: "url", value: alt.uri || alt.url };
|
|
58948
|
+
return { type: "dns", value: alt.value };
|
|
58949
|
+
}
|
|
58950
|
+
});
|
|
58951
|
+
extensions.push(new SubjectAlternativeNameExtension2(altNames, critical));
|
|
58952
|
+
break;
|
|
58953
|
+
default:
|
|
58954
|
+
console.warn(`Unknown extension "${ext.name}" ignored`);
|
|
58955
|
+
}
|
|
58956
|
+
}
|
|
58957
|
+
return extensions;
|
|
58958
|
+
}
|
|
58851
58959
|
function convertAttributes(attrs) {
|
|
58852
58960
|
const nameMap = {
|
|
58853
58961
|
commonName: "CN",
|
|
@@ -58863,36 +58971,62 @@ function requireSelfsigned() {
|
|
|
58863
58971
|
return `${oid}=${attr.value}`;
|
|
58864
58972
|
}).join(", ");
|
|
58865
58973
|
}
|
|
58866
|
-
|
|
58867
|
-
const
|
|
58868
|
-
|
|
58869
|
-
|
|
58870
|
-
|
|
58871
|
-
|
|
58872
|
-
|
|
58873
|
-
|
|
58874
|
-
|
|
58875
|
-
|
|
58876
|
-
|
|
58877
|
-
|
|
58878
|
-
|
|
58879
|
-
|
|
58880
|
-
|
|
58881
|
-
|
|
58974
|
+
function normalizeECCurve(curveName) {
|
|
58975
|
+
const curveMap = {
|
|
58976
|
+
prime256v1: "P-256",
|
|
58977
|
+
secp384r1: "P-384",
|
|
58978
|
+
secp521r1: "P-521",
|
|
58979
|
+
"P-256": "P-256",
|
|
58980
|
+
"P-384": "P-384",
|
|
58981
|
+
"P-521": "P-521"
|
|
58982
|
+
};
|
|
58983
|
+
return curveMap[curveName] || curveName;
|
|
58984
|
+
}
|
|
58985
|
+
function getECCurve(keyObject) {
|
|
58986
|
+
const details = keyObject.asymmetricKeyDetails;
|
|
58987
|
+
if (details && details.namedCurve) {
|
|
58988
|
+
return normalizeECCurve(details.namedCurve);
|
|
58989
|
+
}
|
|
58990
|
+
return "P-256";
|
|
58991
|
+
}
|
|
58992
|
+
async function importPrivateKey(pemKey, algorithm, keyType) {
|
|
58993
|
+
const keyObject = nodeCrypto.createPrivateKey(pemKey);
|
|
58994
|
+
const detectedKeyType = keyObject.asymmetricKeyType;
|
|
58995
|
+
const actualKeyType = keyType || detectedKeyType;
|
|
58996
|
+
const pkcs8Pem = keyObject.export({ type: "pkcs8", format: "pem" });
|
|
58997
|
+
const pemContents = pkcs8Pem.replace(/-----BEGIN PRIVATE KEY-----/, "").replace(/-----END PRIVATE KEY-----/, "").replace(/\s/g, "");
|
|
58998
|
+
const binaryDer = Buffer.from(pemContents, "base64");
|
|
58999
|
+
let importAlgorithm;
|
|
59000
|
+
if (actualKeyType === "ec") {
|
|
59001
|
+
const curve = getECCurve(keyObject);
|
|
59002
|
+
importAlgorithm = {
|
|
59003
|
+
name: "ECDSA",
|
|
59004
|
+
namedCurve: curve
|
|
59005
|
+
};
|
|
59006
|
+
} else {
|
|
59007
|
+
importAlgorithm = {
|
|
58882
59008
|
name: "RSASSA-PKCS1-v1_5",
|
|
58883
59009
|
hash: getAlgorithmName(algorithm)
|
|
58884
|
-
}
|
|
58885
|
-
} else {
|
|
58886
|
-
throw new Error("Unsupported private key format. Expected PKCS#8 or PKCS#1 RSA key.");
|
|
59010
|
+
};
|
|
58887
59011
|
}
|
|
59012
|
+
return await crypto2.subtle.importKey("pkcs8", binaryDer, importAlgorithm, true, ["sign"]);
|
|
58888
59013
|
}
|
|
58889
|
-
async function importPublicKey(pemKey, algorithm) {
|
|
59014
|
+
async function importPublicKey(pemKey, algorithm, keyType, curve) {
|
|
58890
59015
|
const pemContents = pemKey.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, "");
|
|
58891
59016
|
const binaryDer = Buffer.from(pemContents, "base64");
|
|
58892
|
-
|
|
58893
|
-
|
|
58894
|
-
|
|
58895
|
-
|
|
59017
|
+
let importAlgorithm;
|
|
59018
|
+
if (keyType === "ec") {
|
|
59019
|
+
importAlgorithm = {
|
|
59020
|
+
name: "ECDSA",
|
|
59021
|
+
namedCurve: curve
|
|
59022
|
+
};
|
|
59023
|
+
} else {
|
|
59024
|
+
importAlgorithm = {
|
|
59025
|
+
name: "RSASSA-PKCS1-v1_5",
|
|
59026
|
+
hash: getAlgorithmName(algorithm)
|
|
59027
|
+
};
|
|
59028
|
+
}
|
|
59029
|
+
return await crypto2.subtle.importKey("spki", binaryDer, importAlgorithm, true, ["verify"]);
|
|
58896
59030
|
}
|
|
58897
59031
|
async function generatePemAsync(keyPair, attrs, options, ca) {
|
|
58898
59032
|
const { privateKey, publicKey } = keyPair;
|
|
@@ -58933,22 +59067,15 @@ function requireSelfsigned() {
|
|
|
58933
59067
|
}
|
|
58934
59068
|
];
|
|
58935
59069
|
const subjectName = convertAttributes(attrs);
|
|
58936
|
-
const
|
|
59070
|
+
const keyType = options.keyType || "rsa";
|
|
59071
|
+
const signingAlg = getSigningAlgorithm(options.algorithm, keyType);
|
|
58937
59072
|
const commonNameAttr = attrs.find((attr) => attr.name === "commonName" || attr.shortName === "CN");
|
|
58938
59073
|
const commonName = commonNameAttr ? commonNameAttr.value : "localhost";
|
|
58939
|
-
const extensions =
|
|
58940
|
-
new BasicConstraintsExtension2(false, undefined, true),
|
|
58941
|
-
new KeyUsagesExtension2(KeyUsageFlags2.digitalSignature | KeyUsageFlags2.keyEncipherment, true),
|
|
58942
|
-
new ExtendedKeyUsageExtension2([ExtendedKeyUsage3.serverAuth, ExtendedKeyUsage3.clientAuth], false),
|
|
58943
|
-
new SubjectAlternativeNameExtension2([
|
|
58944
|
-
{ type: "dns", value: commonName },
|
|
58945
|
-
...commonName === "localhost" ? [{ type: "ip", value: "127.0.0.1" }] : []
|
|
58946
|
-
], false)
|
|
58947
|
-
];
|
|
59074
|
+
const extensions = buildExtensions(options.extensions, commonName);
|
|
58948
59075
|
let cert;
|
|
58949
59076
|
if (ca) {
|
|
58950
59077
|
const caCert = new X509Certificate2(ca.cert);
|
|
58951
|
-
const caPrivateKey = await importPrivateKey(ca.key, options.algorithm || "sha256");
|
|
59078
|
+
const caPrivateKey = await importPrivateKey(ca.key, options.algorithm || "sha256", keyType);
|
|
58952
59079
|
cert = await X509CertificateGenerator2.create({
|
|
58953
59080
|
serialNumber: serialHex,
|
|
58954
59081
|
subject: subjectName,
|
|
@@ -59016,12 +59143,15 @@ function requireSelfsigned() {
|
|
|
59016
59143
|
const clientKeySize = clientOpts.keySize || options.clientCertificateKeySize || 2048;
|
|
59017
59144
|
const clientAlgorithm = clientOpts.algorithm || options.algorithm || "sha1";
|
|
59018
59145
|
const clientCN = clientOpts.cn || options.clientCertificateCN || "John Doe jdoe123";
|
|
59019
|
-
const
|
|
59020
|
-
|
|
59021
|
-
|
|
59022
|
-
|
|
59023
|
-
|
|
59024
|
-
|
|
59146
|
+
const clientKeyType = clientOpts.keyType || keyType;
|
|
59147
|
+
const clientCurve = clientOpts.curve || options.curve || "P-256";
|
|
59148
|
+
const clientKeyAlg = getKeyAlgorithm({
|
|
59149
|
+
keyType: clientKeyType,
|
|
59150
|
+
keySize: clientKeySize,
|
|
59151
|
+
algorithm: clientAlgorithm,
|
|
59152
|
+
curve: clientCurve
|
|
59153
|
+
});
|
|
59154
|
+
const clientKeyPair = await crypto2.subtle.generateKey(clientKeyAlg, true, ["sign", "verify"]);
|
|
59025
59155
|
const clientSerialBytes = crypto2.getRandomValues(new Uint8Array(9));
|
|
59026
59156
|
const clientSerialHex = toPositiveHex(Buffer.from(clientSerialBytes).toString("hex"));
|
|
59027
59157
|
const clientNotBefore = clientOpts.notBeforeDate || new Date;
|
|
@@ -59043,7 +59173,7 @@ function requireSelfsigned() {
|
|
|
59043
59173
|
}
|
|
59044
59174
|
const clientSubjectName = convertAttributes(clientAttrs);
|
|
59045
59175
|
const issuerName = convertAttributes(attrs);
|
|
59046
|
-
const clientSigningAlg = getSigningAlgorithm(clientAlgorithm);
|
|
59176
|
+
const clientSigningAlg = getSigningAlgorithm(clientAlgorithm, keyType);
|
|
59047
59177
|
const clientCertRaw = await X509CertificateGenerator2.create({
|
|
59048
59178
|
serialNumber: clientSerialHex,
|
|
59049
59179
|
subject: clientSubjectName,
|
|
@@ -59086,20 +59216,17 @@ function requireSelfsigned() {
|
|
|
59086
59216
|
selfsigned.generate = async function generate(attrs, options) {
|
|
59087
59217
|
attrs = attrs || undefined;
|
|
59088
59218
|
options = options || {};
|
|
59089
|
-
const
|
|
59219
|
+
const keyType = options.keyType || "rsa";
|
|
59220
|
+
const curve = options.curve || "P-256";
|
|
59090
59221
|
let keyPair;
|
|
59091
59222
|
if (options.keyPair) {
|
|
59092
59223
|
keyPair = {
|
|
59093
|
-
privateKey: await importPrivateKey(options.keyPair.privateKey, options.algorithm || "sha1"),
|
|
59094
|
-
publicKey: await importPublicKey(options.keyPair.publicKey, options.algorithm || "sha1")
|
|
59224
|
+
privateKey: await importPrivateKey(options.keyPair.privateKey, options.algorithm || "sha1", keyType),
|
|
59225
|
+
publicKey: await importPublicKey(options.keyPair.publicKey, options.algorithm || "sha1", keyType, curve)
|
|
59095
59226
|
};
|
|
59096
59227
|
} else {
|
|
59097
|
-
|
|
59098
|
-
|
|
59099
|
-
modulusLength: keySize,
|
|
59100
|
-
publicExponent: new Uint8Array([1, 0, 1]),
|
|
59101
|
-
hash: getAlgorithmName(options.algorithm || "sha1")
|
|
59102
|
-
}, true, ["sign", "verify"]);
|
|
59228
|
+
const keyAlg = getKeyAlgorithm(options);
|
|
59229
|
+
keyPair = await crypto2.subtle.generateKey(keyAlg, true, ["sign", "verify"]);
|
|
59103
59230
|
}
|
|
59104
59231
|
return await generatePemAsync(keyPair, attrs, options, options.ca);
|
|
59105
59232
|
};
|
|
@@ -68535,6 +68662,7 @@ var import_fast_glob = __toESM(require_out4(), 1);
|
|
|
68535
68662
|
import fs8 from "node:fs";
|
|
68536
68663
|
|
|
68537
68664
|
// src/module/local-apps/src/modules/pm2.ts
|
|
68665
|
+
import { spawn } from "node:child_process";
|
|
68538
68666
|
import pm23 from "pm2";
|
|
68539
68667
|
import { promisify as promisify3 } from "node:util";
|
|
68540
68668
|
var normalizeScriptPath2 = (scriptPath) => {
|
|
@@ -68561,6 +68689,23 @@ var restart3 = promisify3(pm23.restart).bind(pm23);
|
|
|
68561
68689
|
var reload2 = promisify3(pm23.reload).bind(pm23);
|
|
68562
68690
|
var deleteProcess3 = promisify3(pm23.delete).bind(pm23);
|
|
68563
68691
|
var list3 = promisify3(pm23.list).bind(pm23);
|
|
68692
|
+
var checkInstall = async (app) => {
|
|
68693
|
+
return new Promise((resolve, reject) => {
|
|
68694
|
+
const install = spawn("pnpm", ["install"], {
|
|
68695
|
+
cwd: app.path,
|
|
68696
|
+
stdio: "inherit"
|
|
68697
|
+
});
|
|
68698
|
+
install.on("close", (code) => {
|
|
68699
|
+
if (code !== 0) {
|
|
68700
|
+
console.log("install failed");
|
|
68701
|
+
return resolve(false);
|
|
68702
|
+
}
|
|
68703
|
+
console.log("install success");
|
|
68704
|
+
resolve(true);
|
|
68705
|
+
});
|
|
68706
|
+
});
|
|
68707
|
+
};
|
|
68708
|
+
|
|
68564
68709
|
class Pm2Connect2 {
|
|
68565
68710
|
needConnect = true;
|
|
68566
68711
|
isConnected = false;
|
|
@@ -68702,6 +68847,9 @@ class Pm2Manager2 {
|
|
|
68702
68847
|
this.pm2Connect.checkDisconnect(runOpts);
|
|
68703
68848
|
}
|
|
68704
68849
|
}
|
|
68850
|
+
async remove(runOpts) {
|
|
68851
|
+
this.deleteProcess(runOpts);
|
|
68852
|
+
}
|
|
68705
68853
|
async deleteProcess(runOpts) {
|
|
68706
68854
|
try {
|
|
68707
68855
|
await this.pm2Connect.checkConnect();
|
|
@@ -68749,61 +68897,7 @@ class Manager2 {
|
|
|
68749
68897
|
async loadApp(app) {
|
|
68750
68898
|
const mainApp = this.mainApp;
|
|
68751
68899
|
this.apps.set(app.key, app);
|
|
68752
|
-
|
|
68753
|
-
return;
|
|
68754
|
-
}
|
|
68755
|
-
if (!fileIsExist2(app.path)) {
|
|
68756
|
-
console.error("app is not found");
|
|
68757
|
-
return;
|
|
68758
|
-
}
|
|
68759
|
-
const pathEntry = path8.join(app.path, app.entry);
|
|
68760
|
-
if (!fileIsExist2(pathEntry)) {
|
|
68761
|
-
console.error("file entry not found");
|
|
68762
|
-
return;
|
|
68763
|
-
}
|
|
68764
|
-
const entry2 = app.entry + `?timestamp=${app?.timestamp}`;
|
|
68765
|
-
if (app.type === "micro-app" /* MicroApp */) {
|
|
68766
|
-
const childProcess = fork2(app.entry, [], {
|
|
68767
|
-
stdio: "inherit",
|
|
68768
|
-
cwd: app.path,
|
|
68769
|
-
env: {
|
|
68770
|
-
...process.env,
|
|
68771
|
-
...app.env,
|
|
68772
|
-
APP_KEY: app.key,
|
|
68773
|
-
APP_PATH: app.path,
|
|
68774
|
-
APP_ENTRY: entry2
|
|
68775
|
-
}
|
|
68776
|
-
});
|
|
68777
|
-
app.process = childProcess;
|
|
68778
|
-
} else if (app.type === "system-app" /* SystemApp */) {
|
|
68779
|
-
const pathEntryAndTimestamp = path8.join(app.path, entry2);
|
|
68780
|
-
const importPath = process.platform === "win32" ? "file:///" + pathEntryAndTimestamp.replace(/\\/g, "/") : pathEntryAndTimestamp;
|
|
68781
|
-
const module = await import(importPath);
|
|
68782
|
-
if (module.loadApp && mainApp) {
|
|
68783
|
-
await module.loadApp?.(mainApp, app);
|
|
68784
|
-
}
|
|
68785
|
-
} else if (app.type === "gateway-app" /* GatewayApp */) {
|
|
68786
|
-
console.log("gateway app not support");
|
|
68787
|
-
} else if (app.type === "pm2-system-app" /* Pm2SystemApp */) {
|
|
68788
|
-
const pathEntry2 = path8.join(app.path, app.entry);
|
|
68789
|
-
const pm2Manager = new Pm2Manager2({
|
|
68790
|
-
appName: app.key,
|
|
68791
|
-
script: pathEntry2,
|
|
68792
|
-
pm2Connect: this.#pm2Connect
|
|
68793
|
-
});
|
|
68794
|
-
const pm2Options = app.pm2Options || {};
|
|
68795
|
-
if (app?.engine) {
|
|
68796
|
-
pm2Options.interpreter = pm2Options.interpreter || app?.engine;
|
|
68797
|
-
}
|
|
68798
|
-
if (!pm2Options.cwd) {
|
|
68799
|
-
pm2Options.cwd = path8.join(app.path, "../..");
|
|
68800
|
-
}
|
|
68801
|
-
await pm2Manager.start(pm2Options);
|
|
68802
|
-
} else {
|
|
68803
|
-
console.error("app type not support", app.type);
|
|
68804
|
-
}
|
|
68805
|
-
console.log(`load ${app.type} success`, app.key);
|
|
68806
|
-
return true;
|
|
68900
|
+
return await LoadApp(app, { mainApp, pm2Connect: this.#pm2Connect });
|
|
68807
68901
|
}
|
|
68808
68902
|
async saveAppInfo(app, newTimeData = false) {
|
|
68809
68903
|
const list4 = this.appInfo.list || [];
|
|
@@ -68904,24 +68998,7 @@ class Manager2 {
|
|
|
68904
68998
|
if (!app) {
|
|
68905
68999
|
return;
|
|
68906
69000
|
}
|
|
68907
|
-
|
|
68908
|
-
console.log(`app ${key} is stopped`);
|
|
68909
|
-
return;
|
|
68910
|
-
}
|
|
68911
|
-
app.status = "stop";
|
|
68912
|
-
if (app.type === "micro-app" /* MicroApp */) {
|
|
68913
|
-
if (app.process) {
|
|
68914
|
-
app.process.kill();
|
|
68915
|
-
}
|
|
68916
|
-
}
|
|
68917
|
-
if (app.type === "pm2-system-app" /* Pm2SystemApp */) {
|
|
68918
|
-
const pm2Manager = new Pm2Manager2({
|
|
68919
|
-
appName: app.key,
|
|
68920
|
-
script: app.entry,
|
|
68921
|
-
pm2Connect: this.#pm2Connect
|
|
68922
|
-
});
|
|
68923
|
-
await pm2Manager.stop();
|
|
68924
|
-
}
|
|
69001
|
+
await StopApp(app, { pm2Connect: this.#pm2Connect, todo: "stop" });
|
|
68925
69002
|
await this.saveAppInfo(app);
|
|
68926
69003
|
}
|
|
68927
69004
|
async restart(key) {
|
|
@@ -68968,8 +69045,9 @@ class Manager2 {
|
|
|
68968
69045
|
await this.saveAppInfo(app);
|
|
68969
69046
|
return onAppShowInfo2(app);
|
|
68970
69047
|
}
|
|
68971
|
-
async removeApp(key) {
|
|
69048
|
+
async removeApp(key, opts) {
|
|
68972
69049
|
const app = this.apps.get(key);
|
|
69050
|
+
const deleteFile = opts?.deleteFile ?? true;
|
|
68973
69051
|
if (!app) {
|
|
68974
69052
|
return false;
|
|
68975
69053
|
}
|
|
@@ -68989,6 +69067,9 @@ class Manager2 {
|
|
|
68989
69067
|
} catch (e) {
|
|
68990
69068
|
console.log("delete pm2 process error", e);
|
|
68991
69069
|
}
|
|
69070
|
+
if (!deleteFile) {
|
|
69071
|
+
return true;
|
|
69072
|
+
}
|
|
68992
69073
|
try {
|
|
68993
69074
|
deleteFileAppInfo2(key, this.appsPath);
|
|
68994
69075
|
} catch (e) {
|
|
@@ -69054,6 +69135,99 @@ class Manager2 {
|
|
|
69054
69135
|
}
|
|
69055
69136
|
}
|
|
69056
69137
|
}
|
|
69138
|
+
var LoadApp = async (app, opts) => {
|
|
69139
|
+
const mainApp = opts?.mainApp;
|
|
69140
|
+
const pm2Connect = opts?.pm2Connect;
|
|
69141
|
+
if (app.status !== "running") {
|
|
69142
|
+
return false;
|
|
69143
|
+
}
|
|
69144
|
+
if (!fileIsExist2(app.path)) {
|
|
69145
|
+
console.error("app is not found");
|
|
69146
|
+
return false;
|
|
69147
|
+
}
|
|
69148
|
+
const pathEntry = path8.join(app.path, app.entry);
|
|
69149
|
+
if (!fileIsExist2(pathEntry)) {
|
|
69150
|
+
console.error("file entry not found");
|
|
69151
|
+
return false;
|
|
69152
|
+
}
|
|
69153
|
+
const entry2 = app.entry + `?timestamp=${app?.timestamp}`;
|
|
69154
|
+
if (app.type === "micro-app" /* MicroApp */) {
|
|
69155
|
+
const childProcess = fork2(app.entry, [], {
|
|
69156
|
+
stdio: "inherit",
|
|
69157
|
+
cwd: app.path,
|
|
69158
|
+
env: {
|
|
69159
|
+
...process.env,
|
|
69160
|
+
...app.env,
|
|
69161
|
+
APP_KEY: app.key,
|
|
69162
|
+
APP_PATH: app.path,
|
|
69163
|
+
APP_ENTRY: entry2
|
|
69164
|
+
}
|
|
69165
|
+
});
|
|
69166
|
+
app.process = childProcess;
|
|
69167
|
+
} else if (app.type === "system-app" /* SystemApp */) {
|
|
69168
|
+
const pathEntryAndTimestamp = path8.join(app.path, entry2);
|
|
69169
|
+
const importPath = process.platform === "win32" ? "file:///" + pathEntryAndTimestamp.replace(/\\/g, "/") : pathEntryAndTimestamp;
|
|
69170
|
+
const module = await import(importPath);
|
|
69171
|
+
if (module.loadApp && mainApp) {
|
|
69172
|
+
await module.loadApp?.(mainApp, app);
|
|
69173
|
+
}
|
|
69174
|
+
} else if (app.type === "gateway-app" /* GatewayApp */) {
|
|
69175
|
+
console.log("gateway app not support");
|
|
69176
|
+
} else if (app.type === "pm2-system-app" /* Pm2SystemApp */) {
|
|
69177
|
+
const pathEntry2 = path8.join(app.path, app.entry);
|
|
69178
|
+
console.log("pm2 system app start", pathEntry2);
|
|
69179
|
+
const pm2Manager = new Pm2Manager2({
|
|
69180
|
+
appName: app.key,
|
|
69181
|
+
script: pathEntry2,
|
|
69182
|
+
pm2Connect
|
|
69183
|
+
});
|
|
69184
|
+
if (app?.init) {
|
|
69185
|
+
const isInstall = await checkInstall(app);
|
|
69186
|
+
if (!isInstall) {
|
|
69187
|
+
console.log("install failed");
|
|
69188
|
+
return false;
|
|
69189
|
+
}
|
|
69190
|
+
}
|
|
69191
|
+
const pm2Options = app.pm2Options || {};
|
|
69192
|
+
if (app?.engine) {
|
|
69193
|
+
pm2Options.interpreter = pm2Options.interpreter || app?.engine;
|
|
69194
|
+
}
|
|
69195
|
+
if (!pm2Options.cwd) {
|
|
69196
|
+
pm2Options.cwd = path8.join(app.path, "../..");
|
|
69197
|
+
}
|
|
69198
|
+
console.log("pm2 start options", pm2Options);
|
|
69199
|
+
await pm2Manager.start(pm2Options);
|
|
69200
|
+
} else if (app.type === "script-app" /* ScriptApp */) {
|
|
69201
|
+
return true;
|
|
69202
|
+
} else {
|
|
69203
|
+
console.error("app type not support", app.type);
|
|
69204
|
+
}
|
|
69205
|
+
console.log(`load ${app.type} success`, app.key);
|
|
69206
|
+
return true;
|
|
69207
|
+
};
|
|
69208
|
+
var StopApp = async (app, opts) => {
|
|
69209
|
+
const key = app.key;
|
|
69210
|
+
const pm2Connect = opts?.pm2Connect;
|
|
69211
|
+
const todo = opts?.todo || "stop";
|
|
69212
|
+
if (app.status === "stop" && app.type === "system-app" /* SystemApp */) {
|
|
69213
|
+
console.log(`app ${key} is stopped`);
|
|
69214
|
+
return;
|
|
69215
|
+
}
|
|
69216
|
+
app.status = "stop";
|
|
69217
|
+
if (app.type === "micro-app" /* MicroApp */) {
|
|
69218
|
+
if (app.process) {
|
|
69219
|
+
app.process.kill();
|
|
69220
|
+
}
|
|
69221
|
+
}
|
|
69222
|
+
if (app.type === "pm2-system-app" /* Pm2SystemApp */) {
|
|
69223
|
+
const pm2Manager = new Pm2Manager2({
|
|
69224
|
+
appName: app.key,
|
|
69225
|
+
script: app.entry,
|
|
69226
|
+
pm2Connect
|
|
69227
|
+
});
|
|
69228
|
+
await pm2Manager[todo]?.();
|
|
69229
|
+
}
|
|
69230
|
+
};
|
|
69057
69231
|
var installAppFromKey2 = async (key, _appPath) => {
|
|
69058
69232
|
const normalizedKey = key.replace(/\//g, path8.sep);
|
|
69059
69233
|
const directory = path8.join(_appPath, normalizedKey);
|
|
@@ -69641,7 +69815,7 @@ class AssistantQuery {
|
|
|
69641
69815
|
}
|
|
69642
69816
|
}
|
|
69643
69817
|
// src/module/npm-install.ts
|
|
69644
|
-
import { spawn, spawnSync } from "child_process";
|
|
69818
|
+
import { spawn as spawn2, spawnSync } from "child_process";
|
|
69645
69819
|
var checkPnpm = () => {
|
|
69646
69820
|
try {
|
|
69647
69821
|
spawnSync("pnpm", ["--version"]);
|
|
@@ -69661,7 +69835,7 @@ var installDeps = async (opts) => {
|
|
|
69661
69835
|
params.push("--omit=dev");
|
|
69662
69836
|
}
|
|
69663
69837
|
console.log("installDeps", appPath, params);
|
|
69664
|
-
const syncSpawn = opts.sync ? spawnSync :
|
|
69838
|
+
const syncSpawn = opts.sync ? spawnSync : spawn2;
|
|
69665
69839
|
if (isPnpm) {
|
|
69666
69840
|
syncSpawn("pnpm", params, { cwd: appPath, stdio: "inherit", env: process.env });
|
|
69667
69841
|
} else {
|
|
@@ -70476,6 +70650,14 @@ var app = useContextKey("app", () => {
|
|
|
70476
70650
|
}
|
|
70477
70651
|
});
|
|
70478
70652
|
});
|
|
70653
|
+
app.route({
|
|
70654
|
+
path: "router",
|
|
70655
|
+
key: "list",
|
|
70656
|
+
description: "获取路由列表"
|
|
70657
|
+
}).define(async (ctx) => {
|
|
70658
|
+
const list4 = ctx.app.getList();
|
|
70659
|
+
ctx.body = { list: list4 };
|
|
70660
|
+
}).addTo(app);
|
|
70479
70661
|
|
|
70480
70662
|
// src/module/local-proxy/index.ts
|
|
70481
70663
|
import fs12 from "node:fs";
|
|
@@ -70694,7 +70876,7 @@ app.route({
|
|
|
70694
70876
|
import path13 from "path";
|
|
70695
70877
|
import fs13 from "fs";
|
|
70696
70878
|
|
|
70697
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
70879
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/key.js
|
|
70698
70880
|
var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
|
|
70699
70881
|
var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
|
|
70700
70882
|
var isSpaceKey = (key) => key.name === "space";
|
|
@@ -70702,7 +70884,7 @@ var isBackspaceKey = (key) => key.name === "backspace";
|
|
|
70702
70884
|
var isTabKey = (key) => key.name === "tab";
|
|
70703
70885
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
70704
70886
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
70705
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
70887
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/errors.js
|
|
70706
70888
|
class AbortPromptError extends Error {
|
|
70707
70889
|
name = "AbortPromptError";
|
|
70708
70890
|
message = "Prompt was aborted";
|
|
@@ -70728,10 +70910,10 @@ class HookError extends Error {
|
|
|
70728
70910
|
class ValidationError extends Error {
|
|
70729
70911
|
name = "ValidationError";
|
|
70730
70912
|
}
|
|
70731
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
70913
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
70732
70914
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
70733
70915
|
|
|
70734
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
70916
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
70735
70917
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
70736
70918
|
var hookStorage = new AsyncLocalStorage;
|
|
70737
70919
|
function createStore(rl) {
|
|
@@ -70836,7 +71018,7 @@ var effectScheduler = {
|
|
|
70836
71018
|
}
|
|
70837
71019
|
};
|
|
70838
71020
|
|
|
70839
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71021
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
70840
71022
|
function useState(defaultValue) {
|
|
70841
71023
|
return withPointer((pointer) => {
|
|
70842
71024
|
const setState = AsyncResource2.bind(function setState(newValue) {
|
|
@@ -70854,7 +71036,7 @@ function useState(defaultValue) {
|
|
|
70854
71036
|
});
|
|
70855
71037
|
}
|
|
70856
71038
|
|
|
70857
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71039
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
70858
71040
|
function useEffect(cb, depArray) {
|
|
70859
71041
|
withPointer((pointer) => {
|
|
70860
71042
|
const oldDeps = pointer.get();
|
|
@@ -70866,10 +71048,10 @@ function useEffect(cb, depArray) {
|
|
|
70866
71048
|
});
|
|
70867
71049
|
}
|
|
70868
71050
|
|
|
70869
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71051
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/theme.js
|
|
70870
71052
|
import { styleText } from "node:util";
|
|
70871
71053
|
|
|
70872
|
-
// ../node_modules/.pnpm/@inquirer+figures@2.0.
|
|
71054
|
+
// ../node_modules/.pnpm/@inquirer+figures@2.0.3/node_modules/@inquirer/figures/dist/index.js
|
|
70873
71055
|
import process5 from "node:process";
|
|
70874
71056
|
function isUnicodeSupported() {
|
|
70875
71057
|
if (process5.platform !== "win32") {
|
|
@@ -71158,7 +71340,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
71158
71340
|
var dist_default = figures;
|
|
71159
71341
|
var replacements = Object.entries(specialMainSymbols);
|
|
71160
71342
|
|
|
71161
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71343
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/theme.js
|
|
71162
71344
|
var defaultTheme = {
|
|
71163
71345
|
prefix: {
|
|
71164
71346
|
idle: styleText("blue", "?"),
|
|
@@ -71179,7 +71361,7 @@ var defaultTheme = {
|
|
|
71179
71361
|
}
|
|
71180
71362
|
};
|
|
71181
71363
|
|
|
71182
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71364
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
71183
71365
|
function isPlainObject3(value) {
|
|
71184
71366
|
if (typeof value !== "object" || value === null)
|
|
71185
71367
|
return false;
|
|
@@ -71207,7 +71389,7 @@ function makeTheme(...themes) {
|
|
|
71207
71389
|
return deepMerge(...themesToMerge);
|
|
71208
71390
|
}
|
|
71209
71391
|
|
|
71210
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71392
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
71211
71393
|
function usePrefix({ status = "idle", theme }) {
|
|
71212
71394
|
const [showLoader, setShowLoader] = useState(false);
|
|
71213
71395
|
const [tick, setTick] = useState(0);
|
|
@@ -71237,7 +71419,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
71237
71419
|
const iconName = status === "loading" ? "idle" : status;
|
|
71238
71420
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
71239
71421
|
}
|
|
71240
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71422
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
71241
71423
|
function useMemo(fn, dependencies) {
|
|
71242
71424
|
return withPointer((pointer) => {
|
|
71243
71425
|
const prev = pointer.get();
|
|
@@ -71249,11 +71431,11 @@ function useMemo(fn, dependencies) {
|
|
|
71249
71431
|
return prev.value;
|
|
71250
71432
|
});
|
|
71251
71433
|
}
|
|
71252
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71434
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
71253
71435
|
function useRef(val) {
|
|
71254
71436
|
return useState({ current: val })[0];
|
|
71255
71437
|
}
|
|
71256
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71438
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
71257
71439
|
function useKeypress(userHandler) {
|
|
71258
71440
|
const signal = useRef(userHandler);
|
|
71259
71441
|
signal.current = userHandler;
|
|
@@ -71271,7 +71453,7 @@ function useKeypress(userHandler) {
|
|
|
71271
71453
|
};
|
|
71272
71454
|
}, []);
|
|
71273
71455
|
}
|
|
71274
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71456
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/utils.js
|
|
71275
71457
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
71276
71458
|
|
|
71277
71459
|
// ../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
|
|
@@ -71705,7 +71887,7 @@ function wrapAnsi(string2, columns, options) {
|
|
|
71705
71887
|
`);
|
|
71706
71888
|
}
|
|
71707
71889
|
|
|
71708
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71890
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/utils.js
|
|
71709
71891
|
function breakLines(content, width) {
|
|
71710
71892
|
return content.split(`
|
|
71711
71893
|
`).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
|
|
@@ -71716,7 +71898,7 @@ function readlineWidth() {
|
|
|
71716
71898
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
71717
71899
|
}
|
|
71718
71900
|
|
|
71719
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71901
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
71720
71902
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
71721
71903
|
const state = useRef({
|
|
71722
71904
|
lastPointer: active,
|
|
@@ -71782,7 +71964,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
71782
71964
|
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
71783
71965
|
`);
|
|
71784
71966
|
}
|
|
71785
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
71967
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
71786
71968
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
71787
71969
|
import * as readline2 from "node:readline";
|
|
71788
71970
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
@@ -71995,10 +72177,10 @@ var {
|
|
|
71995
72177
|
unload
|
|
71996
72178
|
} = signalExitWrap(processOk(process6) ? new SignalExit(process6) : new SignalExitFallback);
|
|
71997
72179
|
|
|
71998
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
72180
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
71999
72181
|
import { stripVTControlCharacters } from "node:util";
|
|
72000
72182
|
|
|
72001
|
-
// ../node_modules/.pnpm/@inquirer+ansi@2.0.
|
|
72183
|
+
// ../node_modules/.pnpm/@inquirer+ansi@2.0.3/node_modules/@inquirer/ansi/dist/index.js
|
|
72002
72184
|
var ESC = "\x1B[";
|
|
72003
72185
|
var cursorLeft = ESC + "G";
|
|
72004
72186
|
var cursorHide = ESC + "?25l";
|
|
@@ -72014,7 +72196,7 @@ var cursorTo = (x, y) => {
|
|
|
72014
72196
|
var eraseLine = ESC + "2K";
|
|
72015
72197
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
72016
72198
|
|
|
72017
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
72199
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
72018
72200
|
var height = (content) => content.split(`
|
|
72019
72201
|
`).length;
|
|
72020
72202
|
var lastLine = (content) => content.split(`
|
|
@@ -72079,7 +72261,7 @@ class ScreenManager {
|
|
|
72079
72261
|
}
|
|
72080
72262
|
}
|
|
72081
72263
|
|
|
72082
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
72264
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
72083
72265
|
class PromisePolyfill extends Promise {
|
|
72084
72266
|
static withResolver() {
|
|
72085
72267
|
let resolve;
|
|
@@ -72092,7 +72274,7 @@ class PromisePolyfill extends Promise {
|
|
|
72092
72274
|
}
|
|
72093
72275
|
}
|
|
72094
72276
|
|
|
72095
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
72277
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
72096
72278
|
function getCallSites() {
|
|
72097
72279
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
72098
72280
|
let result = [];
|
|
@@ -72178,7 +72360,7 @@ function createPrompt(view) {
|
|
|
72178
72360
|
};
|
|
72179
72361
|
return prompt;
|
|
72180
72362
|
}
|
|
72181
|
-
// ../node_modules/.pnpm/@inquirer+core@11.1.
|
|
72363
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
72182
72364
|
import { styleText as styleText2 } from "node:util";
|
|
72183
72365
|
class Separator {
|
|
72184
72366
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
@@ -72192,7 +72374,7 @@ class Separator {
|
|
|
72192
72374
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
72193
72375
|
}
|
|
72194
72376
|
}
|
|
72195
|
-
// ../node_modules/.pnpm/@inquirer+checkbox@5.0.
|
|
72377
|
+
// ../node_modules/.pnpm/@inquirer+checkbox@5.0.4_@types+node@25.0.3/node_modules/@inquirer/checkbox/dist/index.js
|
|
72196
72378
|
import { styleText as styleText3 } from "node:util";
|
|
72197
72379
|
var checkboxTheme = {
|
|
72198
72380
|
icon: {
|
|
@@ -72365,16 +72547,16 @@ var dist_default2 = createPrompt((config2, done) => {
|
|
|
72365
72547
|
`).trimEnd();
|
|
72366
72548
|
return `${lines}${cursorHide}`;
|
|
72367
72549
|
});
|
|
72368
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
72550
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.3_@types+node@25.0.3/node_modules/@inquirer/external-editor/dist/index.js
|
|
72369
72551
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
72370
72552
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
72371
|
-
import { spawn as
|
|
72553
|
+
import { spawn as spawn3, spawnSync as spawnSync2 } from "child_process";
|
|
72372
72554
|
import { readFileSync, unlinkSync, writeFileSync } from "fs";
|
|
72373
72555
|
import path12 from "node:path";
|
|
72374
72556
|
import os3 from "node:os";
|
|
72375
72557
|
import { randomUUID } from "node:crypto";
|
|
72376
72558
|
|
|
72377
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
72559
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.3_@types+node@25.0.3/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js
|
|
72378
72560
|
class CreateFileError extends Error {
|
|
72379
72561
|
originalError;
|
|
72380
72562
|
constructor(originalError) {
|
|
@@ -72383,7 +72565,7 @@ class CreateFileError extends Error {
|
|
|
72383
72565
|
}
|
|
72384
72566
|
}
|
|
72385
72567
|
|
|
72386
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
72568
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.3_@types+node@25.0.3/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js
|
|
72387
72569
|
class LaunchEditorError extends Error {
|
|
72388
72570
|
originalError;
|
|
72389
72571
|
constructor(originalError) {
|
|
@@ -72392,7 +72574,7 @@ class LaunchEditorError extends Error {
|
|
|
72392
72574
|
}
|
|
72393
72575
|
}
|
|
72394
72576
|
|
|
72395
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
72577
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.3_@types+node@25.0.3/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js
|
|
72396
72578
|
class ReadFileError extends Error {
|
|
72397
72579
|
originalError;
|
|
72398
72580
|
constructor(originalError) {
|
|
@@ -72401,7 +72583,7 @@ class ReadFileError extends Error {
|
|
|
72401
72583
|
}
|
|
72402
72584
|
}
|
|
72403
72585
|
|
|
72404
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
72586
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.3_@types+node@25.0.3/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js
|
|
72405
72587
|
class RemoveFileError extends Error {
|
|
72406
72588
|
originalError;
|
|
72407
72589
|
constructor(originalError) {
|
|
@@ -72410,7 +72592,7 @@ class RemoveFileError extends Error {
|
|
|
72410
72592
|
}
|
|
72411
72593
|
}
|
|
72412
72594
|
|
|
72413
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
72595
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.3_@types+node@25.0.3/node_modules/@inquirer/external-editor/dist/index.js
|
|
72414
72596
|
function editAsync(text = "", callback, fileOptions) {
|
|
72415
72597
|
const editor = new ExternalEditor(text, fileOptions);
|
|
72416
72598
|
editor.runAsync((err, result) => {
|
|
@@ -72554,7 +72736,7 @@ class ExternalEditor {
|
|
|
72554
72736
|
}
|
|
72555
72737
|
launchEditorAsync(callback) {
|
|
72556
72738
|
try {
|
|
72557
|
-
const editorProcess =
|
|
72739
|
+
const editorProcess = spawn3(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
|
|
72558
72740
|
editorProcess.on("exit", (code) => {
|
|
72559
72741
|
this.lastExitStatus = code;
|
|
72560
72742
|
setImmediate(callback);
|
|
@@ -72565,7 +72747,7 @@ class ExternalEditor {
|
|
|
72565
72747
|
}
|
|
72566
72748
|
}
|
|
72567
72749
|
|
|
72568
|
-
// ../node_modules/.pnpm/@inquirer+editor@5.0.
|
|
72750
|
+
// ../node_modules/.pnpm/@inquirer+editor@5.0.4_@types+node@25.0.3/node_modules/@inquirer/editor/dist/index.js
|
|
72569
72751
|
var editorTheme = {
|
|
72570
72752
|
validationFailureMode: "keep"
|
|
72571
72753
|
};
|
|
@@ -72633,7 +72815,7 @@ var dist_default3 = createPrompt((config2, done) => {
|
|
|
72633
72815
|
}
|
|
72634
72816
|
return [[prefix, message, helpTip].filter(Boolean).join(" "), error2];
|
|
72635
72817
|
});
|
|
72636
|
-
// ../node_modules/.pnpm/@inquirer+confirm@6.0.
|
|
72818
|
+
// ../node_modules/.pnpm/@inquirer+confirm@6.0.4_@types+node@25.0.3/node_modules/@inquirer/confirm/dist/index.js
|
|
72637
72819
|
function getBooleanValue(value, defaultValue) {
|
|
72638
72820
|
let answer = defaultValue !== false;
|
|
72639
72821
|
if (/^(y|yes)/i.test(value))
|
|
@@ -72678,7 +72860,7 @@ var dist_default4 = createPrompt((config2, done) => {
|
|
|
72678
72860
|
const message = theme.style.message(config2.message, status);
|
|
72679
72861
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
72680
72862
|
});
|
|
72681
|
-
// ../node_modules/.pnpm/@inquirer+input@5.0.
|
|
72863
|
+
// ../node_modules/.pnpm/@inquirer+input@5.0.4_@types+node@25.0.3/node_modules/@inquirer/input/dist/index.js
|
|
72682
72864
|
var inputTheme = {
|
|
72683
72865
|
validationFailureMode: "keep"
|
|
72684
72866
|
};
|
|
@@ -72762,7 +72944,7 @@ var dist_default5 = createPrompt((config2, done) => {
|
|
|
72762
72944
|
error2
|
|
72763
72945
|
];
|
|
72764
72946
|
});
|
|
72765
|
-
// ../node_modules/.pnpm/@inquirer+number@4.0.
|
|
72947
|
+
// ../node_modules/.pnpm/@inquirer+number@4.0.4_@types+node@25.0.3/node_modules/@inquirer/number/dist/index.js
|
|
72766
72948
|
function isStepOf(value, step, min) {
|
|
72767
72949
|
const valuePow = value * Math.pow(10, 6);
|
|
72768
72950
|
const stepPow = step * Math.pow(10, 6);
|
|
@@ -72842,7 +73024,7 @@ var dist_default6 = createPrompt((config2, done) => {
|
|
|
72842
73024
|
error2
|
|
72843
73025
|
];
|
|
72844
73026
|
});
|
|
72845
|
-
// ../node_modules/.pnpm/@inquirer+expand@5.0.
|
|
73027
|
+
// ../node_modules/.pnpm/@inquirer+expand@5.0.4_@types+node@25.0.3/node_modules/@inquirer/expand/dist/index.js
|
|
72846
73028
|
import { styleText as styleText4 } from "node:util";
|
|
72847
73029
|
function normalizeChoices2(choices) {
|
|
72848
73030
|
return choices.map((choice) => {
|
|
@@ -72939,9 +73121,14 @@ var dist_default7 = createPrompt((config2, done) => {
|
|
|
72939
73121
|
`)
|
|
72940
73122
|
];
|
|
72941
73123
|
});
|
|
72942
|
-
// ../node_modules/.pnpm/@inquirer+rawlist@5.
|
|
73124
|
+
// ../node_modules/.pnpm/@inquirer+rawlist@5.2.0_@types+node@25.0.3/node_modules/@inquirer/rawlist/dist/index.js
|
|
72943
73125
|
import { styleText as styleText5 } from "node:util";
|
|
72944
73126
|
var numberRegex = /\d+/;
|
|
73127
|
+
var rawlistTheme = {
|
|
73128
|
+
style: {
|
|
73129
|
+
description: (text) => styleText5("cyan", text)
|
|
73130
|
+
}
|
|
73131
|
+
};
|
|
72945
73132
|
function isSelectableChoice(choice) {
|
|
72946
73133
|
return choice != null && !Separator.isSeparator(choice);
|
|
72947
73134
|
}
|
|
@@ -72965,7 +73152,8 @@ function normalizeChoices3(choices) {
|
|
|
72965
73152
|
value: choice.value,
|
|
72966
73153
|
name,
|
|
72967
73154
|
short: choice.short ?? name,
|
|
72968
|
-
key: choice.key ?? String(index)
|
|
73155
|
+
key: choice.key ?? String(index),
|
|
73156
|
+
description: choice.description
|
|
72969
73157
|
};
|
|
72970
73158
|
});
|
|
72971
73159
|
}
|
|
@@ -72988,7 +73176,7 @@ var dist_default8 = createPrompt((config2, done) => {
|
|
|
72988
73176
|
return defaultChoice?.key ?? "";
|
|
72989
73177
|
});
|
|
72990
73178
|
const [errorMsg, setError] = useState();
|
|
72991
|
-
const theme = makeTheme(config2.theme);
|
|
73179
|
+
const theme = makeTheme(rawlistTheme, config2.theme);
|
|
72992
73180
|
const prefix = usePrefix({ status, theme });
|
|
72993
73181
|
const bounds = useMemo(() => {
|
|
72994
73182
|
const first = choices.findIndex(isSelectableChoice);
|
|
@@ -73000,11 +73188,11 @@ var dist_default8 = createPrompt((config2, done) => {
|
|
|
73000
73188
|
}, [choices]);
|
|
73001
73189
|
useKeypress((key, rl) => {
|
|
73002
73190
|
if (isEnterKey(key)) {
|
|
73003
|
-
const [
|
|
73004
|
-
if (isSelectableChoice(
|
|
73005
|
-
setValue(
|
|
73191
|
+
const [selectedChoice2] = getSelectedChoice(value, choices);
|
|
73192
|
+
if (isSelectableChoice(selectedChoice2)) {
|
|
73193
|
+
setValue(selectedChoice2.short);
|
|
73006
73194
|
setStatus("done");
|
|
73007
|
-
done(
|
|
73195
|
+
done(selectedChoice2.value);
|
|
73008
73196
|
} else if (value === "") {
|
|
73009
73197
|
setError("Please input a value");
|
|
73010
73198
|
} else {
|
|
@@ -73012,8 +73200,8 @@ var dist_default8 = createPrompt((config2, done) => {
|
|
|
73012
73200
|
}
|
|
73013
73201
|
} else if (isUpKey(key) || isDownKey(key)) {
|
|
73014
73202
|
rl.clearLine(0);
|
|
73015
|
-
const [
|
|
73016
|
-
if (!
|
|
73203
|
+
const [selectedChoice2, active] = getSelectedChoice(value, choices);
|
|
73204
|
+
if (!selectedChoice2) {
|
|
73017
73205
|
const firstChoice = isDownKey(key) ? choices.find(isSelectableChoice) : choices.findLast(isSelectableChoice);
|
|
73018
73206
|
setValue(firstChoice.key);
|
|
73019
73207
|
} else if (loop || isUpKey(key) && active !== bounds.first || isDownKey(key) && active !== bounds.last) {
|
|
@@ -73038,7 +73226,7 @@ var dist_default8 = createPrompt((config2, done) => {
|
|
|
73038
73226
|
return ` ${choice.separator}`;
|
|
73039
73227
|
}
|
|
73040
73228
|
const line = ` ${choice.key}) ${choice.name}`;
|
|
73041
|
-
if (choice.key === value
|
|
73229
|
+
if (choice.key === value) {
|
|
73042
73230
|
return theme.style.highlight(line);
|
|
73043
73231
|
}
|
|
73044
73232
|
return line;
|
|
@@ -73048,13 +73236,18 @@ var dist_default8 = createPrompt((config2, done) => {
|
|
|
73048
73236
|
if (errorMsg) {
|
|
73049
73237
|
error2 = theme.style.error(errorMsg);
|
|
73050
73238
|
}
|
|
73239
|
+
const [selectedChoice] = getSelectedChoice(value, choices);
|
|
73240
|
+
let description = "";
|
|
73241
|
+
if (!errorMsg && selectedChoice?.description) {
|
|
73242
|
+
description = theme.style.description(selectedChoice.description);
|
|
73243
|
+
}
|
|
73051
73244
|
return [
|
|
73052
73245
|
`${prefix} ${message} ${value}`,
|
|
73053
|
-
[choicesStr, error2].filter(Boolean).join(`
|
|
73246
|
+
[choicesStr, error2, description].filter(Boolean).join(`
|
|
73054
73247
|
`)
|
|
73055
73248
|
];
|
|
73056
73249
|
});
|
|
73057
|
-
// ../node_modules/.pnpm/@inquirer+password@5.0.
|
|
73250
|
+
// ../node_modules/.pnpm/@inquirer+password@5.0.4_@types+node@25.0.3/node_modules/@inquirer/password/dist/index.js
|
|
73058
73251
|
var dist_default9 = createPrompt((config2, done) => {
|
|
73059
73252
|
const { validate: validate2 = () => true } = config2;
|
|
73060
73253
|
const theme = makeTheme(config2.theme);
|
|
@@ -73102,7 +73295,7 @@ var dist_default9 = createPrompt((config2, done) => {
|
|
|
73102
73295
|
}
|
|
73103
73296
|
return [[prefix, message, config2.mask ? formattedValue : helpTip].join(" "), error2];
|
|
73104
73297
|
});
|
|
73105
|
-
// ../node_modules/.pnpm/@inquirer+search@4.
|
|
73298
|
+
// ../node_modules/.pnpm/@inquirer+search@4.1.0_@types+node@25.0.3/node_modules/@inquirer/search/dist/index.js
|
|
73106
73299
|
import { styleText as styleText6 } from "node:util";
|
|
73107
73300
|
var searchTheme = {
|
|
73108
73301
|
icon: { cursor: dist_default.pointer },
|
|
@@ -73148,6 +73341,7 @@ var dist_default10 = createPrompt((config2, done) => {
|
|
|
73148
73341
|
const [searchTerm, setSearchTerm] = useState("");
|
|
73149
73342
|
const [searchResults, setSearchResults] = useState([]);
|
|
73150
73343
|
const [searchError, setSearchError] = useState();
|
|
73344
|
+
const defaultApplied = useRef(false);
|
|
73151
73345
|
const prefix = usePrefix({ status, theme });
|
|
73152
73346
|
const bounds = useMemo(() => {
|
|
73153
73347
|
const first = searchResults.findIndex(isSelectable2);
|
|
@@ -73165,9 +73359,16 @@ var dist_default10 = createPrompt((config2, done) => {
|
|
|
73165
73359
|
signal: controller.signal
|
|
73166
73360
|
});
|
|
73167
73361
|
if (!controller.signal.aborted) {
|
|
73168
|
-
|
|
73362
|
+
const normalized = normalizeChoices4(results);
|
|
73363
|
+
let initialActive;
|
|
73364
|
+
if (!defaultApplied.current && "default" in config2) {
|
|
73365
|
+
const defaultIndex = normalized.findIndex((item) => isSelectable2(item) && item.value === config2.default);
|
|
73366
|
+
initialActive = defaultIndex === -1 ? undefined : defaultIndex;
|
|
73367
|
+
defaultApplied.current = true;
|
|
73368
|
+
}
|
|
73369
|
+
setActive(initialActive);
|
|
73169
73370
|
setSearchError(undefined);
|
|
73170
|
-
setSearchResults(
|
|
73371
|
+
setSearchResults(normalized);
|
|
73171
73372
|
setStatus("idle");
|
|
73172
73373
|
}
|
|
73173
73374
|
} catch (error3) {
|
|
@@ -73264,7 +73465,7 @@ var dist_default10 = createPrompt((config2, done) => {
|
|
|
73264
73465
|
`).trimEnd();
|
|
73265
73466
|
return [header, body];
|
|
73266
73467
|
});
|
|
73267
|
-
// ../node_modules/.pnpm/@inquirer+select@5.0.
|
|
73468
|
+
// ../node_modules/.pnpm/@inquirer+select@5.0.4_@types+node@25.0.3/node_modules/@inquirer/select/dist/index.js
|
|
73268
73469
|
import { styleText as styleText7 } from "node:util";
|
|
73269
73470
|
var selectTheme = {
|
|
73270
73471
|
icon: { cursor: dist_default.pointer },
|
|
@@ -73425,6 +73626,25 @@ var import_rxjs = __toESM(require_cjs(), 1);
|
|
|
73425
73626
|
var import_run_async = __toESM(require_run_async(), 1);
|
|
73426
73627
|
var import_mute_stream2 = __toESM(require_lib(), 1);
|
|
73427
73628
|
import readline3 from "node:readline";
|
|
73629
|
+
|
|
73630
|
+
// ../node_modules/.pnpm/@inquirer+core@11.1.0_@types+node@25.0.3/node_modules/@inquirer/core/dist/lib/errors.js
|
|
73631
|
+
class AbortPromptError2 extends Error {
|
|
73632
|
+
name = "AbortPromptError";
|
|
73633
|
+
message = "Prompt was aborted";
|
|
73634
|
+
constructor(options) {
|
|
73635
|
+
super();
|
|
73636
|
+
this.cause = options?.cause;
|
|
73637
|
+
}
|
|
73638
|
+
}
|
|
73639
|
+
|
|
73640
|
+
// ../node_modules/.pnpm/@inquirer+ansi@2.0.2/node_modules/@inquirer/ansi/dist/index.js
|
|
73641
|
+
var ESC2 = "\x1B[";
|
|
73642
|
+
var cursorLeft2 = ESC2 + "G";
|
|
73643
|
+
var cursorHide2 = ESC2 + "?25l";
|
|
73644
|
+
var cursorShow2 = ESC2 + "?25h";
|
|
73645
|
+
var eraseLine2 = ESC2 + "2K";
|
|
73646
|
+
|
|
73647
|
+
// ../node_modules/.pnpm/inquirer@13.1.0_@types+node@25.0.3/node_modules/inquirer/dist/ui/prompt.js
|
|
73428
73648
|
var _ = {
|
|
73429
73649
|
set: (obj, path13 = "", value) => {
|
|
73430
73650
|
let pointer = obj;
|
|
@@ -73558,7 +73778,7 @@ class PromptsRunner {
|
|
|
73558
73778
|
const promptFn = isPromptConstructor(prompt) ? (q, opt) => new Promise((resolve, reject) => {
|
|
73559
73779
|
const { signal: signal2 } = opt;
|
|
73560
73780
|
if (signal2.aborted) {
|
|
73561
|
-
reject(new
|
|
73781
|
+
reject(new AbortPromptError2({ cause: signal2.reason }));
|
|
73562
73782
|
return;
|
|
73563
73783
|
}
|
|
73564
73784
|
const rl = readline3.createInterface(setupReadlineOptions(opt));
|
|
@@ -73572,7 +73792,7 @@ class PromptsRunner {
|
|
|
73572
73792
|
rl.removeListener("SIGINT", onForceClose);
|
|
73573
73793
|
rl.setPrompt("");
|
|
73574
73794
|
rl.output.unmute();
|
|
73575
|
-
rl.output.write(
|
|
73795
|
+
rl.output.write(cursorShow2);
|
|
73576
73796
|
rl.output.end();
|
|
73577
73797
|
rl.close();
|
|
73578
73798
|
};
|
|
@@ -73584,7 +73804,7 @@ class PromptsRunner {
|
|
|
73584
73804
|
cleanupSignal?.();
|
|
73585
73805
|
};
|
|
73586
73806
|
const abort = () => {
|
|
73587
|
-
reject(new
|
|
73807
|
+
reject(new AbortPromptError2({ cause: signal2.reason }));
|
|
73588
73808
|
cleanup();
|
|
73589
73809
|
};
|
|
73590
73810
|
signal2.addEventListener("abort", abort);
|
|
@@ -77519,6 +77739,15 @@ var wrapper_default = import_websocket.default;
|
|
|
77519
77739
|
// src/services/proxy/proxy-page-index.ts
|
|
77520
77740
|
var localProxy = new LocalProxy({});
|
|
77521
77741
|
localProxy.initFromAssistantConfig(assistantConfig2);
|
|
77742
|
+
var isOpenPath = (pathname) => {
|
|
77743
|
+
const openPaths = ["/root/home", "/root/cli"];
|
|
77744
|
+
for (const openPath of openPaths) {
|
|
77745
|
+
if (pathname.startsWith(openPath)) {
|
|
77746
|
+
return true;
|
|
77747
|
+
}
|
|
77748
|
+
}
|
|
77749
|
+
return false;
|
|
77750
|
+
};
|
|
77522
77751
|
var authFilter = async (req, res) => {
|
|
77523
77752
|
const _assistantConfig = assistantConfig2.getCacheAssistantConfig();
|
|
77524
77753
|
const auth = _assistantConfig?.auth || {};
|
|
@@ -77606,6 +77835,7 @@ var proxyRoute = async (req, res) => {
|
|
|
77606
77835
|
target: apiBackendProxy.target
|
|
77607
77836
|
});
|
|
77608
77837
|
}
|
|
77838
|
+
logger.debug("proxyRoute handle by router", { url: req.url }, noAdmin);
|
|
77609
77839
|
const urls = pathname.split("/");
|
|
77610
77840
|
const [_2, _user, _app] = urls;
|
|
77611
77841
|
if (!_app) {
|
|
@@ -77613,7 +77843,9 @@ var proxyRoute = async (req, res) => {
|
|
|
77613
77843
|
res.end("Not Found Proxy");
|
|
77614
77844
|
return;
|
|
77615
77845
|
}
|
|
77616
|
-
|
|
77846
|
+
const isOpen = isOpenPath(pathname);
|
|
77847
|
+
log.debug("proxyRoute", { _user, _app, pathname, noAdmin, isOpen });
|
|
77848
|
+
if (noAdmin && !isOpen) {
|
|
77617
77849
|
return toSetting();
|
|
77618
77850
|
}
|
|
77619
77851
|
if (_app && urls.length === 3) {
|
|
@@ -77951,7 +78183,7 @@ var getBunPath = () => {
|
|
|
77951
78183
|
return bunExecutableName;
|
|
77952
78184
|
};
|
|
77953
78185
|
|
|
77954
|
-
// ../node_modules/.pnpm/@kevisual+video-tools@0.0.
|
|
78186
|
+
// ../node_modules/.pnpm/@kevisual+video-tools@0.0.13_dotenv@17.2.3_supports-color@10.2.2/node_modules/@kevisual/video-tools/src/ws/index.ts
|
|
77955
78187
|
var isBrowser3 = typeof process === "undefined" || typeof window !== "undefined" && typeof window.document !== "undefined" || typeof process !== "undefined" && process?.env?.BROWSER === "true";
|
|
77956
78188
|
var chantHttpToWs = (url2) => {
|
|
77957
78189
|
if (url2.startsWith("http://")) {
|
|
@@ -77980,7 +78212,7 @@ var initWs = async (url2, options) => {
|
|
|
77980
78212
|
return ws;
|
|
77981
78213
|
};
|
|
77982
78214
|
|
|
77983
|
-
// ../node_modules/.pnpm/@kevisual+video-tools@0.0.
|
|
78215
|
+
// ../node_modules/.pnpm/@kevisual+video-tools@0.0.13_dotenv@17.2.3_supports-color@10.2.2/node_modules/@kevisual/video-tools/src/asr/ws.ts
|
|
77984
78216
|
class WSServer {
|
|
77985
78217
|
ws;
|
|
77986
78218
|
onConnect;
|
|
@@ -78161,9 +78393,20 @@ class WSServer {
|
|
|
78161
78393
|
async sendBlankJson() {
|
|
78162
78394
|
this.ws.send(JSON.stringify({ type: "blankVoice" }));
|
|
78163
78395
|
}
|
|
78396
|
+
async fixBrowerBuffer(base64) {
|
|
78397
|
+
let voice = Buffer.from(base64, "base64");
|
|
78398
|
+
const floatArray = new Float32Array(voice.buffer, voice.byteOffset, voice.length / 4);
|
|
78399
|
+
const pcm16 = Buffer.alloc(floatArray.length * 2);
|
|
78400
|
+
for (let i = 0;i < floatArray.length; i++) {
|
|
78401
|
+
const sample = Math.max(-1, Math.min(1, floatArray[i]));
|
|
78402
|
+
pcm16.writeInt16LE(sample < 0 ? sample * 32768 : sample * 32767, i * 2);
|
|
78403
|
+
}
|
|
78404
|
+
voice = pcm16;
|
|
78405
|
+
return voice;
|
|
78406
|
+
}
|
|
78164
78407
|
}
|
|
78165
78408
|
|
|
78166
|
-
// ../node_modules/.pnpm/@kevisual+video-tools@0.0.
|
|
78409
|
+
// ../node_modules/.pnpm/@kevisual+video-tools@0.0.13_dotenv@17.2.3_supports-color@10.2.2/node_modules/@kevisual/video-tools/src/asr/provider/aliyun/base.ts
|
|
78167
78410
|
class AsrRelatime extends WSServer {
|
|
78168
78411
|
static baseURL = "wss://dashscope.aliyuncs.com/api-ws/v1/realtime";
|
|
78169
78412
|
enableServerVad = true;
|
|
@@ -78266,17 +78509,6 @@ class AsrRelatime extends WSServer {
|
|
|
78266
78509
|
console.log("error", error2);
|
|
78267
78510
|
}
|
|
78268
78511
|
}
|
|
78269
|
-
async fixBrowerBuffer(base64) {
|
|
78270
|
-
let voice = Buffer.from(base64, "base64");
|
|
78271
|
-
const floatArray = new Float32Array(voice.buffer, voice.byteOffset, voice.length / 4);
|
|
78272
|
-
const pcm16 = Buffer.alloc(floatArray.length * 2);
|
|
78273
|
-
for (let i = 0;i < floatArray.length; i++) {
|
|
78274
|
-
const sample = Math.max(-1, Math.min(1, floatArray[i]));
|
|
78275
|
-
pcm16.writeInt16LE(sample < 0 ? sample * 32768 : sample * 32767, i * 2);
|
|
78276
|
-
}
|
|
78277
|
-
voice = pcm16;
|
|
78278
|
-
return voice;
|
|
78279
|
-
}
|
|
78280
78512
|
async onClose(event) {
|
|
78281
78513
|
let { code } = event;
|
|
78282
78514
|
if (code === 1007) {
|
|
@@ -79779,7 +80011,19 @@ var func = async (req, res) => {
|
|
|
79779
80011
|
return;
|
|
79780
80012
|
}
|
|
79781
80013
|
if (!asr) {
|
|
79782
|
-
const
|
|
80014
|
+
const confg = assistantConfig2.getConfig();
|
|
80015
|
+
const asrConfig = confg?.asr;
|
|
80016
|
+
if (!asrConfig?.enabled) {
|
|
80017
|
+
ws.send(JSON.stringify({ type: "error", message: "asr服务未启用" }));
|
|
80018
|
+
ws.close();
|
|
80019
|
+
return;
|
|
80020
|
+
}
|
|
80021
|
+
const token = asrConfig?.token;
|
|
80022
|
+
if (!token) {
|
|
80023
|
+
ws.send(JSON.stringify({ type: "error", message: "asr服务未配置token" }));
|
|
80024
|
+
ws.close();
|
|
80025
|
+
return;
|
|
80026
|
+
}
|
|
79783
80027
|
asr = new AsrRelatime({
|
|
79784
80028
|
token,
|
|
79785
80029
|
onConnect: () => {
|
|
@@ -79853,20 +80097,17 @@ var func = async (req, res) => {
|
|
|
79853
80097
|
console.log("ASR receive data", "blank voice");
|
|
79854
80098
|
} else if (data?.voice) {
|
|
79855
80099
|
if (!data?.isRelatime) {
|
|
79856
|
-
console.log("ASR receive data", "has voice", !!data?.voice);
|
|
79857
|
-
|
|
79858
|
-
const isBrowserFormat = data.format === "float32";
|
|
79859
|
-
const time = data?.time || 0;
|
|
79860
|
-
if (time) {
|
|
80100
|
+
console.log("ASR receive data", "has voice", !!data?.voice, data?.isRelatime);
|
|
80101
|
+
const time = data?.time || 0;
|
|
79861
80102
|
console.log("receiveDelay", Date.now() - time);
|
|
79862
80103
|
}
|
|
80104
|
+
const isBrowserFormat = data.format === "float32";
|
|
79863
80105
|
let voice;
|
|
79864
80106
|
if (isBrowserFormat) {
|
|
79865
80107
|
voice = await asr.fixBrowerBuffer(data.voice);
|
|
79866
80108
|
} else {
|
|
79867
80109
|
voice = Buffer.from(data.voice, "base64");
|
|
79868
80110
|
}
|
|
79869
|
-
console.log("sendTime", Date.now());
|
|
79870
80111
|
ws.data.startTime = Date.now();
|
|
79871
80112
|
asr.sendBuffer(voice);
|
|
79872
80113
|
}
|
|
@@ -79904,7 +80145,11 @@ var runServer = async (port = 51515, listenPath = "127.0.0.1") => {
|
|
|
79904
80145
|
} else {
|
|
79905
80146
|
app.listen(_port, listenPath, () => {
|
|
79906
80147
|
const protocol = assistantConfig2.getHttps().protocol;
|
|
79907
|
-
|
|
80148
|
+
let showListenPath = listenPath;
|
|
80149
|
+
if (listenPath === "::") {
|
|
80150
|
+
showListenPath = "localhost";
|
|
80151
|
+
}
|
|
80152
|
+
console.log(`Server is running on ${protocol}://${showListenPath}:${_port}`);
|
|
79908
80153
|
});
|
|
79909
80154
|
}
|
|
79910
80155
|
app.server.on([
|