matex-cli 1.2.43 โ 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/chat.js +1 -1
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +91 -17
- 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 +5 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/tui.d.ts +2 -2
- package/dist/utils/tui.d.ts.map +1 -1
- package/dist/utils/tui.js +34 -8
- package/dist/utils/tui.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/chat.ts +1 -1
- package/src/commands/dev.ts +97 -21
- package/src/commands/study.ts +418 -0
- package/src/index.ts +6 -3
- package/src/utils/tui.ts +40 -8
|
@@ -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
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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.
|
|
@@ -228,8 +231,8 @@ ${context}`
|
|
|
228
231
|
tui_1.TUI.drawSummaryBox(displayContent);
|
|
229
232
|
}
|
|
230
233
|
else {
|
|
231
|
-
tui_1.TUI.
|
|
232
|
-
technicalType === 'patch' ? '
|
|
234
|
+
tui_1.TUI.drawGlowingContainer(technicalType === 'file' ? 'New File' :
|
|
235
|
+
technicalType === 'patch' ? 'Patch' : 'Code Block', technicalType === 'code' ? codeLang : 'text', displayContent);
|
|
233
236
|
}
|
|
234
237
|
technicalBuffer = '';
|
|
235
238
|
technicalType = null;
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAo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,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/dist/utils/tui.d.ts
CHANGED
|
@@ -30,9 +30,9 @@ export declare class TUI {
|
|
|
30
30
|
*/
|
|
31
31
|
static drawBox(title: string, content: string, color?: (s: string) => string): void;
|
|
32
32
|
/**
|
|
33
|
-
* Draw a
|
|
33
|
+
* Draw a premium glowing code container (turns cyan)
|
|
34
34
|
*/
|
|
35
|
-
static
|
|
35
|
+
static drawGlowingContainer(title: string, language: string, content: string): void;
|
|
36
36
|
/**
|
|
37
37
|
* Draw Ajay Vai's premium summary with a human chat bubble vibe
|
|
38
38
|
*/
|
package/dist/utils/tui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../../src/utils/tui.ts"],"names":[],"mappings":"AAIA,qBAAa,GAAG;IACZ,OAAO,CAAC,MAAM,CAAC,aAAa,CAAS;IACrC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAM;IAE/B;;OAEG;IACH,MAAM,CAAC,IAAI;IAYX;;OAEG;IACH,MAAM,CAAC,IAAI;IAQX;;OAEG;IACH,MAAM,CAAC,KAAK;IAIZ;;OAEG;IACH,MAAM,CAAC,aAAa;IAQpB;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM;IAIxC;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAqB,EAAE,KAAK,GAAE,OAAe;IAuB1F;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAmB;IAMxF;;OAEG;IACH,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../../src/utils/tui.ts"],"names":[],"mappings":"AAIA,qBAAa,GAAG;IACZ,OAAO,CAAC,MAAM,CAAC,aAAa,CAAS;IACrC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAM;IAE/B;;OAEG;IACH,MAAM,CAAC,IAAI;IAYX;;OAEG;IACH,MAAM,CAAC,IAAI;IAQX;;OAEG;IACH,MAAM,CAAC,KAAK;IAIZ;;OAEG;IACH,MAAM,CAAC,aAAa;IAQpB;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM;IAIxC;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAqB,EAAE,KAAK,GAAE,OAAe;IAuB1F;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAmB;IAMxF;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAyC5E;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM;IA0DrC;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAS1D;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IA6EvD;;OAEG;IACH,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM;CAG7B"}
|
package/dist/utils/tui.js
CHANGED
|
@@ -77,7 +77,7 @@ class TUI {
|
|
|
77
77
|
โโโโโ โโโ โโโ โโโ โโโ โโโ โ
|
|
78
78
|
โ โ โ โโโ โ โโโ โ โ โโโ โ
|
|
79
79
|
`;
|
|
80
|
-
console.log(chalk_1.default.hex('#
|
|
80
|
+
console.log(chalk_1.default.hex('#0de306ff').bold(logo));
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* Draw a clean welcome message
|
|
@@ -119,15 +119,41 @@ class TUI {
|
|
|
119
119
|
console.log(color('---------------------------------'));
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
|
-
* Draw a
|
|
122
|
+
* Draw a premium glowing code container (turns cyan)
|
|
123
123
|
*/
|
|
124
|
-
static
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
static drawGlowingContainer(title, language, content) {
|
|
125
|
+
const width = Math.min(process.stdout.columns || 80, 100);
|
|
126
|
+
const innerWidth = width - 4;
|
|
127
|
+
// Premium Cyan Glow
|
|
128
|
+
const glow = chalk_1.default.hex('#06b6d4');
|
|
129
|
+
const bright = chalk_1.default.hex('#22d3ee');
|
|
130
|
+
const dark = chalk_1.default.hex('#164e63');
|
|
131
|
+
console.log();
|
|
132
|
+
// Top shadow/glow
|
|
133
|
+
console.log(dark(` .${'ยท'.repeat(width - 4)}.`));
|
|
134
|
+
// Header
|
|
135
|
+
const headerText = ` ${title} [${language}] `;
|
|
136
|
+
const headerPad = Math.max(0, innerWidth - headerText.length);
|
|
137
|
+
console.log(glow(' โญโ') + bright.bold.bgHex('#083344')(headerText) + glow('โ'.repeat(headerPad - 2)) + glow('โฎ'));
|
|
138
|
+
// Content
|
|
139
|
+
const lines = content.split('\n');
|
|
140
|
+
// Limit display to 20 lines to keep it small/compact
|
|
141
|
+
const displayLines = lines.length > 20 ? lines.slice(0, 18) : lines;
|
|
142
|
+
displayLines.forEach(line => {
|
|
143
|
+
// Trim to width
|
|
144
|
+
const displayLine = line.length > innerWidth - 2 ? line.substring(0, innerWidth - 5) + '...' : line;
|
|
145
|
+
const pad = Math.max(0, innerWidth - 2 - displayLine.length);
|
|
146
|
+
console.log(glow(' โ ') + chalk_1.default.white(displayLine) + ' '.repeat(pad) + glow(' โ'));
|
|
129
147
|
});
|
|
130
|
-
|
|
148
|
+
if (lines.length > 20) {
|
|
149
|
+
const hiddenText = chalk_1.default.italic.gray(`... ${lines.length - 18} more lines ...`);
|
|
150
|
+
const pad = Math.max(0, innerWidth - 2 - (`... ${lines.length - 18} more lines ...`).length);
|
|
151
|
+
console.log(glow(' โ ') + hiddenText + ' '.repeat(pad) + glow(' โ'));
|
|
152
|
+
}
|
|
153
|
+
// Footer
|
|
154
|
+
console.log(glow(' โฐ' + 'โ'.repeat(innerWidth) + 'โฏ'));
|
|
155
|
+
console.log(dark(` '${'ยท'.repeat(width - 4)}'`));
|
|
156
|
+
console.log();
|
|
131
157
|
}
|
|
132
158
|
/**
|
|
133
159
|
* Draw Ajay Vai's premium summary with a human chat bubble vibe
|