hedgequantx 2.5.33 → 2.5.35
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/pages/stats.js +22 -14
package/package.json
CHANGED
package/src/pages/stats.js
CHANGED
|
@@ -394,11 +394,13 @@ const showStats = async (service) => {
|
|
|
394
394
|
drawBoxHeader('AI SUPERVISION', boxWidth);
|
|
395
395
|
draw2ColHeader('AGENTS', 'PERFORMANCE', boxWidth);
|
|
396
396
|
|
|
397
|
-
// Agent
|
|
398
|
-
const
|
|
399
|
-
const
|
|
400
|
-
const
|
|
401
|
-
|
|
397
|
+
// Agent mode - INDIVIDUAL (1 agent) or CONSENSUS (2+ agents)
|
|
398
|
+
const isConsensusMode = aiAgents.length >= 2;
|
|
399
|
+
const agentMode = isConsensusMode ? 'CONSENSUS' : 'INDIVIDUAL';
|
|
400
|
+
const modeColor = isConsensusMode ? chalk.magenta : chalk.cyan;
|
|
401
|
+
|
|
402
|
+
// Get consensus data if in consensus mode
|
|
403
|
+
const consensusData = isConsensusMode ? AISupervisor.getConsensus() : null;
|
|
402
404
|
|
|
403
405
|
// Supervision metrics
|
|
404
406
|
let totalDecisions = 0;
|
|
@@ -438,23 +440,29 @@ const showStats = async (service) => {
|
|
|
438
440
|
{ label: 'TRADES TODAY:', value: chalk.white(String(supervisionData.totalTrades)) }
|
|
439
441
|
];
|
|
440
442
|
|
|
441
|
-
// Agents column data (left side) - each agent on its own line
|
|
443
|
+
// Agents column data (left side) - each agent on its own line with ● indicator
|
|
442
444
|
const agentsData = [
|
|
443
|
-
{ label: 'CONNECTED
|
|
445
|
+
{ label: 'CONNECTED:', value: chalk.green(String(aiAgents.length) + ' AGENT' + (aiAgents.length > 1 ? 'S' : '')) },
|
|
444
446
|
{ label: 'MODE:', value: modeColor(agentMode) },
|
|
445
|
-
{ label: 'SESSION
|
|
447
|
+
{ label: 'SESSION:', value: sessionTimeStr === 'INACTIVE' ? chalk.yellow(sessionTimeStr) : chalk.white(sessionTimeStr) }
|
|
446
448
|
];
|
|
447
449
|
|
|
448
|
-
// Add
|
|
450
|
+
// Add consensus info if in consensus mode
|
|
451
|
+
if (isConsensusMode && consensusData) {
|
|
452
|
+
const agreement = consensusData.agreement !== null
|
|
453
|
+
? Math.round(consensusData.agreement * 100) + '%'
|
|
454
|
+
: 'N/A';
|
|
455
|
+
const consensusAction = consensusData.action || 'PENDING';
|
|
456
|
+
agentsData.push({ label: 'CONSENSUS:', value: chalk.magenta(consensusAction + ' (' + agreement + ')') });
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// Add each agent as a separate line with ● indicator
|
|
449
460
|
aiAgents.forEach((agent, idx) => {
|
|
450
461
|
const agentLabel = idx === 0 ? 'AGENTS:' : '';
|
|
451
|
-
const isActive = activeAgent && agent.id === activeAgent.id;
|
|
452
462
|
const agentName = agent.name.length > maxAgentNameLen
|
|
453
|
-
? agent.name.substring(0, maxAgentNameLen -
|
|
463
|
+
? agent.name.substring(0, maxAgentNameLen - 4) + '..'
|
|
454
464
|
: agent.name;
|
|
455
|
-
const agentDisplay =
|
|
456
|
-
? chalk.green('● ') + chalk.green(agentName)
|
|
457
|
-
: chalk.white('○ ') + chalk.white(agentName);
|
|
465
|
+
const agentDisplay = chalk.green('● ') + chalk.white(agentName);
|
|
458
466
|
agentsData.push({ label: agentLabel, value: agentDisplay });
|
|
459
467
|
});
|
|
460
468
|
|