feat: add plugin runtime and cross-device task orchestration

This commit is contained in:
chenmingxuan committed 2026-10-14 20:21:44 +08:00
1 parent 3ee4a5f7a8
commit 6663233ab8
82 files changed
+4147 -124

No files matched your search

+16
View File
@@ -88,6 +88,22 @@ async def observe(
device_data = await asyncio.wait_for(
controller.get_screen_data(), timeout=settings.ARTEMIS_OBSERVATION_TIMEOUT_SECONDS
)
if getattr(device_data, "platform", "android") == "computer":
screenshot = base64.b64decode(device_data.base64) if device_data.base64 else None
path = None
if screenshot and ctx.data_engine:
path = str(
ctx.data_engine.get_image_path(ctx.data_engine.get_or_create_image(screenshot))
)
return ObserveResult(
ok=True,
message="已读取电脑插件观察结果",
screenshot_path=path,
width=device_data.width,
height=device_data.height,
elements_text=device_data.observation_text,
hierarchy_ok=True,
), screenshot
screenshot_bytes = base64.b64decode(device_data.base64)
with Image.open(BytesIO(screenshot_bytes)) as image:
if min(image.size) <= 1: