This scaffold provides a Windows-centric automation runner that watches for intents, executes YAML recipes, and exposes helpers for screen automation, OCR-triggered flows, and LLM-assisted hand-offs.
- Configurable intent catalog – intents live in
connector.config.yml:intent_mapand map to reusable YAML recipes underagent/examples/recipes/. - Application lifecycle control – generic
app.*recipes (launch, focus, minimize, restore, close, kill) resolve defaults from context so the same intents work across OCR, chat, and file triggers. - Browser automation helpers – stock Chrome recipes for open-home, focus/minimize, restore, refresh quotes, and launching arbitrary URLs.
- Screen-based triggers – the OCR scanner looks for
#intent#markers, parses macro syntax, and fires each command once (deduped via(intent, args)cache). - Clipboard + LLM handoff –
context.copy_for_llmcaptures state/context and copies it to the clipboard;context.load_llm_responseingests an LLM reply and merges it back into the execution context. - Chat bridge – when enabled, inline macros such as
[macro:browser_minimize action_id=203]are parsed and written to the intents directory. - Emergency hotkey –
ctrl+alt+shift+escstops the watcher, chat bridge, OCR thread, and raises an interrupt.
python -m pip install -r requirements.txt
# optional (enables clipboard intents)
python -m pip install pyperclipRequired third-party packages include watchdog (intent watcher) and pytesseract, pillow, mss (OCR). Install Chrome to match the default browser recipes or update connector.config.yml accordingly.
python agent.pyUseful flags:
--ocr-intents / --no-ocr-intents– enable or disable the OCR scanner (defaults come fromfeatures.ocr_intents).--chat-bridge / --no-chat-bridge– enable or disable the macro-aware REPL (features.chat_bridge).--profile {safe|balanced|unrestricted}– switch automation toggles on startup.--allow-focus-tap– permit the MSAA focus tap fallback when UI controls reject direct clicks.--dry-run– skip starting the intent watcher (configuration sanity check).
With OCR enabled, type markers such as:
#intent# + 401 + [browser_open_home]
#intent# + 402 + [browser_focus_and_minimize]
#intent# + 403 + [browser_restore]
The scanner translates them into standard macros and writes intents to C:/Automation/intents/.
- Enter
list intents for browser(or[macro:list_intents topic=browser]) in the chat bridge to view relevant entries. - Natural language commands that do not match directly now show the top keyword candidates. Optionally wire an LLM callback into
ChatIntentBridgeto translate free-form requests; it receives the intent manifest and returns{intent, args}suggestions.
Intent mappings (excerpt):
| Intent | Recipe | Notes |
|---|---|---|
browser_open_home |
browser.open_home.yml |
Launch Chrome with default URL |
browser_open_url |
browser.open_url.yml |
Requires args.url in context |
app_launch |
app.launch.yml |
Reads name, preset, args |
app_focus / app_minimize / ... |
app.*.yml recipes |
Apply to latest or targeted instance |
context_copy_for_llm |
context.copy_for_llm.yml |
Copies state/context to clipboard |
context_load_llm_response |
context.load_llm_response.yml |
Loads clipboard YAML into context |
ts.web.export_quotes |
ts.web.export_quotes.yml |
Domain-specific example |
Add or adjust catalog entries by editing agent/examples/recipes/ and updating connector.config.yml.
- Trigger
context.copy_for_llmto capture the active context snapshot and copy it to the clipboard. - Paste the payload into Cursor/GPT, get the continuation, then copy the response to the clipboard.
- Trigger
context.load_llm_responseto merge the response back into the recipe context for follow-up intents.
Both steps rely on pyperclip (install if you plan to use them).
- Tests:
python -m pytest - Hotkey utilities live in
agent/platform/windows/hotkeys.pyand are unit-tested undertests/platform/windows/. - OCR logic (thread-local screenshot capture, one-shot dedupe) resides in
agent/vision/ocr_intents.pywith coverage intests/test_ocr_intents.py. - The chat bridge and recipes have dedicated fixtures/tests under
tests/test_chat_bridge.pyandtests/test_app_recipes.py.
For detailed intent behavior, inspect the YAML recipes and associated step handlers in agent/runner/steps.py.