Skip to content

viewer

etrack.api.viewer

api/viewer: ViewerApi — the viewer's doors over HTTP: the laid-out graph, the threads, a thread live, the canvas.

GET /api/topology is the declared graph as placed; GET /api/threads the threads the watched sink keeps, the most recently written first; GET /api/threads/{thread}/events a thread over Server-Sent Events — each message's id is the frame's offset in the thread and its data the RunEvent as JSON — e-serde canonicalizes what a source carried (LangChain messages, dataclasses, dates), unknown objects as their text — replayed past the cursor then followed live. The cursor is ?after= or, on a browser's automatic reconnect, the Last-Event-ID header: a reconnect misses nothing still kept. / serves the canvas from etrack/ui/dist when the bundle is there; without it the API runs alone. The app is plain ASGI: a host mounts it under any prefix, or GranianAdapter serves it on its own port.

ViewerApi

ViewerApi(
    topology: Topology, watch: WatchPort, dist: Path = DIST
)

The viewer's ASGI app over one laid-out topology and one watched sink.

asgi property

asgi: Litestar

The ASGI app: the API under /api, its OpenAPI schema at /api/schema, the canvas at /.

schema staticmethod

schema() -> dict[str, Any]

The JSON Schema of every type the API sends, as $defs: the source of the canvas's types.