Control and execute automation macros via a local Rust-based orchestrator API (http://127.0.0.1:4777). Use when Aditya (the user) asks to run, list, or record macros.
This skill interfaces with the Rust-based macro orchestrator.
http://127.0.0.1:4777| Method | Path | Description |
|---|---|---|
| GET | /help | Crucial: Fetch this to see macro metadata (method, input/output kinds). |
| GET | /macros | List basic macro profiles. |
| POST | /macros/:name/invoke | Invoke a macro. Returns output_text / output_image_base64. |
| GET | /macros/:name/invoke | Invoke a GET-only macro. Returns NO output fields (null). |
| POST | /macros/stop | Stop any currently running macro (Global Stop). |
| POST | /macros/stop-all | Alias for global stop. |
| POST | /macros/:name/stop | Stop a specific macro only. |
| POST | /mouse/move | Move mouse to absolute x, y. |
| POST | /mouse/drag | Drag mouse by delta_x, delta_y. |
| POST | /recording/start | Start recording. |
| POST | /recording/stop | Stop recording and save with profile options. |
| DELETE | /macros/:name | Delete a macro. |
Check Metadata First: Always use GET /help to determine a macro's required method (GET or POST) and input_kind.
Method Enforcement:
POST, you must use POST .../invoke.GET, use GET .../invoke.Handling Inputs (POST):
{"text": "your command/text"}.{"attachment_path": "path/to/img"} or {"image_base64": "..."}.Handling Outputs:
POST .../invoke populates output_text and output_image_base64.GET .../invoke returns null for these fields.PowerShell Escaping: When using curl.exe in PowerShell, use a temporary JSON file for the body to avoid quoting hell:
@'
{"text":"cmd here"}
'@ | Set-Content -Path body.json -Encoding utf8
curl.exe -s -X POST "http://127.0.0.1:4777/macros/name/invoke" -H "Content-Type: application/json" -d "@body.json"
Clipboard Data Retrieval: When a macro (like image-gen or img-gen) returns output_image_base64, treat this as a high-priority asset.
output_image_base64 is not null, convert/save it and present it to the user.output_text is present, display it formatted as markdown.Interruption Handling: If the user says "stop", "cancel", or "kill it" while a macro is running, immediately call POST /macros/stop.
Mouse Control:
POST /mouse/move with {"x": float, "y": float}.POST /mouse/drag with {"delta_x": float, "delta_y": float}.image-gen / img-gen: These often put a generated image on the clipboard. Always look for output_image_base64 in the POST response and deliver it to Aditya immediately.paste: Grab the request, perform Ctrl+V, and returns a status image. Use this for interactive typing or terminal commands where direct invocation is less reliable.terminal: One-liner Windows commands. Use paste if it needs more complex interaction.Graceful Retry: If a macro fails, attempt one retry with the paste macro if applicable, or spawn a fresh instance.
Schedules: For periodic tasks (e.g., "every 5 hours"), update HEARTBEAT.md with the task and track the last run time in memory/heartbeat-state.json.
Contextual Response: If a macro returns an output_image_base64, present it to the user. If it returns output_text, summarize or display it.
Safety: Use /macros/stop if a macro appears stuck or is taking too long.