gogcli-mcp-contacts 2.19.0 → 2.19.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.
- package/dist/index.js +63 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +5 -1
package/dist/index.js
CHANGED
|
@@ -31817,7 +31817,68 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
|
|
|
31817
31817
|
);
|
|
31818
31818
|
|
|
31819
31819
|
// ../gogcli-mcp/src/server.ts
|
|
31820
|
-
var VERSION = true ? "2.19.
|
|
31820
|
+
var VERSION = true ? "2.19.1" : "0.0.0";
|
|
31821
|
+
|
|
31822
|
+
// ../gogcli-mcp/src/connector-runtime.ts
|
|
31823
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
31824
|
+
var DEADLINE_GRACE_MS = 5e3;
|
|
31825
|
+
var RUNNER_GOG_FAILED = 422;
|
|
31826
|
+
var RUNNER_DRAINING = 503;
|
|
31827
|
+
function makeFlyExecutor(endpoint, key) {
|
|
31828
|
+
return async (args, opts) => {
|
|
31829
|
+
const deadlineMs = (opts?.timeout ?? DEFAULT_TIMEOUT_MS) + DEADLINE_GRACE_MS;
|
|
31830
|
+
let res;
|
|
31831
|
+
try {
|
|
31832
|
+
res = await fetch(endpoint + "/run", {
|
|
31833
|
+
method: "POST",
|
|
31834
|
+
headers: {
|
|
31835
|
+
Authorization: "Bearer " + key,
|
|
31836
|
+
"Content-Type": "application/json"
|
|
31837
|
+
},
|
|
31838
|
+
body: JSON.stringify({ args }),
|
|
31839
|
+
signal: AbortSignal.timeout(deadlineMs)
|
|
31840
|
+
});
|
|
31841
|
+
} catch (err) {
|
|
31842
|
+
const name = err instanceof Error ? err.name : "";
|
|
31843
|
+
if (name === "TimeoutError" || name === "AbortError") {
|
|
31844
|
+
throw new Error(
|
|
31845
|
+
`gog-runner did not respond within ${deadlineMs}ms (${endpoint}) \u2014 the Fly backend may be cold or wedged`
|
|
31846
|
+
);
|
|
31847
|
+
}
|
|
31848
|
+
throw err;
|
|
31849
|
+
}
|
|
31850
|
+
if (!res.ok) {
|
|
31851
|
+
const body = await res.json().catch(() => null);
|
|
31852
|
+
const detail = body && typeof body.error === "string" ? body.stderr && body.stderr.trim() && body.stderr.trim() !== body.error.trim() ? `${body.error}
|
|
31853
|
+
${body.stderr}` : body.error : "";
|
|
31854
|
+
if (res.status === RUNNER_GOG_FAILED) {
|
|
31855
|
+
throw new Error(detail || "gog failed on the runner (no detail supplied)");
|
|
31856
|
+
}
|
|
31857
|
+
if (res.status === RUNNER_DRAINING || body?.retryable === true) {
|
|
31858
|
+
throw new Error(
|
|
31859
|
+
`gog-runner is restarting; retry this call.${detail ? ` ${detail}` : ""}`
|
|
31860
|
+
);
|
|
31861
|
+
}
|
|
31862
|
+
if (detail) {
|
|
31863
|
+
throw new Error(detail);
|
|
31864
|
+
}
|
|
31865
|
+
throw new Error(
|
|
31866
|
+
`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.`
|
|
31867
|
+
);
|
|
31868
|
+
}
|
|
31869
|
+
const { stdout } = await res.json();
|
|
31870
|
+
return stdout;
|
|
31871
|
+
};
|
|
31872
|
+
}
|
|
31873
|
+
|
|
31874
|
+
// ../gogcli-mcp/src/remote-runner.ts
|
|
31875
|
+
function useRemoteGogRunner(env = process.env) {
|
|
31876
|
+
const endpoint = readEnvVar("GOG_RUNNER_URL", { env });
|
|
31877
|
+
const key = readEnvVar("GOG_RUNNER_KEY", { env });
|
|
31878
|
+
if (!endpoint || !key) return false;
|
|
31879
|
+
runExecutor.enterWith({ executor: makeFlyExecutor(endpoint.replace(/\/+$/, ""), key) });
|
|
31880
|
+
return true;
|
|
31881
|
+
}
|
|
31821
31882
|
|
|
31822
31883
|
// src/tools/contacts-extra.ts
|
|
31823
31884
|
function registerExtraContactsTools(server) {
|
|
@@ -32019,6 +32080,7 @@ function registerExtraContactsTools(server) {
|
|
|
32019
32080
|
}
|
|
32020
32081
|
|
|
32021
32082
|
// src/index.ts
|
|
32083
|
+
useRemoteGogRunner();
|
|
32022
32084
|
await runMcp({
|
|
32023
32085
|
name: "gogcli-contacts",
|
|
32024
32086
|
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.1",
|
|
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.1",
|
|
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,
|