Windows support: cmd-shim CLI spawning, PowerShell dictation, NSIS packaging - #7
Windows support: cmd-shim CLI spawning, PowerShell dictation, NSIS packaging#7muneeb-rahmani wants to merge 7 commits into
Conversation
- server/cli-util.ts (new): resolve .cmd/.bat shims and spawn through cmd.exe with CommandLineToArgvW quoting; taskkill-based process-tree kill for Windows; typed stdio overloads. - claude.ts/codex.ts: use spawnCli/execFileCli everywhere, swap unix sockets for the Windows named pipe, and use the cross-platform kill. - index.ts: read the CUA connection descriptor via a platform-safe path. - dist-server/*: rebuilt output reflecting the above.
- speech.mjs: spawn the PowerShell helper (System.Speech, on-device) on Windows; keep the Swift helper for macOS. Same NDJSON protocol. - resources/speech-helper.ps1 (new): Windows dictation to stdout. - main.mjs: guard all macOS-only APIs (systemPreferences, app.dock, screen-permission helper) behind IS_MAC; Windows mic needs no grant. - cua.mjs: Windows named-pipe socket path + PATH-based driver probe. - preload.cjs: surface platform to the renderer.
- Onboarding: Windows has no TCC prompts; collapse permission step to not-applicable. - Composer: pass platform-aware dictation; Windows mic needs no grant. - ComputerPanel: hide macOS-only screen-permission affordance. - ogb.d.ts: type the platform field.
- electron-builder.yml: win x64 NSIS + zip targets, icon.ico, bundled speech-helper.ps1; macOS config untouched. - build/make-ico.ps1 (new): generate icon.ico from the app PNG. - scripts/build-native.mjs (new): guard the Swift-only helpers so \pnpm package\ runs on any platform. - package.json: package:win script; pnpm-workspace.yaml for build approval. - README: document Windows support + packaging. - .gitignore: build artifacts.
Detaching the claude/codex CLI processes on Windows gave each a new console (flashing window) and severed the piped stdout/stderr the drivers read, so claude exited 1 with no output and codex RPC broke. detached is only needed on POSIX for -pid group killing; Windows tree-kill already uses taskkill /T. Also adds the previously built macro record/replay feature (Win32 low- level hooks in macro-record.ps1, SendInput replay in macro-replay.ps1, Electron IPC + ComputerPanel UI) plus its compiled dist-server output.
|
Thanks for the huge effort here — there's real, careful Win32 work in this PR. After deep-reviewing both this and #5 (which solve the same problem on the same files), here's where we landed: We're basing the Windows port on #5's spawn strategy (now #10, with fixes). The deciding issue is That said, this PR has valuable pieces #5 doesn't have, and we'd love them as focused follow-up PRs on top of the port once it lands:
Also for a future revision: |
…e README conflict # Conflicts: # README.md
|
Heads-up: I pushed a merge of current |
|
The Windows port this branch introduced has since landed on main through newer, tested implementations, including packaging, dictation gating, named pipes, process-tree cleanup, and desktop capabilities. This older branch would overwrite newer provider and lifecycle work and retains cmd.exe shim execution. Please close it; any remaining shim-resolution work should be rebased as a small no-shell change alongside #41. |
|
Thank you for this — the cmd-shim spawning analysis in particular was correct and is essentially how main works today. Closing as superseded: Windows support landed in #17 (f3bac3a). Three Windows ports arrived at once and only one could land; that's a scheduling accident, not a verdict on the code. If something here is still missing on main, a focused PR against current main is very welcome. |
Ports OpenMausBot to Windows.
Server: resolve .cmd/.bat CLI shims (claude/codex) and spawn through cmd.exe with proper quoting (server/cli-util.ts); taskkill-based process-tree kill; Windows named-pipe CUA socket.
Electron: platform-safe main process (macOS-only APIs guarded); Windows dictation via a bundled PowerShell System.Speech helper speaking the same NDJSON protocol as the Swift helper.
UI: onboarding/composer/computer-panel perm flows adapt to no-TCC platforms.
Packaging: electron-builder win x64 NSIS + zip targets, icon.ico generation (make-ico.ps1), and platform-guarded native build scripts.
Verified: typecheck, prod build, packaged app launches and serves the UI on Windows.