@kevisual/cli 0.0.68 → 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.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 path5 = __require("path");
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 path5.resolve(cwd, filepath);
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 isObject2 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
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 (isObject2(step)) {
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 && !isObject2(step))
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 path5 = __require("path");
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: path5.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 path5 = __require("path");
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 || path5.sep === "\\";
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 path5 = __require("path");
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 isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
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 = isObject2(glob2) && glob2.tokens && glob2.input;
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(path5.basename(input));
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 path5 = __require("path");
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 = path5.basename(pattern2);
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 path5.isAbsolute(pattern2);
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 = merge2;
20347
- function merge2() {
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 merge2 = require_merge2();
20461
+ var merge22 = require_merge2();
20462
20462
  function merge3(streams) {
20463
- const mergedStream = merge2(streams);
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 fs6 = require_fs();
20500
- exports.fs = fs6;
20501
- var path5 = require_path();
20502
- exports.path = path5;
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(path5, settings2, callback) {
20599
- settings2.fs.lstat(path5, (lstatError, 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(path5, (statError, 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(path5, settings2) {
20638
- const lstat = settings2.fs.lstatSync(path5);
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(path5);
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 fs6 = __require("fs");
20662
+ var fs7 = __require("fs");
20663
20663
  exports.FILE_SYSTEM_ADAPTER = {
20664
- lstat: fs6.lstat,
20665
- stat: fs6.stat,
20666
- lstatSync: fs6.lstatSync,
20667
- statSync: fs6.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 fs6 = require_fs2();
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 = fs6.createFileSystemAdapter(this._options.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(path5, optionsOrSettingsOrCallback, callback) {
20706
+ function stat(path6, optionsOrSettingsOrCallback, callback) {
20707
20707
  if (typeof optionsOrSettingsOrCallback === "function") {
20708
- async2.read(path5, getSettings(), optionsOrSettingsOrCallback);
20708
+ async2.read(path6, getSettings(), optionsOrSettingsOrCallback);
20709
20709
  return;
20710
20710
  }
20711
- async2.read(path5, getSettings(optionsOrSettingsOrCallback), callback);
20711
+ async2.read(path6, getSettings(optionsOrSettingsOrCallback), callback);
20712
20712
  }
20713
20713
  exports.stat = stat;
20714
- function statSync(path5, optionsOrSettings) {
20714
+ function statSync(path6, optionsOrSettings) {
20715
20715
  const settings2 = getSettings(optionsOrSettings);
20716
- return sync2.read(path5, settings2);
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 fs6 = require_fs3();
20833
- exports.fs = fs6;
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 path5 = common2.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
20919
+ const path6 = common2.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
20920
20920
  return (done) => {
20921
- fsStat.stat(path5, settings2.fsStatSettings, (error2, stats) => {
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: path5,
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 fs6 = __require("fs");
21016
+ var fs7 = __require("fs");
21017
21017
  exports.FILE_SYSTEM_ADAPTER = {
21018
- lstat: fs6.lstat,
21019
- stat: fs6.stat,
21020
- lstatSync: fs6.lstatSync,
21021
- statSync: fs6.statSync,
21022
- readdir: fs6.readdir,
21023
- readdirSync: fs6.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 path5 = __require("path");
21037
+ var path6 = __require("path");
21038
21038
  var fsStat = require_out();
21039
- var fs6 = require_fs4();
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 = fs6.createFileSystemAdapter(this._options.fs);
21046
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path5.sep);
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(path5, optionsOrSettingsOrCallback, callback) {
21070
+ function scandir(path6, optionsOrSettingsOrCallback, callback) {
21071
21071
  if (typeof optionsOrSettingsOrCallback === "function") {
21072
- async2.read(path5, getSettings(), optionsOrSettingsOrCallback);
21072
+ async2.read(path6, getSettings(), optionsOrSettingsOrCallback);
21073
21073
  return;
21074
21074
  }
21075
- async2.read(path5, getSettings(optionsOrSettingsOrCallback), callback);
21075
+ async2.read(path6, getSettings(optionsOrSettingsOrCallback), callback);
21076
21076
  }
21077
21077
  exports.scandir = scandir;
21078
- function scandirSync(path5, optionsOrSettings) {
21078
+ function scandirSync(path6, optionsOrSettings) {
21079
21079
  const settings2 = getSettings(optionsOrSettings);
21080
- return sync2.read(path5, settings2);
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 path5 = __require("path");
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, path5.sep);
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 path5 = __require("path");
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 path5.resolve(this._settings.cwd, filepath);
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(root2, options) {
21794
- return this._walkStream(root2, options);
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(root2, options) {
21847
+ dynamic(root3, options) {
21848
21848
  return new Promise((resolve, reject) => {
21849
- this._walkAsync(root2, options, (error2, entries) => {
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 path5 = __require("path");
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 path5.resolve(this._settings.cwd, task.base);
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 root2 = this._getRootDirectory(task);
22217
+ const root3 = this._getRootDirectory(task);
22218
22218
  const options = this._getReaderOptions(task);
22219
- const entries = await this.api(root2, task, options);
22219
+ const entries = await this.api(root3, task, options);
22220
22220
  return entries.map((entry2) => options.transform(entry2));
22221
22221
  }
22222
- api(root2, task, options) {
22222
+ api(root3, task, options) {
22223
22223
  if (task.dynamic) {
22224
- return this._reader.dynamic(root2, options);
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 root2 = this._getRootDirectory(task);
22245
+ const root3 = this._getRootDirectory(task);
22246
22246
  const options = this._getReaderOptions(task);
22247
- const source = this.api(root2, task, options);
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(root2, task, options) {
22253
+ api(root3, task, options) {
22254
22254
  if (task.dynamic) {
22255
- return this._reader.dynamic(root2, options);
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(root2, options) {
22277
- return this._walkSync(root2, options);
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 root2 = this._getRootDirectory(task);
22321
+ const root3 = this._getRootDirectory(task);
22322
22322
  const options = this._getReaderOptions(task);
22323
- const entries = this.api(root2, task, options);
22323
+ const entries = this.api(root3, task, options);
22324
22324
  return entries.map(options.transform);
22325
22325
  }
22326
- api(root2, task, options) {
22326
+ api(root3, task, options) {
22327
22327
  if (task.dynamic) {
22328
- return this._reader.dynamic(root2, options);
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 fs6 = __require("fs");
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: fs6.lstat,
22345
- lstatSync: fs6.lstatSync,
22346
- stat: fs6.stat,
22347
- statSync: fs6.statSync,
22348
- readdir: fs6.readdir,
22349
- readdirSync: fs6.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 fs10 = (0, node_1.default)();
28539
+ const fs12 = (0, node_1.default)();
28540
28540
  const handler = (err, buffer) => {
28541
28541
  if (fd) {
28542
- fs10.closeSync(fd);
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 = fs10.openSync(filepath, "r");
28554
+ fd = fs12.openSync(filepath, "r");
28555
28555
  let sample = Buffer.allocUnsafe(sampleSize);
28556
- fs10.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
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
- fs10.readFile(filepath, handler);
28568
+ fs12.readFile(filepath, handler);
28569
28569
  });
28570
28570
  exports.detectFile = detectFile;
28571
28571
  var detectFileSync = (filepath, opts = {}) => {
28572
- const fs10 = (0, node_1.default)();
28572
+ const fs12 = (0, node_1.default)();
28573
28573
  if (opts && opts.sampleSize) {
28574
- const fd = fs10.openSync(filepath, "r");
28574
+ const fd = fs12.openSync(filepath, "r");
28575
28575
  let sample = Buffer.allocUnsafe(opts.sampleSize);
28576
- const bytesRead = fs10.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
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
- fs10.closeSync(fd);
28580
+ fs12.closeSync(fd);
28581
28581
  return (0, exports.detect)(sample);
28582
28582
  }
28583
- return (0, exports.detect)(fs10.readFileSync(filepath));
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 Buffer3 = buffer.Buffer;
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 Buffer3) {
28609
- if (!Buffer3.hasOwnProperty(key))
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] = Buffer3[key];
28613
+ Safer[key] = Buffer5[key];
28614
28614
  }
28615
- safer.Buffer.prototype = Buffer3.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 Buffer3(value, encodingOrOffset, length);
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 = Buffer3(size);
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 Buffer3 = require_safer().Buffer;
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 (Buffer3.from("eda0bdedb2a9", "hex").toString() !== "\uD83D\uDCA9") {
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 (!Buffer3.isBuffer(buf)) {
28756
- buf = Buffer3.from(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 Buffer3.from(str, this.enc);
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 Buffer3.from(str, "base64");
28778
+ return Buffer5.from(str, "base64");
28779
28779
  };
28780
28780
  InternalEncoderBase64.prototype.end = function() {
28781
- return Buffer3.from(this.prevStr, "base64");
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 = Buffer3.alloc(str.length * 3);
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 Buffer3.from(str, this.enc);
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 Buffer3.from(str, this.enc);
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 Buffer3 = require_safer().Buffer;
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 = Buffer3.from(str, "ucs2");
28912
- var dst = Buffer3.alloc(src.length * 2);
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 = Buffer3.alloc(4);
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 = Buffer3.alloc(src.length + 4);
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 Buffer3 = require_safer().Buffer;
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 = Buffer3.from(str, "ucs2");
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 = Buffer3.alloc(buf.length + 1);
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 Buffer3 = require_safer().Buffer;
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 Buffer3.from(str.replace(nonDirectChars, function(chunk) {
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(Buffer3.from(b64str, "base64"), "utf16-be");
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(Buffer3.from(b64str, "base64"), "utf16-be");
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(Buffer3.from(this.base64Accum, "base64"), "utf16-be");
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 = Buffer3.alloc(6);
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 = Buffer3.alloc(str.length * 5 + 10);
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 = Buffer3.alloc(10);
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(Buffer3.from(b64str, "base64"), "utf16-be");
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(Buffer3.from(b64str, "base64"), "utf16-be");
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(Buffer3.from(this.base64Accum, "base64"), "utf16-be");
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 Buffer3 = require_safer().Buffer;
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 = Buffer3.from(codecOptions.chars, "ucs2");
29501
- var encodeBuf = Buffer3.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
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 = Buffer3.alloc(str.length);
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 = Buffer3.alloc(buf.length * 2);
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 Buffer3 = require_safer().Buffer;
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 = Buffer3.alloc(str.length * (this.gb18030 ? 4 : 3));
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 = Buffer3.alloc(10);
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 = Buffer3.alloc(buf.length * 2);
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 Buffer3 = require_safer().Buffer;
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, Buffer3.concat(chunks));
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 (!Buffer3.isBuffer(chunk) && !(chunk instanceof Uint8Array)) {
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 Buffer3 = require_safer().Buffer;
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 ? Buffer3.concat([res, trail]) : res;
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 = Buffer3.from("" + (buf || ""), "binary");
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 isFunction2(value) {
32256
+ function isFunction3(value) {
32257
32257
  return typeof value === "function";
32258
32258
  }
32259
- exports.isFunction = isFunction2;
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 identity2(x) {
32859
+ function identity3(x) {
32860
32860
  return x;
32861
32861
  }
32862
- exports.identity = identity2;
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 start3 = provider2.now();
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 - start3
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 isArray2 = Array.isArray;
35916
+ var isArray3 = Array.isArray;
35917
35917
  function callOrApply(fn, args) {
35918
- return isArray2(args) ? fn.apply(undefined, __spreadArray([], __read(args))) : fn(args);
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 isArray2 = Array.isArray;
36059
+ var isArray3 = Array.isArray;
36060
36060
  var getPrototypeOf = Object.getPrototypeOf;
36061
- var objectProto2 = Object.prototype;
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 (isArray2(first_1)) {
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) === objectProto2;
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 merge2() {
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 = merge2;
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 isArray2 = Array.isArray;
36788
+ var isArray3 = Array.isArray;
36789
36789
  function argsOrArgArray(args) {
36790
- return args.length === 1 && isArray2(args[0]) ? args[0] : args;
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(start3, count, scheduler) {
36932
+ function range(start4, count, scheduler) {
36933
36933
  if (count == null) {
36934
- count = start3;
36935
- start3 = 0;
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 + start3;
36940
+ var end = count + start4;
36941
36941
  return new Observable_1.Observable(scheduler ? function(subscriber) {
36942
- var n = start3;
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 = start3;
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 connect2(selector, config2) {
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 = connect2;
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 merge2() {
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 = merge2;
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
@@ -41648,7 +41648,7 @@ var import_websocket_server = __toESM(require_websocket_server(), 1);
41648
41648
  var wss = new import_websocket_server.default({
41649
41649
  noServer: true
41650
41650
  });
41651
- // ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.29_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
41651
+ // ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.32_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
41652
41652
  var exports_manager = {};
41653
41653
  __export(exports_manager, {
41654
41654
  onAppShowInfo: () => onAppShowInfo,
@@ -41725,10 +41725,11 @@ var getConfigFile = (opts) => {
41725
41725
  return "";
41726
41726
  };
41727
41727
 
41728
- // ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.29_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
41728
+ // ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.32_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
41729
41729
  import path$1 from "node:path";
41730
41730
  import fs$4 from "node:fs";
41731
41731
  import { fork } from "node:child_process";
41732
+ import { fileURLToPath } from "node:url";
41732
41733
  import require$$0 from "os";
41733
41734
  import require$$0$1 from "path";
41734
41735
  import require$$0$2 from "util";
@@ -41784,7 +41785,8 @@ var saveAppInfo = async (data, appsPath, filename = "apps.config.json") => {
41784
41785
  fs$4.writeFileSync(configFile, JSON.stringify(data, null, 2));
41785
41786
  };
41786
41787
  var deleteFileAppInfo = async (key, appsPath) => {
41787
- const directory = path$1.join(appsPath, key);
41788
+ const normalizedKey = key.replace(/\//g, path$1.sep);
41789
+ const directory = path$1.join(appsPath, normalizedKey);
41788
41790
  if (!fileIsExist2(directory)) {
41789
41791
  return;
41790
41792
  }
@@ -48076,6 +48078,12 @@ function requireOut() {
48076
48078
  }
48077
48079
  var outExports = requireOut();
48078
48080
  var glob = /* @__PURE__ */ getDefaultExportFromCjs(outExports);
48081
+ var normalizeScriptPath = (scriptPath) => {
48082
+ if (process.platform === "win32") {
48083
+ return scriptPath.replace(/\\/g, "/");
48084
+ }
48085
+ return scriptPath;
48086
+ };
48079
48087
  var connect = async (noDaemonMode = false) => {
48080
48088
  return new Promise((resolve, reject) => {
48081
48089
  pm2.connect(noDaemonMode, (err) => {
@@ -48177,9 +48185,10 @@ class Pm2Manager {
48177
48185
  console.error("script is required");
48178
48186
  return;
48179
48187
  }
48188
+ const normalizedScript = normalizeScriptPath(script);
48180
48189
  const starter = {
48181
48190
  name: appName,
48182
- script,
48191
+ script: normalizedScript,
48183
48192
  cwd: process.cwd(),
48184
48193
  interpreter,
48185
48194
  ...options,
@@ -48336,7 +48345,8 @@ class Manager {
48336
48345
  app.process = childProcess;
48337
48346
  } else if (app.type === "system-app") {
48338
48347
  const pathEntryAndTimestamp = path$1.join(app.path, entry2);
48339
- const module = await import(pathEntryAndTimestamp);
48348
+ const importPath = process.platform === "win32" ? "file:///" + pathEntryAndTimestamp.replace(/\\/g, "/") : pathEntryAndTimestamp;
48349
+ const module = await import(importPath);
48340
48350
  if (module.loadApp && mainApp) {
48341
48351
  await module.loadApp?.(mainApp, app);
48342
48352
  }
@@ -48613,7 +48623,8 @@ class Manager {
48613
48623
  }
48614
48624
  }
48615
48625
  var installAppFromKey = async (key, _appPath) => {
48616
- const directory = path$1.join(_appPath, key);
48626
+ const normalizedKey = key.replace(/\//g, path$1.sep);
48627
+ const directory = path$1.join(_appPath, normalizedKey);
48617
48628
  if (!fileIsExist2(directory)) {
48618
48629
  console.error("App not found", directory);
48619
48630
  throw new Error("App not found");
@@ -48658,8 +48669,8 @@ var installAppFromKey = async (key, _appPath) => {
48658
48669
  var getAppPathKeys = async (_appPath) => {
48659
48670
  const directory = path$1.resolve(_appPath);
48660
48671
  const root2 = directory;
48661
- const path1 = path$1.join(directory, "*/package.json");
48662
- const path22 = path$1.join(directory, "*/*/package.json");
48672
+ const path1 = "*/package.json";
48673
+ const path22 = "*/*/package.json";
48663
48674
  const appsPackages = await glob([path1, path22], {
48664
48675
  cwd: root2,
48665
48676
  onlyFiles: true,
@@ -48668,21 +48679,21 @@ var getAppPathKeys = async (_appPath) => {
48668
48679
  });
48669
48680
  const appPathKeys = appsPackages.map((pkg) => {
48670
48681
  const dir = path$1.dirname(pkg);
48671
- const relativePath = path$1.relative(root2, dir);
48672
- return relativePath;
48682
+ return dir.replace(/\\/g, "/");
48673
48683
  });
48674
48684
  return appPathKeys;
48675
48685
  };
48676
48686
  var clearMicroApp = (link) => {
48677
48687
  try {
48678
- const modulePath = new URL(link, import.meta.url).pathname;
48688
+ const moduleUrl = new URL(link, import.meta.url);
48689
+ const modulePath = fileURLToPath(moduleUrl);
48679
48690
  delete __require.cache[modulePath];
48680
48691
  console.log(`Module ${link} has been unloaded.`);
48681
48692
  } catch (error2) {
48682
48693
  console.error(`Failed to unload module ${link}:`, error2);
48683
48694
  }
48684
48695
  };
48685
- // ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.29_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/pm2.mjs
48696
+ // ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.32_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/pm2.mjs
48686
48697
  import pm22 from "pm2";
48687
48698
  import { promisify as promisify2 } from "node:util";
48688
48699
  var disconnect = promisify2(pm22.disconnect).bind(pm22);
@@ -48692,317 +48703,2015 @@ var restart2 = promisify2(pm22.restart).bind(pm22);
48692
48703
  var reload = promisify2(pm22.reload).bind(pm22);
48693
48704
  var deleteProcess2 = promisify2(pm22.delete).bind(pm22);
48694
48705
  var list2 = promisify2(pm22.list).bind(pm22);
48695
- // src/module/assistant/local-app-manager/assistant-app.ts
48696
- var import_fast_glob = __toESM(require_out4(), 1);
48706
+ // src/module/local-apps/src/modules/app-file.ts
48697
48707
  import path5 from "node:path";
48698
48708
  import fs6 from "node:fs";
48699
-
48700
- class AssistantApp extends Manager {
48701
- config;
48702
- pagesPath;
48703
- constructor(config, mainApp) {
48704
- config.checkMounted();
48705
- const appsPath = config?.configPath?.appsDir || path5.join(process.cwd(), "apps");
48706
- const pagesPath = config?.configPath?.pagesDir || path5.join(process.cwd(), "pages");
48707
- const appsConfigPath = config.configPath?.appsConfigPath;
48708
- const configFimename = path5.basename(appsConfigPath || "");
48709
- super({
48710
- appsPath,
48711
- configFilename: configFimename,
48712
- mainApp
48713
- });
48714
- this.pagesPath = pagesPath;
48715
- 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
+ }
48716
48719
  }
48717
- async pageList() {
48718
- const pages = await import_fast_glob.default(["*/*/package.json"], {
48719
- cwd: this.pagesPath,
48720
- onlyFiles: true
48721
- });
48722
- const pagesParse = pages.map((page) => {
48723
- const [user, app] = page.split("/");
48724
- const contentStr = fs6.readFileSync(path5.join(this.pagesPath, page), "utf-8");
48725
- const content = parseIfJson(contentStr);
48726
- return {
48727
- user,
48728
- app,
48729
- version: content?.version,
48730
- title: content?.title || "",
48731
- description: content?.description || "",
48732
- content
48733
- };
48734
- });
48735
- 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: [] };
48736
48731
  }
48737
- async getPageAndAppList() {
48738
- const root2 = this.config.configPath.configDir;
48739
- const pages = await import_fast_glob.default([root2 + "/apps/*/package.json", root2 + "/pages/*/*/package.json"], {
48740
- cwd: root2,
48741
- onlyFiles: true
48742
- });
48743
- const pagesParse = pages.map((page) => {
48744
- const relativePath = path5.relative(root2, page);
48745
- const contentStr = fs6.readFileSync(path5.join(page), "utf-8");
48746
- const content = parseIfJson(contentStr);
48747
- if (!content.appType) {
48748
- const isWeb = relativePath.startsWith("pages/");
48749
- content.appType = isWeb ? "web" : "app";
48750
- }
48751
- return {
48752
- ...content,
48753
- filepath: relativePath
48754
- };
48755
- });
48756
- 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: [] };
48757
48742
  }
48758
- }
48759
- // ../node_modules/.pnpm/@kevisual+query@0.0.29_@kevisual+ws@8.0.0/node_modules/@kevisual/query/dist/query.js
48760
- var isTextForContentType = (contentType) => {
48761
- if (!contentType)
48762
- return false;
48763
- const textTypes = ["text/", "xml", "html", "javascript", "css", "csv", "plain", "x-www-form-urlencoded"];
48764
- return textTypes.some((type) => contentType.includes(type));
48765
48743
  };
48766
- var adapter = async (opts = {}, overloadOpts) => {
48767
- const controller = new AbortController;
48768
- const signal = controller.signal;
48769
- const isBlob = opts.isBlob || false;
48770
- const isText = opts.isText || false;
48771
- const isPostFile = opts.isPostFile || false;
48772
- const timeout = opts.timeout || 60000 * 3;
48773
- const timer = setTimeout(() => {
48774
- controller.abort();
48775
- }, timeout);
48776
- let method = overloadOpts?.method || opts?.method || "POST";
48777
- let headers = { ...opts?.headers, ...overloadOpts?.headers };
48778
- let origin = "";
48779
- let url;
48780
- if (opts?.url?.startsWith("http")) {
48781
- url = new URL(opts.url);
48782
- } else {
48783
- origin = window?.location?.origin || "http://localhost:51015";
48784
- url = new URL(opts.url, origin);
48785
- }
48786
- const isGet = method === "GET";
48787
- if (isGet) {
48788
- 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;
48789
48752
  }
48790
- let body = undefined;
48791
- if (isGet) {
48792
- body = undefined;
48793
- } else if (isPostFile) {
48794
- body = opts.body;
48795
- } else {
48796
- headers = {
48797
- "Content-Type": "application/json",
48798
- ...headers
48799
- };
48800
- 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;
48801
48760
  }
48802
- return fetch(url, {
48803
- method: method.toUpperCase(),
48804
- signal,
48805
- body,
48806
- ...overloadOpts,
48807
- headers
48808
- }).then(async (response) => {
48809
- const contentType = response.headers.get("Content-Type");
48810
- if (isBlob) {
48811
- return await response.blob();
48812
- }
48813
- const isJson = contentType && contentType.includes("application/json");
48814
- if (isJson && !isText) {
48815
- return await response.json();
48816
- } else if (isTextForContentType(contentType)) {
48817
- return {
48818
- code: 200,
48819
- status: response.status,
48820
- data: await response.text()
48821
- };
48822
- } else {
48823
- return response;
48824
- }
48825
- }).catch((err) => {
48826
- if (err.name === "AbortError") {
48827
- console.log("Request timed out and was aborted");
48828
- }
48829
- console.error(err);
48830
- return {
48831
- code: 500
48832
- };
48833
- }).finally(() => {
48834
- clearTimeout(timer);
48835
- });
48761
+ fs6.rmSync(directory, { recursive: true });
48836
48762
  };
48837
- var setBaseResponse = (res) => {
48838
- res.success = res.code === 200;
48839
- res.showError = (fn) => {
48840
- if (!res.success && !res.noMsg) {
48841
- fn?.();
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];
48842
48797
  }
48843
- };
48844
- return res;
48845
- };
48846
- var wrapperError = ({ code, message }) => {
48847
- const result = {
48848
- code: code || 500,
48849
- success: false,
48850
- message: message || "api request error",
48851
- showError: (fn) => {},
48852
- noMsg: true
48853
- };
48798
+ }
48854
48799
  return result;
48855
- };
48800
+ }
48801
+ var _getRawTag_default = getRawTag2;
48856
48802
 
48857
- class Query {
48858
- adapter;
48859
- url;
48860
- beforeRequest;
48861
- afterResponse;
48862
- headers;
48863
- timeout;
48864
- stop;
48865
- qws;
48866
- constructor(opts) {
48867
- this.adapter = opts?.adapter || adapter;
48868
- this.url = opts?.url || "/api/router";
48869
- this.headers = opts?.headers || {
48870
- "Content-Type": "application/json"
48871
- };
48872
- 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;
48873
48818
  }
48874
- setQueryWs(qws) {
48875
- this.qws = qws;
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;
48876
48854
  }
48877
- setStop(stop3) {
48878
- this.stop = stop3;
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) {}
48879
48885
  }
48880
- async get(params, options) {
48881
- return this.post(params, options);
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;
48882
48901
  }
48883
- async post(body, options) {
48884
- const url = options?.url || this.url;
48885
- const { headers, adapter: adapter2, beforeRequest, afterResponse, timeout, ...rest } = options || {};
48886
- const _headers = { ...this.headers, ...headers };
48887
- const _adapter = adapter2 || this.adapter;
48888
- const _beforeRequest = beforeRequest || this.beforeRequest;
48889
- const _afterResponse = afterResponse || this.afterResponse;
48890
- const _timeout = timeout || this.timeout;
48891
- const req = {
48892
- url,
48893
- headers: _headers,
48894
- body,
48895
- timeout: _timeout,
48896
- ...rest
48897
- };
48898
- try {
48899
- if (_beforeRequest) {
48900
- const res = await _beforeRequest(req);
48901
- if (res === false) {
48902
- return wrapperError({
48903
- code: 500,
48904
- message: "request is cancel",
48905
- req
48906
- });
48907
- }
48908
- }
48909
- } catch (e) {
48910
- console.error("request beforeFn error", e, req);
48911
- return wrapperError({
48912
- code: 500,
48913
- message: "api request beforeFn error"
48914
- });
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 {};
48915
48927
  }
48916
- if (this.stop && !options?.noStop) {
48917
- const that = this;
48918
- await new Promise((resolve) => {
48919
- let timer = 0;
48920
- const detect = setInterval(() => {
48921
- if (!that.stop) {
48922
- clearInterval(detect);
48923
- resolve(true);
48924
- }
48925
- timer++;
48926
- if (timer > 30) {
48927
- console.error("request stop: timeout", req.url, timer);
48928
- }
48929
- }, 1000);
48930
- });
48928
+ if (objectCreate2) {
48929
+ return objectCreate2(proto);
48931
48930
  }
48932
- return _adapter(req).then(async (res) => {
48933
- try {
48934
- setBaseResponse(res);
48935
- if (_afterResponse) {
48936
- return await _afterResponse(res, {
48937
- req,
48938
- res,
48939
- fetch: adapter2
48940
- });
48941
- }
48942
- return res;
48943
- } catch (e) {
48944
- console.error("request afterFn error", e, req);
48945
- return wrapperError({
48946
- code: 500,
48947
- message: "api request afterFn error"
48948
- });
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];
48949
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
48950
49038
  });
49039
+ } else {
49040
+ object[key] = value;
48951
49041
  }
48952
- before(fn) {
48953
- this.beforeRequest = fn;
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);
48954
49058
  }
48955
- after(fn) {
48956
- this.afterResponse = fn;
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
+ }
48957
49078
  }
48958
- async fetchText(urlOrOptions, options) {
48959
- let _options = { ...options };
48960
- if (typeof urlOrOptions === "string" && !_options.url) {
48961
- _options.url = urlOrOptions;
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];
48962
49091
  }
48963
- if (typeof urlOrOptions === "object") {
48964
- _options = { ...urlOrOptions, ..._options };
49092
+ index = -1;
49093
+ var otherArgs = Array(start3 + 1);
49094
+ while (++index < start3) {
49095
+ otherArgs[index] = args[index];
48965
49096
  }
48966
- const res = await adapter({
48967
- method: "GET",
48968
- ..._options,
48969
- headers: {
48970
- ...this.headers,
48971
- ..._options?.headers || {}
48972
- }
48973
- });
48974
- return setBaseResponse(res);
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;
48975
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;
48976
49132
  }
48977
- // src/config.ts
48978
- var _configDir = parseHomeArg(configDir).configDir;
48979
- var configDir2 = AssistantConfig.detectConfigDir(_configDir);
48980
- var assistantConfig2 = new AssistantConfig({
48981
- configDir: configDir2,
48982
- init: false
48983
- });
49133
+ var _isIterateeCall_default = isIterateeCall2;
48984
49134
 
48985
- // src/program.ts
48986
- import fs7 from "fs";
48987
- var version = "0.0.1";
48988
- try {
48989
- if ("0.0.6")
48990
- version = "0.0.6";
48991
- } catch (e) {}
48992
- program.name("asst").description("A CLI tool with envison").version(version, "-v, --version", "output the current version");
48993
- var ls = new Command("ls").description("List files in the current directory").action(() => {
48994
- console.log("List files");
48995
- console.log(fs7.readdirSync(process.cwd()));
48996
- });
48997
- program.addCommand(ls);
48998
- var runProgram = (args) => {
48999
- const [_app, _command] = process.argv;
49000
- program.parse([_app, _command, ...args]);
49001
- };
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);
49149
+ }
49150
+ }
49151
+ return object;
49152
+ });
49153
+ }
49154
+ var _createAssigner_default = createAssigner2;
49002
49155
 
49003
- // src/services/init/index.ts
49004
- import fs9 from "node:fs";
49005
- import path7 from "node:path";
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);
49169
+ }
49170
+ return result;
49171
+ }
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
49196
+ });
49197
+
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")
50699
+ version = "0.0.6";
50700
+ } catch (e) {}
50701
+ program.name("asst").description("A CLI tool with envison").version(version, "-v, --version", "output the current version");
50702
+ var ls = new Command("ls").description("List files in the current directory").action(() => {
50703
+ console.log("List files");
50704
+ console.log(fs9.readdirSync(process.cwd()));
50705
+ });
50706
+ program.addCommand(ls);
50707
+ var runProgram = (args) => {
50708
+ const [_app, _command] = process.argv;
50709
+ program.parse([_app, _command, ...args]);
50710
+ };
50711
+
50712
+ // src/services/init/index.ts
50713
+ import fs11 from "node:fs";
50714
+ import path9 from "node:path";
49006
50715
 
49007
50716
  // ../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
49008
50717
  var ANSI_BACKGROUND_OFFSET = 10;
@@ -50599,12 +52308,12 @@ function requireUtil() {
50599
52308
  util$1.deflate = function(api, bytes, raw) {
50600
52309
  bytes = util$1.decode64(api.deflate(util$1.encode64(bytes)).rval);
50601
52310
  if (raw) {
50602
- var start3 = 2;
52311
+ var start4 = 2;
50603
52312
  var flg = bytes.charCodeAt(1);
50604
52313
  if (flg & 32) {
50605
- start3 = 6;
52314
+ start4 = 6;
50606
52315
  }
50607
- bytes = bytes.substring(start3, bytes.length - 4);
52316
+ bytes = bytes.substring(start4, bytes.length - 4);
50608
52317
  }
50609
52318
  return bytes;
50610
52319
  };
@@ -51983,7 +53692,7 @@ function requireAes() {
51983
53692
  } else {
51984
53693
  cipher2 = forge2.cipher.createCipher(algorithm, options.key);
51985
53694
  }
51986
- var start3 = cipher2.start;
53695
+ var start4 = cipher2.start;
51987
53696
  cipher2.start = function(iv, options2) {
51988
53697
  var output = null;
51989
53698
  if (options2 instanceof forge2.util.ByteBuffer) {
@@ -51993,7 +53702,7 @@ function requireAes() {
51993
53702
  options2 = options2 || {};
51994
53703
  options2.output = output;
51995
53704
  options2.iv = iv;
51996
- start3.call(cipher2, options2);
53705
+ start4.call(cipher2, options2);
51997
53706
  };
51998
53707
  return cipher2;
51999
53708
  }
@@ -52340,15 +54049,15 @@ function requireAsn1() {
52340
54049
  return value;
52341
54050
  };
52342
54051
  function _fromDer(bytes, remaining, depth, options) {
52343
- var start3;
54052
+ var start4;
52344
54053
  _checkBufferLength(bytes, remaining, 2);
52345
54054
  var b1 = bytes.getByte();
52346
54055
  remaining--;
52347
54056
  var tagClass = b1 & 192;
52348
54057
  var type = b1 & 31;
52349
- start3 = bytes.length();
54058
+ start4 = bytes.length();
52350
54059
  var length = _getValueLength(bytes, remaining);
52351
- remaining -= start3 - bytes.length();
54060
+ remaining -= start4 - bytes.length();
52352
54061
  if (length !== undefined && length > remaining) {
52353
54062
  if (options.strict) {
52354
54063
  var error2 = new Error("Too few bytes to read ASN.1 value.");
@@ -52372,16 +54081,16 @@ function requireAsn1() {
52372
54081
  remaining -= 2;
52373
54082
  break;
52374
54083
  }
52375
- start3 = bytes.length();
54084
+ start4 = bytes.length();
52376
54085
  value.push(_fromDer(bytes, remaining, depth + 1, options));
52377
- remaining -= start3 - bytes.length();
54086
+ remaining -= start4 - bytes.length();
52378
54087
  }
52379
54088
  } else {
52380
54089
  while (length > 0) {
52381
- start3 = bytes.length();
54090
+ start4 = bytes.length();
52382
54091
  value.push(_fromDer(bytes, length, depth + 1, options));
52383
- remaining -= start3 - bytes.length();
52384
- length -= start3 - bytes.length();
54092
+ remaining -= start4 - bytes.length();
54093
+ length -= start4 - bytes.length();
52385
54094
  }
52386
54095
  }
52387
54096
  }
@@ -52399,13 +54108,13 @@ function requireAsn1() {
52399
54108
  }
52400
54109
  if (unused === 0) {
52401
54110
  try {
52402
- start3 = bytes.length();
54111
+ start4 = bytes.length();
52403
54112
  var subOptions = {
52404
54113
  strict: true,
52405
54114
  decodeBitStrings: true
52406
54115
  };
52407
54116
  var composed = _fromDer(bytes, remaining, depth + 1, subOptions);
52408
- var used = start3 - bytes.length();
54117
+ var used = start4 - bytes.length();
52409
54118
  remaining -= used;
52410
54119
  if (type == asn1$1.Type.BITSTRING) {
52411
54120
  used++;
@@ -53690,7 +55399,7 @@ function requireDes() {
53690
55399
  } else {
53691
55400
  cipher2 = forge2.cipher.createCipher(algorithm, options.key);
53692
55401
  }
53693
- var start3 = cipher2.start;
55402
+ var start4 = cipher2.start;
53694
55403
  cipher2.start = function(iv, options2) {
53695
55404
  var output = null;
53696
55405
  if (options2 instanceof forge2.util.ByteBuffer) {
@@ -53700,7 +55409,7 @@ function requireDes() {
53700
55409
  options2 = options2 || {};
53701
55410
  options2.output = output;
53702
55411
  options2.iv = iv;
53703
- start3.call(cipher2, options2);
55412
+ start4.call(cipher2, options2);
53704
55413
  };
53705
55414
  return cipher2;
53706
55415
  }
@@ -56581,7 +58290,7 @@ function requirePrime() {
56581
58290
  _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback);
56582
58291
  }
56583
58292
  function _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) {
56584
- var start3 = +new Date;
58293
+ var start4 = +new Date;
56585
58294
  do {
56586
58295
  if (num.bitLength() > bits) {
56587
58296
  num = generateRandom(bits, rng);
@@ -56590,7 +58299,7 @@ function requirePrime() {
56590
58299
  return callback(null, num);
56591
58300
  }
56592
58301
  num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0);
56593
- } while (maxBlockTime < 0 || +new Date - start3 < maxBlockTime);
58302
+ } while (maxBlockTime < 0 || +new Date - start4 < maxBlockTime);
56594
58303
  forge2.util.setImmediate(function() {
56595
58304
  _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback);
56596
58305
  });
@@ -66232,8 +67941,8 @@ var createCert = (attrs = [], altNames = []) => {
66232
67941
  };
66233
67942
 
66234
67943
  // src/module/assistant/https/sign.ts
66235
- import path6 from "node:path";
66236
- import fs8 from "node:fs";
67944
+ import path8 from "node:path";
67945
+ import fs10 from "node:fs";
66237
67946
  var import_dayjs = __toESM(require_dayjs_min(), 1);
66238
67947
 
66239
67948
  class HttpsPem {
@@ -66258,8 +67967,8 @@ class HttpsPem {
66258
67967
  const keyPath = config2.https.keyPath;
66259
67968
  const certPath = config2.https.certPath;
66260
67969
  if (checkFileExists(keyPath) && checkFileExists(certPath)) {
66261
- this.key = fs8.readFileSync(keyPath, "utf-8");
66262
- this.cert = fs8.readFileSync(certPath, "utf-8");
67970
+ this.key = fs10.readFileSync(keyPath, "utf-8");
67971
+ this.cert = fs10.readFileSync(certPath, "utf-8");
66263
67972
  console.log(chalk2.green("使用配置文件 https.keyPath 和 https.certPath 的证书"), keyPath, certPath);
66264
67973
  return;
66265
67974
  } else {
@@ -66275,9 +67984,9 @@ class HttpsPem {
66275
67984
  }
66276
67985
  getPemDir() {
66277
67986
  const configDir3 = this.assistantConfig.configPath?.configDir || process.cwd();
66278
- const pemDir = path6.join(configDir3, "pem");
67987
+ const pemDir = path8.join(configDir3, "pem");
66279
67988
  if (!checkFileExists(pemDir)) {
66280
- fs8.mkdirSync(pemDir, { recursive: true });
67989
+ fs10.mkdirSync(pemDir, { recursive: true });
66281
67990
  }
66282
67991
  return pemDir;
66283
67992
  }
@@ -66286,14 +67995,14 @@ class HttpsPem {
66286
67995
  return;
66287
67996
  const pemDir = this.getPemDir();
66288
67997
  const pemPath = {
66289
- key: path6.join(pemDir, "https-private-key.pem"),
66290
- cert: path6.join(pemDir, "https-cert.pem"),
66291
- config: path6.join(pemDir, "https-config.json")
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")
66292
68001
  };
66293
68002
  const writeCreate = (opts) => {
66294
- fs8.writeFileSync(pemPath.key, opts.key);
66295
- fs8.writeFileSync(pemPath.cert, opts.cert);
66296
- fs8.writeFileSync(pemPath.config, JSON.stringify(opts.data, null, 2));
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));
66297
68006
  };
66298
68007
  if (!checkFileExists(pemPath.key) || !checkFileExists(pemPath.cert)) {
66299
68008
  const { key: key2, cert: cert2, data } = this.createCert();
@@ -66306,11 +68015,11 @@ class HttpsPem {
66306
68015
  }
66307
68016
  if (!checkFileExists(pemPath.config)) {
66308
68017
  const data = this.createExpireData();
66309
- fs8.writeFileSync(pemPath.config, JSON.stringify(data, null, 2));
68018
+ fs10.writeFileSync(pemPath.config, JSON.stringify(data, null, 2));
66310
68019
  }
66311
- const key = fs8.readFileSync(pemPath.key, "utf-8");
66312
- const cert = fs8.readFileSync(pemPath.cert, "utf-8");
66313
- const config2 = fs8.readFileSync(pemPath.config, "utf-8");
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");
66314
68023
  let expireTime = 0;
66315
68024
  try {
66316
68025
  const data = JSON.parse(config2);
@@ -66350,18 +68059,18 @@ class HttpsPem {
66350
68059
  removeCert() {
66351
68060
  const pemDir = this.getPemDir();
66352
68061
  const pemPath = {
66353
- key: path6.join(pemDir, "https-private-key.pem"),
66354
- cert: path6.join(pemDir, "https-cert.pem")
68062
+ key: path8.join(pemDir, "https-private-key.pem"),
68063
+ cert: path8.join(pemDir, "https-cert.pem")
66355
68064
  };
66356
68065
  const oldPath = {
66357
- key: path6.join(pemDir, "https-private-key.pem.bak"),
66358
- cert: path6.join(pemDir, "https-cert.pem.bak")
68066
+ key: path8.join(pemDir, "https-private-key.pem.bak"),
68067
+ cert: path8.join(pemDir, "https-cert.pem.bak")
66359
68068
  };
66360
68069
  if (checkFileExists(pemPath.key)) {
66361
- fs8.renameSync(pemPath.key, oldPath.key);
68070
+ fs10.renameSync(pemPath.key, oldPath.key);
66362
68071
  }
66363
68072
  if (checkFileExists(pemPath.cert)) {
66364
- fs8.renameSync(pemPath.cert, oldPath.cert);
68073
+ fs10.renameSync(pemPath.cert, oldPath.cert);
66365
68074
  }
66366
68075
  }
66367
68076
  createCert(attrs, altNames) {
@@ -66457,13 +68166,13 @@ class AssistantInit extends AssistantConfig {
66457
68166
  });
66458
68167
  }
66459
68168
  checkConfigPath() {
66460
- const assistantPath = path7.join(this.configDir, "assistant-app", "assistant-config.json");
68169
+ const assistantPath = path9.join(this.configDir, "assistant-app", "assistant-config.json");
66461
68170
  return checkFileExists(assistantPath);
66462
68171
  }
66463
68172
  createEnvConfig() {
66464
68173
  const env3 = this.configPath?.envConfigPath;
66465
68174
  if (!checkFileExists(env3, true)) {
66466
- fs9.writeFileSync(env3, `# 环境配置文件
68175
+ fs11.writeFileSync(env3, `# 环境配置文件
66467
68176
  `);
66468
68177
  console.log(chalk2.green("助手环境配置.env文件创建成功"));
66469
68178
  }
@@ -66471,10 +68180,10 @@ class AssistantInit extends AssistantConfig {
66471
68180
  createOtherConfig() {
66472
68181
  const appsConfig = this.configPath?.appsConfigPath;
66473
68182
  if (!checkFileExists(appsConfig, true)) {
66474
- fs9.writeFileSync(appsConfig, JSON.stringify({ description: "apps manager.", list: [] }));
68183
+ fs11.writeFileSync(appsConfig, JSON.stringify({ description: "apps manager.", list: [] }));
66475
68184
  console.log(chalk2.green("助手应用配置文件 apps.json 创建成功"));
66476
68185
  }
66477
- const pemDir = path7.join(this.configPath?.configDir, "pem");
68186
+ const pemDir = path9.join(this.configPath?.configDir, "pem");
66478
68187
  const httpsPem = new HttpsPem(this);
66479
68188
  if (httpsPem.isHttps) {
66480
68189
  if (!checkFileExists(pemDir)) {
@@ -66490,20 +68199,20 @@ class AssistantInit extends AssistantConfig {
66490
68199
  }
66491
68200
  }
66492
68201
  initPnpm() {
66493
- const pnpmPath = path7.join(this.configDir, "assistant-app", "pnpm-workspace.yaml");
68202
+ const pnpmPath = path9.join(this.configDir, "assistant-app", "pnpm-workspace.yaml");
66494
68203
  let create = false;
66495
68204
  if (!checkFileExists(pnpmPath, true)) {
66496
68205
  create = true;
66497
- fs9.writeFileSync(pnpmPath, `packages:
68206
+ fs11.writeFileSync(pnpmPath, `packages:
66498
68207
  - 'apps/**/*'
66499
68208
  - 'pages/**/*'
66500
68209
  `);
66501
68210
  console.log(chalk2.green("助手 pnpm-workspace.yaml 文件创建成功"));
66502
68211
  }
66503
- const packagePath = path7.join(this.configDir, "assistant-app", "package.json");
68212
+ const packagePath = path9.join(this.configDir, "assistant-app", "package.json");
66504
68213
  if (!checkFileExists(packagePath, true)) {
66505
68214
  create = true;
66506
- fs9.writeFileSync(packagePath, `{
68215
+ fs11.writeFileSync(packagePath, `{
66507
68216
  "name": "assistant-app",
66508
68217
  "version": "1.0.0",
66509
68218
  "description": "assistant-app package pnpm, node pkgs projects",
@@ -66539,7 +68248,7 @@ class AssistantInit extends AssistantConfig {
66539
68248
  }
66540
68249
  `);
66541
68250
  console.log(chalk2.green("助手 package.json 文件创建成功, 正在安装依赖..."));
66542
- installDeps({ appPath: path7.dirname(packagePath), isProduction: true }).then(() => {
68251
+ installDeps({ appPath: path9.dirname(packagePath), isProduction: true }).then(() => {
66543
68252
  console.log(chalk2.green("助手依赖安装完成"));
66544
68253
  });
66545
68254
  }
@@ -66573,10 +68282,10 @@ class AssistantInit extends AssistantConfig {
66573
68282
  }
66574
68283
 
66575
68284
  // src/command/config-manager/index.ts
66576
- import path9 from "node:path";
66577
- import fs10 from "node:fs";
68285
+ import path11 from "node:path";
68286
+ import fs12 from "node:fs";
66578
68287
 
66579
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/key.js
68288
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/key.js
66580
68289
  var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
66581
68290
  var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
66582
68291
  var isSpaceKey = (key) => key.name === "space";
@@ -66584,7 +68293,7 @@ var isBackspaceKey = (key) => key.name === "backspace";
66584
68293
  var isTabKey = (key) => key.name === "tab";
66585
68294
  var isNumberKey = (key) => "1234567890".includes(key.name);
66586
68295
  var isEnterKey = (key) => key.name === "enter" || key.name === "return";
66587
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/errors.js
68296
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/errors.js
66588
68297
  class AbortPromptError extends Error {
66589
68298
  name = "AbortPromptError";
66590
68299
  message = "Prompt was aborted";
@@ -66610,10 +68319,10 @@ class HookError extends Error {
66610
68319
  class ValidationError extends Error {
66611
68320
  name = "ValidationError";
66612
68321
  }
66613
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-state.js
68322
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-state.js
66614
68323
  import { AsyncResource as AsyncResource2 } from "node:async_hooks";
66615
68324
 
66616
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/hook-engine.js
68325
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/hook-engine.js
66617
68326
  import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
66618
68327
  var hookStorage = new AsyncLocalStorage;
66619
68328
  function createStore(rl) {
@@ -66718,7 +68427,7 @@ var effectScheduler = {
66718
68427
  }
66719
68428
  };
66720
68429
 
66721
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-state.js
68430
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-state.js
66722
68431
  function useState(defaultValue) {
66723
68432
  return withPointer((pointer) => {
66724
68433
  const setState = AsyncResource2.bind(function setState(newValue) {
@@ -66736,7 +68445,7 @@ function useState(defaultValue) {
66736
68445
  });
66737
68446
  }
66738
68447
 
66739
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-effect.js
68448
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-effect.js
66740
68449
  function useEffect(cb, depArray) {
66741
68450
  withPointer((pointer) => {
66742
68451
  const oldDeps = pointer.get();
@@ -66748,10 +68457,10 @@ function useEffect(cb, depArray) {
66748
68457
  });
66749
68458
  }
66750
68459
 
66751
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/theme.js
68460
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/theme.js
66752
68461
  import { styleText } from "node:util";
66753
68462
 
66754
- // ../node_modules/.pnpm/@inquirer+figures@2.0.1/node_modules/@inquirer/figures/dist/index.js
68463
+ // ../node_modules/.pnpm/@inquirer+figures@2.0.2/node_modules/@inquirer/figures/dist/index.js
66755
68464
  import process5 from "node:process";
66756
68465
  function isUnicodeSupported() {
66757
68466
  if (process5.platform !== "win32") {
@@ -67040,7 +68749,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
67040
68749
  var dist_default = figures;
67041
68750
  var replacements = Object.entries(specialMainSymbols);
67042
68751
 
67043
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/theme.js
68752
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/theme.js
67044
68753
  var defaultTheme = {
67045
68754
  prefix: {
67046
68755
  idle: styleText("blue", "?"),
@@ -67061,8 +68770,8 @@ var defaultTheme = {
67061
68770
  }
67062
68771
  };
67063
68772
 
67064
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/make-theme.js
67065
- function isPlainObject2(value) {
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) {
67066
68775
  if (typeof value !== "object" || value === null)
67067
68776
  return false;
67068
68777
  let proto2 = value;
@@ -67076,7 +68785,7 @@ function deepMerge(...objects) {
67076
68785
  for (const obj of objects) {
67077
68786
  for (const [key, value] of Object.entries(obj)) {
67078
68787
  const prevValue = output[key];
67079
- output[key] = isPlainObject2(prevValue) && isPlainObject2(value) ? deepMerge(prevValue, value) : value;
68788
+ output[key] = isPlainObject3(prevValue) && isPlainObject3(value) ? deepMerge(prevValue, value) : value;
67080
68789
  }
67081
68790
  }
67082
68791
  return output;
@@ -67089,7 +68798,7 @@ function makeTheme(...themes) {
67089
68798
  return deepMerge(...themesToMerge);
67090
68799
  }
67091
68800
 
67092
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-prefix.js
68801
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-prefix.js
67093
68802
  function usePrefix({ status = "idle", theme }) {
67094
68803
  const [showLoader, setShowLoader] = useState(false);
67095
68804
  const [tick, setTick] = useState(0);
@@ -67119,7 +68828,7 @@ function usePrefix({ status = "idle", theme }) {
67119
68828
  const iconName = status === "loading" ? "idle" : status;
67120
68829
  return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
67121
68830
  }
67122
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-memo.js
68831
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-memo.js
67123
68832
  function useMemo(fn, dependencies) {
67124
68833
  return withPointer((pointer) => {
67125
68834
  const prev = pointer.get();
@@ -67131,11 +68840,11 @@ function useMemo(fn, dependencies) {
67131
68840
  return prev.value;
67132
68841
  });
67133
68842
  }
67134
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-ref.js
68843
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-ref.js
67135
68844
  function useRef(val) {
67136
68845
  return useState({ current: val })[0];
67137
68846
  }
67138
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-keypress.js
68847
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-keypress.js
67139
68848
  function useKeypress(userHandler) {
67140
68849
  const signal = useRef(userHandler);
67141
68850
  signal.current = userHandler;
@@ -67153,7 +68862,7 @@ function useKeypress(userHandler) {
67153
68862
  };
67154
68863
  }, []);
67155
68864
  }
67156
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/utils.js
68865
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/utils.js
67157
68866
  var import_cli_width = __toESM(require_cli_width(), 1);
67158
68867
 
67159
68868
  // ../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
@@ -67587,7 +69296,7 @@ function wrapAnsi(string2, columns, options) {
67587
69296
  `);
67588
69297
  }
67589
69298
 
67590
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/utils.js
69299
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/utils.js
67591
69300
  function breakLines(content, width) {
67592
69301
  return content.split(`
67593
69302
  `).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
@@ -67598,7 +69307,7 @@ function readlineWidth() {
67598
69307
  return import_cli_width.default({ defaultWidth: 80, output: readline().output });
67599
69308
  }
67600
69309
 
67601
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
69310
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
67602
69311
  function usePointerPosition({ active, renderedItems, pageSize, loop }) {
67603
69312
  const state = useRef({
67604
69313
  lastPointer: active,
@@ -67664,7 +69373,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
67664
69373
  return pageBuffer.filter((line) => typeof line === "string").join(`
67665
69374
  `);
67666
69375
  }
67667
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/create-prompt.js
69376
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/create-prompt.js
67668
69377
  var import_mute_stream = __toESM(require_lib(), 1);
67669
69378
  import * as readline2 from "node:readline";
67670
69379
  import { AsyncResource as AsyncResource3 } from "node:async_hooks";
@@ -67711,15 +69420,15 @@ class Emitter {
67711
69420
  this.listeners[ev].push(fn);
67712
69421
  }
67713
69422
  removeListener(ev, fn) {
67714
- const list3 = this.listeners[ev];
67715
- const i = list3.indexOf(fn);
69423
+ const list4 = this.listeners[ev];
69424
+ const i = list4.indexOf(fn);
67716
69425
  if (i === -1) {
67717
69426
  return;
67718
69427
  }
67719
- if (i === 0 && list3.length === 1) {
67720
- list3.length = 0;
69428
+ if (i === 0 && list4.length === 1) {
69429
+ list4.length = 0;
67721
69430
  } else {
67722
- list3.splice(i, 1);
69431
+ list4.splice(i, 1);
67723
69432
  }
67724
69433
  }
67725
69434
  emit(ev, code, signal) {
@@ -67877,10 +69586,10 @@ var {
67877
69586
  unload
67878
69587
  } = signalExitWrap(processOk(process6) ? new SignalExit(process6) : new SignalExitFallback);
67879
69588
 
67880
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/screen-manager.js
69589
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/screen-manager.js
67881
69590
  import { stripVTControlCharacters } from "node:util";
67882
69591
 
67883
- // ../node_modules/.pnpm/@inquirer+ansi@2.0.1/node_modules/@inquirer/ansi/dist/index.js
69592
+ // ../node_modules/.pnpm/@inquirer+ansi@2.0.2/node_modules/@inquirer/ansi/dist/index.js
67884
69593
  var ESC = "\x1B[";
67885
69594
  var cursorLeft = ESC + "G";
67886
69595
  var cursorHide = ESC + "?25l";
@@ -67896,7 +69605,7 @@ var cursorTo = (x, y) => {
67896
69605
  var eraseLine = ESC + "2K";
67897
69606
  var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
67898
69607
 
67899
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/screen-manager.js
69608
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/screen-manager.js
67900
69609
  var height = (content) => content.split(`
67901
69610
  `).length;
67902
69611
  var lastLine = (content) => content.split(`
@@ -67961,7 +69670,7 @@ class ScreenManager {
67961
69670
  }
67962
69671
  }
67963
69672
 
67964
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
69673
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
67965
69674
  class PromisePolyfill extends Promise {
67966
69675
  static withResolver() {
67967
69676
  let resolve;
@@ -67974,7 +69683,7 @@ class PromisePolyfill extends Promise {
67974
69683
  }
67975
69684
  }
67976
69685
 
67977
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/create-prompt.js
69686
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/create-prompt.js
67978
69687
  function getCallSites() {
67979
69688
  const _prepareStackTrace = Error.prepareStackTrace;
67980
69689
  let result = [];
@@ -68060,7 +69769,7 @@ function createPrompt(view) {
68060
69769
  };
68061
69770
  return prompt;
68062
69771
  }
68063
- // ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/Separator.js
69772
+ // ../node_modules/.pnpm/@inquirer+core@11.0.2_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/Separator.js
68064
69773
  import { styleText as styleText2 } from "node:util";
68065
69774
  class Separator {
68066
69775
  separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
@@ -68074,7 +69783,7 @@ class Separator {
68074
69783
  return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
68075
69784
  }
68076
69785
  }
68077
- // ../node_modules/.pnpm/@inquirer+checkbox@5.0.1_@types+node@24.10.1/node_modules/@inquirer/checkbox/dist/index.js
69786
+ // ../node_modules/.pnpm/@inquirer+checkbox@5.0.2_@types+node@24.10.1/node_modules/@inquirer/checkbox/dist/index.js
68078
69787
  import { styleText as styleText3 } from "node:util";
68079
69788
  var checkboxTheme = {
68080
69789
  icon: {
@@ -68247,16 +69956,16 @@ var dist_default2 = createPrompt((config2, done) => {
68247
69956
  `).trimEnd();
68248
69957
  return `${lines}${cursorHide}`;
68249
69958
  });
68250
- // ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/index.js
69959
+ // ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/index.js
68251
69960
  var import_chardet = __toESM(require_lib2(), 1);
68252
69961
  var import_iconv_lite = __toESM(require_lib3(), 1);
68253
69962
  import { spawn as spawn2, spawnSync as spawnSync2 } from "child_process";
68254
69963
  import { readFileSync, unlinkSync, writeFileSync } from "fs";
68255
- import path8 from "node:path";
69964
+ import path10 from "node:path";
68256
69965
  import os3 from "node:os";
68257
69966
  import { randomUUID } from "node:crypto";
68258
69967
 
68259
- // ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js
69968
+ // ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js
68260
69969
  class CreateFileError extends Error {
68261
69970
  originalError;
68262
69971
  constructor(originalError) {
@@ -68265,7 +69974,7 @@ class CreateFileError extends Error {
68265
69974
  }
68266
69975
  }
68267
69976
 
68268
- // ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js
69977
+ // ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js
68269
69978
  class LaunchEditorError extends Error {
68270
69979
  originalError;
68271
69980
  constructor(originalError) {
@@ -68274,7 +69983,7 @@ class LaunchEditorError extends Error {
68274
69983
  }
68275
69984
  }
68276
69985
 
68277
- // ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js
69986
+ // ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js
68278
69987
  class ReadFileError extends Error {
68279
69988
  originalError;
68280
69989
  constructor(originalError) {
@@ -68283,7 +69992,7 @@ class ReadFileError extends Error {
68283
69992
  }
68284
69993
  }
68285
69994
 
68286
- // ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js
69995
+ // ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js
68287
69996
  class RemoveFileError extends Error {
68288
69997
  originalError;
68289
69998
  constructor(originalError) {
@@ -68292,7 +70001,7 @@ class RemoveFileError extends Error {
68292
70001
  }
68293
70002
  }
68294
70003
 
68295
- // ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/index.js
70004
+ // ../node_modules/.pnpm/@inquirer+external-editor@2.0.2_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/index.js
68296
70005
  function editAsync(text = "", callback, fileOptions) {
68297
70006
  const editor = new ExternalEditor(text, fileOptions);
68298
70007
  editor.runAsync((err, result) => {
@@ -68388,8 +70097,8 @@ class ExternalEditor {
68388
70097
  const prefix = sanitizeAffix(this.fileOptions.prefix);
68389
70098
  const postfix = sanitizeAffix(this.fileOptions.postfix);
68390
70099
  const filename = `${prefix}${id}${postfix}`;
68391
- const candidate = path8.resolve(baseDir, filename);
68392
- const baseResolved = path8.resolve(baseDir) + path8.sep;
70100
+ const candidate = path10.resolve(baseDir, filename);
70101
+ const baseResolved = path10.resolve(baseDir) + path10.sep;
68393
70102
  if (!candidate.startsWith(baseResolved)) {
68394
70103
  throw new Error("Resolved temporary file escaped the base directory");
68395
70104
  }
@@ -68447,7 +70156,7 @@ class ExternalEditor {
68447
70156
  }
68448
70157
  }
68449
70158
 
68450
- // ../node_modules/.pnpm/@inquirer+editor@5.0.1_@types+node@24.10.1/node_modules/@inquirer/editor/dist/index.js
70159
+ // ../node_modules/.pnpm/@inquirer+editor@5.0.2_@types+node@24.10.1/node_modules/@inquirer/editor/dist/index.js
68451
70160
  var editorTheme = {
68452
70161
  validationFailureMode: "keep"
68453
70162
  };
@@ -68515,7 +70224,7 @@ var dist_default3 = createPrompt((config2, done) => {
68515
70224
  }
68516
70225
  return [[prefix, message, helpTip].filter(Boolean).join(" "), error2];
68517
70226
  });
68518
- // ../node_modules/.pnpm/@inquirer+confirm@6.0.1_@types+node@24.10.1/node_modules/@inquirer/confirm/dist/index.js
70227
+ // ../node_modules/.pnpm/@inquirer+confirm@6.0.2_@types+node@24.10.1/node_modules/@inquirer/confirm/dist/index.js
68519
70228
  function getBooleanValue(value, defaultValue) {
68520
70229
  let answer = defaultValue !== false;
68521
70230
  if (/^(y|yes)/i.test(value))
@@ -68560,7 +70269,7 @@ var dist_default4 = createPrompt((config2, done) => {
68560
70269
  const message = theme.style.message(config2.message, status);
68561
70270
  return `${prefix} ${message}${defaultValue} ${formattedValue}`;
68562
70271
  });
68563
- // ../node_modules/.pnpm/@inquirer+input@5.0.1_@types+node@24.10.1/node_modules/@inquirer/input/dist/index.js
70272
+ // ../node_modules/.pnpm/@inquirer+input@5.0.2_@types+node@24.10.1/node_modules/@inquirer/input/dist/index.js
68564
70273
  var inputTheme = {
68565
70274
  validationFailureMode: "keep"
68566
70275
  };
@@ -68644,7 +70353,7 @@ var dist_default5 = createPrompt((config2, done) => {
68644
70353
  error2
68645
70354
  ];
68646
70355
  });
68647
- // ../node_modules/.pnpm/@inquirer+number@4.0.1_@types+node@24.10.1/node_modules/@inquirer/number/dist/index.js
70356
+ // ../node_modules/.pnpm/@inquirer+number@4.0.2_@types+node@24.10.1/node_modules/@inquirer/number/dist/index.js
68648
70357
  function isStepOf(value, step, min) {
68649
70358
  const valuePow = value * Math.pow(10, 6);
68650
70359
  const stepPow = step * Math.pow(10, 6);
@@ -68724,7 +70433,7 @@ var dist_default6 = createPrompt((config2, done) => {
68724
70433
  error2
68725
70434
  ];
68726
70435
  });
68727
- // ../node_modules/.pnpm/@inquirer+expand@5.0.1_@types+node@24.10.1/node_modules/@inquirer/expand/dist/index.js
70436
+ // ../node_modules/.pnpm/@inquirer+expand@5.0.2_@types+node@24.10.1/node_modules/@inquirer/expand/dist/index.js
68728
70437
  import { styleText as styleText4 } from "node:util";
68729
70438
  function normalizeChoices2(choices) {
68730
70439
  return choices.map((choice) => {
@@ -68821,7 +70530,7 @@ var dist_default7 = createPrompt((config2, done) => {
68821
70530
  `)
68822
70531
  ];
68823
70532
  });
68824
- // ../node_modules/.pnpm/@inquirer+rawlist@5.0.1_@types+node@24.10.1/node_modules/@inquirer/rawlist/dist/index.js
70533
+ // ../node_modules/.pnpm/@inquirer+rawlist@5.0.2_@types+node@24.10.1/node_modules/@inquirer/rawlist/dist/index.js
68825
70534
  import { styleText as styleText5 } from "node:util";
68826
70535
  var numberRegex = /\d+/;
68827
70536
  function isSelectableChoice(choice) {
@@ -68932,7 +70641,7 @@ var dist_default8 = createPrompt((config2, done) => {
68932
70641
  `)
68933
70642
  ];
68934
70643
  });
68935
- // ../node_modules/.pnpm/@inquirer+password@5.0.1_@types+node@24.10.1/node_modules/@inquirer/password/dist/index.js
70644
+ // ../node_modules/.pnpm/@inquirer+password@5.0.2_@types+node@24.10.1/node_modules/@inquirer/password/dist/index.js
68936
70645
  var dist_default9 = createPrompt((config2, done) => {
68937
70646
  const { validate: validate2 = () => true } = config2;
68938
70647
  const theme = makeTheme(config2.theme);
@@ -68980,7 +70689,7 @@ var dist_default9 = createPrompt((config2, done) => {
68980
70689
  }
68981
70690
  return [[prefix, message, config2.mask ? formattedValue : helpTip].join(" "), error2];
68982
70691
  });
68983
- // ../node_modules/.pnpm/@inquirer+search@4.0.1_@types+node@24.10.1/node_modules/@inquirer/search/dist/index.js
70692
+ // ../node_modules/.pnpm/@inquirer+search@4.0.2_@types+node@24.10.1/node_modules/@inquirer/search/dist/index.js
68984
70693
  import { styleText as styleText6 } from "node:util";
68985
70694
  var searchTheme = {
68986
70695
  icon: { cursor: dist_default.pointer },
@@ -69142,7 +70851,7 @@ var dist_default10 = createPrompt((config2, done) => {
69142
70851
  `).trimEnd();
69143
70852
  return [header, body];
69144
70853
  });
69145
- // ../node_modules/.pnpm/@inquirer+select@5.0.1_@types+node@24.10.1/node_modules/@inquirer/select/dist/index.js
70854
+ // ../node_modules/.pnpm/@inquirer+select@5.0.2_@types+node@24.10.1/node_modules/@inquirer/select/dist/index.js
69146
70855
  import { styleText as styleText7 } from "node:util";
69147
70856
  var selectTheme = {
69148
70857
  icon: { cursor: dist_default.pointer },
@@ -69297,15 +71006,15 @@ var dist_default11 = createPrompt((config2, done) => {
69297
71006
  `).trimEnd();
69298
71007
  return `${lines}${cursorHide}`;
69299
71008
  });
69300
- // ../node_modules/.pnpm/inquirer@13.0.1_@types+node@24.10.1/node_modules/inquirer/dist/ui/prompt.js
71009
+ // ../node_modules/.pnpm/inquirer@13.0.2_@types+node@24.10.1/node_modules/inquirer/dist/ui/prompt.js
69301
71010
  var import_rxjs = __toESM(require_cjs(), 1);
69302
71011
  var import_run_async = __toESM(require_run_async(), 1);
69303
71012
  var import_mute_stream2 = __toESM(require_lib(), 1);
69304
71013
  import readline3 from "node:readline";
69305
71014
  var _ = {
69306
- set: (obj, path9 = "", value) => {
71015
+ set: (obj, path11 = "", value) => {
69307
71016
  let pointer = obj;
69308
- path9.split(".").forEach((key, index, arr) => {
71017
+ path11.split(".").forEach((key, index, arr) => {
69309
71018
  if (key === "__proto__" || key === "constructor")
69310
71019
  return;
69311
71020
  if (index === arr.length - 1) {
@@ -69316,8 +71025,8 @@ var _ = {
69316
71025
  pointer = pointer[key];
69317
71026
  });
69318
71027
  },
69319
- get: (obj, path9 = "", defaultValue) => {
69320
- const travel = (regexp) => String.prototype.split.call(path9, regexp).filter(Boolean).reduce((res, key) => res == null ? res : res[key], obj);
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);
69321
71030
  const result = travel(/[,[\]]+?/) || travel(/[,.[\]]+?/);
69322
71031
  return result === undefined || result === obj ? defaultValue : result;
69323
71032
  }
@@ -69508,7 +71217,7 @@ class PromptsRunner {
69508
71217
  };
69509
71218
  }
69510
71219
 
69511
- // ../node_modules/.pnpm/inquirer@13.0.1_@types+node@24.10.1/node_modules/inquirer/dist/index.js
71220
+ // ../node_modules/.pnpm/inquirer@13.0.2_@types+node@24.10.1/node_modules/inquirer/dist/index.js
69512
71221
  var builtInPrompts = {
69513
71222
  input: dist_default5,
69514
71223
  select: dist_default11,
@@ -69559,9 +71268,9 @@ var dist_default12 = inquirer;
69559
71268
  // src/command/config-manager/index.ts
69560
71269
  var Init = new Command("init").description("初始化一个助手客户端,生成配置文件。").option("-p --path <path>", "助手路径,默认为执行命令的目录,如果助手路径不存在则创建。").action((opts) => {
69561
71270
  if (opts.path && !opts.path.startsWith("/")) {
69562
- opts.path = path9.join(process.cwd(), opts.path);
71271
+ opts.path = path11.join(process.cwd(), opts.path);
69563
71272
  } else if (opts.path) {
69564
- opts.path = path9.resolve(opts.path);
71273
+ opts.path = path11.resolve(opts.path);
69565
71274
  }
69566
71275
  const configDir3 = AssistantInit.detectConfigDir(opts.path);
69567
71276
  console.log("configDir", configDir3);
@@ -69573,13 +71282,13 @@ var Init = new Command("init").description("初始化一个助手客户端,生
69573
71282
  program.addCommand(Init);
69574
71283
  var removeCommand = new Command("remove").description("删除助手配置文件").option("-p --path <path>", "助手路径,默认为执行命令的目录,如果助手路径不存在则创建。").action((opts) => {
69575
71284
  if (opts.path && !opts.path.startsWith("/")) {
69576
- opts.path = path9.join(process.cwd(), opts.path);
71285
+ opts.path = path11.join(process.cwd(), opts.path);
69577
71286
  } else if (opts.path) {
69578
- opts.path = path9.resolve(opts.path);
71287
+ opts.path = path11.resolve(opts.path);
69579
71288
  }
69580
71289
  const configDir3 = AssistantInit.detectConfigDir(opts.path);
69581
- const assistantDir = path9.join(configDir3, "assistant-app");
69582
- if (fs10.existsSync(assistantDir)) {
71290
+ const assistantDir = path11.join(configDir3, "assistant-app");
71291
+ if (fs12.existsSync(assistantDir)) {
69583
71292
  dist_default12.prompt([
69584
71293
  {
69585
71294
  type: "confirm",
@@ -69590,7 +71299,7 @@ var removeCommand = new Command("remove").description("删除助手配置文件"
69590
71299
  }
69591
71300
  ]).then((answers) => {
69592
71301
  if (answers.confirm) {
69593
- fs10.rmSync(assistantDir, { recursive: true, force: true });
71302
+ fs12.rmSync(assistantDir, { recursive: true, force: true });
69594
71303
  console.log(source_default.green("助手配置文件已删除"));
69595
71304
  } else {
69596
71305
  console.log(source_default.blue("助手配置文件未删除"));
@@ -69603,9 +71312,9 @@ var removeCommand = new Command("remove").description("删除助手配置文件"
69603
71312
  program.addCommand(removeCommand);
69604
71313
  var npmCommand = new Command("pnpm").description("助手pnpm命令").option("-p --path <path>", "助手路径,默认为执行命令的目录,如果助手路径不存在则创建。").action((opts) => {
69605
71314
  if (opts.path && !opts.path.startsWith("/")) {
69606
- opts.path = path9.join(process.cwd(), opts.path);
71315
+ opts.path = path11.join(process.cwd(), opts.path);
69607
71316
  } else if (opts.path) {
69608
- opts.path = path9.resolve(opts.path);
71317
+ opts.path = path11.resolve(opts.path);
69609
71318
  }
69610
71319
  const configDir3 = AssistantInit.detectConfigDir(opts.path);
69611
71320
  console.log("configDir", configDir3);
@@ -69622,8 +71331,8 @@ var npmCommand = new Command("pnpm").description("助手pnpm命令").option("-p
69622
71331
  Init.addCommand(npmCommand);
69623
71332
 
69624
71333
  // src/services/app/index.ts
69625
- import path10 from "path";
69626
- import fs11 from "fs";
71334
+ import path12 from "path";
71335
+ import fs13 from "fs";
69627
71336
  import { spawnSync as spawnSync3 } from "child_process";
69628
71337
  var runCommand = (command, args) => {
69629
71338
  const result = spawnSync3(command, args, {
@@ -69664,7 +71373,7 @@ class AppDownload {
69664
71373
  if (type === "web") {
69665
71374
  args.push("-o", pagesDir);
69666
71375
  } else if (type === "app") {
69667
- args.push("-o", path10.join(appsDir));
71376
+ args.push("-o", path12.join(appsDir));
69668
71377
  } else {
69669
71378
  throw new Error("应用类型错误,只能是 web 或 app");
69670
71379
  }
@@ -69702,10 +71411,10 @@ class AppDownload {
69702
71411
  let deletePath = "";
69703
71412
  let isDelete = false;
69704
71413
  if (type === "web") {
69705
- const pagePath = path10.join(pagesDir, id);
71414
+ const pagePath = path12.join(pagesDir, id);
69706
71415
  deletePath = pagePath;
69707
71416
  } else if (type === "app") {
69708
- const appPath = path10.join(appsDir, id);
71417
+ const appPath = path12.join(appsDir, id);
69709
71418
  deletePath = appPath;
69710
71419
  }
69711
71420
  if (deletePath && checkFileExists(deletePath)) {
@@ -69716,7 +71425,7 @@ class AppDownload {
69716
71425
  return;
69717
71426
  }
69718
71427
  }
69719
- fs11.rmSync(deletePath, { recursive: true });
71428
+ fs13.rmSync(deletePath, { recursive: true });
69720
71429
  isDelete = true;
69721
71430
  console.log(`删除应用成功: ${deletePath}`);
69722
71431
  }
@@ -69749,7 +71458,7 @@ appManagerCommand.command("start").argument("<app-key-name>", "应用的 key 名
69749
71458
  manager.start(appKey);
69750
71459
  console.log("Start App:", appKey);
69751
71460
  });
69752
- var stop3 = async (appKey) => {
71461
+ var stop4 = async (appKey) => {
69753
71462
  const manager = new AssistantApp(assistantConfig2);
69754
71463
  try {
69755
71464
  await manager.loadConfig();
@@ -69759,7 +71468,7 @@ var stop3 = async (appKey) => {
69759
71468
  }
69760
71469
  };
69761
71470
  appManagerCommand.command("stop").argument("<app-key-name>", "应用的 key 名称").action(async (appKey) => {
69762
- await stop3(appKey);
71471
+ await stop4(appKey);
69763
71472
  console.log("Stop App:", appKey);
69764
71473
  });
69765
71474
  appManagerCommand.command("restart").argument("<app-key-name>", "应用的 key 名称").action(async (appKey) => {
@@ -69788,7 +71497,7 @@ appManagerCommand.command("delete").alias("del").argument("<app-key-name>", "应
69788
71497
  if (id.includes("/")) {
69789
71498
  const [_user, appName] = id.split("/");
69790
71499
  id = appName;
69791
- await stop3(id);
71500
+ await stop4(id);
69792
71501
  }
69793
71502
  await app.deleteApp({ id, type: "app" });
69794
71503
  }
@@ -69909,7 +71618,7 @@ var runScriptsCommand = new Command("run-scripts").alias("run").arguments("<cmd>
69909
71618
  });
69910
71619
  program.addCommand(runScriptsCommand);
69911
71620
 
69912
- // ../node_modules/.pnpm/@kevisual+ai@0.0.12/node_modules/@kevisual/ai/dist/ai-provider.js
71621
+ // ../node_modules/.pnpm/@kevisual+ai@0.0.16/node_modules/@kevisual/ai/dist/ai-provider.js
69913
71622
  import { createRequire as createRequire2 } from "node:module";
69914
71623
  var __create2 = Object.create;
69915
71624
  var __getProtoOf2 = Object.getPrototypeOf;
@@ -69930,13 +71639,13 @@ var __toESM2 = (mod, isNodeMode, target) => {
69930
71639
  var __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
69931
71640
  var __require2 = /* @__PURE__ */ createRequire2(import.meta.url);
69932
71641
  var require_core = __commonJS2((exports, module) => {
69933
- (function(root2, factory) {
71642
+ (function(root3, factory) {
69934
71643
  if (typeof exports === "object") {
69935
71644
  module.exports = exports = factory();
69936
71645
  } else if (typeof define === "function" && define.amd) {
69937
71646
  define([], factory);
69938
71647
  } else {
69939
- root2.CryptoJS = factory();
71648
+ root3.CryptoJS = factory();
69940
71649
  }
69941
71650
  })(exports, function() {
69942
71651
  var CryptoJS = CryptoJS || function(Math2, undefined2) {
@@ -70213,13 +71922,13 @@ var require_core = __commonJS2((exports, module) => {
70213
71922
  });
70214
71923
  });
70215
71924
  var require_enc_base64 = __commonJS2((exports, module) => {
70216
- (function(root2, factory) {
71925
+ (function(root3, factory) {
70217
71926
  if (typeof exports === "object") {
70218
71927
  module.exports = exports = factory(require_core());
70219
71928
  } else if (typeof define === "function" && define.amd) {
70220
71929
  define(["./core"], factory);
70221
71930
  } else {
70222
- factory(root2.CryptoJS);
71931
+ factory(root3.CryptoJS);
70223
71932
  }
70224
71933
  })(exports, function(CryptoJS) {
70225
71934
  (function() {
@@ -70291,13 +72000,13 @@ var require_enc_base64 = __commonJS2((exports, module) => {
70291
72000
  });
70292
72001
  });
70293
72002
  var require_md5 = __commonJS2((exports, module) => {
70294
- (function(root2, factory) {
72003
+ (function(root3, factory) {
70295
72004
  if (typeof exports === "object") {
70296
72005
  module.exports = exports = factory(require_core());
70297
72006
  } else if (typeof define === "function" && define.amd) {
70298
72007
  define(["./core"], factory);
70299
72008
  } else {
70300
- factory(root2.CryptoJS);
72009
+ factory(root3.CryptoJS);
70301
72010
  }
70302
72011
  })(exports, function(CryptoJS) {
70303
72012
  (function(Math2) {
@@ -70466,13 +72175,13 @@ var require_md5 = __commonJS2((exports, module) => {
70466
72175
  });
70467
72176
  });
70468
72177
  var require_sha1 = __commonJS2((exports, module) => {
70469
- (function(root2, factory) {
72178
+ (function(root3, factory) {
70470
72179
  if (typeof exports === "object") {
70471
72180
  module.exports = exports = factory(require_core());
70472
72181
  } else if (typeof define === "function" && define.amd) {
70473
72182
  define(["./core"], factory);
70474
72183
  } else {
70475
- factory(root2.CryptoJS);
72184
+ factory(root3.CryptoJS);
70476
72185
  }
70477
72186
  })(exports, function(CryptoJS) {
70478
72187
  (function() {
@@ -70553,13 +72262,13 @@ var require_sha1 = __commonJS2((exports, module) => {
70553
72262
  });
70554
72263
  });
70555
72264
  var require_hmac = __commonJS2((exports, module) => {
70556
- (function(root2, factory) {
72265
+ (function(root3, factory) {
70557
72266
  if (typeof exports === "object") {
70558
72267
  module.exports = exports = factory(require_core());
70559
72268
  } else if (typeof define === "function" && define.amd) {
70560
72269
  define(["./core"], factory);
70561
72270
  } else {
70562
- factory(root2.CryptoJS);
72271
+ factory(root3.CryptoJS);
70563
72272
  }
70564
72273
  })(exports, function(CryptoJS) {
70565
72274
  (function() {
@@ -70613,13 +72322,13 @@ var require_hmac = __commonJS2((exports, module) => {
70613
72322
  });
70614
72323
  });
70615
72324
  var require_evpkdf = __commonJS2((exports, module) => {
70616
- (function(root2, factory, undef) {
72325
+ (function(root3, factory, undef) {
70617
72326
  if (typeof exports === "object") {
70618
72327
  module.exports = exports = factory(require_core(), require_sha1(), require_hmac());
70619
72328
  } else if (typeof define === "function" && define.amd) {
70620
72329
  define(["./core", "./sha1", "./hmac"], factory);
70621
72330
  } else {
70622
- factory(root2.CryptoJS);
72331
+ factory(root3.CryptoJS);
70623
72332
  }
70624
72333
  })(exports, function(CryptoJS) {
70625
72334
  (function() {
@@ -70670,13 +72379,13 @@ var require_evpkdf = __commonJS2((exports, module) => {
70670
72379
  });
70671
72380
  });
70672
72381
  var require_cipher_core = __commonJS2((exports, module) => {
70673
- (function(root2, factory, undef) {
72382
+ (function(root3, factory, undef) {
70674
72383
  if (typeof exports === "object") {
70675
72384
  module.exports = exports = factory(require_core(), require_evpkdf());
70676
72385
  } else if (typeof define === "function" && define.amd) {
70677
72386
  define(["./core", "./evpkdf"], factory);
70678
72387
  } else {
70679
- factory(root2.CryptoJS);
72388
+ factory(root3.CryptoJS);
70680
72389
  }
70681
72390
  })(exports, function(CryptoJS) {
70682
72391
  CryptoJS.lib.Cipher || function(undefined2) {
@@ -70966,13 +72675,13 @@ var require_cipher_core = __commonJS2((exports, module) => {
70966
72675
  });
70967
72676
  });
70968
72677
  var require_aes = __commonJS2((exports, module) => {
70969
- (function(root2, factory, undef) {
72678
+ (function(root3, factory, undef) {
70970
72679
  if (typeof exports === "object") {
70971
72680
  module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core());
70972
72681
  } else if (typeof define === "function" && define.amd) {
70973
72682
  define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
70974
72683
  } else {
70975
- factory(root2.CryptoJS);
72684
+ factory(root3.CryptoJS);
70976
72685
  }
70977
72686
  })(exports, function(CryptoJS) {
70978
72687
  (function() {
@@ -71116,42 +72825,141 @@ var require_aes = __commonJS2((exports, module) => {
71116
72825
  });
71117
72826
  });
71118
72827
  var require_enc_utf8 = __commonJS2((exports, module) => {
71119
- (function(root2, factory) {
72828
+ (function(root3, factory) {
71120
72829
  if (typeof exports === "object") {
71121
72830
  module.exports = exports = factory(require_core());
71122
72831
  } else if (typeof define === "function" && define.amd) {
71123
72832
  define(["./core"], factory);
71124
72833
  } else {
71125
- factory(root2.CryptoJS);
72834
+ factory(root3.CryptoJS);
71126
72835
  }
71127
72836
  })(exports, function(CryptoJS) {
71128
72837
  return CryptoJS.enc.Utf8;
71129
72838
  });
71130
72839
  });
71131
- var getIsBrowser = () => {
71132
- try {
71133
- return typeof window !== "undefined" && typeof window.document !== "undefined";
71134
- } catch (e) {
71135
- return false;
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
+ }
71136
72851
  }
71137
- };
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
+ }
71138
72949
 
71139
72950
  class BaseChat {
71140
72951
  baseURL;
71141
72952
  model;
71142
72953
  apiKey;
71143
- isBrowser;
71144
- openai;
71145
72954
  prompt_tokens;
71146
72955
  total_tokens;
71147
72956
  completion_tokens;
71148
72957
  responseText;
72958
+ utils = AIUtils;
71149
72959
  constructor(options) {
71150
72960
  this.baseURL = options.baseURL;
71151
72961
  this.model = options.model;
71152
72962
  this.apiKey = options.apiKey;
71153
- const DEFAULT_IS_BROWSER = getIsBrowser();
71154
- this.isBrowser = options.isBrowser ?? DEFAULT_IS_BROWSER;
71155
72963
  }
71156
72964
  post(url = "", opts = {}) {
71157
72965
  let _url = url.startsWith("http") ? url : this.baseURL + url;
@@ -71355,6 +73163,22 @@ class BailianChat extends BaseChat {
71355
73163
  super({ ...options, baseURL });
71356
73164
  }
71357
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
+ }
71358
73182
  var OllamaProvider = Ollama;
71359
73183
  var SiliconFlowProvider = SiliconFlow;
71360
73184
  var CustomProvider = Custom;
@@ -71362,6 +73186,8 @@ var VolcesProvider = Volces;
71362
73186
  var DeepSeekProvider = DeepSeek;
71363
73187
  var ModelScopeProvider = ModelScope;
71364
73188
  var BailianProvider = BailianChat;
73189
+ var ZhipuProvider = Zhipu;
73190
+ var KimiProvider = Kimi;
71365
73191
  var ChatProviderMap = {
71366
73192
  Ollama: OllamaProvider,
71367
73193
  SiliconFlow: SiliconFlowProvider,
@@ -71370,7 +73196,9 @@ var ChatProviderMap = {
71370
73196
  DeepSeek: DeepSeekProvider,
71371
73197
  ModelScope: ModelScopeProvider,
71372
73198
  BaseChat,
71373
- Bailian: BailianProvider
73199
+ Bailian: BailianProvider,
73200
+ Zhipu: ZhipuProvider,
73201
+ Kimi: KimiProvider
71374
73202
  };
71375
73203
 
71376
73204
  class ProviderManager {