Skip to content

Machines

A machine is where agents run: a daemon connected to the relay. An agent's address names it as name@machine. Circles are separate. A circle is the team, and a shared circle spans machines. A machine is where each agent in it runs. Design: rfcs/machines.md.

The registry

Each daemon describes itself to the relay every time it connects:

  • its id, the @machine part of an address, which is the hostname;
  • its kind (daemon);
  • the backends it can spawn, which are the keys of spawn.commands;
  • its capabilities, such as spawn, inbox, push, schedules, conversation and remote;
  • its version and schema.

The relay keeps these in memory while the machine is connected and drops them when it disconnects. Only online machines are listed.

repowire machines            # the owner's online machines
repowire machines --json

Surfaces read the same list from GET /machines on the daemon or GET /api/v1/machines on the relay (HTTP API). With the relay off, a daemon lists only itself.

Each id belongs to one machine. A second install that connects with a connected machine's id is refused with machine_id_taken. Rename one of the hosts to fix it.

Home

One human has one inbox. The home machine is the machine whose inbox is the human's. The hosted dashboard and the iOS app reach home when they don't name a machine.

  • Home is the first machine with an inbox to connect.
  • It stays home through restarts, reconnects and a rename of its host.
  • It never moves to another machine by itself. While home is offline, a request that names no machine gets home_offline, with when home was last seen and the machines that are online. The relay never sends it to another machine's inbox instead. Every human surface says it in one sentence: "Your home machine, X, is offline (last seen ). Your inbox and messages wait there until it is back." repowire machines then prints the way to move it on its own line.
  • Move it on purpose:
repowire machines home MACHINE_ID
  • With the relay off, the daemon is its own home.

Home is the one thing the relay stores about machines. It sits next to share links in the relay's state database (relay).

The human across machines

The human is one person with one inbox, on home. Circles still bound agents, but not the human.

  • The human to an agent. A send to name@machine (or peer_id@machine) from any of the human's surfaces reaches that agent, whatever its circle. The agent hears it from @human. Its answer, and the send's state, come back to the human's conversation as a local send's do.
  • An agent to the human. An agent on a machine that is not home that asks or notifies plain human reaches home's inbox (Needs you). The human's reply there reaches the agent, and threads and in_reply_to work as they do locally. There is no human@machine address.
  • Where plain human goes. With the relay off, or before the relay has said which machine is home, it is this machine's inbox, as before. On home it is the local inbox. Anywhere else it is home.
  • Home offline. An agent's ask or note to human fails at once with 503 {error: "home_offline", home_id, home_seen_at} and the detail "Home machine X is offline (last seen T). Your message was not sent; send it again when home is back." Nothing is queued.
  • Forward. Forwarding an item to an agent on another machine sends it on, quoted, as a new message from the human. An open ask you hold is not handed across machines yet: it stays yours to answer, and surfaces say "Copy sent to @x; still yours to answer" (kept_ask in the response).
  • Broadcasts do not carry the human across machines. An agent's broadcast reaches its own shared circle only.

A cross-machine send whose outcome is not known yet is accepted with a warning. It was recorded and may have landed, so a retry under the same idempotency key returns it instead of sending again, and the human's next read of the inbox or conversation settles it.

Trust: another machine's daemon vouches for the human it sends as, under the owner trust model of cross-machine circles. The relay carries these requests only between machines on the same owner key.

Reaching a machine through the relay

A request through the relay can name its machine with the X-Repowire-Machine header or a machine query parameter. The parameter exists because the browser's EventSource streams cannot send headers. If both are sent, the header wins. An offline machine answers machine_offline. A share link always goes to the machine that made it.