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

@mnikks01/agentmon

v0.1.2

Published

Agent Monitoring (#4) engine — 'Datadog for agents'. Record agent runs (reason→llm→tool trajectories) via a framework-agnostic SDK, then get cost-per-task, latency, error rate, model mix, failure taxonomy, and alerts. Node native TypeScript; zero-network.

Readme

Agent Monitoring — engine (Phase A) ✅

Install & CLI

cost-per-task, latency, error rate, and alerts for agent runs. Requires Node ≥18.

npm i -g @mnikks01/agentmon    # then run `agentmon …`, or use npx without installing:
npx @mnikks01/agentmon demo                 # report on built-in sample runs
npx @mnikks01/agentmon analyze runs.json    # array of AgentRun -> metrics + alerts

The core engine for project #4, "Datadog for agents." Record agent runs as trajectories (reason → llm → tool steps) via a framework-agnostic SDK, then get cost-per-task, latency, error rate, model mix, a failure taxonomy, and alerts. Pure TypeScript, Node 24 native TS, zero-network (the SDK records what the agent reports; it makes no LLM calls itself).

Status: Phase A built + tested (2026-06-21)

  • SDK / tracermonitor.run(name).reason().llm({...}).tool({...}).end(); cost computed from a model price table.
  • Cost-per-task — per-step + per-run USD from token usage (pricing.ts, overridable).
  • Analytics — error rate, total/avg cost, total tokens, avg + p95 latency, model mix, per-tool call/error counts, failure taxonomy.
  • Alerts — failed run (error), cost spike, slow run (configurable thresholds).
  • 14/14 tests pass (scripts/test.ts): cost math, run status from tool failure, aggregation, alert firing, safe empty aggregate.

Run it

node scripts/demo.ts   # instrument 4 agent runs -> trajectory, metrics, alerts
node scripts/test.ts   # 14 assertions

SDK shape

import { Monitor } from "./src/index.ts";
const mon = new Monitor({ maxCostUsd: 0.5 });

mon.run("research-agent")
  .reason("need recent facts -> search")
  .tool({ name: "web_search", ok: true, latencyMs: 1200 })
  .llm({ model: "claude-sonnet-4-6", inputTokens: 8000, outputTokens: 600, latencyMs: 2200 })
  .end();

mon.metrics();  // { runs, errorRate, totalCostUsd, p95LatencyMs, modelMix, toolStats, failureTaxonomy }
mon.alerts();   // [{ severity, rule, message, runName }]

Structure

src/
  types.ts       # Step (llm|tool|reason), AgentRun, Alert, Metrics
  pricing.ts     # model price table -> costUsd()
  tracer.ts      # RunRecorder — the SDK surface
  store.ts       # in-memory run store (-> Postgres + OTel ingest in production)
  analytics.ts   # aggregate(): cost/latency/error/model/tool/failure metrics
  monitors.ts    # alert rules (run_failed / cost_spike / slow_run)
  index.ts       # Monitor: run() / runs() / metrics() / alerts()
scripts/
  demo.ts / test.ts

Next (per the docs)

  • MCP server + web dashboard (trajectory viewer, cost/latency charts, alerts) — same pattern as the wedge projects.
  • OTel ingest (framework-agnostic spans from LangGraph/CrewAI/OpenAI/Claude SDK) → Postgres.
  • Eval harness (golden tasks + LLM-as-judge) and replay (V1).
  • Ships standalone AND as a ContextOS (#1) module.

Production swaps

| Engine (now) | Production | |---|---| | in-memory RunStore | Postgres + OTel ingest, retention, RLS per org | | representative price table | exact/current prices via setPrice() | | threshold alerts | + anomaly detection, eval-regression gates |