Show HN: Generative UI: OSS "Imagine with Claude" (github.com)

🤖 AI Summary
A new open‑source project, “Generative UI: Imagine with Claude” (Show HN), demonstrates an agent-driven UI authoring system that builds and edits live app windows on a canvas. The agent runs in the browser (no backend required), uses React Flow for a canvas and sandboxed iframes (srcdoc) for each “window,” and primarily issues tool calls instead of text to manipulate the UI. User queries or iframe postMessage events trigger the LLM; the agent can create windows (create_new_window(name, html)), perform selector‑scoped DOM mutations (dom_replace(windowId, mutations[])), rename windows, or replace full HTML (set_window_html). Streaming is supported end‑to‑end and the tool-driven prompt/response bridge is implemented in src/lib/ai.ts, with UI pieces in src/components/*. This is significant because it shows a pattern for event‑driven, stateful interface agents that program their own front ends in response to interactions—enabling rapid prototyping and UI automation without server infrastructure. It works with multiple providers (OpenAI, Anthropic, Gemini via the OpenAI SDK from the browser; Anthropic via custom baseURL/header) and stores API keys locally (localStorage), so you must ensure your provider allows direct browser use and CORS. The repo follows Simon Willison’s ideas and illustrates both practical opportunities (interactive app generation, fine‑grained DOM edits, streaming tool calls) and security/operational caveats (client‑side keys, CORS requirements, sandboxing).
Loading comments...
loading comments...