()
| 122 | } |
| 123 | |
| 124 | export async function checkVersion(): Promise<VersionCheck> { |
| 125 | try { |
| 126 | const { data } = await api.get<HealthResponse>('/health', { timeout: 3000 }); |
| 127 | const version = data.version || null; |
| 128 | const isCompatible = version ? compareVersions(version, MIN_SERVER_VERSION) : false; |
| 129 | return { connected: true, version, isCompatible, minRequired: MIN_SERVER_VERSION }; |
| 130 | } catch { |
| 131 | return { connected: false, version: null, isCompatible: false, minRequired: MIN_SERVER_VERSION }; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | export function buildProtocolUrl(action: string, params?: Record<string, string>): string { |
| 136 | let url = `opencodestudio://${action}`; |
no test coverage detected