Feat(client): complete the macOS feature set (phase 0 and 1)
Phase 0 makes implementations that already existed reachable. macOS now declares TERMINAL, SCREEN_CLIPBOARD, PROCESS and C2C_RECV_ACK; PROCESS is a new bit and Linux declares it too. SystemManager was dead code -- its constructor took a second argument and it did not derive IOCPManager, so the sub-connection skeleton could never instantiate it -- and now matches the createHandler/OnReceive contract, so COMMAND_SYSTEM really spawns a sub-connection (proc_listpids, SIGKILL). DataProcess always gets a NULL user, so main.mm keeps a g_pMainClient handle and the V2 C2C receiver finally answers TOKEN_C2C_RECV_RESULT. The server asks for SupportsTerminal() on MAC for exec_command / terminal_* and for SupportsProcess() for kill_process, so an old build gets "client is too old" instead of a command nobody answers; kToolPlatforms and mcp/tools.json follow. http_probe stays win/lnx: the terminal works on macOS, but the probe uses GNU-only base64 -w. Phase 1 is POSIX parity. ScreenPreview captures through CGDisplayCreateImage, scales and ships BGRX for the server to encode, and the capability is only declared when preflight or a real capture says the display is readable. ActivityHistory samples the frontmost layer-0 window once a second and prints the same records as Windows and Linux. COMMAND_SCREEN_KEYFRAME_REQ is now consumed by Linux (x264 IDR) and macOS (VideoToolbox force keyframe): the receive thread raises a flag, the capture thread -- which owns the encoder -- consumes it and puts it back if the frame never went out. The macOS quality level persists in NSUserDefaults because main.mm rewrites config.conf. Linux client and Debug x64 server rebuild green; check_platform_table PASS. Not built or run on a Mac. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
c2b59f5d4a
commit
06b93f7bdb
19 files changed
+890
-121
No files matched your search
@@ -118,9 +118,10 @@ GATE = {
|
||||
|
||||
# platforms: 该工具涉及的任一主机都必须落在此集合内。
|
||||
#
|
||||
# 判定依据是**服务端实际放行**,不是客户端有没有实现。两者在 macOS 上会分叉:
|
||||
# exec_command / terminal_* / kill_process 的客户端实现是有的,但服务端刻意拦着
|
||||
# (McpServer.cpp:3652「macOS 本轮不开放」、6870),所以标 win/lnx(终端族另有 apk)。
|
||||
# 判定依据是**服务端实际放行**,不是客户端有没有实现。两者可能在 macOS 上分叉,
|
||||
# 2026-11-14 起不再分叉:exec_command / terminal_* / kill_process 的 macOS 实现接上了
|
||||
# 能力位(CLIENT_CAP_TERMINAL / CLIENT_CAP_PROCESS),服务端按能力位放行——老构建收到
|
||||
# 这些工具仍返回 -32005,但那是「客户端太旧」而不是平台被拦,故平台表标 mac。
|
||||
# Android 同理:COMMAND_SHELL 只有声明 CLIENT_CAP_TERMINAL 的新版 APK 才处理,
|
||||
# 老 APK 由工具内部按能力位返回 -32005。
|
||||
#
|
||||
@@ -128,12 +129,13 @@ GATE = {
|
||||
# 全平台 —— 只读写服务端本地数据,与客户端平台无关
|
||||
# win/lnx/mac —— client/、linux/、macos/ 都有该命令的处理分支,且服务端不拦
|
||||
# win/lnx —— 远程控制只实现于 Windows/Linux(McpServer.cpp:2728);
|
||||
# 以及 macOS 客户端有实现但服务端未开放的 kill_process
|
||||
# 仅 win —— 服务/注册表/键日志/活动历史/文件写/host_* /power_action
|
||||
# 以及 http_probe(macOS 终端可用,但探测命令用了 GNU 专有的 base64 -w)
|
||||
# 仅 win —— 服务/注册表/键日志/文件写/host_* /power_action
|
||||
# (power_action 实际走 TOKEN_MACHINE_MANAGE,不是通用电源命令)
|
||||
#
|
||||
# 支持面是产品定位的阶梯:win 100% > lnx 46% > mac 28% ≈ apk 16%。
|
||||
# Windows 是唯一全量支持的平台,check_platform_table.py 会把这条做成不变式。
|
||||
# 支持面是产品定位的阶梯:win 100% > lnx 46% > apk 16%(mac 2026-11-14 起进入补全阶段,
|
||||
# 已覆盖终端、进程、截屏、活动历史、文件传输)。Windows 是唯一全量支持的平台,
|
||||
# check_platform_table.py 会把这条做成不变式。
|
||||
#
|
||||
# apk 现状:COMMAND_SYSTEM 与 COMMAND_SHELL 在 android/.../main.cpp 明确标注 not
|
||||
# implemented,故除服务端本地类之外,只有少量按需补过分支的能力:运行日志
|
||||
@@ -170,19 +172,22 @@ PLATFORMS = {
|
||||
# 实测 Linux 直接超时 -32001。别被 SystemManager 里的 case 骗到,那是 SystemDlg 用的。
|
||||
"list_windows": _WIN,
|
||||
|
||||
# macOS 客户端有 PTY 实现(macos/main.mm:753 起 ShellworkingThread),但服务端
|
||||
# 本轮刻意不开放(McpServer.cpp:3652 注释「macOS 本轮不开放」),故实际不可用。
|
||||
# Android 新版复用 common/PTYHandler.h,声明 CLIENT_CAP_TERMINAL 后服务端才放行。
|
||||
"terminal_open": _WLA,
|
||||
"terminal_exec": _WLA,
|
||||
"terminal_close": _WLA,
|
||||
"exec_command": _WLA,
|
||||
# macOS 客户端一直是完整 PTY(macos/main.mm 的 ShellworkingThread),2026-11-14 起
|
||||
# 声明 CLIENT_CAP_TERMINAL,服务端按能力位放行(老构建仍返回 -32005)。
|
||||
# Android 新版复用 common/PTYHandler.h,同样声明 CLIENT_CAP_TERMINAL 后服务端才放行。
|
||||
"terminal_open": _APK,
|
||||
"terminal_exec": _APK,
|
||||
"terminal_close": _APK,
|
||||
"exec_command": _APK,
|
||||
|
||||
# http_probe 走终端通道:macOS 终端未开放;Android 的 toybox 不保证有 curl/base64
|
||||
# http_probe 走终端通道:macOS 终端已开放,但 POSIX 探测命令用了 GNU 专有的
|
||||
# `base64 -w`(BSD base64 没有该开关),换成两平台通用写法前仍只标 win/lnx;
|
||||
# Android 的 toybox 不保证有 curl/base64
|
||||
"http_probe": _WL,
|
||||
|
||||
# macOS 客户端有 COMMAND_KILLPROCESS 分支,但服务端同样拦着(McpServer.cpp:6870)
|
||||
"kill_process": _WL,
|
||||
# macOS 客户端有 COMMAND_KILLPROCESS(SystemManager,SIGKILL),2026-11-14 起
|
||||
# 声明 CLIENT_CAP_PROCESS 后服务端放行;老构建按能力位提前拒绝。
|
||||
"kill_process": _TRIO,
|
||||
|
||||
# 需要 CLIENT_CAP_V2;三个桌面平台的 DefaultCaps() 都含 V2
|
||||
"download_file": _TRIO,
|
||||
@@ -200,15 +205,16 @@ PLATFORMS = {
|
||||
"remote_lock_screen": _APKONLY,
|
||||
|
||||
# 需要 CLIENT_CAP_SCREEN_PREVIEW:Windows 恒有,Linux 仅在探测到 X11 桌面时声明,
|
||||
# macOS 仅在登录时已授予录屏权限时声明(CGDisplayCreateImage → BGRX),
|
||||
# Android 仅在无障碍服务在跑时声明(takeScreenshot,只支持 mode=screen)
|
||||
"get_screenshot": _WLA,
|
||||
"get_screenshot": _APK,
|
||||
|
||||
# ---- 仅 Windows ----
|
||||
"list_services": _WIN,
|
||||
"control_service": _WIN,
|
||||
"list_registry": _WIN,
|
||||
"get_keylog": _WIN,
|
||||
"get_activity_history": _WLA, # Windows 前台窗口;Linux 桌面/无桌面均有实现(linux/main.cpp);APK 复用同一采样机
|
||||
"get_activity_history": _APK, # Windows 前台窗口;Linux 桌面/无桌面均有实现(linux/main.cpp);macOS 用 CGWindowList 采前台窗口(macos/ActivityHistory.mm);APK 复用同一采样机
|
||||
"get_foreground_window": _WIN, # 窗口信息 RPC:CLIENT_CAP_WINDOW_INFO,仅 Windows 客户端声明
|
||||
"search_file": _WIN,
|
||||
"delete_path": _WIN,
|
||||
|
||||
Reference in new issue
Block a user