feat(snapshot): carry the presenter's platform-neutral role on nodes
Summary
Part of #2656. Every SnapshotNode now carries kind, the text presenter's platform-neutral
role (button, text-field, text, switch, ...), computed by formatRole — the same value
the presenter prints in brackets. type stays the raw platform class; kind is set by
attachRefs on every node on every platform. Docs clarify role= selectors still match a raw,
leaf-only normalization of type, not kind; reconciling the two vocabularies, the empty grep, and kind in client-api.md are tracked
separately as #3021 since they would change matching for selectors already in use.
Example (snapshot --json, Android):
{ "index": 0, "type": "android.widget.TextView", "role": "textview", "kind": "text", "label": "4:05" }
39 files touched (kernel construction path, capture-kit presenter reuse, contracts/selectors/
daemon fixtures, docs, gate metadata). No scope expansion beyond #2656 and its gate fallout
(an output-economy byte-budget waiver for the intentional growth, and a web-provider
integration fixture updated to expect kind).
Validation
Tested at the head of this branch (rebased on main). The live iOS and Android runs below were taken before the rebase; the rebase and the follow-up commit only touch tests and docs.
pnpm check:affected --run: all runnable checks passed.- Live iOS (
xcrun simctl create wf-2656 "iPhone 16" iOS-18-6, SpringBoard):snapshot --json
andsnapshot -i --jsonboth showkindnext totype
(type: "Application", kind: "application";type: "Other", kind: "other"). - Live Android (
emulator -avd Pixel_9_Pro_XL -port 5582 -no-window):snapshot --jsonand
snapshot -i --jsonboth showkindnext totype
(type: "android.widget.TextView", kind: "text";type: "android.widget.FrameLayout", kind: "group"). - Both devices created for this run and torn down afterward; no CI-reserved devices used.