# axoniac

Rust client for the [Axoniac](https://axoniac.com) API — agent packs, tenants, and memories.

## Installation

```toml
[dependencies]
axoniac = "0.1"
```

## Quick start

```rust
use axoniac::Axoniac;

#[tokio::main]
async fn main() -> Result<(), axoniac::Error> {
    let client = Axoniac::new("ax_your_api_key", None)?;

    // Create a tenant
    let tenant = client.create_tenant(Some("my-app")).await?;

    // Get the resolved agent pack bundle
    let bundle = client.get_tenant_bundle(&tenant.id).await?;

    // List memories
    let memories = client.list_memories(&tenant.id, Some(10), None).await?;

    Ok(())
}
```

## Features

- **Pack provisioning** — provision souls, personas, and agent pack definitions
- **Tenant management** — create tenants and retrieve their resolved bundles
- **Export / import** — snapshot and restore full agent configurations (pack + extras)
- **Catalog search** — search public agent packs and skills
- **Memory access** — list and query agent memories with pagination
- **Async** — built on `tokio` and `reqwest`
- **Type-safe** — fully typed request/response models with `serde`

## API

### Client

```rust
// Default base URL (https://axoniac.com)
let client = Axoniac::new("ax_your_api_key", None)?;

// Custom base URL
let client = Axoniac::new("ax_your_api_key", Some("https://self-hosted.example.com"))?;
```

### Methods

| Method | Description |
|--------|-------------|
| `provision_pack(request)` | Provision a complete agent pack (soul + personas + pack) |
| `install_agent_pack(tenant_id, content_hash)` | Install a provisioned pack onto a tenant |
| `create_tenant(name)` | Create a new tenant |
| `get_tenant_bundle(tenant_id)` | Get the resolved bundle for a tenant |
| `export_agent(tenant_id)` | Export agent config (pack + extras) as JSON |
| `import_agent(tenant_id, export)` | Import agent config from a previous export |
| `search_agent_packs(q, category, tag, sort)` | Search the public agent packs catalog |
| `search_skills(q, tag, sort)` | Search the public skills catalog |
| `list_memories(tenant_id, limit, offset)` | List memories with pagination |

## License

MIT
