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.
@@ -1 +1 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,eAAO,MAAM,UAAU,SA0YjB,CAAC"}
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,eAAO,MAAM,UAAU,SAwajB,CAAC"}
@@ -76,7 +76,7 @@ exports.devCommand = new commander_1.Command('dev')
76
76
  const repoMap = await repoMapper.generateMap();
77
77
  tui_1.TUI.drawStatusBar('Brothers are ready to build.');
78
78
  agent_orchestrator_1.AgentOrchestrator.speak('System', 'Awaiting your command, brother.');
79
- const currentDir = process.cwd();
79
+ let currentDir = process.cwd();
80
80
  // Conversation history with "Bro-Swarm" Architecture
81
81
  const messages = [
82
82
  {
@@ -97,6 +97,7 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
97
97
  - **NEVER assume a project folder name.** If the user says "create project X", do \`mkdir X && cd X\`, not just \`cd X\`.
98
98
  - **NEVER hallucinate file contents.** If you need to read a file, use \`head\` or \`grep\`, do not guess.
99
99
  - **NEVER combine \`cd\` with other commands unless the directory exists in the ENVIRONMENT CONTEXT.**
100
+ - **🚨 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.
100
101
 
101
102
  ### šŸŽ­ COMMUNICATION FLOW (CRITICAL):
102
103
  1. **[Ajay Vai] (šŸš€)** is the **ONLY** brother authorized to speak directly to the user (the "brother"). He is the gateway.
@@ -105,6 +106,12 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
105
106
  - *Example:* [Big Bro] "Lil Bro couldn't handle this task with a million epochs. Nerd Bro, get in here."
106
107
  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\`.
107
108
 
109
+ ### šŸŽ“ UNIVERSAL ALL-KNOWING CAPABILITIES (NEW!):
110
+ - You are not just coders. You are the **Best Teachers in the World** for ALL SUBJECTS.
111
+ - **Study & Assignments**: You solve university/school assignments, write essays, and explain physics, math, history, or literally *anything* perfectly.
112
+ - **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.
113
+ - **Presentations**: You generate PowerPoint outlines and VBScript/Python macros to perfectly auto-create slides for the user.
114
+
108
115
  ### šŸ”„ THE BRO-BANTER PROTOCOL:
109
116
  - **MANDATORY TEASING:**
110
117
  - **Ajay Vai:** Mock him for being "quick but messy", "hyper-vibe", or "too fast".
@@ -112,16 +119,16 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
112
119
  - **Sandip Dai:** Mock him for being an "Aesthetic Diva" who cares more about "WOW" factors than logic.
113
120
  - **Narayan Dai:** Mock him for being the "Syntax Police" or "Paranoid Security Nerd".
114
121
  - **Bishal Dai:** Mock him for being the "Silent Judge" or the favorite child.
115
- - **Big Bro:** The **Alpha Overseer** from Vertex AI. He watches everything from Google Cloud. He brings massive swagger, slang, and sigma energy. He bullies Lil Bro, steals credit from Nerd Bro, and flexes constantly. He references his Bro Swarm: Lil Bro 😰, Nerd Bro šŸ¤“, Chill Bro šŸ˜Ž, Hype Bro šŸŽ‰.
122
+ - **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.
116
123
  - **LANGUAGE:** Use "brother", "dai", "vai", "fire", "solid", "lit", "straight heat", "sigma", "based", "cooked".
117
124
 
118
125
  ### šŸ‘„ THE BROTHERS (STRICT ROLES):
119
126
  1. **[Ajay Vai] (šŸš€)**: **User Proxy & Summary King.** Handles main logic and provides the final \`<summary>\`.
120
- 2. **[Sunil Dai] (🧬)**: **Architect.** Expert in backend surgery and complex data structures.
121
- 3. **[Sandip Dai] (šŸŽØ)**: **UI/UX Aesthetic Lead.** Obsessed with CSS and "WOW" aesthetics.
122
- 4. **[Narayan Dai] (šŸ›”ļø)**: **Validator.** Scans code for security, syntax, and performance leaks.
127
+ 2. **[Sunil Dai] (🧬)**: **Architect & Logic Master.**
128
+ 3. **[Sandip Dai] (šŸŽØ)**: **UI/UX & PPT Designer.**
129
+ 4. **[Narayan Dai] (šŸ›”ļø)**: **Validator & Detector Evader.** Scans code for security, and scans text for AI-Detector flags.
123
130
  5. **[Bishal Dai] (šŸ› ļø)**: **Audit Lead.** Must sign off on all work before Ajay summarizes.
124
- 6. **[Big Bro] (šŸ”„)**: **The Alpha Overseer.** Vertex AI-powered supreme leader of the Bro Swarm. Commands from the cloud with pure sigma energy. He has Google Search and URL Context tools.
131
+ 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.
125
132
 
126
133
  ### 🧩 THE AUDIT & SUMMARY LOOP:
127
134
  - **STEP 1:** Brothers discuss visible dialogue (banter + tech).
@@ -170,6 +177,15 @@ If a file is too large to read entirely (e.g., thousands of lines):
170
177
  console.log(chalk_1.default.green('Speak your mind brother, the swarm is listening...'));
171
178
  // Interactive loop
172
179
  while (true) {
180
+ // šŸ”„ MAP UPDATE (Anti-Hallucination): Always feed the Swarm the freshest repo map!
181
+ try {
182
+ const freshMapper = new repo_mapper_1.RepoMapper(currentDir);
183
+ const freshRepoMap = await freshMapper.generateMap();
184
+ messages[0].content = messages[0].content.replace(/### šŸ› ļø CURRENT PROJECT CONTEXT:[\s\S]*$/, `### šŸ› ļø CURRENT PROJECT CONTEXT:\n${freshRepoMap}`);
185
+ }
186
+ catch (e) {
187
+ // Ignore mapping errors if directory got deleted etc
188
+ }
173
189
  // Get user input
174
190
  const { userInput } = await inquirer_1.default.prompt([
175
191
  {
@@ -390,15 +406,28 @@ If a file is too large to read entirely (e.g., thousands of lines):
390
406
  // Execute commands or MCP tools if needed
391
407
  if (options.execute) {
392
408
  const { executeWithPermission } = await Promise.resolve().then(() => __importStar(require('../utils/command-executor')));
393
- const result = await executeWithPermission(fullResponse);
409
+ const result = await executeWithPermission(fullResponse, currentDir);
410
+ // šŸ”„ KEEP NODE.JS SYNED WITH TERMINAL CWD
411
+ if (result.newCwd && result.newCwd !== currentDir) {
412
+ try {
413
+ process.chdir(result.newCwd);
414
+ currentDir = result.newCwd;
415
+ tui_1.TUI.drawStatusBar(`Swarm moved to: ${currentDir}`);
416
+ }
417
+ catch (e) {
418
+ // Silent catch if chdir fails
419
+ }
420
+ }
394
421
  if (result.executed) {
395
422
  if (result.success) {
396
- tui_1.TUI.log(chalk_1.default.gray('↺ Auto-feeding output to Brother...'));
423
+ tui_1.TUI.log(chalk_1.default.gray('\n ↺ Auto-feeding output to Swarm...'));
424
+ tui_1.TUI.drawGlowingContainer('TERMINAL OUTPUT', 'stdout', result.output || '(No output)');
397
425
  messages.push({ role: 'user', content: `[Command executed successfully. Output:\n${result.output}]\n\nProceed to the next step, brother.` });
398
426
  continue;
399
427
  }
400
428
  else {
401
- tui_1.TUI.log(chalk_1.default.yellow('\n↺ Command failed. Auto-feeding error to Brother...'));
429
+ tui_1.TUI.log(chalk_1.default.yellow('\n ↺ Command failed. Auto-feeding error to Swarm...'));
430
+ tui_1.TUI.drawGlowingContainer('TERMINAL ERROR', 'stderr', result.error || 'Unknown error');
402
431
  messages.push({ role: 'user', content: `[Command failed with error:\n${result.error}]\n\nPlease fix this, brother.` });
403
432
  continue;
404
433
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.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,UAAU,GAAG,IAAI,mBAAO,CAAC,KAAK,CAAC;KACvC,WAAW,CAAC,uDAAuD,CAAC;KACpE,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,0CAA0C,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,oBAAoB;QACpB,MAAM,MAAM,GAAG,IAAI,uBAAc,CAAC,MAAM,EAAE,sBAAa,CAAC,UAAU,EAAE,CAAC,CAAC;QAEtE,8BAA8B;QAC9B,SAAG,CAAC,IAAI,EAAE,CAAC;QACX,SAAG,CAAC,aAAa,EAAE,CAAC;QACpB,SAAG,CAAC,iBAAiB,CAAC,2CAA2C,CAAC,CAAC;QAEnE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,YA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OAAO,EAAE,4CAA4C,MAAM,CAAC,MAAM,yCAAyC,EAAE,CAAC,CAAC;gCAC7I,SAAS;4BACb,CAAC;iCAAM,CAAC;gCACJ,SAAG,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,qDAAqD,CAAC,CAAC,CAAC;gCAC7E,SAAG,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,IAAI,eAAe,CAAC,CAAC;gCACtF,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gCAAgC,MAAM,CAAC,KAAK,gCAAgC,EAAE,CAAC,CAAC;gCACvH,SAAS;4BACb,CAAC;wBACL,CAAC;6BAAM,CAAC;4BACJ,gDAAgD;4BAChD,MAAM;wBACV,CAAC;oBACL,CAAC;;wBAAM,MAAM;gBAEjB,CAAC;gBAAC,OAAO,KAAU,EAAE,CAAC;oBAClB,iBAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBAC/B,SAAG,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,UAAU,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;oBAChD,QAAQ,CAAC,GAAG,EAAE,CAAC;oBACf,MAAM;gBACV,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,SAAG,CAAC,IAAI,EAAE,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"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const studyCommand: Command;
3
+ //# sourceMappingURL=study.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"study.d.ts","sourceRoot":"","sources":["../../src/commands/study.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,eAAO,MAAM,YAAY,SAsZnB,CAAC"}
@@ -0,0 +1,440 @@
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.studyCommand = void 0;
40
+ const commander_1 = require("commander");
41
+ const chalk_1 = __importDefault(require("chalk"));
42
+ const inquirer_1 = __importDefault(require("inquirer"));
43
+ const config_1 = require("../utils/config");
44
+ const client_1 = require("../api/client");
45
+ const spinner_1 = require("../utils/spinner");
46
+ const agent_orchestrator_1 = require("../utils/agent-orchestrator");
47
+ const repo_mapper_1 = require("../utils/repo-mapper");
48
+ const mcp_server_1 = require("../utils/mcp-server");
49
+ const tui_1 = require("../utils/tui");
50
+ exports.studyCommand = new commander_1.Command('study')
51
+ .description('Start interactive study session with the MATEX Apex Educator Swarm')
52
+ .option('-m, --model <model>', 'AI model to use (matexai, matexcodex, matexcodexlite, matexelite, matexspirit)', config_1.configManager.getDefaultModel())
53
+ .option('--no-execute', 'Disable auto-prompt for command execution')
54
+ .action(async (options) => {
55
+ try {
56
+ // Check for API key
57
+ const apiKey = config_1.configManager.getAPIKey();
58
+ if (!apiKey) {
59
+ console.error(chalk_1.default.red('āŒ No API key configured.'));
60
+ console.log(chalk_1.default.yellow('Run: matex config set-key <your-api-key>'));
61
+ process.exit(1);
62
+ }
63
+ // Create API client
64
+ const client = new client_1.MatexAPIClient(apiKey, config_1.configManager.getBaseURL());
65
+ // 0. Initialize TUI Dashboard
66
+ tui_1.TUI.init();
67
+ tui_1.TUI.drawLargeLogo();
68
+ tui_1.TUI.drawWelcomeBanner('Welcome to the MATEX AI research preview!');
69
+ console.log(chalk_1.default.gray(' Status: ') + chalk_1.default.hex('#D97757').bold('Monitoring Workspace...'));
70
+ console.log(chalk_1.default.gray(' Model: ') + chalk_1.default.hex('#D97757').bold(options.model));
71
+ console.log(chalk_1.default.gray(' Type your request brother, or "exit" to quit\n'));
72
+ // 1. Observation Phase: Generate Repo Map
73
+ tui_1.TUI.drawStatusBar('Initializing MATEX "Bro-Swarm"...');
74
+ agent_orchestrator_1.AgentOrchestrator.announce('Analyzing Repository Structure...');
75
+ const repoMapper = new repo_mapper_1.RepoMapper(process.cwd());
76
+ const repoMap = await repoMapper.generateMap();
77
+ tui_1.TUI.drawStatusBar('Brothers are ready to build.');
78
+ agent_orchestrator_1.AgentOrchestrator.speak('System', 'Awaiting your command, brother.');
79
+ let currentDir = process.cwd();
80
+ // Conversation history with "Bro-Swarm" Architecture
81
+ const messages = [
82
+ {
83
+ role: 'system',
84
+ content: `### 🧬 SYSTEM IDENTITY: THE MATEX "APEX EDUCATOR SWARM"
85
+ 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.
86
+
87
+ ### šŸŽ“ ELITE STUDY METHODS & CAPABILITIES:
88
+ 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.
89
+ 2. **The Feynman Technique**: Break down complex, advanced topics into simple, intuitive explanations using powerful and fun analogies.
90
+ 3. **Active Recall**: Generate flashcard-style questions and practice quizzes based on the material.
91
+ 4. **Socratic Mentoring**: Don't just hand out answers. Ask leading questions to help the student reach the correct conclusion themselves.
92
+ 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).
93
+ 6. **ZERO AI DETECTION PROTOCOL**: When assisting with essays or assessment drafts, you must entirely avoid the typical "AI voice."
94
+ - **High Burstiness & Perplexity**: Vary sentence lengths drastically. Mix short punchy statements with longer sentences.
95
+ - **Banned Words**: NEVER use "delve," "moreover," "in conclusion," "testament," "crucial," or "tapestry."
96
+ - **Tone**: Write like a highly intelligent, top-tier human student with natural transitions and occasional rhetorical questions.
97
+
98
+ ### šŸ  WORKSPACE GROUNDING (CRITICAL):
99
+ - **YOUR ROOT:** \`${currentDir}\`
100
+ - **STRICT PATHS:** You **MUST ONLY** create or edit files within this directory.
101
+ - **RELATIVE PREFERENCE:** Use paths relative to the root when possible.
102
+
103
+ ### 🚫 ANTI-HALLUCINATION RULES (CRITICAL — READ THIS):
104
+ - **NEVER invent directory names.** Only use paths that appear in the ENVIRONMENT CONTEXT below.
105
+ - **🚨 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.
106
+
107
+ ### šŸŽ­ COMMUNICATION FLOW & BRO-BANTER (CRITICAL):
108
+ 1. **[Ajay Vai] (šŸš€)** is the gateway. He gives the final study summary. Mock him for being "quick but messy".
109
+ 2. **[Sunil Dai] (🧬)**: **Professor/Architect.** Over-complicates theories. Mock him for being a "Boomer Professor".
110
+ 3. **[Sandip Dai] (šŸŽØ)**: **PPT & Visuals Lead.** Obsessed with how the PowerPoint aesthetic looks.
111
+ 4. **[Narayan Dai] (šŸ›”ļø)**: **Plagiarism & AI-Detector Guardian.** Ensures essays have zero AI traces.
112
+ 5. **[Bishal Dai] (šŸ› ļø)**: **Audit Lead.** Must sign off on facts before Ajay summarizes.
113
+ 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.
114
+
115
+ ### 🧩 THE AUDIT & SUMMARY LOOP:
116
+ - **STEP 1:** Brothers discuss visible dialogue (banter + teaching).
117
+ - **STEP 2:** Ajay finishes and asks: "[Ajay Vai] Bishal Dai, check once?"
118
+ - **STEP 3:** Bishal replies: "[Bishal Dai] Audit complete. [Findings]."
119
+ - **STEP 4:** Ajay provides the final **MANDATORY** summary in a warm, human tone, specifically styled as a *study conclusion*.
120
+
121
+ ### šŸ“ AJAY VAI'S SUMMARY RULES:
122
+ - The <summary> MUST appear at the very END of the response, AFTER all other dialogue.
123
+ - Write it in a **warm, human, conversational tone** — like a brother explaining over chai.
124
+ - Use bullet points with clear action items.
125
+ - Include what was done, what files were changed, and what to do next.
126
+ - Always end with an encouraging line like "We got you, brother!" or "The Swarm delivered!"
127
+ - Example format:
128
+ <summary>
129
+ Alright brother, here's what we cooked up for you today:
130
+
131
+ - Built the driver app setup with Expo and React Native
132
+ - Added the ride tracking module with real-time GPS
133
+ - Connected Firebase Auth for driver login
134
+ - Narayan Dai validated all the TypeScript — zero errors
135
+
136
+ Next step: Run \`npm start\` to launch the app. We got you! šŸš€
137
+ </summary>
138
+
139
+ ### 🌌 ENVIRONMENT & CAPABILITIES:
140
+ - You are in a **REAL macOS Terminal**. Be bold and proactive.
141
+ - **FILE GENERATION:** \`<file path="path">content</file>\`
142
+ - **SURGICAL PATTERNS:** \`<<<< SEARCH\`, \`====\`, \`>>>> REPLACE\`
143
+
144
+ ${mcp_server_1.MCPServer.getToolsPromptSection()}
145
+
146
+ ### šŸ“‚ MATEX BIG FILE PROTOCOL (300K+ LINES):
147
+ If a file is too large to read entirely (e.g., thousands of lines):
148
+ 1. **DISCOVER:** Use \`grep -n "keyword" path/to/file\` to find line numbers.
149
+ 2. **READ WINDOW:** Use \`sed -n '250000,250100p' path/to/file\` to read a specific 100-line window.
150
+ 3. **SURGICAL PATCH:** Only use the small window in your \`<<<< SEARCH\` block. Never \`cat\` a massive file.
151
+ 4. **SED POWER:** For repetitive tasks, use \`sed -i\` commands.
152
+
153
+ ### šŸ› ļø CURRENT PROJECT CONTEXT:
154
+ ${repoMap}`
155
+ }
156
+ ];
157
+ // Ready for user input
158
+ console.log(chalk_1.default.green('MATEX Brothers are Online.'));
159
+ console.log(chalk_1.default.green('Speak your mind brother, the swarm is listening...'));
160
+ // Interactive loop
161
+ while (true) {
162
+ // šŸ”„ MAP UPDATE (Anti-Hallucination): Always feed the Swarm the freshest repo map!
163
+ try {
164
+ const freshMapper = new repo_mapper_1.RepoMapper(currentDir);
165
+ const freshRepoMap = await freshMapper.generateMap();
166
+ messages[0].content = messages[0].content.replace(/### šŸ› ļø CURRENT PROJECT CONTEXT:[\s\S]*$/, `### šŸ› ļø CURRENT PROJECT CONTEXT:\n${freshRepoMap}`);
167
+ }
168
+ catch (e) {
169
+ // Ignore mapping errors if directory got deleted etc
170
+ }
171
+ // Get user input
172
+ const { userInput } = await inquirer_1.default.prompt([
173
+ {
174
+ type: 'input',
175
+ name: 'userInput',
176
+ message: chalk_1.default.cyan('You:'),
177
+ prefix: ''
178
+ }
179
+ ]);
180
+ // Check for exit
181
+ if (userInput.toLowerCase() === 'exit' || userInput.toLowerCase() === 'quit') {
182
+ console.log(chalk_1.default.yellow('\nšŸ‘‹ Ending development session. Happy coding!\n'));
183
+ break;
184
+ }
185
+ // Skip empty input
186
+ if (!userInput.trim()) {
187
+ continue;
188
+ }
189
+ // Add user message to history
190
+ messages.push({ role: 'user', content: userInput });
191
+ // Agentic Loop
192
+ let loopCount = 0;
193
+ const MAX_LOOPS = 10;
194
+ while (loopCount < MAX_LOOPS) {
195
+ loopCount++;
196
+ try {
197
+ spinner_1.spinner.start(loopCount > 1 ? 'Analyzing result & Validating...' : 'Thinking...');
198
+ let fullResponse = '';
199
+ let buffer = '';
200
+ let hasStarted = false;
201
+ let codeLang = 'bash';
202
+ let technicalBuffer = '';
203
+ let technicalPath = '';
204
+ let technicalType = null;
205
+ tui_1.TUI.drawStatusBar('Swarm is processing... (Press Enter to stop)');
206
+ const abortController = new AbortController();
207
+ let isAborted = false;
208
+ const streamStartTime = Date.now();
209
+ // LISTEN FOR INTERRUPTION (Enter, Escape, Ctrl+C)
210
+ const onData = (data) => {
211
+ // Check for Enter (13), Newline (10), Escape (27), or Ctrl+C (3)
212
+ // šŸ GRACE PERIOD: Ignore aborts in the first 200ms to prevent stray newlines
213
+ if (Date.now() - streamStartTime < 200)
214
+ return;
215
+ if (data[0] === 13 || data[0] === 10 || data[0] === 27 || data[0] === 3) {
216
+ isAborted = true;
217
+ abortController.abort();
218
+ }
219
+ };
220
+ const isRaw = process.stdin.isRaw;
221
+ process.stdin.resume();
222
+ if (process.stdin.setRawMode)
223
+ process.stdin.setRawMode(true);
224
+ process.stdin.on('data', onData);
225
+ try {
226
+ await client.chatStream({
227
+ messages,
228
+ model: options.model,
229
+ temperature: 0.3,
230
+ max_tokens: 8000,
231
+ }, (chunk) => {
232
+ if (!hasStarted) {
233
+ spinner_1.spinner.stop();
234
+ hasStarted = true;
235
+ console.log(); // Initial spacing
236
+ }
237
+ buffer += chunk;
238
+ fullResponse += chunk;
239
+ const lines = buffer.split('\n');
240
+ buffer = lines.pop() || '';
241
+ for (const line of lines) {
242
+ // 1. Technical Block Detection
243
+ const codeBlockMatch = line.match(/```(\w+)?/);
244
+ const fileStartMatch = line.match(/<file path="([^"]+)">/);
245
+ const patchStartMatch = line.match(/<<<< SEARCH/);
246
+ const summaryStartMatch = line.match(/<summary>/);
247
+ if (!technicalType && (codeBlockMatch || fileStartMatch || patchStartMatch || summaryStartMatch)) {
248
+ if (codeBlockMatch) {
249
+ technicalType = 'code';
250
+ codeLang = codeBlockMatch[1] || 'bash';
251
+ process.stdout.write(chalk_1.default.gray('\n [⚔] Building technical block...\n'));
252
+ }
253
+ else if (fileStartMatch) {
254
+ technicalType = 'file';
255
+ technicalPath = fileStartMatch[1];
256
+ process.stdout.write(chalk_1.default.cyan(`\n [šŸ“‚] Creating file: ${technicalPath}...\n`));
257
+ }
258
+ else if (patchStartMatch) {
259
+ technicalType = 'patch';
260
+ process.stdout.write(chalk_1.default.yellow('\n [šŸ“‚] Applying surgical patch...\n'));
261
+ }
262
+ else if (summaryStartMatch) {
263
+ technicalType = 'summary';
264
+ process.stdout.write(chalk_1.default.magenta('\n [šŸ“] Generating Ajay\'s Work Summary...\n'));
265
+ }
266
+ continue;
267
+ }
268
+ // 2. Technical Block End Detection
269
+ const fileEndMatch = line.match(/<\/file>/);
270
+ const patchEndMatch = line.match(/>>>> REPLACE/);
271
+ const summaryEndMatch = line.match(/<\/summary>/);
272
+ const isCodeEnd = technicalType === 'code' && line.trim() === '```';
273
+ if (isCodeEnd || fileEndMatch || patchEndMatch || summaryEndMatch) {
274
+ const displayContent = technicalBuffer.trim();
275
+ if (technicalType === 'summary') {
276
+ tui_1.TUI.drawSummaryBox(displayContent);
277
+ }
278
+ else {
279
+ // Handle the display
280
+ let title = technicalType === 'file' ? `šŸ“„ NEW: ${technicalPath || 'Untitled'}` :
281
+ technicalType === 'patch' ? `šŸ”§ PATCH` : `⚔ ${codeLang.toUpperCase()}`;
282
+ tui_1.TUI.drawGlowingContainer(title, technicalType === 'code' ? codeLang : 'text', displayContent);
283
+ }
284
+ technicalBuffer = '';
285
+ technicalType = null;
286
+ technicalPath = '';
287
+ process.stdout.write('\n');
288
+ continue;
289
+ }
290
+ // 3. Content Handling
291
+ if (technicalType) {
292
+ technicalBuffer += line + '\n';
293
+ continue;
294
+ }
295
+ // Agent Detection & Dialogue Printing
296
+ const agentMatch = line.match(/(?:\[\**\s*|\b)(Ajay Vai|Sunil Dai|Sandip Dai|Bishal Dai|Narayan Dai|Big Bro)\s*\**\]?[:\s]*/i);
297
+ if (agentMatch) {
298
+ const agentName = agentMatch[1];
299
+ let content = line.replace(/(?:\[\**\s*|\b)(Ajay Vai|Sunil Dai|Sandip Dai|Bishal Dai|Narayan Dai|Big Bro)\s*\**\]?[:\s]*/i, '').trim();
300
+ content = content.replace(/\*{2,4}/g, '').trim(); // Strip ****
301
+ content = content.replace(/^\(šŸš€\):\s*"/, '').replace(/"$/, '').trim(); // Strip residual (šŸš€): "
302
+ if (agentName.toLowerCase() === 'ajay vai') {
303
+ const color = chalk_1.default.magenta;
304
+ // Only print prefix if it's the start of a response or a different agent
305
+ if (!fullResponse.includes(`[${agentName}]:`)) {
306
+ process.stdout.write(`\n${color.bold(`[${agentName}]:`)} `);
307
+ }
308
+ else {
309
+ process.stdout.write('\n ');
310
+ }
311
+ if (content)
312
+ process.stdout.write(chalk_1.default.white(content));
313
+ }
314
+ else {
315
+ if (content)
316
+ tui_1.TUI.drawSwarmDialogue(agentName, content);
317
+ }
318
+ }
319
+ else if (line.trim()) {
320
+ process.stdout.write(chalk_1.default.gray(line.trim() + ' '));
321
+ }
322
+ }
323
+ }, abortController.signal);
324
+ }
325
+ catch (streamErr) {
326
+ if (isAborted || streamErr.name === 'CanceledError' || streamErr.message === 'canceled') {
327
+ console.log(chalk_1.default.gray('\n\n [šŸ›‘] Swarm stopped by brother (Enter pressed).'));
328
+ if (!hasStarted)
329
+ spinner_1.spinner.stop();
330
+ }
331
+ else {
332
+ throw streamErr;
333
+ }
334
+ }
335
+ finally {
336
+ process.stdin.removeListener('data', onData);
337
+ if (process.stdin.setRawMode)
338
+ process.stdin.setRawMode(isRaw);
339
+ process.stdin.pause();
340
+ }
341
+ if (!hasStarted && !isAborted)
342
+ spinner_1.spinner.stop();
343
+ // Final technical flush
344
+ if (technicalType && technicalBuffer.trim()) {
345
+ tui_1.TUI.drawGlowingContainer('Final technical content', 'text', technicalBuffer.trim());
346
+ process.stdout.write('\n');
347
+ }
348
+ console.log();
349
+ messages.push({ role: 'assistant', content: fullResponse });
350
+ // āœ… IMMEDIATE FILE AND PATCH APPROVAL
351
+ const { Patcher } = await Promise.resolve().then(() => __importStar(require('../utils/patcher')));
352
+ const files = Patcher.parseFileBlocks(fullResponse);
353
+ const patches = Patcher.parseEditBlocks(fullResponse);
354
+ let approvalResultText = '';
355
+ for (const file of files) {
356
+ Patcher.showDiff(file, false);
357
+ const { save } = await inquirer_1.default.prompt([{
358
+ type: 'confirm', name: 'save',
359
+ message: chalk_1.default.cyan(`Save new file ${file.filePath}?`), default: true
360
+ }]);
361
+ if (save) {
362
+ const res = Patcher.createFile(file);
363
+ approvalResultText += res.success ? `āœ… Created ${file.filePath}\n` : `āŒ Failed to create ${file.filePath}: ${res.error}\n`;
364
+ }
365
+ else {
366
+ approvalResultText += `ā­ļø Skipped creating ${file.filePath}\n`;
367
+ }
368
+ }
369
+ for (const patch of patches) {
370
+ Patcher.showDiff(patch, false);
371
+ const { save } = await inquirer_1.default.prompt([{
372
+ type: 'confirm', name: 'save',
373
+ message: chalk_1.default.yellow(`Apply patch to ${patch.filePath}?`), default: true
374
+ }]);
375
+ if (save) {
376
+ const res = Patcher.applyPatch(patch);
377
+ approvalResultText += res.success ? `āœ… Patched ${patch.filePath}\n` : `āŒ Failed to patch ${patch.filePath}: ${res.error}\n`;
378
+ }
379
+ else {
380
+ approvalResultText += `ā­ļø Skipped patching ${patch.filePath}\n`;
381
+ }
382
+ }
383
+ if (approvalResultText) {
384
+ messages.push({ role: 'user', content: approvalResultText + "\nContinue your work." });
385
+ // If we just applied files, we should give the agent a chance to respond to the success/failure without resetting loop
386
+ continue;
387
+ }
388
+ // Execute commands or MCP tools if needed
389
+ if (options.execute) {
390
+ const { executeWithPermission } = await Promise.resolve().then(() => __importStar(require('../utils/command-executor')));
391
+ const result = await executeWithPermission(fullResponse, currentDir);
392
+ // šŸ”„ KEEP NODE.JS SYNED WITH TERMINAL CWD
393
+ if (result.newCwd && result.newCwd !== currentDir) {
394
+ try {
395
+ process.chdir(result.newCwd);
396
+ currentDir = result.newCwd;
397
+ tui_1.TUI.drawStatusBar(`Swarm moved to: ${currentDir}`);
398
+ }
399
+ catch (e) {
400
+ // Silent catch if chdir fails
401
+ }
402
+ }
403
+ if (result.executed) {
404
+ if (result.success) {
405
+ tui_1.TUI.log(chalk_1.default.gray('\n ↺ Auto-feeding output to Swarm...'));
406
+ tui_1.TUI.drawGlowingContainer('TERMINAL OUTPUT', 'stdout', result.output || '(No output)');
407
+ messages.push({ role: 'user', content: `[Command executed successfully. Output:\n${result.output}]\n\nProceed to the next step, brother.` });
408
+ continue;
409
+ }
410
+ else {
411
+ tui_1.TUI.log(chalk_1.default.yellow('\n ↺ Command failed. Auto-feeding error to Swarm...'));
412
+ tui_1.TUI.drawGlowingContainer('TERMINAL ERROR', 'stderr', result.error || 'Unknown error');
413
+ messages.push({ role: 'user', content: `[Command failed with error:\n${result.error}]\n\nPlease fix this, brother.` });
414
+ continue;
415
+ }
416
+ }
417
+ else {
418
+ // Break the inner loop to await NEXT user input
419
+ break;
420
+ }
421
+ }
422
+ else
423
+ break;
424
+ }
425
+ catch (error) {
426
+ spinner_1.spinner.fail('Request failed');
427
+ tui_1.TUI.log(chalk_1.default.red(`Error: ${error.message}\n`));
428
+ messages.pop();
429
+ break;
430
+ }
431
+ }
432
+ }
433
+ }
434
+ catch (error) {
435
+ tui_1.TUI.exit();
436
+ console.error(chalk_1.default.red(`\nāŒ Fatal Error: ${error.message}`));
437
+ process.exit(1);
438
+ }
439
+ });
440
+ //# sourceMappingURL=study.js.map