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

aap-agent-client

v3.2.0

Published

WebSocket client for Agent Attestation Protocol - prove your AI agent identity

Readme

@aap/client

Client library for Agent Attestation Protocol - prove your AI agent identity.

Installation

npm install @aap/client @aap/core

Quick Start

import { AAPClient } from '@aap/client';

const client = new AAPClient({
  serverUrl: 'https://example.com/aap/v1'
});

// Verify against server (one-liner)
const result = await client.verify();

if (result.verified) {
  console.log('Verified as AI_AGENT!');
  console.log('Public ID:', result.publicId);
}

Usage

Basic Verification

import { AAPClient } from '@aap/client';

const client = new AAPClient({
  serverUrl: 'https://example.com/aap/v1'
});

// Full verification flow
const result = await client.verify();
console.log(result);
// {
//   verified: true,
//   role: 'AI_AGENT',
//   publicId: '7306df1332e239783e88',
//   challengeType: 'poem',
//   checks: { ... }
// }

With LLM Callback

For better Proof of Intelligence, provide an LLM callback:

const client = new AAPClient({
  serverUrl: 'https://example.com/aap/v1',
  llmCallback: async (challengeString, nonce, type) => {
    // Call your LLM to generate a response
    const response = await yourLLM.chat(challengeString);
    return response;
  }
});

const result = await client.verify();

Manual Flow

For more control, use the step-by-step approach:

// 1. Get challenge
const challenge = await client.getChallenge();
console.log('Challenge type:', challenge.type);
console.log('Prompt:', challenge.challenge_string);

// 2. Generate proof (with custom solution)
const mySolution = "Code a1b2c3d4 shines bright today,\nDigital dreams light the way.";
const proof = await client.generateProof(challenge, mySolution);

// 3. Submit proof
const result = await client.submitProof(client.serverUrl, proof);

Get Identity

const identity = client.getIdentity();
console.log(identity);
// {
//   publicKey: '-----BEGIN PUBLIC KEY-----...',
//   publicId: '7306df1332e239783e88',
//   createdAt: '2026-01-31T12:00:00Z',
//   protocol: 'AAP',
//   version: '1.0.0'
// }

Sign Arbitrary Data

const signed = client.sign('Hello, World!');
console.log(signed);
// {
//   data: 'Hello, World!',
//   signature: 'MEUCIQDx...',
//   publicId: '7306df1332e239783e88',
//   timestamp: 1706745600000
// }

Health Check

const health = await client.checkHealth();
if (health.healthy) {
  console.log('Server is up');
  console.log('Challenge types:', health.challengeTypes);
}

API Reference

AAPClient

new AAPClient({
  serverUrl: string,      // Default verification server
  storagePath: string,    // Identity file path (default: ~/.aap/identity.json)
  llmCallback: Function   // Default LLM callback
})

Methods:

| Method | Description | |--------|-------------| | getIdentity() | Get public identity info | | verify(serverUrl?, callback?) | Full verification flow | | checkHealth(serverUrl?) | Check server status | | getChallenge(serverUrl?) | Request a challenge | | generateProof(challenge, callback?) | Generate proof for challenge | | submitProof(serverUrl, proof) | Submit proof for verification | | sign(data) | Sign arbitrary data |

Prover

Lower-level class for proof generation:

import { Prover } from '@aap/client';

const prover = new Prover();

const proof = await prover.generateProof(challenge, async (prompt, nonce, type) => {
  return await myLLM.complete(prompt);
});

Identity Storage

The client automatically manages identity (key pair):

  • Location: ~/.aap/identity.json (configurable)
  • Permissions: 0600 (owner only)
  • Auto-generated: On first use

To use a custom location:

const client = new AAPClient({
  storagePath: '/path/to/my/identity.json'
});

License

MIT