Host Bridge Protocol
Companion SDK 使用小型 JSON-RPC protocol 与 Vifu host 通信。Game code 应使用 SDK API,不要直接发送 protocol message。
| Method | Direction | Description |
|---|---|---|
companion.initialize | host to game | 初始化 bridge。 |
companion.contexts/list | host to game | 列出 registered context。 |
companion.contexts/read | host to game | 读取 context snapshot。 |
companion.commands/list | host to game | 列出 registered command。 |
companion.commands/call | host to game | 请求 game command。 |
companion.observe | game to host | 发送 observation。 |
companion.signal | game to host | 发送 signal。 |
Game 拥有 state 和 command。Host 可以 request command execution,但 input validation 和 state change 由 game 负责。
