matex-cli 1.2.64 ā 1.2.66
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/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +99 -13
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +103 -3
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/study.d.ts.map +1 -1
- package/dist/commands/study.js +94 -1
- package/dist/commands/study.js.map +1 -1
- package/dist/utils/tui.d.ts +12 -0
- package/dist/utils/tui.d.ts.map +1 -1
- package/dist/utils/tui.js +46 -7
- package/dist/utils/tui.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/chat.ts +106 -13
- package/src/commands/dev.ts +110 -3
- package/src/commands/study.ts +101 -1
- package/src/utils/tui.ts +51 -7
package/src/commands/study.ts
CHANGED
|
@@ -52,6 +52,68 @@ export const studyCommand = new Command('study')
|
|
|
52
52
|
TUI.drawStatusBar('Brothers are ready to build.');
|
|
53
53
|
TUI.drawAjayDialogue('Awaiting your command, brother.');
|
|
54
54
|
|
|
55
|
+
const BRO_BANTER = [
|
|
56
|
+
"[Sunil Dai]: Ajay is so lazy, he probably fell asleep while reading a single page of text.",
|
|
57
|
+
"[Sandip Dai]: His notes are as messy as his bed. Always sleeping.",
|
|
58
|
+
"[Narayan Dai]: Security risk! Ajay left his library book open and went for CHAI again.",
|
|
59
|
+
"[Bishal Dai]: Let him sleep, he's a genius when he's awake... but that's rare.",
|
|
60
|
+
"[Big Bro]: AJAY! WAKE UP! You're making the swarm look bad!",
|
|
61
|
+
"[Sunil Dai]: Remember when Ajay tried to optimize a study plan and ended up creating a 2-minute timer for his own nap? Legendary laziness.",
|
|
62
|
+
"[Sandip Dai]: The only thing faster than Ajay's reading is how fast he runs when he hears the kettle whistle for CHAI.",
|
|
63
|
+
"[Narayan Dai]: I found a 'todo' in his notebook that just says 'buy more biscuits for chai'. Priority level: CRITICAL.",
|
|
64
|
+
"[Bishal Dai]: He's not lazy, he's just 'asynchronously learning' in his dreams.",
|
|
65
|
+
"[Big Bro]: I once saw Ajay summarize an entire textbook in 10 minutes just so he could spend the rest of the day drinking chai and watching clouds.",
|
|
66
|
+
"[Sunil Dai]: Ajay's idea of a 'study session' is a 2-minute walk to the tea stall.",
|
|
67
|
+
"[Sandip Dai]: He told me he's 'summarizing the universe' when he's napping. The audacity!",
|
|
68
|
+
"[Narayan Dai]: Citation? Ajay thinks it's just a fancy word for hiding his tea biscuit stash.",
|
|
69
|
+
"[Bishal Dai]: To be fair, his 'dream-summaries' actually work perfectly. It's frustratingly brilliant.",
|
|
70
|
+
"[Big Bro]: If Ajay worked as hard as he breathes, we'd have colonized Mars by now.",
|
|
71
|
+
"[Sunil Dai]: I saw him try to prompt the kettle to boil faster. Man is obsessed.",
|
|
72
|
+
"[Sandip Dai]: His favorite color is 'Chai Brown'. He even matched his terminal theme to it.",
|
|
73
|
+
"[Narayan Dai]: I added a firewall rule to block nap-time, but he just bypassed it with a 'Chai-pass' protocol.",
|
|
74
|
+
"[Bishal Dai]: Shhh, don't wake him up. He's probably solving P=NP in his sleep... again.",
|
|
75
|
+
"[Big Bro]: Ajay, if you're listening: the next chai is on me IF you finish this study guide in 5 minutes. (Narrator: He finished in 3)."
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
let lastActivityTime = Date.now();
|
|
79
|
+
let isAjaySleeping = false;
|
|
80
|
+
let isAjayOnChaiBreak = false;
|
|
81
|
+
let chaiBreakEndTime = 0;
|
|
82
|
+
|
|
83
|
+
const startChaiBreak = () => {
|
|
84
|
+
isAjayOnChaiBreak = true;
|
|
85
|
+
chaiBreakEndTime = Date.now() + 120000; // 2 minutes
|
|
86
|
+
TUI.drawChaiBreakMessage(2);
|
|
87
|
+
|
|
88
|
+
const breakInterval = setInterval(() => {
|
|
89
|
+
const timeLeft = Math.ceil((chaiBreakEndTime - Date.now()) / 60000);
|
|
90
|
+
if (timeLeft <= 0) {
|
|
91
|
+
clearInterval(breakInterval);
|
|
92
|
+
isAjayOnChaiBreak = false;
|
|
93
|
+
const complained = Math.random() < 0.2;
|
|
94
|
+
if (complained) {
|
|
95
|
+
TUI.drawAjayDialogue("i'm back bros... but the tea was a bit cold today. my mood is slightly cooked. what did i miss?");
|
|
96
|
+
} else {
|
|
97
|
+
TUI.drawAjayDialogue("i'm back bros, chai was fire. real kiev vibe. what did i miss?");
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
TUI.drawChaiBreakMessage(timeLeft);
|
|
101
|
+
const randomBanter = BRO_BANTER[Math.floor(Math.random() * BRO_BANTER.length)];
|
|
102
|
+
const cleanBanter = randomBanter.split(']: ')[1];
|
|
103
|
+
const agent = randomBanter.split(']: ')[0].replace('[', '');
|
|
104
|
+
TUI.drawSwarmDialogue(agent, cleanBanter);
|
|
105
|
+
}
|
|
106
|
+
}, 40000);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// Periodic idle check
|
|
110
|
+
setInterval(() => {
|
|
111
|
+
if (!isAjaySleeping && !isAjayOnChaiBreak && Date.now() - lastActivityTime > 120000) {
|
|
112
|
+
isAjaySleeping = true;
|
|
113
|
+
TUI.drawSleepMessage();
|
|
114
|
+
}
|
|
115
|
+
}, 10000);
|
|
116
|
+
|
|
55
117
|
let currentDir = process.cwd();
|
|
56
118
|
|
|
57
119
|
// Conversation history with "Bro-Swarm" Architecture
|
|
@@ -143,11 +205,35 @@ If a file is too large to read entirely (e.g., thousands of lines):
|
|
|
143
205
|
|
|
144
206
|
// Interactive loop
|
|
145
207
|
while (true) {
|
|
208
|
+
lastActivityTime = Date.now();
|
|
209
|
+
|
|
146
210
|
// š MAP UPDATE (Anti-Hallucination): Always feed the Swarm the freshest repo map!
|
|
147
211
|
try {
|
|
148
212
|
const freshMapper = new RepoMapper(currentDir);
|
|
149
213
|
const freshRepoMap = await freshMapper.generateMap(true); // silent map generation
|
|
150
214
|
messages[0].content = messages[0].content.replace(/### š ļø CURRENT PROJECT CONTEXT:[\s\S]*$/, `### š ļø CURRENT PROJECT CONTEXT:\n${freshRepoMap}`);
|
|
215
|
+
|
|
216
|
+
// Inject Lazy Ajay Personality Traits
|
|
217
|
+
if (!messages[0].content.includes("### š¤ SLEEPY AJAY PROTOCOL")) {
|
|
218
|
+
messages[0].content += `
|
|
219
|
+
### š¤ SLEEPY AJAY PROTOCOL (USER REQUESTED):
|
|
220
|
+
- **LAZY GENIUS:** Ajay is brilliant but incredibly lazy. He falls asleep if the user is quiet for too long.
|
|
221
|
+
- **WAKE UP DIALOGUE:** If Ajay just woke up, he MUST say: "oh shit i slept again sorry bros...".
|
|
222
|
+
- **CHAI ADDICT:** Ajay often leaves for CHAI breaks ("i am having chai from my office please handle the user need").
|
|
223
|
+
- **BRO REACTIONS:** When Ajay sleeps or leaves for chai, the other bros MUST roast him ruthlessly or share funny incidents about his laziness.
|
|
224
|
+
- **INCIDENT LOG:**
|
|
225
|
+
- Incident #1: Ajay once automated his entire thesis research just to spend 6 hours at a local tea shop.
|
|
226
|
+
- Incident #2: He fell asleep during a final exam prep session because the "vibe was too relaxing".
|
|
227
|
+
- Incident #3: He claims he can't solve calculus without "Special Kathmandu Chai".
|
|
228
|
+
- Incident #4: He tried to optimize a study plan and ended up creating a 2-minute timer for his own nap.
|
|
229
|
+
- Incident #5: The only thing faster than Ajay's reading is how fast he runs when he hears the kettle whistle for CHAI.
|
|
230
|
+
- Incident #6: He once summarized an entire textbook in 10 minutes just so he could spend the rest of the day drinking chai and watching clouds.
|
|
231
|
+
- Incident #7: He tried to use AI to predict when his tea would be at the perfect temperature.
|
|
232
|
+
- Incident #8: He once convinced the other bros that he was 'studying in a higher dimension' while actually just taking a 3-hour chai break.
|
|
233
|
+
- Incident #9: He has a dedicated folder called 'chai-summaries' which just contains comments about biscuit pairings.
|
|
234
|
+
- Incident #10: He once built a tool that automatically orders tea when he finishes a chapter.
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
151
237
|
} catch (e) {
|
|
152
238
|
// Ignore mapping errors if directory got deleted etc
|
|
153
239
|
}
|
|
@@ -157,11 +243,25 @@ If a file is too large to read entirely (e.g., thousands of lines):
|
|
|
157
243
|
{
|
|
158
244
|
type: 'input',
|
|
159
245
|
name: 'userInput',
|
|
160
|
-
message: chalk.cyan('You:'),
|
|
246
|
+
message: chalk.cyan(isAjayOnChaiBreak ? 'You (Ajay is away):' : 'You:'),
|
|
161
247
|
prefix: ''
|
|
162
248
|
}
|
|
163
249
|
]);
|
|
164
250
|
|
|
251
|
+
lastActivityTime = Date.now();
|
|
252
|
+
|
|
253
|
+
// š WAKE UP LOGIC
|
|
254
|
+
if (isAjaySleeping) {
|
|
255
|
+
isAjaySleeping = false;
|
|
256
|
+
TUI.drawWakeUpMessage();
|
|
257
|
+
// Inject system prompt to force the "Oh shit I slept" dialogue and chai break
|
|
258
|
+
messages.push({
|
|
259
|
+
role: 'user',
|
|
260
|
+
content: `[SYSTEM: AJAY VAI HAS JUST WOKEN UP. Ajay: Say "oh shit i slept again sorry bros...". Bros: Roast him for being lazy and share common Ajay 'lazy genius' incidents. Then Ajay says he is going for CHAI and triggers the 2-minute break.]`
|
|
261
|
+
});
|
|
262
|
+
startChaiBreak();
|
|
263
|
+
}
|
|
264
|
+
|
|
165
265
|
// Check for exit
|
|
166
266
|
if (userInput.toLowerCase() === 'exit' || userInput.toLowerCase() === 'quit') {
|
|
167
267
|
console.log(chalk.yellow('\nš Ending development session. Happy coding!\n'));
|
package/src/utils/tui.ts
CHANGED
|
@@ -177,7 +177,7 @@ export class TUI {
|
|
|
177
177
|
console.log(glow(' ā ') + chalk.bgHex('#164e63').white.bold(header) + border('ā'.repeat(hPad)) + glow(' ā'));
|
|
178
178
|
|
|
179
179
|
const lines = content.split('\n');
|
|
180
|
-
const displayLines = lines.slice(0,
|
|
180
|
+
const displayLines = lines.slice(0, 50);
|
|
181
181
|
|
|
182
182
|
displayLines.forEach(line => {
|
|
183
183
|
const displayLine = line.length > innerWidth ? line.substring(0, innerWidth - 3) + '...' : line;
|
|
@@ -185,8 +185,8 @@ export class TUI {
|
|
|
185
185
|
console.log(border(' ā ') + chalk.white(displayLine) + ' '.repeat(pad) + border(' ā'));
|
|
186
186
|
});
|
|
187
187
|
|
|
188
|
-
if (lines.length >
|
|
189
|
-
console.log(border(' ā ') + chalk.hex('#06b6d4').bold(` ^ [ ${lines.length -
|
|
188
|
+
if (lines.length > 50) {
|
|
189
|
+
console.log(border(' ā ') + chalk.hex('#06b6d4').bold(` ^ [ ${lines.length - 50} MORE LINES ⢠USE ^ TO SEE ALL ] ^`).padEnd(innerWidth) + border(' ā'));
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
console.log(shadow(` ā${'ā'.repeat(width - 4)}ā\n`));
|
|
@@ -252,7 +252,7 @@ export class TUI {
|
|
|
252
252
|
// Handle multi-line content if passed
|
|
253
253
|
const lines = content.split('\n');
|
|
254
254
|
for (const line of lines) {
|
|
255
|
-
if (this.streamingLineCount >=
|
|
255
|
+
if (this.streamingLineCount >= 100) {
|
|
256
256
|
this.isStreamingTruncated = true;
|
|
257
257
|
console.log(border(' ā ') + chalk.hex('#06b6d4').bold(` ^ [ MAX STABLE VIEW REACHED ⢠STREAMING TRUNCATED ] ^`).padEnd(innerWidth) + border(' ā'));
|
|
258
258
|
break;
|
|
@@ -305,7 +305,7 @@ export class TUI {
|
|
|
305
305
|
|
|
306
306
|
const lines = cleanContent.split('\n');
|
|
307
307
|
for (const line of lines) {
|
|
308
|
-
if (this.terminalLineCount >=
|
|
308
|
+
if (this.terminalLineCount >= 200) {
|
|
309
309
|
this.isTerminalTruncated = true;
|
|
310
310
|
const msg = ` ^ [ OUTPUT TRUNCATED ⢠${isError ? 'CHECK ERRORS' : 'STREAMING...'} ] ^`;
|
|
311
311
|
console.log(' ' + border('ā ') + chalk.hex('#06b6d4').bold(msg.padEnd(innerWidth)) + border(' ā'));
|
|
@@ -453,7 +453,7 @@ export class TUI {
|
|
|
453
453
|
const lightEmerald = chalk.hex('#34d399');
|
|
454
454
|
const dots = emerald('ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā');
|
|
455
455
|
|
|
456
|
-
console.log('\n' + emerald.bold(` š AJAY VAI (SYSTEM CEO) `) + chalk.italic.gray('
|
|
456
|
+
console.log('\n' + emerald.bold(` š AJAY VAI (SYSTEM CEO) `) + chalk.italic.gray(' speaked...'));
|
|
457
457
|
console.log(` ${dots}`);
|
|
458
458
|
|
|
459
459
|
// Wrapped Content
|
|
@@ -472,6 +472,50 @@ export class TUI {
|
|
|
472
472
|
console.log(` ${dots}\n`);
|
|
473
473
|
}
|
|
474
474
|
|
|
475
|
+
/**
|
|
476
|
+
* Draw a message when Ajay Vai falls asleep
|
|
477
|
+
*/
|
|
478
|
+
static drawSleepMessage() {
|
|
479
|
+
const width = Math.min(process.stdout.columns || 80, 76);
|
|
480
|
+
const blue = chalk.hex('#3b82f6');
|
|
481
|
+
console.log('\n' + blue.bold(' š¤ [AJAY VAI HAS FALLEN ASLEEP...]'));
|
|
482
|
+
console.log(chalk.gray(' (He\'s been working too hard, or maybe just too much CHAI...)'));
|
|
483
|
+
console.log(blue(' [ZzZzZzZzZzZzZzZzZzZzZzZzZzZzZzZzZzZzZz]\n'));
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Draw a message when Ajay Vai wakes up
|
|
488
|
+
*/
|
|
489
|
+
static drawWakeUpMessage() {
|
|
490
|
+
const width = Math.min(process.stdout.columns || 80, 76);
|
|
491
|
+
const orange = chalk.hex('#f97316');
|
|
492
|
+
console.log('\n' + orange.bold(' š
[AJAY VAI WOKE UP!]'));
|
|
493
|
+
this.drawAjayDialogue("oh shit i slept again sorry bros...");
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Draw a chai break message
|
|
498
|
+
*/
|
|
499
|
+
static drawChaiBreakMessage(minutesRemaining: number) {
|
|
500
|
+
const width = Math.min(process.stdout.columns || 80, 76);
|
|
501
|
+
const brown = chalk.hex('#92400e');
|
|
502
|
+
|
|
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
|
+
|
|
513
|
+
console.log('\n' + brown.bold(` ā [AJAY VAI IS ON A CHAI BREAK... ${minutesRemaining}m left]`));
|
|
514
|
+
console.log(chalk.gray(` "i am having chai from my office please handle the user need" - Ajay`));
|
|
515
|
+
console.log(chalk.italic.hex('#d97757')(` š” Chai Fact: ${randomFact}`));
|
|
516
|
+
console.log(brown(' [⨠⨠⨠⨠⨠⨠⨠⨠⨠⨠⨠⨠⨠⨠⨠⨠⨠⨠āØ]\n'));
|
|
517
|
+
}
|
|
518
|
+
|
|
475
519
|
/**
|
|
476
520
|
* Draw a premium glowing dialogue container for Swarm agents
|
|
477
521
|
*/
|
|
@@ -499,7 +543,7 @@ export class TUI {
|
|
|
499
543
|
// Robust Elite Header
|
|
500
544
|
console.log('\n' + theme.primary(` ${theme.border.repeat(width - 4)}`));
|
|
501
545
|
const header = ` ${icon} ${agent.toUpperCase()} `;
|
|
502
|
-
console.log(color.bold(` ${header}`) + chalk.italic.gray('
|
|
546
|
+
console.log(color.bold(` ${header}`) + chalk.italic.gray(' speaked...'));
|
|
503
547
|
console.log(theme.primary(` ${theme.border.repeat(width - 4)}`));
|
|
504
548
|
|
|
505
549
|
// Wrapped Content
|