Skip to content

Commit edcbf31

Browse files
authored
Merge pull request #234 from Integration-Automation/feat/devex-batch
Add CI workflow annotations and clipboard history
2 parents 70b73fc + 9c281d6 commit edcbf31

17 files changed

Lines changed: 559 additions & 0 deletions

File tree

README.md

Lines changed: 8 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-19) — CI Annotations & Clipboard History](#whats-new-2026-06-19--ci-annotations--clipboard-history)
1617
- [What's new (2026-06-19) — Resilience Primitives](#whats-new-2026-06-19--resilience-primitives)
1718
- [What's new (2026-06-19) — Timed Input Macros](#whats-new-2026-06-19--timed-input-macros)
1819
- [What's new (2026-06-19) — Semantic Screen State](#whats-new-2026-06-19--semantic-screen-state)
@@ -78,6 +79,13 @@
7879

7980
---
8081

82+
## What's new (2026-06-19) — CI Annotations & Clipboard History
83+
84+
Two pure-stdlib utilities. Full reference: [`docs/source/Eng/doc/new_features/v26_features_doc.rst`](docs/source/Eng/doc/new_features/v26_features_doc.rst).
85+
86+
- **CI annotations**`emit_annotations(results)` (`AC_ci_annotations`, `ac_ci_annotations`): turn result dicts into GitHub Actions workflow commands (`::error file=...,line=...::msg`) so failures show inline in a PR, no reporter action needed.
87+
- **Clipboard history**`ClipboardHistory` / `default_clipboard_history` (`AC_clip_history_capture`/`list`/`search`/`start`/`stop`, `ac_clip_history_*`): a capped, searchable, newest-first ring buffer of copied text with an optional background poller.
88+
8189
## What's new (2026-06-19) — Resilience Primitives
8290

8391
Reusable retry + circuit-breaker primitives. Full reference: [`docs/source/Eng/doc/new_features/v25_features_doc.rst`](docs/source/Eng/doc/new_features/v25_features_doc.rst).

README/README_zh-CN.md

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

1313
## 目录
1414

15+
- [本次更新 (2026-06-19) — CI 注解与剪贴板历史](#本次更新-2026-06-19--ci-注解与剪贴板历史)
1516
- [本次更新 (2026-06-19) — 韧性原语](#本次更新-2026-06-19--韧性原语)
1617
- [本次更新 (2026-06-19) — 计时输入宏](#本次更新-2026-06-19--计时输入宏)
1718
- [本次更新 (2026-06-19) — 语义屏幕状态](#本次更新-2026-06-19--语义屏幕状态)
@@ -77,6 +78,13 @@
7778

7879
---
7980

81+
## 本次更新 (2026-06-19) — CI 注解与剪贴板历史
82+
83+
两项纯标准库工具。完整参考:[`docs/source/Zh/doc/new_features/v26_features_doc.rst`](../docs/source/Zh/doc/new_features/v26_features_doc.rst)
84+
85+
- **CI 注解**`emit_annotations(results)`(`AC_ci_annotations``ac_ci_annotations`):把结果 dict 转成 GitHub Actions 工作流命令(`::error file=...,line=...::msg`),让失败在 PR 行内显示,免 reporter action。
86+
- **剪贴板历史**`ClipboardHistory` / `default_clipboard_history`(`AC_clip_history_capture`/`list`/`search`/`start`/`stop``ac_clip_history_*`):有上限、可搜索、最新在前的复制文本环形缓冲,含可选后台轮询器。
87+
8088
## 本次更新 (2026-06-19) — 韧性原语
8189

8290
可重用的 retry 与断路器原语。完整参考:[`docs/source/Zh/doc/new_features/v25_features_doc.rst`](../docs/source/Zh/doc/new_features/v25_features_doc.rst)

README/README_zh-TW.md

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

1313
## 目錄
1414

15+
- [本次更新 (2026-06-19) — CI 註解與剪貼簿歷史](#本次更新-2026-06-19--ci-註解與剪貼簿歷史)
1516
- [本次更新 (2026-06-19) — 韌性原語](#本次更新-2026-06-19--韌性原語)
1617
- [本次更新 (2026-06-19) — 計時輸入巨集](#本次更新-2026-06-19--計時輸入巨集)
1718
- [本次更新 (2026-06-19) — 語意螢幕狀態](#本次更新-2026-06-19--語意螢幕狀態)
@@ -77,6 +78,13 @@
7778

7879
---
7980

81+
## 本次更新 (2026-06-19) — CI 註解與剪貼簿歷史
82+
83+
兩項純標準庫工具。完整參考:[`docs/source/Zh/doc/new_features/v26_features_doc.rst`](../docs/source/Zh/doc/new_features/v26_features_doc.rst)
84+
85+
- **CI 註解**`emit_annotations(results)`(`AC_ci_annotations``ac_ci_annotations`):把結果 dict 轉成 GitHub Actions 工作流程命令(`::error file=...,line=...::msg`),讓失敗在 PR 行內顯示,免 reporter action。
86+
- **剪貼簿歷史**`ClipboardHistory` / `default_clipboard_history`(`AC_clip_history_capture`/`list`/`search`/`start`/`stop``ac_clip_history_*`):有上限、可搜尋、最新在前的複製文字環狀緩衝,含可選背景輪詢器。
87+
8088
## 本次更新 (2026-06-19) — 韌性原語
8189

8290
可重用的 retry 與斷路器原語。完整參考:[`docs/source/Zh/doc/new_features/v25_features_doc.rst`](../docs/source/Zh/doc/new_features/v25_features_doc.rst)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
==================================================
2+
New Features (2026-06-19) — CI Annotations & Clipboard History
3+
==================================================
4+
5+
Two pure-standard-library utilities: emit CI annotations from results, and
6+
keep a searchable clipboard history. Full stack.
7+
8+
.. contents::
9+
:local:
10+
:depth: 2
11+
12+
13+
CI workflow annotations
14+
======================
15+
16+
::
17+
18+
from je_auto_control import emit_annotations
19+
20+
emit_annotations([
21+
{"level": "error", "message": "step failed",
22+
"file": "flows/login.json", "line": 12, "title": "Login"},
23+
])
24+
# prints: ::error file=flows/login.json,line=12,title=Login::step failed
25+
26+
Converts result dicts (``{level, message, file?, line?, col?, title?}``)
27+
into GitHub Actions workflow commands so failures surface **inline** in a PR
28+
— no third-party reporter action required. ``level`` is ``error`` /
29+
``warning`` / ``notice``; values are escaped per GitHub's rules. Exposed as
30+
``AC_ci_annotations`` / ``ac_ci_annotations``.
31+
32+
33+
Clipboard history
34+
================
35+
36+
::
37+
38+
from je_auto_control import ClipboardHistory, default_clipboard_history
39+
40+
default_clipboard_history.start() # poll the clipboard in the background
41+
default_clipboard_history.search("invoice")
42+
default_clipboard_history.get(0) # most recent entry
43+
44+
A capped, newest-first ring buffer of distinct clipboard text entries with
45+
``add`` / ``snapshot`` / ``get`` / ``search`` / ``clear`` and an optional
46+
background poller (``start`` / ``stop`` / ``capture_once``). Exposed as
47+
``AC_clip_history_capture`` / ``AC_clip_history_list`` /
48+
``AC_clip_history_search`` / ``AC_clip_history_start`` /
49+
``AC_clip_history_stop`` (and ``ac_clip_history_*``).

docs/source/Eng/eng_index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Comprehensive guides for all AutoControl features.
4848
doc/new_features/v23_features_doc
4949
doc/new_features/v24_features_doc
5050
doc/new_features/v25_features_doc
51+
doc/new_features/v26_features_doc
5152
doc/ocr_backends/ocr_backends_doc
5253
doc/observability/observability_doc
5354
doc/operations_layer/operations_layer_doc
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
==================================================
2+
新功能 (2026-06-19) — CI 註解與剪貼簿歷史
3+
==================================================
4+
5+
兩項純標準庫工具:從結果輸出 CI 註解,以及保存可搜尋的剪貼簿歷史。
6+
走完整五層。
7+
8+
.. contents::
9+
:local:
10+
:depth: 2
11+
12+
13+
CI 工作流程註解
14+
===============
15+
16+
::
17+
18+
from je_auto_control import emit_annotations
19+
20+
emit_annotations([
21+
{"level": "error", "message": "step failed",
22+
"file": "flows/login.json", "line": 12, "title": "Login"},
23+
])
24+
# 印出:::error file=flows/login.json,line=12,title=Login::step failed
25+
26+
把結果 dict(``{level, message, file?, line?, col?, title?}``)轉成 GitHub
27+
Actions 工作流程命令,讓失敗在 PR 中**行內**顯示——不需第三方 reporter
28+
action。``level`` 為 ``error`` / ``warning`` / ``notice``;值會依 GitHub
29+
規則轉義。對應 ``AC_ci_annotations`` / ``ac_ci_annotations``。
30+
31+
32+
剪貼簿歷史
33+
==========
34+
35+
::
36+
37+
from je_auto_control import ClipboardHistory, default_clipboard_history
38+
39+
default_clipboard_history.start() # 背景輪詢剪貼簿
40+
default_clipboard_history.search("invoice")
41+
default_clipboard_history.get(0) # 最近一筆
42+
43+
一個有上限、最新在前、去重的剪貼簿文字環狀緩衝,具 ``add`` / ``snapshot``
44+
/ ``get`` / ``search`` / ``clear`` 及可選的背景輪詢器(``start`` / ``stop``
45+
/ ``capture_once``)。對應 ``AC_clip_history_capture`` /
46+
``AC_clip_history_list`` / ``AC_clip_history_search`` /
47+
``AC_clip_history_start`` / ``AC_clip_history_stop``(以及 ``ac_clip_history_*``)。

docs/source/Zh/zh_index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ AutoControl 所有功能的完整使用指南。
4848
doc/new_features/v23_features_doc
4949
doc/new_features/v24_features_doc
5050
doc/new_features/v25_features_doc
51+
doc/new_features/v26_features_doc
5152
doc/ocr_backends/ocr_backends_doc
5253
doc/observability/observability_doc
5354
doc/operations_layer/operations_layer_doc

je_auto_control/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@
180180
from je_auto_control.utils.resilience import (
181181
CircuitBreaker, CircuitOpenError, RetryPolicy, retry_call,
182182
)
183+
# CI workflow annotations (GitHub Actions)
184+
from je_auto_control.utils.ci_annotations import (
185+
emit_annotations, format_annotation,
186+
)
187+
# Clipboard history (ring buffer + background poller)
188+
from je_auto_control.utils.clipboard_history import (
189+
ClipboardHistory, default_clipboard_history,
190+
)
183191
# Background popup/interrupt watchdog (unattended automation)
184192
from je_auto_control.utils.watchdog import (
185193
PopupWatchdog, WatchdogRule, default_popup_watchdog,
@@ -609,6 +617,8 @@ def start_autocontrol_gui(*args, **kwargs):
609617
"snapshot_screen",
610618
"replay_timeline", "run_sequence",
611619
"CircuitBreaker", "CircuitOpenError", "RetryPolicy", "retry_call",
620+
"emit_annotations", "format_annotation",
621+
"ClipboardHistory", "default_clipboard_history",
612622
# MCP server
613623
"AuditLogger", "HttpMCPServer", "MCPContent", "MCPPrompt",
614624
"MCPPromptArgument", "MCPResource", "MCPServer", "MCPTool",

je_auto_control/gui/script_builder/command_schema.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,26 @@ def _add_misc_specs(specs: List[CommandSpec]) -> None:
665665
_add_screen_state_specs(specs)
666666
_add_input_macro_specs(specs)
667667
_add_resilience_specs(specs)
668+
_add_devex_specs(specs)
669+
670+
671+
def _add_devex_specs(specs: List[CommandSpec]) -> None:
672+
specs.append(CommandSpec(
673+
"AC_ci_annotations", "Tools", "Emit CI Annotations",
674+
description="Emit GitHub Actions annotations from 'annotations' "
675+
"(JSON view).",
676+
))
677+
specs.append(CommandSpec(
678+
"AC_clip_history_capture", "Misc", "Clipboard History: Capture"))
679+
specs.append(CommandSpec(
680+
"AC_clip_history_list", "Misc", "Clipboard History: List"))
681+
specs.append(CommandSpec(
682+
"AC_clip_history_search", "Misc", "Clipboard History: Search",
683+
fields=(FieldSpec("query", FieldType.STRING),)))
684+
specs.append(CommandSpec(
685+
"AC_clip_history_start", "Misc", "Clipboard History: Start"))
686+
specs.append(CommandSpec(
687+
"AC_clip_history_stop", "Misc", "Clipboard History: Stop"))
668688

669689

670690
def _add_resilience_specs(specs: List[CommandSpec]) -> None:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Emit CI workflow annotations (GitHub Actions) from run results."""
2+
from je_auto_control.utils.ci_annotations.ci_annotations import (
3+
emit_annotations, format_annotation,
4+
)
5+
6+
__all__ = ["emit_annotations", "format_annotation"]

0 commit comments

Comments
 (0)