Skip to content

Add elements command for iOS accessibility tree dump#105

Merged
obj-p merged 2 commits intocli-mcp-parityfrom
elements-command
Apr 15, 2026
Merged

Add elements command for iOS accessibility tree dump#105
obj-p merged 2 commits intocli-mcp-parityfrom
elements-command

Conversation

@obj-p
Copy link
Copy Markdown
Owner

@obj-p obj-p commented Apr 15, 2026

Summary

  • Adds previewsmcp elements as a daemon client for the preview_elements MCP tool.
  • Prints the accessibility tree as JSON to stdout (pipe into jq); log messages go to stderr.
  • Session targeting uses the shared SessionResolver rules: --session <uuid> > --file <path> > sole running session.
  • --filter {all,interactable,labeled} narrows the tree via the daemon.
  • Also gitignores .claude/scheduled_tasks.lock so it no longer shows up as untracked.

Test plan

  • swift build
  • swift test --filter 'ElementsCommandTests/elementsNoSession' (passes locally)
  • swift test --filter 'ElementsCommandTests/elementsRejectsMacOSSession' (passes locally, ~5s)
  • Gated iOS happy-path test runs on machines with an available simulator

🤖 Generated with Claude Code

obj-p and others added 2 commits April 15, 2026 13:23
Forwards to the daemon's preview_elements MCP tool and prints the
resulting JSON to stdout so callers can pipe into jq or consume
from scripts. Session targeting mirrors configure/switch: --session,
--file, or the sole running session.

Also ignores .claude/scheduled_tasks.lock so it stops surfacing in
git status.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ty stdout

- The macOS-rejection test matched "ios" in lowercased stderr, which
  could incidentally pass on unrelated log lines. Pin it to the
  daemon's exact iOS-only message from MCPServer.swift:871.
- Skip printing a trailing newline when the daemon returns an empty
  payload so downstream jq parsers don't see a stray \n.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@obj-p obj-p merged commit 1426e32 into cli-mcp-parity Apr 15, 2026
@obj-p obj-p deleted the elements-command branch April 15, 2026 17:51
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