@kevisual/cli 0.0.70 → 0.0.72
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 +50213 -4932
- package/dist/assistant.js +2422 -607
- package/dist/envision.js +391 -439
- package/package.json +5 -4
package/dist/assistant.js
CHANGED
|
@@ -17310,7 +17310,7 @@ var require_path = __commonJS((exports) => {
|
|
|
17310
17310
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17311
17311
|
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = undefined;
|
|
17312
17312
|
var os2 = __require("os");
|
|
17313
|
-
var
|
|
17313
|
+
var path6 = __require("path");
|
|
17314
17314
|
var IS_WINDOWS_PLATFORM = os2.platform() === "win32";
|
|
17315
17315
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
17316
17316
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
@@ -17322,7 +17322,7 @@ var require_path = __commonJS((exports) => {
|
|
|
17322
17322
|
}
|
|
17323
17323
|
exports.unixify = unixify;
|
|
17324
17324
|
function makeAbsolute(cwd, filepath) {
|
|
17325
|
-
return
|
|
17325
|
+
return path6.resolve(cwd, filepath);
|
|
17326
17326
|
}
|
|
17327
17327
|
exports.makeAbsolute = makeAbsolute;
|
|
17328
17328
|
function removeLeadingDotSegment(entry2) {
|
|
@@ -17897,7 +17897,7 @@ var require_fill_range = __commonJS((exports, module) => {
|
|
|
17897
17897
|
*/
|
|
17898
17898
|
var util = __require("util");
|
|
17899
17899
|
var toRegexRange = require_to_regex_range();
|
|
17900
|
-
var
|
|
17900
|
+
var isObject3 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
17901
17901
|
var transform = (toNumber) => {
|
|
17902
17902
|
return (value) => toNumber === true ? Number(value) : String(value);
|
|
17903
17903
|
};
|
|
@@ -18076,7 +18076,7 @@ var require_fill_range = __commonJS((exports, module) => {
|
|
|
18076
18076
|
if (typeof step === "function") {
|
|
18077
18077
|
return fill(start3, end, 1, { transform: step });
|
|
18078
18078
|
}
|
|
18079
|
-
if (
|
|
18079
|
+
if (isObject3(step)) {
|
|
18080
18080
|
return fill(start3, end, 0, step);
|
|
18081
18081
|
}
|
|
18082
18082
|
let opts = { ...options };
|
|
@@ -18084,7 +18084,7 @@ var require_fill_range = __commonJS((exports, module) => {
|
|
|
18084
18084
|
opts.wrap = true;
|
|
18085
18085
|
step = step || opts.step || 1;
|
|
18086
18086
|
if (!isNumber2(step)) {
|
|
18087
|
-
if (step != null && !
|
|
18087
|
+
if (step != null && !isObject3(step))
|
|
18088
18088
|
return invalidStep(step, opts);
|
|
18089
18089
|
return fill(start3, end, 1, step);
|
|
18090
18090
|
}
|
|
@@ -18580,7 +18580,7 @@ var require_braces = __commonJS((exports, module) => {
|
|
|
18580
18580
|
|
|
18581
18581
|
// ../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
|
|
18582
18582
|
var require_constants3 = __commonJS((exports, module) => {
|
|
18583
|
-
var
|
|
18583
|
+
var path6 = __require("path");
|
|
18584
18584
|
var WIN_SLASH = "\\\\/";
|
|
18585
18585
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
18586
18586
|
var DOT_LITERAL = "\\.";
|
|
@@ -18702,7 +18702,7 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
18702
18702
|
CHAR_UNDERSCORE: 95,
|
|
18703
18703
|
CHAR_VERTICAL_LINE: 124,
|
|
18704
18704
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
18705
|
-
SEP:
|
|
18705
|
+
SEP: path6.sep,
|
|
18706
18706
|
extglobChars(chars) {
|
|
18707
18707
|
return {
|
|
18708
18708
|
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
@@ -18720,7 +18720,7 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
18720
18720
|
|
|
18721
18721
|
// ../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
|
|
18722
18722
|
var require_utils2 = __commonJS((exports) => {
|
|
18723
|
-
var
|
|
18723
|
+
var path6 = __require("path");
|
|
18724
18724
|
var win32 = process.platform === "win32";
|
|
18725
18725
|
var {
|
|
18726
18726
|
REGEX_BACKSLASH,
|
|
@@ -18749,7 +18749,7 @@ var require_utils2 = __commonJS((exports) => {
|
|
|
18749
18749
|
if (options && typeof options.windows === "boolean") {
|
|
18750
18750
|
return options.windows;
|
|
18751
18751
|
}
|
|
18752
|
-
return win32 === true ||
|
|
18752
|
+
return win32 === true || path6.sep === "\\";
|
|
18753
18753
|
};
|
|
18754
18754
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
18755
18755
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -19873,12 +19873,12 @@ var require_parse2 = __commonJS((exports, module) => {
|
|
|
19873
19873
|
|
|
19874
19874
|
// ../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
|
|
19875
19875
|
var require_picomatch = __commonJS((exports, module) => {
|
|
19876
|
-
var
|
|
19876
|
+
var path6 = __require("path");
|
|
19877
19877
|
var scan = require_scan();
|
|
19878
19878
|
var parse = require_parse2();
|
|
19879
19879
|
var utils2 = require_utils2();
|
|
19880
19880
|
var constants2 = require_constants3();
|
|
19881
|
-
var
|
|
19881
|
+
var isObject3 = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
19882
19882
|
var picomatch2 = (glob2, options, returnState = false) => {
|
|
19883
19883
|
if (Array.isArray(glob2)) {
|
|
19884
19884
|
const fns = glob2.map((input) => picomatch2(input, options, returnState));
|
|
@@ -19892,7 +19892,7 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
19892
19892
|
};
|
|
19893
19893
|
return arrayMatcher;
|
|
19894
19894
|
}
|
|
19895
|
-
const isState =
|
|
19895
|
+
const isState = isObject3(glob2) && glob2.tokens && glob2.input;
|
|
19896
19896
|
if (glob2 === "" || typeof glob2 !== "string" && !isState) {
|
|
19897
19897
|
throw new TypeError("Expected pattern to be a non-empty string");
|
|
19898
19898
|
}
|
|
@@ -19959,7 +19959,7 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
19959
19959
|
};
|
|
19960
19960
|
picomatch2.matchBase = (input, glob2, options, posix = utils2.isWindows(options)) => {
|
|
19961
19961
|
const regex = glob2 instanceof RegExp ? glob2 : picomatch2.makeRe(glob2, options);
|
|
19962
|
-
return regex.test(
|
|
19962
|
+
return regex.test(path6.basename(input));
|
|
19963
19963
|
};
|
|
19964
19964
|
picomatch2.isMatch = (str, patterns, options) => picomatch2(patterns, options)(str);
|
|
19965
19965
|
picomatch2.parse = (pattern2, options) => {
|
|
@@ -20180,7 +20180,7 @@ var require_micromatch = __commonJS((exports, module) => {
|
|
|
20180
20180
|
var require_pattern = __commonJS((exports) => {
|
|
20181
20181
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20182
20182
|
exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = undefined;
|
|
20183
|
-
var
|
|
20183
|
+
var path6 = __require("path");
|
|
20184
20184
|
var globParent2 = require_glob_parent();
|
|
20185
20185
|
var micromatch = require_micromatch();
|
|
20186
20186
|
var GLOBSTAR = "**";
|
|
@@ -20275,7 +20275,7 @@ var require_pattern = __commonJS((exports) => {
|
|
|
20275
20275
|
}
|
|
20276
20276
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
20277
20277
|
function isAffectDepthOfReadingPattern(pattern2) {
|
|
20278
|
-
const basename =
|
|
20278
|
+
const basename = path6.basename(pattern2);
|
|
20279
20279
|
return endsWithSlashGlobStar(pattern2) || isStaticPattern(basename);
|
|
20280
20280
|
}
|
|
20281
20281
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
@@ -20333,7 +20333,7 @@ var require_pattern = __commonJS((exports) => {
|
|
|
20333
20333
|
}
|
|
20334
20334
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
20335
20335
|
function isAbsolute(pattern2) {
|
|
20336
|
-
return
|
|
20336
|
+
return path6.isAbsolute(pattern2);
|
|
20337
20337
|
}
|
|
20338
20338
|
exports.isAbsolute = isAbsolute;
|
|
20339
20339
|
});
|
|
@@ -20343,8 +20343,8 @@ var require_merge2 = __commonJS((exports, module) => {
|
|
|
20343
20343
|
var Stream = __require("stream");
|
|
20344
20344
|
var PassThrough = Stream.PassThrough;
|
|
20345
20345
|
var slice = Array.prototype.slice;
|
|
20346
|
-
module.exports =
|
|
20347
|
-
function
|
|
20346
|
+
module.exports = merge22;
|
|
20347
|
+
function merge22() {
|
|
20348
20348
|
const streamsQueue = [];
|
|
20349
20349
|
const args = slice.call(arguments);
|
|
20350
20350
|
let merging = false;
|
|
@@ -20458,9 +20458,9 @@ var require_merge2 = __commonJS((exports, module) => {
|
|
|
20458
20458
|
var require_stream2 = __commonJS((exports) => {
|
|
20459
20459
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20460
20460
|
exports.merge = undefined;
|
|
20461
|
-
var
|
|
20461
|
+
var merge22 = require_merge2();
|
|
20462
20462
|
function merge3(streams) {
|
|
20463
|
-
const mergedStream =
|
|
20463
|
+
const mergedStream = merge22(streams);
|
|
20464
20464
|
streams.forEach((stream2) => {
|
|
20465
20465
|
stream2.once("error", (error2) => mergedStream.emit("error", error2));
|
|
20466
20466
|
});
|
|
@@ -20496,10 +20496,10 @@ var require_utils3 = __commonJS((exports) => {
|
|
|
20496
20496
|
exports.array = array2;
|
|
20497
20497
|
var errno2 = require_errno();
|
|
20498
20498
|
exports.errno = errno2;
|
|
20499
|
-
var
|
|
20500
|
-
exports.fs =
|
|
20501
|
-
var
|
|
20502
|
-
exports.path =
|
|
20499
|
+
var fs7 = require_fs();
|
|
20500
|
+
exports.fs = fs7;
|
|
20501
|
+
var path6 = require_path();
|
|
20502
|
+
exports.path = path6;
|
|
20503
20503
|
var pattern2 = require_pattern();
|
|
20504
20504
|
exports.pattern = pattern2;
|
|
20505
20505
|
var stream2 = require_stream2();
|
|
@@ -20595,8 +20595,8 @@ var require_tasks = __commonJS((exports) => {
|
|
|
20595
20595
|
var require_async = __commonJS((exports) => {
|
|
20596
20596
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20597
20597
|
exports.read = undefined;
|
|
20598
|
-
function read(
|
|
20599
|
-
settings2.fs.lstat(
|
|
20598
|
+
function read(path6, settings2, callback) {
|
|
20599
|
+
settings2.fs.lstat(path6, (lstatError, lstat) => {
|
|
20600
20600
|
if (lstatError !== null) {
|
|
20601
20601
|
callFailureCallback(callback, lstatError);
|
|
20602
20602
|
return;
|
|
@@ -20605,7 +20605,7 @@ var require_async = __commonJS((exports) => {
|
|
|
20605
20605
|
callSuccessCallback(callback, lstat);
|
|
20606
20606
|
return;
|
|
20607
20607
|
}
|
|
20608
|
-
settings2.fs.stat(
|
|
20608
|
+
settings2.fs.stat(path6, (statError, stat) => {
|
|
20609
20609
|
if (statError !== null) {
|
|
20610
20610
|
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
20611
20611
|
callFailureCallback(callback, statError);
|
|
@@ -20634,13 +20634,13 @@ var require_async = __commonJS((exports) => {
|
|
|
20634
20634
|
var require_sync = __commonJS((exports) => {
|
|
20635
20635
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20636
20636
|
exports.read = undefined;
|
|
20637
|
-
function read(
|
|
20638
|
-
const lstat = settings2.fs.lstatSync(
|
|
20637
|
+
function read(path6, settings2) {
|
|
20638
|
+
const lstat = settings2.fs.lstatSync(path6);
|
|
20639
20639
|
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
20640
20640
|
return lstat;
|
|
20641
20641
|
}
|
|
20642
20642
|
try {
|
|
20643
|
-
const stat = settings2.fs.statSync(
|
|
20643
|
+
const stat = settings2.fs.statSync(path6);
|
|
20644
20644
|
if (settings2.markSymbolicLink) {
|
|
20645
20645
|
stat.isSymbolicLink = () => true;
|
|
20646
20646
|
}
|
|
@@ -20659,12 +20659,12 @@ var require_sync = __commonJS((exports) => {
|
|
|
20659
20659
|
var require_fs2 = __commonJS((exports) => {
|
|
20660
20660
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20661
20661
|
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = undefined;
|
|
20662
|
-
var
|
|
20662
|
+
var fs7 = __require("fs");
|
|
20663
20663
|
exports.FILE_SYSTEM_ADAPTER = {
|
|
20664
|
-
lstat:
|
|
20665
|
-
stat:
|
|
20666
|
-
lstatSync:
|
|
20667
|
-
statSync:
|
|
20664
|
+
lstat: fs7.lstat,
|
|
20665
|
+
stat: fs7.stat,
|
|
20666
|
+
lstatSync: fs7.lstatSync,
|
|
20667
|
+
statSync: fs7.statSync
|
|
20668
20668
|
};
|
|
20669
20669
|
function createFileSystemAdapter(fsMethods) {
|
|
20670
20670
|
if (fsMethods === undefined) {
|
|
@@ -20678,13 +20678,13 @@ var require_fs2 = __commonJS((exports) => {
|
|
|
20678
20678
|
// ../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js
|
|
20679
20679
|
var require_settings = __commonJS((exports) => {
|
|
20680
20680
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20681
|
-
var
|
|
20681
|
+
var fs7 = require_fs2();
|
|
20682
20682
|
|
|
20683
20683
|
class Settings {
|
|
20684
20684
|
constructor(_options = {}) {
|
|
20685
20685
|
this._options = _options;
|
|
20686
20686
|
this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
|
20687
|
-
this.fs =
|
|
20687
|
+
this.fs = fs7.createFileSystemAdapter(this._options.fs);
|
|
20688
20688
|
this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
|
20689
20689
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
20690
20690
|
}
|
|
@@ -20703,17 +20703,17 @@ var require_out = __commonJS((exports) => {
|
|
|
20703
20703
|
var sync2 = require_sync();
|
|
20704
20704
|
var settings_1 = require_settings();
|
|
20705
20705
|
exports.Settings = settings_1.default;
|
|
20706
|
-
function stat(
|
|
20706
|
+
function stat(path6, optionsOrSettingsOrCallback, callback) {
|
|
20707
20707
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
20708
|
-
async2.read(
|
|
20708
|
+
async2.read(path6, getSettings(), optionsOrSettingsOrCallback);
|
|
20709
20709
|
return;
|
|
20710
20710
|
}
|
|
20711
|
-
async2.read(
|
|
20711
|
+
async2.read(path6, getSettings(optionsOrSettingsOrCallback), callback);
|
|
20712
20712
|
}
|
|
20713
20713
|
exports.stat = stat;
|
|
20714
|
-
function statSync(
|
|
20714
|
+
function statSync(path6, optionsOrSettings) {
|
|
20715
20715
|
const settings2 = getSettings(optionsOrSettings);
|
|
20716
|
-
return sync2.read(
|
|
20716
|
+
return sync2.read(path6, settings2);
|
|
20717
20717
|
}
|
|
20718
20718
|
exports.statSync = statSync;
|
|
20719
20719
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -20829,8 +20829,8 @@ var require_fs3 = __commonJS((exports) => {
|
|
|
20829
20829
|
var require_utils4 = __commonJS((exports) => {
|
|
20830
20830
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20831
20831
|
exports.fs = undefined;
|
|
20832
|
-
var
|
|
20833
|
-
exports.fs =
|
|
20832
|
+
var fs7 = require_fs3();
|
|
20833
|
+
exports.fs = fs7;
|
|
20834
20834
|
});
|
|
20835
20835
|
|
|
20836
20836
|
// ../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js
|
|
@@ -20916,16 +20916,16 @@ var require_async2 = __commonJS((exports) => {
|
|
|
20916
20916
|
return;
|
|
20917
20917
|
}
|
|
20918
20918
|
const tasks2 = names.map((name) => {
|
|
20919
|
-
const
|
|
20919
|
+
const path6 = common2.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
20920
20920
|
return (done) => {
|
|
20921
|
-
fsStat.stat(
|
|
20921
|
+
fsStat.stat(path6, settings2.fsStatSettings, (error2, stats) => {
|
|
20922
20922
|
if (error2 !== null) {
|
|
20923
20923
|
done(error2);
|
|
20924
20924
|
return;
|
|
20925
20925
|
}
|
|
20926
20926
|
const entry2 = {
|
|
20927
20927
|
name,
|
|
20928
|
-
path:
|
|
20928
|
+
path: path6,
|
|
20929
20929
|
dirent: utils2.fs.createDirentFromStats(name, stats)
|
|
20930
20930
|
};
|
|
20931
20931
|
if (settings2.stats) {
|
|
@@ -21013,14 +21013,14 @@ var require_sync2 = __commonJS((exports) => {
|
|
|
21013
21013
|
var require_fs4 = __commonJS((exports) => {
|
|
21014
21014
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21015
21015
|
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = undefined;
|
|
21016
|
-
var
|
|
21016
|
+
var fs7 = __require("fs");
|
|
21017
21017
|
exports.FILE_SYSTEM_ADAPTER = {
|
|
21018
|
-
lstat:
|
|
21019
|
-
stat:
|
|
21020
|
-
lstatSync:
|
|
21021
|
-
statSync:
|
|
21022
|
-
readdir:
|
|
21023
|
-
readdirSync:
|
|
21018
|
+
lstat: fs7.lstat,
|
|
21019
|
+
stat: fs7.stat,
|
|
21020
|
+
lstatSync: fs7.lstatSync,
|
|
21021
|
+
statSync: fs7.statSync,
|
|
21022
|
+
readdir: fs7.readdir,
|
|
21023
|
+
readdirSync: fs7.readdirSync
|
|
21024
21024
|
};
|
|
21025
21025
|
function createFileSystemAdapter(fsMethods) {
|
|
21026
21026
|
if (fsMethods === undefined) {
|
|
@@ -21034,16 +21034,16 @@ var require_fs4 = __commonJS((exports) => {
|
|
|
21034
21034
|
// ../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js
|
|
21035
21035
|
var require_settings2 = __commonJS((exports) => {
|
|
21036
21036
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21037
|
-
var
|
|
21037
|
+
var path6 = __require("path");
|
|
21038
21038
|
var fsStat = require_out();
|
|
21039
|
-
var
|
|
21039
|
+
var fs7 = require_fs4();
|
|
21040
21040
|
|
|
21041
21041
|
class Settings {
|
|
21042
21042
|
constructor(_options = {}) {
|
|
21043
21043
|
this._options = _options;
|
|
21044
21044
|
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
|
21045
|
-
this.fs =
|
|
21046
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
21045
|
+
this.fs = fs7.createFileSystemAdapter(this._options.fs);
|
|
21046
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path6.sep);
|
|
21047
21047
|
this.stats = this._getValue(this._options.stats, false);
|
|
21048
21048
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
21049
21049
|
this.fsStatSettings = new fsStat.Settings({
|
|
@@ -21067,17 +21067,17 @@ var require_out2 = __commonJS((exports) => {
|
|
|
21067
21067
|
var sync2 = require_sync2();
|
|
21068
21068
|
var settings_1 = require_settings2();
|
|
21069
21069
|
exports.Settings = settings_1.default;
|
|
21070
|
-
function scandir(
|
|
21070
|
+
function scandir(path6, optionsOrSettingsOrCallback, callback) {
|
|
21071
21071
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
21072
|
-
async2.read(
|
|
21072
|
+
async2.read(path6, getSettings(), optionsOrSettingsOrCallback);
|
|
21073
21073
|
return;
|
|
21074
21074
|
}
|
|
21075
|
-
async2.read(
|
|
21075
|
+
async2.read(path6, getSettings(optionsOrSettingsOrCallback), callback);
|
|
21076
21076
|
}
|
|
21077
21077
|
exports.scandir = scandir;
|
|
21078
|
-
function scandirSync(
|
|
21078
|
+
function scandirSync(path6, optionsOrSettings) {
|
|
21079
21079
|
const settings2 = getSettings(optionsOrSettings);
|
|
21080
|
-
return sync2.read(
|
|
21080
|
+
return sync2.read(path6, settings2);
|
|
21081
21081
|
}
|
|
21082
21082
|
exports.scandirSync = scandirSync;
|
|
21083
21083
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -21675,7 +21675,7 @@ var require_sync4 = __commonJS((exports) => {
|
|
|
21675
21675
|
// ../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js
|
|
21676
21676
|
var require_settings3 = __commonJS((exports) => {
|
|
21677
21677
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21678
|
-
var
|
|
21678
|
+
var path6 = __require("path");
|
|
21679
21679
|
var fsScandir = require_out2();
|
|
21680
21680
|
|
|
21681
21681
|
class Settings {
|
|
@@ -21686,7 +21686,7 @@ var require_settings3 = __commonJS((exports) => {
|
|
|
21686
21686
|
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
|
21687
21687
|
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
|
21688
21688
|
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
|
21689
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
21689
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path6.sep);
|
|
21690
21690
|
this.fsScandirSettings = new fsScandir.Settings({
|
|
21691
21691
|
followSymbolicLinks: this._options.followSymbolicLinks,
|
|
21692
21692
|
fs: this._options.fs,
|
|
@@ -21742,7 +21742,7 @@ var require_out3 = __commonJS((exports) => {
|
|
|
21742
21742
|
// ../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js
|
|
21743
21743
|
var require_reader2 = __commonJS((exports) => {
|
|
21744
21744
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21745
|
-
var
|
|
21745
|
+
var path6 = __require("path");
|
|
21746
21746
|
var fsStat = require_out();
|
|
21747
21747
|
var utils2 = require_utils3();
|
|
21748
21748
|
|
|
@@ -21756,7 +21756,7 @@ var require_reader2 = __commonJS((exports) => {
|
|
|
21756
21756
|
});
|
|
21757
21757
|
}
|
|
21758
21758
|
_getFullEntryPath(filepath) {
|
|
21759
|
-
return
|
|
21759
|
+
return path6.resolve(this._settings.cwd, filepath);
|
|
21760
21760
|
}
|
|
21761
21761
|
_makeEntry(stats, pattern2) {
|
|
21762
21762
|
const entry2 = {
|
|
@@ -21790,8 +21790,8 @@ var require_stream4 = __commonJS((exports) => {
|
|
|
21790
21790
|
this._walkStream = fsWalk.walkStream;
|
|
21791
21791
|
this._stat = fsStat.stat;
|
|
21792
21792
|
}
|
|
21793
|
-
dynamic(
|
|
21794
|
-
return this._walkStream(
|
|
21793
|
+
dynamic(root3, options) {
|
|
21794
|
+
return this._walkStream(root3, options);
|
|
21795
21795
|
}
|
|
21796
21796
|
static(patterns, options) {
|
|
21797
21797
|
const filepaths = patterns.map(this._getFullEntryPath, this);
|
|
@@ -21844,9 +21844,9 @@ var require_async5 = __commonJS((exports) => {
|
|
|
21844
21844
|
this._walkAsync = fsWalk.walk;
|
|
21845
21845
|
this._readerStream = new stream_1.default(this._settings);
|
|
21846
21846
|
}
|
|
21847
|
-
dynamic(
|
|
21847
|
+
dynamic(root3, options) {
|
|
21848
21848
|
return new Promise((resolve, reject) => {
|
|
21849
|
-
this._walkAsync(
|
|
21849
|
+
this._walkAsync(root3, options, (error2, entries) => {
|
|
21850
21850
|
if (error2 === null) {
|
|
21851
21851
|
resolve(entries);
|
|
21852
21852
|
} else {
|
|
@@ -22153,7 +22153,7 @@ var require_entry2 = __commonJS((exports) => {
|
|
|
22153
22153
|
// ../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js
|
|
22154
22154
|
var require_provider = __commonJS((exports) => {
|
|
22155
22155
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22156
|
-
var
|
|
22156
|
+
var path6 = __require("path");
|
|
22157
22157
|
var deep_1 = require_deep();
|
|
22158
22158
|
var entry_1 = require_entry();
|
|
22159
22159
|
var error_1 = require_error2();
|
|
@@ -22168,7 +22168,7 @@ var require_provider = __commonJS((exports) => {
|
|
|
22168
22168
|
this.entryTransformer = new entry_2.default(this._settings);
|
|
22169
22169
|
}
|
|
22170
22170
|
_getRootDirectory(task) {
|
|
22171
|
-
return
|
|
22171
|
+
return path6.resolve(this._settings.cwd, task.base);
|
|
22172
22172
|
}
|
|
22173
22173
|
_getReaderOptions(task) {
|
|
22174
22174
|
const basePath = task.base === "." ? "" : task.base;
|
|
@@ -22214,14 +22214,14 @@ var require_async6 = __commonJS((exports) => {
|
|
|
22214
22214
|
this._reader = new async_1.default(this._settings);
|
|
22215
22215
|
}
|
|
22216
22216
|
async read(task) {
|
|
22217
|
-
const
|
|
22217
|
+
const root3 = this._getRootDirectory(task);
|
|
22218
22218
|
const options = this._getReaderOptions(task);
|
|
22219
|
-
const entries = await this.api(
|
|
22219
|
+
const entries = await this.api(root3, task, options);
|
|
22220
22220
|
return entries.map((entry2) => options.transform(entry2));
|
|
22221
22221
|
}
|
|
22222
|
-
api(
|
|
22222
|
+
api(root3, task, options) {
|
|
22223
22223
|
if (task.dynamic) {
|
|
22224
|
-
return this._reader.dynamic(
|
|
22224
|
+
return this._reader.dynamic(root3, options);
|
|
22225
22225
|
}
|
|
22226
22226
|
return this._reader.static(task.patterns, options);
|
|
22227
22227
|
}
|
|
@@ -22242,17 +22242,17 @@ var require_stream5 = __commonJS((exports) => {
|
|
|
22242
22242
|
this._reader = new stream_2.default(this._settings);
|
|
22243
22243
|
}
|
|
22244
22244
|
read(task) {
|
|
22245
|
-
const
|
|
22245
|
+
const root3 = this._getRootDirectory(task);
|
|
22246
22246
|
const options = this._getReaderOptions(task);
|
|
22247
|
-
const source = this.api(
|
|
22247
|
+
const source = this.api(root3, task, options);
|
|
22248
22248
|
const destination = new stream_1.Readable({ objectMode: true, read: () => {} });
|
|
22249
22249
|
source.once("error", (error2) => destination.emit("error", error2)).on("data", (entry2) => destination.emit("data", options.transform(entry2))).once("end", () => destination.emit("end"));
|
|
22250
22250
|
destination.once("close", () => source.destroy());
|
|
22251
22251
|
return destination;
|
|
22252
22252
|
}
|
|
22253
|
-
api(
|
|
22253
|
+
api(root3, task, options) {
|
|
22254
22254
|
if (task.dynamic) {
|
|
22255
|
-
return this._reader.dynamic(
|
|
22255
|
+
return this._reader.dynamic(root3, options);
|
|
22256
22256
|
}
|
|
22257
22257
|
return this._reader.static(task.patterns, options);
|
|
22258
22258
|
}
|
|
@@ -22273,8 +22273,8 @@ var require_sync5 = __commonJS((exports) => {
|
|
|
22273
22273
|
this._walkSync = fsWalk.walkSync;
|
|
22274
22274
|
this._statSync = fsStat.statSync;
|
|
22275
22275
|
}
|
|
22276
|
-
dynamic(
|
|
22277
|
-
return this._walkSync(
|
|
22276
|
+
dynamic(root3, options) {
|
|
22277
|
+
return this._walkSync(root3, options);
|
|
22278
22278
|
}
|
|
22279
22279
|
static(patterns, options) {
|
|
22280
22280
|
const entries = [];
|
|
@@ -22318,14 +22318,14 @@ var require_sync6 = __commonJS((exports) => {
|
|
|
22318
22318
|
this._reader = new sync_1.default(this._settings);
|
|
22319
22319
|
}
|
|
22320
22320
|
read(task) {
|
|
22321
|
-
const
|
|
22321
|
+
const root3 = this._getRootDirectory(task);
|
|
22322
22322
|
const options = this._getReaderOptions(task);
|
|
22323
|
-
const entries = this.api(
|
|
22323
|
+
const entries = this.api(root3, task, options);
|
|
22324
22324
|
return entries.map(options.transform);
|
|
22325
22325
|
}
|
|
22326
|
-
api(
|
|
22326
|
+
api(root3, task, options) {
|
|
22327
22327
|
if (task.dynamic) {
|
|
22328
|
-
return this._reader.dynamic(
|
|
22328
|
+
return this._reader.dynamic(root3, options);
|
|
22329
22329
|
}
|
|
22330
22330
|
return this._reader.static(task.patterns, options);
|
|
22331
22331
|
}
|
|
@@ -22337,16 +22337,16 @@ var require_sync6 = __commonJS((exports) => {
|
|
|
22337
22337
|
var require_settings4 = __commonJS((exports) => {
|
|
22338
22338
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22339
22339
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = undefined;
|
|
22340
|
-
var
|
|
22340
|
+
var fs7 = __require("fs");
|
|
22341
22341
|
var os2 = __require("os");
|
|
22342
22342
|
var CPU_COUNT = Math.max(os2.cpus().length, 1);
|
|
22343
22343
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
22344
|
-
lstat:
|
|
22345
|
-
lstatSync:
|
|
22346
|
-
stat:
|
|
22347
|
-
statSync:
|
|
22348
|
-
readdir:
|
|
22349
|
-
readdirSync:
|
|
22344
|
+
lstat: fs7.lstat,
|
|
22345
|
+
lstatSync: fs7.lstatSync,
|
|
22346
|
+
stat: fs7.stat,
|
|
22347
|
+
statSync: fs7.statSync,
|
|
22348
|
+
readdir: fs7.readdir,
|
|
22349
|
+
readdirSync: fs7.readdirSync
|
|
22350
22350
|
};
|
|
22351
22351
|
|
|
22352
22352
|
class Settings {
|
|
@@ -28536,10 +28536,10 @@ var require_lib2 = __commonJS((exports) => {
|
|
|
28536
28536
|
exports.analyse = analyse;
|
|
28537
28537
|
var detectFile = (filepath, opts = {}) => new Promise((resolve, reject) => {
|
|
28538
28538
|
let fd;
|
|
28539
|
-
const
|
|
28539
|
+
const fs12 = (0, node_1.default)();
|
|
28540
28540
|
const handler = (err, buffer) => {
|
|
28541
28541
|
if (fd) {
|
|
28542
|
-
|
|
28542
|
+
fs12.closeSync(fd);
|
|
28543
28543
|
}
|
|
28544
28544
|
if (err) {
|
|
28545
28545
|
reject(err);
|
|
@@ -28551,9 +28551,9 @@ var require_lib2 = __commonJS((exports) => {
|
|
|
28551
28551
|
};
|
|
28552
28552
|
const sampleSize = (opts === null || opts === undefined ? undefined : opts.sampleSize) || 0;
|
|
28553
28553
|
if (sampleSize > 0) {
|
|
28554
|
-
fd =
|
|
28554
|
+
fd = fs12.openSync(filepath, "r");
|
|
28555
28555
|
let sample = Buffer.allocUnsafe(sampleSize);
|
|
28556
|
-
|
|
28556
|
+
fs12.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
|
|
28557
28557
|
if (err) {
|
|
28558
28558
|
handler(err, null);
|
|
28559
28559
|
} else {
|
|
@@ -28565,22 +28565,22 @@ var require_lib2 = __commonJS((exports) => {
|
|
|
28565
28565
|
});
|
|
28566
28566
|
return;
|
|
28567
28567
|
}
|
|
28568
|
-
|
|
28568
|
+
fs12.readFile(filepath, handler);
|
|
28569
28569
|
});
|
|
28570
28570
|
exports.detectFile = detectFile;
|
|
28571
28571
|
var detectFileSync = (filepath, opts = {}) => {
|
|
28572
|
-
const
|
|
28572
|
+
const fs12 = (0, node_1.default)();
|
|
28573
28573
|
if (opts && opts.sampleSize) {
|
|
28574
|
-
const fd =
|
|
28574
|
+
const fd = fs12.openSync(filepath, "r");
|
|
28575
28575
|
let sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
28576
|
-
const bytesRead =
|
|
28576
|
+
const bytesRead = fs12.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
|
|
28577
28577
|
if (bytesRead < opts.sampleSize) {
|
|
28578
28578
|
sample = sample.subarray(0, bytesRead);
|
|
28579
28579
|
}
|
|
28580
|
-
|
|
28580
|
+
fs12.closeSync(fd);
|
|
28581
28581
|
return (0, exports.detect)(sample);
|
|
28582
28582
|
}
|
|
28583
|
-
return (0, exports.detect)(
|
|
28583
|
+
return (0, exports.detect)(fs12.readFileSync(filepath));
|
|
28584
28584
|
};
|
|
28585
28585
|
exports.detectFileSync = detectFileSync;
|
|
28586
28586
|
exports.default = {
|
|
@@ -28594,7 +28594,7 @@ var require_lib2 = __commonJS((exports) => {
|
|
|
28594
28594
|
// ../node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js
|
|
28595
28595
|
var require_safer = __commonJS((exports, module) => {
|
|
28596
28596
|
var buffer = __require("buffer");
|
|
28597
|
-
var
|
|
28597
|
+
var Buffer5 = buffer.Buffer;
|
|
28598
28598
|
var safer = {};
|
|
28599
28599
|
var key;
|
|
28600
28600
|
for (key in buffer) {
|
|
@@ -28605,14 +28605,14 @@ var require_safer = __commonJS((exports, module) => {
|
|
|
28605
28605
|
safer[key] = buffer[key];
|
|
28606
28606
|
}
|
|
28607
28607
|
var Safer = safer.Buffer = {};
|
|
28608
|
-
for (key in
|
|
28609
|
-
if (!
|
|
28608
|
+
for (key in Buffer5) {
|
|
28609
|
+
if (!Buffer5.hasOwnProperty(key))
|
|
28610
28610
|
continue;
|
|
28611
28611
|
if (key === "allocUnsafe" || key === "allocUnsafeSlow")
|
|
28612
28612
|
continue;
|
|
28613
|
-
Safer[key] =
|
|
28613
|
+
Safer[key] = Buffer5[key];
|
|
28614
28614
|
}
|
|
28615
|
-
safer.Buffer.prototype =
|
|
28615
|
+
safer.Buffer.prototype = Buffer5.prototype;
|
|
28616
28616
|
if (!Safer.from || Safer.from === Uint8Array.from) {
|
|
28617
28617
|
Safer.from = function(value, encodingOrOffset, length) {
|
|
28618
28618
|
if (typeof value === "number") {
|
|
@@ -28621,7 +28621,7 @@ var require_safer = __commonJS((exports, module) => {
|
|
|
28621
28621
|
if (value && typeof value.length === "undefined") {
|
|
28622
28622
|
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
|
|
28623
28623
|
}
|
|
28624
|
-
return
|
|
28624
|
+
return Buffer5(value, encodingOrOffset, length);
|
|
28625
28625
|
};
|
|
28626
28626
|
}
|
|
28627
28627
|
if (!Safer.alloc) {
|
|
@@ -28632,7 +28632,7 @@ var require_safer = __commonJS((exports, module) => {
|
|
|
28632
28632
|
if (size < 0 || size >= 2 * (1 << 30)) {
|
|
28633
28633
|
throw new RangeError('The value "' + size + '" is invalid for option "size"');
|
|
28634
28634
|
}
|
|
28635
|
-
var buf =
|
|
28635
|
+
var buf = Buffer5(size);
|
|
28636
28636
|
if (!fill || fill.length === 0) {
|
|
28637
28637
|
buf.fill(0);
|
|
28638
28638
|
} else if (typeof encoding === "string") {
|
|
@@ -28717,7 +28717,7 @@ var require_merge_exports = __commonJS((exports, module) => {
|
|
|
28717
28717
|
|
|
28718
28718
|
// ../node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/encodings/internal.js
|
|
28719
28719
|
var require_internal = __commonJS((exports, module) => {
|
|
28720
|
-
var
|
|
28720
|
+
var Buffer5 = require_safer().Buffer;
|
|
28721
28721
|
module.exports = {
|
|
28722
28722
|
utf8: { type: "_internal", bomAware: true },
|
|
28723
28723
|
cesu8: { type: "_internal", bomAware: true },
|
|
@@ -28739,7 +28739,7 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
28739
28739
|
} else if (this.enc === "cesu8") {
|
|
28740
28740
|
this.enc = "utf8";
|
|
28741
28741
|
this.encoder = InternalEncoderCesu8;
|
|
28742
|
-
if (
|
|
28742
|
+
if (Buffer5.from("eda0bdedb2a9", "hex").toString() !== "\uD83D\uDCA9") {
|
|
28743
28743
|
this.decoder = InternalDecoderCesu8;
|
|
28744
28744
|
this.defaultCharUnicode = iconv.defaultCharUnicode;
|
|
28745
28745
|
}
|
|
@@ -28752,8 +28752,8 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
28752
28752
|
this.decoder = new StringDecoder(codec.enc);
|
|
28753
28753
|
}
|
|
28754
28754
|
InternalDecoder.prototype.write = function(buf) {
|
|
28755
|
-
if (!
|
|
28756
|
-
buf =
|
|
28755
|
+
if (!Buffer5.isBuffer(buf)) {
|
|
28756
|
+
buf = Buffer5.from(buf);
|
|
28757
28757
|
}
|
|
28758
28758
|
return this.decoder.write(buf);
|
|
28759
28759
|
};
|
|
@@ -28764,7 +28764,7 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
28764
28764
|
this.enc = codec.enc;
|
|
28765
28765
|
}
|
|
28766
28766
|
InternalEncoder.prototype.write = function(str) {
|
|
28767
|
-
return
|
|
28767
|
+
return Buffer5.from(str, this.enc);
|
|
28768
28768
|
};
|
|
28769
28769
|
InternalEncoder.prototype.end = function() {};
|
|
28770
28770
|
function InternalEncoderBase64(options, codec) {
|
|
@@ -28775,14 +28775,14 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
28775
28775
|
var completeQuads = str.length - str.length % 4;
|
|
28776
28776
|
this.prevStr = str.slice(completeQuads);
|
|
28777
28777
|
str = str.slice(0, completeQuads);
|
|
28778
|
-
return
|
|
28778
|
+
return Buffer5.from(str, "base64");
|
|
28779
28779
|
};
|
|
28780
28780
|
InternalEncoderBase64.prototype.end = function() {
|
|
28781
|
-
return
|
|
28781
|
+
return Buffer5.from(this.prevStr, "base64");
|
|
28782
28782
|
};
|
|
28783
28783
|
function InternalEncoderCesu8(options, codec) {}
|
|
28784
28784
|
InternalEncoderCesu8.prototype.write = function(str) {
|
|
28785
|
-
var buf =
|
|
28785
|
+
var buf = Buffer5.alloc(str.length * 3);
|
|
28786
28786
|
var bufIdx = 0;
|
|
28787
28787
|
for (var i = 0;i < str.length; i++) {
|
|
28788
28788
|
var charCode = str.charCodeAt(i);
|
|
@@ -28877,20 +28877,20 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
28877
28877
|
str = str.slice(0, str.length - 1);
|
|
28878
28878
|
}
|
|
28879
28879
|
}
|
|
28880
|
-
return
|
|
28880
|
+
return Buffer5.from(str, this.enc);
|
|
28881
28881
|
};
|
|
28882
28882
|
InternalEncoderUtf8.prototype.end = function() {
|
|
28883
28883
|
if (this.highSurrogate) {
|
|
28884
28884
|
var str = this.highSurrogate;
|
|
28885
28885
|
this.highSurrogate = "";
|
|
28886
|
-
return
|
|
28886
|
+
return Buffer5.from(str, this.enc);
|
|
28887
28887
|
}
|
|
28888
28888
|
};
|
|
28889
28889
|
});
|
|
28890
28890
|
|
|
28891
28891
|
// ../node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/encodings/utf32.js
|
|
28892
28892
|
var require_utf32 = __commonJS((exports) => {
|
|
28893
|
-
var
|
|
28893
|
+
var Buffer5 = require_safer().Buffer;
|
|
28894
28894
|
exports._utf32 = Utf32Codec;
|
|
28895
28895
|
function Utf32Codec(codecOptions, iconv) {
|
|
28896
28896
|
this.iconv = iconv;
|
|
@@ -28908,8 +28908,8 @@ var require_utf32 = __commonJS((exports) => {
|
|
|
28908
28908
|
this.highSurrogate = 0;
|
|
28909
28909
|
}
|
|
28910
28910
|
Utf32Encoder.prototype.write = function(str) {
|
|
28911
|
-
var src =
|
|
28912
|
-
var dst =
|
|
28911
|
+
var src = Buffer5.from(str, "ucs2");
|
|
28912
|
+
var dst = Buffer5.alloc(src.length * 2);
|
|
28913
28913
|
var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
|
|
28914
28914
|
var offset = 0;
|
|
28915
28915
|
for (var i = 0;i < src.length; i += 2) {
|
|
@@ -28945,7 +28945,7 @@ var require_utf32 = __commonJS((exports) => {
|
|
|
28945
28945
|
if (!this.highSurrogate) {
|
|
28946
28946
|
return;
|
|
28947
28947
|
}
|
|
28948
|
-
var buf =
|
|
28948
|
+
var buf = Buffer5.alloc(4);
|
|
28949
28949
|
if (this.isLE) {
|
|
28950
28950
|
buf.writeUInt32LE(this.highSurrogate, 0);
|
|
28951
28951
|
} else {
|
|
@@ -28965,7 +28965,7 @@ var require_utf32 = __commonJS((exports) => {
|
|
|
28965
28965
|
}
|
|
28966
28966
|
var i = 0;
|
|
28967
28967
|
var codepoint = 0;
|
|
28968
|
-
var dst =
|
|
28968
|
+
var dst = Buffer5.alloc(src.length + 4);
|
|
28969
28969
|
var offset = 0;
|
|
28970
28970
|
var isLE = this.isLE;
|
|
28971
28971
|
var overflow = this.overflow;
|
|
@@ -29124,7 +29124,7 @@ var require_utf32 = __commonJS((exports) => {
|
|
|
29124
29124
|
|
|
29125
29125
|
// ../node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/encodings/utf16.js
|
|
29126
29126
|
var require_utf16 = __commonJS((exports) => {
|
|
29127
|
-
var
|
|
29127
|
+
var Buffer5 = require_safer().Buffer;
|
|
29128
29128
|
exports.utf16be = Utf16BECodec;
|
|
29129
29129
|
function Utf16BECodec() {}
|
|
29130
29130
|
Utf16BECodec.prototype.encoder = Utf16BEEncoder;
|
|
@@ -29132,7 +29132,7 @@ var require_utf16 = __commonJS((exports) => {
|
|
|
29132
29132
|
Utf16BECodec.prototype.bomAware = true;
|
|
29133
29133
|
function Utf16BEEncoder() {}
|
|
29134
29134
|
Utf16BEEncoder.prototype.write = function(str) {
|
|
29135
|
-
var buf =
|
|
29135
|
+
var buf = Buffer5.from(str, "ucs2");
|
|
29136
29136
|
for (var i = 0;i < buf.length; i += 2) {
|
|
29137
29137
|
var tmp = buf[i];
|
|
29138
29138
|
buf[i] = buf[i + 1];
|
|
@@ -29148,7 +29148,7 @@ var require_utf16 = __commonJS((exports) => {
|
|
|
29148
29148
|
if (buf.length == 0) {
|
|
29149
29149
|
return "";
|
|
29150
29150
|
}
|
|
29151
|
-
var buf2 =
|
|
29151
|
+
var buf2 = Buffer5.alloc(buf.length + 1);
|
|
29152
29152
|
var i = 0;
|
|
29153
29153
|
var j = 0;
|
|
29154
29154
|
if (this.overflowByte !== -1) {
|
|
@@ -29267,7 +29267,7 @@ var require_utf16 = __commonJS((exports) => {
|
|
|
29267
29267
|
|
|
29268
29268
|
// ../node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/encodings/utf7.js
|
|
29269
29269
|
var require_utf7 = __commonJS((exports) => {
|
|
29270
|
-
var
|
|
29270
|
+
var Buffer5 = require_safer().Buffer;
|
|
29271
29271
|
exports.utf7 = Utf7Codec;
|
|
29272
29272
|
exports.unicode11utf7 = "utf7";
|
|
29273
29273
|
function Utf7Codec(codecOptions, iconv) {
|
|
@@ -29281,7 +29281,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29281
29281
|
this.iconv = codec.iconv;
|
|
29282
29282
|
}
|
|
29283
29283
|
Utf7Encoder.prototype.write = function(str) {
|
|
29284
|
-
return
|
|
29284
|
+
return Buffer5.from(str.replace(nonDirectChars, function(chunk) {
|
|
29285
29285
|
return "+" + (chunk === "+" ? "" : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + "-";
|
|
29286
29286
|
}.bind(this)));
|
|
29287
29287
|
};
|
|
@@ -29318,7 +29318,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29318
29318
|
res += "+";
|
|
29319
29319
|
} else {
|
|
29320
29320
|
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii");
|
|
29321
|
-
res += this.iconv.decode(
|
|
29321
|
+
res += this.iconv.decode(Buffer5.from(b64str, "base64"), "utf16-be");
|
|
29322
29322
|
}
|
|
29323
29323
|
if (buf[i2] != minusChar) {
|
|
29324
29324
|
i2--;
|
|
@@ -29336,7 +29336,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29336
29336
|
var canBeDecoded = b64str.length - b64str.length % 8;
|
|
29337
29337
|
base64Accum = b64str.slice(canBeDecoded);
|
|
29338
29338
|
b64str = b64str.slice(0, canBeDecoded);
|
|
29339
|
-
res += this.iconv.decode(
|
|
29339
|
+
res += this.iconv.decode(Buffer5.from(b64str, "base64"), "utf16-be");
|
|
29340
29340
|
}
|
|
29341
29341
|
this.inBase64 = inBase64;
|
|
29342
29342
|
this.base64Accum = base64Accum;
|
|
@@ -29345,7 +29345,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29345
29345
|
Utf7Decoder.prototype.end = function() {
|
|
29346
29346
|
var res = "";
|
|
29347
29347
|
if (this.inBase64 && this.base64Accum.length > 0) {
|
|
29348
|
-
res = this.iconv.decode(
|
|
29348
|
+
res = this.iconv.decode(Buffer5.from(this.base64Accum, "base64"), "utf16-be");
|
|
29349
29349
|
}
|
|
29350
29350
|
this.inBase64 = false;
|
|
29351
29351
|
this.base64Accum = "";
|
|
@@ -29361,14 +29361,14 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29361
29361
|
function Utf7IMAPEncoder(options, codec) {
|
|
29362
29362
|
this.iconv = codec.iconv;
|
|
29363
29363
|
this.inBase64 = false;
|
|
29364
|
-
this.base64Accum =
|
|
29364
|
+
this.base64Accum = Buffer5.alloc(6);
|
|
29365
29365
|
this.base64AccumIdx = 0;
|
|
29366
29366
|
}
|
|
29367
29367
|
Utf7IMAPEncoder.prototype.write = function(str) {
|
|
29368
29368
|
var inBase64 = this.inBase64;
|
|
29369
29369
|
var base64Accum = this.base64Accum;
|
|
29370
29370
|
var base64AccumIdx = this.base64AccumIdx;
|
|
29371
|
-
var buf =
|
|
29371
|
+
var buf = Buffer5.alloc(str.length * 5 + 10);
|
|
29372
29372
|
var bufIdx = 0;
|
|
29373
29373
|
for (var i2 = 0;i2 < str.length; i2++) {
|
|
29374
29374
|
var uChar = str.charCodeAt(i2);
|
|
@@ -29407,7 +29407,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29407
29407
|
return buf.slice(0, bufIdx);
|
|
29408
29408
|
};
|
|
29409
29409
|
Utf7IMAPEncoder.prototype.end = function() {
|
|
29410
|
-
var buf =
|
|
29410
|
+
var buf = Buffer5.alloc(10);
|
|
29411
29411
|
var bufIdx = 0;
|
|
29412
29412
|
if (this.inBase64) {
|
|
29413
29413
|
if (this.base64AccumIdx > 0) {
|
|
@@ -29444,7 +29444,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29444
29444
|
res += "&";
|
|
29445
29445
|
} else {
|
|
29446
29446
|
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii").replace(/,/g, "/");
|
|
29447
|
-
res += this.iconv.decode(
|
|
29447
|
+
res += this.iconv.decode(Buffer5.from(b64str, "base64"), "utf16-be");
|
|
29448
29448
|
}
|
|
29449
29449
|
if (buf[i2] != minusChar) {
|
|
29450
29450
|
i2--;
|
|
@@ -29462,7 +29462,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29462
29462
|
var canBeDecoded = b64str.length - b64str.length % 8;
|
|
29463
29463
|
base64Accum = b64str.slice(canBeDecoded);
|
|
29464
29464
|
b64str = b64str.slice(0, canBeDecoded);
|
|
29465
|
-
res += this.iconv.decode(
|
|
29465
|
+
res += this.iconv.decode(Buffer5.from(b64str, "base64"), "utf16-be");
|
|
29466
29466
|
}
|
|
29467
29467
|
this.inBase64 = inBase64;
|
|
29468
29468
|
this.base64Accum = base64Accum;
|
|
@@ -29471,7 +29471,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29471
29471
|
Utf7IMAPDecoder.prototype.end = function() {
|
|
29472
29472
|
var res = "";
|
|
29473
29473
|
if (this.inBase64 && this.base64Accum.length > 0) {
|
|
29474
|
-
res = this.iconv.decode(
|
|
29474
|
+
res = this.iconv.decode(Buffer5.from(this.base64Accum, "base64"), "utf16-be");
|
|
29475
29475
|
}
|
|
29476
29476
|
this.inBase64 = false;
|
|
29477
29477
|
this.base64Accum = "";
|
|
@@ -29481,7 +29481,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
29481
29481
|
|
|
29482
29482
|
// ../node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/encodings/sbcs-codec.js
|
|
29483
29483
|
var require_sbcs_codec = __commonJS((exports) => {
|
|
29484
|
-
var
|
|
29484
|
+
var Buffer5 = require_safer().Buffer;
|
|
29485
29485
|
exports._sbcs = SBCSCodec;
|
|
29486
29486
|
function SBCSCodec(codecOptions, iconv) {
|
|
29487
29487
|
if (!codecOptions) {
|
|
@@ -29497,8 +29497,8 @@ var require_sbcs_codec = __commonJS((exports) => {
|
|
|
29497
29497
|
}
|
|
29498
29498
|
codecOptions.chars = asciiString + codecOptions.chars;
|
|
29499
29499
|
}
|
|
29500
|
-
this.decodeBuf =
|
|
29501
|
-
var encodeBuf =
|
|
29500
|
+
this.decodeBuf = Buffer5.from(codecOptions.chars, "ucs2");
|
|
29501
|
+
var encodeBuf = Buffer5.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
|
|
29502
29502
|
for (var i = 0;i < codecOptions.chars.length; i++) {
|
|
29503
29503
|
encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
|
|
29504
29504
|
}
|
|
@@ -29510,7 +29510,7 @@ var require_sbcs_codec = __commonJS((exports) => {
|
|
|
29510
29510
|
this.encodeBuf = codec.encodeBuf;
|
|
29511
29511
|
}
|
|
29512
29512
|
SBCSEncoder.prototype.write = function(str) {
|
|
29513
|
-
var buf =
|
|
29513
|
+
var buf = Buffer5.alloc(str.length);
|
|
29514
29514
|
for (var i = 0;i < str.length; i++) {
|
|
29515
29515
|
buf[i] = this.encodeBuf[str.charCodeAt(i)];
|
|
29516
29516
|
}
|
|
@@ -29522,7 +29522,7 @@ var require_sbcs_codec = __commonJS((exports) => {
|
|
|
29522
29522
|
}
|
|
29523
29523
|
SBCSDecoder.prototype.write = function(buf) {
|
|
29524
29524
|
var decodeBuf = this.decodeBuf;
|
|
29525
|
-
var newBuf =
|
|
29525
|
+
var newBuf = Buffer5.alloc(buf.length * 2);
|
|
29526
29526
|
var idx1 = 0;
|
|
29527
29527
|
var idx2 = 0;
|
|
29528
29528
|
for (var i = 0;i < buf.length; i++) {
|
|
@@ -30143,7 +30143,7 @@ var require_sbcs_data_generated = __commonJS((exports, module) => {
|
|
|
30143
30143
|
|
|
30144
30144
|
// ../node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/encodings/dbcs-codec.js
|
|
30145
30145
|
var require_dbcs_codec = __commonJS((exports) => {
|
|
30146
|
-
var
|
|
30146
|
+
var Buffer5 = require_safer().Buffer;
|
|
30147
30147
|
exports._dbcs = DBCSCodec;
|
|
30148
30148
|
var UNASSIGNED = -1;
|
|
30149
30149
|
var GB18030_CODE = -2;
|
|
@@ -30382,7 +30382,7 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
30382
30382
|
this.gb18030 = codec.gb18030;
|
|
30383
30383
|
}
|
|
30384
30384
|
DBCSEncoder.prototype.write = function(str) {
|
|
30385
|
-
var newBuf =
|
|
30385
|
+
var newBuf = Buffer5.alloc(str.length * (this.gb18030 ? 4 : 3));
|
|
30386
30386
|
var leadSurrogate = this.leadSurrogate;
|
|
30387
30387
|
var seqObj = this.seqObj;
|
|
30388
30388
|
var nextChar = -1;
|
|
@@ -30486,7 +30486,7 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
30486
30486
|
if (this.leadSurrogate === -1 && this.seqObj === undefined) {
|
|
30487
30487
|
return;
|
|
30488
30488
|
}
|
|
30489
|
-
var newBuf =
|
|
30489
|
+
var newBuf = Buffer5.alloc(10);
|
|
30490
30490
|
var j = 0;
|
|
30491
30491
|
if (this.seqObj) {
|
|
30492
30492
|
var dbcsCode = this.seqObj[DEF_CHAR];
|
|
@@ -30516,7 +30516,7 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
30516
30516
|
this.gb18030 = codec.gb18030;
|
|
30517
30517
|
}
|
|
30518
30518
|
DBCSDecoder.prototype.write = function(buf) {
|
|
30519
|
-
var newBuf =
|
|
30519
|
+
var newBuf = Buffer5.alloc(buf.length * 2);
|
|
30520
30520
|
var nodeIdx = this.nodeIdx;
|
|
30521
30521
|
var prevBytes = this.prevBytes;
|
|
30522
30522
|
var prevOffset = this.prevBytes.length;
|
|
@@ -32026,7 +32026,7 @@ var require_encodings = __commonJS((exports, module) => {
|
|
|
32026
32026
|
|
|
32027
32027
|
// ../node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/lib/streams.js
|
|
32028
32028
|
var require_streams = __commonJS((exports, module) => {
|
|
32029
|
-
var
|
|
32029
|
+
var Buffer5 = require_safer().Buffer;
|
|
32030
32030
|
module.exports = function(streamModule) {
|
|
32031
32031
|
var Transform = streamModule.Transform;
|
|
32032
32032
|
function IconvLiteEncoderStream(conv, options) {
|
|
@@ -32068,7 +32068,7 @@ var require_streams = __commonJS((exports, module) => {
|
|
|
32068
32068
|
chunks.push(chunk);
|
|
32069
32069
|
});
|
|
32070
32070
|
this.on("end", function() {
|
|
32071
|
-
cb(null,
|
|
32071
|
+
cb(null, Buffer5.concat(chunks));
|
|
32072
32072
|
});
|
|
32073
32073
|
return this;
|
|
32074
32074
|
};
|
|
@@ -32082,7 +32082,7 @@ var require_streams = __commonJS((exports, module) => {
|
|
|
32082
32082
|
constructor: { value: IconvLiteDecoderStream }
|
|
32083
32083
|
});
|
|
32084
32084
|
IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
|
|
32085
|
-
if (!
|
|
32085
|
+
if (!Buffer5.isBuffer(chunk) && !(chunk instanceof Uint8Array)) {
|
|
32086
32086
|
return done(new Error("Iconv decoding stream needs buffers as its input."));
|
|
32087
32087
|
}
|
|
32088
32088
|
try {
|
|
@@ -32124,7 +32124,7 @@ var require_streams = __commonJS((exports, module) => {
|
|
|
32124
32124
|
|
|
32125
32125
|
// ../node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/lib/index.js
|
|
32126
32126
|
var require_lib3 = __commonJS((exports, module) => {
|
|
32127
|
-
var
|
|
32127
|
+
var Buffer5 = require_safer().Buffer;
|
|
32128
32128
|
var bomHandling = require_bom_handling();
|
|
32129
32129
|
var mergeModules = require_merge_exports();
|
|
32130
32130
|
var iconv = exports;
|
|
@@ -32136,7 +32136,7 @@ var require_lib3 = __commonJS((exports, module) => {
|
|
|
32136
32136
|
var encoder = iconv.getEncoder(encoding, options);
|
|
32137
32137
|
var res = encoder.write(str);
|
|
32138
32138
|
var trail = encoder.end();
|
|
32139
|
-
return trail && trail.length > 0 ?
|
|
32139
|
+
return trail && trail.length > 0 ? Buffer5.concat([res, trail]) : res;
|
|
32140
32140
|
};
|
|
32141
32141
|
iconv.decode = function decode(buf, encoding, options) {
|
|
32142
32142
|
if (typeof buf === "string") {
|
|
@@ -32144,7 +32144,7 @@ var require_lib3 = __commonJS((exports, module) => {
|
|
|
32144
32144
|
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
|
|
32145
32145
|
iconv.skipDecodeWarning = true;
|
|
32146
32146
|
}
|
|
32147
|
-
buf =
|
|
32147
|
+
buf = Buffer5.from("" + (buf || ""), "binary");
|
|
32148
32148
|
}
|
|
32149
32149
|
var decoder = iconv.getDecoder(encoding, options);
|
|
32150
32150
|
var res = decoder.write(buf);
|
|
@@ -32253,10 +32253,10 @@ var require_lib3 = __commonJS((exports, module) => {
|
|
|
32253
32253
|
var require_isFunction = __commonJS((exports) => {
|
|
32254
32254
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32255
32255
|
exports.isFunction = undefined;
|
|
32256
|
-
function
|
|
32256
|
+
function isFunction3(value) {
|
|
32257
32257
|
return typeof value === "function";
|
|
32258
32258
|
}
|
|
32259
|
-
exports.isFunction =
|
|
32259
|
+
exports.isFunction = isFunction3;
|
|
32260
32260
|
});
|
|
32261
32261
|
|
|
32262
32262
|
// ../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js
|
|
@@ -32856,10 +32856,10 @@ var require_observable = __commonJS((exports) => {
|
|
|
32856
32856
|
var require_identity = __commonJS((exports) => {
|
|
32857
32857
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32858
32858
|
exports.identity = undefined;
|
|
32859
|
-
function
|
|
32859
|
+
function identity3(x) {
|
|
32860
32860
|
return x;
|
|
32861
32861
|
}
|
|
32862
|
-
exports.identity =
|
|
32862
|
+
exports.identity = identity3;
|
|
32863
32863
|
});
|
|
32864
32864
|
|
|
32865
32865
|
// ../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/pipe.js
|
|
@@ -33313,7 +33313,7 @@ var require_animationFrames = __commonJS((exports) => {
|
|
|
33313
33313
|
function animationFramesFactory(timestampProvider) {
|
|
33314
33314
|
return new Observable_1.Observable(function(subscriber) {
|
|
33315
33315
|
var provider2 = timestampProvider || performanceTimestampProvider_1.performanceTimestampProvider;
|
|
33316
|
-
var
|
|
33316
|
+
var start4 = provider2.now();
|
|
33317
33317
|
var id = 0;
|
|
33318
33318
|
var run = function() {
|
|
33319
33319
|
if (!subscriber.closed) {
|
|
@@ -33322,7 +33322,7 @@ var require_animationFrames = __commonJS((exports) => {
|
|
|
33322
33322
|
var now = provider2.now();
|
|
33323
33323
|
subscriber.next({
|
|
33324
33324
|
timestamp: timestampProvider ? now : timestamp,
|
|
33325
|
-
elapsed: now -
|
|
33325
|
+
elapsed: now - start4
|
|
33326
33326
|
});
|
|
33327
33327
|
run();
|
|
33328
33328
|
});
|
|
@@ -35913,9 +35913,9 @@ var require_mapOneOrManyArgs = __commonJS((exports) => {
|
|
|
35913
35913
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35914
35914
|
exports.mapOneOrManyArgs = undefined;
|
|
35915
35915
|
var map_1 = require_map();
|
|
35916
|
-
var
|
|
35916
|
+
var isArray3 = Array.isArray;
|
|
35917
35917
|
function callOrApply(fn, args) {
|
|
35918
|
-
return
|
|
35918
|
+
return isArray3(args) ? fn.apply(undefined, __spreadArray([], __read(args))) : fn(args);
|
|
35919
35919
|
}
|
|
35920
35920
|
function mapOneOrManyArgs(fn) {
|
|
35921
35921
|
return map_1.map(function(args) {
|
|
@@ -36056,14 +36056,14 @@ var require_bindNodeCallback = __commonJS((exports) => {
|
|
|
36056
36056
|
var require_argsArgArrayOrObject = __commonJS((exports) => {
|
|
36057
36057
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36058
36058
|
exports.argsArgArrayOrObject = undefined;
|
|
36059
|
-
var
|
|
36059
|
+
var isArray3 = Array.isArray;
|
|
36060
36060
|
var getPrototypeOf = Object.getPrototypeOf;
|
|
36061
|
-
var
|
|
36061
|
+
var objectProto13 = Object.prototype;
|
|
36062
36062
|
var getKeys = Object.keys;
|
|
36063
36063
|
function argsArgArrayOrObject(args) {
|
|
36064
36064
|
if (args.length === 1) {
|
|
36065
36065
|
var first_1 = args[0];
|
|
36066
|
-
if (
|
|
36066
|
+
if (isArray3(first_1)) {
|
|
36067
36067
|
return { args: first_1, keys: null };
|
|
36068
36068
|
}
|
|
36069
36069
|
if (isPOJO(first_1)) {
|
|
@@ -36080,7 +36080,7 @@ var require_argsArgArrayOrObject = __commonJS((exports) => {
|
|
|
36080
36080
|
}
|
|
36081
36081
|
exports.argsArgArrayOrObject = argsArgArrayOrObject;
|
|
36082
36082
|
function isPOJO(obj) {
|
|
36083
|
-
return obj && typeof obj === "object" && getPrototypeOf(obj) ===
|
|
36083
|
+
return obj && typeof obj === "object" && getPrototypeOf(obj) === objectProto13;
|
|
36084
36084
|
}
|
|
36085
36085
|
});
|
|
36086
36086
|
|
|
@@ -36755,7 +36755,7 @@ var require_merge = __commonJS((exports) => {
|
|
|
36755
36755
|
var empty_1 = require_empty();
|
|
36756
36756
|
var args_1 = require_args();
|
|
36757
36757
|
var from_1 = require_from();
|
|
36758
|
-
function
|
|
36758
|
+
function merge3() {
|
|
36759
36759
|
var args = [];
|
|
36760
36760
|
for (var _i = 0;_i < arguments.length; _i++) {
|
|
36761
36761
|
args[_i] = arguments[_i];
|
|
@@ -36765,7 +36765,7 @@ var require_merge = __commonJS((exports) => {
|
|
|
36765
36765
|
var sources = args;
|
|
36766
36766
|
return !sources.length ? empty_1.EMPTY : sources.length === 1 ? innerFrom_1.innerFrom(sources[0]) : mergeAll_1.mergeAll(concurrent)(from_1.from(sources, scheduler));
|
|
36767
36767
|
}
|
|
36768
|
-
exports.merge =
|
|
36768
|
+
exports.merge = merge3;
|
|
36769
36769
|
});
|
|
36770
36770
|
|
|
36771
36771
|
// ../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/never.js
|
|
@@ -36785,9 +36785,9 @@ var require_never = __commonJS((exports) => {
|
|
|
36785
36785
|
var require_argsOrArgArray = __commonJS((exports) => {
|
|
36786
36786
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36787
36787
|
exports.argsOrArgArray = undefined;
|
|
36788
|
-
var
|
|
36788
|
+
var isArray3 = Array.isArray;
|
|
36789
36789
|
function argsOrArgArray(args) {
|
|
36790
|
-
return args.length === 1 &&
|
|
36790
|
+
return args.length === 1 && isArray3(args[0]) ? args[0] : args;
|
|
36791
36791
|
}
|
|
36792
36792
|
exports.argsOrArgArray = argsOrArgArray;
|
|
36793
36793
|
});
|
|
@@ -36929,17 +36929,17 @@ var require_range = __commonJS((exports) => {
|
|
|
36929
36929
|
exports.range = undefined;
|
|
36930
36930
|
var Observable_1 = require_Observable();
|
|
36931
36931
|
var empty_1 = require_empty();
|
|
36932
|
-
function range(
|
|
36932
|
+
function range(start4, count, scheduler) {
|
|
36933
36933
|
if (count == null) {
|
|
36934
|
-
count =
|
|
36935
|
-
|
|
36934
|
+
count = start4;
|
|
36935
|
+
start4 = 0;
|
|
36936
36936
|
}
|
|
36937
36937
|
if (count <= 0) {
|
|
36938
36938
|
return empty_1.EMPTY;
|
|
36939
36939
|
}
|
|
36940
|
-
var end = count +
|
|
36940
|
+
var end = count + start4;
|
|
36941
36941
|
return new Observable_1.Observable(scheduler ? function(subscriber) {
|
|
36942
|
-
var n =
|
|
36942
|
+
var n = start4;
|
|
36943
36943
|
return scheduler.schedule(function() {
|
|
36944
36944
|
if (n < end) {
|
|
36945
36945
|
subscriber.next(n++);
|
|
@@ -36949,7 +36949,7 @@ var require_range = __commonJS((exports) => {
|
|
|
36949
36949
|
}
|
|
36950
36950
|
});
|
|
36951
36951
|
} : function(subscriber) {
|
|
36952
|
-
var n =
|
|
36952
|
+
var n = start4;
|
|
36953
36953
|
while (n < end && !subscriber.closed) {
|
|
36954
36954
|
subscriber.next(n++);
|
|
36955
36955
|
}
|
|
@@ -37819,7 +37819,7 @@ var require_connect = __commonJS((exports) => {
|
|
|
37819
37819
|
return new Subject_1.Subject;
|
|
37820
37820
|
}
|
|
37821
37821
|
};
|
|
37822
|
-
function
|
|
37822
|
+
function connect3(selector, config2) {
|
|
37823
37823
|
if (config2 === undefined) {
|
|
37824
37824
|
config2 = DEFAULT_CONFIG;
|
|
37825
37825
|
}
|
|
@@ -37830,7 +37830,7 @@ var require_connect = __commonJS((exports) => {
|
|
|
37830
37830
|
subscriber.add(source.subscribe(subject));
|
|
37831
37831
|
});
|
|
37832
37832
|
}
|
|
37833
|
-
exports.connect =
|
|
37833
|
+
exports.connect = connect3;
|
|
37834
37834
|
});
|
|
37835
37835
|
|
|
37836
37836
|
// ../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/count.js
|
|
@@ -38728,7 +38728,7 @@ var require_merge3 = __commonJS((exports) => {
|
|
|
38728
38728
|
var mergeAll_1 = require_mergeAll();
|
|
38729
38729
|
var args_1 = require_args();
|
|
38730
38730
|
var from_1 = require_from();
|
|
38731
|
-
function
|
|
38731
|
+
function merge3() {
|
|
38732
38732
|
var args = [];
|
|
38733
38733
|
for (var _i = 0;_i < arguments.length; _i++) {
|
|
38734
38734
|
args[_i] = arguments[_i];
|
|
@@ -38739,7 +38739,7 @@ var require_merge3 = __commonJS((exports) => {
|
|
|
38739
38739
|
mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray([source], __read(args)), scheduler)).subscribe(subscriber);
|
|
38740
38740
|
});
|
|
38741
38741
|
}
|
|
38742
|
-
exports.merge =
|
|
38742
|
+
exports.merge = merge3;
|
|
38743
38743
|
});
|
|
38744
38744
|
|
|
38745
38745
|
// ../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeWith.js
|
|
@@ -48703,309 +48703,2005 @@ var restart2 = promisify2(pm22.restart).bind(pm22);
|
|
|
48703
48703
|
var reload = promisify2(pm22.reload).bind(pm22);
|
|
48704
48704
|
var deleteProcess2 = promisify2(pm22.delete).bind(pm22);
|
|
48705
48705
|
var list2 = promisify2(pm22.list).bind(pm22);
|
|
48706
|
-
// src/module/
|
|
48707
|
-
var import_fast_glob = __toESM(require_out4(), 1);
|
|
48706
|
+
// src/module/local-apps/src/modules/app-file.ts
|
|
48708
48707
|
import path5 from "node:path";
|
|
48709
48708
|
import fs6 from "node:fs";
|
|
48710
|
-
|
|
48711
|
-
|
|
48712
|
-
|
|
48713
|
-
|
|
48714
|
-
|
|
48715
|
-
|
|
48716
|
-
|
|
48717
|
-
|
|
48718
|
-
|
|
48719
|
-
|
|
48720
|
-
super({
|
|
48721
|
-
appsPath,
|
|
48722
|
-
configFilename: configFimename,
|
|
48723
|
-
mainApp
|
|
48724
|
-
});
|
|
48725
|
-
this.pagesPath = pagesPath;
|
|
48726
|
-
this.config = config;
|
|
48709
|
+
var getAppsPath2 = () => {
|
|
48710
|
+
const appsPath = process.env.APPS_PATH;
|
|
48711
|
+
if (appsPath) {
|
|
48712
|
+
const resolvePath = path5.resolve(appsPath);
|
|
48713
|
+
if (fileIsExist2(resolvePath)) {
|
|
48714
|
+
return resolvePath;
|
|
48715
|
+
} else {
|
|
48716
|
+
fs6.mkdirSync(resolvePath, { recursive: true });
|
|
48717
|
+
return resolvePath;
|
|
48718
|
+
}
|
|
48727
48719
|
}
|
|
48728
|
-
|
|
48729
|
-
|
|
48730
|
-
|
|
48731
|
-
|
|
48732
|
-
|
|
48733
|
-
|
|
48734
|
-
|
|
48735
|
-
|
|
48736
|
-
|
|
48737
|
-
|
|
48738
|
-
|
|
48739
|
-
app,
|
|
48740
|
-
version: content?.version,
|
|
48741
|
-
title: content?.title || "",
|
|
48742
|
-
description: content?.description || "",
|
|
48743
|
-
content
|
|
48744
|
-
};
|
|
48745
|
-
});
|
|
48746
|
-
return pagesParse;
|
|
48720
|
+
return useFileStore("apps", { needExists: true });
|
|
48721
|
+
};
|
|
48722
|
+
var loadAppInfo2 = async (appsPath = "apps", filename = "apps.config.json") => {
|
|
48723
|
+
let configFile = getConfigFile({
|
|
48724
|
+
cwd: appsPath,
|
|
48725
|
+
fileName: filename
|
|
48726
|
+
});
|
|
48727
|
+
if (!configFile) {
|
|
48728
|
+
configFile = path5.join(appsPath, "..", filename);
|
|
48729
|
+
fs6.writeFileSync(configFile, JSON.stringify({ list: [] }));
|
|
48730
|
+
return { list: [] };
|
|
48747
48731
|
}
|
|
48748
|
-
|
|
48749
|
-
const
|
|
48750
|
-
const
|
|
48751
|
-
|
|
48752
|
-
|
|
48753
|
-
|
|
48754
|
-
|
|
48755
|
-
|
|
48756
|
-
|
|
48757
|
-
|
|
48758
|
-
const contentStr = fs6.readFileSync(path5.join(root2, page), "utf-8");
|
|
48759
|
-
const content = parseIfJson(contentStr);
|
|
48760
|
-
if (!content.appType) {
|
|
48761
|
-
const isWeb = relativePath.startsWith("pages/");
|
|
48762
|
-
content.appType = isWeb ? "web" : "app";
|
|
48763
|
-
}
|
|
48764
|
-
return {
|
|
48765
|
-
...content,
|
|
48766
|
-
filepath: relativePath
|
|
48767
|
-
};
|
|
48768
|
-
});
|
|
48769
|
-
return pagesParse;
|
|
48732
|
+
try {
|
|
48733
|
+
const config = fs6.readFileSync(configFile, "utf-8");
|
|
48734
|
+
const v = JSON.parse(config);
|
|
48735
|
+
if (!v.list) {
|
|
48736
|
+
v.list = [];
|
|
48737
|
+
}
|
|
48738
|
+
return v;
|
|
48739
|
+
} catch (e) {
|
|
48740
|
+
console.error("读取配置文件失败", e.message);
|
|
48741
|
+
return { list: [] };
|
|
48770
48742
|
}
|
|
48771
|
-
}
|
|
48772
|
-
// ../node_modules/.pnpm/@kevisual+query@0.0.29_@kevisual+ws@8.0.0/node_modules/@kevisual/query/dist/query.js
|
|
48773
|
-
var isTextForContentType = (contentType) => {
|
|
48774
|
-
if (!contentType)
|
|
48775
|
-
return false;
|
|
48776
|
-
const textTypes = ["text/", "xml", "html", "javascript", "css", "csv", "plain", "x-www-form-urlencoded"];
|
|
48777
|
-
return textTypes.some((type) => contentType.includes(type));
|
|
48778
48743
|
};
|
|
48779
|
-
var
|
|
48780
|
-
const
|
|
48781
|
-
|
|
48782
|
-
|
|
48783
|
-
|
|
48784
|
-
|
|
48785
|
-
|
|
48786
|
-
|
|
48787
|
-
controller.abort();
|
|
48788
|
-
}, timeout);
|
|
48789
|
-
let method = overloadOpts?.method || opts?.method || "POST";
|
|
48790
|
-
let headers = { ...opts?.headers, ...overloadOpts?.headers };
|
|
48791
|
-
let origin = "";
|
|
48792
|
-
let url;
|
|
48793
|
-
if (opts?.url?.startsWith("http")) {
|
|
48794
|
-
url = new URL(opts.url);
|
|
48795
|
-
} else {
|
|
48796
|
-
origin = window?.location?.origin || "http://localhost:51015";
|
|
48797
|
-
url = new URL(opts.url, origin);
|
|
48798
|
-
}
|
|
48799
|
-
const isGet = method === "GET";
|
|
48800
|
-
if (isGet) {
|
|
48801
|
-
url.search = new URLSearchParams(opts.body).toString();
|
|
48744
|
+
var saveAppInfo2 = async (data, appsPath, filename = "apps.config.json") => {
|
|
48745
|
+
const configFile = getConfigFile({
|
|
48746
|
+
fileName: filename,
|
|
48747
|
+
cwd: appsPath
|
|
48748
|
+
});
|
|
48749
|
+
if (!configFile) {
|
|
48750
|
+
console.error("未找到配置文件");
|
|
48751
|
+
return;
|
|
48802
48752
|
}
|
|
48803
|
-
|
|
48804
|
-
|
|
48805
|
-
|
|
48806
|
-
|
|
48807
|
-
|
|
48808
|
-
|
|
48809
|
-
|
|
48810
|
-
"Content-Type": "application/json",
|
|
48811
|
-
...headers
|
|
48812
|
-
};
|
|
48813
|
-
body = JSON.stringify(opts.body);
|
|
48753
|
+
fs6.writeFileSync(configFile, JSON.stringify(data, null, 2));
|
|
48754
|
+
};
|
|
48755
|
+
var deleteFileAppInfo2 = async (key, appsPath) => {
|
|
48756
|
+
const normalizedKey = key.replace(/\//g, path5.sep);
|
|
48757
|
+
const directory = path5.join(appsPath, normalizedKey);
|
|
48758
|
+
if (!fileIsExist2(directory)) {
|
|
48759
|
+
return;
|
|
48814
48760
|
}
|
|
48815
|
-
|
|
48816
|
-
method: method.toUpperCase(),
|
|
48817
|
-
signal,
|
|
48818
|
-
body,
|
|
48819
|
-
...overloadOpts,
|
|
48820
|
-
headers
|
|
48821
|
-
}).then(async (response) => {
|
|
48822
|
-
const contentType = response.headers.get("Content-Type");
|
|
48823
|
-
if (isBlob) {
|
|
48824
|
-
return await response.blob();
|
|
48825
|
-
}
|
|
48826
|
-
const isJson = contentType && contentType.includes("application/json");
|
|
48827
|
-
if (isJson && !isText) {
|
|
48828
|
-
return await response.json();
|
|
48829
|
-
} else if (isTextForContentType(contentType)) {
|
|
48830
|
-
return {
|
|
48831
|
-
code: 200,
|
|
48832
|
-
status: response.status,
|
|
48833
|
-
data: await response.text()
|
|
48834
|
-
};
|
|
48835
|
-
} else {
|
|
48836
|
-
return response;
|
|
48837
|
-
}
|
|
48838
|
-
}).catch((err) => {
|
|
48839
|
-
if (err.name === "AbortError") {
|
|
48840
|
-
console.log("Request timed out and was aborted");
|
|
48841
|
-
}
|
|
48842
|
-
console.error(err);
|
|
48843
|
-
return {
|
|
48844
|
-
code: 500
|
|
48845
|
-
};
|
|
48846
|
-
}).finally(() => {
|
|
48847
|
-
clearTimeout(timer);
|
|
48848
|
-
});
|
|
48761
|
+
fs6.rmSync(directory, { recursive: true });
|
|
48849
48762
|
};
|
|
48850
|
-
|
|
48851
|
-
|
|
48852
|
-
|
|
48853
|
-
|
|
48854
|
-
|
|
48763
|
+
|
|
48764
|
+
// src/module/local-apps/src/modules/manager.ts
|
|
48765
|
+
import { fork as fork2 } from "node:child_process";
|
|
48766
|
+
|
|
48767
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
|
|
48768
|
+
var freeGlobal2 = typeof global == "object" && global && global.Object === Object && global;
|
|
48769
|
+
var _freeGlobal_default = freeGlobal2;
|
|
48770
|
+
|
|
48771
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js
|
|
48772
|
+
var freeSelf2 = typeof self == "object" && self && self.Object === Object && self;
|
|
48773
|
+
var root2 = _freeGlobal_default || freeSelf2 || Function("return this")();
|
|
48774
|
+
var _root_default = root2;
|
|
48775
|
+
|
|
48776
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
|
|
48777
|
+
var Symbol3 = _root_default.Symbol;
|
|
48778
|
+
var _Symbol_default = Symbol3;
|
|
48779
|
+
|
|
48780
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js
|
|
48781
|
+
var objectProto2 = Object.prototype;
|
|
48782
|
+
var hasOwnProperty2 = objectProto2.hasOwnProperty;
|
|
48783
|
+
var nativeObjectToString2 = objectProto2.toString;
|
|
48784
|
+
var symToStringTag2 = _Symbol_default ? _Symbol_default.toStringTag : undefined;
|
|
48785
|
+
function getRawTag2(value) {
|
|
48786
|
+
var isOwn = hasOwnProperty2.call(value, symToStringTag2), tag = value[symToStringTag2];
|
|
48787
|
+
try {
|
|
48788
|
+
value[symToStringTag2] = undefined;
|
|
48789
|
+
var unmasked = true;
|
|
48790
|
+
} catch (e) {}
|
|
48791
|
+
var result = nativeObjectToString2.call(value);
|
|
48792
|
+
if (unmasked) {
|
|
48793
|
+
if (isOwn) {
|
|
48794
|
+
value[symToStringTag2] = tag;
|
|
48795
|
+
} else {
|
|
48796
|
+
delete value[symToStringTag2];
|
|
48855
48797
|
}
|
|
48856
|
-
}
|
|
48857
|
-
return res;
|
|
48858
|
-
};
|
|
48859
|
-
var wrapperError = ({ code, message }) => {
|
|
48860
|
-
const result = {
|
|
48861
|
-
code: code || 500,
|
|
48862
|
-
success: false,
|
|
48863
|
-
message: message || "api request error",
|
|
48864
|
-
showError: (fn) => {},
|
|
48865
|
-
noMsg: true
|
|
48866
|
-
};
|
|
48798
|
+
}
|
|
48867
48799
|
return result;
|
|
48868
|
-
}
|
|
48800
|
+
}
|
|
48801
|
+
var _getRawTag_default = getRawTag2;
|
|
48869
48802
|
|
|
48870
|
-
|
|
48871
|
-
|
|
48872
|
-
|
|
48873
|
-
|
|
48874
|
-
|
|
48875
|
-
|
|
48876
|
-
|
|
48877
|
-
|
|
48878
|
-
|
|
48879
|
-
|
|
48880
|
-
|
|
48881
|
-
|
|
48882
|
-
|
|
48883
|
-
|
|
48884
|
-
|
|
48885
|
-
this.timeout = opts?.timeout || 60000 * 3;
|
|
48803
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js
|
|
48804
|
+
var objectProto3 = Object.prototype;
|
|
48805
|
+
var nativeObjectToString3 = objectProto3.toString;
|
|
48806
|
+
function objectToString2(value) {
|
|
48807
|
+
return nativeObjectToString3.call(value);
|
|
48808
|
+
}
|
|
48809
|
+
var _objectToString_default = objectToString2;
|
|
48810
|
+
|
|
48811
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js
|
|
48812
|
+
var nullTag2 = "[object Null]";
|
|
48813
|
+
var undefinedTag2 = "[object Undefined]";
|
|
48814
|
+
var symToStringTag3 = _Symbol_default ? _Symbol_default.toStringTag : undefined;
|
|
48815
|
+
function baseGetTag2(value) {
|
|
48816
|
+
if (value == null) {
|
|
48817
|
+
return value === undefined ? undefinedTag2 : nullTag2;
|
|
48886
48818
|
}
|
|
48887
|
-
|
|
48888
|
-
|
|
48819
|
+
return symToStringTag3 && symToStringTag3 in Object(value) ? _getRawTag_default(value) : _objectToString_default(value);
|
|
48820
|
+
}
|
|
48821
|
+
var _baseGetTag_default = baseGetTag2;
|
|
48822
|
+
|
|
48823
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
|
|
48824
|
+
function isObjectLike2(value) {
|
|
48825
|
+
return value != null && typeof value == "object";
|
|
48826
|
+
}
|
|
48827
|
+
var isObjectLike_default = isObjectLike2;
|
|
48828
|
+
|
|
48829
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
|
|
48830
|
+
var isArray2 = Array.isArray;
|
|
48831
|
+
var isArray_default = isArray2;
|
|
48832
|
+
|
|
48833
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js
|
|
48834
|
+
function isObject2(value) {
|
|
48835
|
+
var type = typeof value;
|
|
48836
|
+
return value != null && (type == "object" || type == "function");
|
|
48837
|
+
}
|
|
48838
|
+
var isObject_default = isObject2;
|
|
48839
|
+
|
|
48840
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js
|
|
48841
|
+
function identity2(value) {
|
|
48842
|
+
return value;
|
|
48843
|
+
}
|
|
48844
|
+
var identity_default = identity2;
|
|
48845
|
+
|
|
48846
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js
|
|
48847
|
+
var asyncTag2 = "[object AsyncFunction]";
|
|
48848
|
+
var funcTag2 = "[object Function]";
|
|
48849
|
+
var genTag2 = "[object GeneratorFunction]";
|
|
48850
|
+
var proxyTag2 = "[object Proxy]";
|
|
48851
|
+
function isFunction2(value) {
|
|
48852
|
+
if (!isObject_default(value)) {
|
|
48853
|
+
return false;
|
|
48889
48854
|
}
|
|
48890
|
-
|
|
48891
|
-
|
|
48855
|
+
var tag = _baseGetTag_default(value);
|
|
48856
|
+
return tag == funcTag2 || tag == genTag2 || tag == asyncTag2 || tag == proxyTag2;
|
|
48857
|
+
}
|
|
48858
|
+
var isFunction_default = isFunction2;
|
|
48859
|
+
|
|
48860
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js
|
|
48861
|
+
var coreJsData2 = _root_default["__core-js_shared__"];
|
|
48862
|
+
var _coreJsData_default = coreJsData2;
|
|
48863
|
+
|
|
48864
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js
|
|
48865
|
+
var maskSrcKey2 = function() {
|
|
48866
|
+
var uid = /[^.]+$/.exec(_coreJsData_default && _coreJsData_default.keys && _coreJsData_default.keys.IE_PROTO || "");
|
|
48867
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
48868
|
+
}();
|
|
48869
|
+
function isMasked2(func) {
|
|
48870
|
+
return !!maskSrcKey2 && maskSrcKey2 in func;
|
|
48871
|
+
}
|
|
48872
|
+
var _isMasked_default = isMasked2;
|
|
48873
|
+
|
|
48874
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js
|
|
48875
|
+
var funcProto2 = Function.prototype;
|
|
48876
|
+
var funcToString2 = funcProto2.toString;
|
|
48877
|
+
function toSource2(func) {
|
|
48878
|
+
if (func != null) {
|
|
48879
|
+
try {
|
|
48880
|
+
return funcToString2.call(func);
|
|
48881
|
+
} catch (e) {}
|
|
48882
|
+
try {
|
|
48883
|
+
return func + "";
|
|
48884
|
+
} catch (e) {}
|
|
48892
48885
|
}
|
|
48893
|
-
|
|
48894
|
-
|
|
48886
|
+
return "";
|
|
48887
|
+
}
|
|
48888
|
+
var _toSource_default = toSource2;
|
|
48889
|
+
|
|
48890
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js
|
|
48891
|
+
var reRegExpChar2 = /[\\^$.*+?()[\]{}|]/g;
|
|
48892
|
+
var reIsHostCtor2 = /^\[object .+?Constructor\]$/;
|
|
48893
|
+
var funcProto3 = Function.prototype;
|
|
48894
|
+
var objectProto4 = Object.prototype;
|
|
48895
|
+
var funcToString3 = funcProto3.toString;
|
|
48896
|
+
var hasOwnProperty3 = objectProto4.hasOwnProperty;
|
|
48897
|
+
var reIsNative2 = RegExp("^" + funcToString3.call(hasOwnProperty3).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
48898
|
+
function baseIsNative2(value) {
|
|
48899
|
+
if (!isObject_default(value) || _isMasked_default(value)) {
|
|
48900
|
+
return false;
|
|
48895
48901
|
}
|
|
48896
|
-
|
|
48897
|
-
|
|
48898
|
-
|
|
48899
|
-
|
|
48900
|
-
|
|
48901
|
-
|
|
48902
|
-
|
|
48903
|
-
|
|
48904
|
-
|
|
48905
|
-
|
|
48906
|
-
|
|
48907
|
-
|
|
48908
|
-
|
|
48909
|
-
|
|
48910
|
-
|
|
48911
|
-
|
|
48912
|
-
|
|
48913
|
-
|
|
48914
|
-
|
|
48915
|
-
|
|
48916
|
-
|
|
48917
|
-
|
|
48918
|
-
|
|
48919
|
-
|
|
48920
|
-
|
|
48921
|
-
}
|
|
48922
|
-
} catch (e) {
|
|
48923
|
-
console.error("request beforeFn error", e, req);
|
|
48924
|
-
return wrapperError({
|
|
48925
|
-
code: 500,
|
|
48926
|
-
message: "api request beforeFn error"
|
|
48927
|
-
});
|
|
48902
|
+
var pattern2 = isFunction_default(value) ? reIsNative2 : reIsHostCtor2;
|
|
48903
|
+
return pattern2.test(_toSource_default(value));
|
|
48904
|
+
}
|
|
48905
|
+
var _baseIsNative_default = baseIsNative2;
|
|
48906
|
+
|
|
48907
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js
|
|
48908
|
+
function getValue2(object, key) {
|
|
48909
|
+
return object == null ? undefined : object[key];
|
|
48910
|
+
}
|
|
48911
|
+
var _getValue_default = getValue2;
|
|
48912
|
+
|
|
48913
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js
|
|
48914
|
+
function getNative2(object, key) {
|
|
48915
|
+
var value = _getValue_default(object, key);
|
|
48916
|
+
return _baseIsNative_default(value) ? value : undefined;
|
|
48917
|
+
}
|
|
48918
|
+
var _getNative_default = getNative2;
|
|
48919
|
+
|
|
48920
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseCreate.js
|
|
48921
|
+
var objectCreate2 = Object.create;
|
|
48922
|
+
var baseCreate2 = function() {
|
|
48923
|
+
function object() {}
|
|
48924
|
+
return function(proto) {
|
|
48925
|
+
if (!isObject_default(proto)) {
|
|
48926
|
+
return {};
|
|
48928
48927
|
}
|
|
48929
|
-
if (
|
|
48930
|
-
|
|
48931
|
-
await new Promise((resolve) => {
|
|
48932
|
-
let timer = 0;
|
|
48933
|
-
const detect = setInterval(() => {
|
|
48934
|
-
if (!that.stop) {
|
|
48935
|
-
clearInterval(detect);
|
|
48936
|
-
resolve(true);
|
|
48937
|
-
}
|
|
48938
|
-
timer++;
|
|
48939
|
-
if (timer > 30) {
|
|
48940
|
-
console.error("request stop: timeout", req.url, timer);
|
|
48941
|
-
}
|
|
48942
|
-
}, 1000);
|
|
48943
|
-
});
|
|
48928
|
+
if (objectCreate2) {
|
|
48929
|
+
return objectCreate2(proto);
|
|
48944
48930
|
}
|
|
48945
|
-
|
|
48946
|
-
|
|
48947
|
-
|
|
48948
|
-
|
|
48949
|
-
|
|
48950
|
-
|
|
48951
|
-
|
|
48952
|
-
|
|
48953
|
-
|
|
48954
|
-
|
|
48955
|
-
|
|
48956
|
-
|
|
48957
|
-
|
|
48958
|
-
|
|
48959
|
-
|
|
48960
|
-
|
|
48961
|
-
|
|
48931
|
+
object.prototype = proto;
|
|
48932
|
+
var result = new object;
|
|
48933
|
+
object.prototype = undefined;
|
|
48934
|
+
return result;
|
|
48935
|
+
};
|
|
48936
|
+
}();
|
|
48937
|
+
var _baseCreate_default = baseCreate2;
|
|
48938
|
+
|
|
48939
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js
|
|
48940
|
+
function apply2(func, thisArg, args) {
|
|
48941
|
+
switch (args.length) {
|
|
48942
|
+
case 0:
|
|
48943
|
+
return func.call(thisArg);
|
|
48944
|
+
case 1:
|
|
48945
|
+
return func.call(thisArg, args[0]);
|
|
48946
|
+
case 2:
|
|
48947
|
+
return func.call(thisArg, args[0], args[1]);
|
|
48948
|
+
case 3:
|
|
48949
|
+
return func.call(thisArg, args[0], args[1], args[2]);
|
|
48950
|
+
}
|
|
48951
|
+
return func.apply(thisArg, args);
|
|
48952
|
+
}
|
|
48953
|
+
var _apply_default = apply2;
|
|
48954
|
+
|
|
48955
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyArray.js
|
|
48956
|
+
function copyArray2(source, array2) {
|
|
48957
|
+
var index = -1, length = source.length;
|
|
48958
|
+
array2 || (array2 = Array(length));
|
|
48959
|
+
while (++index < length) {
|
|
48960
|
+
array2[index] = source[index];
|
|
48961
|
+
}
|
|
48962
|
+
return array2;
|
|
48963
|
+
}
|
|
48964
|
+
var _copyArray_default = copyArray2;
|
|
48965
|
+
|
|
48966
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_shortOut.js
|
|
48967
|
+
var HOT_COUNT2 = 800;
|
|
48968
|
+
var HOT_SPAN2 = 16;
|
|
48969
|
+
var nativeNow2 = Date.now;
|
|
48970
|
+
function shortOut2(func) {
|
|
48971
|
+
var count = 0, lastCalled = 0;
|
|
48972
|
+
return function() {
|
|
48973
|
+
var stamp = nativeNow2(), remaining = HOT_SPAN2 - (stamp - lastCalled);
|
|
48974
|
+
lastCalled = stamp;
|
|
48975
|
+
if (remaining > 0) {
|
|
48976
|
+
if (++count >= HOT_COUNT2) {
|
|
48977
|
+
return arguments[0];
|
|
48962
48978
|
}
|
|
48979
|
+
} else {
|
|
48980
|
+
count = 0;
|
|
48981
|
+
}
|
|
48982
|
+
return func.apply(undefined, arguments);
|
|
48983
|
+
};
|
|
48984
|
+
}
|
|
48985
|
+
var _shortOut_default = shortOut2;
|
|
48986
|
+
|
|
48987
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/constant.js
|
|
48988
|
+
function constant2(value) {
|
|
48989
|
+
return function() {
|
|
48990
|
+
return value;
|
|
48991
|
+
};
|
|
48992
|
+
}
|
|
48993
|
+
var constant_default = constant2;
|
|
48994
|
+
|
|
48995
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_defineProperty.js
|
|
48996
|
+
var defineProperty2 = function() {
|
|
48997
|
+
try {
|
|
48998
|
+
var func = _getNative_default(Object, "defineProperty");
|
|
48999
|
+
func({}, "", {});
|
|
49000
|
+
return func;
|
|
49001
|
+
} catch (e) {}
|
|
49002
|
+
}();
|
|
49003
|
+
var _defineProperty_default = defineProperty2;
|
|
49004
|
+
|
|
49005
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSetToString.js
|
|
49006
|
+
var baseSetToString2 = !_defineProperty_default ? identity_default : function(func, string2) {
|
|
49007
|
+
return _defineProperty_default(func, "toString", {
|
|
49008
|
+
configurable: true,
|
|
49009
|
+
enumerable: false,
|
|
49010
|
+
value: constant_default(string2),
|
|
49011
|
+
writable: true
|
|
49012
|
+
});
|
|
49013
|
+
};
|
|
49014
|
+
var _baseSetToString_default = baseSetToString2;
|
|
49015
|
+
|
|
49016
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToString.js
|
|
49017
|
+
var setToString2 = _shortOut_default(_baseSetToString_default);
|
|
49018
|
+
var _setToString_default = setToString2;
|
|
49019
|
+
|
|
49020
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js
|
|
49021
|
+
var MAX_SAFE_INTEGER2 = 9007199254740991;
|
|
49022
|
+
var reIsUint2 = /^(?:0|[1-9]\d*)$/;
|
|
49023
|
+
function isIndex2(value, length) {
|
|
49024
|
+
var type = typeof value;
|
|
49025
|
+
length = length == null ? MAX_SAFE_INTEGER2 : length;
|
|
49026
|
+
return !!length && (type == "number" || type != "symbol" && reIsUint2.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
49027
|
+
}
|
|
49028
|
+
var _isIndex_default = isIndex2;
|
|
49029
|
+
|
|
49030
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignValue.js
|
|
49031
|
+
function baseAssignValue2(object, key, value) {
|
|
49032
|
+
if (key == "__proto__" && _defineProperty_default) {
|
|
49033
|
+
_defineProperty_default(object, key, {
|
|
49034
|
+
configurable: true,
|
|
49035
|
+
enumerable: true,
|
|
49036
|
+
value,
|
|
49037
|
+
writable: true
|
|
48963
49038
|
});
|
|
49039
|
+
} else {
|
|
49040
|
+
object[key] = value;
|
|
48964
49041
|
}
|
|
48965
|
-
|
|
48966
|
-
|
|
49042
|
+
}
|
|
49043
|
+
var _baseAssignValue_default = baseAssignValue2;
|
|
49044
|
+
|
|
49045
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js
|
|
49046
|
+
function eq2(value, other) {
|
|
49047
|
+
return value === other || value !== value && other !== other;
|
|
49048
|
+
}
|
|
49049
|
+
var eq_default = eq2;
|
|
49050
|
+
|
|
49051
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignValue.js
|
|
49052
|
+
var objectProto5 = Object.prototype;
|
|
49053
|
+
var hasOwnProperty4 = objectProto5.hasOwnProperty;
|
|
49054
|
+
function assignValue2(object, key, value) {
|
|
49055
|
+
var objValue = object[key];
|
|
49056
|
+
if (!(hasOwnProperty4.call(object, key) && eq_default(objValue, value)) || value === undefined && !(key in object)) {
|
|
49057
|
+
_baseAssignValue_default(object, key, value);
|
|
48967
49058
|
}
|
|
48968
|
-
|
|
48969
|
-
|
|
49059
|
+
}
|
|
49060
|
+
var _assignValue_default = assignValue2;
|
|
49061
|
+
|
|
49062
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyObject.js
|
|
49063
|
+
function copyObject2(source, props, object, customizer) {
|
|
49064
|
+
var isNew = !object;
|
|
49065
|
+
object || (object = {});
|
|
49066
|
+
var index = -1, length = props.length;
|
|
49067
|
+
while (++index < length) {
|
|
49068
|
+
var key = props[index];
|
|
49069
|
+
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
|
|
49070
|
+
if (newValue === undefined) {
|
|
49071
|
+
newValue = source[key];
|
|
49072
|
+
}
|
|
49073
|
+
if (isNew) {
|
|
49074
|
+
_baseAssignValue_default(object, key, newValue);
|
|
49075
|
+
} else {
|
|
49076
|
+
_assignValue_default(object, key, newValue);
|
|
49077
|
+
}
|
|
48970
49078
|
}
|
|
48971
|
-
|
|
48972
|
-
|
|
48973
|
-
|
|
48974
|
-
|
|
49079
|
+
return object;
|
|
49080
|
+
}
|
|
49081
|
+
var _copyObject_default = copyObject2;
|
|
49082
|
+
|
|
49083
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overRest.js
|
|
49084
|
+
var nativeMax2 = Math.max;
|
|
49085
|
+
function overRest2(func, start3, transform) {
|
|
49086
|
+
start3 = nativeMax2(start3 === undefined ? func.length - 1 : start3, 0);
|
|
49087
|
+
return function() {
|
|
49088
|
+
var args = arguments, index = -1, length = nativeMax2(args.length - start3, 0), array2 = Array(length);
|
|
49089
|
+
while (++index < length) {
|
|
49090
|
+
array2[index] = args[start3 + index];
|
|
48975
49091
|
}
|
|
48976
|
-
|
|
48977
|
-
|
|
49092
|
+
index = -1;
|
|
49093
|
+
var otherArgs = Array(start3 + 1);
|
|
49094
|
+
while (++index < start3) {
|
|
49095
|
+
otherArgs[index] = args[index];
|
|
48978
49096
|
}
|
|
48979
|
-
|
|
48980
|
-
|
|
48981
|
-
|
|
48982
|
-
|
|
48983
|
-
|
|
48984
|
-
|
|
49097
|
+
otherArgs[start3] = transform(array2);
|
|
49098
|
+
return _apply_default(func, this, otherArgs);
|
|
49099
|
+
};
|
|
49100
|
+
}
|
|
49101
|
+
var _overRest_default = overRest2;
|
|
49102
|
+
|
|
49103
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRest.js
|
|
49104
|
+
function baseRest2(func, start3) {
|
|
49105
|
+
return _setToString_default(_overRest_default(func, start3, identity_default), func + "");
|
|
49106
|
+
}
|
|
49107
|
+
var _baseRest_default = baseRest2;
|
|
49108
|
+
|
|
49109
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js
|
|
49110
|
+
var MAX_SAFE_INTEGER3 = 9007199254740991;
|
|
49111
|
+
function isLength2(value) {
|
|
49112
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER3;
|
|
49113
|
+
}
|
|
49114
|
+
var isLength_default = isLength2;
|
|
49115
|
+
|
|
49116
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js
|
|
49117
|
+
function isArrayLike2(value) {
|
|
49118
|
+
return value != null && isLength_default(value.length) && !isFunction_default(value);
|
|
49119
|
+
}
|
|
49120
|
+
var isArrayLike_default = isArrayLike2;
|
|
49121
|
+
|
|
49122
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIterateeCall.js
|
|
49123
|
+
function isIterateeCall2(value, index, object) {
|
|
49124
|
+
if (!isObject_default(object)) {
|
|
49125
|
+
return false;
|
|
49126
|
+
}
|
|
49127
|
+
var type = typeof index;
|
|
49128
|
+
if (type == "number" ? isArrayLike_default(object) && _isIndex_default(index, object.length) : type == "string" && (index in object)) {
|
|
49129
|
+
return eq_default(object[index], value);
|
|
49130
|
+
}
|
|
49131
|
+
return false;
|
|
49132
|
+
}
|
|
49133
|
+
var _isIterateeCall_default = isIterateeCall2;
|
|
49134
|
+
|
|
49135
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAssigner.js
|
|
49136
|
+
function createAssigner2(assigner) {
|
|
49137
|
+
return _baseRest_default(function(object, sources) {
|
|
49138
|
+
var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined;
|
|
49139
|
+
customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined;
|
|
49140
|
+
if (guard && _isIterateeCall_default(sources[0], sources[1], guard)) {
|
|
49141
|
+
customizer = length < 3 ? undefined : customizer;
|
|
49142
|
+
length = 1;
|
|
49143
|
+
}
|
|
49144
|
+
object = Object(object);
|
|
49145
|
+
while (++index < length) {
|
|
49146
|
+
var source = sources[index];
|
|
49147
|
+
if (source) {
|
|
49148
|
+
assigner(object, source, index, customizer);
|
|
48985
49149
|
}
|
|
48986
|
-
}
|
|
48987
|
-
return
|
|
49150
|
+
}
|
|
49151
|
+
return object;
|
|
49152
|
+
});
|
|
49153
|
+
}
|
|
49154
|
+
var _createAssigner_default = createAssigner2;
|
|
49155
|
+
|
|
49156
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js
|
|
49157
|
+
var objectProto6 = Object.prototype;
|
|
49158
|
+
function isPrototype2(value) {
|
|
49159
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto6;
|
|
49160
|
+
return value === proto;
|
|
49161
|
+
}
|
|
49162
|
+
var _isPrototype_default = isPrototype2;
|
|
49163
|
+
|
|
49164
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js
|
|
49165
|
+
function baseTimes2(n, iteratee) {
|
|
49166
|
+
var index = -1, result = Array(n);
|
|
49167
|
+
while (++index < n) {
|
|
49168
|
+
result[index] = iteratee(index);
|
|
48988
49169
|
}
|
|
49170
|
+
return result;
|
|
48989
49171
|
}
|
|
48990
|
-
|
|
48991
|
-
|
|
48992
|
-
|
|
48993
|
-
var
|
|
48994
|
-
|
|
48995
|
-
|
|
49172
|
+
var _baseTimes_default = baseTimes2;
|
|
49173
|
+
|
|
49174
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js
|
|
49175
|
+
var argsTag2 = "[object Arguments]";
|
|
49176
|
+
function baseIsArguments2(value) {
|
|
49177
|
+
return isObjectLike_default(value) && _baseGetTag_default(value) == argsTag2;
|
|
49178
|
+
}
|
|
49179
|
+
var _baseIsArguments_default = baseIsArguments2;
|
|
49180
|
+
|
|
49181
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js
|
|
49182
|
+
var objectProto7 = Object.prototype;
|
|
49183
|
+
var hasOwnProperty5 = objectProto7.hasOwnProperty;
|
|
49184
|
+
var propertyIsEnumerable2 = objectProto7.propertyIsEnumerable;
|
|
49185
|
+
var isArguments2 = _baseIsArguments_default(function() {
|
|
49186
|
+
return arguments;
|
|
49187
|
+
}()) ? _baseIsArguments_default : function(value) {
|
|
49188
|
+
return isObjectLike_default(value) && hasOwnProperty5.call(value, "callee") && !propertyIsEnumerable2.call(value, "callee");
|
|
49189
|
+
};
|
|
49190
|
+
var isArguments_default = isArguments2;
|
|
49191
|
+
|
|
49192
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js
|
|
49193
|
+
var exports_isBuffer = {};
|
|
49194
|
+
__export(exports_isBuffer, {
|
|
49195
|
+
default: () => isBuffer_default
|
|
48996
49196
|
});
|
|
48997
49197
|
|
|
48998
|
-
//
|
|
48999
|
-
|
|
49000
|
-
|
|
49001
|
-
|
|
49002
|
-
|
|
49198
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js
|
|
49199
|
+
function stubFalse2() {
|
|
49200
|
+
return false;
|
|
49201
|
+
}
|
|
49202
|
+
var stubFalse_default = stubFalse2;
|
|
49203
|
+
|
|
49204
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js
|
|
49205
|
+
var freeExports2 = typeof exports_isBuffer == "object" && exports_isBuffer && !exports_isBuffer.nodeType && exports_isBuffer;
|
|
49206
|
+
var freeModule2 = freeExports2 && typeof module_isBuffer == "object" && module_isBuffer && !module_isBuffer.nodeType && module_isBuffer;
|
|
49207
|
+
var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
|
|
49208
|
+
var Buffer3 = moduleExports2 ? _root_default.Buffer : undefined;
|
|
49209
|
+
var nativeIsBuffer2 = Buffer3 ? Buffer3.isBuffer : undefined;
|
|
49210
|
+
var isBuffer2 = nativeIsBuffer2 || stubFalse_default;
|
|
49211
|
+
var isBuffer_default = isBuffer2;
|
|
49212
|
+
|
|
49213
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsTypedArray.js
|
|
49214
|
+
var argsTag3 = "[object Arguments]";
|
|
49215
|
+
var arrayTag2 = "[object Array]";
|
|
49216
|
+
var boolTag2 = "[object Boolean]";
|
|
49217
|
+
var dateTag2 = "[object Date]";
|
|
49218
|
+
var errorTag2 = "[object Error]";
|
|
49219
|
+
var funcTag3 = "[object Function]";
|
|
49220
|
+
var mapTag2 = "[object Map]";
|
|
49221
|
+
var numberTag2 = "[object Number]";
|
|
49222
|
+
var objectTag2 = "[object Object]";
|
|
49223
|
+
var regexpTag2 = "[object RegExp]";
|
|
49224
|
+
var setTag2 = "[object Set]";
|
|
49225
|
+
var stringTag2 = "[object String]";
|
|
49226
|
+
var weakMapTag2 = "[object WeakMap]";
|
|
49227
|
+
var arrayBufferTag2 = "[object ArrayBuffer]";
|
|
49228
|
+
var dataViewTag2 = "[object DataView]";
|
|
49229
|
+
var float32Tag2 = "[object Float32Array]";
|
|
49230
|
+
var float64Tag2 = "[object Float64Array]";
|
|
49231
|
+
var int8Tag2 = "[object Int8Array]";
|
|
49232
|
+
var int16Tag2 = "[object Int16Array]";
|
|
49233
|
+
var int32Tag2 = "[object Int32Array]";
|
|
49234
|
+
var uint8Tag2 = "[object Uint8Array]";
|
|
49235
|
+
var uint8ClampedTag2 = "[object Uint8ClampedArray]";
|
|
49236
|
+
var uint16Tag2 = "[object Uint16Array]";
|
|
49237
|
+
var uint32Tag2 = "[object Uint32Array]";
|
|
49238
|
+
var typedArrayTags2 = {};
|
|
49239
|
+
typedArrayTags2[float32Tag2] = typedArrayTags2[float64Tag2] = typedArrayTags2[int8Tag2] = typedArrayTags2[int16Tag2] = typedArrayTags2[int32Tag2] = typedArrayTags2[uint8Tag2] = typedArrayTags2[uint8ClampedTag2] = typedArrayTags2[uint16Tag2] = typedArrayTags2[uint32Tag2] = true;
|
|
49240
|
+
typedArrayTags2[argsTag3] = typedArrayTags2[arrayTag2] = typedArrayTags2[arrayBufferTag2] = typedArrayTags2[boolTag2] = typedArrayTags2[dataViewTag2] = typedArrayTags2[dateTag2] = typedArrayTags2[errorTag2] = typedArrayTags2[funcTag3] = typedArrayTags2[mapTag2] = typedArrayTags2[numberTag2] = typedArrayTags2[objectTag2] = typedArrayTags2[regexpTag2] = typedArrayTags2[setTag2] = typedArrayTags2[stringTag2] = typedArrayTags2[weakMapTag2] = false;
|
|
49241
|
+
function baseIsTypedArray2(value) {
|
|
49242
|
+
return isObjectLike_default(value) && isLength_default(value.length) && !!typedArrayTags2[_baseGetTag_default(value)];
|
|
49243
|
+
}
|
|
49244
|
+
var _baseIsTypedArray_default = baseIsTypedArray2;
|
|
49245
|
+
|
|
49246
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js
|
|
49247
|
+
function baseUnary2(func) {
|
|
49248
|
+
return function(value) {
|
|
49249
|
+
return func(value);
|
|
49250
|
+
};
|
|
49251
|
+
}
|
|
49252
|
+
var _baseUnary_default = baseUnary2;
|
|
49253
|
+
|
|
49254
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js
|
|
49255
|
+
var exports__nodeUtil = {};
|
|
49256
|
+
__export(exports__nodeUtil, {
|
|
49257
|
+
default: () => _nodeUtil_default
|
|
49258
|
+
});
|
|
49259
|
+
var freeExports3 = typeof exports__nodeUtil == "object" && exports__nodeUtil && !exports__nodeUtil.nodeType && exports__nodeUtil;
|
|
49260
|
+
var freeModule3 = freeExports3 && typeof module__nodeUtil == "object" && module__nodeUtil && !module__nodeUtil.nodeType && module__nodeUtil;
|
|
49261
|
+
var moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
|
|
49262
|
+
var freeProcess2 = moduleExports3 && _freeGlobal_default.process;
|
|
49263
|
+
var nodeUtil2 = function() {
|
|
49264
|
+
try {
|
|
49265
|
+
var types = freeModule3 && freeModule3.require && freeModule3.require("util").types;
|
|
49266
|
+
if (types) {
|
|
49267
|
+
return types;
|
|
49268
|
+
}
|
|
49269
|
+
return freeProcess2 && freeProcess2.binding && freeProcess2.binding("util");
|
|
49270
|
+
} catch (e) {}
|
|
49271
|
+
}();
|
|
49272
|
+
var _nodeUtil_default = nodeUtil2;
|
|
49273
|
+
|
|
49274
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js
|
|
49275
|
+
var nodeIsTypedArray2 = _nodeUtil_default && _nodeUtil_default.isTypedArray;
|
|
49276
|
+
var isTypedArray2 = nodeIsTypedArray2 ? _baseUnary_default(nodeIsTypedArray2) : _baseIsTypedArray_default;
|
|
49277
|
+
var isTypedArray_default = isTypedArray2;
|
|
49278
|
+
|
|
49279
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayLikeKeys.js
|
|
49280
|
+
var objectProto8 = Object.prototype;
|
|
49281
|
+
var hasOwnProperty6 = objectProto8.hasOwnProperty;
|
|
49282
|
+
function arrayLikeKeys2(value, inherited) {
|
|
49283
|
+
var isArr = isArray_default(value), isArg = !isArr && isArguments_default(value), isBuff = !isArr && !isArg && isBuffer_default(value), isType = !isArr && !isArg && !isBuff && isTypedArray_default(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? _baseTimes_default(value.length, String) : [], length = result.length;
|
|
49284
|
+
for (var key in value) {
|
|
49285
|
+
if ((inherited || hasOwnProperty6.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || _isIndex_default(key, length)))) {
|
|
49286
|
+
result.push(key);
|
|
49287
|
+
}
|
|
49288
|
+
}
|
|
49289
|
+
return result;
|
|
49290
|
+
}
|
|
49291
|
+
var _arrayLikeKeys_default = arrayLikeKeys2;
|
|
49292
|
+
|
|
49293
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js
|
|
49294
|
+
function overArg2(func, transform) {
|
|
49295
|
+
return function(arg) {
|
|
49296
|
+
return func(transform(arg));
|
|
49297
|
+
};
|
|
49298
|
+
}
|
|
49299
|
+
var _overArg_default = overArg2;
|
|
49300
|
+
|
|
49301
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeysIn.js
|
|
49302
|
+
function nativeKeysIn2(object) {
|
|
49303
|
+
var result = [];
|
|
49304
|
+
if (object != null) {
|
|
49305
|
+
for (var key in Object(object)) {
|
|
49306
|
+
result.push(key);
|
|
49307
|
+
}
|
|
49308
|
+
}
|
|
49309
|
+
return result;
|
|
49310
|
+
}
|
|
49311
|
+
var _nativeKeysIn_default = nativeKeysIn2;
|
|
49312
|
+
|
|
49313
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeysIn.js
|
|
49314
|
+
var objectProto9 = Object.prototype;
|
|
49315
|
+
var hasOwnProperty7 = objectProto9.hasOwnProperty;
|
|
49316
|
+
function baseKeysIn2(object) {
|
|
49317
|
+
if (!isObject_default(object)) {
|
|
49318
|
+
return _nativeKeysIn_default(object);
|
|
49319
|
+
}
|
|
49320
|
+
var isProto = _isPrototype_default(object), result = [];
|
|
49321
|
+
for (var key in object) {
|
|
49322
|
+
if (!(key == "constructor" && (isProto || !hasOwnProperty7.call(object, key)))) {
|
|
49323
|
+
result.push(key);
|
|
49324
|
+
}
|
|
49325
|
+
}
|
|
49326
|
+
return result;
|
|
49327
|
+
}
|
|
49328
|
+
var _baseKeysIn_default = baseKeysIn2;
|
|
49329
|
+
|
|
49330
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keysIn.js
|
|
49331
|
+
function keysIn2(object) {
|
|
49332
|
+
return isArrayLike_default(object) ? _arrayLikeKeys_default(object, true) : _baseKeysIn_default(object);
|
|
49333
|
+
}
|
|
49334
|
+
var keysIn_default = keysIn2;
|
|
49335
|
+
|
|
49336
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js
|
|
49337
|
+
var nativeCreate2 = _getNative_default(Object, "create");
|
|
49338
|
+
var _nativeCreate_default = nativeCreate2;
|
|
49339
|
+
|
|
49340
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js
|
|
49341
|
+
function hashClear2() {
|
|
49342
|
+
this.__data__ = _nativeCreate_default ? _nativeCreate_default(null) : {};
|
|
49343
|
+
this.size = 0;
|
|
49344
|
+
}
|
|
49345
|
+
var _hashClear_default = hashClear2;
|
|
49346
|
+
|
|
49347
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js
|
|
49348
|
+
function hashDelete2(key) {
|
|
49349
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
49350
|
+
this.size -= result ? 1 : 0;
|
|
49351
|
+
return result;
|
|
49352
|
+
}
|
|
49353
|
+
var _hashDelete_default = hashDelete2;
|
|
49354
|
+
|
|
49355
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js
|
|
49356
|
+
var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
|
|
49357
|
+
var objectProto10 = Object.prototype;
|
|
49358
|
+
var hasOwnProperty8 = objectProto10.hasOwnProperty;
|
|
49359
|
+
function hashGet2(key) {
|
|
49360
|
+
var data = this.__data__;
|
|
49361
|
+
if (_nativeCreate_default) {
|
|
49362
|
+
var result = data[key];
|
|
49363
|
+
return result === HASH_UNDEFINED2 ? undefined : result;
|
|
49364
|
+
}
|
|
49365
|
+
return hasOwnProperty8.call(data, key) ? data[key] : undefined;
|
|
49366
|
+
}
|
|
49367
|
+
var _hashGet_default = hashGet2;
|
|
49368
|
+
|
|
49369
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js
|
|
49370
|
+
var objectProto11 = Object.prototype;
|
|
49371
|
+
var hasOwnProperty9 = objectProto11.hasOwnProperty;
|
|
49372
|
+
function hashHas2(key) {
|
|
49373
|
+
var data = this.__data__;
|
|
49374
|
+
return _nativeCreate_default ? data[key] !== undefined : hasOwnProperty9.call(data, key);
|
|
49375
|
+
}
|
|
49376
|
+
var _hashHas_default = hashHas2;
|
|
49377
|
+
|
|
49378
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js
|
|
49379
|
+
var HASH_UNDEFINED3 = "__lodash_hash_undefined__";
|
|
49380
|
+
function hashSet2(key, value) {
|
|
49381
|
+
var data = this.__data__;
|
|
49382
|
+
this.size += this.has(key) ? 0 : 1;
|
|
49383
|
+
data[key] = _nativeCreate_default && value === undefined ? HASH_UNDEFINED3 : value;
|
|
49384
|
+
return this;
|
|
49385
|
+
}
|
|
49386
|
+
var _hashSet_default = hashSet2;
|
|
49387
|
+
|
|
49388
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js
|
|
49389
|
+
function Hash2(entries) {
|
|
49390
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
49391
|
+
this.clear();
|
|
49392
|
+
while (++index < length) {
|
|
49393
|
+
var entry2 = entries[index];
|
|
49394
|
+
this.set(entry2[0], entry2[1]);
|
|
49395
|
+
}
|
|
49396
|
+
}
|
|
49397
|
+
Hash2.prototype.clear = _hashClear_default;
|
|
49398
|
+
Hash2.prototype["delete"] = _hashDelete_default;
|
|
49399
|
+
Hash2.prototype.get = _hashGet_default;
|
|
49400
|
+
Hash2.prototype.has = _hashHas_default;
|
|
49401
|
+
Hash2.prototype.set = _hashSet_default;
|
|
49402
|
+
var _Hash_default = Hash2;
|
|
49403
|
+
|
|
49404
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js
|
|
49405
|
+
function listCacheClear2() {
|
|
49406
|
+
this.__data__ = [];
|
|
49407
|
+
this.size = 0;
|
|
49408
|
+
}
|
|
49409
|
+
var _listCacheClear_default = listCacheClear2;
|
|
49410
|
+
|
|
49411
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js
|
|
49412
|
+
function assocIndexOf2(array2, key) {
|
|
49413
|
+
var length = array2.length;
|
|
49414
|
+
while (length--) {
|
|
49415
|
+
if (eq_default(array2[length][0], key)) {
|
|
49416
|
+
return length;
|
|
49417
|
+
}
|
|
49418
|
+
}
|
|
49419
|
+
return -1;
|
|
49420
|
+
}
|
|
49421
|
+
var _assocIndexOf_default = assocIndexOf2;
|
|
49422
|
+
|
|
49423
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js
|
|
49424
|
+
var arrayProto2 = Array.prototype;
|
|
49425
|
+
var splice2 = arrayProto2.splice;
|
|
49426
|
+
function listCacheDelete2(key) {
|
|
49427
|
+
var data = this.__data__, index = _assocIndexOf_default(data, key);
|
|
49428
|
+
if (index < 0) {
|
|
49429
|
+
return false;
|
|
49430
|
+
}
|
|
49431
|
+
var lastIndex = data.length - 1;
|
|
49432
|
+
if (index == lastIndex) {
|
|
49433
|
+
data.pop();
|
|
49434
|
+
} else {
|
|
49435
|
+
splice2.call(data, index, 1);
|
|
49436
|
+
}
|
|
49437
|
+
--this.size;
|
|
49438
|
+
return true;
|
|
49439
|
+
}
|
|
49440
|
+
var _listCacheDelete_default = listCacheDelete2;
|
|
49441
|
+
|
|
49442
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js
|
|
49443
|
+
function listCacheGet2(key) {
|
|
49444
|
+
var data = this.__data__, index = _assocIndexOf_default(data, key);
|
|
49445
|
+
return index < 0 ? undefined : data[index][1];
|
|
49446
|
+
}
|
|
49447
|
+
var _listCacheGet_default = listCacheGet2;
|
|
49448
|
+
|
|
49449
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js
|
|
49450
|
+
function listCacheHas2(key) {
|
|
49451
|
+
return _assocIndexOf_default(this.__data__, key) > -1;
|
|
49452
|
+
}
|
|
49453
|
+
var _listCacheHas_default = listCacheHas2;
|
|
49454
|
+
|
|
49455
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js
|
|
49456
|
+
function listCacheSet2(key, value) {
|
|
49457
|
+
var data = this.__data__, index = _assocIndexOf_default(data, key);
|
|
49458
|
+
if (index < 0) {
|
|
49459
|
+
++this.size;
|
|
49460
|
+
data.push([key, value]);
|
|
49461
|
+
} else {
|
|
49462
|
+
data[index][1] = value;
|
|
49463
|
+
}
|
|
49464
|
+
return this;
|
|
49465
|
+
}
|
|
49466
|
+
var _listCacheSet_default = listCacheSet2;
|
|
49467
|
+
|
|
49468
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js
|
|
49469
|
+
function ListCache2(entries) {
|
|
49470
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
49471
|
+
this.clear();
|
|
49472
|
+
while (++index < length) {
|
|
49473
|
+
var entry2 = entries[index];
|
|
49474
|
+
this.set(entry2[0], entry2[1]);
|
|
49475
|
+
}
|
|
49476
|
+
}
|
|
49477
|
+
ListCache2.prototype.clear = _listCacheClear_default;
|
|
49478
|
+
ListCache2.prototype["delete"] = _listCacheDelete_default;
|
|
49479
|
+
ListCache2.prototype.get = _listCacheGet_default;
|
|
49480
|
+
ListCache2.prototype.has = _listCacheHas_default;
|
|
49481
|
+
ListCache2.prototype.set = _listCacheSet_default;
|
|
49482
|
+
var _ListCache_default = ListCache2;
|
|
49483
|
+
|
|
49484
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js
|
|
49485
|
+
var Map2 = _getNative_default(_root_default, "Map");
|
|
49486
|
+
var _Map_default = Map2;
|
|
49487
|
+
|
|
49488
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js
|
|
49489
|
+
function mapCacheClear2() {
|
|
49490
|
+
this.size = 0;
|
|
49491
|
+
this.__data__ = {
|
|
49492
|
+
hash: new _Hash_default,
|
|
49493
|
+
map: new (_Map_default || _ListCache_default),
|
|
49494
|
+
string: new _Hash_default
|
|
49495
|
+
};
|
|
49496
|
+
}
|
|
49497
|
+
var _mapCacheClear_default = mapCacheClear2;
|
|
49498
|
+
|
|
49499
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js
|
|
49500
|
+
function isKeyable2(value) {
|
|
49501
|
+
var type = typeof value;
|
|
49502
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
49503
|
+
}
|
|
49504
|
+
var _isKeyable_default = isKeyable2;
|
|
49505
|
+
|
|
49506
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js
|
|
49507
|
+
function getMapData2(map, key) {
|
|
49508
|
+
var data = map.__data__;
|
|
49509
|
+
return _isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
49510
|
+
}
|
|
49511
|
+
var _getMapData_default = getMapData2;
|
|
49512
|
+
|
|
49513
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js
|
|
49514
|
+
function mapCacheDelete2(key) {
|
|
49515
|
+
var result = _getMapData_default(this, key)["delete"](key);
|
|
49516
|
+
this.size -= result ? 1 : 0;
|
|
49517
|
+
return result;
|
|
49518
|
+
}
|
|
49519
|
+
var _mapCacheDelete_default = mapCacheDelete2;
|
|
49520
|
+
|
|
49521
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js
|
|
49522
|
+
function mapCacheGet2(key) {
|
|
49523
|
+
return _getMapData_default(this, key).get(key);
|
|
49524
|
+
}
|
|
49525
|
+
var _mapCacheGet_default = mapCacheGet2;
|
|
49526
|
+
|
|
49527
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js
|
|
49528
|
+
function mapCacheHas2(key) {
|
|
49529
|
+
return _getMapData_default(this, key).has(key);
|
|
49530
|
+
}
|
|
49531
|
+
var _mapCacheHas_default = mapCacheHas2;
|
|
49532
|
+
|
|
49533
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js
|
|
49534
|
+
function mapCacheSet2(key, value) {
|
|
49535
|
+
var data = _getMapData_default(this, key), size = data.size;
|
|
49536
|
+
data.set(key, value);
|
|
49537
|
+
this.size += data.size == size ? 0 : 1;
|
|
49538
|
+
return this;
|
|
49539
|
+
}
|
|
49540
|
+
var _mapCacheSet_default = mapCacheSet2;
|
|
49541
|
+
|
|
49542
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js
|
|
49543
|
+
function MapCache2(entries) {
|
|
49544
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
49545
|
+
this.clear();
|
|
49546
|
+
while (++index < length) {
|
|
49547
|
+
var entry2 = entries[index];
|
|
49548
|
+
this.set(entry2[0], entry2[1]);
|
|
49549
|
+
}
|
|
49550
|
+
}
|
|
49551
|
+
MapCache2.prototype.clear = _mapCacheClear_default;
|
|
49552
|
+
MapCache2.prototype["delete"] = _mapCacheDelete_default;
|
|
49553
|
+
MapCache2.prototype.get = _mapCacheGet_default;
|
|
49554
|
+
MapCache2.prototype.has = _mapCacheHas_default;
|
|
49555
|
+
MapCache2.prototype.set = _mapCacheSet_default;
|
|
49556
|
+
var _MapCache_default = MapCache2;
|
|
49557
|
+
|
|
49558
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getPrototype.js
|
|
49559
|
+
var getPrototype2 = _overArg_default(Object.getPrototypeOf, Object);
|
|
49560
|
+
var _getPrototype_default = getPrototype2;
|
|
49561
|
+
|
|
49562
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isPlainObject.js
|
|
49563
|
+
var objectTag3 = "[object Object]";
|
|
49564
|
+
var funcProto4 = Function.prototype;
|
|
49565
|
+
var objectProto12 = Object.prototype;
|
|
49566
|
+
var funcToString4 = funcProto4.toString;
|
|
49567
|
+
var hasOwnProperty10 = objectProto12.hasOwnProperty;
|
|
49568
|
+
var objectCtorString2 = funcToString4.call(Object);
|
|
49569
|
+
function isPlainObject2(value) {
|
|
49570
|
+
if (!isObjectLike_default(value) || _baseGetTag_default(value) != objectTag3) {
|
|
49571
|
+
return false;
|
|
49572
|
+
}
|
|
49573
|
+
var proto = _getPrototype_default(value);
|
|
49574
|
+
if (proto === null) {
|
|
49575
|
+
return true;
|
|
49576
|
+
}
|
|
49577
|
+
var Ctor = hasOwnProperty10.call(proto, "constructor") && proto.constructor;
|
|
49578
|
+
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString4.call(Ctor) == objectCtorString2;
|
|
49579
|
+
}
|
|
49580
|
+
var isPlainObject_default = isPlainObject2;
|
|
49581
|
+
|
|
49582
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js
|
|
49583
|
+
function stackClear2() {
|
|
49584
|
+
this.__data__ = new _ListCache_default;
|
|
49585
|
+
this.size = 0;
|
|
49586
|
+
}
|
|
49587
|
+
var _stackClear_default = stackClear2;
|
|
49588
|
+
|
|
49589
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js
|
|
49590
|
+
function stackDelete2(key) {
|
|
49591
|
+
var data = this.__data__, result = data["delete"](key);
|
|
49592
|
+
this.size = data.size;
|
|
49593
|
+
return result;
|
|
49594
|
+
}
|
|
49595
|
+
var _stackDelete_default = stackDelete2;
|
|
49596
|
+
|
|
49597
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js
|
|
49598
|
+
function stackGet2(key) {
|
|
49599
|
+
return this.__data__.get(key);
|
|
49600
|
+
}
|
|
49601
|
+
var _stackGet_default = stackGet2;
|
|
49602
|
+
|
|
49603
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js
|
|
49604
|
+
function stackHas2(key) {
|
|
49605
|
+
return this.__data__.has(key);
|
|
49606
|
+
}
|
|
49607
|
+
var _stackHas_default = stackHas2;
|
|
49608
|
+
|
|
49609
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js
|
|
49610
|
+
var LARGE_ARRAY_SIZE2 = 200;
|
|
49611
|
+
function stackSet2(key, value) {
|
|
49612
|
+
var data = this.__data__;
|
|
49613
|
+
if (data instanceof _ListCache_default) {
|
|
49614
|
+
var pairs = data.__data__;
|
|
49615
|
+
if (!_Map_default || pairs.length < LARGE_ARRAY_SIZE2 - 1) {
|
|
49616
|
+
pairs.push([key, value]);
|
|
49617
|
+
this.size = ++data.size;
|
|
49618
|
+
return this;
|
|
49619
|
+
}
|
|
49620
|
+
data = this.__data__ = new _MapCache_default(pairs);
|
|
49621
|
+
}
|
|
49622
|
+
data.set(key, value);
|
|
49623
|
+
this.size = data.size;
|
|
49624
|
+
return this;
|
|
49625
|
+
}
|
|
49626
|
+
var _stackSet_default = stackSet2;
|
|
49627
|
+
|
|
49628
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js
|
|
49629
|
+
function Stack2(entries) {
|
|
49630
|
+
var data = this.__data__ = new _ListCache_default(entries);
|
|
49631
|
+
this.size = data.size;
|
|
49632
|
+
}
|
|
49633
|
+
Stack2.prototype.clear = _stackClear_default;
|
|
49634
|
+
Stack2.prototype["delete"] = _stackDelete_default;
|
|
49635
|
+
Stack2.prototype.get = _stackGet_default;
|
|
49636
|
+
Stack2.prototype.has = _stackHas_default;
|
|
49637
|
+
Stack2.prototype.set = _stackSet_default;
|
|
49638
|
+
var _Stack_default = Stack2;
|
|
49639
|
+
|
|
49640
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneBuffer.js
|
|
49641
|
+
var exports__cloneBuffer = {};
|
|
49642
|
+
__export(exports__cloneBuffer, {
|
|
49643
|
+
default: () => _cloneBuffer_default
|
|
49644
|
+
});
|
|
49645
|
+
var freeExports4 = typeof exports__cloneBuffer == "object" && exports__cloneBuffer && !exports__cloneBuffer.nodeType && exports__cloneBuffer;
|
|
49646
|
+
var freeModule4 = freeExports4 && typeof module__cloneBuffer == "object" && module__cloneBuffer && !module__cloneBuffer.nodeType && module__cloneBuffer;
|
|
49647
|
+
var moduleExports4 = freeModule4 && freeModule4.exports === freeExports4;
|
|
49648
|
+
var Buffer4 = moduleExports4 ? _root_default.Buffer : undefined;
|
|
49649
|
+
var allocUnsafe = Buffer4 ? Buffer4.allocUnsafe : undefined;
|
|
49650
|
+
function cloneBuffer2(buffer, isDeep) {
|
|
49651
|
+
if (isDeep) {
|
|
49652
|
+
return buffer.slice();
|
|
49653
|
+
}
|
|
49654
|
+
var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
49655
|
+
buffer.copy(result);
|
|
49656
|
+
return result;
|
|
49657
|
+
}
|
|
49658
|
+
var _cloneBuffer_default = cloneBuffer2;
|
|
49659
|
+
|
|
49660
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js
|
|
49661
|
+
var Uint8Array3 = _root_default.Uint8Array;
|
|
49662
|
+
var _Uint8Array_default = Uint8Array3;
|
|
49663
|
+
|
|
49664
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneArrayBuffer.js
|
|
49665
|
+
function cloneArrayBuffer2(arrayBuffer) {
|
|
49666
|
+
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
49667
|
+
new _Uint8Array_default(result).set(new _Uint8Array_default(arrayBuffer));
|
|
49668
|
+
return result;
|
|
49669
|
+
}
|
|
49670
|
+
var _cloneArrayBuffer_default = cloneArrayBuffer2;
|
|
49671
|
+
|
|
49672
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneTypedArray.js
|
|
49673
|
+
function cloneTypedArray2(typedArray, isDeep) {
|
|
49674
|
+
var buffer = isDeep ? _cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer;
|
|
49675
|
+
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
49676
|
+
}
|
|
49677
|
+
var _cloneTypedArray_default = cloneTypedArray2;
|
|
49678
|
+
|
|
49679
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneObject.js
|
|
49680
|
+
function initCloneObject2(object) {
|
|
49681
|
+
return typeof object.constructor == "function" && !_isPrototype_default(object) ? _baseCreate_default(_getPrototype_default(object)) : {};
|
|
49682
|
+
}
|
|
49683
|
+
var _initCloneObject_default = initCloneObject2;
|
|
49684
|
+
|
|
49685
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseFor.js
|
|
49686
|
+
function createBaseFor2(fromRight) {
|
|
49687
|
+
return function(object, iteratee, keysFunc) {
|
|
49688
|
+
var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
|
|
49689
|
+
while (length--) {
|
|
49690
|
+
var key = props[fromRight ? length : ++index];
|
|
49691
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
49692
|
+
break;
|
|
49693
|
+
}
|
|
49694
|
+
}
|
|
49695
|
+
return object;
|
|
49696
|
+
};
|
|
49697
|
+
}
|
|
49698
|
+
var _createBaseFor_default = createBaseFor2;
|
|
49699
|
+
|
|
49700
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFor.js
|
|
49701
|
+
var baseFor2 = _createBaseFor_default();
|
|
49702
|
+
var _baseFor_default = baseFor2;
|
|
49703
|
+
|
|
49704
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignMergeValue.js
|
|
49705
|
+
function assignMergeValue2(object, key, value) {
|
|
49706
|
+
if (value !== undefined && !eq_default(object[key], value) || value === undefined && !(key in object)) {
|
|
49707
|
+
_baseAssignValue_default(object, key, value);
|
|
49708
|
+
}
|
|
49709
|
+
}
|
|
49710
|
+
var _assignMergeValue_default = assignMergeValue2;
|
|
49711
|
+
|
|
49712
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLikeObject.js
|
|
49713
|
+
function isArrayLikeObject2(value) {
|
|
49714
|
+
return isObjectLike_default(value) && isArrayLike_default(value);
|
|
49715
|
+
}
|
|
49716
|
+
var isArrayLikeObject_default = isArrayLikeObject2;
|
|
49717
|
+
|
|
49718
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_safeGet.js
|
|
49719
|
+
function safeGet2(object, key) {
|
|
49720
|
+
if (key === "constructor" && typeof object[key] === "function") {
|
|
49721
|
+
return;
|
|
49722
|
+
}
|
|
49723
|
+
if (key == "__proto__") {
|
|
49724
|
+
return;
|
|
49725
|
+
}
|
|
49726
|
+
return object[key];
|
|
49727
|
+
}
|
|
49728
|
+
var _safeGet_default = safeGet2;
|
|
49729
|
+
|
|
49730
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPlainObject.js
|
|
49731
|
+
function toPlainObject2(value) {
|
|
49732
|
+
return _copyObject_default(value, keysIn_default(value));
|
|
49733
|
+
}
|
|
49734
|
+
var toPlainObject_default = toPlainObject2;
|
|
49735
|
+
|
|
49736
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMergeDeep.js
|
|
49737
|
+
function baseMergeDeep2(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
49738
|
+
var objValue = _safeGet_default(object, key), srcValue = _safeGet_default(source, key), stacked = stack.get(srcValue);
|
|
49739
|
+
if (stacked) {
|
|
49740
|
+
_assignMergeValue_default(object, key, stacked);
|
|
49741
|
+
return;
|
|
49742
|
+
}
|
|
49743
|
+
var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined;
|
|
49744
|
+
var isCommon = newValue === undefined;
|
|
49745
|
+
if (isCommon) {
|
|
49746
|
+
var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue);
|
|
49747
|
+
newValue = srcValue;
|
|
49748
|
+
if (isArr || isBuff || isTyped) {
|
|
49749
|
+
if (isArray_default(objValue)) {
|
|
49750
|
+
newValue = objValue;
|
|
49751
|
+
} else if (isArrayLikeObject_default(objValue)) {
|
|
49752
|
+
newValue = _copyArray_default(objValue);
|
|
49753
|
+
} else if (isBuff) {
|
|
49754
|
+
isCommon = false;
|
|
49755
|
+
newValue = _cloneBuffer_default(srcValue, true);
|
|
49756
|
+
} else if (isTyped) {
|
|
49757
|
+
isCommon = false;
|
|
49758
|
+
newValue = _cloneTypedArray_default(srcValue, true);
|
|
49759
|
+
} else {
|
|
49760
|
+
newValue = [];
|
|
49761
|
+
}
|
|
49762
|
+
} else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) {
|
|
49763
|
+
newValue = objValue;
|
|
49764
|
+
if (isArguments_default(objValue)) {
|
|
49765
|
+
newValue = toPlainObject_default(objValue);
|
|
49766
|
+
} else if (!isObject_default(objValue) || isFunction_default(objValue)) {
|
|
49767
|
+
newValue = _initCloneObject_default(srcValue);
|
|
49768
|
+
}
|
|
49769
|
+
} else {
|
|
49770
|
+
isCommon = false;
|
|
49771
|
+
}
|
|
49772
|
+
}
|
|
49773
|
+
if (isCommon) {
|
|
49774
|
+
stack.set(srcValue, newValue);
|
|
49775
|
+
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
49776
|
+
stack["delete"](srcValue);
|
|
49777
|
+
}
|
|
49778
|
+
_assignMergeValue_default(object, key, newValue);
|
|
49779
|
+
}
|
|
49780
|
+
var _baseMergeDeep_default = baseMergeDeep2;
|
|
49781
|
+
|
|
49782
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMerge.js
|
|
49783
|
+
function baseMerge2(object, source, srcIndex, customizer, stack) {
|
|
49784
|
+
if (object === source) {
|
|
49785
|
+
return;
|
|
49786
|
+
}
|
|
49787
|
+
_baseFor_default(source, function(srcValue, key) {
|
|
49788
|
+
stack || (stack = new _Stack_default);
|
|
49789
|
+
if (isObject_default(srcValue)) {
|
|
49790
|
+
_baseMergeDeep_default(object, source, key, srcIndex, baseMerge2, customizer, stack);
|
|
49791
|
+
} else {
|
|
49792
|
+
var newValue = customizer ? customizer(_safeGet_default(object, key), srcValue, key + "", object, source, stack) : undefined;
|
|
49793
|
+
if (newValue === undefined) {
|
|
49794
|
+
newValue = srcValue;
|
|
49795
|
+
}
|
|
49796
|
+
_assignMergeValue_default(object, key, newValue);
|
|
49797
|
+
}
|
|
49798
|
+
}, keysIn_default);
|
|
49799
|
+
}
|
|
49800
|
+
var _baseMerge_default = baseMerge2;
|
|
49801
|
+
|
|
49802
|
+
// ../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js
|
|
49803
|
+
var merge2 = _createAssigner_default(function(object, source, srcIndex) {
|
|
49804
|
+
_baseMerge_default(object, source, srcIndex);
|
|
49805
|
+
});
|
|
49806
|
+
var merge_default = merge2;
|
|
49807
|
+
// src/module/local-apps/src/modules/manager.ts
|
|
49808
|
+
import path6 from "node:path";
|
|
49809
|
+
var import_fast_glob = __toESM(require_out4(), 1);
|
|
49810
|
+
import fs7 from "node:fs";
|
|
49811
|
+
|
|
49812
|
+
// src/module/local-apps/src/modules/pm2.ts
|
|
49813
|
+
import pm23 from "pm2";
|
|
49814
|
+
import { promisify as promisify3 } from "node:util";
|
|
49815
|
+
var normalizeScriptPath2 = (scriptPath) => {
|
|
49816
|
+
if (process.platform === "win32") {
|
|
49817
|
+
return scriptPath.replace(/\\/g, "/");
|
|
49818
|
+
}
|
|
49819
|
+
return scriptPath;
|
|
49820
|
+
};
|
|
49821
|
+
var connect2 = async (noDaemonMode = false) => {
|
|
49822
|
+
return new Promise((resolve, reject) => {
|
|
49823
|
+
pm23.connect(noDaemonMode, (err) => {
|
|
49824
|
+
if (err) {
|
|
49825
|
+
console.error("pm2 connect error", err);
|
|
49826
|
+
return reject(err);
|
|
49827
|
+
}
|
|
49828
|
+
resolve(true);
|
|
49829
|
+
});
|
|
49830
|
+
});
|
|
49831
|
+
};
|
|
49832
|
+
var disconnect2 = promisify3(pm23.disconnect).bind(pm23);
|
|
49833
|
+
var start3 = promisify3(pm23.start).bind(pm23);
|
|
49834
|
+
var stop3 = promisify3(pm23.stop).bind(pm23);
|
|
49835
|
+
var restart3 = promisify3(pm23.restart).bind(pm23);
|
|
49836
|
+
var reload2 = promisify3(pm23.reload).bind(pm23);
|
|
49837
|
+
var deleteProcess3 = promisify3(pm23.delete).bind(pm23);
|
|
49838
|
+
var list3 = promisify3(pm23.list).bind(pm23);
|
|
49839
|
+
class Pm2Connect2 {
|
|
49840
|
+
needConnect = true;
|
|
49841
|
+
isConnected = false;
|
|
49842
|
+
constructor(needConnect = true) {
|
|
49843
|
+
this.needConnect = needConnect;
|
|
49844
|
+
}
|
|
49845
|
+
async sleep(ms) {
|
|
49846
|
+
return new Promise((resolve) => {
|
|
49847
|
+
setTimeout(resolve, ms);
|
|
49848
|
+
});
|
|
49849
|
+
}
|
|
49850
|
+
async checkConnect() {
|
|
49851
|
+
const that = this;
|
|
49852
|
+
try {
|
|
49853
|
+
if (this.needConnect && !this.isConnected) {
|
|
49854
|
+
const data = await connect2();
|
|
49855
|
+
that.isConnected = !!data;
|
|
49856
|
+
}
|
|
49857
|
+
} catch (e) {
|
|
49858
|
+
console.log("pm2 check connect error", e);
|
|
49859
|
+
}
|
|
49860
|
+
}
|
|
49861
|
+
async checkDisconnect(runOpts) {
|
|
49862
|
+
const needExit = runOpts?.needExit ?? true;
|
|
49863
|
+
if (this.needConnect && this.isConnected && needExit) {
|
|
49864
|
+
this.disconnect();
|
|
49865
|
+
}
|
|
49866
|
+
}
|
|
49867
|
+
async connect() {
|
|
49868
|
+
try {
|
|
49869
|
+
await connect2();
|
|
49870
|
+
this.isConnected = true;
|
|
49871
|
+
} catch (e) {
|
|
49872
|
+
console.log("pm2 connect error", e);
|
|
49873
|
+
}
|
|
49874
|
+
}
|
|
49875
|
+
async disconnect() {
|
|
49876
|
+
try {
|
|
49877
|
+
pm23.disconnect();
|
|
49878
|
+
await this.sleep(1000);
|
|
49879
|
+
} catch (e) {
|
|
49880
|
+
console.log("pm2 disconnect error", e);
|
|
49881
|
+
}
|
|
49882
|
+
this.isConnected = false;
|
|
49883
|
+
}
|
|
49884
|
+
}
|
|
49885
|
+
|
|
49886
|
+
class Pm2Manager2 {
|
|
49887
|
+
pm2Connect;
|
|
49888
|
+
appName;
|
|
49889
|
+
script;
|
|
49890
|
+
interpreter;
|
|
49891
|
+
needConnect = true;
|
|
49892
|
+
isConnect = false;
|
|
49893
|
+
env;
|
|
49894
|
+
constructor(opts) {
|
|
49895
|
+
this.appName = opts.appName;
|
|
49896
|
+
this.script = opts.script;
|
|
49897
|
+
this.interpreter = opts.interpreter;
|
|
49898
|
+
this.pm2Connect = opts.pm2Connect || new Pm2Connect2;
|
|
49899
|
+
this.env = opts.env || {};
|
|
49900
|
+
}
|
|
49901
|
+
async list(runOpts) {
|
|
49902
|
+
const _runOpts = { needExit: false, ...runOpts };
|
|
49903
|
+
try {
|
|
49904
|
+
await this.pm2Connect.checkConnect();
|
|
49905
|
+
const apps = await list3();
|
|
49906
|
+
return apps;
|
|
49907
|
+
} catch (e) {
|
|
49908
|
+
console.log("pm2 run error", e);
|
|
49909
|
+
return [];
|
|
49910
|
+
} finally {
|
|
49911
|
+
this.pm2Connect.checkDisconnect(_runOpts);
|
|
49912
|
+
}
|
|
49913
|
+
}
|
|
49914
|
+
async start(options, runOpts) {
|
|
49915
|
+
const { appName, script, env: env2, interpreter } = this;
|
|
49916
|
+
const needExit = runOpts?.needExit ?? true;
|
|
49917
|
+
if (!script) {
|
|
49918
|
+
console.error("script is required");
|
|
49919
|
+
return;
|
|
49920
|
+
}
|
|
49921
|
+
const normalizedScript = normalizeScriptPath2(script);
|
|
49922
|
+
const starter = {
|
|
49923
|
+
name: appName,
|
|
49924
|
+
script: normalizedScript,
|
|
49925
|
+
cwd: process.cwd(),
|
|
49926
|
+
interpreter,
|
|
49927
|
+
...options,
|
|
49928
|
+
env: {
|
|
49929
|
+
NODE_ENV: "production",
|
|
49930
|
+
...env2,
|
|
49931
|
+
...options?.env
|
|
49932
|
+
}
|
|
49933
|
+
};
|
|
49934
|
+
try {
|
|
49935
|
+
await this.pm2Connect.checkConnect();
|
|
49936
|
+
const apps = await this.list({ needExit: false });
|
|
49937
|
+
const app = apps.find((app2) => app2.name === appName);
|
|
49938
|
+
if (app && app.pid === 0) {
|
|
49939
|
+
await start3(starter);
|
|
49940
|
+
return;
|
|
49941
|
+
} else if (!app) {
|
|
49942
|
+
await start3(starter);
|
|
49943
|
+
} else {
|
|
49944
|
+
console.log(`pm2 app ${appName} is running`);
|
|
49945
|
+
}
|
|
49946
|
+
} catch (e) {
|
|
49947
|
+
console.error("error", e);
|
|
49948
|
+
} finally {
|
|
49949
|
+
this.pm2Connect.checkDisconnect({ needExit });
|
|
49950
|
+
}
|
|
49951
|
+
}
|
|
49952
|
+
async stop(runOpts) {
|
|
49953
|
+
try {
|
|
49954
|
+
await this.pm2Connect.checkConnect();
|
|
49955
|
+
const apps = await this.list({ needExit: false });
|
|
49956
|
+
const app = apps.find((app2) => app2.name === this.appName);
|
|
49957
|
+
if (app && app.pid !== 0) {
|
|
49958
|
+
await stop3(app.name);
|
|
49959
|
+
}
|
|
49960
|
+
} catch (e) {
|
|
49961
|
+
console.error("error", e);
|
|
49962
|
+
} finally {
|
|
49963
|
+
this.pm2Connect.checkDisconnect(runOpts);
|
|
49964
|
+
}
|
|
49965
|
+
}
|
|
49966
|
+
async restart(runOpts) {
|
|
49967
|
+
try {
|
|
49968
|
+
await this.pm2Connect.checkConnect();
|
|
49969
|
+
const apps = await this.list({ needExit: false });
|
|
49970
|
+
const app = apps.find((app2) => app2.name === this.appName);
|
|
49971
|
+
if (app) {
|
|
49972
|
+
await restart3(app.name);
|
|
49973
|
+
}
|
|
49974
|
+
} catch (e) {
|
|
49975
|
+
console.error("error", e);
|
|
49976
|
+
} finally {
|
|
49977
|
+
this.pm2Connect.checkDisconnect(runOpts);
|
|
49978
|
+
}
|
|
49979
|
+
}
|
|
49980
|
+
async deleteProcess(runOpts) {
|
|
49981
|
+
try {
|
|
49982
|
+
await this.pm2Connect.checkConnect();
|
|
49983
|
+
const apps = await this.list({ needExit: false });
|
|
49984
|
+
const app = apps.find((app2) => app2.name === this.appName);
|
|
49985
|
+
if (app) {
|
|
49986
|
+
await deleteProcess3(app.name);
|
|
49987
|
+
}
|
|
49988
|
+
} catch (e) {
|
|
49989
|
+
console.error("error", e);
|
|
49990
|
+
} finally {
|
|
49991
|
+
this.pm2Connect.checkDisconnect(runOpts);
|
|
49992
|
+
}
|
|
49993
|
+
}
|
|
49994
|
+
}
|
|
49995
|
+
|
|
49996
|
+
// src/module/local-apps/src/modules/manager.ts
|
|
49997
|
+
var onAppShowInfo2 = (app) => {
|
|
49998
|
+
return {
|
|
49999
|
+
key: app.key,
|
|
50000
|
+
status: app.status,
|
|
50001
|
+
engine: app.engine,
|
|
50002
|
+
type: app.type,
|
|
50003
|
+
description: app.description,
|
|
50004
|
+
version: app.version
|
|
50005
|
+
};
|
|
50006
|
+
};
|
|
50007
|
+
class Manager2 {
|
|
50008
|
+
apps;
|
|
50009
|
+
mainApp;
|
|
50010
|
+
appInfo;
|
|
50011
|
+
appsPath;
|
|
50012
|
+
configFilename;
|
|
50013
|
+
constructor(opts) {
|
|
50014
|
+
this.apps = new Map;
|
|
50015
|
+
this.mainApp = opts.mainApp;
|
|
50016
|
+
this.appInfo = {};
|
|
50017
|
+
this.appsPath = opts?.appsPath || getAppsPath2();
|
|
50018
|
+
this.configFilename = opts?.configFilename || "apps.config.json";
|
|
50019
|
+
}
|
|
50020
|
+
#pm2Connect;
|
|
50021
|
+
checkKey(key) {
|
|
50022
|
+
return this.apps.has(key);
|
|
50023
|
+
}
|
|
50024
|
+
async loadApp(app) {
|
|
50025
|
+
const mainApp = this.mainApp;
|
|
50026
|
+
this.apps.set(app.key, app);
|
|
50027
|
+
if (app.status !== "running") {
|
|
50028
|
+
return;
|
|
50029
|
+
}
|
|
50030
|
+
if (!fileIsExist2(app.path)) {
|
|
50031
|
+
console.error("app is not found");
|
|
50032
|
+
return;
|
|
50033
|
+
}
|
|
50034
|
+
const pathEntry = path6.join(app.path, app.entry);
|
|
50035
|
+
if (!fileIsExist2(pathEntry)) {
|
|
50036
|
+
console.error("file entry not found");
|
|
50037
|
+
return;
|
|
50038
|
+
}
|
|
50039
|
+
const entry2 = app.entry + `?timestamp=${app?.timestamp}`;
|
|
50040
|
+
if (app.type === "micro-app" /* MicroApp */) {
|
|
50041
|
+
const childProcess = fork2(app.entry, [], {
|
|
50042
|
+
stdio: "inherit",
|
|
50043
|
+
cwd: app.path,
|
|
50044
|
+
env: {
|
|
50045
|
+
...process.env,
|
|
50046
|
+
...app.env,
|
|
50047
|
+
APP_KEY: app.key,
|
|
50048
|
+
APP_PATH: app.path,
|
|
50049
|
+
APP_ENTRY: entry2
|
|
50050
|
+
}
|
|
50051
|
+
});
|
|
50052
|
+
app.process = childProcess;
|
|
50053
|
+
} else if (app.type === "system-app" /* SystemApp */) {
|
|
50054
|
+
const pathEntryAndTimestamp = path6.join(app.path, entry2);
|
|
50055
|
+
const importPath = process.platform === "win32" ? "file:///" + pathEntryAndTimestamp.replace(/\\/g, "/") : pathEntryAndTimestamp;
|
|
50056
|
+
const module = await import(importPath);
|
|
50057
|
+
if (module.loadApp && mainApp) {
|
|
50058
|
+
await module.loadApp?.(mainApp, app);
|
|
50059
|
+
}
|
|
50060
|
+
} else if (app.type === "gateway-app" /* GatewayApp */) {
|
|
50061
|
+
console.log("gateway app not support");
|
|
50062
|
+
} else if (app.type === "pm2-system-app" /* Pm2SystemApp */) {
|
|
50063
|
+
const pathEntry2 = path6.join(app.path, app.entry);
|
|
50064
|
+
const pm2Manager = new Pm2Manager2({
|
|
50065
|
+
appName: app.key,
|
|
50066
|
+
script: pathEntry2,
|
|
50067
|
+
pm2Connect: this.#pm2Connect
|
|
50068
|
+
});
|
|
50069
|
+
const pm2Options = app.pm2Options || {};
|
|
50070
|
+
if (app?.engine) {
|
|
50071
|
+
pm2Options.interpreter = pm2Options.interpreter || app?.engine;
|
|
50072
|
+
}
|
|
50073
|
+
if (!pm2Options.cwd) {
|
|
50074
|
+
pm2Options.cwd = path6.join(app.path, "../..");
|
|
50075
|
+
}
|
|
50076
|
+
await pm2Manager.start(pm2Options);
|
|
50077
|
+
} else {
|
|
50078
|
+
console.error("app type not support", app.type);
|
|
50079
|
+
}
|
|
50080
|
+
console.log(`load ${app.type} success`, app.key);
|
|
50081
|
+
return true;
|
|
50082
|
+
}
|
|
50083
|
+
async saveAppInfo(app, newTimeData = false) {
|
|
50084
|
+
const list4 = this.appInfo.list || [];
|
|
50085
|
+
if (newTimeData) {
|
|
50086
|
+
app.timestamp = Date.now();
|
|
50087
|
+
}
|
|
50088
|
+
const { process: process3, ...info } = app;
|
|
50089
|
+
const has = list4.findIndex((item) => item.key === app.key);
|
|
50090
|
+
if (has >= 0) {
|
|
50091
|
+
list4[has] = info;
|
|
50092
|
+
} else {
|
|
50093
|
+
list4.push(info);
|
|
50094
|
+
}
|
|
50095
|
+
this.appInfo.list = list4;
|
|
50096
|
+
await saveAppInfo2(this.appInfo, this.appsPath, this.configFilename);
|
|
50097
|
+
}
|
|
50098
|
+
async loadConfig(loadApps = false) {
|
|
50099
|
+
if (loadApps) {
|
|
50100
|
+
return await this.load();
|
|
50101
|
+
}
|
|
50102
|
+
const appInfos = await loadAppInfo2(this.appsPath, this.configFilename);
|
|
50103
|
+
this.appInfo = appInfos;
|
|
50104
|
+
const list4 = appInfos?.list || [];
|
|
50105
|
+
for (const app of list4) {
|
|
50106
|
+
this.apps.set(app.key, app);
|
|
50107
|
+
}
|
|
50108
|
+
return this.apps;
|
|
50109
|
+
}
|
|
50110
|
+
async load(opts) {
|
|
50111
|
+
if (opts?.configFilename) {
|
|
50112
|
+
this.configFilename = opts.configFilename;
|
|
50113
|
+
}
|
|
50114
|
+
if (opts?.appsPath) {
|
|
50115
|
+
this.appsPath = opts.appsPath;
|
|
50116
|
+
}
|
|
50117
|
+
if (opts?.mainApp) {
|
|
50118
|
+
this.mainApp = opts.mainApp;
|
|
50119
|
+
}
|
|
50120
|
+
const appInfos = await loadAppInfo2(this.appsPath, this.configFilename);
|
|
50121
|
+
this.appInfo = appInfos;
|
|
50122
|
+
const _List = appInfos?.list || [];
|
|
50123
|
+
const list4 = _List.filter((item) => {
|
|
50124
|
+
if (opts?.runtime && item.runtime) {
|
|
50125
|
+
return item.runtime?.includes(opts.runtime);
|
|
50126
|
+
}
|
|
50127
|
+
return true;
|
|
50128
|
+
});
|
|
50129
|
+
const pm2Connect = new Pm2Connect2(false);
|
|
50130
|
+
this.#pm2Connect = pm2Connect;
|
|
50131
|
+
try {
|
|
50132
|
+
await pm2Connect.connect();
|
|
50133
|
+
} catch (e) {
|
|
50134
|
+
console.log("pm2 connect error", e);
|
|
50135
|
+
return;
|
|
50136
|
+
}
|
|
50137
|
+
for (const app of list4) {
|
|
50138
|
+
try {
|
|
50139
|
+
const loaded = await this.loadApp(app);
|
|
50140
|
+
if (!loaded) {
|
|
50141
|
+
if (app.status === "running") {
|
|
50142
|
+
app.status = "error";
|
|
50143
|
+
console.log("load app error", app);
|
|
50144
|
+
await this.saveAppInfo(app);
|
|
50145
|
+
}
|
|
50146
|
+
} else {}
|
|
50147
|
+
} catch (e) {
|
|
50148
|
+
console.error(`load app error====[${app.type} | ${app.key}]
|
|
50149
|
+
`, e);
|
|
50150
|
+
}
|
|
50151
|
+
}
|
|
50152
|
+
pm2Connect.disconnect();
|
|
50153
|
+
this.#pm2Connect = null;
|
|
50154
|
+
}
|
|
50155
|
+
async add(app) {
|
|
50156
|
+
if (this.checkKey(app.key)) {
|
|
50157
|
+
console.error("key is loaded");
|
|
50158
|
+
return false;
|
|
50159
|
+
}
|
|
50160
|
+
await this.saveAppInfo(app, true);
|
|
50161
|
+
this.loadApp(app);
|
|
50162
|
+
}
|
|
50163
|
+
async start(key) {
|
|
50164
|
+
const app = this.apps.get(key);
|
|
50165
|
+
if (!app) {
|
|
50166
|
+
console.error("app not found", key);
|
|
50167
|
+
return;
|
|
50168
|
+
}
|
|
50169
|
+
if (app.status === "running" && app.type === "system-app" /* SystemApp */) {
|
|
50170
|
+
console.log(`app ${key} is running`);
|
|
50171
|
+
return;
|
|
50172
|
+
}
|
|
50173
|
+
app.status = "running";
|
|
50174
|
+
this.loadApp(app);
|
|
50175
|
+
await this.saveAppInfo(app);
|
|
50176
|
+
}
|
|
50177
|
+
async stop(key) {
|
|
50178
|
+
const app = this.apps.get(key);
|
|
50179
|
+
if (!app) {
|
|
50180
|
+
return;
|
|
50181
|
+
}
|
|
50182
|
+
if (app.status === "stop" && app.type === "system-app" /* SystemApp */) {
|
|
50183
|
+
console.log(`app ${key} is stopped`);
|
|
50184
|
+
return;
|
|
50185
|
+
}
|
|
50186
|
+
app.status = "stop";
|
|
50187
|
+
if (app.type === "micro-app" /* MicroApp */) {
|
|
50188
|
+
if (app.process) {
|
|
50189
|
+
app.process.kill();
|
|
50190
|
+
}
|
|
50191
|
+
}
|
|
50192
|
+
if (app.type === "pm2-system-app" /* Pm2SystemApp */) {
|
|
50193
|
+
const pm2Manager = new Pm2Manager2({
|
|
50194
|
+
appName: app.key,
|
|
50195
|
+
script: app.entry,
|
|
50196
|
+
pm2Connect: this.#pm2Connect
|
|
50197
|
+
});
|
|
50198
|
+
await pm2Manager.stop();
|
|
50199
|
+
}
|
|
50200
|
+
await this.saveAppInfo(app);
|
|
50201
|
+
}
|
|
50202
|
+
async restart(key) {
|
|
50203
|
+
const app = this.apps.get(key);
|
|
50204
|
+
if (!app) {
|
|
50205
|
+
return;
|
|
50206
|
+
}
|
|
50207
|
+
if (app.status !== "running") {
|
|
50208
|
+
await this.start(key);
|
|
50209
|
+
return;
|
|
50210
|
+
}
|
|
50211
|
+
if (app.status === "running" && app.type === "pm2-system-app" /* Pm2SystemApp */) {
|
|
50212
|
+
const pm2Manager = new Pm2Manager2({
|
|
50213
|
+
appName: app.key
|
|
50214
|
+
});
|
|
50215
|
+
await pm2Manager.restart();
|
|
50216
|
+
return;
|
|
50217
|
+
} else {
|
|
50218
|
+
await this.stop(key);
|
|
50219
|
+
await this.start(key);
|
|
50220
|
+
}
|
|
50221
|
+
}
|
|
50222
|
+
getAppShowInfo(key) {
|
|
50223
|
+
const app = this.apps.get(key);
|
|
50224
|
+
if (!app) {
|
|
50225
|
+
return;
|
|
50226
|
+
}
|
|
50227
|
+
return onAppShowInfo2(app);
|
|
50228
|
+
}
|
|
50229
|
+
getAllAppShowInfo() {
|
|
50230
|
+
const list4 = [];
|
|
50231
|
+
for (const [key, value] of this.apps) {
|
|
50232
|
+
list4.push(onAppShowInfo2(value));
|
|
50233
|
+
}
|
|
50234
|
+
return list4;
|
|
50235
|
+
}
|
|
50236
|
+
async updateAppInfo(key, info) {
|
|
50237
|
+
const app = this.apps.get(key);
|
|
50238
|
+
if (!app) {
|
|
50239
|
+
return;
|
|
50240
|
+
}
|
|
50241
|
+
merge_default(app, info);
|
|
50242
|
+
this.loadApp(app);
|
|
50243
|
+
await this.saveAppInfo(app);
|
|
50244
|
+
return onAppShowInfo2(app);
|
|
50245
|
+
}
|
|
50246
|
+
async removeApp(key) {
|
|
50247
|
+
const app = this.apps.get(key);
|
|
50248
|
+
if (!app) {
|
|
50249
|
+
return false;
|
|
50250
|
+
}
|
|
50251
|
+
if (app.process) {
|
|
50252
|
+
app.process.kill();
|
|
50253
|
+
}
|
|
50254
|
+
this.apps.delete(key);
|
|
50255
|
+
this.appInfo.list = this.appInfo.list.filter((item) => item.key !== key);
|
|
50256
|
+
await saveAppInfo2(this.appInfo, this.appsPath, this.configFilename);
|
|
50257
|
+
try {
|
|
50258
|
+
if (app.type === "pm2-system-app" /* Pm2SystemApp */) {
|
|
50259
|
+
const pm2Manager = new Pm2Manager2({
|
|
50260
|
+
appName: app.key
|
|
50261
|
+
});
|
|
50262
|
+
await pm2Manager.deleteProcess();
|
|
50263
|
+
}
|
|
50264
|
+
} catch (e) {
|
|
50265
|
+
console.log("delete pm2 process error", e);
|
|
50266
|
+
}
|
|
50267
|
+
try {
|
|
50268
|
+
deleteFileAppInfo2(key, this.appsPath);
|
|
50269
|
+
} catch (e) {
|
|
50270
|
+
console.error("delete file app error", e);
|
|
50271
|
+
return false;
|
|
50272
|
+
}
|
|
50273
|
+
return true;
|
|
50274
|
+
}
|
|
50275
|
+
async detectApp(opts = {}) {
|
|
50276
|
+
const manager = this;
|
|
50277
|
+
const { autoClear = true } = opts;
|
|
50278
|
+
const list4 = manager.getAllAppShowInfo();
|
|
50279
|
+
const appPathKeys = await getAppPathKeys2(this.appsPath);
|
|
50280
|
+
let hasDeletedList = [];
|
|
50281
|
+
console.log("App path keys", appPathKeys);
|
|
50282
|
+
if (autoClear) {
|
|
50283
|
+
hasDeletedList = list4.filter((item) => !appPathKeys.find((key) => item.key === key));
|
|
50284
|
+
console.log("Has deleted", hasDeletedList);
|
|
50285
|
+
for (const item of hasDeletedList) {
|
|
50286
|
+
try {
|
|
50287
|
+
await manager.removeApp(item.key);
|
|
50288
|
+
} catch (e) {
|
|
50289
|
+
continue;
|
|
50290
|
+
}
|
|
50291
|
+
}
|
|
50292
|
+
}
|
|
50293
|
+
const notIn = appPathKeys.filter((key) => !list4.find((item) => item.key === key));
|
|
50294
|
+
console.log("Not in", notIn);
|
|
50295
|
+
const loadInfo = [];
|
|
50296
|
+
if (notIn.length <= 0) {
|
|
50297
|
+
return true;
|
|
50298
|
+
}
|
|
50299
|
+
for (const key of notIn) {
|
|
50300
|
+
try {
|
|
50301
|
+
const { showAppInfo } = await installAppFromKey2(key, this.appsPath);
|
|
50302
|
+
await manager.add(showAppInfo);
|
|
50303
|
+
loadInfo.push(`Load ${key} success`);
|
|
50304
|
+
} catch (e) {
|
|
50305
|
+
loadInfo.push(`Load ${key} error:`, e.message);
|
|
50306
|
+
}
|
|
50307
|
+
}
|
|
50308
|
+
return { list: loadInfo, newApps: notIn, hasDeletedList };
|
|
50309
|
+
}
|
|
50310
|
+
async reload(key) {
|
|
50311
|
+
const manager = this;
|
|
50312
|
+
const app = this.apps.get(key);
|
|
50313
|
+
if (!app) {
|
|
50314
|
+
return;
|
|
50315
|
+
}
|
|
50316
|
+
const appStatus = app.status;
|
|
50317
|
+
try {
|
|
50318
|
+
await manager.removeApp(key);
|
|
50319
|
+
} catch (e) {}
|
|
50320
|
+
try {
|
|
50321
|
+
const { showAppInfo } = await installAppFromKey2(key, this.appsPath);
|
|
50322
|
+
await manager.add(showAppInfo);
|
|
50323
|
+
if (appStatus === "running") {
|
|
50324
|
+
await manager.start(key);
|
|
50325
|
+
}
|
|
50326
|
+
console.log("reload app success", key);
|
|
50327
|
+
} catch (e) {
|
|
50328
|
+
console.error("reload app error", e);
|
|
50329
|
+
}
|
|
50330
|
+
}
|
|
50331
|
+
}
|
|
50332
|
+
var installAppFromKey2 = async (key, _appPath) => {
|
|
50333
|
+
const normalizedKey = key.replace(/\//g, path6.sep);
|
|
50334
|
+
const directory = path6.join(_appPath, normalizedKey);
|
|
50335
|
+
if (!fileIsExist2(directory)) {
|
|
50336
|
+
console.error("App not found", directory);
|
|
50337
|
+
throw new Error("App not found");
|
|
50338
|
+
}
|
|
50339
|
+
const pkgs = path6.join(directory, "package.json");
|
|
50340
|
+
if (!fileIsExist2(pkgs)) {
|
|
50341
|
+
throw new Error("Invalid package.json, need package.json in app directory");
|
|
50342
|
+
}
|
|
50343
|
+
const json = fs7.readFileSync(pkgs, "utf-8");
|
|
50344
|
+
const pkg = JSON.parse(json);
|
|
50345
|
+
const { name, version, app } = pkg;
|
|
50346
|
+
if (!name || !version || !app) {
|
|
50347
|
+
console.error("need name, version and app in package.json");
|
|
50348
|
+
throw new Error("Invalid package.json format, need name, version and app");
|
|
50349
|
+
}
|
|
50350
|
+
const readmeFile = path6.join(directory, "README.md");
|
|
50351
|
+
const readmeFile2 = path6.join(directory, "readme.md");
|
|
50352
|
+
let readmeDesc = "";
|
|
50353
|
+
if (fileIsExist2(readmeFile)) {
|
|
50354
|
+
readmeDesc = fs7.readFileSync(readmeFile, "utf-8");
|
|
50355
|
+
} else if (fileIsExist2(readmeFile2)) {
|
|
50356
|
+
readmeDesc = fs7.readFileSync(readmeFile2, "utf-8");
|
|
50357
|
+
}
|
|
50358
|
+
let showAppInfo = {
|
|
50359
|
+
key,
|
|
50360
|
+
status: "inactive",
|
|
50361
|
+
type: app?.type || "system-app",
|
|
50362
|
+
description: app?.description || pkg?.description || readmeDesc || "",
|
|
50363
|
+
version,
|
|
50364
|
+
runtime: app?.runtime || [],
|
|
50365
|
+
entry: app?.entry || "",
|
|
50366
|
+
path: directory,
|
|
50367
|
+
origin: app
|
|
50368
|
+
};
|
|
50369
|
+
app.key = key;
|
|
50370
|
+
if (app.type === "pm2-system-app") {
|
|
50371
|
+
const pm2Cwd = path6.join(_appPath, "..");
|
|
50372
|
+
showAppInfo.pm2Options = { cwd: pm2Cwd, ...app.pm2Options };
|
|
50373
|
+
}
|
|
50374
|
+
return { pkg, showAppInfo };
|
|
50375
|
+
};
|
|
50376
|
+
var getAppPathKeys2 = async (_appPath) => {
|
|
50377
|
+
const directory = path6.resolve(_appPath);
|
|
50378
|
+
const root3 = directory;
|
|
50379
|
+
const path1 = "*/package.json";
|
|
50380
|
+
const path22 = "*/*/package.json";
|
|
50381
|
+
const appsPackages = await import_fast_glob.default([path1, path22], {
|
|
50382
|
+
cwd: root3,
|
|
50383
|
+
onlyFiles: true,
|
|
50384
|
+
absolute: false,
|
|
50385
|
+
ignore: ["**/node_modules/**"]
|
|
50386
|
+
});
|
|
50387
|
+
const appPathKeys = appsPackages.map((pkg) => {
|
|
50388
|
+
const dir = path6.dirname(pkg);
|
|
50389
|
+
return dir.replace(/\\/g, "/");
|
|
50390
|
+
});
|
|
50391
|
+
return appPathKeys;
|
|
50392
|
+
};
|
|
50393
|
+
|
|
50394
|
+
// src/module/assistant/local-app-manager/assistant-app.ts
|
|
50395
|
+
var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
50396
|
+
import path7 from "node:path";
|
|
50397
|
+
import fs8 from "node:fs";
|
|
50398
|
+
|
|
50399
|
+
class AssistantApp extends Manager2 {
|
|
50400
|
+
config;
|
|
50401
|
+
pagesPath;
|
|
50402
|
+
constructor(config, mainApp) {
|
|
50403
|
+
config.checkMounted();
|
|
50404
|
+
const appsPath = config?.configPath?.appsDir || path7.join(process.cwd(), "apps");
|
|
50405
|
+
const pagesPath = config?.configPath?.pagesDir || path7.join(process.cwd(), "pages");
|
|
50406
|
+
const appsConfigPath = config.configPath?.appsConfigPath;
|
|
50407
|
+
const configFimename = path7.basename(appsConfigPath || "");
|
|
50408
|
+
super({
|
|
50409
|
+
appsPath,
|
|
50410
|
+
configFilename: configFimename,
|
|
50411
|
+
mainApp
|
|
50412
|
+
});
|
|
50413
|
+
this.pagesPath = pagesPath;
|
|
50414
|
+
this.config = config;
|
|
50415
|
+
}
|
|
50416
|
+
async pageList() {
|
|
50417
|
+
const pages = await import_fast_glob2.default(["*/*/package.json"], {
|
|
50418
|
+
cwd: this.pagesPath,
|
|
50419
|
+
onlyFiles: true
|
|
50420
|
+
});
|
|
50421
|
+
const pagesParse = pages.map((page) => {
|
|
50422
|
+
const [user, app] = page.split("/");
|
|
50423
|
+
const contentStr = fs8.readFileSync(path7.join(this.pagesPath, page), "utf-8");
|
|
50424
|
+
const content = parseIfJson(contentStr);
|
|
50425
|
+
return {
|
|
50426
|
+
user,
|
|
50427
|
+
app,
|
|
50428
|
+
version: content?.version,
|
|
50429
|
+
title: content?.title || "",
|
|
50430
|
+
description: content?.description || "",
|
|
50431
|
+
content
|
|
50432
|
+
};
|
|
50433
|
+
});
|
|
50434
|
+
return pagesParse;
|
|
50435
|
+
}
|
|
50436
|
+
async getPageAndAppList() {
|
|
50437
|
+
const root3 = this.config.configPath.configDir;
|
|
50438
|
+
const path1 = "apps/*/*/package.json";
|
|
50439
|
+
const path22 = "pages/*/*/package.json";
|
|
50440
|
+
const pages = await import_fast_glob2.default([path1, path22], {
|
|
50441
|
+
cwd: root3,
|
|
50442
|
+
onlyFiles: true
|
|
50443
|
+
});
|
|
50444
|
+
const pagesParse = pages.map((page) => {
|
|
50445
|
+
const relativePath = page;
|
|
50446
|
+
const contentStr = fs8.readFileSync(path7.join(root3, page), "utf-8");
|
|
50447
|
+
const content = parseIfJson(contentStr);
|
|
50448
|
+
if (!content.appType) {
|
|
50449
|
+
const isWeb = relativePath.startsWith("pages/");
|
|
50450
|
+
content.appType = isWeb ? "web" : "app";
|
|
50451
|
+
}
|
|
50452
|
+
return {
|
|
50453
|
+
...content,
|
|
50454
|
+
filepath: relativePath
|
|
50455
|
+
};
|
|
50456
|
+
});
|
|
50457
|
+
return pagesParse;
|
|
50458
|
+
}
|
|
50459
|
+
}
|
|
50460
|
+
// ../node_modules/.pnpm/@kevisual+query@0.0.31/node_modules/@kevisual/query/dist/query.js
|
|
50461
|
+
var isTextForContentType = (contentType) => {
|
|
50462
|
+
if (!contentType)
|
|
50463
|
+
return false;
|
|
50464
|
+
const textTypes = ["text/", "xml", "html", "javascript", "css", "csv", "plain", "x-www-form-urlencoded", "md"];
|
|
50465
|
+
return textTypes.some((type) => contentType.includes(type));
|
|
50466
|
+
};
|
|
50467
|
+
var adapter = async (opts = {}, overloadOpts) => {
|
|
50468
|
+
const controller = new AbortController;
|
|
50469
|
+
const signal = controller.signal;
|
|
50470
|
+
const isPostFile = opts.isPostFile || false;
|
|
50471
|
+
let responseType = opts.responseType || "json";
|
|
50472
|
+
if (opts.isBlob) {
|
|
50473
|
+
responseType = "blob";
|
|
50474
|
+
} else if (opts.isText) {
|
|
50475
|
+
responseType = "text";
|
|
50476
|
+
}
|
|
50477
|
+
const timeout = opts.timeout || 60000 * 3;
|
|
50478
|
+
const timer = setTimeout(() => {
|
|
50479
|
+
controller.abort();
|
|
50480
|
+
}, timeout);
|
|
50481
|
+
let method = overloadOpts?.method || opts?.method || "POST";
|
|
50482
|
+
let headers = { ...opts?.headers, ...overloadOpts?.headers };
|
|
50483
|
+
let origin = "";
|
|
50484
|
+
let url;
|
|
50485
|
+
if (opts?.url?.startsWith("http")) {
|
|
50486
|
+
url = new URL(opts.url);
|
|
50487
|
+
} else {
|
|
50488
|
+
origin = window?.location?.origin || "http://localhost:51015";
|
|
50489
|
+
url = new URL(opts.url, origin);
|
|
50490
|
+
}
|
|
50491
|
+
const isGet = method === "GET";
|
|
50492
|
+
if (isGet) {
|
|
50493
|
+
url.search = new URLSearchParams(opts.body).toString();
|
|
50494
|
+
} else {
|
|
50495
|
+
const params = opts.params || {};
|
|
50496
|
+
url.search = new URLSearchParams(params).toString();
|
|
50497
|
+
}
|
|
50498
|
+
let body = undefined;
|
|
50499
|
+
if (isGet) {
|
|
50500
|
+
body = undefined;
|
|
50501
|
+
} else if (isPostFile) {
|
|
50502
|
+
body = opts.body;
|
|
50503
|
+
} else {
|
|
50504
|
+
headers = {
|
|
50505
|
+
"Content-Type": "application/json",
|
|
50506
|
+
...headers
|
|
50507
|
+
};
|
|
50508
|
+
body = JSON.stringify(opts.body);
|
|
50509
|
+
}
|
|
50510
|
+
return fetch(url, {
|
|
50511
|
+
method: method.toUpperCase(),
|
|
50512
|
+
signal,
|
|
50513
|
+
body,
|
|
50514
|
+
...overloadOpts,
|
|
50515
|
+
headers
|
|
50516
|
+
}).then(async (response) => {
|
|
50517
|
+
const contentType = response.headers.get("Content-Type");
|
|
50518
|
+
if (responseType === "blob") {
|
|
50519
|
+
return await response.blob();
|
|
50520
|
+
}
|
|
50521
|
+
const isText = responseType === "text";
|
|
50522
|
+
const isJson = contentType && contentType.includes("application/json");
|
|
50523
|
+
if (isJson && !isText) {
|
|
50524
|
+
return await response.json();
|
|
50525
|
+
} else if (isTextForContentType(contentType)) {
|
|
50526
|
+
return {
|
|
50527
|
+
code: 200,
|
|
50528
|
+
status: response.status,
|
|
50529
|
+
data: await response.text()
|
|
50530
|
+
};
|
|
50531
|
+
} else {
|
|
50532
|
+
return response;
|
|
50533
|
+
}
|
|
50534
|
+
}).catch((err) => {
|
|
50535
|
+
if (err.name === "AbortError") {
|
|
50536
|
+
console.log("Request timed out and was aborted");
|
|
50537
|
+
}
|
|
50538
|
+
console.error(err);
|
|
50539
|
+
return {
|
|
50540
|
+
code: 500
|
|
50541
|
+
};
|
|
50542
|
+
}).finally(() => {
|
|
50543
|
+
clearTimeout(timer);
|
|
50544
|
+
});
|
|
50545
|
+
};
|
|
50546
|
+
var setBaseResponse = (res) => {
|
|
50547
|
+
res.success = res.code === 200;
|
|
50548
|
+
res.showError = (fn) => {
|
|
50549
|
+
if (!res.success && !res.noMsg) {
|
|
50550
|
+
fn?.();
|
|
50551
|
+
}
|
|
50552
|
+
};
|
|
50553
|
+
return res;
|
|
50554
|
+
};
|
|
50555
|
+
var wrapperError = ({ code, message }) => {
|
|
50556
|
+
const result = {
|
|
50557
|
+
code: code || 500,
|
|
50558
|
+
success: false,
|
|
50559
|
+
message: message || "api request error",
|
|
50560
|
+
showError: (fn) => {},
|
|
50561
|
+
noMsg: true
|
|
50562
|
+
};
|
|
50563
|
+
return result;
|
|
50564
|
+
};
|
|
50565
|
+
|
|
50566
|
+
class Query {
|
|
50567
|
+
adapter;
|
|
50568
|
+
url;
|
|
50569
|
+
beforeRequest;
|
|
50570
|
+
afterResponse;
|
|
50571
|
+
headers;
|
|
50572
|
+
timeout;
|
|
50573
|
+
stop;
|
|
50574
|
+
qws;
|
|
50575
|
+
constructor(opts) {
|
|
50576
|
+
this.adapter = opts?.adapter || adapter;
|
|
50577
|
+
this.url = opts?.url || "/api/router";
|
|
50578
|
+
this.headers = opts?.headers || {
|
|
50579
|
+
"Content-Type": "application/json"
|
|
50580
|
+
};
|
|
50581
|
+
this.timeout = opts?.timeout || 60000 * 3;
|
|
50582
|
+
}
|
|
50583
|
+
setQueryWs(qws) {
|
|
50584
|
+
this.qws = qws;
|
|
50585
|
+
}
|
|
50586
|
+
setStop(stop4) {
|
|
50587
|
+
this.stop = stop4;
|
|
50588
|
+
}
|
|
50589
|
+
async get(params, options) {
|
|
50590
|
+
return this.post(params, options);
|
|
50591
|
+
}
|
|
50592
|
+
async post(body, options) {
|
|
50593
|
+
const url = options?.url || this.url;
|
|
50594
|
+
const { headers, adapter: adapter2, beforeRequest, afterResponse, timeout, ...rest } = options || {};
|
|
50595
|
+
const _headers = { ...this.headers, ...headers };
|
|
50596
|
+
const _adapter = adapter2 || this.adapter;
|
|
50597
|
+
const _beforeRequest = beforeRequest || this.beforeRequest;
|
|
50598
|
+
const _afterResponse = afterResponse || this.afterResponse;
|
|
50599
|
+
const _timeout = timeout || this.timeout;
|
|
50600
|
+
const req = {
|
|
50601
|
+
url,
|
|
50602
|
+
headers: _headers,
|
|
50603
|
+
body,
|
|
50604
|
+
timeout: _timeout,
|
|
50605
|
+
...rest
|
|
50606
|
+
};
|
|
50607
|
+
try {
|
|
50608
|
+
if (_beforeRequest) {
|
|
50609
|
+
const res = await _beforeRequest(req);
|
|
50610
|
+
if (res === false) {
|
|
50611
|
+
return wrapperError({
|
|
50612
|
+
code: 500,
|
|
50613
|
+
message: "request is cancel",
|
|
50614
|
+
req
|
|
50615
|
+
});
|
|
50616
|
+
}
|
|
50617
|
+
}
|
|
50618
|
+
} catch (e) {
|
|
50619
|
+
console.error("request beforeFn error", e, req);
|
|
50620
|
+
return wrapperError({
|
|
50621
|
+
code: 500,
|
|
50622
|
+
message: "api request beforeFn error"
|
|
50623
|
+
});
|
|
50624
|
+
}
|
|
50625
|
+
if (this.stop && !options?.noStop) {
|
|
50626
|
+
const that = this;
|
|
50627
|
+
await new Promise((resolve) => {
|
|
50628
|
+
let timer = 0;
|
|
50629
|
+
const detect = setInterval(() => {
|
|
50630
|
+
if (!that.stop) {
|
|
50631
|
+
clearInterval(detect);
|
|
50632
|
+
resolve(true);
|
|
50633
|
+
}
|
|
50634
|
+
timer++;
|
|
50635
|
+
if (timer > 30) {
|
|
50636
|
+
console.error("request stop: timeout", req.url, timer);
|
|
50637
|
+
}
|
|
50638
|
+
}, 1000);
|
|
50639
|
+
});
|
|
50640
|
+
}
|
|
50641
|
+
return _adapter(req).then(async (res) => {
|
|
50642
|
+
try {
|
|
50643
|
+
setBaseResponse(res);
|
|
50644
|
+
if (_afterResponse) {
|
|
50645
|
+
return await _afterResponse(res, {
|
|
50646
|
+
req,
|
|
50647
|
+
res,
|
|
50648
|
+
fetch: adapter2
|
|
50649
|
+
});
|
|
50650
|
+
}
|
|
50651
|
+
return res;
|
|
50652
|
+
} catch (e) {
|
|
50653
|
+
console.error("request afterFn error", e, req);
|
|
50654
|
+
return wrapperError({
|
|
50655
|
+
code: 500,
|
|
50656
|
+
message: "api request afterFn error"
|
|
50657
|
+
});
|
|
50658
|
+
}
|
|
50659
|
+
});
|
|
50660
|
+
}
|
|
50661
|
+
before(fn) {
|
|
50662
|
+
this.beforeRequest = fn;
|
|
50663
|
+
}
|
|
50664
|
+
after(fn) {
|
|
50665
|
+
this.afterResponse = fn;
|
|
50666
|
+
}
|
|
50667
|
+
async fetchText(urlOrOptions, options) {
|
|
50668
|
+
let _options = { ...options };
|
|
50669
|
+
if (typeof urlOrOptions === "string" && !_options.url) {
|
|
50670
|
+
_options.url = urlOrOptions;
|
|
50671
|
+
}
|
|
50672
|
+
if (typeof urlOrOptions === "object") {
|
|
50673
|
+
_options = { ...urlOrOptions, ..._options };
|
|
50674
|
+
}
|
|
50675
|
+
const res = await adapter({
|
|
50676
|
+
method: "GET",
|
|
50677
|
+
..._options,
|
|
50678
|
+
headers: {
|
|
50679
|
+
...this.headers,
|
|
50680
|
+
..._options?.headers || {}
|
|
50681
|
+
}
|
|
50682
|
+
});
|
|
50683
|
+
return setBaseResponse(res);
|
|
50684
|
+
}
|
|
50685
|
+
}
|
|
50686
|
+
// src/config.ts
|
|
50687
|
+
var _configDir = parseHomeArg(configDir).configDir;
|
|
50688
|
+
var configDir2 = AssistantConfig.detectConfigDir(_configDir);
|
|
50689
|
+
var assistantConfig2 = new AssistantConfig({
|
|
50690
|
+
configDir: configDir2,
|
|
50691
|
+
init: false
|
|
50692
|
+
});
|
|
50693
|
+
|
|
50694
|
+
// src/program.ts
|
|
50695
|
+
import fs9 from "fs";
|
|
50696
|
+
var version = "0.0.1";
|
|
50697
|
+
try {
|
|
50698
|
+
if ("0.0.6")
|
|
49003
50699
|
version = "0.0.6";
|
|
49004
50700
|
} catch (e) {}
|
|
49005
50701
|
program.name("asst").description("A CLI tool with envison").version(version, "-v, --version", "output the current version");
|
|
49006
50702
|
var ls = new Command("ls").description("List files in the current directory").action(() => {
|
|
49007
50703
|
console.log("List files");
|
|
49008
|
-
console.log(
|
|
50704
|
+
console.log(fs9.readdirSync(process.cwd()));
|
|
49009
50705
|
});
|
|
49010
50706
|
program.addCommand(ls);
|
|
49011
50707
|
var runProgram = (args) => {
|
|
@@ -49014,8 +50710,8 @@ var runProgram = (args) => {
|
|
|
49014
50710
|
};
|
|
49015
50711
|
|
|
49016
50712
|
// src/services/init/index.ts
|
|
49017
|
-
import
|
|
49018
|
-
import
|
|
50713
|
+
import fs11 from "node:fs";
|
|
50714
|
+
import path9 from "node:path";
|
|
49019
50715
|
|
|
49020
50716
|
// ../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
49021
50717
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -50612,12 +52308,12 @@ function requireUtil() {
|
|
|
50612
52308
|
util$1.deflate = function(api, bytes, raw) {
|
|
50613
52309
|
bytes = util$1.decode64(api.deflate(util$1.encode64(bytes)).rval);
|
|
50614
52310
|
if (raw) {
|
|
50615
|
-
var
|
|
52311
|
+
var start4 = 2;
|
|
50616
52312
|
var flg = bytes.charCodeAt(1);
|
|
50617
52313
|
if (flg & 32) {
|
|
50618
|
-
|
|
52314
|
+
start4 = 6;
|
|
50619
52315
|
}
|
|
50620
|
-
bytes = bytes.substring(
|
|
52316
|
+
bytes = bytes.substring(start4, bytes.length - 4);
|
|
50621
52317
|
}
|
|
50622
52318
|
return bytes;
|
|
50623
52319
|
};
|
|
@@ -51996,7 +53692,7 @@ function requireAes() {
|
|
|
51996
53692
|
} else {
|
|
51997
53693
|
cipher2 = forge2.cipher.createCipher(algorithm, options.key);
|
|
51998
53694
|
}
|
|
51999
|
-
var
|
|
53695
|
+
var start4 = cipher2.start;
|
|
52000
53696
|
cipher2.start = function(iv, options2) {
|
|
52001
53697
|
var output = null;
|
|
52002
53698
|
if (options2 instanceof forge2.util.ByteBuffer) {
|
|
@@ -52006,7 +53702,7 @@ function requireAes() {
|
|
|
52006
53702
|
options2 = options2 || {};
|
|
52007
53703
|
options2.output = output;
|
|
52008
53704
|
options2.iv = iv;
|
|
52009
|
-
|
|
53705
|
+
start4.call(cipher2, options2);
|
|
52010
53706
|
};
|
|
52011
53707
|
return cipher2;
|
|
52012
53708
|
}
|
|
@@ -52353,15 +54049,15 @@ function requireAsn1() {
|
|
|
52353
54049
|
return value;
|
|
52354
54050
|
};
|
|
52355
54051
|
function _fromDer(bytes, remaining, depth, options) {
|
|
52356
|
-
var
|
|
54052
|
+
var start4;
|
|
52357
54053
|
_checkBufferLength(bytes, remaining, 2);
|
|
52358
54054
|
var b1 = bytes.getByte();
|
|
52359
54055
|
remaining--;
|
|
52360
54056
|
var tagClass = b1 & 192;
|
|
52361
54057
|
var type = b1 & 31;
|
|
52362
|
-
|
|
54058
|
+
start4 = bytes.length();
|
|
52363
54059
|
var length = _getValueLength(bytes, remaining);
|
|
52364
|
-
remaining -=
|
|
54060
|
+
remaining -= start4 - bytes.length();
|
|
52365
54061
|
if (length !== undefined && length > remaining) {
|
|
52366
54062
|
if (options.strict) {
|
|
52367
54063
|
var error2 = new Error("Too few bytes to read ASN.1 value.");
|
|
@@ -52385,16 +54081,16 @@ function requireAsn1() {
|
|
|
52385
54081
|
remaining -= 2;
|
|
52386
54082
|
break;
|
|
52387
54083
|
}
|
|
52388
|
-
|
|
54084
|
+
start4 = bytes.length();
|
|
52389
54085
|
value.push(_fromDer(bytes, remaining, depth + 1, options));
|
|
52390
|
-
remaining -=
|
|
54086
|
+
remaining -= start4 - bytes.length();
|
|
52391
54087
|
}
|
|
52392
54088
|
} else {
|
|
52393
54089
|
while (length > 0) {
|
|
52394
|
-
|
|
54090
|
+
start4 = bytes.length();
|
|
52395
54091
|
value.push(_fromDer(bytes, length, depth + 1, options));
|
|
52396
|
-
remaining -=
|
|
52397
|
-
length -=
|
|
54092
|
+
remaining -= start4 - bytes.length();
|
|
54093
|
+
length -= start4 - bytes.length();
|
|
52398
54094
|
}
|
|
52399
54095
|
}
|
|
52400
54096
|
}
|
|
@@ -52412,13 +54108,13 @@ function requireAsn1() {
|
|
|
52412
54108
|
}
|
|
52413
54109
|
if (unused === 0) {
|
|
52414
54110
|
try {
|
|
52415
|
-
|
|
54111
|
+
start4 = bytes.length();
|
|
52416
54112
|
var subOptions = {
|
|
52417
54113
|
strict: true,
|
|
52418
54114
|
decodeBitStrings: true
|
|
52419
54115
|
};
|
|
52420
54116
|
var composed = _fromDer(bytes, remaining, depth + 1, subOptions);
|
|
52421
|
-
var used =
|
|
54117
|
+
var used = start4 - bytes.length();
|
|
52422
54118
|
remaining -= used;
|
|
52423
54119
|
if (type == asn1$1.Type.BITSTRING) {
|
|
52424
54120
|
used++;
|
|
@@ -53703,7 +55399,7 @@ function requireDes() {
|
|
|
53703
55399
|
} else {
|
|
53704
55400
|
cipher2 = forge2.cipher.createCipher(algorithm, options.key);
|
|
53705
55401
|
}
|
|
53706
|
-
var
|
|
55402
|
+
var start4 = cipher2.start;
|
|
53707
55403
|
cipher2.start = function(iv, options2) {
|
|
53708
55404
|
var output = null;
|
|
53709
55405
|
if (options2 instanceof forge2.util.ByteBuffer) {
|
|
@@ -53713,7 +55409,7 @@ function requireDes() {
|
|
|
53713
55409
|
options2 = options2 || {};
|
|
53714
55410
|
options2.output = output;
|
|
53715
55411
|
options2.iv = iv;
|
|
53716
|
-
|
|
55412
|
+
start4.call(cipher2, options2);
|
|
53717
55413
|
};
|
|
53718
55414
|
return cipher2;
|
|
53719
55415
|
}
|
|
@@ -56594,7 +58290,7 @@ function requirePrime() {
|
|
|
56594
58290
|
_primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback);
|
|
56595
58291
|
}
|
|
56596
58292
|
function _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) {
|
|
56597
|
-
var
|
|
58293
|
+
var start4 = +new Date;
|
|
56598
58294
|
do {
|
|
56599
58295
|
if (num.bitLength() > bits) {
|
|
56600
58296
|
num = generateRandom(bits, rng);
|
|
@@ -56603,7 +58299,7 @@ function requirePrime() {
|
|
|
56603
58299
|
return callback(null, num);
|
|
56604
58300
|
}
|
|
56605
58301
|
num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0);
|
|
56606
|
-
} while (maxBlockTime < 0 || +new Date -
|
|
58302
|
+
} while (maxBlockTime < 0 || +new Date - start4 < maxBlockTime);
|
|
56607
58303
|
forge2.util.setImmediate(function() {
|
|
56608
58304
|
_primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback);
|
|
56609
58305
|
});
|
|
@@ -66245,8 +67941,8 @@ var createCert = (attrs = [], altNames = []) => {
|
|
|
66245
67941
|
};
|
|
66246
67942
|
|
|
66247
67943
|
// src/module/assistant/https/sign.ts
|
|
66248
|
-
import
|
|
66249
|
-
import
|
|
67944
|
+
import path8 from "node:path";
|
|
67945
|
+
import fs10 from "node:fs";
|
|
66250
67946
|
var import_dayjs = __toESM(require_dayjs_min(), 1);
|
|
66251
67947
|
|
|
66252
67948
|
class HttpsPem {
|
|
@@ -66271,8 +67967,8 @@ class HttpsPem {
|
|
|
66271
67967
|
const keyPath = config2.https.keyPath;
|
|
66272
67968
|
const certPath = config2.https.certPath;
|
|
66273
67969
|
if (checkFileExists(keyPath) && checkFileExists(certPath)) {
|
|
66274
|
-
this.key =
|
|
66275
|
-
this.cert =
|
|
67970
|
+
this.key = fs10.readFileSync(keyPath, "utf-8");
|
|
67971
|
+
this.cert = fs10.readFileSync(certPath, "utf-8");
|
|
66276
67972
|
console.log(chalk2.green("使用配置文件 https.keyPath 和 https.certPath 的证书"), keyPath, certPath);
|
|
66277
67973
|
return;
|
|
66278
67974
|
} else {
|
|
@@ -66288,9 +67984,9 @@ class HttpsPem {
|
|
|
66288
67984
|
}
|
|
66289
67985
|
getPemDir() {
|
|
66290
67986
|
const configDir3 = this.assistantConfig.configPath?.configDir || process.cwd();
|
|
66291
|
-
const pemDir =
|
|
67987
|
+
const pemDir = path8.join(configDir3, "pem");
|
|
66292
67988
|
if (!checkFileExists(pemDir)) {
|
|
66293
|
-
|
|
67989
|
+
fs10.mkdirSync(pemDir, { recursive: true });
|
|
66294
67990
|
}
|
|
66295
67991
|
return pemDir;
|
|
66296
67992
|
}
|
|
@@ -66299,14 +67995,14 @@ class HttpsPem {
|
|
|
66299
67995
|
return;
|
|
66300
67996
|
const pemDir = this.getPemDir();
|
|
66301
67997
|
const pemPath = {
|
|
66302
|
-
key:
|
|
66303
|
-
cert:
|
|
66304
|
-
config:
|
|
67998
|
+
key: path8.join(pemDir, "https-private-key.pem"),
|
|
67999
|
+
cert: path8.join(pemDir, "https-cert.pem"),
|
|
68000
|
+
config: path8.join(pemDir, "https-config.json")
|
|
66305
68001
|
};
|
|
66306
68002
|
const writeCreate = (opts) => {
|
|
66307
|
-
|
|
66308
|
-
|
|
66309
|
-
|
|
68003
|
+
fs10.writeFileSync(pemPath.key, opts.key);
|
|
68004
|
+
fs10.writeFileSync(pemPath.cert, opts.cert);
|
|
68005
|
+
fs10.writeFileSync(pemPath.config, JSON.stringify(opts.data, null, 2));
|
|
66310
68006
|
};
|
|
66311
68007
|
if (!checkFileExists(pemPath.key) || !checkFileExists(pemPath.cert)) {
|
|
66312
68008
|
const { key: key2, cert: cert2, data } = this.createCert();
|
|
@@ -66319,11 +68015,11 @@ class HttpsPem {
|
|
|
66319
68015
|
}
|
|
66320
68016
|
if (!checkFileExists(pemPath.config)) {
|
|
66321
68017
|
const data = this.createExpireData();
|
|
66322
|
-
|
|
68018
|
+
fs10.writeFileSync(pemPath.config, JSON.stringify(data, null, 2));
|
|
66323
68019
|
}
|
|
66324
|
-
const key =
|
|
66325
|
-
const cert =
|
|
66326
|
-
const config2 =
|
|
68020
|
+
const key = fs10.readFileSync(pemPath.key, "utf-8");
|
|
68021
|
+
const cert = fs10.readFileSync(pemPath.cert, "utf-8");
|
|
68022
|
+
const config2 = fs10.readFileSync(pemPath.config, "utf-8");
|
|
66327
68023
|
let expireTime = 0;
|
|
66328
68024
|
try {
|
|
66329
68025
|
const data = JSON.parse(config2);
|
|
@@ -66363,18 +68059,18 @@ class HttpsPem {
|
|
|
66363
68059
|
removeCert() {
|
|
66364
68060
|
const pemDir = this.getPemDir();
|
|
66365
68061
|
const pemPath = {
|
|
66366
|
-
key:
|
|
66367
|
-
cert:
|
|
68062
|
+
key: path8.join(pemDir, "https-private-key.pem"),
|
|
68063
|
+
cert: path8.join(pemDir, "https-cert.pem")
|
|
66368
68064
|
};
|
|
66369
68065
|
const oldPath = {
|
|
66370
|
-
key:
|
|
66371
|
-
cert:
|
|
68066
|
+
key: path8.join(pemDir, "https-private-key.pem.bak"),
|
|
68067
|
+
cert: path8.join(pemDir, "https-cert.pem.bak")
|
|
66372
68068
|
};
|
|
66373
68069
|
if (checkFileExists(pemPath.key)) {
|
|
66374
|
-
|
|
68070
|
+
fs10.renameSync(pemPath.key, oldPath.key);
|
|
66375
68071
|
}
|
|
66376
68072
|
if (checkFileExists(pemPath.cert)) {
|
|
66377
|
-
|
|
68073
|
+
fs10.renameSync(pemPath.cert, oldPath.cert);
|
|
66378
68074
|
}
|
|
66379
68075
|
}
|
|
66380
68076
|
createCert(attrs, altNames) {
|
|
@@ -66470,13 +68166,13 @@ class AssistantInit extends AssistantConfig {
|
|
|
66470
68166
|
});
|
|
66471
68167
|
}
|
|
66472
68168
|
checkConfigPath() {
|
|
66473
|
-
const assistantPath =
|
|
68169
|
+
const assistantPath = path9.join(this.configDir, "assistant-app", "assistant-config.json");
|
|
66474
68170
|
return checkFileExists(assistantPath);
|
|
66475
68171
|
}
|
|
66476
68172
|
createEnvConfig() {
|
|
66477
68173
|
const env3 = this.configPath?.envConfigPath;
|
|
66478
68174
|
if (!checkFileExists(env3, true)) {
|
|
66479
|
-
|
|
68175
|
+
fs11.writeFileSync(env3, `# 环境配置文件
|
|
66480
68176
|
`);
|
|
66481
68177
|
console.log(chalk2.green("助手环境配置.env文件创建成功"));
|
|
66482
68178
|
}
|
|
@@ -66484,10 +68180,10 @@ class AssistantInit extends AssistantConfig {
|
|
|
66484
68180
|
createOtherConfig() {
|
|
66485
68181
|
const appsConfig = this.configPath?.appsConfigPath;
|
|
66486
68182
|
if (!checkFileExists(appsConfig, true)) {
|
|
66487
|
-
|
|
68183
|
+
fs11.writeFileSync(appsConfig, JSON.stringify({ description: "apps manager.", list: [] }));
|
|
66488
68184
|
console.log(chalk2.green("助手应用配置文件 apps.json 创建成功"));
|
|
66489
68185
|
}
|
|
66490
|
-
const pemDir =
|
|
68186
|
+
const pemDir = path9.join(this.configPath?.configDir, "pem");
|
|
66491
68187
|
const httpsPem = new HttpsPem(this);
|
|
66492
68188
|
if (httpsPem.isHttps) {
|
|
66493
68189
|
if (!checkFileExists(pemDir)) {
|
|
@@ -66503,20 +68199,20 @@ class AssistantInit extends AssistantConfig {
|
|
|
66503
68199
|
}
|
|
66504
68200
|
}
|
|
66505
68201
|
initPnpm() {
|
|
66506
|
-
const pnpmPath =
|
|
68202
|
+
const pnpmPath = path9.join(this.configDir, "assistant-app", "pnpm-workspace.yaml");
|
|
66507
68203
|
let create = false;
|
|
66508
68204
|
if (!checkFileExists(pnpmPath, true)) {
|
|
66509
68205
|
create = true;
|
|
66510
|
-
|
|
68206
|
+
fs11.writeFileSync(pnpmPath, `packages:
|
|
66511
68207
|
- 'apps/**/*'
|
|
66512
68208
|
- 'pages/**/*'
|
|
66513
68209
|
`);
|
|
66514
68210
|
console.log(chalk2.green("助手 pnpm-workspace.yaml 文件创建成功"));
|
|
66515
68211
|
}
|
|
66516
|
-
const packagePath =
|
|
68212
|
+
const packagePath = path9.join(this.configDir, "assistant-app", "package.json");
|
|
66517
68213
|
if (!checkFileExists(packagePath, true)) {
|
|
66518
68214
|
create = true;
|
|
66519
|
-
|
|
68215
|
+
fs11.writeFileSync(packagePath, `{
|
|
66520
68216
|
"name": "assistant-app",
|
|
66521
68217
|
"version": "1.0.0",
|
|
66522
68218
|
"description": "assistant-app package pnpm, node pkgs projects",
|
|
@@ -66552,7 +68248,7 @@ class AssistantInit extends AssistantConfig {
|
|
|
66552
68248
|
}
|
|
66553
68249
|
`);
|
|
66554
68250
|
console.log(chalk2.green("助手 package.json 文件创建成功, 正在安装依赖..."));
|
|
66555
|
-
installDeps({ appPath:
|
|
68251
|
+
installDeps({ appPath: path9.dirname(packagePath), isProduction: true }).then(() => {
|
|
66556
68252
|
console.log(chalk2.green("助手依赖安装完成"));
|
|
66557
68253
|
});
|
|
66558
68254
|
}
|
|
@@ -66586,10 +68282,10 @@ class AssistantInit extends AssistantConfig {
|
|
|
66586
68282
|
}
|
|
66587
68283
|
|
|
66588
68284
|
// src/command/config-manager/index.ts
|
|
66589
|
-
import
|
|
66590
|
-
import
|
|
68285
|
+
import path11 from "node:path";
|
|
68286
|
+
import fs12 from "node:fs";
|
|
66591
68287
|
|
|
66592
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68288
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/key.js
|
|
66593
68289
|
var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
|
|
66594
68290
|
var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
|
|
66595
68291
|
var isSpaceKey = (key) => key.name === "space";
|
|
@@ -66597,7 +68293,7 @@ var isBackspaceKey = (key) => key.name === "backspace";
|
|
|
66597
68293
|
var isTabKey = (key) => key.name === "tab";
|
|
66598
68294
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
66599
68295
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
66600
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68296
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/errors.js
|
|
66601
68297
|
class AbortPromptError extends Error {
|
|
66602
68298
|
name = "AbortPromptError";
|
|
66603
68299
|
message = "Prompt was aborted";
|
|
@@ -66623,10 +68319,10 @@ class HookError extends Error {
|
|
|
66623
68319
|
class ValidationError extends Error {
|
|
66624
68320
|
name = "ValidationError";
|
|
66625
68321
|
}
|
|
66626
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68322
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
66627
68323
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
66628
68324
|
|
|
66629
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68325
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
66630
68326
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
66631
68327
|
var hookStorage = new AsyncLocalStorage;
|
|
66632
68328
|
function createStore(rl) {
|
|
@@ -66731,7 +68427,7 @@ var effectScheduler = {
|
|
|
66731
68427
|
}
|
|
66732
68428
|
};
|
|
66733
68429
|
|
|
66734
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68430
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
66735
68431
|
function useState(defaultValue) {
|
|
66736
68432
|
return withPointer((pointer) => {
|
|
66737
68433
|
const setState = AsyncResource2.bind(function setState(newValue) {
|
|
@@ -66749,7 +68445,7 @@ function useState(defaultValue) {
|
|
|
66749
68445
|
});
|
|
66750
68446
|
}
|
|
66751
68447
|
|
|
66752
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68448
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
66753
68449
|
function useEffect(cb, depArray) {
|
|
66754
68450
|
withPointer((pointer) => {
|
|
66755
68451
|
const oldDeps = pointer.get();
|
|
@@ -66761,10 +68457,10 @@ function useEffect(cb, depArray) {
|
|
|
66761
68457
|
});
|
|
66762
68458
|
}
|
|
66763
68459
|
|
|
66764
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68460
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/theme.js
|
|
66765
68461
|
import { styleText } from "node:util";
|
|
66766
68462
|
|
|
66767
|
-
// ../node_modules/.pnpm/@inquirer+figures@2.0.
|
|
68463
|
+
// ../node_modules/.pnpm/@inquirer+figures@2.0.2/node_modules/@inquirer/figures/dist/index.js
|
|
66768
68464
|
import process5 from "node:process";
|
|
66769
68465
|
function isUnicodeSupported() {
|
|
66770
68466
|
if (process5.platform !== "win32") {
|
|
@@ -67053,7 +68749,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
67053
68749
|
var dist_default = figures;
|
|
67054
68750
|
var replacements = Object.entries(specialMainSymbols);
|
|
67055
68751
|
|
|
67056
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68752
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/theme.js
|
|
67057
68753
|
var defaultTheme = {
|
|
67058
68754
|
prefix: {
|
|
67059
68755
|
idle: styleText("blue", "?"),
|
|
@@ -67074,8 +68770,8 @@ var defaultTheme = {
|
|
|
67074
68770
|
}
|
|
67075
68771
|
};
|
|
67076
68772
|
|
|
67077
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
67078
|
-
function
|
|
68773
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
68774
|
+
function isPlainObject3(value) {
|
|
67079
68775
|
if (typeof value !== "object" || value === null)
|
|
67080
68776
|
return false;
|
|
67081
68777
|
let proto2 = value;
|
|
@@ -67089,7 +68785,7 @@ function deepMerge(...objects) {
|
|
|
67089
68785
|
for (const obj of objects) {
|
|
67090
68786
|
for (const [key, value] of Object.entries(obj)) {
|
|
67091
68787
|
const prevValue = output[key];
|
|
67092
|
-
output[key] =
|
|
68788
|
+
output[key] = isPlainObject3(prevValue) && isPlainObject3(value) ? deepMerge(prevValue, value) : value;
|
|
67093
68789
|
}
|
|
67094
68790
|
}
|
|
67095
68791
|
return output;
|
|
@@ -67102,7 +68798,7 @@ function makeTheme(...themes) {
|
|
|
67102
68798
|
return deepMerge(...themesToMerge);
|
|
67103
68799
|
}
|
|
67104
68800
|
|
|
67105
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68801
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
67106
68802
|
function usePrefix({ status = "idle", theme }) {
|
|
67107
68803
|
const [showLoader, setShowLoader] = useState(false);
|
|
67108
68804
|
const [tick, setTick] = useState(0);
|
|
@@ -67132,7 +68828,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
67132
68828
|
const iconName = status === "loading" ? "idle" : status;
|
|
67133
68829
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
67134
68830
|
}
|
|
67135
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68831
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
67136
68832
|
function useMemo(fn, dependencies) {
|
|
67137
68833
|
return withPointer((pointer) => {
|
|
67138
68834
|
const prev = pointer.get();
|
|
@@ -67144,11 +68840,11 @@ function useMemo(fn, dependencies) {
|
|
|
67144
68840
|
return prev.value;
|
|
67145
68841
|
});
|
|
67146
68842
|
}
|
|
67147
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68843
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
67148
68844
|
function useRef(val) {
|
|
67149
68845
|
return useState({ current: val })[0];
|
|
67150
68846
|
}
|
|
67151
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68847
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
67152
68848
|
function useKeypress(userHandler) {
|
|
67153
68849
|
const signal = useRef(userHandler);
|
|
67154
68850
|
signal.current = userHandler;
|
|
@@ -67166,7 +68862,7 @@ function useKeypress(userHandler) {
|
|
|
67166
68862
|
};
|
|
67167
68863
|
}, []);
|
|
67168
68864
|
}
|
|
67169
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
68865
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/utils.js
|
|
67170
68866
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
67171
68867
|
|
|
67172
68868
|
// ../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
|
|
@@ -67600,7 +69296,7 @@ function wrapAnsi(string2, columns, options) {
|
|
|
67600
69296
|
`);
|
|
67601
69297
|
}
|
|
67602
69298
|
|
|
67603
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
69299
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/utils.js
|
|
67604
69300
|
function breakLines(content, width) {
|
|
67605
69301
|
return content.split(`
|
|
67606
69302
|
`).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
|
|
@@ -67611,7 +69307,7 @@ function readlineWidth() {
|
|
|
67611
69307
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
67612
69308
|
}
|
|
67613
69309
|
|
|
67614
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
69310
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
67615
69311
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
67616
69312
|
const state = useRef({
|
|
67617
69313
|
lastPointer: active,
|
|
@@ -67677,7 +69373,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
67677
69373
|
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
67678
69374
|
`);
|
|
67679
69375
|
}
|
|
67680
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
69376
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
67681
69377
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
67682
69378
|
import * as readline2 from "node:readline";
|
|
67683
69379
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
@@ -67724,15 +69420,15 @@ class Emitter {
|
|
|
67724
69420
|
this.listeners[ev].push(fn);
|
|
67725
69421
|
}
|
|
67726
69422
|
removeListener(ev, fn) {
|
|
67727
|
-
const
|
|
67728
|
-
const i =
|
|
69423
|
+
const list4 = this.listeners[ev];
|
|
69424
|
+
const i = list4.indexOf(fn);
|
|
67729
69425
|
if (i === -1) {
|
|
67730
69426
|
return;
|
|
67731
69427
|
}
|
|
67732
|
-
if (i === 0 &&
|
|
67733
|
-
|
|
69428
|
+
if (i === 0 && list4.length === 1) {
|
|
69429
|
+
list4.length = 0;
|
|
67734
69430
|
} else {
|
|
67735
|
-
|
|
69431
|
+
list4.splice(i, 1);
|
|
67736
69432
|
}
|
|
67737
69433
|
}
|
|
67738
69434
|
emit(ev, code, signal) {
|
|
@@ -67890,10 +69586,10 @@ var {
|
|
|
67890
69586
|
unload
|
|
67891
69587
|
} = signalExitWrap(processOk(process6) ? new SignalExit(process6) : new SignalExitFallback);
|
|
67892
69588
|
|
|
67893
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
69589
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
67894
69590
|
import { stripVTControlCharacters } from "node:util";
|
|
67895
69591
|
|
|
67896
|
-
// ../node_modules/.pnpm/@inquirer+ansi@2.0.
|
|
69592
|
+
// ../node_modules/.pnpm/@inquirer+ansi@2.0.2/node_modules/@inquirer/ansi/dist/index.js
|
|
67897
69593
|
var ESC = "\x1B[";
|
|
67898
69594
|
var cursorLeft = ESC + "G";
|
|
67899
69595
|
var cursorHide = ESC + "?25l";
|
|
@@ -67909,7 +69605,7 @@ var cursorTo = (x, y) => {
|
|
|
67909
69605
|
var eraseLine = ESC + "2K";
|
|
67910
69606
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
67911
69607
|
|
|
67912
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
69608
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
67913
69609
|
var height = (content) => content.split(`
|
|
67914
69610
|
`).length;
|
|
67915
69611
|
var lastLine = (content) => content.split(`
|
|
@@ -67974,7 +69670,7 @@ class ScreenManager {
|
|
|
67974
69670
|
}
|
|
67975
69671
|
}
|
|
67976
69672
|
|
|
67977
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
69673
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
67978
69674
|
class PromisePolyfill extends Promise {
|
|
67979
69675
|
static withResolver() {
|
|
67980
69676
|
let resolve;
|
|
@@ -67987,7 +69683,7 @@ class PromisePolyfill extends Promise {
|
|
|
67987
69683
|
}
|
|
67988
69684
|
}
|
|
67989
69685
|
|
|
67990
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
69686
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
67991
69687
|
function getCallSites() {
|
|
67992
69688
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
67993
69689
|
let result = [];
|
|
@@ -68073,7 +69769,7 @@ function createPrompt(view) {
|
|
|
68073
69769
|
};
|
|
68074
69770
|
return prompt;
|
|
68075
69771
|
}
|
|
68076
|
-
// ../node_modules/.pnpm/@inquirer+core@11.0.
|
|
69772
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
68077
69773
|
import { styleText as styleText2 } from "node:util";
|
|
68078
69774
|
class Separator {
|
|
68079
69775
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
@@ -68087,7 +69783,7 @@ class Separator {
|
|
|
68087
69783
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
68088
69784
|
}
|
|
68089
69785
|
}
|
|
68090
|
-
// ../node_modules/.pnpm/@inquirer+checkbox@5.0.
|
|
69786
|
+
// ../node_modules/.pnpm/@inquirer+checkbox@5.0.2_@types+node@24.10.1/node_modules/@inquirer/checkbox/dist/index.js
|
|
68091
69787
|
import { styleText as styleText3 } from "node:util";
|
|
68092
69788
|
var checkboxTheme = {
|
|
68093
69789
|
icon: {
|
|
@@ -68260,16 +69956,16 @@ var dist_default2 = createPrompt((config2, done) => {
|
|
|
68260
69956
|
`).trimEnd();
|
|
68261
69957
|
return `${lines}${cursorHide}`;
|
|
68262
69958
|
});
|
|
68263
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
69959
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/index.js
|
|
68264
69960
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
68265
69961
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
68266
69962
|
import { spawn as spawn2, spawnSync as spawnSync2 } from "child_process";
|
|
68267
69963
|
import { readFileSync, unlinkSync, writeFileSync } from "fs";
|
|
68268
|
-
import
|
|
69964
|
+
import path10 from "node:path";
|
|
68269
69965
|
import os3 from "node:os";
|
|
68270
69966
|
import { randomUUID } from "node:crypto";
|
|
68271
69967
|
|
|
68272
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
69968
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js
|
|
68273
69969
|
class CreateFileError extends Error {
|
|
68274
69970
|
originalError;
|
|
68275
69971
|
constructor(originalError) {
|
|
@@ -68278,7 +69974,7 @@ class CreateFileError extends Error {
|
|
|
68278
69974
|
}
|
|
68279
69975
|
}
|
|
68280
69976
|
|
|
68281
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
69977
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js
|
|
68282
69978
|
class LaunchEditorError extends Error {
|
|
68283
69979
|
originalError;
|
|
68284
69980
|
constructor(originalError) {
|
|
@@ -68287,7 +69983,7 @@ class LaunchEditorError extends Error {
|
|
|
68287
69983
|
}
|
|
68288
69984
|
}
|
|
68289
69985
|
|
|
68290
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
69986
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js
|
|
68291
69987
|
class ReadFileError extends Error {
|
|
68292
69988
|
originalError;
|
|
68293
69989
|
constructor(originalError) {
|
|
@@ -68296,7 +69992,7 @@ class ReadFileError extends Error {
|
|
|
68296
69992
|
}
|
|
68297
69993
|
}
|
|
68298
69994
|
|
|
68299
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
69995
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js
|
|
68300
69996
|
class RemoveFileError extends Error {
|
|
68301
69997
|
originalError;
|
|
68302
69998
|
constructor(originalError) {
|
|
@@ -68305,7 +70001,7 @@ class RemoveFileError extends Error {
|
|
|
68305
70001
|
}
|
|
68306
70002
|
}
|
|
68307
70003
|
|
|
68308
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.
|
|
70004
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/index.js
|
|
68309
70005
|
function editAsync(text = "", callback, fileOptions) {
|
|
68310
70006
|
const editor = new ExternalEditor(text, fileOptions);
|
|
68311
70007
|
editor.runAsync((err, result) => {
|
|
@@ -68401,8 +70097,8 @@ class ExternalEditor {
|
|
|
68401
70097
|
const prefix = sanitizeAffix(this.fileOptions.prefix);
|
|
68402
70098
|
const postfix = sanitizeAffix(this.fileOptions.postfix);
|
|
68403
70099
|
const filename = `${prefix}${id}${postfix}`;
|
|
68404
|
-
const candidate =
|
|
68405
|
-
const baseResolved =
|
|
70100
|
+
const candidate = path10.resolve(baseDir, filename);
|
|
70101
|
+
const baseResolved = path10.resolve(baseDir) + path10.sep;
|
|
68406
70102
|
if (!candidate.startsWith(baseResolved)) {
|
|
68407
70103
|
throw new Error("Resolved temporary file escaped the base directory");
|
|
68408
70104
|
}
|
|
@@ -68460,7 +70156,7 @@ class ExternalEditor {
|
|
|
68460
70156
|
}
|
|
68461
70157
|
}
|
|
68462
70158
|
|
|
68463
|
-
// ../node_modules/.pnpm/@inquirer+editor@5.0.
|
|
70159
|
+
// ../node_modules/.pnpm/@inquirer+editor@5.0.2_@types+node@24.10.1/node_modules/@inquirer/editor/dist/index.js
|
|
68464
70160
|
var editorTheme = {
|
|
68465
70161
|
validationFailureMode: "keep"
|
|
68466
70162
|
};
|
|
@@ -68528,7 +70224,7 @@ var dist_default3 = createPrompt((config2, done) => {
|
|
|
68528
70224
|
}
|
|
68529
70225
|
return [[prefix, message, helpTip].filter(Boolean).join(" "), error2];
|
|
68530
70226
|
});
|
|
68531
|
-
// ../node_modules/.pnpm/@inquirer+confirm@6.0.
|
|
70227
|
+
// ../node_modules/.pnpm/@inquirer+confirm@6.0.2_@types+node@24.10.1/node_modules/@inquirer/confirm/dist/index.js
|
|
68532
70228
|
function getBooleanValue(value, defaultValue) {
|
|
68533
70229
|
let answer = defaultValue !== false;
|
|
68534
70230
|
if (/^(y|yes)/i.test(value))
|
|
@@ -68573,7 +70269,7 @@ var dist_default4 = createPrompt((config2, done) => {
|
|
|
68573
70269
|
const message = theme.style.message(config2.message, status);
|
|
68574
70270
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
68575
70271
|
});
|
|
68576
|
-
// ../node_modules/.pnpm/@inquirer+input@5.0.
|
|
70272
|
+
// ../node_modules/.pnpm/@inquirer+input@5.0.2_@types+node@24.10.1/node_modules/@inquirer/input/dist/index.js
|
|
68577
70273
|
var inputTheme = {
|
|
68578
70274
|
validationFailureMode: "keep"
|
|
68579
70275
|
};
|
|
@@ -68657,7 +70353,7 @@ var dist_default5 = createPrompt((config2, done) => {
|
|
|
68657
70353
|
error2
|
|
68658
70354
|
];
|
|
68659
70355
|
});
|
|
68660
|
-
// ../node_modules/.pnpm/@inquirer+number@4.0.
|
|
70356
|
+
// ../node_modules/.pnpm/@inquirer+number@4.0.2_@types+node@24.10.1/node_modules/@inquirer/number/dist/index.js
|
|
68661
70357
|
function isStepOf(value, step, min) {
|
|
68662
70358
|
const valuePow = value * Math.pow(10, 6);
|
|
68663
70359
|
const stepPow = step * Math.pow(10, 6);
|
|
@@ -68737,7 +70433,7 @@ var dist_default6 = createPrompt((config2, done) => {
|
|
|
68737
70433
|
error2
|
|
68738
70434
|
];
|
|
68739
70435
|
});
|
|
68740
|
-
// ../node_modules/.pnpm/@inquirer+expand@5.0.
|
|
70436
|
+
// ../node_modules/.pnpm/@inquirer+expand@5.0.2_@types+node@24.10.1/node_modules/@inquirer/expand/dist/index.js
|
|
68741
70437
|
import { styleText as styleText4 } from "node:util";
|
|
68742
70438
|
function normalizeChoices2(choices) {
|
|
68743
70439
|
return choices.map((choice) => {
|
|
@@ -68834,7 +70530,7 @@ var dist_default7 = createPrompt((config2, done) => {
|
|
|
68834
70530
|
`)
|
|
68835
70531
|
];
|
|
68836
70532
|
});
|
|
68837
|
-
// ../node_modules/.pnpm/@inquirer+rawlist@5.0.
|
|
70533
|
+
// ../node_modules/.pnpm/@inquirer+rawlist@5.0.2_@types+node@24.10.1/node_modules/@inquirer/rawlist/dist/index.js
|
|
68838
70534
|
import { styleText as styleText5 } from "node:util";
|
|
68839
70535
|
var numberRegex = /\d+/;
|
|
68840
70536
|
function isSelectableChoice(choice) {
|
|
@@ -68945,7 +70641,7 @@ var dist_default8 = createPrompt((config2, done) => {
|
|
|
68945
70641
|
`)
|
|
68946
70642
|
];
|
|
68947
70643
|
});
|
|
68948
|
-
// ../node_modules/.pnpm/@inquirer+password@5.0.
|
|
70644
|
+
// ../node_modules/.pnpm/@inquirer+password@5.0.2_@types+node@24.10.1/node_modules/@inquirer/password/dist/index.js
|
|
68949
70645
|
var dist_default9 = createPrompt((config2, done) => {
|
|
68950
70646
|
const { validate: validate2 = () => true } = config2;
|
|
68951
70647
|
const theme = makeTheme(config2.theme);
|
|
@@ -68993,7 +70689,7 @@ var dist_default9 = createPrompt((config2, done) => {
|
|
|
68993
70689
|
}
|
|
68994
70690
|
return [[prefix, message, config2.mask ? formattedValue : helpTip].join(" "), error2];
|
|
68995
70691
|
});
|
|
68996
|
-
// ../node_modules/.pnpm/@inquirer+search@4.0.
|
|
70692
|
+
// ../node_modules/.pnpm/@inquirer+search@4.0.2_@types+node@24.10.1/node_modules/@inquirer/search/dist/index.js
|
|
68997
70693
|
import { styleText as styleText6 } from "node:util";
|
|
68998
70694
|
var searchTheme = {
|
|
68999
70695
|
icon: { cursor: dist_default.pointer },
|
|
@@ -69155,7 +70851,7 @@ var dist_default10 = createPrompt((config2, done) => {
|
|
|
69155
70851
|
`).trimEnd();
|
|
69156
70852
|
return [header, body];
|
|
69157
70853
|
});
|
|
69158
|
-
// ../node_modules/.pnpm/@inquirer+select@5.0.
|
|
70854
|
+
// ../node_modules/.pnpm/@inquirer+select@5.0.2_@types+node@24.10.1/node_modules/@inquirer/select/dist/index.js
|
|
69159
70855
|
import { styleText as styleText7 } from "node:util";
|
|
69160
70856
|
var selectTheme = {
|
|
69161
70857
|
icon: { cursor: dist_default.pointer },
|
|
@@ -69310,15 +71006,15 @@ var dist_default11 = createPrompt((config2, done) => {
|
|
|
69310
71006
|
`).trimEnd();
|
|
69311
71007
|
return `${lines}${cursorHide}`;
|
|
69312
71008
|
});
|
|
69313
|
-
// ../node_modules/.pnpm/inquirer@13.0.
|
|
71009
|
+
// ../node_modules/.pnpm/inquirer@13.0.2_@types+node@24.10.1/node_modules/inquirer/dist/ui/prompt.js
|
|
69314
71010
|
var import_rxjs = __toESM(require_cjs(), 1);
|
|
69315
71011
|
var import_run_async = __toESM(require_run_async(), 1);
|
|
69316
71012
|
var import_mute_stream2 = __toESM(require_lib(), 1);
|
|
69317
71013
|
import readline3 from "node:readline";
|
|
69318
71014
|
var _ = {
|
|
69319
|
-
set: (obj,
|
|
71015
|
+
set: (obj, path11 = "", value) => {
|
|
69320
71016
|
let pointer = obj;
|
|
69321
|
-
|
|
71017
|
+
path11.split(".").forEach((key, index, arr) => {
|
|
69322
71018
|
if (key === "__proto__" || key === "constructor")
|
|
69323
71019
|
return;
|
|
69324
71020
|
if (index === arr.length - 1) {
|
|
@@ -69329,8 +71025,8 @@ var _ = {
|
|
|
69329
71025
|
pointer = pointer[key];
|
|
69330
71026
|
});
|
|
69331
71027
|
},
|
|
69332
|
-
get: (obj,
|
|
69333
|
-
const travel = (regexp) => String.prototype.split.call(
|
|
71028
|
+
get: (obj, path11 = "", defaultValue) => {
|
|
71029
|
+
const travel = (regexp) => String.prototype.split.call(path11, regexp).filter(Boolean).reduce((res, key) => res == null ? res : res[key], obj);
|
|
69334
71030
|
const result = travel(/[,[\]]+?/) || travel(/[,.[\]]+?/);
|
|
69335
71031
|
return result === undefined || result === obj ? defaultValue : result;
|
|
69336
71032
|
}
|
|
@@ -69521,7 +71217,7 @@ class PromptsRunner {
|
|
|
69521
71217
|
};
|
|
69522
71218
|
}
|
|
69523
71219
|
|
|
69524
|
-
// ../node_modules/.pnpm/inquirer@13.0.
|
|
71220
|
+
// ../node_modules/.pnpm/inquirer@13.0.2_@types+node@24.10.1/node_modules/inquirer/dist/index.js
|
|
69525
71221
|
var builtInPrompts = {
|
|
69526
71222
|
input: dist_default5,
|
|
69527
71223
|
select: dist_default11,
|
|
@@ -69572,9 +71268,9 @@ var dist_default12 = inquirer;
|
|
|
69572
71268
|
// src/command/config-manager/index.ts
|
|
69573
71269
|
var Init = new Command("init").description("初始化一个助手客户端,生成配置文件。").option("-p --path <path>", "助手路径,默认为执行命令的目录,如果助手路径不存在则创建。").action((opts) => {
|
|
69574
71270
|
if (opts.path && !opts.path.startsWith("/")) {
|
|
69575
|
-
opts.path =
|
|
71271
|
+
opts.path = path11.join(process.cwd(), opts.path);
|
|
69576
71272
|
} else if (opts.path) {
|
|
69577
|
-
opts.path =
|
|
71273
|
+
opts.path = path11.resolve(opts.path);
|
|
69578
71274
|
}
|
|
69579
71275
|
const configDir3 = AssistantInit.detectConfigDir(opts.path);
|
|
69580
71276
|
console.log("configDir", configDir3);
|
|
@@ -69586,13 +71282,13 @@ var Init = new Command("init").description("初始化一个助手客户端,生
|
|
|
69586
71282
|
program.addCommand(Init);
|
|
69587
71283
|
var removeCommand = new Command("remove").description("删除助手配置文件").option("-p --path <path>", "助手路径,默认为执行命令的目录,如果助手路径不存在则创建。").action((opts) => {
|
|
69588
71284
|
if (opts.path && !opts.path.startsWith("/")) {
|
|
69589
|
-
opts.path =
|
|
71285
|
+
opts.path = path11.join(process.cwd(), opts.path);
|
|
69590
71286
|
} else if (opts.path) {
|
|
69591
|
-
opts.path =
|
|
71287
|
+
opts.path = path11.resolve(opts.path);
|
|
69592
71288
|
}
|
|
69593
71289
|
const configDir3 = AssistantInit.detectConfigDir(opts.path);
|
|
69594
|
-
const assistantDir =
|
|
69595
|
-
if (
|
|
71290
|
+
const assistantDir = path11.join(configDir3, "assistant-app");
|
|
71291
|
+
if (fs12.existsSync(assistantDir)) {
|
|
69596
71292
|
dist_default12.prompt([
|
|
69597
71293
|
{
|
|
69598
71294
|
type: "confirm",
|
|
@@ -69603,7 +71299,7 @@ var removeCommand = new Command("remove").description("删除助手配置文件"
|
|
|
69603
71299
|
}
|
|
69604
71300
|
]).then((answers) => {
|
|
69605
71301
|
if (answers.confirm) {
|
|
69606
|
-
|
|
71302
|
+
fs12.rmSync(assistantDir, { recursive: true, force: true });
|
|
69607
71303
|
console.log(source_default.green("助手配置文件已删除"));
|
|
69608
71304
|
} else {
|
|
69609
71305
|
console.log(source_default.blue("助手配置文件未删除"));
|
|
@@ -69616,9 +71312,9 @@ var removeCommand = new Command("remove").description("删除助手配置文件"
|
|
|
69616
71312
|
program.addCommand(removeCommand);
|
|
69617
71313
|
var npmCommand = new Command("pnpm").description("助手pnpm命令").option("-p --path <path>", "助手路径,默认为执行命令的目录,如果助手路径不存在则创建。").action((opts) => {
|
|
69618
71314
|
if (opts.path && !opts.path.startsWith("/")) {
|
|
69619
|
-
opts.path =
|
|
71315
|
+
opts.path = path11.join(process.cwd(), opts.path);
|
|
69620
71316
|
} else if (opts.path) {
|
|
69621
|
-
opts.path =
|
|
71317
|
+
opts.path = path11.resolve(opts.path);
|
|
69622
71318
|
}
|
|
69623
71319
|
const configDir3 = AssistantInit.detectConfigDir(opts.path);
|
|
69624
71320
|
console.log("configDir", configDir3);
|
|
@@ -69635,8 +71331,8 @@ var npmCommand = new Command("pnpm").description("助手pnpm命令").option("-p
|
|
|
69635
71331
|
Init.addCommand(npmCommand);
|
|
69636
71332
|
|
|
69637
71333
|
// src/services/app/index.ts
|
|
69638
|
-
import
|
|
69639
|
-
import
|
|
71334
|
+
import path12 from "path";
|
|
71335
|
+
import fs13 from "fs";
|
|
69640
71336
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
69641
71337
|
var runCommand = (command, args) => {
|
|
69642
71338
|
const result = spawnSync3(command, args, {
|
|
@@ -69677,7 +71373,7 @@ class AppDownload {
|
|
|
69677
71373
|
if (type === "web") {
|
|
69678
71374
|
args.push("-o", pagesDir);
|
|
69679
71375
|
} else if (type === "app") {
|
|
69680
|
-
args.push("-o",
|
|
71376
|
+
args.push("-o", path12.join(appsDir));
|
|
69681
71377
|
} else {
|
|
69682
71378
|
throw new Error("应用类型错误,只能是 web 或 app");
|
|
69683
71379
|
}
|
|
@@ -69715,10 +71411,10 @@ class AppDownload {
|
|
|
69715
71411
|
let deletePath = "";
|
|
69716
71412
|
let isDelete = false;
|
|
69717
71413
|
if (type === "web") {
|
|
69718
|
-
const pagePath =
|
|
71414
|
+
const pagePath = path12.join(pagesDir, id);
|
|
69719
71415
|
deletePath = pagePath;
|
|
69720
71416
|
} else if (type === "app") {
|
|
69721
|
-
const appPath =
|
|
71417
|
+
const appPath = path12.join(appsDir, id);
|
|
69722
71418
|
deletePath = appPath;
|
|
69723
71419
|
}
|
|
69724
71420
|
if (deletePath && checkFileExists(deletePath)) {
|
|
@@ -69729,7 +71425,7 @@ class AppDownload {
|
|
|
69729
71425
|
return;
|
|
69730
71426
|
}
|
|
69731
71427
|
}
|
|
69732
|
-
|
|
71428
|
+
fs13.rmSync(deletePath, { recursive: true });
|
|
69733
71429
|
isDelete = true;
|
|
69734
71430
|
console.log(`删除应用成功: ${deletePath}`);
|
|
69735
71431
|
}
|
|
@@ -69762,7 +71458,7 @@ appManagerCommand.command("start").argument("<app-key-name>", "应用的 key 名
|
|
|
69762
71458
|
manager.start(appKey);
|
|
69763
71459
|
console.log("Start App:", appKey);
|
|
69764
71460
|
});
|
|
69765
|
-
var
|
|
71461
|
+
var stop4 = async (appKey) => {
|
|
69766
71462
|
const manager = new AssistantApp(assistantConfig2);
|
|
69767
71463
|
try {
|
|
69768
71464
|
await manager.loadConfig();
|
|
@@ -69772,7 +71468,7 @@ var stop3 = async (appKey) => {
|
|
|
69772
71468
|
}
|
|
69773
71469
|
};
|
|
69774
71470
|
appManagerCommand.command("stop").argument("<app-key-name>", "应用的 key 名称").action(async (appKey) => {
|
|
69775
|
-
await
|
|
71471
|
+
await stop4(appKey);
|
|
69776
71472
|
console.log("Stop App:", appKey);
|
|
69777
71473
|
});
|
|
69778
71474
|
appManagerCommand.command("restart").argument("<app-key-name>", "应用的 key 名称").action(async (appKey) => {
|
|
@@ -69801,7 +71497,7 @@ appManagerCommand.command("delete").alias("del").argument("<app-key-name>", "应
|
|
|
69801
71497
|
if (id.includes("/")) {
|
|
69802
71498
|
const [_user, appName] = id.split("/");
|
|
69803
71499
|
id = appName;
|
|
69804
|
-
await
|
|
71500
|
+
await stop4(id);
|
|
69805
71501
|
}
|
|
69806
71502
|
await app.deleteApp({ id, type: "app" });
|
|
69807
71503
|
}
|
|
@@ -69922,7 +71618,7 @@ var runScriptsCommand = new Command("run-scripts").alias("run").arguments("<cmd>
|
|
|
69922
71618
|
});
|
|
69923
71619
|
program.addCommand(runScriptsCommand);
|
|
69924
71620
|
|
|
69925
|
-
// ../node_modules/.pnpm/@kevisual+ai@0.0.
|
|
71621
|
+
// ../node_modules/.pnpm/@kevisual+ai@0.0.16/node_modules/@kevisual/ai/dist/ai-provider.js
|
|
69926
71622
|
import { createRequire as createRequire2 } from "node:module";
|
|
69927
71623
|
var __create2 = Object.create;
|
|
69928
71624
|
var __getProtoOf2 = Object.getPrototypeOf;
|
|
@@ -69943,13 +71639,13 @@ var __toESM2 = (mod, isNodeMode, target) => {
|
|
|
69943
71639
|
var __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
69944
71640
|
var __require2 = /* @__PURE__ */ createRequire2(import.meta.url);
|
|
69945
71641
|
var require_core = __commonJS2((exports, module) => {
|
|
69946
|
-
(function(
|
|
71642
|
+
(function(root3, factory) {
|
|
69947
71643
|
if (typeof exports === "object") {
|
|
69948
71644
|
module.exports = exports = factory();
|
|
69949
71645
|
} else if (typeof define === "function" && define.amd) {
|
|
69950
71646
|
define([], factory);
|
|
69951
71647
|
} else {
|
|
69952
|
-
|
|
71648
|
+
root3.CryptoJS = factory();
|
|
69953
71649
|
}
|
|
69954
71650
|
})(exports, function() {
|
|
69955
71651
|
var CryptoJS = CryptoJS || function(Math2, undefined2) {
|
|
@@ -70226,13 +71922,13 @@ var require_core = __commonJS2((exports, module) => {
|
|
|
70226
71922
|
});
|
|
70227
71923
|
});
|
|
70228
71924
|
var require_enc_base64 = __commonJS2((exports, module) => {
|
|
70229
|
-
(function(
|
|
71925
|
+
(function(root3, factory) {
|
|
70230
71926
|
if (typeof exports === "object") {
|
|
70231
71927
|
module.exports = exports = factory(require_core());
|
|
70232
71928
|
} else if (typeof define === "function" && define.amd) {
|
|
70233
71929
|
define(["./core"], factory);
|
|
70234
71930
|
} else {
|
|
70235
|
-
factory(
|
|
71931
|
+
factory(root3.CryptoJS);
|
|
70236
71932
|
}
|
|
70237
71933
|
})(exports, function(CryptoJS) {
|
|
70238
71934
|
(function() {
|
|
@@ -70304,13 +72000,13 @@ var require_enc_base64 = __commonJS2((exports, module) => {
|
|
|
70304
72000
|
});
|
|
70305
72001
|
});
|
|
70306
72002
|
var require_md5 = __commonJS2((exports, module) => {
|
|
70307
|
-
(function(
|
|
72003
|
+
(function(root3, factory) {
|
|
70308
72004
|
if (typeof exports === "object") {
|
|
70309
72005
|
module.exports = exports = factory(require_core());
|
|
70310
72006
|
} else if (typeof define === "function" && define.amd) {
|
|
70311
72007
|
define(["./core"], factory);
|
|
70312
72008
|
} else {
|
|
70313
|
-
factory(
|
|
72009
|
+
factory(root3.CryptoJS);
|
|
70314
72010
|
}
|
|
70315
72011
|
})(exports, function(CryptoJS) {
|
|
70316
72012
|
(function(Math2) {
|
|
@@ -70479,13 +72175,13 @@ var require_md5 = __commonJS2((exports, module) => {
|
|
|
70479
72175
|
});
|
|
70480
72176
|
});
|
|
70481
72177
|
var require_sha1 = __commonJS2((exports, module) => {
|
|
70482
|
-
(function(
|
|
72178
|
+
(function(root3, factory) {
|
|
70483
72179
|
if (typeof exports === "object") {
|
|
70484
72180
|
module.exports = exports = factory(require_core());
|
|
70485
72181
|
} else if (typeof define === "function" && define.amd) {
|
|
70486
72182
|
define(["./core"], factory);
|
|
70487
72183
|
} else {
|
|
70488
|
-
factory(
|
|
72184
|
+
factory(root3.CryptoJS);
|
|
70489
72185
|
}
|
|
70490
72186
|
})(exports, function(CryptoJS) {
|
|
70491
72187
|
(function() {
|
|
@@ -70566,13 +72262,13 @@ var require_sha1 = __commonJS2((exports, module) => {
|
|
|
70566
72262
|
});
|
|
70567
72263
|
});
|
|
70568
72264
|
var require_hmac = __commonJS2((exports, module) => {
|
|
70569
|
-
(function(
|
|
72265
|
+
(function(root3, factory) {
|
|
70570
72266
|
if (typeof exports === "object") {
|
|
70571
72267
|
module.exports = exports = factory(require_core());
|
|
70572
72268
|
} else if (typeof define === "function" && define.amd) {
|
|
70573
72269
|
define(["./core"], factory);
|
|
70574
72270
|
} else {
|
|
70575
|
-
factory(
|
|
72271
|
+
factory(root3.CryptoJS);
|
|
70576
72272
|
}
|
|
70577
72273
|
})(exports, function(CryptoJS) {
|
|
70578
72274
|
(function() {
|
|
@@ -70626,13 +72322,13 @@ var require_hmac = __commonJS2((exports, module) => {
|
|
|
70626
72322
|
});
|
|
70627
72323
|
});
|
|
70628
72324
|
var require_evpkdf = __commonJS2((exports, module) => {
|
|
70629
|
-
(function(
|
|
72325
|
+
(function(root3, factory, undef) {
|
|
70630
72326
|
if (typeof exports === "object") {
|
|
70631
72327
|
module.exports = exports = factory(require_core(), require_sha1(), require_hmac());
|
|
70632
72328
|
} else if (typeof define === "function" && define.amd) {
|
|
70633
72329
|
define(["./core", "./sha1", "./hmac"], factory);
|
|
70634
72330
|
} else {
|
|
70635
|
-
factory(
|
|
72331
|
+
factory(root3.CryptoJS);
|
|
70636
72332
|
}
|
|
70637
72333
|
})(exports, function(CryptoJS) {
|
|
70638
72334
|
(function() {
|
|
@@ -70683,13 +72379,13 @@ var require_evpkdf = __commonJS2((exports, module) => {
|
|
|
70683
72379
|
});
|
|
70684
72380
|
});
|
|
70685
72381
|
var require_cipher_core = __commonJS2((exports, module) => {
|
|
70686
|
-
(function(
|
|
72382
|
+
(function(root3, factory, undef) {
|
|
70687
72383
|
if (typeof exports === "object") {
|
|
70688
72384
|
module.exports = exports = factory(require_core(), require_evpkdf());
|
|
70689
72385
|
} else if (typeof define === "function" && define.amd) {
|
|
70690
72386
|
define(["./core", "./evpkdf"], factory);
|
|
70691
72387
|
} else {
|
|
70692
|
-
factory(
|
|
72388
|
+
factory(root3.CryptoJS);
|
|
70693
72389
|
}
|
|
70694
72390
|
})(exports, function(CryptoJS) {
|
|
70695
72391
|
CryptoJS.lib.Cipher || function(undefined2) {
|
|
@@ -70979,13 +72675,13 @@ var require_cipher_core = __commonJS2((exports, module) => {
|
|
|
70979
72675
|
});
|
|
70980
72676
|
});
|
|
70981
72677
|
var require_aes = __commonJS2((exports, module) => {
|
|
70982
|
-
(function(
|
|
72678
|
+
(function(root3, factory, undef) {
|
|
70983
72679
|
if (typeof exports === "object") {
|
|
70984
72680
|
module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core());
|
|
70985
72681
|
} else if (typeof define === "function" && define.amd) {
|
|
70986
72682
|
define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
|
|
70987
72683
|
} else {
|
|
70988
|
-
factory(
|
|
72684
|
+
factory(root3.CryptoJS);
|
|
70989
72685
|
}
|
|
70990
72686
|
})(exports, function(CryptoJS) {
|
|
70991
72687
|
(function() {
|
|
@@ -71129,42 +72825,141 @@ var require_aes = __commonJS2((exports, module) => {
|
|
|
71129
72825
|
});
|
|
71130
72826
|
});
|
|
71131
72827
|
var require_enc_utf8 = __commonJS2((exports, module) => {
|
|
71132
|
-
(function(
|
|
72828
|
+
(function(root3, factory) {
|
|
71133
72829
|
if (typeof exports === "object") {
|
|
71134
72830
|
module.exports = exports = factory(require_core());
|
|
71135
72831
|
} else if (typeof define === "function" && define.amd) {
|
|
71136
72832
|
define(["./core"], factory);
|
|
71137
72833
|
} else {
|
|
71138
|
-
factory(
|
|
72834
|
+
factory(root3.CryptoJS);
|
|
71139
72835
|
}
|
|
71140
72836
|
})(exports, function(CryptoJS) {
|
|
71141
72837
|
return CryptoJS.enc.Utf8;
|
|
71142
72838
|
});
|
|
71143
72839
|
});
|
|
71144
|
-
|
|
71145
|
-
|
|
71146
|
-
|
|
71147
|
-
|
|
71148
|
-
|
|
72840
|
+
|
|
72841
|
+
class AIUtils {
|
|
72842
|
+
static extractJsonFromMarkdown(str) {
|
|
72843
|
+
const jsonRegex = /```json\s*([\s\S]*?)\s*```/;
|
|
72844
|
+
const match = str.match(jsonRegex);
|
|
72845
|
+
let jsonStr = match && match[1] ? match[1] : str;
|
|
72846
|
+
try {
|
|
72847
|
+
return JSON.parse(jsonStr);
|
|
72848
|
+
} catch {
|
|
72849
|
+
return null;
|
|
72850
|
+
}
|
|
71149
72851
|
}
|
|
71150
|
-
|
|
72852
|
+
extractCodeFromMarkdown(str, language) {
|
|
72853
|
+
if (language) {
|
|
72854
|
+
const regex22 = new RegExp(`\`\`\`${language}\\s*([\\s\\S]*?)\\s*\`\`\``, "g");
|
|
72855
|
+
const matches2 = str.match(regex22);
|
|
72856
|
+
if (!matches2)
|
|
72857
|
+
return null;
|
|
72858
|
+
return matches2.map((m) => m.replace(new RegExp(`\`\`\`${language}\\s*|\\s*\`\`\``, "g"), "").trim());
|
|
72859
|
+
}
|
|
72860
|
+
const regex2 = /```[\w]*\s*([\s\S]*?)\s*```/g;
|
|
72861
|
+
const matches = [...str.matchAll(regex2)];
|
|
72862
|
+
if (matches.length === 0)
|
|
72863
|
+
return null;
|
|
72864
|
+
return matches.map((m) => m[1].trim());
|
|
72865
|
+
}
|
|
72866
|
+
cleanResponse(str) {
|
|
72867
|
+
return str.trim().replace(/\n{3,}/g, `
|
|
72868
|
+
|
|
72869
|
+
`).replace(/[ \t]+$/gm, "");
|
|
72870
|
+
}
|
|
72871
|
+
extractTags(str) {
|
|
72872
|
+
const tagPatterns = [
|
|
72873
|
+
/#(\w+)/g,
|
|
72874
|
+
/\[(\w+)\]/g,
|
|
72875
|
+
/tags?:\s*\[([^\]]+)\]/gi
|
|
72876
|
+
];
|
|
72877
|
+
const tags = new Set;
|
|
72878
|
+
for (const pattern2 of tagPatterns) {
|
|
72879
|
+
const matches = str.matchAll(pattern2);
|
|
72880
|
+
for (const match of matches) {
|
|
72881
|
+
if (match[1]) {
|
|
72882
|
+
const extracted = match[1].split(/[,;]/).map((t) => t.trim()).filter(Boolean);
|
|
72883
|
+
extracted.forEach((tag) => tags.add(tag));
|
|
72884
|
+
}
|
|
72885
|
+
}
|
|
72886
|
+
}
|
|
72887
|
+
return Array.from(tags);
|
|
72888
|
+
}
|
|
72889
|
+
extractUrls(str) {
|
|
72890
|
+
const urlRegex = /(https?:\/\/[^\s]+)/g;
|
|
72891
|
+
const matches = str.match(urlRegex);
|
|
72892
|
+
return matches || [];
|
|
72893
|
+
}
|
|
72894
|
+
chunkText(text, maxTokens = 1000) {
|
|
72895
|
+
const chunkSize = maxTokens * 4;
|
|
72896
|
+
const chunks = [];
|
|
72897
|
+
const paragraphs = text.split(/\n\n+/);
|
|
72898
|
+
let currentChunk = "";
|
|
72899
|
+
for (const paragraph of paragraphs) {
|
|
72900
|
+
if ((currentChunk + paragraph).length > chunkSize && currentChunk) {
|
|
72901
|
+
chunks.push(currentChunk.trim());
|
|
72902
|
+
currentChunk = paragraph;
|
|
72903
|
+
} else {
|
|
72904
|
+
currentChunk += (currentChunk ? `
|
|
72905
|
+
|
|
72906
|
+
` : "") + paragraph;
|
|
72907
|
+
}
|
|
72908
|
+
}
|
|
72909
|
+
if (currentChunk) {
|
|
72910
|
+
chunks.push(currentChunk.trim());
|
|
72911
|
+
}
|
|
72912
|
+
return chunks;
|
|
72913
|
+
}
|
|
72914
|
+
removeThinkingTags(str) {
|
|
72915
|
+
return str.replace(/<thinking>[\s\S]*?<\/thinking>/gi, "").replace(/\[thinking\][\s\S]*?\[\/thinking\]/gi, "").trim();
|
|
72916
|
+
}
|
|
72917
|
+
escapeForPrompt(str) {
|
|
72918
|
+
return str.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
72919
|
+
}
|
|
72920
|
+
estimateTokens(text) {
|
|
72921
|
+
const chineseChars = (text.match(/[\u4e00-\u9fa5]/g) || []).length;
|
|
72922
|
+
const otherChars = text.length - chineseChars;
|
|
72923
|
+
return Math.ceil(chineseChars / 1.5 + otherChars / 4);
|
|
72924
|
+
}
|
|
72925
|
+
extractKeyValuePairs(str) {
|
|
72926
|
+
const result = {};
|
|
72927
|
+
const lines = str.split(`
|
|
72928
|
+
`);
|
|
72929
|
+
for (const line of lines) {
|
|
72930
|
+
const match = line.match(/^([^::]+)[::]\s*(.+)$/);
|
|
72931
|
+
if (match) {
|
|
72932
|
+
const key = match[1].trim();
|
|
72933
|
+
const value = match[2].trim();
|
|
72934
|
+
result[key] = value;
|
|
72935
|
+
}
|
|
72936
|
+
}
|
|
72937
|
+
return result;
|
|
72938
|
+
}
|
|
72939
|
+
isResponseComplete(str) {
|
|
72940
|
+
const incompleteSigns = [
|
|
72941
|
+
/```[\w]*\s*[\s\S]*?(?<!```)$/,
|
|
72942
|
+
/\{[\s\S]*(?<!\})$/,
|
|
72943
|
+
/\[[\s\S]*(?<!\])$/,
|
|
72944
|
+
/\.{3,}$/
|
|
72945
|
+
];
|
|
72946
|
+
return !incompleteSigns.some((pattern2) => pattern2.test(str.trim()));
|
|
72947
|
+
}
|
|
72948
|
+
}
|
|
71151
72949
|
|
|
71152
72950
|
class BaseChat {
|
|
71153
72951
|
baseURL;
|
|
71154
72952
|
model;
|
|
71155
72953
|
apiKey;
|
|
71156
|
-
isBrowser;
|
|
71157
|
-
openai;
|
|
71158
72954
|
prompt_tokens;
|
|
71159
72955
|
total_tokens;
|
|
71160
72956
|
completion_tokens;
|
|
71161
72957
|
responseText;
|
|
72958
|
+
utils = AIUtils;
|
|
71162
72959
|
constructor(options) {
|
|
71163
72960
|
this.baseURL = options.baseURL;
|
|
71164
72961
|
this.model = options.model;
|
|
71165
72962
|
this.apiKey = options.apiKey;
|
|
71166
|
-
const DEFAULT_IS_BROWSER = getIsBrowser();
|
|
71167
|
-
this.isBrowser = options.isBrowser ?? DEFAULT_IS_BROWSER;
|
|
71168
72963
|
}
|
|
71169
72964
|
post(url = "", opts = {}) {
|
|
71170
72965
|
let _url = url.startsWith("http") ? url : this.baseURL + url;
|
|
@@ -71368,6 +73163,22 @@ class BailianChat extends BaseChat {
|
|
|
71368
73163
|
super({ ...options, baseURL });
|
|
71369
73164
|
}
|
|
71370
73165
|
}
|
|
73166
|
+
|
|
73167
|
+
class Zhipu extends BaseChat {
|
|
73168
|
+
static BASE_URL = "https://open.bigmodel.cn/api/paas/v4/";
|
|
73169
|
+
constructor(options) {
|
|
73170
|
+
const baseURL = options.baseURL || Zhipu.BASE_URL;
|
|
73171
|
+
super({ ...options, baseURL });
|
|
73172
|
+
}
|
|
73173
|
+
}
|
|
73174
|
+
|
|
73175
|
+
class Kimi extends BaseChat {
|
|
73176
|
+
static BASE_URL = "https://api.moonshot.cn/v1/";
|
|
73177
|
+
constructor(options) {
|
|
73178
|
+
const baseURL = options.baseURL || Kimi.BASE_URL;
|
|
73179
|
+
super({ ...options, baseURL });
|
|
73180
|
+
}
|
|
73181
|
+
}
|
|
71371
73182
|
var OllamaProvider = Ollama;
|
|
71372
73183
|
var SiliconFlowProvider = SiliconFlow;
|
|
71373
73184
|
var CustomProvider = Custom;
|
|
@@ -71375,6 +73186,8 @@ var VolcesProvider = Volces;
|
|
|
71375
73186
|
var DeepSeekProvider = DeepSeek;
|
|
71376
73187
|
var ModelScopeProvider = ModelScope;
|
|
71377
73188
|
var BailianProvider = BailianChat;
|
|
73189
|
+
var ZhipuProvider = Zhipu;
|
|
73190
|
+
var KimiProvider = Kimi;
|
|
71378
73191
|
var ChatProviderMap = {
|
|
71379
73192
|
Ollama: OllamaProvider,
|
|
71380
73193
|
SiliconFlow: SiliconFlowProvider,
|
|
@@ -71383,7 +73196,9 @@ var ChatProviderMap = {
|
|
|
71383
73196
|
DeepSeek: DeepSeekProvider,
|
|
71384
73197
|
ModelScope: ModelScopeProvider,
|
|
71385
73198
|
BaseChat,
|
|
71386
|
-
Bailian: BailianProvider
|
|
73199
|
+
Bailian: BailianProvider,
|
|
73200
|
+
Zhipu: ZhipuProvider,
|
|
73201
|
+
Kimi: KimiProvider
|
|
71387
73202
|
};
|
|
71388
73203
|
|
|
71389
73204
|
class ProviderManager {
|