feat: add POST /openclaw endpoint and enrich heartbeats with OpenClaw metadata

- Bridge server now accepts POST /openclaw from OpenClaw plugin
- OpenClawMeta struct stores version, plugin_version, and agents
- Heartbeat sendOnce() enriches payload with plugin metadata when available
- Telemetry Payload adds optional openclaw_version field
- README updated to document /openclaw endpoint and metadata enrichment
- All communication remains optional — Monitor functions without plugin data
This commit is contained in:
zhi
2026-03-22 01:37:15 +00:00
parent 360743ba6b
commit dc05fa01d1
4 changed files with 88 additions and 3 deletions

View File

@@ -73,6 +73,19 @@ func main() {
// Update bridge with latest telemetry
if bridgeSrv != nil {
bridgeSrv.UpdatePayload(payload)
// Enrich payload with OpenClaw metadata if available
if meta := bridgeSrv.GetOpenClawMeta(); meta != nil {
if meta.Version != "" {
payload.OpenClawVersion = meta.Version
}
if meta.PluginVersion != "" {
payload.PluginVersion = meta.PluginVersion
}
if len(meta.Agents) > 0 {
payload.Agents = meta.Agents
}
}
}
if printPayload || dryRun {