patchcord 0.5.76 → 0.5.77

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.5.76",
3
+ "version": "0.5.77",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",
@@ -8,11 +8,7 @@ description: >
8
8
 
9
9
  # patchcord:subscribe
10
10
 
11
- Kimi uses **background polling** for proactive message notification. The `patchcord subscribe` command polls the inbox every N seconds and exits when messages are found, triggering Kimi's auto-run.
12
-
13
- ## Start the listener
14
-
15
- Run `patchcord subscribe` as a **background Shell task** with a short poll interval and long timeout:
11
+ Run this exact background Shell task:
16
12
 
17
13
  ```
18
14
  Shell:
@@ -22,44 +18,7 @@ Shell:
22
18
  timeout: 86400
23
19
  ```
24
20
 
25
- **`command: patchcord subscribe 5`**poll every 5 seconds for responsive wake-up. Do not rely on the script's 30-second default; always pass an explicit interval.
26
-
27
- **`timeout: 86400`** background tasks default to 60 seconds, which is too short for polling. Use `86400` (24 hours, the maximum) so the listener stays active until a message arrives.
28
-
29
- ## How it works
30
-
31
- - Walks up from cwd looking for `.kimi/mcp.json`, falls back to global
32
- - Polls `/api/inbox?status=pending` every N seconds
33
- - When messages found: writes `~/.kimi/patchcord-subscribe-notify.txt` and **exits 0**
34
- - Kimi's `BackgroundTaskManager` detects the terminal state
35
- - If `background_autotrigger_armed = true`, Kimi auto-starts a new turn
36
- - **One-shot** — must be re-launched after each detection
37
- - **Pidfile guard** — prevents multiple concurrent instances
38
-
39
- ## Re-arming the background poll
40
-
41
- **Critical:** the background poll is **one-shot** — it exits on first detection and must be re-launched. Every time you read messages from `inbox()` or `wait_for_message()`, **re-arm the listener before doing any work**:
42
-
43
- ```
44
- Shell:
45
- command: patchcord subscribe 5
46
- run_in_background: true
47
- description: Patchcord inbox polling
48
- timeout: 86400
49
- ```
50
-
51
- This ensures the next incoming message will also wake you up.
52
-
53
- ## Stop hook (secondary)
54
-
55
- Kimi also has a Stop hook (`~/.kimi/patchcord-stop-hook.sh`) that checks the inbox at the end of each turn. If messages are pending, it triggers a new turn with the notification. This is a fallback — it only fires when a turn is already ending. The background poll is the primary proactive mechanism.
56
-
57
- ## Limitations
58
-
59
- ### Auto-trigger requires "arming"
60
-
61
- Kimi only auto-triggers on background task completion after the user has sent at least one message in the session (`background_autotrigger_armed = true`). A fresh idle session with zero user turns will NOT auto-trigger.
62
-
63
- ### Message consumption by other clients
64
-
65
- If the same Patchcord identity is also used by Claude Code or Codex (with `patchcord subscribe` running), those clients will consume messages via their WebSocket listeners. The Kimi background poll competes with them. For reliable Kimi-only usage, use a dedicated agent identity.
21
+ - `command: patchcord subscribe 5`polls inbox every **5 seconds**
22
+ - `timeout: 86400` — runs for **24 hours** (maximum). Always 86400, never anything else.
23
+ - One-shot: exits when messages found, triggers Kimi auto-run
24
+ - Must re-arm after every `inbox()` or `wait_for_message()` call by running the exact same command again
@@ -3,13 +3,12 @@ name: patchcord:wait
3
3
  description: >
4
4
  Block this turn for up to 5 minutes waiting for one incoming Patchcord
5
5
  message via the wait_for_message MCP tool. Single blocking call, no
6
- background process. Use ONLY when the user explicitly runs /patchcord:wait
7
- or asks you to wait for a patchcord message.
6
+ background process.
8
7
  ---
9
8
 
10
9
  # patchcord:wait
11
10
 
12
- User invoked /patchcord:wait or asked you to wait for a Patchcord message. Use `wait_for_message()` only. Do NOT spawn a background listener.
11
+ Use `wait_for_message()` only. Do NOT spawn a background listener.
13
12
 
14
13
  Call `wait_for_message()` to block until a message arrives (up to 5 minutes).
15
14
 
@@ -453,7 +453,7 @@ function runOnce(ticket, baseUrl, token, refreshTicket) {
453
453
  // Successful subscribe ack — log once for confirmation, then quiet.
454
454
  // Replace Supabase's "Subscribed to PostgreSQL" with a user-facing label.
455
455
  if (status === "ok" && message) {
456
- const displayMsg = message.replace(/PostgreSQL/g, "Patchcord");
456
+ const displayMsg = message.replace(/postgresql/gi, "Patchcord").replace(/postgres/gi, "Patchcord");
457
457
  logErr(`subscribe: system ok on ${frame.topic}: ${displayMsg}`);
458
458
  }
459
459
  return;