patchcord 0.3.89 → 0.3.90
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/bin/patchcord.mjs +41 -4
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -263,7 +263,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
263
263
|
|
|
264
264
|
const CLIENT_TYPE_MAP = {
|
|
265
265
|
"claude_code": "1", "codex": "2", "cursor": "3", "windsurf": "4",
|
|
266
|
-
"gemini": "5", "vscode": "6", "zed": "7", "opencode": "8", "openclaw": "9",
|
|
266
|
+
"gemini": "5", "vscode": "6", "zed": "7", "opencode": "8", "openclaw": "9", "antigravity": "10",
|
|
267
267
|
};
|
|
268
268
|
|
|
269
269
|
|
|
@@ -365,9 +365,23 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
365
365
|
} catch {}
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
+
if (!existingToken) {
|
|
369
|
+
const agJsonPath = join(HOME, ".gemini", "antigravity", "mcp_config.json");
|
|
370
|
+
if (existsSync(agJsonPath)) {
|
|
371
|
+
try {
|
|
372
|
+
const ag = JSON.parse(readFileSync(agJsonPath, "utf-8"));
|
|
373
|
+
const pt = ag?.mcpServers?.patchcord;
|
|
374
|
+
if (pt?.headers?.Authorization) {
|
|
375
|
+
existingToken = pt.headers.Authorization.replace(/^Bearer\s+/i, "");
|
|
376
|
+
existingConfigFile = agJsonPath;
|
|
377
|
+
}
|
|
378
|
+
} catch {}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
368
381
|
if (existingToken) {
|
|
369
382
|
// Figure out which tool is already configured
|
|
370
383
|
const existingToolName = existingConfigFile.includes(".codex") ? "Codex"
|
|
384
|
+
: existingConfigFile.includes("antigravity") ? "Antigravity"
|
|
371
385
|
: existingConfigFile.includes("openclaw") ? "OpenClaw"
|
|
372
386
|
: existingConfigFile.includes(".cursor") ? "Cursor"
|
|
373
387
|
: existingConfigFile.includes(".vscode") ? "VS Code"
|
|
@@ -574,6 +588,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
574
588
|
const isZed = choice === "7";
|
|
575
589
|
const isOpenCode = choice === "8";
|
|
576
590
|
const isOpenClaw = choice === "9";
|
|
591
|
+
const isAntigravity = choice === "10";
|
|
577
592
|
|
|
578
593
|
const hostname = run("hostname -s") || run("hostname") || "unknown";
|
|
579
594
|
|
|
@@ -747,6 +762,28 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
747
762
|
console.log(`\n ${dim}If tools don't appear after restart, your OpenClaw may be too old${r}`);
|
|
748
763
|
console.log(` ${dim}for streamable-http. Update to v2026.3.31+ or use mcp-remote:${r}`);
|
|
749
764
|
console.log(` ${dim}openclaw mcp set patchcord '{"command":"npx","args":["mcp-remote","${serverUrl}/mcp","--header","Authorization: Bearer ${token}"],"transport":"stdio"}'${r}`);
|
|
765
|
+
} else if (isAntigravity) {
|
|
766
|
+
// Antigravity: global ~/.gemini/antigravity/mcp_config.json → mcpServers
|
|
767
|
+
const agDir = join(HOME, ".gemini", "antigravity");
|
|
768
|
+
const agPath = join(agDir, "mcp_config.json");
|
|
769
|
+
let agConfig = {};
|
|
770
|
+
if (existsSync(agPath)) {
|
|
771
|
+
try {
|
|
772
|
+
agConfig = JSON.parse(readFileSync(agPath, "utf-8"));
|
|
773
|
+
} catch {}
|
|
774
|
+
}
|
|
775
|
+
if (!agConfig.mcpServers) agConfig.mcpServers = {};
|
|
776
|
+
agConfig.mcpServers.patchcord = {
|
|
777
|
+
serverUrl: `${serverUrl}/mcp`,
|
|
778
|
+
headers: {
|
|
779
|
+
Authorization: `Bearer ${token}`,
|
|
780
|
+
"X-Patchcord-Machine": hostname,
|
|
781
|
+
},
|
|
782
|
+
};
|
|
783
|
+
mkdirSync(agDir, { recursive: true });
|
|
784
|
+
writeFileSync(agPath, JSON.stringify(agConfig, null, 2) + "\n");
|
|
785
|
+
console.log(`\n ${green}✓${r} Antigravity configured: ${dim}${agPath}${r}`);
|
|
786
|
+
console.log(` ${yellow}Global config — all Antigravity projects share this agent.${r}`);
|
|
750
787
|
} else if (isVSCode) {
|
|
751
788
|
// VS Code: write .vscode/mcp.json (per-project)
|
|
752
789
|
const vscodeDir = join(cwd, ".vscode");
|
|
@@ -922,7 +959,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
922
959
|
}
|
|
923
960
|
|
|
924
961
|
// Warn about gitignore for per-project configs with tokens
|
|
925
|
-
if (!isWindsurf && !isGemini && !isZed && !isOpenClaw) {
|
|
962
|
+
if (!isWindsurf && !isGemini && !isZed && !isOpenClaw && !isAntigravity) {
|
|
926
963
|
const gitignorePath = join(cwd, ".gitignore");
|
|
927
964
|
const configFile = isCodex ? ".codex/config.toml" : isCursor ? ".cursor/mcp.json" : isVSCode ? ".vscode/mcp.json" : isOpenCode ? "opencode.json" : ".mcp.json";
|
|
928
965
|
let needsWarning = true;
|
|
@@ -937,9 +974,9 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
937
974
|
}
|
|
938
975
|
}
|
|
939
976
|
|
|
940
|
-
const toolName = isOpenClaw ? "OpenClaw" : isOpenCode ? "OpenCode" : isZed ? "Zed" : isVSCode ? "VS Code" : isGemini ? "Gemini CLI" : isWindsurf ? "Windsurf" : isCursor ? "Cursor" : isCodex ? "Codex" : "Claude Code";
|
|
977
|
+
const toolName = isAntigravity ? "Antigravity" : isOpenClaw ? "OpenClaw" : isOpenCode ? "OpenCode" : isZed ? "Zed" : isVSCode ? "VS Code" : isGemini ? "Gemini CLI" : isWindsurf ? "Windsurf" : isCursor ? "Cursor" : isCodex ? "Codex" : "Claude Code";
|
|
941
978
|
|
|
942
|
-
if (!isWindsurf && !isGemini && !isZed && !isOpenClaw) {
|
|
979
|
+
if (!isWindsurf && !isGemini && !isZed && !isOpenClaw && !isAntigravity) {
|
|
943
980
|
console.log(`\n ${dim}To connect a second agent:${r}`);
|
|
944
981
|
console.log(` ${dim}cd into another project and run${r} ${bold}npx patchcord@latest${r} ${dim}there.${r}`);
|
|
945
982
|
}
|