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

Function computeConnectedHighestApprovalMode

lib/logger.js:64–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64function computeConnectedHighestApprovalMode() {
65 if (!state.wss) return 'default';
66 let best = 'default';
67 let bestScore = APPROVAL_MODE_ORDER.default;
68 for (const ws of state.wss.clients) {
69 if (!isAuthenticatedClient(ws)) continue;
70 const mode = normalizeApprovalMode(ws._approvalMode);
71 const score = APPROVAL_MODE_ORDER[mode];
72 if (score > bestScore) {
73 best = mode;
74 bestScore = score;
75 }
76 }
77 return best;
78}
79
80function sendWs(ws, msg, context = '') {
81 if (!ws || ws.readyState !== WebSocket.OPEN) return false;

Callers 1

Calls 2

isAuthenticatedClientFunction · 0.85
normalizeApprovalModeFunction · 0.85

Tested by

no test coverage detected