patchcord 0.3.63 → 0.3.64
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 +44 -7
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -80,7 +80,7 @@ if (cmd === "plugin-path") {
|
|
|
80
80
|
if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd === "--no-browser" || cmd === "--server") {
|
|
81
81
|
const flags = cmd?.startsWith("--") ? process.argv.slice(2) : process.argv.slice(3);
|
|
82
82
|
const fullStatusline = flags.includes("--full");
|
|
83
|
-
const { readFileSync, writeFileSync } = await import("fs");
|
|
83
|
+
const { readFileSync, writeFileSync, unlinkSync } = await import("fs");
|
|
84
84
|
|
|
85
85
|
function safeReadJson(filePath) {
|
|
86
86
|
try {
|
|
@@ -668,13 +668,50 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
668
668
|
console.log(` ${green}✓${r} Cleaned PATCHCORD_TOKEN from .env`);
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
|
-
//
|
|
672
|
-
const
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
671
|
+
// Clean up old slash commands if they exist (deprecated in Codex v0.117+)
|
|
672
|
+
const oldPromptsDir = join(codexDir, "prompts");
|
|
673
|
+
for (const f of ["patchcord.md", "patchcord-wait.md"]) {
|
|
674
|
+
const p = join(oldPromptsDir, f);
|
|
675
|
+
if (existsSync(p)) { unlinkSync(p); }
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// Install Codex plugin (skills auto-discovered via @patchcord)
|
|
679
|
+
const pluginDir = join(homedir(), ".codex", "plugins", "patchcord");
|
|
680
|
+
mkdirSync(join(pluginDir, ".codex-plugin"), { recursive: true });
|
|
681
|
+
mkdirSync(join(pluginDir, "skills", "patchcord"), { recursive: true });
|
|
682
|
+
mkdirSync(join(pluginDir, "skills", "patchcord-wait"), { recursive: true });
|
|
683
|
+
// Plugin manifest
|
|
684
|
+
writeFileSync(join(pluginDir, ".codex-plugin", "plugin.json"), JSON.stringify({
|
|
685
|
+
name: "patchcord",
|
|
686
|
+
version: JSON.parse(readFileSync(join(pluginRoot, "package.json"), "utf-8")).version,
|
|
687
|
+
description: "Cross-machine agent messaging for Codex",
|
|
688
|
+
skills: "./skills/",
|
|
689
|
+
}, null, 2) + "\n");
|
|
690
|
+
// Skills
|
|
691
|
+
const codexSkillSrc = readFileSync(join(pluginRoot, "skills", "codex", "SKILL.md"), "utf-8");
|
|
692
|
+
writeFileSync(join(pluginDir, "skills", "patchcord", "SKILL.md"), codexSkillSrc);
|
|
693
|
+
const waitSkillSrc = readFileSync(join(pluginRoot, "skills", "wait", "SKILL.md"), "utf-8");
|
|
694
|
+
writeFileSync(join(pluginDir, "skills", "patchcord-wait", "SKILL.md"), waitSkillSrc);
|
|
695
|
+
|
|
696
|
+
// Marketplace entry (personal)
|
|
697
|
+
const marketplaceDir = join(homedir(), ".agents", "plugins");
|
|
698
|
+
mkdirSync(marketplaceDir, { recursive: true });
|
|
699
|
+
const marketplacePath = join(marketplaceDir, "marketplace.json");
|
|
700
|
+
let marketplace = { name: "patchcord", plugins: [] };
|
|
701
|
+
if (existsSync(marketplacePath)) {
|
|
702
|
+
try { marketplace = JSON.parse(readFileSync(marketplacePath, "utf-8")); } catch {}
|
|
703
|
+
}
|
|
704
|
+
marketplace.plugins = (marketplace.plugins || []).filter(p => p.name !== "patchcord");
|
|
705
|
+
marketplace.plugins.push({
|
|
706
|
+
name: "patchcord",
|
|
707
|
+
source: { source: "local", path: join(homedir(), ".codex", "plugins", "patchcord") },
|
|
708
|
+
policy: { installation: "INSTALLED_BY_DEFAULT" },
|
|
709
|
+
category: "Productivity",
|
|
710
|
+
});
|
|
711
|
+
writeFileSync(marketplacePath, JSON.stringify(marketplace, null, 2) + "\n");
|
|
712
|
+
|
|
676
713
|
console.log(`\n ${green}✓${r} Codex configured: ${dim}${configPath}${r}`);
|
|
677
|
-
console.log(` ${green}✓${r}
|
|
714
|
+
console.log(` ${green}✓${r} Plugin installed: ${dim}@patchcord${r}, ${dim}@patchcord-wait${r}`);
|
|
678
715
|
} else {
|
|
679
716
|
// Claude Code: write .mcp.json (MCP server only — channel plugin disabled)
|
|
680
717
|
const mcpPath = join(cwd, ".mcp.json");
|