claude-live 2.0.4 → 2.0.6

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,101 +1,101 @@
1
1
  {
2
- "description": "claude-live hooks — forwards Claude Code events to the visualizer",
2
+ "description": "claude-live hooks — auto-starts server on SessionStart, forwards all events to visualizer",
3
3
  "hooks": {
4
4
  "SessionStart": [{
5
5
  "hooks": [{
6
6
  "type": "command",
7
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
7
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start",
8
8
  "async": true
9
9
  }]
10
10
  }],
11
11
  "InstructionsLoaded": [{
12
12
  "hooks": [{
13
13
  "type": "command",
14
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
14
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
15
15
  "async": true
16
16
  }]
17
17
  }],
18
18
  "WorktreeCreate": [{
19
19
  "hooks": [{
20
20
  "type": "command",
21
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
21
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
22
22
  "async": true
23
23
  }]
24
24
  }],
25
25
  "WorktreeRemove": [{
26
26
  "hooks": [{
27
27
  "type": "command",
28
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
28
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
29
29
  "async": true
30
30
  }]
31
31
  }],
32
32
  "PreToolUse": [{
33
33
  "hooks": [{
34
34
  "type": "command",
35
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
35
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
36
36
  "async": true
37
37
  }]
38
38
  }],
39
39
  "PostToolUse": [{
40
40
  "hooks": [{
41
41
  "type": "command",
42
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
42
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
43
43
  "async": true
44
44
  }]
45
45
  }],
46
46
  "Stop": [{
47
47
  "hooks": [{
48
48
  "type": "command",
49
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
49
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
50
50
  "async": true
51
51
  }]
52
52
  }],
53
53
  "Notification": [{
54
54
  "hooks": [{
55
55
  "type": "command",
56
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
56
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
57
57
  "async": true
58
58
  }]
59
59
  }],
60
60
  "PermissionRequest": [{
61
61
  "hooks": [{
62
62
  "type": "command",
63
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
63
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
64
64
  "async": true
65
65
  }]
66
66
  }],
67
67
  "SubagentStart": [{
68
68
  "hooks": [{
69
69
  "type": "command",
70
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
70
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
71
71
  "async": true
72
72
  }]
73
73
  }],
74
74
  "SubagentStop": [{
75
75
  "hooks": [{
76
76
  "type": "command",
77
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
77
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
78
78
  "async": true
79
79
  }]
80
80
  }],
81
81
  "SessionEnd": [{
82
82
  "hooks": [{
83
83
  "type": "command",
84
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
84
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
85
85
  "async": true
86
86
  }]
87
87
  }],
88
88
  "PostToolUseFailure": [{
89
89
  "hooks": [{
90
90
  "type": "command",
91
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
91
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
92
92
  "async": true
93
93
  }]
94
94
  }],
95
95
  "UserPromptSubmit": [{
96
96
  "hooks": [{
97
97
  "type": "command",
98
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
98
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
99
99
  "async": true
100
100
  }]
101
101
  }],
@@ -103,7 +103,7 @@
103
103
  "match": { "trigger": ["manual", "auto"] },
104
104
  "hooks": [{
105
105
  "type": "command",
106
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
106
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
107
107
  "async": true
108
108
  }]
109
109
  }],
@@ -111,49 +111,49 @@
111
111
  "match": { "trigger": ["manual", "auto"] },
112
112
  "hooks": [{
113
113
  "type": "command",
114
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
114
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
115
115
  "async": true
116
116
  }]
117
117
  }],
118
118
  "StopFailure": [{
119
119
  "hooks": [{
120
120
  "type": "command",
121
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
121
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
122
122
  "async": true
123
123
  }]
124
124
  }],
125
125
  "TeammateIdle": [{
126
126
  "hooks": [{
127
127
  "type": "command",
128
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
128
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
129
129
  "async": true
130
130
  }]
131
131
  }],
132
132
  "TaskCompleted": [{
133
133
  "hooks": [{
134
134
  "type": "command",
135
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
135
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
136
136
  "async": true
137
137
  }]
138
138
  }],
139
139
  "ConfigChange": [{
140
140
  "hooks": [{
141
141
  "type": "command",
142
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
142
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
143
143
  "async": true
144
144
  }]
145
145
  }],
146
146
  "Elicitation": [{
147
147
  "hooks": [{
148
148
  "type": "command",
149
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
149
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
150
150
  "async": true
151
151
  }]
152
152
  }],
153
153
  "ElicitationResult": [{
154
154
  "hooks": [{
155
155
  "type": "command",
156
- "command": "node $HOME/.claude/plugins/marketplaces/claude-live/bin/hook.js",
156
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" send-event",
157
157
  "async": true
158
158
  }]
159
159
  }]
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: diagnostics
3
+ description: Show claude-live hook health — recent log entries, success/failure rates per target, and last errors
4
+ trigger: explicit
5
+ ---
6
+
7
+ Show a diagnostics report for claude-live hooks.
8
+
9
+ ## Log location
10
+
11
+ Logs are written to `~/.config/claude-live/logs/YYYY-MM-DD.jsonl` — one JSON line per hook fire.
12
+
13
+ ## Steps
14
+
15
+ 1. Read today's log file: `~/.config/claude-live/logs/<today>.jsonl`
16
+ - If it doesn't exist, also try yesterday's
17
+ - If no logs exist at all, report: "No hook logs found — hooks may not be firing"
18
+
19
+ 2. Parse each line as JSON with fields: `ts`, `session_id`, `hook_event_name`, `tool_name`, `targets[]`
20
+ - Each target entry has: `url`, `ok` (bool), `ms`, optionally `error`
21
+
22
+ 3. Report:
23
+
24
+ ```
25
+ claude-live diagnostics
26
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27
+ Log: ~/.config/claude-live/logs/<date>.jsonl
28
+ Entries: <N> hooks fired
29
+
30
+ Targets:
31
+ http://localhost:43451 ✓ 142/150 (94%) avg 3ms
32
+ http://192.168.1.50:43451 ✗ 0/150 (0%) — connection_error
33
+
34
+ Last 5 entries:
35
+ 14:23:01 PreToolUse Bash ✓ 2ms
36
+ 14:23:00 PreToolUse Read ✓ 3ms
37
+ 14:22:58 PostToolUse Bash ✓ 2ms
38
+ ...
39
+
40
+ Recent errors (if any):
41
+ 14:20:11 PostToolUse Bash http://192.168.1.50:43451 connection_error
42
+ ```
43
+
44
+ 4. If all targets are failing: suggest running `/claude-live start` or checking `/claude-live status`
45
+ 5. If no log file: suggest the user check that the plugin is enabled with `/reload-plugins`
46
+
47
+ Use the Read tool to read the log file and Bash for `date` if needed. Keep output compact.
package/README.md CHANGED
@@ -37,9 +37,16 @@ Run `npm root -g` to find your global node_modules path if the above doesn't wor
37
37
 
38
38
  ## Use
39
39
 
40
- ```bash
41
- claude-live # Start server (foreground)
42
- claude-live start # Start server (detached)
40
+ Once installed, use the `/claude-live:server` slash command in Claude Code:
41
+
42
+ ```
43
+ /claude-live:server # Check status, auto-start if needed
44
+ /claude-live:server stop # Stop the server
45
+ /claude-live:server restart # Restart the server
46
+ /claude-live:server logs # Show last 30 log lines
47
+ /claude-live:server config # Show current endpoint URL
48
+ /claude-live:server config http://192.168.1.50:43451 # Set remote endpoint
49
+ /claude-live:server config reset # Reset to localhost default
43
50
  ```
44
51
 
45
52
  Then open http://localhost:43451 in your browser.
@@ -57,13 +64,22 @@ Multiple Claude sessions show as separate star systems. Prompts fly inward, resp
57
64
 
58
65
  Under the hood: the plugin sends every event to a lightweight Node.js server (pure passthrough, no persistence). The server broadcasts events to a PixiJS frontend via Server-Sent Events (SSE).
59
66
 
60
- ## CLI
67
+ ## Server Endpoints
61
68
 
62
- ```bash
63
- claude-live start # Open visualization in browser
64
- claude-live stop # Stop the server
65
- claude-live status # Show server status
66
- ```
69
+ | Endpoint | Method | Description |
70
+ |---|---|---|
71
+ | `/hook` | POST | Receive hook events, broadcast to SSE clients |
72
+ | `/events` | GET | SSE stream for the frontend |
73
+ | `/health` | GET | Health check — returns `{"ok":true,"clients":<N>,"port":43451}` |
74
+
75
+ ## Troubleshooting
76
+
77
+ | Symptom | Cause | Fix |
78
+ |---|---|---|
79
+ | No activity in browser | Hooks not firing | Run `/reload-plugins` or check `settings.json` hooks |
80
+ | Server not reachable | Server not running | `/claude-live:server` auto-starts it |
81
+ | `clients: 0` in `/health` | Server up, no browser tab open | Open `http://localhost:43451` |
82
+ | Hook logs location | Debug delivery failures | `~/.config/claude-live/logs/YYYY-MM-DD.jsonl` |
67
83
 
68
84
  ## Development
69
85
 
package/bin/hook.js CHANGED
@@ -1,24 +1,78 @@
1
1
  #!/usr/bin/env node
2
- // Reads a JSON event from stdin and POSTs it to the claude-live server.
3
- // Fails silently — must never block Claude Code.
4
2
  import { request } from 'http'
3
+ import { request as httpsRequest } from 'https'
4
+ import { readFileSync, mkdirSync, appendFileSync } from 'fs'
5
+ import { homedir } from 'os'
6
+ import { join } from 'path'
7
+
8
+ const CONFIG_PATH = join(homedir(), '.config', 'claude-live', 'config.json')
9
+ const LOG_DIR = join(homedir(), '.config', 'claude-live', 'logs')
10
+
11
+ function getTargets() {
12
+ try {
13
+ const cfg = JSON.parse(readFileSync(CONFIG_PATH, 'utf8'))
14
+ if (Array.isArray(cfg.targets) && cfg.targets.length > 0) return cfg.targets
15
+ if (cfg.url) return [cfg.url]
16
+ } catch {}
17
+ return ['http://localhost:43451']
18
+ }
19
+
20
+ function writeLog(entry) {
21
+ try {
22
+ mkdirSync(LOG_DIR, { recursive: true })
23
+ const date = new Date().toISOString().slice(0, 10)
24
+ appendFileSync(join(LOG_DIR, `${date}.jsonl`), JSON.stringify(entry) + '\n')
25
+ } catch {}
26
+ }
27
+
28
+ function postToTarget(url, body) {
29
+ return new Promise(resolve => {
30
+ const start = Date.now()
31
+ try {
32
+ const parsed = new URL(url)
33
+ const isHttps = parsed.protocol === 'https:'
34
+ const req = (isHttps ? httpsRequest : request)({
35
+ hostname: parsed.hostname,
36
+ port: parsed.port || (isHttps ? 443 : 80),
37
+ path: '/hook',
38
+ method: 'POST',
39
+ headers: { 'Content-Type': 'application/json', 'Content-Length': body.length },
40
+ timeout: 2000,
41
+ }, res => {
42
+ res.resume()
43
+ resolve({ url, ok: res.statusCode === 200, ms: Date.now() - start })
44
+ })
45
+ req.on('error', () => resolve({ url, ok: false, ms: Date.now() - start, error: 'connection_error' }))
46
+ req.on('timeout', () => { req.destroy(); resolve({ url, ok: false, ms: Date.now() - start, error: 'timeout' }) })
47
+ req.end(body)
48
+ } catch (e) {
49
+ resolve({ url, ok: false, ms: Date.now() - start, error: e.message })
50
+ }
51
+ })
52
+ }
5
53
 
6
54
  let data = ''
7
55
  process.stdin.setEncoding('utf8')
8
56
  process.stdin.on('data', c => data += c)
9
- process.stdin.on('end', () => {
57
+ process.stdin.on('end', async () => {
10
58
  if (!data.trim()) process.exit(0)
59
+
11
60
  const body = Buffer.from(data)
12
- const req = request({
13
- hostname: '127.0.0.1',
14
- port: parseInt(process.env.CLAUDE_LIVE_PORT || '43451', 10),
15
- path: '/hook',
16
- method: 'POST',
17
- headers: { 'Content-Type': 'application/json', 'Content-Length': body.length },
18
- timeout: 2000,
61
+ const targets = getTargets()
62
+
63
+ let event = {}
64
+ try { event = JSON.parse(data) } catch {}
65
+
66
+ const results = await Promise.all(targets.map(url => postToTarget(url, body)))
67
+
68
+ writeLog({
69
+ ts: new Date().toISOString(),
70
+ session_id: event.session_id ?? null,
71
+ hook_event_name: event.hook_event_name ?? null,
72
+ tool_name: event.tool_name ?? null,
73
+ targets: results,
19
74
  })
20
- req.on('error', () => {})
21
- req.on('timeout', () => req.destroy())
22
- req.end(body)
75
+
76
+ process.exit(0)
23
77
  })
24
- process.stdin.on('error', () => {})
78
+ process.stdin.on('error', () => process.exit(0))
@@ -20,23 +20,29 @@ User's argument: $ARGUMENTS
20
20
 
21
21
  ## Status output (default and after start)
22
22
 
23
- Run these and display in a compact summary:
23
+ Use `/health` endpoint not SSE stream (SSE causes false negatives with short timeouts):
24
24
 
25
25
  ```
26
- curl -sf http://localhost:43451/events -o /dev/null -m 1 2>&1 && echo "● running on port 43451 — http://localhost:43451" || echo "○ stopped"
26
+ curl -sf http://localhost:43451/health -m 2
27
+ ```
28
+
29
+ Returns `{"ok":true,"clients":<N>,"port":43451}` when running.
30
+
31
+ Also show:
32
+ ```
27
33
  ps -eo pid,etime,cmd | grep "node.*server/index.js" | grep -v grep
28
34
  tail -5 /tmp/claude-live.log 2>/dev/null
29
35
  ```
30
36
 
31
- Show: running/stopped, port (always 43451), PID and uptime if running, last 5 log lines.
37
+ Show: running/stopped, port (always 43451), PID and uptime if running, client count, last 5 log lines.
32
38
 
33
39
  ## Config Management
34
40
 
35
- The `/claude-live config` subcommands manage where hooks send events.
41
+ The `/claude-live:server config` subcommands manage where hooks send events.
36
42
 
37
43
  ### Display current URL
38
44
  ```
39
- /claude-live config
45
+ /claude-live:server config
40
46
  ```
41
47
  Output example: `● Configured: http://192.168.1.50:43451 (from global config)`
42
48
 
@@ -48,7 +54,7 @@ Possible sources shown:
48
54
 
49
55
  ### Set global URL
50
56
  ```
51
- /claude-live config http://192.168.1.50:43451
57
+ /claude-live:server config http://192.168.1.50:43451
52
58
  ```
53
59
  Output: `✓ URL set to http://192.168.1.50:43451`
54
60
 
@@ -70,7 +76,7 @@ Invalid URLs:
70
76
 
71
77
  ### Reset to default
72
78
  ```
73
- /claude-live config reset
79
+ /claude-live:server config reset
74
80
  ```
75
81
  Output: `✓ Reset to default (localhost:43451)`
76
82
 
@@ -0,0 +1,38 @@
1
+ : << 'CMDBLOCK'
2
+ @echo off
3
+ REM Cross-platform polyglot wrapper for hook scripts.
4
+ REM On Windows: cmd.exe runs the batch portion.
5
+ REM On Unix: the shell interprets this as a script (: is a no-op).
6
+
7
+ if "%~1"=="" (
8
+ echo run-hook.cmd: missing script name >&2
9
+ exit /b 1
10
+ )
11
+
12
+ set "HOOK_DIR=%~dp0"
13
+
14
+ if exist "C:\Program Files\Git\bin\bash.exe" (
15
+ "C:\Program Files\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
16
+ exit /b %ERRORLEVEL%
17
+ )
18
+ if exist "C:\Program Files (x86)\Git\bin\bash.exe" (
19
+ "C:\Program Files (x86)\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
20
+ exit /b %ERRORLEVEL%
21
+ )
22
+ where bash >nul 2>nul
23
+ if %ERRORLEVEL% equ 0 (
24
+ bash "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
25
+ exit /b %ERRORLEVEL%
26
+ )
27
+ exit /b 0
28
+ CMDBLOCK
29
+
30
+ # Unix: run the named script directly
31
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
32
+ if [ -z "${1:-}" ]; then
33
+ echo "run-hook.cmd: missing script name" >&2
34
+ exit 1
35
+ fi
36
+ SCRIPT_NAME="$1"
37
+ shift
38
+ exec bash "${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ # Forwards stdin event JSON to bin/hook.js. Fails silently.
3
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
4
+ PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
5
+ exec node "${PLUGIN_ROOT}/bin/hook.js"
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env bash
2
+ # SessionStart hook: auto-starts claude-live server if not running, then forwards event.
3
+ set -euo pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
+ PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
7
+ SERVER="${PLUGIN_ROOT}/server/index.js"
8
+ LOG="/tmp/claude-live.log"
9
+ PORT="${CLAUDE_LIVE_PORT:-43451}"
10
+
11
+ # Read stdin so it's available to forward
12
+ input="$(cat)"
13
+
14
+ # Check if server is already running.
15
+ # /events is an SSE stream that never closes, so curl exits with 28 (timeout) on success.
16
+ # We treat exit 0 (got data + closed) and 28 (timeout = streaming) as "server up".
17
+ server_up() {
18
+ local code
19
+ curl -s "http://127.0.0.1:${PORT}/events" -o /dev/null -m 1 2>/dev/null
20
+ code=$?
21
+ [ "$code" -eq 0 ] || [ "$code" -eq 28 ]
22
+ }
23
+
24
+ if ! server_up; then
25
+ # Start server detached
26
+ nohup node "${SERVER}" >"${LOG}" 2>&1 &
27
+ disown
28
+ # Wait up to 3s for it to come up
29
+ for i in 1 2 3; do
30
+ sleep 1
31
+ server_up && break
32
+ done
33
+ fi
34
+
35
+ # Forward event to server (if it came up)
36
+ if [ -n "$input" ]; then
37
+ printf '%s' "$input" | node "${PLUGIN_ROOT}/bin/hook.js" || true
38
+ fi
39
+
40
+ exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-live",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Realtime Claude Code activity visualizer",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/marisancans/claude-live",
@@ -19,7 +19,8 @@
19
19
  "bin/",
20
20
  "client/dist/",
21
21
  ".claude-plugin/",
22
- "commands/"
22
+ "commands/",
23
+ "hooks/"
23
24
  ],
24
25
  "engines": {
25
26
  "node": ">=18"
package/server/index.js CHANGED
@@ -52,6 +52,13 @@ const server = createServer((req, res) => {
52
52
  return
53
53
  }
54
54
 
55
+ // GET /health — health check
56
+ if (req.method === 'GET' && req.url === '/health') {
57
+ res.writeHead(200, { 'Content-Type': 'application/json' })
58
+ res.end(JSON.stringify({ ok: true, clients: clients.size, port: PORT }))
59
+ return
60
+ }
61
+
55
62
  // GET /events — SSE stream
56
63
  if (req.method === 'GET' && req.url === '/events') {
57
64
  res.writeHead(200, {