fenestra
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**A UI stack built for the agent loop.** Describe a UI as JSON, render it
natively, and check it in CI. There's no compile step in that loop, and no
flaky screenshots.
fenestra is a pure-Rust GUI framework. Its headless renderer is
deterministic, which means people and AI coding agents can both look at
what they built and prove it is right. It also speaks
A2UI, the open Agent-to-UI standard — this is its first
native Rust renderer (fenestra-a2ui). The widget kit and
design system below are what that loop can produce.
**▶ Try the live demo** — the
dashboard and widget galleries, running in your browser over WebGPU. No
DOM and no CSS: every pixel is vello on wgpu, from the same code as the
native window. There's also
**the book** if you want
the guided tour.
| Light | Dark |
| --- | --- |
| | |
*That hero shot is a real tool, not a mockup: examples/agent_dashboard.rs
is a live dashboard over an AI coding session, with a virtualized feed,
charts, and a live tail through the effect layer. The SaaS-style widget
showcase lives on as examples/dashboard.rs:*
| Light | Dark |
| --- | --- |
| | |
There's no browser here, no webview, and no HTML or CSS parser. fenestra
draws everything itself with [vello] on wgpu. It lays out with [taffy]
(flexbox and grid) and shapes text with [parley].
On top of that sits a themed widget kit that looks like a polished modern
web app: soft layered shadows, OKLCH color ramps, a real typographic
hierarchy, transitions on hover and focus, and light and dark themes that
both get first-class treatment.
[vello]: https://github.com/linebender/vello
[taffy]: https://github.com/DioxusLabs/taffy
[parley]: https://github.com/linebender/parley
Quickstart
Run cargo add fenestra, paste that in, then cargo run. If you'd rather
start from a template, cargo generate richer-richard/fenestra-template
gives you one with a headless UI test and CI already set up.
The whole view is rebuilt, laid out and repainted on every redraw. There's
no diffing and there are no macros, so everything autocompletes.
Agents can see what they build
Rendering (element tree, theme, size) to pixels is a pure function, and it
runs without a window or display server:
Headless rendering is deterministic (embedded fonts, fixed scale, reduced
motion), which makes pixel-exact golden tests practical — fenestra's own
widget kit is tested this way, on CI, with no GPU display attached.
The same pipeline backs a JSON authoring format called fenestra/1, for
agents and tools that would rather not compile Rust. You describe a UI in
JSON and fenestra-describe parses it into the same
Element tree the builders produce. The format covers the whole kit: data
tables, trees, popovers, command palettes, the OKLCH color picker, images,
charts, and markdown.
From there you have a few ways in. fenestra render writes a PNG.
fenestra preview opens a window that re-renders every time you
save. And the fenestra-mcp server hands an agent the whole
loop — render, query, interact, verify — as fourteen MCP tools, including
render_a2ui. You can watch motion too, not just single frames:
Harness::film (also fenestra film, also the MCP film_ui tool) captures
a sequence with real motion turned on and composes it into one captioned
filmstrip.
**What a headless render does and doesn't cover.** It renders a deliberate
subset of what a live window shows. That subset is exactly what makes it
deterministic, so it's worth knowing where the edges are.
Text uses the embedded fonts, so Latin comes out exact. The real monospace,
CJK, emoji and RTL faces come from the OS, and those only show up in a real
window. Motion is always forced to reduced. Pixels are referenced against
macOS/Metal, with Linux/lavapipe allowed a wider tolerance. Scale isn't
pinned — render_element_scaled runs the same two-pass pipeline at any
device scale, so you can catch retina-only regressions like hairlines and