feat(proto): add Snapshot RPC for atomic hierarchy+screenshot

Pairs hierarchy and screenshot in a single response so the runner can
capture both under a backend mutex, avoiding the cross-fade race where
the two reads describe different frames.
This commit is contained in:
pj committed 2026-05-31 15:22:22 +05:30
1 parent a1390aecdd
commit 5a19ef885f
3 files changed
+193 -77

No files matched your search

+9
View File
@@ -18,6 +18,10 @@ service Driver {
rpc Screenshot(Empty) returns (Image);
rpc Hierarchy(Empty) returns (HierarchyJSON);
// Snapshot captures hierarchy and screenshot back-to-back under a
// backend-side mutex so the pair describes the same on-device frame.
// Use this instead of racing Hierarchy and Screenshot from the runner.
rpc Snapshot(Empty) returns (SnapshotResponse);
rpc RecentLogs(RecentLogsRequest) returns (LogEntries);
rpc WaitForIdle(Duration) returns (Empty);
@@ -56,6 +60,11 @@ message HierarchyJSON {
string json = 1;
}
message SnapshotResponse {
HierarchyJSON hierarchy = 1;
Image screenshot = 2;
}
message Duration {
int64 millis = 1;
}