HeadlinesBriefing favicon HeadlinesBriefing.com

Markdown‑Based Protocol Powers Agentic UI Generation

Hacker News •
×

A developer built a prototype that unites generative UI and code execution into a single architecture. The core idea is to treat Markdown as a protocol, streaming text, executable code, and data in one flow. The agent writes code fences that run on the server, while a mount() primitive lets it build React UIs on the fly.

To keep the user engaged, the prototype streams execution. As the LLM emits a code fence, each statement runs immediately, without waiting for the fence to close. The author built a custom runtime called bun-streaming-exec that feeds tokens into a vm.Script wrapper, enabling top‑level await and shared context across statements.

The agentic UI layer turns that code into live interfaces. By calling mount() with a JSX snippet, the server serializes a React component and streams it to the client. The prototype supports four data‑flow patterns: client‑to‑server forms, server‑to‑client live updates, LLM‑streamed JSON, and client‑initiated callbacks, all wired through shared state objects.

Security remains a concern, but industry players already sandbox LLM‑generated code with capability‑based permissions and static analysis. The prototype demonstrates that