Add tvOS platform support#363
Conversation
tvOS simulators now surface through the MCP server. - Accept `tvos` in the platform unions and validation in the mobilecli wrapper. - Drop the hard `ios` filter on simulator discovery so tvOS simulators are returned, and report each device's real platform to analytics. - List the tvOS Siri Remote buttons (UP, DOWN, LEFT, RIGHT, SELECT, MENU, PLAY_PAUSE) in the press-button tool description. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
WalkthroughThe change adds 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/server.ts (1)
521-521: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winMake
buttonmachine-validatable, not description-only.
buttonis still a free-form string, so clients cannot validate or autocomplete the new tvOS buttons from the schema, and typos will only fail deeper in the stack. If this is a closed set, prefer a sharedz.enum(...)here.Suggested direction
+const SUPPORTED_BUTTONS = [ + "BACK", + "HOME", + "VOLUME_UP", + "VOLUME_DOWN", + "ENTER", + "DPAD_CENTER", + "DPAD_UP", + "DPAD_DOWN", + "DPAD_LEFT", + "DPAD_RIGHT", + "UP", + "DOWN", + "LEFT", + "RIGHT", + "SELECT", + "MENU", + "PLAY_PAUSE", +] as const; + tool( "mobile_press_button", "Press Button", "Press a button on device", { device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."), - button: z.string().describe("The button to press. Supported buttons: BACK (android only), HOME, VOLUME_UP, VOLUME_DOWN, ENTER, DPAD_CENTER (android tv only), DPAD_UP (android tv only), DPAD_DOWN (android tv only), DPAD_LEFT (android tv only), DPAD_RIGHT (android tv only), UP (tvOS only), DOWN (tvOS only), LEFT (tvOS only), RIGHT (tvOS only), SELECT (tvOS only), MENU (tvOS only), PLAY_PAUSE (tvOS only)"), + button: z.enum(SUPPORTED_BUTTONS).describe("The button to press. Some buttons are platform-specific."), },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/server.ts` at line 521, The `button` field in the schema is still defined as a free-form `z.string()` in `server.ts`, so it cannot be machine-validated or autocompleted. Replace it with a shared `z.enum(...)` covering the supported button values, and reuse that enum in the relevant schema so the `button` constraint is enforced at validation time rather than only described in text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/server.ts`:
- Line 521: The `button` field in the schema is still defined as a free-form
`z.string()` in `server.ts`, so it cannot be machine-validated or autocompleted.
Replace it with a shared `z.enum(...)` covering the supported button values, and
reuse that enum in the relevant schema so the `button` constraint is enforced at
validation time rather than only described in text.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 63cdf31c-400f-4757-a15b-598dce6c3cac
📒 Files selected for processing (2)
src/mobilecli.tssrc/server.ts
What
tvOS simulators now surface through the MCP server, so an MCP client can find and control them the same way it does iOS simulators.
Changes
tvosin the platform unions and validation in the mobilecli wrapper.iosfilter on simulator discovery, so tvOS simulators are returned. Analytics now reports each device's real platform instead of a hardcodedios.Depends on
tvosplatform and the Siri Remote button mappingTesting
With a booted tvOS simulator,
mobile_list_available_devicesreturns it andmobile_press_buttonmoves its focus.