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

Method send

packages/server-e2e/src/ws.ts:103–110  ·  view source on GitHub ↗

JSON-stringifies and sends a frame.

(frame: object)

Source from the content-addressed store, hash-verified

101
102 /** JSON-stringifies and sends a frame. */
103 send(frame: object): void {
104 if (!this.ws) throw new Error('ws not open');
105 this.ws.send(JSON.stringify(frame));
106 recordReportEvent(
107 { kind: 'ws', direction: 'out', url: this.opts.url, frame },
108 { reportDir: this.opts.reportDir },
109 );
110 }
111
112 /** Register a frame subscriber. Returns an unsubscribe handle. */
113 onFrame(handler: (f: AnyFrame) => void): () => void {

Callers 4

openSocketWithHelloFunction · 0.95
openSocketWithHelloFunction · 0.95
sendAndAwaitAckMethod · 0.95
_onMessageMethod · 0.95

Calls 2

recordReportEventFunction · 0.85
sendMethod · 0.65

Tested by 1

openSocketWithHelloFunction · 0.76