()
| 135 | * Check Desktop install status including version compatibility. |
| 136 | */ |
| 137 | export async function getDesktopInstallStatus(): Promise<DesktopInstallStatus> { |
| 138 | const installed = await isDesktopInstalled() |
| 139 | if (!installed) { |
| 140 | return { status: 'not-installed' } |
| 141 | } |
| 142 | |
| 143 | let version: string | null |
| 144 | try { |
| 145 | version = await getDesktopVersion() |
| 146 | } catch { |
| 147 | // Best effort — proceed with handoff if version detection fails |
| 148 | return { status: 'ready', version: 'unknown' } |
| 149 | } |
| 150 | |
| 151 | if (!version) { |
| 152 | // Can't determine version — assume it's ready (dev mode or unknown install) |
| 153 | return { status: 'ready', version: 'unknown' } |
| 154 | } |
| 155 | |
| 156 | const coerced = semverCoerce(version) |
| 157 | if (!coerced || !semverGte(coerced.version, MIN_DESKTOP_VERSION)) { |
| 158 | return { status: 'version-too-old', version } |
| 159 | } |
| 160 | |
| 161 | return { status: 'ready', version } |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Opens a deep link URL using the platform-specific mechanism. |
no test coverage detected