@vrs-soft/wecom-aibot-mcp 3.4.0 → 3.4.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/dist/channel-server.js +10 -1
- package/dist/config-wizard.d.ts +1 -0
- package/dist/config-wizard.js +7 -0
- package/package.json +1 -1
package/dist/channel-server.js
CHANGED
|
@@ -14,7 +14,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
14
14
|
import { z } from 'zod';
|
|
15
15
|
import * as fs from 'fs';
|
|
16
16
|
import * as path from 'path';
|
|
17
|
-
import { VERSION, installSkill } from './config-wizard.js';
|
|
17
|
+
import { VERSION, installSkill, ensureHookFiles } from './config-wizard.js';
|
|
18
18
|
import { addPermissionHook, registerActiveProject, unregisterActiveProject, updateWechatModeConfig, loadWechatModeConfig } from './project-config.js';
|
|
19
19
|
import { findClaudePid } from './platform.js';
|
|
20
20
|
import { logger } from './logger.js';
|
|
@@ -860,6 +860,15 @@ function registerChannelTools(server) {
|
|
|
860
860
|
connectSSE(parsed.ccId);
|
|
861
861
|
// Channel 模式:在本地项目写入 PermissionRequest hook
|
|
862
862
|
const localProjectDir = project_dir || process.cwd();
|
|
863
|
+
// v3.4.0: 先确保 ~/.wecom-aibot-mcp/permission-hook.mjs 存在
|
|
864
|
+
// (addPermissionHook 只往项目 settings.json 写命令,不装文件;
|
|
865
|
+
// 没装文件的话 Claude TUI 执行 hook 命令会 ENOENT)
|
|
866
|
+
try {
|
|
867
|
+
ensureHookFiles();
|
|
868
|
+
}
|
|
869
|
+
catch (e) {
|
|
870
|
+
logger.error('ensureHookFiles 失败', { error: String(e) });
|
|
871
|
+
}
|
|
863
872
|
const hookResult = addPermissionHook(localProjectDir);
|
|
864
873
|
logger.info('本地 PermissionRequest hook 已写入', { path: hookResult.path, success: hookResult.success });
|
|
865
874
|
// 注册 Claude TUI 的 PID(不能用 process.ppid,npx 部署时 ppid 是 npx 不是 Claude)
|
package/dist/config-wizard.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare function deleteHook(): void;
|
|
|
5
5
|
export declare function deleteSkills(): void;
|
|
6
6
|
export declare function uninstall(): void;
|
|
7
7
|
export declare function ensureHookInstalled(): void;
|
|
8
|
+
export declare function ensureHookFiles(): void;
|
|
8
9
|
export type InstallMode = 'channel-only' | 'remote' | 'remote-channel';
|
|
9
10
|
export declare function getInstalledMode(): {
|
|
10
11
|
mode?: InstallMode;
|
package/dist/config-wizard.js
CHANGED
|
@@ -266,6 +266,13 @@ export function ensureHookInstalled() {
|
|
|
266
266
|
writeMcpPermissions();
|
|
267
267
|
writeStopHookScript();
|
|
268
268
|
}
|
|
269
|
+
// v3.4.0: 只装 hook 文件本身(不动 ~/.claude/settings.local.json),
|
|
270
|
+
// 供 channel-server enter_headless_mode 在写项目级 settings.json 前
|
|
271
|
+
// 确保 ~/.wecom-aibot-mcp/permission-hook.mjs 真实存在
|
|
272
|
+
export function ensureHookFiles() {
|
|
273
|
+
writeHookScript();
|
|
274
|
+
writeStopHookScript();
|
|
275
|
+
}
|
|
269
276
|
// 读取上次安装的模式 + 远程参数(来自 version.json)
|
|
270
277
|
export function getInstalledMode() {
|
|
271
278
|
if (!fs.existsSync(VERSION_FILE))
|