YAML configuration, init without a wizard, and openai-chat-completions
ci / check (push) Successful in 15m52s

- /config/agent.yaml and /config/boot.yaml replace the JSON files, read
  with serde_yaml_ng (also in the agent, inside WASM).
- sausage init asks nothing and reads no SAUSAGE_* variables. It writes
  commented templates with an example for each API, and prints the path
  to edit. Until the agent is configured, agent.chat names the missing
  field. allow_no_token: true permits a local model without a key.
- The agent speaks openai-chat-completions, the format of OpenRouter,
  Ollama, and most providers. base_url follows each SDK: with /v1 for
  the OpenAI shapes, without it for Anthropic.
- Checked against the proxy with glm-5.3-flash: the agent wrote, built,
  and activated a counter plugin in 55 s.
This commit is contained in:
2026-10-23 11:27:48 +01:00
parent ab1adbd5e3
commit b536beb069
19 changed files with 481 additions and 123 deletions
+9 -8
View File
@@ -10,8 +10,9 @@ own code.
## Start
You need [Nix](https://nixos.org/download) with flakes, and an API token for
an LLM (OpenAI Responses or Anthropic Messages API). No clone needed:
You need [Nix](https://nixos.org/download) with flakes, and an LLM: the OpenAI
Responses API, an OpenAI-compatible Chat Completions API (OpenRouter, Ollama,
and most other providers), or the Anthropic Messages API. No clone needed:
```sh
nix run git+https://gitea.surma.technology/surma/sausage
@@ -27,10 +28,10 @@ nix run git+https://gitea.surma.technology/surma/sausage -- init # creates ./w
nix run git+https://gitea.surma.technology/surma/sausage -- run # starts the world and a console
```
`init` asks for the API shape (`openai-responses` or `anthropic-messages`),
the base URL, the model, and the token. It reads `SAUSAGE_API`,
`SAUSAGE_BASE_URL`, `SAUSAGE_MODEL`, and `SAUSAGE_API_TOKEN` first. The
values go to `world/config/agent.json`. Both commands take another folder as
`init` asks nothing. It writes `world/config/agent.yaml`, with a comment for
each field and an example for each API. Edit it before the first chat: choose
the API, the base URL, the model, and the key. Until then, a chat answers with
an error that names the missing field. Both commands take another folder as
an argument, for example `... -- run my-world`.
Compiled code is cached outside the world, in `$XDG_CACHE_HOME/sausage/`
@@ -83,8 +84,8 @@ plugins/<name>/plugin.wasm the current version of a plugin
plugins/<name>/source/ its source
state/<plugin>/ the state of a plugin, by convention
state/core/journal.sqlite the journal: stderr of all processes, and core events
config/boot.json the services that start with the world
config/agent.json the configuration of the agent
config/boot.yaml the services that start with the world
config/agent.yaml the configuration of the agent
```
Each process also sees `/proc` (the processes and the state of the core),