Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/08-相关后端项目.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
| `md-html-render` | Markdown/HTML 渲染为图片 | 37632 | 工具 → MCP服务器配置(md-html-render) |
| `mcp-files-exec` | 本地文件读写/执行 | 3910 | 工具 → MCP服务器配置(mcp-files-exec) |

`web-read`、`md-html-render` 与 `mcp-files-exec` 均为 **MCP(Streamable HTTP)** 服务:插件通过「工具 → MCP服务器配置」中的 `mcpServers` 块按标准格式接入(默认 `http://127.0.0.1:46799/mcp`、`http://127.0.0.1:37632/mcp`、`http://127.0.0.1:3910`)。其中 `web-read` / `md-html-render` 由内置包装工具(`web_read` / `render_markdown` / `render_html`)调用,不重复注册为 AI 工具;`mcp-files-exec` 的工具(文件读写/执行)直接注册为 AI 工具。这些后端的 REST 接口已移除,仅提供 MCP。
`web-read`、`md-html-render` 与 `mcp-files-exec` 均为 **MCP(Streamable HTTP)** 服务:插件通过「工具 → MCP服务器配置」中的 `mcpServers` 块按标准格式接入(默认 `http://127.0.0.1:46799/mcp`、`http://127.0.0.1:37632/mcp`、`http://127.0.0.1:3910/mcp`)。其中 `web-read` / `md-html-render` 由内置包装工具(`web_read` / `render_markdown` / `render_html`)调用,不重复注册为 AI 工具;`mcp-files-exec` 的工具(文件读写/执行)直接注册为 AI 工具。这些后端的 REST 接口已移除,仅提供 MCP。

## 部署与一键管理

Expand Down
2 changes: 1 addition & 1 deletion src/config/configs/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class ToolConfig {
"mcpServers": {
"mcp-files-exec": {
"type": "http",
"url": "http://127.0.0.1:3910",
"url": "http://127.0.0.1:3910/mcp",
"headers": {
"Authorization": "Bearer token"
}
Expand Down
14 changes: 11 additions & 3 deletions src/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import User from "../session/user";
import { ToolCall } from "../tool/types";
import { getFriendList, getGroupList, getGroupMemberInfo, getGroupMemberList, getStrangerInfo, netExists } from "../utils/ob11";
import { levenshteinDistance, stripInternalTags } from "../utils/string";
import { TypeDescriptor } from "../utils/utils";
import { TypeDescriptor, withTimeout } from "../utils/utils";

import Message from "./message";
import { AssistantMessage, AssistantMessageItem, MessageType, SystemUserMessageItem, ToolCallbackMessage, ToolCallsMessage, UserMessage, UserMessageItem } from "./types";
Expand Down Expand Up @@ -406,11 +406,19 @@ export class Context {
async updateName(epId: string, gid: string, uid: string) {
switch (this.autoNameMod) {
case 1: {
await this.setName(epId, gid, uid, 'nickname');
try {
await withTimeout(() => this.setName(epId, gid, uid, 'nickname'), 5000);
} catch (e) {
Logger.warning(`自动改名(昵称)失败: ${e instanceof Error ? e.message : String(e)}`);
}
break;
}
case 2: {
await this.setName(epId, gid, uid, 'card');
try {
await withTimeout(() => this.setName(epId, gid, uid, 'card'), 5000);
} catch (e) {
Logger.warning(`自动改名(群名片)失败: ${e instanceof Error ? e.message : String(e)}`);
}
break;
}
}
Expand Down
Loading