diff --git a/rpa-dashboard-no-ai/templates/sections.md b/rpa-dashboard-no-ai/templates/sections.md index 157f767..b3a662b 100644 --- a/rpa-dashboard-no-ai/templates/sections.md +++ b/rpa-dashboard-no-ai/templates/sections.md @@ -26,17 +26,17 @@ Numbered boxes on the Run tab. Each one is pending, in progress, done or stuck. - Event `cpstate {kind: "pending"|"active"|"done"|"stuck", cp}`. `cp` counts from 1. `active` also marks the earlier boxes done and the later ones pending, so the bot can send `active` for each checkpoint as it starts, and `stuck` when one fails. -- Desktop: add a marker table next to `STEP_MARKERS` in `bridge.py`, and send the event - from `_on_line`, using specific substrings the bot really prints: +- Desktop: add a marker table next to `STEP_MARKERS` in `bot_runner.py`, and add the event + in `events_for`, using specific substrings the bot really prints. The dry run then shows + the `cpstate` events too: ```python - CHECKPOINT_MARKERS = [("[cp 1]", "active", 1), ("[cp 1 failed]", "stuck", 1)] # (substring, kind, cp) + # (specific substring, kind, cp). First match wins. + CHECKPOINT_MARKERS = [("[cp 1]", "active", 1), ("[cp 1 failed]", "stuck", 1)] - # in _on_line, after the step markers: - for marker, kind, cp in CHECKPOINT_MARKERS: - if marker in low: - self.send_to_js("cpstate", {"kind": kind, "cp": cp}) - break + # in events_for, right after the step marker: + if cp := _first(CHECKPOINT_MARKERS, line): + out.append(("cpstate", {"kind": cp[1], "cp": cp[2]})) ``` ## Admin/roles screen (`admin`)