feat(M1): 补 de_wake/de_press_key 工具(Agent 熄屏可自唤醒);修复 MCP SDK v2 input_schema 字段警告

This commit is contained in:
2026-09-04 12:50:55 +08:00
parent 937a87b36c
commit 7017ff3315
3 changed files with 46 additions and 1 deletions
+12
View File
@@ -107,6 +107,18 @@ class PlatformClient:
"duration": float(duration)})
return self._check_op(r, "swipe")
def wake(self, serial):
"""亮屏并解锁(POST /api/device/screen_all mode=on)。"""
r = self._post("/api/device/screen_all",
json={"mode": "on", "serials": [serial]})
return self._check_op(r, "wake")
def press_key(self, serial, key):
"""按键(POST /api/screen/key)。"""
r = self._post("/api/screen/key",
json={"serial": serial, "key": key})
return self._check_op(r, "key")
@staticmethod
def _check_op(r, name):
if r.status_code == 503: