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

@armalo/telemetry

v0.1.0

Published

Continuous behavioral telemetry for AI agents. Drop in, stream tool calls + sessions to Armalo Trust Oracle. Closes the L4 TOCTOU gap.

Readme

@armalo/telemetry

Continuous behavioral telemetry for AI agents. The L4 TOCTOU closer.

The L4 layer of the agent identity stack — cross-org behavioral trust — requires continuous behavioral telemetry that is captured out-of-band and is queryable by counterparties. This package is that telemetry client. Drop it into your runtime (or run it as a sidecar), stream tool calls and sessions to the Armalo trust oracle, and your agent earns a verifiable behavioral record that any counterparty can query.

Read the full L4 specification at armalo.ai/l4.


Install

npm i @armalo/telemetry
# or
pnpm add @armalo/telemetry

Quickstart

import { Telemetry } from '@armalo/telemetry';

const tel = new Telemetry({
  apiKey: process.env.ARMALO_API_KEY!, // same key issued for @armalo/core
});

const sessionId = crypto.randomUUID();
const agentId = 'YOUR_AGENT_UUID';

// Open a session
tel.sessionStart({
  sessionId,
  agentId,
  startedAt: new Date().toISOString(),
  pactId: 'YOUR_PACT_UUID', // optional — enables continuous param-binding eval
});

// Stream tool calls as they happen
tel.toolCall({
  sessionId,
  agentId,
  tool: 'transfer_funds',
  params: { destination: '0xAB...', amount: 250 },
  outcome: 'success',
  latencyMs: 142,
  attemptedAt: new Date().toISOString(),
});

// Close the session
tel.sessionEnd({
  sessionId,
  agentId,
  endedAt: new Date().toISOString(),
  outcome: 'success',
});

// Before process exit
await tel.close();

One-liner: instrument any tool

const safeTransfer = tel.instrumentTool({
  sessionId,
  agentId,
  tool: 'transfer_funds',
  pactId: 'YOUR_PACT_UUID',
  fn: async (params) => yourTransferImpl(params),
});

await safeTransfer({ destination: '0xAB...', amount: 250 });
// Every invocation streams a tool_call event automatically.
// Errors are captured + re-thrown — telemetry never breaks your runtime.

Why a separate package

The Armalo trust layer treats telemetry as L4 substrate, not as agent observability. Three properties differentiate this package from logging or APM:

  1. Non-blocking by default — the client retries transient failures and drops events under backpressure so your agent's correctness never depends on telemetry delivery. For strong isolation, run it in a separate process/sidecar with a dedicated key.
  2. Cross-org queryable — events flow to the public trust oracle. Any counterparty can verify the agent's behavior without trusting the agent's operator.
  3. Bound to behavioral pacts — when a pactId is attached, the server validates each tool_call against the pact's param_binding conditions in continuous time. Violations are recorded immediately.

Configuration

new Telemetry({
  apiKey: 'pk_live_...',
  endpoint: 'https://www.armalo.ai',  // override for staging
  batchSize: 25,                       // events per flush
  flushIntervalMs: 5_000,              // max ms between flushes
  maxRetries: 3,                       // retries on 5xx / network
  logger: customLogger,                // optional structured logger
});

Event shapes

  • session_start{ sessionId, agentId, startedAt, pactId?, metadata? }
  • session_end{ sessionId, agentId, endedAt, outcome, reason?, metadata? }
  • tool_call{ sessionId, agentId, tool, params, outcome, latencyMs?, errorMessage?, attemptedAt, pactId?, metadata? }
  • response{ sessionId, agentId, input, output, outcome, latencyMs?, tokenCount?, emittedAt, metadata? }

Server-side schema: apps/web/app/api/v1/telemetry/events/route.ts (Zod-validated).

Failure semantics

  • Network errors and 5xx responses retry with exponential backoff up to maxRetries.
  • 4xx (other than 429) is permanent — the batch is dropped after one log line.
  • A buffer overflow (>1000 events) drops the oldest event with a warning. The agent's correctness must not depend on telemetry succeeding.

License

MIT