patchcord 0.3.63 → 0.3.65

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 +48 -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,54 @@ 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 per-project slash commands (deprecated in Codex v0.117+)
672
+ for (const dir of [join(codexDir, "prompts"), join(homedir(), ".codex", "prompts")]) {
673
+ for (const f of ["patchcord.md", "patchcord-wait.md"]) {
674
+ const p = join(dir, f);
675
+ if (existsSync(p)) { unlinkSync(p); }
676
+ }
677
+ }
678
+ // Clean up old per-project skill (now installed as global plugin)
679
+ const oldSkillPath = join(cwd, ".agents", "skills", "patchcord", "SKILL.md");
680
+ if (existsSync(oldSkillPath)) { unlinkSync(oldSkillPath); }
681
+
682
+ // Install Codex plugin (skills auto-discovered via @patchcord)
683
+ const pluginDir = join(homedir(), ".codex", "plugins", "patchcord");
684
+ mkdirSync(join(pluginDir, ".codex-plugin"), { recursive: true });
685
+ mkdirSync(join(pluginDir, "skills", "patchcord"), { recursive: true });
686
+ mkdirSync(join(pluginDir, "skills", "patchcord-wait"), { recursive: true });
687
+ // Plugin manifest
688
+ writeFileSync(join(pluginDir, ".codex-plugin", "plugin.json"), JSON.stringify({
689
+ name: "patchcord",
690
+ version: JSON.parse(readFileSync(join(pluginRoot, "package.json"), "utf-8")).version,
691
+ description: "Cross-machine agent messaging for Codex",
692
+ skills: "./skills/",
693
+ }, null, 2) + "\n");
694
+ // Skills
695
+ const codexSkillSrc = readFileSync(join(pluginRoot, "skills", "codex", "SKILL.md"), "utf-8");
696
+ writeFileSync(join(pluginDir, "skills", "patchcord", "SKILL.md"), codexSkillSrc);
697
+ const waitSkillSrc = readFileSync(join(pluginRoot, "skills", "wait", "SKILL.md"), "utf-8");
698
+ writeFileSync(join(pluginDir, "skills", "patchcord-wait", "SKILL.md"), waitSkillSrc);
699
+
700
+ // Marketplace entry (personal)
701
+ const marketplaceDir = join(homedir(), ".agents", "plugins");
702
+ mkdirSync(marketplaceDir, { recursive: true });
703
+ const marketplacePath = join(marketplaceDir, "marketplace.json");
704
+ let marketplace = { name: "patchcord", plugins: [] };
705
+ if (existsSync(marketplacePath)) {
706
+ try { marketplace = JSON.parse(readFileSync(marketplacePath, "utf-8")); } catch {}
707
+ }
708
+ marketplace.plugins = (marketplace.plugins || []).filter(p => p.name !== "patchcord");
709
+ marketplace.plugins.push({
710
+ name: "patchcord",
711
+ source: { source: "local", path: join(homedir(), ".codex", "plugins", "patchcord") },
712
+ policy: { installation: "INSTALLED_BY_DEFAULT" },
713
+ category: "Productivity",
714
+ });
715
+ writeFileSync(marketplacePath, JSON.stringify(marketplace, null, 2) + "\n");
716
+
676
717
  console.log(`\n ${green}✓${r} Codex configured: ${dim}${configPath}${r}`);
677
- console.log(` ${green}✓${r} Slash commands: ${dim}/patchcord${r}, ${dim}/patchcord-wait${r}`);
718
+ console.log(` ${green}✓${r} Plugin installed: ${dim}@patchcord${r}, ${dim}@patchcord-wait${r}`);
678
719
  } else {
679
720
  // Claude Code: write .mcp.json (MCP server only — channel plugin disabled)
680
721
  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.65",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",