Files
sanderling/proto/driverpb/driver.proto
pj da3cc5f68c feat(driver): add escape to the pressKey surface
escape is a key a spec has real use for and no platform could send it. android maps it to KEYCODE_ESCAPE, the ios companion to HID usage 41 and the in-simulator runner to XCUIKeyboardKey.escape, and the Key union accepts it so it can be written at all.
2026-08-16 17:41:33 +05:30

131 lines
3.0 KiB
Protocol Buffer

syntax = "proto3";
package sanderling.driver.v1;
option go_package = "github.com/priyanshujain/sanderling/proto/driverpb;driverpb";
option java_package = "dev.sanderling.driver.v1";
option java_multiple_files = true;
service Driver {
rpc Launch(LaunchRequest) returns (Empty);
rpc Terminate(Empty) returns (Empty);
rpc Tap(Point) returns (Empty);
// DoubleTap lands two taps as close together as the platform allows.
// Composing two Tap calls from the client spreads them by hundreds of
// milliseconds on iOS, wide enough for navigation to interleave, which
// defeats double-submission testing.
rpc DoubleTap(Point) returns (Empty);
rpc TapSelector(Selector) returns (Empty);
rpc InputText(Text) returns (Empty);
// EraseText deletes characters from the focused field so InputText can
// replace existing content instead of appending to it.
rpc EraseText(EraseTextRequest) returns (Empty);
rpc Swipe(SwipeRequest) returns (Empty);
rpc PressKey(PressKeyRequest) returns (Empty);
rpc LongPress(Point) returns (Empty);
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);
rpc Health(Empty) returns (HealthStatus);
rpc Metrics(MetricsRequest) returns (MetricsResponse);
}
message Empty {}
message LaunchRequest {
string bundle_id = 1;
bool clear_state = 2;
map<string, string> env = 3;
}
message Point {
int32 x = 1;
int32 y = 2;
}
message Text {
string value = 1;
}
message EraseTextRequest {
int32 character_count = 1;
}
message Selector {
string value = 1;
}
message Image {
bytes png = 1;
int32 width = 2;
int32 height = 3;
}
message HierarchyJSON {
string json = 1;
}
message SnapshotResponse {
HierarchyJSON hierarchy = 1;
Image screenshot = 2;
}
message Duration {
int64 millis = 1;
}
message HealthStatus {
bool ready = 1;
string version = 2;
string platform = 3;
}
message SwipeRequest {
Point from = 1;
Point to = 2;
int64 duration_millis = 3;
}
message PressKeyRequest {
// Logical key name. Supported: "back", "home", "enter", "tab", "escape",
// "up", "down", "left", "right".
string key = 1;
}
message RecentLogsRequest {
// Lower bound as unix-epoch milliseconds; entries at or after this are
// returned.
int64 since_unix_millis = 1;
// Minimum level: "E", "W", or "I". Empty defaults to "E".
string level_at_least = 2;
}
message LogEntries {
repeated LogEntry entries = 1;
}
message LogEntry {
int64 unix_millis = 1;
string level = 2;
string tag = 3;
string message = 4;
}
message MetricsRequest {
string bundle_id = 1;
}
message MetricsResponse {
double cpu_percent = 1;
int64 heap_bytes = 2;
int64 total_memory_bytes = 3;
}