MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / helloAndSubscribe

Function helloAndSubscribe

packages/server/test/fs-watch.e2e.test.ts:210–224  ·  view source on GitHub ↗
(
  conn: Conn,
  clientId: string,
  sessionId: string,
)

Source from the content-addressed store, hash-verified

208}
209
210async function helloAndSubscribe(
211 conn: Conn,
212 clientId: string,
213 sessionId: string,
214): Promise<void> {
215 await receiveType(conn, 'server_hello', 1000);
216 conn.ws.send(
217 JSON.stringify({
218 type: 'client_hello',
219 id: `cli_${clientId}`,
220 payload: { client_id: clientId, subscriptions: [sessionId] },
221 }),
222 );
223 await receiveType(conn, 'ack', 1000);
224}
225
226const sleep = (ms: number): Promise<void> =>
227 new Promise((r) => setTimeout(r, ms));

Callers 1

Calls 2

receiveTypeFunction · 0.70
sendMethod · 0.65

Tested by

no test coverage detected