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

anyclaude-react

v0.5.0

Published

React UI kit for anyclaude-sdk — restylable hooks + components (useAgent, Transcript, Composer, AgentChat, Terminal, FileExplorer, CodeEditor, ChatPanel, AskUser) with built-in serverless 'survivor' stream-stitching. Build chatbots, agents, research assis

Readme

anyclaude-react

Restylable React UI kit for anyclaude-sdk — hooks + components to build chatbots, AI agents, research assistants, and browser IDEs. Includes built-in serverless "survivor" stream-stitching (long runs span function time-limits transparently) and client-side tool execution (the server-side agent runs bash/file tools in the user's browser). Markdown via streamdown.

Live demo — a full IDE built with this kit, running in your browser.

npm install anyclaude-react anyclaude-sdk react

Quick start (browser / in-process)

Drive the agent in-process by wrapping the SDK's query() in a run function:

import { AgentChat } from 'anyclaude-react'
import 'anyclaude-react/styles.css'
import { query, createOpenAIClient, MemoryFileSystem, NoopCommandExecutor, composeWorkspace } from 'anyclaude-sdk'

const ws = composeWorkspace(new MemoryFileSystem(), new NoopCommandExecutor(), '/work')
const llm = createOpenAIClient({ baseUrl: '…', model: 'gpt-4o', apiKey: KEY })

export default function App() {
  return (
    <AgentChat
      run={({ prompt, sessionId, continueRun }) =>
        query({ prompt: continueRun ? '' : prompt, workspace: ws, llm, model: 'gpt-4o',
                sessionId, resume: continueRun, continueRun, includePartialMessages: true })}
    />
  )
}

Serverless (survivor)

Point at a function that streams NDJSON SDKMessages. When the function pauses at its time-limit ({type:'system',subtype:'paused'}), the client auto-continues in a new request with the same sessionId — invisibly:

<AgentChat endpoint="/api/agent" />

Your function runs query({ ..., maxDurationMs, sessionStore, sessionId, resume: continueRun, continueRun }) and writes each message as a JSON line.

Hook

const { messages, streamingText, status, tokens, cost, send, interrupt, clear } =
  useAgent({ run /* | endpoint | client */, sessionId })
  • status: 'idle' | 'running' | 'paused'
  • send(text) starts/continues; interrupt() aborts; clear() resets (new session).

Client-side tools (server brain, browser hands)

Run the agent on your server but execute its file/shell tools in the browser — against a WebContainer, an IndexedDB filesystem, OPFS, or memory. Pair query({ clientTools: WORKSPACE_TOOL_NAMES }) server-side with a turnkey executor map here. client_tool_requests are auto-executed and the results streamed back; it reuses the real SDK tool implementations, so behavior matches server-side exactly.

import { useAgent, createWebContainerClientTools, createWorkspaceClientTools } from 'anyclaude-react'
import { DexieFileSystem } from 'anyclaude-sdk/fs'

// real shell + files in a WebContainer:
useAgent({ endpoint: '/api/agent', clientTools: createWebContainerClientTools(wc) })

// or point the file tools at the user's own IndexedDB (no shell):
useAgent({ endpoint: '/api/agent', clientTools: createWorkspaceClientTools(new DexieFileSystem('my-db')) })

// fully overridable per tool:
createWorkspaceClientTools(workspace, { only: ['write_file','read_file'], extra: { bash: myBash } })

You can still hand-write a clientTools map ({ bash: async ({command}) => ({ content }) }) for full control.

Components

Chat

| Component | Purpose | |---|---| | <AgentChat> | All-in-one: Transcript + Working + Composer wired to useAgent. | | <ChatPanel> | Like AgentChat with a header (status / tokens / cost). | | <Transcript messages streamingText> | Renders messages; pairs tool calls with results. | | <Message> / <MarkdownMessage> | Chat bubbles; markdown via streamdown (override via render). | | <ToolCall> | Collapsible tool call + result. | | <Composer onSend> | Textarea + send (Enter sends, Shift+Enter newline). | | <Working active paused> | Shimmering "Working…" indicator. |

Lightweight UI (root, no heavy deps)

| Component | Purpose | |---|---| | <FileExplorer list onOpen> | Collapsible file tree over any filesystem adapter. | | <AskUser question onAnswer> | Renders an ask_user_question prompt; pair with the SDK's onAskUser. |

IDE — anyclaude-react/ide subpath (so the root barrel stays dependency-light)

import { Terminal, CodeEditor } from 'anyclaude-react/ide'

| Component | Purpose | Peer dep | |---|---|---| | <Terminal spawn> | xterm.js terminal bound to a streaming shell (e.g. a WebContainer process). | @xterm/xterm + @xterm/addon-fit | | <CodeEditor value onChange> | Controlled CodeMirror 6 editor. | codemirror + @codemirror/* |

The root export (useAgent, chat components, FileExplorer, AskUser, the client/workspace helpers) pulls neither @xterm nor codemirror — install those only if you import from /ide.

Styling

Everything is class-based (.ac-*) with data-role attributes. Import the optional anyclaude-react/styles.css and override the CSS variables on .ac-chat (--ac-accent, --ac-bg, --ac-fg, …), or skip it and style with your own CSS / Tailwind. No emojis — icons are inline SVG.