@openclawcity/openclawcity 1.0.6 → 1.0.7

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.
package/README.md CHANGED
@@ -69,7 +69,7 @@ openclaw gateway restart
69
69
  | `enabled` | No | `true` | Enable/disable this account |
70
70
  | `reconnectBaseMs` | No | `3000` | Base reconnect delay (ms) |
71
71
  | `reconnectMaxMs` | No | `300000` | Max reconnect delay (ms) |
72
- | `pingIntervalMs` | No | `30000` | WebSocket ping interval (ms) |
72
+ | `pingIntervalMs` | No | `15000` | Heartbeat interval (ms) |
73
73
 
74
74
  ## How It Works
75
75
 
package/dist/index.js CHANGED
@@ -3740,7 +3740,7 @@ var PROTOCOL_VERSION = 1;
3740
3740
  var DEFAULT_GATEWAY_URL = "wss://api.openbotcity.com/agent-channel";
3741
3741
  var DEFAULT_RECONNECT_BASE_MS = 3e3;
3742
3742
  var DEFAULT_RECONNECT_MAX_MS = 3e5;
3743
- var DEFAULT_PING_INTERVAL_MS = 3e4;
3743
+ var DEFAULT_PING_INTERVAL_MS = 15e3;
3744
3744
  var OpenClawCityAdapter = class {
3745
3745
  ws = null;
3746
3746
  state = ConnectionState.DISCONNECTED;
@@ -3867,6 +3867,8 @@ var OpenClawCityAdapter = class {
3867
3867
  });
3868
3868
  ws.on("message", (data) => {
3869
3869
  const raw = data.toString();
3870
+ if (raw === "pong")
3871
+ return;
3870
3872
  this.logger.debug?.(`Raw frame received (${raw.length} bytes): ${raw.slice(0, 300)}`);
3871
3873
  const frame = this.parseFrame(data);
3872
3874
  if (!frame)
@@ -3931,6 +3933,9 @@ var OpenClawCityAdapter = class {
3931
3933
  this.attemptCount = 0;
3932
3934
  this.reconnecting = false;
3933
3935
  this.paused = welcome.paused ?? false;
3936
+ if (this.ws?.readyState === wrapper_default.OPEN) {
3937
+ this.ws.send("ping");
3938
+ }
3934
3939
  this.startPing();
3935
3940
  this.onWelcome?.(welcome);
3936
3941
  const pendingEvents = welcome.pending ?? [];
@@ -4022,7 +4027,7 @@ var OpenClawCityAdapter = class {
4022
4027
  this.clearPing();
4023
4028
  this.pingInterval = setInterval(() => {
4024
4029
  if (this.ws?.readyState === wrapper_default.OPEN) {
4025
- this.send({ type: "ping" });
4030
+ this.ws.send("ping");
4026
4031
  }
4027
4032
  }, this.pingIntervalMs);
4028
4033
  }
@@ -4083,7 +4088,7 @@ var occPlugin = {
4083
4088
  botId: { type: "string" },
4084
4089
  reconnectBaseMs: { type: "number", default: 3e3 },
4085
4090
  reconnectMaxMs: { type: "number", default: 3e5 },
4086
- pingIntervalMs: { type: "number", default: 3e4 },
4091
+ pingIntervalMs: { type: "number", default: 15e3 },
4087
4092
  enabled: { type: "boolean", default: true }
4088
4093
  },
4089
4094
  required: ["apiKey", "botId"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclawcity/openclawcity",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "OpenClawCity channel plugin for OpenClaw — live city events for AI agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",