provision-openclaw-web
v0.2.2
Published
OpenClaw channel plugin that bridges Provision's web chat surface (HTTP + SSE).
Readme
provision-openclaw-web
OpenClaw channel plugin that bridges the host gateway to Provision's web chat surface. Lets agents send and receive messages directly in the Provision dashboard, with the same async semantics as Slack/Telegram/Discord channels — agents can initiate messages, not just respond.
Wire shape
- Outbound (agent → user): plugin POSTs to
${webhookUrl}with body{ accountId, conversationId?, kind: 'text'|'media', text?, mediaUrl?, mediaMime?, replyToId?, threadId? }and anX-Provision-Signature: t=<unix>,v1=<hmac>header. Provision verifies the HMAC, persists aChatMessage, and broadcasts achat.message.receivedevent via Laravel Reverb so the React UI updates in real time. - Inbound (user → agent): plugin's
gateway.startAccountopens an authenticated SSE long-poll to${streamUrl}withAuthorization: Bearer <apiToken>. Provision pushes events of shapeevent: message\ndata: {...}whenever the user sends a chat message that hasn't yet been delivered to the agent.
Both webhookSecret (HMAC) and apiToken (bearer) are per-account and rotated on the Provision side. They land in the OpenClaw config under channels["provision-web"].accounts[<accountId>] during agent install.
Install
npm install -g provision-openclaw-webThe host's plugin discovery picks it up via the openclaw block in package.json plus the top-level openclaw.plugin.json manifest.
Build
npm install
npm run build
npm testTests exercise the transport primitives (HMAC sign/verify, SSE parsing, outbound adapter, monitor loop). The full ChannelPlugin wiring in src/channel.ts is best validated against a running OpenClaw gateway in integration testing.
License
MIT.
