feat(computer-use): create platform abstraction layer for cross-platform backends
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 502
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 715
Description
## 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
Contributor guide
Research direction
Start by reading packages/computer-use/src/maka-cu-backend.ts and packages/computer-use/src/select-backend.ts to map the existing macOS operations and platform selection. Then inspect the seven macOS-only components under apps/desktop/src/main/computer-use/. Done means the interface, Darwin implementation, Linux and Windows stubs, platform guards, and cross-platform tests satisfy every listed acceptance criterion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, typescript
- Domain
- desktop, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100