Skip to content

Add persistent MCP Viewer and typed property editing - #52

Merged
asklar merged 103 commits into
mainfrom
mcp-viewer-eventing
Aug 31, 2026
Merged

Add persistent MCP Viewer and typed property editing#52
asklar merged 103 commits into
mainfrom
mcp-viewer-eventing

Conversation

@asklar

@asklar asklar commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • move the Viewer to one persistent subscribed MCP session for visual and UIA trees
  • add provider-driven typed property schemas, editing, clear/reset, effective readback, and structured failures for XAML/WinUI3, UIA, WPF, WinForms, Win32, and common controls
  • add persistent managed/plugin connections plus native/UIA eventing and durable lifetime-scoped identities
  • harden per-session authorization, target lifetime fencing, snapshot ordering, package validation, and x86/x64 ABI behavior
  • update the packaged lvt skill and release contents; external plugin property ABI remains explicitly deferred

Validation

  • x64/x86 deterministic unit, WinUI static/legacy, Chromium, native/watch, managed, UIA, MCP, Rust, and Viewer regression suites
  • x64/x86 CLI build-layout validation and complete x64 Viewer bundle validation
  • ARM64 CLI build and 46-item package-layout validation using Windows SDK 10.0.26100.0
  • deterministic screenshot transport tests pass on x64/x86

Environment-limited checks

  • real Graphics Capture and foreground-input cases remain subject to Windows shared-desktop policy
  • x86 Notepad integration cases were redirected to an existing user-owned unsaved x64 Notepad process and were not allowed to close or replace it

Blocks the draft v0.5.0 release PR until this implementation merges.

asklar and others added 30 commits August 27, 2026 15:36
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Remove the watch stdin control channel and expose persistent visual property operations and session-scoped tree diffs as MCP tools instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Expose session visual-tree patches as MCP resources and send standards-compliant resource update notifications from persistent TAP change events.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Replace the Viewer-specific watch/one-shot subprocess split with one lvt MCP session. Subscribe to mode-specific UIA/visual tree resources, apply cached snapshot/diff patches, route UIA and XAML property actions through the same session, preserve prior snapshots across transient XAML collection failures, and harden reconnect/shutdown/stale-patch handling.

Keep property loading asynchronous, construct rows off the dispatcher, replace collections once, and add property name/value filtering and loading feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Give direct tools and subscribed resources independent diff baselines, preserve snapshots across total and per-island XAML loss, retain overflow resync state, and keep subscriptions alive across transient reads. Honor XAML child insertion indices.

Scope Viewer requests to transport generations, serialize all resource reads, make watchdog cancellation safe, prevent stale async property responses, live-filter changed values, and ignore obsolete-path removals after reparenting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Exercise the Viewer-style subscribe/read flow, consume the same property mutation through get_visual_tree_changes, and prove the subscribed resource still emits and returns its own non-snapshot diff.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Teach the skill to use MCP subscriptions and provider-owned typed property schemas, select the exact CLI release archive instead of the Viewer archive, and bump the plugin metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Match unique XAML and WinUI provider handles across parent changes while preserving local reconciliation for other providers. Cover move ordering, nested subtrees, duplicate and recycled handles, and serialized path fields.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Emit parentKey for globally reconciled nodes whose parent identity changed even when their absolute path did not. Teach LiveTree to apply the relocation safely across same-path parent replacement and add native and Viewer regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Explain why the XAML runtime's retained IObjectWithSite reference makes mid-session FreeLibrary unsafe, and add a PID-scoped repeated-connect regression proving active resources are cleaned up without unloading the module.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Implement curated Win32 and common-control property descriptors, safe timed messaging, remote buffers, validation/readback, fixture coverage, MCP integration, and documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Fix toolbar text sizing, pointer-message buffer lifetime, one-shot cross-bitness checks, tree membership, disconnect races, and tab/item identity validation with regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Describe bounded pointer lifetimes, safe toolbar text retrieval, cross-bitness limits, session-scoped publication, and stronger native item identity checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Handle owner-drawn status data, tab item-extra ABI, duplicate toolbar commands, long item text, and live tree membership with focused regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Document owner-draw status handling, tab item-extra avoidance, toolbar command uniqueness, bounded text reads, and live publication pruning.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
asklar added 28 commits August 30, 2026 09:05
Treat disappearance caused by a fully validated WindowPattern.Close call as success, including providers that invalidate their proxy while closing. Retain ownershipLost for replacement before the call, default MCP window actions to the root element, and cover CLI/MCP success and replacement races on x64 and x86.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Preserve the native-key and scoped-watch fixture message range while assigning the rebased UIA HWND-recycle command a non-conflicting identifier.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Keep the plugin-distributed skill identical to the canonical repository copy, including exact CLI asset selection, MCP resource subscriptions, and provider-driven typed property guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Scope identities by UIA view only, evict excess historical scopes and aliases with current-snapshot protection, and refuse oversized snapshots transactionally.

Add unit and MCP regressions for option churn, view switching, stale pruning, and bounded key resolution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Bind compact provider handles to complete session snapshots and validate visual target identity across reads, resources, connection acquisition, and property mutations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Preserve transient identity status, validate live managed root membership on every property command, and commit staged authorization only after accepted snapshots.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Keep wait-gone semantics while validating snapshots, and prevent older accepted responses from overwriting newer session authorization generations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Validate XAML roots at property execution, preserve UIA failure HRESULTs, reject delayed authorization after disconnect, and stage screenshots until target identity is revalidated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Reject partial hosts across every visual snapshot, fence framework detection by exact identity, and preserve closed-window ownership wording.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Reject incomplete initial or new XAML hosts, generation-order tree baselines, linearize screenshot publication with disconnect, and require UIA identity support for MCP.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Serve stale reset requests from the latest compatible baseline, retry incompatible generations, and expose reset through MCP tree-change tools.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Release baseline locks before bounded reset retries, return full stale reset snapshots, and scope WinForms child-HWND sessions to their control subtree.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Atomically publish matching authorization before baselines become visible and replace caller-controlled recursive reset retries with a fixed bounded loop.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Publish baseline trees with matching authorization tokens and retry stale resets locally when later visual reads revoke their generation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Stage native target trees and commit native plus generic authorization under one generation lock before baselines become visible.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Release the authorization lease before re-entering session state and add a deterministic snapshot-publication deadlock regression.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Return classified mutation failures and provider-effective readback metadata across managed, native, UIA, and XAML property adapters. Tighten MCP schemas, Viewer handling, and cross-architecture coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Classify XAML readback failures, managed in-flight timeouts, and stale UIA child operations at provider boundaries while retaining fallback semantic refinement for generic transient failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Preserve typed-property failure stages and exact HRESULTs across UIA, native, managed, and authorization paths, and require effective readback for native selection clears.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Harden native lifetime identities and reconciliation, remove remaining lock inversions, require positive XAML host association, and propagate incomplete and structured failure states.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Describe lifetime-scoped native keys, UIPI read-only fallback, lock ordering, and provider-neutral typed property behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Install the .NET 6 runtime in CI, restore recycled native fixture state, and make the RuntimeId reparenting test provider-neutral while retaining the durable-key assertion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Use live root bounds after restoring minimized targets, isolate simulated-input tests from real desktop occlusion, and choose only connectable secondary windows for concurrency coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Skip real monitor validation only when the complete foreground-and-input suppression test override is active.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Wait longer for managed fixture readiness and require a balanced prior TAP cleanup baseline before counting repeated dump cycles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
Select only on-monitor obstructed elements and skip when Windows foreground policy prevents the test prerequisite.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 624b695e-57bc-426d-b037-4c0d6bd3db46
@asklar
asklar merged commit de97405 into main Aug 31, 2026
6 checks passed
@asklar
asklar deleted the mcp-viewer-eventing branch August 31, 2026 20:20
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