docs: add bgm-engine message layer design

Define the message/queue/tick model, the three handler kinds (trigger,
orchestrator, command host), and the @tts/engine package split. Cross-link
from bgm-commands and bgm-tabletop, and add the engine to the architecture
package table.
This commit is contained in:
2026-08-10 18:26:19 +08:00
parent 13b3eaed78
commit 91cd3a16d7
4 changed files with 238 additions and 3 deletions
+4 -2
View File
@@ -6,8 +6,10 @@ interaction — focus the camera, wait for a tap, move a part, show a caption
that runs against the tabletop state store and render layer.
This doc covers **command execution**: the async lifecycle, run contexts, and
tap interaction. How commands are *declared* (the `script` role, trigger
points on parts) is a separate concern, deferred to `bgm-format.md`.
tap interaction. The message layer above this — how commands are *declared*
and *fired* (triggers, orchestrators, the message queue) — is specified in
[`bgm-engine.md`](./bgm-engine.md). The command host is the `@tts/tabletop`
implementation of the engine's `CommandHost` contract.
## 1. async commands