OpenClaw 透過 JSON-RPC 整合外部 CLI。今日使用兩種模式。Documentation Index
Fetch the complete documentation index at: https://docs2.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
模式 A:HTTP 常駐程式 (signal-cli)
signal-cli以常駐程式形式執行,透過 HTTP 使用 JSON-RPC。- 事件串流是 SSE (
/api/v1/events)。 - 健康狀態探測:
/api/v1/check。 - 當
channels.signal.autoStart=true時,OpenClaw 負責生命週期。
模式 B:stdio 子行程 (imsg)
- OpenClaw 會為 iMessage 產生
imsg rpc作為子行程。 - JSON-RPC 透過 stdin/stdout 以行分隔(一行一個 JSON 物件)。
- 不需要 TCP 連接埠,也不需要常駐程式。
watch.subscribe→ 通知 (method: "message")watch.unsubscribesendchats.list(探測/診斷)
chat_id)。
轉接器準則
- Gateway 負責行程(啟動/停止與提供者生命週期綁定)。
- 保持 RPC 用戶端具備韌性:逾時、退出時重新啟動。
- 優先使用穩定 ID(例如
chat_id),而不是顯示字串。