@ateam-ai/mcp 0.4.44 → 0.4.45

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/src/api.js +15 -1
  3. package/src/tools.js +20 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ateam-ai/mcp",
3
- "version": "0.4.44",
3
+ "version": "0.4.45",
4
4
  "mcpName": "io.github.ariekogan/ateam-mcp",
5
5
  "description": "A-Team MCP Server — build, validate, and deploy multi-agent solutions from any AI environment",
6
6
  "type": "module",
package/src/api.js CHANGED
@@ -461,7 +461,21 @@ function formatError(method, path, status, body, baseUrl) {
461
461
  }
462
462
 
463
463
  const hint = hints[status] || "";
464
- const detail = typeof body === "string" && body.length > 0 && body.length < 2000 ? body : "";
464
+ // A JSON error body used to be dropped entirely only a string body became
465
+ // `detail`. So an endpoint that answers 4xx WITH the diagnosis (ui.surfaceProbe
466
+ // returns 422 + the failures that explain why the surface is broken) reached
467
+ // the caller as a bare "returned 422", throwing away the very thing it was
468
+ // asked to produce. Serialize objects too, capped the same way.
469
+ let detail = "";
470
+ if (typeof body === "string") {
471
+ if (body.length > 0 && body.length < 2000) detail = body;
472
+ } else if (body && typeof body === "object") {
473
+ try {
474
+ const s = JSON.stringify(body);
475
+ if (s.length < 2000) detail = s;
476
+ else detail = s.slice(0, 2000) + "… (truncated)";
477
+ } catch { /* non-serializable — leave detail empty */ }
478
+ }
465
479
 
466
480
  // Always show the FULL URL actually hit — ateam-mcp is a PUBLIC MCP with a
467
481
  // configurable base (prod default, dev/self-host overrides), so a bare
package/src/tools.js CHANGED
@@ -4036,10 +4036,26 @@ const handlers = {
4036
4036
  if (actor_id) body.actor_id = actor_id;
4037
4037
  // Forwards to the skill-validator, which runs Core's ui.surfaceProbe via /mcp.
4038
4038
  // 60s: navigate + settle + warm-retry inside Core, plus the hop.
4039
- return await post(
4040
- `/deploy/solutions/${solution_id}/plugins/${encodeURIComponent(plugin_id)}/verify-surface`,
4041
- body, sid, { timeoutMs: 60000 }
4042
- );
4039
+ try {
4040
+ return await post(
4041
+ `/deploy/solutions/${solution_id}/plugins/${encodeURIComponent(plugin_id)}/verify-surface`,
4042
+ body, sid, { timeoutMs: 60000 }
4043
+ );
4044
+ } catch (err) {
4045
+ // A FAILING surface is this tool's whole job, not a transport error. The
4046
+ // route maps a negative verdict to 422 (503 for inconclusive), which the
4047
+ // generic error path turned into "returned 422" — hiding the failures that
4048
+ // say WHY the screen is broken, and leaving the caller as blind as before
4049
+ // it ran the probe. Hand the verdict back as a result instead of throwing.
4050
+ const m = /returned (4\d\d|503)\b[\s\S]*?— (\{[\s\S]*)$/.exec(err?.message || "");
4051
+ if (m) {
4052
+ try {
4053
+ const parsed = JSON.parse(m[2].replace(/\n?Hint: [\s\S]*$/, "").trim());
4054
+ if (parsed && (parsed.verdict || Array.isArray(parsed.failures))) return parsed;
4055
+ } catch { /* not the probe's body — fall through */ }
4056
+ }
4057
+ throw err;
4058
+ }
4043
4059
  },
4044
4060
 
4045
4061
  ateam_test_skill: async ({ solution_id, skill_id, message, wait, wait_for, chain_timeout_ms, actor_id }, sid) => {