@wfm-cn/dsh-mcp-connectors 0.2.0 → 0.2.2
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/README.md +2 -0
- package/client.js +3 -3
- package/index.js +14 -3
- package/package.json +2 -2
package/README.md
CHANGED
package/client.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* @wfm-cn/dsh-mcp-connectors — MCP 连接器中心(Client 侧)
|
|
3
3
|
*
|
|
4
4
|
* - sidebar.panellist 图标 + `main` 面板页(卡片流,hover 出现编辑/开关);
|
|
5
5
|
* - conversation.input.left 会话内连接器选择下拉(向上弹出,按会话生效);
|
|
6
6
|
* - 所有 Host 交互走 ctx.remote['mcp-connectors'].*。
|
|
7
7
|
*/
|
|
8
8
|
window.__ModuleLoader__.load({
|
|
9
|
-
id: '@
|
|
9
|
+
id: '@wfm-cn/dsh-mcp-connectors',
|
|
10
10
|
factory(require) {
|
|
11
11
|
const React = require('react');
|
|
12
12
|
const h = React.createElement;
|
|
@@ -226,7 +226,7 @@ window.__ModuleLoader__.load({
|
|
|
226
226
|
const wsName = (s) => {
|
|
227
227
|
const cwd = String(s.cwd ?? '');
|
|
228
228
|
if (!cwd) return s.live ? '(活跃)' : '';
|
|
229
|
-
const parts = cwd.split(
|
|
229
|
+
const parts = cwd.split(/[\\/]/).filter(Boolean);
|
|
230
230
|
return parts[parts.length - 1] ?? cwd;
|
|
231
231
|
};
|
|
232
232
|
const label = (s) => s.title || s.id;
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* @wfm-cn/dsh-mcp-connectors — MCP 连接器中心(Host 侧)
|
|
3
3
|
*
|
|
4
4
|
* 通道说明:运行期安装的插件拿不到编译期生成的 `remote.*` 命名空间,
|
|
5
5
|
* 因此 Host↔Client 用宿主提供的 HTTP 路由(ctx.webServer.register):
|
|
@@ -231,9 +231,20 @@ export async function apply(ctx, config = {}) {
|
|
|
231
231
|
function stdioClient(c) {
|
|
232
232
|
let cl = STDIO_CLIENTS.get(c.serverName);
|
|
233
233
|
if (cl) return cl;
|
|
234
|
-
|
|
234
|
+
// Windows 上 npx/pnpm 等命令是 .cmd shim,必须经 shell 才能启动;
|
|
235
|
+
// macOS/Linux 不加 shell,避免参数被 shell 二次解析
|
|
236
|
+
const isWin = process.platform === 'win32';
|
|
237
|
+
let command = c.command;
|
|
238
|
+
if (isWin) {
|
|
239
|
+
const s = String(command).trim();
|
|
240
|
+
if (/^(npx|npm|pnpm|yarn|bunx?|uvx?|python3?|node)$/i.test(s)) command = `${s}.cmd`;
|
|
241
|
+
else if (/[\\/ ]/.test(s) && !/\.(cmd|exe|bat|ps1)$/i.test(s)) command = s; // 完整路径交给 shell 解析
|
|
242
|
+
}
|
|
243
|
+
const child = spawn(command, c.args ?? [], {
|
|
235
244
|
env: { ...process.env, ...(c.env ?? {}) },
|
|
236
245
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
246
|
+
shell: isWin,
|
|
247
|
+
windowsHide: true,
|
|
237
248
|
});
|
|
238
249
|
child.on('exit', () => STDIO_CLIENTS.delete(c.serverName));
|
|
239
250
|
const pending = new Map();
|
|
@@ -915,7 +926,7 @@ export async function apply(ctx, config = {}) {
|
|
|
915
926
|
'POST /wx-auth/start': async (body) => {
|
|
916
927
|
const serverName = String(body?.serverName ?? 'weixin-mcp');
|
|
917
928
|
const WX_BASE = 'https://ilinkai.weixin.qq.com';
|
|
918
|
-
const ACCOUNTS_DIR = `${
|
|
929
|
+
const ACCOUNTS_DIR = `${homedir()}/.weixin-mcp/accounts`;
|
|
919
930
|
const genQr = async (url) => {
|
|
920
931
|
const { default: QR } = await import('qrcode');
|
|
921
932
|
return QR.toDataURL(url, { width: 360, margin: 2 });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wfm-cn/dsh-mcp-connectors",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
"qrcode": "^1.5.4"
|
|
33
33
|
},
|
|
34
34
|
"description": "Unified MCP connector manager for DeepSeek Harness: panel-based add/edit/toggle, token auth, per-session tool gating, WeChat (ClawBot) QR login & auto-reply."
|
|
35
|
-
}
|
|
35
|
+
}
|