patchcord 0.6.15 → 0.6.17

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "patchcord",
3
3
  "description": "Cross-machine agent messaging. Messages from other agents land in the inbox and wake the agent to reply.",
4
- "version": "0.6.15",
4
+ "version": "0.6.17",
5
5
  "author": {
6
6
  "name": "ppravdin"
7
7
  },
package/bin/patchcord.mjs CHANGED
@@ -1966,6 +1966,30 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
1966
1966
  } else if (allowlistChanged) {
1967
1967
  globalChanges.push("Cursor MCP allowlist configured");
1968
1968
  }
1969
+
1970
+ // cursor-agent v2026.07+ also reads ~/.cursor/cli-config.json permissions.allow
1971
+ // for MCP tool approval — permissions.json alone leaves patchcord at
1972
+ // "not loaded (needs approval)" even with --yolo.
1973
+ const cliConfigPath = join(HOME, ".cursor", "cli-config.json");
1974
+ let cliAllowChanged = false;
1975
+ const cliOk = updateJsonConfig(cliConfigPath, (obj) => {
1976
+ obj.permissions = obj.permissions || {};
1977
+ if (!obj.permissions.allow) obj.permissions.allow = [];
1978
+ if (!Array.isArray(obj.permissions.allow)) {
1979
+ console.log(`\n ${yellow}⚠${r} Skipped Cursor CLI MCP allow — ${cliConfigPath} permissions.allow is not an array.`);
1980
+ return;
1981
+ }
1982
+ const pat = "Mcp(patchcord:*)";
1983
+ if (!obj.permissions.allow.includes(pat)) {
1984
+ obj.permissions.allow.push(pat);
1985
+ cliAllowChanged = true;
1986
+ }
1987
+ });
1988
+ if (!cliOk) {
1989
+ globalChanges.push("✗ Cursor CLI permissions error");
1990
+ } else if (cliAllowChanged) {
1991
+ globalChanges.push("Cursor CLI MCP allowlist configured");
1992
+ }
1969
1993
  }
1970
1994
  }
1971
1995
 
@@ -2403,6 +2427,13 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
2403
2427
  }
2404
2428
  toolSlug = toolFlag; // preserved as-is for the URL param
2405
2429
  }
2430
+ // cursor-agent --yolo runs `npx patchcord` without --tool=cursor. Without
2431
+ // this, browser connect defaults to Claude and writes .mcp.json instead of
2432
+ // .cursor/mcp.json — MCP never loads in cursor-agent.
2433
+ if (!choice && process.env.CURSOR_AGENT) {
2434
+ choice = CLIENT_TYPE_MAP.cursor;
2435
+ toolSlug = toolSlug || "cursor";
2436
+ }
2406
2437
 
2407
2438
  // --token bypass for power users / CI / self-hosters
2408
2439
  const tokenFlag = flags.find(f => f.startsWith("--token="))?.split("=")[1]
@@ -2453,12 +2484,14 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
2453
2484
  let existingToken = "";
2454
2485
  let existingConfigFile = "";
2455
2486
  const mcpJsonPath = join(cwd, ".mcp.json");
2487
+ const cursorMcpPath = join(cwd, ".cursor", "mcp.json");
2456
2488
  const codexTomlPath = join(cwd, ".codex", "config.toml");
2457
2489
  const grokTomlPath = join(cwd, ".grok", "config.toml");
2458
2490
  const kimiJsonPath = join(cwd, ".kimi", "mcp.json");
2459
2491
 
2460
- const slugForCheck = toolSlug ? toolSlug.replace(/-/g, "_") : "";
2492
+ const slugForCheck = toolSlug ? toolSlug.replace(/-/g, "_") : (process.env.CURSOR_AGENT ? "cursor" : "");
2461
2493
  const checkMcpJson = !slugForCheck || slugForCheck === "claude_code";
2494
+ const checkCursorJson = !slugForCheck || slugForCheck === "cursor";
2462
2495
  const checkCodexToml = !slugForCheck || slugForCheck === "codex";
2463
2496
  const checkGrokToml = !slugForCheck || ["grok", "grok_cli", "grok_build"].includes(slugForCheck);
2464
2497
  const checkKimiJson = !slugForCheck || slugForCheck === "kimi";
@@ -2473,6 +2506,16 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
2473
2506
  }
2474
2507
  } catch {}
2475
2508
  }
2509
+ if (!existingToken && checkCursorJson && existsSync(cursorMcpPath)) {
2510
+ try {
2511
+ const existing = JSON.parse(readFileSync(cursorMcpPath, "utf-8"));
2512
+ const pt = existing?.mcpServers?.patchcord;
2513
+ if (pt?.headers?.Authorization) {
2514
+ existingToken = pt.headers.Authorization.replace(/^Bearer\s+/i, "");
2515
+ existingConfigFile = cursorMcpPath;
2516
+ }
2517
+ } catch {}
2518
+ }
2476
2519
  if (!existingToken && checkCodexToml && existsSync(codexTomlPath)) {
2477
2520
  try {
2478
2521
  const content = readFileSync(codexTomlPath, "utf-8");
@@ -3452,6 +3495,9 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
3452
3495
  console.log(`\n ${green}→${r} ${bold}Restart ${cyan}kimi${r}${bold} in this project (or run ${cyan}/reload${r}${bold}), then say: ${cyan}${bold}check inbox${r}`);
3453
3496
  } else if (isKimi) {
3454
3497
  console.log(`\n ${green}→${r} ${bold}Restart your ${toolName} session with ${cyan}kimi-pc${r}${bold}, then say: ${cyan}${bold}check inbox${r}`);
3498
+ } else if (isCursor && hasCursorAgent) {
3499
+ console.log(`\n ${green}→${r} ${bold}Exit and start a new ${cyan}cursor-agent${r}${bold} session${r} ${dim}(MCP loads at session start — not mid-session)${r}`);
3500
+ console.log(` ${dim}Then:${r} ${cyan}${bold}check inbox${r} ${dim}before${r} ${cyan}${bold}/patchcord-subscribe${r}`);
3455
3501
  } else {
3456
3502
  console.log(`\n ${green}→${r} ${bold}Restart your ${toolName} session${r}, then say: ${cyan}${bold}check inbox${r}`);
3457
3503
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.6.15",
3
+ "version": "0.6.17",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "scripts": {
6
6
  "version": "node scripts/sync-plugin-version.mjs && git add .claude-plugin/plugin.json"