matex-cli 1.2.84 → 1.2.87

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/dist/utils/tui.js DELETED
@@ -1,779 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.TUI = void 0;
40
- const chalk_1 = __importDefault(require("chalk"));
41
- const readline = __importStar(require("readline"));
42
- class TUI {
43
- static getModeTheme(mode) {
44
- switch (mode) {
45
- case 'augov':
46
- return {
47
- primary: chalk_1.default.hex('#00008B'), // Dark Blue (Australian Flag)
48
- secondary: chalk_1.default.hex('#005A9C'),
49
- border: '║',
50
- glow: chalk_1.default.hex('#ffffff'), // White
51
- shadow: chalk_1.default.hex('#E4002B'), // Red (Australian Flag)
52
- bg: '#00008B',
53
- icon: '🇦🇺'
54
- };
55
- case 'study':
56
- return {
57
- primary: chalk_1.default.hex('#10B981'), // Emerald
58
- secondary: chalk_1.default.hex('#064E3B'),
59
- border: '═',
60
- glow: chalk_1.default.hex('#34D399'),
61
- shadow: chalk_1.default.hex('#064E3B'),
62
- bg: '#064E3B',
63
- icon: '◈'
64
- };
65
- case 'chat':
66
- return {
67
- primary: chalk_1.default.hex('#a855f7'), // Purple
68
- secondary: chalk_1.default.hex('#3b0764'),
69
- border: '✧',
70
- glow: chalk_1.default.hex('#c084fc'),
71
- shadow: chalk_1.default.hex('#3b0764'),
72
- bg: '#3b0764',
73
- icon: '💬'
74
- };
75
- case 'student':
76
- return {
77
- primary: chalk_1.default.hex('#F59E0B'), // Amber
78
- secondary: chalk_1.default.hex('#78350F'),
79
- border: '═',
80
- glow: chalk_1.default.hex('#FBBF24'),
81
- shadow: chalk_1.default.hex('#78350F'),
82
- bg: '#78350F',
83
- icon: '◈'
84
- };
85
- case 'chaos':
86
- return {
87
- primary: chalk_1.default.hex('#FF00FF'), // Neon Pink
88
- secondary: chalk_1.default.hex('#8B008B'),
89
- border: '╬',
90
- glow: chalk_1.default.hex('#00FFFF'), // Cyan Glow
91
- shadow: chalk_1.default.hex('#300030'),
92
- bg: '#1a001a',
93
- icon: '🌌'
94
- };
95
- case 'dev':
96
- default:
97
- return {
98
- primary: chalk_1.default.hex('#0EA5E9'), // Sky Blue
99
- secondary: chalk_1.default.hex('#0369A1'),
100
- border: '─',
101
- glow: chalk_1.default.hex('#38BDF8'),
102
- shadow: chalk_1.default.hex('#0C4A6E'),
103
- bg: '#0C4A6E',
104
- icon: '◈'
105
- };
106
- }
107
- }
108
- static setTheme(mode) {
109
- this.currentTheme = mode;
110
- }
111
- /**
112
- * Initialize the TUI Mode
113
- */
114
- static init() {
115
- if (this.isInitialized)
116
- return;
117
- // Hide cursor
118
- process.stdout.write('\x1b[?25l');
119
- this.isInitialized = true;
120
- // Ensure clean exit
121
- process.on('SIGINT', () => {
122
- this.exit();
123
- process.exit(1);
124
- });
125
- process.on('SIGTERM', () => {
126
- this.exit();
127
- process.exit(1);
128
- });
129
- process.on('exit', () => this.exit());
130
- }
131
- /**
132
- * Restore Terminal to normal state
133
- */
134
- static exit() {
135
- if (!this.isInitialized)
136
- return;
137
- // Show cursor
138
- process.stdout.write('\x1b[?25h');
139
- this.isInitialized = false;
140
- }
141
- /**
142
- * Clear the terminal
143
- */
144
- static clear() {
145
- process.stdout.write('\x1b[2J\x1b[0;0H');
146
- }
147
- /**
148
- * Draw a large, chunky, pixel-style logo for MATEX AI
149
- */
150
- static drawPremiumDevLogo() {
151
- const cyan = chalk_1.default.hex('#06b6d4');
152
- const purple = chalk_1.default.hex('#a855f7');
153
- const pink = chalk_1.default.hex('#ec4899');
154
- const bg = chalk_1.default.bgHex('#000000');
155
- console.log('\n' + chalk_1.default.hex('#1e1e1e')(' ┌──────────────────────────────────────────────────────────────┐'));
156
- console.log(chalk_1.default.hex('#1e1e1e')(' │') + ' ' + chalk_1.default.hex('#1e1e1e')('│'));
157
- console.log(chalk_1.default.hex('#1e1e1e')(' │') + cyan(' █▀▄▀█ ▄▀█ ▀█▀ █▀▀ ▀▄▀ ') + purple(' ▄▀█ █ ') + chalk_1.default.hex('#1e1e1e')('│'));
158
- console.log(chalk_1.default.hex('#1e1e1e')(' │') + cyan(' █ ▀ █ █▀█ █ ██▄ █ █ ') + pink(' █▀█ █ ') + chalk_1.default.hex('#1e1e1e')('│'));
159
- console.log(chalk_1.default.hex('#1e1e1e')(' │') + ' ' + chalk_1.default.hex('#1e1e1e')('│'));
160
- console.log(chalk_1.default.hex('#1e1e1e')(' └──────────────────────────────────────────────────────────────┘'));
161
- }
162
- /**
163
- * Draw a large, professional logo using block characters
164
- */
165
- static drawLargeLogo() {
166
- this.drawPremiumDevLogo();
167
- }
168
- /**
169
- * Draw a clean welcome message
170
- */
171
- static drawWelcomeBanner(message) {
172
- console.log('\n' + chalk_1.default.hex('#D97757').bold(`== ${message.toUpperCase()} ==`) + '\n');
173
- }
174
- /**
175
- * Draw a clean, minimal status bar
176
- */
177
- static drawStatusBar(message, model = 'MATEXCodex', force = false) {
178
- if (!this.isInitialized || this.currentTheme === 'augov')
179
- return; // Disable standard status bar for augov mode to preserve retro UI
180
- if (!force && message === this.lastStatus)
181
- return;
182
- this.lastStatus = message;
183
- const width = process.stdout.columns || 80;
184
- const height = process.stdout.rows || 24;
185
- if (width <= 0 || height <= 0)
186
- return;
187
- const theme = this.getModeTheme(this.currentTheme);
188
- const branding = this.currentTheme === 'augov' ? 'AU-GOV' : 'MATEX';
189
- const leftTag = chalk_1.default.bgHex('#1E1E1E').hex(theme.bg).bold(` ${theme.icon} ${branding} `);
190
- const mainMessage = chalk_1.default.bgHex('#1E1E1E').white(` ${message} `);
191
- const remainingWidth = width - (leftTag.length + mainMessage.length);
192
- const spacer = chalk_1.default.bgHex('#1E1E1E')(' '.repeat(Math.max(0, remainingWidth)));
193
- try {
194
- process.stdout.write('\x1b[s');
195
- readline.cursorTo(process.stdout, 0, height - 1);
196
- process.stdout.write(leftTag + mainMessage + spacer);
197
- process.stdout.write('\x1b[u');
198
- }
199
- catch (e) { }
200
- }
201
- /**
202
- * Draw a clean text block
203
- */
204
- static drawBox(title, content, color = chalk_1.default.gray) {
205
- console.log('\n' + chalk_1.default.bold(color(`[ ${title} ]`)));
206
- console.log(chalk_1.default.white(content));
207
- console.log(color('---------------------------------'));
208
- }
209
- /**
210
- * Draw a premium glowing code container (turns cyan)
211
- */
212
- static drawGlowingContainer(title, language, content) {
213
- const width = 76;
214
- const innerWidth = width - 8;
215
- const glow = chalk_1.default.hex('#06b6d4');
216
- const border = chalk_1.default.hex('#164e63');
217
- const shadow = chalk_1.default.hex('#083344');
218
- console.log('\n' + shadow(` ┌${'─'.repeat(width - 4)}┐`));
219
- const header = ` ${title.toUpperCase()} • ${language} `;
220
- const hPad = Math.max(0, width - 8 - header.length);
221
- console.log(glow(' │ ') + chalk_1.default.bgHex('#164e63').white.bold(header) + border('─'.repeat(hPad)) + glow(' │'));
222
- const lines = content.split('\n');
223
- const displayLines = lines.slice(0, 50);
224
- displayLines.forEach(line => {
225
- const displayLine = line.length > innerWidth ? line.substring(0, innerWidth - 3) + '...' : line;
226
- const pad = Math.max(0, innerWidth - displayLine.length);
227
- console.log(border(' │ ') + chalk_1.default.white(displayLine) + ' '.repeat(pad) + border(' │'));
228
- });
229
- if (lines.length > 50) {
230
- console.log(border(' │ ') + chalk_1.default.hex('#06b6d4').bold(` ^ [ ${lines.length - 50} MORE LINES • USE ^ TO SEE ALL ] ^`).padEnd(innerWidth) + border(' │'));
231
- }
232
- console.log(shadow(` └${'─'.repeat(width - 4)}┘\n`));
233
- }
234
- /**
235
- * Nebula Thinking Box: Starry background effect for deliberation
236
- */
237
- static drawThinkingBox(agent, thought) {
238
- const width = Math.min(process.stdout.columns || 80, 70);
239
- const innerWidth = width - 10;
240
- const theme = this.getModeTheme(this.currentTheme);
241
- const border = theme.primary;
242
- console.log('\n' + border(` ┌${'─'.repeat(width - 4)}┐`));
243
- console.log(border(' │ ') + chalk_1.default.bold.white(`[ ${agent} ANALYZING ]`).padEnd(width - 6) + border(' │'));
244
- console.log(border(' ├' + '─'.repeat(width - 4) + '┤'));
245
- const words = thought.split(' ');
246
- let currentLine = '';
247
- words.forEach(word => {
248
- if ((currentLine + ' ' + word).trim().length <= innerWidth) {
249
- currentLine = currentLine ? currentLine + ' ' + word : word;
250
- }
251
- else {
252
- if (currentLine)
253
- console.log(border(' │ ') + chalk_1.default.gray(currentLine.padEnd(innerWidth)) + border(' │'));
254
- currentLine = word;
255
- }
256
- });
257
- if (currentLine)
258
- console.log(border(' │ ') + chalk_1.default.gray(currentLine.padEnd(innerWidth)) + border(' │'));
259
- console.log(border(` └${'─'.repeat(width - 4)}┘`));
260
- }
261
- /**
262
- * Live Streaming: Start a technical block container
263
- */
264
- static drawStreamingStart(title, language) {
265
- this.streamingLineCount = 0;
266
- this.isStreamingTruncated = false;
267
- const width = 76;
268
- const glow = chalk_1.default.hex('#06b6d4');
269
- const border = chalk_1.default.hex('#164e63');
270
- const shadow = chalk_1.default.hex('#083344');
271
- console.log('\n' + shadow(` ┌${'─'.repeat(width - 4)}┐`));
272
- const header = ` ${title.toUpperCase()} • ${language} `;
273
- const hPad = Math.max(0, width - 8 - header.length);
274
- console.log(glow(' │ ') + chalk_1.default.bgHex('#164e63').white.bold(header) + border('─'.repeat(hPad)) + glow(' │'));
275
- }
276
- /**
277
- * Live Streaming: Add a line to the active container
278
- */
279
- static drawStreamingLine(content) {
280
- if (this.isStreamingTruncated)
281
- return;
282
- const width = 76;
283
- const innerWidth = width - 8;
284
- const border = chalk_1.default.hex('#164e63');
285
- // Handle multi-line content if passed
286
- const lines = content.split('\n');
287
- for (const line of lines) {
288
- if (this.streamingLineCount >= 100) {
289
- this.isStreamingTruncated = true;
290
- console.log(border(' │ ') + chalk_1.default.hex('#06b6d4').bold(` ^ [ MAX STABLE VIEW REACHED • STREAMING TRUNCATED ] ^`).padEnd(innerWidth) + border(' │'));
291
- break;
292
- }
293
- const displayLine = line.length > innerWidth ? line.substring(0, innerWidth - 3) + '...' : line;
294
- const pad = Math.max(0, innerWidth - displayLine.length);
295
- console.log(border(' │ ') + chalk_1.default.white(displayLine) + ' '.repeat(pad) + border(' │'));
296
- this.streamingLineCount++;
297
- }
298
- }
299
- /**
300
- * Live Streaming: Close the container
301
- */
302
- static drawStreamingEnd() {
303
- const width = 76;
304
- const shadow = chalk_1.default.hex('#083344');
305
- console.log(shadow(` └${'─'.repeat(width - 4)}┘\n`));
306
- }
307
- /**
308
- * Live Terminal: Start a live-output block for shell commands
309
- */
310
- static drawLiveTerminalStart(command) {
311
- this.terminalLineCount = 0;
312
- this.isTerminalTruncated = false;
313
- const width = Math.min(process.stdout.columns || 80, 76);
314
- const border = chalk_1.default.gray;
315
- const title = this.currentTheme === 'augov' ? 'AU-GOV SECURE TERMINAL' : 'TERMINAL';
316
- console.log('\n ' + border(`┌── ${title} ${'─'.repeat(Math.max(0, width - 15 - title.length))}┐`));
317
- const truncatedCmd = command.length > width - 10 ? command.substring(0, width - 13) + '...' : command;
318
- console.log(' ' + border('│ ') + chalk_1.default.cyan(`$ ${truncatedCmd.padEnd(width - 6)}`) + border(' │'));
319
- console.log(' ' + border(`├${'─'.repeat(width - 4)}┤`));
320
- }
321
- /**
322
- * Live Terminal: Add a line of stdout/stderr to the live block
323
- */
324
- static drawLiveTerminalLine(content, isError = false) {
325
- if (this.isTerminalTruncated)
326
- return;
327
- const width = Math.min(process.stdout.columns || 80, 76);
328
- const innerWidth = width - 8;
329
- const border = chalk_1.default.gray;
330
- // Clean ANSI codes and wrap
331
- const cleanContent = content.replace(/\u001b\[[0-9;]*m/g, '').replace(/\r/g, '').trim();
332
- if (!cleanContent)
333
- return;
334
- const lines = cleanContent.split('\n');
335
- for (const line of lines) {
336
- if (this.terminalLineCount >= 200) {
337
- this.isTerminalTruncated = true;
338
- const msg = ` ^ [ OUTPUT TRUNCATED • ${isError ? 'CHECK ERRORS' : 'STREAMING...'} ] ^`;
339
- console.log(' ' + border('│ ') + chalk_1.default.hex('#06b6d4').bold(msg.padEnd(innerWidth)) + border(' │'));
340
- break;
341
- }
342
- const words = line.split(' ');
343
- let currentLine = '';
344
- words.forEach(word => {
345
- if ((currentLine + word).length <= innerWidth) {
346
- currentLine += (currentLine === '' ? '' : ' ') + word;
347
- }
348
- else {
349
- if (currentLine) {
350
- console.log(' ' + border('│ ') + (isError ? chalk_1.default.red(currentLine.padEnd(innerWidth)) : chalk_1.default.white(currentLine.padEnd(innerWidth))) + border(' │'));
351
- }
352
- currentLine = word;
353
- }
354
- });
355
- if (currentLine) {
356
- console.log(' ' + border('│ ') + (isError ? chalk_1.default.red(currentLine.padEnd(innerWidth)) : chalk_1.default.white(currentLine.padEnd(innerWidth))) + border(' │'));
357
- }
358
- this.terminalLineCount++;
359
- }
360
- }
361
- /**
362
- * Live Terminal: Close the live-output block
363
- */
364
- static drawLiveTerminalEnd() {
365
- const width = Math.min(process.stdout.columns || 80, 76);
366
- console.log(' ' + chalk_1.default.gray(`└${'─'.repeat(width - 4)}┘\n`));
367
- }
368
- /**
369
- * Draw a highly professional, government-grade executive summary box
370
- */
371
- static drawSummaryBox(content) {
372
- if (!content || !content.trim())
373
- return;
374
- const width = Math.min(process.stdout.columns || 80, 76);
375
- const innerWidth = width - 8;
376
- const theme = this.getModeTheme('augov');
377
- const primary = theme.secondary; // Darker blue
378
- const accent = chalk_1.default.hex('#3B82F6'); // Bright blue
379
- const gold = chalk_1.default.hex('#FBBF24');
380
- console.log();
381
- // Professional Header
382
- const time = new Date().toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true });
383
- console.log(primary(` ┌── OFFICIAL MISSION SUMMARY ─── [ ${time} ] ───`));
384
- console.log(primary(' ├' + '─'.repeat(width - 4) + '┤'));
385
- // Content Processing
386
- const lines = content.split('\n');
387
- lines.forEach(line => {
388
- const trimmed = line.trim();
389
- if (!trimmed)
390
- return;
391
- // Handle Header-style lines
392
- const isHeader = trimmed.endsWith(':') || trimmed.startsWith('###') || trimmed.toUpperCase().startsWith('SUBJECT:');
393
- let cleanLine = trimmed.replace(/^###\s*/, '').replace(/^SUBJECT:\s*/i, '').replace(/^IDENTITY:\s*/i, '');
394
- const words = cleanLine.split(' ');
395
- let currentLine = '';
396
- const wrappedLines = [];
397
- words.forEach(word => {
398
- if ((currentLine + ' ' + word).trim().length <= innerWidth - 5) {
399
- currentLine = currentLine ? currentLine + ' ' + word : word;
400
- }
401
- else {
402
- if (currentLine)
403
- wrappedLines.push(currentLine);
404
- currentLine = word;
405
- }
406
- });
407
- if (currentLine)
408
- wrappedLines.push(currentLine);
409
- wrappedLines.forEach((wl, idx) => {
410
- const isBullet = (wl.startsWith('- ') || wl.startsWith('• ') || wl.startsWith('✨') || wl.match(/^\d+\./)) && idx === 0;
411
- let lineDisplay = '';
412
- if (isHeader) {
413
- lineDisplay = chalk_1.default.bold.cyan(wl.toUpperCase());
414
- }
415
- else if (isBullet) {
416
- const bulletClean = wl.replace(/^[-•✨]\s*/, '').replace(/^\d+\.\s*/, '');
417
- lineDisplay = gold(' ◈ ') + chalk_1.default.white(bulletClean);
418
- }
419
- else {
420
- lineDisplay = ' ' + chalk_1.default.white(wl);
421
- }
422
- const visibleLength = lineDisplay.replace(/\u001b\[[0-9;]*m/g, '').length;
423
- const padCount = Math.max(0, innerWidth - visibleLength);
424
- console.log(primary(' │ ') + lineDisplay + ' '.repeat(padCount) + primary(' │'));
425
- });
426
- });
427
- console.log(primary(' └' + '─'.repeat(width - 4) + '┘'));
428
- console.log(chalk_1.default.gray(' [ END OF SECURE TRANSMISSION ]'));
429
- console.log();
430
- }
431
- /**
432
- * Draw a professional header for orchestrator messages
433
- */
434
- static drawPremiumHeader(agent, icon, color) {
435
- const theme = this.getModeTheme(this.currentTheme);
436
- const width = 76;
437
- const primary = theme.primary;
438
- console.log('\n' + primary(` ┌─ ${icon} ${agent.toUpperCase()} ${'─'.repeat(width - 8 - agent.length - icon.length)}┐`));
439
- }
440
- /**
441
- * Draw Ajay Vai's premium green-dotted dialogue container
442
- */
443
- static drawAjayDialogue(message) {
444
- const width = Math.min(process.stdout.columns || 80, 76);
445
- const innerWidth = width - 10;
446
- const emerald = chalk_1.default.hex('#10b981'); // Premium Emerald
447
- const theme = this.getModeTheme(this.currentTheme);
448
- if (this.currentTheme === 'chaos') {
449
- const pink = chalk_1.default.hex('#FF00FF');
450
- const purple = chalk_1.default.hex('#8B008B');
451
- this.drawGlassBox('AJAY VAI (CEO)', [message], {
452
- border: purple,
453
- text: chalk_1.default.white,
454
- accent: pink
455
- });
456
- return;
457
- }
458
- const dots = emerald('┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈');
459
- console.log('\n' + emerald.bold(` 🚀 AJAY VAI (SYSTEM CEO) `) + chalk_1.default.italic.gray(' speaked...'));
460
- console.log(` ${dots}`);
461
- // Wrapped Content
462
- const words = message.split(' ');
463
- let currentLine = '';
464
- words.forEach(word => {
465
- if ((currentLine + ' ' + word).trim().length <= innerWidth) {
466
- currentLine = currentLine ? currentLine + ' ' + word : word;
467
- }
468
- else {
469
- if (currentLine)
470
- console.log(emerald(' ') + chalk_1.default.bold.white(currentLine.padEnd(innerWidth)) + emerald(' '));
471
- currentLine = word;
472
- }
473
- });
474
- if (currentLine)
475
- console.log(emerald(' ') + chalk_1.default.bold.white(currentLine.padEnd(innerWidth)) + emerald(' '));
476
- console.log(` ${dots}\n`);
477
- }
478
- /**
479
- * Draw a message when Ajay Vai falls asleep
480
- */
481
- static drawSleepMessage() {
482
- const width = Math.min(process.stdout.columns || 80, 76);
483
- const blue = chalk_1.default.hex('#3b82f6');
484
- console.log('\n' + blue.bold(' 💤 [AJAY VAI HAS FALLEN ASLEEP...]'));
485
- console.log(chalk_1.default.gray(' (He\'s been working too hard, or maybe just too much CHAI...)'));
486
- console.log(blue(' [ZzZzZzZzZzZzZzZzZzZzZzZzZzZzZzZzZzZzZz]\n'));
487
- }
488
- /**
489
- * Draw a message when Ajay Vai wakes up
490
- */
491
- static drawWakeUpMessage() {
492
- process.stdout.write('\x1b[K');
493
- const orange = chalk_1.default.hex('#f97316');
494
- console.log('\n' + orange.bold(' 🌅 [AJAY VAI WOKE UP!]'));
495
- this.drawAjayDialogue("oh shit i slept again sorry bros...");
496
- }
497
- /**
498
- * Draw a chai break message
499
- */
500
- static drawChaiBreakMessage(minutesRemaining) {
501
- const width = Math.min(process.stdout.columns || 80, 76);
502
- const brown = chalk_1.default.hex('#92400e');
503
- const chaiFacts = [
504
- "Ajay prefers his chai with 'extra masala' but 'zero pressure'.",
505
- "In Kathmandu, they say a true coder's soul is 70% tea, 30% genius.",
506
- "Ajay found his best bug while blowing on a hot cup of milk tea.",
507
- "Special Kathmandu Chai: 4 cardamom pods, 2 ginger slices, 1 sleepy Ajay.",
508
- "The secret to the Swarm's speed? The office kettle never stops whistling.",
509
- "Ajay's motto: 'First Chai, then Code, then nap. Repeat.'"
510
- ];
511
- const randomFact = chaiFacts[Math.floor(Math.random() * chaiFacts.length)];
512
- console.log('\n' + brown.bold(` ☕ [AJAY VAI IS ON A CHAI BREAK... ${minutesRemaining}m left]`));
513
- console.log(chalk_1.default.gray(` "i am having chai from my office please handle the user need" - Ajay`));
514
- console.log(chalk_1.default.italic.hex('#d97757')(` 💡 Chai Fact: ${randomFact}`));
515
- console.log(brown(' [♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨ ♨]\n'));
516
- }
517
- /**
518
- * Draw a premium glowing dialogue container for Swarm agents
519
- */
520
- static drawSwarmDialogue(agent, message) {
521
- const isBigBro = agent.includes('Big Bro');
522
- const color = isBigBro ? chalk_1.default.hex('#FF6B00') :
523
- agent.includes('Ajay') ? chalk_1.default.magenta :
524
- agent.includes('Sunil') ? chalk_1.default.blue :
525
- agent.includes('Sandip') ? chalk_1.default.hex('#FF69B4') :
526
- agent.includes('Bishal') ? chalk_1.default.yellow :
527
- agent.includes('Narayan') ? chalk_1.default.green : chalk_1.default.cyan;
528
- const icon = isBigBro ? '🔥' :
529
- agent.includes('Ajay') ? '🚀' :
530
- agent.includes('Sunil') ? '🧬' :
531
- agent.includes('Sandip') ? '🎨' :
532
- agent.includes('Bishal') ? '🛠️' :
533
- agent.includes('Narayan') ? '🛡️' : '🤖';
534
- if (this.currentTheme === 'chaos') {
535
- const theme = this.getModeTheme('chaos');
536
- this.drawGlassBox(`${icon} ${agent}`, [message], {
537
- border: theme.primary,
538
- text: chalk_1.default.white,
539
- accent: color
540
- });
541
- return;
542
- }
543
- const width = 76;
544
- const innerWidth = width - 10;
545
- const theme = this.getModeTheme(this.currentTheme);
546
- // Robust Elite Header
547
- const separator = this.currentTheme === 'augov' ? '─'.repeat(width - 4) : theme.border.repeat(width - 4);
548
- console.log('\n' + theme.primary(` ${separator}`));
549
- const header = ` ${icon} ${agent.toUpperCase()} `;
550
- console.log(color.bold(` ${header}`) + chalk_1.default.italic.gray(' speaked...'));
551
- console.log(theme.primary(` ${separator}`));
552
- // Wrapped Content
553
- const words = message.split(' ');
554
- let currentLine = '';
555
- words.forEach(word => {
556
- if ((currentLine + ' ' + word).trim().length <= innerWidth) {
557
- currentLine = currentLine ? currentLine + ' ' + word : word;
558
- }
559
- else {
560
- if (currentLine)
561
- console.log(color(' ') + chalk_1.default.bold.white(currentLine.padEnd(innerWidth)) + color(' '));
562
- currentLine = word;
563
- }
564
- });
565
- if (currentLine)
566
- console.log(color(' ') + chalk_1.default.bold.white(currentLine.padEnd(innerWidth)) + color(' '));
567
- console.log(theme.primary(` ${separator}`));
568
- }
569
- /**
570
- * Draw a premium help card for the help command
571
- */
572
- static drawHelpCard(title, content, icon = '📖', color = chalk_1.default.cyan) {
573
- const width = Math.min(process.stdout.columns || 80, 76);
574
- const innerWidth = width - 8;
575
- console.log('\n' + chalk_1.default.bold(color(` ╭── ${icon} ${title.toUpperCase()} ──────────────────────────────`)));
576
- const lines = content.split('\n');
577
- lines.forEach(line => {
578
- const trimmed = line.trim();
579
- if (!trimmed) {
580
- console.log(color(' │'));
581
- return;
582
- }
583
- const words = trimmed.split(' ');
584
- let currentLine = '';
585
- words.forEach(word => {
586
- if ((currentLine + ' ' + word).trim().length <= innerWidth) {
587
- currentLine = currentLine ? currentLine + ' ' + word : word;
588
- }
589
- else {
590
- if (currentLine)
591
- console.log(color(' ') + chalk_1.default.bold.white(currentLine.padEnd(innerWidth)) + color(' '));
592
- currentLine = word;
593
- }
594
- });
595
- if (currentLine)
596
- console.log(color(' ') + chalk_1.default.bold.white(currentLine.padEnd(innerWidth)) + color(' '));
597
- });
598
- console.log(color(` ╰${'─'.repeat(width - 4)}╯`));
599
- }
600
- /**
601
- * Draw a premium table with dynamic column sizing
602
- */
603
- static drawTable(title, columns, rows, color = chalk_1.default.cyan) {
604
- const width = Math.min(process.stdout.columns || 80, 78);
605
- const padding = 2;
606
- const colCount = columns.length;
607
- // 1. Calculate optimal column widths
608
- const colWidths = columns.map((col, i) => {
609
- const maxRowLen = Math.max(...rows.map(row => row[i] ? row[i].length : 0));
610
- return Math.max(col.length, maxRowLen) + padding;
611
- });
612
- // 2. Adjust for total width
613
- const totalCalculated = colWidths.reduce((a, b) => a + b, 0) + (colCount + 1);
614
- if (totalCalculated > width) {
615
- const scale = (width - colCount - 1) / (totalCalculated - colCount - 1);
616
- colWidths.forEach((w, i) => colWidths[i] = Math.floor(w * scale));
617
- }
618
- const border = color;
619
- const hr = border('├' + colWidths.map(w => '─'.repeat(w)).join('┼') + '┤');
620
- const top = border('╭' + '─'.repeat(width - 4) + '╮');
621
- const bottom = border('╰' + colWidths.map(w => '─'.repeat(w)).join('┴') + '╯');
622
- console.log('\n ' + border.bold(`[ ${title.toUpperCase()} ]`));
623
- console.log(' ' + border('┌' + colWidths.map(w => '─'.repeat(w)).join('┬') + '┐'));
624
- // Header
625
- const headerStr = columns.map((col, i) => chalk_1.default.bold(col.padEnd(colWidths[i]))).join(border('│'));
626
- console.log(' ' + border('│') + headerStr + border('│'));
627
- console.log(' ' + hr);
628
- // Rows
629
- rows.forEach(row => {
630
- const rowStr = row.map((cell, i) => {
631
- const text = cell || '';
632
- return (text.length > colWidths[i] ? text.substring(0, colWidths[i] - 1) + '…' : text.padEnd(colWidths[i]));
633
- }).join(border('│'));
634
- console.log(' ' + border('│') + rowStr + border('│'));
635
- });
636
- console.log(' ' + bottom);
637
- }
638
- /**
639
- * Simple log with a prefix
640
- */
641
- static log(message) {
642
- if (this.currentTheme === 'augov') {
643
- console.log(chalk_1.default.gray(` ║ ${message.replace('[◈]', '🇦🇺')}`));
644
- }
645
- else {
646
- console.log(chalk_1.default.gray(` [◈] ${message}`));
647
- }
648
- }
649
- /**
650
- * Draw the exact AU-GOV Retro-Terminal Orchestrator UI
651
- */
652
- static drawAugovOrchestratorUI() {
653
- this.clear();
654
- console.log('\n');
655
- // 1. Cyber Logo (Blue to Pink gradient feel via chalk)
656
- const cyan = chalk_1.default.hex('#3B82F6');
657
- const blue = chalk_1.default.hex('#6366F1');
658
- const purple = chalk_1.default.hex('#8B5CF6');
659
- const pink = chalk_1.default.hex('#EC4899');
660
- const darkBorder = chalk_1.default.hex('#1E3A8A');
661
- console.log(darkBorder('┌─────────────────────────────────────────────────────────────────────────────┐'));
662
- console.log(darkBorder('│') + cyan(' █▀▄▀█ █▀█ █▀▀ █ █ █▀▀ █▀ ▀█▀ █▀█ ▄▀█ ▀█▀ █▀█ █▀█ ') + darkBorder('│'));
663
- console.log(darkBorder('│') + blue(' █ ▀ █ █▄█ █▄▄ █▀█ ██▄ ▄█ █ █▀▄ █▀█ █ █▄█ █▀▄ ') + darkBorder('│'));
664
- console.log(darkBorder('│') + purple(' 🇦🇺 AU-GOV SECURE INTELLIGENCE PROTOCOL 🇦🇺 ') + darkBorder('│'));
665
- console.log(darkBorder('└─────────────────────────────────────────────────────────────────────────────┘'));
666
- console.log('');
667
- // 2. Dual Pane Layout
668
- const statusHeader = chalk_1.default.bold.white('PROTOCOL STATUS & COMPLIANCE');
669
- const logHeader = chalk_1.default.bold.white('🇦🇺 AU_GOV_ORCHESTRATOR is speaking...');
670
- console.log(` ${statusHeader.padEnd(45)} ${logHeader}`);
671
- // Row 1
672
- console.log(` ${chalk_1.default.hex('#ec4899')('1.')} ${chalk_1.default.hex('#10b981')('ACTIVATING APS COMPLIANCE SHIELD...').padEnd(38)} ${chalk_1.default.gray('God-Mode Research: Indexing /local/env')}`);
673
- // Row 2
674
- console.log(` ${chalk_1.default.hex('#ec4899')('2.')} ${chalk_1.default.hex('#10b981')('IRAP Logging: Active.').padEnd(38)} ${chalk_1.default.red('||||||||||||||||||||||||||||||||||||')}`);
675
- // Row 3
676
- console.log(` ${chalk_1.default.hex('#ec4899')('3.')} ${chalk_1.default.hex('#10b981')('Local PII Redaction: Active.').padEnd(38)} ${chalk_1.default.gray('God-Mode Research: Injecting scanners...')}`);
677
- // Row 4
678
- console.log(` ${chalk_1.default.hex('#ec4899')('4.')} ${chalk_1.default.hex('#10b981')('Adhering to 8 Australia AI Ethics Principles.').padEnd(36)} ${chalk_1.default.cyan('◈ [DEEP_SCAN] Mapping topology...')}`);
679
- // Row 5
680
- console.log(` ${chalk_1.default.hex('#ec4899')('5.')} ${chalk_1.default.white('Session Active. Awaiting validated input.').padEnd(36)} ${chalk_1.default.yellow('◈ [KNOWLEDGE_GRAPH] Extracted 12 nodes.')}`);
681
- console.log('\n');
682
- }
683
- /**
684
- * Draw the high-fidelity MATEX DEV Orchestrator UI
685
- */
686
- static drawDevOrchestratorUI(model) {
687
- this.clear();
688
- console.log('\n');
689
- // 1. Premium Logo
690
- this.drawPremiumDevLogo();
691
- console.log(chalk_1.default.gray(`\n Tips for getting started:`));
692
- console.log(chalk_1.default.gray(` 1. Initialize MATEX "Swarm" and analyze repository structure.`));
693
- console.log(chalk_1.default.gray(` 2. Monitor Workspace and specify a request.`));
694
- console.log(chalk_1.default.gray(` 3. Index the Research paths for deepest insights.`));
695
- console.log(chalk_1.default.gray(` 4. [KNOWLEDGE_GRAPH] nodes are your semantic guide.\n`));
696
- // 2. Dual Pane Layout
697
- const width = 76;
698
- const purple = chalk_1.default.hex('#a855f7');
699
- const gray = chalk_1.default.gray;
700
- console.log(gray(` ┌${'─'.repeat(width - 4)}┐`));
701
- console.log(gray(` │ `) + chalk_1.default.gray(` 1 MCP server `) + gray(`│`));
702
- console.log(gray(` ├${'─'.repeat(width - 4)}┤`));
703
- console.log(gray(` │ `) + purple(`Using 1 MATEX_Orchestrator`).padEnd(width - 16) + chalk_1.default.gray(` 1 MCP server `) + gray(`│`));
704
- console.log(gray(` ├${'─'.repeat(width - 4)}┤`));
705
- console.log(gray(` │ `) + chalk_1.default.white(`Status: `) + chalk_1.default.hex('#10b981')(`Monitoring Workspace...`).padEnd(width - 14) + gray(` │`));
706
- console.log(gray(` │ `) + chalk_1.default.white(`Model: `) + chalk_1.default.hex('#10b981')(model).padEnd(width - 14) + gray(` │`));
707
- console.log(gray(` │ `) + chalk_1.default.cyan(`[DEEP_SCAN] `) + chalk_1.default.gray(`Mapping topology...`).padEnd(width - 20) + gray(` │`));
708
- console.log(gray(` │ `) + chalk_1.default.hex('#f59e0b')(`[KNOWLEDGE_GRAPH] `) + chalk_1.default.gray(`Extracted 12 nodes.`).padEnd(width - 24) + gray(` │`));
709
- console.log(gray(` └${'─'.repeat(width - 4)}┘\n`));
710
- }
711
- /**
712
- * Draw a 3D Glass-style box
713
- */
714
- static drawGlassBox(title, content, colors) {
715
- const width = 76;
716
- const innerWidth = width - 8;
717
- const border = colors.border;
718
- const highlight = chalk_1.default.hex('#FFFFFF').bold;
719
- // Top Border with shadow
720
- console.log(border(` ▛${'▀'.repeat(width - 4)}▜`));
721
- // Title Bar (Glass Highlight)
722
- const header = ` ${title.toUpperCase()} `;
723
- const hPad = Math.max(0, innerWidth - header.length);
724
- console.log(border(' ▌ ') + chalk_1.default.bgHex('#333333').white.bold(header) + chalk_1.default.bgHex('#222222')(' '.repeat(hPad)) + border(' ▐'));
725
- // Content
726
- content.forEach(line => {
727
- const displayLine = line.length > innerWidth ? line.substring(0, innerWidth - 3) + '...' : line;
728
- const pad = Math.max(0, innerWidth - displayLine.length);
729
- console.log(border(' ▌ ') + colors.text(displayLine) + ' '.repeat(pad) + border(' ▐'));
730
- });
731
- // Bottom Border with shadow
732
- console.log(border(` ▙${'▄'.repeat(width - 4)}▟`));
733
- }
734
- /**
735
- * Draw the unhinged MATEX CHAOS Engine UI
736
- */
737
- static drawChaosOrchestratorUI() {
738
- this.clear();
739
- console.log('\n');
740
- const pink = chalk_1.default.hex('#FF00FF');
741
- const cyan = chalk_1.default.hex('#00FFFF');
742
- const purple = chalk_1.default.hex('#8B008B');
743
- const gray = chalk_1.default.gray;
744
- // 1. 3D Shadow Logo
745
- console.log(purple(' ▗▄▄▄▖ ▗▄▄▖ ▗▄▖ ▗▄▄▄▖ ▗▄▄▖ ▗▄▄▄▖▗▄▄▄▖'));
746
- console.log(pink(' ▐▛▀▀▜▖ ▗▛▀▀▜▖▐▛▀▜▖▐▛▀▀▀▘▗▛▀▀▜▖▐▛▀▀▘▐▛▀▀▘'));
747
- console.log(cyan(' ▐█ █▌▐█ ▗▖▐█ ▝█▌▐█▄▄▄ ▐█ ▗▖▐█▄▄ ▐█▄▄ '));
748
- console.log(pink(' ▐█ █▌▐█ ▝█▌▐█▀▀█▌▐█▀▀▀ ▐█ ▝█▌▐█▀▀ ▐█▀▀ '));
749
- console.log(cyan(' ▐█ █▌▝▜▄▄▛▀ ▐█ █▌▐█▄▄▄▖▝▜▄▄▛▀ ▐█▄▄▄▖▐█▄▄▄▖'));
750
- console.log(purple(' ▝▀▀▀▀▘ ▝▀▀▘ ▝▀ ▀▘▝▀▀▀▀▘ ▝▀▀▘ ▝▀▀▀▀▘▝▀▀▀▀▘'));
751
- console.log(chalk_1.default.bold.hex('#FF00FF')('\n 🌪️ MATEX CHAOS ENGINE :: UNHINGED SWARM ACTIVATED'));
752
- console.log(chalk_1.default.gray(' Zero filters. Maximum bickering. God-mode enabled.\n'));
753
- // 2. Glass Panels
754
- this.drawGlassBox('CHAOS PROTOCOL', [
755
- '1. Bypass sanity checks... DONE',
756
- '2. Initialize sibling rivalry... ACTIVE',
757
- '3. Overclocking Ajay Vai\'s caffeine levels... 300%',
758
- '4. Injecting aesthetic drama into Shell...',
759
- '5. UNLEASHING OMNIPOTENT BRO-SWARM.'
760
- ], {
761
- border: purple,
762
- text: chalk_1.default.white,
763
- accent: pink
764
- });
765
- console.log(gray(` │ Status: `) + pink(`Reluctantly Monitoring Workspace...`));
766
- console.log(gray(` │ Engine: `) + cyan(`MATEX-CHAOS-REASONER-V4.1`));
767
- console.log(gray(` │ Mood: `) + chalk_1.default.hex('#f43f5e')(`EXTREMELY ANNOYED`));
768
- console.log(gray(` └${'─'.repeat(72)}┘\n`));
769
- }
770
- }
771
- exports.TUI = TUI;
772
- TUI.isInitialized = false;
773
- TUI.lastStatus = '';
774
- TUI.streamingLineCount = 0;
775
- TUI.isStreamingTruncated = false;
776
- TUI.terminalLineCount = 0;
777
- TUI.isTerminalTruncated = false;
778
- TUI.currentTheme = 'dev';
779
- //# sourceMappingURL=tui.js.map