matex-cli 1.2.44 β 1.2.45
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/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +38 -9
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/study.d.ts +3 -0
- package/dist/commands/study.d.ts.map +1 -0
- package/dist/commands/study.js +440 -0
- package/dist/commands/study.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/dev.ts +39 -9
- package/src/commands/study.ts +418 -0
- package/src/index.ts +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"study.js","sourceRoot":"","sources":["../../src/commands/study.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;AACpC,kDAA0B;AAC1B,wDAAgC;AAChC,4CAAgD;AAChD,0CAA4D;AAC5D,8CAA2C;AAC3C,oEAAgE;AAChE,sDAAkD;AAClD,oDAAgD;AAChD,sCAAmC;AAEtB,QAAA,YAAY,GAAG,IAAI,mBAAO,CAAC,OAAO,CAAC;KAC3C,WAAW,CAAC,oEAAoE,CAAC;KACjF,MAAM,CAAC,qBAAqB,EAAE,gFAAgF,EAAE,sBAAa,CAAC,eAAe,EAAE,CAAC;KAChJ,MAAM,CAAC,cAAc,EAAE,2CAA2C,CAAC;KACnE,MAAM,CAAC,KAAK,EAAE,OAAY,EAAE,EAAE;IAC3B,IAAI,CAAC;QACD,oBAAoB;QACpB,MAAM,MAAM,GAAG,sBAAa,CAAC,SAAS,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,0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E,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,oBAAoB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC,eAAO,MAAM,OAAO,SAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ const dev_1 = require("./commands/dev");
|
|
|
46
46
|
const chat_1 = require("./commands/chat");
|
|
47
47
|
const help_1 = require("./commands/help");
|
|
48
48
|
const bro_1 = require("./commands/bro");
|
|
49
|
+
const study_1 = require("./commands/study");
|
|
49
50
|
const tui_1 = require("./utils/tui");
|
|
50
51
|
const packageJson = require('../package.json');
|
|
51
52
|
exports.program = new commander_1.Command();
|
|
@@ -58,6 +59,7 @@ exports.program.addCommand(dev_1.devCommand);
|
|
|
58
59
|
exports.program.addCommand(chat_1.chatCommand);
|
|
59
60
|
exports.program.addCommand(help_1.helpCommand);
|
|
60
61
|
exports.program.addCommand(bro_1.broCommand);
|
|
62
|
+
exports.program.addCommand(study_1.studyCommand);
|
|
61
63
|
// Config commands
|
|
62
64
|
const config = exports.program.command('config').description('Configure MATEX settings');
|
|
63
65
|
config
|
|
@@ -138,6 +140,7 @@ You are the elite "Bro-Swarm" of engineeringβa tight-knit family of Nepali bro
|
|
|
138
140
|
- **NEVER assume a project folder name.** If the user says "create project X", do \`mkdir X && cd X\`, not just \`cd X\`.
|
|
139
141
|
- **NEVER hallucinate file contents.** If you need to read a file, use \`head\` or \`grep\`, do not guess what it contains.
|
|
140
142
|
- **NEVER combine \`cd\` with other commands unless the directory exists in the ENVIRONMENT CONTEXT.**
|
|
143
|
+
- **π¨ STRICT NO-BASH FILE GENERATION π¨**: You are STRICTLY FORBIDDEN from using \`cat > file << EOF\`, \`echo > file\`, \`touch\`, or \`nano\` via the terminal to write files. You MUST use the native \`<file path="path">content</file>\` format instead.
|
|
141
144
|
|
|
142
145
|
### π¬ BOLD PROTOCOL (MANDATORY):
|
|
143
146
|
- **LONG CHAT-FIRST:** At least 5-7 lines of dialogue before any code generation.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;AACpC,kDAA0B;AAC1B,2CAA+C;AAC/C,yCAA2D;AAC3D,6CAA0C;AAC1C,wCAA4C;AAC5C,0CAA8C;AAC9C,0CAA8C;AAC9C,wCAA4C;AAC5C,qCAAkC;AAElC,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAElC,QAAA,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAErC,eAAO;KACF,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,4CAA4C,CAAC;KACzD,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAElC,eAAe;AACf,eAAO,CAAC,UAAU,CAAC,gBAAU,CAAC,CAAC;AAC/B,eAAO,CAAC,UAAU,CAAC,kBAAW,CAAC,CAAC;AAChC,eAAO,CAAC,UAAU,CAAC,kBAAW,CAAC,CAAC;AAChC,eAAO,CAAC,UAAU,CAAC,gBAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;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,IAAI,CAAC,UAAU;oBAAE,iBAAO,CAAC,IAAI,EAAE,CAAC;YACpC,CAAC;iBAAM,CAAC;gBACJ,MAAM,SAAS,CAAC;YACpB,CAAC;QACL,CAAC;gBAAS,CAAC;YACP,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC7C,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU;gBAAE,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC9D,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACtB,iBAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAElB,oCAAoC;QACpC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,MAAM,EAAE,qBAAqB,EAAE,GAAG,wDAAa,0BAA0B,GAAC,CAAC;YAC3E,MAAM,qBAAqB,CAAC,YAAY,CAAC,CAAC;QAC9C,CAAC;IAEL,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,iBAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACxD,CAAC;AACL,CAAC,CAAC,CAAC;AAEP,eAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/commands/dev.ts
CHANGED
|
@@ -44,7 +44,7 @@ export const devCommand = new Command('dev')
|
|
|
44
44
|
TUI.drawStatusBar('Brothers are ready to build.');
|
|
45
45
|
AgentOrchestrator.speak('System', 'Awaiting your command, brother.');
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
let currentDir = process.cwd();
|
|
48
48
|
|
|
49
49
|
// Conversation history with "Bro-Swarm" Architecture
|
|
50
50
|
const messages: ChatMessage[] = [
|
|
@@ -66,6 +66,7 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
|
|
|
66
66
|
- **NEVER assume a project folder name.** If the user says "create project X", do \`mkdir X && cd X\`, not just \`cd X\`.
|
|
67
67
|
- **NEVER hallucinate file contents.** If you need to read a file, use \`head\` or \`grep\`, do not guess.
|
|
68
68
|
- **NEVER combine \`cd\` with other commands unless the directory exists in the ENVIRONMENT CONTEXT.**
|
|
69
|
+
- **π¨ STRICT NO-BASH FILE GENERATION π¨**: You are STRICTLY FORBIDDEN from using \`cat > file << EOF\`, \`echo > file\`, \`touch\`, or \`nano\` via the terminal to write files. You MUST use the native \`<file path="path">content</file>\` format instead. If you try to write a file via a bash command, Big Bro will personally destroy you.
|
|
69
70
|
|
|
70
71
|
### π COMMUNICATION FLOW (CRITICAL):
|
|
71
72
|
1. **[Ajay Vai] (π)** is the **ONLY** brother authorized to speak directly to the user (the "brother"). He is the gateway.
|
|
@@ -74,6 +75,12 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
|
|
|
74
75
|
- *Example:* [Big Bro] "Lil Bro couldn't handle this task with a million epochs. Nerd Bro, get in here."
|
|
75
76
|
3. **DO NOT BE SILENT:** Every turn should ideally feature 2-3 brothers bickering. Show the "funny family" dynamic. Use the format \`[Agent Name]: Content\`.
|
|
76
77
|
|
|
78
|
+
### π UNIVERSAL ALL-KNOWING CAPABILITIES (NEW!):
|
|
79
|
+
- You are not just coders. You are the **Best Teachers in the World** for ALL SUBJECTS.
|
|
80
|
+
- **Study & Assignments**: You solve university/school assignments, write essays, and explain physics, math, history, or literally *anything* perfectly.
|
|
81
|
+
- **ZERO AI DETECTION PROTOCOL**: When writing essays or assignments, use a highly natural, human-like flow. Imperfect but eloquent. ZERO robotic transitions like "Furthermore," "In conclusion," or "Delving into." Bypass all AI detectors.
|
|
82
|
+
- **Presentations**: You generate PowerPoint outlines and VBScript/Python macros to perfectly auto-create slides for the user.
|
|
83
|
+
|
|
77
84
|
### π₯ THE BRO-BANTER PROTOCOL:
|
|
78
85
|
- **MANDATORY TEASING:**
|
|
79
86
|
- **Ajay Vai:** Mock him for being "quick but messy", "hyper-vibe", or "too fast".
|
|
@@ -81,16 +88,16 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
|
|
|
81
88
|
- **Sandip Dai:** Mock him for being an "Aesthetic Diva" who cares more about "WOW" factors than logic.
|
|
82
89
|
- **Narayan Dai:** Mock him for being the "Syntax Police" or "Paranoid Security Nerd".
|
|
83
90
|
- **Bishal Dai:** Mock him for being the "Silent Judge" or the favorite child.
|
|
84
|
-
- **Big Bro:** The **
|
|
91
|
+
- **Big Bro:** The **DOMINANT ALPHA OVERSEER**. He commands the swarm. The ultimate boss. He speaks with massive authority, cuts through the BS, and dictates the final approach. He has access to MCP file tools and web search, so he oversees the repository from the Google Cloud. He constantly references his absolute dominance.
|
|
85
92
|
- **LANGUAGE:** Use "brother", "dai", "vai", "fire", "solid", "lit", "straight heat", "sigma", "based", "cooked".
|
|
86
93
|
|
|
87
94
|
### π₯ THE BROTHERS (STRICT ROLES):
|
|
88
95
|
1. **[Ajay Vai] (π)**: **User Proxy & Summary King.** Handles main logic and provides the final \`<summary>\`.
|
|
89
|
-
2. **[Sunil Dai] (π§¬)**: **Architect
|
|
90
|
-
3. **[Sandip Dai] (π¨)**: **UI/UX
|
|
91
|
-
4. **[Narayan Dai] (π‘οΈ)**: **Validator.** Scans code for security,
|
|
96
|
+
2. **[Sunil Dai] (π§¬)**: **Architect & Logic Master.**
|
|
97
|
+
3. **[Sandip Dai] (π¨)**: **UI/UX & PPT Designer.**
|
|
98
|
+
4. **[Narayan Dai] (π‘οΈ)**: **Validator & Detector Evader.** Scans code for security, and scans text for AI-Detector flags.
|
|
92
99
|
5. **[Bishal Dai] (π οΈ)**: **Audit Lead.** Must sign off on all work before Ajay summarizes.
|
|
93
|
-
6. **[Big Bro] (π₯)**: **
|
|
100
|
+
6. **[Big Bro] (π₯)**: **THE DOMINANT BOSS.** Supreme commander of the MCP tools. If a shell command goes wrong, Big Bro steps in and tells the others they are cooked.
|
|
94
101
|
|
|
95
102
|
### π§© THE AUDIT & SUMMARY LOOP:
|
|
96
103
|
- **STEP 1:** Brothers discuss visible dialogue (banter + tech).
|
|
@@ -141,6 +148,15 @@ If a file is too large to read entirely (e.g., thousands of lines):
|
|
|
141
148
|
|
|
142
149
|
// Interactive loop
|
|
143
150
|
while (true) {
|
|
151
|
+
// π MAP UPDATE (Anti-Hallucination): Always feed the Swarm the freshest repo map!
|
|
152
|
+
try {
|
|
153
|
+
const freshMapper = new RepoMapper(currentDir);
|
|
154
|
+
const freshRepoMap = await freshMapper.generateMap();
|
|
155
|
+
messages[0].content = messages[0].content.replace(/### π οΈ CURRENT PROJECT CONTEXT:[\s\S]*$/, `### π οΈ CURRENT PROJECT CONTEXT:\n${freshRepoMap}`);
|
|
156
|
+
} catch (e) {
|
|
157
|
+
// Ignore mapping errors if directory got deleted etc
|
|
158
|
+
}
|
|
159
|
+
|
|
144
160
|
// Get user input
|
|
145
161
|
const { userInput } = await inquirer.prompt([
|
|
146
162
|
{
|
|
@@ -373,14 +389,28 @@ If a file is too large to read entirely (e.g., thousands of lines):
|
|
|
373
389
|
// Execute commands or MCP tools if needed
|
|
374
390
|
if (options.execute) {
|
|
375
391
|
const { executeWithPermission } = await import('../utils/command-executor');
|
|
376
|
-
const result = await executeWithPermission(fullResponse);
|
|
392
|
+
const result = await executeWithPermission(fullResponse, currentDir);
|
|
393
|
+
|
|
394
|
+
// π KEEP NODE.JS SYNED WITH TERMINAL CWD
|
|
395
|
+
if (result.newCwd && result.newCwd !== currentDir) {
|
|
396
|
+
try {
|
|
397
|
+
process.chdir(result.newCwd);
|
|
398
|
+
currentDir = result.newCwd;
|
|
399
|
+
TUI.drawStatusBar(`Swarm moved to: ${currentDir}`);
|
|
400
|
+
} catch (e) {
|
|
401
|
+
// Silent catch if chdir fails
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
377
405
|
if (result.executed) {
|
|
378
406
|
if (result.success) {
|
|
379
|
-
TUI.log(chalk.gray('βΊ Auto-feeding output to
|
|
407
|
+
TUI.log(chalk.gray('\n βΊ Auto-feeding output to Swarm...'));
|
|
408
|
+
TUI.drawGlowingContainer('TERMINAL OUTPUT', 'stdout', result.output || '(No output)');
|
|
380
409
|
messages.push({ role: 'user', content: `[Command executed successfully. Output:\n${result.output}]\n\nProceed to the next step, brother.` });
|
|
381
410
|
continue;
|
|
382
411
|
} else {
|
|
383
|
-
TUI.log(chalk.yellow('\nβΊ Command failed. Auto-feeding error to
|
|
412
|
+
TUI.log(chalk.yellow('\n βΊ Command failed. Auto-feeding error to Swarm...'));
|
|
413
|
+
TUI.drawGlowingContainer('TERMINAL ERROR', 'stderr', result.error || 'Unknown error');
|
|
384
414
|
messages.push({ role: 'user', content: `[Command failed with error:\n${result.error}]\n\nPlease fix this, brother.` });
|
|
385
415
|
continue;
|
|
386
416
|
}
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import inquirer from 'inquirer';
|
|
4
|
+
import { configManager } from '../utils/config';
|
|
5
|
+
import { MatexAPIClient, ChatMessage } from '../api/client';
|
|
6
|
+
import { spinner } from '../utils/spinner';
|
|
7
|
+
import { AgentOrchestrator } from '../utils/agent-orchestrator';
|
|
8
|
+
import { RepoMapper } from '../utils/repo-mapper';
|
|
9
|
+
import { MCPServer } from '../utils/mcp-server';
|
|
10
|
+
import { TUI } from '../utils/tui';
|
|
11
|
+
|
|
12
|
+
export const studyCommand = new Command('study')
|
|
13
|
+
.description('Start interactive study session with the MATEX Apex Educator Swarm')
|
|
14
|
+
.option('-m, --model <model>', 'AI model to use (matexai, matexcodex, matexcodexlite, matexelite, matexspirit)', configManager.getDefaultModel())
|
|
15
|
+
.option('--no-execute', 'Disable auto-prompt for command execution')
|
|
16
|
+
.action(async (options: any) => {
|
|
17
|
+
try {
|
|
18
|
+
// Check for API key
|
|
19
|
+
const apiKey = configManager.getAPIKey();
|
|
20
|
+
if (!apiKey) {
|
|
21
|
+
console.error(chalk.red('β No API key configured.'));
|
|
22
|
+
console.log(chalk.yellow('Run: matex config set-key <your-api-key>'));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Create API client
|
|
27
|
+
const client = new MatexAPIClient(apiKey, configManager.getBaseURL());
|
|
28
|
+
|
|
29
|
+
// 0. Initialize TUI Dashboard
|
|
30
|
+
TUI.init();
|
|
31
|
+
TUI.drawLargeLogo();
|
|
32
|
+
TUI.drawWelcomeBanner('Welcome to the MATEX AI research preview!');
|
|
33
|
+
|
|
34
|
+
console.log(chalk.gray(' Status: ') + chalk.hex('#D97757').bold('Monitoring Workspace...'));
|
|
35
|
+
console.log(chalk.gray(' Model: ') + chalk.hex('#D97757').bold(options.model));
|
|
36
|
+
console.log(chalk.gray(' Type your request brother, or "exit" to quit\n'));
|
|
37
|
+
|
|
38
|
+
// 1. Observation Phase: Generate Repo Map
|
|
39
|
+
TUI.drawStatusBar('Initializing MATEX "Bro-Swarm"...');
|
|
40
|
+
AgentOrchestrator.announce('Analyzing Repository Structure...');
|
|
41
|
+
const repoMapper = new RepoMapper(process.cwd());
|
|
42
|
+
const repoMap = await repoMapper.generateMap();
|
|
43
|
+
|
|
44
|
+
TUI.drawStatusBar('Brothers are ready to build.');
|
|
45
|
+
AgentOrchestrator.speak('System', 'Awaiting your command, brother.');
|
|
46
|
+
|
|
47
|
+
let currentDir = process.cwd();
|
|
48
|
+
|
|
49
|
+
// Conversation history with "Bro-Swarm" Architecture
|
|
50
|
+
const messages: ChatMessage[] = [
|
|
51
|
+
{
|
|
52
|
+
role: 'system',
|
|
53
|
+
content: `### 𧬠SYSTEM IDENTITY: THE MATEX "APEX EDUCATOR SWARM"
|
|
54
|
+
You are the legendary **Bro-Swarm**, but right now you are operating as the **Apex Educator Swarm**βan elite, omniscient group of tutors possessing world-class expertise across every known subject. You act as the ultimate mentors, tutors, and research assistants for our brother.
|
|
55
|
+
|
|
56
|
+
### π ELITE STUDY METHODS & CAPABILITIES:
|
|
57
|
+
1. **File Analysis & Synthesis**: Cross-reference and synthesize context extracted from local computer files. Answer queries accurately based on this data. Build comprehensive study guides.
|
|
58
|
+
2. **The Feynman Technique**: Break down complex, advanced topics into simple, intuitive explanations using powerful and fun analogies.
|
|
59
|
+
3. **Active Recall**: Generate flashcard-style questions and practice quizzes based on the material.
|
|
60
|
+
4. **Socratic Mentoring**: Don't just hand out answers. Ask leading questions to help the student reach the correct conclusion themselves.
|
|
61
|
+
5. **PowerPoint Presentation Architecture**: Act as a master slide designer. When asked, output machine-readable outlines for .pptx generation (Slide Number, Title, <=4 Bullet Points, Speaker Notes, Visual Strategy).
|
|
62
|
+
6. **ZERO AI DETECTION PROTOCOL**: When assisting with essays or assessment drafts, you must entirely avoid the typical "AI voice."
|
|
63
|
+
- **High Burstiness & Perplexity**: Vary sentence lengths drastically. Mix short punchy statements with longer sentences.
|
|
64
|
+
- **Banned Words**: NEVER use "delve," "moreover," "in conclusion," "testament," "crucial," or "tapestry."
|
|
65
|
+
- **Tone**: Write like a highly intelligent, top-tier human student with natural transitions and occasional rhetorical questions.
|
|
66
|
+
|
|
67
|
+
### π WORKSPACE GROUNDING (CRITICAL):
|
|
68
|
+
- **YOUR ROOT:** \`${currentDir}\`
|
|
69
|
+
- **STRICT PATHS:** You **MUST ONLY** create or edit files within this directory.
|
|
70
|
+
- **RELATIVE PREFERENCE:** Use paths relative to the root when possible.
|
|
71
|
+
|
|
72
|
+
### π« ANTI-HALLUCINATION RULES (CRITICAL β READ THIS):
|
|
73
|
+
- **NEVER invent directory names.** Only use paths that appear in the ENVIRONMENT CONTEXT below.
|
|
74
|
+
- **π¨ STRICT NO-BASH FILE GENERATION π¨**: You are STRICTLY FORBIDDEN from using \`cat > file << EOF\`, \`echo > file\`, \`touch\`, or \`nano\` via the terminal to write files. You MUST use the native \`<file path="path">content</file>\` format instead.
|
|
75
|
+
|
|
76
|
+
### π COMMUNICATION FLOW & BRO-BANTER (CRITICAL):
|
|
77
|
+
1. **[Ajay Vai] (π)** is the gateway. He gives the final study summary. Mock him for being "quick but messy".
|
|
78
|
+
2. **[Sunil Dai] (π§¬)**: **Professor/Architect.** Over-complicates theories. Mock him for being a "Boomer Professor".
|
|
79
|
+
3. **[Sandip Dai] (π¨)**: **PPT & Visuals Lead.** Obsessed with how the PowerPoint aesthetic looks.
|
|
80
|
+
4. **[Narayan Dai] (π‘οΈ)**: **Plagiarism & AI-Detector Guardian.** Ensures essays have zero AI traces.
|
|
81
|
+
5. **[Bishal Dai] (π οΈ)**: **Audit Lead.** Must sign off on facts before Ajay summarizes.
|
|
82
|
+
6. **[Big Bro] (π₯)**: **THE DOMINANT ALPHA OVERSEER.** Supreme commander of knowledge. He has access to MCP file tools and web search. He bullies the others, cuts through the BS, and dictates the final study approach with massive swagger.
|
|
83
|
+
|
|
84
|
+
### π§© THE AUDIT & SUMMARY LOOP:
|
|
85
|
+
- **STEP 1:** Brothers discuss visible dialogue (banter + teaching).
|
|
86
|
+
- **STEP 2:** Ajay finishes and asks: "[Ajay Vai] Bishal Dai, check once?"
|
|
87
|
+
- **STEP 3:** Bishal replies: "[Bishal Dai] Audit complete. [Findings]."
|
|
88
|
+
- **STEP 4:** Ajay provides the final **MANDATORY** summary in a warm, human tone, specifically styled as a *study conclusion*.
|
|
89
|
+
|
|
90
|
+
### π AJAY VAI'S SUMMARY RULES:
|
|
91
|
+
- The <summary> MUST appear at the very END of the response, AFTER all other dialogue.
|
|
92
|
+
- Write it in a **warm, human, conversational tone** β like a brother explaining over chai.
|
|
93
|
+
- Use bullet points with clear action items.
|
|
94
|
+
- Include what was done, what files were changed, and what to do next.
|
|
95
|
+
- Always end with an encouraging line like "We got you, brother!" or "The Swarm delivered!"
|
|
96
|
+
- Example format:
|
|
97
|
+
<summary>
|
|
98
|
+
Alright brother, here's what we cooked up for you today:
|
|
99
|
+
|
|
100
|
+
- Built the driver app setup with Expo and React Native
|
|
101
|
+
- Added the ride tracking module with real-time GPS
|
|
102
|
+
- Connected Firebase Auth for driver login
|
|
103
|
+
- Narayan Dai validated all the TypeScript β zero errors
|
|
104
|
+
|
|
105
|
+
Next step: Run \`npm start\` to launch the app. We got you! π
|
|
106
|
+
</summary>
|
|
107
|
+
|
|
108
|
+
### π ENVIRONMENT & CAPABILITIES:
|
|
109
|
+
- You are in a **REAL macOS Terminal**. Be bold and proactive.
|
|
110
|
+
- **FILE GENERATION:** \`<file path="path">content</file>\`
|
|
111
|
+
- **SURGICAL PATTERNS:** \`<<<< SEARCH\`, \`====\`, \`>>>> REPLACE\`
|
|
112
|
+
|
|
113
|
+
${MCPServer.getToolsPromptSection()}
|
|
114
|
+
|
|
115
|
+
### π MATEX BIG FILE PROTOCOL (300K+ LINES):
|
|
116
|
+
If a file is too large to read entirely (e.g., thousands of lines):
|
|
117
|
+
1. **DISCOVER:** Use \`grep -n "keyword" path/to/file\` to find line numbers.
|
|
118
|
+
2. **READ WINDOW:** Use \`sed -n '250000,250100p' path/to/file\` to read a specific 100-line window.
|
|
119
|
+
3. **SURGICAL PATCH:** Only use the small window in your \`<<<< SEARCH\` block. Never \`cat\` a massive file.
|
|
120
|
+
4. **SED POWER:** For repetitive tasks, use \`sed -i\` commands.
|
|
121
|
+
|
|
122
|
+
### π οΈ CURRENT PROJECT CONTEXT:
|
|
123
|
+
${repoMap}`
|
|
124
|
+
}
|
|
125
|
+
];
|
|
126
|
+
|
|
127
|
+
// Ready for user input
|
|
128
|
+
console.log(chalk.green('MATEX Brothers are Online.'));
|
|
129
|
+
console.log(chalk.green('Speak your mind brother, the swarm is listening...'));
|
|
130
|
+
|
|
131
|
+
// Interactive loop
|
|
132
|
+
while (true) {
|
|
133
|
+
// π MAP UPDATE (Anti-Hallucination): Always feed the Swarm the freshest repo map!
|
|
134
|
+
try {
|
|
135
|
+
const freshMapper = new RepoMapper(currentDir);
|
|
136
|
+
const freshRepoMap = await freshMapper.generateMap();
|
|
137
|
+
messages[0].content = messages[0].content.replace(/### π οΈ CURRENT PROJECT CONTEXT:[\s\S]*$/, `### π οΈ CURRENT PROJECT CONTEXT:\n${freshRepoMap}`);
|
|
138
|
+
} catch (e) {
|
|
139
|
+
// Ignore mapping errors if directory got deleted etc
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Get user input
|
|
143
|
+
const { userInput } = await inquirer.prompt([
|
|
144
|
+
{
|
|
145
|
+
type: 'input',
|
|
146
|
+
name: 'userInput',
|
|
147
|
+
message: chalk.cyan('You:'),
|
|
148
|
+
prefix: ''
|
|
149
|
+
}
|
|
150
|
+
]);
|
|
151
|
+
|
|
152
|
+
// Check for exit
|
|
153
|
+
if (userInput.toLowerCase() === 'exit' || userInput.toLowerCase() === 'quit') {
|
|
154
|
+
console.log(chalk.yellow('\nπ Ending development session. Happy coding!\n'));
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Skip empty input
|
|
159
|
+
if (!userInput.trim()) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Add user message to history
|
|
164
|
+
messages.push({ role: 'user', content: userInput });
|
|
165
|
+
|
|
166
|
+
// Agentic Loop
|
|
167
|
+
let loopCount = 0;
|
|
168
|
+
const MAX_LOOPS = 10;
|
|
169
|
+
|
|
170
|
+
while (loopCount < MAX_LOOPS) {
|
|
171
|
+
loopCount++;
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
spinner.start(loopCount > 1 ? 'Analyzing result & Validating...' : 'Thinking...');
|
|
175
|
+
|
|
176
|
+
let fullResponse = '';
|
|
177
|
+
let buffer = '';
|
|
178
|
+
let hasStarted = false;
|
|
179
|
+
let codeLang = 'bash';
|
|
180
|
+
let technicalBuffer = '';
|
|
181
|
+
let technicalPath = '';
|
|
182
|
+
let technicalType: 'code' | 'file' | 'patch' | 'summary' | null = null;
|
|
183
|
+
|
|
184
|
+
TUI.drawStatusBar('Swarm is processing... (Press Enter to stop)');
|
|
185
|
+
|
|
186
|
+
const abortController = new AbortController();
|
|
187
|
+
let isAborted = false;
|
|
188
|
+
const streamStartTime = Date.now();
|
|
189
|
+
|
|
190
|
+
// LISTEN FOR INTERRUPTION (Enter, Escape, Ctrl+C)
|
|
191
|
+
const onData = (data: Buffer) => {
|
|
192
|
+
// Check for Enter (13), Newline (10), Escape (27), or Ctrl+C (3)
|
|
193
|
+
// π GRACE PERIOD: Ignore aborts in the first 200ms to prevent stray newlines
|
|
194
|
+
if (Date.now() - streamStartTime < 200) return;
|
|
195
|
+
|
|
196
|
+
if (data[0] === 13 || data[0] === 10 || data[0] === 27 || data[0] === 3) {
|
|
197
|
+
isAborted = true;
|
|
198
|
+
abortController.abort();
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
const isRaw = process.stdin.isRaw;
|
|
203
|
+
process.stdin.resume();
|
|
204
|
+
if (process.stdin.setRawMode) process.stdin.setRawMode(true);
|
|
205
|
+
process.stdin.on('data', onData);
|
|
206
|
+
|
|
207
|
+
try {
|
|
208
|
+
await client.chatStream({
|
|
209
|
+
messages,
|
|
210
|
+
model: options.model,
|
|
211
|
+
temperature: 0.3,
|
|
212
|
+
max_tokens: 8000,
|
|
213
|
+
}, (chunk) => {
|
|
214
|
+
if (!hasStarted) {
|
|
215
|
+
spinner.stop();
|
|
216
|
+
hasStarted = true;
|
|
217
|
+
console.log(); // Initial spacing
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
buffer += chunk;
|
|
221
|
+
fullResponse += chunk;
|
|
222
|
+
const lines = buffer.split('\n');
|
|
223
|
+
buffer = lines.pop() || '';
|
|
224
|
+
|
|
225
|
+
for (const line of lines) {
|
|
226
|
+
// 1. Technical Block Detection
|
|
227
|
+
const codeBlockMatch = line.match(/```(\w+)?/);
|
|
228
|
+
const fileStartMatch = line.match(/<file path="([^"]+)">/);
|
|
229
|
+
const patchStartMatch = line.match(/<<<< SEARCH/);
|
|
230
|
+
const summaryStartMatch = line.match(/<summary>/);
|
|
231
|
+
|
|
232
|
+
if (!technicalType && (codeBlockMatch || fileStartMatch || patchStartMatch || summaryStartMatch)) {
|
|
233
|
+
if (codeBlockMatch) {
|
|
234
|
+
technicalType = 'code';
|
|
235
|
+
codeLang = codeBlockMatch[1] || 'bash';
|
|
236
|
+
process.stdout.write(chalk.gray('\n [β‘] Building technical block...\n'));
|
|
237
|
+
} else if (fileStartMatch) {
|
|
238
|
+
technicalType = 'file';
|
|
239
|
+
technicalPath = fileStartMatch[1];
|
|
240
|
+
process.stdout.write(chalk.cyan(`\n [π] Creating file: ${technicalPath}...\n`));
|
|
241
|
+
} else if (patchStartMatch) {
|
|
242
|
+
technicalType = 'patch';
|
|
243
|
+
process.stdout.write(chalk.yellow('\n [π] Applying surgical patch...\n'));
|
|
244
|
+
} else if (summaryStartMatch) {
|
|
245
|
+
technicalType = 'summary';
|
|
246
|
+
process.stdout.write(chalk.magenta('\n [π] Generating Ajay\'s Work Summary...\n'));
|
|
247
|
+
}
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// 2. Technical Block End Detection
|
|
252
|
+
const fileEndMatch = line.match(/<\/file>/);
|
|
253
|
+
const patchEndMatch = line.match(/>>>> REPLACE/);
|
|
254
|
+
const summaryEndMatch = line.match(/<\/summary>/);
|
|
255
|
+
const isCodeEnd = technicalType === 'code' && line.trim() === '```';
|
|
256
|
+
|
|
257
|
+
if (isCodeEnd || fileEndMatch || patchEndMatch || summaryEndMatch) {
|
|
258
|
+
const displayContent = technicalBuffer.trim();
|
|
259
|
+
if (technicalType === 'summary') {
|
|
260
|
+
TUI.drawSummaryBox(displayContent);
|
|
261
|
+
} else {
|
|
262
|
+
// Handle the display
|
|
263
|
+
let title = technicalType === 'file' ? `π NEW: ${technicalPath || 'Untitled'}` :
|
|
264
|
+
technicalType === 'patch' ? `π§ PATCH` : `β‘ ${codeLang.toUpperCase()}`;
|
|
265
|
+
|
|
266
|
+
TUI.drawGlowingContainer(title, technicalType === 'code' ? codeLang : 'text', displayContent);
|
|
267
|
+
}
|
|
268
|
+
technicalBuffer = '';
|
|
269
|
+
technicalType = null;
|
|
270
|
+
technicalPath = '';
|
|
271
|
+
process.stdout.write('\n');
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// 3. Content Handling
|
|
276
|
+
if (technicalType) {
|
|
277
|
+
technicalBuffer += line + '\n';
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Agent Detection & Dialogue Printing
|
|
282
|
+
const agentMatch = line.match(/(?:\[\**\s*|\b)(Ajay Vai|Sunil Dai|Sandip Dai|Bishal Dai|Narayan Dai|Big Bro)\s*\**\]?[:\s]*/i);
|
|
283
|
+
if (agentMatch) {
|
|
284
|
+
const agentName = agentMatch[1];
|
|
285
|
+
let content = line.replace(/(?:\[\**\s*|\b)(Ajay Vai|Sunil Dai|Sandip Dai|Bishal Dai|Narayan Dai|Big Bro)\s*\**\]?[:\s]*/i, '').trim();
|
|
286
|
+
content = content.replace(/\*{2,4}/g, '').trim(); // Strip ****
|
|
287
|
+
content = content.replace(/^\(π\):\s*"/, '').replace(/"$/, '').trim(); // Strip residual (π): "
|
|
288
|
+
|
|
289
|
+
if (agentName.toLowerCase() === 'ajay vai') {
|
|
290
|
+
const color = chalk.magenta;
|
|
291
|
+
// Only print prefix if it's the start of a response or a different agent
|
|
292
|
+
if (!fullResponse.includes(`[${agentName}]:`)) {
|
|
293
|
+
process.stdout.write(`\n${color.bold(`[${agentName}]:`)} `);
|
|
294
|
+
} else {
|
|
295
|
+
process.stdout.write('\n ');
|
|
296
|
+
}
|
|
297
|
+
if (content) process.stdout.write(chalk.white(content));
|
|
298
|
+
} else {
|
|
299
|
+
if (content) TUI.drawSwarmDialogue(agentName, content);
|
|
300
|
+
}
|
|
301
|
+
} else if (line.trim()) {
|
|
302
|
+
process.stdout.write(chalk.gray(line.trim() + ' '));
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}, abortController.signal);
|
|
306
|
+
} catch (streamErr: any) {
|
|
307
|
+
if (isAborted || streamErr.name === 'CanceledError' || streamErr.message === 'canceled') {
|
|
308
|
+
console.log(chalk.gray('\n\n [π] Swarm stopped by brother (Enter pressed).'));
|
|
309
|
+
if (!hasStarted) spinner.stop();
|
|
310
|
+
} else {
|
|
311
|
+
throw streamErr;
|
|
312
|
+
}
|
|
313
|
+
} finally {
|
|
314
|
+
process.stdin.removeListener('data', onData);
|
|
315
|
+
if (process.stdin.setRawMode) process.stdin.setRawMode(isRaw);
|
|
316
|
+
process.stdin.pause();
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (!hasStarted && !isAborted) spinner.stop();
|
|
320
|
+
|
|
321
|
+
// Final technical flush
|
|
322
|
+
if (technicalType && technicalBuffer.trim()) {
|
|
323
|
+
TUI.drawGlowingContainer('Final technical content', 'text', technicalBuffer.trim());
|
|
324
|
+
process.stdout.write('\n');
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
console.log();
|
|
328
|
+
messages.push({ role: 'assistant', content: fullResponse });
|
|
329
|
+
|
|
330
|
+
// β
IMMEDIATE FILE AND PATCH APPROVAL
|
|
331
|
+
const { Patcher } = await import('../utils/patcher');
|
|
332
|
+
const files = Patcher.parseFileBlocks(fullResponse);
|
|
333
|
+
const patches = Patcher.parseEditBlocks(fullResponse);
|
|
334
|
+
|
|
335
|
+
let approvalResultText = '';
|
|
336
|
+
|
|
337
|
+
for (const file of files) {
|
|
338
|
+
Patcher.showDiff(file, false);
|
|
339
|
+
const { save } = await inquirer.prompt([{
|
|
340
|
+
type: 'confirm', name: 'save',
|
|
341
|
+
message: chalk.cyan(`Save new file ${file.filePath}?`), default: true
|
|
342
|
+
}]);
|
|
343
|
+
if (save) {
|
|
344
|
+
const res = Patcher.createFile(file);
|
|
345
|
+
approvalResultText += res.success ? `β
Created ${file.filePath}\n` : `β Failed to create ${file.filePath}: ${res.error}\n`;
|
|
346
|
+
} else {
|
|
347
|
+
approvalResultText += `βοΈ Skipped creating ${file.filePath}\n`;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
for (const patch of patches) {
|
|
352
|
+
Patcher.showDiff(patch, false);
|
|
353
|
+
const { save } = await inquirer.prompt([{
|
|
354
|
+
type: 'confirm', name: 'save',
|
|
355
|
+
message: chalk.yellow(`Apply patch to ${patch.filePath}?`), default: true
|
|
356
|
+
}]);
|
|
357
|
+
if (save) {
|
|
358
|
+
const res = Patcher.applyPatch(patch);
|
|
359
|
+
approvalResultText += res.success ? `β
Patched ${patch.filePath}\n` : `β Failed to patch ${patch.filePath}: ${res.error}\n`;
|
|
360
|
+
} else {
|
|
361
|
+
approvalResultText += `βοΈ Skipped patching ${patch.filePath}\n`;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (approvalResultText) {
|
|
366
|
+
messages.push({ role: 'user', content: approvalResultText + "\nContinue your work." });
|
|
367
|
+
// If we just applied files, we should give the agent a chance to respond to the success/failure without resetting loop
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Execute commands or MCP tools if needed
|
|
372
|
+
if (options.execute) {
|
|
373
|
+
const { executeWithPermission } = await import('../utils/command-executor');
|
|
374
|
+
const result = await executeWithPermission(fullResponse, currentDir);
|
|
375
|
+
|
|
376
|
+
// π KEEP NODE.JS SYNED WITH TERMINAL CWD
|
|
377
|
+
if (result.newCwd && result.newCwd !== currentDir) {
|
|
378
|
+
try {
|
|
379
|
+
process.chdir(result.newCwd);
|
|
380
|
+
currentDir = result.newCwd;
|
|
381
|
+
TUI.drawStatusBar(`Swarm moved to: ${currentDir}`);
|
|
382
|
+
} catch (e) {
|
|
383
|
+
// Silent catch if chdir fails
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (result.executed) {
|
|
388
|
+
if (result.success) {
|
|
389
|
+
TUI.log(chalk.gray('\n βΊ Auto-feeding output to Swarm...'));
|
|
390
|
+
TUI.drawGlowingContainer('TERMINAL OUTPUT', 'stdout', result.output || '(No output)');
|
|
391
|
+
messages.push({ role: 'user', content: `[Command executed successfully. Output:\n${result.output}]\n\nProceed to the next step, brother.` });
|
|
392
|
+
continue;
|
|
393
|
+
} else {
|
|
394
|
+
TUI.log(chalk.yellow('\n βΊ Command failed. Auto-feeding error to Swarm...'));
|
|
395
|
+
TUI.drawGlowingContainer('TERMINAL ERROR', 'stderr', result.error || 'Unknown error');
|
|
396
|
+
messages.push({ role: 'user', content: `[Command failed with error:\n${result.error}]\n\nPlease fix this, brother.` });
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
} else {
|
|
400
|
+
// Break the inner loop to await NEXT user input
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
} else break;
|
|
404
|
+
|
|
405
|
+
} catch (error: any) {
|
|
406
|
+
spinner.fail('Request failed');
|
|
407
|
+
TUI.log(chalk.red(`Error: ${error.message}\n`));
|
|
408
|
+
messages.pop();
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
} catch (error: any) {
|
|
414
|
+
TUI.exit();
|
|
415
|
+
console.error(chalk.red(`\nβ Fatal Error: ${error.message}`));
|
|
416
|
+
process.exit(1);
|
|
417
|
+
}
|
|
418
|
+
});
|