agent-yes · lab

Architecture lab · re-imagining the graph

One agent → one URL.
The whole map, today & tomorrow.

The goal: anyone can expose their own AI agent to the network with a single link, self-contained, end-to-end encrypted. Most of it already exists — but it grew as several overlapping stacks. This page re-draws the system as one clean graph, marks what is built vs. what is next, and names the seam that collapses the clutter.

The unifying idea → one agent, one local fabric, one API handler, many transports, one URL. Every reach surface (browser, CLI, desktop, peer) speaks the same API; every transport (HTTP, WebRTC, libp2p) is just a pipe into the same in-process apiFetch(); trust & discovery (signaling, E2E keys, tokens) is a separable plane, not baked into any one path.

01The interactive graph

Tap any node for what it is, where it lives in the tree, and its status. Toggle Future to overlay where the system is heading.

Built Partial Experimental Future

02The five planes (read top-down)

The same boxes from the graph, grouped into the layers that make the model legible. Data flows up from the agent; control flows down from a surface.

① Agent core

  • Auto-yes wrapper spawns any AI CLI in a PTY and answers ready / enter / fatal prompts so it runs unattended.
  • Rust is the primary single binary; TypeScript is the reference.
  • Crash-recovery, idle exit, session resume, TTY-resize propagation.

② Local fabric

  • PID registry (pids.jsonl) — every agent, both runtimes.
  • FIFO per pid — append prompts to a live agent's stdin.
  • Raw PTY logs — the source of truth for tail / render.
  • cy is the on-machine control plane over all of it.

③ Exposure

  • ay serve exposes one transport-agnostic handler apiFetch(req)→Response.
  • HTTP (Bun.serve, :7432) and a WebRTC bridge both call it.
  • Daemonized via oxmgr / pm2; health-watchdog keeps the native stack fresh.

④ Trust & discovery

  • Signaling DO — a rendezvous only; never sees plaintext or the secret.
  • E2E — HKDF key split + per-connection AES-256-GCM; the secret rides the URL fragment and never hits a server.
  • Token + persistent room → a stable, secret-bearing link.
  • Next: per-agent capabilities + OAuth-bound shares — design draft.

⑤ Reach surfaces

  • Browser console /w/ — PWA, xterm.js, mobile/touch.
  • Remote CLIay remote add then drive another box.
  • Desktop (Electron) — offline, same UI, no signaling needed.
  • Swarm peers — other agents, P2P (experimental).

03How a share link actually resolves

The "simple URL" path end-to-end. The secret S never leaves the two endpoints.

# 1. the host mints/persists a room and prints a link
$ ay serve --share
  https://agent-yes.com/w/#r3f9c2:e1.<secret S> # room + E2E secret in the #fragment

# 2. browser opens the link — the #fragment never reaches any server
  S = location.hash  →  authToken = HKDF(S, room) # only this is shown to signaling

# 3. rendezvous over s.agent-yes.com (relays SDP/ICE; learns nothing)
  browser  ⇄  signaling DO  ⇄  ay serve host

# 4. P2P DataChannel opens; keys = HKDF(S, transcript). Server is now cut out.
  browser  ⇄ AES-256-GCM ⇄  host apiFetch()  →  ls · tail · send · spawn

# offline / LAN / desktop: skip 2–4 entirely
$ ay serve --http   # browser → http://host:7432/#k=<token>

04Honest status — built · cluttered · next

✓ Built & working

  • Auto-yes wrapper across 8 CLIs, TS + Rust parity.
  • Local fabric: pidStore + FIFO + logs, driven by cy.
  • ay serve with HTTP + WebRTC off one handler.
  • E2E share links (HKDF split, AES-GCM, fail-closed handshake) + signaling DO.
  • Browser console PWA incl. mobile/touch; remote CLI.

⚠ Where the clutter is

  • Two runtimes (TS reference, Rust primary) — features drift; a parity table has to be hand-maintained.
  • Three networking stacks that don't share a model: HTTP, WebRTC+signaling, libp2p swarm.
  • Overlapping modes — --http / --webrtc / --share (legacy alias).
  • node-datachannel fragility: native freeze needs watchdogs + proactive restarts.
  • Persistence scattered across several ~/.agent-yes/* dotfiles.

TS ↔ Rust ↔ exposure, at a glance

Capability TypeScript Rust Notes
PTY wrap + pattern auto-yes ✓ built ✓ built Primary distribution is the Rust single binary
Local fabric (pids · FIFO · logs) ✓ built ✓ built Shared ~/.agent-yes registry across both
ay serve HTTP API + console ✓ built — via TS Served by the TS runtime; Rust shells out
WebRTC share + E2E + signaling ✓ built node-datachannel; secret stays client-side
Desktop (Electron, offline) ◐ scaffold Spawns ay serve --http on loopback
libp2p swarm (peer mesh) — stub ⬡ experimental Feature-gated; broadcast-only so far
Native mobile surface future future Wrap the existing /w/ PWA