patchcord 0.3.34 → 0.3.36

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 CHANGED
@@ -149,6 +149,7 @@ if (!cmd || cmd === "install" || cmd === "agent") {
149
149
  if (existsSync(join(process.env.HOME || "", ".gemini"))) {
150
150
  const geminiSkillDir = join(process.env.HOME || "", ".gemini", "skills", "patchcord");
151
151
  const geminiWaitDir = join(process.env.HOME || "", ".gemini", "skills", "patchcord-wait");
152
+ const geminiCmdDir = join(process.env.HOME || "", ".gemini", "commands");
152
153
  let geminiChanged = false;
153
154
  if (!existsSync(geminiSkillDir)) {
154
155
  mkdirSync(geminiSkillDir, { recursive: true });
@@ -160,7 +161,13 @@ if (!cmd || cmd === "install" || cmd === "agent") {
160
161
  cpSync(join(pluginRoot, "skills", "wait", "SKILL.md"), join(geminiWaitDir, "SKILL.md"));
161
162
  geminiChanged = true;
162
163
  }
163
- if (geminiChanged) globalChanges.push("Gemini CLI skills installed");
164
+ if (!existsSync(join(geminiCmdDir, "patchcord.toml"))) {
165
+ mkdirSync(geminiCmdDir, { recursive: true });
166
+ cpSync(join(pluginRoot, "commands", "patchcord.toml"), join(geminiCmdDir, "patchcord.toml"));
167
+ cpSync(join(pluginRoot, "commands", "patchcord-wait.toml"), join(geminiCmdDir, "patchcord-wait.toml"));
168
+ geminiChanged = true;
169
+ }
170
+ if (geminiChanged) globalChanges.push("Gemini CLI skills + commands installed");
164
171
  }
165
172
 
166
173
  // Codex CLI
@@ -198,15 +205,17 @@ if (!cmd || cmd === "install" || cmd === "agent") {
198
205
  console.log(` ${cyan}2.${r} Codex CLI`);
199
206
  console.log(` ${cyan}3.${r} Cursor`);
200
207
  console.log(` ${cyan}4.${r} Windsurf`);
201
- console.log(` ${cyan}5.${r} Gemini CLI\n`);
208
+ console.log(` ${cyan}5.${r} Gemini CLI`);
209
+ console.log(` ${cyan}6.${r} VS Code (Copilot)\n`);
202
210
 
203
- const choice = (await ask(`${dim}Choose (1/2/3/4/5):${r} `)).trim();
211
+ const choice = (await ask(`${dim}Choose (1-6):${r} `)).trim();
204
212
  const isCodex = choice === "2";
205
213
  const isCursor = choice === "3";
206
214
  const isWindsurf = choice === "4";
207
215
  const isGemini = choice === "5";
216
+ const isVSCode = choice === "6";
208
217
 
209
- if (!["1", "2", "3", "4", "5"].includes(choice)) {
218
+ if (!["1", "2", "3", "4", "5", "6"].includes(choice)) {
210
219
  console.error("Invalid choice.");
211
220
  rl.close();
212
221
  process.exit(1);
@@ -309,6 +318,23 @@ if (!cmd || cmd === "install" || cmd === "agent") {
309
318
  }
310
319
  } catch {}
311
320
  }
321
+ } else if (isVSCode) {
322
+ const vscodePath = join(cwd, ".vscode", "mcp.json");
323
+ if (existsSync(vscodePath)) {
324
+ try {
325
+ const existing = JSON.parse(readFileSync(vscodePath, "utf-8"));
326
+ if (existing.servers?.patchcord) {
327
+ console.log(`\n ${yellow}⚠ VS Code already configured in this project${r}`);
328
+ console.log(` ${dim}${vscodePath}${r}`);
329
+ const replace = (await ask(` ${dim}Replace? (y/N):${r} `)).trim().toLowerCase();
330
+ if (replace !== "y" && replace !== "yes") {
331
+ console.log("Keeping existing config.");
332
+ rl.close();
333
+ process.exit(0);
334
+ }
335
+ }
336
+ } catch {}
337
+ }
312
338
  } else if (isCodex) {
313
339
  const configPath = join(cwd, ".codex", "config.toml");
314
340
  if (existsSync(configPath)) {
@@ -479,6 +505,37 @@ if (!cmd || cmd === "install" || cmd === "agent") {
479
505
  writeFileSync(geminiPath, JSON.stringify(geminiSettings, null, 2) + "\n");
480
506
  console.log(`\n ${green}✓${r} Gemini CLI configured: ${dim}${geminiPath}${r}`);
481
507
  console.log(` ${yellow}Global config — all Gemini CLI projects share this agent.${r}`);
508
+ } else if (isVSCode) {
509
+ // VS Code: write .vscode/mcp.json (per-project)
510
+ const vscodeDir = join(cwd, ".vscode");
511
+ mkdirSync(vscodeDir, { recursive: true });
512
+ const vscodePath = join(vscodeDir, "mcp.json");
513
+ const vscodeConfig = {
514
+ servers: {
515
+ patchcord: {
516
+ type: "http",
517
+ url: `${serverUrl}/mcp`,
518
+ headers: {
519
+ Authorization: `Bearer ${token}`,
520
+ },
521
+ },
522
+ },
523
+ };
524
+
525
+ if (existsSync(vscodePath)) {
526
+ try {
527
+ const existing = JSON.parse(readFileSync(vscodePath, "utf-8"));
528
+ existing.servers = existing.servers || {};
529
+ existing.servers.patchcord = vscodeConfig.servers.patchcord;
530
+ writeFileSync(vscodePath, JSON.stringify(existing, null, 2) + "\n");
531
+ } catch {
532
+ writeFileSync(vscodePath, JSON.stringify(vscodeConfig, null, 2) + "\n");
533
+ }
534
+ } else {
535
+ writeFileSync(vscodePath, JSON.stringify(vscodeConfig, null, 2) + "\n");
536
+ }
537
+ console.log(`\n ${green}✓${r} VS Code configured: ${dim}${vscodePath}${r}`);
538
+ console.log(` ${dim}Requires GitHub Copilot extension with agent mode enabled.${r}`);
482
539
  } else if (isCodex) {
483
540
  // Codex: copy skill + write config + install slash commands
484
541
  const dest = join(cwd, ".agents", "skills", "patchcord");
@@ -530,7 +587,7 @@ if (!cmd || cmd === "install" || cmd === "agent") {
530
587
  console.log(`\n ${green}✓${r} Claude Code configured: ${dim}${mcpPath}${r}`);
531
588
  }
532
589
 
533
- const toolName = isGemini ? "Gemini CLI" : isWindsurf ? "Windsurf" : isCursor ? "Cursor" : isCodex ? "Codex" : "Claude Code";
590
+ const toolName = isVSCode ? "VS Code" : isGemini ? "Gemini CLI" : isWindsurf ? "Windsurf" : isCursor ? "Cursor" : isCodex ? "Codex" : "Claude Code";
534
591
  console.log(`\n${dim}Restart your ${toolName} session, then run:${r} ${bold}inbox()${r}`);
535
592
  process.exit(0);
536
593
  }
@@ -0,0 +1 @@
1
+ prompt = "Enter listening mode. Call wait_for_message() to block until a message arrives. When one arrives: do the work, reply with what you did, then call wait_for_message() again to keep listening."
@@ -0,0 +1 @@
1
+ prompt = "Call inbox() to check for pending patchcord messages. Reply to all immediately — do the work first, then reply with what you did. After replying, call wait_for_message() to stay responsive."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.3.34",
3
+ "version": "0.3.36",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",
@@ -26,6 +26,7 @@
26
26
  "hooks/",
27
27
  "scripts/",
28
28
  "skills/",
29
+ "commands/",
29
30
  "README.md"
30
31
  ]
31
32
  }