patchcord 0.6.18 → 0.6.19

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.18",
4
+ "version": "0.6.19",
5
5
  "author": {
6
6
  "name": "ppravdin"
7
7
  },
package/bin/patchcord.mjs CHANGED
@@ -43,6 +43,18 @@ function isSafeId(s) {
43
43
  return /^[A-Za-z0-9_\-]+$/.test(s) && s.length < 100;
44
44
  }
45
45
 
46
+ /** cursor-agent --yolo often spawns `npx patchcord` without CURSOR_AGENT in env. */
47
+ function _runningUnderCursorAgent() {
48
+ if (process.env.CURSOR_AGENT) return true;
49
+ if (process.platform === "linux") {
50
+ try {
51
+ const cmdline = readFileSync(`/proc/${process.ppid}/cmdline`, "utf-8").replace(/\0/g, " ");
52
+ if (/cursor-agent|\bcursor agent\b/i.test(cmdline)) return true;
53
+ } catch {}
54
+ }
55
+ return false;
56
+ }
57
+
46
58
  /** Undo 0.6.14 mistake: Claude Code uses /mcp (not /mcp/bearer). */
47
59
  function revertClaudeMcpBearerUrl(mcpPath) {
48
60
  if (!existsSync(mcpPath)) return false;
@@ -1671,6 +1683,11 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
1671
1683
  const flags = cmd?.startsWith("--") ? process.argv.slice(2) : process.argv.slice(3);
1672
1684
  const fullStatusline = flags.includes("--full");
1673
1685
  const updateOnly = flags.includes("--update-only");
1686
+ const toolFlagEarly = flags.find((f) => f.startsWith("--tool="))?.split("=")[1]
1687
+ || (flags.includes("--tool") ? flags[flags.indexOf("--tool") + 1] : "");
1688
+ const skipClaudePluginForCursor =
1689
+ _runningUnderCursorAgent()
1690
+ || toolFlagEarly.replace(/-/g, "_") === "cursor";
1674
1691
  let wasPluginInstalled = false;
1675
1692
  const { readFileSync, writeFileSync, unlinkSync, rmSync, chmodSync, copyFileSync } = await import("fs");
1676
1693
 
@@ -1854,7 +1871,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
1854
1871
  // MCP registers as "plugin-patchcord-marketplace-patchcord", which cursor-agent
1855
1872
  // tries instead of project .cursor/mcp.json → "MCP server not found".
1856
1873
  const hasClaude = run("which claude");
1857
- if (hasClaude && !process.env.CURSOR_AGENT) {
1874
+ if (hasClaude && !skipClaudePluginForCursor) {
1858
1875
  // Remove legacy npm-cache install (pre-marketplace era) — causes duplicate /patchcord commands.
1859
1876
  const npmCachePatchcord = join(HOME, ".claude", "plugins", "npm-cache", "node_modules", "patchcord");
1860
1877
  if (existsSync(npmCachePatchcord)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.6.18",
3
+ "version": "0.6.19",
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"