Skip to content

Commit 87b2796

Browse files
committed
Add webhook (HTTP push) trigger
A bundled http.server-backed dispatcher fires action scripts when an external service POSTs to a registered path; method and bearer token constraints are enforced before any work runs. Request method, path, query, headers, body, and parsed JSON are seeded into the variable scope so scripts can interpolate them as ${webhook.body} etc. Wired into the executor (AC_webhook_*), the run-history dashboard, and a new Webhooks GUI tab.
1 parent 459d235 commit 87b2796

11 files changed

Lines changed: 906 additions & 1 deletion

File tree

je_auto_control/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@
145145
FilePathTrigger, ImageAppearsTrigger, PixelColorTrigger, TriggerEngine,
146146
WindowAppearsTrigger, default_trigger_engine,
147147
)
148+
from je_auto_control.utils.triggers.webhook_server import (
149+
WebhookTrigger, WebhookTriggerServer, default_webhook_server,
150+
)
148151
# Recording editor (headless helpers)
149152
from je_auto_control.utils.recording_edit.editor import (
150153
adjust_delays, filter_actions, insert_action, remove_action,
@@ -311,6 +314,7 @@ def start_autocontrol_gui(*args, **kwargs):
311314
"TriggerEngine", "default_trigger_engine",
312315
"ImageAppearsTrigger", "WindowAppearsTrigger",
313316
"PixelColorTrigger", "FilePathTrigger",
317+
"WebhookTrigger", "WebhookTriggerServer", "default_webhook_server",
314318
# Profiler
315319
"ActionProfiler", "ActionStats", "default_profiler",
316320
# Secret manager

je_auto_control/gui/language_wrapper/english.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"tab_live_hud": "Live HUD",
2626
"tab_hotkeys": "Hotkeys",
2727
"tab_triggers": "Triggers",
28+
"tab_webhooks": "Webhooks",
2829
"tab_plugins": "Plugins",
2930
"tab_screen_record": "Screen Recording",
3031
"tab_shell": "Shell Command",
@@ -665,6 +666,34 @@
665666
"rh_preview_empty": "Select a run to preview.",
666667
"rh_preview_no_artifact": "No screenshot for this run.",
667668

669+
# Webhooks tab
670+
"wh_server_group": "HTTP server",
671+
"wh_add_group": "New webhook",
672+
"wh_host_label": "Host:",
673+
"wh_port_label": "Port:",
674+
"wh_start": "Start",
675+
"wh_stop": "Stop",
676+
"wh_started": "Listening on {host}:{port}",
677+
"wh_running": "Running on {host}:{port}",
678+
"wh_stopped": "Server is stopped.",
679+
"wh_path_label": "Path:",
680+
"wh_script_label": "Script:",
681+
"wh_browse": "Browse",
682+
"wh_methods_label": "Methods:",
683+
"wh_token_label": "Token:",
684+
"wh_token_placeholder": "optional bearer token",
685+
"wh_register": "Register webhook",
686+
"wh_remove": "Remove selected",
687+
"wh_path_and_script_required": "Path and script file are required.",
688+
"wh_col_id": "ID",
689+
"wh_col_path": "Path",
690+
"wh_col_methods": "Methods",
691+
"wh_col_script": "Script",
692+
"wh_col_fired": "Fired",
693+
"wh_col_token": "Auth?",
694+
"wh_yes": "Yes",
695+
"wh_no": "No",
696+
668697
# Secrets tab
669698
"secret_unlock_group": "Vault",
670699
"secret_manage_group": "Secrets",

je_auto_control/gui/language_wrapper/japanese.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"tab_live_hud": "ライブ HUD",
2424
"tab_hotkeys": "ホットキー",
2525
"tab_triggers": "トリガー",
26+
"tab_webhooks": "Webhook",
2627
"tab_plugins": "プラグイン",
2728
"tab_screen_record": "画面録画",
2829
"tab_shell": "シェル",
@@ -663,6 +664,34 @@
663664
"rh_preview_empty": "実行を選択するとプレビューが表示されます。",
664665
"rh_preview_no_artifact": "この実行のスクリーンショットはありません。",
665666

667+
# Webhooks tab
668+
"wh_server_group": "HTTP サーバー",
669+
"wh_add_group": "新規 webhook",
670+
"wh_host_label": "ホスト:",
671+
"wh_port_label": "ポート:",
672+
"wh_start": "開始",
673+
"wh_stop": "停止",
674+
"wh_started": "{host}:{port} で待機中",
675+
"wh_running": "稼働中 {host}:{port}",
676+
"wh_stopped": "サーバー停止中。",
677+
"wh_path_label": "パス:",
678+
"wh_script_label": "スクリプト:",
679+
"wh_browse": "参照",
680+
"wh_methods_label": "メソッド:",
681+
"wh_token_label": "Token:",
682+
"wh_token_placeholder": "Bearer トークン (任意)",
683+
"wh_register": "Webhook を登録",
684+
"wh_remove": "選択を削除",
685+
"wh_path_and_script_required": "パスとスクリプトファイルが必要です。",
686+
"wh_col_id": "ID",
687+
"wh_col_path": "パス",
688+
"wh_col_methods": "メソッド",
689+
"wh_col_script": "スクリプト",
690+
"wh_col_fired": "発火回数",
691+
"wh_col_token": "認証?",
692+
"wh_yes": "あり",
693+
"wh_no": "なし",
694+
666695
# Secrets tab
667696
"secret_unlock_group": "ボールト",
668697
"secret_manage_group": "シークレット",

je_auto_control/gui/language_wrapper/simplified_chinese.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"tab_live_hud": "实时监看",
1616
"tab_hotkeys": "全局热键",
1717
"tab_triggers": "事件触发器",
18+
"tab_webhooks": "Webhook 触发",
1819
"tab_plugins": "插件",
1920
"tab_screen_record": "屏幕录像",
2021
"tab_shell": "Shell 命令",
@@ -653,6 +654,34 @@
653654
"rh_preview_empty": "请选择一条记录预览。",
654655
"rh_preview_no_artifact": "此次执行没有截图。",
655656

657+
# Webhooks tab
658+
"wh_server_group": "HTTP 服务器",
659+
"wh_add_group": "新增 webhook",
660+
"wh_host_label": "主机:",
661+
"wh_port_label": "端口:",
662+
"wh_start": "启动",
663+
"wh_stop": "停止",
664+
"wh_started": "正在监听 {host}:{port}",
665+
"wh_running": "运行中 {host}:{port}",
666+
"wh_stopped": "服务器已停止。",
667+
"wh_path_label": "路径:",
668+
"wh_script_label": "脚本:",
669+
"wh_browse": "浏览",
670+
"wh_methods_label": "方法:",
671+
"wh_token_label": "Token:",
672+
"wh_token_placeholder": "可选 Bearer token",
673+
"wh_register": "注册 webhook",
674+
"wh_remove": "删除所选",
675+
"wh_path_and_script_required": "请输入路径和脚本文件。",
676+
"wh_col_id": "ID",
677+
"wh_col_path": "路径",
678+
"wh_col_methods": "方法",
679+
"wh_col_script": "脚本",
680+
"wh_col_fired": "触发次数",
681+
"wh_col_token": "需验证?",
682+
"wh_yes": "是",
683+
"wh_no": "否",
684+
656685
# Secrets tab
657686
"secret_unlock_group": "密钥库",
658687
"secret_manage_group": "密钥",

je_auto_control/gui/language_wrapper/traditional_chinese.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"tab_live_hud": "即時監看",
1717
"tab_hotkeys": "全域熱鍵",
1818
"tab_triggers": "事件觸發器",
19+
"tab_webhooks": "Webhook 觸發",
1920
"tab_plugins": "外掛",
2021
"tab_screen_record": "螢幕錄影",
2122
"tab_shell": "Shell 命令",
@@ -654,6 +655,34 @@
654655
"rh_preview_empty": "請選擇一筆紀錄以預覽。",
655656
"rh_preview_no_artifact": "此次執行沒有截圖。",
656657

658+
# Webhooks tab
659+
"wh_server_group": "HTTP 伺服器",
660+
"wh_add_group": "新增 webhook",
661+
"wh_host_label": "主機:",
662+
"wh_port_label": "埠號:",
663+
"wh_start": "啟動",
664+
"wh_stop": "停止",
665+
"wh_started": "正在監聽 {host}:{port}",
666+
"wh_running": "運行中 {host}:{port}",
667+
"wh_stopped": "伺服器已停止。",
668+
"wh_path_label": "路徑:",
669+
"wh_script_label": "腳本:",
670+
"wh_browse": "瀏覽",
671+
"wh_methods_label": "方法:",
672+
"wh_token_label": "Token:",
673+
"wh_token_placeholder": "可選的 Bearer token",
674+
"wh_register": "註冊 webhook",
675+
"wh_remove": "移除所選",
676+
"wh_path_and_script_required": "請輸入路徑與腳本檔案。",
677+
"wh_col_id": "ID",
678+
"wh_col_path": "路徑",
679+
"wh_col_methods": "方法",
680+
"wh_col_script": "腳本",
681+
"wh_col_fired": "觸發次數",
682+
"wh_col_token": "需驗證?",
683+
"wh_yes": "是",
684+
"wh_no": "否",
685+
657686
# Secrets tab
658687
"secret_unlock_group": "密鑰庫",
659688
"secret_manage_group": "密鑰",

je_auto_control/gui/main_widget.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from je_auto_control.gui.script_builder import ScriptBuilderTab
3636
from je_auto_control.gui.selector import crop_template_to_file, open_region_selector
3737
from je_auto_control.gui.triggers_tab import TriggersTab
38+
from je_auto_control.gui.webhooks_tab import WebhooksTab
3839
from je_auto_control.gui.variables_tab import VariablesTab
3940
from je_auto_control.gui.vlm_tab import VLMTab
4041
from je_auto_control.gui.window_tab import WindowManagerTab
@@ -128,6 +129,8 @@ def __init__(self, parent=None):
128129
category="automation")
129130
self._add_tab("triggers", "tab_triggers", TriggersTab(),
130131
category="automation")
132+
self._add_tab("webhooks", "tab_webhooks", WebhooksTab(),
133+
category="automation")
131134
self._add_tab("run_history", "tab_run_history", RunHistoryTab(),
132135
category="automation")
133136
self._add_tab("profiler", "tab_profiler", ProfilerTab(),

0 commit comments

Comments
 (0)