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