@maka/computer-use adapts Maka's Runtime-owned Computer Use contracts to the
native maka-cu executor. It owns backend selection, the executor process and
protocol lifecycle, host-side result decoding, display snapshot mapping, and
the cursor-overlay hook. Runtime owns the model-facing tools and session state;
Desktop supplies the executable and presentation dependencies.
The package exposes one root entry point through src/index.ts:
selectComputerUseBackend()selects the available executor and builds the Runtime tool set.CU_BACKEND_IDScurrently contains onlymaka-cu.createMakaCuBackend()adapts the native executor to Runtime'sCuDispatchBackendcontract.MakaCuServicesupervises the executor process and owns the JSON-RPC request, cancellation, restart, and generation lifecycle.- The
maka-cu-protocolexports decode and validatemaka.cu/2envelopes, snapshots, dispatch results, domain errors, and key chords. resolveCuaDisplaySnapshots()maps executor screenshots to Electron display coordinates without guessing when the display geometry is ambiguous.createComputerUseOverlayHook()projects action lifecycle events to a presentation-only cursor sink. It does not choose or authorize targets.
Other packages should import these exports from @maka/computer-use, not from
undeclared internal source paths.
The shipped selector enables Computer Use only when all of these conditions hold:
- the host platform is macOS (
process.platform === 'darwin'); - the composition supplies a
maka-cuexecutable path; and - the composition supplies the executable's expected SHA-256 digest.
On another platform, with missing inputs, or when backend construction fails,
selection fails closed to backendId: 'none' with an empty tool set. This
package does not discover, download, or choose an unpinned executable.
The executable's build, provenance, signing, and distribution status are
separate release concerns. See
computer-use-provenance.md rather
than assuming that installing this workspace supplies a runnable binary.
Cross-platform work is tracked separately:
- #3896 — platform abstraction;
- #3891 — Linux backend;
- #3785 — Windows executor hardening and production evidence.
The host and executor communicate over line-delimited JSON-RPC using the
versioned maka.cu/2 protocol. MakaCuService verifies that the executable is
usable and checks any configured digest before spawning it, completes a
host.hello handshake, and exposes the executor version, capabilities, limits,
and process generation. The product selector always supplies the required
digest.
Lifecycle and protocol failures remain distinct:
MakaCuLifecycleErrorreports unavailable, mismatched, aborted, or outcome-unknown process states;MakaCuRpcErrorreports a JSON-RPC error response for one method; andMakaCuProtocolViolationreports malformed or contradictory wire data.
An executor exit releases affected sessions and invalidates their observations. Requests that may have reached the executor surface as outcome-unknown rather than being replayed automatically. Runtime must re-observe before another action.
- Keep provider-neutral Computer Use types and model-facing contracts in
@maka/coreand@maka/runtime. - Keep native executor transport, decoding, and lifecycle handling in this package.
- Keep Electron windows, screen-lock integration, binary provisioning, and
product status UI in
apps/desktop. - Add a second backend only after it has a real adapter and platform evidence;
do not widen
CU_BACKEND_IDSwith a placeholder. - Preserve fail-closed selection and snapshot-bound dispatch. Missing or stale authority must not fall back to global pointer or foreground input.
The cross-layer safety and evidence rules live in the
Computer Use foundation contract
and host events contract.
Install dependencies once at the repository root, then run:
npm run build
npm --workspace @maka/computer-use run test:dist
npm --workspace @maka/computer-use run typecheckThe package tests cover protocol decoding, process lifecycle, backend behavior, host-event propagation, display mapping, overlay projection, and the cumulative Computer Use path.