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

Method _sendWsControl

packages/server-e2e/src/client.ts:665–679  ·  view source on GitHub ↗
(
    type: string,
    payload: Record<string, unknown>,
    timeoutMs?: number,
  )

Source from the content-addressed store, hash-verified

663 }
664
665 private async _sendWsControl<T>(
666 type: string,
667 payload: Record<string, unknown>,
668 timeoutMs?: number,
669 ): Promise<T> {
670 const id = `${type}-${ulid()}`;
671 const ack = await this._requireWs().sendAndAwaitAck(
672 { type, id, payload },
673 timeoutMs ?? this._controlAckTimeoutMs,
674 );
675 if (ack.code !== 0) {
676 throw new Error(`${type} rejected (code=${ack.code ?? 'unknown'}): ${ack.msg ?? 'no message'}`);
677 }
678 return (ack.payload ?? {}) as T;
679 }
680}
681
682function noopLogger(): void {

Callers 5

attachTerminalMethod · 0.95
detachTerminalMethod · 0.95
writeTerminalInputMethod · 0.95
resizeTerminalMethod · 0.95
closeTerminalControlMethod · 0.95

Calls 3

_requireWsMethod · 0.95
ulidFunction · 0.85
sendAndAwaitAckMethod · 0.80

Tested by

no test coverage detected