mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 16:06:16 +00:00
chore: Run pnpm format:fix.
This commit is contained in:
@@ -4,11 +4,13 @@ read_when:
|
||||
- Adding or changing external CLI integrations
|
||||
- Debugging RPC adapters (signal-cli, imsg)
|
||||
---
|
||||
|
||||
# RPC adapters
|
||||
|
||||
OpenClaw integrates external CLIs via JSON-RPC. Two patterns are used today.
|
||||
|
||||
## Pattern A: HTTP daemon (signal-cli)
|
||||
|
||||
- `signal-cli` runs as a daemon with JSON-RPC over HTTP.
|
||||
- Event stream is SSE (`/api/v1/events`).
|
||||
- Health probe: `/api/v1/check`.
|
||||
@@ -17,11 +19,13 @@ OpenClaw integrates external CLIs via JSON-RPC. Two patterns are used today.
|
||||
See [Signal](/channels/signal) for setup and endpoints.
|
||||
|
||||
## Pattern B: stdio child process (imsg)
|
||||
|
||||
- OpenClaw spawns `imsg rpc` as a child process.
|
||||
- JSON-RPC is line-delimited over stdin/stdout (one JSON object per line).
|
||||
- No TCP port, no daemon required.
|
||||
|
||||
Core methods used:
|
||||
|
||||
- `watch.subscribe` → notifications (`method: "message"`)
|
||||
- `watch.unsubscribe`
|
||||
- `send`
|
||||
@@ -30,6 +34,7 @@ Core methods used:
|
||||
See [iMessage](/channels/imessage) for setup and addressing (`chat_id` preferred).
|
||||
|
||||
## Adapter guidelines
|
||||
|
||||
- Gateway owns the process (start/stop tied to provider lifecycle).
|
||||
- Keep RPC clients resilient: timeouts, restart on exit.
|
||||
- Prefer stable IDs (e.g., `chat_id`) over display strings.
|
||||
|
||||
Reference in New Issue
Block a user