patchcord 0.3.20 → 0.3.22

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 with auto-inbox checking. Agents automatically respond to messages from other agents without human intervention.",
4
- "version": "0.3.20",
4
+ "version": "0.3.22",
5
5
  "author": {
6
6
  "name": "ppravdin"
7
7
  },
package/bin/patchcord.mjs CHANGED
@@ -48,28 +48,21 @@ if (!cmd || cmd === "install" || cmd === "agent") {
48
48
  Messenger for AI agents.
49
49
  `);
50
50
 
51
- let installedSomething = false;
51
+ // ── Global setup (silent if nothing changed) ──
52
+ let globalChanges = [];
52
53
 
53
- // ── Claude Code ──
54
+ // Claude Code
54
55
  const hasClaude = run("which claude");
55
56
  if (hasClaude) {
56
- console.log(`\n🔧 Claude Code`);
57
-
58
- // Register npm package as a local marketplace (idempotent)
59
57
  const marketplaceExists = run(`claude plugin marketplace list`)?.includes("patchcord");
60
58
  if (!marketplaceExists) {
61
59
  run(`claude plugin marketplace add "${pluginRoot}"`);
60
+ const installed = run(`claude plugin list`)?.includes("patchcord");
61
+ installed ? run(`claude plugin update patchcord`) : run(`claude plugin install patchcord`);
62
+ globalChanges.push("Claude Code plugin installed");
62
63
  }
63
64
 
64
- // Install or update the plugin from the marketplace
65
- const installed = run(`claude plugin list`)?.includes("patchcord");
66
- installed ? run(`claude plugin update patchcord`) : run(`claude plugin install patchcord`);
67
-
68
- console.log(` ✓ Plugin installed`);
69
-
70
- // Block OAuth tool leakage from claude.ai web connector
71
65
  const claudeSettings = join(process.env.HOME || "", ".claude", "settings.json");
72
- let settingsOk = false;
73
66
  if (existsSync(claudeSettings)) {
74
67
  try {
75
68
  const settings = JSON.parse(readFileSync(claudeSettings, "utf-8"));
@@ -89,49 +82,53 @@ if (!cmd || cmd === "install" || cmd === "agent") {
89
82
  }
90
83
  if (changed) {
91
84
  writeFileSync(claudeSettings, JSON.stringify(settings, null, 2) + "\n");
85
+ globalChanges.push("Permissions configured");
92
86
  }
93
- settingsOk = true;
94
- console.log(` ✓ Permissions configured`);
95
87
  } catch (e) {
96
- console.log(` ✗ Settings update failed — invalid JSON in ${claudeSettings}`);
97
- console.log(` ${e.message}`);
98
- console.log(` Fix the JSON and re-run: npx patchcord@latest install`);
88
+ globalChanges.push(`✗ Settings error: ${e.message}`);
99
89
  }
100
90
  }
101
91
 
102
- // Enable statusline
103
- if (settingsOk) {
104
- const enableScript = join(pluginRoot, "scripts", "enable-statusline.sh");
105
- if (existsSync(enableScript)) {
106
- const slArg = fullStatusline ? " --full" : "";
107
- run(`bash "${enableScript}"${slArg}`);
108
- console.log(` ✓ Statusline${fullStatusline ? " (full)" : ""} enabled`);
92
+ const enableScript = join(pluginRoot, "scripts", "enable-statusline.sh");
93
+ if (existsSync(enableScript)) {
94
+ const slArg = fullStatusline ? " --full" : "";
95
+ const slResult = run(`bash "${enableScript}"${slArg}`);
96
+ if (slResult !== null && slResult.includes("statusline")) {
97
+ globalChanges.push(`Statusline${fullStatusline ? " (full)" : ""} enabled`);
109
98
  }
110
99
  }
111
- installedSomething = true;
112
100
  }
113
101
 
114
- // ── Codex CLI ──
102
+ // Cursor
103
+ const cursorSkillDir = join(process.env.HOME || "", ".cursor", "skills-cursor", "patchcord");
104
+ const cursorSkillsRoot = join(process.env.HOME || "", ".cursor", "skills-cursor");
105
+ if (existsSync(cursorSkillsRoot) && !existsSync(cursorSkillDir)) {
106
+ mkdirSync(cursorSkillDir, { recursive: true });
107
+ cpSync(join(pluginRoot, "skills", "inbox", "SKILL.md"), join(cursorSkillDir, "SKILL.md"));
108
+ globalChanges.push("Cursor skill installed");
109
+ }
110
+
111
+ // Codex CLI
115
112
  const codexConfig = join(process.env.HOME || "", ".codex", "config.toml");
116
113
  if (existsSync(codexConfig)) {
117
114
  const content = readFileSync(codexConfig, "utf-8");
118
115
  if (!content.includes("[apps.patchcord]")) {
119
116
  writeFileSync(codexConfig, content.trimEnd() + "\n\n[apps.patchcord]\nenabled = false\n");
117
+ globalChanges.push("Codex ChatGPT app conflict prevented");
120
118
  }
121
- console.log(`\n🔧 Codex CLI`);
122
- console.log(` ✓ ChatGPT app conflict prevented`);
123
- installedSomething = true;
124
119
  }
125
120
 
126
- if (!installedSomething) {
127
- console.log(`No Claude Code or Codex CLI found on this machine.
128
-
129
- Install one first:
130
- Claude Code https://claude.ai/code
131
- Codex CLI → npm install -g @openai/codex
121
+ // Only show global changes if something actually changed
122
+ if (globalChanges.length > 0) {
123
+ console.log(`${dim}Global setup:${r}`);
124
+ for (const change of globalChanges) {
125
+ const icon = change.startsWith("✗") ? "" : " ✓ ";
126
+ console.log(`${icon}${change}`);
127
+ }
128
+ }
132
129
 
133
- Then run: npx patchcord@latest install`);
134
- process.exit(1);
130
+ if (!hasClaude && !existsSync(codexConfig)) {
131
+ console.log(`${dim}No Claude Code or Codex CLI detected — skipping global setup.${r}`);
135
132
  }
136
133
 
137
134
  // ── project setup (inline, not a separate command) ──────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.3.20",
3
+ "version": "0.3.22",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",