patchcord 0.3.51 → 0.3.53
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 +9 -5
- 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();
|
|
@@ -695,7 +695,8 @@ if (!cmd || cmd === "install" || cmd === "agent") {
|
|
|
695
695
|
// Codex: copy skill + write config + install slash commands
|
|
696
696
|
const dest = join(cwd, ".agents", "skills", "patchcord");
|
|
697
697
|
mkdirSync(dest, { recursive: true });
|
|
698
|
-
|
|
698
|
+
const skillSrc = readFileSync(join(pluginRoot, "skills", "inbox", "SKILL.md"), "utf-8");
|
|
699
|
+
writeFileSync(join(dest, "SKILL.md"), `IMPORTANT: Use the "patchcord-codex" MCP server for all patchcord tools (e.g. patchcord-codex.inbox, patchcord-codex.send_message). Do NOT use codex_apps.patchcord_* tools — they use the wrong identity.\n\n` + skillSrc);
|
|
699
700
|
|
|
700
701
|
const codexDir = join(cwd, ".codex");
|
|
701
702
|
mkdirSync(codexDir, { recursive: true });
|
|
@@ -703,7 +704,7 @@ if (!cmd || cmd === "install" || cmd === "agent") {
|
|
|
703
704
|
let existing = existsSync(configPath) ? readFileSync(configPath, "utf-8") : "";
|
|
704
705
|
// Remove old patchcord config block if present
|
|
705
706
|
existing = existing.replace(/\[mcp_servers\.patchcord\]\n(?:(?!\[)[^\n]*\n?)*/g, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
706
|
-
existing = existing.trimEnd() + `\n\n[mcp_servers.patchcord]\nurl = "${serverUrl}/mcp/bearer"\nhttp_headers = { "Authorization" = "Bearer ${token}", "X-Patchcord-Machine" = "${hostname}" }\n`;
|
|
707
|
+
existing = existing.trimEnd() + `\n\n[mcp_servers.patchcord-codex]\nurl = "${serverUrl}/mcp/bearer"\nhttp_headers = { "Authorization" = "Bearer ${token}", "X-Patchcord-Machine" = "${hostname}" }\n`;
|
|
707
708
|
writeFileSync(configPath, existing);
|
|
708
709
|
// Clean up any PATCHCORD_TOKEN we previously wrote to .env
|
|
709
710
|
const envPath = join(cwd, ".env");
|
|
@@ -718,7 +719,10 @@ if (!cmd || cmd === "install" || cmd === "agent") {
|
|
|
718
719
|
// Slash commands (.codex/prompts/)
|
|
719
720
|
const codexPromptsDir = join(codexDir, "prompts");
|
|
720
721
|
mkdirSync(codexPromptsDir, { recursive: true });
|
|
721
|
-
|
|
722
|
+
// Write Codex-specific prompts that reference the correct MCP server name
|
|
723
|
+
const skillContent = readFileSync(join(pluginRoot, "skills", "inbox", "SKILL.md"), "utf-8");
|
|
724
|
+
const codexSkill = `IMPORTANT: Use the "patchcord-codex" MCP server for all patchcord tools (e.g. patchcord-codex.inbox, patchcord-codex.send_message). Do NOT use codex_apps.patchcord_* tools — they use the wrong identity.\n\n` + skillContent;
|
|
725
|
+
writeFileSync(join(codexPromptsDir, "patchcord.md"), codexSkill);
|
|
722
726
|
cpSync(join(pluginRoot, "skills", "wait", "SKILL.md"), join(codexPromptsDir, "patchcord-wait.md"));
|
|
723
727
|
console.log(`\n ${green}✓${r} Codex configured: ${dim}${configPath}${r}`);
|
|
724
728
|
console.log(` ${green}✓${r} Slash commands: ${dim}/patchcord${r}, ${dim}/patchcord-wait${r}`);
|