mirror of
https://github.com/lahfir/agent-desktop.git
synced 2026-07-27 01:22:16 +00:00
Implements the complete agent-desktop Phase 1 specification:
- Workspace: 5-crate layout (core, macos, windows/linux stubs, binary)
- Core: AccessibilityNode, Action, ErrorCode, PlatformAdapter trait, RefMap
with atomic writes, SnapshotEngine with depth-first ref allocation
- macOS adapter: AXUIElement tree traversal, action execution, input
synthesis via CGEvent, screenshot via CGWindowListCreateImage, clipboard
via pbpaste/pbcopy, window listing and app management via osascript
- 31 CLI subcommands via clap derive: snapshot, find, screenshot, get, is,
click, double-click, right-click, type, set-value, focus, select, toggle,
expand, collapse, scroll, press, launch, close-app, list-windows,
list-apps, focus-window, clipboard-get/set, wait, status, permissions,
version, batch
- Windows/Linux: not-supported stubs ready for Phase 2 implementation
- JSON output contract: {version,ok,command,data} envelope with structured
error payloads including SCREAMING_SNAKE_CASE error codes
- Ref system: @e{N} sequential refs for interactive elements, stored at
~/.agent-desktop/last_refmap.json with 0o600/0o700 permissions
- CI: GitHub Actions macOS runner with dependency isolation check, clippy,
unit tests, release build, and 15MB binary size gate
|
||
|---|---|---|
| .. | ||
| README.md | ||
Test Fixtures
Golden JSON snapshots for regression testing.
Populating Fixtures
Run the following on macOS with Accessibility permissions to capture real snapshots:
cargo build --release
./target/release/agent-desktop snapshot --app Finder > tests/fixtures/finder-snapshot.json
./target/release/agent-desktop snapshot --app TextEdit > tests/fixtures/textedit-snapshot.json
./target/release/agent-desktop list-apps > tests/fixtures/list-apps.json
Usage in Tests
Fixture files are loaded in tests to assert serialization stability:
let expected: Value = serde_json::from_str(
include_str!("../fixtures/finder-snapshot.json")
).unwrap();
Any change to the JSON output contract must be accompanied by updated fixtures.