---
name: message-state-playground
description: Build an offline messaging state simulator with editable drafts, delivery failure, retry, rich cards and an inspectable event history.
---

# 每条消息，都有下一步。

Build an offline messaging state simulator with editable drafts, delivery failure, retry, rich cards and an inspectable event history.

Generate the standalone interface with Python 3.10 or newer:

```sh
python3 scripts/generate.py -o index.html
python3 scripts/generate.py -o index.html --title "A small interactive experiment" --accent "#5b95ad"
```

The default interface is Chinese, including the accessible names of both main regions. Open with `?lang=en` for English. Explicitly configured titles and text retain the supplied content. This is a single offline HTML file; no network service is required.

`--title` accepts 1–2000 characters; `--accent` accepts a 3- or 6-digit hex color. Text is escaped in HTML and configuration JSON. Additional text options (1–160 characters): --contact. Numeric options: --latency 150–3000. All options can also be provided in `--params config.json`. Unknown keys and invalid values are rejected. Template paths resolve relative to this package, so generation works from any directory.

Read [references/design.md](references/design.md) when adapting the state model, accessibility behavior or exported output. Preserve an actual repeatable interaction and keep displayed results tied to the current state. The preview is a useful starting point, not permission to connect external services.
