MCPcopy Create free account
hub / github.com/Noumena-Network/code / sendControlRequest

Method sendControlRequest

src/remote/SessionsWebSocket.ts:340–356  ·  view source on GitHub ↗

* Send a control request to the session (e.g., interrupt)

(request: SDKControlRequestInner)

Source from the content-addressed store, hash-verified

338 * Send a control request to the session (e.g., interrupt)
339 */
340 sendControlRequest(request: SDKControlRequestInner): void {
341 if (!this.ws || this.state !== 'connected') {
342 logError(new Error('[SessionsWebSocket] Cannot send: not connected'))
343 return
344 }
345
346 const controlRequest: SDKControlRequest = {
347 type: 'control_request',
348 request_id: randomUUID(),
349 request,
350 }
351
352 logForDebugging(
353 `[SessionsWebSocket] Sending control request: ${request.subtype}`,
354 )
355 this.ws.send(jsonStringify(controlRequest))
356 }
357
358 /**
359 * Check if connected

Callers 3

cancelSessionMethod · 0.80
runHeadlessStreamingFunction · 0.80
sendRequestFunction · 0.80

Calls 5

randomUUIDFunction · 0.90
jsonStringifyFunction · 0.85
logErrorFunction · 0.50
logForDebuggingFunction · 0.50
sendMethod · 0.45

Tested by

no test coverage detected