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

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ServerBuilder.d.ts","sourceRoot":"","sources":["../../src/server/ServerBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACN,UAAU,EACV,KAAK,oBAAoB,EAEzB,MAAM,iBAAiB,CAAC;AAEzB,qBAAa,aAAa;IACzB,OAAO,CAAC,SAAS,CAAC,CAAoB;IACtC,OAAO,CAAC,IAAI,CAAC,CAAe;IAC5B,OAAO,CAAC,OAAO,CAAC,CAAkB;IAClC,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,eAAe,CAAC,CAAkB;IAC1C,OAAO,CAAC,iBAAiB,CAAC,CAAsB;IAChD,OAAO,CAAC,UAAU,CAAC,CAA2B;IAC9C,OAAO,CAAC,aAAa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e,GAAG,IAAI;IAK3D,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI;IAKxD,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI;IAKtD,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKrC,mBAAmB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAK/C;;;;;;;OAOG;IACH,wBAAwB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAKnE;;;;;;;;;;;;;;;;;;OAkBG;IACH,wBAAwB,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI;IAK7D,KAAK,IAAI,UAAU;IAqEnB;;;OAGG;IACH,OAAO,CAAC,0BAA0B;CAiDlC"}
@@ -154,11 +154,14 @@ class ServerBuilder {
154
154
  server.on("client_joined_room", async ({ clientId, roomId }) => {
155
155
  const userId = server.getUserIdFromClientId(clientId);
156
156
  if (userId && presenceManager.isEnabled()) {
157
+ // Get deviceId from client (set via setClientDeviceId after auth)
158
+ const client = server.getClient(clientId);
159
+ const deviceId = client?.deviceId || clientId;
157
160
  // Call onRoomJoined for all extensions
158
161
  const extensions = presenceManager.extensions;
159
162
  if (extensions) {
160
163
  for (const ext of extensions) {
161
- await ext.onRoomJoined?.(userId, roomId, clientId);
164
+ await ext.onRoomJoined?.(userId, roomId, deviceId);
162
165
  }
163
166
  }
164
167
  }
@@ -166,11 +169,14 @@ class ServerBuilder {
166
169
  server.on("client_left_room", async ({ clientId, roomId }) => {
167
170
  const userId = server.getUserIdFromClientId(clientId);
168
171
  if (userId && presenceManager.isEnabled()) {
172
+ // Get deviceId from client (set via setClientDeviceId after auth)
173
+ const client = server.getClient(clientId);
174
+ const deviceId = client?.deviceId || clientId;
169
175
  // Call onRoomLeft for all extensions
170
176
  const extensions = presenceManager.extensions;
171
177
  if (extensions) {
172
178
  for (const ext of extensions) {
173
- await ext.onRoomLeft?.(userId, roomId, clientId);
179
+ await ext.onRoomLeft?.(userId, roomId, deviceId);
174
180
  }
175
181
  }
176
182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principal-ai/control-tower-core",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Centralized, runtime-agnostic library for real-time collaboration and synchronization",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",