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

agent-to-agent

v0.1.5

Published

A TypeScript library for building AI agents with structured skills and capabilities

Readme

Airtrain Node.js Library

Airtrain is a lightweight agent and LLM framework for building, testing, and monitoring AI systems. This is the official Node.js implementation of Airtrain.

Features

  • 🔄 Cross-platform: JavaScript/TypeScript implementation of Airtrain, compatible with the Python version
  • 🧩 Modular: Build AI agents from composable skills with a simple, consistent API
  • 💾 Secure credentials: Robust credential management for API keys and secrets
  • 📊 Telemetry: Built-in telemetry for monitoring and improving your AI systems
  • 🚀 Model Integrations: Support for multiple model providers including Fireworks AI
  • 🛠 Type-Safe: Fully typed with TypeScript for better developer experience

Installation

npm install airtrain

Quick Start

import { Skill, telemetry } from 'airtrain';
import { FireworksClient } from 'airtrain/integrations/fireworks';

// Initialize with your API key (or use environment variables)
const client = new FireworksClient({
  apiKey: process.env.FIREWORKS_API_KEY
});

// Create a skill
const answerQuestion = new Skill({
  name: "answerQuestion",
  description: "Answers general knowledge questions",
  execute: async ({ input }) => {
    const response = await client.createChatCompletion([
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: input }
    ]);
    
    return response.choices[0]?.message?.content || "No response from model";
  }
});

// Use the skill
async function main() {
  const result = await answerQuestion.process("What is the capital of France?");
  console.log(result);
}

main().catch(console.error);

Key Components

Schemas

The library uses Zod for validation:

import { BaseSchema } from 'airtrain';
import { z } from 'zod';

// Define a schema for your skill's input
const MyInputSchema = BaseSchema.extend({
  question: z.string().nonempty(),
  context: z.string().optional()
});

// Type inference works automatically
type MyInput = z.infer<typeof MyInputSchema>;

Credentials

Securely manage API keys and other sensitive information:

import { Credentials } from 'airtrain';

// Create credentials manager
const credentials = new Credentials({
  configPath: './config',
  encryptionKey: process.env.ENCRYPTION_KEY
});

// Save an API key
await credentials.set('fireworks', { apiKey: 'your-api-key' });

// Use the credentials
const apiKey = (await credentials.get('fireworks')).apiKey;

Skills

Build modular, reusable components:

import { Skill } from 'airtrain';
import { z } from 'zod';

const translator = new Skill({
  name: "translator",
  description: "Translates text to another language",
  input_schema: z.object({
    text: z.string(),
    target_language: z.string()
  }),
  execute: async ({ input }) => {
    // Implementation using your preferred LLM
    return translatedText;
  }
});

Integrations

The library includes integrations with popular LLM providers:

  • Fireworks AI: High-performance, cost-effective LLMs
    import { FireworksClient } from 'airtrain/integrations/fireworks';
      
    const client = new FireworksClient({
      apiKey: process.env.FIREWORKS_API_KEY,
      defaultModel: "accounts/fireworks/models/llama-v3-70b-instruct"
    });
      
    const response = await client.createChatCompletion([
      { role: "user", content: "Hello!" }
    ]);

Examples

Explore the examples directory for detailed usage examples:

  • Basic skills: How to create and use skills
  • Fireworks integration: Chat, streaming, function calling examples
  • Credential management: Secure storage and retrieval of credentials

Development

Setup

# Clone the repository
git clone <repository-url>
cd airtrain-node

# Install dependencies
npm install

# Build the project
npm run build

Testing

# Run tests
npm test

# Run with coverage
npm run test:coverage

Publishing to NPM

The library includes a dedicated script for publishing to NPM:

# Create a .env file with your NPM token
cp .env.example .env
# Edit the .env file to add your NPM_TOKEN

# Run the publishing script
npm run publish-npm

The script will:

  1. Validate your package.json
  2. Check git status and branch
  3. Let you choose a version bump (patch, minor, major)
  4. Build and test the package
  5. Publish to NPM with your token

For a dry run (without actually publishing):

npm run publish-npm -- --dry-run

License

MIT

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.