@kevisual/cli 0.1.37 → 0.1.39

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/cli.js CHANGED
@@ -4,25 +4,43 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
7
12
  var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
8
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
9
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
22
  for (let key of __getOwnPropNames(mod))
11
23
  if (!__hasOwnProp.call(to, key))
12
24
  __defProp(to, key, {
13
- get: () => mod[key],
25
+ get: __accessProp.bind(mod, key),
14
26
  enumerable: true
15
27
  });
28
+ if (canCache)
29
+ cache.set(mod, to);
16
30
  return to;
17
31
  };
18
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __returnValue = (v) => v;
34
+ function __exportSetter(name, newValue) {
35
+ this[name] = __returnValue.bind(null, newValue);
36
+ }
19
37
  var __export = (target, all) => {
20
38
  for (var name in all)
21
39
  __defProp(target, name, {
22
40
  get: all[name],
23
41
  enumerable: true,
24
42
  configurable: true,
25
- set: (newValue) => all[name] = () => newValue
43
+ set: __exportSetter.bind(all, name)
26
44
  });
27
45
  };
28
46
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
@@ -9749,6 +9767,297 @@ var require_jsonwebtoken = __commonJS((exports, module) => {
9749
9767
  };
9750
9768
  });
9751
9769
 
9770
+ // node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/dayjs.min.js
9771
+ var require_dayjs_min = __commonJS((exports, module) => {
9772
+ (function(t, e) {
9773
+ typeof exports == "object" && typeof module != "undefined" ? module.exports = e() : typeof define == "function" && define.amd ? define(e) : (t = typeof globalThis != "undefined" ? globalThis : t || self).dayjs = e();
9774
+ })(exports, function() {
9775
+ var t = 1000, e = 60000, n = 3600000, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
9776
+ var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
9777
+ return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
9778
+ } }, m = function(t2, e2, n2) {
9779
+ var r2 = String(t2);
9780
+ return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
9781
+ }, v = { s: m, z: function(t2) {
9782
+ var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
9783
+ return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
9784
+ }, m: function t2(e2, n2) {
9785
+ if (e2.date() < n2.date())
9786
+ return -t2(n2, e2);
9787
+ var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
9788
+ return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
9789
+ }, a: function(t2) {
9790
+ return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
9791
+ }, p: function(t2) {
9792
+ return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
9793
+ }, u: function(t2) {
9794
+ return t2 === undefined;
9795
+ } }, g = "en", D = {};
9796
+ D[g] = M;
9797
+ var p = "$isDayjsObject", S = function(t2) {
9798
+ return t2 instanceof _ || !(!t2 || !t2[p]);
9799
+ }, w = function t2(e2, n2, r2) {
9800
+ var i2;
9801
+ if (!e2)
9802
+ return g;
9803
+ if (typeof e2 == "string") {
9804
+ var s2 = e2.toLowerCase();
9805
+ D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
9806
+ var u2 = e2.split("-");
9807
+ if (!i2 && u2.length > 1)
9808
+ return t2(u2[0]);
9809
+ } else {
9810
+ var a2 = e2.name;
9811
+ D[a2] = e2, i2 = a2;
9812
+ }
9813
+ return !r2 && i2 && (g = i2), i2 || !r2 && g;
9814
+ }, O = function(t2, e2) {
9815
+ if (S(t2))
9816
+ return t2.clone();
9817
+ var n2 = typeof e2 == "object" ? e2 : {};
9818
+ return n2.date = t2, n2.args = arguments, new _(n2);
9819
+ }, b = v;
9820
+ b.l = w, b.i = S, b.w = function(t2, e2) {
9821
+ return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
9822
+ };
9823
+ var _ = function() {
9824
+ function M2(t2) {
9825
+ this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
9826
+ }
9827
+ var m2 = M2.prototype;
9828
+ return m2.parse = function(t2) {
9829
+ this.$d = function(t3) {
9830
+ var { date: e2, utc: n2 } = t3;
9831
+ if (e2 === null)
9832
+ return new Date(NaN);
9833
+ if (b.u(e2))
9834
+ return new Date;
9835
+ if (e2 instanceof Date)
9836
+ return new Date(e2);
9837
+ if (typeof e2 == "string" && !/Z$/i.test(e2)) {
9838
+ var r2 = e2.match($);
9839
+ if (r2) {
9840
+ var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
9841
+ return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
9842
+ }
9843
+ }
9844
+ return new Date(e2);
9845
+ }(t2), this.init();
9846
+ }, m2.init = function() {
9847
+ var t2 = this.$d;
9848
+ this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
9849
+ }, m2.$utils = function() {
9850
+ return b;
9851
+ }, m2.isValid = function() {
9852
+ return !(this.$d.toString() === l);
9853
+ }, m2.isSame = function(t2, e2) {
9854
+ var n2 = O(t2);
9855
+ return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
9856
+ }, m2.isAfter = function(t2, e2) {
9857
+ return O(t2) < this.startOf(e2);
9858
+ }, m2.isBefore = function(t2, e2) {
9859
+ return this.endOf(e2) < O(t2);
9860
+ }, m2.$g = function(t2, e2, n2) {
9861
+ return b.u(t2) ? this[e2] : this.set(n2, t2);
9862
+ }, m2.unix = function() {
9863
+ return Math.floor(this.valueOf() / 1000);
9864
+ }, m2.valueOf = function() {
9865
+ return this.$d.getTime();
9866
+ }, m2.startOf = function(t2, e2) {
9867
+ var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
9868
+ var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
9869
+ return r2 ? i2 : i2.endOf(a);
9870
+ }, $2 = function(t3, e3) {
9871
+ return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
9872
+ }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
9873
+ switch (f2) {
9874
+ case h:
9875
+ return r2 ? l2(1, 0) : l2(31, 11);
9876
+ case c:
9877
+ return r2 ? l2(1, M3) : l2(0, M3 + 1);
9878
+ case o:
9879
+ var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
9880
+ return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
9881
+ case a:
9882
+ case d:
9883
+ return $2(v2 + "Hours", 0);
9884
+ case u:
9885
+ return $2(v2 + "Minutes", 1);
9886
+ case s:
9887
+ return $2(v2 + "Seconds", 2);
9888
+ case i:
9889
+ return $2(v2 + "Milliseconds", 3);
9890
+ default:
9891
+ return this.clone();
9892
+ }
9893
+ }, m2.endOf = function(t2) {
9894
+ return this.startOf(t2, false);
9895
+ }, m2.$set = function(t2, e2) {
9896
+ var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
9897
+ if (o2 === c || o2 === h) {
9898
+ var y2 = this.clone().set(d, 1);
9899
+ y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
9900
+ } else
9901
+ l2 && this.$d[l2]($2);
9902
+ return this.init(), this;
9903
+ }, m2.set = function(t2, e2) {
9904
+ return this.clone().$set(t2, e2);
9905
+ }, m2.get = function(t2) {
9906
+ return this[b.p(t2)]();
9907
+ }, m2.add = function(r2, f2) {
9908
+ var d2, l2 = this;
9909
+ r2 = Number(r2);
9910
+ var $2 = b.p(f2), y2 = function(t2) {
9911
+ var e2 = O(l2);
9912
+ return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
9913
+ };
9914
+ if ($2 === c)
9915
+ return this.set(c, this.$M + r2);
9916
+ if ($2 === h)
9917
+ return this.set(h, this.$y + r2);
9918
+ if ($2 === a)
9919
+ return y2(1);
9920
+ if ($2 === o)
9921
+ return y2(7);
9922
+ var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
9923
+ return b.w(m3, this);
9924
+ }, m2.subtract = function(t2, e2) {
9925
+ return this.add(-1 * t2, e2);
9926
+ }, m2.format = function(t2) {
9927
+ var e2 = this, n2 = this.$locale();
9928
+ if (!this.isValid())
9929
+ return n2.invalidDate || l;
9930
+ var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
9931
+ return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
9932
+ }, d2 = function(t3) {
9933
+ return b.s(s2 % 12 || 12, t3, "0");
9934
+ }, $2 = f2 || function(t3, e3, n3) {
9935
+ var r3 = t3 < 12 ? "AM" : "PM";
9936
+ return n3 ? r3.toLowerCase() : r3;
9937
+ };
9938
+ return r2.replace(y, function(t3, r3) {
9939
+ return r3 || function(t4) {
9940
+ switch (t4) {
9941
+ case "YY":
9942
+ return String(e2.$y).slice(-2);
9943
+ case "YYYY":
9944
+ return b.s(e2.$y, 4, "0");
9945
+ case "M":
9946
+ return a2 + 1;
9947
+ case "MM":
9948
+ return b.s(a2 + 1, 2, "0");
9949
+ case "MMM":
9950
+ return h2(n2.monthsShort, a2, c2, 3);
9951
+ case "MMMM":
9952
+ return h2(c2, a2);
9953
+ case "D":
9954
+ return e2.$D;
9955
+ case "DD":
9956
+ return b.s(e2.$D, 2, "0");
9957
+ case "d":
9958
+ return String(e2.$W);
9959
+ case "dd":
9960
+ return h2(n2.weekdaysMin, e2.$W, o2, 2);
9961
+ case "ddd":
9962
+ return h2(n2.weekdaysShort, e2.$W, o2, 3);
9963
+ case "dddd":
9964
+ return o2[e2.$W];
9965
+ case "H":
9966
+ return String(s2);
9967
+ case "HH":
9968
+ return b.s(s2, 2, "0");
9969
+ case "h":
9970
+ return d2(1);
9971
+ case "hh":
9972
+ return d2(2);
9973
+ case "a":
9974
+ return $2(s2, u2, true);
9975
+ case "A":
9976
+ return $2(s2, u2, false);
9977
+ case "m":
9978
+ return String(u2);
9979
+ case "mm":
9980
+ return b.s(u2, 2, "0");
9981
+ case "s":
9982
+ return String(e2.$s);
9983
+ case "ss":
9984
+ return b.s(e2.$s, 2, "0");
9985
+ case "SSS":
9986
+ return b.s(e2.$ms, 3, "0");
9987
+ case "Z":
9988
+ return i2;
9989
+ }
9990
+ return null;
9991
+ }(t3) || i2.replace(":", "");
9992
+ });
9993
+ }, m2.utcOffset = function() {
9994
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
9995
+ }, m2.diff = function(r2, d2, l2) {
9996
+ var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
9997
+ return b.m(y2, m3);
9998
+ };
9999
+ switch (M3) {
10000
+ case h:
10001
+ $2 = D2() / 12;
10002
+ break;
10003
+ case c:
10004
+ $2 = D2();
10005
+ break;
10006
+ case f:
10007
+ $2 = D2() / 3;
10008
+ break;
10009
+ case o:
10010
+ $2 = (g2 - v2) / 604800000;
10011
+ break;
10012
+ case a:
10013
+ $2 = (g2 - v2) / 86400000;
10014
+ break;
10015
+ case u:
10016
+ $2 = g2 / n;
10017
+ break;
10018
+ case s:
10019
+ $2 = g2 / e;
10020
+ break;
10021
+ case i:
10022
+ $2 = g2 / t;
10023
+ break;
10024
+ default:
10025
+ $2 = g2;
10026
+ }
10027
+ return l2 ? $2 : b.a($2);
10028
+ }, m2.daysInMonth = function() {
10029
+ return this.endOf(c).$D;
10030
+ }, m2.$locale = function() {
10031
+ return D[this.$L];
10032
+ }, m2.locale = function(t2, e2) {
10033
+ if (!t2)
10034
+ return this.$L;
10035
+ var n2 = this.clone(), r2 = w(t2, e2, true);
10036
+ return r2 && (n2.$L = r2), n2;
10037
+ }, m2.clone = function() {
10038
+ return b.w(this.$d, this);
10039
+ }, m2.toDate = function() {
10040
+ return new Date(this.valueOf());
10041
+ }, m2.toJSON = function() {
10042
+ return this.isValid() ? this.toISOString() : null;
10043
+ }, m2.toISOString = function() {
10044
+ return this.$d.toISOString();
10045
+ }, m2.toString = function() {
10046
+ return this.$d.toUTCString();
10047
+ }, M2;
10048
+ }(), k = _.prototype;
10049
+ return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
10050
+ k[t2[1]] = function(e2) {
10051
+ return this.$g(e2, t2[0], t2[1]);
10052
+ };
10053
+ }), O.extend = function(t2, e2) {
10054
+ return t2.$i || (t2(e2, _, O), t2.$i = true), O;
10055
+ }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
10056
+ return O(1000 * t2);
10057
+ }, O.en = D[g], O.Ls = D, O.p = {}, O;
10058
+ });
10059
+ });
10060
+
9752
10061
  // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
9753
10062
  var require_error2 = __commonJS((exports) => {
9754
10063
  class CommanderError extends Error {
@@ -10184,15 +10493,15 @@ ${itemIndentStr}`);
10184
10493
  }
10185
10494
  let sumChunks = [chunks.shift()];
10186
10495
  let sumWidth = this.displayWidth(sumChunks[0]);
10187
- chunks.forEach((chunk) => {
10188
- const visibleWidth = this.displayWidth(chunk);
10496
+ chunks.forEach((chunk2) => {
10497
+ const visibleWidth = this.displayWidth(chunk2);
10189
10498
  if (sumWidth + visibleWidth <= width) {
10190
- sumChunks.push(chunk);
10499
+ sumChunks.push(chunk2);
10191
10500
  sumWidth += visibleWidth;
10192
10501
  return;
10193
10502
  }
10194
10503
  wrappedLines.push(sumChunks.join(""));
10195
- const nextChunk = chunk.trimStart();
10504
+ const nextChunk = chunk2.trimStart();
10196
10505
  sumChunks = [nextChunk];
10197
10506
  sumWidth = this.displayWidth(nextChunk);
10198
10507
  });
@@ -10472,7 +10781,7 @@ var require_command = __commonJS((exports) => {
10472
10781
  var EventEmitter5 = __require("node:events").EventEmitter;
10473
10782
  var childProcess = __require("node:child_process");
10474
10783
  var path13 = __require("node:path");
10475
- var fs15 = __require("node:fs");
10784
+ var fs16 = __require("node:fs");
10476
10785
  var process4 = __require("node:process");
10477
10786
  var { Argument, humanReadableArgName } = require_argument();
10478
10787
  var { CommanderError } = require_error2();
@@ -11007,7 +11316,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
11007
11316
  this.processedArgs = [];
11008
11317
  }
11009
11318
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
11010
- if (fs15.existsSync(executableFile))
11319
+ if (fs16.existsSync(executableFile))
11011
11320
  return;
11012
11321
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
11013
11322
  const executableMissing = `'${executableFile}' does not exist
@@ -11022,11 +11331,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
11022
11331
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
11023
11332
  function findFile(baseDir, baseName) {
11024
11333
  const localBin = path13.resolve(baseDir, baseName);
11025
- if (fs15.existsSync(localBin))
11334
+ if (fs16.existsSync(localBin))
11026
11335
  return localBin;
11027
11336
  if (sourceExt.includes(path13.extname(baseName)))
11028
11337
  return;
11029
- const foundExt = sourceExt.find((ext) => fs15.existsSync(`${localBin}${ext}`));
11338
+ const foundExt = sourceExt.find((ext) => fs16.existsSync(`${localBin}${ext}`));
11030
11339
  if (foundExt)
11031
11340
  return `${localBin}${foundExt}`;
11032
11341
  return;
@@ -11038,7 +11347,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
11038
11347
  if (this._scriptPath) {
11039
11348
  let resolvedScriptPath;
11040
11349
  try {
11041
- resolvedScriptPath = fs15.realpathSync(this._scriptPath);
11350
+ resolvedScriptPath = fs16.realpathSync(this._scriptPath);
11042
11351
  } catch {
11043
11352
  resolvedScriptPath = this._scriptPath;
11044
11353
  }
@@ -21276,7 +21585,7 @@ var require_get_intrinsic = __commonJS((exports, module) => {
21276
21585
  var max = require_max();
21277
21586
  var min = require_min();
21278
21587
  var pow = require_pow();
21279
- var round = require_round();
21588
+ var round2 = require_round();
21280
21589
  var sign2 = require_sign2();
21281
21590
  var $Function = Function;
21282
21591
  var getEvalledConstructor = function(expressionSyntax) {
@@ -21388,7 +21697,7 @@ var require_get_intrinsic = __commonJS((exports, module) => {
21388
21697
  "%Math.max%": max,
21389
21698
  "%Math.min%": min,
21390
21699
  "%Math.pow%": pow,
21391
- "%Math.round%": round,
21700
+ "%Math.round%": round2,
21392
21701
  "%Math.sign%": sign2,
21393
21702
  "%Reflect.getPrototypeOf%": $ReflectGPO
21394
21703
  };
@@ -21488,10 +21797,10 @@ var require_get_intrinsic = __commonJS((exports, module) => {
21488
21797
  var reEscapeChar = /\\(\\)?/g;
21489
21798
  var stringToPath = function stringToPath2(string5) {
21490
21799
  var first = $strSlice(string5, 0, 1);
21491
- var last = $strSlice(string5, -1);
21492
- if (first === "%" && last !== "%") {
21800
+ var last2 = $strSlice(string5, -1);
21801
+ if (first === "%" && last2 !== "%") {
21493
21802
  throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
21494
- } else if (last === "%" && first !== "%") {
21803
+ } else if (last2 === "%" && first !== "%") {
21495
21804
  throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
21496
21805
  }
21497
21806
  var result = [];
@@ -21547,8 +21856,8 @@ var require_get_intrinsic = __commonJS((exports, module) => {
21547
21856
  for (var i = 1, isOwn = true;i < parts.length; i += 1) {
21548
21857
  var part = parts[i];
21549
21858
  var first = $strSlice(part, 0, 1);
21550
- var last = $strSlice(part, -1);
21551
- if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
21859
+ var last2 = $strSlice(part, -1);
21860
+ if ((first === '"' || first === "'" || first === "`" || (last2 === '"' || last2 === "'" || last2 === "`")) && first !== last2) {
21552
21861
  throw new $SyntaxError("property names with quotes must have matching quotes");
21553
21862
  }
21554
21863
  if (part === "constructor" || !isOwn) {
@@ -21641,7 +21950,7 @@ var require_form_data = __commonJS((exports, module) => {
21641
21950
  var http3 = __require("http");
21642
21951
  var https2 = __require("https");
21643
21952
  var parseUrl = __require("url").parse;
21644
- var fs16 = __require("fs");
21953
+ var fs17 = __require("fs");
21645
21954
  var Stream = __require("stream").Stream;
21646
21955
  var crypto6 = __require("crypto");
21647
21956
  var mime = require_mime_types();
@@ -21709,7 +22018,7 @@ var require_form_data = __commonJS((exports, module) => {
21709
22018
  if (value.end != null && value.end != Infinity && value.start != null) {
21710
22019
  callback(null, value.end + 1 - (value.start ? value.start : 0));
21711
22020
  } else {
21712
- fs16.stat(value.path, function(err, stat) {
22021
+ fs17.stat(value.path, function(err, stat) {
21713
22022
  if (err) {
21714
22023
  callback(err);
21715
22024
  return;
@@ -21970,13 +22279,13 @@ var require_kind_of = __commonJS((exports, module) => {
21970
22279
  }
21971
22280
  if (isArray(val))
21972
22281
  return "array";
21973
- if (isBuffer(val))
22282
+ if (isBuffer2(val))
21974
22283
  return "buffer";
21975
22284
  if (isArguments(val))
21976
22285
  return "arguments";
21977
- if (isDate(val))
22286
+ if (isDate3(val))
21978
22287
  return "date";
21979
- if (isError(val))
22288
+ if (isError2(val))
21980
22289
  return "error";
21981
22290
  if (isRegexp(val))
21982
22291
  return "regexp";
@@ -22038,10 +22347,10 @@ var require_kind_of = __commonJS((exports, module) => {
22038
22347
  return Array.isArray(val);
22039
22348
  return val instanceof Array;
22040
22349
  }
22041
- function isError(val) {
22350
+ function isError2(val) {
22042
22351
  return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
22043
22352
  }
22044
- function isDate(val) {
22353
+ function isDate3(val) {
22045
22354
  if (val instanceof Date)
22046
22355
  return true;
22047
22356
  return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
@@ -22069,7 +22378,7 @@ var require_kind_of = __commonJS((exports, module) => {
22069
22378
  }
22070
22379
  return false;
22071
22380
  }
22072
- function isBuffer(val) {
22381
+ function isBuffer2(val) {
22073
22382
  if (val.constructor && typeof val.constructor.isBuffer === "function") {
22074
22383
  return val.constructor.isBuffer(val);
22075
22384
  }
@@ -22127,7 +22436,7 @@ var require_section_matter = __commonJS((exports, module) => {
22127
22436
  options2 = { parse: options2 };
22128
22437
  }
22129
22438
  var file3 = toObject(input);
22130
- var defaults = { section_delimiter: "---", parse: identity };
22439
+ var defaults = { section_delimiter: "---", parse: identity2 };
22131
22440
  var opts = extend3({}, defaults, options2);
22132
22441
  var delim = opts.section_delimiter;
22133
22442
  var lines = file3.content.split(/\r?\n/);
@@ -22203,7 +22512,7 @@ var require_section_matter = __commonJS((exports, module) => {
22203
22512
  if (typeOf(input) !== "object") {
22204
22513
  input = { content: input };
22205
22514
  }
22206
- if (typeof input.content !== "string" && !isBuffer(input.content)) {
22515
+ if (typeof input.content !== "string" && !isBuffer2(input.content)) {
22207
22516
  throw new TypeError("expected a buffer or string");
22208
22517
  }
22209
22518
  input.content = input.content.toString();
@@ -22216,10 +22525,10 @@ var require_section_matter = __commonJS((exports, module) => {
22216
22525
  function createSection() {
22217
22526
  return { key: "", data: "", content: "" };
22218
22527
  }
22219
- function identity(val) {
22528
+ function identity2(val) {
22220
22529
  return val;
22221
22530
  }
22222
- function isBuffer(val) {
22531
+ function isBuffer2(val) {
22223
22532
  if (val && val.constructor && typeof val.constructor.isBuffer === "function") {
22224
22533
  return val.constructor.isBuffer(val);
22225
22534
  }
@@ -22287,10 +22596,10 @@ var require_exception = __commonJS((exports, module) => {
22287
22596
  }
22288
22597
  YAMLException.prototype = Object.create(Error.prototype);
22289
22598
  YAMLException.prototype.constructor = YAMLException;
22290
- YAMLException.prototype.toString = function toString(compact) {
22599
+ YAMLException.prototype.toString = function toString(compact2) {
22291
22600
  var result = this.name + ": ";
22292
22601
  result += this.reason || "(unknown reason)";
22293
- if (!compact && this.mark) {
22602
+ if (!compact2 && this.mark) {
22294
22603
  result += " " + this.mark.toString();
22295
22604
  }
22296
22605
  return result;
@@ -22309,44 +22618,44 @@ var require_mark = __commonJS((exports, module) => {
22309
22618
  this.column = column;
22310
22619
  }
22311
22620
  Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
22312
- var head, start, tail, end, snippet;
22621
+ var head2, start, tail2, end, snippet;
22313
22622
  if (!this.buffer)
22314
22623
  return null;
22315
22624
  indent = indent || 4;
22316
22625
  maxLength = maxLength || 75;
22317
- head = "";
22626
+ head2 = "";
22318
22627
  start = this.position;
22319
22628
  while (start > 0 && `\x00\r
22320
22629
  …\u2028\u2029`.indexOf(this.buffer.charAt(start - 1)) === -1) {
22321
22630
  start -= 1;
22322
22631
  if (this.position - start > maxLength / 2 - 1) {
22323
- head = " ... ";
22632
+ head2 = " ... ";
22324
22633
  start += 5;
22325
22634
  break;
22326
22635
  }
22327
22636
  }
22328
- tail = "";
22637
+ tail2 = "";
22329
22638
  end = this.position;
22330
22639
  while (end < this.buffer.length && `\x00\r
22331
22640
  …\u2028\u2029`.indexOf(this.buffer.charAt(end)) === -1) {
22332
22641
  end += 1;
22333
22642
  if (end - this.position > maxLength / 2 - 1) {
22334
- tail = " ... ";
22643
+ tail2 = " ... ";
22335
22644
  end -= 5;
22336
22645
  break;
22337
22646
  }
22338
22647
  }
22339
22648
  snippet = this.buffer.slice(start, end);
22340
- return common2.repeat(" ", indent) + head + snippet + tail + `
22341
- ` + common2.repeat(" ", indent + this.position - start + head.length) + "^";
22649
+ return common2.repeat(" ", indent) + head2 + snippet + tail2 + `
22650
+ ` + common2.repeat(" ", indent + this.position - start + head2.length) + "^";
22342
22651
  };
22343
- Mark.prototype.toString = function toString(compact) {
22652
+ Mark.prototype.toString = function toString(compact2) {
22344
22653
  var snippet, where = "";
22345
22654
  if (this.name) {
22346
22655
  where += 'in "' + this.name + '" ';
22347
22656
  }
22348
22657
  where += "at line " + (this.line + 1) + ", column " + (this.column + 1);
22349
- if (!compact) {
22658
+ if (!compact2) {
22350
22659
  snippet = this.getSnippet();
22351
22660
  if (snippet) {
22352
22661
  where += `:
@@ -22556,14 +22865,14 @@ var require_null = __commonJS((exports, module) => {
22556
22865
  function constructYamlNull() {
22557
22866
  return null;
22558
22867
  }
22559
- function isNull(object3) {
22868
+ function isNull2(object3) {
22560
22869
  return object3 === null;
22561
22870
  }
22562
22871
  module.exports = new Type("tag:yaml.org,2002:null", {
22563
22872
  kind: "scalar",
22564
22873
  resolve: resolveYamlNull,
22565
22874
  construct: constructYamlNull,
22566
- predicate: isNull,
22875
+ predicate: isNull2,
22567
22876
  represent: {
22568
22877
  canonical: function() {
22569
22878
  return "~";
@@ -22594,14 +22903,14 @@ var require_bool = __commonJS((exports, module) => {
22594
22903
  function constructYamlBoolean(data) {
22595
22904
  return data === "true" || data === "True" || data === "TRUE";
22596
22905
  }
22597
- function isBoolean(object3) {
22906
+ function isBoolean2(object3) {
22598
22907
  return Object.prototype.toString.call(object3) === "[object Boolean]";
22599
22908
  }
22600
22909
  module.exports = new Type("tag:yaml.org,2002:bool", {
22601
22910
  kind: "scalar",
22602
22911
  resolve: resolveYamlBoolean,
22603
22912
  construct: constructYamlBoolean,
22604
- predicate: isBoolean,
22913
+ predicate: isBoolean2,
22605
22914
  represent: {
22606
22915
  lowercase: function(object3) {
22607
22916
  return object3 ? "true" : "false";
@@ -23003,7 +23312,7 @@ var require_binary = __commonJS((exports, module) => {
23003
23312
  return result;
23004
23313
  }
23005
23314
  function representYamlBinary(object3) {
23006
- var result = "", bits = 0, idx, tail, max = object3.length, map3 = BASE64_MAP;
23315
+ var result = "", bits = 0, idx, tail2, max = object3.length, map3 = BASE64_MAP;
23007
23316
  for (idx = 0;idx < max; idx++) {
23008
23317
  if (idx % 3 === 0 && idx) {
23009
23318
  result += map3[bits >> 18 & 63];
@@ -23013,18 +23322,18 @@ var require_binary = __commonJS((exports, module) => {
23013
23322
  }
23014
23323
  bits = (bits << 8) + object3[idx];
23015
23324
  }
23016
- tail = max % 3;
23017
- if (tail === 0) {
23325
+ tail2 = max % 3;
23326
+ if (tail2 === 0) {
23018
23327
  result += map3[bits >> 18 & 63];
23019
23328
  result += map3[bits >> 12 & 63];
23020
23329
  result += map3[bits >> 6 & 63];
23021
23330
  result += map3[bits & 63];
23022
- } else if (tail === 2) {
23331
+ } else if (tail2 === 2) {
23023
23332
  result += map3[bits >> 10 & 63];
23024
23333
  result += map3[bits >> 4 & 63];
23025
23334
  result += map3[bits << 2 & 63];
23026
23335
  result += map3[64];
23027
- } else if (tail === 1) {
23336
+ } else if (tail2 === 1) {
23028
23337
  result += map3[bits >> 2 & 63];
23029
23338
  result += map3[bits << 4 & 63];
23030
23339
  result += map3[64];
@@ -23182,14 +23491,14 @@ var require_undefined = __commonJS((exports, module) => {
23182
23491
  function representJavascriptUndefined() {
23183
23492
  return "";
23184
23493
  }
23185
- function isUndefined(object3) {
23494
+ function isUndefined2(object3) {
23186
23495
  return typeof object3 === "undefined";
23187
23496
  }
23188
23497
  module.exports = new Type("tag:yaml.org,2002:js/undefined", {
23189
23498
  kind: "scalar",
23190
23499
  resolve: resolveJavascriptUndefined,
23191
23500
  construct: constructJavascriptUndefined,
23192
- predicate: isUndefined,
23501
+ predicate: isUndefined2,
23193
23502
  represent: representJavascriptUndefined
23194
23503
  });
23195
23504
  });
@@ -23202,10 +23511,10 @@ var require_regexp = __commonJS((exports, module) => {
23202
23511
  return false;
23203
23512
  if (data.length === 0)
23204
23513
  return false;
23205
- var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
23514
+ var regexp = data, tail2 = /\/([gim]*)$/.exec(data), modifiers = "";
23206
23515
  if (regexp[0] === "/") {
23207
- if (tail)
23208
- modifiers = tail[1];
23516
+ if (tail2)
23517
+ modifiers = tail2[1];
23209
23518
  if (modifiers.length > 3)
23210
23519
  return false;
23211
23520
  if (regexp[regexp.length - modifiers.length - 1] !== "/")
@@ -23214,10 +23523,10 @@ var require_regexp = __commonJS((exports, module) => {
23214
23523
  return true;
23215
23524
  }
23216
23525
  function constructJavascriptRegExp(data) {
23217
- var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
23526
+ var regexp = data, tail2 = /\/([gim]*)$/.exec(data), modifiers = "";
23218
23527
  if (regexp[0] === "/") {
23219
- if (tail)
23220
- modifiers = tail[1];
23528
+ if (tail2)
23529
+ modifiers = tail2[1];
23221
23530
  regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
23222
23531
  }
23223
23532
  return new RegExp(regexp, modifiers);
@@ -23232,14 +23541,14 @@ var require_regexp = __commonJS((exports, module) => {
23232
23541
  result += "i";
23233
23542
  return result;
23234
23543
  }
23235
- function isRegExp(object3) {
23544
+ function isRegExp2(object3) {
23236
23545
  return Object.prototype.toString.call(object3) === "[object RegExp]";
23237
23546
  }
23238
23547
  module.exports = new Type("tag:yaml.org,2002:js/regexp", {
23239
23548
  kind: "scalar",
23240
23549
  resolve: resolveJavascriptRegExp,
23241
23550
  construct: constructJavascriptRegExp,
23242
- predicate: isRegExp,
23551
+ predicate: isRegExp2,
23243
23552
  represent: representJavascriptRegExp
23244
23553
  });
23245
23554
  });
@@ -23286,14 +23595,14 @@ var require_function = __commonJS((exports, module) => {
23286
23595
  function representJavascriptFunction(object3) {
23287
23596
  return object3.toString();
23288
23597
  }
23289
- function isFunction(object3) {
23598
+ function isFunction2(object3) {
23290
23599
  return Object.prototype.toString.call(object3) === "[object Function]";
23291
23600
  }
23292
23601
  module.exports = new Type("tag:yaml.org,2002:js/function", {
23293
23602
  kind: "scalar",
23294
23603
  resolve: resolveJavascriptFunction,
23295
23604
  construct: constructJavascriptFunction,
23296
- predicate: isFunction,
23605
+ predicate: isFunction2,
23297
23606
  represent: representJavascriptFunction
23298
23607
  });
23299
23608
  });
@@ -24783,11 +25092,11 @@ var require_dumper = __commonJS((exports, module) => {
24783
25092
  state.tag = _tag;
24784
25093
  state.dump = "[" + _result + "]";
24785
25094
  }
24786
- function writeBlockSequence(state, level2, object3, compact) {
25095
+ function writeBlockSequence(state, level2, object3, compact2) {
24787
25096
  var _result = "", _tag = state.tag, index, length;
24788
25097
  for (index = 0, length = object3.length;index < length; index += 1) {
24789
25098
  if (writeNode(state, level2 + 1, object3[index], true, true)) {
24790
- if (!compact || index !== 0) {
25099
+ if (!compact2 || index !== 0) {
24791
25100
  _result += generateNextLine(state, level2);
24792
25101
  }
24793
25102
  if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
@@ -24826,7 +25135,7 @@ var require_dumper = __commonJS((exports, module) => {
24826
25135
  state.tag = _tag;
24827
25136
  state.dump = "{" + _result + "}";
24828
25137
  }
24829
- function writeBlockMapping(state, level2, object3, compact) {
25138
+ function writeBlockMapping(state, level2, object3, compact2) {
24830
25139
  var _result = "", _tag = state.tag, objectKeyList = Object.keys(object3), index, length, objectKey, objectValue, explicitPair, pairBuffer;
24831
25140
  if (state.sortKeys === true) {
24832
25141
  objectKeyList.sort();
@@ -24837,7 +25146,7 @@ var require_dumper = __commonJS((exports, module) => {
24837
25146
  }
24838
25147
  for (index = 0, length = objectKeyList.length;index < length; index += 1) {
24839
25148
  pairBuffer = "";
24840
- if (!compact || index !== 0) {
25149
+ if (!compact2 || index !== 0) {
24841
25150
  pairBuffer += generateNextLine(state, level2);
24842
25151
  }
24843
25152
  objectKey = objectKeyList[index];
@@ -24894,7 +25203,7 @@ var require_dumper = __commonJS((exports, module) => {
24894
25203
  }
24895
25204
  return false;
24896
25205
  }
24897
- function writeNode(state, level2, object3, block, compact, iskey) {
25206
+ function writeNode(state, level2, object3, block, compact2, iskey) {
24898
25207
  state.tag = null;
24899
25208
  state.dump = object3;
24900
25209
  if (!detectType(state, object3, false)) {
@@ -24910,7 +25219,7 @@ var require_dumper = __commonJS((exports, module) => {
24910
25219
  duplicate = duplicateIndex !== -1;
24911
25220
  }
24912
25221
  if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level2 > 0) {
24913
- compact = false;
25222
+ compact2 = false;
24914
25223
  }
24915
25224
  if (duplicate && state.usedDuplicates[duplicateIndex]) {
24916
25225
  state.dump = "*ref_" + duplicateIndex;
@@ -24920,7 +25229,7 @@ var require_dumper = __commonJS((exports, module) => {
24920
25229
  }
24921
25230
  if (type === "[object Object]") {
24922
25231
  if (block && Object.keys(state.dump).length !== 0) {
24923
- writeBlockMapping(state, level2, state.dump, compact);
25232
+ writeBlockMapping(state, level2, state.dump, compact2);
24924
25233
  if (duplicate) {
24925
25234
  state.dump = "&ref_" + duplicateIndex + state.dump;
24926
25235
  }
@@ -24933,7 +25242,7 @@ var require_dumper = __commonJS((exports, module) => {
24933
25242
  } else if (type === "[object Array]") {
24934
25243
  var arrayLevel = state.noArrayIndent && level2 > 0 ? level2 - 1 : level2;
24935
25244
  if (block && state.dump.length !== 0) {
24936
- writeBlockSequence(state, arrayLevel, state.dump, compact);
25245
+ writeBlockSequence(state, arrayLevel, state.dump, compact2);
24937
25246
  if (duplicate) {
24938
25247
  state.dump = "&ref_" + duplicateIndex + state.dump;
24939
25248
  }
@@ -25307,7 +25616,7 @@ var require_parse4 = __commonJS((exports, module) => {
25307
25616
 
25308
25617
  // node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js
25309
25618
  var require_gray_matter = __commonJS((exports, module) => {
25310
- var fs23 = __require("fs");
25619
+ var fs24 = __require("fs");
25311
25620
  var sections = require_section_matter();
25312
25621
  var defaults = require_defaults();
25313
25622
  var stringify = require_stringify2();
@@ -25394,7 +25703,7 @@ var require_gray_matter = __commonJS((exports, module) => {
25394
25703
  return stringify(file3, data, options2);
25395
25704
  };
25396
25705
  matter.read = function(filepath, options2) {
25397
- const str2 = fs23.readFileSync(filepath, "utf8");
25706
+ const str2 = fs24.readFileSync(filepath, "utf8");
25398
25707
  const file3 = matter(str2, options2);
25399
25708
  file3.path = filepath;
25400
25709
  return file3;
@@ -25421,297 +25730,6 @@ var require_gray_matter = __commonJS((exports, module) => {
25421
25730
  module.exports = matter;
25422
25731
  });
25423
25732
 
25424
- // node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/dayjs.min.js
25425
- var require_dayjs_min = __commonJS((exports, module) => {
25426
- (function(t, e) {
25427
- typeof exports == "object" && typeof module != "undefined" ? module.exports = e() : typeof define == "function" && define.amd ? define(e) : (t = typeof globalThis != "undefined" ? globalThis : t || self).dayjs = e();
25428
- })(exports, function() {
25429
- var t = 1000, e = 60000, n = 3600000, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
25430
- var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
25431
- return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
25432
- } }, m = function(t2, e2, n2) {
25433
- var r2 = String(t2);
25434
- return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
25435
- }, v = { s: m, z: function(t2) {
25436
- var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
25437
- return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
25438
- }, m: function t2(e2, n2) {
25439
- if (e2.date() < n2.date())
25440
- return -t2(n2, e2);
25441
- var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
25442
- return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
25443
- }, a: function(t2) {
25444
- return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
25445
- }, p: function(t2) {
25446
- return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
25447
- }, u: function(t2) {
25448
- return t2 === undefined;
25449
- } }, g = "en", D = {};
25450
- D[g] = M;
25451
- var p = "$isDayjsObject", S = function(t2) {
25452
- return t2 instanceof _ || !(!t2 || !t2[p]);
25453
- }, w = function t2(e2, n2, r2) {
25454
- var i2;
25455
- if (!e2)
25456
- return g;
25457
- if (typeof e2 == "string") {
25458
- var s2 = e2.toLowerCase();
25459
- D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
25460
- var u2 = e2.split("-");
25461
- if (!i2 && u2.length > 1)
25462
- return t2(u2[0]);
25463
- } else {
25464
- var a2 = e2.name;
25465
- D[a2] = e2, i2 = a2;
25466
- }
25467
- return !r2 && i2 && (g = i2), i2 || !r2 && g;
25468
- }, O = function(t2, e2) {
25469
- if (S(t2))
25470
- return t2.clone();
25471
- var n2 = typeof e2 == "object" ? e2 : {};
25472
- return n2.date = t2, n2.args = arguments, new _(n2);
25473
- }, b = v;
25474
- b.l = w, b.i = S, b.w = function(t2, e2) {
25475
- return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
25476
- };
25477
- var _ = function() {
25478
- function M2(t2) {
25479
- this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
25480
- }
25481
- var m2 = M2.prototype;
25482
- return m2.parse = function(t2) {
25483
- this.$d = function(t3) {
25484
- var { date: e2, utc: n2 } = t3;
25485
- if (e2 === null)
25486
- return new Date(NaN);
25487
- if (b.u(e2))
25488
- return new Date;
25489
- if (e2 instanceof Date)
25490
- return new Date(e2);
25491
- if (typeof e2 == "string" && !/Z$/i.test(e2)) {
25492
- var r2 = e2.match($);
25493
- if (r2) {
25494
- var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
25495
- return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
25496
- }
25497
- }
25498
- return new Date(e2);
25499
- }(t2), this.init();
25500
- }, m2.init = function() {
25501
- var t2 = this.$d;
25502
- this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
25503
- }, m2.$utils = function() {
25504
- return b;
25505
- }, m2.isValid = function() {
25506
- return !(this.$d.toString() === l);
25507
- }, m2.isSame = function(t2, e2) {
25508
- var n2 = O(t2);
25509
- return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
25510
- }, m2.isAfter = function(t2, e2) {
25511
- return O(t2) < this.startOf(e2);
25512
- }, m2.isBefore = function(t2, e2) {
25513
- return this.endOf(e2) < O(t2);
25514
- }, m2.$g = function(t2, e2, n2) {
25515
- return b.u(t2) ? this[e2] : this.set(n2, t2);
25516
- }, m2.unix = function() {
25517
- return Math.floor(this.valueOf() / 1000);
25518
- }, m2.valueOf = function() {
25519
- return this.$d.getTime();
25520
- }, m2.startOf = function(t2, e2) {
25521
- var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
25522
- var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
25523
- return r2 ? i2 : i2.endOf(a);
25524
- }, $2 = function(t3, e3) {
25525
- return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
25526
- }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
25527
- switch (f2) {
25528
- case h:
25529
- return r2 ? l2(1, 0) : l2(31, 11);
25530
- case c:
25531
- return r2 ? l2(1, M3) : l2(0, M3 + 1);
25532
- case o:
25533
- var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
25534
- return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
25535
- case a:
25536
- case d:
25537
- return $2(v2 + "Hours", 0);
25538
- case u:
25539
- return $2(v2 + "Minutes", 1);
25540
- case s:
25541
- return $2(v2 + "Seconds", 2);
25542
- case i:
25543
- return $2(v2 + "Milliseconds", 3);
25544
- default:
25545
- return this.clone();
25546
- }
25547
- }, m2.endOf = function(t2) {
25548
- return this.startOf(t2, false);
25549
- }, m2.$set = function(t2, e2) {
25550
- var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
25551
- if (o2 === c || o2 === h) {
25552
- var y2 = this.clone().set(d, 1);
25553
- y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
25554
- } else
25555
- l2 && this.$d[l2]($2);
25556
- return this.init(), this;
25557
- }, m2.set = function(t2, e2) {
25558
- return this.clone().$set(t2, e2);
25559
- }, m2.get = function(t2) {
25560
- return this[b.p(t2)]();
25561
- }, m2.add = function(r2, f2) {
25562
- var d2, l2 = this;
25563
- r2 = Number(r2);
25564
- var $2 = b.p(f2), y2 = function(t2) {
25565
- var e2 = O(l2);
25566
- return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
25567
- };
25568
- if ($2 === c)
25569
- return this.set(c, this.$M + r2);
25570
- if ($2 === h)
25571
- return this.set(h, this.$y + r2);
25572
- if ($2 === a)
25573
- return y2(1);
25574
- if ($2 === o)
25575
- return y2(7);
25576
- var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
25577
- return b.w(m3, this);
25578
- }, m2.subtract = function(t2, e2) {
25579
- return this.add(-1 * t2, e2);
25580
- }, m2.format = function(t2) {
25581
- var e2 = this, n2 = this.$locale();
25582
- if (!this.isValid())
25583
- return n2.invalidDate || l;
25584
- var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
25585
- return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
25586
- }, d2 = function(t3) {
25587
- return b.s(s2 % 12 || 12, t3, "0");
25588
- }, $2 = f2 || function(t3, e3, n3) {
25589
- var r3 = t3 < 12 ? "AM" : "PM";
25590
- return n3 ? r3.toLowerCase() : r3;
25591
- };
25592
- return r2.replace(y, function(t3, r3) {
25593
- return r3 || function(t4) {
25594
- switch (t4) {
25595
- case "YY":
25596
- return String(e2.$y).slice(-2);
25597
- case "YYYY":
25598
- return b.s(e2.$y, 4, "0");
25599
- case "M":
25600
- return a2 + 1;
25601
- case "MM":
25602
- return b.s(a2 + 1, 2, "0");
25603
- case "MMM":
25604
- return h2(n2.monthsShort, a2, c2, 3);
25605
- case "MMMM":
25606
- return h2(c2, a2);
25607
- case "D":
25608
- return e2.$D;
25609
- case "DD":
25610
- return b.s(e2.$D, 2, "0");
25611
- case "d":
25612
- return String(e2.$W);
25613
- case "dd":
25614
- return h2(n2.weekdaysMin, e2.$W, o2, 2);
25615
- case "ddd":
25616
- return h2(n2.weekdaysShort, e2.$W, o2, 3);
25617
- case "dddd":
25618
- return o2[e2.$W];
25619
- case "H":
25620
- return String(s2);
25621
- case "HH":
25622
- return b.s(s2, 2, "0");
25623
- case "h":
25624
- return d2(1);
25625
- case "hh":
25626
- return d2(2);
25627
- case "a":
25628
- return $2(s2, u2, true);
25629
- case "A":
25630
- return $2(s2, u2, false);
25631
- case "m":
25632
- return String(u2);
25633
- case "mm":
25634
- return b.s(u2, 2, "0");
25635
- case "s":
25636
- return String(e2.$s);
25637
- case "ss":
25638
- return b.s(e2.$s, 2, "0");
25639
- case "SSS":
25640
- return b.s(e2.$ms, 3, "0");
25641
- case "Z":
25642
- return i2;
25643
- }
25644
- return null;
25645
- }(t3) || i2.replace(":", "");
25646
- });
25647
- }, m2.utcOffset = function() {
25648
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
25649
- }, m2.diff = function(r2, d2, l2) {
25650
- var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
25651
- return b.m(y2, m3);
25652
- };
25653
- switch (M3) {
25654
- case h:
25655
- $2 = D2() / 12;
25656
- break;
25657
- case c:
25658
- $2 = D2();
25659
- break;
25660
- case f:
25661
- $2 = D2() / 3;
25662
- break;
25663
- case o:
25664
- $2 = (g2 - v2) / 604800000;
25665
- break;
25666
- case a:
25667
- $2 = (g2 - v2) / 86400000;
25668
- break;
25669
- case u:
25670
- $2 = g2 / n;
25671
- break;
25672
- case s:
25673
- $2 = g2 / e;
25674
- break;
25675
- case i:
25676
- $2 = g2 / t;
25677
- break;
25678
- default:
25679
- $2 = g2;
25680
- }
25681
- return l2 ? $2 : b.a($2);
25682
- }, m2.daysInMonth = function() {
25683
- return this.endOf(c).$D;
25684
- }, m2.$locale = function() {
25685
- return D[this.$L];
25686
- }, m2.locale = function(t2, e2) {
25687
- if (!t2)
25688
- return this.$L;
25689
- var n2 = this.clone(), r2 = w(t2, e2, true);
25690
- return r2 && (n2.$L = r2), n2;
25691
- }, m2.clone = function() {
25692
- return b.w(this.$d, this);
25693
- }, m2.toDate = function() {
25694
- return new Date(this.valueOf());
25695
- }, m2.toJSON = function() {
25696
- return this.isValid() ? this.toISOString() : null;
25697
- }, m2.toISOString = function() {
25698
- return this.$d.toISOString();
25699
- }, m2.toString = function() {
25700
- return this.$d.toUTCString();
25701
- }, M2;
25702
- }(), k = _.prototype;
25703
- return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
25704
- k[t2[1]] = function(e2) {
25705
- return this.$g(e2, t2[0], t2[1]);
25706
- };
25707
- }), O.extend = function(t2, e2) {
25708
- return t2.$i || (t2(e2, _, O), t2.$i = true), O;
25709
- }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
25710
- return O(1000 * t2);
25711
- }, O.en = D[g], O.Ls = D, O.p = {}, O;
25712
- });
25713
- });
25714
-
25715
25733
  // node_modules/.pnpm/@kevisual+router@0.2.5/node_modules/@kevisual/router/dist/router.js
25716
25734
  import { createRequire as createRequire2 } from "node:module";
25717
25735
  import { webcrypto as crypto2 } from "node:crypto";
@@ -25724,15 +25742,15 @@ var __getProtoOf2 = Object.getPrototypeOf;
25724
25742
  var __defProp2 = Object.defineProperty;
25725
25743
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
25726
25744
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
25727
- function __accessProp(key) {
25745
+ function __accessProp2(key) {
25728
25746
  return this[key];
25729
25747
  }
25730
- var __toESMCache_node;
25731
- var __toESMCache_esm;
25748
+ var __toESMCache_node2;
25749
+ var __toESMCache_esm2;
25732
25750
  var __toESM2 = (mod, isNodeMode, target) => {
25733
25751
  var canCache = mod != null && typeof mod === "object";
25734
25752
  if (canCache) {
25735
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
25753
+ var cache = isNodeMode ? __toESMCache_node2 ??= new WeakMap : __toESMCache_esm2 ??= new WeakMap;
25736
25754
  var cached = cache.get(mod);
25737
25755
  if (cached)
25738
25756
  return cached;
@@ -25742,7 +25760,7 @@ var __toESM2 = (mod, isNodeMode, target) => {
25742
25760
  for (let key of __getOwnPropNames2(mod))
25743
25761
  if (!__hasOwnProp2.call(to, key))
25744
25762
  __defProp2(to, key, {
25745
- get: __accessProp.bind(mod, key),
25763
+ get: __accessProp2.bind(mod, key),
25746
25764
  enumerable: true
25747
25765
  });
25748
25766
  if (canCache)
@@ -25750,9 +25768,9 @@ var __toESM2 = (mod, isNodeMode, target) => {
25750
25768
  return to;
25751
25769
  };
25752
25770
  var __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
25753
- var __returnValue = (v) => v;
25754
- function __exportSetter(name, newValue) {
25755
- this[name] = __returnValue.bind(null, newValue);
25771
+ var __returnValue2 = (v) => v;
25772
+ function __exportSetter2(name, newValue) {
25773
+ this[name] = __returnValue2.bind(null, newValue);
25756
25774
  }
25757
25775
  var __export2 = (target, all) => {
25758
25776
  for (var name in all)
@@ -25760,7 +25778,7 @@ var __export2 = (target, all) => {
25760
25778
  get: all[name],
25761
25779
  enumerable: true,
25762
25780
  configurable: true,
25763
- set: __exportSetter.bind(all, name)
25781
+ set: __exportSetter2.bind(all, name)
25764
25782
  });
25765
25783
  };
25766
25784
  var __require2 = /* @__PURE__ */ createRequire2(import.meta.url);
@@ -44435,6 +44453,7 @@ class App extends QueryRouterServer {
44435
44453
  }
44436
44454
 
44437
44455
  // node_modules/.pnpm/@kevisual+context@0.0.8/node_modules/@kevisual/context/dist/app.js
44456
+ var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
44438
44457
  var isBrowser22 = typeof window !== "undefined" && typeof window.document !== "undefined";
44439
44458
  function getDefaultExportFromCjs(x) {
44440
44459
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -44987,6 +45006,33 @@ class InitEnv {
44987
45006
  }
44988
45007
  }
44989
45008
  InitEnv.init();
45009
+ var useKey = (envKey, initKey = "context") => {
45010
+ let key = envKey;
45011
+ if (!key)
45012
+ return null;
45013
+ const _env = useEnv({}, initKey);
45014
+ if (typeof _env[key] !== "undefined") {
45015
+ return _env[key];
45016
+ }
45017
+ if (!isBrowser) {
45018
+ const nodeEev = gt?.process?.env;
45019
+ if (typeof nodeEev !== "undefined") {
45020
+ const value = nodeEev[key];
45021
+ if (typeof value !== "undefined") {
45022
+ return value;
45023
+ }
45024
+ }
45025
+ } else {
45026
+ const storage = gt?.localStorage;
45027
+ if (typeof storage !== "undefined") {
45028
+ const value = storage.getItem(key);
45029
+ if (typeof value !== "undefined") {
45030
+ return value;
45031
+ }
45032
+ }
45033
+ }
45034
+ return null;
45035
+ };
44990
45036
 
44991
45037
  // src/app.ts
44992
45038
  var app = useContextKey("app", () => {
@@ -60442,7 +60488,7 @@ var mergeConfig = (config3) => {
60442
60488
  global.config = _config;
60443
60489
  return _config;
60444
60490
  };
60445
- var useKey = (key, opts) => {
60491
+ var useKey2 = (key, opts) => {
60446
60492
  let v = useConfig()[key];
60447
60493
  if (!v) {
60448
60494
  v = process.env[key];
@@ -60458,7 +60504,7 @@ var useKey = (key, opts) => {
60458
60504
  }
60459
60505
  return v;
60460
60506
  };
60461
- var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
60507
+ var isBrowser3 = typeof window !== "undefined" && typeof window.document !== "undefined";
60462
60508
  function getDefaultExportFromCjs2(x) {
60463
60509
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
60464
60510
  }
@@ -61042,7 +61088,7 @@ var writeConfig = (config3) => {
61042
61088
  return config3;
61043
61089
  };
61044
61090
  var getEnvToken = () => {
61045
- const envTokne = useKey("KEVISUAL_TOKEN") || "";
61091
+ const envTokne = useKey2("KEVISUAL_TOKEN") || "";
61046
61092
  return envTokne;
61047
61093
  };
61048
61094
 
@@ -62594,7 +62640,6 @@ var normalizeScriptPath = (scriptPath) => {
62594
62640
 
62595
62641
  // src/module/download/install.ts
62596
62642
  var import_fast_glob = __toESM(require_out4(), 1);
62597
-
62598
62643
  // node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@25.5.2/node_modules/@inquirer/core/dist/lib/key.js
62599
62644
  var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
62600
62645
  var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
@@ -64975,12 +65020,12 @@ app.route({
64975
65020
  }
64976
65021
  }).define(async (ctx) => {
64977
65022
  const registry3 = ctx.args.registry || "default";
64978
- let DOCKER_USERNAME = useKey("DOCKER_USERNAME");
64979
- let DOCKER_PASSWORD = useKey("DOCKER_PASSWORD");
64980
- let DOCKER_REGISTRY = useKey("DOCKER_REGISTRY");
65023
+ let DOCKER_USERNAME = useKey2("DOCKER_USERNAME");
65024
+ let DOCKER_PASSWORD = useKey2("DOCKER_PASSWORD");
65025
+ let DOCKER_REGISTRY = useKey2("DOCKER_REGISTRY");
64981
65026
  if (registry3 !== "default") {
64982
65027
  DOCKER_USERNAME = "cnb";
64983
- DOCKER_PASSWORD = useKey("CNB_TOKEN");
65028
+ DOCKER_PASSWORD = useKey2("CNB_TOKEN");
64984
65029
  DOCKER_REGISTRY = "docker.cnb.cool";
64985
65030
  }
64986
65031
  if (!DOCKER_USERNAME || !DOCKER_PASSWORD) {
@@ -65017,7 +65062,7 @@ app.route({
65017
65062
  }
65018
65063
  }).define(async () => {
65019
65064
  let DOCKER_USERNAME = "cnb";
65020
- let DOCKER_PASSWORD = useKey("CNB_TOKEN");
65065
+ let DOCKER_PASSWORD = useKey2("CNB_TOKEN");
65021
65066
  if (!DOCKER_PASSWORD) {
65022
65067
  console.log(chalk2.red("请先配置 CNB_TOKEN"));
65023
65068
  return;
@@ -67922,17 +67967,6 @@ var loginInCommand = async () => {
67922
67967
 
67923
67968
  // src/routes/login.ts
67924
67969
  import util2 from "util";
67925
-
67926
- // node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
67927
- function isPrimitive(value) {
67928
- return value == null || typeof value !== "object" && typeof value !== "function";
67929
- }
67930
-
67931
- // node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
67932
- function isTypedArray(x) {
67933
- return ArrayBuffer.isView(x) && !(x instanceof DataView);
67934
- }
67935
-
67936
67970
  // node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
67937
67971
  function getSymbols(object3) {
67938
67972
  return Object.getOwnPropertySymbols(object3).filter((symbol3) => Object.prototype.propertyIsEnumerable.call(object3, symbol3));
@@ -67970,6 +68004,16 @@ var int32ArrayTag = "[object Int32Array]";
67970
68004
  var float32ArrayTag = "[object Float32Array]";
67971
68005
  var float64ArrayTag = "[object Float64Array]";
67972
68006
 
68007
+ // node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
68008
+ function isPrimitive(value) {
68009
+ return value == null || typeof value !== "object" && typeof value !== "function";
68010
+ }
68011
+
68012
+ // node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
68013
+ function isTypedArray(x) {
68014
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
68015
+ }
68016
+
67973
68017
  // node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/object/cloneDeepWith.mjs
67974
68018
  function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = new Map, cloneValue = undefined) {
67975
68019
  const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);
@@ -68366,10 +68410,10 @@ var adapter3 = async (opts = {}, overloadOpts) => {
68366
68410
  } else if (opts.isText) {
68367
68411
  responseType = "text";
68368
68412
  }
68369
- const timeout = opts.timeout || 60000 * 3;
68413
+ const timeout2 = opts.timeout || 60000 * 3;
68370
68414
  const timer = setTimeout(() => {
68371
68415
  controller.abort();
68372
- }, timeout);
68416
+ }, timeout2);
68373
68417
  let method = overloadOpts?.method || opts?.method || "POST";
68374
68418
  let headers = { ...opts?.headers, ...overloadOpts?.headers };
68375
68419
  let origin = "";
@@ -68508,18 +68552,18 @@ class Query3 {
68508
68552
  }
68509
68553
  async post(body, options2) {
68510
68554
  const url4 = options2?.url || this.url;
68511
- const { headers, adapter: adapter22, beforeRequest, afterResponse, timeout, ...rest } = options2 || {};
68555
+ const { headers, adapter: adapter22, beforeRequest, afterResponse, timeout: timeout2, ...rest2 } = options2 || {};
68512
68556
  const _headers = { ...this.headers, ...headers };
68513
68557
  const _adapter = adapter22 || this.adapter;
68514
68558
  const _beforeRequest = beforeRequest || this.beforeRequest;
68515
68559
  const _afterResponse = afterResponse || this.afterResponse;
68516
- const _timeout = timeout || this.timeout;
68560
+ const _timeout = timeout2 || this.timeout;
68517
68561
  const req = {
68518
68562
  url: url4,
68519
68563
  headers: _headers,
68520
68564
  body,
68521
68565
  timeout: _timeout,
68522
- ...rest
68566
+ ...rest2
68523
68567
  };
68524
68568
  try {
68525
68569
  if (_beforeRequest) {
@@ -68806,10 +68850,10 @@ var adapter4 = async (opts = {}, overloadOpts) => {
68806
68850
  } else if (opts.isText) {
68807
68851
  responseType = "text";
68808
68852
  }
68809
- const timeout = opts.timeout || 60000 * 3;
68853
+ const timeout2 = opts.timeout || 60000 * 3;
68810
68854
  const timer = setTimeout(() => {
68811
68855
  controller.abort();
68812
- }, timeout);
68856
+ }, timeout2);
68813
68857
  let method = overloadOpts?.method || opts?.method || "POST";
68814
68858
  let headers = { ...opts?.headers, ...overloadOpts?.headers };
68815
68859
  let origin = "";
@@ -68948,18 +68992,18 @@ class Query4 {
68948
68992
  }
68949
68993
  async post(body, options2) {
68950
68994
  const url4 = options2?.url || this.url;
68951
- const { headers, adapter: adapter22, beforeRequest, afterResponse, timeout, ...rest } = options2 || {};
68995
+ const { headers, adapter: adapter22, beforeRequest, afterResponse, timeout: timeout2, ...rest2 } = options2 || {};
68952
68996
  const _headers = { ...this.headers, ...headers };
68953
68997
  const _adapter = adapter22 || this.adapter;
68954
68998
  const _beforeRequest = beforeRequest || this.beforeRequest;
68955
68999
  const _afterResponse = afterResponse || this.afterResponse;
68956
- const _timeout = timeout || this.timeout;
69000
+ const _timeout = timeout2 || this.timeout;
68957
69001
  const req = {
68958
69002
  url: url4,
68959
69003
  headers: _headers,
68960
69004
  body,
68961
69005
  timeout: _timeout,
68962
- ...rest
69006
+ ...rest2
68963
69007
  };
68964
69008
  try {
68965
69009
  if (_beforeRequest) {
@@ -69275,7 +69319,7 @@ app.route({
69275
69319
  }
69276
69320
  }
69277
69321
  }).define(async (ctx) => {
69278
- let { add, remove, set: set3, list, clear } = ctx.args;
69322
+ let { add, remove: remove2, set: set3, list, clear } = ctx.args;
69279
69323
  let config4 = getConfig2();
69280
69324
  let baseList = config4.baseURLList || [];
69281
69325
  if (!config4.baseURL) {
@@ -69307,8 +69351,8 @@ app.route({
69307
69351
  showList(baseList);
69308
69352
  }
69309
69353
  }
69310
- if (remove !== undefined) {
69311
- const index = remove - 1;
69354
+ if (remove2 !== undefined) {
69355
+ const index = remove2 - 1;
69312
69356
  if (index < 0 || index >= baseList.length) {
69313
69357
  console.log("index out of range");
69314
69358
  return;
@@ -69321,8 +69365,8 @@ app.route({
69321
69365
  return;
69322
69366
  }
69323
69367
  if (set3 !== undefined) {
69324
- const isNumber = isNumeric(String(set3));
69325
- if (isNumber) {
69368
+ const isNumber2 = isNumeric(String(set3));
69369
+ if (isNumber2) {
69326
69370
  const index = Number(set3) - 1;
69327
69371
  if (index < 0 || index >= baseList.length) {
69328
69372
  console.log("index out of range");
@@ -69387,8 +69431,8 @@ app.route({
69387
69431
  return;
69388
69432
  }
69389
69433
  if (set3) {
69390
- const isNumber = isNumeric(set3);
69391
- if (isNumber) {
69434
+ const isNumber2 = isNumeric(set3);
69435
+ if (isNumber2) {
69392
69436
  const index = Number(set3) - 1;
69393
69437
  if (index < 0 || index >= defaultRegistry.length) {
69394
69438
  console.log("index out of range");
@@ -69586,7 +69630,7 @@ function fillPool2(bytes) {
69586
69630
  }
69587
69631
  poolOffset2 += bytes;
69588
69632
  }
69589
- function random(bytes) {
69633
+ function random3(bytes) {
69590
69634
  fillPool2(bytes |= 0);
69591
69635
  return pool2.subarray(poolOffset2 - bytes, poolOffset2);
69592
69636
  }
@@ -69609,10 +69653,11 @@ function customRandom2(alphabet, defaultSize, getRandom) {
69609
69653
  };
69610
69654
  }
69611
69655
  function customAlphabet2(alphabet, size = 21) {
69612
- return customRandom2(alphabet, size, random);
69656
+ return customRandom2(alphabet, size, random3);
69613
69657
  }
69614
69658
 
69615
69659
  // src/routes/id.ts
69660
+ var import_dayjs = __toESM(require_dayjs_min(), 1);
69616
69661
  var letters = "0123456789abcdefghijklmnopqrstuvwxyz";
69617
69662
  var nanoid128 = customAlphabet2(letters, 128);
69618
69663
  app.route({
@@ -69628,9 +69673,11 @@ app.route({
69628
69673
  const { size = 128 } = ctx.args;
69629
69674
  const id = nanoid128(size);
69630
69675
  console.log(chalk2.green("生成 ID"), id);
69676
+ const time4 = import_dayjs.default().format("YYYYMMDDHHmm");
69631
69677
  ctx.body = {
69632
69678
  id,
69633
- id8: nanoid128(8)
69679
+ id8: nanoid128(8),
69680
+ time: time4
69634
69681
  };
69635
69682
  }).addTo(app);
69636
69683
 
@@ -69648,6 +69695,9 @@ var gitBlobHashContent = (content) => {
69648
69695
  class KevisualPod {
69649
69696
  constructor(opts) {
69650
69697
  this.setRoot(opts?.root);
69698
+ if (opts?.kevisualName) {
69699
+ this.kevisualName = opts.kevisualName;
69700
+ }
69651
69701
  }
69652
69702
  setRoot(root) {
69653
69703
  if (root) {
@@ -69663,7 +69713,8 @@ class KevisualPod {
69663
69713
  async getConfig() {
69664
69714
  return {
69665
69715
  root: this.root,
69666
- kevisual: path12.join(this.root, "kevisual.json")
69716
+ kevisual: path12.join(this.root, `${this.kevisualName || "kevisual"}.json`),
69717
+ kevisualFilename: `${this.kevisualName || "kevisual"}.json`
69667
69718
  };
69668
69719
  }
69669
69720
  async readFileSync(filePath) {
@@ -69674,6 +69725,14 @@ class KevisualPod {
69674
69725
  return {};
69675
69726
  }
69676
69727
  }
69728
+ async getPodData() {
69729
+ const config4 = await this.getConfig();
69730
+ const data = await this.readFileSync(config4.kevisual);
69731
+ return {
69732
+ isNew: !data.root,
69733
+ data
69734
+ };
69735
+ }
69677
69736
  async writeFileSync(filePath, data) {
69678
69737
  try {
69679
69738
  fs14.writeFileSync(filePath, JSON.stringify(data, null, 2), "utf-8");
@@ -69683,21 +69742,50 @@ class KevisualPod {
69683
69742
  }
69684
69743
  async sync(options2 = {}) {
69685
69744
  const config4 = await this.getConfig();
69686
- const manifest = await this.readFileSync(config4.kevisual);
69745
+ const { isNew, data: manifest } = await this.getPodData();
69687
69746
  const oldManifest = cloneDeep(manifest);
69688
- const isNew = !manifest.root;
69747
+ const ignoreConfig = await getRootIgnore(config4.root);
69748
+ const commonIgnore = [
69749
+ "**/node_modules/**",
69750
+ "**/dist/**",
69751
+ "**/build/**",
69752
+ "**/.astro/**",
69753
+ "**/pack-dist/**",
69754
+ "**/.next/**",
69755
+ "**/.nuxt/**",
69756
+ "**/.output/**",
69757
+ "**/.vite/**",
69758
+ "**/.turbo/**",
69759
+ "**/.cache/**",
69760
+ "**/.parcel-cache/**",
69761
+ "**/coverage/**",
69762
+ "**/.nyc_output/**",
69763
+ "**/.git/**",
69764
+ "**/.svn/**",
69765
+ "**/.hg/**",
69766
+ "**/*.log",
69767
+ "**/npm-debug.log*",
69768
+ "**/yarn-debug.log*",
69769
+ "**/yarn-error.log*",
69770
+ "**/*.tmp",
69771
+ "**/*.temp",
69772
+ "**/.idea/**",
69773
+ "**/.vscode/**",
69774
+ "**/*.swp",
69775
+ "**/*~",
69776
+ "**/.vim/",
69777
+ "**/.DS_Store",
69778
+ "**/Thumbs.db",
69779
+ "**/desktop.ini",
69780
+ "**/.AppleDouble",
69781
+ "**/._*"
69782
+ ];
69783
+ const ignore = [...commonIgnore, ...ignoreConfig.ignoreFG];
69784
+ const ignoreSet = new Set(ignore);
69689
69785
  const files = await import_fast_glob2.default(["**/*"], {
69690
69786
  cwd: config4.root,
69691
69787
  dot: true,
69692
- ignore: [
69693
- "**/node_modules/**",
69694
- "**/dist/**",
69695
- "**/pack-dist/**",
69696
- "**/.git/**",
69697
- "**/build/**",
69698
- "**/.DS_Store",
69699
- "**/Thumbs.db"
69700
- ],
69788
+ ignore: Array.from(ignoreSet),
69701
69789
  onlyFiles: true
69702
69790
  });
69703
69791
  manifest.root = config4.root;
@@ -69712,11 +69800,11 @@ class KevisualPod {
69712
69800
  if (item.exist) {
69713
69801
  try {
69714
69802
  const stat = fs14.statSync(filePath);
69715
- const newUpdatedAt = stat.mtimeMs;
69803
+ const newUpdatedAt = Math.floor(stat.mtimeMs);
69716
69804
  if (item.updatedAt === newUpdatedAt && item.hash) {
69717
69805
  return item;
69718
69806
  }
69719
- if (item.name === "kevisual.json") {
69807
+ if (item.name === config4.kevisualFilename) {
69720
69808
  return item;
69721
69809
  }
69722
69810
  const content = fs14.readFileSync(filePath);
@@ -69743,12 +69831,12 @@ class KevisualPod {
69743
69831
  exist: true
69744
69832
  };
69745
69833
  const filePath = path12.join(config4.root, file3);
69746
- if (file3 !== "kevisual.json") {
69834
+ if (file3 !== config4.kevisualFilename) {
69747
69835
  try {
69748
69836
  const content = fs14.readFileSync(filePath);
69749
69837
  newItem.hash = gitBlobHashContent(content);
69750
69838
  const stat = fs14.statSync(filePath);
69751
- newItem.updatedAt = stat.mtimeMs;
69839
+ newItem.updatedAt = Math.floor(stat.mtimeMs);
69752
69840
  } catch (err) {
69753
69841
  console.error(`Error reading file ${filePath}:`, err);
69754
69842
  }
@@ -69761,7 +69849,6 @@ class KevisualPod {
69761
69849
  if (!isNew || oldResources.length > 0) {
69762
69850
  const changed = JSON.stringify(oldManifest) !== JSON.stringify(manifest);
69763
69851
  if (!changed) {
69764
- console.log("No changes detected, skipping write to kevisual.json");
69765
69852
  return manifest;
69766
69853
  }
69767
69854
  await this.writeFileSync(config4.kevisual, manifest);
@@ -69788,50 +69875,170 @@ class KevisualPod {
69788
69875
  return null;
69789
69876
  }
69790
69877
  }
69791
- const config4 = await this.sync();
69878
+ const kevisualJsonPath = path12.join(process.cwd(), `${this.kevisualName || "kevisual"}.json`);
69879
+ if (fileIsExist2(kevisualJsonPath)) {
69880
+ return await this.readFileSync(kevisualJsonPath);
69881
+ }
69882
+ const config4 = await this.sync({ lock: true });
69792
69883
  if (!config4.root)
69793
69884
  return null;
69794
69885
  return config4;
69795
69886
  }
69887
+ async parseHeader(hearder) {
69888
+ const parsed = {};
69889
+ for (const key in hearder) {
69890
+ const value = hearder[key];
69891
+ const envMatch = value.match(/^\$\{env:([^}]+)\}$/);
69892
+ if (envMatch) {
69893
+ const envKey = envMatch[1];
69894
+ parsed[key] = useKey(envKey) || "";
69895
+ continue;
69896
+ }
69897
+ const directMatch = value.match(/^\$\{([^}]+)\}$/);
69898
+ if (directMatch) {
69899
+ const envKey = directMatch[1];
69900
+ parsed[key] = useKey(envKey) || "";
69901
+ continue;
69902
+ }
69903
+ if (value.startsWith("env:")) {
69904
+ const envKey = value.slice(4);
69905
+ parsed[key] = useKey(envKey) || "";
69906
+ } else {
69907
+ parsed[key] = value;
69908
+ }
69909
+ }
69910
+ return parsed;
69911
+ }
69796
69912
  async download(data, opts) {
69797
69913
  const config4 = await this.getConfig();
69798
69914
  let resources = data.resources || [];
69799
- const baseURL2 = data.baseURL || "https://kevisual.cn";
69915
+ let _baseURL = data.baseURL;
69916
+ if (!_baseURL && data.repo) {
69917
+ const pv = data.private ?? false;
69918
+ let repo = data.repo;
69919
+ if (repo.startsWith("/")) {
69920
+ repo = repo.slice(1);
69921
+ }
69922
+ if (repo.endsWith("/")) {
69923
+ repo = repo.slice(0, -1);
69924
+ }
69925
+ if (pv) {
69926
+ _baseURL = `https://api.cnb.cool/${repo}/-/git/contents`;
69927
+ } else {
69928
+ _baseURL = `https://cnb.cool/${repo}/-/git/raw/main`;
69929
+ }
69930
+ }
69800
69931
  const project = opts?.project;
69801
69932
  if (project) {
69802
69933
  resources = resources.filter((item) => item.tags.includes(project));
69803
69934
  console.log(`Filtering resources by project "${project}", ${resources.length} resources to download.`);
69804
69935
  }
69805
69936
  const done = [];
69937
+ const headers = await this.parseHeader(data.headers || {});
69806
69938
  for (const resource of resources) {
69807
- let _url3 = resource.url || `${baseURL2}/${resource.name}`;
69939
+ let _url3 = resource.url || `${_baseURL}/${resource.name}`;
69940
+ const filePath = path12.join(config4.root, resource.name);
69941
+ const isExist = fileIsExist2(filePath);
69942
+ const dir = path12.dirname(filePath);
69808
69943
  try {
69809
- const res = await fetch(_url3);
69810
- let etag = res.headers.get("ETag");
69811
- if (etag === resource.hash) {
69812
- continue;
69813
- }
69814
- if (res.ok) {
69815
- const arrayBuffer = await res.arrayBuffer();
69816
- const buffer = Buffer.from(arrayBuffer);
69817
- const filePath = path12.join(config4.root, resource.name);
69818
- const dir = path12.dirname(filePath);
69944
+ const buffer = await download(_url3, { headers, hash: isExist ? resource.hash : undefined });
69945
+ if (buffer && buffer.buffer) {
69819
69946
  fs14.mkdirSync(dir, { recursive: true });
69820
- fs14.writeFileSync(filePath, buffer);
69821
- console.log(`Downloaded ${resource.name} from ${_url3}`);
69947
+ fs14.writeFileSync(filePath, buffer.buffer);
69948
+ console.log(`下载 ${resource.name}
69949
+ 下载地址为 ${_url3}`);
69822
69950
  done.push(resource);
69823
69951
  } else {
69824
- console.error(`Failed to download ${_url3}: ${res.statusText}`);
69952
+ if (buffer?.code === 304) {
69953
+ console.warn(`资源 ${resource.name} 未修改,跳过下载。`);
69954
+ } else {
69955
+ console.warn(`资源 ${resource.name} 下载失败,状态码 ${buffer?.code}。`);
69956
+ }
69825
69957
  }
69826
69958
  } catch (err) {
69827
- console.error(`Error downloading ${_url3}:`, err);
69959
+ console.error(`下载错误 ${_url3}:`, err);
69828
69960
  }
69829
69961
  }
69830
69962
  return done;
69831
69963
  }
69832
69964
  }
69965
+ var isCNBOpenApi = (url4) => {
69966
+ return url4.startsWith("https://api.cnb.cool");
69967
+ };
69968
+ var download = async (url4, opts) => {
69969
+ const isCNB = isCNBOpenApi(url4);
69970
+ if (isCNB) {
69971
+ return await downloadByCNBApi(url4, opts);
69972
+ } else {
69973
+ return await downloadResource(url4, opts);
69974
+ }
69975
+ };
69976
+ var downloadResource = async (url4, opts) => {
69977
+ const headers = opts?.headers || {};
69978
+ const res = await fetch(url4, { headers });
69979
+ let etag = res.headers.get("ETag");
69980
+ if (opts?.hash && etag === opts.hash) {
69981
+ return { code: 304, buffer: null };
69982
+ }
69983
+ if (res.ok) {
69984
+ const arrayBuffer = await res.arrayBuffer();
69985
+ return { code: 200, buffer: Buffer.from(arrayBuffer) };
69986
+ } else {
69987
+ console.error(`下载失败 ${url4}: ${res.statusText}`);
69988
+ return { code: res.status, buffer: null };
69989
+ }
69990
+ };
69991
+ var downloadByCNBApi = async (url4, opts) => {
69992
+ const hash3 = opts?.hash;
69993
+ const res = await fetch(url4, {
69994
+ headers: {
69995
+ Accept: "application/vnd.cnb.api+json",
69996
+ ...opts?.headers
69997
+ }
69998
+ });
69999
+ let resJson;
70000
+ try {
70001
+ resJson = await res.json();
70002
+ } catch (e) {
70003
+ console.error(`下载失败 ${url4}: ${res.statusText}`, e);
70004
+ return { code: res.status, buffer: null };
70005
+ }
70006
+ if (res.ok && resJson.type === "blob" && resJson.encoding === "base64" && resJson.content) {
70007
+ if (hash3 && resJson.sha === hash3) {
70008
+ return { code: 304, buffer: null };
70009
+ }
70010
+ const buffer = Buffer.from(resJson.content, "base64");
70011
+ return { code: 200, buffer };
70012
+ } else {
70013
+ console.error(`下载失败 ${url4}: ${res.statusText}`, resJson);
70014
+ return { code: res.status, buffer: null };
70015
+ }
70016
+ };
70017
+ var getRootIgnore = async (dir) => {
70018
+ const cnbIgnorePath = path12.join(dir, ".cnbignore");
70019
+ const gitIgnorePath = path12.join(dir, ".gitignore");
70020
+ let ignoreContent = "";
70021
+ if (fs14.existsSync(cnbIgnorePath)) {
70022
+ ignoreContent = fs14.readFileSync(cnbIgnorePath, "utf-8");
70023
+ } else if (fs14.existsSync(gitIgnorePath)) {
70024
+ ignoreContent = fs14.readFileSync(gitIgnorePath, "utf-8");
70025
+ }
70026
+ const ignore = ignoreContent.split(`
70027
+ `).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
70028
+ const ignoreFG = ignore.map((line) => {
70029
+ if (line.startsWith("!")) {
70030
+ return "";
70031
+ }
70032
+ if (line.endsWith("/")) {
70033
+ return line + "**";
70034
+ }
70035
+ return line;
70036
+ }).filter(Boolean);
70037
+ return { ignore, ignoreFG };
70038
+ };
69833
70039
 
69834
70040
  // src/routes/pod/sync.ts
70041
+ import fs15 from "node:fs";
69835
70042
  app.route({
69836
70043
  path: "pod",
69837
70044
  key: "sync",
@@ -69880,16 +70087,18 @@ app.route({
69880
70087
  args: {
69881
70088
  project: exports_external2.string().describe("项目名称"),
69882
70089
  url: exports_external2.string().optional().describe("下载链接,如果不存在, 用当前文件夹下的kevisual.json"),
69883
- repo: exports_external2.string().optional().describe("获取cnb仓库对应的kevisual.json,地址,构建一个url。")
70090
+ repo: exports_external2.string().optional().describe("获取cnb仓库对应的kevisual.json,地址,构建一个url。"),
70091
+ kevisualName: exports_external2.string().optional().describe("自定义kevisual文件名, 默认为kevisual, 会检测kevisual.json")
69884
70092
  }
69885
70093
  }
69886
70094
  }).define(async (ctx) => {
69887
70095
  let url4 = ctx.args.url;
69888
70096
  const project = ctx.args.project || "";
69889
- const pod = new KevisualPod;
70097
+ const kevisualName = ctx.args.kevisualName;
70098
+ const pod = new KevisualPod({ kevisualName });
69890
70099
  const repo = ctx.args.repo;
69891
70100
  if (repo) {
69892
- url4 = `https://cnb.cool/${repo}/-/git/raw/main/kevisual.json`;
70101
+ url4 = `https://cnb.cool/${repo}/-/git/raw/main/${kevisualName || "kevisual"}.json`;
69893
70102
  }
69894
70103
  const data = await pod.getKevisualJSON({ url: url4 });
69895
70104
  if (data) {
@@ -69904,6 +70113,28 @@ app.route({
69904
70113
  content: "完成"
69905
70114
  };
69906
70115
  }).addTo(app);
70116
+ app.route({
70117
+ path: "pod",
70118
+ key: "fetch",
70119
+ middleware: ["auth-admin"]
70120
+ }).define(async (ctx) => {
70121
+ const url4 = "https://api.cnb.cool/xzzlwl/httpecho/-/git/contents/package.json";
70122
+ const CNB_API_KEY = useKey("CNB_API_KEY");
70123
+ console.log("CNB_API_KEY", CNB_API_KEY);
70124
+ const res = await downloadByCNBApi(url4, {
70125
+ headers: {
70126
+ Authorization: `${CNB_API_KEY}`
70127
+ }
70128
+ });
70129
+ if (res.code === 200 && res.buffer) {
70130
+ fs15.writeFileSync("./test.json", res.buffer);
70131
+ } else {
70132
+ console.error(`下载失败 ${url4}: ${res.code}`);
70133
+ }
70134
+ ctx.body = {
70135
+ content: "完成"
70136
+ };
70137
+ }).addTo(app);
69907
70138
 
69908
70139
  // src/index.ts
69909
70140
  app.createAuth(() => {});
@@ -69926,7 +70157,7 @@ var {
69926
70157
  } = import__3.default;
69927
70158
 
69928
70159
  // src/program.ts
69929
- import fs15 from "fs";
70160
+ import fs16 from "fs";
69930
70161
  var version3 = useContextKey("version", () => {
69931
70162
  let version4 = "0.1.33";
69932
70163
  try {
@@ -69938,7 +70169,7 @@ var version3 = useContextKey("version", () => {
69938
70169
  program.name("app").description("A CLI tool with envison").version(version3, "-V, --version");
69939
70170
  var ls = new Command("ls").description("List files in the current directory").action(() => {
69940
70171
  console.log("List files");
69941
- console.log(fs15.readdirSync(process.cwd()));
70172
+ console.log(fs16.readdirSync(process.cwd()));
69942
70173
  });
69943
70174
  program.addCommand(ls);
69944
70175
 
@@ -70094,7 +70325,7 @@ program.addCommand(logoutCommand);
70094
70325
  var import_fast_glob3 = __toESM(require_out4(), 1);
70095
70326
  var import_form_data2 = __toESM(require_form_data(), 1);
70096
70327
  import path13 from "path";
70097
- import fs16 from "fs";
70328
+ import fs17 from "fs";
70098
70329
 
70099
70330
  // src/module/download/upload.ts
70100
70331
  var import_form_data = __toESM(require_form_data(), 1);
@@ -70107,8 +70338,8 @@ var handleResponse = async (err, res, opts) => {
70107
70338
  return;
70108
70339
  }
70109
70340
  let body = "";
70110
- res.on("data", (chunk) => {
70111
- body += chunk;
70341
+ res.on("data", (chunk2) => {
70342
+ body += chunk2;
70112
70343
  });
70113
70344
  res.on("end", () => {
70114
70345
  if (noResponse) {
@@ -70178,11 +70409,11 @@ var upload = (opts) => {
70178
70409
  var nanoid7 = customAlphabet2("abcdefghijklmnopqrstuvwxyz", 8);
70179
70410
  var getPackageJson = (opts) => {
70180
70411
  const filePath = path13.join(process.cwd(), "package.json");
70181
- if (!fs16.existsSync(filePath)) {
70412
+ if (!fs17.existsSync(filePath)) {
70182
70413
  return null;
70183
70414
  }
70184
70415
  try {
70185
- const packageJson = JSON.parse(fs16.readFileSync(filePath, "utf-8"));
70416
+ const packageJson = JSON.parse(fs17.readFileSync(filePath, "utf-8"));
70186
70417
  const basename = packageJson.basename || "";
70187
70418
  const version4 = packageJson.version || "1.0.0";
70188
70419
  const app2 = packageJson.app;
@@ -70217,7 +70448,7 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
70217
70448
  }
70218
70449
  const pwd = process.cwd();
70219
70450
  const directory = path13.join(pwd, filePath);
70220
- const stat = fs16.statSync(directory);
70451
+ const stat = fs17.statSync(directory);
70221
70452
  let _relativeFiles = [];
70222
70453
  let isDirectory = false;
70223
70454
  if (stat.isDirectory()) {
@@ -70270,7 +70501,7 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
70270
70501
  console.error(source_default.red("查询应用版本失败"), res2.message, key);
70271
70502
  return;
70272
70503
  }
70273
- const { id, data, ...rest } = res2.data || {};
70504
+ const { id, data, ...rest2 } = res2.data || {};
70274
70505
  if (id && !update) {
70275
70506
  if (!org) {
70276
70507
  console.log(source_default.green(`更新为最新版本: envision deploy-load ${id}`));
@@ -70301,7 +70532,7 @@ var uploadFilesV2 = async (files, directory, opts) => {
70301
70532
  const form = new import_form_data2.default;
70302
70533
  const filename = path13.basename(filePath);
70303
70534
  const encodedFilename = Buffer.from(filename, "utf-8").toString("binary");
70304
- form.append("file", fs16.createReadStream(filePath), {
70535
+ form.append("file", fs17.createReadStream(filePath), {
70305
70536
  filename: encodedFilename,
70306
70537
  filepath: file3
70307
70538
  });
@@ -70369,7 +70600,8 @@ var deployLoadFn = async (id, org) => {
70369
70600
  logger.error("deploy-load failed", res.message);
70370
70601
  }
70371
70602
  };
70372
- var deployLoad = new Command("deploy-load").description("部署加载").argument("<id>", "id").option("-o, --org <org>", "org").action(async (id, opts) => {
70603
+ var deployLoad = new Command("deploy-load").description("部署加载").argument("<id>", "id").option("-o, --org <org>", "org").option("-p, --publish ", "是否公开").action(async (id, opts) => {
70604
+ const publish = !!opts.publish;
70373
70605
  deployLoadFn(id, opts?.org);
70374
70606
  });
70375
70607
  program.addCommand(deployLoad);
@@ -70377,7 +70609,7 @@ program.addCommand(deployLoad);
70377
70609
  // src/command/npm.ts
70378
70610
  import path14 from "path";
70379
70611
  import { spawn as spawn4 } from "child_process";
70380
- import fs17 from "fs";
70612
+ import fs18 from "fs";
70381
70613
 
70382
70614
  // src/uitls/npm.ts
70383
70615
  import { spawn as spawn3, spawnSync } from "child_process";
@@ -70428,7 +70660,7 @@ var publishRegistry = (options2) => {
70428
70660
  [key]: config4[key]
70429
70661
  };
70430
70662
  }, {});
70431
- const pkg = fs17.readFileSync(packageJson, "utf-8");
70663
+ const pkg = fs18.readFileSync(packageJson, "utf-8");
70432
70664
  const pkgJson = parseIfJson2(pkg);
70433
70665
  const version4 = pkgJson?.version;
70434
70666
  if (version4 && options2?.tag) {
@@ -70516,7 +70748,7 @@ var getnpmrc = new Command("get").action(async () => {
70516
70748
  const execPath = process.cwd();
70517
70749
  const npmrcPath = path14.resolve(execPath, ".npmrc");
70518
70750
  if (fileIsExist2(npmrcPath)) {
70519
- const npmrcContent = fs17.readFileSync(npmrcPath, "utf-8");
70751
+ const npmrcContent = fs18.readFileSync(npmrcPath, "utf-8");
70520
70752
  console.log(npmrcContent);
70521
70753
  }
70522
70754
  });
@@ -70545,22 +70777,22 @@ var npmrc = new Command("set").description("set .npmrc").option("-f <force>").ac
70545
70777
  writeFlag = true;
70546
70778
  }
70547
70779
  if (writeFlag) {
70548
- fs17.writeFileSync(npmrcPath, npmrcContent);
70780
+ fs18.writeFileSync(npmrcPath, npmrcContent);
70549
70781
  console.log(chalk2.green("write .npmrc success"));
70550
70782
  }
70551
70783
  });
70552
70784
  command3.addCommand(npmrc);
70553
- var remove = new Command("remove").description("remove .npmrc").action(async () => {
70785
+ var remove2 = new Command("remove").description("remove .npmrc").action(async () => {
70554
70786
  const execPath = process.cwd();
70555
70787
  const npmrcPath = path14.resolve(execPath, ".npmrc");
70556
70788
  if (fileIsExist2(npmrcPath)) {
70557
- fs17.unlinkSync(npmrcPath);
70789
+ fs18.unlinkSync(npmrcPath);
70558
70790
  console.log(chalk2.green("remove .npmrc success"));
70559
70791
  } else {
70560
70792
  console.log(chalk2.green(".npmrc success"));
70561
70793
  }
70562
70794
  });
70563
- command3.addCommand(remove);
70795
+ command3.addCommand(remove2);
70564
70796
  var install = new Command("install").option("-n, --noproxy", "no proxy").description("npm install 使用 proxy代理去下载").action(async (options2) => {
70565
70797
  const cwd = process.cwd();
70566
70798
  const config4 = getConfig2();
@@ -70588,7 +70820,7 @@ var patchFunc = (opts) => {
70588
70820
  const cwd = opts?.directory || process.cwd();
70589
70821
  const packageJson = path14.resolve(cwd, "package.json");
70590
70822
  if (fileIsExist2(packageJson)) {
70591
- const pkg = fs17.readFileSync(packageJson, "utf-8");
70823
+ const pkg = fs18.readFileSync(packageJson, "utf-8");
70592
70824
  const pkgJson = parseIfJson2(pkg);
70593
70825
  const version4 = pkgJson?.version;
70594
70826
  if (version4) {
@@ -70597,7 +70829,7 @@ var patchFunc = (opts) => {
70597
70829
  const patchVersion = Number(versionArr[2]) + 1;
70598
70830
  const newVersion = `${versionArr[0]}.${versionArr[1]}.${patchVersion}`;
70599
70831
  pkgJson.version = newVersion;
70600
- fs17.writeFileSync(packageJson, JSON.stringify(pkgJson, null, 2));
70832
+ fs18.writeFileSync(packageJson, JSON.stringify(pkgJson, null, 2));
70601
70833
  console.log(chalk2.green(`${pkgJson?.name} 更新到版本: ${newVersion}`));
70602
70834
  }
70603
70835
  }
@@ -70611,7 +70843,7 @@ program.addCommand(command3);
70611
70843
 
70612
70844
  // src/command/publish.ts
70613
70845
  var import_fast_glob4 = __toESM(require_out4(), 1);
70614
- import fs18 from "fs";
70846
+ import fs19 from "fs";
70615
70847
  import path15 from "path";
70616
70848
  // src/query/services/index.ts
70617
70849
  var queryServiceOperate = async (appKey, action) => {
@@ -70647,18 +70879,18 @@ var queryServiceDelect = async (appKey) => {
70647
70879
 
70648
70880
  // src/command/publish.ts
70649
70881
  async function findFileInsensitive(targetFile) {
70650
- const files = fs18.readdirSync(".");
70882
+ const files = fs19.readdirSync(".");
70651
70883
  const matchedFile = files.find((file3) => file3.toLowerCase() === targetFile.toLowerCase());
70652
70884
  return matchedFile || null;
70653
70885
  }
70654
70886
  async function collectFileInfo(filePath, baseDir = ".") {
70655
- const stats = fs18.statSync(filePath);
70887
+ const stats = fs19.statSync(filePath);
70656
70888
  const relativePath = path15.relative(baseDir, filePath);
70657
70889
  if (stats.isFile()) {
70658
70890
  return [{ path: relativePath, size: stats.size }];
70659
70891
  }
70660
70892
  if (stats.isDirectory()) {
70661
- const files = fs18.readdirSync(filePath);
70893
+ const files = fs19.readdirSync(filePath);
70662
70894
  const results = await Promise.all(files.map((file3) => collectFileInfo(path15.join(filePath, file3), baseDir)));
70663
70895
  return results.flat();
70664
70896
  }
@@ -70667,12 +70899,12 @@ async function collectFileInfo(filePath, baseDir = ".") {
70667
70899
  var copyFilesToPackDist = async (files, cwd, packDist = "pack-dist", mergeDist = true) => {
70668
70900
  const packDistPath = path15.join(cwd, packDist);
70669
70901
  if (!fileIsExist2(packDistPath)) {
70670
- fs18.mkdirSync(packDistPath, { recursive: true });
70902
+ fs19.mkdirSync(packDistPath, { recursive: true });
70671
70903
  } else {
70672
- fs18.rmSync(packDistPath, { recursive: true, force: true });
70904
+ fs19.rmSync(packDistPath, { recursive: true, force: true });
70673
70905
  }
70674
70906
  files.forEach((file3) => {
70675
- const stat = fs18.statSync(path15.join(cwd, file3));
70907
+ const stat = fs19.statSync(path15.join(cwd, file3));
70676
70908
  let outputFile = file3;
70677
70909
  if (mergeDist) {
70678
70910
  if (file3.startsWith("dist/")) {
@@ -70682,9 +70914,9 @@ var copyFilesToPackDist = async (files, cwd, packDist = "pack-dist", mergeDist =
70682
70914
  }
70683
70915
  }
70684
70916
  if (stat.isDirectory()) {
70685
- fs18.cpSync(path15.join(cwd, file3), path15.join(packDistPath, outputFile), { recursive: true });
70917
+ fs19.cpSync(path15.join(cwd, file3), path15.join(packDistPath, outputFile), { recursive: true });
70686
70918
  } else {
70687
- fs18.copyFileSync(path15.join(cwd, file3), path15.join(packDistPath, outputFile));
70919
+ fs19.copyFileSync(path15.join(cwd, file3), path15.join(packDistPath, outputFile));
70688
70920
  }
70689
70921
  });
70690
70922
  const packageInfo = await getPackageInfo();
@@ -70719,7 +70951,7 @@ ${filesString}
70719
70951
 
70720
70952
  </html>`;
70721
70953
  if (!fileIsExist2(indexHtmlPath)) {
70722
- fs18.writeFileSync(indexHtmlPath, indexHtmlContent);
70954
+ fs19.writeFileSync(indexHtmlPath, indexHtmlContent);
70723
70955
  }
70724
70956
  };
70725
70957
  var pack = async (opts) => {
@@ -70733,7 +70965,7 @@ var pack = async (opts) => {
70733
70965
  }
70734
70966
  let packageJson;
70735
70967
  try {
70736
- const packageContent = fs18.readFileSync(packageJsonPath, "utf-8");
70968
+ const packageContent = fs19.readFileSync(packageJsonPath, "utf-8");
70737
70969
  packageJson = JSON.parse(packageContent);
70738
70970
  } catch (error49) {
70739
70971
  console.error("Invalid package.json:", error49);
@@ -70760,7 +70992,7 @@ var pack = async (opts) => {
70760
70992
  allFiles.forEach((file3) => {
70761
70993
  logger.debug(`${file3.size}B ${file3.path}`);
70762
70994
  });
70763
- const totalSize = allFiles.reduce((sum, file3) => sum + file3.size, 0);
70995
+ const totalSize = allFiles.reduce((sum2, file3) => sum2 + file3.size, 0);
70764
70996
  collection.files = allFiles;
70765
70997
  collection.packageJson = packageJson;
70766
70998
  collection.totalSize = totalSize;
@@ -70777,7 +71009,7 @@ var pack = async (opts) => {
70777
71009
  }
70778
71010
  const readme = await findFileInsensitive("README.md");
70779
71011
  if (readme) {
70780
- const readmeContent = fs18.readFileSync(readme, "utf-8");
71012
+ const readmeContent = fs19.readFileSync(readme, "utf-8");
70781
71013
  collection.readme = readmeContent;
70782
71014
  }
70783
71015
  return { collection, dir: cwd };
@@ -70786,7 +71018,7 @@ var getPackageInfo = async () => {
70786
71018
  const cwd = process.cwd();
70787
71019
  const packageJsonPath = path15.join(cwd, "package.json");
70788
71020
  try {
70789
- const packageJson = JSON.parse(fs18.readFileSync(packageJsonPath, "utf-8"));
71021
+ const packageJson = JSON.parse(fs19.readFileSync(packageJsonPath, "utf-8"));
70790
71022
  return packageJson;
70791
71023
  } catch (error49) {
70792
71024
  console.error("Invalid package.json:", error49);
@@ -70876,7 +71108,7 @@ var packCommand = new Command("pack").description("打包应用, 使用 package.
70876
71108
  if (opts?.clean) {
70877
71109
  const newPackageJson = { ...packageInfo };
70878
71110
  delete newPackageJson.devDependencies;
70879
- fs18.writeFileSync(path15.join(process.cwd(), "pack-dist", "package.json"), JSON.stringify(newPackageJson, null, 2));
71111
+ fs19.writeFileSync(path15.join(process.cwd(), "pack-dist", "package.json"), JSON.stringify(newPackageJson, null, 2));
70880
71112
  }
70881
71113
  if (opts.publish) {
70882
71114
  const [_app, _command] = process.argv;
@@ -70994,7 +71226,7 @@ servicesCommand.addCommand(detectCommand);
70994
71226
 
70995
71227
  // src/command/sync/modules/base.ts
70996
71228
  import path16 from "node:path";
70997
- import fs19 from "node:fs";
71229
+ import fs20 from "node:fs";
70998
71230
  var import_fast_glob5 = __toESM(require_out4(), 1);
70999
71231
  var import_micromatch = __toESM(require_micromatch(), 1);
71000
71232
  var checkAuth = (value = "", baseURL2 = "") => {
@@ -71043,7 +71275,7 @@ class SyncBase {
71043
71275
  const filepath = path16.join(dir, filename);
71044
71276
  if (!fileIsExist2(filepath))
71045
71277
  throw new Error("config file not found");
71046
- const config4 = JSON.parse(fs19.readFileSync(filepath, "utf-8"));
71278
+ const config4 = JSON.parse(fs20.readFileSync(filepath, "utf-8"));
71047
71279
  const sync = config4.sync || {};
71048
71280
  const keys = Object.keys(sync);
71049
71281
  const newConfigSync = {};
@@ -71247,7 +71479,7 @@ class SyncBase {
71247
71479
  const dir = path16.dirname(filepath);
71248
71480
  if (check3) {
71249
71481
  if (!fileIsExist2(dir)) {
71250
- fs19.mkdirSync(dir, { recursive: true });
71482
+ fs20.mkdirSync(dir, { recursive: true });
71251
71483
  }
71252
71484
  }
71253
71485
  return dir;
@@ -71257,7 +71489,7 @@ class SyncBase {
71257
71489
  }
71258
71490
 
71259
71491
  // src/command/sync/sync.ts
71260
- import fs20 from "node:fs";
71492
+ import fs21 from "node:fs";
71261
71493
  import path17 from "node:path";
71262
71494
  var command4 = new Command("sync").option("-d --dir <dir>").description("同步项目").action(() => {
71263
71495
  console.log("同步项目");
@@ -71305,7 +71537,7 @@ var syncUpload = new Command("upload").option("-d --dir <dir>", "配置目录").
71305
71537
  }
71306
71538
  const res = await upload({
71307
71539
  token,
71308
- file: fs20.readFileSync(item.filepath),
71540
+ file: fs21.readFileSync(item.filepath),
71309
71541
  url: item.url,
71310
71542
  needHash: true,
71311
71543
  hash: item.hash,
@@ -71352,7 +71584,7 @@ var syncDownload = new Command("download").option("-d --dir <dir>", "配置目
71352
71584
  const { content, status } = await fetchLink(item.url, { setToken: item.auth, returnContent: true, hash: hash3 });
71353
71585
  if (status === 200) {
71354
71586
  await sync.getDir(item.filepath, true);
71355
- fs20.writeFileSync(item.filepath, content);
71587
+ fs21.writeFileSync(item.filepath, content);
71356
71588
  logger.info("下载成功", item.key, chalk2.green(item.url));
71357
71589
  } else if (status === 304) {
71358
71590
  logger.info("文件未修改", item.key, chalk2.green(item.url));
@@ -71395,14 +71627,14 @@ var syncCreateList = new Command("create").option("-d --dir <dir>", "配置目
71395
71627
  const filepath = sync.getRelativePath(opts.output);
71396
71628
  if (filepath) {
71397
71629
  logger.debug("输出文件", filepath);
71398
- fs20.writeFileSync(filepath.absolute, JSON.stringify(newJson, null, 2));
71630
+ fs21.writeFileSync(filepath.absolute, JSON.stringify(newJson, null, 2));
71399
71631
  } else {
71400
71632
  logger.info(`输出内容
71401
71633
  `);
71402
71634
  logger.info(newJson);
71403
71635
  }
71404
71636
  });
71405
- var clone3 = new Command("clone").option("-d --dir <dir>", "配置目录").option("-c --config <config>", "配置文件的名字", "kevisual.json").option("-i --link <link>", "克隆链接, 比 kevisual.json 优先级更高").option("-l --local", "值对sync的列表进行clone处理,只对sync列表处理").description("检查目录").action(async (opts) => {
71637
+ var clone5 = new Command("clone").option("-d --dir <dir>", "配置目录").option("-c --config <config>", "配置文件的名字", "kevisual.json").option("-i --link <link>", "克隆链接, 比 kevisual.json 优先级更高").option("-l --local", "值对sync的列表进行clone处理,只对sync列表处理").description("检查目录").action(async (opts) => {
71406
71638
  let link = opts.link || "";
71407
71639
  const local = opts.local || false;
71408
71640
  const sync = new SyncBase({ dir: opts.dir, baseURL, configFilename: opts.config });
@@ -71412,7 +71644,7 @@ var clone3 = new Command("clone").option("-d --dir <dir>", "配置目录").optio
71412
71644
  }
71413
71645
  const res = await query.fetchText(link);
71414
71646
  if (res.code === 200) {
71415
- fs20.writeFileSync(sync.configPath, JSON.stringify(res.data, null, 2));
71647
+ fs21.writeFileSync(sync.configPath, JSON.stringify(res.data, null, 2));
71416
71648
  } else {
71417
71649
  logger.error("下载配置文件失败", link, res);
71418
71650
  return;
@@ -71477,7 +71709,7 @@ var clone3 = new Command("clone").option("-d --dir <dir>", "配置目录").optio
71477
71709
  if (needDownload) {
71478
71710
  const { content, status } = await fetchLink(matchItem.url, { setToken: item.auth, returnContent: true, hash: hash3 });
71479
71711
  if (status === 200) {
71480
- fs20.writeFileSync(matchItem.absolute, content);
71712
+ fs21.writeFileSync(matchItem.absolute, content);
71481
71713
  logger.info("下载成功", matchItem.pathname, chalk2.green(matchItem.url));
71482
71714
  } else if (status === 304) {
71483
71715
  logger.info("文件未修改", matchItem.pathname, chalk2.green(matchItem.url));
@@ -71496,17 +71728,17 @@ command4.addCommand(syncUpload);
71496
71728
  command4.addCommand(syncDownload);
71497
71729
  command4.addCommand(syncList);
71498
71730
  command4.addCommand(syncCreateList);
71499
- command4.addCommand(clone3);
71731
+ command4.addCommand(clone5);
71500
71732
  program.addCommand(command4);
71501
71733
 
71502
71734
  // src/command/coding-plan/cc.ts
71503
71735
  import path18 from "node:path";
71504
71736
  import os4 from "node:os";
71505
- import fs21 from "node:fs";
71737
+ import fs22 from "node:fs";
71506
71738
  var MODELS = ["minimax", "glm", "volcengine", "bailian"];
71507
71739
  var changeMinimax = (token) => {
71508
- const auth_token = token || useKey("MINIMAX_API_KEY");
71509
- const MINIMAX_MODEL = useKey("MINIMAX_MODEL") || "MiniMax-M2.5";
71740
+ const auth_token = token || useKey2("MINIMAX_API_KEY");
71741
+ const MINIMAX_MODEL = useKey2("MINIMAX_MODEL") || "MiniMax-M2.5";
71510
71742
  return {
71511
71743
  env: {
71512
71744
  ANTHROPIC_AUTH_TOKEN: auth_token,
@@ -71521,7 +71753,7 @@ var changeMinimax = (token) => {
71521
71753
  };
71522
71754
  };
71523
71755
  var changeGLM = (token) => {
71524
- const auth_token = token || useKey("ZHIPU_API_KEY");
71756
+ const auth_token = token || useKey2("ZHIPU_API_KEY");
71525
71757
  return {
71526
71758
  env: {
71527
71759
  ANTHROPIC_AUTH_TOKEN: auth_token,
@@ -71534,7 +71766,7 @@ var changeGLM = (token) => {
71534
71766
  };
71535
71767
  };
71536
71768
  var changeVolcengine = (token) => {
71537
- const auth_token = token || useKey("VOLCENGINE_API_KEY");
71769
+ const auth_token = token || useKey2("VOLCENGINE_API_KEY");
71538
71770
  return {
71539
71771
  env: {
71540
71772
  ANTHROPIC_AUTH_TOKEN: auth_token,
@@ -71548,7 +71780,7 @@ var changeVolcengine = (token) => {
71548
71780
  };
71549
71781
  };
71550
71782
  var changeBailian = (token) => {
71551
- const auth_token = token || useKey("BAILIAN_API_KEY");
71783
+ const auth_token = token || useKey2("BAILIAN_API_KEY");
71552
71784
  return {
71553
71785
  env: {
71554
71786
  ANTHROPIC_AUTH_TOKEN: auth_token,
@@ -71565,8 +71797,8 @@ var changeNoCheck = () => {
71565
71797
  const homeDir = os4.homedir();
71566
71798
  const claudeConfigPath = path18.join(homeDir, ".claude.json");
71567
71799
  let claudeConfig = {};
71568
- if (fs21.existsSync(claudeConfigPath)) {
71569
- const content = fs21.readFileSync(claudeConfigPath, "utf-8");
71800
+ if (fs22.existsSync(claudeConfigPath)) {
71801
+ const content = fs22.readFileSync(claudeConfigPath, "utf-8");
71570
71802
  try {
71571
71803
  claudeConfig = JSON.parse(content);
71572
71804
  } catch {
@@ -71577,7 +71809,7 @@ var changeNoCheck = () => {
71577
71809
  ...claudeConfig,
71578
71810
  hasCompletedOnboarding: true
71579
71811
  };
71580
- fs21.writeFileSync(claudeConfigPath, JSON.stringify(claudeConfig, null, 2));
71812
+ fs22.writeFileSync(claudeConfigPath, JSON.stringify(claudeConfig, null, 2));
71581
71813
  };
71582
71814
  var modelConfig = {
71583
71815
  minimax: changeMinimax,
@@ -71586,8 +71818,8 @@ var modelConfig = {
71586
71818
  bailian: changeBailian
71587
71819
  };
71588
71820
  var readOrCreateConfig = (configPath2) => {
71589
- if (fs21.existsSync(configPath2)) {
71590
- const content = fs21.readFileSync(configPath2, "utf-8");
71821
+ if (fs22.existsSync(configPath2)) {
71822
+ const content = fs22.readFileSync(configPath2, "utf-8");
71591
71823
  try {
71592
71824
  return JSON.parse(content);
71593
71825
  } catch {
@@ -71597,7 +71829,7 @@ var readOrCreateConfig = (configPath2) => {
71597
71829
  return {};
71598
71830
  };
71599
71831
  var saveConfig = (configPath2, config4) => {
71600
- fs21.writeFileSync(configPath2, JSON.stringify(config4, null, 2));
71832
+ fs22.writeFileSync(configPath2, JSON.stringify(config4, null, 2));
71601
71833
  };
71602
71834
  var command5 = new Command("cc").description("切换claude code模型,支持GLM4.7、Minimax和豆包").option("-m, --models <model:string>", `选择模型: ${MODELS.join(" | ")}`).action(async (options2) => {
71603
71835
  const configPath2 = path18.join(os4.homedir(), ".claude/settings.json");
@@ -71623,10 +71855,10 @@ program.addCommand(command5);
71623
71855
  // src/command/coding-plan/oc.ts
71624
71856
  import path19 from "node:path";
71625
71857
  import os5 from "node:os";
71626
- import fs22 from "node:fs";
71858
+ import fs23 from "node:fs";
71627
71859
  var readOpencodeConfig = (configPath2) => {
71628
- if (fs22.existsSync(configPath2)) {
71629
- const content = fs22.readFileSync(configPath2, "utf-8");
71860
+ if (fs23.existsSync(configPath2)) {
71861
+ const content = fs23.readFileSync(configPath2, "utf-8");
71630
71862
  try {
71631
71863
  return JSON.parse(content);
71632
71864
  } catch {
@@ -71636,7 +71868,7 @@ var readOpencodeConfig = (configPath2) => {
71636
71868
  return { provider: {} };
71637
71869
  };
71638
71870
  var saveOpencodeConfig = (configPath2, config4) => {
71639
- fs22.writeFileSync(configPath2, JSON.stringify(config4, null, 2));
71871
+ fs23.writeFileSync(configPath2, JSON.stringify(config4, null, 2));
71640
71872
  };
71641
71873
  var extractAvailableModels = (config4) => {
71642
71874
  const models = [];
@@ -71707,15 +71939,20 @@ program.addCommand(command6);
71707
71939
  // packages/common/mark-local/modules/manager.ts
71708
71940
  var import_fast_glob6 = __toESM(require_out4(), 1);
71709
71941
  var import_gray_matter = __toESM(require_gray_matter(), 1);
71710
- import fs23 from "node:fs";
71942
+ import fs24 from "node:fs";
71711
71943
  import path20 from "node:path";
71712
71944
  import crypto6 from "node:crypto";
71713
71945
  var hashFile = (content) => {
71714
71946
  return crypto6.createHash("sha1").update(content).digest("hex");
71715
71947
  };
71948
+ var statSync = (filepath) => {
71949
+ const stat = fs24.statSync(filepath);
71950
+ stat.mtimeMs = floorMs(stat.mtimeMs);
71951
+ return stat;
71952
+ };
71716
71953
 
71717
71954
  class MarkLocalManager {
71718
- filename = "readme.md";
71955
+ filename = "index";
71719
71956
  constructor(options2) {
71720
71957
  this.setRoot(options2?.root);
71721
71958
  }
@@ -71735,11 +71972,11 @@ class MarkLocalManager {
71735
71972
  if (!fileIsExist3(fullPath)) {
71736
71973
  return null;
71737
71974
  }
71738
- const stat = fs23.statSync(fullPath);
71975
+ const stat = statSync(fullPath);
71739
71976
  if (!stat.isDirectory()) {
71740
71977
  return null;
71741
71978
  }
71742
- const files = import_fast_glob6.default.sync(`*/${this.filename}`, {
71979
+ const files = import_fast_glob6.default.sync(`*/${this.filename}.{md,mdx}`, {
71743
71980
  cwd: fullPath,
71744
71981
  ignore: ["node_modules", "**/node_modules/**", ".git", "**/.git/**"],
71745
71982
  onlyFiles: true
@@ -71754,7 +71991,7 @@ class MarkLocalManager {
71754
71991
  }
71755
71992
  for (const file3 of files) {
71756
71993
  try {
71757
- const content = fs23.readFileSync(path20.resolve(dir, file3), "utf-8");
71994
+ const content = fs24.readFileSync(path20.resolve(dir, file3), "utf-8");
71758
71995
  const matterContent = import_gray_matter.default(content);
71759
71996
  const hash3 = hashFile(content);
71760
71997
  datas.push({
@@ -71784,7 +72021,7 @@ class MarkLocalManager {
71784
72021
  if (!fileIsExist3(filepath)) {
71785
72022
  return null;
71786
72023
  }
71787
- const content = fs23.readFileSync(filepath, "utf-8");
72024
+ const content = fs24.readFileSync(filepath, "utf-8");
71788
72025
  const matterContent = import_gray_matter.default(content);
71789
72026
  return matterContent;
71790
72027
  }
@@ -71799,7 +72036,7 @@ class MarkLocalManager {
71799
72036
  return false;
71800
72037
  }
71801
72038
  if (!hasRoot) {
71802
- fs23.mkdirSync(config4.root, { recursive: true });
72039
+ fs24.mkdirSync(config4.root, { recursive: true });
71803
72040
  isNew = true;
71804
72041
  }
71805
72042
  await this.syncLocal();
@@ -71818,19 +72055,19 @@ class MarkLocalManager {
71818
72055
  const newFiles = [];
71819
72056
  for (const file3 of fileList) {
71820
72057
  try {
71821
- const statSync = fs23.statSync(path20.resolve(config4.root, file3));
72058
+ const statInfo = statSync(path20.resolve(config4.root, file3));
71822
72059
  const existFile = hasFiles.find((f) => f.name === file3);
71823
72060
  if (!existFile) {
71824
72061
  newFiles.push({
71825
72062
  name: file3,
71826
- updatedAt: statSync.mtimeMs
72063
+ updatedAt: statInfo.mtimeMs
71827
72064
  });
71828
72065
  continue;
71829
72066
  }
71830
- let needUpdate = !existFile.updatedAt || statSync.mtimeMs > existFile.updatedAt;
72067
+ let needUpdate = !existFile.updatedAt || statInfo.mtimeMs > existFile.updatedAt;
71831
72068
  if (needUpdate) {
71832
- existFile.updatedAt = statSync.mtimeMs;
71833
- const content = fs23.readFileSync(path20.resolve(config4.root, file3), "utf-8");
72069
+ existFile.updatedAt = statInfo.mtimeMs;
72070
+ const content = fs24.readFileSync(path20.resolve(config4.root, file3), "utf-8");
71834
72071
  const matterContent = import_gray_matter.default(content);
71835
72072
  existFile.title = matterContent.data?.title || "";
71836
72073
  }
@@ -71854,17 +72091,17 @@ class MarkLocalManager {
71854
72091
  name: config4.folder,
71855
72092
  files: []
71856
72093
  };
71857
- fs23.writeFileSync(manifestPath, JSON.stringify(defaultConfig, null, 2), "utf-8");
72094
+ fs24.writeFileSync(manifestPath, JSON.stringify(defaultConfig, null, 2), "utf-8");
71858
72095
  return defaultConfig;
71859
72096
  }
71860
- const content = fs23.readFileSync(manifestPath, "utf-8");
72097
+ const content = fs24.readFileSync(manifestPath, "utf-8");
71861
72098
  const manifest = JSON.parse(content);
71862
72099
  return manifest;
71863
72100
  }
71864
72101
  saveManifest(manifest) {
71865
72102
  const config4 = this.getConfig();
71866
72103
  const manifestPath = config4.mainifest;
71867
- fs23.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
72104
+ fs24.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
71868
72105
  }
71869
72106
  async build(opts) {
71870
72107
  const config4 = this.getConfig();
@@ -71881,11 +72118,25 @@ class MarkLocalManager {
71881
72118
  const markPath = path20.resolve(config4.root, mark.name);
71882
72119
  const markDir = path20.dirname(markPath);
71883
72120
  if (!fileIsExist3(markDir)) {
71884
- fs23.mkdirSync(markDir, { recursive: true });
72121
+ fs24.mkdirSync(markDir, { recursive: true });
71885
72122
  }
71886
- fs23.writeFileSync(path20.join(markDir, "data.json"), JSON.stringify(mark, null, 2), "utf-8");
72123
+ fs24.writeFileSync(path20.join(markDir, "data.json"), JSON.stringify(mark, null, 2), "utf-8");
71887
72124
  if (opts?.stat) {
71888
- const statInfo = fs23.statSync(markPath);
72125
+ const statInfo = statSync(markPath);
72126
+ const resources = mark.data?.resources || [];
72127
+ let resourceSize = 0;
72128
+ for (let resource of resources) {
72129
+ if (resource?.name && resource?.type === "file") {
72130
+ const filePath = path20.resolve(markDir, resource.name);
72131
+ console.log(`Calculating size for resource: ${filePath}`);
72132
+ try {
72133
+ const resStat = statSync(filePath);
72134
+ resourceSize += resStat.size;
72135
+ } catch (error49) {
72136
+ console.error(`Failed to get stat for resource: ${resource.name}`, error49);
72137
+ }
72138
+ }
72139
+ }
71889
72140
  stat.push({
71890
72141
  name: config4.folder + "/" + mark.name,
71891
72142
  size: statInfo.size,
@@ -71893,13 +72144,13 @@ class MarkLocalManager {
71893
72144
  tags: mark.tags || [],
71894
72145
  summary: mark.summary || "",
71895
72146
  updatedAt: mark?.updatedAt || statInfo.mtimeMs,
71896
- data: mark.data?.resources || []
72147
+ data: { resources, resourceSize }
71897
72148
  });
71898
72149
  }
71899
72150
  }
71900
72151
  } catch (error49) {}
71901
72152
  }
71902
- fs23.writeFileSync(config4.data, JSON.stringify(result, null, 2), "utf-8");
72153
+ fs24.writeFileSync(config4.data, JSON.stringify(result, null, 2), "utf-8");
71903
72154
  return {
71904
72155
  data: {
71905
72156
  list: markList,
@@ -71927,17 +72178,20 @@ var getPath2 = (dir) => {
71927
72178
  };
71928
72179
  var fileIsExist3 = (filepath) => {
71929
72180
  try {
71930
- fs23.accessSync(filepath, fs23.constants.F_OK);
72181
+ fs24.accessSync(filepath, fs24.constants.F_OK);
71931
72182
  return true;
71932
72183
  } catch (err) {
71933
72184
  return false;
71934
72185
  }
71935
72186
  };
72187
+ var floorMs = (ms) => {
72188
+ return Math.floor(ms / 1000) * 1000;
72189
+ };
71936
72190
 
71937
72191
  // src/command/mark.ts
71938
72192
  var markCmd = new Command("mark").alias("m").description("mark相关命令");
71939
72193
  program.addCommand(markCmd);
71940
- var init = new Command("init").description("初始化mark相关文件").option("-d, --dir <dir>", "目录,默认为当前目录").action(async (opts) => {
72194
+ var init = new Command("sync").alias("init").description("初始化mark相关文件").option("-d, --dir <dir>", "目录,默认为当前目录").action(async (opts) => {
71941
72195
  const dir = opts.dir;
71942
72196
  const markLocal = new MarkLocalManager({ root: dir });
71943
72197
  await markLocal.mount();
@@ -72015,15 +72269,15 @@ var __getProtoOf4 = Object.getPrototypeOf;
72015
72269
  var __defProp5 = Object.defineProperty;
72016
72270
  var __getOwnPropNames4 = Object.getOwnPropertyNames;
72017
72271
  var __hasOwnProp4 = Object.prototype.hasOwnProperty;
72018
- function __accessProp2(key) {
72272
+ function __accessProp3(key) {
72019
72273
  return this[key];
72020
72274
  }
72021
- var __toESMCache_node2;
72022
- var __toESMCache_esm2;
72275
+ var __toESMCache_node3;
72276
+ var __toESMCache_esm3;
72023
72277
  var __toESM4 = (mod, isNodeMode, target) => {
72024
72278
  var canCache = mod != null && typeof mod === "object";
72025
72279
  if (canCache) {
72026
- var cache3 = isNodeMode ? __toESMCache_node2 ??= new WeakMap : __toESMCache_esm2 ??= new WeakMap;
72280
+ var cache3 = isNodeMode ? __toESMCache_node3 ??= new WeakMap : __toESMCache_esm3 ??= new WeakMap;
72027
72281
  var cached3 = cache3.get(mod);
72028
72282
  if (cached3)
72029
72283
  return cached3;
@@ -72033,7 +72287,7 @@ var __toESM4 = (mod, isNodeMode, target) => {
72033
72287
  for (let key of __getOwnPropNames4(mod))
72034
72288
  if (!__hasOwnProp4.call(to, key))
72035
72289
  __defProp5(to, key, {
72036
- get: __accessProp2.bind(mod, key),
72290
+ get: __accessProp3.bind(mod, key),
72037
72291
  enumerable: true
72038
72292
  });
72039
72293
  if (canCache)
@@ -72041,9 +72295,9 @@ var __toESM4 = (mod, isNodeMode, target) => {
72041
72295
  return to;
72042
72296
  };
72043
72297
  var __commonJS4 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
72044
- var __returnValue2 = (v) => v;
72045
- function __exportSetter2(name, newValue) {
72046
- this[name] = __returnValue2.bind(null, newValue);
72298
+ var __returnValue3 = (v) => v;
72299
+ function __exportSetter3(name, newValue) {
72300
+ this[name] = __returnValue3.bind(null, newValue);
72047
72301
  }
72048
72302
  var __export4 = (target, all) => {
72049
72303
  for (var name in all)
@@ -72051,7 +72305,7 @@ var __export4 = (target, all) => {
72051
72305
  get: all[name],
72052
72306
  enumerable: true,
72053
72307
  configurable: true,
72054
- set: __exportSetter2.bind(all, name)
72308
+ set: __exportSetter3.bind(all, name)
72055
72309
  });
72056
72310
  };
72057
72311
  var __require4 = /* @__PURE__ */ createRequire4(import.meta.url);
@@ -72486,15 +72740,15 @@ ${itemIndentStr}`);
72486
72740
  }
72487
72741
  let sumChunks = [chunks.shift()];
72488
72742
  let sumWidth = this.displayWidth(sumChunks[0]);
72489
- chunks.forEach((chunk) => {
72490
- const visibleWidth = this.displayWidth(chunk);
72743
+ chunks.forEach((chunk2) => {
72744
+ const visibleWidth = this.displayWidth(chunk2);
72491
72745
  if (sumWidth + visibleWidth <= width) {
72492
- sumChunks.push(chunk);
72746
+ sumChunks.push(chunk2);
72493
72747
  sumWidth += visibleWidth;
72494
72748
  return;
72495
72749
  }
72496
72750
  wrappedLines.push(sumChunks.join(""));
72497
- const nextChunk = chunk.trimStart();
72751
+ const nextChunk = chunk2.trimStart();
72498
72752
  sumChunks = [nextChunk];
72499
72753
  sumWidth = this.displayWidth(nextChunk);
72500
72754
  });
@@ -72768,7 +73022,7 @@ var require_command2 = __commonJS4((exports) => {
72768
73022
  var EventEmitter5 = __require4("node:events").EventEmitter;
72769
73023
  var childProcess = __require4("node:child_process");
72770
73024
  var path21 = __require4("node:path");
72771
- var fs24 = __require4("node:fs");
73025
+ var fs25 = __require4("node:fs");
72772
73026
  var process22 = __require4("node:process");
72773
73027
  var { Argument: Argument2, humanReadableArgName } = require_argument2();
72774
73028
  var { CommanderError: CommanderError2 } = require_error3();
@@ -73303,7 +73557,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
73303
73557
  this.processedArgs = [];
73304
73558
  }
73305
73559
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
73306
- if (fs24.existsSync(executableFile))
73560
+ if (fs25.existsSync(executableFile))
73307
73561
  return;
73308
73562
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
73309
73563
  const executableMissing = `'${executableFile}' does not exist
@@ -73318,11 +73572,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
73318
73572
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
73319
73573
  function findFile(baseDir, baseName) {
73320
73574
  const localBin = path21.resolve(baseDir, baseName);
73321
- if (fs24.existsSync(localBin))
73575
+ if (fs25.existsSync(localBin))
73322
73576
  return localBin;
73323
73577
  if (sourceExt.includes(path21.extname(baseName)))
73324
73578
  return;
73325
- const foundExt = sourceExt.find((ext) => fs24.existsSync(`${localBin}${ext}`));
73579
+ const foundExt = sourceExt.find((ext) => fs25.existsSync(`${localBin}${ext}`));
73326
73580
  if (foundExt)
73327
73581
  return `${localBin}${foundExt}`;
73328
73582
  return;
@@ -73334,7 +73588,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
73334
73588
  if (this._scriptPath) {
73335
73589
  let resolvedScriptPath;
73336
73590
  try {
73337
- resolvedScriptPath = fs24.realpathSync(this._scriptPath);
73591
+ resolvedScriptPath = fs25.realpathSync(this._scriptPath);
73338
73592
  } catch {
73339
73593
  resolvedScriptPath = this._scriptPath;
73340
73594
  }
@@ -74175,16 +74429,16 @@ var require_eventemitter33 = __commonJS22((exports, module) => {
74175
74429
  if (!new Events().__proto__)
74176
74430
  prefix = false;
74177
74431
  }
74178
- function EE(fn, context, once) {
74432
+ function EE(fn, context, once2) {
74179
74433
  this.fn = fn;
74180
74434
  this.context = context;
74181
- this.once = once || false;
74435
+ this.once = once2 || false;
74182
74436
  }
74183
- function addListener(emitter, event, fn, context, once) {
74437
+ function addListener(emitter, event, fn, context, once2) {
74184
74438
  if (typeof fn !== "function") {
74185
74439
  throw new TypeError("The listener must be a function");
74186
74440
  }
74187
- var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
74441
+ var listener = new EE(fn, context || emitter, once2), evt = prefix ? prefix + event : event;
74188
74442
  if (!emitter._events[evt])
74189
74443
  emitter._events[evt] = listener, emitter._eventsCount++;
74190
74444
  else if (!emitter._events[evt].fn)
@@ -74293,10 +74547,10 @@ var require_eventemitter33 = __commonJS22((exports, module) => {
74293
74547
  EventEmitter5.prototype.on = function on(event, fn, context) {
74294
74548
  return addListener(this, event, fn, context, false);
74295
74549
  };
74296
- EventEmitter5.prototype.once = function once(event, fn, context) {
74550
+ EventEmitter5.prototype.once = function once2(event, fn, context) {
74297
74551
  return addListener(this, event, fn, context, true);
74298
74552
  };
74299
- EventEmitter5.prototype.removeListener = function removeListener(event, fn, context, once) {
74553
+ EventEmitter5.prototype.removeListener = function removeListener(event, fn, context, once2) {
74300
74554
  var evt = prefix ? prefix + event : event;
74301
74555
  if (!this._events[evt])
74302
74556
  return this;
@@ -74306,12 +74560,12 @@ var require_eventemitter33 = __commonJS22((exports, module) => {
74306
74560
  }
74307
74561
  var listeners = this._events[evt];
74308
74562
  if (listeners.fn) {
74309
- if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
74563
+ if (listeners.fn === fn && (!once2 || listeners.once) && (!context || listeners.context === context)) {
74310
74564
  clearEvent(this, evt);
74311
74565
  }
74312
74566
  } else {
74313
74567
  for (var i = 0, events = [], length = listeners.length;i < length; i++) {
74314
- if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
74568
+ if (listeners[i].fn !== fn || once2 && !listeners[i].once || context && listeners[i].context !== context) {
74315
74569
  events.push(listeners[i]);
74316
74570
  }
74317
74571
  }
@@ -74399,12 +74653,12 @@ class RemoteApp {
74399
74653
  console.log(`远程应用 ${this.id} 正在重连中...`);
74400
74654
  }
74401
74655
  return new Promise((resolve) => {
74402
- const timeout = setTimeout(() => {
74656
+ const timeout2 = setTimeout(() => {
74403
74657
  resolve(false);
74404
74658
  that.emitter.off("open", listenOnce);
74405
74659
  }, 5000);
74406
74660
  const listenOnce = () => {
74407
- clearTimeout(timeout);
74661
+ clearTimeout(timeout2);
74408
74662
  that.isConnected = true;
74409
74663
  that.remoteIsConnected = true;
74410
74664
  resolve(true);
@@ -74504,8 +74758,8 @@ class RemoteApp {
74504
74758
  if (!this.enableBackoff) {
74505
74759
  return this.reconnectDelay;
74506
74760
  }
74507
- const delay = this.reconnectDelay * Math.pow(2, this.reconnectAttempts);
74508
- return Math.min(delay, this.maxReconnectDelay);
74761
+ const delay2 = this.reconnectDelay * Math.pow(2, this.reconnectAttempts);
74762
+ return Math.min(delay2, this.maxReconnectDelay);
74509
74763
  }
74510
74764
  scheduleReconnect() {
74511
74765
  if (this.reconnectAttempts >= this.maxReconnectAttempts) {
@@ -74516,9 +74770,9 @@ class RemoteApp {
74516
74770
  if (this.reconnectTimer) {
74517
74771
  clearTimeout(this.reconnectTimer);
74518
74772
  }
74519
- const delay = this.calculateReconnectDelay();
74773
+ const delay2 = this.calculateReconnectDelay();
74520
74774
  this.reconnectAttempts++;
74521
- console.log(`远程应用 ${this.id} 将在 ${delay}ms 后尝试第 ${this.reconnectAttempts} 次重连`);
74775
+ console.log(`远程应用 ${this.id} 将在 ${delay2}ms 后尝试第 ${this.reconnectAttempts} 次重连`);
74522
74776
  this.reconnectTimer = setTimeout(() => {
74523
74777
  this.reconnectTimer = null;
74524
74778
  try {
@@ -74528,7 +74782,7 @@ class RemoteApp {
74528
74782
  this.emitter.emit("reconnectFailed", { id: this.id, attempt: this.reconnectAttempts, error: error49 });
74529
74783
  this.scheduleReconnect();
74530
74784
  }
74531
- }, delay);
74785
+ }, delay2);
74532
74786
  }
74533
74787
  disconnect() {
74534
74788
  this.isManuallyClosed = true;
@@ -74633,7 +74887,7 @@ class RemoteApp {
74633
74887
  }
74634
74888
  var exports_external3 = {};
74635
74889
  __export4(exports_external3, {
74636
- xor: () => xor3,
74890
+ xor: () => xor5,
74637
74891
  xid: () => xid22,
74638
74892
  void: () => _void22,
74639
74893
  uuidv7: () => uuidv73,
@@ -74644,7 +74898,7 @@ __export4(exports_external3, {
74644
74898
  url: () => url5,
74645
74899
  uppercase: () => _uppercase3,
74646
74900
  unknown: () => unknown3,
74647
- union: () => union3,
74901
+ union: () => union5,
74648
74902
  undefined: () => _undefined32,
74649
74903
  ulid: () => ulid22,
74650
74904
  uint64: () => uint643,
@@ -74732,7 +74986,7 @@ __export4(exports_external3, {
74732
74986
  iso: () => exports_iso3,
74733
74987
  ipv6: () => ipv622,
74734
74988
  ipv4: () => ipv422,
74735
- intersection: () => intersection3,
74989
+ intersection: () => intersection5,
74736
74990
  int64: () => int643,
74737
74991
  int32: () => int323,
74738
74992
  int: () => int3,
@@ -74774,7 +75028,7 @@ __export4(exports_external3, {
74774
75028
  config: () => config4,
74775
75029
  coerce: () => exports_coerce3,
74776
75030
  codec: () => codec3,
74777
- clone: () => clone5,
75031
+ clone: () => clone6,
74778
75032
  cidrv6: () => cidrv622,
74779
75033
  cidrv4: () => cidrv422,
74780
75034
  check: () => check3,
@@ -74909,7 +75163,7 @@ __export4(exports_core22, {
74909
75163
  createToJSONSchemaMethod: () => createToJSONSchemaMethod3,
74910
75164
  createStandardJSONSchemaMethod: () => createStandardJSONSchemaMethod3,
74911
75165
  config: () => config4,
74912
- clone: () => clone5,
75166
+ clone: () => clone6,
74913
75167
  _xor: () => _xor3,
74914
75168
  _xid: () => _xid3,
74915
75169
  _void: () => _void6,
@@ -75238,20 +75492,20 @@ __export4(exports_util3, {
75238
75492
  primitiveTypes: () => primitiveTypes3,
75239
75493
  prefixIssues: () => prefixIssues3,
75240
75494
  pick: () => pick7,
75241
- partial: () => partial3,
75495
+ partial: () => partial5,
75242
75496
  parsedType: () => parsedType3,
75243
75497
  optionalKeys: () => optionalKeys3,
75244
- omit: () => omit3,
75498
+ omit: () => omit5,
75245
75499
  objectClone: () => objectClone3,
75246
75500
  numKeys: () => numKeys3,
75247
75501
  nullish: () => nullish6,
75248
75502
  normalizeParams: () => normalizeParams3,
75249
75503
  mergeDefs: () => mergeDefs3,
75250
- merge: () => merge5,
75504
+ merge: () => merge6,
75251
75505
  jsonStringifyReplacer: () => jsonStringifyReplacer3,
75252
75506
  joinValues: () => joinValues3,
75253
75507
  issue: () => issue3,
75254
- isPlainObject: () => isPlainObject6,
75508
+ isPlainObject: () => isPlainObject7,
75255
75509
  isObject: () => isObject4,
75256
75510
  hexToUint8Array: () => hexToUint8Array3,
75257
75511
  getSizableOrigin: () => getSizableOrigin3,
@@ -75267,7 +75521,7 @@ __export4(exports_util3, {
75267
75521
  defineLazy: () => defineLazy3,
75268
75522
  createTransparentProxy: () => createTransparentProxy3,
75269
75523
  cloneDef: () => cloneDef3,
75270
- clone: () => clone5,
75524
+ clone: () => clone6,
75271
75525
  cleanRegex: () => cleanRegex3,
75272
75526
  cleanEnum: () => cleanEnum3,
75273
75527
  captureStackTrace: () => captureStackTrace3,
@@ -75436,7 +75690,7 @@ var allowsEval3 = cached3(() => {
75436
75690
  return false;
75437
75691
  }
75438
75692
  });
75439
- function isPlainObject6(o) {
75693
+ function isPlainObject7(o) {
75440
75694
  if (isObject4(o) === false)
75441
75695
  return false;
75442
75696
  const ctor = o.constructor;
@@ -75453,7 +75707,7 @@ function isPlainObject6(o) {
75453
75707
  return true;
75454
75708
  }
75455
75709
  function shallowClone3(o) {
75456
- if (isPlainObject6(o))
75710
+ if (isPlainObject7(o))
75457
75711
  return { ...o };
75458
75712
  if (Array.isArray(o))
75459
75713
  return [...o];
@@ -75517,7 +75771,7 @@ var primitiveTypes3 = new Set(["string", "number", "bigint", "boolean", "symbol"
75517
75771
  function escapeRegex3(str2) {
75518
75772
  return str2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
75519
75773
  }
75520
- function clone5(inst, def, params) {
75774
+ function clone6(inst, def, params) {
75521
75775
  const cl = new inst._zod.constr(def ?? inst._zod.def);
75522
75776
  if (!def || params?.parent)
75523
75777
  cl._zod.parent = inst;
@@ -75618,9 +75872,9 @@ function pick7(schema, mask) {
75618
75872
  },
75619
75873
  checks: []
75620
75874
  });
75621
- return clone5(schema, def);
75875
+ return clone6(schema, def);
75622
75876
  }
75623
- function omit3(schema, mask) {
75877
+ function omit5(schema, mask) {
75624
75878
  const currDef = schema._zod.def;
75625
75879
  const checks3 = currDef.checks;
75626
75880
  const hasChecks = checks3 && checks3.length > 0;
@@ -75643,10 +75897,10 @@ function omit3(schema, mask) {
75643
75897
  },
75644
75898
  checks: []
75645
75899
  });
75646
- return clone5(schema, def);
75900
+ return clone6(schema, def);
75647
75901
  }
75648
75902
  function extend3(schema, shape) {
75649
- if (!isPlainObject6(shape)) {
75903
+ if (!isPlainObject7(shape)) {
75650
75904
  throw new Error("Invalid input to extend: expected a plain object");
75651
75905
  }
75652
75906
  const checks3 = schema._zod.def.checks;
@@ -75666,10 +75920,10 @@ function extend3(schema, shape) {
75666
75920
  return _shape;
75667
75921
  }
75668
75922
  });
75669
- return clone5(schema, def);
75923
+ return clone6(schema, def);
75670
75924
  }
75671
75925
  function safeExtend3(schema, shape) {
75672
- if (!isPlainObject6(shape)) {
75926
+ if (!isPlainObject7(shape)) {
75673
75927
  throw new Error("Invalid input to safeExtend: expected a plain object");
75674
75928
  }
75675
75929
  const def = mergeDefs3(schema._zod.def, {
@@ -75679,9 +75933,9 @@ function safeExtend3(schema, shape) {
75679
75933
  return _shape;
75680
75934
  }
75681
75935
  });
75682
- return clone5(schema, def);
75936
+ return clone6(schema, def);
75683
75937
  }
75684
- function merge5(a, b) {
75938
+ function merge6(a, b) {
75685
75939
  const def = mergeDefs3(a._zod.def, {
75686
75940
  get shape() {
75687
75941
  const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
@@ -75693,9 +75947,9 @@ function merge5(a, b) {
75693
75947
  },
75694
75948
  checks: []
75695
75949
  });
75696
- return clone5(a, def);
75950
+ return clone6(a, def);
75697
75951
  }
75698
- function partial3(Class3, schema, mask) {
75952
+ function partial5(Class3, schema, mask) {
75699
75953
  const currDef = schema._zod.def;
75700
75954
  const checks3 = currDef.checks;
75701
75955
  const hasChecks = checks3 && checks3.length > 0;
@@ -75731,7 +75985,7 @@ function partial3(Class3, schema, mask) {
75731
75985
  },
75732
75986
  checks: []
75733
75987
  });
75734
- return clone5(schema, def);
75988
+ return clone6(schema, def);
75735
75989
  }
75736
75990
  function required3(Class3, schema, mask) {
75737
75991
  const def = mergeDefs3(schema._zod.def, {
@@ -75762,7 +76016,7 @@ function required3(Class3, schema, mask) {
75762
76016
  return shape;
75763
76017
  }
75764
76018
  });
75765
- return clone5(schema, def);
76019
+ return clone6(schema, def);
75766
76020
  }
75767
76021
  function aborted3(x, startIndex = 0) {
75768
76022
  if (x.aborted === true)
@@ -77439,15 +77693,15 @@ var $ZodDate3 = /* @__PURE__ */ $constructor3("$ZodDate", (inst, def) => {
77439
77693
  } catch (_err) {}
77440
77694
  }
77441
77695
  const input = payload.value;
77442
- const isDate = input instanceof Date;
77443
- const isValidDate = isDate && !Number.isNaN(input.getTime());
77696
+ const isDate3 = input instanceof Date;
77697
+ const isValidDate = isDate3 && !Number.isNaN(input.getTime());
77444
77698
  if (isValidDate)
77445
77699
  return payload;
77446
77700
  payload.issues.push({
77447
77701
  expected: "date",
77448
77702
  code: "invalid_type",
77449
77703
  input,
77450
- ...isDate ? { received: "Invalid Date" } : {},
77704
+ ...isDate3 ? { received: "Invalid Date" } : {},
77451
77705
  inst
77452
77706
  });
77453
77707
  return payload;
@@ -77927,7 +78181,7 @@ function mergeValues3(a, b) {
77927
78181
  if (a instanceof Date && b instanceof Date && +a === +b) {
77928
78182
  return { valid: true, data: a };
77929
78183
  }
77930
- if (isPlainObject6(a) && isPlainObject6(b)) {
78184
+ if (isPlainObject7(a) && isPlainObject7(b)) {
77931
78185
  const bKeys = Object.keys(b);
77932
78186
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
77933
78187
  const newObj = { ...a, ...b };
@@ -78052,8 +78306,8 @@ var $ZodTuple3 = /* @__PURE__ */ $constructor3("$ZodTuple", (inst, def) => {
78052
78306
  }
78053
78307
  }
78054
78308
  if (def.rest) {
78055
- const rest = input.slice(items.length);
78056
- for (const el of rest) {
78309
+ const rest2 = input.slice(items.length);
78310
+ for (const el of rest2) {
78057
78311
  i++;
78058
78312
  const result = def.rest._zod.run({
78059
78313
  value: el,
@@ -78081,7 +78335,7 @@ var $ZodRecord3 = /* @__PURE__ */ $constructor3("$ZodRecord", (inst, def) => {
78081
78335
  $ZodType3.init(inst, def);
78082
78336
  inst._zod.parse = (payload, ctx) => {
78083
78337
  const input = payload.value;
78084
- if (!isPlainObject6(input)) {
78338
+ if (!isPlainObject7(input)) {
78085
78339
  payload.issues.push({
78086
78340
  expected: "record",
78087
78341
  code: "invalid_type",
@@ -81779,11 +82033,11 @@ var capitalizeFirstCharacter3 = (text) => {
81779
82033
  };
81780
82034
  function getUnitTypeFromNumber3(number22) {
81781
82035
  const abs = Math.abs(number22);
81782
- const last = abs % 10;
81783
- const last2 = abs % 100;
81784
- if (last2 >= 11 && last2 <= 19 || last === 0)
82036
+ const last2 = abs % 10;
82037
+ const last22 = abs % 100;
82038
+ if (last22 >= 11 && last22 <= 19 || last2 === 0)
81785
82039
  return "many";
81786
- if (last === 1)
82040
+ if (last2 === 1)
81787
82041
  return "one";
81788
82042
  return "few";
81789
82043
  }
@@ -84984,11 +85238,11 @@ function _intersection3(Class22, left, right) {
84984
85238
  function _tuple3(Class22, items, _paramsOrRest, _params) {
84985
85239
  const hasRest = _paramsOrRest instanceof $ZodType3;
84986
85240
  const params = hasRest ? _params : _paramsOrRest;
84987
- const rest = hasRest ? _paramsOrRest : null;
85241
+ const rest2 = hasRest ? _paramsOrRest : null;
84988
85242
  return new Class22({
84989
85243
  type: "tuple",
84990
85244
  items,
84991
- rest,
85245
+ rest: rest2,
84992
85246
  ...normalizeParams3(params)
84993
85247
  });
84994
85248
  }
@@ -85926,30 +86180,30 @@ var tupleProcessor3 = (schema, ctx, _json, params) => {
85926
86180
  ...params,
85927
86181
  path: [...params.path, prefixPath, i]
85928
86182
  }));
85929
- const rest = def.rest ? process22(def.rest, ctx, {
86183
+ const rest2 = def.rest ? process22(def.rest, ctx, {
85930
86184
  ...params,
85931
86185
  path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
85932
86186
  }) : null;
85933
86187
  if (ctx.target === "draft-2020-12") {
85934
86188
  json3.prefixItems = prefixItems;
85935
- if (rest) {
85936
- json3.items = rest;
86189
+ if (rest2) {
86190
+ json3.items = rest2;
85937
86191
  }
85938
86192
  } else if (ctx.target === "openapi-3.0") {
85939
86193
  json3.items = {
85940
86194
  anyOf: prefixItems
85941
86195
  };
85942
- if (rest) {
85943
- json3.items.anyOf.push(rest);
86196
+ if (rest2) {
86197
+ json3.items.anyOf.push(rest2);
85944
86198
  }
85945
86199
  json3.minItems = prefixItems.length;
85946
- if (!rest) {
86200
+ if (!rest2) {
85947
86201
  json3.maxItems = prefixItems.length;
85948
86202
  }
85949
86203
  } else {
85950
86204
  json3.items = prefixItems;
85951
- if (rest) {
85952
- json3.additionalItems = rest;
86205
+ if (rest2) {
86206
+ json3.additionalItems = rest2;
85953
86207
  }
85954
86208
  }
85955
86209
  const { minimum, maximum } = schema._zod.bag;
@@ -86208,7 +86462,7 @@ class JSONSchemaGenerator3 {
86208
86462
  var exports_json_schema3 = {};
86209
86463
  var exports_schemas22 = {};
86210
86464
  __export4(exports_schemas22, {
86211
- xor: () => xor3,
86465
+ xor: () => xor5,
86212
86466
  xid: () => xid22,
86213
86467
  void: () => _void22,
86214
86468
  uuidv7: () => uuidv73,
@@ -86217,7 +86471,7 @@ __export4(exports_schemas22, {
86217
86471
  uuid: () => uuid22,
86218
86472
  url: () => url5,
86219
86473
  unknown: () => unknown3,
86220
- union: () => union3,
86474
+ union: () => union5,
86221
86475
  undefined: () => _undefined32,
86222
86476
  ulid: () => ulid22,
86223
86477
  uint64: () => uint643,
@@ -86265,7 +86519,7 @@ __export4(exports_schemas22, {
86265
86519
  json: () => json3,
86266
86520
  ipv6: () => ipv622,
86267
86521
  ipv4: () => ipv422,
86268
- intersection: () => intersection3,
86522
+ intersection: () => intersection5,
86269
86523
  int64: () => int643,
86270
86524
  int32: () => int323,
86271
86525
  int: () => int3,
@@ -86512,7 +86766,7 @@ var ZodType3 = /* @__PURE__ */ $constructor3("ZodType", (inst, def) => {
86512
86766
  });
86513
86767
  };
86514
86768
  inst.with = inst.check;
86515
- inst.clone = (def2, params) => clone5(inst, def2, params);
86769
+ inst.clone = (def2, params) => clone6(inst, def2, params);
86516
86770
  inst.brand = () => inst;
86517
86771
  inst.register = (reg, meta22) => {
86518
86772
  reg.add(inst, meta22);
@@ -86540,8 +86794,8 @@ var ZodType3 = /* @__PURE__ */ $constructor3("ZodType", (inst, def) => {
86540
86794
  inst.nullish = () => optional3(nullable3(inst));
86541
86795
  inst.nonoptional = (params) => nonoptional3(inst, params);
86542
86796
  inst.array = () => array3(inst);
86543
- inst.or = (arg) => union3([inst, arg]);
86544
- inst.and = (arg) => intersection3(inst, arg);
86797
+ inst.or = (arg) => union5([inst, arg]);
86798
+ inst.and = (arg) => intersection5(inst, arg);
86545
86799
  inst.transform = (tx) => pipe3(inst, transform3(tx));
86546
86800
  inst.default = (def2) => _default22(inst, def2);
86547
86801
  inst.prefault = (def2) => prefault3(inst, def2);
@@ -87044,7 +87298,7 @@ var ZodUnion3 = /* @__PURE__ */ $constructor3("ZodUnion", (inst, def) => {
87044
87298
  inst._zod.processJSONSchema = (ctx, json3, params) => unionProcessor3(inst, ctx, json3, params);
87045
87299
  inst.options = def.options;
87046
87300
  });
87047
- function union3(options2, params) {
87301
+ function union5(options2, params) {
87048
87302
  return new ZodUnion3({
87049
87303
  type: "union",
87050
87304
  options: options2,
@@ -87057,7 +87311,7 @@ var ZodXor3 = /* @__PURE__ */ $constructor3("ZodXor", (inst, def) => {
87057
87311
  inst._zod.processJSONSchema = (ctx, json3, params) => unionProcessor3(inst, ctx, json3, params);
87058
87312
  inst.options = def.options;
87059
87313
  });
87060
- function xor3(options2, params) {
87314
+ function xor5(options2, params) {
87061
87315
  return new ZodXor3({
87062
87316
  type: "union",
87063
87317
  options: options2,
@@ -87082,7 +87336,7 @@ var ZodIntersection3 = /* @__PURE__ */ $constructor3("ZodIntersection", (inst, d
87082
87336
  ZodType3.init(inst, def);
87083
87337
  inst._zod.processJSONSchema = (ctx, json3, params) => intersectionProcessor3(inst, ctx, json3, params);
87084
87338
  });
87085
- function intersection3(left, right) {
87339
+ function intersection5(left, right) {
87086
87340
  return new ZodIntersection3({
87087
87341
  type: "intersection",
87088
87342
  left,
@@ -87093,19 +87347,19 @@ var ZodTuple3 = /* @__PURE__ */ $constructor3("ZodTuple", (inst, def) => {
87093
87347
  $ZodTuple3.init(inst, def);
87094
87348
  ZodType3.init(inst, def);
87095
87349
  inst._zod.processJSONSchema = (ctx, json3, params) => tupleProcessor3(inst, ctx, json3, params);
87096
- inst.rest = (rest) => inst.clone({
87350
+ inst.rest = (rest2) => inst.clone({
87097
87351
  ...inst._zod.def,
87098
- rest
87352
+ rest: rest2
87099
87353
  });
87100
87354
  });
87101
87355
  function tuple3(items, _paramsOrRest, _params) {
87102
87356
  const hasRest = _paramsOrRest instanceof $ZodType3;
87103
87357
  const params = hasRest ? _params : _paramsOrRest;
87104
- const rest = hasRest ? _paramsOrRest : null;
87358
+ const rest2 = hasRest ? _paramsOrRest : null;
87105
87359
  return new ZodTuple3({
87106
87360
  type: "tuple",
87107
87361
  items,
87108
- rest,
87362
+ rest: rest2,
87109
87363
  ...exports_util3.normalizeParams(params)
87110
87364
  });
87111
87365
  }
@@ -87125,7 +87379,7 @@ function record3(keyType, valueType, params) {
87125
87379
  });
87126
87380
  }
87127
87381
  function partialRecord3(keyType, valueType, params) {
87128
- const k = clone5(keyType);
87382
+ const k = clone6(keyType);
87129
87383
  k._zod.values = undefined;
87130
87384
  return new ZodRecord3({
87131
87385
  type: "record",
@@ -87557,7 +87811,7 @@ var stringbool3 = (...args) => _stringbool3({
87557
87811
  }, ...args);
87558
87812
  function json3(params) {
87559
87813
  const jsonSchema = lazy3(() => {
87560
- return union3([string22(params), number22(), boolean22(), _null32(), array3(jsonSchema), record3(string22(), jsonSchema)]);
87814
+ return union5([string22(params), number22(), boolean22(), _null32(), array3(jsonSchema), record3(string22(), jsonSchema)]);
87561
87815
  });
87562
87816
  return jsonSchema;
87563
87817
  }
@@ -87922,9 +88176,9 @@ function convertBaseSchema3(schema, ctx) {
87922
88176
  const items = schema.items;
87923
88177
  if (prefixItems && Array.isArray(prefixItems)) {
87924
88178
  const tupleItems = prefixItems.map((item) => convertSchema3(item, ctx));
87925
- const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema3(items, ctx) : undefined;
87926
- if (rest) {
87927
- zodSchema = z3.tuple(tupleItems).rest(rest);
88179
+ const rest2 = items && typeof items === "object" && !Array.isArray(items) ? convertSchema3(items, ctx) : undefined;
88180
+ if (rest2) {
88181
+ zodSchema = z3.tuple(tupleItems).rest(rest2);
87928
88182
  } else {
87929
88183
  zodSchema = z3.tuple(tupleItems);
87930
88184
  }
@@ -87936,9 +88190,9 @@ function convertBaseSchema3(schema, ctx) {
87936
88190
  }
87937
88191
  } else if (Array.isArray(items)) {
87938
88192
  const tupleItems = items.map((item) => convertSchema3(item, ctx));
87939
- const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema3(schema.additionalItems, ctx) : undefined;
87940
- if (rest) {
87941
- zodSchema = z3.tuple(tupleItems).rest(rest);
88193
+ const rest2 = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema3(schema.additionalItems, ctx) : undefined;
88194
+ if (rest2) {
88195
+ zodSchema = z3.tuple(tupleItems).rest(rest2);
87942
88196
  } else {
87943
88197
  zodSchema = z3.tuple(tupleItems);
87944
88198
  }
@@ -88446,26 +88700,26 @@ app.route({
88446
88700
 
88447
88701
  // packages/common/mark-local/file.ts
88448
88702
  import path24 from "node:path";
88449
- import fs25 from "node:fs";
88703
+ import fs26 from "node:fs";
88450
88704
 
88451
88705
  // assistant/src/module/assistant/proxy/pipe.ts
88452
- import * as fs24 from "fs";
88706
+ import * as fs25 from "fs";
88453
88707
 
88454
88708
  // assistant/src/module/assistant/proxy/utils.ts
88455
88709
  var isBun2 = typeof Bun !== "undefined" && Bun?.version != null;
88456
- var isNode = typeof process !== "undefined" && process?.versions != null && process.versions?.node != null;
88710
+ var isNode3 = typeof process !== "undefined" && process?.versions != null && process.versions?.node != null;
88457
88711
  var isDeno2 = typeof Deno !== "undefined" && Deno?.version != null && Deno?.version?.deno != null;
88458
88712
 
88459
88713
  // node_modules/.pnpm/@kevisual+logger@0.0.4/node_modules/@kevisual/logger/dist/logger.mjs
88460
88714
  var showTime2 = (time4, format = "hh:mm:ss") => {
88461
88715
  const date6 = new Date(time4);
88462
- const pad = (n) => n.toString().padStart(2, "0");
88716
+ const pad2 = (n) => n.toString().padStart(2, "0");
88463
88717
  const year2 = date6.getFullYear();
88464
- const month = pad(date6.getMonth() + 1);
88465
- const day2 = pad(date6.getDate());
88466
- const hours = pad(date6.getHours());
88467
- const minutes = pad(date6.getMinutes());
88468
- const seconds = pad(date6.getSeconds());
88718
+ const month = pad2(date6.getMonth() + 1);
88719
+ const day2 = pad2(date6.getDate());
88720
+ const hours = pad2(date6.getHours());
88721
+ const minutes = pad2(date6.getMinutes());
88722
+ const seconds = pad2(date6.getSeconds());
88469
88723
  if (format === "YYYY-MM-DD hh:mm:ss") {
88470
88724
  return `${year2}-${month}-${day2} ${hours}:${minutes}:${seconds}`;
88471
88725
  }
@@ -88553,7 +88807,7 @@ var console2 = {
88553
88807
 
88554
88808
  // assistant/src/module/assistant/proxy/pipe.ts
88555
88809
  var pipeFileStream = (filePath, res) => {
88556
- const readStream = fs24.createReadStream(filePath);
88810
+ const readStream = fs25.createReadStream(filePath);
88557
88811
  if (isBun2) {
88558
88812
  res.pipe(readStream);
88559
88813
  } else {
@@ -88682,10 +88936,10 @@ app.route({
88682
88936
  try {
88683
88937
  const encoding = ctx.args.encoding || "utf-8";
88684
88938
  if (encoding === "utf-8") {
88685
- fs25.writeFileSync(filepath, content, "utf-8");
88939
+ fs26.writeFileSync(filepath, content, "utf-8");
88686
88940
  } else if (encoding === "base64") {
88687
88941
  const buffer = Buffer.from(content, "base64");
88688
- fs25.writeFileSync(filepath, buffer);
88942
+ fs26.writeFileSync(filepath, buffer);
88689
88943
  } else {
88690
88944
  ctx.throw("不支持的编码格式");
88691
88945
  }
@@ -88726,7 +88980,7 @@ app.route({
88726
88980
  ctx.throw("文件不存在");
88727
88981
  return;
88728
88982
  }
88729
- fs25.unlinkSync(filepath);
88983
+ fs26.unlinkSync(filepath);
88730
88984
  ctx.body = {
88731
88985
  success: true,
88732
88986
  message: "文件删除成功"
@@ -88765,7 +89019,7 @@ app.route({
88765
89019
  return;
88766
89020
  }
88767
89021
  if (base644) {
88768
- const buffer = fs25.readFileSync(filepath);
89022
+ const buffer = fs26.readFileSync(filepath);
88769
89023
  const base64Content = buffer.toString("base64");
88770
89024
  console.log("base64Content", dir, name);
88771
89025
  ctx.body = {
@@ -88783,8 +89037,8 @@ app.route({
88783
89037
 
88784
89038
  // packages/common/mark-local/note.ts
88785
89039
  import path25 from "node:path";
88786
- import fs26 from "node:fs";
88787
- var import_dayjs = __toESM(require_dayjs_min(), 1);
89040
+ import fs27 from "node:fs";
89041
+ var import_dayjs2 = __toESM(require_dayjs_min(), 1);
88788
89042
  var import_gray_matter2 = __toESM(require_gray_matter(), 1);
88789
89043
  app.route({
88790
89044
  path: "mark-local",
@@ -88853,27 +89107,30 @@ app.route({
88853
89107
  args: {
88854
89108
  dir: exports_external2.string().optional().describe("目录"),
88855
89109
  title: exports_external2.string().optional().describe("标题"),
88856
- id: exports_external2.string().optional().describe("id")
89110
+ id: exports_external2.string().optional().describe("id"),
89111
+ ext: exports_external2.string().optional().describe("mdx或者md,默认为md")
88857
89112
  }
88858
89113
  }
88859
89114
  }).define(async (ctx) => {
88860
- let { dir, title, id } = ctx.args;
89115
+ let { dir, title, id, ext } = ctx.args;
88861
89116
  const markLocalManager2 = new MarkLocalManager({ root: dir });
88862
89117
  await markLocalManager2.mount();
88863
89118
  const config5 = markLocalManager2.getConfig();
88864
- const dirname2 = `${id || import_dayjs.default().format("YYYYMMDDHHmmss")}`;
89119
+ const dayId = "x" + import_dayjs2.default().format("YYYYMMDDHHmm");
89120
+ const dirname2 = `${id || dayId}`;
88865
89121
  const dirpath = path25.resolve(config5.root, dirname2);
88866
89122
  if (!fileIsExist3(dirpath)) {
88867
- fs26.mkdirSync(dirpath, { recursive: true });
89123
+ fs27.mkdirSync(dirpath, { recursive: true });
88868
89124
  }
88869
- const filepath = path25.resolve(config5.root, dirname2, "readme.md");
89125
+ const filename = markLocalManager2.filename;
89126
+ const filepath = path25.resolve(config5.root, dirname2, `${filename}.${ext || "md"}`);
88870
89127
  const data = {
88871
89128
  title: title || dirname2,
88872
89129
  updateAt: Date.now()
88873
89130
  };
88874
89131
  const _matterContent = import_gray_matter2.default.stringify("", data);
88875
89132
  if (!fileIsExist3(filepath)) {
88876
- fs26.writeFileSync(filepath, _matterContent, "utf-8");
89133
+ fs27.writeFileSync(filepath, _matterContent, "utf-8");
88877
89134
  }
88878
89135
  ctx.body = {
88879
89136
  filepath
@@ -88904,15 +89161,15 @@ app.route({
88904
89161
  const statPath = path25.resolve(config5.root, "..", output || "dist", statHtml);
88905
89162
  if (clean) {
88906
89163
  try {
88907
- fs26.rmSync(distPath, { recursive: true, force: true });
89164
+ fs27.rmSync(distPath, { recursive: true, force: true });
88908
89165
  } catch (error98) {
88909
89166
  console.error(error98);
88910
89167
  }
88911
89168
  }
88912
89169
  if (!fileIsExist3(distPath)) {
88913
- fs26.mkdirSync(distPath, { recursive: true });
89170
+ fs27.mkdirSync(distPath, { recursive: true });
88914
89171
  }
88915
- fs26.cpSync(config5.root, distPath, { recursive: true });
89172
+ fs27.cpSync(config5.root, distPath, { recursive: true });
88916
89173
  const distManager = new MarkLocalManager({ root: distPath });
88917
89174
  await distManager.mount();
88918
89175
  const result = await distManager.build({ stat });
@@ -88944,7 +89201,7 @@ app.route({
88944
89201
  </body>
88945
89202
  </html>
88946
89203
  `;
88947
- fs26.writeFileSync(statPath, statHtmlContent, "utf-8");
89204
+ fs27.writeFileSync(statPath, statHtmlContent, "utf-8");
88948
89205
  }
88949
89206
  ctx.body = {
88950
89207
  distPath