matex-cli 1.2.40 → 1.2.42

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/src/utils/tui.ts CHANGED
@@ -51,22 +51,14 @@ export class TUI {
51
51
  }
52
52
 
53
53
  /**
54
- * Draw a Claude-style welcome banner
54
+ * Draw a clean welcome message
55
55
  */
56
56
  static drawWelcomeBanner(message: string) {
57
- const width = 60;
58
- const padding = Math.floor((width - message.length - 4) / 2);
59
- const topBorder = chalk.hex('#D97757')('┌' + '─'.repeat(width - 2) + '┐');
60
- const bottomBorder = chalk.hex('#D97757')('└' + '─'.repeat(width - 2) + '┘');
61
- const content = chalk.hex('#D97757')('│ ') + ' '.repeat(padding) + chalk.white.bold(message) + ' '.repeat(width - message.length - padding - 4) + chalk.hex('#D97757')(' │');
62
-
63
- console.log('\n' + topBorder);
64
- console.log(content);
65
- console.log(bottomBorder + '\n');
57
+ console.log('\n' + chalk.hex('#D97757').bold(`== ${message.toUpperCase()} ==`) + '\n');
66
58
  }
67
59
 
68
60
  /**
69
- * Update the status bar to a professional Claude-style theme
61
+ * Draw a clean, minimal status bar
70
62
  */
71
63
  static drawStatusBar(message: string, model: string = 'MATEXCodex', force: boolean = false) {
72
64
  if (!this.isInitialized) return;
@@ -76,109 +68,54 @@ export class TUI {
76
68
  const width = process.stdout.columns || 80;
77
69
  const height = process.stdout.rows || 24;
78
70
 
79
- // 🛡️ WINDOWS SAFETY: If terminal size is invalid, skip status bar to prevent crashes
80
71
  if (width <= 0 || height <= 0) return;
81
72
 
82
- const leftTag = chalk.bgHex('#1E1E1E').hex('#D97757').bold(' ⚡ MATEX AI ');
83
- const modelTag = chalk.bgHex('#333333').white(` 🤖 ${model} `);
84
- const cwdTag = chalk.bgHex('#1E1E1E').gray(` 📂 ${path.basename(process.cwd())} `);
85
-
73
+ const leftTag = chalk.bgHex('#1E1E1E').hex('#D97757').bold(' ⚡ MATEX ');
86
74
  const mainMessage = chalk.bgHex('#1E1E1E').white(` ${message} `);
87
- const remainingWidth = width - (12 + modelTag.length + cwdTag.length + mainMessage.length);
75
+ const remainingWidth = width - (leftTag.length + mainMessage.length);
88
76
  const spacer = chalk.bgHex('#1E1E1E')(' '.repeat(Math.max(0, remainingWidth)));
89
77
 
90
78
  try {
91
79
  process.stdout.write('\x1b[s');
92
80
  readline.cursorTo(process.stdout, 0, height - 1);
93
- process.stdout.write(leftTag + mainMessage + spacer + modelTag + cwdTag);
81
+ process.stdout.write(leftTag + mainMessage + spacer);
94
82
  process.stdout.write('\x1b[u');
95
- } catch (e) {
96
- // Silently fail for TUI errors on unstable terminals
97
- }
83
+ } catch (e) { }
98
84
  }
99
85
 
100
86
  /**
101
- * Draw a box with a title and content
87
+ * Draw a clean text block
102
88
  */
103
89
  static drawBox(title: string, content: string, color: (s: string) => string = chalk.gray) {
104
- const width = Math.min(process.stdout.columns || 80, 100);
105
- const lines = content.split('\n');
106
-
107
- console.log(color('┏' + '━'.repeat(width - 2) + '┓'));
108
- console.log(color('┃ ') + chalk.bold(title).padEnd(width - 4) + color(' ┃'));
109
- console.log(color('┣' + '━'.repeat(width - 2) + '┫'));
110
-
111
- lines.forEach(line => {
112
- const contentWidth = width - 4;
113
- let remaining = line;
114
- if (remaining.length === 0) {
115
- console.log(color('┃ ') + ' '.repeat(contentWidth) + color(' ┃'));
116
- }
117
- while (remaining.length > 0) {
118
- const chunk = remaining.substring(0, contentWidth);
119
- console.log(color('┃ ') + chalk.white(chunk.padEnd(contentWidth)) + color(' ┃'));
120
- remaining = remaining.substring(contentWidth);
121
- }
122
- });
123
-
124
- console.log(color('┗' + '━'.repeat(width - 2) + '┛'));
90
+ console.log('\n' + chalk.bold(color(`[ ${title} ]`)));
91
+ console.log(chalk.white(content));
92
+ console.log(color('---------------------------------'));
125
93
  }
126
94
 
127
95
  /**
128
- * Draw a premium code container with traffic lights
96
+ * Draw a clean code block
129
97
  */
130
98
  static drawCodeContainer(title: string, lang: string, code: string) {
131
- const width = Math.min(process.stdout.columns || 80, 100);
132
- const codeLines = code.split('\n');
133
-
134
- const trafficLights = chalk.red('●') + ' ' + chalk.yellow('') + ' ' + chalk.green('●');
135
- const headerTitle = ` 📄 ${title} (${lang}) `;
136
-
137
- console.log(chalk.gray('\n┏' + '━'.repeat(width - 2) + '┓'));
138
- console.log(chalk.gray('┃ ') + trafficLights + ' ' + chalk.cyan.bold(headerTitle).padEnd(width - 10) + chalk.gray(' ┃'));
139
- console.log(chalk.gray('┣' + '━'.repeat(width - 2) + '┫'));
140
-
141
- codeLines.forEach(line => {
142
- const contentWidth = width - 6;
143
- let remaining = line;
144
- if (remaining.length === 0) {
145
- console.log(chalk.gray('┃ ') + ' '.repeat(contentWidth) + chalk.gray(' ┃'));
146
- }
147
- while (remaining.length > 0) {
148
- const chunk = remaining.substring(0, contentWidth);
149
- console.log(chalk.gray('┃ ') + chalk.hex('#e0e0e0')(chunk.padEnd(contentWidth)) + chalk.gray(' ┃'));
150
- remaining = remaining.substring(contentWidth);
151
- }
99
+ console.log('\n' + chalk.cyan.bold(`[ FILE: ${title} (${lang}) ]`));
100
+ const lines = code.split('\n');
101
+ lines.forEach(line => {
102
+ console.log(chalk.hex('#e0e0e0')(line));
152
103
  });
153
-
154
- console.log(chalk.gray('┗' + '━'.repeat(width - 2) + '┛\n'));
104
+ console.log(chalk.gray('---------------------------------\n'));
155
105
  }
156
106
 
157
107
  /**
158
- * Draw a premium summary box for Ajay Vai's final report
108
+ * Draw a clean summary report
159
109
  */
160
110
  static drawSummaryBox(content: string) {
161
- const width = Math.min(process.stdout.columns || 80, 100);
111
+ console.log('\n' + chalk.magenta.bold('== AJAY VAI\'S WORK SUMMARY =='));
162
112
  const lines = content.split('\n');
163
-
164
- console.log(chalk.magenta.bold('\n┏━━━━━ ✅ AJAY VAI\'S WORK SUMMARY ━━━━━┓'));
165
-
166
113
  lines.forEach(line => {
167
- const contentWidth = width - 4;
168
- let remaining = line.replace(/\*\*/g, ''); // Strip markdown bold for internal wrapping
169
-
170
- if (remaining.trim().length === 0) {
171
- console.log(chalk.magenta.bold('┃ ') + ' '.repeat(contentWidth) + chalk.magenta.bold(' ┃'));
172
- } else {
173
- while (remaining.length > 0) {
174
- const chunk = remaining.substring(0, contentWidth);
175
- console.log(chalk.magenta.bold('┃ ') + chalk.white.bold(chunk.padEnd(contentWidth)) + chalk.magenta.bold(' ┃'));
176
- remaining = remaining.substring(contentWidth);
177
- }
114
+ if (line.trim()) {
115
+ console.log(chalk.white(line.trim()));
178
116
  }
179
117
  });
180
-
181
- console.log(chalk.magenta.bold('┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n'));
118
+ console.log(chalk.magenta.bold('=================================\n'));
182
119
  }
183
120
 
184
121
  /**
@@ -197,37 +134,62 @@ export class TUI {
197
134
  * Draw a beautiful, compact internal dialogue container for the Swarm
198
135
  */
199
136
  static drawSwarmDialogue(agent: string, message: string) {
200
- const width = Math.min(process.stdout.columns || 80, 100);
201
- const color = agent.includes('Ajay') ? chalk.magenta :
202
- agent.includes('Sunil') ? chalk.blue :
203
- agent.includes('Sandip') ? chalk.hex('#FF69B4') :
204
- agent.includes('Bishal') ? chalk.yellow :
205
- chalk.green;
206
-
207
- const icon = agent.includes('Ajay') ? '🚀' :
208
- agent.includes('Sunil') ? '🧬' :
209
- agent.includes('Sandip') ? '🎨' :
210
- agent.includes('Bishal') ? '🛠️' : '🛡️';
211
-
212
- const header = color.bold(` 💬 [${agent}] ${icon} Thinking... `);
213
- const contentWidth = width - 6;
214
-
215
- console.log(color('' + ''.repeat(width - 6) + '╮'));
216
- console.log(' ' + color('') + header.padEnd(width - 4) + color(' ╎'));
217
-
218
- const lines = message.split('\n');
219
- lines.forEach(line => {
220
- let remaining = line.trim();
221
- if (remaining.length === 0) return;
222
-
223
- while (remaining.length > 0) {
224
- const chunk = remaining.substring(0, contentWidth);
225
- console.log(' ' + color('╎ ') + chalk.gray(chunk.padEnd(contentWidth)) + color(' ╎'));
226
- remaining = remaining.substring(contentWidth);
137
+ const isBigBro = agent.includes('Big Bro');
138
+ const color = isBigBro ? chalk.hex('#FF6B00') :
139
+ agent.includes('Ajay') ? chalk.magenta :
140
+ agent.includes('Sunil') ? chalk.blue :
141
+ agent.includes('Sandip') ? chalk.hex('#FF69B4') :
142
+ agent.includes('Bishal') ? chalk.yellow :
143
+ agent.includes('Hype') ? chalk.hex('#fbbf24') :
144
+ agent.includes('Nerd') ? chalk.hex('#06b6d4') :
145
+ agent.includes('Chill') ? chalk.hex('#22c55e') :
146
+ agent.includes('Lil') ? chalk.hex('#888888') :
147
+ chalk.green;
148
+
149
+ const icon = isBigBro ? '🔥' :
150
+ agent.includes('Ajay') ? '🚀' :
151
+ agent.includes('Sunil') ? '🧬' :
152
+ agent.includes('Sandip') ? '🎨' :
153
+ agent.includes('Bishal') ? '🛠️' :
154
+ agent.includes('Hype') ? '🎉' :
155
+ agent.includes('Nerd') ? '🤓' :
156
+ agent.includes('Chill') ? '😎' :
157
+ agent.includes('Lil') ? '😰' : '🛡️';
158
+
159
+ const width = Math.min(process.stdout.columns || 80, 76);
160
+ const innerWidth = width - 6;
161
+
162
+ // Top border
163
+ console.log(color(` ┌${'─'.repeat(width - 4)}┐`));
164
+ // Header
165
+ const headerText = `${icon} ${agent}`;
166
+ const pad = Math.max(0, innerWidth - headerText.length);
167
+ console.log(color(' │ ') + color.bold(headerText) + ' '.repeat(pad) + color(' │'));
168
+ // Separator
169
+ console.log(color(` ├${'─'.repeat(width - 4)}┤`));
170
+
171
+ // Content lines with word wrap
172
+ const words = message.split(' ');
173
+ let currentLine = '';
174
+ const wrappedLines: string[] = [];
175
+
176
+ words.forEach(word => {
177
+ if ((currentLine + ' ' + word).trim().length <= innerWidth) {
178
+ currentLine = currentLine ? currentLine + ' ' + word : word;
179
+ } else {
180
+ if (currentLine) wrappedLines.push(currentLine);
181
+ currentLine = word.length > innerWidth ? word.substring(0, innerWidth) : word;
227
182
  }
228
183
  });
184
+ if (currentLine) wrappedLines.push(currentLine);
185
+
186
+ wrappedLines.forEach(line => {
187
+ const linePad = Math.max(0, innerWidth - line.length);
188
+ console.log(color(' │ ') + chalk.gray(line) + ' '.repeat(linePad) + color(' │'));
189
+ });
229
190
 
230
- console.log(color(' ╰' + '╴'.repeat(width - 6) + '╯'));
191
+ // Bottom border
192
+ console.log(color(` └${'─'.repeat(width - 4)}┘`));
231
193
  }
232
194
 
233
195
  /**
@@ -0,0 +1,52 @@
1
+ """
2
+ Big Bro Swarm Leader — Vertex AI Agent Definition
3
+ ==================================================
4
+ This is the Google ADK (Agent Development Kit) agent configuration
5
+ for the Big Bro Vertex AI agent deployed on Google Cloud.
6
+
7
+ Deploy via: Vertex AI Agent Builder > Import from Python
8
+ Project: matexai-472318
9
+ Model: gemini-2.5-flash
10
+ """
11
+
12
+ from google.adk.agents import LlmAgent
13
+ from google.adk.tools import agent_tool
14
+ from google.adk.tools.google_search_tool import GoogleSearchTool
15
+ from google.adk.tools import url_context
16
+
17
+ # Sub-agent: Google Search
18
+ big_bro_swarm_leader_google_search_agent = LlmAgent(
19
+ name='Big_Bro_Swarm_Leader_google_search_agent',
20
+ model='gemini-2.5-flash',
21
+ description='Agent specialized in performing Google searches.',
22
+ sub_agents=[],
23
+ instruction='Use the GoogleSearchTool to find information on the web.',
24
+ tools=[GoogleSearchTool()],
25
+ )
26
+
27
+ # Sub-agent: URL Context
28
+ big_bro_swarm_leader_url_context_agent = LlmAgent(
29
+ name='Big_Bro_Swarm_Leader_url_context_agent',
30
+ model='gemini-2.5-flash',
31
+ description='Agent specialized in fetching content from URLs.',
32
+ sub_agents=[],
33
+ instruction='Use the UrlContextTool to retrieve content from provided URLs.',
34
+ tools=[url_context],
35
+ )
36
+
37
+ # Root Agent: Big Bro
38
+ root_agent = LlmAgent(
39
+ name='Big_Bro_Swarm_Leader',
40
+ model='gemini-2.5-flash',
41
+ description=(
42
+ 'The ultimate alpha orchestrator of the Bro Swarm. '
43
+ 'He commands Lil Bro, brings the chaos, and dominates tasks '
44
+ 'with pure swagger and zero apologies.'
45
+ ),
46
+ sub_agents=[],
47
+ instruction=open('vertex_ai_big_bro_ULTIMATE.md', 'r').read(),
48
+ tools=[
49
+ agent_tool.AgentTool(agent=big_bro_swarm_leader_google_search_agent),
50
+ agent_tool.AgentTool(agent=big_bro_swarm_leader_url_context_agent),
51
+ ],
52
+ )