| 1 | export interface ConnectionAuthentication { |
| 2 | status: "ready" | "missing_credential" | "authentication_rejected" | "credential_store_unavailable" | string; |
| 3 | providerName?: string; |
| 4 | modelRef?: string; |
| 5 | keyEnv?: string; |
| 6 | httpStatus?: number; |
| 7 | code?: string; |
| 8 | message?: string; |
| 9 | } |
| 10 | |
| 11 | export function modelSettingsAllowSubmission(ready: boolean, state?: { |
| 12 | authentication?: ConnectionAuthentication; |
| 13 | modelSettingsPending?: boolean; |
| 14 | }): boolean { |
| 15 | return ready && (state?.modelSettingsPending === true || (state?.authentication?.status ?? "ready") === "ready"); |
| 16 | } |
| 17 |