@hohaha/openclaw-event-bus-plugin
v0.1.1
Published
OpenClaw Event Bus Plugin - Integrates event-driven architecture into OpenClaw Gateway
Downloads
13
Maintainers
Readme
@hohaha/openclaw-event-bus-plugin
OpenClaw Event Bus Plugin - Integrates event-driven architecture into OpenClaw Gateway.
Features
- 🎯 Event-First Architecture - Capture all OpenClaw events
- 🔌 Plugin Integration - Seamlessly integrates with OpenClaw Gateway
- 📊 Event Monitoring - Query and analyze events
- 🔗 HTTP API - REST endpoint for event access
- 🛠️ Agent Tool - Tool for event inspection
Installation
# Install plugin
openclaw plugins install @hohaha/openclaw-event-bus-plugin
# Or from local
openclaw plugins install ./openclaw-event-bus-plugin
# Restart gateway
openclaw gateway restartConfiguration
Add to your OpenClaw config file:
{
plugins: {
entries: {
"event-bus": {
enabled: true,
config: {
persistence: {
enabled: true,
provider: "memory" // or "sqlite"
},
debug: false
}
}
}
}
}Events Captured
| Event Type | OpenClaw Hook | Description |
|------------|---------------|-------------|
| TOOL_INVOKED | before_tool_call | Tool execution started |
| TOOL_COMPLETED | after_tool_call | Tool execution finished |
| SESSION_STARTED | session_created | New session created |
| SESSION_ENDED | session_ended | Session terminated |
| ERROR_OCCURRED | error_occurred | Error happened |
HTTP API
GET /api/events
Query events from the Event Bus.
curl http://localhost:8080/api/eventsAgent Tool
event_bus_query
Query events from within agent sessions.
/event_bus_query {"sessionId": "sess-123"}Architecture
OpenClaw Gateway
│
├── Hooks (before_tool_call, after_tool_call, ...)
│ │
│ └─► Event Bus Plugin
│ │
│ ├── OpenClawEventBus
│ │ ├── Event Queue
│ │ ├── Event Store
│ │ └── Subscribers
│ │
│ ├── HTTP Route (/api/events)
│ └── Agent Tool (event_bus_query)
│
└── Sessions, Tools, ChannelsDevelopment
# Build
npm run build
# Test
npm test
# Install locally for development
openclaw plugins install -l .License
MIT
Related
- @hohaha/event-bus - Core Event Bus library
- OpenClaw Plugin SDK - Plugin development guide
