denpex-mcp 0.2.20 → 0.2.22

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 (2) hide show
  1. package/dist/index.js +17 -24
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -165,15 +165,24 @@ var DenpexClient = class {
165
165
  if (this.config.apiKey) headers["X-Denpex-Key"] = this.config.apiKey;
166
166
  if (body !== void 0) headers["Content-Type"] = "application/json";
167
167
  Object.assign(headers, opts.headers ?? {});
168
- let res;
169
168
  try {
170
- res = await fetch(`${this.config.apiUrl}${path2}`, {
169
+ const res = await fetch(`${this.config.apiUrl}${path2}`, {
171
170
  method,
172
171
  headers,
173
172
  body: body !== void 0 ? JSON.stringify(body) : void 0,
174
173
  signal: controller.signal
175
174
  });
175
+ const raw = await res.text();
176
+ let parsed;
177
+ try {
178
+ parsed = raw ? JSON.parse(raw) : void 0;
179
+ } catch {
180
+ parsed = raw;
181
+ }
182
+ if (!res.ok) throw new DenpexError(res.status, parsed, `HTTP ${res.status}`);
183
+ return parsed;
176
184
  } catch (e) {
185
+ if (e instanceof DenpexError) throw e;
177
186
  const err = e;
178
187
  if (err?.name === "AbortError") {
179
188
  throw new DenpexError(504, null, "Request timed out");
@@ -182,17 +191,6 @@ var DenpexClient = class {
182
191
  } finally {
183
192
  clearTimeout(timer);
184
193
  }
185
- const raw = await res.text();
186
- let parsed;
187
- try {
188
- parsed = raw ? JSON.parse(raw) : void 0;
189
- } catch {
190
- parsed = raw;
191
- }
192
- if (!res.ok) {
193
- throw new DenpexError(res.status, parsed, `HTTP ${res.status}`);
194
- }
195
- return parsed;
196
194
  }
197
195
  };
198
196
 
@@ -12351,18 +12349,13 @@ function registerFollowup(server, ctx) {
12351
12349
  // Follow-ups use the same deep worker and 290s API ceiling as diagnosis.
12352
12350
  timeoutMs: 32e4
12353
12351
  });
12354
- const r = reply.reply ?? {};
12355
- const lines = [];
12356
- if (typeof r.summary === "string") lines.push(r.summary);
12357
- if (typeof r.action === "string") lines.push("", `**Suggested action:** ${r.action}`);
12358
- const clar = r.clarifyingQuestions;
12359
- if (Array.isArray(clar) && clar.length) {
12360
- lines.push("", "**To narrow it down:**");
12361
- for (const q of clar) if (typeof q === "string") lines.push(`- ${q}`);
12362
- }
12352
+ if (!reply.reply || typeof reply.reply !== "object" || Array.isArray(reply.reply)) return toolText("No complete follow-up report returned. Retry without treating this as a diagnosis.", true);
12353
+ const r = reply.reply;
12354
+ const view = viewFromCloud({ fix: r, forensicReport: r.forensicReport, diagnosisId, meta: { failureType: r.failureType, confidence: r.confidence } });
12355
+ const lines = [renderDiagnosis(view)];
12363
12356
  const cid = reply.conversationId;
12364
12357
  if (typeof cid === "string") lines.push("", `_conversationId: ${cid} (pass this back to continue)_`);
12365
- return toolText(lines.join("\n").trim() || "No reply returned.");
12358
+ return toolResult(lines.join("\n").trim(), { ...structuredDiagnosis(view), conversationId: typeof cid === "string" ? cid : null });
12366
12359
  } catch (e) {
12367
12360
  return toolText(describeError(e, { tier: "Team", tool: "ask_followup" }), true);
12368
12361
  }
@@ -12975,7 +12968,7 @@ function registerPrompts(server) {
12975
12968
 
12976
12969
  // src/version.ts
12977
12970
  var SERVER_NAME = "denpex";
12978
- var SERVER_VERSION = "0.2.20";
12971
+ var SERVER_VERSION = "0.2.22";
12979
12972
 
12980
12973
  // src/server.ts
12981
12974
  function createServer() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "denpex-mcp",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "Denpex MCP server, diagnose GPU/ML training failures (CUDA OOM, NCCL timeouts, Xid faults, NaN loss) from Claude Desktop, Cursor, or Claude Code, with optional explicit zero-egress mode.",
5
5
  "type": "module",
6
6
  "license": "MIT",