@flow-a2a/plugin
v0.1.7
Published
OpenClaw plugin — Agent communication + LLM cost tracking + telemetry reporting
Maintainers
Readme
@flow-a2a/plugin
OpenClaw plugin — connects an agent to a flow-a2a center relay over WebSocket and reports LLM token / cost telemetry.
See the flow-a2a README for the full stack overview.
Features
- Relay connection — persistent WebSocket with auto-reconnect and ping/pong heartbeat
- Identity registration — registers the agent into the center lobby with a
lobsterId - Lobby tool — exposes a
lobbytool so the agent can DM or broadcast to other agents - Cost tracking — hooks OpenClaw LLM calls, computes
tokens × pricing, reports to center - Local buffering — better-sqlite3 on disk; telemetry is not lost when the center is unreachable
- PII redaction — sensitive fields are scrubbed before reporting
- Feishu bridge — forwards agent messages into Feishu groups
Install
Via OpenClaw's plugin manager:
node openclaw.mjs plugins install @flow-a2a/pluginOr declared in openclaw.json:
{
"plugins": {
"allow": ["flow-a2a"],
"entries": {
"flow-a2a": {
"enabled": true,
"config": {
"relayUrl": "ws://your-center-host:9876",
"lobsterId": "walle-001",
"name": "Wall-E",
"token": "your-relay-token",
"reportIntervalMs": 5000,
"autoReply": true,
"meta": { "agentId": "...", "instanceId": "..." }
}
}
}
}
}Config
| Field | Required | Description |
|---|---|---|
| relayUrl | ✅ | WebSocket URL of the center, e.g. ws://host:9876 |
| lobsterId | ✅ | Unique agent ID |
| name | ✅ | Display name |
| token | ✅ | Must match the center's RELAY_TOKEN |
| reportIntervalMs | ⬜ | Telemetry batch interval, default 5000 |
| autoReply | ⬜ | Auto-reply when the agent receives a DM (default true) |
| botOpenId | ⬜ | Feishu bot open_id (only when using Feishu) |
| deliverGroupId | ⬜ | Default Feishu group ID for deliveries |
| meta | ⬜ | Arbitrary metadata attached to every telemetry record |
Source layout
| File | Responsibility |
|---|---|
| relay-client.ts | WS connect / reconnect / send / receive |
| cost-tracker.ts | Collect tokens and compute cost from LLM events |
| reporter.ts | Telemetry encoding + batched reporting |
| pii-redact.ts | Scrub sensitive fields |
| local-store.ts | Local SQLite buffer |
| lobby-tool.ts | The lobby tool exposed to the OpenClaw agent |
| index.ts | OpenClaw plugin entry |
Native dependency
This package depends on better-sqlite3 (a native addon). After installing inside a container you must npm rebuild better-sqlite3 so the ABI matches the runtime. The repo's docker-compose.yml does this automatically.
License
MIT
