gogcli-mcp-gmail 2.28.0 → 2.29.0

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/index.js CHANGED
@@ -31323,6 +31323,56 @@ function redactSecrets(text) {
31323
31323
  return text.replace(BEARER_RE, "$1[REDACTED]").replace(BASIC_AUTH_RE, "$1[REDACTED]").replace(SET_COOKIE_RE, "$1$2=[REDACTED]").replace(COOKIE_HEADER_RE, (_m, prefix, pairs) => `${prefix}${pairs.replace(/=[^;,\s]*/g, "=[REDACTED]")}`).replace(API_KEY_RE, "[REDACTED]").replace(QUERY_SECRET_RE, "$1[REDACTED]").replace(AWS_SIGV4_RE, "$1[REDACTED]").replace(JSON_SECRET_DQ_RE, "$1[REDACTED]$2").replace(JSON_SECRET_SQ_RE, "$1[REDACTED]$2").replace(JWT_RE, "[REDACTED]");
31324
31324
  }
31325
31325
 
31326
+ // ../../node_modules/@chrischall/mcp-utils/dist/response/view.js
31327
+ function minifiedResult(data) {
31328
+ return { content: [{ type: "text", text: JSON.stringify(data) }] };
31329
+ }
31330
+
31331
+ // ../../node_modules/@chrischall/mcp-utils/dist/response/media.js
31332
+ var MEDIA_NOUN = "(?:avatar|tall_avatar|cover_photo|cover_image|picture|photo|thumbnail|thumb|image|icon|banner|profile_pic(?:ture)?|logo)";
31333
+ var MEDIA_KEY = new RegExp(`^${MEDIA_NOUN}s?(?:(?:link|uri|url)s?)?$`, "i");
31334
+ var MEDIA_URL = /^https?:\/\/[^\s]+?\.(png|jpe?g|gif|webp|svg|avif|bmp|ico)([?#]|$)/i;
31335
+ function stripMediaUrls(value, opts = {}) {
31336
+ const keep = new Set((opts.keep ?? []).map((k) => k.toLowerCase()));
31337
+ const drop = (opts.drop ?? []).map((rule) => typeof rule === "string" ? rule.toLowerCase() : new RegExp(rule.source, rule.flags));
31338
+ return walk(value, keep, drop);
31339
+ }
31340
+ function alsoDrop(key, drop) {
31341
+ const lower = key.toLowerCase();
31342
+ for (const rule of drop) {
31343
+ if (typeof rule === "string") {
31344
+ if (rule === lower)
31345
+ return true;
31346
+ continue;
31347
+ }
31348
+ rule.lastIndex = 0;
31349
+ if (rule.test(key))
31350
+ return true;
31351
+ }
31352
+ return false;
31353
+ }
31354
+ function walk(value, keep, drop) {
31355
+ if (Array.isArray(value))
31356
+ return value.map((v) => walk(v, keep, drop));
31357
+ if (value === null || typeof value !== "object")
31358
+ return value;
31359
+ if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
31360
+ return value;
31361
+ const out = {};
31362
+ for (const [key, v] of Object.entries(value)) {
31363
+ if (keep.has(key.toLowerCase())) {
31364
+ out[key] = v;
31365
+ continue;
31366
+ }
31367
+ if (MEDIA_KEY.test(key) || alsoDrop(key, drop))
31368
+ continue;
31369
+ if (typeof v === "string" && MEDIA_URL.test(v))
31370
+ continue;
31371
+ out[key] = walk(v, keep, drop);
31372
+ }
31373
+ return out;
31374
+ }
31375
+
31326
31376
  // ../../node_modules/@chrischall/mcp-utils/dist/response/index.js
31327
31377
  function textResult(data) {
31328
31378
  return {
@@ -31847,11 +31897,11 @@ function parseTimestampValue(key, value, assumeNaiveIn) {
31847
31897
  }
31848
31898
  return null;
31849
31899
  }
31850
- function walk(node, tz, naiveTz) {
31900
+ function walk2(node, tz, naiveTz) {
31851
31901
  let changed = false;
31852
31902
  if (Array.isArray(node)) {
31853
31903
  for (const item of node) {
31854
- if (walk(item, tz, naiveTz)) changed = true;
31904
+ if (walk2(item, tz, naiveTz)) changed = true;
31855
31905
  }
31856
31906
  return changed;
31857
31907
  }
@@ -31860,7 +31910,7 @@ function walk(node, tz, naiveTz) {
31860
31910
  for (const key of Object.keys(obj)) {
31861
31911
  const value = obj[key];
31862
31912
  if (value !== null && typeof value === "object") {
31863
- if (walk(value, tz, naiveTz)) changed = true;
31913
+ if (walk2(value, tz, naiveTz)) changed = true;
31864
31914
  continue;
31865
31915
  }
31866
31916
  if (ZONE_NAME_KEYS.has(key) || !TIMESTAMP_KEYS.has(key)) continue;
@@ -31886,7 +31936,7 @@ function normalizeTimestamps(text, tz = displayTimeZone(), naiveTz = naiveSource
31886
31936
  } catch {
31887
31937
  return text;
31888
31938
  }
31889
- if (!walk(parsed, tz, naiveTz)) return text;
31939
+ if (!walk2(parsed, tz, naiveTz)) return text;
31890
31940
  return JSON.stringify(parsed, null, detectIndent(text));
31891
31941
  }
31892
31942
 
@@ -32043,10 +32093,38 @@ ${accounts || "(none)"}${hint}`);
32043
32093
  return errorResult(`${errText}${hint}`);
32044
32094
  }
32045
32095
  }
32096
+ function minifiedOrRawText(text, stripMedia = false) {
32097
+ const trimmed = text.trim();
32098
+ if (trimmed === "" || !/^[[{]/.test(trimmed)) return rawTextResult(text);
32099
+ try {
32100
+ const parsed = JSON.parse(trimmed);
32101
+ return minifiedResult(stripMedia ? stripMediaUrls(parsed) : parsed);
32102
+ } catch {
32103
+ return rawTextResult(text);
32104
+ }
32105
+ }
32106
+ function isRejectedFieldMask(err) {
32107
+ return /invalidParameter|invalid field selection/i.test(String(err));
32108
+ }
32109
+ async function runProjected(args, options) {
32110
+ const { fieldsMask } = options;
32111
+ if (!fieldsMask) return run(args, options);
32112
+ try {
32113
+ return await run([...args, `--fields=${fieldsMask}`], options);
32114
+ } catch (err) {
32115
+ if (!isRejectedFieldMask(err)) throw err;
32116
+ process.stderr.write(
32117
+ `gogcli-mcp: Google rejected the compact field mask (${fieldsMask}); retrying unprojected
32118
+ `
32119
+ );
32120
+ return run(args, options);
32121
+ }
32122
+ }
32046
32123
  async function runOrDiagnose(args, options) {
32047
32124
  try {
32048
- const raw = await run(args, options);
32049
- return rawTextResult(options.lossless ? raw : stripConsumedPageToken(normalizeTimestamps(raw)));
32125
+ const raw = await runProjected(args, options);
32126
+ if (options.lossless) return rawTextResult(raw);
32127
+ return minifiedOrRawText(stripConsumedPageToken(normalizeTimestamps(raw)), options.stripMedia);
32050
32128
  } catch (err) {
32051
32129
  return diagnose(err);
32052
32130
  }
@@ -32572,7 +32650,7 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
32572
32650
  );
32573
32651
 
32574
32652
  // ../gogcli-mcp/src/server.ts
32575
- var VERSION = true ? "2.28.0" : "0.0.0";
32653
+ var VERSION = true ? "2.29.0" : "0.0.0";
32576
32654
 
32577
32655
  // ../gogcli-mcp/src/auth-log.ts
32578
32656
  var FAILURES = /* @__PURE__ */ new Set([
@@ -33590,15 +33668,15 @@ function decodePartText(part) {
33590
33668
  }
33591
33669
  function bestBodyText(payload) {
33592
33670
  const firstOfType = /* @__PURE__ */ new Map();
33593
- const walk2 = (part) => {
33671
+ const walk3 = (part) => {
33594
33672
  if (!part) return;
33595
33673
  const mime = partMimeType(part);
33596
33674
  if (part.body?.data && !part.filename && !firstOfType.has(mime)) {
33597
33675
  firstOfType.set(mime, decodePartText(part));
33598
33676
  }
33599
- for (const child of part.parts ?? []) walk2(child);
33677
+ for (const child of part.parts ?? []) walk3(child);
33600
33678
  };
33601
- walk2(payload);
33679
+ walk3(payload);
33602
33680
  return firstOfType.get("text/plain") ?? firstOfType.get("text/html") ?? "";
33603
33681
  }
33604
33682
  var DRAFT_DIFF_MAX_LINES = 200;
package/manifest.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifest_version": "0.3",
4
4
  "name": "gogcli-mcp-gmail",
5
5
  "display_name": "gogcli (Gmail)",
6
- "version": "2.28.0",
6
+ "version": "2.29.0",
7
7
  "description": "Extended Gmail for Claude via gogcli — auth + full Gmail support (threads, labels, drafts, attachments, forward, autoreply, bulk operations)",
8
8
  "author": {
9
9
  "name": "Chris Hall",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gogcli-mcp-gmail",
3
- "version": "2.28.0",
3
+ "version": "2.29.0",
4
4
  "mcpName": "io.github.chrischall/gogcli-mcp-gmail",
5
5
  "description": "Extended Gmail MCP server via gogcli — auth + full Gmail support (threads, labels, drafts, attachments, forward, autoreply, bulk operations)",
6
6
  "author": "Claude Code (AI) <https://www.anthropic.com/claude>",
@@ -24,7 +24,7 @@
24
24
  "test:coverage": "vitest run --coverage"
25
25
  },
26
26
  "dependencies": {
27
- "@chrischall/mcp-utils": "^0.17.1",
27
+ "@chrischall/mcp-utils": "^0.23.0",
28
28
  "@modelcontextprotocol/sdk": "^1.30.0",
29
29
  "zod": "^4.4.3"
30
30
  },