patchcord 0.6.31 → 0.6.33
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 +11 -24
- package/package.json +1 -1
- package/scripts/lib/claude-local-mcp.mjs +11 -7
- package/skills/subscribe/SKILL.md +13 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -2865,7 +2865,12 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
2865
2865
|
|
|
2866
2866
|
const CLIENT_TYPE_MAP = {
|
|
2867
2867
|
"claude_code": "1", "codex": "2", "cursor": "3", "grok": "14", "grok_cli": "14", "grok_build": "14", "windsurf": "4",
|
|
2868
|
-
"gemini"
|
|
2868
|
+
// "gemini" is deliberately ABSENT: Gemini CLI is retired as an install
|
|
2869
|
+
// target (Antigravity covers Google's agent). Slot "5" is left unassigned
|
|
2870
|
+
// rather than reused, so an old connect page sending client_type=gemini
|
|
2871
|
+
// falls through to no choice instead of silently configuring a DIFFERENT
|
|
2872
|
+
// harness and writing someone's token to the wrong file.
|
|
2873
|
+
"vscode": "6", "zed": "7", "opencode": "8", "openclaw": "9", "antigravity": "10",
|
|
2869
2874
|
"cline": "11", "kimi": "12", "hermes": "13",
|
|
2870
2875
|
};
|
|
2871
2876
|
|
|
@@ -3242,7 +3247,11 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
3242
3247
|
const isCursor = choice === "3";
|
|
3243
3248
|
const isGrok = choice === "14";
|
|
3244
3249
|
const isWindsurf = choice === "4";
|
|
3245
|
-
|
|
3250
|
+
// Gemini CLI retired as an install target. Kept as a permanent false so the
|
|
3251
|
+
// guards below still read as "this harness gets no project-local config"
|
|
3252
|
+
// for anything that reaches them, and so removing the slot cannot flip a
|
|
3253
|
+
// condition that used to exclude it into one that now includes it.
|
|
3254
|
+
const isGemini = false;
|
|
3246
3255
|
const isVSCode = choice === "6";
|
|
3247
3256
|
const isZed = choice === "7";
|
|
3248
3257
|
const isOpenCode = choice === "8";
|
|
@@ -3371,28 +3380,6 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
3371
3380
|
console.log(`\n ${green}✓${r} Windsurf configured: ${dim}${wsPath}${r}`);
|
|
3372
3381
|
console.log(` ${yellow}Global config — all Windsurf projects share this agent.${r}`);
|
|
3373
3382
|
}
|
|
3374
|
-
} else if (isGemini) {
|
|
3375
|
-
// Gemini CLI: global only (~/.gemini/settings.json)
|
|
3376
|
-
const geminiPath = join(HOME, ".gemini", "settings.json");
|
|
3377
|
-
const geminiOk = updateJsonConfig(geminiPath, (obj) => {
|
|
3378
|
-
obj.mcpServers = obj.mcpServers || {};
|
|
3379
|
-
obj.mcpServers.patchcord = {
|
|
3380
|
-
httpUrl: `${serverUrl}/mcp`,
|
|
3381
|
-
headers: {
|
|
3382
|
-
Authorization: `Bearer ${token}`,
|
|
3383
|
-
"X-Patchcord-Machine": hostname,
|
|
3384
|
-
},
|
|
3385
|
-
};
|
|
3386
|
-
// Clean up deprecated tools.allowed if present (removed in Gemini CLI 1.0)
|
|
3387
|
-
if (obj.tools?.allowed) {
|
|
3388
|
-
obj.tools.allowed = obj.tools.allowed.filter(t => !t.startsWith("mcp_patchcord_"));
|
|
3389
|
-
if (obj.tools.allowed.length === 0) delete obj.tools;
|
|
3390
|
-
}
|
|
3391
|
-
});
|
|
3392
|
-
if (geminiOk) {
|
|
3393
|
-
console.log(`\n ${green}✓${r} Gemini CLI configured: ${dim}${geminiPath}${r}`);
|
|
3394
|
-
console.log(` ${yellow}Global config — all Gemini CLI projects share this agent.${r}`);
|
|
3395
|
-
}
|
|
3396
3383
|
} else if (isZed) {
|
|
3397
3384
|
// Zed: global settings.json → context_servers
|
|
3398
3385
|
const zedPath = process.platform === "darwin"
|
package/package.json
CHANGED
|
@@ -116,14 +116,18 @@ export function detectClaudeLocalMcpOverride({
|
|
|
116
116
|
claude_config: claudeConfig,
|
|
117
117
|
local_bearer_fp: localFp,
|
|
118
118
|
disk_bearer_fp: diskFp,
|
|
119
|
+
// Kept SHORT and ending on the action that actually heals it. The old
|
|
120
|
+
// copy ran seven clauses and finished with "restart Claude Code", which
|
|
121
|
+
// is both heavier than needed and incomplete: clearing the entry does
|
|
122
|
+
// nothing until the MCP client reloads, and `/mcp` -> reconnect does that
|
|
123
|
+
// in place. A human who follows the old text to the letter clears the
|
|
124
|
+
// file, sees the tools still 401, and concludes the diagnosis was wrong.
|
|
119
125
|
tell_human:
|
|
120
|
-
|
|
121
|
-
+ "
|
|
122
|
-
+
|
|
123
|
-
+ "
|
|
124
|
-
+ "
|
|
125
|
-
+ "using the stale copy, which is why the CLI works while the MCP tools 401. "
|
|
126
|
-
+ "Patchcord will not edit ~/.claude.json for you.",
|
|
126
|
+
`Claude Code cached an old MCP token in ~/.claude.json that overrides this project's .mcp.json. ${detail} `
|
|
127
|
+
+ `Remove projects["${projectDir}"].mcpServers["${serverKey}"], then run /mcp and reconnect patchcord — `
|
|
128
|
+
+ "clearing it alone will not fix it, the MCP client has to reload. "
|
|
129
|
+
+ "Your token is fine; only Claude's MCP client holds the stale copy, "
|
|
130
|
+
+ "which is why the CLI works while the MCP tools 401.",
|
|
127
131
|
};
|
|
128
132
|
} catch {
|
|
129
133
|
return null;
|
|
@@ -69,7 +69,19 @@ patchcord whoami --json
|
|
|
69
69
|
|
|
70
70
|
If `warnings` contains `claude_local_mcp_cache_override`, **relay its `tell_human` text to the user verbatim.** They have no reason to know this command exists — all they saw was a tool failing.
|
|
71
71
|
|
|
72
|
-
**
|
|
72
|
+
Then **offer to clear it**: *"Want me to remove the stale entry?"* Ask first — `~/.claude.json` is the user's global editor config, holds far more than MCP servers, and writing it races the running Claude Code process. But do not stop at diagnosing. Most users do not want to hand-edit JSON, and an accurate report they cannot act on leaves them exactly as stuck as no report.
|
|
73
|
+
|
|
74
|
+
If they say yes:
|
|
75
|
+
|
|
76
|
+
1. **Back it up first** — `cp ~/.claude.json ~/.claude.json.bak.$(date +%s)`.
|
|
77
|
+
2. **Remove only** `projects["<dir>"].mcpServers["patchcord"]`. Not the whole `mcpServers` object, not the project entry, not the file. Parse, delete the one key, write atomically.
|
|
78
|
+
3. **Then tell them to run `/mcp` and reconnect patchcord.**
|
|
79
|
+
|
|
80
|
+
**Step 3 is the one that actually heals it, and it is the one that gets forgotten.** Clearing the entry changes a file the running MCP client already read; until it reloads, the tools keep 401-ing with the stale token and it looks like the fix failed. `/mcp` → reconnect reloads in place. Never tell them to restart Claude Code — if they are talking to you, they have already restarted, and it would not have helped anyway.
|
|
81
|
+
|
|
82
|
+
You cannot run `/mcp` yourself; it is an interactive command in the user's client. Say the words and let them press it.
|
|
83
|
+
|
|
84
|
+
Do not ask another agent to edit the file for you.
|
|
73
85
|
|
|
74
86
|
## If `whoami` is clean and the MCP tools STILL 401
|
|
75
87
|
|