(
auth: { accessToken: string } | { apiKey: string },
)
| 368 | } |
| 369 | |
| 370 | async function fetchFastModeStatus( |
| 371 | auth: { accessToken: string } | { apiKey: string }, |
| 372 | ): Promise<FastModeResponse> { |
| 373 | const endpoint = `${getOauthConfig().BASE_API_URL}/api/claude_code_penguin_mode` |
| 374 | const headers: Record<string, string> = |
| 375 | 'accessToken' in auth |
| 376 | ? { |
| 377 | Authorization: `Bearer ${auth.accessToken}`, |
| 378 | 'anthropic-beta': OAUTH_BETA_HEADER, |
| 379 | } |
| 380 | : { 'x-api-key': auth.apiKey } |
| 381 | |
| 382 | const response = await axios.get<FastModeResponse>(endpoint, { headers }) |
| 383 | return response.data |
| 384 | } |
| 385 | |
| 386 | const PREFETCH_MIN_INTERVAL_MS = 30_000 |
| 387 | let lastPrefetchAt = 0 |
no test coverage detected