Skip to content

feat(install): run on Linux, and pick the platform at install time - #234

Open
NagyVikt wants to merge 2 commits into
citrolabs:mainfrom
opencue:feat/linux-support-and-os-detection
Open

feat(install): run on Linux, and pick the platform at install time#234
NagyVikt wants to merge 2 commits into
citrolabs:mainfrom
opencue:feat/linux-support-and-os-detection

Conversation

@NagyVikt

@NagyVikt NagyVikt commented Aug 7, 2026

Copy link
Copy Markdown

What this adds

skills/ego-browser/scripts/install.sh currently opens with

[ "$(uname -s)" = "Darwin" ] || die "this script only supports macOS"

so the only way to run the harness on Linux has been to fork the repo. This PR adds the missing half instead of replacing the existing one.

  • The macOS flow is untouched. main() was renamed to main_macos() and lost exactly one line — the guard above. Every DMG function (install_ego_lite, find_ego_lite_app, strip_quarantine_attributes, cleanup, the trap) is byte-identical. The diff on that file is +81/−3.
  • A new main() dispatches on uname -s: Darwin → the existing flow, Linux → the new one, anything else → unsupported platform: <name> rather than a macOS-specific message.
  • package/ego-linux (new, 39 files) supplies the globalThis.ego object the macOS app injects natively, backed by a stock Chrome/Chromium over CDP.

Why it does not touch package/ego-browser

package/ego-browser is unchanged in this PR — 0 files. Every helper, locator, driver and format runs as-is on both platforms; the port is a backing implementation, not a second harness. That is the design claim, and the test run below is what checks it rather than asserting it.

Install on Linux

A build plus a symlink — there is nothing to download:

sh skills/ego-browser/scripts/install.sh

It verifies Node >= 22 and a browser on PATH before touching anything, so it fails clearly instead of half-installing. EGO_LINUX_CHROME points it at a browser that is not on PATH; EGO_LINUX_BIN_DIR links somewhere other than ~/.local/bin. There is no GUI onboarding step on Linux: when the script returns, the command is ready.

Verification

Run on Linux against an unmodified package/ego-browser from this branch:

Check Result
package/ego-linux suite 54/54 pass
sh skills/ego-browser/scripts/install.sh end to end Pass — npm ci, build, symlink, PATH warning, post-install smoke check
Dispatcher, uname stubbed to Darwin Enters the DMG flow — reaches require_command hdiutil
Dispatcher, uname stubbed to FreeBSD error: unsupported platform: FreeBSD (supported: macOS, Linux)
sh -n on the installer Clean

The install was run with EGO_LINUX_BIN_DIR pointed at a scratch directory, so it proves the flow without depending on a pre-existing install.

What Linux cannot do that the macOS app can

Documented in references/install.md and package/ego-linux/README.md rather than left to be discovered:

  • listTabs is browser-wide, not per task space. Task spaces work (own tabs, ownership, switch / claim / handOff / complete), but CDP cannot place a tab in a chosen window, so per-space tab lists are not reproducible.
  • Spaces are isolated, but their login state is a copy — seeded from yours at creation. A login made inside one space does not appear in the others, and localStorage / IndexedDB / service workers are not carried.
  • Snapshot content is rebuilt from DOMSnapshot.captureSnapshot. Refs (@N) are exact CDP backendNodeIds, but the tree's wording differs from the native snapshot.

Scope

This is carved down from a working Linux fork to the platform-support core. Deliberately not included, to keep the diff reviewable:

The two are independent: they touch different files, and this branch documents the drag race only in terms of what was observed, never by the constant #235 changes. Either order merges cleanly.

Notes for review

  • package/ego-linux/README.md still says "upstream" in a few places where it means "the macOS app" (e.g. "Upstream draws this inside the browser's own chrome"). Readable, but happy to reword to whatever wording you prefer.
  • .gitignore gains two un-ignore lines so package/ego-linux/test/ is tracked, matching the existing package/ego-browser/test/ exception.
  • Asset and path names keep the ego-lite-linux identifier (ego-lite-linux.desktop, the profile dir). Renaming them is a breaking change for anyone already running the port, so I left it as a call for you to make.

NagyVikt and others added 2 commits August 7, 2026 05:37
`install.sh` refused everything that was not Darwin, so the only way to use the
harness on Linux was to fork it. This adds the missing half rather than
replacing the existing one: the macOS DMG flow is untouched, and `main()` now
dispatches on `uname -s` instead of dying on it.

The Linux side is `package/ego-linux`, a CDP shim that supplies the
`globalThis.ego` object the macOS app injects natively, backed by a stock
Chrome/Chromium. `package/ego-browser` is unchanged — every helper, locator,
driver and format runs as-is on both platforms. That is the point of the
design, and it is what the test run below actually verifies.

Install on Linux is a build plus a symlink, not a download: the script checks
Node >= 22 and a browser on PATH up front and stops with a clear error rather
than half-installing. `EGO_LINUX_CHROME` and `EGO_LINUX_BIN_DIR` override the
two things worth overriding.

Verified on Linux against an unmodified `package/ego-browser`:
- `package/ego-linux` suite: 54/54 pass
- `sh skills/ego-browser/scripts/install.sh` end to end — build, link, PATH
  warning, and the post-install smoke check
- dispatcher, with `uname` stubbed: Darwin enters the DMG flow (reaches
  `require_command hdiutil`), FreeBSD exits with `unsupported platform`

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two places described `finishDragProbe` by its current constant — a 50 ms
window — and one of them prescribed the fix. Both go stale the moment that
window changes, and neither belongs in install/porting docs: the race is in the
shared harness, not in anything Linux-specific.

The install troubleshooting bullet is dropped outright; it was filed under
"Linux" for a symptom that has nothing to do with the platform. The README's
section keeps the measurement — what was observed, how it reproduces, and why
the shim cannot suppress it — and drops the constant and the remedy, so it
stays true whatever the harness does about it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@flaviusburca

Copy link
Copy Markdown

can we get this moving ? we really need it

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.

2 participants