Skip to content

Native input rewrite, multi-display/Retina fixes, companion app - #1

Merged
wmehanna merged 13 commits into
mainfrom
feat/multi-display-and-companion
Jul 25, 2026
Merged

Native input rewrite, multi-display/Retina fixes, companion app#1
wmehanna merged 13 commits into
mainfrom
feat/multi-display-and-companion

Conversation

@wmehanna

Copy link
Copy Markdown
Collaborator

Summary

  • Rewrite the input layer on native JXA/CoreGraphics (CGEventPost taps/swipes, JXA activation with cursor save/restore), replacing the prior cliclick dependency, and add the app registry + open-app launcher.
  • Fix multi-display and mixed-Retina correctness: Retina scale is now measured from the actual window capture instead of guessed from display geometry (the geometric approach silently returned 1 on gapped/non-rectangular display arrangements); an inverted alpha-scan axis is corrected; screenshots are normalized to point dimensions so one coordinate space covers taps, OCR, and the registry on any display, including negative-origin secondary displays.
  • Add a SwiftUI companion app that docks next to the iPhone Mirroring window and drives it via native CGEvent/AXUIElement calls, avoiding per-call TCC overhead from shelling out.
  • Add bats coverage (including a negative-origin window fixture), a GitHub Actions workflow running the bats + vitest suites, and Makefile targets for build/test/lint.
  • Sync README/SKILL docs and MCP tool descriptions with the current command/tool surface.

Changes

  • helpers/get-window-id.swift, find-window.sh, helpers/common.sh: measured capture scale, top-left alpha scan, strict bounds parsing
  • screenshot.sh, map-apps.sh, registry.sh: point-normalized screenshots, registry v2 with stale-version rejection
  • mcp-server/src/index.ts: tool descriptions declare screenshot/tap coordinate parity
  • companion/: new SwiftUI companion app (native input controller, window manager, tool executor)
  • tests/, .github/workflows/test.yml, Makefile: expanded test coverage and CI
  • README.md, SKILL.md: refreshed to match actual commands and MCP tools

Test plan

  • bats tests/*.bats (113/113 passing)
  • cd mcp-server && npx vitest run (31/31 passing)
  • xcodebuild for the companion app target (builds clean)
  • Manual verification with iPhone Mirroring open across multiple displays (primary + secondary, mixed Retina scale)

wmehanna added 13 commits March 26, 2026 23:22
…istry and app launcher

- Replace cliclick with CGEvent-based tap/swipe (no external deps)
- Use alpha-channel detection for precise iOS content bounds
- Add open-app, registry scan/lookup, home/spotlight/app-switcher tools
- Add status check and scan_apps MCP tools
- Fix P3 display alpha bug, sips error handling, SCALE=0 guard
- Fix RCE: write user input to temp files instead of bash string embedding
- Fix concurrent screenshot collision (Date.now -> randomUUID)
- Fix JSON control char escaping in OCR output
- Add window_id to cache key to survive app restarts
Panel app that docks next to the iPhone Mirroring window and drives it
via native CGEvent/AXUIElement calls instead of shelling out, avoiding
per-call TCC permission overhead.
…rget

The workflow never installed shellcheck, so the lint step always failed
with 'command not found' before reaching any real check. Once installed,
linting helpers/common.sh standalone flags every constant as unused since
it is a sourced-only library with no consumers in that single-file view;
-x already surfaces real usage through the scripts that source it. Also
fixes a genuine SC2034 in map-apps.sh (ph field read but never used).
@wmehanna
wmehanna merged commit 8b34a87 into main Jul 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant