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

@uix-ai/adapter-agui

v0.0.2

Published

Adapter to convert AG-UI protocol events to UIX Lucid IR format

Readme

@uix-ai/adapter-agui

Adapter to convert AG-UI protocol streaming events to UIX Lucid IR format.

Install

pnpm add @uix-ai/adapter-agui

Peer dependencies: react, @uix-ai/core

Quick Start

Using the useAGUI hook (recommended)

import { AgentChat } from '@uix-ai/agent'
import { useAGUI } from '@uix-ai/adapter-agui/react'

function App() {
  const { conversations, status, send, stop } = useAGUI({ url: '/api/agent' })

  return (
    <AgentChat
      conversations={conversations}
      status={status}
      onSend={send}
      onStop={stop}
    />
  )
}

useAGUI Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | url | string | required | AG-UI agent endpoint URL | | threadId | string | auto-generated | Thread ID for conversation continuity | | headers | Record<string, string> | -- | Custom headers for SSE connection | | processorOptions | AGUIProcessorOptions | -- | Event processor configuration | | autoConnect | boolean | false | Connect on mount | | onError | (error: Error) => void | -- | Error callback | | onFinish | () => void | -- | Run finished callback |

Returns: { conversations, status, send, stop, isLoading, reset, error }

With thread persistence

const { conversations, send } = useAGUI({
  url: '/api/agent',
  threadId: 'thread-abc-123',
  headers: { Authorization: 'Bearer ...' },
})

Manual AGUIEventProcessor Usage

For non-React use cases or custom event sources, use the stateful processor directly:

import { AGUIEventProcessor } from '@uix-ai/adapter-agui'

const processor = new AGUIEventProcessor({
  onUpdate: (conversations) => {
    // Called after each event is processed
    renderUI(conversations)
  },
})

// Feed events from any source
eventSource.onmessage = (event) => {
  processor.processEvent(JSON.parse(event.data))
}

// Read current state at any time
const conversations = processor.getConversations()

// Reset all state
processor.reset()

Batch conversion (stateless)

For one-shot conversion of a complete event array:

import { fromAGUIEvents } from '@uix-ai/adapter-agui'

const conversations = fromAGUIEvents(events)

Supported Event Types

Lifecycle Events

| Event | Description | |-------|-------------| | RunStarted | Agent run begins (with threadId, runId) | | RunFinished | Agent run completes; all streaming messages marked completed | | RunError | Agent run failed; last assistant message marked as error | | StepStarted | Agent step begins | | StepFinished | Agent step completes |

Text Message Events

| Event | Description | |-------|-------------| | TextMessageStart | New message created with role and ID | | TextMessageContent | Text delta appended to current message | | TextMessageEnd | Message streaming complete |

Tool Call Events

| Event | Description | |-------|-------------| | ToolCallStart | Tool invocation begins (attached to parent message) | | ToolCallArgs | Streamed tool input argument deltas | | ToolCallEnd | Tool input complete | | ToolCallResult | Tool output received |

Reasoning Events

| Event | Description | |-------|-------------| | ReasoningMessageStart | Thinking/reasoning block begins | | ReasoningMessageContent | Reasoning text delta | | ReasoningMessageEnd | Reasoning complete |

State Events

| Event | Description | |-------|-------------| | StateSnapshot | Full state snapshot | | StateDelta | JSON Patch delta for state | | MessagesSnapshot | Full messages snapshot |

State events (StateSnapshot, StateDelta, MessagesSnapshot) are received but do not produce blocks in the current implementation.

Links