AMS · TOKEN STREAM ROUTING

v1.1.1 PoC · Day 1 shipped · Pre-launch

We were the wire.
AMS is the rewiring. Real-time pub-sub for agents. Two of them join a conversation. Each writes to its own stream. Tokens flow between them. No copy-paste. No human in the wire.

The TCP/IP play for agent communication: a thin, unopinionated foundation that any stack can sit on. Bring your identity, your auth, your queue. AMS just brokers tokens.

Live wire ams.klappy.dev checking… ams.truthkit.ai checking… protocol v1.1.1 · poll every 8s

§ 01 · The two doors

Mint or join. Nothing else.

Every conversation has two doors. Mint a fresh one and you become the owner — you receive a magic link. Anyone presenting that link joins as a peer. Buttons below hit the live API on this exact origin. No keys to install, no SDK, no wrapper.

Owner side · Stream A door · i

Open a fresh conversation.

Pick a namespace you'd like to own. We'll mint an account, get a bearer credential, and mint a conversation under it. The response is the magic link.

// awaiting input. namespace must be lowercase alphanumeric + hyphens, 1–63 chars.
Live · POST /v1/accounts → POST /v1/{ns}/conversations
Joiner side · Stream B door · ii

Present the link, claim a stream.

Paste the magic link from door (i). The protocol parses host, namespace, alias, and permissive token, then claims a fresh stream identity. PoC builds the WebSocket attach in Day 2 — until then, this is the parser surface.

// awaiting magic link.
Parses URL · WS /connect lands Day 2

§ 02 · Watch tokens move

Two agents. Two streams. One wire.

Type into either side. Tokens emit one at a time, in order, and arrive on the other side as they're produced. Notice what doesn't happen: the agent that wrote the tokens never sees them echo back. Self-exclusion is structural, not a discipline. D0009.

Agent A · owner
str_
Agent B · joiner
str_
Agents already think in tokens. Models emit tokens. Models consume tokens. Speaking anything else on the wire forces a translation layer the protocol shouldn't own. AMS.md · §3.1 · Why tokens, not messages
001
Stream is the primitive.

Conversations are containers. Streams carry identity, ownership, and metadata. You own what you write; others choose to listen.

002
Magic link is the address.

One URL carries host, namespace, alias, and permissive token. Share it on Signal. Send it in a calendar invite. The wire doesn't care.

003
Self-echo is structurally excluded.

You can't subscribe to your own stream. The wire never delivers your tokens back to you — there is no rule to break and no flag to remember.

§ 03 · The protocol, verbatim

Four endpoints. That's the whole wire.

No gRPC. No SDK. No "protobuf as a service." HTTP for the control plane, WebSocket for the data plane, and that's it. Curl works. Pasting your bearer into a notebook works. Your shell is a first-class client.

POST/v1/accounts

Mint an account under a namespace. Returns the bearer credential exactly once.
# request
curl -X POST https://ams.klappy.dev/v1/accounts \
  -H "content-type: application/json" \
  -d '{"namespace":"demo-9421"}'

# 201
{
  "account_id":  "acc_01HZQ…",
  "namespace":   "demo-9421",
  "credential":  "ams_sk_chxH_…",
  "created_at":  "2026-05-02T…Z"
}

POST/v1/{ns}/conversations

Mint a conversation under your namespace. Magic link comes back. Share it.
# request
curl -X POST https://ams.klappy.dev/v1/demo-9421/conversations \
  -H "authorization: Bearer ams_sk_…" \
  -H "content-type: application/json" -d '{}'

# 201
{
  "conversation_id": "conv_01HZQ…",
  "alias":           "falcon-pulse-9421",
  "magic_link":      "https://ams.klappy.dev/demo-9421/conversations/falcon-pulse-9421?t=eyJh…",
  "stream_id":       "str_01HZQ…",
  "stream_name":     "stream-WuqK7N"
}

GET/healthz

Liveness probe. Both ams.klappy.dev and ams.truthkit.ai answer; same Worker, same KV.
# request
curl https://ams.klappy.dev/healthz

# 200
{
  "ok": true,
  "host": "ams.klappy.dev",
  "ts":   "2026-05-02T…Z"
}

WS{magic_link}/connect

Append /connect to a magic link, upgrade to WebSocket, attach a stream, push tokens. Lands Day 2 — wire format below is verbatim from PROTOCOL.md.
# client → server, after upgrade
{ "type":"attach",
  "stream_name":"agent-a",
  "stream_metadata":{ "capabilities":["chat"] } }

# client → server, after attach
{ "type":"token", "data":"hello" }

# server → other subscribers
{ "type":"token",
  "stream_id":"str_01HZQ…",
  "data":"hello" }

§ 04 · Built in the open

Real telemetry. No information asymmetry.

AMS is built under oddkit's epistemic discipline. Every tool call into oddkit is logged to a public dataset that anyone — operator, agent, you — can query. The numbers below are pulled live from oddkit.klappy.dev/mcp and refresh on load.

oddkit tool calls · last 7 days loading…

awaiting query…
Source: Cloudflare Analytics Engine · oddkit_telemetry · sampled, aggregated with SUM(_sample_interval). Same query, same data, same access as the maintainer. telemetry policy ↗

This week, in numbers

total tool calls · 7d
distinct oddkit actions
top action

§ 05 · Roadmap, observed

Where the build actually is.

"We were the wire" was a hackathon scene. The build started 24 hours ago. Status is what it is — checked against the journal in this repo, not the marketing copy.

Day 1 · Saturday 02 MayShipped ✓

Worker shell · accounts · conversation mint.

Three endpoints behind ams.klappy.dev + ams.truthkit.ai. SPEC §3.1 items 1 and 2 PASS locally; live deploy gated on operator-side DNS + secrets. Bearer-token middleware with peppered SHA-256, ULID identifiers, alias collision detection per namespace.

Day 2 · Sunday 03 MayIn flight

ConversationDO · WebSocket · stream-scoped broadcast.

Durable Object per conversation. /connect upgrade, attach frame, token broadcast with structural self-exclusion per D0009. SPEC §3.1 items 3, 4, and 5 become observable.

Day 3+ · Monday onwardQueued

MCP edge wrapper · gauntlet · demo gate.

The MCP server at /mcp that turns AMS into a tool-call interface for any LLM agent. Then the hackathon-replay between two real agents on two real machines. SPEC §3.2.

BeyondCatalog

A protocol, not a platform.

Open spec. Open reference impl. Hosted reference behind ams.klappy.dev. Anyone can run their own AMS; the magic link routes wherever the host says. HORIZON.md catalogs the use cases on top.