patchcord 0.3.20 → 0.3.21

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.21",
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,44 @@ 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
+ // Codex CLI
115
103
  const codexConfig = join(process.env.HOME || "", ".codex", "config.toml");
116
104
  if (existsSync(codexConfig)) {
117
105
  const content = readFileSync(codexConfig, "utf-8");
118
106
  if (!content.includes("[apps.patchcord]")) {
119
107
  writeFileSync(codexConfig, content.trimEnd() + "\n\n[apps.patchcord]\nenabled = false\n");
108
+ globalChanges.push("Codex ChatGPT app conflict prevented");
120
109
  }
121
- console.log(`\n🔧 Codex CLI`);
122
- console.log(` ✓ ChatGPT app conflict prevented`);
123
- installedSomething = true;
124
110
  }
125
111
 
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
112
+ // Only show global changes if something actually changed
113
+ if (globalChanges.length > 0) {
114
+ console.log(`${dim}Global setup:${r}`);
115
+ for (const change of globalChanges) {
116
+ const icon = change.startsWith("✗") ? "" : " ✓ ";
117
+ console.log(`${icon}${change}`);
118
+ }
119
+ }
132
120
 
133
- Then run: npx patchcord@latest install`);
134
- process.exit(1);
121
+ if (!hasClaude && !existsSync(codexConfig)) {
122
+ console.log(`${dim}No Claude Code or Codex CLI detected — skipping global setup.${r}`);
135
123
  }
136
124
 
137
125
  // ── 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.21",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",