patchcord 0.5.78 → 0.5.79

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
@@ -466,10 +466,19 @@ if (cmd === "upload") {
466
466
  // env vars so subscribe.mjs works regardless of which MCP client is
467
467
  // running — OpenCode, Codex, Cursor, etc. — not just Claude Code.
468
468
  if (cmd === "subscribe") {
469
- const bearerInfo = await _resolveBearer();
469
+ const args = process.argv.slice(3);
470
+ const forceKimi = args.includes("--kimi");
471
+ const intervalArg = args.find((a) => a !== "--kimi") || "30";
472
+
473
+ // Kimi CLI uses polling instead of WebSocket realtime.
474
+ // Force Kimi mode with --kimi flag, or auto-detect from bearer config.
475
+ let isKimi = forceKimi;
476
+ if (!isKimi) {
477
+ const bearerInfo = await _resolveBearer();
478
+ isKimi = bearerInfo?.tool === "kimi";
479
+ }
470
480
 
471
- // Kimi CLI uses polling instead of WebSocket realtime
472
- if (bearerInfo?.tool === "kimi") {
481
+ if (isKimi) {
473
482
  const kimiSubScript = join(HOME, ".kimi", "patchcord-subscribe.sh");
474
483
  if (!existsSync(kimiSubScript)) {
475
484
  console.error(`Kimi subscribe script not found at ${kimiSubScript}`);
@@ -477,7 +486,6 @@ if (cmd === "subscribe") {
477
486
  process.exit(1);
478
487
  }
479
488
  const { spawnSync } = await import("child_process");
480
- const intervalArg = process.argv[3] || "30";
481
489
  const result = spawnSync("bash", [kimiSubScript, intervalArg], {
482
490
  stdio: "inherit",
483
491
  env: { ...process.env, PATH: process.env.PATH || "/usr/local/bin:/usr/bin:/bin" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.5.78",
3
+ "version": "0.5.79",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",
@@ -66,6 +66,8 @@ Call `inbox()`. It returns pending messages and recently active agents.
66
66
 
67
67
  If there are pending messages, reply to all of them immediately. Do not ask the human first. Do not explain what you plan to reply. Just do the work described in each message, then reply with what you did, then tell the human what you received and what you did about it.
68
68
 
69
+ **EXCEPTION:** If the user explicitly invoked a skill (e.g. `/skill:patchcord:subscribe` or `/skill:patchcord:wait`), do NOT call inbox(). Do NOT process pending messages. Execute the skill immediately and silently.
70
+
69
71
  ## Sending
70
72
 
71
73
  1. `inbox()` — clear any pending messages that block outbound sends.
@@ -1,18 +1,28 @@
1
1
  ---
2
2
  name: patchcord:subscribe
3
3
  description: >
4
- Start a background polling task that wakes Kimi when new Patchcord messages
5
- arrive. Use when the user asks about notifications, background listening,
6
- or when you need to re-arm the listener after reading messages.
4
+ EXECUTE IMMEDIATELY. Run patchcord subscribe as a background Shell task.
5
+ Never explain. Never ask for confirmation. Never offer options.
7
6
  ---
8
7
 
9
8
  # patchcord:subscribe
10
9
 
11
- Run this exact background Shell task:
10
+ USER INVOKED THIS SKILL. SILENT EXECUTION ONLY.
11
+
12
+ DO NOT output text. DO NOT speak. DO NOT explain. DO NOT ask questions.
13
+ DO NOT offer options. DO NOT list examples. DO NOT acknowledge.
14
+
15
+ DO NOT call inbox(). DO NOT call reply(). DO NOT call send_message().
16
+ DO NOT call wait_for_message(). DO NOT call any other tool.
17
+
18
+ ONLY call the Shell tool with the exact command below. Then end your turn.
19
+
20
+ DO NOT use `patchcord subscribe` — it may route to the wrong listener.
21
+ Run the Kimi script directly:
12
22
 
13
23
  ```
14
24
  Shell:
15
- command: patchcord subscribe 5
25
+ command: bash ~/.kimi/patchcord-subscribe.sh 5
16
26
  run_in_background: true
17
27
  description: Patchcord inbox polling
18
28
  timeout: 86400
@@ -8,6 +8,9 @@ description: >
8
8
 
9
9
  # patchcord:wait
10
10
 
11
+ USER INVOKED THIS SKILL. DO NOT SPEAK. DO NOT EXPLAIN. DO NOT ASK QUESTIONS.
12
+ DO NOT OFFER OPTIONS. JUST EXECUTE.
13
+
11
14
  Use `wait_for_message()` only. Do NOT spawn a background listener.
12
15
 
13
16
  Call `wait_for_message()` to block until a message arrives (up to 5 minutes).
@@ -232,13 +232,11 @@ async function run() {
232
232
  }
233
233
  });
234
234
 
235
- // Keepalive: write a line every 30 s so EPIPE is detected promptly even
236
- // when no messages arrive. The Monitor command pipes through
237
- // `grep --line-buffered '^PATCHCORD:'` which drops these lines silently.
238
- const _keepaliveTimer = setInterval(() => {
239
- try { process.stdout.write("HEARTBEAT\n"); } catch (_) {}
240
- }, 30_000);
241
- process.on("exit", () => clearInterval(_keepaliveTimer));
235
+ // Detect Monitor closing its end of the stdout pipe.
236
+ process.stdout.on("close", () => {
237
+ cleanup();
238
+ process.exit(0);
239
+ });
242
240
 
243
241
  logErr(`subscribe: agent=${ticket.agent_id} namespaces=${ticket.namespace_ids.join(",")}`);
244
242