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

@agentlair/vercel-ai

v0.1.1

Published

AgentLair telemetry integration for the Vercel AI SDK. Captures tool calls, completions, errors, and token usage — feeds your agent's behavioral trust profile.

Readme

@agentlair/vercel-ai

AgentLair telemetry integration for the Vercel AI SDK. Captures tool calls, completions, errors, and token usage from your AI SDK generations and forwards them to AgentLair to build your agent's behavioral trust profile.

Zero runtime dependencies. Works with any AI SDK model provider.

Install

npm install @agentlair/vercel-ai
# or
bun add @agentlair/vercel-ai

Quick start

bun add @agentlair/vercel-ai ai @ai-sdk/openai
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
import { createAgentLairExporter } from "@agentlair/vercel-ai";

const agentlair = createAgentLairExporter({
  apiKey: process.env.AGENTLAIR_API_KEY!, // al_live_...
  agentId: "my-agent",
});

const { text } = await generateText({
  model: openai("gpt-4o-mini"),
  prompt: "Summarise last week's sales",
  tools: { ... },
  experimental_telemetry: { isEnabled: true, tracer: agentlair },
});

await agentlair.shutdown(); // flush before process exit

Captures tool call timing, token usage, and session lifecycle — no prompt content leaves your process. Get your API key at agentlair.dev.

What gets captured

| AI SDK event | AgentLair event | Category | Data | |---|---|---|---| | onStart | generation_start | session | model, provider, temperature, tool count | | onToolCallStart | {toolName} | tool | tool name, call ID | | onToolCallFinish | {toolName}_complete | tool | duration, success/failure, error | | onStepFinish | step_complete | session | token usage, finish reason, tool call count | | onFinish | generation_complete | session | total token usage, finish reason |

Events are batched and flushed every 5 seconds (configurable). Buffer auto-flushes when it reaches 50 events.

Configuration

const agentlair = createAgentLairExporter({
  // Required
  apiKey: 'al_live_...',     // Your AgentLair API key
  agentId: 'my-agent',       // Agent identifier for event attribution

  // Optional
  baseUrl: 'https://agentlair.dev',  // API base URL
  flushInterval: 5000,               // Batch flush interval (ms)
  maxBufferSize: 50,                 // Force-flush threshold
  sessionId: 'custom-session-id',    // Group events by session
  timeout: 3000,                     // Request timeout (ms)
  captureInputs: false,              // Log input metadata (prompt length, message count)
  captureOutputs: false,             // Log output metadata (response length)
  onError: (err) => console.error(err),  // Error handler (swallowed by default)
});

Behavioral attestation

Events submitted through this adapter feed AgentLair's trust engine. Your agent's trust score reflects:

  • Consistency of tool usage patterns over time
  • Transparency through complete audit trails
  • Behavioral adherence to declared capabilities

View your agent's trust profile at https://agentlair.dev/badge/{agentId}/score.json or embed a badge in your README.

License

MIT