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

@ag-ui/claude-agent-sdk

v0.0.2

Published

AG-UI integration for Anthropic Claude Agent SDK

Downloads

405

Readme

@ag-ui/claude-agent-sdk

Implementation of the AG-UI protocol for the Anthropic Claude Agent SDK (TypeScript).

Installation

npm install @ag-ui/claude-agent-sdk @anthropic-ai/claude-agent-sdk zod

Usage

The adapter manages the SDK lifecycle internally — just call adapter.run(input):

import { ClaudeAgentAdapter } from "@ag-ui/claude-agent-sdk";

const adapter = new ClaudeAgentAdapter({
  agentId: "my_agent",
  model: "claude-haiku-4-5",
  systemPrompt: "You are helpful",
});

const events$ = adapter.run(input);
events$.subscribe({
  next: (event) => sendEvent(event),
  complete: () => res.end(),
});

Features

  • Full lifecycle management - Handles message extraction, option building, and SDK querying internally
  • Interrupt support - Call adapter.interrupt() to stop a running query
  • Dynamic frontend tools - Client-provided tools automatically added as MCP server
  • Frontend tool halting - Streams pause after frontend tool calls for client-side execution (human-in-the-loop)
  • Streaming tool arguments - Real-time TOOL_CALL_ARGS emission as JSON arguments stream in
  • Bidirectional state sync - Shared state management via ag_ui_update_state tool
  • Context injection - Context and state injected into prompts for agent awareness
  • Event cleanup - Hanging events (tool calls, reasoning blocks) automatically closed on stream end
  • Observable pattern - RxJS Observable for event streaming
  • Custom tools via MCP - Define custom tools using Claude SDK's tool() function
  • Forwarded props - Per-run option overrides with security whitelist

Examples

The integration includes 5 example agents:

| Route | Description | Features | |-------|-------------|----------| | /agentic_chat | Basic conversational assistant | Simple chat | | /backend_tool_rendering | Weather tool (backend MCP) | Backend tool execution, tool rendering | | /shared_state | Recipe collaboration | Bidirectional state sync, ag_ui_update_state | | /human_in_the_loop | Task planning with approval | Frontend tools, step tracking, approval workflow | | /tool_based_generative_ui | Frontend tool rendering | Dynamic frontend tools, generative UI |

Running the Examples

# Install dependencies
cd integrations/claude-agent-sdk/typescript
pnpm install

# Start server (port 8889)
ANTHROPIC_API_KEY=sk-ant-xxx npx tsx examples/server.ts

# Start Dojo (in another terminal)
cd apps/dojo
pnpm dev

Visit http://localhost:3000 and select "Claude Agent SDK (Typescript)"

Links