(response: Record<string, unknown>)
| 34 | } |
| 35 | |
| 36 | function extractModelConfigOption(response: Record<string, unknown>): { |
| 37 | currentValue: string | null; |
| 38 | options: unknown[]; |
| 39 | } | null { |
| 40 | if (!Array.isArray(response.configOptions)) return null; |
| 41 | |
| 42 | for (const entry of response.configOptions) { |
| 43 | if (!isObject(entry)) continue; |
| 44 | if (asString(entry.category) !== 'model') continue; |
| 45 | return { |
| 46 | currentValue: asString(entry.currentValue), |
| 47 | options: Array.isArray(entry.options) ? entry.options : [] |
| 48 | }; |
| 49 | } |
| 50 | |
| 51 | return null; |
| 52 | } |
| 53 | |
| 54 | function extractModelsFromResponse(response: unknown): { |
| 55 | availableModels: OpencodeModelSummary[]; |
no test coverage detected