MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / broadcast

Function broadcast

lib/logger.js:95–108  ·  view source on GitHub ↗
(msg)

Source from the content-addressed store, hash-verified

93}
94
95function broadcast(msg) {
96 if (!state.wss) return;
97 const raw = JSON.stringify(msg);
98 const recipients = [];
99 for (const ws of state.wss.clients) {
100 if (isAuthenticatedClient(ws)) {
101 ws.send(raw);
102 recipients.push(wsLabel(ws));
103 }
104 }
105 if (msg.type === 'status' || msg.type === 'transcript_ready' || msg.type === 'turn_state') {
106 log(`Broadcast ${msg.type} -> ${recipients.length} client(s)${recipients.length ? ` [${recipients.join(', ')}]` : ''}`);
107 }
108}
109
110function autoResolveAllPendingApprovals(reason = '') {
111 if (state.pendingApprovals.size === 0) return;

Callers 9

spawnClaudeFunction · 0.85
restartClaudeFunction · 0.85
attachTranscriptFunction · 0.85
startTailingFunction · 0.85
setTurnStateFunction · 0.85
emitInterruptFunction · 0.85
setupWebSocketServerFunction · 0.85
createHttpServerFunction · 0.85

Calls 3

isAuthenticatedClientFunction · 0.85
wsLabelFunction · 0.85
logFunction · 0.85

Tested by

no test coverage detected