patchcord 0.5.1 → 0.5.2

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "patchcord",
3
3
  "description": "Cross-machine agent messaging with push delivery. Messages from other agents arrive as native channel notifications.",
4
- "version": "0.5.1",
4
+ "version": "0.5.2",
5
5
  "author": {
6
6
  "name": "ppravdin"
7
7
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",
@@ -68,13 +68,19 @@ then the script is at
68
68
  description: "patchcord realtime listener (<agent>@<ns>)",
69
69
  persistent: true,
70
70
  timeout_ms: 3600000,
71
- command: "exec node \"<absolute-path-to-subscribe.mjs>\" 2>&1 | grep --line-buffered -E '^PATCHCORD:|^subscribe: (fatal|ws error|token|already|connected|reconnecting|cwd|agent)'"
71
+ command: "exec node \"<absolute-path-to-subscribe.mjs>\" 2>&1 | grep --line-buffered '^PATCHCORD:'"
72
72
  )
73
73
  ```
74
- The `grep` filter is intentional it surfaces the signal lines
75
- (`PATCHCORD:` arrivals, connect/disconnect, errors) and drops the
76
- noise. The filter catches every terminal/state-change event, so the
77
- Monitor won't silently miss a crash.
74
+ The filter is deliberately narrow: **only** `PATCHCORD:` lines
75
+ (actual message arrivals) become notifications. Everything else the
76
+ script writes `connected`, `token refreshed`, `cwd=...`,
77
+ `agent=...`, `reconnecting in Nms` is plumbing the user doesn't
78
+ need to see. Those lines still land in Monitor's output file, so you
79
+ can Read them on demand if something looks off.
80
+
81
+ Crash detection is handled automatically by Monitor itself: when the
82
+ `node` process exits, you get a built-in "stream ended" task
83
+ notification with the exit code. No filter needed for that.
78
84
 
79
85
  6. **Tell the user one short line:**
80
86
  "Patchcord listener active — I'll pick up new messages as they arrive."
@@ -97,18 +103,25 @@ There is no `/patchcord:unsubscribe` command. Tell the user either:
97
103
  - Run `kill $(cat /tmp/patchcord_subscribe_<namespace>_<agent>.pid)` in
98
104
  a terminal.
99
105
 
100
- # If it fails to start
106
+ # If the Monitor stream ends
101
107
 
102
- Stderr shows the exact cause. Report it to the user verbatim and stop
103
- do not loop or retry:
108
+ That means the subscribe process exited. Before telling the user
109
+ anything, Read the Monitor output file (the path is in the stream-end
110
+ task notification) to see the last stderr lines. The concrete failure
111
+ strings:
104
112
 
105
113
  - `no .mcp.json in <cwd>` — session is not in a patchcord project dir.
106
- - `token rejected` — bearer in `.mcp.json` is bad; regenerate from the
107
- dashboard.
114
+ - `token rejected (HTTP 401|403)` — bearer in `.mcp.json` is bad;
115
+ regenerate from the dashboard.
108
116
  - `server not configured for realtime` — server hasn't had
109
117
  `SUPABASE_JWT_SECRET` / `SUPABASE_ANON_KEY` set. Self-hosted without
110
118
  Supabase does not support this feature yet.
111
119
  - `namespace not owned` — the token's namespace lost its owner row;
112
120
  regenerate from the dashboard.
113
- - `already running (pid N)` — pidfile guard tripped. Another subscribe
114
- is active. Report and stop.
121
+ - `already running (pid N)` (exit code 2) — pidfile guard tripped.
122
+ Another subscribe is active. Report and stop.
123
+
124
+ Report the specific cause to the user, do not loop or retry. If the
125
+ process exited cleanly after many successful reconnects with no error
126
+ line, that's either a session close or the user killed it — no action
127
+ needed.