hedgequantx 2.5.28 → 2.5.29

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.28",
3
+ "version": "2.5.29",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -181,17 +181,39 @@ const showAgentDetails = async (agent) => {
181
181
 
182
182
  console.log(makeLine(chalk.white('NAME: ') + providerColor(agent.name)));
183
183
  console.log(makeLine(chalk.white('PROVIDER: ') + chalk.white(agent.provider?.name || agent.providerId)));
184
- console.log(makeLine(chalk.white('MODEL: ') + chalk.white(agent.model)));
184
+ console.log(makeLine(chalk.white('MODEL: ') + chalk.white(agent.model || 'N/A')));
185
185
  console.log(makeLine(chalk.white('STATUS: ') + (agent.isActive ? chalk.green('ACTIVE') : chalk.white('STANDBY'))));
186
186
 
187
187
  console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
188
188
 
189
+ // Menu in 2 columns
190
+ const colWidth = Math.floor(W / 2);
191
+
192
+ const menuRow = (col1, col2 = '') => {
193
+ const c1Plain = col1.replace(/\x1b\[[0-9;]*m/g, '');
194
+ const c2Plain = col2.replace(/\x1b\[[0-9;]*m/g, '');
195
+
196
+ const pad1Left = Math.floor((colWidth - c1Plain.length) / 2);
197
+ const pad1Right = colWidth - c1Plain.length - pad1Left;
198
+
199
+ const col2Width = W - colWidth;
200
+ const pad2Left = Math.floor((col2Width - c2Plain.length) / 2);
201
+ const pad2Right = col2Width - c2Plain.length - pad2Left;
202
+
203
+ const line =
204
+ ' '.repeat(pad1Left) + col1 + ' '.repeat(pad1Right) +
205
+ ' '.repeat(pad2Left) + col2 + ' '.repeat(pad2Right);
206
+
207
+ console.log(chalk.cyan('║') + line + chalk.cyan('║'));
208
+ };
209
+
189
210
  if (!agent.isActive) {
190
- console.log(makeLine(chalk.cyan('[A] SET AS ACTIVE')));
211
+ menuRow(chalk.cyan('[A] SET AS ACTIVE'), chalk.yellow('[M] CHANGE MODEL'));
212
+ menuRow(chalk.red('[R] REMOVE'), chalk.white('[<] BACK'));
213
+ } else {
214
+ menuRow(chalk.yellow('[M] CHANGE MODEL'), chalk.red('[R] REMOVE'));
215
+ menuRow(chalk.white('[<] BACK'), '');
191
216
  }
192
- console.log(makeLine(chalk.yellow('[M] CHANGE MODEL')));
193
- console.log(makeLine(chalk.red('[R] REMOVE')));
194
- console.log(makeLine(chalk.white('[<] BACK')));
195
217
 
196
218
  drawBoxFooter(boxWidth);
197
219