@epoch-agent/plugin-mcp 0.9.0 → 0.10.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/index.d.ts +19 -0
- package/dist/index.js +7 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -664,6 +664,25 @@ declare class McpClient {
|
|
|
664
664
|
* 最要紧的一句(而它永远等不到自己的 `\n`)。
|
|
665
665
|
*/
|
|
666
666
|
private stderrHint;
|
|
667
|
+
/**
|
|
668
|
+
* stdio server **一个字节都没打印**就死掉时,把那条命令补进错误里。
|
|
669
|
+
*
|
|
670
|
+
* ## 为什么要这一句:`Connection closed` 不携带任何可操作信息
|
|
671
|
+
*
|
|
672
|
+
* 2026-09-10 的现场:Windows 上 `"command": "python3"` 解析到的是
|
|
673
|
+
* `…\WindowsApps\python3.exe` —— 微软商店的「应用执行别名」,**一个 0 字节的
|
|
674
|
+
* 占位文件**。跑它退出码 9009、stdout 和 stderr 各 0 字节。于是
|
|
675
|
+
* {@link stderrHint} 那条路(有 stderr 就把尾巴附上)**整个用不上**,
|
|
676
|
+
* 用户最终看到的就是一句 `MCP error -32000: Connection closed`。
|
|
677
|
+
*
|
|
678
|
+
* 那句话会把人引向「网络 / 连接」,而真正发生的事是「这条命令在这台机器上不是
|
|
679
|
+
* 你以为的那个东西」。把 `command` + `args` 摆出来,用户能自己去终端跑一遍 ——
|
|
680
|
+
* 那一跑就结束了。
|
|
681
|
+
*
|
|
682
|
+
* ⚠️ 只在 **stdio + stderr 空** 这一格补:远程那一档没有命令可说;
|
|
683
|
+
* 有 stderr 的时候那几行本身就是更强的证据,再挂一条命令只是把它挤出视野。
|
|
684
|
+
*/
|
|
685
|
+
private silentStdioHint;
|
|
667
686
|
/**
|
|
668
687
|
* server 说工具表变了。
|
|
669
688
|
*
|
package/dist/index.js
CHANGED
|
@@ -669,7 +669,7 @@ var McpClient = class {
|
|
|
669
669
|
throw err;
|
|
670
670
|
}
|
|
671
671
|
const base = err instanceof Error ? err.message : String(err);
|
|
672
|
-
this.lastError = this.stderrTail.length > 0 ? `${base}\uFF1Bstderr: ${this.stderrHint()}` : base
|
|
672
|
+
this.lastError = this.stderrTail.length > 0 ? `${base}\uFF1Bstderr: ${this.stderrHint()}` : `${base}${this.silentStdioHint()}`;
|
|
673
673
|
throw err;
|
|
674
674
|
}
|
|
675
675
|
this.transport = transport;
|
|
@@ -694,6 +694,12 @@ var McpClient = class {
|
|
|
694
694
|
const lines = partial.length > 0 ? [...this.stderrTail, partial] : this.stderrTail;
|
|
695
695
|
return lines.slice(-3).join(" | ");
|
|
696
696
|
}
|
|
697
|
+
silentStdioHint() {
|
|
698
|
+
const stdio = this.config.transport === "stdio" || !this.config.url;
|
|
699
|
+
if (!stdio || this.config.command === void 0) return "";
|
|
700
|
+
const line = [this.config.command, ...this.config.args ?? []].join(" ");
|
|
701
|
+
return `\uFF1B\u8FD9\u6761\u547D\u4EE4\u6CA1\u6709\u6253\u5370\u4EFB\u4F55\u4E1C\u897F\u5C31\u9000\u51FA\u4E86\uFF0C\u53BB\u7EC8\u7AEF\u91CC\u624B\u8DD1\u4E00\u904D\u770B\u770B\uFF1A${line}`;
|
|
702
|
+
}
|
|
697
703
|
onToolsListChanged() {
|
|
698
704
|
this.cache.invalidate(this.config.name);
|
|
699
705
|
this.onToolsChanged?.();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epoch-agent/plugin-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "epoch-agent MCP 客户端插件",
|
|
6
6
|
"repository": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
25
25
|
"zod": "^4.4.3",
|
|
26
|
-
"@epoch-agent/infra": "0.
|
|
27
|
-
"@epoch-agent/protocol": "0.
|
|
26
|
+
"@epoch-agent/infra": "0.10.1",
|
|
27
|
+
"@epoch-agent/protocol": "0.10.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^26.1.2",
|