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

+15
View File
@@ -50,3 +50,18 @@ Errors answer with a non-2xx status and `{detail: "<why>"}`. The page shows `det
`templates/web/server_stub.py` implements all of this on sample data, standard library
only. A real backend serves the same endpoints with the same rules.
## Desktop (PyQt, no web server)
The same endpoints and rules travel over the Qt bridge instead of HTTP:
- Page to Python: one slot, `ai_request(id, method, path, body)`. `path` is the endpoint
path above without `{API_BASE}`, `body` is a JSON string (`"{}"` when there is none).
- Python to page: one envelope, `{event: "ai_response", data: {id, status, body}}`, with the
same `status` and JSON `body` the web endpoint would answer.
- `GET /runs/{job_id}/document` answers an SVG string or a URL the page can load (for
example a `file:///` path to the PDF).
`templates/desktop/ai_bridge.py` adds that slot to the no-AI `Bridge`. It hands each
request to the review backend's `dispatch(method, path, body)` (`server_stub.py` until the
project has its own), so the approve gate is enforced in Python, never in the page.