feat(perception): expose active app metadata in UI tree
Tests / Test passed: 971

This commit is contained in:
2026-07-16 08:13:04 +08:00
parent 059fb272bb
commit 9a17297f1e
13 changed files with 246 additions and 17 deletions
+6 -1
View File
@@ -3,6 +3,8 @@ from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Any
from core.models import ActiveApp
class Driver(ABC):
"""Driver-independent device capability interface.
@@ -71,6 +73,10 @@ class Driver(ABC):
def tree(self) -> Any:
"""Return the raw UI tree from the device driver."""
def active_app(self) -> ActiveApp | None:
"""Return foreground application metadata when the driver supports it."""
return None
@abstractmethod
def home(self) -> None:
"""Press the device home button."""
@@ -82,4 +88,3 @@ class Driver(ABC):
@abstractmethod
def unlock(self) -> None:
"""Unlock the device."""