@mikoto_zero/minigame-open-mcp 1.11.2 → 1.11.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/proxy.js CHANGED
@@ -13389,7 +13389,7 @@ var StreamableHTTPClientTransport = class {
13389
13389
  };
13390
13390
 
13391
13391
  // src/mcp-proxy/proxy.ts
13392
- var VERSION = true ? "1.11.2" : "dev";
13392
+ var VERSION = true ? "1.11.3" : "dev";
13393
13393
  var TapTapMCPProxy = class {
13394
13394
  // 30秒验证一次会话
13395
13395
  constructor(config) {
@@ -13429,7 +13429,8 @@ var TapTapMCPProxy = class {
13429
13429
  try {
13430
13430
  await this.connectToServer();
13431
13431
  } catch (error) {
13432
- console.error("[Proxy] Initial connection failed, will retry in background");
13432
+ console.error("[Proxy] Initial connection failed:", this.formatError(error));
13433
+ console.error("[Proxy] Will retry in background...");
13433
13434
  this.scheduleReconnect();
13434
13435
  }
13435
13436
  this.setupHandlers();
@@ -13527,10 +13528,55 @@ var TapTapMCPProxy = class {
13527
13528
  this.healthCheckTimer = null;
13528
13529
  }
13529
13530
  }
13531
+ /**
13532
+ * 格式化错误信息,提取有用的错误详情
13533
+ *
13534
+ * 错误来源及结构:
13535
+ * 1. 网络层错误 (Node.js fetch):
13536
+ * - message: "fetch failed"
13537
+ * - cause.code: "ECONNREFUSED" / "ETIMEDOUT" 等系统错误码
13538
+ * - cause.message: "connect ECONNREFUSED 127.0.0.1:4000"
13539
+ *
13540
+ * 2. HTTP 错误 (MCP SDK send):
13541
+ * - message: "Error POSTing to endpoint (HTTP 502): Bad Gateway"
13542
+ * - HTTP 状态码嵌入在 message 中
13543
+ *
13544
+ * 3. SSE 连接错误 (MCP SDK StreamableHTTPError):
13545
+ * - message: "Streamable HTTP error: Failed to open SSE stream: Bad Gateway"
13546
+ * - code: 502 (HTTP 状态码,注意和系统错误码共用 code 字段)
13547
+ */
13548
+ formatError(error) {
13549
+ if (!(error instanceof Error)) {
13550
+ return String(error);
13551
+ }
13552
+ const parts = [];
13553
+ parts.push(error.message);
13554
+ const errorCode = error.code;
13555
+ if (errorCode) {
13556
+ if (typeof errorCode === "number") {
13557
+ parts.push(`[HTTP ${errorCode}]`);
13558
+ } else {
13559
+ parts.push(`[${errorCode}]`);
13560
+ }
13561
+ }
13562
+ const cause = error.cause;
13563
+ if (cause) {
13564
+ if (cause instanceof Error) {
13565
+ const causeCode = cause.code;
13566
+ let causeInfo = cause.message;
13567
+ if (causeCode) causeInfo += ` [${causeCode}]`;
13568
+ parts.push(`(cause: ${causeInfo})`);
13569
+ } else {
13570
+ parts.push(`(cause: ${String(cause)})`);
13571
+ }
13572
+ }
13573
+ return parts.join(" ");
13574
+ }
13530
13575
  /**
13531
13576
  * 重连到 TapTap Server
13532
13577
  */
13533
13578
  async reconnectToServer() {
13579
+ var _a2;
13534
13580
  if (this.reconnecting) return;
13535
13581
  this.reconnecting = true;
13536
13582
  this.clearReconnectTimer();
@@ -13542,7 +13588,9 @@ var TapTapMCPProxy = class {
13542
13588
  await this.connectToServer();
13543
13589
  console.error("[Proxy] ✅ Reconnected successfully");
13544
13590
  } catch (error) {
13545
- console.error("[Proxy] Reconnect failed, will retry in 5s");
13591
+ const interval = ((_a2 = this.config.options) == null ? void 0 : _a2.reconnect_interval) ?? 5e3;
13592
+ console.error("[Proxy] ❌ Reconnect failed:", this.formatError(error));
13593
+ console.error(`[Proxy] Will retry in ${interval / 1e3}s...`);
13546
13594
  this.reconnecting = false;
13547
13595
  this.scheduleReconnect();
13548
13596
  }
package/dist/server.js CHANGED
@@ -5660,7 +5660,7 @@ class MultiplayerManager {
5660
5660
  // 导出
5661
5661
  // export default MultiplayerManager;
5662
5662
  // module.exports = MultiplayerManager;
5663
- // window.MultiplayerManager = MultiplayerManager;`}]}}};var ha;ha="1.11.2";async function uX(){return mi(jc,"api_event_relations")}async function dX(){return mi(jc,"protocol_template")}async function Nv(){return mi(jc,"complete_example")}async function fX(){return`# TapTap 多人联机集成指南
5663
+ // window.MultiplayerManager = MultiplayerManager;`}]}}};var ha;ha="1.11.3";async function uX(){return mi(jc,"api_event_relations")}async function dX(){return mi(jc,"protocol_template")}async function Nv(){return mi(jc,"complete_example")}async function fX(){return`# TapTap 多人联机集成指南
5664
5664
 
5665
5665
  ---
5666
5666
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikoto_zero/minigame-open-mcp",
3
- "version": "1.11.2",
3
+ "version": "1.11.3",
4
4
  "type": "module",
5
5
  "description": "TapTap Open API MCP Server - Documentation and Management APIs for TapTap Minigame and H5 Games (Leaderboard, and more features coming)",
6
6
  "main": "dist/server.js",