diff --git a/rpa-dashboard-ai/SKILL.md b/rpa-dashboard-ai/SKILL.md index e3555a5..779bd15 100644 --- a/rpa-dashboard-ai/SKILL.md +++ b/rpa-dashboard-ai/SKILL.md @@ -15,7 +15,7 @@ means `../rpa-dashboard-no-ai/templates/`. | `templates/web/pricing.py` | The pricing table (with its source and as-of date) and `cost_for_call`. The backend imports it. | | `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/desktop/ai_sections.html` | Desktop: the Review tab (band legend, review split pane, drafts, Verify, approve gate) and the Cost tab in plain HTML, pasted into `dashboard.html`. | +| `templates/desktop/ai_sections.html` | Desktop, and web projects with a non-React frontend: the Review tab (band legend, review split pane, drafts, Verify, approve gate) and the Cost tab in plain HTML, pasted into `dashboard.html`. Talks over the Qt bridge, or with no Qt, fetches the `templates/contract.md` endpoints. | | `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 `contract.md`. | | `templates/reference/` | Superbill Review extracts, marked EXAMPLE ONLY. Use them to port extra polish, never copy their project names. | @@ -59,7 +59,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. +- **Web:** the React starter in `templates/web/`, served by the backend. An existing + non-React frontend gets the plain-HTML page instead (step 6, web). - **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. @@ -83,9 +84,17 @@ Both need the endpoints in `templates/contract.md`; add them to the backend (and ## 6. Build (web) -1. Copy `templates/web/` into the project as `dashboard/` (an existing frontend: - see `frontend.md` section 3; in an existing React app, port the - `src/` components into it). Don't copy `node_modules/` or `dist/`. +**Existing plain-HTML, Vue, Angular or Svelte frontend:** don't use the React starter. +Build the no-AI page as `../rpa-dashboard-no-ai/SKILL.md` step 6 says (web, with +`API_BASE` filled, for example `/api`), paste the whole of `templates/desktop/ai_sections.html` +into it just before ``, and put it where `frontend.md` section 3 says. With no +Qt bridge, its AI sections fetch `{API_BASE}` + the paths in `templates/contract.md`, so +the backend serves those (step 7). Port it into the app's components only if the user asks, +with `ai_sections.html` as the reference. Then skip to step 7. + +1. Copy `templates/web/` into the project as `dashboard/` (an existing React app: + port the `src/` components into it, see `frontend.md` section 3). + Don't copy `node_modules/` or `dist/`. 2. Fill every `{{...}}` in `dashboard/index.html`'s CONFIG block: | Placeholder | Value | @@ -122,7 +131,7 @@ Both need the endpoints in `templates/contract.md`; add them to the backend (and The contracts: `contract.md` for the shell, `templates/contract.md` for runs, review rows and the gate. - **Sample data (no backend for these endpoints yet):** keep `SAMPLE_DATA = true` in - `src/store.ts` and use `server_stub.py`. Replace its `SAMPLE_FIELDS` with the + `src/store.ts` (a plain-HTML page: in `dashboard.html`) and use `server_stub.py`. Replace its `SAMPLE_FIELDS` with the fields the project's extraction really returns (name, a sample value, word scores, mandatory). Tell the user which endpoints their backend must serve later. - **Backend exists:** add the endpoints from `templates/contract.md` to it. Copy diff --git a/rpa-dashboard-ai/templates/desktop/ai_sections.html b/rpa-dashboard-ai/templates/desktop/ai_sections.html index 7cda176..0f3dc02 100644 --- a/rpa-dashboard-ai/templates/desktop/ai_sections.html +++ b/rpa-dashboard-ai/templates/desktop/ai_sections.html @@ -2,9 +2,11 @@ Paste this whole block into the no-AI dashboard.html, just before . It adds a Review tab: band legend, band filters, the source document beside its extracted fields, drafts, Verify, and Approve. Plain HTML, the page's own theme tokens, no build step. - Every request goes over the Qt bridge as one slot call, ai_request(id, method, path, body), - and comes back as an `ai_response` envelope (see ../contract.md, "Desktop"). The approve - gate is the Python backend's: this page only asks, and shows the refusal. + In PyQt, every request goes over the Qt bridge as one slot call, ai_request(id, method, path, + body), and comes back as an `ai_response` envelope (see ../contract.md, "Desktop"). With no + Qt (a plain-HTML web project), it fetches {API_BASE}{path} from the backend instead, the + web endpoints in ../contract.md. The approve gate is the backend's: this page only asks, + and shows the refusal. -->