@principal-ai/control-tower-core 0.4.5 → 0.5.0

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
@@ -7191,6 +7191,21 @@ class ServerBuilder {
7191
7191
  await ext.onRoomJoined?.(userId, roomId, deviceId);
7192
7192
  }
7193
7193
  }
7194
+ const presenceConfig = presenceManager.getConfig();
7195
+ if (presenceConfig.broadcastPresenceUpdates && roomId !== "__global_presence__") {
7196
+ try {
7197
+ const experimental = server.experimental;
7198
+ await experimental?.broadcastAuthenticated({
7199
+ type: "presence:repo_opened",
7200
+ payload: {
7201
+ userId,
7202
+ repoId: roomId,
7203
+ branch: "main",
7204
+ openedAt: Date.now()
7205
+ }
7206
+ });
7207
+ } catch (error) {}
7208
+ }
7194
7209
  }
7195
7210
  });
7196
7211
  server.on("client_left_room", async ({ clientId, roomId }) => {
@@ -7204,6 +7219,19 @@ class ServerBuilder {
7204
7219
  await ext.onRoomLeft?.(userId, roomId, deviceId);
7205
7220
  }
7206
7221
  }
7222
+ const presenceConfig = presenceManager.getConfig();
7223
+ if (presenceConfig.broadcastPresenceUpdates && roomId !== "__global_presence__") {
7224
+ try {
7225
+ const experimental = server.experimental;
7226
+ await experimental?.broadcastAuthenticated({
7227
+ type: "presence:repo_closed",
7228
+ payload: {
7229
+ userId,
7230
+ repoId: roomId
7231
+ }
7232
+ });
7233
+ } catch (error) {}
7234
+ }
7207
7235
  }
7208
7236
  });
7209
7237
  server.on("stopped", async () => {
@@ -7238,4 +7266,4 @@ export {
7238
7266
  BaseClient
7239
7267
  };
7240
7268
 
7241
- //# debugId=CDBE4571CA2CA37864756E2164756E21
7269
+ //# debugId=DB66BB3C03BD260564756E2164756E21