hedgequantx 2.5.19 → 2.5.20

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.19",
3
+ "version": "2.5.20",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -64,23 +64,46 @@ const aiAgentMenu = async () => {
64
64
 
65
65
  console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
66
66
 
67
- // Menu options
68
- console.log(makeLine(chalk.green('[+] ADD NEW AGENT')));
67
+ // Menu in 2 columns
68
+ const colWidth = Math.floor(W / 2);
69
69
 
70
+ const menuRow2 = (col1, col2 = '') => {
71
+ const c1Plain = col1.replace(/\x1b\[[0-9;]*m/g, '');
72
+ const c2Plain = col2.replace(/\x1b\[[0-9;]*m/g, '');
73
+
74
+ const pad1Left = Math.floor((colWidth - c1Plain.length) / 2);
75
+ const pad1Right = colWidth - c1Plain.length - pad1Left;
76
+
77
+ const col2Width = W - colWidth;
78
+ const pad2Left = Math.floor((col2Width - c2Plain.length) / 2);
79
+ const pad2Right = col2Width - c2Plain.length - pad2Left;
80
+
81
+ const line =
82
+ ' '.repeat(pad1Left) + col1 + ' '.repeat(pad1Right) +
83
+ ' '.repeat(pad2Left) + col2 + ' '.repeat(pad2Right);
84
+
85
+ console.log(chalk.cyan('║') + line + chalk.cyan('║'));
86
+ };
87
+
88
+ const menuItem = (key, label, color) => {
89
+ const text = `[${key}] ${label.padEnd(14)}`;
90
+ return color(text);
91
+ };
92
+
93
+ // Menu options in 2 columns
70
94
  if (agentCount > 0) {
71
- // Only show SET ACTIVE if more than 1 agent
72
- if (agentCount > 1) {
73
- console.log(makeLine(chalk.cyan('[S] SET ACTIVE AGENT')));
74
- }
75
- console.log(makeLine(chalk.yellow('[M] CHANGE MODEL')));
76
- console.log(makeLine(chalk.red('[R] REMOVE AGENT')));
77
95
  if (agentCount > 1) {
78
- console.log(makeLine(chalk.red('[X] REMOVE ALL')));
96
+ menuRow2(menuItem('+', 'ADD AGENT', chalk.green), menuItem('S', 'SET ACTIVE', chalk.cyan));
97
+ menuRow2(menuItem('M', 'CHANGE MODEL', chalk.yellow), menuItem('R', 'REMOVE AGENT', chalk.red));
98
+ menuRow2(menuItem('X', 'REMOVE ALL', chalk.red), menuItem('<', 'BACK', chalk.gray));
99
+ } else {
100
+ menuRow2(menuItem('+', 'ADD AGENT', chalk.green), menuItem('M', 'CHANGE MODEL', chalk.yellow));
101
+ menuRow2(menuItem('R', 'REMOVE AGENT', chalk.red), menuItem('<', 'BACK', chalk.gray));
79
102
  }
103
+ } else {
104
+ menuRow2(menuItem('+', 'ADD AGENT', chalk.green), menuItem('<', 'BACK', chalk.gray));
80
105
  }
81
106
 
82
- console.log(makeLine(chalk.gray('[<] BACK')));
83
-
84
107
  drawBoxFooter(boxWidth);
85
108
 
86
109
  const choice = await prompts.textInput(chalk.cyan('SELECT:'));