AsyncContext shapes following an update in inngest@3.45.0b175718: # New Package: @inngest/use-agent
Introducing a comprehensive React hooks package for building AI chat interfaces with AgentKit networks.
@inngest/use-agent is a standalone npm package that provides a complete set of React hooks for integrating with AgentKit. This package extracts and consolidates all the React functionality needed to build sophisticated AI chat applications.
useAgent, useChat, useThreads for real-time streaming and thread managementuseEphemeralThreads, useConversationBranching, useEditMessage, useMessageActions, useSidebar, useIsMobileAgentProvider for shared connections and configurationDefaultAgentTransport and custom transport supportnpm install @inngest/use-agents
# Peer dependencies
npm install react @inngest/realtime uuid
import { useChat, AgentProvider } from '@inngest/use-agents';
function App() {
return (
<AgentProvider userId="user-123">
<ChatComponent />
</AgentProvider>
);
}
function ChatComponent() {
const { messages, sendMessage, status } = useChat();
return <div>/* Your chat UI */</div>;
}
This package enables developers to:
If you were previously using local hooks from AgentKit examples, replace local imports:
// Before
import { useChat } from "@/hooks";
import { AgentProvider } from "@/contexts/AgentContext";
// After
import { useChat, AgentProvider } from "@inngest/use-agents";
No functional changes are required - the API is identical to the previous local implementation.
b175718: # Comprehensive AgentKit Enhancements
Major improvements to AgentKit with enhanced documentation, new API routes, comprehensive UI components, and example applications.
New Advanced Pattern Guides:
legacy-ui-streaming.mdx - Guide for UI streaming with useAgent hookuse-chat.mdx - Comprehensive guide for building chat interfacesuse-threads.mdx - Documentation for managing conversation threadsuse-agent.mdx - Updated agent integration patternsDocumentation Reorganization:
Comprehensive Streaming Architecture:
Event Types Supported:
run.started, run.completed, run.failed, run.interruptedtext.delta, reasoning.delta, data.deltatool_call.arguments.delta, tool_call.output.deltapart.created, part.completed, part.failedhitl.requested, hitl.resolvedusage.updated, metadata.updated, stream.endedDeveloper Experience:
This streaming system enables real-time UI updates that perfectly match the useAgent hook expectations, creating seamless agent-to-UI communication.
Chat & Communication:
POST /api/chat - Main chat endpoint with Zod validation and Inngest integrationPOST /api/chat/cancel - Chat cancellation with run interruption eventsPOST /api/approve-tool - Human-in-the-loop tool approval systemPOST /api/realtime/token - Real-time subscription token generationThread Management:
GET/POST /api/threads - Thread listing and creation with paginationGET/DELETE/PATCH /api/threads/[threadId] - Individual thread operationsIntegration:
/api/inngest/route - Inngest function serving with runAgentChatAI-Specific Elements:
Actions & Action - Interactive action buttons with tooltipsBranch components - Conversation branching and navigationCodeBlock - Syntax-highlighted code display with copy functionalityConversation - Chat conversation containers with scroll managementImage - AI-generated image display componentsInlineCitation - Citation cards and source referencingLoader - Loading animations and statesMessage components - Message display with avatars and contentPromptInput - Responsive chat input with model selectionReasoning - Agent reasoning display with streaming supportSources - Source material display and linkingSuggestion - AI suggestion chips and interactionsTask - Task display and management componentsTool - Tool call display with input/output viewsWebPreview - Web page preview componentsChat Interface Components:
Chat - Main chat interface with sidebar integrationEmptyState - Welcome screen with suggestionsChatHeader - Header with actions and agent informationShareDialog - Thread sharing functionalityMessageActions - Copy, edit, regenerate, like/dislike functionalityMessageEditor - In-place message editingPlayground & Development Tools:
SqlPlayground - Interactive SQL query interfaceSqlEditor - SQL editing with syntax highlightingEphemeralChat - Client-side only chat for demosMultiChat - Multiple concurrent chat sessionsUI Primitives & Layout:
Button, Card, Dialog, Sheet, Tabs and 30+ UI primitivesExample Applications:
/chat/[threadId])Build & Configuration:
Development Tools:
This release significantly enhances the AgentKit ecosystem with production-ready tools for building sophisticated AI chat applications.
81c90df: # Comprehensive AgentKit Enhancements
Major improvements to AgentKit with enhanced documentation, new API routes, comprehensive UI components, and example applications.
New Advanced Pattern Guides:
legacy-ui-streaming.mdx - Guide for UI streaming with useAgent hookuse-chat.mdx - Comprehensive guide for building chat interfacesuse-threads.mdx - Documentation for managing conversation threadsuse-agent.mdx - Updated agent integration patternsDocumentation Reorganization:
Comprehensive Streaming Architecture:
Event Types Supported:
run.started, run.completed, run.failed, run.interruptedtext.delta, reasoning.delta, data.deltatool_call.arguments.delta, tool_call.output.deltapart.created, part.completed, part.failedhitl.requested, hitl.resolvedusage.updated, metadata.updated, stream.endedDeveloper Experience:
This streaming system enables real-time UI updates that perfectly match the useAgent hook expectations, creating seamless agent-to-UI communication.
Chat & Communication:
POST /api/chat - Main chat endpoint with Zod validation and Inngest integrationPOST /api/chat/cancel - Chat cancellation with run interruption eventsPOST /api/approve-tool - Human-in-the-loop tool approval systemPOST /api/realtime/token - Real-time subscription token generationThread Management:
GET/POST /api/threads - Thread listing and creation with paginationGET/DELETE/PATCH /api/threads/[threadId] - Individual thread operationsIntegration:
/api/inngest/route - Inngest function serving with runAgentChatAI-Specific Elements:
Actions & Action - Interactive action buttons with tooltipsBranch components - Conversation branching and navigationCodeBlock - Syntax-highlighted code display with copy functionalityConversation - Chat conversation containers with scroll managementImage - AI-generated image display componentsInlineCitation - Citation cards and source referencingLoader - Loading animations and statesMessage components - Message display with avatars and contentPromptInput - Responsive chat input with model selectionReasoning - Agent reasoning display with streaming supportSources - Source material display and linkingSuggestion - AI suggestion chips and interactionsTask - Task display and management componentsTool - Tool call display with input/output viewsWebPreview - Web page preview componentsChat Interface Components:
Chat - Main chat interface with sidebar integrationEmptyState - Welcome screen with suggestionsChatHeader - Header with actions and agent informationShareDialog - Thread sharing functionalityMessageActions - Copy, edit, regenerate, like/dislike functionalityMessageEditor - In-place message editingPlayground & Development Tools:
SqlPlayground - Interactive SQL query interfaceSqlEditor - SQL editing with syntax highlightingEphemeralChat - Client-side only chat for demosMultiChat - Multiple concurrent chat sessionsUI Primitives & Layout:
Button, Card, Dialog, Sheet, Tabs and 30+ UI primitivesExample Applications:
/chat/[threadId])Build & Configuration:
Development Tools:
This release significantly enhances the AgentKit ecosystem with production-ready tools for building sophisticated AI chat applications.
81c90df: # New Package: @inngest/use-agent
Introducing a comprehensive React hooks package for building AI chat interfaces with AgentKit networks.
@inngest/use-agent is a standalone npm package that provides a complete set of React hooks for integrating with AgentKit. This package extracts and consolidates all the React functionality needed to build sophisticated AI chat applications.
useAgent, useChat, useThreads for real-time streaming and thread managementuseEphemeralThreads, useConversationBranching, useEditMessage, useMessageActions, useSidebar, useIsMobileAgentProvider for shared connections and configurationDefaultAgentTransport and custom transport supportnpm install @inngest/use-agents
# Peer dependencies
npm install react @inngest/realtime uuid
import { useChat, AgentProvider } from '@inngest/use-agents';
function App() {
return (
<AgentProvider userId="user-123">
<ChatComponent />
</AgentProvider>
);
}
function ChatComponent() {
const { messages, sendMessage, status } = useChat();
return <div>/* Your chat UI */</div>;
}
This package enables developers to:
If you were previously using local hooks from AgentKit examples, replace local imports:
// Before
import { useChat } from "@/hooks";
import { AgentProvider } from "@/contexts/AgentContext";
// After
import { useChat, AgentProvider } from "@inngest/use-agents";
No functional changes are required - the API is identical to the previous local implementation.
43a0745: Removed redundant call to this.listMCPTools(server) as we are now using a promises array to handle multiple servers concurrently
Fixed conditional in MCP client initialization and moved this._mcpClients.push(client) to the beginning of listMCPTools method to prevent duplicate clients from being registered
index.tstools and tool_config if not tools are providedcreateServer(), removing risk of parallel indexingdefaultRouter