AI sections fall back to fetch with no Qt bridge, for non-React web frontends
ai_sections.html fetches {API_BASE}+path when window.qt is absent; a page-check case routes those requests to server_stub.dispatch(). AI SKILL.md step 6 and frontend.md send plain-HTML/Vue/Angular/Svelte projects to it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
344718007e
commit
461798127a
6 files changed
+100
-13
No files matched your search
@@ -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 `<no-ai>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 `<no-ai>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 `<no-ai>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 `<no-ai>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 `</body>`, and put it where `<no-ai>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 `<no-ai>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: `<no-ai>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
|
||||
|
||||
Reference in new issue
Block a user