Skip to content

Commit 1c9e0da

Browse files
authored
Merge pull request #198 from Integration-Automation/dev
PII redaction + Android uiautomator2 widget tree + iOS XCUITest + AC_run_agent
2 parents 2943886 + 0a0a636 commit 1c9e0da

27 files changed

Lines changed: 2410 additions & 20 deletions

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@
5757

5858
## What's new (2026-05)
5959

60-
Twenty-three additions covering smarter locators, deeper IDE / ops
61-
tooling, two new platforms, and fresh integrations. Each ships with a
62-
headless API, an `AC_*` executor command, an `ac_*` MCP tool, and
63-
(where it makes sense) a Qt GUI tab. Full reference page:
60+
Twenty-seven additions covering smarter locators, deeper IDE / ops
61+
tooling, four new platforms (Wayland, Wayland-libei, Android
62+
widget-tree, iOS), screenshot PII redaction, and a generic
63+
plan-execute-verify agent loop. Each ships with a headless API, an
64+
`AC_*` executor command, an `ac_*` MCP tool, and (where it makes
65+
sense) a Qt GUI tab. Full reference page:
6466
[`docs/source/Eng/doc/new_features/v2_features_doc.rst`](docs/source/Eng/doc/new_features/v2_features_doc.rst).
6567

6668
**Locator + selector intelligence**
@@ -80,13 +82,20 @@ headless API, an `AC_*` executor command, an `ac_*` MCP tool, and
8082

8183
**Agent + integrations**
8284
- **Computer-use high-level API**`run_computer_use(goal, ...)` wraps `ComputerUseAgentBackend` + `AgentLoop`; auto-detects display size; bounded by `max_steps` / `wall_seconds`.
85+
- **Generic agent loop JSON + MCP**`AC_run_agent` / `ac_run_agent` expose the closed-loop `AgentLoop` (plan → act → verify → retry) with pluggable Anthropic / OpenAI backends; the Anthropic-only Computer-Use raw path remains via `AC_computer_use`.
8386
- **WebRunner convenience commands**`web_open` / `web_quit` / `web_screenshot` / `web_current_url` on top of the existing `je_web_runner` bridge; same surface exposed as `AC_web_*` and `ac_web_*`.
8487
- **Chat-ops bot** — transport-agnostic `CommandRouter` + polling Slack adapter. Built-in commands: `/help`, `/scripts`, `/run`, `/screenshot`, `/status`. RBAC via `required_role`.
8588

89+
**Privacy + safety**
90+
- **Screenshot PII redaction**`RedactionEngine` with built-in detectors for email / credit card / SSN / phone (regex against caller-supplied OCR tokens) plus accessibility-tree secure-text-field detection. Forced regions for sticky overlays. Env-var-driven default policy `JE_AUTOCONTROL_REDACTION=off|moderate|strict`. Wired through `AC_redact_screenshot` + `ac_redact_screenshot`.
91+
8692
**Platform coverage**
8793
- **Wayland CLI backend**`wtype` / `ydotool` / `grim` with `XDG_SESSION_TYPE` auto-detect and X11 (XWayland) fallback; override via `JE_AUTOCONTROL_LINUX_DISPLAY_SERVER=x11|wayland|auto`.
8894
- **Wayland libei native** — ctypes binding to `libei.so.*` for microsecond-latency input; opt-in via `JE_AUTOCONTROL_WAYLAND_INPUT_BACKEND=libei|cli|auto`. Defaults to libei when loadable.
8995
- **macOS Accessibility deep-dive** — recursive `dump_accessibility_tree()` plus a polling `AccessibilityRecorder` for focus / bounds events.
96+
- **Android — adb shell primitives**`AC_android_tap/swipe/key/text/screenshot` route through `adb` for any phone over USB / Wi-Fi adb. No daemon required.
97+
- **Android — uiautomator2 widget tree**`AC_android_find_element/click_element/dump_hierarchy` add selector-based widget lookup (`text` / `resource_id` / `description` / `class_name`) and live XML hierarchy dump on top of the adb path.
98+
- **iOS — XCUITest via WebDriverAgent** — new `je_auto_control.ios.*` namespace: `tap`, `swipe`, `long_press`, `type_text`, `press_key`, `screenshot`, `screen_size`, `find_element` / `click_element` (XCUITest selectors: `name`, `class_name`, `predicate`), `dump_source`. Seven new `AC_ios_*` executor commands and matching `ac_ios_*` MCP tools. `facebook-wda` is an optional pip dep; loads lazily so non-Mac hosts still import the package.
9099

91100
**Developer experience**
92101
- **autocontrol-lsp completion** — the language server now tracks `didOpen` / `didChange` / `didClose`, publishes diagnostics for invalid JSON and unknown `AC_*` commands, and provides signature help generated from the live executor table.
@@ -129,7 +138,8 @@ headless API, an `AC_*` executor command, an `ac_*` MCP tool, and
129138
- **Window Management** — send keyboard/mouse events directly to specific windows (Windows/Linux)
130139
- **GUI Application** — built-in PySide6 graphical interface with live language switching (English / 繁體中文 / 简体中文 / 日本語)
131140
- **CLI Runner**`python -m je_auto_control.cli run|list-jobs|start-server|start-rest`
132-
- **Cross-Platform** — unified API across Windows, macOS, and Linux (X11)
141+
- **Cross-Platform** — unified API across Windows, macOS, Linux (X11 + Wayland), Android (adb + uiautomator2), and iOS (WebDriverAgent / facebook-wda)
142+
- **Screenshot PII redaction**`RedactionEngine` blurs emails / credit cards / SSNs / phones / secure-text fields / forced regions before screenshots leave the host (VLM upload, audit log, REST). Policy via env var `JE_AUTOCONTROL_REDACTION=off|moderate|strict` or per-call
133143
- **Multi-Host Admin Console** — register N AutoControl REST endpoints in one address book, poll them in parallel for health/sessions/jobs, broadcast actions to all of them. Persisted to `~/.je_auto_control/admin_hosts.json` (mode 0600 on POSIX). Bad-token hosts surface as unhealthy with the actual HTTP error
134144
- **Tamper-Evident Audit Log** — SQLite events table with SHA-256 hash chain (`prev_hash` + `row_hash` per row); editing any past row breaks the chain. `verify_chain()` walks rows top-down and reports the first broken link. Legacy tables get backfilled at startup ("trust on first use")
135145
- **WebRTC Packet Inspector** — process-global rolling window of `StatsSnapshot` samples (default 600 / ~10 min @ 1Hz) fed by the existing WebRTC stats pollers. Per-metric `last/min/max/avg/p95` for RTT, FPS, bitrate, packet loss, jitter

README/README_zh-CN.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@
5656

5757
## 本次更新 (2026-05)
5858

59-
新增 23 个功能,覆盖更聪明的定位器、更深的 IDE / 运维工具、两个新平台后端,
60-
以及几个新集成。每个功能都遵循框架既有模式:headless Python API、
61-
`AC_*` executor 命令、`ac_*` MCP 工具,以及(适用时)Qt GUI 选项卡。
62-
完整参考页面:
59+
新增 27 个功能,覆盖更聪明的定位器、更深的 IDE / 运维工具、
60+
四个新平台后端(Wayland、Wayland-libei、Android widget tree、iOS)、
61+
截屏 PII 脱敏,以及通用 plan-execute-verify agent 循环。
62+
每个功能都遵循框架既有模式:headless Python API、`AC_*` executor 命令、
63+
`ac_*` MCP 工具,以及(适用时)Qt GUI 选项卡。完整参考页面:
6364
[`docs/source/Zh/doc/new_features/v2_features_doc.rst`](../docs/source/Zh/doc/new_features/v2_features_doc.rst)
6465

6566
**定位器与选择器智能化**
@@ -79,13 +80,20 @@
7980

8081
**代理与集成**
8182
- **Computer-use 高阶 API**`run_computer_use(goal, ...)` 封装 `ComputerUseAgentBackend` + `AgentLoop`;自动检测屏幕大小;以 `max_steps` / `wall_seconds` 为预算。
83+
- **通用 agent 循环 JSON / MCP 接入**`AC_run_agent` / `ac_run_agent` 把闭环 `AgentLoop`(规划 → 执行 → 验证 → 重试)开放给 JSON action 和 MCP 客户端,支持 Anthropic / OpenAI 两种 backend;既有的 Anthropic 原生 Computer-Use 路径仍通过 `AC_computer_use` 提供。
8284
- **WebRunner 便利命令** — 在既有 `je_web_runner` 桥接之上的 `web_open` / `web_quit` / `web_screenshot` / `web_current_url`;同步以 `AC_web_*``ac_web_*` 暴露。
8385
- **Chat-ops 机器人** — 传输层中立的 `CommandRouter` + Slack polling adapter。内置命令:`/help``/scripts``/run``/screenshot``/status`。RBAC 通过 `required_role`
8486

87+
**隐私与安全**
88+
- **截屏 PII 脱敏**`RedactionEngine` 内置检测:email / 信用卡 / SSN / 电话(regex 比对调用方提供的 OCR token)以及 accessibility tree 标记的 secure-text 字段;可指定强制模糊区域。默认策略通过环境变量 `JE_AUTOCONTROL_REDACTION=off|moderate|strict` 控制。执行器命令 `AC_redact_screenshot` 与 MCP `ac_redact_screenshot` 都已接入。
89+
8590
**平台覆盖**
8691
- **Wayland CLI 后端**`wtype` / `ydotool` / `grim`,按 `XDG_SESSION_TYPE` 自动检测,CLI 工具未装时回退到 X11 (XWayland);可用 `JE_AUTOCONTROL_LINUX_DISPLAY_SERVER=x11|wayland|auto` 覆盖。
8792
- **Wayland libei 原生后端** — 对 `libei.so.*` 的 ctypes 绑定,绕过 CLI shim 取得微秒级延迟;以 `JE_AUTOCONTROL_WAYLAND_INPUT_BACKEND=libei|cli|auto` 启用,默认在 libei 可加载时用 libei。
8893
- **macOS Accessibility 强化** — 递归 `dump_accessibility_tree()` 与 polling `AccessibilityRecorder`,捕捉 focus / bounds 事件。
94+
- **Android — adb shell 原语**`AC_android_tap/swipe/key/text/screenshot` 直接通过 `adb` 驱动任何 USB / Wi-Fi adb 连接的手机,不需要常驻 daemon。
95+
- **Android — uiautomator2 widget tree**`AC_android_find_element/click_element/dump_hierarchy` 在 adb 路径之上加上 selector(`text` / `resource_id` / `description` / `class_name`)查找与实时 XML hierarchy dump。
96+
- **iOS — WebDriverAgent / XCUITest** — 新的 `je_auto_control.ios.*` 命名空间:`tap``swipe``long_press``type_text``press_key``screenshot``screen_size``find_element` / `click_element`(XCUITest selector:`name``class_name``predicate`)、`dump_source`。新增七个 `AC_ios_*` executor 命令与对应 `ac_ios_*` MCP 工具。`facebook-wda` 为可选 pip 依赖、懒加载,非 macOS 主机 import 仍可成功。
8997

9098
**开发者体验**
9199
- **autocontrol-lsp 完整化** — 追踪 `didOpen` / `didChange` / `didClose`、发布 JSON 与未知 `AC_*` 命令的 diagnostics、由即时的 executor 表生成 signature help。
@@ -128,7 +136,8 @@
128136
- **窗口管理** — 直接将键盘/鼠标事件发送至指定窗口(Windows/Linux)
129137
- **GUI 应用程序** — 内置 PySide6 图形界面,支持即时切换语言(English / 繁體中文 / 简体中文 / 日本語)
130138
- **CLI 运行器**`python -m je_auto_control.cli run|list-jobs|start-server|start-rest`
131-
- **跨平台** — 统一 API,支持 Windows、macOS、Linux(X11)
139+
- **跨平台** — 统一 API,支持 Windows、macOS、Linux(X11 + Wayland)、Android(adb + uiautomator2)、iOS(WebDriverAgent / facebook-wda)
140+
- **截屏 PII 脱敏**`RedactionEngine` 在截屏上传 VLM、写入 audit log 或通过 REST 返回前,把 email / 信用卡号 / SSN / 电话 / secure-text 字段 / 强制区域模糊掉。通过环境变量 `JE_AUTOCONTROL_REDACTION=off|moderate|strict` 或逐次调用指定策略
132141
- **多主机管理控制台** — 在一份通讯录中注册 N 个远程 AutoControl REST 端点,并行轮询 health/sessions/jobs,把同一份动作清单广播给全部主机。储存于 `~/.je_auto_control/admin_hosts.json`(POSIX 上模式 0600)。Token 错误的主机会以实际 HTTP 错误显示为不健康
133142
- **可检测篡改的审计日志** — SQLite events 表加上 SHA-256 哈希链(每条记录含 `prev_hash` + `row_hash`);修改任何过去记录都会打断哈希链。`verify_chain()` 自顶向下走访并报告第一个断点。既有数据表会在启动时回填("初次使用即信任")
134143
- **WebRTC 包监测** — 由既有 WebRTC stats 轮询喂入的进程级 `StatsSnapshot` 滚动窗口(默认 600 条 / 1 Hz 约 10 分钟)。对 RTT、FPS、bitrate、丢包率、jitter 各回 `last/min/max/avg/p95`

README/README_zh-TW.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@
5656

5757
## 本次更新 (2026-05)
5858

59-
新增 23 個功能,涵蓋更聰明的定位器、更深的 IDE / 維運工具、兩個新平台後端,
60-
以及幾個新整合。每個功能都遵循框架既有模式:headless Python API、
61-
`AC_*` executor 命令、`ac_*` MCP 工具,以及(適用時)Qt GUI 分頁。
62-
完整參考頁面:
59+
新增 27 個功能,涵蓋更聰明的定位器、更深的 IDE / 維運工具、
60+
四個新平台後端(Wayland、Wayland-libei、Android widget tree、iOS)、
61+
螢幕截圖 PII 遮罩,以及通用的 plan-execute-verify agent 迴圈。
62+
每個功能都遵循框架既有模式:headless Python API、`AC_*` executor 命令、
63+
`ac_*` MCP 工具,以及(適用時)Qt GUI 分頁。完整參考頁面:
6364
[`docs/source/Zh/doc/new_features/v2_features_doc.rst`](../docs/source/Zh/doc/new_features/v2_features_doc.rst)
6465

6566
**定位器與選擇器智慧化**
@@ -79,13 +80,20 @@
7980

8081
**代理與整合**
8182
- **Computer-use 高階 API**`run_computer_use(goal, ...)` 封裝 `ComputerUseAgentBackend` + `AgentLoop`;自動偵測螢幕大小;以 `max_steps` / `wall_seconds` 為預算。
83+
- **通用 agent 迴圈 JSON / MCP 接點**`AC_run_agent` / `ac_run_agent` 把閉環 `AgentLoop`(規劃 → 執行 → 驗證 → 重試)開放給 JSON action 與 MCP 客戶端,支援 Anthropic / OpenAI 兩種 backend;既有的 Anthropic 原生 Computer-Use 路徑仍透過 `AC_computer_use` 提供。
8284
- **WebRunner 便利命令** — 在既有 `je_web_runner` 橋接之上的 `web_open` / `web_quit` / `web_screenshot` / `web_current_url`;同步以 `AC_web_*``ac_web_*` 暴露。
8385
- **Chat-ops 機器人** — 傳輸層中立的 `CommandRouter` + Slack polling adapter。內建命令:`/help``/scripts``/run``/screenshot``/status`。RBAC 透過 `required_role`
8486

87+
**隱私與安全**
88+
- **截圖 PII 遮罩**`RedactionEngine` 內建偵測:email / credit card / SSN / 電話(regex 比對呼叫端提供的 OCR token)以及 accessibility tree 標記的 secure-text 欄位;可指定強制模糊區域。預設政策透過環境變數 `JE_AUTOCONTROL_REDACTION=off|moderate|strict` 控制。執行器命令 `AC_redact_screenshot` 與 MCP `ac_redact_screenshot` 都已串接。
89+
8590
**平台覆蓋**
8691
- **Wayland CLI 後端**`wtype` / `ydotool` / `grim`,依 `XDG_SESSION_TYPE` 自動偵測,CLI 工具未裝時回退到 X11 (XWayland);可用 `JE_AUTOCONTROL_LINUX_DISPLAY_SERVER=x11|wayland|auto` 覆寫。
8792
- **Wayland libei 原生後端** — 對 `libei.so.*` 的 ctypes 綁定,繞過 CLI shim 取得微秒級延遲;以 `JE_AUTOCONTROL_WAYLAND_INPUT_BACKEND=libei|cli|auto` 啟用,預設在 libei 可載入時用 libei。
8893
- **macOS Accessibility 強化** — 遞迴 `dump_accessibility_tree()` 與 polling `AccessibilityRecorder`,捕捉 focus / bounds 事件。
94+
- **Android — adb shell 原語**`AC_android_tap/swipe/key/text/screenshot` 直接透過 `adb` 驅動任何 USB / Wi-Fi adb 連線的手機,不需要常駐 daemon。
95+
- **Android — uiautomator2 widget tree**`AC_android_find_element/click_element/dump_hierarchy` 在 adb 路徑之上加上 selector(`text` / `resource_id` / `description` / `class_name`)查找與即時 XML hierarchy dump。
96+
- **iOS — WebDriverAgent / XCUITest** — 新的 `je_auto_control.ios.*` 命名空間:`tap``swipe``long_press``type_text``press_key``screenshot``screen_size``find_element` / `click_element`(XCUITest selector:`name``class_name``predicate`)、`dump_source`。新增七個 `AC_ios_*` executor 命令與對應 `ac_ios_*` MCP 工具。`facebook-wda` 為可選 pip 相依、懶載入,非 macOS 主機 import 仍可成功。
8997

9098
**開發者體驗**
9199
- **autocontrol-lsp 完整化** — 追蹤 `didOpen` / `didChange` / `didClose`、發佈 JSON 與未知 `AC_*` 命令的 diagnostics、由即時的 executor 表產生 signature help。
@@ -128,7 +136,8 @@
128136
- **視窗管理** — 直接將鍵盤/滑鼠事件送至指定視窗(Windows/Linux)
129137
- **GUI 應用程式** — 內建 PySide6 圖形介面,支援即時切換語系(English / 繁體中文 / 简体中文 / 日本語)
130138
- **CLI 執行介面**`python -m je_auto_control.cli run|list-jobs|start-server|start-rest`
131-
- **跨平台** — 統一 API,支援 Windows、macOS、Linux(X11)
139+
- **跨平台** — 統一 API,支援 Windows、macOS、Linux(X11 + Wayland)、Android(adb + uiautomator2)、iOS(WebDriverAgent / facebook-wda)
140+
- **截圖 PII 遮罩**`RedactionEngine` 在截圖上傳 VLM、寫入 audit log 或經由 REST 回傳前,把 email / 信用卡號 / SSN / 電話 / secure-text 欄位 / 強制區域模糊掉。透過環境變數 `JE_AUTOCONTROL_REDACTION=off|moderate|strict` 或逐次呼叫指定政策
132141
- **多主機管理主控台** — 在一份通訊錄中註冊 N 個遠端 AutoControl REST 端點,並行輪詢 health/sessions/jobs,把同一份動作清單廣播給全部主機。儲存於 `~/.je_auto_control/admin_hosts.json`(POSIX 上模式 0600)。Token 錯誤的主機會以實際 HTTP 錯誤呈現為不健康
133142
- **可偵測竄改的稽核紀錄** — SQLite events 表加上 SHA-256 雜湊鏈(每筆紀錄含 `prev_hash` + `row_hash`);修改任何過去紀錄都會打斷雜湊鏈。`verify_chain()` 由上往下走訪並回報第一個斷點。既有資料表會在啟動時回填(「初次使用即信任」)
134143
- **WebRTC 封包監測** — 由既有 WebRTC stats 輪詢餵入的程序級 `StatsSnapshot` 滾動視窗(預設 600 筆 / 1 Hz 約 10 分鐘)。對 RTT、FPS、bitrate、封包遺失、jitter 各回 `last/min/max/avg/p95`

0 commit comments

Comments
 (0)