hedgequantx 2.5.2 → 2.5.4
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 +1 -1
- package/src/menus/dashboard.js +10 -17
- package/src/ui/box.js +5 -8
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -52,36 +52,29 @@ const dashboardMenu = async (service) => {
|
|
|
52
52
|
const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString()}` : '--';
|
|
53
53
|
const balColor = statsInfo.balance !== null ? chalk.green : chalk.gray;
|
|
54
54
|
|
|
55
|
-
let pnlDisplay, pnlColor;
|
|
56
|
-
if (statsInfo.pnl !== null) {
|
|
57
|
-
pnlColor = statsInfo.pnl >= 0 ? chalk.green : chalk.red;
|
|
58
|
-
pnlDisplay = `${statsInfo.pnl >= 0 ? '+' : ''}$${Math.abs(statsInfo.pnl).toLocaleString()}`;
|
|
59
|
-
} else {
|
|
60
|
-
pnlColor = chalk.gray;
|
|
61
|
-
pnlDisplay = '--';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
55
|
// AI status
|
|
65
56
|
const aiConnection = aiService.getConnection();
|
|
66
57
|
const aiStatus = aiConnection
|
|
67
58
|
? aiConnection.provider.name.split(' ')[0] // Just "CLAUDE" or "OPENAI"
|
|
68
59
|
: null;
|
|
69
60
|
|
|
70
|
-
//
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
const
|
|
61
|
+
// Build stats line with simple ASCII icons (+ for connected, - for not)
|
|
62
|
+
const statsContent = `+ CONNECTIONS: ${statsInfo.connections} + ACCOUNTS: ${statsInfo.accounts} + BALANCE: ${balStr} ${aiStatus ? '+' : '-'} AI: ${aiStatus || 'NONE'}`;
|
|
63
|
+
const statsLen = statsContent.length;
|
|
64
|
+
const statsLeftPad = Math.max(0, Math.floor((W - statsLen) / 2));
|
|
65
|
+
const statsRightPad = Math.max(0, W - statsLen - statsLeftPad);
|
|
74
66
|
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
const
|
|
67
|
+
// Now build with colors (use same text so length matches)
|
|
68
|
+
const icon = chalk.yellow('+ ');
|
|
69
|
+
const aiIcon = aiStatus ? chalk.magenta('+ ') : chalk.gray('- ');
|
|
70
|
+
const aiText = aiStatus ? chalk.magenta(aiStatus) : chalk.gray('NONE');
|
|
78
71
|
|
|
79
72
|
console.log(chalk.cyan('║') + ' '.repeat(statsLeftPad) +
|
|
80
73
|
icon + chalk.white(`CONNECTIONS: ${statsInfo.connections}`) + ' ' +
|
|
81
74
|
icon + chalk.white(`ACCOUNTS: ${statsInfo.accounts}`) + ' ' +
|
|
82
75
|
icon + chalk.white('BALANCE: ') + balColor(balStr) + ' ' +
|
|
83
76
|
aiIcon + chalk.white('AI: ') + aiText +
|
|
84
|
-
' '.repeat(
|
|
77
|
+
' '.repeat(statsRightPad) + chalk.cyan('║'));
|
|
85
78
|
}
|
|
86
79
|
|
|
87
80
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|
package/src/ui/box.js
CHANGED
|
@@ -11,22 +11,19 @@ let logoWidth = null;
|
|
|
11
11
|
/**
|
|
12
12
|
* Get logo width for consistent box sizing
|
|
13
13
|
* Adapts to terminal width for mobile devices
|
|
14
|
+
* Returns 98 for desktop to match the full HEDGEQUANTX logo width
|
|
14
15
|
*/
|
|
15
16
|
const getLogoWidth = () => {
|
|
16
|
-
const termWidth = process.stdout.columns ||
|
|
17
|
+
const termWidth = process.stdout.columns || 100;
|
|
17
18
|
|
|
18
19
|
// Mobile: use terminal width
|
|
19
20
|
if (termWidth < 60) {
|
|
20
21
|
return Math.max(termWidth - 2, 40);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
// Desktop:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const lines = logoText.split('\n').filter(line => line.trim().length > 0);
|
|
27
|
-
logoWidth = Math.max(...lines.map(line => line.length)) + 4;
|
|
28
|
-
}
|
|
29
|
-
return Math.min(logoWidth, termWidth - 2);
|
|
24
|
+
// Desktop: fixed width of 98 to match banner
|
|
25
|
+
// Logo line = 86 chars (HEDGEQUANT) + 8 chars (X) + 2 borders = 96, round to 98
|
|
26
|
+
return Math.min(98, termWidth - 2);
|
|
30
27
|
};
|
|
31
28
|
|
|
32
29
|
/**
|