README
Agent Runtimes / chat
chat
Chat - Next generation chat component for agent-runtimes.
Features:
- Multiple transport support: AG-UI, A2A, ACP
- Hybrid tool execution (frontend/backend)
- Human-in-the-loop (HITL) tool approval
- Middleware pipeline for extensibility
- Extension registry for custom renderers
- Primer React UI components
- Zustand state management (NO provider required!)
Example
import {
useChatStore,
ChatSidebar,
useFrontendTool,
DatalayerInferenceProvider,
} from './chat';
// Setup inference provider (once at app init)
const provider = new DatalayerInferenceProvider({
apiKey: 'your-api-key',
baseUrl: 'https://api.datalayer.io',
});
useChatStore.getState().setInferenceProvider(provider);
function App() {
return (
<>
<ToolRegistrar />
<ChatSidebar title="Assistant" />
</>
);
}
function ToolRegistrar() {
useFrontendTool({
name: 'greet',
description: 'Greet a user',
parameters: [{ name: 'name', type: 'string', required: true }],
handler: async ({ name }) => ({ greeting: `Hello, ${name}!` }),
});
return null;
}
References
Chat
Re-exports Chat
ChatBase
Re-exports ChatBase
ChatFloating
Re-exports ChatFloating
ChatFloatingProps
Re-exports ChatFloatingProps
ChatHeader
Re-exports ChatHeader
ChatHeaderProps
Re-exports ChatHeaderProps
ChatInline
Re-exports ChatInline
ChatInlineProps
Re-exports ChatInlineProps
ChatInlineProtocolConfig
Re-exports ChatInlineProtocolConfig
ChatMessages
Re-exports ChatMessages
ChatMessagesProps
Re-exports ChatMessagesProps
ChatProps
Re-exports ChatProps
ChatSidebar
Re-exports ChatSidebar
ChatSidebarProps
Re-exports ChatSidebarProps
ChatStandalone
Re-exports ChatStandalone
DynamicToolPart
Re-exports DynamicToolPart
DynamicToolPartProps
Re-exports DynamicToolPartProps
FloatingBrandButton
Re-exports FloatingBrandButton
FloatingBrandButtonProps
Re-exports FloatingBrandButtonProps
InputPrompt
Re-exports InputPrompt
InputPromptProps
Re-exports InputPromptProps
McpAggregateStatus
Re-exports McpAggregateStatus
McpServerStatus
Re-exports McpServerStatus
McpStatusIndicator
Re-exports McpStatusIndicator
McpStatusIndicatorProps
Re-exports McpStatusIndicatorProps
MessagePart
Re-exports MessagePart
MessagePartProps
Re-exports MessagePartProps
PendingApproval
Re-exports PendingApproval
PoweredByTag
Re-exports PoweredByTag
PoweredByTagProps
Re-exports PoweredByTagProps
ReasoningPart
Re-exports ReasoningPart
ReasoningPartProps
Re-exports ReasoningPartProps
SandboxAggregateStatus
Re-exports SandboxAggregateStatus
SandboxStatusIndicator
Re-exports SandboxStatusIndicator
SandboxStatusIndicatorProps
Re-exports SandboxStatusIndicatorProps
SandboxWsStatus
Re-exports SandboxWsStatus
TextPart
Re-exports TextPart
TextPartProps
Re-exports TextPartProps
ToolApprovalBanner
Re-exports ToolApprovalBanner
ToolApprovalBannerProps
Re-exports ToolApprovalBannerProps
ToolApprovalDialog
Re-exports ToolApprovalDialog
ToolApprovalDialogProps
Re-exports ToolApprovalDialogProps
ToolCallDisplay
Re-exports ToolCallDisplay
ToolCallDisplayProps
Re-exports ToolCallDisplayProps
ToolPart
Re-exports ToolPart
ToolPartProps
Re-exports ToolPartProps
useToolApprovalDialog
Re-exports useToolApprovalDialog