patchcord 0.3.50 → 0.3.52
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/bin/patchcord.mjs +13 -21
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -449,7 +449,7 @@ if (!cmd || cmd === "install" || cmd === "agent") {
|
|
|
449
449
|
const globalCodexConfig = join(HOME, ".codex", "config.toml");
|
|
450
450
|
if (existsSync(globalCodexConfig)) {
|
|
451
451
|
const globalContent = readFileSync(globalCodexConfig, "utf-8");
|
|
452
|
-
if (globalContent.includes("[mcp_servers.patchcord]")) {
|
|
452
|
+
if (globalContent.includes("[mcp_servers.patchcord-codex]")) {
|
|
453
453
|
console.log(`\n ${red}⚠ Patchcord is in your GLOBAL Codex config!${r}`);
|
|
454
454
|
console.log(` ${dim}${globalCodexConfig}${r}`);
|
|
455
455
|
console.log(` ${yellow}This overrides per-project config and causes conflicts.${r}`);
|
|
@@ -464,7 +464,7 @@ if (!cmd || cmd === "install" || cmd === "agent") {
|
|
|
464
464
|
const configPath = join(cwd, ".codex", "config.toml");
|
|
465
465
|
if (existsSync(configPath)) {
|
|
466
466
|
const content = readFileSync(configPath, "utf-8");
|
|
467
|
-
if (content.includes("[mcp_servers.patchcord]")) {
|
|
467
|
+
if (content.includes("[mcp_servers.patchcord-codex]")) {
|
|
468
468
|
console.log(`\n ${yellow}⚠ Codex CLI already configured in this project${r}`);
|
|
469
469
|
console.log(` ${dim}${configPath}${r}`);
|
|
470
470
|
const replace = (await ask(` ${dim}Replace? (y/N):${r} `)).trim().toLowerCase();
|
|
@@ -543,15 +543,11 @@ if (!cmd || cmd === "install" || cmd === "agent") {
|
|
|
543
543
|
const cursorConfig = {
|
|
544
544
|
mcpServers: {
|
|
545
545
|
patchcord: {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
`Authorization: Bearer ${token}`,
|
|
552
|
-
"--header",
|
|
553
|
-
`X-Patchcord-Machine: ${hostname}`,
|
|
554
|
-
],
|
|
546
|
+
url: `${serverUrl}/mcp/bearer`,
|
|
547
|
+
headers: {
|
|
548
|
+
Authorization: `Bearer ${token}`,
|
|
549
|
+
"X-Patchcord-Machine": hostname,
|
|
550
|
+
},
|
|
555
551
|
},
|
|
556
552
|
},
|
|
557
553
|
};
|
|
@@ -576,15 +572,11 @@ if (!cmd || cmd === "install" || cmd === "agent") {
|
|
|
576
572
|
const wsConfig = {
|
|
577
573
|
mcpServers: {
|
|
578
574
|
patchcord: {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
`Authorization: Bearer ${token}`,
|
|
585
|
-
"--header",
|
|
586
|
-
`X-Patchcord-Machine: ${hostname}`,
|
|
587
|
-
],
|
|
575
|
+
url: `${serverUrl}/mcp/bearer`,
|
|
576
|
+
headers: {
|
|
577
|
+
Authorization: `Bearer ${token}`,
|
|
578
|
+
"X-Patchcord-Machine": hostname,
|
|
579
|
+
},
|
|
588
580
|
},
|
|
589
581
|
},
|
|
590
582
|
};
|
|
@@ -711,7 +703,7 @@ if (!cmd || cmd === "install" || cmd === "agent") {
|
|
|
711
703
|
let existing = existsSync(configPath) ? readFileSync(configPath, "utf-8") : "";
|
|
712
704
|
// Remove old patchcord config block if present
|
|
713
705
|
existing = existing.replace(/\[mcp_servers\.patchcord\]\n(?:(?!\[)[^\n]*\n?)*/g, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
714
|
-
existing = existing.trimEnd() + `\n\n[mcp_servers.patchcord]\nurl = "${serverUrl}/mcp/bearer"\nhttp_headers = { "Authorization" = "Bearer ${token}", "X-Patchcord-Machine" = "${hostname}" }\n`;
|
|
706
|
+
existing = existing.trimEnd() + `\n\n[mcp_servers.patchcord-codex]\nurl = "${serverUrl}/mcp/bearer"\nhttp_headers = { "Authorization" = "Bearer ${token}", "X-Patchcord-Machine" = "${hostname}" }\n`;
|
|
715
707
|
writeFileSync(configPath, existing);
|
|
716
708
|
// Clean up any PATCHCORD_TOKEN we previously wrote to .env
|
|
717
709
|
const envPath = join(cwd, ".env");
|