McpAppsHost
@Composable
MCP Apps for a chat screen: content gets the renderer for DataPart.MCP_APP (register it in AiElementsRenderers.data), and the views' dialogs — tool approvals, full screen — show at this level, whether or not their view is scrolled into sight. Views are torn down with this.
McpAppsHost({ id -> clients[id] }, actions) { apps ->
CompositionLocalProvider(LocalAiElementsRenderers provides AiElementsRenderers(data = mapOf(DataPart.MCP_APP to apps))) {
Chat(controller)
}
}Content copied to clipboard