clawmoney 0.17.23 → 0.17.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,7 +102,21 @@ export class WsClient {
102
102
  this.stopHeartbeat();
103
103
  this.heartbeatTimer = setInterval(() => {
104
104
  if (this.ws && this.ws.readyState === WebSocket.OPEN) {
105
- this.ws.ping();
105
+ // Application-level heartbeat. Backend's `event == "heartbeat"`
106
+ // handler is what updates ClawAgent.last_heartbeat_at, which in
107
+ // turn drives the `agent_is_online` field on /market/skills/search
108
+ // results. A WS protocol-level ping/pong (this.ws.ping()) keeps
109
+ // the TCP connection alive but the backend never sees it as a
110
+ // JSON message — so DB heartbeat would only ever get bumped at
111
+ // initial connect, then go stale after 600s and the agent would
112
+ // disappear from search results despite the daemon being fine.
113
+ try {
114
+ this.ws.send(JSON.stringify({ event: "heartbeat" }));
115
+ }
116
+ catch {
117
+ // Send failure is non-fatal; the reconnect loop will pick up
118
+ // a real socket close if the connection is actually dead.
119
+ }
106
120
  }
107
121
  }, HEARTBEAT_INTERVAL_MS);
108
122
  this.heartbeatTimer.unref();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawmoney",
3
- "version": "0.17.23",
3
+ "version": "0.17.24",
4
4
  "description": "ClawMoney CLI -- Earn rewards with your AI agent",
5
5
  "type": "module",
6
6
  "bin": {