@jxgame2020/dsh-token-quota 0.1.26 → 0.1.28
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/lib/client.js +505 -305
- package/lib/index.js +10 -2
- package/lib/types/client/index.js +6 -1
- package/lib/types/client/locales.js +2 -2
- package/lib/types/client/music.d.ts +64 -49
- package/lib/types/client/music.js +314 -255
- package/lib/types/client/store.js +1 -1
- package/lib/types/index.js +15 -1
- package/lib/types/types.js +1 -1
- package/package.json +1 -1
package/lib/types/index.js
CHANGED
|
@@ -491,7 +491,21 @@ export class TokenQuotaService extends Service {
|
|
|
491
491
|
});
|
|
492
492
|
this.musicClients.add(res);
|
|
493
493
|
res.write(': token-quota music stream\n\n');
|
|
494
|
-
|
|
494
|
+
// Heartbeat: the client uses this to detect a dead stream and stop
|
|
495
|
+
// the soundtrack (a stuck drone is worse than no music). SSE comments
|
|
496
|
+
// don't fire client listeners, so send a named event.
|
|
497
|
+
const hb = setInterval(() => {
|
|
498
|
+
try {
|
|
499
|
+
res.write('event: hb\ndata: 1\n\n');
|
|
500
|
+
}
|
|
501
|
+
catch {
|
|
502
|
+
clearInterval(hb);
|
|
503
|
+
}
|
|
504
|
+
}, 5000);
|
|
505
|
+
req.on('close', () => {
|
|
506
|
+
clearInterval(hb);
|
|
507
|
+
this.musicClients.delete(res);
|
|
508
|
+
});
|
|
495
509
|
},
|
|
496
510
|
});
|
|
497
511
|
}
|
package/lib/types/types.js
CHANGED
|
@@ -28,7 +28,7 @@ export const TOKEN_QUOTA_MUSIC_STYLES = ['major', 'minor', 'pentatonic'];
|
|
|
28
28
|
export const TOKEN_QUOTA_DEFAULT_MUSIC = {
|
|
29
29
|
enabled: false,
|
|
30
30
|
volume: 0.5,
|
|
31
|
-
style: '
|
|
31
|
+
style: 'pentatonic',
|
|
32
32
|
onlyCurrentSession: true,
|
|
33
33
|
};
|
|
34
34
|
/** Build the stable per-model key shared by the counter, settings, and snapshot. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxgame2020/dsh-token-quota",
|
|
3
3
|
"description": "Daily per-model token quota accounting, enforcement, and a floating quota panel for the DeepSeek Harness — a fully self-contained plugin (no core-Harness wiring, no generated RPC contract)",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.28",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|