Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(cua): host Cua Driver on macOS, Linux, and Windows #16527

Draftjuliusmarmingewants to merge 1 commit intomain fromrefs/pull/16527/headopened View on GitHub

juliusmarmingecommented

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_PATH still 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-driver moves 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) points dlopen at the .asar.unpacked sibling, 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 EmbeddedCuaDriverHost starts, returns its MCP descriptor and socket, and listApps answers through it. 0.38.0 has not been rechecked by hand.
  • The archive checksums and sizes match Cua's published checksums.txt and assets for 0.38.0.
  • skips the primary native probe for cross-architecture Windows payloads in build-desktop-artifact.test.ts fails 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. Pushede11023b

Sign in to join this conversation.