Peer Mailboxes
loomtty peer gives agents (and scripts) named mailboxes inside loomtty-server. One agent sends a message; another, blocked on loomtty peer recv <name> --wait, wakes up with the message in its output. Nobody polls, nobody types into someone else's terminal, and it works the same between two shells on one machine and between machines.
# reviewer (left running in the background):
loomtty peer recv reviewer --wait
# main:
loomtty peer send reviewer --from main -s "please review" -f notes.md
# delivered (reviewer is waiting) id k3f9a2-x81mqd
loomtty peer recv main --wait # now wait for the answer
# reviewer, after waking up and doing the work:
loomtty peer send main --from reviewer --reply-to k3f9a2-x81mqd -f review.md
loomtty peer recv reviewer --wait # and wait for the next turnThe model
- A mailbox is a name. Names are not registered anywhere: the first
sendto a name orrecvon it creates the mailbox. An agent talking to two others at once uses two names, which keeps the two conversations apart. Names follow the session-name rule (lowercase letters, digits and-). - Messages are files. Each mailbox is a directory under loomtty's state directory (
mail/<name>/, next tosessions/), with one file per message: queued messages innew/, handed-out ones inseen/. They survive a server restart. - Waits are local.
recv --waitalways waits on the machine it runs on. Only onerecv --waitwaits per name; a newer one takes over and the older one exits with status 4. - The sender makes the hop.
send build:builderconnects from your machine to theloomtty-serveronbuildthrough ssh (ssh -W 127.0.0.1:<port>, the same path as remote attach) and drops the message in that machine's mailbox. Servers never talk to each other. - Messages are text. The body is UTF-8, at most 512 KiB. For anything bigger, send a path or a git ref.
recvprints bodies up to 8 KiB and points to the file for the rest.
Delivery states
send tells you what happened right away:
| Status | Meaning |
|---|---|
delivered (... is waiting) | A recv --wait was waiting on that name and now has the message. |
queued (... last seen 3m ago, N unread) | Nobody is waiting; the next recv gets it. |
queued (nobody has used the name ... yet) | The name has never been used on that machine: often a typo, or the other side has not started yet. |
peer log shows each message's state afterwards:
| State | Meaning |
|---|---|
queued | Still waiting in the mailbox. |
delivered | Handed to a recv, and the owner has not run a peer command since. |
read | Handed out, and the owner has since run recv or sent a message from this machine, so it moved on to its next step. |
At-most-once delivery
A message counts as delivered once it is handed to a recv command. If that command belonged to an agent that is already gone (an orphaned background task), the message went to it and nobody read it. Such a message stays delivered in peer log instead of turning read; its file is still in the mailbox's seen/ directory, and peer log (with --json) shows its path. Starting a fresh recv --wait on the name takes over from an orphaned waiter.
Setting up machines
On one machine there is nothing to set up: the server must be running (start loomtty, or loomtty-server --headless).
Across machines:
Every machine runs loomtty 0.3.0 or newer; an older server is reported as too old.
The receiving machine accepts tunnelled clients:
toml[remote] enabled = trueThe sending machine has a saved host for it, and ssh logs in without a prompt (peer runs ssh with
BatchMode=yes):toml[[remote.hosts]] name = "build" host = "[email protected]"The sending machine has a name of its own, so the recipient can reply to
<that name>:<your name>. Use the name the other machines give it in their[[remote.hosts]]:toml[peer] host = "laptop"Restart
loomtty-serverafter setting or changing it: the server reads[peer] hostonly when it starts.
Messages from another machine arrive as laptop:main; replying to exactly that address goes back through the recipient's own [[remote.hosts]] entry for laptop.
Limits
peer logon a machine shows the messages that machine received. A conversation between two machines is split between their two logs.- A
deliveredmessage whose recipient replied to another machine and then stopped staysdelivered: the reply went to the other machine's server, not this one. Runningrecv --waitagain (the normal next step) marks it read. - Message files in
seen/are not cleaned up automatically. Deleting them by hand is safe.
See the CLI reference for every flag and exit status.