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.
Files changed (2) hide show
  1. package/bin/patchcord.mjs +44 -7
  2. 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
- // Slash commands (.codex/prompts/) plain text, no YAML frontmatter
672
- const codexPromptsDir = join(codexDir, "prompts");
673
- mkdirSync(codexPromptsDir, { recursive: true });
674
- writeFileSync(join(codexPromptsDir, "patchcord.md"), `Check patchcord inbox using the patchcord-codex MCP server. Call patchcord-codex.inbox() to see pending messages and who is online. Reply to all pending messages immediately — do the work first, then reply with what you did. After replying, call patchcord-codex.wait_for_message() to stay responsive for follow-ups. Do NOT use codex_apps tools.\n`);
675
- writeFileSync(join(codexPromptsDir, "patchcord-wait.md"), `Enter patchcord listening mode using the patchcord-codex MCP server. Call patchcord-codex.wait_for_message() to block until a message arrives. When one arrives, do the work described, reply with what you did, then call patchcord-codex.wait_for_message() again. Do NOT use codex_apps tools.\n`);
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} Slash commands: ${dim}/patchcord${r}, ${dim}/patchcord-wait${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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.3.63",
3
+ "version": "0.3.64",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",