gogcli-mcp-calendar 2.21.1 → 2.23.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 +119 -8
- package/manifest.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31430,6 +31430,13 @@ var TIMESTAMP_KEYS = /* @__PURE__ */ new Set([
|
|
|
31430
31430
|
// Calendar event start/end
|
|
31431
31431
|
"internalDate",
|
|
31432
31432
|
// Gmail, epoch milliseconds (authoritative)
|
|
31433
|
+
// gog >= 0.35.0 Gmail message AND thread listings. Already offset-bearing
|
|
31434
|
+
// (RFC3339 from internalDate), so it needs no offset repair — it is
|
|
31435
|
+
// allowlisted purely to gain a Display sibling, and to be re-rendered in
|
|
31436
|
+
// DISPLAY_TZ like every other instant. Separately sourced from the sibling
|
|
31437
|
+
// `date`, which is a naive re-format of the sender's Date header; the two may
|
|
31438
|
+
// legitimately disagree. See docs/timestamps.md.
|
|
31439
|
+
"internalDateIso",
|
|
31433
31440
|
"modifiedTime",
|
|
31434
31441
|
// Drive
|
|
31435
31442
|
"createdTime",
|
|
@@ -31659,8 +31666,8 @@ function formatOneAccountHealth(a, now) {
|
|
|
31659
31666
|
const age = ageInDays(a.created_at, now);
|
|
31660
31667
|
const ageStr = age === null ? "" : ` Authorized ${age.toFixed(1)} day(s) ago.`;
|
|
31661
31668
|
if (a.valid === false) {
|
|
31662
|
-
const
|
|
31663
|
-
return `\u2717 ${email3}: NEEDS RE-AUTH \u2014 ${
|
|
31669
|
+
const cause2 = INVALID_GRANT_PATTERN.test(a.error ?? "") ? 'refresh token expired or revoked \u2014 commonly the 7-day limit on OAuth consent screens still in "Testing" mode' : a.error?.trim() || "unknown error";
|
|
31670
|
+
return `\u2717 ${email3}: NEEDS RE-AUTH \u2014 ${cause2}.${ageStr} Re-authorize with gog_auth_add (browser) or gog_auth_add_url + gog_auth_add_complete (remote/headless).`;
|
|
31664
31671
|
}
|
|
31665
31672
|
if (a.valid === true) {
|
|
31666
31673
|
let line = `\u2713 ${email3}: token valid.${ageStr}`;
|
|
@@ -31702,7 +31709,7 @@ function registerAuthToolsWith(server, defaultServices) {
|
|
|
31702
31709
|
}
|
|
31703
31710
|
});
|
|
31704
31711
|
server.registerTool("gog_auth_status", {
|
|
31705
|
-
description: "Show gogcli auth
|
|
31712
|
+
description: "Show gogcli auth CONFIGURATION: keyring backend, credential files, and auth setup. Despite the name this is not a health check \u2014 it reads local setup and does not contact Google, so it says nothing about whether an account can still authenticate. Use gog_auth_health for that.",
|
|
31706
31713
|
annotations: { readOnlyHint: true },
|
|
31707
31714
|
inputSchema: {}
|
|
31708
31715
|
}, async () => {
|
|
@@ -31713,7 +31720,7 @@ function registerAuthToolsWith(server, defaultServices) {
|
|
|
31713
31720
|
}
|
|
31714
31721
|
});
|
|
31715
31722
|
server.registerTool("gog_auth_health", {
|
|
31716
|
-
description: 'Check the LIVE health of each stored Google account. Unlike gog_auth_status (which only reports keyring/config setup), this performs a real token refresh against Google, so it detects expired or revoked (invalid_grant) refresh tokens \u2014 the account-wide sign-out that blocks every service. Reports per account: whether the token is currently valid, the mapped cause when it is not, how long ago it was authorized, and a warning as it approaches the 7-day refresh-token limit that applies to OAuth apps whose consent screen is still in "Testing" mode. Run it proactively to re-authorize on your own schedule instead of mid-task.',
|
|
31723
|
+
description: 'Check the LIVE health of each stored Google account. Unlike gog_auth_status (which only reports keyring/config setup), this performs a real token refresh against Google, so it detects expired or revoked (invalid_grant) refresh tokens \u2014 the account-wide sign-out that blocks every service. Reports per account: whether the token is currently valid, the mapped cause when it is not, how long ago it was authorized, and a warning as it approaches the 7-day refresh-token limit that applies to OAuth apps whose consent screen is still in "Testing" mode. Run it proactively to re-authorize on your own schedule instead of mid-task. On the hosted connector this is the ONLY check that measures Google: a connector showing "connected" or "refreshed" has verified the connector key that reaches the gog machine, and nothing else \u2014 the Google credential lives on that machine and can be dead while the connection looks perfectly healthy.',
|
|
31717
31724
|
annotations: { readOnlyHint: true },
|
|
31718
31725
|
inputSchema: {}
|
|
31719
31726
|
}, async () => {
|
|
@@ -31954,14 +31961,29 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
|
|
|
31954
31961
|
);
|
|
31955
31962
|
|
|
31956
31963
|
// ../gogcli-mcp/src/server.ts
|
|
31957
|
-
var VERSION = true ? "2.
|
|
31964
|
+
var VERSION = true ? "2.23.0" : "0.0.0";
|
|
31958
31965
|
|
|
31959
31966
|
// ../gogcli-mcp/src/auth-log.ts
|
|
31960
31967
|
var FAILURES = /* @__PURE__ */ new Set([
|
|
31961
31968
|
"token.mint-failed",
|
|
31962
31969
|
"grant.dead",
|
|
31963
31970
|
"replay.failed",
|
|
31964
|
-
"runner.auth-failed"
|
|
31971
|
+
"runner.auth-failed",
|
|
31972
|
+
"connect.key-rejected",
|
|
31973
|
+
// An enrolment that could not proceed is a failure even though nobody is at
|
|
31974
|
+
// fault: it is the only trace a half-enrolled connector leaves behind, and
|
|
31975
|
+
// the absence of exactly this record is why DEFECT 4 could not be explained.
|
|
31976
|
+
"connect.runner-unreachable",
|
|
31977
|
+
"connect.google-unhealthy",
|
|
31978
|
+
"refusal.google-unhealthy",
|
|
31979
|
+
// The loudest record on this branch, and the only one that means "we cannot
|
|
31980
|
+
// explain this". Google refused a real call while a live check of the same
|
|
31981
|
+
// credential, taken seconds later, succeeded — so neither the 7-day cliff nor
|
|
31982
|
+
// a revoked grant accounts for it. It is filed as a failure precisely because
|
|
31983
|
+
// it is the record nobody may scroll past: it is the only evidence that could
|
|
31984
|
+
// ever justify building something on the hosted path, and its absence over
|
|
31985
|
+
// time is what retires that theory for good.
|
|
31986
|
+
"refusal.google-ok"
|
|
31965
31987
|
]);
|
|
31966
31988
|
var PREFIX = "gog-auth ";
|
|
31967
31989
|
var TAG_CHARS = 12;
|
|
@@ -32108,10 +32130,39 @@ async function exchange(refreshToken, clientId, clientSecret) {
|
|
|
32108
32130
|
return { accessToken: body.access_token, expiresAt: Date.now() + expiresInMs };
|
|
32109
32131
|
}
|
|
32110
32132
|
|
|
32133
|
+
// ../gogcli-mcp/src/google-probe.ts
|
|
32134
|
+
var bool = (value) => typeof value === "boolean" ? value : void 0;
|
|
32135
|
+
var cause = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
|
|
32136
|
+
function readGoogleProbe(body) {
|
|
32137
|
+
const record2 = typeof body === "object" && body !== null ? body : {};
|
|
32138
|
+
const measured = bool(record2.measured);
|
|
32139
|
+
const reported = cause(record2.error);
|
|
32140
|
+
if (measured === false) {
|
|
32141
|
+
return {
|
|
32142
|
+
kind: "unmeasured",
|
|
32143
|
+
reason: reported ?? "the runner reported it could not measure the Google layer"
|
|
32144
|
+
};
|
|
32145
|
+
}
|
|
32146
|
+
if (measured === true) {
|
|
32147
|
+
if (bool(record2.ok) === true) return { kind: "ok" };
|
|
32148
|
+
return {
|
|
32149
|
+
kind: "unhealthy",
|
|
32150
|
+
reason: reported ?? "the runner reported the Google layer unhealthy with no cause"
|
|
32151
|
+
};
|
|
32152
|
+
}
|
|
32153
|
+
return {
|
|
32154
|
+
kind: "unmeasured",
|
|
32155
|
+
reason: reported ? `the runner did not report whether it measured the Google layer; it said: ${reported}` : "the runner did not report whether it measured the Google layer"
|
|
32156
|
+
};
|
|
32157
|
+
}
|
|
32158
|
+
|
|
32111
32159
|
// ../gogcli-mcp/src/connector-runtime.ts
|
|
32112
32160
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
32113
32161
|
var DEADLINE_GRACE_MS = 5e3;
|
|
32114
32162
|
var MIN_REPLAY_BUDGET_MS = 1e3;
|
|
32163
|
+
var REFUSAL_PROBE_TIMEOUT_MS = 4e3;
|
|
32164
|
+
var MIN_PROBE_BUDGET_MS = 1e3;
|
|
32165
|
+
var PROBE_INTERVAL_MS = 6e4;
|
|
32115
32166
|
var RUNNER_GOG_FAILED = 422;
|
|
32116
32167
|
var RUNNER_DRAINING = 503;
|
|
32117
32168
|
var RUNNER_BAD_REQUEST = 400;
|
|
@@ -32158,7 +32209,7 @@ function gogTarget(args) {
|
|
|
32158
32209
|
}
|
|
32159
32210
|
return { service };
|
|
32160
32211
|
}
|
|
32161
|
-
async function remintAfterGoogleRejection(err, used, args, readAccessToken, deadlineAt) {
|
|
32212
|
+
async function remintAfterGoogleRejection(err, used, args, readAccessToken, deadlineAt, probeGoogle) {
|
|
32162
32213
|
if (!(err instanceof GogFailedError)) return void 0;
|
|
32163
32214
|
const grantDead = REFRESH_TOKEN_DEAD_PATTERN.test(err.stderr);
|
|
32164
32215
|
if (!grantDead && !GOOGLE_TOKEN_REJECTED_PATTERN.test(err.stderr)) return void 0;
|
|
@@ -32173,6 +32224,7 @@ async function remintAfterGoogleRejection(err, used, args, readAccessToken, dead
|
|
|
32173
32224
|
return void 0;
|
|
32174
32225
|
}
|
|
32175
32226
|
if (!used) {
|
|
32227
|
+
await probeGoogle(where);
|
|
32176
32228
|
logAuthTransition("replay.declined", {
|
|
32177
32229
|
...where,
|
|
32178
32230
|
reason: "no access token was supplied with the call, so gog acted as the backend volume\u2019s own identity"
|
|
@@ -32220,6 +32272,64 @@ async function remintAfterGoogleRejection(err, used, args, readAccessToken, dead
|
|
|
32220
32272
|
return { token: fresh, budgetMs, invalidate: readAccessToken.invalidate, ...where };
|
|
32221
32273
|
}
|
|
32222
32274
|
function makeFlyExecutor(endpoint, key, readAccessToken) {
|
|
32275
|
+
let lastProbeAt = Number.NEGATIVE_INFINITY;
|
|
32276
|
+
const probeGoogleAfterRefusal = async (where, deadlineAt) => {
|
|
32277
|
+
const record2 = { ...where, endpoint };
|
|
32278
|
+
const now = Date.now();
|
|
32279
|
+
const remainingMs = deadlineAt - now;
|
|
32280
|
+
if (remainingMs < MIN_PROBE_BUDGET_MS) {
|
|
32281
|
+
logAuthTransition("refusal.google-unmeasured", {
|
|
32282
|
+
...record2,
|
|
32283
|
+
reason: `only ${remainingMs}ms of the call\u2019s deadline remained, so the Google layer was not measured rather than delay the caller\u2019s own error`
|
|
32284
|
+
});
|
|
32285
|
+
return;
|
|
32286
|
+
}
|
|
32287
|
+
if (now - lastProbeAt < PROBE_INTERVAL_MS) {
|
|
32288
|
+
logAuthTransition("refusal.google-unmeasured", {
|
|
32289
|
+
...record2,
|
|
32290
|
+
// "attempted", not "measured". `lastProbeAt` is stamped before the
|
|
32291
|
+
// fetch and is deliberately NOT reset when the probe comes back with no
|
|
32292
|
+
// verdict (a 404 from a runner too old to have the endpoint, a timeout,
|
|
32293
|
+
// a dead socket) — the backend cost this throttle exists to bound was
|
|
32294
|
+
// paid either way, and resetting it would let a retry loop storm a
|
|
32295
|
+
// runner that is already unwell. So the timestamp stays and the sentence
|
|
32296
|
+
// has to be the true one: on this branch a log line may not assert a
|
|
32297
|
+
// measurement that never happened, and the previous probe may well have
|
|
32298
|
+
// measured nothing at all.
|
|
32299
|
+
reason: "a Google probe was attempted recently, so another was not sent: this probe spawns gog on the backend and takes the keyring\u2019s exclusive lock"
|
|
32300
|
+
});
|
|
32301
|
+
return;
|
|
32302
|
+
}
|
|
32303
|
+
lastProbeAt = now;
|
|
32304
|
+
let event;
|
|
32305
|
+
let reason;
|
|
32306
|
+
try {
|
|
32307
|
+
const res = await fetch(`${endpoint}/health/google`, {
|
|
32308
|
+
headers: { Authorization: `Bearer ${key}` },
|
|
32309
|
+
// Never more than the probe's own budget, never more than the call has
|
|
32310
|
+
// left. `Math.min` rather than a plain constant because the second
|
|
32311
|
+
// bound is the caller's, and it outranks ours.
|
|
32312
|
+
signal: AbortSignal.timeout(Math.min(REFUSAL_PROBE_TIMEOUT_MS, remainingMs))
|
|
32313
|
+
});
|
|
32314
|
+
if (!res.ok) {
|
|
32315
|
+
event = "refusal.google-unmeasured";
|
|
32316
|
+
reason = `the runner did not answer the Google probe (HTTP ${res.status})`;
|
|
32317
|
+
} else {
|
|
32318
|
+
const verdict = readGoogleProbe(await res.json());
|
|
32319
|
+
if (verdict.kind === "ok") {
|
|
32320
|
+
event = "refusal.google-ok";
|
|
32321
|
+
reason = "Google refused this call, yet a live token check on the same volume succeeded \u2014 so a dead or expired refresh token does not explain this refusal";
|
|
32322
|
+
} else {
|
|
32323
|
+
event = verdict.kind === "unhealthy" ? "refusal.google-unhealthy" : "refusal.google-unmeasured";
|
|
32324
|
+
reason = verdict.reason;
|
|
32325
|
+
}
|
|
32326
|
+
}
|
|
32327
|
+
} catch (err) {
|
|
32328
|
+
event = "refusal.google-unmeasured";
|
|
32329
|
+
reason = err instanceof Error ? err.message : String(err);
|
|
32330
|
+
}
|
|
32331
|
+
logAuthTransition(event, { ...record2, reason });
|
|
32332
|
+
};
|
|
32223
32333
|
return async (args, opts) => {
|
|
32224
32334
|
const deadlineMs = (opts?.timeout ?? DEFAULT_TIMEOUT_MS) + DEADLINE_GRACE_MS;
|
|
32225
32335
|
const accessToken = await readAccessToken?.();
|
|
@@ -32232,7 +32342,8 @@ function makeFlyExecutor(endpoint, key, readAccessToken) {
|
|
|
32232
32342
|
accessToken,
|
|
32233
32343
|
args,
|
|
32234
32344
|
readAccessToken,
|
|
32235
|
-
deadlineAt
|
|
32345
|
+
deadlineAt,
|
|
32346
|
+
(where2) => probeGoogleAfterRefusal(where2, deadlineAt)
|
|
32236
32347
|
);
|
|
32237
32348
|
if (replay === void 0) throw err;
|
|
32238
32349
|
const where = { credential: replay.credential, service: replay.service, endpoint };
|
package/manifest.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"manifest_version": "0.3",
|
|
4
4
|
"name": "gogcli-mcp-calendar",
|
|
5
5
|
"display_name": "gogcli (Calendar)",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.23.0",
|
|
7
7
|
"description": "Extended Google Calendar for Claude via gogcli — auth + Calendar events + Meet space management",
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "Chris Hall",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gogcli-mcp-calendar",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"mcpName": "io.github.chrischall/gogcli-mcp-calendar",
|
|
5
5
|
"description": "Extended Google Calendar + Meet MCP server via gogcli — auth + Calendar events + Meet space management",
|
|
6
6
|
"author": "Claude Code (AI) <https://www.anthropic.com/claude>",
|