gogcli-mcp-classroom 4.1.0 → 4.2.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.
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "Extended Google Classroom for Claude via gogcli — auth + full Classroom support (courses, rosters, coursework, submissions, announcements, topics, invitations)",
10
- "version": "4.1.0"
10
+ "version": "4.2.0"
11
11
  },
12
12
  "plugins": [
13
13
  {
@@ -15,7 +15,7 @@
15
15
  "displayName": "gogcli (Classroom)",
16
16
  "source": "./",
17
17
  "description": "Extended Google Classroom for Claude via gogcli — auth + full Classroom support (courses, rosters, coursework, submissions, announcements, topics, invitations)",
18
- "version": "4.1.0",
18
+ "version": "4.2.0",
19
19
  "author": {
20
20
  "name": "Chris Hall"
21
21
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gogcli-mcp-classroom",
3
3
  "displayName": "gogcli (Classroom)",
4
- "version": "4.1.0",
4
+ "version": "4.2.0",
5
5
  "description": "Extended Google Classroom for Claude via gogcli — auth + full Classroom support (courses, rosters, coursework, submissions, announcements, topics, invitations)",
6
6
  "author": {
7
7
  "name": "Chris Hall",
package/dist/index.js CHANGED
@@ -5,6 +5,32 @@ 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) {
12
+ return signal ? storage.run({ signal }, 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
+
8
34
  // ../../node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs
9
35
  var __create = Object.create;
10
36
  var __defProp2 = Object.defineProperty;
@@ -34433,17 +34459,41 @@ Hint: ${err.hint}`);
34433
34459
  }
34434
34460
  throw err;
34435
34461
  }
34462
+ function callSignalFrom(args) {
34463
+ const ctx = args.at(-1);
34464
+ if (typeof ctx !== "object" || ctx === null)
34465
+ return void 0;
34466
+ const req = ctx.mcpReq;
34467
+ if (typeof req !== "object" || req === null)
34468
+ return void 0;
34469
+ const signal = req.signal;
34470
+ return signal instanceof AbortSignal ? signal : void 0;
34471
+ }
34436
34472
  function surfaceToolHints(server) {
34437
34473
  const register2 = server.registerTool.bind(server);
34438
- server.registerTool = (name, config2, cb) => register2(name, config2, (...args) => {
34439
- let result;
34440
- try {
34441
- result = cb(...args);
34442
- } catch (err) {
34443
- return hintResultOrRethrow(err);
34444
- }
34445
- return result instanceof Promise ? result.catch(hintResultOrRethrow) : result;
34446
- });
34474
+ server.registerTool = (name, config2, cb) => register2(name, config2, (...args) => (
34475
+ // THE CALLER'S CANCELLATION, made ambient for the whole handler
34476
+ // (`cancel/index.ts`). The SDK delivers it and the fleet ignored it:
34477
+ // measured against @modelcontextprotocol/server 2.0.0, a cancelled
34478
+ // call aborts `ctx.mcpReq.signal` with the caller's reason and the
34479
+ // handler runs to completion regardless — so the HTTP request stays
34480
+ // in flight, the child keeps burning metered CPU, and the upstream
34481
+ // keeps being hit for somebody who has gone. claude.ai sent 101
34482
+ // cancellations in the week to 2026-09-20.
34483
+ //
34484
+ // Here because this is the one wrapper every tool already passes
34485
+ // through: threading the signal by hand would mean editing several
34486
+ // hundred handlers and missing exactly the ones nobody edits.
34487
+ withCallSignal(callSignalFrom(args), () => {
34488
+ let result;
34489
+ try {
34490
+ result = cb(...args);
34491
+ } catch (err) {
34492
+ return hintResultOrRethrow(err);
34493
+ }
34494
+ return result instanceof Promise ? result.catch(hintResultOrRethrow) : result;
34495
+ })
34496
+ ));
34447
34497
  }
34448
34498
  async function createMcpServer(opts) {
34449
34499
  const server = new McpServer({ name: opts.name, version: opts.version }, { supportedProtocolVersions: [...SERVER_PROTOCOL_VERSIONS] });
@@ -34878,8 +34928,15 @@ async function spawnGog(fullArgs, opts) {
34878
34928
  const stdoutChunks = [];
34879
34929
  const stderrChunks = [];
34880
34930
  let settled = false;
34931
+ const cancelled = currentCallSignal();
34932
+ const stopWatchingCancel = killOnCancel(child);
34933
+ const stopWatching = () => {
34934
+ clearTimeout(timer);
34935
+ stopWatchingCancel();
34936
+ };
34881
34937
  const timer = setTimeout(() => {
34882
34938
  settled = true;
34939
+ stopWatchingCancel();
34883
34940
  child.kill();
34884
34941
  reject(new Error(`gog timed out after ${formatTimeout(effectiveTimeout)}`));
34885
34942
  }, effectiveTimeout);
@@ -34890,9 +34947,13 @@ async function spawnGog(fullArgs, opts) {
34890
34947
  stderrChunks.push(chunk);
34891
34948
  });
34892
34949
  child.on("close", (code) => {
34893
- clearTimeout(timer);
34950
+ stopWatching();
34894
34951
  if (settled) return;
34895
34952
  settled = true;
34953
+ if (cancelled?.aborted) {
34954
+ reject(cancelled.reason instanceof Error ? cancelled.reason : new Error("the caller cancelled this call"));
34955
+ return;
34956
+ }
34896
34957
  const stderr = Buffer.concat(stderrChunks).toString().trim();
34897
34958
  if (code === 0) {
34898
34959
  if (binary) {
@@ -34910,7 +34971,7 @@ async function spawnGog(fullArgs, opts) {
34910
34971
  }
34911
34972
  });
34912
34973
  child.on("error", (err) => {
34913
- clearTimeout(timer);
34974
+ stopWatching();
34914
34975
  if (settled) return;
34915
34976
  settled = true;
34916
34977
  if (err.code === "ENOENT") {
@@ -35732,7 +35793,7 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
35732
35793
  );
35733
35794
 
35734
35795
  // ../gogcli-mcp/src/server.ts
35735
- var VERSION = true ? "4.1.0" : "0.0.0";
35796
+ var VERSION = true ? "4.2.0" : "0.0.0";
35736
35797
 
35737
35798
  // ../gogcli-mcp/src/bootstrap-auth.ts
35738
35799
  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-classroom",
5
5
  "display_name": "gogcli (Classroom)",
6
- "version": "4.1.0",
6
+ "version": "4.2.0",
7
7
  "description": "Extended Google Classroom for Claude via gogcli — auth + full Classroom support (courses, rosters, coursework, submissions, announcements, topics, invitations)",
8
8
  "author": {
9
9
  "name": "Chris Hall",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gogcli-mcp-classroom",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "mcpName": "io.github.chrischall/gogcli-mcp-classroom",
5
5
  "description": "Extended Google Classroom MCP server via gogcli — auth + full Classroom support",
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.0.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-classroom"
9
9
  },
10
- "version": "4.1.0",
10
+ "version": "4.2.0",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "gogcli-mcp-classroom",
15
- "version": "4.1.0",
15
+ "version": "4.2.0",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  },