gogcli-mcp-drive 4.1.0 → 4.2.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.
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "Extended Google Drive for Claude via gogcli — auth + full Drive support (upload, download, permissions, comments, shared drives)",
10
- "version": "4.1.0"
10
+ "version": "4.2.1"
11
11
  },
12
12
  "plugins": [
13
13
  {
@@ -15,7 +15,7 @@
15
15
  "displayName": "gogcli (Drive)",
16
16
  "source": "./",
17
17
  "description": "Extended Google Drive for Claude via gogcli — auth + full Drive support (upload, download, permissions, comments, shared drives)",
18
- "version": "4.1.0",
18
+ "version": "4.2.1",
19
19
  "author": {
20
20
  "name": "Chris Hall"
21
21
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gogcli-mcp-drive",
3
3
  "displayName": "gogcli (Drive)",
4
- "version": "4.1.0",
4
+ "version": "4.2.1",
5
5
  "description": "Extended Google Drive for Claude via gogcli — auth + full Drive support (upload, download, permissions, comments, shared drives)",
6
6
  "author": {
7
7
  "name": "Chris Hall",
package/dist/index.js CHANGED
@@ -5,6 +5,39 @@ var __export = (target, all) => {
5
5
  __defProp(target, name, { get: all[name], enumerable: true });
6
6
  };
7
7
 
8
+ // ../../node_modules/@chrischall/mcp-utils/dist/cancel/index.js
9
+ import { AsyncLocalStorage } from "node:async_hooks";
10
+ var storage = new AsyncLocalStorage();
11
+ function withCallSignal(signal, fn, request) {
12
+ return signal ? storage.run({ signal, ...request ? { request } : {} }, fn) : fn();
13
+ }
14
+ function currentCallSignal() {
15
+ return storage.getStore()?.signal;
16
+ }
17
+ function killOnCancel(child, signal = "SIGTERM") {
18
+ const ambient = currentCallSignal();
19
+ if (!ambient)
20
+ return () => {
21
+ };
22
+ if (ambient.aborted) {
23
+ child.kill(signal);
24
+ return () => {
25
+ };
26
+ }
27
+ const onAbort = () => {
28
+ child.kill(signal);
29
+ };
30
+ ambient.addEventListener("abort", onAbort, { once: true });
31
+ return () => ambient.removeEventListener("abort", onAbort);
32
+ }
33
+
34
+ // ../../node_modules/@chrischall/mcp-utils/dist/caller/index.js
35
+ import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
36
+ var storage2 = new AsyncLocalStorage2();
37
+ function withCallerCapabilities(capabilities, fn) {
38
+ return capabilities ? storage2.run(capabilities, fn) : fn();
39
+ }
40
+
8
41
  // ../../node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs
9
42
  var __create = Object.create;
10
43
  var __defProp2 = Object.defineProperty;
@@ -34454,17 +34487,73 @@ Hint: ${err.hint}`);
34454
34487
  }
34455
34488
  throw err;
34456
34489
  }
34490
+ function mcpRequestFrom(args) {
34491
+ const ctx = args.at(-1);
34492
+ if (typeof ctx !== "object" || ctx === null)
34493
+ return void 0;
34494
+ const req = ctx.mcpReq;
34495
+ if (typeof req !== "object" || req === null)
34496
+ return void 0;
34497
+ return typeof req.notify === "function" ? req : void 0;
34498
+ }
34499
+ function callSignalFrom(args) {
34500
+ const ctx = args.at(-1);
34501
+ if (typeof ctx !== "object" || ctx === null)
34502
+ return void 0;
34503
+ const req = ctx.mcpReq;
34504
+ if (typeof req !== "object" || req === null)
34505
+ return void 0;
34506
+ const signal = req.signal;
34507
+ return signal instanceof AbortSignal ? signal : void 0;
34508
+ }
34509
+ function declaredCapabilitiesFrom(server) {
34510
+ const inner = server.server;
34511
+ if (typeof inner !== "object" || inner === null)
34512
+ return void 0;
34513
+ const read = inner.getClientCapabilities;
34514
+ if (typeof read !== "function")
34515
+ return void 0;
34516
+ try {
34517
+ const declared = read.call(inner);
34518
+ return typeof declared === "object" && declared !== null ? declared : void 0;
34519
+ } catch {
34520
+ return void 0;
34521
+ }
34522
+ }
34457
34523
  function surfaceToolHints(server) {
34458
34524
  const register2 = server.registerTool.bind(server);
34459
- server.registerTool = (name, config2, cb) => register2(name, config2, (...args) => {
34460
- let result;
34461
- try {
34462
- result = cb(...args);
34463
- } catch (err) {
34464
- return hintResultOrRethrow(err);
34465
- }
34466
- return result instanceof Promise ? result.catch(hintResultOrRethrow) : result;
34467
- });
34525
+ server.registerTool = (name, config2, cb) => register2(name, config2, (...args) => (
34526
+ // THE CALLER'S CANCELLATION, made ambient for the whole handler
34527
+ // (`cancel/index.ts`). The SDK delivers it and the fleet ignored it:
34528
+ // measured against @modelcontextprotocol/server 2.0.0, a cancelled
34529
+ // call aborts `ctx.mcpReq.signal` with the caller's reason and the
34530
+ // handler runs to completion regardless — so the HTTP request stays
34531
+ // in flight, the child keeps burning metered CPU, and the upstream
34532
+ // keeps being hit for somebody who has gone. claude.ai sent 101
34533
+ // cancellations in the week to 2026-09-20.
34534
+ //
34535
+ // Here because this is the one wrapper every tool already passes
34536
+ // through: threading the signal by hand would mean editing several
34537
+ // hundred handlers and missing exactly the ones nobody edits.
34538
+ withCallSignal(callSignalFrom(args), () => (
34539
+ // WHAT THE CALLER CAN DO, made ambient for the same reason and in
34540
+ // the same place (`caller/index.ts`). Only the 2025-era half needs
34541
+ // the wrapper — a 2026-07-28 request answers for itself off its own
34542
+ // envelope — but a guarded tool that cannot tell whether the caller
34543
+ // can be shown a prompt returns one the SDK then refuses to deliver,
34544
+ // and that refusal reaches the caller as an unexplained protocol
34545
+ // error it had no chance to catch.
34546
+ withCallerCapabilities(declaredCapabilitiesFrom(server), () => {
34547
+ let result;
34548
+ try {
34549
+ result = cb(...args);
34550
+ } catch (err) {
34551
+ return hintResultOrRethrow(err);
34552
+ }
34553
+ return result instanceof Promise ? result.catch(hintResultOrRethrow) : result;
34554
+ })
34555
+ ), mcpRequestFrom(args))
34556
+ ));
34468
34557
  }
34469
34558
  async function createMcpServer(opts) {
34470
34559
  const server = new McpServer({ name: opts.name, version: opts.version }, { supportedProtocolVersions: [...SERVER_PROTOCOL_VERSIONS] });
@@ -34899,8 +34988,15 @@ async function spawnGog(fullArgs, opts) {
34899
34988
  const stdoutChunks = [];
34900
34989
  const stderrChunks = [];
34901
34990
  let settled = false;
34991
+ const cancelled = currentCallSignal();
34992
+ const stopWatchingCancel = killOnCancel(child);
34993
+ const stopWatching = () => {
34994
+ clearTimeout(timer);
34995
+ stopWatchingCancel();
34996
+ };
34902
34997
  const timer = setTimeout(() => {
34903
34998
  settled = true;
34999
+ stopWatchingCancel();
34904
35000
  child.kill();
34905
35001
  reject(new Error(`gog timed out after ${formatTimeout(effectiveTimeout)}`));
34906
35002
  }, effectiveTimeout);
@@ -34911,9 +35007,13 @@ async function spawnGog(fullArgs, opts) {
34911
35007
  stderrChunks.push(chunk);
34912
35008
  });
34913
35009
  child.on("close", (code) => {
34914
- clearTimeout(timer);
35010
+ stopWatching();
34915
35011
  if (settled) return;
34916
35012
  settled = true;
35013
+ if (cancelled?.aborted) {
35014
+ reject(cancelled.reason instanceof Error ? cancelled.reason : new Error("the caller cancelled this call"));
35015
+ return;
35016
+ }
34917
35017
  const stderr = Buffer.concat(stderrChunks).toString().trim();
34918
35018
  if (code === 0) {
34919
35019
  if (binary) {
@@ -34931,7 +35031,7 @@ async function spawnGog(fullArgs, opts) {
34931
35031
  }
34932
35032
  });
34933
35033
  child.on("error", (err) => {
34934
- clearTimeout(timer);
35034
+ stopWatching();
34935
35035
  if (settled) return;
34936
35036
  settled = true;
34937
35037
  if (err.code === "ENOENT") {
@@ -35652,7 +35752,7 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
35652
35752
  );
35653
35753
 
35654
35754
  // ../gogcli-mcp/src/server.ts
35655
- var VERSION = true ? "4.1.0" : "0.0.0";
35755
+ var VERSION = true ? "4.2.1" : "0.0.0";
35656
35756
 
35657
35757
  // ../gogcli-mcp/src/bootstrap-auth.ts
35658
35758
  import { join as join2 } from "node:path";
package/manifest.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifest_version": "0.3",
4
4
  "name": "gogcli-mcp-drive",
5
5
  "display_name": "gogcli (Drive)",
6
- "version": "4.1.0",
6
+ "version": "4.2.1",
7
7
  "description": "Extended Google Drive for Claude via gogcli — auth + full Drive support (upload, download, permissions, comments, shared drives)",
8
8
  "author": {
9
9
  "name": "Chris Hall",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gogcli-mcp-drive",
3
- "version": "4.1.0",
3
+ "version": "4.2.1",
4
4
  "mcpName": "io.github.chrischall/gogcli-mcp-drive",
5
5
  "description": "Extended Google Drive MCP server via gogcli — auth + full Drive support (upload/download/permissions/comments/shared drives)",
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": "^1.0.0",
27
+ "@chrischall/mcp-utils": "^2.1.0",
28
28
  "@modelcontextprotocol/server": "^2.0.0",
29
29
  "zod": "^4.6.1"
30
30
  },
package/server.json CHANGED
@@ -7,12 +7,12 @@
7
7
  "source": "github",
8
8
  "subfolder": "packages/gogcli-mcp-drive"
9
9
  },
10
- "version": "4.1.0",
10
+ "version": "4.2.1",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "gogcli-mcp-drive",
15
- "version": "4.1.0",
15
+ "version": "4.2.1",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  },