MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / createKiloProxyHandler

Function createKiloProxyHandler

services/cloud-agent-next/wrapper/src/server.ts:1054–1078  ·  view source on GitHub ↗
(deps: ServerDependencies)

Source from the content-addressed store, hash-verified

1052 if (typeof message === 'string' || message instanceof ArrayBuffer) {
1053 upstream.send(message);
1054 return;
1055 }
1056 const copy = new Uint8Array(message.byteLength);
1057 copy.set(message);
1058 upstream.send(copy.buffer);
1059 }
1060 },
1061 close(ws: Bun.ServerWebSocket<WrapperWebSocketData>) {
1062 const upstream = ptyUpstreams.get(ws);
1063 if (upstream) {
1064 try {
1065 upstream.close();
1066 } catch {
1067 // Already closed.
1068 }
1069 ptyUpstreams.delete(ws);
1070 }
1071 },
1072 };
1073}
1074
1075export function createSessionReadyHandler(deps: ServerDependencies) {
1076 let inFlight:
1077 | {
1078 request: WrapperSessionReadyRequest;
1079 promise: Promise<WrapperSessionReadyResponse>;
1080 }
1081 | undefined;

Callers 2

server.test.tsFile · 0.85
createFetchHandlerFunction · 0.85

Calls 4

createProxyRequestFunction · 0.85
errorResponseFunction · 0.70
fetchFunction · 0.70
setMethod · 0.65

Tested by

no test coverage detected