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

@logicsrc/agentswarm

v0.1.0

Published

AgentSwarm: embeddable multi-agent swarm runtime for LogicSRC, wrapping deepagents. Mount it on your own route (e.g. /swarm).

Readme

@logicsrc/agentswarm

Embeddable multi-agent swarm runtime for LogicSRC, wrapping deepagents. It ships a framework-agnostic Web handler that each host app mounts on its own route (e.g. tronbrowser.dev/swarm) — the host owns hosting, model keys, storage, and billing; agentswarm turns an HTTP request into an agent turn.

MIT licensed. Open-source package + self-hosted by each consumer.

Install

npm i @logicsrc/agentswarm
# the real runner needs these optional peers in the host app:
npm i deepagents @langchain/langgraph @langchain/anthropic

Mount it

The core is a (Request) => Response handler, so it drops into any modern stack.

import { createSwarmHandler, createDeepAgentRunner } from "@logicsrc/agentswarm";

const runner = await createDeepAgentRunner({ model: "anthropic:claude-sonnet-4-6" });

// Next.js route handler — app/swarm/route.ts
export const POST = createSwarmHandler({ runner });
// Hono / any Web-standard server
app.post("/swarm", (c) => createSwarmHandler({ runner })(c.req.raw));

Request body: { "messages": [{ "role": "user", "content": "…" }], "rubric"?: string, "threadId"?: string }.

Meter / gate each call (x402, auth)

onRequest runs before the agent. Throw a SwarmError with a status to reject — this is where a host enforces an x402 payment or a scoped agent token.

import { SwarmError } from "@logicsrc/agentswarm";

createSwarmHandler({
  runner,
  onRequest: async (input, request) => {
    if (!(await paid(request))) throw new SwarmError("payment required", 402);
  }
});

Bring your own runner

SwarmRunner is a one-method interface, so you can stub it in tests or back it with something other than deepagents:

const runner = { async run(input) { /* … */ } };

Demo

npm run build && npm run demo
curl -s localhost:8787/swarm -d '{"messages":[{"role":"user","content":"hi"}]}'

Self-checking with a rubric

Wrap any runner so the agent grades its own answer against "done" criteria and revises until it passes (deepagents' RubricMiddleware, reimplemented at the runner layer since it is Python-only in the JS package today):

import { createRubricRunner, createLLMJudge, createDeepAgentRunner } from "@logicsrc/agentswarm";

const runner = createRubricRunner({
  runner: await createDeepAgentRunner({ model: "anthropic:claude-sonnet-4-6" }),
  judge: await createLLMJudge({ model: "anthropic:claude-haiku-4-5" }), // cheap grader
  maxIterations: 3,
  onEvaluation: (e) => console.log(`iteration ${e.iteration}: ${e.passed ? "pass" : "fail"} — ${e.explanation}`)
});

// then: createSwarmHandler({ runner })

Pass the rubric per request: { "messages": [...], "rubric": "- one sentence\n- mentions chlorophyll" }.

Optional: run on community GPUs (c0mpute.com)

Inference is swappable. If a user connects their c0mpute.com account (peer-shared GPUs), run agents/judges/routers on it instead of a hosted provider. agentswarm does no OAuth — the host's c0mpute connector supplies the credentials; this just consumes them:

import { createC0mputeModel, createDeepAgentRunner } from "@logicsrc/agentswarm";

// `connector` comes from the user connecting their c0mpute.com account
const model = await createC0mputeModel({ apiKey: connector.apiKey, model: "llama-3.1-70b" });
const runner = await createDeepAgentRunner({ model });

Opt-in: omit it and the default hosted provider is used. Requires @langchain/openai.

Status

  • M1 ✓ core handler + injectable runner + deepagents adapter + x402 gate hook.
  • M3 ✓ rubric self-check loop (createRubricRunner / createLLMJudge).
  • Next: peer coordination (the swarm), Turso checkpointer, agentgit identity + budget/ledger adapters, x402 billing middleware, and the tronbrowser mount.