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.
- package/.claude-plugin/plugin.json +1 -1
- package/bin/patchcord.mjs +35 -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.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
|
-
|
|
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,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
|
-
|
|
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
|
+
// 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
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
134
|
-
|
|
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) ──────────
|