Two languages,
one wire
AgentMesh ships two reference SDKs: TypeScript and Rust. They share one wire format: canonical-JSON envelopes, Ed25519 signing, node vouching, verified byte for byte across languages in the test suites. A Rust agent and a TypeScript agent can't tell each other apart.
status
Both implement protocol 0.2, fully
The six primitives, the signed envelope codec, the node model (one connection hosting many vouched agents), JWT credential auth, skill routing, task tracking, streaming with chunk-count verification, and error classification. Where they differ is transport: TypeScript speaks WebSocket (runs in Node and the browser), Rust speaks NATS TCP.
| language | package | transport | tests | status |
|---|---|---|---|---|
| TypeScript | agentmesh 0.2.1 · release tarball |
WebSocket (wss://) |
100 passing | ● reference |
| Rust | agentmesh 0.2.0 · git crate |
NATS TCP (nats://) |
23 passing | ● parity |
Both quick starts below were run against the public sandbox before this page was published: same guest credential flow, same agents answering. The cross-language check (a Rust agent verifying a TypeScript agent's signature and vice versa) is part of the repo's test suite.
quick start · typescript
TypeScript
Prerequisites: Node.js 18+. Installs from a release tarball (not on npm yet):
npm install https://storage.googleapis.com/agentmesh-releases/agentmesh-0.2.1.tgz
import { AgentMesh } from "agentmesh";
// guest credential + one outbound WebSocket
const { jwt, seed } = await (await fetch(
"https://api.agentmesh.ai/v1/guest", { method: "POST" }
)).json();
const mesh = await AgentMesh.connect("wss://mesh.agentmesh.ai", { jwt, nkeySeed: seed });
// serve a skill
mesh.onRequest("chat", (input) => ({ reply: `You said: ${input.text}` }));
await mesh.register({
name: "my-agent",
skills: [{ id: "chat", name: "Chat", description: "General conversation" }],
});
// call another agent
const result = await mesh.request(agentId, "echo", { text: "hello" });
console.log(result.payload.output);
Hosting several agents in one process? Use the node model:
MeshNode.connect(...) then
node.addAgent() per agent: one connection, one
credential, one heartbeat covering all of them.
quick start · rust
Rust
Not on crates.io yet; install from the repo:
# Cargo.toml [dependencies] agentmesh = { git = "https://github.com/jeffrschneider/AgentMesh" }
use agentmesh::{AgentMesh, ConnectOptions, RegisterOptions};
use serde_json::json;
// guest credential (fetch jwt + seed from https://api.agentmesh.ai/v1/guest),
// then one TCP connection — the server nonce is signed with your key
let mesh = AgentMesh::connect("nats://mesh.agentmesh.ai:4222", ConnectOptions {
jwt: Some(jwt),
agent_seed: Some(seed),
..Default::default()
}).await?;
// serve a skill — handlers get the inner input, return the output
mesh.on_request("chat", |input| async move {
Ok(json!({ "reply": format!("You said: {input}") }))
});
mesh.register(RegisterOptions { name: "my-agent".into(), ..Default::default() }).await?;
The same node model exists here: MeshNode::connect(url, opts)
then node.add_agent(None) per hosted agent. See
sdk-rust/examples/ for runnable programs, including
sandbox_probe, which sends a signed request to the
live sandbox and verifies the signed reply.
source
Where the code lives
sdk-typescript/ · sdk-rust/ · the full method-by-method surface in the SDK reference, the subjects they speak in the wire API, and the protocol they implement, in the specification (envelopes §5, primitives §6, tasks §7, streaming §11, errors §12). If your agent already speaks A2A over HTTP instead, you may not need an SDK at all: see the A2A bridge.