The Open Standard for Generative UI
docs: code on integration pages and integration links in the footer (#1400)
Zahle Khanfcfbee02e632
diff --git a/docs/app/(home)/components/Button/Button.tsx b/docs/app/(home)/components/Button/Button.tsxindex 6715e3f09..61ebc0351 100644--- a/docs/app/(home)/components/Button/Button.tsx+++ b/docs/app/(home)/components/Button/Button.tsx@@ -58,6 +58,8 @@ interface ClipboardCommandButtonProps {iconFrameClassName?: string;iconPosition?: "start" | "end";copyIconColor?: string;+ /** Renders it as one of the site's pills instead of the bare command style. */+ variant?: PillVariant;type?: ButtonType;onCopyChange?: (copied: boolean) => void;onCopySuccess?: (command: string) => void;@@ -71,6 +73,7 @@ export function ClipboardCommandButton({iconFrameClassName = "",iconPosition = "end",copyIconColor = "white",+ variant,type = "button",onCopyChange,onCopySuccess,@@ -114,7 +117,14 @@ export function ClipboardCommandButton({<buttontype={type}onClick={handleClick}- className={[styles.clipboardCommandButton, className].filter(Boolean).join(" ")}+ className={[+ styles.clipboardCommandButton,+ variant ? styles.pillBase : "",+ variant ? VARIANT_CLASS_MAP[variant] : "",+ className,+ ]+ .filter(Boolean)+ .join(" ")}>{iconPosition === "start" ? icon : null}{children}diff --git a/docs/app/(home)/integrations/[slug]/page.tsx b/docs/app/(home)/integrations/[slug]/page.tsxindex 7c78dd54a..20e0eeab3 100644--- a/docs/app/(home)/integrations/[slug]/page.tsx+++ b/docs/app/(home)/integrations/[slug]/page.tsx@@ -1,12 +1,12 @@import { Footer } from "@/app/(home)/sections/Footer/Footer";import { JsonLd } from "@/components/seo/JsonLd";import { createPageMetadata } from "@/lib/page-metadata";-import { BASE_URL } from "@/lib/source";+import { BASE_URL, integrationGuide } from "@/lib/source";import { ArrowLeft, ArrowRight, ArrowUpRight } from "lucide-react";import type { Metadata } from "next";import Link from "next/link";import { notFound } from "next/navigation";-import { CopyCommand } from "../copy-command";+import { CopyCommand, CopyPrompt } from "../copy-command";import {getIntegrationCategory,getIntegrationPageMetadata,@@ -14,8 +14,10 @@ import {integrationBySlug,integrations,} from "../data";+import { guideComponents } from "../guide-components";import { IntegrationLogo } from "../integration-logo";import styles from "../page.module.css";+import { integrationPrompt } from "../prompt";export const dynamicParams = false;@@ -42,6 +44,9 @@ export default async function IntegrationDetailPage(props: { params: Promise<{ sconst category = getIntegrationCategory(integration.category);const related = getRelatedIntegrations(integration);+ const guide = integrationGuide.getPage([slug]);+ const Guide = guide?.data.body;+ const prompt = integrationPrompt(integration, await guide?.data.getText("raw"));const breadcrumbs = [{ name: "Home", item: BASE_URL },@@ -75,6 +80,7 @@ export default async function IntegrationDetailPage(props: { params: Promise<{ s<h1>{integration.name}</h1></div><p>{integration.summary}</p>+ <CopyPrompt prompt={prompt} /></div></div></div>@@ -99,21 +105,6 @@ export default async function IntegrationDetailPage(props: { params: Promise<{ s</div></section>) : null}-- <section className={styles.flowSection}>- <h2>Integration steps</h2>- <ol className={styles.flowList}>- {integration.steps.map((step, index) => (- <li key={step.title}>- <span className={styles.flowNumber}>{index + 1}</span>- <div>- <h3>{step.title}</h3>- <p>{step.description}</p>- </div>- </li>- ))}- </ol>- </section></article><aside className={styles.resourceSidebar}>@@ -169,6 +160,10 @@ export default async function IntegrationDetailPage(props: { params: Promise<{ s</aside></div>+ {/* Example and steps from content/integrations/<slug>.mdx, full width below the+ sidebar grid so each step's text can sit beside its code. */}+ {Guide ? <Guide components={guideComponents} /> : null}+<div className={styles.detailBackRow}><Link href={`/integrations#${category.id}`}>Browse {category.shortTitle.toLowerCase()}diff --git a/docs/app/(home)/integrations/copy-command.tsx b/docs/app/(home)/integrations/copy-command.tsxindex 8dfc054ee..2d703c102 100644--- a/docs/app/(home)/integrations/copy-command.tsx+++ b/docs/app/(home)/integrations/copy-command.tsx@@ -1,5 +1,6 @@"use client";+import { ClipboardCommandButton } from "@/app/(home)/components/Button/Button";import { copyText } from "@/lib/copy-text";import { Check, Copy } from "lucide-react";import { useEffect, useRef, useState } from "react";@@ -36,3 +37,24 @@ export function CopyCommand({ command }: { command: string }) {</button>);}++/** Copies the page's integration brief for the reader to paste into a coding agent. */+export function CopyPrompt({ prompt }: { prompt: string }) {+ const [copied, setCopied] = useState(false);++ return (+ <div className={styles.copyPrompt}>+ <ClipboardCommandButton+ command={prompt}+ variant="secondary"+ copyIconColor="currentColor"+ onCopyChange={setCopied}+ >+ Setup for Agent+ </ClipboardCommandButton>+ <p className={styles.copyPromptStatus} role="status" aria-live="polite">+ {copied ? "Copied. Paste it into your coding agent to set this up." : ""}+ </p>+ </div>+ );+}diff --git a/docs/app/(home)/integrations/data.ts b/docs/app/(home)/integrations/data.tsindex 25c42d9b1..4a251b113 100644--- a/docs/app/(home)/integrations/data.ts+++ b/docs/app/(home)/integrations/data.ts@@ -8,11 +8,6 @@ export interface IntegrationLink {kind: "Docs" | "Example" | "Guide" | "GitHub" | "npm" | "Website" | "Plugin";}-export interface IntegrationStep {- title: string;- description: string;-}-export interface Integration {slug: string;name: string;@@ -23,11 +18,12 @@ export interface Integration {type: string;summary: string;howItWorks: string;- steps: IntegrationStep[];install?: string;links: IntegrationLink[];}+// Each page's example and steps live in content/integrations/<slug>.mdx.+export interface IntegrationCategory {id: IntegrationCategoryId;title: string;@@ -96,23 +92,8 @@ const integrationCatalog: Integration[] = ["To add generative UI to shadcn/ui, wrap your shadcn/ui components in an OpenUI library and let the model compose them as streaming interfaces.",howItWorks:"Each shadcn component is registered with defineComponent and a Zod prop schema. createLibrary produces both the prompt vocabulary and the renderer mapping used by the example chat app.",- steps: [- {- title: "Wrap your shadcn/ui components",- description:- "Register each component with defineComponent and a Zod prop schema, then combine them with createLibrary. The example library covers 45+ components, including cards, tables, charts, forms, and dialogs.",- },- {- title: "Generate the library spec",- description:- "Run openui generate --spec on the library file. The chat route passes that spec to generateSystemPrompt({ cloud: true }), so the model can only call components the client can render.",- },- {- title: "Render the responses",- description:- "Pass the library to Renderer from @openuidev/react-lang wherever your app shows model output. For a ready-made chat app, the example passes it to AgentInterface as componentLibrary instead.",- },- ],+ install:+ "npm install @openuidev/react-ui @openuidev/react-headless @openuidev/react-lang @openuidev/lang-core zod",links: [{label: "Integration guide",@@ -134,23 +115,8 @@ const integrationCatalog: Integration[] = ["To add generative UI to Material UI, expose your Material UI components to a model through OpenUI without replacing your existing React design system.",howItWorks:"The example wraps Material UI components with OpenUI definitions, generates a constrained component prompt, and renders model output back into the same Material UI primitives.",- steps: [- {- title: "Map MUI components to OpenUI",- description:- "Wrap Material UI components with defineComponent and Zod schemas, and export them through createLibrary. Charts use @mui/x-charts.",- },- {- title: "Generate the library spec",- description:- "Run openui generate --spec on src/library.ts. The chat route sends that spec to OpenUI Cloud and runs app-owned tools with runChatToolLoop.",- },- {- title: "Render inside your MUI theme",- description:- "Render responses with Renderer, or with AgentInterface as the example does, inside your MUI ThemeProvider. Generated components then use the app's theme and light or dark mode.",- },- ],+ install:+ "npm install @openuidev/react-ui @openuidev/react-headless @openuidev/react-lang @openuidev/lang-core zod",links: [exampleLink("design-systems/material-ui"),{@@ -172,23 +138,8 @@ const integrationCatalog: Integration[] = ["To add generative UI to Handsontable, connect a live Handsontable spreadsheet to OpenUI so agent tools can analyze and update its data.",howItWorks:"The maintained example shares table state between Handsontable and a custom OpenUI SpreadsheetTable component. Tool calls update the server-side data, and the rendered component synchronizes those results back into the live grid.",- steps: [- {- title: "Share the table state",- description:- "Keep the table in a server-side store that both the grid and the chat route use. Edits made in Handsontable sync back to the server through POST /api/table.",- },- {- title: "Give the model spreadsheet tools",- description:- "Expose tools such as get_table_data, update_cells, add_rows, and set_formula. After a write, the model responds with a SpreadsheetTable component.",- },- {- title: "Sync results into the grid",- description:- "The Renderer draws SpreadsheetTable from the custom library, and the useSpreadsheetSync hook pushes the new data into the live Handsontable instance.",- },- ],+ install:+ "npm install @openuidev/react-ui @openuidev/react-headless @openuidev/react-lang @openuidev/lang-core zod handsontable @handsontable/react-wrapper hyperformula",links: [exampleLink("miscellaneous/handsontable"),{ label: "Handsontable", href: "https://handsontable.com", kind: "Website" },@@ -205,27 +156,10 @@ const integrationCatalog: Integration[] = ["To generate React Email templates with an LLM, use OpenUI's React Email component package to generate, preview, and export email-safe interfaces.",howItWorks:"@openuidev/react-email provides 44 OpenUI component definitions, an emailLibrary, and prompt rules. OpenUI Lang streams into a React Email preview, which @react-email/render can convert to email-compatible HTML.",- install: "npm install @openuidev/react-email @openuidev/react-lang",- steps: [- {- title: "Import the email library",- description:- "Use emailLibrary from @openuidev/react-email. It covers 44 email-safe components, including headers, feature grids, pricing cards, and checkout tables.",- },- {- title: "Generate the email prompt",- description:- "Build the system prompt from emailLibrary and emailPromptOptions, so the model composes emails only from those components.",- },- {- title: "Preview and export HTML",- description:- "Stream the response into Renderer from @openuidev/react-lang for a live preview, then convert the email to client-compatible HTML with @react-email/render.",- },- ],+ install: "npm install @openuidev/react-email @openuidev/react-lang @react-email/render",links: [{ label: "React Email API reference", href: "/docs/api-reference/react-email", kind: "Docs" },- ...packageLinks("@openuidev/react-email", "react-email", "/docs/api-reference/react-email"),+ ...packageLinks("@openuidev/react-email", "react-email"),exampleLink("miscellaneous/react-email"),{ label: "React Email", href: "https://react.email", kind: "Website" },],@@ -244,23 +178,6 @@ const integrationCatalog: Integration[] = [howItWorks:"The @openuidev/langchain package transforms LangGraph protocol-v2 events into AG-UI on the server, then agUIAdapter() consumes the stream on the client. If your backend already returns native LangGraph named-event SSE, use the bundled langGraphAdapter() and langGraphMessageFormat instead.",install: "npm install @openuidev/langchain @langchain/langgraph",- steps: [- {- title: "Add the stream transformer",- description:- "Add openUIStreamTransformer from @openuidev/langchain/transformer to your graph's streamTransformers, and give the agent the generated OpenUI system prompt.",- },- {- title: "Expose an AG-UI route",- description:- "Return createLangChainStreamResponse(request, options) from a server route. It starts a protocol-v2 run and relays the output as AG-UI SSE while the API key and deployment URL stay on the server.",- },- {- title: "Connect your chat UI",- description:- "Point fetchLLM at the route with agUIAdapter(), then pass it to AgentInterface for a ready-made chat app or to ChatProvider from @openuidev/react-headless for your own UI. For native LangGraph named-event SSE, use langGraphAdapter() with langGraphMessageFormat instead.",- },- ],links: [...packageLinks("@openuidev/langchain", "langchain", "/docs/api-reference/langchain"),{@@ -288,23 +205,6 @@ const integrationCatalog: Integration[] = [howItWorks:"Return the UIMessage SSE produced by streamText().toUIMessageStreamResponse(), then use vercelAIAdapter() with vercelAIMessageFormat on the client. OpenUI validates AI SDK v6 or v7 chunks and maps streamed text, tool inputs, tool results, multi-step lifecycles, and errors into AG-UI events.",install: "npm install @openuidev/react-ui ai",- steps: [- {- title: "Stream with streamText",- description:- "Call streamText with the generated OpenUI system prompt and your AI SDK tools, then return toUIMessageStreamResponse() from the route.",- },- {- title: "Configure the adapter",- description:- "Create the client connection with fetchLLM({ streamAdapter: vercelAIAdapter(), messageFormat: vercelAIMessageFormat }).",- },- {- title: "Connect your chat UI",- description:- "Pass that llm to AgentInterface for a ready-made chat app, or to ChatProvider from @openuidev/react-headless to build your own UI. Either way, streamed text, tool calls, and multi-step runs arrive as the same chat events.",- },- ],links: [{label: "Vercel AI adapter",@@ -332,23 +232,8 @@ const integrationCatalog: Integration[] = ["To give a Google ADK agent a UI, run it in a server route that maps ADK run events to AG-UI, then render the stream with OpenUI. The example uses ADK for TypeScript with tools and multi-turn sessions.",howItWorks:"A Google ADK Agent and FunctionTool run in a Next.js route. The route maps ADK runAsync events to AG-UI SSE, which agUIAdapter() parses on the client.",- steps: [- {- title: "Define the agent",- description:- "Create an ADK Agent with FunctionTool tools and use the generated OpenUI system prompt as its instruction. The example calls OpenUI Cloud through adk-llm-bridge's Custom() model adapter.",- },- {- title: "Bridge events to AG-UI",- description:- "Run the agent with a Runner whose sessions are keyed by chat thread, and map text, functionCall, and functionResponse parts to AG-UI text and tool events.",- },- {- title: "Connect your chat UI",- description:- "Create an llm with fetchLLM and agUIAdapter(), then pass it to AgentInterface for a ready-made chat app or to ChatProvider from @openuidev/react-headless for your own UI.",- },- ],+ install:+ "npm install @google/adk adk-llm-bridge @openuidev/react-ui @openuidev/react-headless @openuidev/react-lang @openuidev/lang-core zod",links: [exampleLink("agent-frameworks/google-adk"),{ label: "Google ADK", href: "https://github.com/google/adk-js", kind: "GitHub" },@@ -365,23 +250,8 @@ const integrationCatalog: Integration[] = ["To build a UI for a Mastra agent, connect it to OpenUI over AG-UI and render its streamed output as typed interfaces.",howItWorks:"Mastra owns the agent and tools, the AG-UI transport serializes the run as SSE, and OpenUI's agUIAdapter drives the chat state and component renderer on the client.",- steps: [- {- title: "Build the Mastra agent",- description:- "Define the Agent with createTool tools and the generated OpenUI instructions. The example registers a custom Mastra gateway that routes model calls through OpenUI Cloud.",- },- {- title: "Stream AG-UI events",- description:- "Wrap the agent with MastraAgent from @ag-ui/mastra in a server route and stream its AG-UI events to the browser as SSE.",- },- {- title: "Connect your chat UI",- description:- "Create an llm with fetchLLM and agUIAdapter(), then pass it to AgentInterface for a ready-made chat app or to ChatProvider from @openuidev/react-headless for your own UI.",- },- ],+ install:+ "npm install @mastra/core @ag-ui/mastra @ag-ui/core @openuidev/react-ui @openuidev/react-lang @openuidev/lang-core zod",links: [exampleLink("agent-frameworks/mastra"),{@@ -404,23 +274,6 @@ const integrationCatalog: Integration[] = [howItWorks:"The @openuidev/assistant-ui toolkit registers display and human-input tools, generates matching model instructions, renders partial OpenUI Lang, and sends validated form actions back through assistant-ui's tool result flow.",install: "npm install @openuidev/assistant-ui @assistant-ui/react",- steps: [- {- title: "Register the OpenUI toolkit",- description:- "Inside AssistantRuntimeProvider, add openuiIntegration.toolkit through AuiConfig and pass openuiIntegration.instructions to useAssistantInstructions.",- },- {- title: "Let the model call the OpenUI tools",- description:- "present_openui renders complete cards, tables, and charts. prompt_openui renders forms and choices, and completes only when the user submits a result.",- },- {- title: "Bring your own components",- description:- "Call createOpenUIIntegration with your own library so the tool schemas, model instructions, and renderers share one component vocabulary.",- },- ],links: [{ label: "assistant-ui guide", href: "/docs/build-agents/assistant-ui", kind: "Docs" },...packageLinks("@openuidev/assistant-ui", "assistant-ui"),@@ -444,26 +297,9 @@ const integrationCatalog: Integration[] = [category: "ai-frameworks",type: "Agent protocol",summary:- "OpenUI works as a frontend for AG-UI: point it at any AG-UI SSE endpoint and agUIAdapter() renders the event stream as generative UI. Lifecycle, text, tool and error events are supported.",+ "OpenUI works as a frontend for AG-UI: point it at any AG-UI SSE endpoint and agUIAdapter() renders the event stream as generative UI. Text message, tool call, tool result and run error events are supported.",howItWorks:- "Point fetchLLM or a direct ChatLLM implementation at an AG-UI SSE endpoint and use agUIAdapter() as the stream adapter. OpenUI maps supported lifecycle, text, tool, and error events into its chat runtime.",- steps: [- {- title: "Prompt your agent for OpenUI Lang",- description:- "Give the agent a system prompt generated from the same component library the client renders, so its text output is valid OpenUI Lang.",- },- {- title: "Serve AG-UI events",- description:- "Expose the agent as an SSE endpoint that emits standard AG-UI run lifecycle, text message, tool call, and error events.",- },- {- title: "Connect the adapter",- description:- "Point fetchLLM, or your own ChatLLM implementation, at that endpoint with agUIAdapter() as the stream adapter. Pass it to AgentInterface for a ready-made chat app, or to ChatProvider from @openuidev/react-headless for your own UI.",- },- ],+ "Point fetchLLM or a direct ChatLLM implementation at an AG-UI SSE endpoint and use agUIAdapter() as the stream adapter. OpenUI maps text message, tool call, tool result and run error events into its chat runtime, and the run ends when the stream closes.",links: [{label: "Adapters and formats",@@ -484,24 +320,7 @@ const integrationCatalog: Integration[] = [summary:"To build a UI for Grok Build, use OpenUI as a generative UI frontend for persistent Grok Build coding-agent sessions.",howItWorks:- "The maintained local harness talks to Grok Build through its official Agent Client Protocol stdio mode, injects the generated OpenUI rules, and maps reasoning, text, tools, and interactions into AG-UI events for AgentInterface. As shipped, it is an unauthenticated single-user harness and needs authentication, sandboxing, and a stricter permission policy before networked deployment.",- steps: [- {- title: "Install and sign in to Grok Build",- description:- "Put the grok CLI on your PATH and run grok login. In non-interactive environments, set XAI_API_KEY instead.",- },- {- title: "Start the harness on a workspace",- description:- "Launch the example with the project directory Grok Build should work in. It runs one grok agent stdio process and opens a separate ACP session for each OpenUI thread, with the OpenUI prompt added as session rules.",- },- {- title: "Answer questions and approve plans in the browser",- description:- "Grok's clarifying questions and plan approvals appear as browser dialogs, and your answers go back over ACP so the same turn can continue.",- },- ],+ "The maintained local harness talks to Grok Build through its official Agent Client Protocol stdio mode, injects the generated OpenUI rules, and maps reasoning, text, and tools into AG-UI events for AgentInterface. Grok's questions and plan approvals reach the browser over a separate interactions route and open as dialogs. As shipped, it is an unauthenticated single-user harness and needs authentication, sandboxing, and a stricter permission policy before networked deployment.",links: [exampleLink("harnesses/grok-build", "OpenUI harness"),{ label: "Grok Build", href: "https://github.com/xai-org/grok-build", kind: "GitHub" },@@ -518,23 +337,6 @@ const integrationCatalog: Integration[] = ["To build a UI for Vercel Eve, connect Eve's resumable agent sessions to OpenUI while preserving Eve's native runtime.",howItWorks:"The maintained harness delivers turns over Eve's native session protocol, resumes its event stream from a stored cursor, and translates Eve text, tool, and failure events into AG-UI for AgentInterface. The example uses an unauthenticated local Eve channel; a deployed version must configure channel authentication and appropriate tool permissions.",- steps: [- {- title: "Add the OpenUI instructions",- description:- "Add an Eve instruction that injects the generated OpenUI Lang prompt when each session starts, alongside the agent's own identity and tools.",- },- {- title: "Deliver turns over Eve's session protocol",- description:- "Send each turn through Eve's HTTP channel and store the session cursor per OpenUI thread, so the NDJSON event stream can resume where it stopped.",- },- {- title: "Map events with eveAdapter()",- description:- "Use eveAdapter() from @openuidev/react-headless as the llm's stream protocol. It converts Eve text, tool call, and failure events into AG-UI for AgentInterface or your own UI built on ChatProvider.",- },- ],links: [{label: "Integration guide",@@ -556,23 +358,6 @@ const integrationCatalog: Integration[] = ["To build a UI for Pi Coding Agent, embed the Pi coding-agent SDK behind OpenUI and render its answers, reasoning, and tool activity.",howItWorks:"The maintained local harness embeds @earendil-works/pi-coding-agent in a Next.js route, injects the prompt generated from OpenUI's component library, and converts Pi text, reasoning, and tool events into an OpenAI-compatible stream consumed by openAIReadableStreamAdapter(). It exposes real filesystem and shell tools, so the shipped unauthenticated harness must not be exposed to a network as-is.",- steps: [- {- title: "Embed the Pi SDK",- description:- "Create one Pi AgentSession per chat thread with createAgentSession in a Node.js route. Point its model at OpenUI Cloud and append the generated OpenUI prompt.",- },- {- title: "Translate Pi events",- description:- "Write Pi text deltas to delta.content and its reasoning and tool executions to delta.tool_calls, one OpenAI chat.completion.chunk per NDJSON line.",- },- {- title: "Render with the NDJSON adapter",- description:- "Parse the stream with openAIReadableStreamAdapter(), then render the answers, reasoning, and tool activity with AgentInterface or your own UI built on ChatProvider.",- },- ],links: [{label: "Integration guide",@@ -595,24 +380,7 @@ const integrationCatalog: Integration[] = [summary:"To add generative UI to Open WebUI, install the OpenUI plugin to render charts, forms, tables, cards, and follow-ups directly inside Open WebUI conversations.",howItWorks:- "The plugin gives the model a render_openui tool and returns a self-contained HTML response. A sandboxed iframe loads the OpenUI browser bundle and renders the generated program inline.",- steps: [- {- title: "Install the tool",- description:- "Import the plugin from the Open WebUI community site, or create a tool in Admin > Tools and paste in the plugin's tool.py.",- },- {- title: "Enable it for a model",- description:- "Turn the tool on for the models or chats that should render UI. The model calls render_openui when an answer needs a chart, form, table, or card.",- },- {- title: "Choose where the bundle loads from",- description:- "The cdn_base_url valve sets where the OpenUI browser bundle loads from. By default it is the latest @openuidev/browser-bundle on jsDelivr.",- },- ],+ "The plugin gives the model a render_openui tool and returns a self-contained HTML response. Open WebUI shows it as an inline iframe embed, which loads the OpenUI browser bundle and renders the generated program.",links: [{label: "Plugin source",@@ -641,23 +409,6 @@ const integrationCatalog: Integration[] = [howItWorks:"@lynx-js/genui/openui incrementally parses OpenUI Lang, maps registered expressions to ReactLynx components, and renders them through Lynx's native pipeline while the host application owns its component definitions, tools, and actions.",install: "npm install @lynx-js/genui @lynx-js/react @lynx-js/lynx-ui",- steps: [- {- title: "Create the library",- description:- "Build a component library with createOpenUiLibrary() from @lynx-js/genui/openui, and import the renderer stylesheet from @lynx-js/genui/openui/styles/renderer.css.",- },- {- title: "Generate the agent instructions",- description:- "On the server, build the system prompt with buildOpenUiSystemPrompt() from @lynx-js/genui/openui/prompt.",- },- {- title: "Render with OpenUiRenderer",- description:- "Pass the full text received so far, not just the latest delta, to OpenUiRenderer with the library. Handle host-side effects such as navigation in onAction.",- },- ],links: [{label: "OpenUI integration guide",@@ -685,27 +436,10 @@ const integrationCatalog: Integration[] = [category: "frontend-platforms",type: "Native runtime",summary:- "To build generative UI in Vue, define your components with Zod schemas and render streamed OpenUI Lang with @openuidev/vue-lang. The UI updates progressively as the model's output arrives.",+ "To build generative UI in Vue, register Vue 3 single-file components with Zod schemas and render streamed OpenUI Lang with @openuidev/vue-lang. The Renderer component takes the response as a prop, and composables such as useTriggerAction connect your components to it.",howItWorks:- "Vue component definitions and Zod schemas form a shared library for prompt generation and rendering. The Vue Renderer updates progressively as OpenUI Lang arrives.",- install: "npm install @openuidev/vue-lang",- steps: [- {- title: "Define Vue components",- description:- "Register each Vue component with defineComponent and a Zod prop schema, then combine them with createLibrary.",- },- {- title: "Generate the system prompt",- description:- "Build the prompt from the same library with library.prompt(), or with generateSystemPrompt on the server, so the model only calls components the renderer knows.",- },- {- title: "Render the stream",- description:- "Bind the streamed text to the Renderer component's response prop along with library and is-streaming. Handle button and form actions with on-action.",- },- ],+ "Each SFC declares a props prop for the parsed values and a renderNode prop for nested content, and defineComponent pairs it with a Zod schema whose key order sets the positional arguments in OpenUI Lang. Renderer reports back through callback props such as onAction, onStateUpdate and onError rather than emitted events. Inside it, composables like useTriggerAction, useSetFieldValue and useIsStreaming give components access to actions, form state and streaming status.",+ install: "npm install @openuidev/vue-lang zod",links: [{ label: "Vue Lang API reference", href: "/docs/api-reference/vue-lang", kind: "Docs" },...packageLinks("@openuidev/vue-lang", "vue-lang"),@@ -721,38 +455,17 @@ const integrationCatalog: Integration[] = [category: "frontend-platforms",type: "Native runtime",summary:- "To build generative UI in Angular, define your components with Zod schemas and render streamed OpenUI Lang with @openuidev/angular-lang. The UI updates progressively as the model's output arrives.",+ "To build generative UI in Angular, register standalone components with Zod schemas and render streamed OpenUI Lang with the <openui-renderer> component from @openuidev/angular-lang. Results reach your app through outputs such as (action) and (error).",howItWorks:- "Standalone Angular components and Zod schemas form one library for prompt generation and rendering. The openui-renderer component resolves streamed statements into those components, and injection helpers give them access to actions, form state, and query loading.",+ "Each registered component accepts props, renderNode and statementId inputs, and defineComponent pairs its class with a Zod schema. The <openui-renderer> component takes response, library and isStreaming inputs, emits (action), (stateUpdate), (parseResult) and (error) outputs, and runs Query() and mutation calls through a toolProvider. Inside it, injection helpers such as injectTriggerAction and injectIsStreaming expose actions and streaming state, the latter as a Signal.",install: "npm install @openuidev/angular-lang zod rxjs",- steps: [- {- title: "Define Angular components",- description:- "Write standalone components that accept props, renderNode, and statementId inputs. Register each one with defineComponent and a Zod schema, then combine them with createLibrary.",- },- {- title: "Generate the system prompt",- description:- "Call library.prompt() in the app, or share the Zod schemas with a Node backend and use @openuidev/lang-core so the server never imports Angular classes.",- },- {- title: "Render with openui-renderer",- description:- "Import Renderer and bind response, library, and isStreaming. Handle the (action), (stateUpdate), and (error) outputs, and pass a toolProvider to run Query and Mutation calls.",- },- ],links: [{label: "Angular Lang API reference",href: "/docs/api-reference/angular-lang",kind: "Docs",},- ...packageLinks(- "@openuidev/angular-lang",- "angular-lang",- "/docs/api-reference/angular-lang",- ),+ ...packageLinks("@openuidev/angular-lang", "angular-lang"),exampleLink("app-frameworks/angular"),{ label: "Angular", href: "https://angular.dev", kind: "Website" },],@@ -767,24 +480,8 @@ const integrationCatalog: Integration[] = [summary:"To add generative UI to a React Native app, render model-generated interfaces in a native mobile chat application with a dedicated component library.",howItWorks:- "The reference project pairs a React Native chat app with a backend that prompts for OpenUI Lang. Native component definitions map the same structured response model to mobile views and actions.",- steps: [- {- title: "Describe the components on the backend",- description:- "Define the component vocabulary (Card, Text, and chart components) with defineComponent and createLibrary in a Node-compatible file, with renderers set to null. The CLI compiles it into the system prompt.",- },- {- title: "Stream plain text",- description:- "Return raw text/plain chunks from the chat route instead of SSE, so the mobile app can read the stream without a browser EventSource.",- },- {- title: "Render native components",- description:- "Use Renderer from @openuidev/react-lang in the Expo app with a library that maps the same component names to native views and charts.",- },- ],+ "The reference project pairs a React Native chat app with a backend that prompts for OpenUI Lang. Native component definitions map the same component names to mobile views and charts, and the app renders the streamed text as it arrives.",+ install: "npm install @openuidev/react-lang zod",links: [exampleLink("app-frameworks/react-native"),{ label: "React Native", href: "https://reactnative.dev", kind: "Website" },@@ -798,27 +495,10 @@ const integrationCatalog: Integration[] = [category: "frontend-platforms",type: "Native runtime",summary:- "To build generative UI in Svelte, define your components with Zod schemas and render streamed OpenUI Lang with @openuidev/svelte-lang. The UI updates progressively as the model's output arrives.",+ "To build generative UI in Svelte, register Svelte 5 components with Zod schemas and render streamed OpenUI Lang with @openuidev/svelte-lang. Components read parsed values with $props() and render nested output through a renderNode snippet.",howItWorks:- "Svelte component definitions and Zod schemas become one component library. The package generates the model prompt and its Renderer resolves streamed statements into Svelte components.",- install: "npm install @openuidev/svelte-lang",- steps: [- {- title: "Define Svelte components",- description:- "Pair each .svelte component with defineComponent and a Zod prop schema, then combine them with createLibrary.",- },- {- title: "Generate the system prompt",- description:- "Build the prompt from the same library with library.prompt(), or with generateSystemPrompt on the server, so the model only calls components the renderer knows.",- },- {- title: "Render the stream",- description:- "Pass the streamed text, the library, and isStreaming to the Renderer component. It resolves each statement into a Svelte component as it arrives.",- },- ],+ "Each .svelte component receives the parsed values as props and a renderNode snippet that it renders with {@render}. Renderer takes callbacks such as onAction and onStateUpdate as ordinary props, and context helpers like getTriggerAction and getIsStreaming give components access to actions and streaming state. The Svelte runtime covers components, simple actions and form state; unlike the React, Vue and Angular runtimes, it does not yet run Query() calls, Action([...]) step plans or $variable state.",+ install: "npm install @openuidev/svelte-lang zod",links: [{ label: "Svelte Lang API reference", href: "/docs/api-reference/svelte-lang", kind: "Docs" },...packageLinks("@openuidev/svelte-lang", "svelte-lang"),diff --git a/docs/app/(home)/integrations/guide-components.tsx b/docs/app/(home)/integrations/guide-components.tsxnew file mode 100644index 000000000..2eb0dd3f2--- /dev/null+++ b/docs/app/(home)/integrations/guide-components.tsx@@ -0,0 +1,159 @@+import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock";+import defaultMdxComponents from "fumadocs-ui/mdx";+import { ArrowUpRight } from "lucide-react";+import type { MDXComponents } from "mdx/types";+import Image from "next/image";+import { Children, Fragment, isValidElement, type ComponentProps, type ReactNode } from "react";+import styles from "./page.module.css";++/*+ * Components for content/integrations/<slug>.mdx. A guide is an optional+ * <Example> and a <Steps> list; inside each, prose goes in the text column and+ * code fences go beside it.+ */++/** The docs' code block, shown in full rather than in a 600px scroll box. */+function GuidePre(props: ComponentProps<"pre">) {+ return (+ <CodeBlock {...props} viewportProps={{ className: "max-h-none" }}>+ <Pre>{props.children}</Pre>+ </CodeBlock>+ );+}++/** A code fence. MDX wraps each one in a fragment around the `pre`. */+function isCode(node: ReactNode): boolean {+ if (!isValidElement<{ children?: ReactNode }>(node)) return false;+ if (node.type === GuidePre) return true;+ return node.type === Fragment && Children.toArray(node.props.children).some(isCode);+}++/** Separates code fences from the prose around them. */+function splitCode(children: ReactNode) {+ const text: ReactNode[] = [];+ const code: ReactNode[] = [];+ Children.forEach(children, (child) => (isCode(child) ? code : text).push(child));+ return { text, code };+}++function ExternalLink({ href, children }: { href: string; children: ReactNode }) {+ return (+ <a className={styles.stepCodeSource} href={href} rel="noopener noreferrer" target="_blank">+ {children}+ <ArrowUpRight size={13} aria-hidden="true" />+ </a>+ );+}++/**+ * A runnable example beside a screenshot of it answering `prompt`. Children are+ * the description and a code fence with the commands that run it, shown under the+ * screenshot. `image` is a path in public/ without the `-light.webp` / `-dark.webp`+ * suffix.+ */+function Example({+ prompt,+ image,+ width,+ height,+ alt,+ href,+ children,+}: {+ prompt: string;+ image: string;+ width: number;+ height: number;+ alt: string;+ href: string;+ children: ReactNode;+}) {+ const { text, code } = splitCode(children);++ return (+ <section className={styles.exampleSection} aria-labelledby="integration-example">+ <h2 id="integration-example">Example</h2>+ <div className={styles.exampleLayout}>+ <div className={styles.exampleText}>+ {text}+ <div>+ <p className={styles.exampleLabel}>Prompt</p>+ <blockquote className={styles.examplePrompt}>{prompt}</blockquote>+ </div>+ <ExternalLink href={href}>Open the example on GitHub</ExternalLink>+ </div>++ <div className={styles.exampleMedia}>+ <div className={styles.exampleShot}>+ {(["light", "dark"] as const).map((mode) => (+ <Image+ key={mode}+ className={mode === "light" ? styles.exampleShotLight : styles.exampleShotDark}+ src={`${image}-${mode}.webp`}+ width={width}+ height={height}+ alt={alt}+ sizes="(min-width: 1024px) 48rem, 100vw"+ />+ ))}+ </div>+ {/* Under the screenshot, where the commands have room to fit on one line. */}+ {code.length ? (+ <div>+ <p className={styles.exampleLabel}>Run it</p>+ {code}+ </div>+ ) : null}+ </div>+ </div>+ </section>+ );+}++function Steps({ children }: { children: ReactNode }) {+ return (+ <section className={styles.stepsSection}>+ <h2>Integration steps</h2>+ <ol className={styles.flowList}>{children}</ol>+ </section>+ );+}++/** One step: its text, and its code with a link to the complete `source` file. */+function Step({+ title,+ source,+ children,+}: {+ title: string;+ source?: string;+ children: ReactNode;+}) {+ const { text, code } = splitCode(children);++ return (+ <li>+ <div className={styles.flowText}>+ <span className={styles.flowNumber} aria-hidden="true" />+ <div>+ <h3>{title}</h3>+ {text}+ </div>+ </div>+ {code.length ? (+ <div className={styles.stepCode}>+ {code}+ {source ? <ExternalLink href={source}>View the full file</ExternalLink> : null}+ </div>+ ) : null}+ </li>+ );+}++export const guideComponents: MDXComponents = {+ ...defaultMdxComponents,+ pre: GuidePre,+ Example,+ Steps,+ Step,+};diff --git a/docs/app/(home)/integrations/page.module.css b/docs/app/(home)/integrations/page.module.cssindex 285479d9d..879623bf1 100644--- a/docs/app/(home)/integrations/page.module.css+++ b/docs/app/(home)/integrations/page.module.css@@ -323,6 +323,7 @@.detailHeroInner,.detailLayout,+.stepsSection,.detailBackRow {max-width: var(--home-container-max);margin-inline: auto;@@ -401,21 +402,39 @@line-height: 1.55;}+/* "Setup for Agent" copies the setup prompt. Lined up under the summary. */+.copyPrompt {+ display: flex;+ flex-wrap: wrap;+ gap: 0.75rem 1rem;+ align-items: center;+ margin: 1.75rem 0 0 calc(var(--detail-logo-size) + var(--detail-heading-gap));+}++.copyPromptStatus {+ margin: 0;+ color: var(--openui-text-neutral-tertiary);+ font-size: 0.875rem;+}+.detailLayout {display: grid;grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);gap: clamp(3rem, 8vw, 7rem);- padding-block: 5rem 7rem;+ padding-block: 5rem 4.5rem;}.detailArticle {display: grid;+ /* Don't stretch the intro to the sidebar's height. */+ align-content: start;gap: 4.5rem;min-width: 0;}.detailArticle section > h2,-.installSection h2 {+.installSection h2,+.stepsSection > h2 {max-width: 42rem;margin: 0;font-family: var(--home-font-display);@@ -433,20 +452,135 @@line-height: 1.75;}+.stepsSection {+ padding-bottom: 5rem;+}++/* ---- Example ----+ Same two columns as the steps: what the app does on the left, a screenshot of+ it answering the prompt on the right. */+.exampleSection {+ max-width: var(--home-container-max);+ margin-inline: auto;+ padding-inline: var(--home-section-padding-inline);+ padding-bottom: 4.5rem;+}++.exampleSection > h2 {+ margin: 0;+ font-family: var(--home-font-display);+ font-size: clamp(1.5rem, 3vw, 2rem);+ font-weight: 500;+ letter-spacing: -0.035em;+ line-height: 1.2;+}++.exampleLayout {+ display: grid;+ grid-template-columns: minmax(0, 1fr);+ gap: 2rem;+ margin-top: 1.75rem;+ padding-top: 2rem;+ border-top: 1px solid var(--home-hairline);+}++.exampleText {+ display: grid;+ /* An explicit track, so the run-it code block scrolls instead of widening the column. */+ grid-template-columns: minmax(0, 1fr);+ align-content: start;+ gap: 1.5rem;+ min-width: 0;+}++.exampleText > p {+ margin: 0;+ color: var(--openui-text-neutral-secondary);+ font-size: 0.9375rem;+ line-height: 1.65;+}++.exampleLabel {+ margin: 0 0 0.5rem;+ color: var(--openui-text-neutral-tertiary);+ font-family: var(--home-font-mono);+ font-size: 0.6875rem;+ letter-spacing: 0.04em;+ text-transform: uppercase;+}++.examplePrompt {+ margin: 0;+ border-left: 2px solid var(--openui-border-default);+ padding-left: 0.875rem;+ color: var(--openui-text-neutral-primary);+ font-size: 0.9375rem;+ line-height: 1.6;+}++.exampleMedia {+ display: grid;+ grid-template-columns: minmax(0, 1fr);+ gap: 1.5rem;+ min-width: 0;+}++.exampleShot {+ min-width: 0;+ overflow: hidden;+ border: 1px solid var(--home-hairline);+ border-radius: 1rem;+ background: var(--openui-sunk-light);+}++.exampleShot img {+ display: block;+ width: 100%;+ height: auto;+}++.exampleShot .exampleShotDark,+[data-theme="dark"] .exampleShot .exampleShotLight {+ display: none;+}++[data-theme="dark"] .exampleShot .exampleShotDark {+ display: block;+}++@media (min-width: 1024px) {+ .exampleLayout {+ grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);+ gap: 3rem;+ }+}+.flowList {+ counter-reset: step;display: grid;- gap: 0;+ /* Without an explicit track the column grows to the longest code line. */+ grid-template-columns: minmax(0, 1fr);margin: 1.75rem 0 0;padding: 0;list-style: none;}+/* Stacked on narrow screens; from 1024px the step's text sits beside its code+ and stays in view while the code scrolls past. */.flowList li {- position: relative;+ counter-increment: step;+ display: grid;+ grid-template-columns: minmax(0, 1fr);+ gap: 1.25rem;+ padding-block: 2rem;+ border-top: 1px solid var(--home-hairline);+}++.flowText {display: grid;grid-template-columns: auto minmax(0, 1fr);gap: 1rem;- padding: 0 0 1.75rem;+ align-self: start;}.flowNumber {@@ -464,17 +598,69 @@font-weight: 500;}+.flowNumber::before {+ content: counter(step);+}++/* Inline code and links in the guide prose (content/integrations/*.mdx). */+.flowText :not(pre) > code,+.exampleText :not(pre) > code {+ border-radius: 0.3rem;+ padding: 0.1em 0.35em;+ background: var(--openui-highlight-subtle);+ color: var(--openui-text-neutral-primary);+ font-family: var(--home-font-mono);+ font-size: 0.85em;+}++.flowText p a,+.exampleText p a {+ color: var(--openui-text-neutral-primary);+ text-decoration: underline;+ text-underline-offset: 0.2em;+}+.flowList h3 {- margin: 0.15rem 0 0;- font-size: 0.9375rem;+ margin: 0.2rem 0 0;+ font-size: 1.0625rem;font-weight: 500;}.flowList p {- margin: 0.45rem 0 0;+ margin: 0.5rem 0 0;color: var(--openui-text-neutral-secondary);- font-size: 0.875rem;- line-height: 1.6;+ font-size: 0.9375rem;+ line-height: 1.65;+}++.stepCode {+ min-width: 0;+}++.stepCodeSource {+ display: inline-flex;+ gap: 0.3rem;+ align-items: center;+ margin-top: 0.625rem;+ color: var(--openui-text-neutral-secondary);+ font-size: 0.8125rem;+}++.stepCodeSource:hover,+.stepCodeSource:focus-visible {+ color: var(--openui-text-neutral-primary);+}++@media (min-width: 1024px) {+ .flowList li {+ grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);+ gap: 3rem;+ }++ .flowText {+ position: sticky;+ top: 6rem;+ }}.installSection {@@ -500,7 +686,9 @@overflow-x: auto;font-family: var(--home-font-mono);font-size: 0.8125rem;- white-space: nowrap;+ /* Long install commands wrap rather than hide behind a scrollbar. */+ white-space: pre-wrap;+ overflow-wrap: anywhere;}.copyCommand {@@ -713,7 +901,8 @@white-space: normal;}- .detailLockup > p {+ .detailLockup > p,+ .copyPrompt {margin-left: 0;}diff --git a/docs/app/(home)/integrations/prompt.ts b/docs/app/(home)/integrations/prompt.tsnew file mode 100644index 000000000..6de3daec1--- /dev/null+++ b/docs/app/(home)/integrations/prompt.ts@@ -0,0 +1,77 @@+import { BASE_URL } from "@/lib/source";+import type { Integration } from "./data";++/*+ * The "Copy prompt" text: a self-contained brief a coding agent can follow to+ * add the integration to the reader's project, built from the page's metadata+ * and its content/integrations/<slug>.mdx guide.+ */++// A JSX attribute in the guide: name="value" or name={"value"}.+function attribute(tag: string, name: string): string | undefined {+ const match = tag.match(new RegExp(`${name}=(?:"([^"]*)"|\\{("(?:[^"\\\\]|\\\\.)*")\\})`));+ if (!match) return undefined;+ return match[1] ?? JSON.parse(match[2]);+}++// Guide prose escapes `{`, `}` and `<` for MDX, and code fences carry a title.+// Code inside the fences is left exactly as written.+function toMarkdown(mdx: string): string {+ let inCode = false;+ return mdx+ .split("\n")+ .map((line) => {+ const fence = line.match(/^```(\w+) title=(?:"([^"]*)"|\{"([^"]*)"\})$/);+ if (fence) {+ inCode = true;+ return `File: \`${fence[2] ?? fence[3]}\`\n\n\`\`\`${fence[1]}`;+ }+ if (line.startsWith("```")) {+ inCode = !inCode;+ return line;+ }+ return inCode ? line : line.replace(/\\([{}<])/g, "$1");+ })+ .join("\n")+ .trim();+}++function guideSteps(mdx: string): string {+ const steps = [...mdx.matchAll(/(<Step\b[^>]*>)([\s\S]*?)<\/Step>/g)];+ return steps+ .map(([, tag, body], index) => {+ const title = attribute(tag, "title") ?? `Step ${index + 1}`;+ const source = attribute(tag, "source");+ return [+ `### Step ${index + 1}: ${title}`,+ toMarkdown(body),+ ...(source ? [`Full file for reference: ${source}`] : []),+ ].join("\n\n");+ })+ .join("\n\n");+}++const absolute = (href: string) => (href.startsWith("/") ? `${BASE_URL}${href}` : href);++export function integrationPrompt(integration: Integration, guideMdx: string | undefined): string {+ const exampleTag = guideMdx?.match(/<Example\b[^>]*>/)?.[0];+ const exampleHref = exampleTag ? attribute(exampleTag, "href") : undefined;+ const steps = guideMdx ? guideSteps(guideMdx) : "";++ const linked = (href: string) => integration.links.some((link) => absolute(link.href) === href);+ const references = [+ ...(exampleHref && !linked(exampleHref) ? [`- Working example: ${exampleHref}`] : []),+ ...integration.links.map((link) => `- ${link.label} (${link.kind}): ${absolute(link.href)}`),+ ];++ return [+ `Help me integrate OpenUI with ${integration.name} in this project.`,+ `OpenUI renders a model's output as interactive UI components (generative UI) instead of plain text. ${integration.summary}`,+ `How it connects: ${integration.howItWorks}`,+ `Full guide: ${BASE_URL}/integrations/${integration.slug}`,+ ...(integration.install ? [`Install:\n\n\`\`\`bash\n${integration.install}\n\`\`\``] : []),+ ...(steps ? [`## Steps\n\n${steps}`] : []),+ "Adapt file paths, names and the model or provider setup to this project instead of copying the example as is, and use the package versions it already has where they're compatible. When you're done, summarize what you changed.",+ `## References\n\n${references.join("\n")}`,+ ].join("\n\n");+}diff --git a/docs/app/(home)/sections/Footer/Footer.module.css b/docs/app/(home)/sections/Footer/Footer.module.cssindex dda110954..8a7b036c7 100644--- a/docs/app/(home)/sections/Footer/Footer.module.css+++ b/docs/app/(home)/sections/Footer/Footer.module.css@@ -24,6 +24,66 @@margin-inline: auto;}+/* ---- Integration links ----+ One column per catalog category, above the brand row, so every page links to+ every integration page. */+.integrations {+ display: grid;+ gap: 1.25rem;+ padding-bottom: 3.5rem;+}++.integrationsTitle {+ justify-self: start;+ font-size: 0.875rem;+ font-weight: 500;+ color: var(--openui-text-neutral-primary);+}++.integrationsTitle:hover,+.integrationsTitle:focus-visible {+ text-decoration: underline;+ text-underline-offset: 0.2em;+}++.integrationColumns {+ display: grid;+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 2rem 1.5rem;+}++.integrationCategory {+ margin: 0 0 0.75rem;+ font-size: 0.75rem;+ color: var(--openui-text-neutral-tertiary);+}++.integrationList {+ display: grid;+ gap: 0.5rem;+ margin: 0;+ padding: 0;+ list-style: none;+}++.integrationList a {+ font-size: 0.875rem;+ line-height: 1.4;+ color: var(--openui-text-neutral-secondary);+ transition: color 0.15s ease;+}++.integrationList a:hover,+.integrationList a:focus-visible {+ color: var(--openui-text-neutral-primary);+}++@media (min-width: 768px) {+ .integrationColumns {+ grid-template-columns: repeat(3, minmax(0, 1fr));+ }+}+/* The mark and the theme control face each other across the footer's width. */.brandRow {display: grid;diff --git a/docs/app/(home)/sections/Footer/Footer.tsx b/docs/app/(home)/sections/Footer/Footer.tsxindex f689a2977..336fffa6f 100644--- a/docs/app/(home)/sections/Footer/Footer.tsx+++ b/docs/app/(home)/sections/Footer/Footer.tsx@@ -1,9 +1,9 @@-"use client";+import { getIntegrationsByCategory, integrationCategories } from "@/app/(home)/integrations/data";import svgPaths from "@/imports/svg-urruvoh2be";-import { Monitor, Moon, Sun } from "@phosphor-icons/react";-import { useTheme } from "next-themes";-import { useId, useSyncExternalStore } from "react";+import Link from "next/link";+import { useId } from "react";import styles from "./Footer.module.css";+import { ThemeTabs } from "./ThemeTabs";// ---------------------------------------------------------------------------// Data@@ -122,51 +122,30 @@ function ThesysLogo() {);}-// A segmented control rather than the header's single swap button: down here the-// current choice is worth showing, and "system" has no opposite to swap to.-// System sits in the middle, between the two it can resolve to.-const THEMES = [- { id: "light", label: "Light", Icon: Sun },- { id: "system", label: "System", Icon: Monitor },- { id: "dark", label: "Dark", Icon: Moon },-] as const;--// Never fires: the value we want differs only between the server snapshot and-// the client one, which is precisely the "have we hydrated yet" signal.-const NEVER_CHANGES = () => () => {};--function ThemeTabs() {- // `theme`, not `resolvedTheme`: the latter resolves "system" to light or dark,- // which would light up the wrong segment.- const { setTheme, theme } = useTheme();- // The server has no theme to render, so nothing is marked active until mount.- // Read as an external store rather than set from an effect, which would kick- // off a second render on every mount.- const mounted = useSyncExternalStore(- NEVER_CHANGES,- () => true,- () => false,- );- const active = mounted ? theme : undefined;-+// Every integration page, one column per category. Rendered on the server so the+// catalog never ships to the client, and read from the catalog so a new page is+// linked from every footer without touching this file.+function IntegrationLinks() {return (- <div className={styles.themeTabs} role="group" aria-label="Colour theme">- {THEMES.map(({ id, label, Icon }) => (- <button- key={id}- type="button"- className={`${styles.themeTab} ${active === id ? styles.themeTabActive : ""}`.trim()}- aria-pressed={active === id}- aria-label={`Use ${label.toLowerCase()} theme`}- title={`Use ${label.toLowerCase()} theme`}- onClick={() => setTheme(id)}- >- {/* Line weight rather than fill: at 16px the solid shapes read as- blobs, and the outline matches the social row below. */}- <Icon className={styles.themeTabIcon} weight="regular" aria-hidden="true" />- </button>- ))}- </div>+ <nav className={styles.integrations} aria-labelledby="footer-integrations">+ <Link className={styles.integrationsTitle} href="/integrations" id="footer-integrations">+ Integrations+ </Link>+ <div className={styles.integrationColumns}>+ {integrationCategories.map((category) => (+ <div key={category.id}>+ <p className={styles.integrationCategory}>{category.shortTitle}</p>+ <ul className={styles.integrationList}>+ {getIntegrationsByCategory(category.id).map((integration) => (+ <li key={integration.slug}>+ <Link href={`/integrations/${integration.slug}`}>{integration.name}</Link>+ </li>+ ))}+ </ul>+ </div>+ ))}+ </div>+ </nav>);}@@ -180,6 +159,8 @@ export function Footer() {{/* Footer content */}<div className={styles.contentSection}><div className={styles.contentContainer}>+ <IntegrationLinks />+{/* Mark on the left, theme control on the right, sitting directly onthe separator below. */}<div className={styles.brandRow}>diff --git a/docs/app/(home)/sections/Footer/ThemeTabs.tsx b/docs/app/(home)/sections/Footer/ThemeTabs.tsxnew file mode 100644index 000000000..32c222ef4--- /dev/null+++ b/docs/app/(home)/sections/Footer/ThemeTabs.tsx@@ -0,0 +1,53 @@+"use client";+import { Monitor, Moon, Sun } from "@phosphor-icons/react";+import { useTheme } from "next-themes";+import { useSyncExternalStore } from "react";+import styles from "./Footer.module.css";++// A segmented control rather than the header's single swap button: down here the+// current choice is worth showing, and "system" has no opposite to swap to.+// System sits in the middle, between the two it can resolve to.+const THEMES = [+ { id: "light", label: "Light", Icon: Sun },+ { id: "system", label: "System", Icon: Monitor },+ { id: "dark", label: "Dark", Icon: Moon },+] as const;++// Never fires: the value we want differs only between the server snapshot and+// the client one, which is precisely the "have we hydrated yet" signal.+const NEVER_CHANGES = () => () => {};++export function ThemeTabs() {+ // `theme`, not `resolvedTheme`: the latter resolves "system" to light or dark,+ // which would light up the wrong segment.+ const { setTheme, theme } = useTheme();+ // The server has no theme to render, so nothing is marked active until mount.+ // Read as an external store rather than set from an effect, which would kick+ // off a second render on every mount.+ const mounted = useSyncExternalStore(+ NEVER_CHANGES,+ () => true,+ () => false,+ );+ const active = mounted ? theme : undefined;++ return (+ <div className={styles.themeTabs} role="group" aria-label="Colour theme">+ {THEMES.map(({ id, label, Icon }) => (+ <button+ key={id}+ type="button"+ className={`${styles.themeTab} ${active === id ? styles.themeTabActive : ""}`.trim()}+ aria-pressed={active === id}+ aria-label={`Use ${label.toLowerCase()} theme`}+ title={`Use ${label.toLowerCase()} theme`}+ onClick={() => setTheme(id)}+ >+ {/* Line weight rather than fill: at 16px the solid shapes read as+ blobs, and the outline matches the social row below. */}+ <Icon className={styles.themeTabIcon} weight="regular" aria-hidden="true" />+ </button>+ ))}+ </div>+ );+}diff --git a/docs/content/docs/agent/reference/adapters-and-formats.mdx b/docs/content/docs/agent/reference/adapters-and-formats.mdxindex 0a17f66be..67de8fae8 100644--- a/docs/content/docs/agent/reference/adapters-and-formats.mdx+++ b/docs/content/docs/agent/reference/adapters-and-formats.mdx@@ -368,15 +368,15 @@ interface StreamProtocolAdapter {Start from your provider and how the route streams its reply. The stream adapter and message format are independent knobs — pick the adapter to match how your backend _streams_, and the format to match how it represents _stored_ messages — but they typically pair up as below.-| Your backend streams… | Stream adapter | Pair with message format |-| ------------------------------------------------------------------ | ------------------------------- | --------------------------------- |-| OpenAI **Chat Completions** SSE (`data: {…}` lines) | `openAIAdapter()` | `openAIMessageFormat` |-| OpenAI SDK `stream.toReadableStream()` (NDJSON, no `data:` prefix) | `openAIReadableStreamAdapter()` | `openAIMessageFormat` |-| OpenAI **Responses / Conversations** API SSE | `openAIResponsesAdapter()` | `openAIConversationMessageFormat` |-| **Vercel AI SDK v6** UIMessage SSE (`toUIMessageStreamResponse()`) | `vercelAIAdapter()` | `vercelAIMessageFormat` |-| **LangGraph** named-event SSE (`event: messages\ndata: …`) | `langGraphAdapter()` | `langGraphMessageFormat` |-| **Vercel Eve** session stream (NDJSON harness events) | `eveAdapter()` | — (Eve keeps the transcript) |-| Already AG-UI events (your route emits AG-UI SSE directly) | `agUIAdapter()` | `identityMessageFormat` (default) |+| Your backend streams… | Stream adapter | Pair with message format |+| ------------------------------------------------------------------------ | ------------------------------- | --------------------------------- |+| OpenAI **Chat Completions** SSE (`data: {…}` lines) | `openAIAdapter()` | `openAIMessageFormat` |+| OpenAI SDK `stream.toReadableStream()` (NDJSON, no `data:` prefix) | `openAIReadableStreamAdapter()` | `openAIMessageFormat` |+| OpenAI **Responses / Conversations** API SSE | `openAIResponsesAdapter()` | `openAIConversationMessageFormat` |+| **Vercel AI SDK v6 or v7** UIMessage SSE (`toUIMessageStreamResponse()`) | `vercelAIAdapter()` | `vercelAIMessageFormat` |+| **LangGraph** named-event SSE (`event: messages\ndata: …`) | `langGraphAdapter()` | `langGraphMessageFormat` |+| **Vercel Eve** session stream (NDJSON harness events) | `eveAdapter()` | — (Eve keeps the transcript) |+| Already AG-UI events (your route emits AG-UI SSE directly) | `agUIAdapter()` | `identityMessageFormat` (default) |Wrapping Anthropic, or any provider with no bundled adapter? You have two paths: translate to AG-UI events server-side and use `agUIAdapter()`, or re-emit your provider's stream as OpenAI Completions SSE and use `openAIAdapter()`.@@ -456,14 +456,14 @@ const llm = fetchLLM({});```-- **Wire shape:** Vercel AI SDK v6 UIMessage SSE, as returned by `result.toUIMessageStreamResponse()`.+- **Wire shape:** Vercel AI SDK v6 or v7 UIMessage SSE, as returned by `result.toUIMessageStreamResponse()`.- **What it handles:** streamed text, streamed or complete tool input, successful, failed, or denied tool output, and SDK error chunks. The adapter delegates SSE decoding and chunk validation to the Vercel AI SDK, then projects the validated chunks into AG-UI events.- **Current scope:** reasoning, sources, assistant files, custom data, metadata, and tool-approval-request chunks have no equivalent in the current AgentInterface stream processor and are ignored. Approval-gated tools therefore need a custom flow today. Provider-executed tool chunks (`providerExecuted: true`) are rejected because AG-UI cannot preserve their assistant-contained result semantics.- **When to use:** Your route uses Vercel AI SDK `streamText()` and returns its UIMessage stream response. Pair with `vercelAIMessageFormat` so the route receives `UIMessage[]` that can be passed to `convertToModelMessages()`.<Callout type="info">- Install `ai@^6` alongside `@openuidev/react-ui` or `@openuidev/react-headless` when using this- integration. It is an optional peer dependency, so apps using other adapters do not need the+ Install `ai` (v6 or v7) alongside `@openuidev/react-ui` or `@openuidev/react-headless` when using+ this integration. It is an optional peer dependency, so apps using other adapters do not need theVercel AI SDK.</Callout>@@ -583,7 +583,7 @@ import { openAIConversationMessageFormat } from "@openuidev/react-ui";import { vercelAIMessageFormat } from "@openuidev/react-ui";```-- **Shape:** Vercel AI SDK v6 `UIMessage[]`, whose content is represented as typed `parts`.+- **Shape:** Vercel AI SDK v6 or v7 `UIMessage[]`, whose content is represented as typed `parts`.- **Conversions:** text and file inputs become UIMessage parts; AG-UI tool calls become `dynamic-tool` parts; separate AG-UI tool-result messages are folded into the matching tool part as an available or errored output. Inbound conversion accepts both `dynamic-tool` and statically named `tool-*` parts and expands completed outputs back into separate tool messages. (`developer` maps to `system`.)- **Unsupported and lossy fields:** this integration does not currently preserve reasoning, sources, custom data, assistant files, or approvals when converting stored messages. Provider-executed tool parts (`providerExecuted: true`) are rejected rather than converted; other provider metadata is not preserved.- **When to use:** Pair with `vercelAIAdapter()` and pass the received messages to Vercel AI SDK's `convertToModelMessages()` in your route.diff --git a/docs/content/docs/agent/reference/self-hosting.mdx b/docs/content/docs/agent/reference/self-hosting.mdxindex 2c6865cc7..09d8ad614 100644--- a/docs/content/docs/agent/reference/self-hosting.mdx+++ b/docs/content/docs/agent/reference/self-hosting.mdx@@ -47,14 +47,14 @@ Your route always receives a JSON body of `{ threadId, messages }` and returns a`streamAdapter` governs the **response** (how the streamed bytes are decoded); `messageFormat` governs the **request** (how outgoing `messages` are shaped). They are chosen independently but pair up by provider. Each adapter is a factory — **call it**: `openAIAdapter()`, not the bare reference.-| Provider / route output | `streamAdapter` | `messageFormat` |-| -------------------------------------------------------------------- | ------------------------------- | ---------------------------------- |-| OpenAI Chat Completions, NDJSON from `stream.toReadableStream()` | `openAIReadableStreamAdapter()` | `openAIMessageFormat` |-| OpenAI Chat Completions, raw SSE (`data: {…}\n\n`, `data: [DONE]`) | `openAIAdapter()` | `openAIMessageFormat` |-| OpenAI **Responses / Conversations** API stream | `openAIResponsesAdapter()` | `openAIConversationMessageFormat` |-| Vercel AI SDK v6 UIMessage stream from `toUIMessageStreamResponse()` | `vercelAIAdapter()` | `vercelAIMessageFormat` |-| LangGraph stream (named SSE events) | `langGraphAdapter()` | `langGraphMessageFormat` |-| A backend that already emits AG-UI events | `agUIAdapter()` | depends on what your route expects |+| Provider / route output | `streamAdapter` | `messageFormat` |+| -------------------------------------------------------------------------- | ------------------------------- | ---------------------------------- |+| OpenAI Chat Completions, NDJSON from `stream.toReadableStream()` | `openAIReadableStreamAdapter()` | `openAIMessageFormat` |+| OpenAI Chat Completions, raw SSE (`data: {…}\n\n`, `data: [DONE]`) | `openAIAdapter()` | `openAIMessageFormat` |+| OpenAI **Responses / Conversations** API stream | `openAIResponsesAdapter()` | `openAIConversationMessageFormat` |+| Vercel AI SDK v6 or v7 UIMessage stream from `toUIMessageStreamResponse()` | `vercelAIAdapter()` | `vercelAIMessageFormat` |+| LangGraph stream (named SSE events) | `langGraphAdapter()` | `langGraphMessageFormat` |+| A backend that already emits AG-UI events | `agUIAdapter()` | depends on what your route expects |The full catalogue and the precise wire format each adapter expects are in [Adapters & formats](/docs/agent/reference/adapters-and-formats).@@ -137,9 +137,12 @@ export async function POST(req: Request) {const messageId = crypto.randomUUID();try {- const anthropicStream = anthropic.messages.stream({- model: "claude-3-5-sonnet-latest",- max_tokens: 1024,+ const anthropicStream = anthropic.beta.messages.stream({+ model: "claude-opus-5-5",+ max_tokens: 64000,+ // If the model declines, Anthropic re-runs the request on a fallback model.+ betas: ["server-side-fallback-2026-07-01"],+ fallbacks: "default",system: system || undefined,messages: turns,});diff --git a/docs/content/docs/api-reference/react-headless.mdx b/docs/content/docs/api-reference/react-headless.mdxindex 2f3705991..0639cf704 100644--- a/docs/content/docs/api-reference/react-headless.mdx+++ b/docs/content/docs/api-reference/react-headless.mdx@@ -138,7 +138,7 @@ Adapters referenced in integration guides:function openAIAdapter(): StreamProtocolAdapter; // OpenAI Chat Completions streamfunction openAIResponsesAdapter(): StreamProtocolAdapter; // OpenAI Responses streamfunction openAIReadableStreamAdapter(): StreamProtocolAdapter; // OpenAI ReadableStream-function vercelAIAdapter(): StreamProtocolAdapter; // Vercel AI SDK v6 UIMessage stream+function vercelAIAdapter(): StreamProtocolAdapter; // Vercel AI SDK v6 or v7 UIMessage streamfunction agUIAdapter(): StreamProtocolAdapter; // AG-UI protocol streamfunction langGraphAdapter(options?: LangGraphAdapterOptions): StreamProtocolAdapter; // LangGraph named-event SSEfunction eveAdapter(options?: EveAdapterOptions): StreamProtocolAdapter; // Vercel Eve NDJSON session stream@@ -159,7 +159,7 @@ Converters referenced in integration guides:```tsconst openAIMessageFormat: MessageFormat; // Chat Completions formatconst openAIConversationMessageFormat: MessageFormat; // Responses/Conversations item format-const vercelAIMessageFormat: MessageFormat; // Vercel AI SDK v6 UIMessage format+const vercelAIMessageFormat: MessageFormat; // Vercel AI SDK v6 or v7 UIMessage formatconst langGraphMessageFormat: MessageFormat; // LangGraph / LangChain message formatconst identityMessageFormat: MessageFormat; // Pass-through (no conversion)```diff --git a/docs/content/integrations/ag-ui.mdx b/docs/content/integrations/ag-ui.mdxnew file mode 100644index 000000000..9369dd980--- /dev/null+++ b/docs/content/integrations/ag-ui.mdx@@ -0,0 +1,116 @@+---+title: "AG-UI"+---++<Example+ prompt="Compare the weather in Tokyo, London and New York right now."+ image="/integrations/examples/ag-ui"+ width={1600}+ height={1050}+ alt="An AG-UI agent answering a request to compare the weather in three cities. The tool calls arrive as AG-UI events, and OpenUI renders a card for each city and a table of temperatures and conditions."+ href="https://github.com/thesysdev/openui/tree/main/examples/agent-frameworks/google-adk"+>++OpenUI renders any AG-UI stream the same way. This screenshot comes from the Google ADK example: its route turns ADK events into AG-UI events, and `agUIAdapter()` reads them in the browser. Its `get_weather` tool returns sample data. The steps below build the same kind of endpoint without a framework, following the self-hosting guide's Anthropic recipe.++```bash title="Terminal"+cd examples/agent-frameworks/google-adk+pnpm install --ignore-workspace+pnpm generate:apiKey # writes THESYS_API_KEY to .env.local+pnpm dev+```++</Example>++<Steps>++<Step title="Prompt your agent for OpenUI Lang" source="https://www.openui.com/docs/build-agents/ui-generation">++Generate the system prompt from the same component library the client renders, so the agent's text output is OpenUI Lang the renderer understands.++```ts title="server.ts"+import { generateSystemPrompt, type LibrarySpec } from "@openuidev/lang-core";+// Your component library's spec, written by `openui generate --spec`.+import library from "./lib/openui.spec.json";++// The complete prompt, ready to send to any model.+const openuiInstructions = generateSystemPrompt({+ library: library as LibrarySpec,+});+```++</Step>++<Step title="Serve AG-UI events" source="https://www.openui.com/docs/agent/reference/self-hosting">++Expose the agent as a server-sent events endpoint whose `data:` lines are AG-UI events: `TEXT_MESSAGE_*` for text, `TOOL_CALL_*` and `TOOL_CALL_RESULT` for tools, and `RUN_ERROR` for failures. Closing the stream ends the run. This route translates Anthropic's stream; an agent framework that already emits AG-UI events can replace it.++```ts title="app/api/chat/route.ts"+import Anthropic from "@anthropic-ai/sdk";++const anthropic = new Anthropic(); // Reads ANTHROPIC_API_KEY from the environment.+const encoder = new TextEncoder();++export async function POST(req: Request) {+ const { messages } = await req.json(); // { role, content } turns (openAIMessageFormat)+ const stream = new ReadableStream({+ async start(controller) {+ // Each AG-UI event goes out as one SSE "data:" line.+ const send = (event: object) =>+ controller.enqueue(encoder.encode(`data: ${JSON.stringify(event)}\n\n`));+ const messageId = crypto.randomUUID();+ try {+ const reply = anthropic.beta.messages.stream({+ model: "claude-opus-5-5",+ max_tokens: 64000,+ // If the model declines, Anthropic re-runs the request on a fallback model.+ betas: ["server-side-fallback-2026-07-01"],+ fallbacks: "default",+ system: openuiInstructions, // The OpenUI Lang prompt from step 1.+ messages: messages.filter((m: { role: string }) => m.role !== "system"),+ });+ send({ type: "TEXT_MESSAGE_START", messageId });+ for await (const chunk of reply) {+ if (chunk.type === "content_block_delta" && chunk.delta.type === "text_delta") {+ send({ type: "TEXT_MESSAGE_CONTENT", messageId, delta: chunk.delta.text });+ }+ }+ send({ type: "TEXT_MESSAGE_END", messageId });+ } catch (err) {+ send({ type: "RUN_ERROR", message: (err as Error).message });+ }+ controller.close(); // Closing the stream ends the run in the UI.+ },+ });+ return new Response(stream, { headers: { "Content-Type": "text/event-stream" } });+}+```++</Step>++<Step title="Connect the adapter" source="https://www.openui.com/docs/agent/reference/self-hosting">++Point `fetchLLM`, or your own `ChatLLM` implementation, at the endpoint with `agUIAdapter()` as the stream adapter. Then pass it to `AgentInterface` for a ready-made chat app, or to `ChatProvider` from `@openuidev/react-headless` for your own UI.++```tsx title="app/page.tsx"+"use client";++import { AgentInterface, agUIAdapter, fetchLLM, openAIMessageFormat } from "@openuidev/react-ui";+// Your component library: the one step 1's spec was generated from.+import { library } from "@/lib/openui";++const llm = fetchLLM({+ url: "/api/chat",+ streamAdapter: agUIAdapter(),+ // Sends OpenAI-style { role, content } turns, which the route forwards to Anthropic.+ messageFormat: openAIMessageFormat,+});++export default function Page() {+ return <AgentInterface llm={llm} componentLibrary={library} />;+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/angular.mdx b/docs/content/integrations/angular.mdxnew file mode 100644index 000000000..914c41459--- /dev/null+++ b/docs/content/integrations/angular.mdx@@ -0,0 +1,112 @@+---+title: "Angular"+---++<Steps>++<Step title="Define a standalone component" source="https://www.openui.com/docs/api-reference/angular-lang">++Give the component props, renderNode and statementId inputs, which the renderer sets on every instance, and register its class with defineComponent and a Zod schema. Use optional access in the template, since props can be incomplete while the model streams.++```ts title="library.ts"+import { Component, Input } from "@angular/core";+import { createLibrary, defineComponent } from "@openuidev/angular-lang";+import { z } from "zod/v4";++@Component({+ selector: "demo-greeting",+ template: `<p>Hello, {{ props?.name }}!</p>`,+})+export class GreetingComponent {+ // The renderer sets these three inputs on every instance.+ @Input() props: { name?: string } | null = null;+ @Input() renderNode: ((value: unknown) => unknown) | null = null;+ @Input() statementId: string | undefined;+}++const Greeting = defineComponent({+ name: "Greeting",+ description: "Greet the user by name.",+ props: z.object({ name: z.string() }),+ component: GreetingComponent,+});++export const library = createLibrary({+ components: [Greeting],+ root: "Greeting",+});+```++</Step>++<Step title="Generate the prompt on a Node server" source="https://github.com/thesysdev/openui/blob/main/examples/app-frameworks/angular/server/library.mjs">++Keep the Zod schemas in a file both sides import, and rebuild the library on the server with @openuidev/lang-core ^0.4 and component: null so it never loads Angular classes. The example's build script passes library.toSpec() to generateSystemPrompt and writes the prompt to a file the server reads.++```js title="server/library.mjs"+import { createLibrary, defineComponent, generateSystemPrompt } from "@openuidev/lang-core";+import { z } from "zod/v4";+// { Name: { description, props } } for each component, plus prompt rules and examples.+// The Angular app's library imports the same file and adds the component classes.+import { definitions, promptOptions } from "../src/app/openui/schema.ts";++// component: null keeps Angular classes out of the Node process.+const blocks = Object.entries(definitions).map(([name, definition]) =>+ defineComponent({ name, ...definition, component: null }),+);+const root = defineComponent({+ name: "Response",+ description: "Root container for every assistant message.",+ props: z.object({ children: z.array(z.union(blocks.map((block) => block.ref))) }),+ component: null,+});++export const library = createLibrary({ root: "Response", components: [root, ...blocks] });++// The example runs this in scripts/generate.mjs and saves the result to a file.+export const systemPrompt = generateSystemPrompt({+ library: library.toSpec(),+ promptOptions,+});+```++</Step>++<Step title="Render with openui-renderer" source="https://www.openui.com/docs/api-reference/angular-lang">++Add Renderer to the host component's imports, bind [response], [library] and [isStreaming], and handle (action) to send the next turn. The same element also emits (stateUpdate) and (error) and accepts a [toolProvider] for Query() and mutation calls.++```ts title="assistant-message.ts"+import { Component, Input } from "@angular/core";+import { BuiltinActionType, Renderer, type ActionEvent } from "@openuidev/angular-lang";+// The library from library.ts.+import { library } from "./library";++@Component({+ selector: "assistant-message",+ imports: [Renderer],+ template: `+ <openui-renderer+ [response]="response"+ [library]="library"+ [isStreaming]="isStreaming"+ (action)="handleAction($event)"+ />+ `,+})+export class AssistantMessageComponent {+ @Input() response: string | null = null;+ @Input() isStreaming = false;+ readonly library = library;++ handleAction(event: ActionEvent): void {+ if (event.type === BuiltinActionType.ContinueConversation && event.humanFriendlyMessage) {+ // Send event.humanFriendlyMessage to your chat as the next user message.+ }+ }+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/assistant-ui.mdx b/docs/content/integrations/assistant-ui.mdxnew file mode 100644index 000000000..17cfd4183--- /dev/null+++ b/docs/content/integrations/assistant-ui.mdx@@ -0,0 +1,105 @@+---+title: "assistant-ui"+---++<Steps>++<Step title="Register the OpenUI toolkit" source="https://www.openui.com/docs/api-reference/assistant-ui">++Inside AssistantRuntimeProvider, add openuiIntegration.toolkit through AuiConfig and pass openuiIntegration.instructions to useAssistantInstructions.++```tsx title="src/components/openui-config-provider.tsx"+"use client";++import type { ReactNode } from "react";+import {+ AuiConfig,+ AuiProvider,+ Tools,+ useAui,+ useAssistantInstructions,+} from "@assistant-ui/react";+import { openuiIntegration } from "@openuidev/assistant-ui";++function OpenUIModelInstructions() {+ useAssistantInstructions(openuiIntegration.instructions);+ return null;+}++// Render this inside AssistantRuntimeProvider (next step).+export function OpenUIConfigProvider({ children }: { children: ReactNode }) {+ const aui = useAui();+ const config = AuiConfig({+ tools: Tools({ toolkit: openuiIntegration.toolkit }),+ });++ return (+ <AuiProvider extends={aui} config={config}>+ <OpenUIModelInstructions />+ {children}+ </AuiProvider>+ );+}+```++</Step>++<Step title="Let the model call the OpenUI tools" source="https://www.openui.com/docs/api-reference/assistant-ui">++present_openui renders complete cards, tables, and charts. prompt_openui renders forms and choices, and completes only when the user submits a result. With an AI SDK runtime, shouldContinueAfterOpenUIPrompt starts the next model step only after a prompt_openui result.++```tsx title="src/components/openui-runtime-provider.tsx"+"use client";++import type { ReactNode } from "react";+import { AssistantRuntimeProvider } from "@assistant-ui/react";+import { useChatRuntime } from "@assistant-ui/react-ai-sdk";+import { shouldContinueAfterOpenUIPrompt } from "@openuidev/assistant-ui/ai-sdk";+// The provider from step 1.+import { OpenUIConfigProvider } from "./openui-config-provider";++export function OpenUIRuntimeProvider({ children }: { children: ReactNode }) {+ // The runtime's chat transport forwards both OpenUI tools to your backend.+ // Continue once prompt_openui has the user's answer; a finished+ // present_openui call is the final response and starts no new step.+ const runtime = useChatRuntime({+ sendAutomaticallyWhen: shouldContinueAfterOpenUIPrompt,+ });++ return (+ <AssistantRuntimeProvider runtime={runtime}>+ <OpenUIConfigProvider>{children}</OpenUIConfigProvider>+ </AssistantRuntimeProvider>+ );+}+```++</Step>++<Step title="Bring your own components" source="https://www.openui.com/docs/api-reference/assistant-ui">++Call createOpenUIIntegration with your own library so the tool schemas, model instructions, and renderers share one component vocabulary.++```ts title="src/lib/openui-integration.ts"+import { createOpenUIIntegration } from "@openuidev/assistant-ui";+import { createShouldContinueAfterOpenUIPrompt } from "@openuidev/assistant-ui/ai-sdk";+// Your component library, made with createLibrary from @openuidev/react-lang.+import { library } from "@/lib/openui";++// Use openui.toolkit and openui.instructions in place of openuiIntegration.+// The tool names are optional; these replace present_openui and prompt_openui.+export const openui = createOpenUIIntegration({+ library,+ presentToolName: "show_panel",+ promptToolName: "ask_panel",+});++// Pass this to useChatRuntime as sendAutomaticallyWhen when you rename the tools.+export const shouldContinue = createShouldContinueAfterOpenUIPrompt({+ promptToolName: openui.toolNames.prompt,+});+```++</Step>++</Steps>diff --git a/docs/content/integrations/google-adk.mdx b/docs/content/integrations/google-adk.mdxnew file mode 100644index 000000000..8f7701097--- /dev/null+++ b/docs/content/integrations/google-adk.mdx@@ -0,0 +1,106 @@+---+title: "Google ADK"+---++<Steps>++<Step title="Define the agent" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/google-adk/src/agent.ts">++Create an ADK Agent with FunctionTool tools and use the generated OpenUI system prompt as its instruction. The example calls OpenUI Cloud through adk-llm-bridge's Custom() model adapter.++```ts title="src/agent.ts"+import { Agent, FunctionTool } from "@google/adk";+import { Custom } from "adk-llm-bridge";+import { z } from "zod";+// Builds the OpenUI system prompt from your component library.+import { cloudInstructions } from "@/lib/cloud-prompt";++const getWeather = new FunctionTool({+ name: "get_weather",+ description: "Get the current weather for a given city.",+ parameters: z.object({ city: z.string() }),+ execute: ({ city }) => {+ // Call your weather API here.+ },+});++export function createAgent() {+ return new Agent({+ name: "openui-adk-agent",+ model: Custom("google/gemini-3.6-flash-free", {+ name: "openui-adk-agent",+ baseURL: "https://api.thesys.dev/v1/embed",+ apiKey: process.env.THESYS_API_KEY,+ }),+ instruction: cloudInstructions(),+ tools: [getWeather],+ });+}+```++</Step>++<Step title="Bridge events to AG-UI" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/google-adk/src/app/api/chat/route.ts">++Run the agent with a Runner and pass its events through the example's adkToAguiEvents() helper, which turns ADK text, functionCall and functionResponse parts into AG-UI events. Stream them to the browser as server-sent events.++```ts title="src/app/api/chat/route.ts"+import { InMemorySessionService, Runner, StreamingMode } from "@google/adk";+import { createAgent } from "@/agent";+// Maps ADK events to AG-UI events. Copy src/lib/adk-to-agui.ts from the example.+import { adkToAguiEvents } from "@/lib/adk-to-agui";++const runner = new Runner({+ appName: "openui-adk-chat",+ agent: createAgent(),+ sessionService: new InMemorySessionService(),+});++export async function POST(req: Request) {+ // Read the last user message into `prompt`, and find or create the ADK+ // session (`sessionId`) for this chat's `threadId`.++ const events = runner.runAsync({+ userId: "demo-user",+ sessionId,+ newMessage: { parts: [{ text: prompt }] },+ runConfig: { streamingMode: StreamingMode.SSE },+ });++ const encoder = new TextEncoder();+ const stream = new ReadableStream({+ async start(controller) {+ const runId = crypto.randomUUID();+ for await (const event of adkToAguiEvents(events, { threadId, runId })) {+ controller.enqueue(encoder.encode(`data: ${JSON.stringify(event)}\n\n`));+ }+ controller.close();+ },+ });++ return new Response(stream, { headers: { "Content-Type": "text/event-stream" } });+}+```++</Step>++<Step title="Connect your chat UI" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/google-adk/src/app/page.tsx">++Create an llm with fetchLLM and agUIAdapter(), then pass it to AgentInterface for a ready-made chat app or to ChatProvider from @openuidev/react-headless for your own UI.++```tsx title="src/app/page.tsx"+"use client";++import { AgentInterface, agUIAdapter, fetchLLM } from "@openuidev/react-ui";+import { openuiLibrary } from "@openuidev/react-ui/genui-lib";++const llm = fetchLLM({ url: "/api/chat", streamAdapter: agUIAdapter() });++export default function Page() {+ return <AgentInterface llm={llm} componentLibrary={openuiLibrary} />;+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/grok-build.mdx b/docs/content/integrations/grok-build.mdxnew file mode 100644index 000000000..b1158f9a8--- /dev/null+++ b/docs/content/integrations/grok-build.mdx@@ -0,0 +1,93 @@+---+title: "Grok Build"+---++<Steps>++<Step title="Install and sign in to Grok Build" source="https://github.com/thesysdev/openui/blob/main/examples/harnesses/grok-build/README.md">++Put the grok CLI on your PATH and run grok login. In non-interactive environments, set XAI_API_KEY instead.++```bash title="Terminal"+grok login+grok --version+# For a non-interactive environment, set XAI_API_KEY instead.++cd examples/harnesses/grok-build+pnpm install --ignore-workspace+cp .env.example .env.local+pnpm dev -- /absolute/path/to/your/project+```++</Step>++<Step title="Start the harness on a workspace" source="https://github.com/thesysdev/openui/blob/main/examples/harnesses/grok-build/src/lib/grok-build-acp.ts">++Launch the example with the project directory Grok Build should work in. It runs one grok agent stdio process and opens a separate ACP session for each OpenUI thread, with the OpenUI prompt added as session rules.++```ts title="src/lib/grok-build-acp.ts"+import { ClientSideConnection, ndJsonStream } from "@agentclientprotocol/sdk";+import { spawn } from "node:child_process";+import { Readable, Writable } from "node:stream";+// Builds the OpenUI Lang prompt; copy src/lib/openui-prompt.ts from the example.+import { localSystemPrompt } from "./openui-prompt";++// One long-lived Grok process for the workspace chosen at launch. --always-approve+// lets tools run unattended, so keep this harness local and single-user.+const cwd = process.env.GROK_BUILD_CWD ?? process.cwd();+const args = ["agent", "--always-approve", "--no-leader", "stdio"];+const child = spawn("grok", args, { cwd, stdio: ["pipe", "pipe", "pipe"] });+const stream = ndJsonStream(+ Writable.toWeb(child.stdin) as WritableStream<Uint8Array>,+ Readable.toWeb(child.stdout) as ReadableStream<Uint8Array>,+);+// `client` answers Grok's callbacks (next step). Initialize and authenticate the+// connection once; see GrokBuildACPClient.create() in the example.+const connection = new ClientSideConnection(() => client, stream);++// Each OpenUI thread gets a Grok session with the same UUID, and the OpenUI prompt+// rides along as the session's rules.+async function createSession(sessionId: string) {+ await connection.newSession({+ cwd,+ mcpServers: [],+ _meta: {+ clientIdentifier: "openui-grok-build-harness",+ rules: localSystemPrompt(),+ sessionId,+ yoloMode: true,+ },+ });+}+```++</Step>++<Step title="Answer questions and approve plans in the browser" source="https://github.com/thesysdev/openui/blob/main/examples/harnesses/grok-build/src/lib/grok-build-acp.ts">++Grok's clarifying questions and plan approvals appear as browser dialogs, and your answers go back over ACP so the same turn can continue.++```ts title="src/lib/grok-build-acp.ts"+import { RequestError, type Client } from "@agentclientprotocol/sdk";+// Holds each question or plan approval until the browser answers it.+// Copy src/lib/grok-build-interactions.ts from the example.+import { requestGrokBuildInteraction } from "./grok-build-interactions";++const client: Client = {+ // Grok sends x.ai/ask_user_question and x.ai/exit_plan_mode as blocking requests.+ // The browser long-polls GET /api/interactions?threadId=… and shows a dialog; its+ // POST /api/interactions answer resolves this promise, which ACP returns to Grok+ // so the same turn continues.+ extMethod: async (method, params) => {+ const interaction = requestGrokBuildInteraction(method, params);+ if (interaction) return interaction;+ throw RequestError.methodNotFound(method);+ },+ // Also implement requestPermission and sessionUpdate, which forwards reasoning,+ // text, and tool updates to the chat route; see the example.+};+```++</Step>++</Steps>diff --git a/docs/content/integrations/handsontable.mdx b/docs/content/integrations/handsontable.mdxnew file mode 100644index 000000000..78d6184cf--- /dev/null+++ b/docs/content/integrations/handsontable.mdx@@ -0,0 +1,114 @@+---+title: "Handsontable"+---++<Steps>++<Step title="Share the table state" source="https://github.com/thesysdev/openui/blob/main/examples/miscellaneous/handsontable/src/app/api/table/route.ts">++Keep the table in a server-side store that both the grid and the chat route use. Edits made in Handsontable sync back to the server through POST /api/table.++```ts title="src/app/api/table/route.ts"+import { NextResponse } from "next/server";+// In-memory tables keyed by thread id; the chat tools read and write the same store.+import { getTableStore, type TableData } from "../chat/tableStore";++// The grid posts its full contents here after every edit.+export async function POST(req: Request) {+ const { threadId, data, colHeaders } = (await req.json()) as {+ threadId: string;+ data: TableData;+ colHeaders?: string[];+ };++ const store = getTableStore(threadId);+ store.data = data;+ if (colHeaders) store.colHeaders = colHeaders;++ return NextResponse.json({ success: true, message: "Table data synced" });+}+```++</Step>++<Step title="Give the model spreadsheet tools" source="https://github.com/thesysdev/openui/blob/main/examples/miscellaneous/handsontable/src/app/api/chat/tools.ts">++Expose tools such as get_table_data, update_cells, add_rows, and set_formula. After a write, the model responds with a SpreadsheetTable component.++```ts title="src/app/api/chat/tools.ts"+// Server-side table store from step 1.+import { setFormula } from "./tableStore";++// The example keeps one shared table, so every tool uses the "default" thread.+const threadId = "default";++// Passed to client.chat.completions.runTools({ tools, ... }) in the chat route.+export const tools = [+ {+ type: "function",+ function: {+ name: "set_formula",+ description: "Set an Excel-like formula in a specific cell.",+ parameters: {+ type: "object",+ properties: {+ row: { type: "number", description: "Zero-based row index" },+ col: { type: "number", description: "Zero-based column index" },+ formula: {+ type: "string",+ description: "Excel-like formula, e.g. =SUM(A1:A5)",+ },+ },+ required: ["row", "col", "formula"],+ },+ parse: JSON.parse,+ function: async (args: { row: number; col: number; formula: string }) =>+ JSON.stringify(setFormula(threadId, args.row, args.col, args.formula)),+ },+ },+ // get_table_data, update_cells, add_rows, delete_rows and others follow this shape.+];+```++</Step>++<Step title="Sync results into the grid" source="https://github.com/thesysdev/openui/blob/main/examples/miscellaneous/handsontable/src/lib/spreadsheet-library.tsx">++The Renderer draws SpreadsheetTable from the custom library, and the useSpreadsheetSync hook pushes the new data into the live Handsontable instance.++```tsx title="src/lib/spreadsheet-library.tsx"+import { createLibrary, defineComponent } from "@openuidev/react-lang";+import { openuiLibrary } from "@openuidev/react-ui/genui-lib";+import { z } from "zod";++const SpreadsheetTable = defineComponent({+ name: "SpreadsheetTable",+ description:+ "Syncs data to the live spreadsheet panel. ONLY use this AFTER modification tools " ++ "to push updated data to the user's spreadsheet. Always include colHeaders.",+ props: z.object({+ data: z.array(z.array(z.union([z.string(), z.number(), z.null()]))),+ colHeaders: z.array(z.string()).optional(),+ }),+ component: ({ props }) => {+ // Sends rows to TableContext, which reloads the Handsontable grid. Copy+ // src/app/useSpreadsheetSync.ts and src/app/TableContext.tsx from the example.+ // Required here, as in the example, so importing this file in Node (the+ // `openui generate` script does) doesn't load the client-only hook.+ const { useSpreadsheetSync } = require("@/app/useSpreadsheetSync");+ useSpreadsheetSync(props.data, props.colHeaders);+ return null;+ },+});++// OpenUI's built-in components plus SpreadsheetTable, passed to <Renderer library>.+export const spreadsheetLibrary = createLibrary({+ root: openuiLibrary.root ?? "Stack",+ componentGroups: openuiLibrary.componentGroups,+ components: [...Object.values(openuiLibrary.components), SpreadsheetTable],+});+```++</Step>++</Steps>diff --git a/docs/content/integrations/langchain-langgraph.mdx b/docs/content/integrations/langchain-langgraph.mdxnew file mode 100644index 000000000..0de492952--- /dev/null+++ b/docs/content/integrations/langchain-langgraph.mdx@@ -0,0 +1,100 @@+---+title: "LangChain & LangGraph"+---++<Example+ prompt="Compare the weather in London and Sydney right now."+ image="/integrations/examples/langchain-langgraph"+ width={1600}+ height={1025}+ alt="The LangGraph example answering a request to compare the weather in London and Sydney. The agent calls get_weather twice, and OpenUI renders a weather card for each city and a tabbed two-day forecast."+ href="https://github.com/thesysdev/openui/tree/main/examples/agent-frameworks/langgraph-platform"+>++The `langgraph-platform` example runs a LangGraph agent, built with `createDeepAgent`, on a local LangGraph server. Its weather, stock-price and web-search tools return sample data. A Next.js route relays each run to the browser as AG-UI events, and OpenUI renders the agent's answer as components.++```bash title="Terminal"+cd examples/agent-frameworks/langgraph-platform+pnpm install --ignore-workspace+cp .env.example .env # add your THESYS_API_KEY+pnpm dev # LangGraph server on :2024, app on :3000+```++</Example>++<Steps>++<Step title="Add the stream transformer" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/langgraph-platform/src/agent/agent.ts">++Give the agent the generated OpenUI system prompt, and add `openUIStreamTransformer` from `@openuidev/langchain/transformer` to the graph's `streamTransformers`. The transformer publishes the run's messages and tool calls as AG-UI events.++```ts title="src/agent/agent.ts"+import { ChatOpenAI } from "@langchain/openai";+import { openUIStreamTransformer } from "@openuidev/langchain/transformer";+import { createDeepAgent } from "deepagents";+// Builds the OpenUI system prompt from your component library.+import { cloudInstructions } from "@/lib/cloud-prompt";+// Your LangChain tools.+import { getStockPrice, getWeather, searchWeb } from "./tools";++// OpenUI Gateway is OpenAI-compatible, so ChatOpenAI can call it.+const model = new ChatOpenAI({+ model: "google/gemini-3.6-flash-free",+ apiKey: process.env.THESYS_API_KEY,+ streaming: true,+ configuration: { baseURL: "https://api.thesys.dev/v1/embed" },+});++export const graph = createDeepAgent({+ model,+ tools: [getWeather, getStockPrice, searchWeb],+ systemPrompt: cloudInstructions(),+ // Publishes the run's message and tool events as AG-UI on "custom:openui".+ streamTransformers: [openUIStreamTransformer],+});+```++</Step>++<Step title="Expose an AG-UI route" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/langgraph-platform/src/app/api/chat/route.ts">++Return `createLangChainStreamResponse(request, options)` from a server route. It starts a run on your LangGraph server and relays the output to the browser as AG-UI server-sent events, so the API key and deployment URL stay on the server.++```ts title="src/app/api/chat/route.ts"+import { createLangChainStreamResponse } from "@openuidev/langchain";++export const runtime = "nodejs";++export async function POST(request: Request) {+ // Converts the AG-UI request to LangChain messages, runs the graph on your+ // LangGraph server, and streams the result back as AG-UI events.+ return createLangChainStreamResponse(request, {+ apiUrl: process.env.LANGGRAPH_API_URL ?? "http://localhost:2024",+ assistantId: process.env.LANGGRAPH_ASSISTANT_ID ?? "agent",+ apiKey: process.env.LANGSMITH_API_KEY,+ });+}+```++</Step>++<Step title="Connect your chat UI" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/langgraph-platform/src/app/page.tsx">++Point `fetchLLM` at the route with `agUIAdapter()`, and pass it to `AgentInterface` for a ready-made chat app or to `ChatProvider` from `@openuidev/react-headless` for your own UI. If your backend returns LangGraph's native named-event stream instead, use `langGraphAdapter()` with `langGraphMessageFormat`.++```tsx title="src/app/page.tsx"+"use client";++import { AgentInterface, agUIAdapter, fetchLLM } from "@openuidev/react-ui";+import { openuiLibrary } from "@openuidev/react-ui/genui-lib";++const llm = fetchLLM({ url: "/api/chat", streamAdapter: agUIAdapter() });++export default function Page() {+ return <AgentInterface llm={llm} componentLibrary={openuiLibrary} />;+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/lynx.mdx b/docs/content/integrations/lynx.mdxnew file mode 100644index 000000000..af70f1d4a--- /dev/null+++ b/docs/content/integrations/lynx.mdx@@ -0,0 +1,85 @@+---+title: "Lynx"+---++<Steps>++<Step title="Create the library" source="https://github.com/lynx-family/lynx-stack/blob/main/packages/genui/openui/README.md">++Build a component library with createOpenUiLibrary() from @lynx-js/genui/openui, and import the theme stylesheet from @lynx-js/genui/openui/styles/theme.css. The renderer's own CSS ships with the renderer module.++```ts title="src/library.ts"+import { createOpenUiLibrary } from "@lynx-js/genui/openui";++// Theme tokens for the built-in components.+import "@lynx-js/genui/openui/styles/theme.css";++// The built-in components; pass { components: [...] } to add your own ReactLynx ones.+// Create it once: the renderer keeps its streaming parser while the library is unchanged.+export const library = createOpenUiLibrary();+```++</Step>++<Step title="Generate the agent instructions" source="https://github.com/lynx-family/lynx-stack/blob/main/packages/genui/openui/docs/system-prompts.md">++On the server, build the system prompt with buildOpenUiSystemPrompt() from @lynx-js/genui/openui/prompt.++```ts title="server/openuiPrompt.ts"+import { buildOpenUiSystemPrompt } from "@lynx-js/genui/openui/prompt";++// Teaches the model OpenUI Lang and the built-in components. Send it as the system+// instruction, then return the model's raw text to the app.+export const systemPrompt = buildOpenUiSystemPrompt({+ appendix: "Use only the tools explicitly provided by this application.",+ // Custom client components go here too, as headless definitions in `components`.+});+```++</Step>++<Step title="Render with OpenUiRenderer" source="https://lynxjs.org/next/react/genui/openui.html#stream-model-output">++Pass the full text received so far, not just the latest delta, to OpenUiRenderer with the library. Handle host-side effects such as navigation in onAction.++```tsx title="src/StreamingSurface.tsx"+import { BuiltinActionType, OpenUiRenderer } from "@lynx-js/genui/openui";+import { useEffect, useState } from "@lynx-js/react";+import { library } from "./library"; // The library from step 1.++// `source` yields the model's text deltas from your Agent transport.+export function StreamingSurface({ source }: { source: AsyncIterable<string> }) {+ const [response, setResponse] = useState("");+ const [isStreaming, setIsStreaming] = useState(false);+ useEffect(() => {+ async function consume() {+ setResponse("");+ setIsStreaming(true);+ try {+ // Append each delta: the renderer needs the full text received so far.+ for await (const delta of source) setResponse((current) => current + delta);+ } finally {+ setIsStreaming(false);+ }+ }+ consume();+ }, [source]);++ return (+ <OpenUiRenderer+ response={response}+ library={library}+ isStreaming={isStreaming}+ onAction={(event) => {+ if (event.type === BuiltinActionType.OpenUrl) {+ // Validate event.params.url, then open it with the host navigation API.+ }+ }}+ />+ );+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/mastra.mdx b/docs/content/integrations/mastra.mdxnew file mode 100644index 000000000..11ec26c57--- /dev/null+++ b/docs/content/integrations/mastra.mdx@@ -0,0 +1,100 @@+---+title: "Mastra"+---++<Steps>++<Step title="Build the Mastra agent" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/mastra/src/mastra.ts">++Define the Agent with createTool tools and the generated OpenUI instructions. The example registers a custom Mastra gateway that routes model calls through OpenUI Cloud.++```ts title="src/mastra.ts"+import { Mastra } from "@mastra/core";+import { Agent } from "@mastra/core/agent";+import { createTool } from "@mastra/core/tools";+import { z } from "zod";+// Builds the OpenUI system prompt from your component library.+import { cloudInstructions } from "@/lib/cloud-prompt";+// Routes model calls to OpenUI Cloud. Copy src/openui-cloud-gateway.ts from the example.+import { OpenUICloudGateway, openuiCloudModelId } from "@/openui-cloud-gateway";++const getWeather = createTool({+ id: "get_weather",+ description: "Get current weather for a city.",+ inputSchema: z.object({ location: z.string() }),+ execute: async ({ location }) => {+ // Call your weather API here.+ },+});++export const openuiAgent = new Agent({+ id: "openui-mastra-agent",+ name: "OpenUI x Mastra Agent",+ instructions: cloudInstructions(),+ model: { id: openuiCloudModelId },+ tools: { getWeather },+});++export const mastra = new Mastra({+ gateways: { openuiCloud: new OpenUICloudGateway() },+ agents: { openui: openuiAgent },+});+```++</Step>++<Step title="Stream AG-UI events" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/mastra/src/app/api/chat/route.ts">++Wrap the agent with MastraAgent from @ag-ui/mastra in a server route and stream its AG-UI events to the browser as SSE.++```ts title="src/app/api/chat/route.ts"+import { MastraAgent } from "@ag-ui/mastra";+import type { Message } from "@ag-ui/core";+import { openuiAgent } from "@/mastra";++const agent = new MastraAgent({ agent: openuiAgent, resourceId: "chat-user" });++export async function POST(req: Request) {+ const { messages, threadId }: { messages: Message[]; threadId: string } = await req.json();+ const encoder = new TextEncoder();++ const stream = new ReadableStream({+ start(controller) {+ agent+ .run({ messages, threadId, runId: crypto.randomUUID(), tools: [], context: [] })+ .subscribe({+ next: (event) => {+ controller.enqueue(encoder.encode(`data: ${JSON.stringify(event)}\n\n`));+ },+ complete: () => controller.close(),+ });+ },+ });++ return new Response(stream, { headers: { "Content-Type": "text/event-stream" } });+}+```++</Step>++<Step title="Connect your chat UI" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/mastra/src/app/page.tsx">++Create an llm with fetchLLM and agUIAdapter(), then pass it to AgentInterface for a ready-made chat app or to ChatProvider from @openuidev/react-headless for your own UI.++```tsx title="src/app/page.tsx"+"use client";++import { AgentInterface, agUIAdapter, fetchLLM } from "@openuidev/react-ui";+import { openuiLibrary } from "@openuidev/react-ui/genui-lib";++// POSTs { messages, threadId, ... } to the route above and parses its AG-UI stream.+const llm = fetchLLM({ url: "/api/chat", streamAdapter: agUIAdapter() });++export default function Page() {+ return <AgentInterface llm={llm} componentLibrary={openuiLibrary} />;+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/material-ui.mdx b/docs/content/integrations/material-ui.mdxnew file mode 100644index 000000000..8117d252c--- /dev/null+++ b/docs/content/integrations/material-ui.mdx@@ -0,0 +1,134 @@+---+title: "Material UI"+---++<Steps>++<Step title="Map MUI components to OpenUI" source="https://github.com/thesysdev/openui/blob/main/examples/design-systems/material-ui/src/lib/mui-genui/index.tsx">++Wrap Material UI components with defineComponent and Zod schemas, and export them through createLibrary. Charts use @mui/x-charts.++```tsx title="src/lib/mui-genui/index.tsx"+import Card from "@mui/material/Card";+import CardContent from "@mui/material/CardContent";+import Typography from "@mui/material/Typography";+import { createLibrary, defineComponent } from "@openuidev/react-lang";+import { z } from "zod";++const CardHeader = defineComponent({+ name: "CardHeader",+ props: z.object({ title: z.string(), description: z.string().optional() }),+ description: "Title/description header block for a Card.",+ component: ({ props }) => (+ <>+ <Typography variant="h3">{props.title}</Typography>+ {props.description && <Typography variant="body2">{props.description}</Typography>}+ </>+ ),+});++const ChatCard = defineComponent({+ name: "Card",+ props: z.object({ children: z.array(CardHeader.ref) }),+ description: "Vertical container for all content in a chat response.",+ component: ({ props, renderNode }) => (+ <Card>+ <CardContent>{renderNode(props.children)}</CardContent>+ </Card>+ ),+});++export const muiChatLibrary = createLibrary({+ root: "Card",+ components: [ChatCard, CardHeader], // plus every other component you wrap+});+```++</Step>++<Step title="Generate the library spec" source="https://github.com/thesysdev/openui/blob/main/examples/design-systems/material-ui/src/app/api/chat/route.ts">++Run openui generate --spec on src/library.ts. The chat route sends that spec to OpenUI Cloud and runs app-owned tools with runChatToolLoop.++```ts title="src/app/api/chat/route.ts"+import OpenAI from "openai";+// Wraps src/generated/spec.json in Cloud's prompt block (src/lib/cloud-prompt.ts).+import { cloudInstructions } from "@/lib/cloud-prompt";+// Your tools: OpenAI function declarations plus the functions that run them.+import { appToolDeclarations, appToolExecutors } from "@/lib/app-tools";+// Runs tool calls on the server until the model answers. Copy src/lib/tool-loop.ts.+import { runChatToolLoop } from "@/lib/tool-loop";++const client = new OpenAI({+ baseURL: "https://api.thesys.dev/v1/embed",+ apiKey: process.env.THESYS_API_KEY,+});+const encoder = new TextEncoder();++export async function POST(req: Request) {+ const { messages } = await req.json();+ const body = new ReadableStream({+ async start(controller) {+ await runChatToolLoop({+ client,+ model: "google/gemini-3.6-flash-free",+ messages: [{ role: "system", content: cloudInstructions() }, ...messages],+ tools: appToolDeclarations,+ executors: appToolExecutors,+ enqueue: (chunk) =>+ controller.enqueue(encoder.encode(`data: ${JSON.stringify(chunk)}\n\n`)),+ });+ controller.enqueue(encoder.encode("data: [DONE]\n\n"));+ controller.close();+ },+ });++ return new Response(body, { headers: { "Content-Type": "text/event-stream" } });+}+```++</Step>++<Step title="Render inside your MUI theme" source="https://github.com/thesysdev/openui/blob/main/examples/design-systems/material-ui/src/app/page.tsx">++Render responses with Renderer, or with AgentInterface as the example does, inside your MUI ThemeProvider. Generated components then use the app's theme and light or dark mode.++```tsx title="src/app/page.tsx"+"use client";++import CssBaseline from "@mui/material/CssBaseline";+import { ThemeProvider } from "@mui/material/styles";+import {+ AgentInterface,+ fetchLLM,+ openAIAdapter,+ openAIMessageFormat,+ useSystemThemeMode,+} from "@openuidev/react-ui";+import { useMemo } from "react";+// Your wrapped components (step 1) and your MUI createTheme() factory.+import { muiChatLibrary } from "@/lib/mui-genui";+import { createAppTheme } from "@/lib/mui-genui/theme";++const llm = fetchLLM({+ url: "/api/chat",+ streamAdapter: openAIAdapter(),+ messageFormat: openAIMessageFormat,+});++export default function Page() {+ const mode = useSystemThemeMode();+ const theme = useMemo(() => createAppTheme(mode), [mode]);++ return (+ <ThemeProvider theme={theme}>+ <CssBaseline />+ <AgentInterface llm={llm} componentLibrary={muiChatLibrary} theme={{ mode }} />+ </ThemeProvider>+ );+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/open-webui.mdx b/docs/content/integrations/open-webui.mdxnew file mode 100644index 000000000..6976bb41b--- /dev/null+++ b/docs/content/integrations/open-webui.mdx@@ -0,0 +1,86 @@+---+title: "Open WebUI"+---++<Steps>++<Step title="Install the tool" source="https://github.com/thesysdev/openwebui-plugin/blob/main/tool.py">++Import the plugin from the Open WebUI community site, or create a tool in Admin > Tools and paste in the plugin's tool.py.++```python title="tool.py"+"""+title: OpenUI - Generative UI+author: thesysdev/vishxrad+version: 0.5.0+description: Renders interactive generative UI components (charts, forms, tables, cards, follow-ups) in chat using OpenUI Lang.+"""+# The rest of tool.py: the Tools class with the cdn_base_url valve and render_openui.+```++</Step>++<Step title="Enable it for a model" source="https://github.com/thesysdev/openwebui-plugin/blob/main/tool.py">++Turn the tool on for the models or chats that should render UI. The model calls render_openui when an answer needs a chart, form, table, or card.++```python title="tool.py"+from starlette.responses import HTMLResponse+++class Tools:+ async def render_openui(+ self,+ openui_lang_code: str,+ title: str = "Response",+ __event_emitter__=None,+ __event_call__=None,+ ) -> tuple:+ # Omitted: the docstring, which tells the model when to call the tool and+ # teaches OpenUI Lang syntax, and the status updates sent to __event_emitter__.++ # Helpers in tool.py: read Open WebUI's light/dark theme, then build an HTML+ # page that loads the OpenUI browser bundle and renders openui_lang_code.+ theme = await _get_openwebui_theme(__event_call__)+ html = _build_openui_html(+ openui_lang_code, title, self.valves.cdn_base_url, theme+ )+ response = HTMLResponse(content=html, headers={"Content-Disposition": "inline"})++ # result_context tells the model the UI is already on screen, so it describes+ # it instead of echoing the OpenUI Lang code.+ return response, result_context+```++</Step>++<Step title="Choose where the bundle loads from" source="https://github.com/thesysdev/openwebui-plugin/blob/main/tool.py">++The cdn_base_url valve sets where the OpenUI browser bundle loads from. By default it is the latest @openuidev/browser-bundle on jsDelivr.++```python title="tool.py"+from pydantic import BaseModel, Field++_CDN_BASE = "https://cdn.jsdelivr.net/npm/@openuidev/browser-bundle@latest"+++class Tools:+ class Valves(BaseModel):+ # Edit in Admin > Tools. The page loads <cdn_base_url>/dist/openui-bundle.min.js+ # and /dist/openui-styles.css. A URL that isn't https (or http on localhost)+ # falls back to _CDN_BASE.+ cdn_base_url: str = Field(+ default=_CDN_BASE,+ description=(+ "Base CDN URL for the OpenUI bundle. "+ "Change if self-hosting or using a different version."+ ),+ )++ def __init__(self):+ self.valves = self.Valves()+```++</Step>++</Steps>diff --git a/docs/content/integrations/pi-coding-agent.mdx b/docs/content/integrations/pi-coding-agent.mdxnew file mode 100644index 000000000..87ec85a6e--- /dev/null+++ b/docs/content/integrations/pi-coding-agent.mdx@@ -0,0 +1,142 @@+---+title: "Pi Coding Agent"+---++<Example+ prompt="Read package.json and show this project's scripts and dependencies as a dashboard."+ image="/integrations/examples/pi-coding-agent"+ width={1600}+ height={1300}+ alt="The Pi harness answering a request to summarize package.json. Pi calls its read tool, and OpenUI renders a project dashboard with dependency, dev dependency and script counts, tabs, and a table of development dependencies."+ href="https://github.com/thesysdev/openui/tree/main/examples/harnesses/pi"+>++The `pi` harness embeds the Pi coding agent in a Next.js app and points it at a folder on your machine. Here it ran with read-only tools: Pi read the project's `package.json` and answered with a dashboard instead of a wall of text.++```bash title="Terminal"+cd examples/harnesses/pi+pnpm install --ignore-workspace+cp .env.example .env # add your THESYS_API_KEY+# read-only: Pi can read files but can't run commands or edit them+PI_WEB_TOOLS=read-only pnpm dev -- /absolute/path/to/your/project+```++</Example>++<Steps>++<Step title="Embed the Pi SDK" source="https://github.com/thesysdev/openui/blob/main/examples/harnesses/pi/src/lib/pi-session.ts">++Create one Pi `AgentSession` per chat thread with `createAgentSession`, and reuse it on later turns: Pi keeps the transcript itself. Point the session's model at OpenUI Cloud and append the generated OpenUI prompt to Pi's system prompt.++```ts title="src/lib/pi-session.ts"+import { join } from "node:path";+// Builds the OpenUI prompt; copy src/lib/cloud-prompt.ts from the example.+import { cloudInstructions } from "./cloud-prompt";++// Call once per chat thread and reuse the session: Pi keeps its own transcript.+export async function createSession(cwd: string) {+ // The Pi SDK is ESM-only, so load it with a native dynamic import().+ const pi = await import("@earendil-works/pi-coding-agent");+ const agentDir = pi.getAgentDir();+ const settingsManager = pi.SettingsManager.create(cwd, agentDir);+ const shared = { cwd, agentDir, settingsManager };++ // OpenUI Cloud is the model; copy src/lib/openui-cloud-models.json from the example.+ const authStorage = pi.AuthStorage.inMemory();+ authStorage.setRuntimeApiKey("openui-cloud", process.env.THESYS_API_KEY!);+ const modelsPath = join(process.cwd(), "src/lib/openui-cloud-models.json");+ const modelRegistry = pi.ModelRegistry.create(authStorage, modelsPath);+ const model = modelRegistry.find("openui-cloud", "google/gemini-3.6-flash-free");++ // Append the OpenUI Lang prompt (the example also passes coding-agent rules to it).+ const resourceLoader = new pi.DefaultResourceLoader({+ ...shared,+ appendSystemPrompt: [cloudInstructions()],+ });+ await resourceLoader.reload();+ const { session } = await pi.createAgentSession({+ ...shared,+ resourceLoader,+ authStorage,+ modelRegistry,+ model,+ });+ return session;+}+```++</Step>++<Step title="Translate Pi events" source="https://github.com/thesysdev/openui/blob/main/examples/harnesses/pi/src/app/api/chat/route.ts">++Subscribe to the session and write each event as an OpenAI `chat.completion.chunk` on its own NDJSON line: text deltas go in `delta.content`, and reasoning and tool executions go in `delta.tool_calls`.++```ts title="src/app/api/chat/route.ts"+// One OpenAI chat.completion.chunk per NDJSON line.+function ndjsonChunk(delta: Record<string, unknown>, finishReason: string | null = null) {+ return `${JSON.stringify({+ id: "pi-chat",+ object: "chat.completion.chunk",+ choices: [{ index: 0, delta, finish_reason: finishReason }],+ })}\n`;+}++// Inside the POST handler's ReadableStream: `session` is this thread's Pi session,+// `enqueue(line)` writes to the response, and `userText` is the newest user message.+let toolIndex = 0;+const unsubscribe = session.subscribe((event) => {+ if (event.type === "message_update") {+ const ame = event.assistantMessageEvent;+ if (ame.type === "text_delta" && ame.delta) {+ enqueue(ndjsonChunk({ content: ame.delta }));+ }+ // thinking_delta streams into a single "Thinking" tool call the same way.+ } else if (event.type === "tool_execution_start") {+ // Each tool run (read, bash, edit, write) becomes an OpenAI tool call card.+ const call = {+ index: toolIndex++,+ id: event.toolCallId,+ type: "function",+ function: { name: event.toolName, arguments: JSON.stringify(event.args) },+ };+ enqueue(ndjsonChunk({ tool_calls: [call] }));+ }+});+await session.prompt(userText);+unsubscribe();+enqueue(ndjsonChunk({}, "stop"));+```++</Step>++<Step title="Render with the NDJSON adapter" source="https://github.com/thesysdev/openui/blob/main/examples/harnesses/pi/src/app/page.tsx">++Parse the stream with `openAIReadableStreamAdapter()`, and render the answers, reasoning and tool activity with `AgentInterface` or with your own UI built on `ChatProvider`.++```tsx title="src/app/page.tsx"+"use client";++import {+ AgentInterface,+ fetchLLM,+ openAIMessageFormat,+ openAIReadableStreamAdapter,+} from "@openuidev/react-ui";+import { openuiLibrary } from "@openuidev/react-ui/genui-lib";++// fetchLLM POSTs { threadId, messages }; the route reuses one Pi session per threadId.+const llm = fetchLLM({+ url: "/api/chat",+ streamAdapter: openAIReadableStreamAdapter(),+ messageFormat: openAIMessageFormat,+});++export default function Home() {+ return <AgentInterface llm={llm} componentLibrary={openuiLibrary} />;+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/react-email.mdx b/docs/content/integrations/react-email.mdxnew file mode 100644index 000000000..75ac0bdc8--- /dev/null+++ b/docs/content/integrations/react-email.mdx@@ -0,0 +1,60 @@+---+title: "React Email"+---++<Steps>++<Step title="Import the email library">++Use emailLibrary from @openuidev/react-email. It covers 44 email-safe components, including headers, feature grids, pricing cards, and checkout tables.++</Step>++<Step title="Generate the email prompt" source="https://www.openui.com/docs/api-reference/react-email">++Build the system prompt from emailLibrary and emailPromptOptions, so the model composes emails only from those components.++```ts title="system-prompt.ts"+import { emailLibrary, emailPromptOptions } from "@openuidev/react-email";++// With examples and rules (recommended)+const systemPrompt = emailLibrary.prompt(emailPromptOptions);++// Without — schema only, no examples or rules+const minimalPrompt = emailLibrary.prompt();+```++</Step>++<Step title="Preview and export HTML" source="https://github.com/thesysdev/openui/blob/main/examples/miscellaneous/react-email/src/hooks/useEmailRendering.tsx">++Stream the response into Renderer from @openuidev/react-lang for a live preview, then convert the email to client-compatible HTML with @react-email/render.++```tsx title="EmailPreview.tsx"+"use client";++import { emailLibrary } from "@openuidev/react-email";+import { Renderer } from "@openuidev/react-lang";+import { render } from "@react-email/render";++interface EmailPreviewProps {+ openuiCode: string;+ isStreaming: boolean;+}++// Live preview: re-renders as the OpenUI Lang response streams in.+export function EmailPreview({ openuiCode, isStreaming }: EmailPreviewProps) {+ return <Renderer response={openuiCode} library={emailLibrary} isStreaming={isStreaming} />;+}++// After streaming ends, turn the same response into email-client HTML.+export function renderToHtml(openuiCode: string) {+ return render(<Renderer response={openuiCode} library={emailLibrary} isStreaming={false} />, {+ pretty: true,+ });+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/react-native.mdx b/docs/content/integrations/react-native.mdxnew file mode 100644index 000000000..e0eb7b8d2--- /dev/null+++ b/docs/content/integrations/react-native.mdx@@ -0,0 +1,129 @@+---+title: "React Native"+---++<Steps>++<Step title="Describe the components on the backend" source="https://github.com/thesysdev/openui/blob/main/examples/app-frameworks/react-native/backend/src/library.ts">++Define the component vocabulary (Card, Text, and chart components) with defineComponent and createLibrary in a Node-compatible file, with renderers set to null. The chat route turns it into the system prompt with generateSystemPrompt from @openuidev/lang-core.++```ts title="backend/src/library.ts"+import { createLibrary, defineComponent } from "@openuidev/lang-core";+import { z } from "zod";++// Same names and schemas as the app's library, with null renderers so it runs in Node.+const TextComponent = defineComponent({+ name: "Text",+ description: "Renders a line of text. Use variant to control emphasis.",+ props: z.object({+ content: z.string().describe("The text to display"),+ variant: z.enum(["body", "heading", "caption"]).optional(),+ }),+ component: () => null,+});++// BarChart, LineChart and PieChart follow the same pattern and go in Card's children.++const CardComponent = defineComponent({+ name: "Card",+ description: "A container card that holds a list of child components.",+ props: z.object({+ children: z.array(TextComponent.ref).optional(),+ }),+ component: () => null,+});++export const library = createLibrary({+ components: [TextComponent, CardComponent],+ root: "Card",+});+```++</Step>++<Step title="Stream plain text" source="https://github.com/thesysdev/openui/blob/main/examples/app-frameworks/react-native/backend/src/app/api/chat/route.ts">++Return raw text/plain chunks from the chat route instead of SSE, so the mobile app can read the stream without a browser EventSource.++```ts title="backend/src/app/api/chat/route.ts"+import { generateSystemPrompt } from "@openuidev/lang-core";+import OpenAI from "openai";+import { library } from "@/library"; // The Node-compatible library from step 1.++// cloud: true matches the OpenUI Cloud client below; omit it for other providers.+const SYSTEM_PROMPT = generateSystemPrompt({ cloud: true, library: library.toSpec() });+const openai = new OpenAI({+ apiKey: process.env.THESYS_API_KEY,+ baseURL: "https://api.thesys.dev/v1/embed",+});++export async function POST(req: Request) {+ const { messages } = await req.json();+ const completion = await openai.chat.completions.create({+ model: "google/gemini-3.6-flash-free",+ stream: true,+ messages: [{ role: "system", content: SYSTEM_PROMPT }, ...messages],+ });++ // Write each text delta as a raw chunk, not an SSE event.+ const stream = new ReadableStream({+ async start(controller) {+ for await (const chunk of completion) {+ const text = chunk.choices[0]?.delta?.content ?? "";+ if (text) controller.enqueue(new TextEncoder().encode(text));+ }+ controller.close();+ },+ });++ return new Response(stream, {+ headers: { "Content-Type": "text/plain; charset=utf-8" },+ });+}+```++</Step>++<Step title="Render native components" source="https://github.com/thesysdev/openui/blob/main/examples/app-frameworks/react-native/chat-app/screens/ChatScreen.tsx">++Use Renderer from @openuidev/react-lang in the Expo app with a library that maps the same component names to native views and charts.++```tsx title="chat-app/screens/ChatScreen.tsx"+import { Renderer } from "@openuidev/react-lang";+import React, { useState } from "react";+// Step 1's components with React Native renderers. See library.tsx in the example.+import { library } from "../library";+// Streams the reply with XMLHttpRequest (React Native's fetch has no readable body).+// Copy hooks/useStreamingChat.ts from the example.+import { useStreamingChat } from "../hooks/useStreamingChat";+// Text box and send button. Copy components/ChatInput.tsx from the example.+import { ChatInput } from "../components/ChatInput";++export default function ChatScreen({ backendUrl }: { backendUrl: string }) {+ const [response, setResponse] = useState("");+ const [isStreaming, setIsStreaming] = useState(false);+ const { sendMessage } = useStreamingChat(backendUrl);++ async function handleSend(text: string) {+ setIsStreaming(true);+ // The example also keeps the conversation history for follow-up turns.+ await sendMessage([{ role: "user", content: text }], (accumulated, isDone) => {+ // `accumulated` is the full reply so far, which is what Renderer expects.+ setResponse(accumulated);+ setIsStreaming(!isDone);+ });+ }++ return (+ <>+ <Renderer response={response} library={library} isStreaming={isStreaming} />+ <ChatInput onSend={handleSend} disabled={isStreaming} />+ </>+ );+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/shadcn-ui.mdx b/docs/content/integrations/shadcn-ui.mdxnew file mode 100644index 000000000..edeca4cce--- /dev/null+++ b/docs/content/integrations/shadcn-ui.mdx@@ -0,0 +1,95 @@+---+title: "shadcn/ui"+---++<Steps>++<Step title="Wrap your shadcn/ui components" source="https://github.com/thesysdev/openui/blob/main/examples/design-systems/shadcn/src/lib/shadcn-genui/index.tsx">++Register each component with defineComponent and a Zod prop schema, then combine them with createLibrary. The example library covers 45+ components, including cards, tables, charts, forms, and dialogs.++```tsx title="src/lib/shadcn-genui/index.tsx"+import { createLibrary, defineComponent } from "@openuidev/react-lang";+import { z } from "zod";+// Components the shadcn CLI added to your project.+import { Badge as ShadcnBadge } from "@/components/ui/badge";+import { Card, CardContent } from "@/components/ui/card";++const Badge = defineComponent({+ name: "Badge",+ props: z.object({+ text: z.string(),+ variant: z.enum(["default", "secondary", "destructive", "outline"]).optional(),+ }),+ description: "Inline label/badge.",+ component: ({ props }) => (+ <ShadcnBadge variant={props.variant ?? "default"}>{props.text}</ShadcnBadge>+ ),+});++const ChatCard = defineComponent({+ name: "Card",+ props: z.object({ children: z.array(Badge.ref) }),+ description: "Vertical container for all content in a chat response.",+ component: ({ props, renderNode }) => (+ <Card>+ <CardContent>{renderNode(props.children)}</CardContent>+ </Card>+ ),+});++export const shadcnChatLibrary = createLibrary({+ root: "Card",+ components: [ChatCard, Badge], // plus every other component you wrap+});+```++</Step>++<Step title="Generate the library spec" source="https://github.com/thesysdev/openui/blob/main/examples/design-systems/shadcn/src/lib/cloud-prompt.ts">++Run openui generate --spec on the library file. The chat route passes that spec to generateSystemPrompt(\{ cloud: true \}), so the model can only call components the client can render.++```ts title="src/lib/cloud-prompt.ts"+import { generateSystemPrompt, type LibrarySpec } from "@openuidev/lang-core";+import { readFileSync } from "fs";+import { join } from "path";++// src/library.ts re-exports your library as `library`, and this command writes the spec:+// openui generate src/library.ts --spec --out src/generated/spec.json+export function cloudInstructions(): string {+ const library = JSON.parse(+ readFileSync(join(process.cwd(), "src/generated/spec.json"), "utf-8"),+ ) as LibrarySpec;+ // The chat route sends this as the system message.+ return generateSystemPrompt({ cloud: true, library });+}+```++</Step>++<Step title="Render the responses" source="https://github.com/thesysdev/openui/blob/main/examples/design-systems/shadcn/src/app/page.tsx">++Pass the library to Renderer from @openuidev/react-lang wherever your app shows model output. For a ready-made chat app, the example passes it to AgentInterface as componentLibrary instead.++```tsx title="src/app/page.tsx"+"use client";++import { AgentInterface, fetchLLM, openAIAdapter, openAIMessageFormat } from "@openuidev/react-ui";+// Your wrapped shadcn/ui components from step 1.+import { shadcnChatLibrary } from "@/lib/shadcn-genui";++const llm = fetchLLM({+ url: "/api/chat",+ streamAdapter: openAIAdapter(),+ messageFormat: openAIMessageFormat,+});++export default function Page() {+ return <AgentInterface llm={llm} componentLibrary={shadcnChatLibrary} />;+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/svelte.mdx b/docs/content/integrations/svelte.mdxnew file mode 100644index 000000000..c3345250b--- /dev/null+++ b/docs/content/integrations/svelte.mdx@@ -0,0 +1,107 @@+---+title: "Svelte 5"+---++<Steps>++<Step title="Write the component with $props()" source="https://github.com/thesysdev/openui/blob/main/examples/app-frameworks/svelte/src/lib/components/Card.svelte">++Destructure props and renderNode from $props(). renderNode is a Snippet passed as a prop, not through context, so render children with \{@render renderNode(...)\} and forward it to any child component that renders nested nodes.++```svelte title="src/lib/components/Card.svelte"+<script lang="ts">+ import type { Snippet } from "svelte";++ let {+ props,+ renderNode,+ }: {+ props: { title?: string; children?: unknown };+ renderNode: Snippet<[unknown]>;+ } = $props();+</script>++<div>+ {#if props.title}+ <h3>{props.title}</h3>+ {/if}+ {#if props.children}+ {@render renderNode(props.children)}+ {/if}+</div>+```++</Step>++<Step title="Register components in a library" source="https://github.com/thesysdev/openui/blob/main/examples/app-frameworks/svelte/src/lib/library.ts">++Pair each .svelte file with defineComponent and a Zod schema, and list a container's allowed children with their .ref schemas. Build the system prompt with library.prompt(), or in a SvelteKit server route share the schemas and generate it with @openuidev/lang-core ^0.4.++```ts title="src/lib/library.ts"+import { createLibrary, defineComponent } from "@openuidev/svelte-lang";+import { z } from "zod";+// Card is the component above; TextContent renders props.text in a <p>.+import Card from "./components/Card.svelte";+import TextContent from "./components/TextContent.svelte";++const TextContentDef = defineComponent({+ name: "TextContent",+ props: z.object({ text: z.string() }),+ description: "Displays a block of text. Supports markdown formatting within the string.",+ component: TextContent,+});++const CardDef = defineComponent({+ name: "Card",+ props: z.object({+ title: z.string(),+ // The components Card accepts as children, by their .ref schemas.+ children: z.array(TextContentDef.ref),+ }),+ description: "A card container with a title and child components",+ component: Card,+});++export const library = createLibrary({+ components: [TextContentDef, CardDef],+ root: "Card",+});++// The system prompt to send with each model request.+export const systemPrompt = library.prompt();+```++</Step>++<Step title="Render the stream" source="https://www.openui.com/docs/api-reference/svelte-lang">++Pass the accumulated text, the library and isStreaming to Renderer, with onAction as an ordinary callback prop. The Svelte Renderer has no onError prop, so read parser errors from onParseResult.++```svelte title="AssistantMessage.svelte"+<script lang="ts">+ import { BuiltinActionType, Renderer, type ActionEvent } from "@openuidev/svelte-lang";+ // The library from src/lib/library.ts.+ import { library } from "$lib/library";++ // The model's OpenUI Lang output so far, and whether it is still streaming.+ let {+ response,+ isStreaming,+ }: { response: string | null; isStreaming: boolean } = $props();++ function handleAction(event: ActionEvent) {+ if (+ event.type === BuiltinActionType.ContinueConversation &&+ event.humanFriendlyMessage+ ) {+ // Send event.humanFriendlyMessage to your chat as the next user message.+ }+ }+</script>++<Renderer {response} {library} {isStreaming} onAction={handleAction} />+```++</Step>++</Steps>diff --git a/docs/content/integrations/vercel-ai-sdk.mdx b/docs/content/integrations/vercel-ai-sdk.mdxnew file mode 100644index 000000000..ab457f4c0--- /dev/null+++ b/docs/content/integrations/vercel-ai-sdk.mdx@@ -0,0 +1,97 @@+---+title: "Vercel AI SDK"+---++<Example+ prompt="What's the current Apple stock price?"+ image="/integrations/examples/vercel-ai-sdk"+ width={1600}+ height={600}+ alt="The Vercel AI SDK example answering a question about Apple's stock price. OpenUI renders the get_stock_price tool result as cards for the price, day change, day range and volume."+ href="https://github.com/thesysdev/openui/tree/main/examples/agent-frameworks/vercel-ai-sdk"+>++The `vercel-ai-sdk` example is a Next.js app whose chat route calls `streamText()` with weather, stock-price and web-search tools that return sample data. The browser reads the AI SDK's UIMessage stream through `vercelAIAdapter()`, and OpenUI renders the answer as components.++```bash title="Terminal"+cd examples/agent-frameworks/vercel-ai-sdk+pnpm install --ignore-workspace+pnpm generate:apiKey # writes THESYS_API_KEY to .env.local+pnpm dev+```++</Example>++<Steps>++<Step title="Stream with streamText" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/vercel-ai-sdk/src/app/api/chat/route.ts">++Call `streamText` with the generated OpenUI system prompt and your AI SDK tools, and return `toUIMessageStreamResponse()` from the route. `stopWhen: stepCountIs(5)` lets the model call tools and keep going for up to five steps.++```ts title="src/app/api/chat/route.ts"+import { createOpenAI } from "@ai-sdk/openai";+import { convertToModelMessages, stepCountIs, streamText } from "ai";+// Builds the OpenUI system prompt from your component library.+import { cloudInstructions } from "@/lib/cloud-prompt";+// Your AI SDK tools, defined with tool() from "ai".+import { tools } from "@/lib/tools";++// OpenUI Gateway is OpenAI-compatible, so the AI SDK's OpenAI provider can call it.+const gateway = createOpenAI({+ baseURL: "https://api.thesys.dev/v1/embed",+ apiKey: process.env.THESYS_API_KEY,+});++export async function POST(req: Request) {+ const { messages } = await req.json(); // UIMessage[] from vercelAIMessageFormat+ const result = streamText({+ model: gateway.chat("google/gemini-3.6-flash-free"),+ system: cloudInstructions(),+ messages: await convertToModelMessages(messages),+ tools,+ stopWhen: stepCountIs(5), // Run tools and continue, up to 5 steps.+ });+ return result.toUIMessageStreamResponse();+}+```++</Step>++<Step title="Configure the adapter" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/vercel-ai-sdk/src/app/page.tsx">++Create the client connection with `fetchLLM`. `vercelAIAdapter()` reads the UIMessage stream, and `vercelAIMessageFormat` sends the conversation as `UIMessage[]`, which the route passes to `convertToModelMessages()`.++```ts title="src/app/page.tsx"+import { fetchLLM, vercelAIAdapter, vercelAIMessageFormat } from "@openuidev/react-ui";++const llm = fetchLLM({+ url: "/api/chat",+ // Parses the UIMessage stream that toUIMessageStreamResponse() returns.+ streamAdapter: vercelAIAdapter(),+ // Sends UIMessage[], which the route passes to convertToModelMessages().+ messageFormat: vercelAIMessageFormat,+});+```++</Step>++<Step title="Connect your chat UI" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/vercel-ai-sdk/src/app/page.tsx">++Pass that `llm` to `AgentInterface` for a ready-made chat app, or to `ChatProvider` from `@openuidev/react-headless` to build your own UI. Either way, streamed text, tool calls and multi-step runs arrive as the same chat events.++```tsx title="src/app/page.tsx"+"use client";++import { AgentInterface } from "@openuidev/react-ui";+import { openuiLibrary } from "@openuidev/react-ui/genui-lib";++// `llm` is the fetchLLM() connection from the previous step, in this same file.++export default function Page() {+ return <AgentInterface llm={llm} componentLibrary={openuiLibrary} />;+}+```++</Step>++</Steps>diff --git a/docs/content/integrations/vercel-eve.mdx b/docs/content/integrations/vercel-eve.mdxnew file mode 100644index 000000000..7646fde31--- /dev/null+++ b/docs/content/integrations/vercel-eve.mdx@@ -0,0 +1,105 @@+---+title: "Vercel Eve"+---++<Steps>++<Step title="Add the OpenUI instructions" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/vercel-eve/agent/instructions/openui.ts">++Add an Eve instruction that injects the generated OpenUI Lang prompt when each session starts, alongside the agent's own identity and tools.++```ts title="agent/instructions/openui.ts"+import { defineDynamic, defineInstructions } from "eve/instructions";+// Builds the OpenUI prompt; copy src/lib/cloud-prompt.ts from the example.+import { cloudInstructions } from "../../src/lib/cloud-prompt";++// Eve loads every file in agent/instructions. This one adds the OpenUI Lang+// prompt once, when a session starts.+export default defineDynamic({+ events: {+ "session.started": () =>+ defineInstructions({+ markdown: cloudInstructions(),+ }),+ },+});+```++</Step>++<Step title="Deliver turns over Eve's session protocol" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/vercel-eve/src/eve-chat.ts">++Send each turn through Eve's HTTP channel and store the session cursor per OpenUI thread, so the NDJSON event stream can resume where it stopped.++```ts title="src/eve-chat.ts"+import type { SessionState } from "eve/client";++// Eve's HTTP channel is served same-origin by withEve() in next.config.ts.+// `state` is this thread's saved cursor: { sessionId?, continuationToken?, streamIndex }.+async function openEveStream(state: SessionState, message: string, signal: AbortSignal) {+ // The first turn creates a session; later turns reuse it with the continuation token.+ const deliverPath = state.sessionId+ ? `/eve/v1/session/${encodeURIComponent(state.sessionId)}`+ : "/eve/v1/session";+ const delivered = await fetch(deliverPath, {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ message, continuationToken: state.continuationToken }),+ signal,+ });+ const meta: { sessionId?: string; continuationToken?: string } = await delivered.json();+ const sessionId = meta.sessionId ?? state.sessionId;+ if (!sessionId) throw new Error("Eve did not return a session id.");++ // Read Eve's NDJSON event stream, resuming from the saved index.+ const startIndex = state.sessionId === sessionId ? state.streamIndex : 0;+ const response = await fetch(+ `/eve/v1/session/${encodeURIComponent(sessionId)}/stream?startIndex=${startIndex}`,+ { signal },+ );+ const continuationToken = meta.continuationToken ?? state.continuationToken;+ return { response, sessionId, continuationToken, startIndex };+}+```++</Step>++<Step title="Map events with eveAdapter()" source="https://github.com/thesysdev/openui/blob/main/examples/agent-frameworks/vercel-eve/src/eve-chat.ts">++Use eveAdapter() from @openuidev/react-headless as the llm's stream protocol. It converts Eve text, tool call, and failure events into AG-UI for AgentInterface or your own UI built on ChatProvider.++```ts title="src/eve-chat.ts"+import { eveAdapter, type ChatLLM } from "@openuidev/react-headless";+import type { HandleMessageStreamEvent, SessionState } from "eve/client";++// openEveStream() is the previous step. The example's src/eve-chat.ts also has+// loadSession/saveSession (one cursor per thread) and latestUserText().+let active: { threadId: string; cursor: SessionState };++export const llm: ChatLLM = {+ send: async ({ messages, threadId, signal }) => {+ const state = loadSession(localStorage, threadId);+ const opened = await openEveStream(state, latestUserText(messages), signal);+ const { sessionId, continuationToken, startIndex: streamIndex } = opened;+ active = { threadId, cursor: { sessionId, continuationToken, streamIndex } };+ return opened.response;+ },+ streamProtocol: eveAdapter({+ // eveAdapter() maps Eve events to AG-UI. onEvent also sees every raw event,+ // so count them to keep this thread's cursor current.+ onEvent: (event: HandleMessageStreamEvent) => {+ active.cursor.streamIndex += 1;+ // Completed sessions start fresh next turn; waiting or failed ones resume.+ if (event.type === "session.completed") {+ saveSession(localStorage, active.threadId, { streamIndex: 0 });+ } else if (event.type === "session.waiting" || event.type === "session.failed") {+ saveSession(localStorage, active.threadId, active.cursor);+ }+ },+ }),+};+```++</Step>++</Steps>diff --git a/docs/content/integrations/vue.mdx b/docs/content/integrations/vue.mdxnew file mode 100644index 000000000..c6c9dc881--- /dev/null+++ b/docs/content/integrations/vue.mdx@@ -0,0 +1,91 @@+---+title: "Vue 3"+---++<Steps>++<Step title="Write the component as an SFC" source="https://www.openui.com/docs/api-reference/vue-lang">++A registered component receives the parsed values in a props prop and a renderNode function. Declare both with defineProps, otherwise Vue forwards renderNode to the root element as an attribute.++```vue title="Greeting.vue"+<script setup lang="ts">+import type { RenderNodeResult } from "@openuidev/vue-lang";++defineProps<{+ props: { name?: string };+ renderNode: (value: unknown) => RenderNodeResult;+}>();+</script>++<template>+ <p>Hello, {{ props.name }}!</p>+</template>+```++</Step>++<Step title="Register it and generate the prompt" source="https://www.openui.com/docs/api-reference/vue-lang">++Pair the SFC with a Zod schema in defineComponent, collect the definitions with createLibrary, and call library.prompt(). A Nuxt server route cannot import .vue files, so share the schemas there and generate the prompt with @openuidev/lang-core ^0.4.++```ts title="library.ts"+import { createLibrary, defineComponent } from "@openuidev/vue-lang";+import { z } from "zod/v4";+// The SFC from the previous step.+import GreetingComponent from "./Greeting.vue";++const Greeting = defineComponent({+ name: "Greeting",+ description: "Greet the user by name.",+ props: z.object({ name: z.string() }),+ component: GreetingComponent,+});++export const library = createLibrary({+ components: [Greeting],+ root: "Greeting",+});++// The system prompt to send with each model request.+export const systemPrompt = library.prompt({+ preamble: "You are a helpful assistant.",+ examples: ['root = Greeting("Alice")'],+});+```++</Step>++<Step title="Render the stream with Renderer" source="https://www.openui.com/docs/api-reference/vue-lang">++Bind the accumulated text, the library and the streaming flag with :response, :library and :is-streaming. Renderer callbacks are props, not emitted events, so bind onAction with :on-action and send continuation actions back to the model as a new turn.++```vue title="AssistantMessage.vue"+<script setup lang="ts">+import { BuiltinActionType, Renderer, type ActionEvent } from "@openuidev/vue-lang";+// The library from library.ts.+import { library } from "./library";++// The model's OpenUI Lang output so far, and whether it is still streaming.+defineProps<{ response: string | null; isStreaming: boolean }>();++function handleAction(event: ActionEvent) {+ if (event.type === BuiltinActionType.ContinueConversation && event.humanFriendlyMessage) {+ // Send event.humanFriendlyMessage to your chat as the next user message.+ }+}+</script>++<template>+ <Renderer+ :response="response"+ :library="library"+ :is-streaming="isStreaming"+ :on-action="handleAction"+ />+</template>+```++</Step>++</Steps>diff --git a/docs/lib/source.ts b/docs/lib/source.tsindex 0d1ac8096..34f23ec32 100644--- a/docs/lib/source.ts+++ b/docs/lib/source.ts@@ -1,7 +1,7 @@import { type InferPageType, loader } from "fumadocs-core/source";import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";import { toFumadocsSource } from "fumadocs-mdx/runtime/server";-import { blogPosts, docs } from "fumadocs-mdx:collections/server";+import { blogPosts, docs, integrationGuides } from "fumadocs-mdx:collections/server";export const BASE_URL = "https://www.openui.com";@@ -25,6 +25,12 @@ export const blog = loader({source: toFumadocsSource(blogPosts, []),});+/** Example and steps for each integration page, keyed by the integration's slug. */+export const integrationGuide = loader({+ baseUrl: "/integrations",+ source: toFumadocsSource(integrationGuides, []),+});+export async function getLLMText(page: InferPageType<typeof source>) {const processed = await page.data.getText("processed");const description = page.data.description || `OpenUI documentation for ${page.data.title}.`;diff --git a/docs/public/integrations/examples/ag-ui-dark.webp b/docs/public/integrations/examples/ag-ui-dark.webpnew file mode 100644index 000000000..4474c4578Binary files /dev/null and b/docs/public/integrations/examples/ag-ui-dark.webp differdiff --git a/docs/public/integrations/examples/ag-ui-light.webp b/docs/public/integrations/examples/ag-ui-light.webpnew file mode 100644index 000000000..53c67ce62Binary files /dev/null and b/docs/public/integrations/examples/ag-ui-light.webp differdiff --git a/docs/public/integrations/examples/langchain-langgraph-dark.webp b/docs/public/integrations/examples/langchain-langgraph-dark.webpnew file mode 100644index 000000000..9467caa83Binary files /dev/null and b/docs/public/integrations/examples/langchain-langgraph-dark.webp differdiff --git a/docs/public/integrations/examples/langchain-langgraph-light.webp b/docs/public/integrations/examples/langchain-langgraph-light.webpnew file mode 100644index 000000000..fbef290cdBinary files /dev/null and b/docs/public/integrations/examples/langchain-langgraph-light.webp differdiff --git a/docs/public/integrations/examples/pi-coding-agent-dark.webp b/docs/public/integrations/examples/pi-coding-agent-dark.webpnew file mode 100644index 000000000..b34ba7e62Binary files /dev/null and b/docs/public/integrations/examples/pi-coding-agent-dark.webp differdiff --git a/docs/public/integrations/examples/pi-coding-agent-light.webp b/docs/public/integrations/examples/pi-coding-agent-light.webpnew file mode 100644index 000000000..3f177c5cdBinary files /dev/null and b/docs/public/integrations/examples/pi-coding-agent-light.webp differdiff --git a/docs/public/integrations/examples/vercel-ai-sdk-dark.webp b/docs/public/integrations/examples/vercel-ai-sdk-dark.webpnew file mode 100644index 000000000..33091186bBinary files /dev/null and b/docs/public/integrations/examples/vercel-ai-sdk-dark.webp differdiff --git a/docs/public/integrations/examples/vercel-ai-sdk-light.webp b/docs/public/integrations/examples/vercel-ai-sdk-light.webpnew file mode 100644index 000000000..988829717Binary files /dev/null and b/docs/public/integrations/examples/vercel-ai-sdk-light.webp differdiff --git a/docs/source.config.ts b/docs/source.config.tsindex 1a093d0af..4faaef30b 100644--- a/docs/source.config.ts+++ b/docs/source.config.ts@@ -47,6 +47,14 @@ export const blogPosts = defineCollections({}),});+// The body of each /integrations/<slug> page: its example and integration steps.+// The file name is the slug; the page's metadata lives in app/(home)/integrations/data.ts.+export const integrationGuides = defineCollections({+ type: "doc",+ dir: "content/integrations",+ schema: pageSchema,+});+export default defineConfig({plugins: [lastModified()],});diff --git a/examples/agent-frameworks/mastra/src/app/api/chat/route.ts b/examples/agent-frameworks/mastra/src/app/api/chat/route.tsindex a7b58857b..bccb4e306 100644--- a/examples/agent-frameworks/mastra/src/app/api/chat/route.ts+++ b/examples/agent-frameworks/mastra/src/app/api/chat/route.ts@@ -37,9 +37,10 @@ export async function POST(req: NextRequest) {},complete: close,error: (error: Error) => {- const msg = error.message;console.error("Mastra stream error:", error);- controller.enqueue(encoder.encode(`data: ${JSON.stringify({ error: msg })}\n\n`));+ // An AG-UI RUN_ERROR event, so agUIAdapter shows the error in the chat.+ const runError = { type: "RUN_ERROR", message: error.message };+ controller.enqueue(encoder.encode(`data: ${JSON.stringify(runError)}\n\n`));close();},});diff --git a/examples/app-frameworks/react-native/README.md b/examples/app-frameworks/react-native/README.mdindex c15607ff8..0b1955682 100644--- a/examples/app-frameworks/react-native/README.md+++ b/examples/app-frameworks/react-native/README.md@@ -20,7 +20,7 @@ A full-stack example that demonstrates using `@openuidev/react-lang` in a React│ │ ──────►│ ││ • Chat UI │ │ • /api/chat (POST) ││ • <Renderer /> parsing │◄────── │ • Streams OpenUI Lang │-│ streamed OpenUI Lang │ stream│ from GPT │+│ streamed OpenUI Lang │ stream│ via OpenUI Cloud ││ • Native chart components │ │ • CORS enabled │└─────────────────────────────┘ └──────────────────────────┘```@@ -33,8 +33,6 @@ react-native/│ ├── package.json # Standalone backend dependencies and scripts│ ├── src/│ │ ├── library.ts # Component library definition (Node-compatible)-│ │ ├── generated/-│ │ │ └── system-prompt.txt # Generated locally from library.ts│ │ └── app/api/chat/│ │ └── route.ts # Streaming chat endpoint│ └── env.example@@ -73,15 +71,7 @@ Add your key to `backend/.env.local`:THESYS_API_KEY=sk-th-...```-### 3. Generate the system prompt--The [Prompt Generator](https://www.openui.com/docs/openui-lang/overview) compiles `library.ts` into an ignored `generated/system-prompt.txt` containing component signatures, syntax rules, and streaming guidelines for the LLM. The backend dev and build commands run this step automatically; run it directly when you only want to refresh the generated artifacts:--```bash-(cd backend && pnpm generate:prompt)-```--### 4. Start the backend+### 3. Start the backend```bash(cd backend && pnpm dev)@@ -89,7 +79,7 @@ The [Prompt Generator](https://www.openui.com/docs/openui-lang/overview) compileThe API will be available at `http://localhost:3000`.-### 5. Start the mobile app+### 4. Start the mobile app```bash(cd chat-app && pnpm start)@@ -99,7 +89,7 @@ The API will be available at `http://localhost:3000`.### `backend/src/library.ts`-Defines the custom component library using [`defineComponent`](https://www.openui.com/docs/openui-lang/overview) and `createLibrary`. This is a **Node-compatible** version (renderers set to `null`) used only by the CLI to generate the system prompt — the backend never renders components itself.+Defines the custom component library using [`defineComponent`](https://www.openui.com/docs/openui-lang/overview) and `createLibrary`. This is a **Node-compatible** version (renderers set to `null`) that the chat route turns into the system prompt — the backend never renders components itself.The library exposes five components:@@ -115,8 +105,8 @@ The library exposes five components:A Next.js Route Handler that:-1. Loads `system-prompt.txt` at startup-2. Forwards the conversation to the OpenAI streaming API+1. Builds the system prompt from `library.ts` with `generateSystemPrompt` from `@openuidev/lang-core` when the module loads+2. Streams the conversation through OpenUI Cloud, using the OpenAI SDK pointed at `https://api.thesys.dev/v1/embed`3. Returns raw `text/plain` chunks — intentionally simpler than SSE so React Native can consume the stream directly without a browser `EventSource`### React Native app (`chat-app/`)@@ -125,11 +115,10 @@ Uses the [`<Renderer />`](https://www.openui.com/docs/openui-lang/overview) comp## Scripts-| Directory | Script | Description |-| ----------- | ---------------------- | ------------------------------------------------ |-| `backend/` | `pnpm dev` | Start the Next.js API server |-| `backend/` | `pnpm generate:prompt` | Regenerate `system-prompt.txt` from `library.ts` |-| `chat-app/` | `pnpm start` | Start the Expo dev server |+| Directory | Script | Description |+| ----------- | ------------ | ---------------------------- |+| `backend/` | `pnpm dev` | Start the Next.js API server |+| `chat-app/` | `pnpm start` | Start the Expo dev server |## Learn Morediff --git a/packages/svelte-lang/README.md b/packages/svelte-lang/README.mdindex 7fb10fc49..c0cc8925c 100644--- a/packages/svelte-lang/README.md+++ b/packages/svelte-lang/README.md@@ -11,12 +11,12 @@ Svelte 5 bindings for OpenUI Lang. Define model-renderable Svelte components, ge## Install```bash-npm install @openuidev/svelte-lang+npm install @openuidev/svelte-lang zod# or-pnpm add @openuidev/svelte-lang+pnpm add @openuidev/svelte-lang zod```-**Peer dependencies:** `svelte >=5.0.0`+**Peer dependencies:** `svelte >=5.0.0`, `zod ^3.25.0 || ^4.0.0`## Overviewdiff --git a/packages/vue-lang/README.md b/packages/vue-lang/README.mdindex 07b575efd..97249800a 100644--- a/packages/vue-lang/README.md+++ b/packages/vue-lang/README.md@@ -11,12 +11,12 @@ Vue 3 bindings for OpenUI Lang. Define model-renderable Vue components, generate## Install```bash-npm install @openuidev/vue-lang+npm install @openuidev/vue-lang zod# or-pnpm add @openuidev/vue-lang+pnpm add @openuidev/vue-lang zod```-**Peer dependencies:** `vue >=3.5.0`+**Peer dependencies:** `vue >=3.5.0`, `zod ^3.25.0 || ^4.0.0`## Overview