Skip to content

Introduce ClawdCursorHost (host IPC) and macOS native helper enhancements#48

Open
AmrDab wants to merge 1 commit intomainfrom
codex/create-clawdcursor-macos-host-app-a639yk
Open

Introduce ClawdCursorHost (host IPC) and macOS native helper enhancements#48
AmrDab wants to merge 1 commit intomainfrom
codex/create-clawdcursor-macos-host-app-a639yk

Conversation

@AmrDab
Copy link
Copy Markdown
Owner

@AmrDab AmrDab commented Apr 8, 2026

Motivation

  • Centralize macOS TCC permissions under a single bundled app identity (ClawdCursor.app) and provide a long-lived host process to own IPC and permission-sensitive operations.
  • Enable richer native desktop control (smooth mouse moves/drags and screenshots) while avoiding unbundled-binary TCC issues on macOS.

Description

  • Add a new host executable ClawdCursorHost with a small HTTP IPC server (127.0.0.1:<port>) and token auth, and register it in Package.swift and the app bundle (Info.plist).
  • Update build flow (native/build.sh) to include ClawdCursorHost in the ClawdCursor.app bundle and change the default run hint to open ClawdCursor.app.
  • Extend the Swift helper (ClawdCursorHelper) with new JSON-RPC methods: moveMouse, dragMouse, and captureScreen (PNG base64 encoding), and add required imports (ImageIO, UniformTypeIdentifiers).
  • Add Sources/ClawdCursorHost/main.swift implementing the host listener, health/status endpoints, and proxying JSON-RPC POST /rpc to clawdcursor-helper when authorized.
  • Rework Node-side native integration (src/native-helper.ts) to prefer communicating with the host IPC (/health, /status, /rpc), add utility functions (isHostRunning, ensureHostAppRunning, stopHostApp, token management), and provide fallback behavior controlled via CLAWDCURSOR_ALLOW_MAC_HELPER_FALLBACK.
  • Wire the native helper into the desktop stack: src/native-desktop.ts now uses the native helper for captures, mouse moves/drags, typing and key presses on macOS when available; src/index.ts, src/doctor.ts, and src/readiness.ts updated to ensure the host is running and to reference ClawdCursor in user-facing messages.
  • Add helper path resolution utilities and tighten permission-check behavior to prefer the host status endpoint before falling back to bundled permission-check binary.
  • Update native/README.md to document the new ClawdCursorHost IPC endpoints and workflow.

Testing

  • Built native Swift targets via the updated build script (./native/build.sh which runs swift build -c release) and confirmed ClawdCursor.app artifacts were produced successfully.
  • Compiled the TypeScript codebase (npm run build) to ensure updated imports and types pass compilation.
  • Performed basic host sanity checks by starting ClawdCursorHost and verifying GET /health and GET /status return expected JSON (local smoke tests succeeded).

Codex Task

AmrDab added a commit that referenced this pull request Apr 8, 2026
Cherry-picked from PR #48 (Codex):
- doctor.ts: Direct users to enable 'ClawdCursor' instead of 'Terminal/Node'
- readiness.ts: Same permission message improvements
- Updated to 'Screen & System Audio Recording' (macOS Sequoia naming)

PR #48 is redundant (core functionality merged via PR #47) and should be closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant