patchcord 0.3.89 → 0.3.91

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.
Files changed (2) hide show
  1. package/bin/patchcord.mjs +49 -4
  2. 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,36 @@ 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
+ // Install global skills
787
+ const agSkillDir = join(agDir, "skills", "patchcord");
788
+ const agWaitDir = join(agDir, "skills", "patchcord-wait");
789
+ mkdirSync(agSkillDir, { recursive: true });
790
+ mkdirSync(agWaitDir, { recursive: true });
791
+ cpSync(join(pluginRoot, "skills", "inbox", "SKILL.md"), join(agSkillDir, "SKILL.md"));
792
+ cpSync(join(pluginRoot, "skills", "wait", "SKILL.md"), join(agWaitDir, "SKILL.md"));
793
+ console.log(` ${green}✓${r} Skills installed: ${dim}patchcord${r}, ${dim}patchcord-wait${r}`);
794
+ console.log(` ${yellow}Global config — all Antigravity projects share this agent.${r}`);
750
795
  } else if (isVSCode) {
751
796
  // VS Code: write .vscode/mcp.json (per-project)
752
797
  const vscodeDir = join(cwd, ".vscode");
@@ -922,7 +967,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
922
967
  }
923
968
 
924
969
  // Warn about gitignore for per-project configs with tokens
925
- if (!isWindsurf && !isGemini && !isZed && !isOpenClaw) {
970
+ if (!isWindsurf && !isGemini && !isZed && !isOpenClaw && !isAntigravity) {
926
971
  const gitignorePath = join(cwd, ".gitignore");
927
972
  const configFile = isCodex ? ".codex/config.toml" : isCursor ? ".cursor/mcp.json" : isVSCode ? ".vscode/mcp.json" : isOpenCode ? "opencode.json" : ".mcp.json";
928
973
  let needsWarning = true;
@@ -937,9 +982,9 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
937
982
  }
938
983
  }
939
984
 
940
- const toolName = isOpenClaw ? "OpenClaw" : isOpenCode ? "OpenCode" : isZed ? "Zed" : isVSCode ? "VS Code" : isGemini ? "Gemini CLI" : isWindsurf ? "Windsurf" : isCursor ? "Cursor" : isCodex ? "Codex" : "Claude Code";
985
+ 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
986
 
942
- if (!isWindsurf && !isGemini && !isZed && !isOpenClaw) {
987
+ if (!isWindsurf && !isGemini && !isZed && !isOpenClaw && !isAntigravity) {
943
988
  console.log(`\n ${dim}To connect a second agent:${r}`);
944
989
  console.log(` ${dim}cd into another project and run${r} ${bold}npx patchcord@latest${r} ${dim}there.${r}`);
945
990
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.3.89",
3
+ "version": "0.3.91",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",