node-karin 1.16.1 → 1.16.3

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,20 @@
1
1
  # 更新日志
2
2
 
3
+ ## [1.16.3](https://github.com/KarinJS/Karin/compare/core-v1.16.2...core-v1.16.3) (2026-07-07)
4
+
5
+
6
+ ### 🐛 Bug Fixes
7
+
8
+ * web配置组件,手风琴子项内部分配置组件无法正常渲染嵌套字段 ([#664](https://github.com/KarinJS/Karin/issues/664)) ([03ff932](https://github.com/KarinJS/Karin/commit/03ff932e9f901e4a95cbb08b4ebc34aad9051215))
9
+
10
+ ## [1.16.2](https://github.com/KarinJS/Karin/compare/core-v1.16.1...core-v1.16.2) (2026-07-04)
11
+
12
+
13
+ ### 🐛 Bug Fixes
14
+
15
+ * fix ([#661](https://github.com/KarinJS/Karin/issues/661)) ([ab4c96d](https://github.com/KarinJS/Karin/commit/ab4c96d7b951f14028ab64c628088b12a5b6d3eb))
16
+ * 优化获取web.config路径的逻辑,简化代码结构 ([#663](https://github.com/KarinJS/Karin/issues/663)) ([6ce06d5](https://github.com/KarinJS/Karin/commit/6ce06d536f9e86250ef9b8fe448da21fe2de94ac))
17
+
3
18
  ## [1.16.1](https://github.com/KarinJS/Karin/compare/core-v1.16.0...core-v1.16.1) (2026-06-11)
4
19
 
5
20
 
package/README.md CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  一键初始化:`pnpm create karin`
30
30
 
31
- > 当前文档可能存在滞后性,欢迎加入交流群(967068507)一起玩耍、提建议!
31
+ > 当前文档可能存在滞后性,欢迎加入交流群(850541480)一起玩耍、提建议!
32
32
 
33
33
  ## 温馨提示
34
34
 
@@ -78,7 +78,7 @@ Thanks to [valqelyan](https://github.com/valqelyan) for transferring the `karin`
78
78
 
79
79
  ## 常见问题
80
80
 
81
- - 文档没看懂?[点我提问](https://github.com/KarinJS/Karin/issues) 或加群 967068507
81
+ - 文档没看懂?[点我提问](https://github.com/KarinJS/Karin/issues) 或加群 850541480
82
82
  - 插件不会写?欢迎参考[插件开发文档](https://karinjs.com/guide/index/)
83
83
  - 遇到 bug?大胆提 Issue,我们超快响应!
84
84
 
@@ -27,7 +27,7 @@ var AdapterConsole = class extends AdapterBase {
27
27
  this.account.uid = botID;
28
28
  this.account.uin = botID;
29
29
  this.account.selfId = botID;
30
- this.account.avatar = "https://p.qlogo.cn/gh/967068507/967068507/0";
30
+ this.account.avatar = "https://p.qlogo.cn/gh/850541480/850541480/0";
31
31
  listeners.emit("karin:adapter:open");
32
32
  }
33
33
  get selfId() {
@@ -144,11 +144,11 @@ var AdapterConsole = class extends AdapterBase {
144
144
  return `http://127.0.0.1:${process.env.HTTP_PORT}/api/v1/console/${name}${ext}?token=${cfg.console.token}`;
145
145
  }
146
146
  async getAvatarUrl(userId, _) {
147
- if (userId === botID) return process.env.ADAPTER_CONSOLE_AVATAR || "https://p.qlogo.cn/gh/967068507/967068507/0";
147
+ if (userId === botID) return process.env.ADAPTER_CONSOLE_AVATAR || "https://p.qlogo.cn/gh/850541480/850541480/0";
148
148
  return "";
149
149
  }
150
150
  async getGroupAvatarUrl(_, __, ___) {
151
- return "https://p.qlogo.cn/gh/967068507/967068507/0";
151
+ return "https://p.qlogo.cn/gh/850541480/850541480/0";
152
152
  }
153
153
  async recallMsg(_, messageId) {
154
154
  logger.info(`[recallMsg] ${messageId}`);
@@ -3552,18 +3552,21 @@ const defaultWebConfig = (exists, path, customComponent, defaultComponent, page,
3552
3552
  * 获取web.config文件绝对路径
3553
3553
  */
3554
3554
  const getWebConfigPath = (plugin) => {
3555
- const dev = isDev();
3556
3555
  const pkg = plugin.pkgData;
3557
- if (!pkg.karin?.web) return null;
3558
- if (dev) {
3559
- if (!pkg.karin["ts-web"]) return null;
3560
- const filepath = path$1.join(plugin.dir, pkg.karin["ts-web"]);
3561
- if (!fs$1.existsSync(filepath)) return null;
3562
- return filepath;
3556
+ if (!pkg?.karin) return null;
3557
+ const getPath = (value) => {
3558
+ if (typeof value !== "string" || !value) return null;
3559
+ const filepath = path$1.join(plugin.dir, value);
3560
+ return fs$1.existsSync(filepath) ? filepath : null;
3561
+ };
3562
+ /** npm插件处于安装态,即使开发环境也应读取发布产物 */
3563
+ if (plugin.type === "npm" || plugin.dir.includes("node_modules")) return getPath(pkg.karin.web);
3564
+ /** 本地源码插件在TS运行时优先读取ts-web */
3565
+ if (isTs()) {
3566
+ const filepath = getPath(pkg.karin["ts-web"]);
3567
+ if (filepath) return filepath;
3563
3568
  }
3564
- const filepath = path$1.join(plugin.dir, pkg.karin.web);
3565
- if (!fs$1.existsSync(filepath)) return null;
3566
- return filepath;
3569
+ return getPath(pkg.karin.web);
3567
3570
  };
3568
3571
  /**
3569
3572
  * 存在web.config文件 获取更多信息
@@ -4098,7 +4101,7 @@ const web = (dir) => {
4098
4101
  * @param host 监听地址
4099
4102
  */
4100
4103
  const initExpress = async (dir, port, host) => {
4101
- await import("./ws-BLDoC2gV.mjs");
4104
+ await import("./ws-DSm9WQk_.mjs");
4102
4105
  app.use(BASE_ROUTER, router);
4103
4106
  app.get("/", rootRouter);
4104
4107
  web(dir);
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./chunk-NzVPYdc1.mjs";
2
2
  import root_default, { basePath, commentPath, configPath, consolePath, dataPath, dbPath, defaultConfigPath, defaultViewPath, htmlPath, isPackaged, isPkg, karinDir, karinMain, karinPathBase, karinPathComment, karinPathConfig, karinPathConsole, karinPathData, karinPathDb, karinPathDefaultConfig, karinPathDefaultView, karinPathHtml, karinPathKv, karinPathLogs, karinPathMain, karinPathPlugins, karinPathPm2Config, karinPathRedisSqlite3, karinPathResource, karinPathRoot, karinPathSandboxData, karinPathSandboxTemp, karinPathTaskDb, karinPathTemp, kvPath, logsPath, pluginDir, pm2Path, redisSqlite3Path, resourcePath, sandboxDataPath, sandboxTempPath, tempPath } from "./root.mjs";
3
3
  import { $ as createBotOfflineNotice, $r as yaml, $t as PrivateFileUploadedNotice, A as getAllBotID, An as getRemotePkgVersion, Ar as makeMessage, At as GroupInviteRequest, B as createMessage, Bn as uptime, Br as log, Bt as GroupHonorChangedNotice, C as taskGet, Ci as pkg, Cn as restart, Cr as buildError, Ct as createGuildMessage, D as updateTaskLogs, Di as requireFileSync, Dn as getCommit, Dr as getFileMessage, Dt as createPrivateRecallNotice, E as taskUpdateStatus, Ei as requireFile, En as checkPkgUpdate, Er as formatLogString, Et as createPrivatePokeNotice, F as sendMsg, Fi as setVersion, Fn as updatePkg, Ft as FriendIncreaseNotice, G as contactGroupTemp, Gn as isLoopback, Gr as lockMethod, Gt as GroupMemberTitleUpdatedNotice, H as contactDirect, Hn as isIPv4Loop, Hr as parseChangelog, Ht as GroupMemberBanNotice, I as unregisterBot, In as importModule, It as GroupAdminChangedNotice, J as senderDirect, Jn as ffprobe, Jr as applyComments, Jt as GroupPokeNotice, K as contactGuild, Kn as ffmpeg, Kr as lockProp, Kt as GroupMessageReactionNotice, L as sendMsg$1, Ln as imports, Lr as fs_exports$1, Lt as GroupCardChangedNotice, M as getBot, Mn as updateAllGitPlugin, Mt as RequestBase, N as getBotCount, Nn as updateAllPkg, Nr as AdapterBase, Nt as BotOfflineNotice, O as updateTaskStatus, Oi as getModuleType, On as getHash, Or as createRawMessage, Ot as createReceiveLikeNotice, P as registerBot, Pi as setRuntime, Pn as updateGitPlugin, Pr as cacheMap, Pt as FriendDecreaseNotice, Q as senderGuild, Qr as write, Qt as NoticeBase, R as createRequest, Rn as isClass, Rr as fs_exports, Rt as GroupFileUploadedNotice, S as taskExists, Si as defaultConfig, Sn as handler, Sr as KarinConvertAdapter, St as createGroupWholeBanNotice, T as taskUpdateLogs, Ti as clearRequireFile, Tn as checkGitPluginUpdate, Tr as fileToBase64, Tt as createPrivateFileUploadedNotice, U as contactFriend, Un as isIPv6Loop, Ur as range, Ut as GroupMemberDecreaseNotice, V as contact, Vn as getRequestIp, Vr as logs, Vt as GroupLuckKingNotice, W as contactGroup, Wn as isLocalRequest, Wr as lock, Wt as GroupMemberIncreaseNotice, X as senderGroup, Xn as eventCall, Xr as read, Xt as GroupSignInNotice, Y as senderFriend, Yn as empty, Yr as comment, Yt as GroupRecallNotice, Z as senderGroupTemp, Zn as config_exports, Zr as save, Zt as GroupWholeBanNotice, _ as taskSystem, _i as mkdir, _r as createResponse, _t as createGroupMessageReactionNotice, ai as readJsonSync, an as GroupMessage, at as createGroupApplyRequest, b as setTaskDatabase, bi as watch, bn as fileToUrl, br as createUnauthorizedResponse, bt as createGroupSignInNotice, ci as base64, cn as MessageBase, ct as createGroupHlightsChangedNotice, d as createOneBotClient, di as readFile, dn as ctx$1, dr as createBadRequestResponse, dt as createGroupLuckKingNotice, ei as getPluginInfo, en as PrivatePokeNotice, et as createDirectMessage, f as createOneBotHttp, fi as stream, fn as common_exports, fr as createForbiddenResponse, ft as createGroupMemberAddNotice, g as initTaskSystem, gi as isFile, gr as createRefreshTokenExpiredResponse, gt as createGroupMessage, h as AdapterOneBot, hi as isDir, hn as getPlugins, hr as createPayloadTooLargeResponse, ht as createGroupMemberTitleUpdatedNotice, ii as readJson, in as FriendMessage, it as createGroupAdminChangedNotice, j as getAllBotList, jn as getTime, jr as segment_exports, jt as PrivateApplyRequest, k as getAllBot, ki as isDev, kn as getPkgVersion, kr as makeForward, kt as GroupApplyRequest, l as master, li as buffer, ln as BaseEvent, lr as HTTPStatusCode, lt as createGroupHonorChangedNotice, m as disconnectAllOneBotServer, mi as exists, mn as qqbotToKarin, mr as createNotFoundResponse, mt as createGroupMemberDelNotice, ni as pkgRoot, nn as ReceiveLikeNotice, nt as createFriendIncreaseNotice, oi as writeJson, on as GroupTempMessage, ot as createGroupCardChangedNotice, p as createOneBotWsServer, pi as existToMkdir, pn as karinToQQBot, pr as createMethodNotAllowedResponse, pt as createGroupMemberBanNotice, q as sender, qn as ffplay, qr as YamlEditor, qt as GroupNotice, ri as json, rn as DirectMessage, rt as createFriendMessage, s as admin, si as writeJsonSync, sn as GuildMessage, st as createGroupFileUploadedNotice, t as initConfigCache, ti as isPlugin, tn as PrivateRecallNotice, tt as createFriendDecreaseNotice, u as adapter, ui as randomStr, un as message, ur as createAccessTokenExpiredResponse, ut as createGroupInviteRequest, v as createTaskDatabase, vi as Watch, vn as system_exports, vr as createServerErrorResponse, vt as createGroupPokeNotice, w as taskList, wi as clearRequire, wn as restartDirect, wr as convertOneBotMessageToKarin, wt as createPrivateApplyRequest, x as taskAdd, xi as watchAndMerge, xn as fileToUrlHandlerKey, xr as AdapterConvertKarin, xt as createGroupTempMessage, y as getTaskDatabase, yi as Watcher, yn as satisfies, yr as createSuccessResponse, yt as createGroupRecallNotice, z as createNotice, zn as formatTime, zr as changelog_exports, zt as GroupHlightsChangedNotice } from "./file-ZGuqNDd-.mjs";
4
- import { _ as getLocalCommitHash, a as authMiddleware, b as ONLINE, c as pkgLoadModule, d as createFile, f as createLogger, g as getLocalBranches, h as getDefaultBranch, i as router, l as pkgLoads, m as gitPull, o as findPkgByFile, p as createPkg, r as server, s as pkgCache, t as app, u as pkgSort, v as getRemoteBranches, y as getRemoteCommitHash } from "./app-DdMQbBEY.mjs";
4
+ import { _ as getLocalCommitHash, a as authMiddleware, b as ONLINE, c as pkgLoadModule, d as createFile, f as createLogger, g as getLocalBranches, h as getDefaultBranch, i as router, l as pkgLoads, m as gitPull, o as findPkgByFile, p as createPkg, r as server, s as pkgCache, t as app, u as pkgSort, v as getRemoteBranches, y as getRemoteCommitHash } from "./app-envEBET_.mjs";
5
5
  import { a as mkdirSync, i as isFileSync, n as existsSync, o as rmSync, r as isDirSync, t as existToMkdirSync } from "./fsSync-Cf5MWILk.mjs";
6
6
  import { a as copyFilesSync, c as downloadFile, d as getFiles, f as sep, i as copyFiles, l as getAllFiles, n as copyConfig, o as createPluginDir, r as copyConfigSync, s as downFile, t as absPath, u as getAllFilesSync } from "./file-dGy9of8-.mjs";
7
7
  import { C as filesByExt, D as isSubPath, E as isPathEqual, O as splitPath, S as cache, T as getRelPath, _ as WS_CONNECTION_SANDBOX, a as BOT_DISCONNECT, b as key_exports, c as RECV_MSG, d as WS_CLOSE_ONEBOT, f as WS_CLOSE_PUPPETEER, g as WS_CONNECTION_PUPPETEER, h as WS_CONNECTION_ONEBOT, i as BOT_CONNECT, k as urlToPath, l as SEND_MSG, m as WS_CONNECTION, n as errorHandler, o as EVENT_COUNT, p as WS_CLOSE_SANDBOX, r as listeners, s as FILE_CHANGE, u as WS_CLOSE, v as WS_CONNECTION_TERMINAL, w as formatPath, x as isPublic, y as WS_SNAPKA } from "./internal-DupfycKE.mjs";
@@ -2098,7 +2098,7 @@ const start = async () => {
2098
2098
  * - 设置静态文件目录
2099
2099
  * - 设置根路径请求
2100
2100
  */
2101
- const { initExpress } = await import("./app-DdMQbBEY.mjs").then((n) => n.n);
2101
+ const { initExpress } = await import("./app-envEBET_.mjs").then((n) => n.n);
2102
2102
  const { initialize } = await import("./terminalManager-Lxa8Sm06.mjs").then((n) => n.a);
2103
2103
  await initExpress(root_default, +process.env.HTTP_PORT, process.env.HTTP_HOST);
2104
2104
  await initTaskSystem(root_default.karinPathTaskDb);
@@ -2112,7 +2112,7 @@ const start = async () => {
2112
2112
  /**
2113
2113
  * 9. 加载适配器
2114
2114
  */
2115
- await import("./adapter-BqlH3u3X.mjs");
2115
+ await import("./adapter-Ct4bCb0r.mjs");
2116
2116
  await initOneBotAdapter();
2117
2117
  await initRender();
2118
2118
  /**
@@ -207960,15 +207960,18 @@ var import_react$70, import_jsx_runtime$53, createSwitch;
207960
207960
  var init_switchs = __esmMin((() => {
207961
207961
  init_dist$39();
207962
207962
  init_utils$21();
207963
+ init_index_esm();
207963
207964
  import_react$70 = /* @__PURE__ */ __toESM$1(require_react(), 1);
207964
207965
  import_jsx_runtime$53 = require_jsx_runtime();
207965
- createSwitch = (props, register) => {
207966
+ createSwitch = (props, control, basePath) => {
207966
207967
  const { componentType: _, key, className, componentClassName, defaultSelected, isDisabled, ...options } = props;
207968
+ const name = basePath ? `${basePath}.${key}.value` : `${key}.value`;
207967
207969
  const [isDescriptionExpanded, setIsDescriptionExpanded] = (0, import_react$70.useState)(false);
207968
207970
  const handleContainerClick = (e) => {
207969
207971
  if (isDisabled) return;
207970
207972
  if (e.target.closest(".description-area")) return;
207971
- document.querySelector(`[data-switch-key="${key}"]`)?.click();
207973
+ if (e.target.closest(".switch-control-area")) return;
207974
+ document.querySelector(`[data-switch-key="${name}"]`)?.click();
207972
207975
  };
207973
207976
  const handleDescriptionClick = (e) => {
207974
207977
  e.stopPropagation();
@@ -207996,15 +207999,23 @@ var init_switchs = __esmMin((() => {
207996
207999
  })]
207997
208000
  })]
207998
208001
  }), /* @__PURE__ */ (0, import_jsx_runtime$53.jsx)("div", {
207999
- className: "absolute right-3 top-1/2 -translate-y-1/2 sm:right-4",
208000
- children: /* @__PURE__ */ (0, import_jsx_runtime$53.jsx)(switch_default, {
208001
- ...options,
208002
- isDisabled,
208003
- "data-switch-key": key,
208004
- className: cn$3(isDisabled ? "cursor-not-allowed" : "cursor-pointer", `data-[selected=true]:border-${options.color || "primary"}`, componentClassName),
208005
- defaultSelected: defaultSelected ?? false,
208006
- ...register(`${key}.value`)
208007
- }, key)
208002
+ className: "switch-control-area absolute right-3 top-1/2 -translate-y-1/2 sm:right-4",
208003
+ children: /* @__PURE__ */ (0, import_jsx_runtime$53.jsx)(Controller, {
208004
+ name,
208005
+ control,
208006
+ defaultValue: defaultSelected ?? false,
208007
+ render: ({ field: { value, onChange, onBlur, name, ref } }) => /* @__PURE__ */ (0, import_jsx_runtime$53.jsx)(switch_default, {
208008
+ ...options,
208009
+ isDisabled,
208010
+ "data-switch-key": name,
208011
+ className: cn$3(isDisabled ? "cursor-not-allowed" : "cursor-pointer", `data-[selected=true]:border-${options.color || "primary"}`, componentClassName),
208012
+ isSelected: value === true,
208013
+ onValueChange: onChange,
208014
+ onBlur,
208015
+ name,
208016
+ ref
208017
+ }, key)
208018
+ })
208008
208019
  })]
208009
208020
  })
208010
208021
  }, key);
@@ -212224,7 +212235,7 @@ var init_render = __esmMin((() => {
212224
212235
  return;
212225
212236
  }
212226
212237
  if (option.componentType === "switch") {
212227
- list.push(createSwitch(option, register));
212238
+ list.push(createSwitch(option, control, basePath));
212228
212239
  return;
212229
212240
  }
212230
212241
  if (option.componentType === "radio-group") {
@@ -215887,7 +215898,7 @@ var init_about = __esmMin((() => {
215887
215898
  children: "Discord"
215888
215899
  }), /* @__PURE__ */ (0, import_jsx_runtime$23.jsx)(button_default$1, {
215889
215900
  as: "a",
215890
- href: "http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=kDN3vwVj8Qozw94TWX69r24vxrWqkgMy&authKey=NxnqHYmo8037jCeDkO9yIFPOdQxkKa4JlxC%2FAV6UNxwGc%2FwKEVoogi44syB3BWuC&noverify=0&group_code=967068507",
215901
+ href: "https://qm.qq.com/q/SgP7WaLTag",
215891
215902
  size: "sm",
215892
215903
  variant: "shadow",
215893
215904
  radius: "full",
@@ -14,7 +14,7 @@
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-Blf4Trpx.js"></script>
17
+ <script type="module" crossorigin src="/web/assets/js/entry-CR8PMgCV.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="/web/assets/css/style-CBB8wM_W.css">
19
19
  </head>
20
20
 
@@ -1,5 +1,5 @@
1
1
  import { i as getRenderCfg } from "./file-ZGuqNDd-.mjs";
2
- import { r as server } from "./app-DdMQbBEY.mjs";
2
+ import { r as server } from "./app-envEBET_.mjs";
3
3
  import { _ as WS_CONNECTION_SANDBOX, d as WS_CLOSE_ONEBOT, f as WS_CLOSE_PUPPETEER, g as WS_CONNECTION_PUPPETEER, h as WS_CONNECTION_ONEBOT, m as WS_CONNECTION, r as listeners, u as WS_CLOSE, v as WS_CONNECTION_TERMINAL, y as WS_SNAPKA } from "./internal-DupfycKE.mjs";
4
4
  import { WebSocketServer } from "ws";
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "1.16.1",
3
+ "version": "1.16.3",
4
4
  "description": "Lightweight, efficient, concise, and stable robot framework.",
5
5
  "keywords": [
6
6
  "node",
@@ -177,7 +177,7 @@
177
177
  "access": "public",
178
178
  "registry": "https://registry.npmjs.org"
179
179
  },
180
- "time": "2026-06-11T07:00:35.219Z",
180
+ "time": "2026-07-07T03:26:08.299Z",
181
181
  "scripts": {
182
182
  ".": "pnpm app",
183
183
  "app": "node dist/start/index.mjs",