Skip to content

feat(computer-use): create platform abstraction layer for cross-platform backends #3896

Description

@0xMudit

Summary

The Computer Use backend (\packages/computer-use/src/maka-cu-backend.ts) is deeply coupled to macOS-specific APIs (AXRaise, AXMenu, ScreenCaptureKit, macOS seatbelt). A platform abstraction layer is needed to support future Linux/Windows backends.

Current State

  • **\packages/computer-use/src/maka-cu-backend.ts**: 1300+ lines of macOS-specific code
  • **\packages/computer-use/src/select-backend.ts**: Hardcoded platform check
  • **\�pps/desktop/src/main/computer-use/**: 7 macOS-only Electron components

Proposed Solution

  1. Define a \ComputerUseBackend\ interface abstracting platform operations
  2. Move macOS-specific code into a \DarwinComputerUseBackend\ implementation
  3. Create stub implementations for Linux (\LinuxComputerUseBackend) and Windows (\WindowsComputerUseBackend)
  4. Update \select-backend.ts\ to use the abstraction layer
  5. Add platform guards to desktop computer-use components

Acceptance Criteria

  • \ComputerUseBackend\ interface is defined and documented
  • macOS backend implements the interface
  • Linux/Windows stubs return appropriate errors or no-ops
  • Desktop components have platform guards
  • Tests pass on all platforms

Labels

enhancement, help wanted

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions