Files
Rpa_Skills/rpa-run-tab/templates/rt.py
T
VasanthandClaude Opus 5.5 258bfbb500 Add rpa-run-tab skill: Tebra-style Run tab in 5 minutes
The Run tab from Tebra Auto Post, scrubbed and themable (Tebra Sky, TVL Teal,
or a custom hex checked for contrast). The skill wires the real bot through
tagged log-file lines and checks itself with a fake bot (complete, partial,
stuck, crash) plus light and dark screenshots. Grill decisions R1-R14 are in
PLAN.md, terms in GLOSSARY.md, and ADRs 0001-0003.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:29:18 +05:30

37 lines
1.1 KiB
Python

"""Run tab protocol for the bot (ADR-0002). Copy this file next to the bot.
import rt
rt.checkpoint(1) # checkpoint 1 starts (its time limit starts counting)
rt.ui("Signed in", "ok") # a line the operator sees: kind "", "ok", "warn" or "error"
rt.checkpoint_done(1)
...
return rt.result(total=40, failed=[("Row 7", "Account not found")])
The bot's entry function returns rt.result(...), and the Run tab prints the summary line.
A bot that is a plain script (no entry function) calls rt.summary(...) as its last line.
"""
import json
SUMMARY = "__RUN_SUMMARY__"
def checkpoint(n):
print(f"[CPSTATE] active {n}", flush=True)
def checkpoint_done(n):
print(f"[CPSTATE] done {n}", flush=True)
def ui(msg, kind=""):
print(f"[UI{':' + kind if kind else ''}] {msg}", flush=True)
def result(total, failed=()):
failed = [[str(item), str(reason)] for item, reason in failed]
return {"total": total, "ok": total - len(failed), "failed": failed}
def summary(total, failed=()):
print(SUMMARY + json.dumps(result(total, failed)), flush=True)