@moxt-ai/mobius 0.0.54 → 0.0.55

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/dist/index.js CHANGED
@@ -39016,12 +39016,16 @@ var RelayConnectionLiveness = class {
39016
39016
  heartbeatId,
39017
39017
  this.#timer.schedule(this.#handleTimeout, HEARTBEAT_ACK_TIMEOUT_MILLISECONDS)
39018
39018
  );
39019
- this.#transport.send(
39019
+ const sent = this.#transport.send(
39020
39020
  encodeRuntimeHeartbeatEvent({
39021
39021
  heartbeatId,
39022
39022
  kind: RUNTIME_HEARTBEAT_KIND
39023
39023
  })
39024
39024
  );
39025
+ if (!sent && this.#state instanceof AwaitingHeartbeatAckState && this.#state.heartbeatId === heartbeatId) {
39026
+ this.#state.timeout.cancel();
39027
+ this.#state = new FinishedRelayLivenessState();
39028
+ }
39025
39029
  };
39026
39030
  };
39027
39031
 
@@ -41200,7 +41204,20 @@ async function runRelayConnection(config2, directories, audit, sessions, install
41200
41204
  }
41201
41205
  };
41202
41206
  const connectionLiveness = new RelayConnectionLiveness(timer, {
41203
- send: (message) => send(socket, message),
41207
+ send: (message) => {
41208
+ if (socket.readyState !== WebSocket2.OPEN) {
41209
+ return false;
41210
+ }
41211
+ try {
41212
+ send(socket, message);
41213
+ return true;
41214
+ } catch (error62) {
41215
+ if (socket.readyState !== WebSocket2.OPEN) {
41216
+ return false;
41217
+ }
41218
+ throw error62;
41219
+ }
41220
+ },
41204
41221
  unresponsive: (heartbeatId, timeoutMilliseconds) => {
41205
41222
  diagnostics.heartbeatTimedOut(connectionEpoch, heartbeatId, timeoutMilliseconds);
41206
41223
  diagnostics.connectionClosed(