@mulingai-npm/redis 3.40.45 → 3.40.47

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.
@@ -36,6 +36,21 @@ export declare class MulingstreamListenerManager {
36
36
  totalListeners: number;
37
37
  languageBreakdown: Record<string, number>;
38
38
  }>;
39
+ /**
40
+ * How many people in this room are ACTUALLY RECEIVING translation right now.
41
+ *
42
+ * Church passes turn on this number rather than on how many people joined. A
43
+ * pass is spent only when translation reached a human being, so somebody
44
+ * sitting on the join screen, or with the tab open and audio stopped, must
45
+ * not burn a church's pass.
46
+ *
47
+ * `isListening` is already maintained by setListeningState, so this is the
48
+ * honest count rather than a proxy for it. Falls back to counting a listener
49
+ * whose flag has never been written, because the flag arrived after some
50
+ * clients shipped and an older client that is genuinely playing audio should
51
+ * still count.
52
+ */
53
+ getReceivingCount(roomId: string): Promise<number>;
39
54
  private capKey;
40
55
  /**
41
56
  * Cache the room's listener cap. Called by the speaker service at go-live and
@@ -239,6 +239,24 @@ class MulingstreamListenerManager {
239
239
  languageBreakdown
240
240
  };
241
241
  }
242
+ /**
243
+ * How many people in this room are ACTUALLY RECEIVING translation right now.
244
+ *
245
+ * Church passes turn on this number rather than on how many people joined. A
246
+ * pass is spent only when translation reached a human being, so somebody
247
+ * sitting on the join screen, or with the tab open and audio stopped, must
248
+ * not burn a church's pass.
249
+ *
250
+ * `isListening` is already maintained by setListeningState, so this is the
251
+ * honest count rather than a proxy for it. Falls back to counting a listener
252
+ * whose flag has never been written, because the flag arrived after some
253
+ * clients shipped and an older client that is genuinely playing audio should
254
+ * still count.
255
+ */
256
+ async getReceivingCount(roomId) {
257
+ const listeners = await this.getListenersByRoom(roomId);
258
+ return listeners.filter((l) => l.isListening !== false).length;
259
+ }
242
260
  // ─── Per-room listener capacity (design B, 2026-07-09) ────────────────────
243
261
  // The cap value is the room owner's plan `max_audience`, resolved ONCE by the
244
262
  // speaker service when it goes live (it already fetches the plan entitlements)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulingai-npm/redis",
3
- "version": "3.40.45",
3
+ "version": "3.40.47",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {