BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/inferencesh/agent

Agent Chat

inferencesh/agent
FreeBlock

Full-featured AI agent chat with state management, tools, and widgets.

Live preview

live · rendered by the registry
Rendered by inferencesh on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://ui.inference.sh/r/agent.json

Source

registry/blocks/agent/agent.tsxui.inference.sh/r/agent.json · first 6 KB
1/**
2 * Agent - Pre-composed Chat Component
3 *
4 * Ready-to-use chat UI built from primitives.
5 * Uses @inferencesh/sdk/agent for state management.
6 */
7
8import React, { memo, useMemo } from 'react';
9import { cn } from '@/lib/utils';
10import { Bot } from 'lucide-react';
11import { Button } from '@/components/ui/button';
12import {
13 Inference,
14 ChatMessageStatusReady,
15 ChatMessageStatusFailed,
16 ChatMessageStatusCancelled,
17 ChatMessageRoleUser,
18 ChatMessageRoleAssistant,
19 ChatMessageContentTypeReasoning,
20 ChatMessageContentTypeText,
21 type ChatMessageDTO,
22} from '@inferencesh/sdk';
23import {
24 AgentChatProvider,
25 useAgentChat,
26 useAgentActions,
27 isAdHocConfig,
28 type AgentOptions,
29} from '@inferencesh/sdk/agent';
30import { ChatContainer } from '@/components/infsh/agent/chat-container';
31import { VirtualizedChatMessages } from '@/registry/blocks/chat/components/virtualized-chat-messages';
32import { ChatInput } from '@/components/infsh/agent/chat-input';
33import { MessageBubble } from '@/components/infsh/agent/message-bubble';
34import { MessageContent } from '@/components/infsh/agent/message-content';
35import { MessageReasoning } from '@/components/infsh/agent/message-reasoning';
36import { MessageStatusIndicator } from '@/components/infsh/agent/message-status-indicator';
37import { ToolInvocations } from '@/components/infsh/agent/tool-invocations';
38
39// Component props
40interface AgentProps {
41 proxyUrl?: string;
42 apiKey?: string;
43 baseUrl?: string;
44 config: AgentOptions;
45 name?: string;
46 chatId?: string;
47 className?: string;
48 compact?: boolean;
49 allowFiles?: boolean;
50 allowImages?: boolean;
51 onChatCreated?: (chatId: string) => void;
52 description?: string;
53 examplePrompts?: string[];
54}
55
56// Check if message status is terminal (generation complete)
57function isTerminalStatus(status: string | undefined): boolean {
58 return status === ChatMessageStatusReady ||
59 status === ChatMessageStatusFailed ||
60 status === ChatMessageStatusCancelled;
61}
62
63// =============================================================================
64// Helper functions
65// =============================================================================
66
67function getTextContent(message: ChatMessageDTO): string {
68 const textContent = message.content.find((c) => c.type === ChatMessageContentTypeText);
69 return textContent?.text ?? '';
70}
71
72function getReasoningContent(message: ChatMessageDTO): string | undefined {
73// … truncated

What it pulls in

npm packages

  • @inferencesh/sdk

Other registry items

  • button
  • https://ui.inference.sh/r/chat.json
  • https://ui.inference.sh/r/tools.json
  • https://ui.inference.sh/r/widgets.json

Files it writes

  • registry/blocks/agent/agent.tsx

Facts

Registry
inferencesh
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on inferencesh ui.inference.sh Raw registry item This item as JSON

More from inferencesh

All 14 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Chat UI PrimitiveschatinferenceshBlocksFree1 dep · 15 files
Code Blockcode-blockinferenceshBlocksFreeno deps · 7 files
Markdown Renderer (legacy)markdowninferenceshBlocksFree2 deps · 2 files
pretext-mdpretext-mdinferenceshBlocksFree4 deps · 10 files
Sidebar Lightsidebar-lightinferenceshBlocksFreeno deps
StepsstepsinferenceshBlocksFreeno deps · 2 files
Table of Contentstable-of-contentsinferenceshBlocksFreeno deps
TasktaskinferenceshBlocksFree1 dep · 9 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex