hedgequantx 2.5.30 → 2.5.32

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.5.30",
3
+ "version": "2.5.32",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -24,6 +24,7 @@ const dashboardMenu = async (service) => {
24
24
 
25
25
  // Check AI connection status
26
26
  const aiConnected = aiService.isConnected();
27
+ const aiAgentCount = aiService.getAgentCount();
27
28
 
28
29
  const makeLine = (content, align = 'left') => {
29
30
  const plainLen = content.replace(/\x1b\[[0-9;]*m/g, '').length;
@@ -57,8 +58,10 @@ const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString
57
58
  const balColor = statsInfo.balance !== null ? chalk.green : chalk.gray;
58
59
 
59
60
  // Build plain text for length calculation
60
- // Format: "✔ CONNECTIONS: X ✔ ACCOUNTS: X ✔ BALANCE: $X ✔ AI: CONNECTED"
61
- const aiText = aiConnected ? 'CONNECTED' : 'NONE';
61
+ // Format: "✔ CONNECTIONS: X ✔ ACCOUNTS: X ✔ BALANCE: $X ✔ AI: X AGENT(S)"
62
+ const aiText = aiAgentCount > 0
63
+ ? `${aiAgentCount} AGENT${aiAgentCount > 1 ? 'S' : ''}`
64
+ : 'NONE';
62
65
  const plainText = `* CONNECTIONS: ${statsInfo.connections} * ACCOUNTS: ${statsInfo.accounts} * BALANCE: ${balStr} * AI: ${aiText}`;
63
66
  const statsLen = plainText.length;
64
67
  const statsLeftPad = Math.max(0, Math.floor((W - statsLen) / 2));
@@ -66,8 +69,10 @@ const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString
66
69
 
67
70
  // Build with unicode icons and colors
68
71
  const checkIcon = chalk.yellow('✔ ');
69
- const aiIcon = aiConnected ? chalk.magenta('✔ ') : chalk.gray('○ ');
70
- const aiTextColored = aiConnected ? chalk.magenta('CONNECTED') : chalk.gray('NONE');
72
+ const aiIcon = aiAgentCount > 0 ? chalk.magenta('✔ ') : chalk.gray('○ ');
73
+ const aiTextColored = aiAgentCount > 0
74
+ ? chalk.magenta(`${aiAgentCount} AGENT${aiAgentCount > 1 ? 'S' : ''}`)
75
+ : chalk.gray('NONE');
71
76
 
72
77
  console.log(chalk.cyan('║') + ' '.repeat(statsLeftPad) +
73
78
  checkIcon + chalk.white(`CONNECTIONS: ${statsInfo.connections}`) + ' ' +
@@ -426,11 +426,17 @@ const showStats = async (service) => {
426
426
  const supervisedAccounts = supervisionData.totalAccounts;
427
427
  const supervisedPnL = supervisionData.totalPnL;
428
428
 
429
- console.log(chalk.cyan('\u2551') + fmtRow('CONNECTED AGENTS:', chalk.green(String(aiAgents.length)), col1) + chalk.cyan('\u2502') + fmtRow('SUPERVISED ACCOUNTS:', supervisedAccounts > 0 ? chalk.white(String(supervisedAccounts)) : chalk.gray('0'), col2) + chalk.cyan('\u2551'));
430
- console.log(chalk.cyan('\u2551') + fmtRow('MODE:', modeColor(agentMode), col1) + chalk.cyan('\u2502') + fmtRow('SUPERVISED P&L:', supervisedPnL !== 0 ? (supervisedPnL >= 0 ? chalk.green('$' + supervisedPnL.toFixed(2)) : chalk.red('$' + supervisedPnL.toFixed(2))) : chalk.gray('$0.00'), col2) + chalk.cyan('\u2551'));
431
- console.log(chalk.cyan('\u2551') + fmtRow('ACTIVE:', activeAgent ? chalk.green(activeAgent.name) : chalk.gray('NONE'), col1) + chalk.cyan('\u2502') + fmtRow('POSITIONS:', chalk.white(String(supervisionData.totalPositions)), col2) + chalk.cyan('\u2551'));
432
- console.log(chalk.cyan('\u2551') + fmtRow('SESSION TIME:', chalk.white(sessionTimeStr), col1) + chalk.cyan('\u2502') + fmtRow('OPEN ORDERS:', chalk.white(String(supervisionData.totalOrders)), col2) + chalk.cyan('\u2551'));
433
- console.log(chalk.cyan('\u2551') + fmtRow('AGENTS:', chalk.gray(agentNames.substring(0, col1 - 10)), col1) + chalk.cyan('\u2502') + fmtRow('TRADES TODAY:', chalk.white(String(supervisionData.totalTrades)), col2) + chalk.cyan('\u2551'));
429
+ // Calculate max agent name length to fit in column (label=18 + space=1 + padding buffer)
430
+ const maxAgentNameLen = col1 - 20;
431
+ const agentNamesDisplay = agentNames.length > maxAgentNameLen
432
+ ? agentNames.substring(0, maxAgentNameLen - 2) + '..'
433
+ : agentNames;
434
+
435
+ console.log(chalk.cyan('\u2551') + fmtRow('CONNECTED AGENTS:', chalk.green(String(aiAgents.length)), col1) + chalk.cyan('\u2502') + fmtRow('SUPERVISED ACCOUNTS:', chalk.white(String(supervisedAccounts)), col2) + chalk.cyan('\u2551'));
436
+ console.log(chalk.cyan('\u2551') + fmtRow('MODE:', modeColor(agentMode), col1) + chalk.cyan('\u2502') + fmtRow('SUPERVISED P&L:', supervisedPnL >= 0 ? chalk.green('$' + supervisedPnL.toFixed(2)) : chalk.red('$' + supervisedPnL.toFixed(2)), col2) + chalk.cyan('\u2551'));
437
+ console.log(chalk.cyan('\u2551') + fmtRow('ACTIVE:', activeAgent ? chalk.green(activeAgent.name) : chalk.white('NONE'), col1) + chalk.cyan('\u2502') + fmtRow('POSITIONS:', chalk.white(String(supervisionData.totalPositions)), col2) + chalk.cyan('\u2551'));
438
+ console.log(chalk.cyan('\u2551') + fmtRow('SESSION TIME:', sessionTimeStr === 'INACTIVE' ? chalk.yellow(sessionTimeStr) : chalk.white(sessionTimeStr), col1) + chalk.cyan('\u2502') + fmtRow('OPEN ORDERS:', chalk.white(String(supervisionData.totalOrders)), col2) + chalk.cyan('\u2551'));
439
+ console.log(chalk.cyan('\u2551') + fmtRow('AGENTS:', chalk.white(agentNamesDisplay), col1) + chalk.cyan('\u2502') + fmtRow('TRADES TODAY:', chalk.white(String(supervisionData.totalTrades)), col2) + chalk.cyan('\u2551'));
434
440
 
435
441
  drawBoxFooter(boxWidth);
436
442
  }