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.
- package/.claude-plugin/plugin.json +1 -1
- package/bin/patchcord.mjs +26 -38
- package/package.json +1 -1
|
@@ -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.
|
|
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
|
-
|
|
51
|
+
// ── Global setup (silent if nothing changed) ──
|
|
52
|
+
let globalChanges = [];
|
|
52
53
|
|
|
53
|
-
//
|
|
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
|
-
|
|
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
|
-
|
|
103
|
-
if (
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
//
|
|
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
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
134
|
-
|
|
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) ──────────
|