Repository navigation
Conversation
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.
Fixes #389
Implements MCP-113 on the Mac only:
type_textnow takes an optionalref. With it, one call presses the element first (ui.presswith the caller'sexpect), types nothing when that press is refused (stale_ref,off_screen,covered), then onpress.oksends the singleui.typeand settles and observes once.didcarriesrefbesidecharacters,clear,submit,entryandvia(never the text), andon.snapshotis the tree the ref came from. No wire or Android change.What changed
MCPActMachine: newPath.pressThenType;Queued -> Pressing -> Typing -> Sent -> Settling -> Observing -> Done, with the existingDraining, deadline,windowClosed,linkLostandclientGonerows unchanged. A refused press goes straight toDonewith its closed code and sends nosendType.MCPCall.typeText/MCPArguments: optionalref, validated by the samekey()rule astap(^e[0-9]+$, ≤ 2147483647).MCPTools+Input: the press keeps the window's turn;sendTypereuses the press snapshot foron.snapshot;MCPActDid.typegained the optionalref.type_text's input schema declaresref; its outputdiddeclaresrefwithadditionalProperties: false.MCP-113row and the act-machine table row indocs/specs/mcp.md;type_text's tool-table description (word-for-word withMCPCore.swift) and thedidshape indocs/design/mcp.md.[MCP-113]): happy path, every press refusal, deadline/client-gone/window-closed while pressing and typing, schema and description parity, plus a ref e2e case insuite_type.py.Checks
Every new case passes:
Full-suite note for this headless session:
swift testreaches one unrelated AppKit/Vision test that cannot run here —LiveTextInteractionTests.testTheOverlayTakesAHitTestOnTextAndKeepsTextSelectionfails withVisionKit never finished (state analyzing)(541 s), andSecondaryClickTestshangs creating anNSEvent; with those two skipped, everything else (all MCP and core tests) is green:The e2e
suite_type.pycase is added but not run here (needs the built app and fake-phone harness); it exercises a ref press followed by oneui.type, and a stale ref that types nothing.