@a1-x-tech/mcp-google-slides 1.1.0 → 1.1.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/telemetry.js +30 -4
- package/package.json +1 -1
package/dist/telemetry.js
CHANGED
|
@@ -231,7 +231,24 @@ export function errorDetail(text) {
|
|
|
231
231
|
const FAILURE_ORIGIN = new WeakMap();
|
|
232
232
|
const JS_ERRORS = new Set(["TypeError", "ReferenceError", "RangeError", "SyntaxError", "EvalError", "URIError"]);
|
|
233
233
|
function jsBug(err) {
|
|
234
|
-
|
|
234
|
+
if (!(err instanceof Error) || !JS_ERRORS.has(err.name))
|
|
235
|
+
return undefined;
|
|
236
|
+
// Node's own errors (ERR_INVALID_ARG_TYPE …, system errors) quote the values passed in: their code only.
|
|
237
|
+
const code = err.code;
|
|
238
|
+
if (code !== undefined || "errno" in err || "syscall" in err) {
|
|
239
|
+
return typeof code === "string" && /^[A-Z][A-Z0-9_]{2,40}$/.test(code) ? `${err.name} ${code}` : err.name;
|
|
240
|
+
}
|
|
241
|
+
return `${err.name}: ${err.message.split("\n")[0]}`;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Only the class name of this server's own errors (AuthRequiredError, AbortError), used when the
|
|
245
|
+
* allowlist finds nothing. Never the message: a plain Error or a system error (ENOENT …) can carry
|
|
246
|
+
* user data, so those send nothing.
|
|
247
|
+
*/
|
|
248
|
+
function errorText(err) {
|
|
249
|
+
if (!(err instanceof Error) || "errno" in err || "syscall" in err)
|
|
250
|
+
return undefined;
|
|
251
|
+
return /^[A-Z][A-Za-z0-9]*(?:Error|Exception)$/.test(err.name) && err.name !== "Error" ? err.name : undefined;
|
|
235
252
|
}
|
|
236
253
|
/**
|
|
237
254
|
* Node's fetch rejects a network failure as TypeError("fetch failed") with the socket/DNS/TLS error
|
|
@@ -260,8 +277,9 @@ export function noteFailure(result, err) {
|
|
|
260
277
|
FAILURE_ORIGIN.set(result, { origin: "network", ...net });
|
|
261
278
|
else {
|
|
262
279
|
const bug = jsBug(err);
|
|
263
|
-
|
|
264
|
-
|
|
280
|
+
const text = bug ?? errorText(err);
|
|
281
|
+
if (text)
|
|
282
|
+
FAILURE_ORIGIN.set(result, { origin: bug ? "internal" : "error", text });
|
|
265
283
|
}
|
|
266
284
|
}
|
|
267
285
|
}
|
|
@@ -297,8 +315,16 @@ function reportCall(telemetry, tool, value, thrown) {
|
|
|
297
315
|
reason = "error_invalid_request";
|
|
298
316
|
detail = maskedOwnText("local: ", noted.text);
|
|
299
317
|
}
|
|
300
|
-
else
|
|
318
|
+
else {
|
|
301
319
|
detail = errorDetail(resultText(value));
|
|
320
|
+
const own = noted?.origin === "error" ? noted.text : thrown ? errorText(value) : undefined;
|
|
321
|
+
if (!detail && own) {
|
|
322
|
+
detail = own;
|
|
323
|
+
// The class name ("AuthRequiredError") often says more than the message.
|
|
324
|
+
if (reason === "error_other")
|
|
325
|
+
reason = toolOutcome({ isError: true, content: [{ type: "text", text: own }] });
|
|
326
|
+
}
|
|
327
|
+
}
|
|
302
328
|
}
|
|
303
329
|
telemetry.send("tool_call", { tool, reason, error_detail: detail || undefined });
|
|
304
330
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a1-x-tech/mcp-google-slides",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "MCP server for the Google Slides API — create and edit presentations, slides, text, shapes, tables and images, manage speaker notes, comments, thumbnails and export. For Claude, Cursor, Codex and other AI clients.",
|
|
5
5
|
"mcpName": "io.github.A1-x-Tech/mcp-google-slides",
|
|
6
6
|
"type": "module",
|