This commit is contained in:
LukeParkerDev 2026-05-04 11:24:14 +10:00
parent fcb4bc1b3a
commit 7dd8b2b7f9
3 changed files with 1 additions and 35 deletions

View file

@ -75,7 +75,6 @@ declare global {
__OPENCODE__?: {
updaterEnabled?: boolean
deepLinks?: string[]
wsl?: boolean
activeServer?: string
}
api?: {

View file

@ -20,29 +20,6 @@ import { type ServerHealth, useCheckServerHealth } from "@/utils/server-health"
const DEFAULT_USERNAME = "opencode"
function versionOlderThan(current: string | null | undefined, expected: string | null | undefined) {
if (!current || !expected) return false
const parse = (value: string) => {
const match = value.match(/v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/)
if (!match) return
return {
major: Number(match[1]),
minor: Number(match[2]),
patch: Number(match[3]),
prerelease: match[4] ?? null,
}
}
const left = parse(current)
const right = parse(expected)
if (!left || !right) return false
if (left.major !== right.major) return left.major < right.major
if (left.minor !== right.minor) return left.minor < right.minor
if (left.patch !== right.patch) return left.patch < right.patch
return !!left.prerelease && !right.prerelease
}
interface DialogSelectServerProps {
onNavigateHome?: () => void
}
@ -632,15 +609,11 @@ export function DialogSelectServer(props: DialogSelectServerProps = {}) {
const blocked = () => health(key)?.healthy === false
const canChangeDefault = () => defaultServer.canDefault() && i.type !== "ssh"
const canRemove = () => i.type === "http" || wsl
const outdated = () => {
const check = wslCheck(i)
return versionOlderThan(check?.version, check?.expectedVersion)
}
const opencodeAction = () => {
const check = wslCheck(i)
if (!check) return null
if (!check.resolvedPath) return "Install OpenCode"
if (outdated()) return "Update OpenCode"
if (check.matchesDesktop === false) return "Update OpenCode"
return null
}
const updating = () => {

View file

@ -147,12 +147,6 @@ export type Platform = {
/** Set the default server URL to use on app startup (platform-specific) */
setDefaultServer?(url: ServerConnection.Key | null): Promise<void> | void
/** Get the configured WSL integration (desktop only) */
getWslEnabled?(): Promise<boolean>
/** Set the configured WSL integration (desktop only) */
setWslEnabled?(config: boolean): Promise<void> | void
/** Manage WSL sidecar servers (Electron on Windows only) */
wslServers?: WslServersPlatform