@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.
@@ -30,7 +30,7 @@ export function createTokenQuotaPanelStore() {
30
30
  dimWhenIdle: false,
31
31
  musicEnabled: false,
32
32
  musicVolume: 0.5,
33
- musicStyle: 'major',
33
+ musicStyle: 'pentatonic',
34
34
  musicOnlyCurrentSession: true,
35
35
  upgrade: null,
36
36
  upgradeDismissed: false,
@@ -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
- req.on('close', () => { this.musicClients.delete(res); });
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
  }
@@ -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: 'major',
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.26",
4
+ "version": "0.1.28",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },