gogcli-mcp-contacts 2.19.0 → 2.19.2
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 +71 -2
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +5 -1
package/dist/index.js
CHANGED
|
@@ -31119,6 +31119,13 @@ function isGogFileArg(arg) {
|
|
|
31119
31119
|
return typeof arg !== "string";
|
|
31120
31120
|
}
|
|
31121
31121
|
var runExecutor = new AsyncLocalStorage();
|
|
31122
|
+
var defaultExecutor;
|
|
31123
|
+
function setDefaultGogExecutor(executor) {
|
|
31124
|
+
defaultExecutor = executor ? { executor } : void 0;
|
|
31125
|
+
}
|
|
31126
|
+
function activeExecutor() {
|
|
31127
|
+
return runExecutor.getStore() ?? defaultExecutor;
|
|
31128
|
+
}
|
|
31122
31129
|
var TIMEOUT_MS = 3e4;
|
|
31123
31130
|
function readonlyEnvEnabled() {
|
|
31124
31131
|
return readEnvVar("GOG_READONLY") !== void 0 && parseBoolEnv("GOG_READONLY", { default: true });
|
|
@@ -31279,7 +31286,7 @@ async function run(args, options = {}) {
|
|
|
31279
31286
|
const { account, spawner, interactive = false, timeout, readonly: readonly2 = false, redactMode = "full" } = options;
|
|
31280
31287
|
const redact = redactMode === "tokens" ? redactGoogleTokens : redactSecrets2;
|
|
31281
31288
|
const fullArgs = assembleArgs(args, { account, interactive, readonly: readonly2 });
|
|
31282
|
-
const store =
|
|
31289
|
+
const store = activeExecutor();
|
|
31283
31290
|
try {
|
|
31284
31291
|
let output;
|
|
31285
31292
|
if (spawner) {
|
|
@@ -31817,7 +31824,68 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
|
|
|
31817
31824
|
);
|
|
31818
31825
|
|
|
31819
31826
|
// ../gogcli-mcp/src/server.ts
|
|
31820
|
-
var VERSION = true ? "2.19.
|
|
31827
|
+
var VERSION = true ? "2.19.2" : "0.0.0";
|
|
31828
|
+
|
|
31829
|
+
// ../gogcli-mcp/src/connector-runtime.ts
|
|
31830
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
31831
|
+
var DEADLINE_GRACE_MS = 5e3;
|
|
31832
|
+
var RUNNER_GOG_FAILED = 422;
|
|
31833
|
+
var RUNNER_DRAINING = 503;
|
|
31834
|
+
function makeFlyExecutor(endpoint, key) {
|
|
31835
|
+
return async (args, opts) => {
|
|
31836
|
+
const deadlineMs = (opts?.timeout ?? DEFAULT_TIMEOUT_MS) + DEADLINE_GRACE_MS;
|
|
31837
|
+
let res;
|
|
31838
|
+
try {
|
|
31839
|
+
res = await fetch(endpoint + "/run", {
|
|
31840
|
+
method: "POST",
|
|
31841
|
+
headers: {
|
|
31842
|
+
Authorization: "Bearer " + key,
|
|
31843
|
+
"Content-Type": "application/json"
|
|
31844
|
+
},
|
|
31845
|
+
body: JSON.stringify({ args }),
|
|
31846
|
+
signal: AbortSignal.timeout(deadlineMs)
|
|
31847
|
+
});
|
|
31848
|
+
} catch (err) {
|
|
31849
|
+
const name = err instanceof Error ? err.name : "";
|
|
31850
|
+
if (name === "TimeoutError" || name === "AbortError") {
|
|
31851
|
+
throw new Error(
|
|
31852
|
+
`gog-runner did not respond within ${deadlineMs}ms (${endpoint}) \u2014 the Fly backend may be cold or wedged`
|
|
31853
|
+
);
|
|
31854
|
+
}
|
|
31855
|
+
throw err;
|
|
31856
|
+
}
|
|
31857
|
+
if (!res.ok) {
|
|
31858
|
+
const body = await res.json().catch(() => null);
|
|
31859
|
+
const detail = body && typeof body.error === "string" ? body.stderr && body.stderr.trim() && body.stderr.trim() !== body.error.trim() ? `${body.error}
|
|
31860
|
+
${body.stderr}` : body.error : "";
|
|
31861
|
+
if (res.status === RUNNER_GOG_FAILED) {
|
|
31862
|
+
throw new Error(detail || "gog failed on the runner (no detail supplied)");
|
|
31863
|
+
}
|
|
31864
|
+
if (res.status === RUNNER_DRAINING || body?.retryable === true) {
|
|
31865
|
+
throw new Error(
|
|
31866
|
+
`gog-runner is restarting; retry this call.${detail ? ` ${detail}` : ""}`
|
|
31867
|
+
);
|
|
31868
|
+
}
|
|
31869
|
+
if (detail) {
|
|
31870
|
+
throw new Error(detail);
|
|
31871
|
+
}
|
|
31872
|
+
throw new Error(
|
|
31873
|
+
`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.`
|
|
31874
|
+
);
|
|
31875
|
+
}
|
|
31876
|
+
const { stdout } = await res.json();
|
|
31877
|
+
return stdout;
|
|
31878
|
+
};
|
|
31879
|
+
}
|
|
31880
|
+
|
|
31881
|
+
// ../gogcli-mcp/src/remote-runner.ts
|
|
31882
|
+
function useRemoteGogRunner(env = process.env) {
|
|
31883
|
+
const endpoint = readEnvVar("GOG_RUNNER_URL", { env });
|
|
31884
|
+
const key = readEnvVar("GOG_RUNNER_KEY", { env });
|
|
31885
|
+
if (!endpoint || !key) return false;
|
|
31886
|
+
setDefaultGogExecutor(makeFlyExecutor(endpoint.replace(/\/+$/, ""), key));
|
|
31887
|
+
return true;
|
|
31888
|
+
}
|
|
31821
31889
|
|
|
31822
31890
|
// src/tools/contacts-extra.ts
|
|
31823
31891
|
function registerExtraContactsTools(server) {
|
|
@@ -32019,6 +32087,7 @@ function registerExtraContactsTools(server) {
|
|
|
32019
32087
|
}
|
|
32020
32088
|
|
|
32021
32089
|
// src/index.ts
|
|
32090
|
+
useRemoteGogRunner();
|
|
32022
32091
|
await runMcp({
|
|
32023
32092
|
name: "gogcli-contacts",
|
|
32024
32093
|
version: VERSION,
|
package/manifest.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"manifest_version": "0.3",
|
|
4
4
|
"name": "gogcli-mcp-contacts",
|
|
5
5
|
"display_name": "gogcli (Contacts)",
|
|
6
|
-
"version": "2.19.
|
|
6
|
+
"version": "2.19.2",
|
|
7
7
|
"description": "Extended Google Contacts for Claude via gogcli — auth + Contacts + Workspace directory (People API)",
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "Chris Hall",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gogcli-mcp-contacts",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.2",
|
|
4
4
|
"mcpName": "io.github.chrischall/gogcli-mcp-contacts",
|
|
5
5
|
"description": "Extended Google Contacts + People MCP server via gogcli — auth + Contacts + Workspace directory (People API)",
|
|
6
6
|
"author": "Claude Code (AI) <https://www.anthropic.com/claude>",
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { runMcp } from '@chrischall/mcp-utils';
|
|
3
|
-
import { VERSION, authToolsFor, registerContactsTools } from '../../gogcli-mcp/src/lib.js';
|
|
3
|
+
import { VERSION, authToolsFor, registerContactsTools, useRemoteGogRunner } from '../../gogcli-mcp/src/lib.js';
|
|
4
4
|
import { registerExtraContactsTools } from './tools/contacts-extra.js';
|
|
5
5
|
|
|
6
|
+
// Execute `gog` on the Fly backend when the host points us at one; without
|
|
7
|
+
// it, nothing changes and we spawn the local binary as before.
|
|
8
|
+
useRemoteGogRunner();
|
|
9
|
+
|
|
6
10
|
await runMcp({
|
|
7
11
|
name: 'gogcli-contacts',
|
|
8
12
|
version: VERSION,
|