Repository navigation
feat(browser): standalone executables without Node, with checksums and attestations - #155
Merged
Merged
Conversation
william-monroy
marked this pull request as ready for review
November 22, 2026 19:44
…ath> mcp Inside the standalone executable (a Node.js single executable application) the package's files live in a virtual file system, so the bin/mcp.js path setup and init printed did not exist for the agent. There, mcpCommand returns the executable itself with "mcp" before --identity, and isTurnoEntry recognizes that entry in an agent's config.
scripts/standalone-build.mjs builds turno-browser as a Node.js 26 single executable application with its npm package (installed with the shrinkwrap) mounted as a read-only virtual file system: darwin-arm64, darwin-x64, linux-x64 and win-x64 from one macOS host, with the pinned Node.js archives checked against their SHA-256, the macOS executables stripped and signed ad hoc, and reproducible zip archives plus SHA256SUMS. One executable serves the CLI and the MCP server (turno-browser mcp), and runs the package's own scripts when the package spawns process.execPath with one. The launcher replaces fs.writev and fs.readv while Node.js 26.13 lacks their VFS handlers (nodejs/node#66532), which broke install-browser's download. standalone.yml builds on macOS, smoke-tests each platform (--version and an MCP initialize, with no node on the PATH; Windows is experimental), then attests the archives and uploads them to the turno-browser release. release.yml calls it after a turno-browser release with the tarball it published; a maintainer can run it for a version on npm, and a pull request that changes it runs it as a dry run.
The standalone executable in Get started and the README: download, check the SHA-256 and the attestation, the macOS Gatekeeper and Windows SmartScreen notes, and where it keeps its data. Windows is marked experimental.
william-monroy
force-pushed
the
feat/standalone-binary
branch
from
November 22, 2026 19:48
6870358 to
5f79671
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
turno-browser as one file per platform for machines without Node or npm, with SHA256SUMS and build provenance attestations on its GitHub release.
What it is
A Node.js 26 single executable application (SEA) with the turno-browser npm package (installed from the published tarball with its shrinkwrap, so the same dependency tree npm users get) mounted as a read-only virtual file system inside the executable (
useVfs+vfsArchive, Node 26.9+). The package runs unchanged from there: patchright-core reads its files andrequire.resolves its own scripts as it does on disk. One executable is both programs:turno-browser <command>andturno-browser mcp(also when renamedturno-browser-mcp). When the package spawnsprocess.execPath <script>(the background server, patchright-core's browser installer and its forked downloader, the trace viewer), the launcher runs that script, as node would.Two things needed code:
setupandinitprinted.../dist/bin/mcp.jsas the agent's command, a path that exists only inside the executable. In a SEA (node:seaisSea()), they now give<path>/turno-browser mcp --identity <id>, andisTurnoEntryrecognizes that entry. turno-browser patch changeset.writev/readv(vfs: createVfsHandlers() does not implement writev(fd, buffers, position) nodejs/node#66532, fixed on main after 26.13.1), so with the VFS mounted anyfs.writevthrows, real files included. A write stream uses it with several chunks queued, which is how patchright-core saves the Chrome for Testing download, soinstall-browserfailed. The launcher detects the missing handler (awritevon an fd no file has throws a TypeError instead of reporting EBADF) and replacesfs.writev/fs.readvwith onefs.write/fs.read; the mount is read-only, so a vector call is always for a real file. It turns itself off on a Node that has the handlers.Comparison (measured)
macOS 26.5, Apple silicon, Chrome 157, turno-browser 0.9.0. The MCP session is initialize, tools/list and
browser_navigateto a page on 127.0.0.1 in headless Chrome, with a sandbox HOME; Chrome's command line was checked for--use-mock-keychain --password-store=basic. Times from a folder outside ~/Documents (file scanning there added about 1 s to every start); three runs each.bun build --compile, Bun 1.3.14deno compile, Deno 2.9.6../package.jsonreads resolve to/$bunfs(ENOENT); with those patched,Cannot find package 'patchright-core'(thecreateRequireloads are not bundled)install-browser--version, median of 7--version/ server in a sessionexecutablepoints at the official Node of the target; darwin-x64, linux-x64 and win-x64 built on darwin-arm64; macOS targets needcodesign(Apple silicon runs no unsigned code), so the build host is macOS--target--targetBaseline, plain Node 26 on the npm install:
--version0.22 s and 101 MB, initialize 0.56 to 1.2 s, server 155-165 MB. Bun as a runtime (not compiled) runs the package from disk fine (initialize 0.79 s, 215 MB), so (b)'s blocker is bundling, not Bun. Under Rosetta the darwin-x64 SEA answers--versionand initialize, but navigate times out, the same as plain x64 Node under Rosetta, so the nativemacos-15-intelsmoke job is what checks x64.Choice
(a), Node SEA with the VFS. It is the only single file that runs the MCP session end to end and shuts down cleanly, keeps the npm package byte for byte (no bundler, no patched sources), builds every target from one host, and stays on the Node line the package already supports. Deno is close and starts faster, but it leaves Chrome running when the agent goes away, which is what turno-browser exists to prevent; Bun would need source changes in turno-browser and in how patchright-core is loaded. The VFS is "Early development" in Node 26 and needed the writev workaround; the Node release is pinned (
scripts/standalone-node.json, with the SHA-256 of each archive) and moves only on purpose.Built by
scripts/standalone-build.mjshere (all four targets in 87 s on the laptop): darwin-arm64 142.3 MB / 47.7 MB zip, darwin-x64 147.0 / 50.0, linux-x64 184.2 / 55.8 (not stripped: ELF from a macOS host), win-x64 133.7 / 47.1. Two builds from the same input give the same SHA256SUMS. Checked locally with the built darwin-arm64 executable: the MCP session above, a realinstall-browserand a navigate on that Chrome for Testing,add,setup(prints the executable withmcp), anddo <id> open/snapshotthrough a background server the executable spawned of itself, thenbackground stop; no Chrome left behind.Release integration
.github/workflows/standalone.yml:buildon macos-15 (all targets, uploads the zips and SHA256SUMS as an artifact),smokeon macos-15, macos-15-intel, ubuntu-latest and windows-latest (--versionand an MCP initialize, with no node on the PATH; Windows hascontinue-on-error), thenrelease:actions/attest-build-provenanceon the zips andgh release uploadtoturno-browser@<version>. Onlyreleasehas write permissions and it runs no project code (Harden-Runner in block mode).release.yml: thetagjob outputs the turno-browser version it released; a newstandalonejob calls the workflow with thereleaseartifact, so the executables hold the tarball that was published. It runs after npm publish and tagging, so a failure there cannot hold back npm.workflow_dispatch(version,dry-rundefault true) builds a version already on npm for its existing release. A pull request that touches the workflow or scripts runs it as a dry run from the checkout: artifacts only, no attestation, no upload. This pull request's run is the dry run.Dry run on this pull request
standalone run 45060591388:
buildon macos-15 packed this checkout and built all four targets; each smoke job checked its zip against SHA256SUMS and ran the executable with no node on the PATH;upload to the releasewas skipped (dry run). Thestandaloneartifact (200 MB, the four zips and SHA256SUMS) is kept for 7 days.--versionThe Windows executable starts and answers initialize, but nothing drives a browser on Windows yet, so it stays experimental until the Windows pull requests land.
Signing and trust
Not signed with a vendor certificate yet. macOS: ad hoc signature only, so a browser download is stopped by Gatekeeper; the docs give
xattr -d com.apple.quarantine, or System Settings, Privacy & Security, Open Anyway (Control-click Open on macOS 14 and older);curldownloads carry no quarantine mark. Windows: unsigned, SmartScreen may warn (More info, Run anyway, orUnblock-File).What signing would need, not added since it is not a simple step and needs accounts:
codesign --options runtime --timestampwith entitlements Node needs under the hardened runtime (com.apple.security.cs.allow-jit,allow-unsigned-executable-memory); thenxcrun notarytool submitof each zip with an App Store Connect API key (secret). A bare executable cannot be stapled, so Gatekeeper checks the ticket online on first run.signtool sign /fd SHA256 /tr <timestamp URL>on the .exe after the SEA blob is injected, before it is zipped.Verify
On Windows:
Get-FileHash .\turno-browser-win-x64.zip -Algorithm SHA256.Not in this pull request
continue-on-errorand documented as experimental.workflow_dispatchpath (without thesetupfix, which is in this pull request).