# AstraSync SDK

Universal TypeScript/Node.js SDK for registering AI agents with AstraSync's blockchain-based compliance platform.

## Features

- 🚀 **Auto-detection** for 5 major agent formats (MCP, Letta, ACP, OpenAI, AutoGPT)
- 🔐 **Blockchain compliance** layer for AI agents
- 📊 **Trust score** calculation based on agent metadata
- 🛠️ **Beautiful CLI** with progress indicators
- 📦 **Zero configuration** - works out of the box
- 🔍 **TypeScript** support with full type safety

## Installation

```bash
npm install @astrasyncai/sdk
```

Or install globally for CLI usage:

```bash
npm install -g @astrasyncai/sdk
```

## Quick Start

### Using the SDK

```typescript
import { AstraSync } from '@astrasyncai/sdk';

const client = new AstraSync({
  developerEmail: 'your-email@example.com'
});

// Register any supported agent format
const result = await client.register(agentData);
console.log(`Agent registered: ${result.agentId}`);
```

### Using the CLI

```bash
# Register an agent from a file
astrasync register agent.json --email your@email.com

# Or with environment variable
export ASTRASYNC_EMAIL=your@email.com
astrasync register agent.json

# Verify an agent exists
astrasync verify TEMP-123456

# Check API health
astrasync health
```

## Supported Agent Formats

The SDK automatically detects and supports:

- **MCP** (Model Context Protocol) - Anthropic's protocol
- **Letta** (formerly MemGPT) - .af files and JSON
- **ACP** (Agent Communication Protocol) - IBM's protocol
- **OpenAI** Assistants API format
- **AutoGPT** agent configurations

## API Reference

### `new AstraSync(options)`

Create a new AstraSync client.

```typescript
const client = new AstraSync({
  developerEmail: 'developer@example.com',
  apiUrl: 'https://api.astrasync.ai' // optional
});
```

### `client.register(agentData)`

Register an agent with auto-format detection.

### `client.verify(agentId)`

Check if an agent ID exists in the system.

### `client.detect(agentData)`

Detect agent format without registering.

### `client.health()`

Check API health status.

## Examples

See the `examples/` directory for complete examples.

## Development

```bash
# Clone the repository
git clone https://github.com/AstraSyncAI/astrasync-node-sdk

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test
```

## License

MIT © AstraSync AI
