gogcli-mcp-classroom 2.21.0 → 2.21.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 Classroom for Claude via gogcli — auth + full Classroom support (courses, rosters, coursework, submissions, announcements, topics, invitations)",
10
- "version": "2.21.0"
10
+ "version": "2.21.1"
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": "2.21.0",
18
+ "version": "2.21.1",
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": "2.21.0",
4
+ "version": "2.21.1",
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
@@ -31140,6 +31140,21 @@ import { delimiter, join } from "node:path";
31140
31140
  function isGogFileArg(arg) {
31141
31141
  return typeof arg !== "string";
31142
31142
  }
31143
+ var RUNNER_TRANSPORT_BRAND = /* @__PURE__ */ Symbol.for("gogcli.RunnerTransportError");
31144
+ var RunnerTransportError = class extends Error {
31145
+ kind;
31146
+ status;
31147
+ constructor(message, kind, status) {
31148
+ super(message);
31149
+ this.name = "RunnerTransportError";
31150
+ this.kind = kind;
31151
+ this.status = status;
31152
+ Object.defineProperty(this, RUNNER_TRANSPORT_BRAND, { value: true });
31153
+ }
31154
+ };
31155
+ function isRunnerTransportError(err) {
31156
+ return err instanceof Error && err[RUNNER_TRANSPORT_BRAND] === true;
31157
+ }
31143
31158
  var runExecutor = new AsyncLocalStorage();
31144
31159
  var defaultExecutor;
31145
31160
  function setDefaultGogExecutor(executor) {
@@ -31320,7 +31335,11 @@ async function run(args, options = {}) {
31320
31335
  }
31321
31336
  return redact(output);
31322
31337
  } catch (err) {
31323
- throw new Error(redact(err instanceof Error ? err.message : String(err)));
31338
+ const message = redact(err instanceof Error ? err.message : String(err));
31339
+ if (isRunnerTransportError(err)) {
31340
+ throw new RunnerTransportError(message, err.kind, err.status);
31341
+ }
31342
+ throw new Error(message);
31324
31343
  }
31325
31344
  }
31326
31345
 
@@ -31572,7 +31591,7 @@ function registerRunTool(server, options) {
31572
31591
  function errorText(err) {
31573
31592
  return err instanceof Error ? `Error: ${err.message}` : String(err);
31574
31593
  }
31575
- var DEFINITE_AUTH_PATTERN = /\b(401|unauthorized|invalid_grant)\b/i;
31594
+ var DEFINITE_AUTH_PATTERN = /\b(?:unauthorized|invalid_grant)\b|\b(?:error|status|code|http|responded|response)["']?[\s:=(,]{0,4}401\b/i;
31576
31595
  var STALE_TOKEN_PATTERN = /\b(?:access[ _-]?)?token\b[^.;\n]{0,40}\b(?:has\s+)?(?:been\s+)?(?:expired|revoked)\b|\b(?:expired|revoked)\s+(?:access[ _-]?)?token\b/i;
31577
31596
  var AUTH_ERROR_PATTERN = new RegExp(`${DEFINITE_AUTH_PATTERN.source}|${STALE_TOKEN_PATTERN.source}`, "i");
31578
31597
  var INVALID_GRANT_PATTERN = /invalid_grant|token has been expired or revoked/i;
@@ -31582,6 +31601,14 @@ var AUTH_HINT = "\n\nAuthentication may have expired. Use gog_auth_add to re-aut
31582
31601
  var INVALID_GRANT_HINT = '\n\nThe stored refresh token was rejected (invalid_grant): it has expired or been revoked, so the whole account is signed out and re-authorization is required. The most common cause is the 7-day refresh-token limit Google applies to OAuth apps whose consent screen is still in "Testing" mode. Re-authorize with gog_auth_add (opens a browser) or gog_auth_add_url + gog_auth_add_complete (remote/headless). To stop this recurring, publish the OAuth consent screen to "In production" in the Google Cloud project that owns the OAuth client. Ask the user if they would like to re-authenticate.';
31583
31602
  var TRANSIENT_HINT = "\n\nThis error is often transient. Retry the same call before trying a different approach (do not fall back to smaller writes or row-by-row operations).";
31584
31603
  var GRID_LIMIT_HINT = "\n\nThe target range is outside the sheet's current grid. Add the missing rows or columns first with gog_sheets_insert (dimension: rows or cols), then retry the write.";
31604
+ var RUNNER_TRANSPORT_AUTH_HINT = "\n\nThis is the CONNECTOR's own transport auth failing, not your Google sign-in. The gog-runner backend rejected the bearer token this server sent, so the request never reached gog and no Google credential was checked \u2014 the Google account is not the problem and re-authorizing it cannot fix this. An operator must make the Worker secret GOG_RUNNER_KEY equal RUNNER_KEY on the Fly app (wrangler secret put GOG_RUNNER_KEY / fly secrets set RUNNER_KEY), then retry.";
31605
+ var RUNNER_TRANSPORT_HINTS = {
31606
+ "transport-auth": RUNNER_TRANSPORT_AUTH_HINT,
31607
+ // The request itself was malformed, so the runner will refuse it identically
31608
+ // every time. Nothing to advise beyond the message the runner already gave.
31609
+ "transport-request": "",
31610
+ "transport-retryable": TRANSIENT_HINT
31611
+ };
31585
31612
  function formatAccountList(raw) {
31586
31613
  try {
31587
31614
  const parsed = JSON.parse(raw);
@@ -31594,11 +31621,12 @@ function formatAccountList(raw) {
31594
31621
  }
31595
31622
  async function diagnose(err) {
31596
31623
  const errText = errorText(err);
31624
+ const transportHint = isRunnerTransportError(err) ? RUNNER_TRANSPORT_HINTS[err.kind] : void 0;
31597
31625
  const isInvalidGrant = INVALID_GRANT_PATTERN.test(errText);
31598
31626
  const isTransientError = !DEFINITE_AUTH_PATTERN.test(errText) && TRANSIENT_ERROR_PATTERN.test(errText);
31599
31627
  const isAuthError = !isTransientError && AUTH_ERROR_PATTERN.test(errText);
31600
31628
  const isGridLimitError = GRID_LIMIT_ERROR_PATTERN.test(errText);
31601
- const hint = isInvalidGrant ? INVALID_GRANT_HINT : isAuthError ? AUTH_HINT : isTransientError ? TRANSIENT_HINT : isGridLimitError ? GRID_LIMIT_HINT : "";
31629
+ const hint = transportHint ?? (isInvalidGrant ? INVALID_GRANT_HINT : isAuthError ? AUTH_HINT : isTransientError ? TRANSIENT_HINT : isGridLimitError ? GRID_LIMIT_HINT : "");
31602
31630
  try {
31603
31631
  const accounts = formatAccountList(await run(["auth", "list"]));
31604
31632
  return errorResult(`${errText}
@@ -32162,7 +32190,25 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
32162
32190
  );
32163
32191
 
32164
32192
  // ../gogcli-mcp/src/server.ts
32165
- var VERSION = true ? "2.21.0" : "0.0.0";
32193
+ var VERSION = true ? "2.21.1" : "0.0.0";
32194
+
32195
+ // ../gogcli-mcp/src/auth-log.ts
32196
+ var FAILURES = /* @__PURE__ */ new Set([
32197
+ "token.mint-failed",
32198
+ "grant.dead",
32199
+ "replay.failed",
32200
+ "runner.auth-failed"
32201
+ ]);
32202
+ var PREFIX = "gog-auth ";
32203
+ var TAG_CHARS = 12;
32204
+ function credentialTag(cacheKeyHash) {
32205
+ return cacheKeyHash.slice(0, TAG_CHARS);
32206
+ }
32207
+ function logAuthTransition(event, context) {
32208
+ const record2 = JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), event, ...context });
32209
+ const write = FAILURES.has(event) ? console.error : console.warn;
32210
+ write(PREFIX + redactSecrets2(record2));
32211
+ }
32166
32212
 
32167
32213
  // ../gogcli-mcp/src/google-token.ts
32168
32214
  var TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token";
@@ -32189,22 +32235,73 @@ function makeAccessTokenSource(env) {
32189
32235
  );
32190
32236
  };
32191
32237
  }
32192
- return async () => {
32193
- const key = await cacheKey(refreshToken, clientId);
32194
- const hit = cache.get(key);
32195
- if (hit && hit.expiresAt - EXPIRY_MARGIN_MS > Date.now()) return hit.accessToken;
32196
- let pending = inFlight.get(key);
32238
+ let keyPromise;
32239
+ const key = () => keyPromise ??= cacheKey(refreshToken, clientId);
32240
+ const logCacheHits = parseBoolEnv("GOG_AUTH_LOG_CACHE_HITS", { env });
32241
+ const read = async () => {
32242
+ const k = await key();
32243
+ const hit = cache.get(k);
32244
+ if (hit && hit.expiresAt - EXPIRY_MARGIN_MS > Date.now()) {
32245
+ if (logCacheHits) logAuthTransition("token.cache-hit", { credential: credentialTag(k) });
32246
+ return hit.accessToken;
32247
+ }
32248
+ let pending = inFlight.get(k);
32197
32249
  if (!pending) {
32198
32250
  pending = exchange(refreshToken, clientId, clientSecret).then((minted2) => {
32199
- cache.set(key, minted2);
32251
+ cache.set(k, minted2);
32252
+ logAuthTransition("token.minted", {
32253
+ credential: credentialTag(k),
32254
+ reason: `valid for ${Math.round((minted2.expiresAt - Date.now()) / 1e3)}s`
32255
+ });
32200
32256
  return minted2;
32201
- }).finally(() => inFlight.delete(key));
32202
- inFlight.set(key, pending);
32257
+ }).catch((err) => {
32258
+ logAuthTransition(err.grantDead ? "grant.dead" : "token.mint-failed", {
32259
+ credential: credentialTag(k),
32260
+ reason: err.message
32261
+ });
32262
+ throw err;
32263
+ }).finally(() => inFlight.delete(k));
32264
+ inFlight.set(k, pending);
32203
32265
  }
32204
32266
  const minted = await pending;
32205
32267
  return minted.accessToken;
32206
32268
  };
32269
+ const invalidate = async (rejected) => {
32270
+ const k = await key();
32271
+ const hit = cache.get(k);
32272
+ if (!hit || hit.accessToken !== rejected) {
32273
+ logAuthTransition("token.evict-noop", {
32274
+ credential: credentialTag(k),
32275
+ reason: hit ? "a concurrent caller had already replaced this credential\u2019s token" : "no token was cached for this credential"
32276
+ });
32277
+ return false;
32278
+ }
32279
+ cache.delete(k);
32280
+ logAuthTransition("token.evicted", {
32281
+ credential: credentialTag(k),
32282
+ reason: "Google rejected this access token; the next read will mint a new one"
32283
+ });
32284
+ return true;
32285
+ };
32286
+ return Object.assign(read, {
32287
+ invalidate,
32288
+ credentialId: async () => credentialTag(await key())
32289
+ });
32207
32290
  }
32291
+ var TokenExchangeError = class extends Error {
32292
+ /**
32293
+ * The REFRESH token is dead (Google's `invalid_grant`), not merely the access
32294
+ * token. Carried as a flag rather than re-read from the message, because
32295
+ * inferring the author of a failure from prose several authors can produce is
32296
+ * precisely the mistake this branch exists to undo. `instanceof` is safe: the
32297
+ * class is thrown and caught inside this one module.
32298
+ */
32299
+ grantDead;
32300
+ constructor(message, grantDead) {
32301
+ super(message);
32302
+ this.grantDead = grantDead;
32303
+ }
32304
+ };
32208
32305
  async function exchange(refreshToken, clientId, clientSecret) {
32209
32306
  let res;
32210
32307
  try {
@@ -32219,23 +32316,29 @@ async function exchange(refreshToken, clientId, clientSecret) {
32219
32316
  }).toString()
32220
32317
  });
32221
32318
  } catch (err) {
32222
- throw new Error(
32223
- `the Google token exchange could not be reached: ${err instanceof Error ? err.message : String(err)}`
32319
+ throw new TokenExchangeError(
32320
+ `the Google token exchange could not be reached: ${err instanceof Error ? err.message : String(err)}`,
32321
+ false
32224
32322
  );
32225
32323
  }
32226
32324
  const body = await res.json().catch(() => ({}));
32227
32325
  if (!res.ok) {
32228
32326
  if (body.error === "invalid_grant") {
32229
- throw new Error(
32230
- 'the stored refresh token has expired or been revoked, so this account must be re-authorized (commonly the 7-day limit on OAuth consent screens still in "Testing" mode). Re-enrol with gog_auth_add_url + gog_auth_add_complete and store the new refresh token.'
32327
+ throw new TokenExchangeError(
32328
+ 'the stored refresh token was rejected (invalid_grant): it has expired or been revoked, so this account must be re-authorized (commonly the 7-day limit on OAuth consent screens still in "Testing" mode). Re-enrol with gog_auth_add_url + gog_auth_add_complete and store the new refresh token.',
32329
+ true
32231
32330
  );
32232
32331
  }
32233
- throw new Error(
32234
- `the access token could not be refreshed (HTTP ${res.status}${body.error ? `, ${body.error}` : ""})`
32332
+ throw new TokenExchangeError(
32333
+ `the access token could not be refreshed (HTTP ${res.status}${body.error ? `, ${body.error}` : ""})`,
32334
+ false
32235
32335
  );
32236
32336
  }
32237
32337
  if (!body.access_token) {
32238
- throw new Error("the access token could not be refreshed: Google returned no access_token");
32338
+ throw new TokenExchangeError(
32339
+ "the access token could not be refreshed: Google returned no access_token",
32340
+ false
32341
+ );
32239
32342
  }
32240
32343
  const expiresInMs = (body.expires_in ?? 3600) * 1e3;
32241
32344
  return { accessToken: body.access_token, expiresAt: Date.now() + expiresInMs };
@@ -32244,54 +32347,218 @@ async function exchange(refreshToken, clientId, clientSecret) {
32244
32347
  // ../gogcli-mcp/src/connector-runtime.ts
32245
32348
  var DEFAULT_TIMEOUT_MS = 3e4;
32246
32349
  var DEADLINE_GRACE_MS = 5e3;
32350
+ var MIN_REPLAY_BUDGET_MS = 1e3;
32247
32351
  var RUNNER_GOG_FAILED = 422;
32248
32352
  var RUNNER_DRAINING = 503;
32353
+ var RUNNER_BAD_REQUEST = 400;
32354
+ var RUNNER_BAD_KEY = 401;
32355
+ var GogFailedError = class extends Error {
32356
+ /** gog's stderr alone, with no echoed argv mixed in. */
32357
+ stderr;
32358
+ constructor(message, stderr) {
32359
+ super(message);
32360
+ this.stderr = stderr;
32361
+ }
32362
+ };
32363
+ var GOOGLE_TOKEN_REJECTED_PATTERN = /Google API error \(401\b|invalid[ _]authentication[ _]credentials|\bACCESS_TOKEN_EXPIRED\b|\binvalid_token\b/i;
32364
+ var REFRESH_TOKEN_DEAD_PATTERN = /\binvalid_grant\b/i;
32365
+ var READ_ONLY_SUBCOMMANDS = /* @__PURE__ */ new Set([
32366
+ "cat",
32367
+ "describe",
32368
+ "get",
32369
+ "info",
32370
+ "list",
32371
+ "list-slides",
32372
+ "ls",
32373
+ "metadata",
32374
+ "read-slide",
32375
+ "search",
32376
+ "services",
32377
+ "status",
32378
+ "structure"
32379
+ ]);
32380
+ function gogTarget(args) {
32381
+ const words = args.filter((arg) => typeof arg === "string");
32382
+ let service;
32383
+ for (let i = 0; i < words.length; i += 1) {
32384
+ const word = words[i];
32385
+ if (word.startsWith("-")) {
32386
+ if (word === "--account") i += 1;
32387
+ continue;
32388
+ }
32389
+ if (service === void 0) {
32390
+ service = word;
32391
+ continue;
32392
+ }
32393
+ return { service, subcommand: word };
32394
+ }
32395
+ return { service };
32396
+ }
32397
+ async function remintAfterGoogleRejection(err, used, args, readAccessToken, deadlineAt) {
32398
+ if (!(err instanceof GogFailedError)) return void 0;
32399
+ const grantDead = REFRESH_TOKEN_DEAD_PATTERN.test(err.stderr);
32400
+ if (!grantDead && !GOOGLE_TOKEN_REJECTED_PATTERN.test(err.stderr)) return void 0;
32401
+ const { service, subcommand } = gogTarget(args);
32402
+ const credential = await readAccessToken?.credentialId?.();
32403
+ const where = { credential, service };
32404
+ if (grantDead) {
32405
+ logAuthTransition("grant.dead", {
32406
+ ...where,
32407
+ reason: "gog reported invalid_grant: the stored refresh token is dead, so no token can be minted and this account must be re-authorized"
32408
+ });
32409
+ return void 0;
32410
+ }
32411
+ if (!used) {
32412
+ logAuthTransition("replay.declined", {
32413
+ ...where,
32414
+ reason: "no access token was supplied with the call, so gog acted as the backend volume\u2019s own identity"
32415
+ });
32416
+ return void 0;
32417
+ }
32418
+ if (!readAccessToken?.invalidate) {
32419
+ logAuthTransition("replay.declined", {
32420
+ ...where,
32421
+ reason: "this token source cannot mint a replacement, so a replay would resend the rejected token"
32422
+ });
32423
+ return void 0;
32424
+ }
32425
+ const evicted = await readAccessToken.invalidate(used);
32426
+ if (subcommand === void 0 || !READ_ONLY_SUBCOMMANDS.has(subcommand)) {
32427
+ logAuthTransition("replay.declined", {
32428
+ ...where,
32429
+ reason: `not replayable: '${subcommand ?? "(none)"}' is not a known read-only subcommand and a write could double-apply`
32430
+ });
32431
+ return void 0;
32432
+ }
32433
+ if (!evicted) {
32434
+ logAuthTransition("replay.declined", {
32435
+ ...where,
32436
+ reason: "the rejected token was already superseded, so the cache holds the token a replay would send"
32437
+ });
32438
+ return void 0;
32439
+ }
32440
+ const fresh = await readAccessToken();
32441
+ if (!fresh) {
32442
+ logAuthTransition("replay.declined", {
32443
+ ...where,
32444
+ reason: "the token source produced no token after eviction; replaying without one would act as the backend"
32445
+ });
32446
+ return void 0;
32447
+ }
32448
+ const budgetMs = deadlineAt - Date.now();
32449
+ if (budgetMs < MIN_REPLAY_BUDGET_MS) {
32450
+ logAuthTransition("replay.declined", {
32451
+ ...where,
32452
+ reason: `only ${budgetMs}ms of the call\u2019s deadline remained, so a replay could only time out; the rejected token was evicted, so the next call mints a fresh one`
32453
+ });
32454
+ return void 0;
32455
+ }
32456
+ return { token: fresh, budgetMs, invalidate: readAccessToken.invalidate, ...where };
32457
+ }
32249
32458
  function makeFlyExecutor(endpoint, key, readAccessToken) {
32250
32459
  return async (args, opts) => {
32251
32460
  const deadlineMs = (opts?.timeout ?? DEFAULT_TIMEOUT_MS) + DEADLINE_GRACE_MS;
32252
32461
  const accessToken = await readAccessToken?.();
32253
- let res;
32462
+ const deadlineAt = Date.now() + deadlineMs;
32254
32463
  try {
32255
- res = await fetch(endpoint + "/run", {
32256
- method: "POST",
32257
- headers: {
32258
- Authorization: "Bearer " + key,
32259
- "Content-Type": "application/json"
32260
- },
32261
- body: JSON.stringify(accessToken ? { args, accessToken } : { args }),
32262
- signal: AbortSignal.timeout(deadlineMs)
32263
- });
32464
+ return await attempt(endpoint, key, args, accessToken, deadlineMs);
32264
32465
  } catch (err) {
32265
- const name = err instanceof Error ? err.name : "";
32266
- if (name === "TimeoutError" || name === "AbortError") {
32267
- throw new Error(
32268
- `gog-runner did not respond within ${deadlineMs}ms (${endpoint}) \u2014 the Fly backend may be cold or wedged`
32269
- );
32466
+ const replay = await remintAfterGoogleRejection(
32467
+ err,
32468
+ accessToken,
32469
+ args,
32470
+ readAccessToken,
32471
+ deadlineAt
32472
+ );
32473
+ if (replay === void 0) throw err;
32474
+ const where = { credential: replay.credential, service: replay.service, endpoint };
32475
+ logAuthTransition("replay.attempted", {
32476
+ ...where,
32477
+ reason: "Google rejected the access token; replaying this read once with a freshly minted one"
32478
+ });
32479
+ try {
32480
+ const stdout = await attempt(endpoint, key, args, replay.token, replay.budgetMs);
32481
+ logAuthTransition("replay.succeeded", where);
32482
+ return stdout;
32483
+ } catch (replayErr) {
32484
+ logAuthTransition("replay.failed", { ...where, reason: String(replayErr) });
32485
+ if (replayErr instanceof GogFailedError && GOOGLE_TOKEN_REJECTED_PATTERN.test(replayErr.stderr)) {
32486
+ await replay.invalidate(replay.token);
32487
+ }
32488
+ throw replayErr;
32270
32489
  }
32271
- throw err;
32272
32490
  }
32273
- if (!res.ok) {
32274
- const body = await res.json().catch(() => null);
32275
- const detail = body && typeof body.error === "string" ? body.stderr && body.stderr.trim() && body.stderr.trim() !== body.error.trim() ? `${body.error}
32491
+ };
32492
+ }
32493
+ async function attempt(endpoint, key, args, accessToken, deadlineMs) {
32494
+ let res;
32495
+ try {
32496
+ res = await fetch(endpoint + "/run", {
32497
+ method: "POST",
32498
+ headers: {
32499
+ Authorization: "Bearer " + key,
32500
+ "Content-Type": "application/json"
32501
+ },
32502
+ body: JSON.stringify(accessToken ? { args, accessToken } : { args }),
32503
+ signal: AbortSignal.timeout(deadlineMs)
32504
+ });
32505
+ } catch (err) {
32506
+ const name = err instanceof Error ? err.name : "";
32507
+ if (name === "TimeoutError" || name === "AbortError") {
32508
+ throw new RunnerTransportError(
32509
+ `gog-runner did not respond within ${deadlineMs}ms (${endpoint}) \u2014 the Fly backend may be cold or wedged`,
32510
+ "transport-retryable"
32511
+ );
32512
+ }
32513
+ throw err;
32514
+ }
32515
+ if (!res.ok) {
32516
+ const body = await res.json().catch(() => null);
32517
+ const detail = body && typeof body.error === "string" ? body.stderr && body.stderr.trim() && body.stderr.trim() !== body.error.trim() ? `${body.error}
32276
32518
  ${body.stderr}` : body.error : "";
32277
- if (res.status === RUNNER_GOG_FAILED) {
32278
- throw new Error(detail || "gog failed on the runner (no detail supplied)");
32279
- }
32280
- if (res.status === RUNNER_DRAINING || body?.retryable === true) {
32281
- throw new Error(
32282
- `gog-runner is restarting; retry this call.${detail ? ` ${detail}` : ""}`
32283
- );
32284
- }
32285
- if (detail) {
32286
- throw new Error(detail);
32287
- }
32288
- throw new Error(
32289
- `gog-runner HTTP ${res.status}: the response did not come from the runner, so the request never reached gog. The backend Machine was most likely starting or shutting down \u2014 this is transient, retry the same call.`
32519
+ if (res.status === RUNNER_GOG_FAILED) {
32520
+ throw new GogFailedError(
32521
+ detail || "gog failed on the runner (no detail supplied)",
32522
+ typeof body?.stderr === "string" ? body.stderr : ""
32290
32523
  );
32291
32524
  }
32292
- const { stdout } = await res.json();
32293
- return stdout;
32294
- };
32525
+ if (res.status === RUNNER_BAD_KEY) {
32526
+ logAuthTransition("runner.auth-failed", {
32527
+ service: gogTarget(args).service,
32528
+ endpoint,
32529
+ reason: "the gog-runner rejected the connector\u2019s bearer token, so gog never ran and no Google credential was read; GOG_RUNNER_KEY does not match the Fly app\u2019s RUNNER_KEY"
32530
+ });
32531
+ throw new RunnerTransportError(
32532
+ "gog-runner rejected the connector's bearer token, so the request never reached gog and no Google credential was involved. The Worker secret GOG_RUNNER_KEY no longer matches RUNNER_KEY on the Fly app; set them to the same value (wrangler secret put GOG_RUNNER_KEY / fly secrets set RUNNER_KEY) and retry.",
32533
+ "transport-auth",
32534
+ res.status
32535
+ );
32536
+ }
32537
+ if (res.status === RUNNER_BAD_REQUEST) {
32538
+ throw new RunnerTransportError(
32539
+ detail || "gog-runner rejected the request (no detail supplied)",
32540
+ "transport-request",
32541
+ res.status
32542
+ );
32543
+ }
32544
+ if (res.status === RUNNER_DRAINING || body?.retryable === true) {
32545
+ throw new RunnerTransportError(
32546
+ `gog-runner is restarting; retry this call.${detail ? ` ${detail}` : ""}`,
32547
+ "transport-retryable",
32548
+ res.status
32549
+ );
32550
+ }
32551
+ if (detail) {
32552
+ throw new Error(detail);
32553
+ }
32554
+ throw new RunnerTransportError(
32555
+ `gog-runner HTTP ${res.status}: the response did not come from the runner, so the request never reached gog. The backend Machine was most likely starting or shutting down \u2014 this is transient, retry the same call.`,
32556
+ "transport-retryable",
32557
+ res.status
32558
+ );
32559
+ }
32560
+ const { stdout } = await res.json();
32561
+ return stdout;
32295
32562
  }
32296
32563
 
32297
32564
  // ../gogcli-mcp/src/remote-runner.ts
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": "2.21.0",
6
+ "version": "2.21.1",
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": "2.21.0",
3
+ "version": "2.21.1",
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>",
package/server.json CHANGED
@@ -7,12 +7,12 @@
7
7
  "source": "github",
8
8
  "subfolder": "packages/gogcli-mcp-classroom"
9
9
  },
10
- "version": "2.21.0",
10
+ "version": "2.21.1",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "gogcli-mcp-classroom",
15
- "version": "2.21.0",
15
+ "version": "2.21.1",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  },