feat: v0.4 — desktop kind (spec + Node producer + FixtureBackend + MCP tools) - #11
Merged
Conversation
Extends the AgentMark spec to native desktop surfaces captured via OS accessibility APIs (Windows UIA, macOS AXAPI, Linux AT-SPI). Adds a new SnapshotKind `'desktop'` with a matching DesktopMeta envelope describing platform, process, window class, focused element, and backend metadata. Producers will arrive in subsequent PRs (Node-side converter + per-OS bridge processes). This PR is the spec foundation — purely additive, zero functional change. v0.3 snapshots continue to validate against v0.4. Changes: - AGENTMARK_VERSION bumped to '0.4' - SUPPORTED_SPEC_VERSIONS extended to include '0.4' - SnapshotKind union extended with 'desktop' - New DesktopMeta interface (mirrors MediaMeta pattern) - desktop_meta?: DesktopMeta on Snapshot - BodyTagKind extended with WINDOW (window boundary) and ELEMENT (non-interactive accessibility element reference) - New schema/agentmark-v0.4.json - Validator resolveSchemaVersion + STRUCTURAL_TAGS + version-compat warning all updated for v0.4 - DesktopMeta exported from src/index.ts - New test/spec-v0.4.test.ts — 7 tests covering valid desktop snapshots on Windows + macOS, invalid platform rejection, invalid extra fields, WINDOW/ELEMENT body tags, YAML round-trip, v0.3 backward compat - Three existing tests with hardcoded version strings bumped 0.3 → 0.4 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
desktop kind for native applicationsdesktop kind + Node producer + FixtureBackend
desktop kind + Node producer + FixtureBackenddesktop kind (spec + Node producer + FixtureBackend + MCP tools)
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.
Summary
Ships
kind: 'desktop'end-to-end: spec, Node-side producer, fixturebackend, and MCP tool surface so any MCP-compatible AI tool can use
AgentMark Desktop today.
OS-specific bridges (Windows UIA via FlaUI, macOS AXAPI via Swift) ship
in follow-up PRs as separate sidecar processes implementing the
DesktopCaptureBackendinterface.How to try it locally (works on any OS)
Then from any AI tool:
The fixture backend serves pre-baked Excel + NowCerts trees so this
works without a real OS bridge installed.
What changed
Spec foundation (v0.4)
AGENTMARK_VERSION→'0.4',SUPPORTED_SPEC_VERSIONSextendedSnapshotKindextended with'desktop'DesktopMetainterface (mirrorsMediaMetapattern)desktop_meta?: DesktopMetaonSnapshotBodyTagKindextended withWINDOW(boundary marker) andELEMENT(non-interactive accessibility element reference)
schema/agentmark-v0.4.jsonwithdesktop_metadefinitionNode producer (
src/desktop/)types.ts—DesktopCaptureBackendinterface,DesktopCapture,DesktopElement, normalisedDesktopRolevocabulary,ExecuteDesktopAction(click | type | select | check | expand |focus | scroll_to | key)
body-builder.ts— walks the tree, emits markdown with the rightmix of
[ACTION:]/[INPUT:]/[WINDOW:]/[ELEMENT:]tags.Headings for windows/panes/dialogs, lists for menus and tree views,
native markdown tables for grids
desktop-converter.ts—convertDesktop()entry point. Populatesthe
ActionBindingwith each action's underlyingelement_idsothe runtime resolves
execute(actionId)→backend.execute({ element_id })fixture-backend.ts— in-memory backend with Excel + NowCertspresets. Round-trippable —
execute(type)mutates an element-valuesmap that subsequent
capture()calls reflectindex.ts— module exports, wired into package rootMCP surface (
src/mcp/)ALL_TOOLS:agentmark_desktop_open,_close,_snapshot,_execute_executecan resolve action IDs without the client knowingunderlying element IDs
fixture(default),windows_uia,macos_axapi— the OS ones return "not yet bundled" until bridgesship
agentmark_list_sessionsextended to report active desktop sessionsTests
test/spec-v0.4.test.ts(7 tests) — minimal Windows + macOSsnapshots validate; bad platform / extra fields rejected;
[WINDOW]/[ELEMENT]body tags accepted without action lookup;YAML round-trip preserves
desktop_meta; v0.3 backwards compattest/desktop/desktop-converter.test.ts(8 tests) — fixturesnapshots, synthesised + explicit URLs, backend name reporting,
aria state, static-only snapshots, full type → execute → re-capture
round-trip
test/mcp/desktop-dispatcher.test.ts(12 tests) — tool registration,open backends, snapshot targeting, full execute round-trip,
unknown action handling, session lifecycle
npm test— 295 passed, 10 skipped (pre-existing), 0 failed.Backwards compat
v0.3 snapshots continue to validate against v0.4 unchanged. No required
field added, no enum narrowed, no existing exports changed.
Next PRs
WindowsUiaBackend/MacosAxapiBackendin agentmark-desktop🤖 Generated with Claude Code