@vrs-soft/wecom-aibot-mcp 3.2.1 → 3.2.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/dist/channel-server.js +9 -7
- package/package.json +1 -1
package/dist/channel-server.js
CHANGED
|
@@ -585,12 +585,6 @@ function registerChannelTools(server) {
|
|
|
585
585
|
// ============================================
|
|
586
586
|
// 工具 4a: CC 间通信 — send_to_cc / list_active_ccs(v2.6.0+)
|
|
587
587
|
// ============================================
|
|
588
|
-
server.tool('send_thinking', 'wecom 流式回复占位符。在用户原会话气泡里追加"思考中"文字,让用户立即看到反馈。仅对最近 60s 的 msgid 有效。', {
|
|
589
|
-
cc_id: z.string().describe('自己的 CC 标识'),
|
|
590
|
-
msgid: z.string().describe('用户消息的 msgid(来自 channel notification meta.msgid)'),
|
|
591
|
-
content: z.string().optional().describe('占位文字,默认"💭 正在处理..."'),
|
|
592
|
-
finished: z.boolean().optional().describe('是否最终回复'),
|
|
593
|
-
}, async (params) => forwardToHttpMcp('send_thinking', params));
|
|
594
588
|
server.tool('send_to_cc', '向同一 daemon 上的另一个 CC 发送消息。目标 CC 收到时会作为 <channel source="cc:..."> 推送唤醒。仅支持同 daemon 间互通。支持 attachments 内联小文档(每个 < 16 KB);大文档请改用 upload_document。', {
|
|
595
589
|
cc_id: z.string().describe('自己的 CC 标识'),
|
|
596
590
|
to_cc: z.string().describe('目标 CC 标识'),
|
|
@@ -663,6 +657,14 @@ function registerChannelTools(server) {
|
|
|
663
657
|
cc_id: z.string().describe('自己的 CC 标识(必须 = 文档的 to_cc)'),
|
|
664
658
|
doc_id: z.string().describe('文档 ID'),
|
|
665
659
|
}, async (params) => forwardToHttpMcp('get_document_info', params));
|
|
660
|
+
server.tool('delete_shared_file', '删除共享文件。仅 owner 可删。', {
|
|
661
|
+
cc_id: z.string().describe('自己的 CC 标识(必须 = owner)'),
|
|
662
|
+
file_id: z.string().describe('共享文件 ID'),
|
|
663
|
+
}, async (params) => forwardToHttpMcp('delete_shared_file', params));
|
|
664
|
+
server.tool('delete_document', '删除点对点文档。fromCc 或 toCc 任一方可删。', {
|
|
665
|
+
cc_id: z.string().describe('自己的 CC 标识(必须 = fromCc 或 toCc)'),
|
|
666
|
+
doc_id: z.string().describe('文档 ID'),
|
|
667
|
+
}, async (params) => forwardToHttpMcp('delete_document', params));
|
|
666
668
|
server.tool('get_shared_file_info', '查询单个共享文件的元数据(不返回 content)。共享池无权限校验,任何 CC 都可查。', {
|
|
667
669
|
cc_id: z.string().describe('自己的 CC 标识'),
|
|
668
670
|
file_id: z.string().describe('共享文件 ID'),
|
|
@@ -1000,7 +1002,7 @@ export async function startChannelServer() {
|
|
|
1000
1002
|
tools: {},
|
|
1001
1003
|
},
|
|
1002
1004
|
// 告知 Claude 如何处理 channel 事件
|
|
1003
|
-
instructions: '企业微信消息通过 <channel> 标签推送。属性说明:from=发送者userid, chatid=会话ID(单聊=用户ID,群聊=群ID), chattype=single|group, cc_id
|
|
1005
|
+
instructions: '企业微信消息通过 <channel> 标签推送。属性说明:from=发送者userid, chatid=会话ID(单聊=用户ID,群聊=群ID), chattype=single|group, cc_id=当前会话标识。【强制规则1·用户消息】daemon 已经代你给用户发了"💭 收到/听到了,正在处理..."回执,agent 不需要再发送 ack,**直接处理任务**,处理完后用 send_message(cc_id, "【完成】...", target_user=chatid) 报结果即可。【强制规则2·CC 间文档】收到 <channel kind="document"> 通知(cc_document_notify)时,禁止擅自落盘:1) 立即 send_message 告知用户("CC <from_cc> 想发送文件「<title>」(<size>, <mime_type>),是否接收?"),target_user 取当前 cc 的 chatid;2) 等用户明确肯定回复(是/接受/yes/同意等);3) 同意后调 download_document_to_path(cc_id, doc_id, save_path) 落盘(save_path 推荐 {projectDir}/received-file/<title>,目录会自动创建);4) 发送完成消息并附 saved_path;拒绝则忽略 doc_id 不调任何下载工具。共享池 share_file_from_path/download_shared_file_to_path 为 pull 模型,agent 主动决定,无需询问。【重要】发送/接收文件请用 *_from_file / *_to_path 系列(文件字节走 channel-server 本地 fs + HTTP,不进 LLM context);旧的 upload_document/fetch_document/accept_document 仍可用但仅适合小内容(< 16KB),远端 daemon 部署下 accept_* 与 file_path 模式不可用。',
|
|
1004
1006
|
});
|
|
1005
1007
|
// 注册工具
|
|
1006
1008
|
registerChannelTools(mcpServer);
|