node-karin 1.8.13 → 1.9.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # 更新日志
2
2
 
3
+ ## [1.9.1](https://github.com/KarinJS/Karin/compare/core-v1.9.0...core-v1.9.1) (2025-05-11)
4
+
5
+
6
+ ### ♻️ Code Refactoring
7
+
8
+ * **core:** 优化插件目录创建逻辑 ([#429](https://github.com/KarinJS/Karin/issues/429)) ([3828411](https://github.com/KarinJS/Karin/commit/382841192b4fe3f91a2797d2118d654a42308d1b))
9
+
10
+ ## [1.9.0](https://github.com/KarinJS/Karin/compare/core-v1.8.13...core-v1.9.0) (2025-05-10)
11
+
12
+
13
+ ### ✨ Features
14
+
15
+ * 增加Docker安装方式以及Docker构建工作流 ([#424](https://github.com/KarinJS/Karin/issues/424)) ([f58417d](https://github.com/KarinJS/Karin/commit/f58417d4593f74b710a5072f5aacdcc8c3d07fab))
16
+
17
+
18
+ ### 🎡 Continuous Integration
19
+
20
+ * 优化ci ([#428](https://github.com/KarinJS/Karin/issues/428)) ([75fe5cb](https://github.com/KarinJS/Karin/commit/75fe5cb5a33b59e0089a39e540602202eb2c675b))
21
+
3
22
  ## [1.8.13](https://github.com/KarinJS/Karin/compare/core-v1.8.12...core-v1.8.13) (2025-05-09)
4
23
 
5
24
 
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  `karin`(卡琳)是一款灵活、现代、极易扩展的 Node.js 插件化应用框架,专为开发者打造,助你轻松构建属于自己的高效工具链和自动化服务。
6
6
 
7
7
  ✨ **主要特性**:
8
- - 插件化架构,支持热插拔,生态丰富
8
+ - ~~插件化架构,支持热插拔,生态丰富~~
9
9
  - 一行命令即可初始化项目,快速上手
10
10
  - 丰富的 Web UI(基于 React + HeroUI),颜值与功能并存
11
11
  - 支持多种自动化场景、任务调度、依赖管理
package/dist/index.d.ts CHANGED
@@ -10103,7 +10103,7 @@ declare const downloadFile: <T extends boolean = false>(fileUrl: string, savePat
10103
10103
  * @param savePath 保存路径
10104
10104
  * @param param axios参数
10105
10105
  */
10106
- declare const downFile: (fileUrl: string, savePath: string, param?: AxiosRequestConfig) => Promise<boolean>;
10106
+ declare const downFile: (fileUrl: string, savePath: string, param?: AxiosRequestConfig) => Promise<DownloadFileResult<boolean>>;
10107
10107
  /**
10108
10108
  * 标准化文件路径 统一使用/分隔符
10109
10109
  * @param file - 路径
@@ -12119,7 +12119,7 @@ declare const getCacheCfg: <T>(cache: Record<string, T>, count: ReturnType<typeo
12119
12119
  * @param count 计数器
12120
12120
  * @param cache 缓存
12121
12121
  */
12122
- declare const clearCache: <T extends GroupsObjectValue | PrivatesObjectValue>(data: Record<string, T>, count: ReturnType<typeof createCount>, cache: Record<string, T>) => void;
12122
+ declare const clearCache: <T extends GroupsObjectValue | PrivatesObjectValue>(count: ReturnType<typeof createCount>, staticCache: Record<string, T>, dynamicCache: Record<string, T>) => void;
12123
12123
 
12124
12124
  /**
12125
12125
  * @description 默认配置
package/dist/index.mjs CHANGED
@@ -1371,8 +1371,12 @@ var init_file2 = __esm({
1371
1371
  createPluginDir = async (name, files) => {
1372
1372
  if (!Array.isArray(files)) files = ["config", "data", "resources"];
1373
1373
  if (files.length === 0) return;
1374
- const pluginPath = path5.join(basePath, name);
1375
- if (!fs6.existsSync(pluginPath)) await fs6.promises.mkdir(pluginPath, { recursive: true });
1374
+ const isOrgPkg = name.startsWith("@") && name.includes("/");
1375
+ let pluginPath = isOrgPkg ? path5.join(karinPathBase, name.replace("/", "-")) : path5.join(karinPathBase, name);
1376
+ if (isOrgPkg && !fs6.existsSync(pluginPath)) {
1377
+ const [orgName, pkgName] = name.split("/");
1378
+ pluginPath = path5.join(karinPathBase, orgName, pkgName);
1379
+ }
1376
1380
  await Promise.all(files.map((file) => {
1377
1381
  const filePath = path5.join(pluginPath, file);
1378
1382
  if (!fs6.existsSync(filePath)) return fs6.promises.mkdir(filePath, { recursive: true });
@@ -1629,19 +1633,22 @@ var init_path = __esm({
1629
1633
  const files = fs6.readdirSync(filePath, { withFileTypes: true });
1630
1634
  const list2 = [];
1631
1635
  if (!Array.isArray(ext)) ext = [ext];
1632
- files.forEach((v) => {
1633
- if (v.isDirectory()) return;
1634
- if (ext.includes(path5.extname(v.name))) {
1636
+ const allFiles = (dir2, entry) => {
1637
+ if (entry.isDirectory()) {
1638
+ const subFiles = filesByExt(path5.join(dir2, entry.name), ext, returnType);
1639
+ list2.push(...subFiles);
1640
+ } else if (ext.includes(path5.extname(entry.name))) {
1635
1641
  if (returnType === "name") {
1636
- list2.push(v.name);
1642
+ list2.push(entry.name);
1637
1643
  } else if (returnType === "rel") {
1638
- const file = path5.resolve(filePath, v.name);
1644
+ const file = path5.resolve(dir2, entry.name);
1639
1645
  list2.push(path5.relative(process.cwd(), file));
1640
1646
  } else if (returnType === "abs") {
1641
- list2.push(formatPath(path5.resolve(filePath, v.name)));
1647
+ list2.push(formatPath(path5.resolve(dir2, entry.name)));
1642
1648
  }
1643
1649
  }
1644
- });
1650
+ };
1651
+ files.forEach((entry) => allFiles(filePath, entry));
1645
1652
  return list2;
1646
1653
  };
1647
1654
  splitPath = (filePath) => {
@@ -3225,38 +3232,41 @@ var init_tools = __esm({
3225
3232
  createCount = () => {
3226
3233
  return {};
3227
3234
  };
3228
- getCacheCfg = (cache12, count3, keys) => {
3235
+ getCacheCfg = (cache10, count3, keys) => {
3229
3236
  const key = keys[0];
3230
- if (cache12[key]) {
3237
+ if (cache10[key]) {
3231
3238
  initCount(count3, key);
3232
- return cache12[key];
3239
+ return cache10[key];
3233
3240
  }
3234
- keys.forEach((v, index6) => {
3235
- if (!cache12[v]) return;
3236
- if (index6 === 0 && v === key) {
3241
+ for (let i = 0; i < keys.length; i++) {
3242
+ const v = keys[i];
3243
+ if (!cache10[v]) {
3244
+ continue;
3245
+ }
3246
+ if (i === 0 && v === key) {
3237
3247
  initCount(count3, v);
3238
- return cache12[v];
3248
+ return cache10[v];
3239
3249
  }
3240
3250
  if (v === key) {
3241
3251
  initCount(count3, v);
3242
- return cache12[v];
3252
+ return cache10[v];
3243
3253
  }
3244
- cache12[key] = cache12[v];
3254
+ cache10[key] = cache10[v];
3245
3255
  initCount(count3, key);
3246
- return cache12[key];
3247
- });
3248
- return cache12.default;
3256
+ return cache10[key];
3257
+ }
3258
+ return cache10.default;
3249
3259
  };
3250
- clearCache = (data, count3, cache12) => {
3260
+ clearCache = (count3, staticCache3, dynamicCache3) => {
3251
3261
  setInterval(() => {
3252
3262
  Object.keys(count3).forEach((key) => {
3253
3263
  if (count3[key].count - count3[key].start < 10) {
3254
- if (data[key]) {
3264
+ if (staticCache3[key]) {
3255
3265
  delete count3[key];
3256
3266
  return;
3257
3267
  }
3258
3268
  delete count3[key];
3259
- delete cache12[key];
3269
+ delete dynamicCache3[key];
3260
3270
  } else {
3261
3271
  count3[key].start = count3[key].count;
3262
3272
  }
@@ -10201,12 +10211,12 @@ var init_list = __esm({
10201
10211
  list2.map(async (v) => {
10202
10212
  const [type, name] = v.split(":");
10203
10213
  if (type === "app") {
10204
- const file = path5.join(pluginDir, name);
10214
+ const file = path5.join(karinPathPlugins, name);
10205
10215
  await getAppInfo(info, file, name, ext, isForce);
10206
10216
  return;
10207
10217
  }
10208
10218
  if (type === "git" || type === "root") {
10209
- const file = type === "root" ? process.cwd() : path5.join(pluginDir, name);
10219
+ const file = type === "root" ? process.cwd() : path5.join(karinPathPlugins, name);
10210
10220
  await getGitInfo(info, file, name, ext, isForce, env3);
10211
10221
  return;
10212
10222
  }
@@ -10229,7 +10239,7 @@ var init_list = __esm({
10229
10239
  files.map(async (v) => {
10230
10240
  if (!v.isDirectory()) return;
10231
10241
  if (!v.name.startsWith("karin-plugin-")) return;
10232
- if (fs6.existsSync(`${pluginDir}/${v.name}/package.json`)) return;
10242
+ if (fs6.existsSync(`${karinPathPlugins}/${v.name}/package.json`)) return;
10233
10243
  list2.push(`app:${v.name}`);
10234
10244
  })
10235
10245
  );
@@ -10239,8 +10249,8 @@ var init_list = __esm({
10239
10249
  files.map(async (v) => {
10240
10250
  if (!v.isDirectory()) return;
10241
10251
  if (!v.name.startsWith("karin-plugin-")) return;
10242
- if (!fs6.existsSync(path5.join(pluginDir, v.name, "package.json"))) return;
10243
- const pkg2 = await requireFile(path5.join(pluginDir, v.name, "package.json"));
10252
+ if (!fs6.existsSync(path5.join(karinPathPlugins, v.name, "package.json"))) return;
10253
+ const pkg2 = await requireFile(path5.join(karinPathPlugins, v.name, "package.json"));
10244
10254
  if (pkg2?.karin?.engines?.karin && !satisfies(pkg2.karin.engines.karin, process.env.KARIN_VERSION)) {
10245
10255
  const msg = `[getPlugins][git] ${v.name} \u8981\u6C42 node-karin \u7248\u672C\u4E3A ${pkg2.karin.engines.karin}\uFF0C\u5F53\u524D\u4E0D\u7B26\u5408\u8981\u6C42\uFF0C\u8DF3\u8FC7\u52A0\u8F7D\u63D2\u4EF6`;
10246
10256
  isInit && setTimeout(() => logger.error(msg), 1e3);
@@ -10278,6 +10288,7 @@ var init_list = __esm({
10278
10288
  "sqlite3"
10279
10289
  ];
10280
10290
  collectNpmPlugins = async (list2) => {
10291
+ logger.debug("[collectNpmPlugins] \u5F00\u59CB\u6536\u96C6NPM\u63D2\u4EF6");
10281
10292
  const pkg2 = await requireFile("./package.json", { force: true });
10282
10293
  const dependencies = [
10283
10294
  ...Object.keys(pkg2.dependencies || {}),
@@ -10318,7 +10329,7 @@ var init_list = __esm({
10318
10329
  initCache();
10319
10330
  if (!["npm", "all", "git", "app"].includes(type)) return [];
10320
10331
  const list2 = [];
10321
- const files = type === "npm" ? [] : fs6.existsSync(pluginDir) ? await fs6.promises.readdir(pluginDir, { withFileTypes: true }) : [];
10332
+ const files = type === "npm" ? [] : fs6.existsSync(karinPathPlugins) ? await fs6.promises.readdir(karinPathPlugins, { withFileTypes: true }) : [];
10322
10333
  switch (type) {
10323
10334
  case "app":
10324
10335
  await collectAppPlugins(files, list2);
@@ -13845,7 +13856,7 @@ function requireRange() {
13845
13856
  parseRange(range22) {
13846
13857
  const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
13847
13858
  const memoKey = memoOpts + ":" + range22;
13848
- const cached = cache12.get(memoKey);
13859
+ const cached = cache10.get(memoKey);
13849
13860
  if (cached) {
13850
13861
  return cached;
13851
13862
  }
@@ -13879,7 +13890,7 @@ function requireRange() {
13879
13890
  rangeMap.delete("");
13880
13891
  }
13881
13892
  const result = [...rangeMap.values()];
13882
- cache12.set(memoKey, result);
13893
+ cache10.set(memoKey, result);
13883
13894
  return result;
13884
13895
  }
13885
13896
  intersects(range22, options) {
@@ -13918,7 +13929,7 @@ function requireRange() {
13918
13929
  }
13919
13930
  range2 = Range;
13920
13931
  const LRU = requireLrucache();
13921
- const cache12 = new LRU();
13932
+ const cache10 = new LRU();
13922
13933
  const parseOptions = requireParseOptions();
13923
13934
  const Comparator = requireComparator();
13924
13935
  const debug3 = requireDebug();
@@ -16673,7 +16684,7 @@ var init_config2 = __esm({
16673
16684
  config_default = initConfig;
16674
16685
  }
16675
16686
  });
16676
- var count, cache8, getCfg, isOld, migrate, format2, initGroups, groups, getGroupCfg, getGuildCfg, getGroupsFileData, groups_default;
16687
+ var count, staticCache, dynamicCache, getCfg, isOld, migrate, format2, initGroups, groups, getGroupCfg, getGuildCfg, getGroupsFileData, groups_default;
16677
16688
  var init_groups4 = __esm({
16678
16689
  "src/utils/config/file/groups.ts"() {
16679
16690
  init_watch();
@@ -16683,7 +16694,7 @@ var init_groups4 = __esm({
16683
16694
  init_default();
16684
16695
  init_tools();
16685
16696
  count = createCount();
16686
- getCfg = (keys) => getCacheCfg(cache8, count, keys);
16697
+ getCfg = (keys) => getCacheCfg(dynamicCache, count, keys);
16687
16698
  isOld = (obj) => {
16688
16699
  if (Array.isArray(obj)) return false;
16689
16700
  return Object.keys(obj).every((key) => typeof obj[key] === "object");
@@ -16710,19 +16721,20 @@ var init_groups4 = __esm({
16710
16721
  const name = "groups.json";
16711
16722
  const file = `${dir2}/${name}`;
16712
16723
  const data = requireFileSync(file, { type: "json" });
16713
- const DATA = isOld(data) ? migrate(file, data) : format2(data);
16714
- cache8 = DATA;
16724
+ staticCache = isOld(data) ? migrate(file, data) : format2(data);
16725
+ dynamicCache = format2(data);
16715
16726
  watch(file, async (old, data2) => {
16716
- cache8 = format2(data2);
16717
- const options = { file: name, old, data: cache8 };
16727
+ staticCache = isOld(data2) ? migrate(file, data2) : format2(data2);
16728
+ dynamicCache = staticCache;
16729
+ const options = { file: name, old, data: dynamicCache };
16718
16730
  listeners.emit(FILE_CHANGE, options);
16719
16731
  listeners.emit(`${FILE_CHANGE}:${name}`, options);
16720
16732
  }, { type: "json" });
16721
- clearCache(DATA, count, cache8);
16733
+ clearCache(count, staticCache, dynamicCache);
16722
16734
  };
16723
16735
  groups = () => {
16724
16736
  return {
16725
- get: () => cache8
16737
+ get: () => dynamicCache
16726
16738
  };
16727
16739
  };
16728
16740
  getGroupCfg = (groupId, selfId) => {
@@ -16754,7 +16766,7 @@ var init_groups4 = __esm({
16754
16766
  groups_default = initGroups;
16755
16767
  }
16756
16768
  });
16757
- var count2, cache9, getCfg2, isOld2, migrate2, format3, initPrivates, privates, getFriendCfg, getDirectCfg, getPrivatesFileData, privates_default;
16769
+ var count2, staticCache2, dynamicCache2, getCfg2, isOld2, migrate2, format3, initPrivates, privates, getFriendCfg, getDirectCfg, getPrivatesFileData, privates_default;
16758
16770
  var init_privates = __esm({
16759
16771
  "src/utils/config/file/privates.ts"() {
16760
16772
  init_watch();
@@ -16764,7 +16776,7 @@ var init_privates = __esm({
16764
16776
  init_default();
16765
16777
  init_tools();
16766
16778
  count2 = createCount();
16767
- getCfg2 = (keys) => getCacheCfg(cache9, count2, keys);
16779
+ getCfg2 = (keys) => getCacheCfg(dynamicCache2, count2, keys);
16768
16780
  isOld2 = (obj) => {
16769
16781
  if (Array.isArray(obj)) return false;
16770
16782
  return Object.keys(obj).every((key) => typeof obj[key] === "object");
@@ -16791,17 +16803,18 @@ var init_privates = __esm({
16791
16803
  const name = "privates.json";
16792
16804
  const file = `${dir2}/${name}`;
16793
16805
  const data = requireFileSync(file, { type: "json" });
16794
- const DATA = isOld2(data) ? migrate2(file, data) : format3(data);
16795
- cache9 = DATA;
16806
+ staticCache2 = isOld2(data) ? migrate2(file, data) : format3(data);
16807
+ dynamicCache2 = format3(data);
16796
16808
  watch(file, async (old, data2) => {
16797
- cache9 = format3(data2);
16798
- const options = { file: name, old, data: cache9 };
16809
+ staticCache2 = isOld2(data2) ? migrate2(file, data2) : format3(data2);
16810
+ dynamicCache2 = staticCache2;
16811
+ const options = { file: name, old, data: dynamicCache2 };
16799
16812
  listeners.emit(FILE_CHANGE, options);
16800
16813
  listeners.emit(`${FILE_CHANGE}:${name}`, options);
16801
16814
  }, { type: "json" });
16802
- clearCache(DATA, count2, cache9);
16815
+ clearCache(count2, staticCache2, dynamicCache2);
16803
16816
  };
16804
- privates = () => cache9;
16817
+ privates = () => dynamicCache2;
16805
16818
  getFriendCfg = (userId, selfId) => {
16806
16819
  const keys = [`Bot:${selfId}:${userId}`, `Bot:${selfId}`, userId, "default"];
16807
16820
  return getCfg2(keys);
@@ -17022,39 +17035,39 @@ var init_template = __esm({
17022
17035
  });
17023
17036
 
17024
17037
  // src/adapter/render/admin/cache.ts
17025
- var index4, cache10, registerRender, unregisterRender, getRender, callRender, getRenderCount, getRenderList, renderHtml, renderMultiHtml, RenderCache, render, Renderer;
17038
+ var index4, cache8, registerRender, unregisterRender, getRender, callRender, getRenderCount, getRenderList, renderHtml, renderMultiHtml, RenderCache, render, Renderer;
17026
17039
  var init_cache3 = __esm({
17027
17040
  "src/adapter/render/admin/cache.ts"() {
17028
17041
  index4 = 0;
17029
- cache10 = [];
17042
+ cache8 = [];
17030
17043
  registerRender = (id, render4) => {
17031
17044
  const i = ++index4;
17032
- cache10.push({ index: i, id, render: render4 });
17045
+ cache8.push({ index: i, id, render: render4 });
17033
17046
  logger.mark(`[render:${index4}] ${logger.green("\u6CE8\u518C\u6210\u529F")}: ${id}`);
17034
17047
  return i;
17035
17048
  };
17036
17049
  unregisterRender = (index6) => {
17037
- const app4 = cache10.find((app5) => app5.index === index6);
17050
+ const app4 = cache8.find((app5) => app5.index === index6);
17038
17051
  if (!app4) {
17039
17052
  logger.error(`[render] \u5378\u8F7D\u5931\u8D25: \u4E0D\u5B58\u5728\u7D22\u5F15 ${index6}`);
17040
17053
  return false;
17041
17054
  }
17042
- cache10.splice(cache10.findIndex((app5) => app5.index === index6), 1);
17055
+ cache8.splice(cache8.findIndex((app5) => app5.index === index6), 1);
17043
17056
  logger.mark(`[render] ${logger.yellow("\u5378\u8F7D\u6210\u529F")}: ${app4.id}`);
17044
17057
  return true;
17045
17058
  };
17046
17059
  getRender = (id) => {
17047
- if (cache10.length === 0) throw new Error("[\u8C03\u7528\u6E32\u67D3\u5668\u5931\u8D25] \u6E32\u67D3\u5668\u5217\u8868\u4E3A\u7A7A");
17060
+ if (cache8.length === 0) throw new Error("[\u8C03\u7528\u6E32\u67D3\u5668\u5931\u8D25] \u6E32\u67D3\u5668\u5217\u8868\u4E3A\u7A7A");
17048
17061
  if (!id) {
17049
- const app5 = cache10[Math.floor(Math.random() * cache10.length)];
17062
+ const app5 = cache8[Math.floor(Math.random() * cache8.length)];
17050
17063
  return app5;
17051
17064
  }
17052
17065
  if (typeof id === "number") {
17053
- const app5 = cache10.find((app6) => app6.index === id);
17066
+ const app5 = cache8.find((app6) => app6.index === id);
17054
17067
  if (!app5) throw new Error(`[\u8C03\u7528\u6E32\u67D3\u5668\u5931\u8D25] \u672A\u627E\u5230\u6E32\u67D3\u5668\uFF1A${id}`);
17055
17068
  return app5;
17056
17069
  }
17057
- const app4 = cache10.find((app5) => app5.id === id);
17070
+ const app4 = cache8.find((app5) => app5.id === id);
17058
17071
  if (!app4) throw new Error(`[\u8C03\u7528\u6E32\u67D3\u5668\u5931\u8D25] \u672A\u627E\u5230\u6E32\u67D3\u5668\uFF1A${id}`);
17059
17072
  return app4;
17060
17073
  };
@@ -17063,9 +17076,9 @@ var init_cache3 = __esm({
17063
17076
  const result = await res.render(Object.assign(options, { encoding: "base64" }));
17064
17077
  return result;
17065
17078
  };
17066
- getRenderCount = () => cache10.length;
17079
+ getRenderCount = () => cache8.length;
17067
17080
  getRenderList = () => {
17068
- const list2 = cache10.map((app4) => app4);
17081
+ const list2 = cache8.map((app4) => app4);
17069
17082
  return list2;
17070
17083
  };
17071
17084
  renderHtml = (data) => {
@@ -17278,9 +17291,9 @@ var init_client2 = __esm({
17278
17291
  });
17279
17292
  };
17280
17293
  disconnectSnapkaClient = (url) => {
17281
- const cache12 = snapkaMap.get(url);
17282
- if (!cache12) return;
17283
- cache12.close();
17294
+ const cache10 = snapkaMap.get(url);
17295
+ if (!cache10) return;
17296
+ cache10.close();
17284
17297
  snapkaMap.delete(url);
17285
17298
  };
17286
17299
  addSnapkaClient = (clientOptions) => {
@@ -17461,7 +17474,7 @@ var init_snapka = __esm({
17461
17474
  });
17462
17475
 
17463
17476
  // src/utils/config/file/render.ts
17464
- var cache11, format4, initRender, render2, getRenderCfg, render_default;
17477
+ var cache9, format4, initRender, render2, getRenderCfg, render_default;
17465
17478
  var init_render = __esm({
17466
17479
  "src/utils/config/file/render.ts"() {
17467
17480
  init_watch();
@@ -17487,9 +17500,9 @@ var init_render = __esm({
17487
17500
  const name = "render.json";
17488
17501
  const file = `${dir2}/${name}`;
17489
17502
  const data = requireFileSync(file, { type: "json" });
17490
- cache11 = format4(data);
17503
+ cache9 = format4(data);
17491
17504
  watch(file, async (old, data2) => {
17492
- cache11 = format4(data2);
17505
+ cache9 = format4(data2);
17493
17506
  const wsClient = diffArray(
17494
17507
  Array.isArray(old?.ws_client) ? old?.ws_client : [],
17495
17508
  Array.isArray(data2?.ws_client) ? data2?.ws_client : []
@@ -17508,13 +17521,13 @@ var init_render = __esm({
17508
17521
  );
17509
17522
  httpServer.removed.forEach((v) => disconnectSnapkaHttp2(v.url));
17510
17523
  httpServer.added.forEach((v) => createSnapkaHttp2(v));
17511
- const options = { file: name, old, data: cache11 };
17524
+ const options = { file: name, old, data: cache9 };
17512
17525
  listeners.emit(FILE_CHANGE, options);
17513
17526
  listeners.emit(`${FILE_CHANGE}:${name}`, options);
17514
17527
  }, { type: "json" });
17515
17528
  };
17516
- render2 = () => cache11;
17517
- getRenderCfg = () => cache11;
17529
+ render2 = () => cache9;
17530
+ getRenderCfg = () => cache9;
17518
17531
  render_default = initRender;
17519
17532
  }
17520
17533
  });
@@ -19209,7 +19222,7 @@ var init_load = __esm({
19209
19222
  } else if (Array.isArray(pkg2.pkgData.karin?.files)) {
19210
19223
  files.push(...pkg2.pkgData.karin.files);
19211
19224
  }
19212
- await createPluginDir(pkg2.name.replace(/\//g, "-"), files);
19225
+ await createPluginDir(pkg2.name, files);
19213
19226
  debug("debug: createPluginDir", pkg2.name, files);
19214
19227
  pkg2.apps.forEach((app4) => {
19215
19228
  const promise = async () => {
@@ -22614,9 +22627,9 @@ var init_list2 = __esm({
22614
22627
  init_redis();
22615
22628
  getDependenciesListRouter = async (req, res) => {
22616
22629
  try {
22617
- const cache12 = await getCache(req, res);
22618
- if (cache12) {
22619
- return createSuccessResponse(res, cache12);
22630
+ const cache10 = await getCache(req, res);
22631
+ if (cache10) {
22632
+ return createSuccessResponse(res, cache10);
22620
22633
  }
22621
22634
  const { stdout, error } = await exec("pnpm list --depth=0 --json");
22622
22635
  if (error) {
@@ -22725,9 +22738,9 @@ var init_list2 = __esm({
22725
22738
  return null;
22726
22739
  }
22727
22740
  const { redis: redis3 } = await Promise.resolve().then(() => (init_redis3(), redis_exports));
22728
- const cache12 = await redis3.get(REDIS_DEPENDENCIES_LIST_CACHE_KEY);
22729
- if (cache12) {
22730
- const data = JSON.parse(cache12);
22741
+ const cache10 = await redis3.get(REDIS_DEPENDENCIES_LIST_CACHE_KEY);
22742
+ if (cache10) {
22743
+ const data = JSON.parse(cache10);
22731
22744
  if (!Array.isArray(data)) {
22732
22745
  await redis3.del(REDIS_DEPENDENCIES_LIST_CACHE_KEY);
22733
22746
  return null;
@@ -23300,9 +23313,9 @@ var init_market2 = __esm({
23300
23313
  const list2 = [];
23301
23314
  const isForce = Boolean(req.body.refresh ?? false);
23302
23315
  if (!isForce) {
23303
- const cache12 = await getCache2();
23304
- if (cache12) {
23305
- return createSuccessResponse(res, JSON.parse(cache12));
23316
+ const cache10 = await getCache2();
23317
+ if (cache10) {
23318
+ return createSuccessResponse(res, JSON.parse(cache10));
23306
23319
  }
23307
23320
  }
23308
23321
  const [
@@ -23321,8 +23334,8 @@ var init_market2 = __esm({
23321
23334
  };
23322
23335
  getCache2 = async () => {
23323
23336
  const { redis: redis3 } = await Promise.resolve().then(() => (init_redis3(), redis_exports));
23324
- const cache12 = await redis3.get(REDIS_PLUGIN_MARKET_LIST_CACHE_KEY);
23325
- return cache12;
23337
+ const cache10 = await redis3.get(REDIS_PLUGIN_MARKET_LIST_CACHE_KEY);
23338
+ return cache10;
23326
23339
  };
23327
23340
  setCache2 = async (data) => {
23328
23341
  const { redis: redis3 } = await Promise.resolve().then(() => (init_redis3(), redis_exports));
@@ -0,0 +1 @@
1
+ import{j as t}from"./vendor-react-Hg1DVPZt.js";import{P as r}from"./components-AQsFMN7-.js";import"./vendor-others-B6NXaB-r.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-5rYIvRjL.js";import"./vendor-heroui-BYc15sbq.js";import"./page-dashboard-BMR0KJUA.js";import"./hooks-C1liScQm.js";import"./utils-C1_eVtU6.js";import"./vendor-visual-mzxhMYK3.js";const x=()=>t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx(r,{})});export{x as default};
@@ -1,2 +1,2 @@
1
- import{V as p}from"./vendor-react-Hg1DVPZt.js";import{a5 as g}from"./components-9RKTV4LX.js";const k=async(t,n,e,r)=>{const{setIsLogModalOpen:i,setTaskId:c,setTaskLogs:o,setTaskName:f}=n;f("更新插件");const a=["开始创建更新任务...",`options: ${JSON.stringify(t)}`];o(a);try{const s=await g(t);if(s.success&&s.taskId)c(s.taskId),o([...a,`
1
+ import{V as p}from"./vendor-react-Hg1DVPZt.js";import{a5 as g}from"./components-AQsFMN7-.js";const k=async(t,n,e,r)=>{const{setIsLogModalOpen:i,setTaskId:c,setTaskLogs:o,setTaskName:f}=n;f("更新插件");const a=["开始创建更新任务...",`options: ${JSON.stringify(t)}`];o(a);try{const s=await g(t);if(s.success&&s.taskId)c(s.taskId),o([...a,`
2
2
  任务创建成功!`,`任务ID: ${s.taskId}`,"正在连接任务执行日志..."]),i(!0),typeof e=="function"&&e(),typeof r=="function"&&r();else throw new Error(s.message||"未知错误")}catch(s){console.error("更新失败:",s),p.error(`更新失败: ${s.message}`)}};export{k as c};
@@ -14,21 +14,21 @@
14
14
  content="viewport-fit=cover, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
15
15
  name="viewport" />
16
16
  <link href="/web/assets/ico/favicon-BoqZd694.ico" rel="icon" />
17
- <script type="module" crossorigin src="/web/assets/js/entry-CzDSdA4M.js"></script>
17
+ <script type="module" crossorigin src="/web/assets/js/entry-UpjOQl3S.js"></script>
18
18
  <link rel="modulepreload" crossorigin href="/web/assets/js/vendor-editor-B8hjWfkw.js">
19
19
  <link rel="modulepreload" crossorigin href="/web/assets/js/vendor-others-B6NXaB-r.js">
20
20
  <link rel="modulepreload" crossorigin href="/web/assets/js/vendor-ui-utils-5rYIvRjL.js">
21
21
  <link rel="modulepreload" crossorigin href="/web/assets/js/vendor-react-Hg1DVPZt.js">
22
- <link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-WfpTlnyv.js">
23
- <link rel="modulepreload" crossorigin href="/web/assets/js/hooks-D65eaS4p.js">
22
+ <link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-BYc15sbq.js">
23
+ <link rel="modulepreload" crossorigin href="/web/assets/js/hooks-C1liScQm.js">
24
24
  <link rel="modulepreload" crossorigin href="/web/assets/js/vendor-visual-mzxhMYK3.js">
25
- <link rel="modulepreload" crossorigin href="/web/assets/js/components-9RKTV4LX.js">
26
- <link rel="modulepreload" crossorigin href="/web/assets/js/utils-DqFE1yN-.js">
27
- <link rel="modulepreload" crossorigin href="/web/assets/js/page-dashboard-BewrlGFW.js">
25
+ <link rel="modulepreload" crossorigin href="/web/assets/js/components-AQsFMN7-.js">
26
+ <link rel="modulepreload" crossorigin href="/web/assets/js/utils-C1_eVtU6.js">
27
+ <link rel="modulepreload" crossorigin href="/web/assets/js/page-dashboard-BMR0KJUA.js">
28
28
  <link rel="stylesheet" crossorigin href="/web/assets/css/vendor-editor-CFbL2ovg.css">
29
29
  <link rel="stylesheet" crossorigin href="/web/assets/css/vendor-others-ZgkIHsf0.css">
30
30
  <link rel="stylesheet" crossorigin href="/web/assets/css/components-ep7vm38G.css">
31
- <link rel="stylesheet" crossorigin href="/web/assets/css/index-2KMNnJRA.css">
31
+ <link rel="stylesheet" crossorigin href="/web/assets/css/index-CZ_28tSH.css">
32
32
  </head>
33
33
 
34
34
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "1.8.13",
3
+ "version": "1.9.1",
4
4
  "description": "Lightweight, efficient, concise, and stable robot framework.",
5
5
  "keywords": [
6
6
  "node",
@@ -1 +0,0 @@
1
- import{j as t}from"./vendor-react-Hg1DVPZt.js";import{P as r}from"./components-9RKTV4LX.js";import"./vendor-others-B6NXaB-r.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-5rYIvRjL.js";import"./vendor-heroui-WfpTlnyv.js";import"./page-dashboard-BewrlGFW.js";import"./hooks-D65eaS4p.js";import"./utils-DqFE1yN-.js";import"./vendor-visual-mzxhMYK3.js";const x=()=>t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx(r,{})});export{x as default};