QORMQORM v0.8.4 api Get started

HTTP & SSE

Auto-generated from the source (TestAPIRef) — do not edit by hand. The route table below is extracted from the code, so it can never drift.

qorm run serves the app and exposes a small HTTP surface: the browser talks to it, an AI agent reaches the MCP tools at /mcp, and OTA updates come in over /update. Endpoints that change state require a same-origin request.

RouteMethodPurpose
/GETthe app shell — server-rendered HTML + the thin client runtime
/eventPOSTdispatch a UI event (action / input change) and re-render
/navigatePOSTURL routing — the browser drives navigation from the address bar ({scene,params} or {back:true}) on Back/Forward
/eventsGET (SSE)Server-Sent Events stream: the server pushes fresh HTML + log lines
/pollGETlong-poll fallback when SSE is unavailable — returns the current revision + HTML if it advanced
/logGET / POSTGET activity entries after ?since=; POST forwards a client console line
/presenceGET / POSTcollaboration presence — who (human/agent) is focused/typing where
/viewportGET / POSTthe browser reports its window size (debounced on resize) so responsive when nodes re-render server-side; GET reads the current value
/consoleGETthe log-window console feed page
/logwindowGETthe standalone log window that accompanies the desktop app
/windowPOSTdesktop window control (move / resize / open / close / focus)
/measurePOSTthe browser reports the measured layout (x/y/w/h, computed style) of every node
/mcpPOSTMCP JSON-RPC over HTTP — the same tools as qorm mcp, sharing the live runtime
/updatePOSTOTA: apply a new signed bundle to the running app
/rollbackPOSTrevert to the previously running bundle
/dev/stateGET / POSTDevTools state inspector: read or write the live app state
/dev/treeGETDevTools component tree: read the current scene's node tree JSON
/dev/highlightPOSTDevTools highlight event: broadcast a node highlight inspect signal to all clients

The /events stream

The client opens GET /events?rev=<n><n> the revision of the page render that produced its HTML — and holds it open. The server writes one SSE message per change:

: connected

data: <html for the changed region>

Each data: frame carries the re-rendered HTML the client swaps in, and ships an id: <rev> line so a reconnecting browser replays it as Last-Event-Id. If a client connects (or reconnects) behind the live revision — a mutation landed between its page render and the stream opening — the server first pushes a current snapshot (rev+html+theme+route) to resync it, then streams; a client already at the tip gets no redundant snapshot. Log and presence updates arrive on the same stream. When a proxy buffers SSE, the client falls back to GET /poll?rev=<n>.