feat(companion): add appState, eraseText, pressKey runner handlers

The Go runner transport already calls these methods; the in-device runner
implemented them only latently. They become load-bearing on the device
path, where the hybrid's legacy-companion fallback is absent. Backward
compatible: the simulator hybrid never calls them.
This commit is contained in:
pj committed 2026-06-08 23:06:06 +05:30
1 parent e04631d4c9
commit 99ae7c9294
3 files changed
+70

No files matched your search

+13
View File
@@ -122,6 +122,19 @@ final class Server {
let bundleIdentifier = params["bundleId"] as? String ?? currentBundleIdentifier
try TextInput.type(text: text, replace: replace, bundleIdentifier: bundleIdentifier)
return ["ok": true]
case "eraseText":
let count = params["count"] as? Int ?? 0
let bundleIdentifier = params["bundleId"] as? String ?? currentBundleIdentifier
try TextInput.erase(count: count, bundleIdentifier: bundleIdentifier)
return ["ok": true]
case "pressKey":
let key = params["key"] as? String ?? ""
let bundleIdentifier = params["bundleId"] as? String ?? currentBundleIdentifier
try TextInput.pressKey(key: key, bundleIdentifier: bundleIdentifier)
return ["ok": true]
case "appState":
let bundleIdentifier = params["bundleId"] as? String ?? currentBundleIdentifier
return ["state": AppLifecycle.state(bundleIdentifier: bundleIdentifier)]
case "screenshot":
return try screenshot()
default: