@mulingai-npm/redis 3.44.2 → 3.44.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.
@@ -115,5 +115,34 @@ export declare function isListenerPresent(lastHeartbeatMs: number, isAway: boole
115
115
  *
116
116
  * So a hidden reader still costs nothing, which was the original point, and a
117
117
  * hidden listener is served, which is the product.
118
+ *
119
+ * ─── THE READER CLAUSE IS GONE, 2026-08-31 ──────────────────────────────────
120
+ *
121
+ * `isAway && !isListening` no longer excludes anybody. The test is now a live
122
+ * heartbeat and nothing else, and everything above about audio survives only as
123
+ * the reason this function stopped trusting `isAway` in the first place.
124
+ *
125
+ * The rule it replaced punished the wrong person. A guest with earbuds in and
126
+ * the phone in their pocket counted; a guest READING CAPTIONS who glanced at
127
+ * WhatsApp for twenty seconds did not. Both have a dark screen. The only thing
128
+ * separating them was which flag happened to be set, which is an accident, not
129
+ * a principle.
130
+ *
131
+ * And the cost of being dropped was never "no captions for twenty seconds". The
132
+ * language left the room's set, so if the room was at its ceiling meanwhile,
133
+ * somebody else could take the slot and the reader came back to find their
134
+ * language gone entirely. David decided on 2026-08-31 to count them in.
135
+ *
136
+ * WHAT THIS DOES NOT DO IS TURN ON SPEECH FOR DARK SCREENS. Synthesis is gated
137
+ * by `getLanguagesWithActiveListeners`, which tests `listener.isListening`
138
+ * itself before ever calling this and passes `true` here, so it only ever used
139
+ * the heartbeat half. The expensive path is unchanged.
140
+ *
141
+ * What it does cost is TRANSLATION for a language held only by people whose
142
+ * screens are dark, and only until they are swept as gone. Measured on
143
+ * 2026-08-31: one target language ran about 28 to 41 output tokens per chunk and
144
+ * two ran about 50 to 67, so an extra language is roughly 20 to 25 output tokens
145
+ * a chunk. That is the price of not stealing a reader's language while they
146
+ * answer a message.
118
147
  */
119
- export declare function isListenerConsuming(lastHeartbeatMs: number, isAway: boolean, isListening: boolean, now?: number): boolean;
148
+ export declare function isListenerConsuming(lastHeartbeatMs: number, _isAway: boolean, _isListening: boolean, now?: number): boolean;
@@ -128,16 +128,54 @@ exports.isListenerPresent = isListenerPresent;
128
128
  *
129
129
  * So a hidden reader still costs nothing, which was the original point, and a
130
130
  * hidden listener is served, which is the product.
131
+ *
132
+ * ─── THE READER CLAUSE IS GONE, 2026-08-31 ──────────────────────────────────
133
+ *
134
+ * `isAway && !isListening` no longer excludes anybody. The test is now a live
135
+ * heartbeat and nothing else, and everything above about audio survives only as
136
+ * the reason this function stopped trusting `isAway` in the first place.
137
+ *
138
+ * The rule it replaced punished the wrong person. A guest with earbuds in and
139
+ * the phone in their pocket counted; a guest READING CAPTIONS who glanced at
140
+ * WhatsApp for twenty seconds did not. Both have a dark screen. The only thing
141
+ * separating them was which flag happened to be set, which is an accident, not
142
+ * a principle.
143
+ *
144
+ * And the cost of being dropped was never "no captions for twenty seconds". The
145
+ * language left the room's set, so if the room was at its ceiling meanwhile,
146
+ * somebody else could take the slot and the reader came back to find their
147
+ * language gone entirely. David decided on 2026-08-31 to count them in.
148
+ *
149
+ * WHAT THIS DOES NOT DO IS TURN ON SPEECH FOR DARK SCREENS. Synthesis is gated
150
+ * by `getLanguagesWithActiveListeners`, which tests `listener.isListening`
151
+ * itself before ever calling this and passes `true` here, so it only ever used
152
+ * the heartbeat half. The expensive path is unchanged.
153
+ *
154
+ * What it does cost is TRANSLATION for a language held only by people whose
155
+ * screens are dark, and only until they are swept as gone. Measured on
156
+ * 2026-08-31: one target language ran about 28 to 41 output tokens per chunk and
157
+ * two ran about 50 to 67, so an extra language is roughly 20 to 25 output tokens
158
+ * a chunk. That is the price of not stealing a reader's language while they
159
+ * answer a message.
131
160
  */
132
- function isListenerConsuming(lastHeartbeatMs, isAway, isListening, now = Date.now()) {
133
- const age = now - lastHeartbeatMs;
134
- // Heard nothing recently: unknown, and unknown is not consuming. Covers both
135
- // 'gone' and the stale-heartbeat half of 'away'.
136
- if (age > exports.LISTENER_PRESENT_MS)
137
- return false;
138
- // Hidden and reading only. Nothing is reaching them, so nothing is made.
139
- if (isAway && !isListening)
140
- return false;
141
- return true;
161
+ function isListenerConsuming(lastHeartbeatMs,
162
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
163
+ _isAway,
164
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
165
+ _isListening, now = Date.now()) {
166
+ /*
167
+ * A live heartbeat, and nothing else.
168
+ *
169
+ * The two flags are still taken so that every call site keeps compiling and
170
+ * keeps reading as a question about a specific listener, and so that the one
171
+ * place that genuinely needs isListening, getLanguagesWithActiveListeners,
172
+ * does not have to change shape. They are deliberately ignored: see the
173
+ * 2026-08-31 block above for why a hidden reader now counts.
174
+ *
175
+ * Heard nothing for ninety seconds is still not consuming. That is the
176
+ * genuinely unknown case, and it is what a closed tab looks like when its
177
+ * leave beacon never fired.
178
+ */
179
+ return now - lastHeartbeatMs <= exports.LISTENER_PRESENT_MS;
142
180
  }
143
181
  exports.isListenerConsuming = isListenerConsuming;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulingai-npm/redis",
3
- "version": "3.44.2",
3
+ "version": "3.44.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {