hedgequantx 2.5.18 → 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 +1 -1
- package/src/menus/ai-agent.js +37 -9
package/package.json
CHANGED
package/src/menus/ai-agent.js
CHANGED
|
@@ -46,7 +46,9 @@ const aiAgentMenu = async () => {
|
|
|
46
46
|
// List all agents
|
|
47
47
|
for (let i = 0; i < agents.length; i++) {
|
|
48
48
|
const agent = agents[i];
|
|
49
|
-
|
|
49
|
+
// Show ACTIVE marker (if single agent, it's always active)
|
|
50
|
+
const isActive = agent.isActive || agents.length === 1;
|
|
51
|
+
const activeMarker = isActive ? chalk.green(' [ACTIVE]') : '';
|
|
50
52
|
const providerColor = agent.providerId === 'anthropic' ? chalk.magenta :
|
|
51
53
|
agent.providerId === 'openai' ? chalk.green :
|
|
52
54
|
agent.providerId === 'openrouter' ? chalk.yellow : chalk.cyan;
|
|
@@ -62,20 +64,46 @@ const aiAgentMenu = async () => {
|
|
|
62
64
|
|
|
63
65
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|
|
64
66
|
|
|
65
|
-
// Menu
|
|
66
|
-
|
|
67
|
+
// Menu in 2 columns
|
|
68
|
+
const colWidth = Math.floor(W / 2);
|
|
67
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
|
|
68
94
|
if (agentCount > 0) {
|
|
69
|
-
console.log(makeLine(chalk.cyan('[S] SET ACTIVE AGENT')));
|
|
70
|
-
console.log(makeLine(chalk.yellow('[M] CHANGE MODEL')));
|
|
71
|
-
console.log(makeLine(chalk.red('[R] REMOVE AGENT')));
|
|
72
95
|
if (agentCount > 1) {
|
|
73
|
-
|
|
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));
|
|
74
102
|
}
|
|
103
|
+
} else {
|
|
104
|
+
menuRow2(menuItem('+', 'ADD AGENT', chalk.green), menuItem('<', 'BACK', chalk.gray));
|
|
75
105
|
}
|
|
76
106
|
|
|
77
|
-
console.log(makeLine(chalk.gray('[<] BACK')));
|
|
78
|
-
|
|
79
107
|
drawBoxFooter(boxWidth);
|
|
80
108
|
|
|
81
109
|
const choice = await prompts.textInput(chalk.cyan('SELECT:'));
|