Skip to content

Commit 1fde3cb

Browse files
committed
Add GUI tabs for OCR reader, runtime variables, and LLM planner
The three headless features added in the previous commits had no GUI affordances yet. CLAUDE.md requires every feature to ship with both headless and GUI surfaces, so this adds thin Qt wrappers: - OCRReaderTab: region picker + dump-region + regex-search, sharing the existing region selector overlay - VariablesTab: live view of executor.variables with single-set, JSON seed, and clear-all controls; reflects what AC_set_var / AC_for_each mutate at runtime - LLMPlannerTab: description box, plan preview, and run-plan button; planning runs on a QThread so the UI stays responsive during the LLM call Translations added for English, Traditional Chinese, Simplified Chinese, and Japanese.
1 parent b50be3b commit 1fde3cb

8 files changed

Lines changed: 786 additions & 0 deletions

File tree

je_auto_control/gui/language_wrapper/english.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
"tab_run_history": "Run History",
2828
"tab_accessibility": "Accessibility",
2929
"tab_vlm": "AI Locator",
30+
"tab_ocr_reader": "OCR Reader",
31+
"tab_variables": "Variables",
32+
"tab_llm_planner": "LLM Planner",
3033

3134
# Auto Click Tab
3235
"interval_time": "Interval (ms):",
@@ -317,6 +320,64 @@
317320
"vlm_error": "Error",
318321
"vlm_desc_required": "Describe the target first",
319322

323+
# OCR Reader Tab
324+
"ocr_region_group": "Region",
325+
"ocr_region_label": "x, y, w, h:",
326+
"ocr_region_placeholder": "leave blank for full screen",
327+
"ocr_pick_region": "Pick region...",
328+
"ocr_lang_label": "Language:",
329+
"ocr_min_conf_label": "Min confidence:",
330+
"ocr_regex_label": "Regex pattern:",
331+
"ocr_regex_placeholder": r"e.g. Order#\d+",
332+
"ocr_dump_region": "Dump region text",
333+
"ocr_find_regex": "Find by regex",
334+
"ocr_results_label": "Matches:",
335+
"ocr_match_count": "{n} matches",
336+
"ocr_region_invalid": "Region must be 4 comma-separated integers",
337+
"ocr_min_conf_invalid": "Min confidence must be a number",
338+
"ocr_regex_required": "Enter a regex pattern first",
339+
"ocr_regex_invalid": "Invalid regex",
340+
341+
# Variables Tab
342+
"vars_current_group": "Current scope",
343+
"vars_col_name": "Name",
344+
"vars_col_value": "Value",
345+
"vars_count": "{n} variables",
346+
"vars_refresh": "Refresh",
347+
"vars_clear": "Clear all",
348+
"vars_clear_confirm": "Clear every runtime variable?",
349+
"vars_set_group": "Set one",
350+
"vars_name_label": "Name:",
351+
"vars_name_placeholder": "variable name",
352+
"vars_name_required": "Name is required",
353+
"vars_value_label": "Value:",
354+
"vars_value_placeholder": "JSON literal (42, \"text\", [1,2]) or raw string",
355+
"vars_set_btn": "Set",
356+
"vars_seed_group": "Seed from JSON",
357+
"vars_seed_placeholder": "{\"counter\": 0, \"items\": [\"a\", \"b\"]}",
358+
"vars_seed_btn": "Merge JSON into scope",
359+
"vars_seed_required": "Paste a JSON object first",
360+
"vars_seed_invalid": "Invalid JSON",
361+
"vars_seed_not_object": "Seed JSON must be an object",
362+
363+
# LLM Planner Tab
364+
"llm_desc_group": "Describe the task",
365+
"llm_desc_placeholder": (
366+
"e.g. open Notepad, type 'hello world', save as test.txt"
367+
),
368+
"llm_model_label": "Model:",
369+
"llm_model_placeholder": "optional override (e.g. claude-opus-4-7)",
370+
"llm_plan_btn": "Plan",
371+
"llm_run_btn": "Run plan",
372+
"llm_plan_group": "Planned actions",
373+
"llm_result_group": "Execution result",
374+
"llm_desc_required": "Describe what you want to automate first",
375+
"llm_planning": "Planning...",
376+
"llm_plan_count": "Planned {n} actions",
377+
"llm_no_plan": "Click Plan first",
378+
"llm_running": "Running...",
379+
"llm_run_done": "Done",
380+
320381
# Menu bar
321382
"menu_file": "File",
322383
"menu_file_open_script": "Open Script...",

je_auto_control/gui/language_wrapper/japanese.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
"tab_run_history": "実行履歴",
2828
"tab_accessibility": "アクセシビリティ",
2929
"tab_vlm": "AI ロケーター",
30+
"tab_ocr_reader": "OCR リーダー",
31+
"tab_variables": "実行時変数",
32+
"tab_llm_planner": "LLM プランナー",
3033

3134
# Auto Click Tab
3235
"interval_time": "間隔 (ms):",
@@ -317,6 +320,64 @@
317320
"vlm_error": "エラー",
318321
"vlm_desc_required": "まず対象の説明を入力してください",
319322

323+
# OCR Reader Tab
324+
"ocr_region_group": "領域",
325+
"ocr_region_label": "x, y, w, h:",
326+
"ocr_region_placeholder": "空欄なら画面全体",
327+
"ocr_pick_region": "領域を選択...",
328+
"ocr_lang_label": "言語:",
329+
"ocr_min_conf_label": "最低信頼度:",
330+
"ocr_regex_label": "正規表現:",
331+
"ocr_regex_placeholder": r"例: Order#\d+",
332+
"ocr_dump_region": "領域内の文字を取得",
333+
"ocr_find_regex": "正規表現で検索",
334+
"ocr_results_label": "結果:",
335+
"ocr_match_count": "{n} 件",
336+
"ocr_region_invalid": "領域はカンマ区切りの整数 4 つ",
337+
"ocr_min_conf_invalid": "信頼度は数値で入力",
338+
"ocr_regex_required": "先に正規表現を入力",
339+
"ocr_regex_invalid": "正規表現が不正",
340+
341+
# Variables Tab
342+
"vars_current_group": "現在のスコープ",
343+
"vars_col_name": "名前",
344+
"vars_col_value": "値",
345+
"vars_count": "{n} 個の変数",
346+
"vars_refresh": "再読み込み",
347+
"vars_clear": "全消去",
348+
"vars_clear_confirm": "実行時変数を全て消去しますか?",
349+
"vars_set_group": "個別に設定",
350+
"vars_name_label": "名前:",
351+
"vars_name_placeholder": "変数名",
352+
"vars_name_required": "名前を入力してください",
353+
"vars_value_label": "値:",
354+
"vars_value_placeholder": "JSON リテラル(42、\"text\"、[1,2])または文字列",
355+
"vars_set_btn": "設定",
356+
"vars_seed_group": "JSON から読み込み",
357+
"vars_seed_placeholder": "{\"counter\": 0, \"items\": [\"a\", \"b\"]}",
358+
"vars_seed_btn": "JSON をスコープに統合",
359+
"vars_seed_required": "JSON オブジェクトを貼り付けてください",
360+
"vars_seed_invalid": "JSON が不正",
361+
"vars_seed_not_object": "JSON はオブジェクトでなければなりません",
362+
363+
# LLM Planner Tab
364+
"llm_desc_group": "タスクの説明",
365+
"llm_desc_placeholder": (
366+
"例: メモ帳を開き、'hello world' と入力し、test.txt として保存"
367+
),
368+
"llm_model_label": "モデル:",
369+
"llm_model_placeholder": "任意(例: claude-opus-4-7)",
370+
"llm_plan_btn": "プラン作成",
371+
"llm_run_btn": "プラン実行",
372+
"llm_plan_group": "計画されたアクション",
373+
"llm_result_group": "実行結果",
374+
"llm_desc_required": "まず自動化したいタスクを記述してください",
375+
"llm_planning": "計画中...",
376+
"llm_plan_count": "{n} 個のアクションを計画",
377+
"llm_no_plan": "まず「プラン作成」を押してください",
378+
"llm_running": "実行中...",
379+
"llm_run_done": "完了",
380+
320381
# Menu bar
321382
"menu_file": "ファイル",
322383
"menu_file_open_script": "スクリプトを開く...",

je_auto_control/gui/language_wrapper/simplified_chinese.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
"tab_run_history": "执行记录",
2323
"tab_accessibility": "无障碍树",
2424
"tab_vlm": "AI 定位",
25+
"tab_ocr_reader": "OCR 读取",
26+
"tab_variables": "运行期变量",
27+
"tab_llm_planner": "LLM 脚本规划",
2528

2629
# Auto Click Tab
2730
"interval_time": "间隔时间 (ms):",
@@ -312,6 +315,64 @@
312315
"vlm_error": "错误",
313316
"vlm_desc_required": "请先输入目标描述",
314317

318+
# OCR Reader Tab
319+
"ocr_region_group": "区域",
320+
"ocr_region_label": "x, y, w, h:",
321+
"ocr_region_placeholder": "留空代表整个屏幕",
322+
"ocr_pick_region": "选取区域...",
323+
"ocr_lang_label": "语言:",
324+
"ocr_min_conf_label": "最低置信度:",
325+
"ocr_regex_label": "Regex 表达式:",
326+
"ocr_regex_placeholder": r"例如 Order#\d+",
327+
"ocr_dump_region": "抓取区域全部文字",
328+
"ocr_find_regex": "用 regex 搜索",
329+
"ocr_results_label": "结果:",
330+
"ocr_match_count": "{n} 个匹配",
331+
"ocr_region_invalid": "区域必须为 4 个逗号分隔整数",
332+
"ocr_min_conf_invalid": "置信度需为数字",
333+
"ocr_regex_required": "请先输入 regex 表达式",
334+
"ocr_regex_invalid": "Regex 不正确",
335+
336+
# Variables Tab
337+
"vars_current_group": "当前作用域",
338+
"vars_col_name": "名称",
339+
"vars_col_value": "值",
340+
"vars_count": "共 {n} 个变量",
341+
"vars_refresh": "刷新",
342+
"vars_clear": "全部清除",
343+
"vars_clear_confirm": "确定清空所有运行期变量?",
344+
"vars_set_group": "新增单个变量",
345+
"vars_name_label": "名称:",
346+
"vars_name_placeholder": "变量名",
347+
"vars_name_required": "请输入名称",
348+
"vars_value_label": "值:",
349+
"vars_value_placeholder": "JSON 字面量(42、\"text\"、[1,2])或纯字符串",
350+
"vars_set_btn": "设定",
351+
"vars_seed_group": "从 JSON 载入",
352+
"vars_seed_placeholder": "{\"counter\": 0, \"items\": [\"a\", \"b\"]}",
353+
"vars_seed_btn": "合并 JSON 到作用域",
354+
"vars_seed_required": "请先粘贴 JSON 对象",
355+
"vars_seed_invalid": "JSON 格式错误",
356+
"vars_seed_not_object": "JSON 必须是对象",
357+
358+
# LLM Planner Tab
359+
"llm_desc_group": "描述要做的任务",
360+
"llm_desc_placeholder": (
361+
"例如:打开记事本、输入 'hello world'、另存为 test.txt"
362+
),
363+
"llm_model_label": "模型:",
364+
"llm_model_placeholder": "选填(例如 claude-opus-4-7)",
365+
"llm_plan_btn": "规划",
366+
"llm_run_btn": "执行此规划",
367+
"llm_plan_group": "已规划的指令",
368+
"llm_result_group": "执行结果",
369+
"llm_desc_required": "请先描述要自动化的任务",
370+
"llm_planning": "规划中...",
371+
"llm_plan_count": "已规划 {n} 个指令",
372+
"llm_no_plan": "请先按下「规划」",
373+
"llm_running": "执行中...",
374+
"llm_run_done": "完成",
375+
315376
# Menu bar
316377
"menu_file": "文件",
317378
"menu_file_open_script": "打开脚本...",

je_auto_control/gui/language_wrapper/traditional_chinese.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
"tab_run_history": "執行紀錄",
2424
"tab_accessibility": "無障礙樹",
2525
"tab_vlm": "AI 定位",
26+
"tab_ocr_reader": "OCR 讀取",
27+
"tab_variables": "執行期變數",
28+
"tab_llm_planner": "LLM 腳本規劃",
2629

2730
# Auto Click Tab
2831
"interval_time": "間隔時間 (ms):",
@@ -313,6 +316,64 @@
313316
"vlm_error": "錯誤",
314317
"vlm_desc_required": "請先輸入目標描述",
315318

319+
# OCR Reader Tab
320+
"ocr_region_group": "區域",
321+
"ocr_region_label": "x, y, w, h:",
322+
"ocr_region_placeholder": "留空代表整個螢幕",
323+
"ocr_pick_region": "選取區域...",
324+
"ocr_lang_label": "語言:",
325+
"ocr_min_conf_label": "最低信心度:",
326+
"ocr_regex_label": "Regex 樣式:",
327+
"ocr_regex_placeholder": r"例如 Order#\d+",
328+
"ocr_dump_region": "抓取區域全部文字",
329+
"ocr_find_regex": "用 regex 搜尋",
330+
"ocr_results_label": "結果:",
331+
"ocr_match_count": "{n} 個結果",
332+
"ocr_region_invalid": "區域必須為 4 個逗號分隔整數",
333+
"ocr_min_conf_invalid": "信心度需為數字",
334+
"ocr_regex_required": "請先輸入 regex 樣式",
335+
"ocr_regex_invalid": "Regex 不正確",
336+
337+
# Variables Tab
338+
"vars_current_group": "目前作用域",
339+
"vars_col_name": "名稱",
340+
"vars_col_value": "值",
341+
"vars_count": "共 {n} 個變數",
342+
"vars_refresh": "重新整理",
343+
"vars_clear": "全部清除",
344+
"vars_clear_confirm": "確定要清空所有執行期變數嗎?",
345+
"vars_set_group": "新增單一變數",
346+
"vars_name_label": "名稱:",
347+
"vars_name_placeholder": "變數名稱",
348+
"vars_name_required": "請輸入名稱",
349+
"vars_value_label": "值:",
350+
"vars_value_placeholder": "JSON 字面值(42、\"text\"、[1,2])或純字串",
351+
"vars_set_btn": "設定",
352+
"vars_seed_group": "從 JSON 載入",
353+
"vars_seed_placeholder": "{\"counter\": 0, \"items\": [\"a\", \"b\"]}",
354+
"vars_seed_btn": "合併 JSON 到作用域",
355+
"vars_seed_required": "請先貼上 JSON 物件",
356+
"vars_seed_invalid": "JSON 格式錯誤",
357+
"vars_seed_not_object": "JSON 必須是物件",
358+
359+
# LLM Planner Tab
360+
"llm_desc_group": "描述要做的任務",
361+
"llm_desc_placeholder": (
362+
"例如:開啟記事本、輸入 'hello world'、另存為 test.txt"
363+
),
364+
"llm_model_label": "模型:",
365+
"llm_model_placeholder": "選填(例如 claude-opus-4-7)",
366+
"llm_plan_btn": "規劃",
367+
"llm_run_btn": "執行此規劃",
368+
"llm_plan_group": "已規劃的指令",
369+
"llm_result_group": "執行結果",
370+
"llm_desc_required": "請先描述要自動化的任務",
371+
"llm_planning": "規劃中...",
372+
"llm_plan_count": "已規劃 {n} 個指令",
373+
"llm_no_plan": "請先按下「規劃」",
374+
"llm_running": "執行中...",
375+
"llm_run_done": "完成",
376+
316377
# Menu bar
317378
"menu_file": "檔案",
318379
"menu_file_open_script": "開啟腳本...",

0 commit comments

Comments
 (0)