Feature: Add window/region capture targets to remote_open

Pass the target HWND through the COMMAND_SCREEN_SPY token and send
COMMAND_SCREEN_ROI after session start, so MCP remote control can stream
just the target window or region instead of the scaled virtual desktop.
The session records the target kind, remote_mouse refuses a redundant
window_hwnd basis, and the cached resolution is refreshed per action so
resized windows keep mapping correctly. Cold starts now clear the stale
resolution cache used by the region handshake.
This commit is contained in:
yuanyuanxiang committed 2026-11-10 19:13:45 +01:00
1 parent 5501889d33
commit cdd9c56b3d
7 files changed
+445 -39

No files matched your search

+1
View File
@@ -513,6 +513,7 @@ P10-C(`3d388f8`)加工具时索性去掉数字——避免每加一个工具
| ~~`search_file` 的描述仍写着「会栈溢出」~~ | — | **已完成**(P10-A,`bb55f52`):描述改为「超过 260 字节的路径会被静默跳过(既不记录也不继续向下递归)」,`tools/mcp_smoke.ps1` 的两处注释改为「MAX_PATH 的条目会被客户端静默跳过(8f718d9 起不再栈溢出)」 |
| ~~`get_screenshot` 无区域裁剪~~ | — | **已完成**(2026-11-10):新增 `mode=region/window/monitor`,默认原生分辨率并返回 `capture` 源矩形元数据;见 `Mcp_Design.md §21` |
| ~~窗口截图坐标要手工换算成屏幕坐标~~ | — | **已完成**(2026-11-10):`remote_mouse` 新增 `window_hwnd` 基准,窗口信息响应追加虚拟桌面矩形尾块;见 `Mcp_Design.md §22` |
| ~~远程控制只能推整虚拟桌面(缩到 1920 宽,点击精度损失)~~ | — | **已完成**(2026-11-10):`remote_open` 新增 `window_hwnd` / `region` 目标,只推目标窗口或 ROI;返回 `target` 与实际矩形,`remote_mouse` 坐标相对目标帧;见 `Mcp_Design.md §23` |
| ~~`terminal_exec` 不能用管道~~ | — | **已完成**(2026-11-10):PTY 会话放开 `\|` / `&&` / `\|\|`(POSIX 还允许 `;`),仅老非 PTY 客户端与 POSIX 裸后台 `&` 仍拒绝;见 `Mcp_Design.md §12.1` |
| 审计不含调用参数 | `Mcp_Design.md §10.8` | 有意设计(防泄漏),维持 |
| `chat_wait` 会取走 inbox | `McpInternal.cpp:431` | 已正确标注非幂等,无需改 |