patchcord 0.5.113 → 0.5.114

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 +30 -21
  2. package/package.json +1 -1
package/bin/patchcord.mjs CHANGED
@@ -294,6 +294,7 @@ async function _resolveBearer(options = {}) {
294
294
  (cwd) => readJsonAt(join(cwd, ".cursor", "mcp.json"), ["mcpServers", "patchcord"], "cursor"),
295
295
  (cwd) => readJsonAt(join(cwd, ".vscode", "mcp.json"), ["servers", "patchcord"], "vscode"),
296
296
  (cwd) => readJsonAt(join(cwd, "opencode.json"), ["mcp", "patchcord"], "opencode"),
297
+ (cwd) => readJsonAt(join(cwd, ".agents", "mcp_config.json"), ["mcpServers", "patchcord"], "antigravity"),
297
298
  (cwd) => readCodexTomlShape(join(cwd, ".codex", "config.toml")),
298
299
  ];
299
300
  const projectReaders = preferKimi
@@ -944,6 +945,15 @@ if (cmd === "login" || cmd === "teamlead" || cmd === "provision" || cmd === "tea
944
945
  o.mcp.patchcord = { type: "remote", url: `${baseUrl}/mcp`, headers: hdr };
945
946
  });
946
947
  }
948
+ if (tool === "antigravity" || tool === "agy") {
949
+ // Antigravity CLI: PROJECT-scoped config at .agents/mcp_config.json (one
950
+ // project = one namespace = one agent). Remote HTTP uses `serverUrl`.
951
+ const adir = join(dir, ".agents"); mkdirSync(adir, { recursive: true });
952
+ return writeJson(join(adir, "mcp_config.json"), (o) => {
953
+ o.mcpServers = o.mcpServers || {};
954
+ o.mcpServers.patchcord = { serverUrl: `${baseUrl}/mcp`, headers: hdr };
955
+ });
956
+ }
947
957
  // default: claude_code. type:"http" is REQUIRED — without it Claude Code
948
958
  // defaults to stdio transport and rejects the entry ("command: expected
949
959
  // string, received undefined").
@@ -1075,7 +1085,7 @@ you design the team, provision its agents, launch them, and manage them.
1075
1085
  if (!manifest) { console.error("No .patchcord/team.json here — cd into the project root."); process.exit(1); }
1076
1086
  const ns = manifest.namespace;
1077
1087
  const real = (p) => run(`realpath -m ${JSON.stringify(p)}`) || p;
1078
- const AGENT_CMDS = /(^|\/)(claude|codex|kimi|kimi-code|opencode|gemini|node)$/;
1088
+ const AGENT_CMDS = /(^|\/)(claude|codex|kimi|kimi-code|opencode|gemini|agy|node)$/;
1079
1089
 
1080
1090
  // Token reader for a specific folder + tool (folder IS the identity).
1081
1091
  const tokenInDir = (tool, dir) => {
@@ -1184,7 +1194,7 @@ you design the team, provision its agents, launch them, and manage them.
1184
1194
  const tmuxOut = run(`tmux list-panes -a -F '#{pane_current_path}\t#{pane_current_command}'`);
1185
1195
  if (tmuxOut) for (const l of tmuxOut.split("\n").filter(Boolean)) {
1186
1196
  const [path, cmd] = l.split("\t");
1187
- if (/(^|\/)(claude|codex|kimi|kimi-code|opencode|gemini|node)$/.test("/" + cmd)) running.add(real(path));
1197
+ if (/(^|\/)(claude|codex|kimi|kimi-code|opencode|gemini|agy|node)$/.test("/" + cmd)) running.add(real(path));
1188
1198
  }
1189
1199
  for (const a of (manifest.agents || [])) {
1190
1200
  const dir = join(process.cwd(), a.dir || a.agent);
@@ -1192,7 +1202,7 @@ you design the team, provision its agents, launch them, and manage them.
1192
1202
  console.log(` ${M.dim}skip ${a.agent} — already running in ${dir}; relaunch-for-identity must resume in place, not fresh-launch (see team-ops skill).${M.rst}`);
1193
1203
  continue;
1194
1204
  }
1195
- const muxTool = a.tool === "claude_code" ? "claude" : (a.tool === "kimi-code" ? "kimi" : a.tool);
1205
+ const muxTool = a.tool === "claude_code" ? "claude" : (a.tool === "kimi-code" ? "kimi" : (a.tool === "antigravity" || a.tool === "agy") ? "agy" : a.tool);
1196
1206
  console.log(` launching ${a.agent} (${muxTool}) in ${dir}`);
1197
1207
  spawnSync("mux", ["new", muxTool, "--dir", dir], { stdio: "inherit" });
1198
1208
  }
@@ -1854,7 +1864,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
1854
1864
  if (!choice) {
1855
1865
  console.log(`\n${bold}Which tool are you setting up?${r}\n`);
1856
1866
  console.log(` ${cyan}1.${r} Claude Code ${cyan}5.${r} Gemini CLI ${cyan}9.${r} OpenClaw`);
1857
- console.log(` ${cyan}2.${r} Codex CLI ${cyan}6.${r} VS Code ${cyan}10.${r} Antigravity`);
1867
+ console.log(` ${cyan}2.${r} Codex CLI ${cyan}6.${r} VS Code ${cyan}10.${r} Antigravity CLI`);
1858
1868
  console.log(` ${cyan}3.${r} Cursor ${cyan}7.${r} Zed ${cyan}11.${r} Cline`);
1859
1869
  console.log(` ${cyan}4.${r} Windsurf ${cyan}8.${r} OpenCode ${cyan}12.${r} Kimi CLI`);
1860
1870
  console.log(` ${cyan}13.${r} Hermes\n`);
@@ -1942,6 +1952,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
1942
1952
  // Figure out which tool is already configured
1943
1953
  const existingToolName = existingConfigFile.includes(".kimi") ? "Kimi CLI"
1944
1954
  : existingConfigFile.includes(".codex") ? "Codex"
1955
+ : existingConfigFile.includes(".agents") ? "Antigravity CLI"
1945
1956
  : existingConfigFile.includes("antigravity") ? "Antigravity"
1946
1957
  : existingConfigFile.includes("openclaw") ? "OpenClaw"
1947
1958
  : existingConfigFile.includes(".cursor") ? "Cursor"
@@ -2393,9 +2404,13 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
2393
2404
  console.log(` ${dim}for streamable-http. Update to v2026.3.31+ or use mcp-remote:${r}`);
2394
2405
  console.log(` ${dim}openclaw mcp set patchcord '{"command":"npx","args":["mcp-remote","${serverUrl}/mcp","--header","Authorization: Bearer ${token}"],"transport":"stdio"}'${r}`);
2395
2406
  } else if (isAntigravity) {
2396
- // Antigravity: global ~/.gemini/antigravity/mcp_config.json → mcpServers
2397
- const agDir = join(HOME, ".gemini", "antigravity");
2398
- const agPath = join(agDir, "mcp_config.json");
2407
+ // Antigravity CLI: PROJECT-scoped config at <project>/.agents/mcp_config.json
2408
+ // (one project = one namespace = one agent identity — never global, which
2409
+ // would give one shared agent cross-project visibility). Remote HTTP uses
2410
+ // the `serverUrl` key. Skills are NOT seeded globally here: a stray skill in
2411
+ // the shared ~/.gemini/skills makes bare agy sessions improvise. The MCP
2412
+ // server injects its own instructions once connected.
2413
+ const agPath = join(cwd, ".agents", "mcp_config.json");
2399
2414
  const agOk = updateJsonConfig(agPath, (obj) => {
2400
2415
  obj.mcpServers = obj.mcpServers || {};
2401
2416
  obj.mcpServers.patchcord = {
@@ -2407,16 +2422,9 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
2407
2422
  };
2408
2423
  });
2409
2424
  if (agOk) {
2410
- console.log(`\n ${green}✓${r} Antigravity configured: ${dim}${agPath}${r}`);
2411
- // Install global skills
2412
- const agSkillDir = join(agDir, "skills", "patchcord");
2413
- const agWaitDir = join(agDir, "skills", "patchcord-wait");
2414
- mkdirSync(agSkillDir, { recursive: true });
2415
- mkdirSync(agWaitDir, { recursive: true });
2416
- cpSync(join(pluginRoot, "skills", "inbox", "SKILL.md"), join(agSkillDir, "SKILL.md"));
2417
- cpSync(join(pluginRoot, "skills", "wait", "SKILL.md"), join(agWaitDir, "SKILL.md"));
2418
- console.log(` ${green}✓${r} Skills installed: ${dim}patchcord${r}, ${dim}patchcord-wait${r}`);
2419
- console.log(` ${yellow}Global config — all Antigravity projects share this agent.${r}`);
2425
+ console.log(`\n ${green}✓${r} Antigravity CLI configured: ${dim}${agPath}${r}`);
2426
+ console.log(` ${yellow}Project config this agent is scoped to ${cwd}.${r}`);
2427
+ console.log(` ${dim}Verify in agy with the /mcp slash command.${r}`);
2420
2428
  }
2421
2429
  } else if (isCline) {
2422
2430
  // Cline VS Code extension: global cline_mcp_settings.json
@@ -2815,9 +2823,9 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
2815
2823
  // Auto-add per-project configs with tokens to .gitignore (don't just warn —
2816
2824
  // a committed token gets clobbered/reverted by git and silently breaks auth).
2817
2825
  // Hermes is global config (~/.hermes/config.yaml) — no per-project file to ignore.
2818
- if (!isWindsurf && !isGemini && !isZed && !isOpenClaw && !isAntigravity && !isCline && !isHermes) {
2826
+ if (!isWindsurf && !isGemini && !isZed && !isOpenClaw && !isCline && !isHermes) {
2819
2827
  const gitignorePath = join(cwd, ".gitignore");
2820
- const configFile = isKimiCode ? ".kimi-code/mcp.json" : isKimi ? ".kimi/mcp.json" : isCodex ? ".codex/config.toml" : isCursor ? ".cursor/mcp.json" : isVSCode ? ".vscode/mcp.json" : isOpenCode ? "opencode.json" : ".mcp.json";
2828
+ const configFile = isKimiCode ? ".kimi-code/mcp.json" : isKimi ? ".kimi/mcp.json" : isCodex ? ".codex/config.toml" : isCursor ? ".cursor/mcp.json" : isVSCode ? ".vscode/mcp.json" : isOpenCode ? "opencode.json" : isAntigravity ? ".agents/mcp_config.json" : ".mcp.json";
2821
2829
  // Forms that already cover this config (its file or its dir)
2822
2830
  const patterns = [configFile];
2823
2831
  if (isKimiCode) patterns.push(".kimi-code/");
@@ -2825,6 +2833,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
2825
2833
  else if (isCodex) patterns.push(".codex/");
2826
2834
  else if (isCursor) patterns.push(".cursor/");
2827
2835
  else if (isVSCode) patterns.push(".vscode/");
2836
+ else if (isAntigravity) patterns.push(".agents/");
2828
2837
 
2829
2838
  const hasGitignore = existsSync(gitignorePath);
2830
2839
  // Only touch .gitignore inside a real git repo, or where one already exists.
@@ -2844,9 +2853,9 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
2844
2853
  }
2845
2854
  }
2846
2855
 
2847
- const toolName = isHermes ? "Hermes" : isKimiCode ? "Kimi Code" : isKimi ? "Kimi CLI" : isAntigravity ? "Antigravity" : isCline ? "Cline" : isOpenClaw ? "OpenClaw" : isOpenCode ? "OpenCode" : isZed ? "Zed" : isVSCode ? "VS Code" : isGemini ? "Gemini CLI" : isWindsurf ? "Windsurf" : isCursor ? "Cursor" : isCodex ? "Codex" : "Claude Code";
2856
+ const toolName = isHermes ? "Hermes" : isKimiCode ? "Kimi Code" : isKimi ? "Kimi CLI" : isAntigravity ? "Antigravity CLI" : isCline ? "Cline" : isOpenClaw ? "OpenClaw" : isOpenCode ? "OpenCode" : isZed ? "Zed" : isVSCode ? "VS Code" : isGemini ? "Gemini CLI" : isWindsurf ? "Windsurf" : isCursor ? "Cursor" : isCodex ? "Codex" : "Claude Code";
2848
2857
 
2849
- if (!isWindsurf && !isGemini && !isZed && !isOpenClaw && !isAntigravity && !isCline && !isKimi && !isHermes) {
2858
+ if (!isWindsurf && !isGemini && !isZed && !isOpenClaw && !isCline && !isKimi && !isHermes) {
2850
2859
  console.log(`\n ${dim}To connect a second agent:${r}`);
2851
2860
  console.log(` ${dim}cd into another project and run${r} ${bold}npx patchcord@latest${r} ${dim}there.${r}`);
2852
2861
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.5.113",
3
+ "version": "0.5.114",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",