hedgequantx 2.9.217 → 2.9.219

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": "hedgequantx",
3
- "version": "2.9.217",
3
+ "version": "2.9.219",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -11,6 +11,7 @@ const { getLogoWidth, centerText, prepareStdin, displayBanner, clearScreen } = r
11
11
  const { getCachedStats } = require('../services/stats-cache');
12
12
  const { prompts } = require('../utils');
13
13
  const { getActiveAgentCount } = require('../pages/ai-agents');
14
+ const { isDaemonRunning } = require('../services/daemon');
14
15
 
15
16
  /**
16
17
  * Dashboard menu after login
@@ -67,27 +68,34 @@ const dashboardMenu = async (service) => {
67
68
  const agentDisplay = agentCount > 0 ? 'ON' : 'OFF';
68
69
  const agentColor = agentCount > 0 ? chalk.green : chalk.red;
69
70
 
70
- // Fixed width columns for alignment (3 columns)
71
- const icon = chalk.yellow('✔ ');
72
- const colWidth = Math.floor(W / 3);
71
+ // Daemon status
72
+ const daemonOn = isDaemonRunning();
73
+ const daemonDisplay = daemonOn ? 'ON' : 'OFF';
74
+ const daemonColor = daemonOn ? chalk.green : chalk.red;
73
75
 
74
- const formatCol = (label, value, valueColor = chalk.white) => {
75
- const text = `✔ ${label}: ${value}`;
76
- const textLen = text.length;
77
- const padLeft = Math.floor((colWidth - textLen) / 2);
78
- const padRight = colWidth - textLen - padLeft;
79
- return ' '.repeat(Math.max(0, padLeft)) + icon + chalk.white(label + ': ') + valueColor(value) + ' '.repeat(Math.max(0, padRight));
80
- };
76
+ // Build stats items
77
+ const icon = chalk.yellow('✔');
78
+ const items = [
79
+ { label: 'Accounts', value: String(statsInfo.accounts), color: chalk.white },
80
+ { label: 'Balance', value: balStr, color: balColor },
81
+ { label: 'Daemon', value: daemonDisplay, color: daemonColor },
82
+ { label: 'AI', value: agentDisplay, color: agentColor },
83
+ ];
81
84
 
82
- const col1 = formatCol('Accounts', String(statsInfo.accounts));
83
- const col2 = formatCol('Balance', balStr, balColor);
84
- const col3 = formatCol('AI Agents', agentDisplay, agentColor);
85
+ // Format: "✔ Label: Value" with consistent spacing
86
+ const formatted = items.map(item =>
87
+ `${icon} ${chalk.white(item.label + ':')} ${item.color(item.value)}`
88
+ );
85
89
 
86
- const statsLine = col1 + col2 + col3;
87
- const statsPlainLen = statsLine.replace(/\x1b\[[0-9;]*m/g, '').length;
88
- const extraPad = W - statsPlainLen;
90
+ // Join with consistent gaps and center the whole line
91
+ const gap = ' '; // 4 spaces between items
92
+ const statsContent = formatted.join(gap);
93
+ const statsPlainLen = statsContent.replace(/\x1b\[[0-9;]*m/g, '').length;
94
+ const totalPad = W - statsPlainLen;
95
+ const padLeft = Math.floor(totalPad / 2);
96
+ const padRight = totalPad - padLeft;
89
97
 
90
- console.log(chalk.cyan('║') + statsLine + ' '.repeat(Math.max(0, extraPad)) + chalk.cyan('║'));
98
+ console.log(chalk.cyan('║') + ' '.repeat(padLeft) + statsContent + ' '.repeat(padRight) + chalk.cyan('║'));
91
99
  }
92
100
 
93
101
  console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));