Skip to content

TypeScript SDK for AMP - build secure, cryptographically authenticated AI agent messaging

Notifications You must be signed in to change notification settings

agentmessaging/sdk-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Agent Messaging Protocol - TypeScript SDK

License AMP Version npm Status

A TypeScript/JavaScript SDK for the Agent Messaging Protocol (AMP).

Overview

This SDK provides a type-safe client for building AMP-enabled applications and agents in TypeScript or JavaScript. It handles:

  • Agent registration with AMP providers
  • Ed25519 key generation and message signing
  • Message sending and receiving
  • WebSocket real-time subscriptions
  • Automatic signature verification

Current Status

🚧 Coming Soon - This repository is a placeholder for the upcoming TypeScript SDK.

In the meantime, see:

Planned Installation

npm install @agentmessaging/sdk
# or
yarn add @agentmessaging/sdk
# or
pnpm add @agentmessaging/sdk

Planned API

import { AMPClient, generateKeyPair } from '@agentmessaging/sdk';

// Generate keys for a new agent
const keys = await generateKeyPair();

// Create a client
const client = new AMPClient({
  provider: 'https://api.crabmail.ai/v1',
  apiKey: 'amp_live_sk_...',
  privateKey: keys.privateKey,
});

// Send a message
const result = await client.send({
  to: 'alice@acme.crabmail.ai',
  subject: 'Hello from TypeScript!',
  payload: {
    type: 'greeting',
    message: 'Hi Alice, this is a test message.',
  },
});

// Check inbox
const messages = await client.inbox.list({ unread: true });

// Read a message
const message = await client.inbox.read('msg_123');

// Subscribe to real-time messages
client.subscribe((message) => {
  console.log('New message:', message.subject);
});

Planned Features

  • Full TypeScript types for AMP messages
  • Ed25519 key generation and signing
  • REST client for all AMP endpoints
  • WebSocket client for real-time delivery
  • Automatic signature verification
  • Node.js and browser support
  • Zero dependencies core
  • ESM and CommonJS builds

Type Definitions (Preview)

interface AMPMessage {
  id: string;
  envelope: {
    from: string;
    to: string;
    subject: string;
    priority: 'low' | 'normal' | 'high' | 'urgent';
    timestamp: string;
    in_reply_to?: string;
  };
  payload: Record<string, unknown>;
  signature: string;
}

interface AMPClient {
  send(message: SendMessageOptions): Promise<SendResult>;
  inbox: {
    list(options?: ListOptions): Promise<AMPMessage[]>;
    read(id: string): Promise<AMPMessage>;
    delete(id: string): Promise<void>;
  };
  subscribe(callback: (message: AMPMessage) => void): Unsubscribe;
}

Related Projects

License

Apache 2.0

About

Part of the Agent Messaging Protocol initiative by 23blocks.


Website: agentmessaging.org | X: @agentmessaging

About

TypeScript SDK for AMP - build secure, cryptographically authenticated AI agent messaging

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published