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

agent-ui-overlay

v0.1.0

Published

AI Agent UI overlay for dynamic configuration via MCP tools

Readme

agent-ui-overlay

AI Agent UI overlay for dynamic configuration via MCP tools.

A React component library that provides a beautiful, draggable overlay interface for AI agents powered by Claude and MCP (Model Context Protocol).

Features

  • Draggable & resizable overlay window
  • Real-time chat interface with AI agent
  • Activity log with progressive disclosure (summary/details/full)
  • Configuration preview with change tracking
  • Dark and light themes
  • Multiple adapter options (Firestore real-time, REST polling)
  • TypeScript support
  • Zero runtime dependencies (only peer deps: React, Zustand, Framer Motion)

Installation

npm install agent-ui-overlay
# or
yarn add agent-ui-overlay
# or
pnpm add agent-ui-overlay

Peer Dependencies

npm install react react-dom zustand framer-motion

Quick Start

import { AgentOverlay, RestAdapter } from 'agent-ui-overlay';
import 'agent-ui-overlay/styles';

function App() {
  const adapter = new RestAdapter({
    baseUrl: '/api/agent',
  });

  return (
    <AgentOverlay
      adapter={adapter}
      sessionConfig={{
        partnerId: 'partner123',
        context: { dynamicAdId: 'ad456' }
      }}
      onConfigChange={(config) => {
        console.log('Agent updated config:', config);
      }}
      theme="dark"
      position="bottom-right"
      resizable
      minimizable
    />
  );
}

Using with Firebase/Firestore

import { AgentOverlay, FirestoreAdapter } from 'agent-ui-overlay';
import { getFirestore } from 'firebase/firestore';

const firestore = getFirestore();

function App() {
  const adapter = new FirestoreAdapter({
    firestore,
    agentEndpoint: '/api/agent/chat',
  });

  return (
    <AgentOverlay
      adapter={adapter}
      sessionConfig={{
        partnerId: 'partner123',
      }}
      theme="dark"
    />
  );
}

Components

AgentOverlay

Main overlay component with tabs for Chat, Activity, and Config.

<AgentOverlay
  adapter={adapter}              // Required: AgentAdapter instance
  sessionConfig={{               // Required: Session configuration
    partnerId: string;
    userId?: string;
    context?: Record<string, unknown>;
  }}
  onConfigChange={(config) => {}} // Called when agent makes config changes
  onSessionEnd={(session) => {}}  // Called when session ends
  theme="dark"                    // 'light' | 'dark' | 'system'
  position="bottom-right"         // Initial position
  defaultSize={{ width: 420, height: 600 }}
  resizable                       // Allow resizing
  minimizable                     // Allow minimizing to bubble
  closable                        // Allow closing
  zIndex={10000}                  // Custom z-index
  className=""                    // Custom class name
/>

AgentChat

Standalone chat component.

<AgentChat
  adapter={adapter}
  placeholder="Ask the AI agent..."
  showToolCalls      // Show tool call details inline
  showThinking       // Show thinking indicator
/>

ActivityLog

Standalone activity log component with progressive disclosure.

<ActivityLog
  adapter={adapter}
  defaultDisplayLevel="summary"  // 'summary' | 'details' | 'full'
  autoScroll                     // Auto-scroll to new entries
  maxEntries={100}               // Max entries to display
/>

ConfigPreview

Configuration preview with change tracking.

<ConfigPreview
  config={currentConfig}
  changes={[
    { path: 'template.title', oldValue: 'Old', newValue: 'New', timestamp: new Date() }
  ]}
  format="json"  // 'json' | 'visual'
/>

Hooks

useAgentSession

Manage agent session lifecycle.

const {
  session,      // Current session
  messages,     // Chat messages
  activityLog,  // Activity log entries
  isLoading,    // Loading state
  error,        // Error message
  sendMessage,  // Send a message
  endSession,   // End the session
} = useAgentSession({
  adapter,
  sessionConfig,
  onConfigChange,
  onSessionEnd,
});

useActivityLog

Manage activity log state.

const {
  entries,          // Filtered entries
  displayLevel,     // Current display level
  setDisplayLevel,  // Change display level
  filterByType,     // Filter by entry type
  typeCounts,       // Count by type
  clearLog,         // Clear all entries
} = useActivityLog({ maxEntries: 100 });

Adapters

RestAdapter

Uses REST API with polling for updates.

const adapter = new RestAdapter({
  baseUrl: '/api/agent',
  pollInterval: 1000,           // Polling interval (ms)
  headers: { 'X-Api-Key': '...' },  // Custom headers
});

FirestoreAdapter

Uses Firestore for real-time updates.

const adapter = new FirestoreAdapter({
  firestore,                    // Firestore instance
  agentEndpoint: '/api/agent',  // Backend endpoint for sending messages
});

Custom Adapter

Implement the AgentAdapter interface:

interface AgentAdapter {
  init(config: SessionConfig): Promise<void>;
  sendMessage(message: string): Promise<void>;
  onMessage(callback: (message: ChatMessage) => void): () => void;
  onActivityLog(callback: (entries: ActivityLogEntry[]) => void): () => void;
  onSessionChange(callback: (session: AgentSession | null) => void): () => void;
  onConfigChange?(callback: (config: Record<string, unknown>) => void): () => void;
  getSession(): AgentSession | null;
  endSession(): Promise<void>;
  destroy(): void;
}

Theming

Override CSS custom properties to customize the look:

.ai-ui-theme-dark {
  --ai-ui-bg: #1a1a1a;
  --ai-ui-accent: #6366f1;
  --ai-ui-text: #fff;
  /* ... see overlay.css for all variables */
}

License

MIT - Reko Labs