hedgequantx 2.7.0 → 2.7.2

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,11 +1,11 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.7.0",
3
+ "version": "2.7.2",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
7
- "hedgequantx": "./bin/cli.js",
8
- "hqx": "./bin/cli.js"
7
+ "hedgequantx": "bin/cli.js",
8
+ "hqx": "bin/cli.js"
9
9
  },
10
10
  "scripts": {
11
11
  "start": "node bin/cli.js",
@@ -51,18 +51,14 @@ const dashboardMenu = async (service) => {
51
51
  const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString()}` : '--';
52
52
  const balColor = statsInfo.balance !== null ? chalk.green : chalk.gray;
53
53
 
54
- let pnlDisplay, pnlColor;
55
- if (statsInfo.pnl !== null) {
56
- pnlColor = statsInfo.pnl >= 0 ? chalk.green : chalk.red;
57
- pnlDisplay = `${statsInfo.pnl >= 0 ? '+' : ''}$${Math.abs(statsInfo.pnl).toLocaleString()}`;
58
- } else {
59
- pnlColor = chalk.gray;
60
- pnlDisplay = '--';
61
- }
54
+ // AI Agents status
55
+ const agentCount = statsInfo.agents || 0;
56
+ const agentDisplay = agentCount > 0 ? `${agentCount} connected` : 'disconnected';
57
+ const agentColor = agentCount > 0 ? chalk.green : chalk.red;
62
58
 
63
59
  // Yellow icons: ✔ for each stat
64
60
  const icon = chalk.yellow('✔ ');
65
- const statsPlain = `✔ Connections: ${statsInfo.connections} ✔ Accounts: ${statsInfo.accounts} ✔ Balance: ${balStr} ✔ P&L: ${pnlDisplay}`;
61
+ const statsPlain = `✔ Connections: ${statsInfo.connections} ✔ Accounts: ${statsInfo.accounts} ✔ Balance: ${balStr} ✔ AI Agents: ${agentDisplay}`;
66
62
  const statsLeftPad = Math.floor((W - statsPlain.length) / 2);
67
63
  const statsRightPad = W - statsPlain.length - statsLeftPad;
68
64
 
@@ -70,19 +66,30 @@ const dashboardMenu = async (service) => {
70
66
  icon + chalk.white(`Connections: ${statsInfo.connections}`) + ' ' +
71
67
  icon + chalk.white(`Accounts: ${statsInfo.accounts}`) + ' ' +
72
68
  icon + chalk.white('Balance: ') + balColor(balStr) + ' ' +
73
- icon + chalk.white('P&L: ') + pnlColor(pnlDisplay) +
69
+ icon + chalk.white('AI Agents: ') + agentColor(agentDisplay) +
74
70
  ' '.repeat(Math.max(0, statsRightPad)) + chalk.cyan('║'));
75
71
  }
76
72
 
77
73
  console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
78
74
 
79
- // Menu in 2 columns
75
+ // Menu in 2 columns - centered
80
76
  const col1Width = Math.floor(W / 2);
77
+ const col2Width = W - col1Width;
78
+
81
79
  const menuRow = (left, right) => {
82
80
  const leftPlain = left.replace(/\x1b\[[0-9;]*m/g, '');
83
81
  const rightPlain = right.replace(/\x1b\[[0-9;]*m/g, '');
84
- const leftPadded = ' ' + left + ' '.repeat(Math.max(0, col1Width - leftPlain.length - 2));
85
- const rightPadded = right + ' '.repeat(Math.max(0, W - col1Width - rightPlain.length));
82
+
83
+ // Center left item in col1
84
+ const leftPadL = Math.floor((col1Width - leftPlain.length) / 2);
85
+ const leftPadR = col1Width - leftPlain.length - leftPadL;
86
+ const leftPadded = ' '.repeat(leftPadL) + left + ' '.repeat(leftPadR);
87
+
88
+ // Center right item in col2
89
+ const rightPadL = Math.floor((col2Width - rightPlain.length) / 2);
90
+ const rightPadR = col2Width - rightPlain.length - rightPadL;
91
+ const rightPadded = ' '.repeat(rightPadL) + right + ' '.repeat(rightPadR);
92
+
86
93
  console.log(chalk.cyan('║') + leftPadded + rightPadded + chalk.cyan('║'));
87
94
  };
88
95