matex-cli 1.2.47 → 1.2.49

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
@@ -96,51 +96,110 @@ export class TUI {
96
96
  * Draw a premium glowing code container (turns cyan)
97
97
  */
98
98
  static drawGlowingContainer(title: string, language: string, content: string) {
99
- const width = Math.min(process.stdout.columns || 80, 100);
100
- const innerWidth = width - 4;
99
+ const width = 76;
100
+ const innerWidth = width - 8;
101
101
 
102
- // Premium Cyan Glow
103
102
  const glow = chalk.hex('#06b6d4');
104
- const bright = chalk.hex('#22d3ee');
105
- const dark = chalk.hex('#164e63');
103
+ const border = chalk.hex('#164e63');
104
+ const shadow = chalk.hex('#083344');
105
+
106
+ console.log('\n' + shadow(` ┌${'─'.repeat(width - 4)}┐`));
107
+ const header = ` ${title.toUpperCase()} • ${language} `;
108
+ const hPad = Math.max(0, width - 8 - header.length);
109
+ console.log(glow(' │ ') + chalk.bgHex('#164e63').white.bold(header) + border('─'.repeat(hPad)) + glow(' │'));
106
110
 
107
- console.log();
108
- // Top shadow/glow
109
- console.log(dark(` .${'·'.repeat(width - 4)}.`));
110
- // Header
111
- const headerText = ` ${title} [${language}] `;
112
- const headerPad = Math.max(0, innerWidth - headerText.length);
113
- console.log(glow(' ╭─') + bright.bold.bgHex('#083344')(headerText) + glow('─'.repeat(headerPad - 2)) + glow('╮'));
114
-
115
- // Content
116
111
  const lines = content.split('\n');
117
- // Limit display to 20 lines to keep it small/compact
118
- const displayLines = lines.length > 20 ? lines.slice(0, 18) : lines;
112
+ const displayLines = lines.length > 25 ? lines.slice(0, 23) : lines;
119
113
 
120
114
  displayLines.forEach(line => {
121
- // Trim to width
122
- const displayLine = line.length > innerWidth - 2 ? line.substring(0, innerWidth - 5) + '...' : line;
123
- const pad = Math.max(0, innerWidth - 2 - displayLine.length);
124
- console.log(glow(' │ ') + chalk.white(displayLine) + ' '.repeat(pad) + glow(' │'));
115
+ const displayLine = line.length > innerWidth ? line.substring(0, innerWidth - 3) + '...' : line;
116
+ const pad = Math.max(0, innerWidth - displayLine.length);
117
+ console.log(border(' │ ') + chalk.white(displayLine) + ' '.repeat(pad) + border(' │'));
125
118
  });
126
119
 
127
- if (lines.length > 20) {
128
- const hiddenText = chalk.italic.gray(`... ${lines.length - 18} more lines ...`);
129
- const pad = Math.max(0, innerWidth - 2 - (`... ${lines.length - 18} more lines ...`).length);
130
- console.log(glow(' │ ') + hiddenText + ' '.repeat(pad) + glow(' │'));
120
+ if (lines.length > 25) {
121
+ console.log(border(' │ ') + chalk.italic.gray(`... ${lines.length - 23} more lines ...`).padEnd(innerWidth) + border(' │'));
131
122
  }
132
123
 
133
- // Footer
134
- console.log(glow(' ╰' + '─'.repeat(innerWidth) + '╯'));
135
- console.log(dark(` '${'·'.repeat(width - 4)}'`));
136
- console.log();
124
+ console.log(shadow(` └${'─'.repeat(width - 4)}┘\n`));
125
+ }
126
+
127
+ /**
128
+ * Nebula Thinking Box: Starry background effect for deliberation
129
+ */
130
+ static drawThinkingBox(agent: string, thought: string) {
131
+ const width = Math.min(process.stdout.columns || 80, 70);
132
+ const innerWidth = width - 10;
133
+ const starColor = chalk.hex('#6366f1');
134
+ const nebulaColor = chalk.hex('#a855f7');
135
+
136
+ console.log('\n' + starColor(` ✧ . * . ✧ . * . ✧`));
137
+ console.log(nebulaColor(` ╭${'─'.repeat(width - 4)}╮`));
138
+ console.log(nebulaColor(' │ ') + nebulaColor.bold(`[ ${agent} is deliberating... ]`).padEnd(width - 6) + nebulaColor(' │'));
139
+ console.log(nebulaColor(' ├' + '╌'.repeat(width - 4) + '┤'));
140
+
141
+ const words = thought.split(' ');
142
+ let currentLine = '';
143
+ words.forEach(word => {
144
+ if ((currentLine + ' ' + word).trim().length <= innerWidth) {
145
+ currentLine = currentLine ? currentLine + ' ' + word : word;
146
+ } else {
147
+ if (currentLine) console.log(nebulaColor(' │ ') + chalk.italic.dim(currentLine.padEnd(innerWidth)) + nebulaColor(' │'));
148
+ currentLine = word;
149
+ }
150
+ });
151
+ if (currentLine) console.log(nebulaColor(' │ ') + chalk.italic.dim(currentLine.padEnd(innerWidth)) + nebulaColor(' │'));
152
+
153
+ console.log(nebulaColor(` ╰${'─'.repeat(width - 4)}╯`));
154
+ console.log(starColor(` * . ✧ . * . ✧ . *`));
155
+ }
156
+
157
+ /**
158
+ * Live Streaming: Start a technical block container
159
+ */
160
+ static drawStreamingStart(title: string, language: string) {
161
+ const width = 76;
162
+ const glow = chalk.hex('#06b6d4');
163
+ const border = chalk.hex('#164e63');
164
+ const shadow = chalk.hex('#083344');
165
+
166
+ console.log('\n' + shadow(` ┌${'─'.repeat(width - 4)}┐`));
167
+ const header = ` ${title.toUpperCase()} • ${language} `;
168
+ const hPad = Math.max(0, width - 8 - header.length);
169
+ console.log(glow(' │ ') + chalk.bgHex('#164e63').white.bold(header) + border('─'.repeat(hPad)) + glow(' │'));
170
+ }
171
+
172
+ /**
173
+ * Live Streaming: Add a line to the active container
174
+ */
175
+ static drawStreamingLine(content: string) {
176
+ const width = 76;
177
+ const innerWidth = width - 8;
178
+ const border = chalk.hex('#164e63');
179
+
180
+ // Handle multi-line content if passed
181
+ const lines = content.split('\n');
182
+ lines.forEach(line => {
183
+ const displayLine = line.length > innerWidth ? line.substring(0, innerWidth - 3) + '...' : line;
184
+ const pad = Math.max(0, innerWidth - displayLine.length);
185
+ console.log(border(' │ ') + chalk.white(displayLine) + ' '.repeat(pad) + border(' │'));
186
+ });
187
+ }
188
+
189
+ /**
190
+ * Live Streaming: Close the container
191
+ */
192
+ static drawStreamingEnd() {
193
+ const width = 76;
194
+ const shadow = chalk.hex('#083344');
195
+ console.log(shadow(` └${'─'.repeat(width - 4)}┘\n`));
137
196
  }
138
197
 
139
198
  /**
140
199
  * Draw Ajay Vai's premium summary with a human chat bubble vibe
141
200
  */
142
201
  static drawSummaryBox(content: string) {
143
- const width = Math.min(process.stdout.columns || 80, 76);
202
+ const width = 74;
144
203
  const innerWidth = width - 6;
145
204
  const magenta = chalk.hex('#ff69b4');
146
205
  const pinkBright = chalk.hex('#ff99cc');
@@ -219,74 +278,40 @@ export class TUI {
219
278
  agent.includes('Sunil') ? chalk.blue :
220
279
  agent.includes('Sandip') ? chalk.hex('#FF69B4') :
221
280
  agent.includes('Bishal') ? chalk.yellow :
222
- agent.includes('Hype') ? chalk.hex('#fbbf24') :
223
- agent.includes('Nerd') ? chalk.hex('#06b6d4') :
224
- agent.includes('Chill') ? chalk.hex('#22c55e') :
225
- agent.includes('Lil') ? chalk.hex('#888888') :
226
- agent.includes('Narayan') ? chalk.green :
227
- chalk.green;
228
-
229
- // Glow color is a brighter version of the agent color
230
- const glowColor = isBigBro ? chalk.hex('#FF9642') :
231
- agent.includes('Ajay') ? chalk.hex('#ff77ff') :
232
- agent.includes('Sunil') ? chalk.hex('#66aaff') :
233
- agent.includes('Sandip') ? chalk.hex('#ff99cc') :
234
- agent.includes('Bishal') ? chalk.hex('#ffee66') :
235
- agent.includes('Hype') ? chalk.hex('#ffe066') :
236
- agent.includes('Nerd') ? chalk.hex('#33ddee') :
237
- agent.includes('Chill') ? chalk.hex('#66ff88') :
238
- agent.includes('Lil') ? chalk.hex('#aaaaaa') :
239
- chalk.hex('#66ff88');
281
+ agent.includes('Narayan') ? chalk.green : chalk.cyan;
240
282
 
283
+ const glowColor = isBigBro ? chalk.hex('#fbbf24') : color;
241
284
  const icon = isBigBro ? '🔥' :
242
285
  agent.includes('Ajay') ? '🚀' :
243
286
  agent.includes('Sunil') ? '🧬' :
244
287
  agent.includes('Sandip') ? '🎨' :
245
288
  agent.includes('Bishal') ? '🛠️' :
246
- agent.includes('Hype') ? '🎉' :
247
- agent.includes('Nerd') ? '🤓' :
248
- agent.includes('Chill') ? '😎' :
249
- agent.includes('Lil') ? '😰' :
250
- agent.includes('Narayan') ? '🛡️' : '🛡️';
289
+ agent.includes('Narayan') ? '🛡️' : '🤖';
251
290
 
252
- const width = Math.min(process.stdout.columns || 80, 76);
253
- const innerWidth = width - 6;
291
+ const width = 76;
292
+ const innerWidth = width - 10;
254
293
 
255
- // Top glow shimmer
256
- console.log(glowColor(` ░${''.repeat(width - 4)}░`));
257
- // Top border with premium double-line
258
- console.log(color(` ╔${'═'.repeat(width - 4)}╗`));
259
- // Header with agent name
260
- const headerText = `${icon} ${agent}`;
261
- const pad = Math.max(0, innerWidth - headerText.length);
262
- console.log(color(' ║ ') + color.bold(headerText) + ' '.repeat(pad) + color(' ║'));
263
- // Separator with dots for premium feel
264
- console.log(color(' ╠') + glowColor('·'.repeat(width - 4)) + color('╣'));
265
-
266
- // Content lines with word wrap
294
+ // Robust Elite Header
295
+ console.log('\n' + color(` ┌${''.repeat(width - 4)}┐`));
296
+ const header = ` ${icon} ${agent.toUpperCase()} `;
297
+ const hPad = Math.max(0, width - 8 - header.length);
298
+ console.log(color(' │ ') + chalk.bgHex('#1a1a1a').white.bold(header) + color('╊'.repeat(hPad)) + color(' │'));
299
+ console.log(color(' │ ') + glowColor('─'.repeat(width - 6)) + color(' │'));
300
+
301
+ // Wrapped Content
267
302
  const words = message.split(' ');
268
303
  let currentLine = '';
269
- const wrappedLines: string[] = [];
270
-
271
304
  words.forEach(word => {
272
305
  if ((currentLine + ' ' + word).trim().length <= innerWidth) {
273
306
  currentLine = currentLine ? currentLine + ' ' + word : word;
274
307
  } else {
275
- if (currentLine) wrappedLines.push(currentLine);
276
- currentLine = word.length > innerWidth ? word.substring(0, innerWidth) : word;
308
+ if (currentLine) console.log(color(' │ ') + chalk.white(currentLine.padEnd(innerWidth)) + color(' │'));
309
+ currentLine = word;
277
310
  }
278
311
  });
279
- if (currentLine) wrappedLines.push(currentLine);
280
-
281
- wrappedLines.forEach(line => {
282
- const linePad = Math.max(0, innerWidth - line.length);
283
- console.log(color(' ║ ') + chalk.white(line) + ' '.repeat(linePad) + color(' ║'));
284
- });
312
+ if (currentLine) console.log(color(' │ ') + chalk.white(currentLine.padEnd(innerWidth)) + color(' │'));
285
313
 
286
- // Bottom border
287
- console.log(color(` ╚${'═'.repeat(width - 4)}╝`));
288
- // Bottom glow shimmer
289
- console.log(glowColor(` ░${'░'.repeat(width - 4)}░`));
314
+ console.log(color(` └${'─'.repeat(width - 4)}┘\n`));
290
315
  }
291
316
 
292
317
  /**