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

@locusgraph/loop

v0.6.1

Published

Agent components for LocusGraph apps: chat, agent steps, human-in-the-loop approvals, memory and cost. Takes Vercel AI SDK UIMessage parts; never calls a model.

Downloads

1,825

Readme

@locusgraph/loop

npm MIT license

Docs · Source · All packages

Loop is the agent kit from Locus Design: chat, what the agent is doing, human-in-the-loop approvals, memory and cost. Components take data and callbacks only and never call a model. Message shapes follow the Vercel AI SDK UIMessage parts, so useChat() output can be passed straight in.

pnpm add @locusgraph/loop @locusgraph/components
@import "@locusgraph/components/theme.css";
@import "@locusgraph/loop/sources.css";
import { Chat, Composer, Turn } from "@locusgraph/loop";

<Chat>
  {messages.map((message) => (
    <Turn key={message.id} message={message} />
  ))}
</Chat>
<Composer status={status} onSubmit={(text) => sendMessage({ text })} onStop={stop} />

Chat, History and Inbox virtualize with TanStack Virtual above 50 items: only the rows near the viewport are mounted, so a long agent session stays fast. Pass virtualize={false} to mount every item. The built package is compiled with the React Compiler, so components skip re-rendering when their props have not changed.

| Group | Components | |---|---| | Chat | Chat, Turn, Reply, Composer, Files | | Thread | Starters, Actions, History, Code, Canvas | | Agent | Thinking, Steps, Tool, Pulse | | Human in the loop | Approval, ArgsEditor, PlanReview, Question, SpendGate, MemoryReview, RunBar, Inbox, ApprovalGate with useApprovalGate, DecisionLog | | Memory | Cite, Sources, Recall, Memorized | | Cost | Context, Cost, CostSteps, ModelPicker |

Turn renders reasoning, tool and source parts with Thinking, Tool and Sources; pass renderReasoning, renderTool or renderSources to replace them. Data parts (data-*, such as a json-render data-spec) render only through renderData; without it they are skipped. A tool part in the approval-requested state is where Approval goes: wire its onApprove and onDeny to the AI SDK's tool approval response.

Approvals follow one rule: tools that only read run without asking; tools that write, pay, send or delete pause and show exactly what is being approved, with stronger warnings for destructive ones. Money is integer micro-USD, formatted with @locusgraph/utils.

Approval takes changes to show what an action will change, before and after, and onAllowForRun to stop asking for that tool for the rest of the run (never offered for destructive tools). useApprovalGate puts an approval in front of any action, including a button a model generated: await gate.ask({ toolName, risk, input }) settles when a person decides, <ApprovalGate gate={gate} /> renders it, and gate.log feeds <DecisionLog />.