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

@aomi-labs/react

v0.6.15

Published

Runtime, state, and utilities for the Aomi widget.

Readme

@aomi-labs/react

React runtime, hooks, and utilities for building UIs on top of the Aomi on-chain agent backend.

Install

npm install @aomi-labs/react @assistant-ui/react react react-dom
# or
pnpm add @aomi-labs/react @assistant-ui/react react react-dom

Optional dependencies when wiring wallet UI through Para + wagmi:

pnpm add wagmi viem

If you use the registry-installed AomiFrame from @aomi-labs/widget-lib, wallet behavior comes from the surrounding Para + wagmi provider tree. @aomi-labs/react does not ship built-in wallet providers.

Quick Start

Wrap your app with AomiRuntimeProvider, then use useAomiRuntime() anywhere inside:

import { AomiRuntimeProvider, useAomiRuntime } from "@aomi-labs/react";

function App() {
  return (
    <AomiRuntimeProvider backendUrl="https://api.aomi.dev">
      <Chat />
    </AomiRuntimeProvider>
  );
}

function Chat() {
  const { sendMessage, isSubmitting, turnState, events } = useAomiRuntime();

  return (
    <div>
      <button onClick={() => sendMessage("What's the price of ETH?")}>
        Ask
      </button>
      {(isSubmitting || turnState === "processing") && <p>Thinking...</p>}
      <p>{events.length} ordered events</p>
    </div>
  );
}

Provider

<AomiRuntimeProvider>

Root provider that composes thread selection, notifications, the client-owned UserState source, controls, and the runtime core. Each active thread owns one ClientSession external store; React only selects and projects its snapshot.

| Prop | Default | Description | | --------------- | ------------------------- | ------------------------------------------------- | | backendUrl | "http://localhost:8080" | Aomi backend URL | | agentTarget | Auto | Optional fixed Auto or Direct target | | applicationId | — | Catalog/persistence scope; does not select Direct | | children | — | React children |

Omit agentTarget for Auto. A host that intentionally pins every turn can pass { mode: "direct", app: "uniswap" } or a hosted applicationId target.

Hooks

useAomiRuntime()

Unified hook providing access to all runtime APIs. Must be used inside <AomiRuntimeProvider>.

Returns an AomiRuntimeApi object with:

User API

| Property | Description | | ---------------- | ------------------------------------------------ | | user | Current user state (wallet address, chain, etc.) | | setUser(data) | Update user state (partial merge) | | getUserState() | Read the current canonical UserState |

Thread API

| Property | Description | | ------------------------- | -------------------------- | | currentThreadId | Active thread ID | | threadMetadata | Map of all thread metadata | | createThread() | Create a new thread | | deleteThread(id) | Delete a thread | | renameThread(id, title) | Rename a thread | | selectThread(id) | Switch to a thread |

Agent API

| Property | Description | | ------------------------ | ----------------------------------------------- | | isSubmitting | Before the first backend Event exists | | isRunning | Derived from authoritative TurnState | | events | Ordered canonical Events for the active session | | turnState | Backend-owned lifecycle | | getMessages(threadId?) | Assistant UI projection of MessageEvents | | sendMessage(text) | Submit a typed StartTurn Intent | | cancelGeneration() | Submit a typed Interrupt Intent |

Action API

| Property | Description | | ----------------------------- | -------------------------------------- | | pendingActions | Durable Actions awaiting a response | | actionAttempts | Execution attempts from ClientSession | | executeAction(id) | Execute through canonical capabilities | | respondToAction(id, result) | Submit a typed ActionResult Intent | | rejectAction(id, reason?) | Reject a pending Action |

Other Hooks

| Hook | Description | | --------------------- | ---------------------------------------------------------- | | useUser() | User/wallet state context | | useThreadContext() | Thread management context | | useControl() | Auto/Direct target, model, catalog, and API key state | | useNotification() | Toast notification context | | useActions(session) | Thin Action/attempt selector over a ClientSession snapshot |

Utilities

import {
  cn, // clsx + tailwind-merge
  formatAddress, // 0x1234...5678
  getNetworkName, // chainId → "Ethereum", "Polygon", etc.
  getChainInfo, // chainId → { name, symbol, explorer }
  SUPPORTED_CHAINS, // supported chain info map
} from "@aomi-labs/react";

Re-exports

AomiClient and all core types are re-exported from @aomi-labs/client:

import { AomiClient } from "@aomi-labs/react";
import type { Event, MessageEvent, Action, TurnState } from "@aomi-labs/react";