Reference UI implementation for driving weft — the execution
substrate for agent-driven scientific analysis. Three surfaces over one
local server that embeds a single Weft controller per workspace:
- Chat — a generic agent panel (Claude Agent SDK) whose weft-specific tool renderers show plans, structured errors, and event digests. (M3)
- Compute — site setup wizard (probe-first, ~/.ssh/config-aware) and live capability/load/footprint status per site. (M2)
- Jobs — monitor/controller for tasks, arrays, kernels, and services: live logs, structured failures with one-click remediation, provenance. (live)
Design principle (from weft): the user and the agent are peers — every
button is an API call the agent could also make (each action shows its
⌁ tool_name), and both land in the same audit trail.
Compute (site capabilities, live storage) and Jobs (structured OOM failure with one-click remediation) — click for full resolution.
pixi install && pixi run web-install && pixi run web-build
# serve a workspace (mints a token, prints the URL to open)
pixi run serve # demo/workspace
# or: pixi shell; weft-ui serve --workspace /path/to/project
# populate the demo story (DFT survey: OOM pilot, qc array with failure
# buckets, memoized resubmit, live-log stream) — drives the running
# server over its own HTTP facade:
pixi run serve & # with --token demo (see pixi.toml) …
pixi run seedFrontend dev loop: pixi run web-dev (vite on :5173, proxies /api to
:8999; open http://localhost:5173/?token=…).
server/weft_ui/— FastAPI, single process, single asyncio loop.facade.py—POST /api/w/<tool>for every tool in weft'sPUBLIC_TOOLS, generated by introspection; tool returns pass through verbatim (weft's returns-never-raises contract crosses HTTP intact: errors are payloads inside a 200; HTTP codes are transport only).events.py— weft's store bus bridged to one SSE stream with cursor replay; stale cursors and slow clients get a_resynccontrol event. The UI never polls.uiapi.py— list endpoints not yet in PUBLIC_TOOLS + the live log sub-stream (task_logscursor-poll at 1 s, labeled honestly).lock.py— flock on.weft/ui.lock: one controller per workspace.
web/— Vite + React + TS; design tokens inweb/src/tokens.css, layout inweb/src/app.css.shared/types.ts— hand-mirrored weft payload shapes;server/tests/test_conformance.pycaptures real payloads intoshared/samples/and fails loudly when upstream weft reshapes them (shared/samples/BASELINErecords the weft SHA; refresh withUPDATE_SAMPLES=1 pixi run test).
Security: binds 127.0.0.1 only; per-process bearer token (injected into
the served page); Origin checked on every /api request.
Every screen is deep-linkable (#/jobs/kernels/krn_x, #/compute/clip, …)
and any of them can be iframed chrome-less into another app with
?embed=1 — framing is CSP-gated by an embed_origins allowlist in the
workspace config. Python/ASGI host apps can instead mount weft-ui
in-process for same-origin panels. The same HTTP surface the UI uses
(tool facade, SSE event stream, chat) is callable directly. See
docs/embedding.md.
pixi run test · pixi run lint; working notes in misc/ (untracked).

