@principal-ai/control-tower-core 0.1.23 → 0.1.25

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.mjs CHANGED
@@ -5480,6 +5480,9 @@ class BaseServer extends TypedEventEmitter {
5480
5480
  case "ping":
5481
5481
  await this.sendToClient(clientId, { type: "pong", timestamp: Date.now() });
5482
5482
  break;
5483
+ case "heartbeat":
5484
+ await this.sendToClient(clientId, { type: "heartbeat_ack", timestamp: Date.now() });
5485
+ break;
5483
5486
  default:
5484
5487
  await this.sendToClient(clientId, {
5485
5488
  type: "error",
@@ -5506,6 +5509,11 @@ class BaseServer extends TypedEventEmitter {
5506
5509
  if (client) {
5507
5510
  client.userId = tokenPayload.userId;
5508
5511
  client.authenticated = true;
5512
+ this.clientUserMap.set(clientId, tokenPayload.userId);
5513
+ if (!this.userClientMap.has(tokenPayload.userId)) {
5514
+ this.userClientMap.set(tokenPayload.userId, new Set);
5515
+ }
5516
+ this.userClientMap.get(tokenPayload.userId).add(clientId);
5509
5517
  await this.emit("client_authenticated", {
5510
5518
  clientId,
5511
5519
  userId: tokenPayload.userId,
@@ -5887,4 +5895,4 @@ export {
5887
5895
  BaseClient
5888
5896
  };
5889
5897
 
5890
- //# debugId=8CDBD5A49BC1736564756E2164756E21
5898
+ //# debugId=676078347A4365E464756E2164756E21