feat(cua): host Cua Driver on macOS, Linux, and Windows #16527
Supersedes https://git.cafe/pingdotgg/t3code/pulls/15006 and https://git.cafe/pingdotgg/t3code/pulls/10899. This stack (https://git.cafe/pingdotgg/t3code/pulls/16527 → https://git.cafe/pingdotgg/t3code/pulls/16528 → https://git.cafe/pingdotgg/t3code/pulls/16529 → https://git.cafe/pingdotgg/t3code/pulls/16530 → https://git.cafe/pingdotgg/t3code/pulls/16531 → https://git.cafe/pingdotgg/t3code/pulls/16532) ships computer use and agent browser tabs on macOS, Linux, and Windows together.
Computer use needs Cua Driver running on the environment's host. https://git.cafe/pingdotgg/t3code/pulls/15006 asked users to install it themselves and only worked on macOS; Cua's own https://git.cafe/pingdotgg/t3code/pulls/10899 bundled it but only wired macOS end to end.
This layer hosts the pinned Cua Driver 0.38.0 on macOS, Linux, and Windows. The @trycua/cua-driver SDK is on the same 0.38.0. The SDK only checks that the driver's contract, tool-schema, capability, and MCP protocol versions match, so a later SDK bump can trail a driver bump.
- Desktop builds bundle it for every target: one universal macOS executable, and per-arch Linux and Windows bundles. Electron starts it as an embedded host, so macOS grants Accessibility and Screen Recording to T3 Code, not to a second app. It hands the MCP descriptor to its primary backend over the existing private control pipe.
- A standalone server (
npx t3) downloads the same release into T3's home on first use, checksum- and size-verified, with path-traversal checks on the archive.T3CODE_CUA_DRIVER_PATHstill overrides it. - The release table (asset names, sizes, SHA-256) lives in
@t3tools/shared/cuaDriverRelease, so the build script and the server cannot drift.@trycua/cua-drivermoves to the pnpm catalog, so desktop and server share one version.
Nothing attaches the driver to agents yet; that is the next layer. The setting stays off by default.
Ported from https://git.cafe/pingdotgg/t3code/pulls/10899 by Francesco Bonacci, with Julius's Effect-convention fixes from https://git.cafe/pingdotgg/t3code/pulls/11709, rebased onto the V2 orchestrator.
- The SDK loads in place from the app archive. A small patch to
@ubjs/node(the SDK's native loader) pointsdlopenat the.asar.unpackedsibling, the same fix fff already carries. Only the SDK's platform packages are unpacked, so Windows stays under its 80-file installer budget.
Verification#
- Focused tests:
CuaDriver(start, revoke, crash, bounded shutdown),CuaDriverInstallation(verified install, checksum rejection, unsafe archive),DesktopCuaDriver, desktop telemetry and backend tests, and build-script staging for all five archive layouts. Server, desktop, contracts, and shared typecheck clean. - Checked by hand on macOS arm64 with 0.34.0: Cua's
EmbeddedCuaDriverHoststarts, returns its MCP descriptor and socket, andlistAppsanswers through it. 0.38.0 has not been rechecked by hand. - The archive checksums and sizes match Cua's published
checksums.txtand assets for 0.38.0. skips the primary native probe for cross-architecture Windows payloadsinbuild-desktop-artifact.test.tsfails on main too, so this PR did not cause it.
Built with Claude Opus 5.5 in T3 Code, through the Claude Code harness.
🤖 Generated with Claude Code
- 1
- 2
- 3
Pushede11023b
Sign in to join this conversation.