MCPcopy Create free account
hub / github.com/cortexkit/magic-context / sendHello

Function sendHello

packages/plugin/src/tui/data/notification-socket.ts:150–161  ·  view source on GitHub ↗
(ws: WebSocket, token: string | null)

Source from the content-addressed store, hash-verified

148}
149
150function sendHello(ws: WebSocket, token: string | null): void {
151 const sessionId = opts?.getSessionId() ?? undefined;
152 helloedSession = sessionId ?? null;
153 ws.send(
154 JSON.stringify({
155 type: "hello",
156 token: token ?? "",
157 sessionId,
158 lastReceivedId: lastHandledId,
159 }),
160 );
161}
162
163async function handleSocketMessage(ws: WebSocket, raw: string): Promise<void> {
164 let msg: { type?: string; notification?: SocketNotification; error?: string };

Callers 2

connectFunction · 0.85
watchSessionFunction · 0.85

Calls 1

sendMethod · 0.80

Tested by

no test coverage detected