bingocode 1.1.170 → 1.1.171

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingocode",
3
- "version": "1.1.170",
3
+ "version": "1.1.171",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -28,8 +28,13 @@ process.on('exit', () => {
28
28
  try { fs.unlinkSync(DAEMON_LOCK_FILE); } catch {}
29
29
  });
30
30
 
31
- // Tray icon: hexagon black-gold with "B" initial (16x16 RGBA PNG, pre-encoded)
32
- const iconB64 = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAS0lEQVR4nGNgGLRAQUHhPzKmSDPRhiAr/n/AAAXjNQjdJnTN2AxBMQibRnyGEW0AMk2WAfR3AbJB+FxFVGyQFI1US0j4DCFJM10BADtB9/MMO0W9AAAAAElFTkSuQmCC';
31
+ // Tray icon: Windows=ICO, others=PNG
32
+ const _iconExt = process.platform === 'win32' ? 'ico' : 'png';
33
+ const _iconFile = path.join(ROOT_DIR, 'assets', `tray-icon.${_iconExt}`);
34
+ const _iconFallback = 'AAABAAEAEBAAAAEAIACEAAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAEtJREFUeJxjYBi0QEFB4T8ypkgz0YYgK/5/wAAF4zUI3SZ0zdgMQTEIm0Z8hhFtADJNlgH0dwGyQfhcRVRskBSNVEtI+AwhSTNdAQA7QffzDDtFvQAAAABJRU5ErkJggg==';
35
+ const iconB64 = fs.existsSync(_iconFile)
36
+ ? fs.readFileSync(_iconFile).toString('base64')
37
+ : _iconFallback;
33
38
 
34
39
  try {
35
40
  const systray = new SysTray({
@@ -57,19 +62,18 @@ try {
57
62
  });
58
63
 
59
64
  systray.onClick((action: any) => {
60
- if (action.seq_id === 1) {
65
+ // items __id: "Server Running"=1, "Exit Bingo"=2
66
+ if (action.seq_id === 2) {
61
67
  console.log('[tray] Exiting via tray menu');
62
68
  const req = http.request(
63
69
  `http://${HOST}:${PORT}/exit`,
64
70
  { method: 'POST', timeout: 5000 },
65
- (res) => {
66
- res.resume();
67
- try { systray.kill(false); } catch {}
68
- process.exit(0);
69
- },
71
+ () => {},
70
72
  );
71
73
  req.on('error', () => {
72
- try { systray.kill(false); } catch {}
74
+ try {
75
+ systray.kill(false);
76
+ } catch {}
73
77
  process.exit(0);
74
78
  });
75
79
  req.end();