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