( sdkBetas: string[] | undefined, )
| 62 | * Returns undefined if no valid betas remain or if user is a subscriber. |
| 63 | */ |
| 64 | export function filterAllowedSdkBetas( |
| 65 | sdkBetas: string[] | undefined, |
| 66 | ): string[] | undefined { |
| 67 | if (!sdkBetas || sdkBetas.length === 0) { |
| 68 | return undefined |
| 69 | } |
| 70 | |
| 71 | if (isClaudeAISubscriber()) { |
| 72 | // biome-ignore lint/suspicious/noConsole: intentional warning |
| 73 | console.warn( |
| 74 | 'Warning: Custom betas are only available for API key users. Ignoring provided betas.', |
| 75 | ) |
| 76 | return undefined |
| 77 | } |
| 78 | |
| 79 | const { allowed, disallowed } = partitionBetasByAllowlist(sdkBetas) |
| 80 | for (const beta of disallowed) { |
| 81 | // biome-ignore lint/suspicious/noConsole: intentional warning |
| 82 | console.warn( |
| 83 | `Warning: Beta header '${beta}' is not allowed. Only the following betas are supported: ${ALLOWED_SDK_BETAS.join(', ')}`, |
| 84 | ) |
| 85 | } |
| 86 | return allowed.length > 0 ? allowed : undefined |
| 87 | } |
| 88 | |
| 89 | // Generally, foundry supports all 1P features; |
| 90 | // however out of an abundance of caution, we do not enable any which are behind an experiment |
no test coverage detected