Skip to content

Commit 5ecf512

Browse files
committed
Document the 2026-06-18 CLI & integrations toolkit
Add a "What's new (2026-06-18)" section to the English and zh-TW/zh-CN READMEs and a v5 new-features reference page (English + Traditional Chinese), registered in both Sphinx toctrees, covering the CLI, codegen, HTTP, SQL, email, PDF, and the file/port waits.
1 parent e8b758d commit 5ecf512

7 files changed

Lines changed: 395 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
## Table of Contents
1515

16+
- [What's new (2026-06-18)](#whats-new-2026-06-18)
1617
- [What's new (2026-06-17)](#whats-new-2026-06-17)
1718
- [What's new (2026-06)](#whats-new-2026-06)
1819
- [What's new (2026-05)](#whats-new-2026-05)
@@ -57,6 +58,35 @@
5758

5859
---
5960

61+
## What's new (2026-06-18)
62+
63+
Eight headless capabilities that round out scripting, integration, and CI
64+
use: a real command-line interface, recording-to-code generation, and
65+
first-class HTTP / SQL / email / PDF / wait steps. Each ships a headless
66+
Python API, an `AC_*` executor command, an MCP tool, and a visual Script
67+
Builder entry, and is covered by headless tests (network / SMTP / PDF
68+
backends are injected, so nothing touches the outside world). Full
69+
reference page:
70+
[`docs/source/Eng/doc/new_features/v5_features_doc.rst`](docs/source/Eng/doc/new_features/v5_features_doc.rst).
71+
72+
**Command-line interface**
73+
- **`je_auto_control` console script** — run and inspect action files from a shell / CI: `run` (with `--var`, `--dry-run`), `validate` (alias `lint`), `list-commands`, `fmt`, `record`, `codegen`, `version`.
74+
75+
**Code generation**
76+
- **Recording → code** — `generate_code` / `generate_code_file` (`AC_generate_code`, `je_auto_control codegen`) turn a recording or action file into a pytest test, standalone Python, or Robot suite. The default `calls` style emits readable `ac.<fn>(...)` statements, falling back to `ac.execute_action([...])` for flow control.
77+
78+
**Integrations**
79+
- **HTTP / API** — `http_request` (`AC_http_request`): method, headers, JSON or raw body, basic / bearer auth, explicit timeout; non-2xx responses are returned (not raised) so you can assert on status. `AC_http_to_var` now shares the client and can POST bodies.
80+
- **SQL** — `query_sqlite` (`AC_sql_to_var` / `AC_assert_db`): read-only, parameter-bound SQLite queries into a variable, or a scalar assertion (e.g. `SELECT COUNT(*) ... == 0`).
81+
- **Email (SMTP)** — `send_email` (`AC_send_email`): stdlib SMTP with TLS on by default (STARTTLS or implicit SSL over a verified context), attachments, and multiple recipients.
82+
- **PDF** — `extract_pdf_text` / `pdf_metadata` / `assert_pdf_text` (`AC_pdf_to_var` / `AC_assert_pdf_text`): text extraction and content assertions, backed by the optional `pypdf` extra (`pip install je_auto_control[pdf]`).
83+
84+
**Smart waits**
85+
- **Wait for a file** — `wait_until_file` (`AC_wait_for_file`) blocks until a file exists and its size stops growing (a download finished writing).
86+
- **Wait for a TCP port** — `wait_until_port` (`AC_wait_for_port`) blocks until `host:port` accepts connections (pairs with `launch_process`).
87+
88+
**Security** — HTTP / SMTP enforce http/https or TLS with verified certificates and explicit timeouts; SQL is read-only and parameter-bound; file paths are resolved before I/O.
89+
6090
## What's new (2026-06-17)
6191

6292
Thirty-plus automation primitives across input realism, vision, flow

‎README/README_zh-CN.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
## 目录
1414

15+
- [本次更新 (2026-06-18)](#本次更新-2026-06-18)
1516
- [本次更新 (2026-06-17)](#本次更新-2026-06-17)
1617
- [本次更新 (2026-06)](#本次更新-2026-06)
1718
- [本次更新 (2026-05)](#本次更新-2026-05)
@@ -56,6 +57,29 @@
5657

5758
---
5859

60+
## 本次更新 (2026-06-18)
61+
62+
八项 headless 能力,补齐脚本化、集成与 CI 场景:真正的命令行界面、把录制转成代码,以及一级的 HTTP / SQL / Email / PDF / 等待步骤。每项都附带 headless API、`AC_*` 执行器指令、MCP 工具与可视化脚本构建器项目,并有 headless 测试(网络 / SMTP / PDF 后端均注入,不接触外部系统)。完整参考页:
63+
[`docs/source/Eng/doc/new_features/v5_features_doc.rst`](../docs/source/Eng/doc/new_features/v5_features_doc.rst)。
64+
65+
**命令行界面**
66+
- **`je_auto_control` console script** — 在 shell/CI 运行与检查动作文件:`run`(含 `--var`、`--dry-run`)、`validate`(别名 `lint`)、`list-commands`、`fmt`、`record`、`codegen`、`version`。
67+
68+
**代码生成**
69+
- **录制 → 代码** — `generate_code` / `generate_code_file`(`AC_generate_code`、`je_auto_control codegen`):把录制或动作文件转成 pytest/独立 Python/Robot 脚本。默认 `calls` 风格生成可读的 `ac.<fn>(...)`,流程控制退回 `ac.execute_action([...])`。
70+
71+
**集成**
72+
- **HTTP / API** — `http_request`(`AC_http_request`):method、headers、JSON/原始 body、basic/bearer 认证、明确超时;非 2xx 返回而非抛异常。`AC_http_to_var` 现共用此客户端,可发送 body。
73+
- **SQL** — `query_sqlite`(`AC_sql_to_var` / `AC_assert_db`):只读、参数绑定的 SQLite 查询,存入变量或做标量断言。
74+
- **Email(SMTP)** — `send_email`(`AC_send_email`):标准库 SMTP,默认 TLS(STARTTLS/SSL、已验证证书),支持附件与多收件人。
75+
- **PDF** — `extract_pdf_text` / `pdf_metadata` / `assert_pdf_text`(`AC_pdf_to_var` / `AC_assert_pdf_text`):文本提取与内容断言,后端为可选 `pypdf`(`pip install je_auto_control[pdf]`)。
76+
77+
**智能等待**
78+
- **等待文件** — `wait_until_file`(`AC_wait_for_file`):等到文件存在且大小停止增长(下载写完)。
79+
- **等待 TCP 端口** — `wait_until_port`(`AC_wait_for_port`):等到 `host:port` 可连接(与 `launch_process` 互补)。
80+
81+
**安全性** — HTTP/SMTP 强制 http/https 或已验证 TLS 与明确超时;SQL 只读且参数绑定;文件路径 I/O 前以 `realpath` 解析。
82+
5983
## 本次更新 (2026-06-17)
6084

6185
新增 30+ 个自动化原语,涵盖输入拟真、视觉、流程控制、触发器、窗口管理与文件安全,

‎README/README_zh-TW.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
## 目錄
1414

15+
- [本次更新 (2026-06-18)](#本次更新-2026-06-18)
1516
- [本次更新 (2026-06-17)](#本次更新-2026-06-17)
1617
- [本次更新 (2026-06)](#本次更新-2026-06)
1718
- [本次更新 (2026-05)](#本次更新-2026-05)
@@ -56,6 +57,29 @@
5657

5758
---
5859

60+
## 本次更新 (2026-06-18)
61+
62+
八項 headless 能力,補齊腳本化、整合與 CI 情境:真正的命令列介面、把錄製轉成程式碼,以及一級的 HTTP / SQL / Email / PDF / 等待步驟。每項都附帶 headless API、`AC_*` 執行器指令、MCP 工具與視覺化腳本建構器項目,並有 headless 測試(網路 / SMTP / PDF 後端皆注入,不碰外部系統)。完整參考頁:
63+
[`docs/source/Zh/doc/new_features/v5_features_doc.rst`](../docs/source/Zh/doc/new_features/v5_features_doc.rst)。
64+
65+
**命令列介面**
66+
- **`je_auto_control` console script** — 在 shell/CI 執行與檢查動作檔:`run`(含 `--var`、`--dry-run`)、`validate`(別名 `lint`)、`list-commands`、`fmt`、`record`、`codegen`、`version`。
67+
68+
**程式碼產生**
69+
- **錄製 → 程式碼** — `generate_code` / `generate_code_file`(`AC_generate_code`、`je_auto_control codegen`):把錄製或動作檔轉成 pytest/獨立 Python/Robot 腳本。預設 `calls` 風格產生可讀的 `ac.<fn>(...)`,流程控制退回 `ac.execute_action([...])`。
70+
71+
**整合**
72+
- **HTTP / API** — `http_request`(`AC_http_request`):method、headers、JSON/原始 body、basic/bearer 認證、明確逾時;非 2xx 回傳而非丟例外。`AC_http_to_var` 現共用此客戶端,可送 body。
73+
- **SQL** — `query_sqlite`(`AC_sql_to_var` / `AC_assert_db`):唯讀、參數綁定的 SQLite 查詢,存入變數或做純量斷言。
74+
- **Email(SMTP)** — `send_email`(`AC_send_email`):標準庫 SMTP,預設 TLS(STARTTLS/SSL、已驗證憑證),支援附件與多收件人。
75+
- **PDF** — `extract_pdf_text` / `pdf_metadata` / `assert_pdf_text`(`AC_pdf_to_var` / `AC_assert_pdf_text`):文字抽取與內容斷言,後端為可選 `pypdf`(`pip install je_auto_control[pdf]`)。
76+
77+
**智慧等待**
78+
- **等待檔案** — `wait_until_file`(`AC_wait_for_file`):等到檔案存在且大小停止增長(下載寫完)。
79+
- **等待 TCP 連接埠** — `wait_until_port`(`AC_wait_for_port`):等到 `host:port` 可連線(與 `launch_process` 互補)。
80+
81+
**安全性** — HTTP/SMTP 強制 http/https 或已驗證 TLS 與明確逾時;SQL 唯讀且參數綁定;檔案路徑 I/O 前以 `realpath` 解析。
82+
5983
## 本次更新 (2026-06-17)
6084

6185
新增 30+ 個自動化原語,涵蓋輸入擬真、視覺、流程控制、觸發器、視窗管理與檔案安全,
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
================================================
2+
New Features (2026-06-18) — CLI & Integrations
3+
================================================
4+
5+
Eight headless capabilities that round out scripting, integration, and
6+
continuous-integration use: a real command-line interface,
7+
recording-to-code generation, and first-class HTTP / SQL / email / PDF /
8+
wait steps. Every feature ships a headless Python API, an ``AC_*``
9+
executor command, an MCP tool, and a visual Script Builder entry, and is
10+
covered by headless tests — the network, SMTP, and PDF backends are
11+
injected, so nothing touches the outside world.
12+
13+
.. contents::
14+
:local:
15+
:depth: 2
16+
17+
18+
Command-line interface
19+
======================
20+
21+
The package now installs a ``je_auto_control`` console script for running
22+
and inspecting action files from a shell or CI pipeline::
23+
24+
je_auto_control run script.json --var user=alice --dry-run
25+
je_auto_control validate script.json # alias: lint
26+
je_auto_control list-commands --filter mouse --json
27+
je_auto_control fmt script.json --check
28+
je_auto_control record out.json --duration 5
29+
je_auto_control codegen script.json --target pytest -o test_flow.py
30+
je_auto_control version
31+
32+
``run`` executes (``--dry-run`` validates and lists steps without acting),
33+
``validate`` / ``lint`` checks structure and rejects unknown commands,
34+
``fmt`` canonicalises the JSON, ``record`` captures input, ``codegen``
35+
emits source (below), and ``list-commands`` prints the live executor
36+
catalogue.
37+
38+
39+
Code generation
40+
===============
41+
42+
Turn a recording or an action file into committable, runnable source::
43+
44+
from je_auto_control import generate_code, generate_code_file
45+
46+
code = generate_code(actions, target="pytest", style="calls")
47+
generate_code_file("flow.json", "test_flow.py", target="pytest")
48+
49+
``target`` is ``pytest`` / ``python`` / ``robot``. The default ``calls``
50+
style maps each ``AC_*`` command to its facade call
51+
(``ac.click_mouse(...)``) and falls back to ``ac.execute_action([...])``
52+
for flow control and private adapters; the ``actions`` style embeds the
53+
list and replays it through the executor.
54+
55+
Executor command: ``AC_generate_code``. CLI: ``je_auto_control codegen``.
56+
57+
58+
HTTP / API
59+
==========
60+
61+
A dependency-free HTTP(S) client for hybrid UI + API flows::
62+
63+
from je_auto_control import http_request
64+
65+
resp = http_request(
66+
"https://api.example/items", method="POST",
67+
json_body={"name": "Sam"},
68+
headers={"X-Trace": "1"},
69+
auth={"type": "bearer", "token": "..."},
70+
timeout=30.0)
71+
assert resp["status"] == 201
72+
73+
Returns ``{status, ok, headers, text, json, url}``; non-2xx responses are
74+
returned rather than raised, so you can assert on the status code. Only
75+
``http`` / ``https`` schemes are allowed. ``AC_http_to_var`` now shares
76+
the same client, so it can POST bodies and send headers / auth.
77+
78+
Executor command: ``AC_http_request``.
79+
80+
81+
SQL
82+
===
83+
84+
Read-only, parameter-bound SQLite queries::
85+
86+
from je_auto_control import query_sqlite
87+
88+
rows = query_sqlite("app.db", "SELECT id, name FROM users")
89+
count = query_sqlite("app.db",
90+
"SELECT COUNT(*) FROM users WHERE active = ?",
91+
params=[1], fetch="scalar")
92+
93+
Queries are restricted to a single read-only ``SELECT`` / ``WITH``
94+
statement, run over a read-only connection, with values always bound as
95+
parameters (never string-interpolated).
96+
97+
Executor commands: ``AC_sql_to_var`` (rows / one row / scalar into a
98+
variable) and ``AC_assert_db`` (a scalar query asserted with
99+
eq / ne / lt / gt / contains / ...).
100+
101+
102+
Email (SMTP)
103+
============
104+
105+
Send mail — for example a flow's report — over the standard library::
106+
107+
from je_auto_control import send_email
108+
109+
send_email(
110+
{"sender": "bot@x.com", "to": ["qa@x.com"],
111+
"subject": "Run passed", "body": "All green",
112+
"attachments": ["report.html"]},
113+
{"host": "smtp.x.com", "port": 587,
114+
"username": "bot@x.com", "password": "..."})
115+
116+
TLS is enabled by default (STARTTLS, or implicit SSL when ``use_ssl`` is
117+
set) over a verified default context; supports multiple recipients, CC,
118+
HTML bodies, and file attachments.
119+
120+
Executor command: ``AC_send_email``.
121+
122+
123+
PDF
124+
===
125+
126+
Extract text from and assert on PDF documents (optional ``pypdf``
127+
backend — ``pip install je_auto_control[pdf]``)::
128+
129+
from je_auto_control import extract_pdf_text, assert_pdf_text
130+
131+
text = extract_pdf_text("invoice.pdf", pages=1)
132+
assert_pdf_text("invoice.pdf", "Total: $50.00")
133+
134+
Executor commands: ``AC_pdf_to_var`` (text into a variable) and
135+
``AC_assert_pdf_text`` (text present / absent, optionally on a page).
136+
137+
138+
Smart waits
139+
===========
140+
141+
Two waits that replace unreliable ``sleep`` calls::
142+
143+
from je_auto_control import wait_until_file, wait_until_port
144+
145+
wait_until_file("~/Downloads/report.pdf", stable_for_s=1.0)
146+
wait_until_port("127.0.0.1", 8080, timeout_s=30.0)
147+
148+
``wait_until_file`` returns once a file exists, is at least ``min_size``
149+
bytes, and its size has held steady for ``stable_for_s`` (a download has
150+
finished). ``wait_until_port`` returns once a TCP connection to
151+
``host:port`` succeeds — the companion to launching a server. Both return
152+
a ``WaitOutcome`` and honour a hard ``timeout_s`` cap.
153+
154+
Executor commands: ``AC_wait_for_file``, ``AC_wait_for_port``.
155+
156+
157+
Security
158+
========
159+
160+
HTTP and SMTP enforce ``http`` / ``https`` or TLS with verified
161+
certificates and explicit timeouts; SQL is read-only and parameter-bound;
162+
all user-supplied file paths are resolved with ``realpath`` before I/O.

‎docs/source/Eng/eng_index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Comprehensive guides for all AutoControl features.
2727
doc/new_features/v2_features_doc
2828
doc/new_features/v3_features_doc
2929
doc/new_features/v4_features_doc
30+
doc/new_features/v5_features_doc
3031
doc/ocr_backends/ocr_backends_doc
3132
doc/observability/observability_doc
3233
doc/operations_layer/operations_layer_doc

0 commit comments

Comments
 (0)