WIP: AI desktop sections, bridge slot, desktop page check

This commit is contained in:
Vasanth committed 2026-10-16 15:25:27 +05:30
1 parent 8951ac05a5
commit 472e18de0d
8 files changed
+465 -16

No files matched your search

+30 -6
View File
@@ -1,6 +1,6 @@
---
name: rpa-dashboard-ai
description: Builds a working dashboard for an RPA bot or service that uses AI (an LLM or OCR extraction call). It has everything from rpa-dashboard-no-ai (sidebar, top bar with dark toggle and status dot, KPI cards, batch donut, run panel with steps and live log, report table with search and export) plus confidence bands, a review split pane (source document beside the extracted fields, band filters, draft edits, Verify) and an approve gate the server enforces. Web path is React + Vite + Tailwind with a sample-data server stub. Use when the user asks for an "AI RPA dashboard", an "extraction dashboard", an "LLM/OCR review dashboard", or any RPA/bot dashboard in a project that calls an LLM or OCR to extract fields. Needs rpa-dashboard-no-ai installed next to it.
description: Builds a working dashboard for an RPA bot or service that uses AI (an LLM or OCR extraction call). It has everything from rpa-dashboard-no-ai (sidebar, top bar with dark toggle and status dot, KPI cards, batch donut, run panel with steps and live log, report table with search and export) plus confidence bands, a review split pane (source document beside the extracted fields, band filters, draft edits, Verify) and an approve gate the server enforces. Web path is React + Vite + Tailwind with a sample-data server stub; desktop path (PyQt) is the no-AI page plus plain-HTML AI sections over the Qt bridge, gate enforced in Python. Use when the user asks for an "AI RPA dashboard", an "extraction dashboard", an "LLM/OCR review dashboard", or any RPA/bot dashboard in a project that calls an LLM or OCR to extract fields. Needs rpa-dashboard-no-ai installed next to it.
---
# RPA dashboard (AI)
@@ -14,7 +14,9 @@ means `../rpa-dashboard-no-ai/templates/`.
| `templates/web/` | The React + Vite + Tailwind starter: shell, KPI, donut, run panel, report, **band legend, review split pane, approve gate**, sample data. |
| `templates/web/server_stub.py` | Sample-data backend for runs, review rows and the approve gate. Standard library only. |
| `templates/web/bands.py` | The band cut points and rules. The one source of truth: the backend imports it. |
| `templates/contract.md` | The AI contract: runs, review rows, endpoints and the gate. Extends `<no-ai>contract.md`. |
| `templates/desktop/ai_sections.html` | Desktop: the Review tab (band legend, review split pane, drafts, Verify, approve gate) in plain HTML, pasted into `<no-ai>dashboard.html`. |
| `templates/desktop/ai_bridge.py` | Desktop: the no-AI `Bridge` plus the `ai_request` slot that hands every AI request to the Python review backend. |
| `templates/contract.md` | The AI contract: runs, review rows, endpoints and the gate, over HTTP or the Qt bridge. Extends `<no-ai>contract.md`. |
| `templates/reference/` | Superbill Review extracts, marked EXAMPLE ONLY. Use them to port extra polish, never copy their project names. |
| `<no-ai>frontend.md`, `<no-ai>detect_frontend.py` | Existing frontend: detect, report, keep or restyle. |
| `<no-ai>themes.md`, `<no-ai>palette.py` | Theme presets and the custom-colour steps. |
@@ -56,9 +58,8 @@ Skip this if the user chose keep. Offer:
Ask only if there is no frontend. If there is one, use its stack. If the project
uses PyQt, choose desktop and say so.
- **Web:** the React starter in `templates/web/`, served by the backend.
- **Desktop:** the plain-HTML AI sections for the PyQt page aren't bundled yet.
Tell the user, and offer the web path or the no-AI desktop page
(`rpa-dashboard-no-ai`) without the AI sections.
- **Desktop:** the no-AI PyQt page with `templates/desktop/ai_sections.html` pasted
in, hosted by `templates/desktop/ai_bridge.py`. No web server, no npm.
## 5. Ask which optional sections to build
@@ -90,6 +91,19 @@ chosen ones at their `OPTIONAL:` markers, and delete the markers.
(`<no-ai>frontend.md` section 4). Never change the band colour block.
4. Search the output for `{{`. None may be left.
## 6. Build (desktop)
1. Build the no-AI desktop page and host first, exactly as steps 6 and 7 of
`../rpa-dashboard-no-ai/SKILL.md` say: `dashboard/dashboard.html` (theme, placeholders,
`SAMPLE_DATA = false` once the bot is wired), `bridge.py` and `bot_runner.py`.
2. Paste the whole of `templates/desktop/ai_sections.html` into `dashboard/dashboard.html`,
just before `</body>`. Change nothing in it: it uses the page's theme tokens, and its
band colours are fixed.
3. Copy `templates/desktop/ai_bridge.py`, `templates/web/server_stub.py` and
`templates/web/bands.py` into `dashboard/`. Fill `{{APP_NAME}}` in `ai_bridge.py`.
4. The app now starts with `python dashboard/ai_bridge.py` (not `bridge.py`).
5. Search the output for `{{`. None may be left.
## 7. Wire the data
The contracts: `<no-ai>contract.md` for the shell, `templates/contract.md` for runs,
@@ -103,6 +117,13 @@ review rows and the gate.
mandatory)`. The approve endpoint must refuse (409 with `detail`) while any flagged
field is unverified: the page never decides that. For the shell, set
`SAMPLE_DATA = false` and serve the no-AI endpoints too.
- **Desktop:** the same rules, over the bridge (`templates/contract.md`, "Desktop").
The shell is wired in `bot_runner.py` as the no-AI skill says. For review data, keep
`server_stub.py` (replace its `SAMPLE_FIELDS` with the real fields, as above) until
the project stores its extraction results. Then write a module with the same
`dispatch(method, path, body)` over the project's store (same routes, bands from
`bands.py`, approve refused while flagged fields are unverified) and import it in
`ai_bridge.py` instead of `server_stub`. The page never decides approval.
- Never invent fields, model names or prices the project doesn't have.
## 8. Verify
@@ -121,6 +142,9 @@ Open the page and check, in light, dark (the toggle) and a window 820px wide or
"page X of Y" on a running document;
- no `{{` is left and the console shows no script errors.
If you can't run npm here, say so and give the user these commands. Finish by
Desktop: `python dashboard/bot_runner.py` (dry run: real steps, ending at 100), then
`python dashboard/ai_bridge.py`, and check the same list in the window.
If you can't run npm (or open a window) here, say so and give the user these commands. Finish by
telling the user where the files are, which theme and sections were built, and
whether the review data is sample data or the backend's.