diff --git a/src/App.tsx b/src/App.tsx index d286ddec6..51ead5fd9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -337,6 +337,20 @@ function isTauriRuntime() { return typeof window !== "undefined" && (window as any).__TAURI_INTERNALS__ != null; } +function isWindowsPlatform() { + if (typeof navigator === "undefined") return false; + + const ua = typeof navigator.userAgent === "string" ? navigator.userAgent : ""; + const platform = + typeof (navigator as any).userAgentData?.platform === "string" + ? (navigator as any).userAgentData.platform + : typeof navigator.platform === "string" + ? navigator.platform + : ""; + + return /windows/i.test(platform) || /windows/i.test(ua); +} + function readModePreference(): Mode | null { if (typeof window === "undefined") return null; @@ -1630,7 +1644,9 @@ export default function App() { if (!result.found) { setError( - "OpenCode CLI not found. Install with `brew install anomalyco/tap/opencode` or `curl -fsSL https://opencode.ai/install | bash`, then retry.", + isWindowsPlatform() + ? "OpenCode CLI not found. Install OpenCode for Windows, then restart OpenWork. If it is installed, ensure `opencode.exe` is on PATH (try `opencode --version` in PowerShell)." + : "OpenCode CLI not found. Install with `brew install anomalyco/tap/opencode` or `curl -fsSL https://opencode.ai/install | bash`, then retry.", ); return false; } @@ -1655,7 +1671,13 @@ export default function App() { setAuthorizedDirs([dir]); } + if (isWindowsPlatform() && engineSource() === "sidecar") { + setEngineSource("path"); + setError("Sidecar OpenCode is not supported on Windows yet. Using PATH instead."); + } + const info = await engineStart(dir, { preferSidecar: engineSource() === "sidecar" }); + setEngine(info); if (info.baseUrl) { @@ -3092,45 +3114,79 @@ export default function App() {
-
Install one of these:
-
- brew install anomalyco/tap/opencode -
-
- curl -fsSL https://opencode.ai/install | bash -
+ +
Install one of these:
+
+ brew install anomalyco/tap/opencode +
+
+ curl -fsSL https://opencode.ai/install | bash +
+ + } + > + <> +
Install OpenCode for Windows:
+
+ https://opencode.ai/install +
+
+ After installing, make sure `opencode.exe` is available on PATH (try `opencode --version`). +
+ +
- + } > - Install OpenCode - + +
PATH uses your installed OpenCode (default). Sidecar will use a bundled binary when available. + + Sidecar is currently unavailable on Windows. +