* Re-check whether the on-disk token is usable; does NOT trigger an * actual OAuth flow. The stdio JSON-RPC channel has no TTY to render * the device-code prompt — clients are expected to spawn * `kimi login` themselves via the terminal-auth method advertised in * `initialize.authMethods
(params: AuthenticateRequest)
| 562 | * (plan G3, lines 68-104). |
| 563 | */ |
| 564 | async authenticate(params: AuthenticateRequest): Promise<AuthenticateResponse | void> { |
| 565 | if (params.methodId !== 'login') { |
| 566 | throw RequestError.invalidParams( |
| 567 | { methodId: params.methodId }, |
| 568 | `Unknown auth method: ${params.methodId}`, |
| 569 | ); |
| 570 | } |
| 571 | if (!(await harnessIsAuthed(this.harness))) { |
| 572 | throw RequestError.authRequired(); |
| 573 | } |
| 574 | // void = empty success body (ACP allows AuthenticateResponse | void). |
| 575 | } |
| 576 | |
| 577 | async prompt(params: PromptRequest): Promise<PromptResponse> { |
| 578 | const acpSession = this.sessions.get(params.sessionId); |
no test coverage detected