patchcord 0.6.18 → 0.6.20
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 +24 -25
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -43,6 +43,24 @@ function isSafeId(s) {
|
|
|
43
43
|
return /^[A-Za-z0-9_\-]+$/.test(s) && s.length < 100;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/** Claude Code marketplace plugin — call ONLY from the Claude provision branch. */
|
|
47
|
+
function _installClaudeMarketplacePlugin(stablePluginDir) {
|
|
48
|
+
if (!run("which claude")) return;
|
|
49
|
+
const npmCachePatchcord = join(HOME, ".claude", "plugins", "npm-cache", "node_modules", "patchcord");
|
|
50
|
+
if (existsSync(npmCachePatchcord)) {
|
|
51
|
+
try { rmSync(npmCachePatchcord, { recursive: true, force: true }); } catch {}
|
|
52
|
+
}
|
|
53
|
+
run(`claude plugin marketplace remove patchcord-marketplace`);
|
|
54
|
+
run(`claude plugin marketplace add "${stablePluginDir}"`);
|
|
55
|
+
const hadPlugin = run(`claude plugin list`)?.includes("patchcord");
|
|
56
|
+
if (hadPlugin) {
|
|
57
|
+
run(`claude plugin update patchcord@patchcord-marketplace`);
|
|
58
|
+
} else {
|
|
59
|
+
run(`claude plugin install patchcord@patchcord-marketplace`);
|
|
60
|
+
}
|
|
61
|
+
return hadPlugin;
|
|
62
|
+
}
|
|
63
|
+
|
|
46
64
|
/** Undo 0.6.14 mistake: Claude Code uses /mcp (not /mcp/bearer). */
|
|
47
65
|
function revertClaudeMcpBearerUrl(mcpPath) {
|
|
48
66
|
if (!existsSync(mcpPath)) return false;
|
|
@@ -1854,31 +1872,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
1854
1872
|
// MCP registers as "plugin-patchcord-marketplace-patchcord", which cursor-agent
|
|
1855
1873
|
// tries instead of project .cursor/mcp.json → "MCP server not found".
|
|
1856
1874
|
const hasClaude = run("which claude");
|
|
1857
|
-
if (hasClaude
|
|
1858
|
-
// Remove legacy npm-cache install (pre-marketplace era) — causes duplicate /patchcord commands.
|
|
1859
|
-
const npmCachePatchcord = join(HOME, ".claude", "plugins", "npm-cache", "node_modules", "patchcord");
|
|
1860
|
-
if (existsSync(npmCachePatchcord)) {
|
|
1861
|
-
try { rmSync(npmCachePatchcord, { recursive: true, force: true }); } catch {}
|
|
1862
|
-
}
|
|
1863
|
-
|
|
1864
|
-
// Always re-add marketplace (point at the STABLE mirror, not pluginRoot
|
|
1865
|
-
// which is the npx ephemeral cache). Claude Code stores the literal
|
|
1866
|
-
// path in its plugin manifest — pointing at npx cache breaks every
|
|
1867
|
-
// future session as soon as that cache dir is swept.
|
|
1868
|
-
// Remove any prior marketplace registration first so the path actually
|
|
1869
|
-
// updates for users who got the buggy npx-cache path on an earlier install.
|
|
1870
|
-
run(`claude plugin marketplace remove patchcord-marketplace`);
|
|
1871
|
-
run(`claude plugin marketplace add "${stablePluginDir}"`);
|
|
1872
|
-
const installed = run(`claude plugin list`)?.includes("patchcord");
|
|
1873
|
-
wasPluginInstalled = !!installed;
|
|
1874
|
-
if (installed) {
|
|
1875
|
-
run(`claude plugin update patchcord@patchcord-marketplace`);
|
|
1876
|
-
globalChanges.push("Claude Code plugin updated");
|
|
1877
|
-
} else {
|
|
1878
|
-
run(`claude plugin install patchcord@patchcord-marketplace`);
|
|
1879
|
-
globalChanges.push("Claude Code plugin installed");
|
|
1880
|
-
}
|
|
1881
|
-
|
|
1875
|
+
if (hasClaude) {
|
|
1882
1876
|
const claudeSettings = join(HOME, ".claude", "settings.json");
|
|
1883
1877
|
if (existsSync(claudeSettings)) {
|
|
1884
1878
|
try {
|
|
@@ -3396,6 +3390,11 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
3396
3390
|
dedupeClaudePatchcordMcp(cwd);
|
|
3397
3391
|
console.log(`\n ${green}✓${r} Claude Code configured: ${dim}${mcpPath}${r}`);
|
|
3398
3392
|
|
|
3393
|
+
if (run("which claude")) {
|
|
3394
|
+
wasPluginInstalled = _installClaudeMarketplacePlugin(stablePluginDir);
|
|
3395
|
+
console.log(` ${green}✓${r} Claude Code plugin ${wasPluginInstalled ? "updated" : "installed"}`);
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3399
3398
|
// Statusline: ask whether to enable full mode (unless --full flag passed or already configured).
|
|
3400
3399
|
const enableScript = join(pluginRoot, "scripts", "enable-statusline.sh");
|
|
3401
3400
|
if (existsSync(enableScript)) {
|
package/package.json
CHANGED