@taptap/maker 0.0.26-beta.3 → 0.0.26-beta.4

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 CHANGED
@@ -32,4 +32,4 @@ or OpenClaw plugin package contents.
32
32
 
33
33
  Full connection and tool-call troubleshooting guide: `docs/MAKER_MCP_CONNECTION_TROUBLESHOOTING.md`.
34
34
 
35
- Version: 0.0.26-beta.3
35
+ Version: 0.0.26-beta.4
package/dist/maker.js CHANGED
@@ -36297,7 +36297,7 @@ function applyDefaults(config2) {
36297
36297
  var MAKER_MCP_TRACKING_ACTION = "tapmaker_mcp_call";
36298
36298
  var MAKER_MCP_TRACKING_SOURCE = "local_mcp";
36299
36299
  var MAKER_MCP_TRACKING_TIMEOUT_MS = 1500;
36300
- var MAKER_MCP_VERSION = "0.0.26-beta.3".trim() ? "0.0.26-beta.3".trim() : "dev";
36300
+ var MAKER_MCP_VERSION = "0.0.26-beta.4".trim() ? "0.0.26-beta.4".trim() : "dev";
36301
36301
  var TRACKING_ERROR_MAX_LENGTH = 500;
36302
36302
  function buildMakerMcpTrackingPayload(event) {
36303
36303
  var _a3, _b, _c;
@@ -36374,7 +36374,7 @@ async function reportMakerMcpActivity(event) {
36374
36374
  }
36375
36375
 
36376
36376
  // src/maker/server/mcp.ts
36377
- var VERSION = true ? "0.0.26-beta.3" : "dev";
36377
+ var VERSION = true ? "0.0.26-beta.4" : "dev";
36378
36378
  var DEFAULT_BUILD_TIMEOUT_MS = 10 * 60 * 1e3;
36379
36379
  var DEFAULT_PROXY_RETRY_ATTEMPTS = 5;
36380
36380
  var DEFAULT_PROXY_RETRY_DELAY_MS = 30 * 1e3;
@@ -37450,6 +37450,18 @@ function sleepMs(delayMs) {
37450
37450
  });
37451
37451
  }
37452
37452
  function isRetryableMakerProxyError(error2) {
37453
+ if (hasRemoteDiagnostic(error2)) {
37454
+ return false;
37455
+ }
37456
+ if (isHttpClientError(error2)) {
37457
+ return false;
37458
+ }
37459
+ if (isExplicitProxyUnavailableError(error2) || isTransientHttpServerError(error2)) {
37460
+ return true;
37461
+ }
37462
+ if (isMcpBusinessError(error2)) {
37463
+ return false;
37464
+ }
37453
37465
  const message = error2 instanceof Error ? error2.message : String(error2);
37454
37466
  if (/\bBUILD FAILED\b|validation|invalid arguments|bad request|forbidden|unauthorized/i.test(
37455
37467
  message
@@ -37460,6 +37472,48 @@ function isRetryableMakerProxyError(error2) {
37460
37472
  message
37461
37473
  );
37462
37474
  }
37475
+ function isExplicitProxyUnavailableError(error2) {
37476
+ return error2 instanceof Error && /TapTap MCP Server is currently unavailable|proxy .*reconnect|attempting to reconnect/i.test(
37477
+ error2.message
37478
+ );
37479
+ }
37480
+ function isTransientHttpServerError(error2) {
37481
+ if (!(error2 instanceof Error)) {
37482
+ return false;
37483
+ }
37484
+ const code = error2.code;
37485
+ if (typeof code === "number" && code >= 500 && code < 600) {
37486
+ return true;
37487
+ }
37488
+ return /\bHTTP\s+5\d\d\b|bad gateway|service unavailable|gateway timeout/i.test(error2.message);
37489
+ }
37490
+ function isHttpClientError(error2) {
37491
+ if (!(error2 instanceof Error)) {
37492
+ return false;
37493
+ }
37494
+ const code = error2.code;
37495
+ const numericCode = typeof code === "number" ? code : typeof code === "string" && /^4\d\d$/.test(code) ? Number(code) : void 0;
37496
+ return numericCode !== void 0 && numericCode >= 400 && numericCode < 500 || /\bHTTP\s+4\d\d\b/i.test(error2.message);
37497
+ }
37498
+ function isMcpBusinessError(error2) {
37499
+ if (!(error2 instanceof Error)) {
37500
+ return false;
37501
+ }
37502
+ const code = error2.code;
37503
+ if (typeof code === "number" && code < 0) {
37504
+ return code !== ErrorCode.ConnectionClosed && code !== ErrorCode.RequestTimeout;
37505
+ }
37506
+ return /\bmcp error -\d+:/i.test(error2.message) && !/not connected|session expired|connection closed|transport closed/i.test(error2.message);
37507
+ }
37508
+ function hasRemoteDiagnostic(error2) {
37509
+ if (!(error2 instanceof Error) || !isPlainRecord(error2.data)) {
37510
+ return false;
37511
+ }
37512
+ return Object.prototype.hasOwnProperty.call(
37513
+ error2.data,
37514
+ "remote_result"
37515
+ );
37516
+ }
37463
37517
  function formatMakerRemoteSyncUnavailable(error2) {
37464
37518
  const message = error2 instanceof Error ? error2.message : String(error2);
37465
37519
  return [
@@ -39227,7 +39281,7 @@ function formatError2(error2) {
39227
39281
  }
39228
39282
 
39229
39283
  // src/maker/cli/commands.ts
39230
- var VERSION2 = true ? "0.0.26-beta.3" : "dev";
39284
+ var VERSION2 = true ? "0.0.26-beta.4" : "dev";
39231
39285
  var DEFAULT_MCP_NAME = "taptap-maker";
39232
39286
  var MAKER_NPM_PACKAGE = "@taptap/maker";
39233
39287
  var TWO_PART_COMMANDS = /* @__PURE__ */ new Set(["pat", "mcp", "dev-kit", "logs", "python", "lua-lsp", "agents"]);
@@ -43187,6 +43241,53 @@ var VERSION3 = typeof __PROXY_VERSION__ !== "undefined" ? __PROXY_VERSION__ : "d
43187
43241
  var LOCAL_PROXY_TAG = "local";
43188
43242
  var DEFAULT_RECONNECT_INTERVAL_MS = 5e3;
43189
43243
  var MAX_RECONNECT_INTERVAL_MS = 60 * 1e3;
43244
+ function convertMcpApplicationErrorToToolResult(error2) {
43245
+ if (!(error2 instanceof Error)) {
43246
+ return void 0;
43247
+ }
43248
+ const data = error2.data;
43249
+ if (!isRecord3(data) || !("remote_result" in data) || data.remote_result === void 0) {
43250
+ return void 0;
43251
+ }
43252
+ return {
43253
+ isError: true,
43254
+ content: [
43255
+ {
43256
+ type: "text",
43257
+ text: [
43258
+ error2.message,
43259
+ "remote_result:",
43260
+ formatProxyDiagnosticValue(data.remote_result)
43261
+ ].join("\n")
43262
+ }
43263
+ ]
43264
+ };
43265
+ }
43266
+ function isRecord3(value) {
43267
+ return typeof value === "object" && value !== null && !Array.isArray(value);
43268
+ }
43269
+ function formatProxyDiagnosticValue(value) {
43270
+ if (typeof value === "string") {
43271
+ return value;
43272
+ }
43273
+ try {
43274
+ return JSON.stringify(value, null, 2) || String(value);
43275
+ } catch {
43276
+ return String(value);
43277
+ }
43278
+ }
43279
+ function isTransientHttpServerError2(error2) {
43280
+ const code = error2.code;
43281
+ if (typeof code === "number" && code >= 500 && code < 600) {
43282
+ return true;
43283
+ }
43284
+ return /\bHTTP\s+5\d\d\b|bad gateway|service unavailable|gateway timeout/i.test(error2.message);
43285
+ }
43286
+ function isHttpClientError2(error2) {
43287
+ const code = error2.code;
43288
+ const numericCode = typeof code === "number" ? code : typeof code === "string" && /^4\d\d$/.test(code) ? Number(code) : void 0;
43289
+ return numericCode !== void 0 && numericCode >= 400 && numericCode < 500 || /\bHTTP\s+4\d\d\b/i.test(error2.message);
43290
+ }
43190
43291
  var TapTapMCPProxy = class {
43191
43292
  constructor(config2) {
43192
43293
  this.connected = false;
@@ -43411,8 +43512,8 @@ var TapTapMCPProxy = class {
43411
43512
  this.log("info", "✅ Connected and session validated");
43412
43513
  this.startHealthCheck();
43413
43514
  if (this.reconnecting) {
43414
- await this.notifyReconnected();
43415
43515
  await this.processPendingRequests();
43516
+ await this.notifyReconnected();
43416
43517
  this.reconnecting = false;
43417
43518
  }
43418
43519
  } catch (error2) {
@@ -43617,6 +43718,15 @@ var TapTapMCPProxy = class {
43617
43718
  */
43618
43719
  isNetworkError(error2) {
43619
43720
  if (!(error2 instanceof Error)) return false;
43721
+ if (convertMcpApplicationErrorToToolResult(error2)) {
43722
+ return false;
43723
+ }
43724
+ if (isHttpClientError2(error2)) {
43725
+ return false;
43726
+ }
43727
+ if (isTransientHttpServerError2(error2)) {
43728
+ return true;
43729
+ }
43620
43730
  const errorMsg = error2.message.toLowerCase();
43621
43731
  const errorCode = error2.code;
43622
43732
  const networkErrorCodes = [
@@ -43640,6 +43750,9 @@ var TapTapMCPProxy = class {
43640
43750
  if (errorCode && networkErrorCodes.includes(errorCode)) {
43641
43751
  return true;
43642
43752
  }
43753
+ if (errorCode === ErrorCode.ConnectionClosed || errorCode === ErrorCode.RequestTimeout) {
43754
+ return true;
43755
+ }
43643
43756
  if (errorMsg.includes("not connected") || this.isSessionInvalidError(error2)) {
43644
43757
  return true;
43645
43758
  }
@@ -43695,6 +43808,17 @@ var TapTapMCPProxy = class {
43695
43808
  );
43696
43809
  req.resolve(result);
43697
43810
  } catch (error2) {
43811
+ const toolErrorResult = convertMcpApplicationErrorToToolResult(error2);
43812
+ if (toolErrorResult) {
43813
+ req.resolve(toolErrorResult);
43814
+ continue;
43815
+ }
43816
+ if (this.isNetworkError(error2)) {
43817
+ this.connected = false;
43818
+ this.sessionValidated = false;
43819
+ this.pendingRequests.unshift(req);
43820
+ throw error2;
43821
+ }
43698
43822
  req.reject(error2 instanceof Error ? error2 : new Error(String(error2)));
43699
43823
  }
43700
43824
  }
@@ -43827,6 +43951,10 @@ var TapTapMCPProxy = class {
43827
43951
  );
43828
43952
  return result;
43829
43953
  } catch (error2) {
43954
+ const toolErrorResult = convertMcpApplicationErrorToToolResult(error2);
43955
+ if (toolErrorResult) {
43956
+ return toolErrorResult;
43957
+ }
43830
43958
  if (this.isNetworkError(error2)) {
43831
43959
  this.log("error", "❌ Network error detected, marking connection as lost");
43832
43960
  this.connected = false;
@@ -60,6 +60,13 @@ command、status、signal、stdout、stderr、error 和 failure_type。它不会
60
60
  对于已经连接的会话,`mcp verify` 不是首要检查。它只验证标准 npx/CLI 启动链路,不能解释单次
61
61
  tool/resource 调用中的请求校验、项目上下文、远端响应或业务错误。用户 AI 应先保存以下证据:
62
62
 
63
+ 远端 Maker 构建中的 Lua/LSP 编译错误是工具级业务失败。代理会把带 `error.data.remote_result` 的
64
+ 上游 MCP 协议异常转换成 `CallToolResult.isError: true`,原始编译诊断放在 `content` 和
65
+ `remote_result` 中;这类错误不应触发重连,也不应被“TapTap MCP Server is currently unavailable”
66
+ 替换。Maker 本地重试器也会根据 `error.data.remote_result` 和 MCP 错误码跳过业务错误重试,避免
67
+ 同一次构建被重复提交。明确的 proxy unavailable、连接断开、会话失效、请求超时或 HTTP 5xx 才按
68
+ 重试策略处理;pending 请求重放期间再次断线时,未完成队列会保留到下一轮退避重连。
69
+
63
70
  - 失败的 tool/resource 名称,以及可稳定复现的操作步骤。
64
71
  - 完整但已脱敏的请求参数;保留字段名、类型和结构,不保留 PAT、token、Authorization、Cookie、
65
72
  secret 或其它凭证值。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taptap/maker",
3
- "version": "0.0.26-beta.3",
3
+ "version": "0.0.26-beta.4",
4
4
  "type": "module",
5
5
  "description": "TapTap Maker local development CLI and MCP server",
6
6
  "main": "dist/maker.js",