Skip to content

feat: Linux and Windows support - #10

Open
kermitsxb wants to merge 15 commits into
mainfrom
feat/cross-platform-support
Open

kermitsxb wants to merge 15 commits into
mainfrom
feat/cross-platform-support

Conversation

@kermitsxb

Copy link
Copy Markdown
Owner

Summary

The native host and its installation now work on Linux and Windows, not only macOS. CI builds, tests and smoke-tests on all three OSes.

  • Host
    • Log directory per OS (host/src/log-dir.ts):
      • macOS: ~/Library/Logs/github-orca
      • Windows: %LOCALAPPDATA%\github-orca\logs
      • Linux: $XDG_STATE_HOME/github-orca or ~/.local/state/github-orca
    • Clone folder validated per OS: Windows accepts a drive-letter path or ~\…. The options form accepts every OS's forms.
    • Orca's CLI launcher is resolved per OS (host/src/orca-launcher.ts):
      • macOS: orca
      • Linux: orca-ide. On Linux, orca is usually the GNOME screen reader, so it is never run.
      • Windows: orca.cmd is parsed, and the Electron binary it names is run directly with the env the .cmd would set. Prompts never go through cmd.exe.
    • If the launcher cannot be found, the user gets an actionable message instead of "Orca is not responding".
  • Extension: native error messages give the install command and log path for the current OS (chrome.runtime.getPlatformInfo).
  • Install
    • scripts/install.sh now also supports Linux:
      • Chrome, Chrome Beta, Chromium, Brave and Edge under $XDG_CONFIG_HOME
      • Firefox in ~/.mozilla/native-messaging-hosts
      • a warning for snap/flatpak browsers
    • New scripts/install.ps1 for Windows:
      • writes a .bat wrapper in the OEM code page, and stops with a clear message if a path cannot be encoded
      • registers HKCU keys for Chrome, Edge, Brave and Firefox
  • CI: the build job is now a matrix on ubuntu, macOS and Windows: npm test, typecheck, build, a host smoke test (scripts/host-smoke.mjs), and an install smoke test with stub Orca commands. On Windows the installer runs the real build under Windows PowerShell 5.1. Firefox lint and packaging stay on Linux.
  • Docs: README install sections per OS, troubleshooting per OS, and an AGENTS.md update.
  • .gitattributes forces LF line endings, so Windows checkouts keep fixtures and scripts intact.

Test plan

  • npm test (293 tests), npm run typecheck, npm run build, npm run lint:firefox (0 errors)
  • Linux install smoke + host smoke in a node:24 container
  • install.ps1 parsed and run with stub commands in a pwsh container. Registry writes are not checked there.
  • actionlint clean
  • This PR's CI on windows-latest and macos-latest. This is the first real run of the Windows installer: registry keys, .bat launch, npm.cmd build.
  • Manual end-to-end on a real Linux machine and a real Windows machine (README checklist)

Not covered: Arc on Windows (registry key unknown); native messaging in sandboxed snap/flatpak browsers (documented caveat).

Find orca (macOS), orca-ide (Linux) or orca.cmd (Windows) on PATH. On Windows,
bypass orca.cmd and run the Electron binary it names with its CLI and env, so
prompts never cross cmd.exe. The runtime RPC client is located from the
launcher. OrcaCli resolves the launcher lazily, once; a missing CLI becomes an
orca_unavailable error. execFile now hides console windows on Windows.
Use orca-ide on Linux, register the host for Chrome, Chromium, Brave and Edge
(honouring XDG_CONFIG_HOME) and Firefox (~/.mozilla/native-messaging-hosts),
warn about snap/flatpak browsers, and allow skipping the build with
GITHUB_ORCA_SKIP_BUILD=1.
Writes a CRLF .bat wrapper pinning orca.cmd, gh, git and node directories,
Chrome and Firefox manifests (UTF-8 without BOM) next to it, and registers
them under HKCU for Chrome, Edge, Brave and Firefox. Runs on Windows
PowerShell 5.1 and PowerShell 7.
cmd.exe decodes batch files in the OEM code page, so a UTF-8 .bat breaks
paths with non-ASCII characters. Encode it with the OEM code page and fail
with the offending paths when they cannot be represented.
…Windows

The build job becomes an OS matrix. Each OS runs the tests, typecheck and build,
a host smoke test (scripts/host-smoke.mjs sends one invalid native frame and
expects invalid_request back) and an install smoke test: the installer runs
against a stub Orca launcher, the browser manifest (or registry key) is checked
and the installed wrapper is smoke-tested. Firefox lint and packaging stay on
Ubuntu.
README: per-OS install sections (Chrome-family browsers and Firefox), Orca's
shell command requirement (orca, orca-ide, orca.cmd), sandboxed browser caveat,
Windows installer and its code page limitation, per-OS log paths, Windows clone
folders and ssh-agent notes per OS.
AGENTS.md: host platforms, orca-launcher.ts, log-dir.ts, install.ps1, the host
smoke script and the rule to inject platform and path flavour in tests.
…dling on Windows

Also drop the unused pathExt dependency and resolve the macOS launcher's real path once.
…rrow the flatpak warning

PowerShell prefers npm.ps1, which inherits StrictMode and reads $MyInvocation.Statement
(PowerShell 7.4+ only): the build aborted under Windows PowerShell 5.1.
@kermitsxb
kermitsxb force-pushed the feat/cross-platform-support branch from f5b1ca6 to 0ba7556 Compare October 1, 2026 14:38
@kermitsxb
kermitsxb marked this pull request as ready for review October 1, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant