Repository navigation
Expo iOS App vm control - #52
Merged
Merged
Conversation
POST /api/vms/:id/input sends clicks, scrolls, keys and text from a live view to the running VM's screen, scaled from the picture the phone shows. Phones may call it. The app's live view gets Take control for VMs, hold to right-click, scroll up and down, and a key bar with arrows, esc, tab and common Mac shortcuts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You can now control a VM from the phone app, not just watch it. Tap "Take control" on a running VM's live screen and your taps, scrolls and typing go to the VM. Core tests for the new route pass, and I ran the full flow in the iOS Simulator against a stand-in for the VM. It has not been tried against a real VM yet.
Take control of a VM from the phone app
Until now the phone app's live view could only watch a VM: "Take control" was turned off for VMs because the core had no way to send input to them.
Core
POST /api/vms/:id/inputtakes{ event, frame }, using the same kinds of events as the shared-screen input (click,move,drag,scroll,key,text).dispatchVmInputinvm/screen.ts, scales the points from the picture the phone shows to the VM's actual screen and sends them over the VM's existing Screen Sharing connection.mobile/scope.tslets phones call the route, and the request may only carryeventandframe. Phones can control any of Godmode's VMs, not only screens shared in a chat.docs/ARCHITECTURE.md(Phone app → Scope) says so.App (
apps/mobile)Tests
vms.test.ts:frameanswer 400.mobile.test.ts: phones may call the route, and a request carrying any other field is refused.bun test test/vms.test.ts test/mobile.test.ts: 52 passed, 0 failed. Typecheck passes for core and for the app.eslintisn't installed inapps/mobile.Simulator check
I ran the app from this branch on an iPhone 17 Simulator. A test copy of Godmode supplied a stand-in VM, with a made-up macOS desktop as its screen, and logged what the phone sent. Every control arrived as intended:
Screenshots:
/Users/danielehrhardt/.godmode/agents/godmode/workspace/task9-shots/vm-control.png: control mode with the scroll buttons and the hint line./Users/danielehrhardt/.godmode/agents/godmode/workspace/task9-shots/vm-typing.png: typing with the on-screen keyboard open; the key bar and type box sit above it and the picture is in full view.Task #9 · done by Godmode with Godmode Bot