npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

drop-agent-ui

v1.0.4

Published

React components for reasoning agent chat interfaces

Readme

drop-agent-ui

React components for AI reasoning agent chat interfaces. Pre-built UI components that work seamlessly with drop-agent for instant chat experiences with extended thinking visualization.

Quick Start

npm install drop-agent-ui
import React from 'react';
import { ChatInterface } from 'drop-agent-ui';

function App() {
  return (
    <div className="h-screen">
      <ChatInterface 
        serverUrl="http://localhost:3001"
        title="My AI Assistant"
      />
    </div>
  );
}

Features

  • 💬 Complete Chat Interface - Full-featured chat UI out of the box
  • 🧠 Thinking Visualization - Shows AI reasoning process in real-time
  • 🔧 Tool Results Display - Highlights tool usage with clear formatting
  • ⚡ Real-time Streaming - SSE-powered live responses
  • 🎨 Customizable - Style with CSS classes and props
  • 📱 Responsive - Works on desktop and mobile

Components

ChatInterface (Complete Solution)

import { ChatInterface } from 'drop-agent-ui';

<ChatInterface 
  serverUrl="http://localhost:3001"
  title="My Reasoning Agent"
  modelOptions={{
    model: 'claude-opus-4-20250514',
    maxTokens: 16000,
    thinkingBudget: 10000
  }}
  className="custom-chat"
/>

Individual Components

import { 
  ThinkingBlock,
  ResponseBlock,
  ToolResults,
  UserMessage,
  ChatInput,
  useSSE
} from 'drop-agent-ui';

function CustomChat() {
  const { sendMessage } = useSSE('http://localhost:3001');
  
  return (
    <div>
      <ThinkingBlock 
        thinking={thinking} 
        isStreaming={true}
        className="my-thinking-style"
      />
      
      <ToolResults toolResults={results} />
      
      <ResponseBlock 
        content={response}
        title="AI Assistant"
        isStreaming={true}
      />
      
      <ChatInput 
        onSend={handleSend}
        placeholder="Ask me anything..."
        disabled={processing}
      />
    </div>
  );
}

useSSE Hook

import { useSSE } from 'drop-agent-ui';

function MyComponent() {
  const { sendMessage, isConnected, error } = useSSE('http://localhost:3001');
  
  const handleChat = async (message) => {
    await sendMessage(message, options, (data) => {
      // Handle streaming events
      if (data.type === 'thinking_delta') {
        setThinking(prev => prev + data.content);
      } else if (data.type === 'text_delta') {
        setResponse(prev => prev + data.content);
      }
    });
  };
}

Component Props

ChatInterface

  • serverUrl - Backend server URL (required)
  • title - Chat header title
  • modelOptions - Claude model configuration
  • className - Custom CSS classes

ThinkingBlock

  • thinking - Thinking content string
  • isStreaming - Show typing indicator
  • className - Custom styling
  • showTitle - Display "Thinking:" header

ResponseBlock

  • content - Response text
  • isStreaming - Show typing indicator
  • title - Custom title (default: "Assistant")
  • className - Custom styling

ChatInput

  • onSend - Callback when message sent
  • disabled - Disable input during processing
  • placeholder - Input placeholder text

Styling

All components accept className props for custom styling. The default styles use Tailwind-like classes but can be overridden:

<ThinkingBlock 
  thinking={content}
  className="my-custom-thinking-style bg-blue-50 p-4"
/>

Server Setup

This UI package requires a backend server running drop-agent:

npm install drop-agent
import { ReasoningAgent, addCommonTools, setupSSERoutes } from 'drop-agent';

const agent = new ReasoningAgent({ apiKey: process.env.ANTHROPIC_API_KEY });
addCommonTools(agent);
setupSSERoutes(app, agent);

Requirements

  • React 18+
  • Backend server with drop-agent

Full Documentation

  • GitHub: https://github.com/rockymedure/drop-agent
  • Core Package: drop-agent for backend functionality
  • Integration Guide: Complete setup examples

License

MIT