Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ jobs:
target: x86_64-apple-darwin
binary_name: agent-relay-broker-darwin-x64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-musl
binary_name: agent-relay-broker-linux-x64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
target: aarch64-unknown-linux-musl
binary_name: agent-relay-broker-linux-arm64

steps:
Expand All @@ -99,21 +99,44 @@ jobs:
with:
targets: ${{ matrix.target }}

- name: Install cross-compilation tools (Linux ARM64)
if: matrix.target == 'aarch64-unknown-linux-gnu'
- name: Install musl cross-compilation tools
if: contains(matrix.target, 'linux-musl')
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
sudo apt-get install -y musl-tools
if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-musl" ]]; then
sudo apt-get install -y gcc-aarch64-linux-gnu
MUSL_URL="https://musl.cc/aarch64-linux-musl-cross.tgz"
MUSL_ARCHIVE="/tmp/aarch64-linux-musl-cross.tgz"
for attempt in 1 2 3; do
if curl -fL --connect-timeout 20 --max-time 180 --retry 3 --retry-delay 2 --retry-all-errors \
"$MUSL_URL" -o "$MUSL_ARCHIVE"; then
break
fi
if [[ "$attempt" -eq 3 ]]; then
echo "Failed to download aarch64 musl cross-compiler"
exit 1
fi
sleep $((attempt * 5))
done
sudo tar -xzf "$MUSL_ARCHIVE" -C /opt
echo "/opt/aarch64-linux-musl-cross/bin" >> "$GITHUB_PATH"
fi

- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
key: broker-${{ matrix.target }}

- name: Build broker binary
run: cargo build --release --bin agent-relay-broker --target ${{ matrix.target }}
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
run: |
if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-musl" ]]; then
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc
export CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc
fi
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --bin agent-relay-broker --target ${{ matrix.target }}
strip target/${{ matrix.target }}/release/agent-relay-broker 2>/dev/null || \
aarch64-linux-musl-strip target/${{ matrix.target }}/release/agent-relay-broker 2>/dev/null || true

- name: Copy binary with platform name
run: |
Expand Down
2 changes: 2 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.aarch64-unknown-linux-musl]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:main"
17 changes: 13 additions & 4 deletions docs/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ title: 'Introduction'
description: 'Programmatically spawn and coordinate AI agents from TypeScript or Python.'
---

The `@agent-relay/sdk` lets you spawn AI agents (Claude, Codex) and coordinate them from code — send messages between agents, listen for responses, and shut them down when done.
The Agent Relay SDK lets you spawn AI agents (Claude, Codex) and coordinate them from code — send messages between agents, listen for responses, and shut them down when done. Available for both TypeScript and Python.

```bash
<CodeGroup>
```bash TypeScript
npm install @agent-relay/sdk
```

```bash Python
pip install agent-relay-sdk
```
</CodeGroup>

## What You Can Do

<CardGroup cols={2}>
Expand All @@ -32,7 +38,10 @@ npm install @agent-relay/sdk
<Card title="Quickstart" icon="rocket" href="/quickstart">
Get your first agents talking to each other in minutes.
</Card>
<Card title="SDK Reference" icon="book" href="/reference/sdk">
Full API reference for AgentRelay, spawn, messaging, and more.
<Card title="TypeScript SDK" icon="js" href="/reference/sdk">
Full API reference for the TypeScript SDK.
</Card>
<Card title="Python SDK" icon="python" href="/reference/sdk-py">
Full API reference for the Python SDK.
</Card>
</CardGroup>
3 changes: 2 additions & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
{
"group": "SDK",
"pages": [
"reference/sdk"
"reference/sdk",
"reference/sdk-py"
]
}
],
Expand Down
61 changes: 56 additions & 5 deletions docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ description: 'Spawn your first agents and send messages between them.'

## Install

```bash
<CodeGroup>
```bash TypeScript
npm install @agent-relay/sdk
```

```bash Python
pip install agent-relay-sdk
```
</CodeGroup>

## Spawn Agents and Send a Message

```typescript
<CodeGroup>
```typescript TypeScript
import { AgentRelay, Models } from '@agent-relay/sdk';

const relay = new AgentRelay();
Expand All @@ -38,6 +45,47 @@ await planner.sendMessage({ to: 'Coder', text: 'Implement the auth module' });
await relay.shutdown();
```

```python Python
import asyncio
from agent_relay import AgentRelay, Models

async def main():
relay = AgentRelay(channels=["dev"])

# Listen for messages
relay.on_message_received = lambda msg: print(f"[{msg.from_name}]: {msg.text}")

# Spawn a planner (Claude) and a coder (Codex)
await relay.claude.spawn(
name="Planner",
model=Models.Claude.OPUS,
channels=["dev"],
task="Plan the feature implementation",
)

await relay.codex.spawn(
name="Coder",
model=Models.Codex.GPT_5_3_CODEX,
channels=["dev"],
task="Implement the plan",
)

# Wait for both agents to be ready
await asyncio.gather(
relay.wait_for_agent_ready("Planner"),
relay.wait_for_agent_ready("Coder"),
)

# Send a message from system to Coder
human = relay.system()
await human.send_message(to="Coder", text="Implement the auth module")

await relay.shutdown()

asyncio.run(main())
```
</CodeGroup>

## Supported CLIs

| CLI | Constant prefix |
Expand All @@ -47,8 +95,11 @@ await relay.shutdown();

## Next Steps

<CardGroup cols={1}>
<Card title="SDK Reference" icon="book" href="/reference/sdk">
Complete API reference.
<CardGroup cols={2}>
<Card title="TypeScript SDK Reference" icon="js" href="/reference/sdk">
Complete TypeScript API reference.
</Card>
<Card title="Python SDK Reference" icon="python" href="/reference/sdk-py">
Complete Python API reference.
</Card>
</CardGroup>
Loading
Loading