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

@xameyz/lemy-react

v0.6.0

Published

Drop-in Cloudflare Think React client for Lemy

Readme

@xameyz/lemy-react

Drop-in React chat for a Lemy project running on Cloudflare Think.

Install

npm install @xameyz/lemy-react @cloudflare/think agents ai

React 19 is required.

For React Native, use @xameyz/lemy-react-native.

Use the sidebar

import { LemyAgentSidebar } from "@xameyz/lemy-react";
import "@xameyz/lemy-react/styles.css";

export function Assistant({ bearer }: { bearer: string }) {
  return (
    <LemyAgentSidebar
      bearerToken={bearer}
      runtimeUrl="https://lemy.example.com/runtime/YOUR_PROJECT_ID"
    />
  );
}

The browser sends the bearer once to the project's HTTPS session endpoint. Lemy validates it, returns a short-lived opaque credential, and uses that credential for the Think WebSocket. The customer bearer is never placed in the WebSocket URL.

Threads

The included New chat button creates a fresh Durable Object conversation. Control the thread from your app when you need routing or persistence:

import { createLemyThreadId, LemyAgentSidebar } from "@xameyz/lemy-react";
import { useState } from "react";

const [threadId, setThreadId] = useState(createLemyThreadId);

<LemyAgentSidebar
  bearerToken={bearer}
  runtimeUrl={project.runtimeUrl}
  threadId={threadId}
  onThreadIdChange={setThreadId}
/>

Human approval

toolApprovalMode="mutations" is the default. The sidebar supports Approve once, Always allow, and Reject.

  • "auto" — never ask.
  • "mutations" — ask for mutating OpenAPI operations and external MCP tools.
  • "always" — ask before every tool call and ignore remembered approvals.

External MCP tools are treated as mutations because MCP servers do not always provide trustworthy read-only metadata. The legacy "ask" value remains an alias for "mutations".

const [approvedTools, setApprovedTools] = useState<string[]>([]);

<LemyAgentSidebar
  approvedTools={approvedTools}
  bearerToken={bearer}
  onApprovedToolsChange={setApprovedTools}
  runtimeUrl={project.runtimeUrl}
  toolApprovalMode="mutations"
/>

Persist approvedTools per authenticated user and Lemy project. Use toolApprovalMode="auto" only when every configured OpenAPI and MCP tool may run without confirmation.

Custom UI

LemyAgentProvider establishes the authenticated Think connection. Build any UI on top of useLemyChat():

function MyChat() {
  const { chat, pendingActions, approveExecution, rejectExecution } = useLemyChat();
  // chat.sendMessage({ text }), chat.stop(), and approval controls are available.
}

<LemyAgentProvider
  bearerToken={bearer}
  runtimeUrl={project.runtimeUrl}
  threadId={threadId}
>
  <MyChat />
</LemyAgentProvider>

useLemyChat() exposes MCP-backed tool calls, the native Think chat, stop, durable pending actions, and approval methods. No CopilotKit, LangGraph, PostgreSQL, or AG-UI bridge is involved.

The previous OpenApiAgentProvider and OpenApiAgentSidebar names remain available as deprecated aliases.