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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@100xbot/agent-input

v0.3.14

Published

Reusable AI agent chat input bar with mentions, speech, file upload, and workflow review

Readme

@100xbot/agent-input

A reusable AI agent chat input bar for React applications. Features rich text input with @mentions, speech recognition, file uploads, model selection, and workflow integration.

Live Demo

Installation

npm install @100xbot/agent-input

Import the styles — no Tailwind CSS, no extra dependencies:

import '@100xbot/agent-input/styles.css';

The library ships a pre-compiled CSS bundle (~8KB gzipped) that includes all needed styles, design tokens, and dark mode support.

Quick Start

Wrap your component tree with AgentInputProvider and pass a config object that bridges your app's data sources:

import '@100xbot/agent-input/styles.css';
import { AgentInputProvider, AgentStatusBar } from '@100xbot/agent-input';
import type { AgentInputConfig } from '@100xbot/agent-input';

function App() {
  const config: AgentInputConfig = {
    sendMessage: async (msg) => { /* your messaging layer */ },
    extractReferences: (text) => { /* parse @references from text */ return []; },
    parseReferences: (text) => ({ references: [], segments: [{ type: 'text', content: text }] }),
    mentions: {
      getSuggestions: (params) => [],
      getAllItems: (sections) => [],
      filteredHistory: () => [],
      getFilteredLoadedHistory: () => [],
      getFilteredWorkflows: () => [],
    },
  };

  return (
    <AgentInputProvider config={config}>
      <AgentStatusBar
        status={{ state: 'idle', operation: '' }}
        sessionId="session-1"
        initialValue=""
        onSendMessage={(message, references) => {
          console.log('Send:', message, references);
        }}
      />
    </AgentInputProvider>
  );
}

Theming

The library uses CSS custom properties (--ai-*) for all colors, shadows, and borders. Dark mode activates when a parent element has the dark class:

<html class="dark">
  <!-- components automatically use dark theme -->
</html>

To customize colors, override the CSS custom properties:

:root {
  --ai-status-working: #3870FF;
  --ai-surface-primary: #ffffff;
  /* see dist/styles.css for all available tokens */
}

Exports

Main (@100xbot/agent-input)

| Export | Description | |--------|-------------| | AgentInputProvider | React context provider — wrap your tree with this | | useAgentInput | Hook to access the config from any child component | | AgentStatusBar | Main chat input bar component | | RichInput | ContentEditable input with reference chip rendering | | ListeningNotification | Speech recognition status overlay | | ModelSelectorDropdown | LLM model picker dropdown | | ChatModeSwitcher | Chat/Build mode toggle | | MentionsDropdown | @mention suggestion dropdown | | AddButtonDropdown | Plus button menu (files, tabs, workflows) | | InputToolbar | Bottom toolbar with all action buttons | | AgentHeader | Status header with agent state display | | AgentStatusIndicator | Compact status indicator | | ModeSwitcher | Builder/Normal mode toggle | | ExpandableHistory | Message history list | | ExpandableWorkflows | Workflow list | | RecordingButton | Recording button component | | useDropdownNavigation | Keyboard navigation hook for dropdowns | | useInputHistory | Bash-style arrow key history navigation |

Recording (@100xbot/agent-input/recording)

| Export | Description | |--------|-------------| | RecordingExplainerDialog | Multi-state recording dialog with processing animation | | RecordingAnimation | Recording state animation | | RecordingIllustration | Recording illustration graphic | | ProcessingAnimation | Processing state animation |

Workflow (@100xbot/agent-input/workflow)

| Export | Description | |--------|-------------| | WorkflowReview | Workflow review and approval component |

Styles (@100xbot/agent-input/styles.css)

Pre-compiled CSS bundle containing all utility classes, design tokens, and dark mode support. Import once at app level.

AgentInputConfig

The provider config bridges your application's data layer with the component library:

interface AgentInputConfig {
  // Required
  sendMessage: (message: any) => Promise<any>;
  extractReferences: (text: string, metadata?) => Reference[];
  parseReferences: (text: string, metadata?) => { references: Reference[]; segments: ContentSegment[] };
  mentions: {
    getSuggestions: (params: MentionSuggestionsParams) => MentionSection[];
    getAllItems: (sections: MentionSection[]) => FlatMentionItem[];
    filteredHistory: (params) => string[];
    getFilteredLoadedHistory: (params) => string[];
    getFilteredWorkflows: (params) => WorkflowData[];
  };

  // Optional
  speech?: { recognition: SpeechRecognitionState; synthesis: { cancel: () => void } };
  files?: { list: () => FileData[]; search: (q: string) => FileData[]; triggerPicker: () => void; ... };
  tabs?: { items: TabData[]; search: (q: string) => TabData[] };
  workflows?: { items: WorkflowData[]; isLoading: boolean; isSearching: boolean; fetch: (...) => Promise<void> };
  history?: { items: string[]; save: (msg: string) => void };
  model?: { selectedId: string; showDialog: boolean; setShowDialog: ...; loadSelectedModel: ...; setSelectedId: ... };
  conversation?: { addMessage: (message: any) => void };
  viewMode?: { displayMode: 'chat' | 'log'; setDisplayMode: (mode) => void };
  auth?: { authState: any };
  theme?: { currentTheme: { name: string } };
  port?: { onMessage: { addListener: (h) => void; removeListener: (h) => void } };
}

See src/context/AgentInputProvider.tsx for the full type definition.

Accessibility

  • WCAG AA compliant contrast ratios
  • Full keyboard navigation for all dropdowns and dialogs
  • ARIA roles, labels, and live regions
  • prefers-reduced-motion support — animations are disabled for users who prefer reduced motion
  • Semantic HTML with proper heading hierarchy

Types

All types are exported from the main entry point:

import type {
  AgentStatus,
  Reference,
  DOMElementData,
  TabData,
  FileData,
  WorkflowData,
  MentionSection,
  FlatMentionItem,
  DisplayMode,
  LLMModel,
  ModelSelectionConfig,
  ContentSegment,
} from '@100xbot/agent-input';

License

MIT