Feature: Support remote chat on Android hosts
The chat tools were Windows-only because the Android client had no COMMAND_CHAT handler: the server asked for a chat sub-connection and the command was silently dropped, leaving chat_open to time out. This adds the full path on the client and the matching server gating. Client: COMMAND_CHAT on the main connection spawns a chat thread that opens an authenticated sub-connection, sends TOKEN_CHAT_START and waits for the server to bind it. Incoming GBK lines are decoded and dispatched to ChatSession, which drives an in-app chat activity; when accessibility is available the activity is pulled to the front, otherwise a tappable notification is posted. Outgoing text is strictly GBK encoded so emoji and unmappable characters are rejected instead of becoming '?'. When the server ends the session the activity closes itself, matching the Windows client's DestroyWindow, and a new session starts from an empty log. Server: a new CLIENT_CAP_REMOTE_CHAT bit lets the server tell new APKs from old ones. ResolveHost now accepts Windows and Android hosts and rejects older APKs up front with -32005 rather than waiting for the command to expire. Tool platform masks, instructions, the docs matrix and mcp/tools.json follow the same change. Verified end to end on the Android 15 emulator: chat_open pops the activity, Chinese text from the server renders, a device reply reaches chat_wait, and ending the session from the master closes the activity instead of leaving a dead window. The committed ghost.apk is stale and must be rebuilt before release. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
f33a205fd9
commit
915c587964
14 files changed
+695
-29
No files matched your search
@@ -115,7 +115,7 @@ GATE = {
|
||||
# win/lnx/mac —— client/、linux/、macos/ 都有该命令的处理分支,且服务端不拦
|
||||
# win/lnx —— 远程控制只实现于 Windows/Linux(McpServer.cpp:2728);
|
||||
# 以及 macOS 客户端有实现但服务端未开放的 exec_command / terminal_* / kill_process
|
||||
# 仅 win —— 服务/注册表/键日志/活动历史/文件写/块输入/host_* /chat_* /power_action
|
||||
# 仅 win —— 服务/注册表/键日志/活动历史/文件写/块输入/host_* /power_action
|
||||
# (power_action 实际走 TOKEN_MACHINE_MANAGE,不是通用电源命令)
|
||||
#
|
||||
# 支持面是产品定位的阶梯:win 100% > lnx 46% > mac 28% ≈ apk 16%。
|
||||
@@ -222,11 +222,11 @@ PLATFORMS = {
|
||||
"host_control_service": _WIN,
|
||||
"host_control_task": _WIN,
|
||||
|
||||
# McpChat 族(COMMAND_TALK 仅 Windows,代码里另有 requireWindows_ 硬校验)
|
||||
"chat_open": _WIN,
|
||||
"chat_send": _WIN,
|
||||
"chat_wait": _WIN,
|
||||
"chat_close": _WIN,
|
||||
# McpChat 族(Windows 一直支持;新版 Android 声明 CLIENT_CAP_REMOTE_CHAT 后也可用)
|
||||
"chat_open": _WINAPK,
|
||||
"chat_send": _WINAPK,
|
||||
"chat_wait": _WINAPK,
|
||||
"chat_close": _WINAPK,
|
||||
}
|
||||
|
||||
# roles: 多主机工具的方向性要求。
|
||||
|
||||
Reference in new issue
Block a user