feat: extend DeviceInfo with battery, manufacturer, heartbeat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sanju Sivalingam
2026-02-17 20:55:42 +05:30
parent 0c0efe9b1e
commit a7738936f2
4 changed files with 41 additions and 4 deletions

View File

@@ -5,7 +5,8 @@ export type DeviceMessage =
| { type: "screen"; requestId: string; elements: UIElement[]; screenshot?: string; packageName?: string }
| { type: "result"; requestId: string; success: boolean; error?: string; data?: string }
| { type: "goal"; text: string }
| { type: "pong" };
| { type: "pong" }
| { type: "heartbeat"; batteryLevel: number; isCharging: boolean };
export type ServerToDeviceMessage =
| { type: "auth_ok"; deviceId: string }
@@ -38,4 +39,5 @@ export type DashboardMessage =
| { type: "device_offline"; deviceId: string }
| { type: "step"; sessionId: string; step: number; action: Record<string, unknown>; reasoning: string; screenHash: string }
| { type: "goal_started"; sessionId: string; goal: string; deviceId: string }
| { type: "goal_completed"; sessionId: string; success: boolean; stepsUsed: number };
| { type: "goal_completed"; sessionId: string; success: boolean; stepsUsed: number }
| { type: "device_status"; deviceId: string; batteryLevel: number; isCharging: boolean };

View File

@@ -53,9 +53,12 @@ export interface ActionResult {
export interface DeviceInfo {
model: string;
manufacturer: string;
androidVersion: string;
screenWidth: number;
screenHeight: number;
batteryLevel: number;
isCharging: boolean;
}
export interface ScreenState {