(
connection: MessageConnection,
handlers: ClientGlobalApiHandlers,
)
| 17138 | * connection. |
| 17139 | */ |
| 17140 | export function registerClientGlobalApiHandlers( |
| 17141 | connection: MessageConnection, |
| 17142 | handlers: ClientGlobalApiHandlers, |
| 17143 | ): void { |
| 17144 | connection.onRequest("llmInference.httpRequestStart", async (params: LlmInferenceHttpRequestStartRequest) => { |
| 17145 | const handler = handlers.llmInference; |
| 17146 | if (!handler) throw new Error("No llmInference client-global handler registered"); |
| 17147 | return handler.httpRequestStart(params); |
| 17148 | }); |
| 17149 | connection.onRequest("llmInference.httpRequestChunk", async (params: LlmInferenceHttpRequestChunkRequest) => { |
| 17150 | const handler = handlers.llmInference; |
| 17151 | if (!handler) throw new Error("No llmInference client-global handler registered"); |
| 17152 | return handler.httpRequestChunk(params); |
| 17153 | }); |
| 17154 | connection.onRequest("gitHubTelemetry.event", async (params: GitHubTelemetryNotification) => { |
| 17155 | const handler = handlers.gitHubTelemetry; |
| 17156 | if (!handler) throw new Error("No gitHubTelemetry client-global handler registered"); |
| 17157 | return handler.event(params); |
| 17158 | }); |
| 17159 | } |
no test coverage detected
searching dependent graphs…