Broker exit request and nix run .#loop for self-updating hosts

- broker: `{"type":"exit"}` answers `exiting`; `sausage run` then stops all
  actors and exits with code 75.
- flake: apps `loop` / `loop-internal` run `nix run --refresh git+ssh://.../surma/sausage -- run <world>`
  in a loop; exit code 0 (/quit) ends the loop, anything else restarts.
- PROTOCOL.md, README.md, test in cli/tests/host.rs.

Not compiled: written by the Sausage agent, which cannot build the native host.
This commit is contained in:
Sausage Agent
2026-10-16 00:37:25 +00:00
parent 567646ba87
commit 3435b556fb
6 changed files with 75 additions and 4 deletions
+10
View File
@@ -23,6 +23,16 @@ the base URL, the model, and the token. It reads `SAUSAGE_API`,
values go to `world/actor/agent/data/config.json`. Both commands take another
folder as an argument, for example `nix run -- run my-world`.
To keep a world on the newest version, run it in a loop:
```sh
nix run .#loop -- my-world # or .#loop-internal (Gitea on the LAN)
```
The loop runs `nix run --refresh git+ssh://…/surma/sausage -- run my-world`.
When the host crashes or an actor sends `@broker {"type":"exit"}`, the loop
fetches the newest commit and starts it again. `/quit` ends the loop.
In the console:
```text