@principal-ai/control-tower-core 0.4.2 → 0.4.3

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
@@ -7183,10 +7183,12 @@ class ServerBuilder {
7183
7183
  server.on("client_joined_room", async ({ clientId, roomId }) => {
7184
7184
  const userId = server.getUserIdFromClientId(clientId);
7185
7185
  if (userId && presenceManager.isEnabled()) {
7186
+ const client = server.getClient(clientId);
7187
+ const deviceId = client?.metadata?.device_id || client?.metadata?.agentId || clientId;
7186
7188
  const extensions = presenceManager.extensions;
7187
7189
  if (extensions) {
7188
7190
  for (const ext of extensions) {
7189
- await ext.onRoomJoined?.(userId, roomId, clientId);
7191
+ await ext.onRoomJoined?.(userId, roomId, deviceId);
7190
7192
  }
7191
7193
  }
7192
7194
  }
@@ -7194,10 +7196,12 @@ class ServerBuilder {
7194
7196
  server.on("client_left_room", async ({ clientId, roomId }) => {
7195
7197
  const userId = server.getUserIdFromClientId(clientId);
7196
7198
  if (userId && presenceManager.isEnabled()) {
7199
+ const client = server.getClient(clientId);
7200
+ const deviceId = client?.metadata?.device_id || client?.metadata?.agentId || clientId;
7197
7201
  const extensions = presenceManager.extensions;
7198
7202
  if (extensions) {
7199
7203
  for (const ext of extensions) {
7200
- await ext.onRoomLeft?.(userId, roomId, clientId);
7204
+ await ext.onRoomLeft?.(userId, roomId, deviceId);
7201
7205
  }
7202
7206
  }
7203
7207
  }
@@ -7234,4 +7238,4 @@ export {
7234
7238
  BaseClient
7235
7239
  };
7236
7240
 
7237
- //# debugId=1FAB6CDDEC349C3164756E2164756E21
7241
+ //# debugId=DB67CC00213AB3CF64756E2164756E21