Is your feature request related to a problem? Please describe.
CopilotKit applications already own the chat shell, conversation state, AG-UI transport, and tool lifecycle. There is no first-party OpenUI adapter for rendering streamed OpenUI Lang inside CopilotKit tool calls. Applications must currently register tools, inject the OpenUI component instructions, map streaming status, handle human input, and restore submitted form state themselves.
This is different from using OpenUI's AG-UI adapter with AgentInterface. In this case CopilotKit remains the host shell and OpenUI renders generated interfaces inside its tool-call extension points.
Describe the solution you'd like
Add a focused @openuidev/copilotkit package under packages/copilotkit, modeled on the existing @openuidev/assistant-ui integration.
Proposed behavior:
- Register
present_openui through CopilotKit v2 useFrontendTool for display-only UI, with followUp: false.
- Register
prompt_openui through useHumanInTheLoop for forms and choices that pause until the user responds.
- Render partial streamed
ui arguments with OpenUI Renderer and openuiChatLibrary.
- Generate model instructions from the same OpenUI library used by the renderer.
- Return
@ToAssistant action context, parameters, form name, and form state through CopilotKit's tool result flow.
- Restore submitted form state when completed tool calls are replayed from conversation history.
- Apply an OpenUI
ThemeProvider by default, with an opt-out for applications that already own the theme boundary.
- Support custom libraries, prompt options, tool names, renderer options, and error handling.
- Add focused unit and renderer tests, package documentation, API reference documentation, and a small runnable CopilotKit example for browser validation.
The adapter would target CopilotKit v2 from @copilotkit/react-core/v2. The current published @copilotkit/react-core version is 1.69.3.
Division of responsibility:
- CopilotKit owns the chat shell, agent connection, messages, tool execution, and continuation.
- OpenUI owns the generated UI language, streaming parser, component library, rendering, interaction state, and action payloads.
Describe alternatives you've considered
- Document an app-local integration only. This leaves every application to duplicate status mapping, prompt generation, action serialization, and replay behavior.
- Add CopilotKit directly to
@openuidev/react-ui. This would make an optional chat shell a dependency or peer of the main React UI package.
- Use OpenUI
AgentInterface with the AG-UI adapter. That is useful when OpenUI owns the shell, but it does not address applications where CopilotKit must remain the shell.
A separate adapter package keeps the host-specific dependency isolated and matches the existing assistant-ui package boundary.
Additional context
Proposed interaction path:
CopilotKit chat -> model tool call -> streamed OpenUI Lang -> OpenUI Renderer
CopilotKit chat <- next model turn <- tool result <- follow-up or form action
Planned validation includes:
- display-only chart rendering with no raw OpenUI Lang visible;
- a
FollowUpBlock item producing exactly one new CopilotKit turn;
- a validated form submission carrying distinctive form values into exactly one new turn;
- streamed partial arguments, parser error handling, theme application, and replayed form state;
- package typecheck, tests, lint, build, publint, and package export checks.
If this package boundary and scope are acceptable, I can implement it on a linked branch and open a pull request after approval.
Is your feature request related to a problem? Please describe.
CopilotKit applications already own the chat shell, conversation state, AG-UI transport, and tool lifecycle. There is no first-party OpenUI adapter for rendering streamed OpenUI Lang inside CopilotKit tool calls. Applications must currently register tools, inject the OpenUI component instructions, map streaming status, handle human input, and restore submitted form state themselves.
This is different from using OpenUI's AG-UI adapter with AgentInterface. In this case CopilotKit remains the host shell and OpenUI renders generated interfaces inside its tool-call extension points.
Describe the solution you'd like
Add a focused
@openuidev/copilotkitpackage underpackages/copilotkit, modeled on the existing@openuidev/assistant-uiintegration.Proposed behavior:
present_openuithrough CopilotKit v2useFrontendToolfor display-only UI, withfollowUp: false.prompt_openuithroughuseHumanInTheLoopfor forms and choices that pause until the user responds.uiarguments with OpenUIRendererandopenuiChatLibrary.@ToAssistantaction context, parameters, form name, and form state through CopilotKit's tool result flow.ThemeProviderby default, with an opt-out for applications that already own the theme boundary.The adapter would target CopilotKit v2 from
@copilotkit/react-core/v2. The current published@copilotkit/react-coreversion is 1.69.3.Division of responsibility:
Describe alternatives you've considered
@openuidev/react-ui. This would make an optional chat shell a dependency or peer of the main React UI package.AgentInterfacewith the AG-UI adapter. That is useful when OpenUI owns the shell, but it does not address applications where CopilotKit must remain the shell.A separate adapter package keeps the host-specific dependency isolated and matches the existing assistant-ui package boundary.
Additional context
Proposed interaction path:
Planned validation includes:
FollowUpBlockitem producing exactly one new CopilotKit turn;If this package boundary and scope are acceptable, I can implement it on a linked branch and open a pull request after approval.