mirror of
https://github.com/lahfir/agent-desktop.git
synced 2026-07-26 17:12:15 +00:00
Adds the trace read/replay layer on the session-first foundation: `trace show` merges per-process segments into one deterministic timeline (bounded JSON for agents), and `trace export` renders a single self-contained, XSS-safe HTML viewer for humans. Opt-in `session start --screenshots` captures pre/post-action screenshots and refmap copies; command.start/end boundary events and a versioned trace.meta header make a step-by-step replay reconstructable. Redaction is hardened so raw caller arguments never leak into trace-reachable error messages. Available across CLI, batch, and FFI. |
||
|---|---|---|
| .. | ||
| trace_show/trace | ||
| drilldown-refmap.json | ||
| README.md | ||
| skeleton-tree.json | ||
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.