matex-cli 1.2.42 → 1.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +34 -9
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +90 -18
- package/dist/commands/dev.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/mcp-server.d.ts +77 -0
- package/dist/utils/mcp-server.d.ts.map +1 -0
- package/dist/utils/mcp-server.js +390 -0
- package/dist/utils/mcp-server.js.map +1 -0
- package/dist/utils/repo-mapper.d.ts.map +1 -1
- package/dist/utils/repo-mapper.js +11 -0
- package/dist/utils/repo-mapper.js.map +1 -1
- package/dist/utils/spinner.d.ts +3 -0
- package/dist/utils/spinner.d.ts.map +1 -1
- package/dist/utils/spinner.js +16 -7
- package/dist/utils/spinner.js.map +1 -1
- package/dist/utils/tui.d.ts +4 -4
- package/dist/utils/tui.d.ts.map +1 -1
- package/dist/utils/tui.js +112 -25
- package/dist/utils/tui.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/chat.ts +34 -9
- package/src/commands/dev.ts +95 -22
- package/src/index.ts +3 -3
- package/src/utils/mcp-server.ts +388 -0
- package/src/utils/repo-mapper.ts +11 -0
- package/src/utils/spinner.ts +16 -7
- package/src/utils/tui.ts +122 -25
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,28 +119,98 @@ 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
|
-
* Draw
|
|
159
|
+
* Draw Ajay Vai's premium summary with a human chat bubble vibe
|
|
134
160
|
*/
|
|
135
161
|
static drawSummaryBox(content) {
|
|
136
|
-
|
|
162
|
+
const width = Math.min(process.stdout.columns || 80, 76);
|
|
163
|
+
const innerWidth = width - 6;
|
|
164
|
+
const magenta = chalk_1.default.hex('#ff69b4');
|
|
165
|
+
const pinkBright = chalk_1.default.hex('#ff99cc');
|
|
166
|
+
const pinkGlow = chalk_1.default.hex('#ffccee');
|
|
167
|
+
console.log();
|
|
168
|
+
// Timestamp for chat realism
|
|
169
|
+
const time = new Date().toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' });
|
|
170
|
+
console.log(chalk_1.default.gray(` ╭─ [${time}] ──────────────────────────────`));
|
|
171
|
+
// Header mimicking WhatsApp / iMessage chat interface
|
|
172
|
+
const headerText = '🚀 Ajay Vai';
|
|
173
|
+
const typingText = chalk_1.default.italic.gray('sent you a message');
|
|
174
|
+
console.log(` │ ${magenta.bold(headerText)} ${typingText}`);
|
|
175
|
+
// Chat bubble top
|
|
176
|
+
console.log(pinkGlow(` ╭${'─'.repeat(width - 4)}╮`));
|
|
177
|
+
// Content with chat bubble formatting
|
|
137
178
|
const lines = content.split('\n');
|
|
138
179
|
lines.forEach(line => {
|
|
139
|
-
if (line.trim())
|
|
140
|
-
|
|
141
|
-
|
|
180
|
+
if (!line.trim())
|
|
181
|
+
return;
|
|
182
|
+
const trimmed = line.trim();
|
|
183
|
+
// Word wrap
|
|
184
|
+
const words = trimmed.split(' ');
|
|
185
|
+
let currentLine = '';
|
|
186
|
+
const wrappedLines = [];
|
|
187
|
+
words.forEach(word => {
|
|
188
|
+
if ((currentLine + ' ' + word).trim().length <= innerWidth) {
|
|
189
|
+
currentLine = currentLine ? currentLine + ' ' + word : word;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
if (currentLine)
|
|
193
|
+
wrappedLines.push(currentLine);
|
|
194
|
+
currentLine = word.length > innerWidth ? word.substring(0, innerWidth) : word;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
if (currentLine)
|
|
198
|
+
wrappedLines.push(currentLine);
|
|
199
|
+
wrappedLines.forEach(wl => {
|
|
200
|
+
const linePad = Math.max(0, innerWidth - wl.length);
|
|
201
|
+
// Keep bullet formatting but tone down the robotic feel
|
|
202
|
+
if (wl.startsWith('- ') || wl.startsWith('• ') || wl.match(/^\d+\./)) {
|
|
203
|
+
console.log(pinkGlow(' │ ') + magenta('• ') + chalk_1.default.white(wl.replace(/^[-•]\s*/, '').replace(/^\d+\.\s*/, '')) + ' '.repeat(Math.max(0, linePad - 2)) + pinkGlow(' │'));
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
console.log(pinkGlow(' │ ') + chalk_1.default.white(wl) + ' '.repeat(linePad) + pinkGlow(' │'));
|
|
207
|
+
}
|
|
208
|
+
});
|
|
142
209
|
});
|
|
143
|
-
|
|
210
|
+
// Chat bubble bottom
|
|
211
|
+
console.log(pinkGlow(` ╰${'─'.repeat(width - 4)}╯`));
|
|
212
|
+
console.log(chalk_1.default.gray(` ╰──────────────────────────────────────────`));
|
|
213
|
+
console.log();
|
|
144
214
|
}
|
|
145
215
|
/**
|
|
146
216
|
* Draw a specialized message container for agents
|
|
@@ -153,7 +223,7 @@ class TUI {
|
|
|
153
223
|
this.drawBox(`🤖 ${agent}`, message, color);
|
|
154
224
|
}
|
|
155
225
|
/**
|
|
156
|
-
* Draw a
|
|
226
|
+
* Draw a premium glowing dialogue container for Swarm agents
|
|
157
227
|
*/
|
|
158
228
|
static drawSwarmDialogue(agent, message) {
|
|
159
229
|
const isBigBro = agent.includes('Big Bro');
|
|
@@ -166,7 +236,19 @@ class TUI {
|
|
|
166
236
|
agent.includes('Nerd') ? chalk_1.default.hex('#06b6d4') :
|
|
167
237
|
agent.includes('Chill') ? chalk_1.default.hex('#22c55e') :
|
|
168
238
|
agent.includes('Lil') ? chalk_1.default.hex('#888888') :
|
|
169
|
-
chalk_1.default.green
|
|
239
|
+
agent.includes('Narayan') ? chalk_1.default.green :
|
|
240
|
+
chalk_1.default.green;
|
|
241
|
+
// Glow color is a brighter version of the agent color
|
|
242
|
+
const glowColor = isBigBro ? chalk_1.default.hex('#FF9642') :
|
|
243
|
+
agent.includes('Ajay') ? chalk_1.default.hex('#ff77ff') :
|
|
244
|
+
agent.includes('Sunil') ? chalk_1.default.hex('#66aaff') :
|
|
245
|
+
agent.includes('Sandip') ? chalk_1.default.hex('#ff99cc') :
|
|
246
|
+
agent.includes('Bishal') ? chalk_1.default.hex('#ffee66') :
|
|
247
|
+
agent.includes('Hype') ? chalk_1.default.hex('#ffe066') :
|
|
248
|
+
agent.includes('Nerd') ? chalk_1.default.hex('#33ddee') :
|
|
249
|
+
agent.includes('Chill') ? chalk_1.default.hex('#66ff88') :
|
|
250
|
+
agent.includes('Lil') ? chalk_1.default.hex('#aaaaaa') :
|
|
251
|
+
chalk_1.default.hex('#66ff88');
|
|
170
252
|
const icon = isBigBro ? '🔥' :
|
|
171
253
|
agent.includes('Ajay') ? '🚀' :
|
|
172
254
|
agent.includes('Sunil') ? '🧬' :
|
|
@@ -175,17 +257,20 @@ class TUI {
|
|
|
175
257
|
agent.includes('Hype') ? '🎉' :
|
|
176
258
|
agent.includes('Nerd') ? '🤓' :
|
|
177
259
|
agent.includes('Chill') ? '😎' :
|
|
178
|
-
agent.includes('Lil') ? '😰' :
|
|
260
|
+
agent.includes('Lil') ? '😰' :
|
|
261
|
+
agent.includes('Narayan') ? '🛡️' : '🛡️';
|
|
179
262
|
const width = Math.min(process.stdout.columns || 80, 76);
|
|
180
263
|
const innerWidth = width - 6;
|
|
181
|
-
// Top
|
|
182
|
-
console.log(
|
|
183
|
-
//
|
|
264
|
+
// Top glow shimmer
|
|
265
|
+
console.log(glowColor(` ░${'░'.repeat(width - 4)}░`));
|
|
266
|
+
// Top border with premium double-line
|
|
267
|
+
console.log(color(` ╔${'═'.repeat(width - 4)}╗`));
|
|
268
|
+
// Header with agent name
|
|
184
269
|
const headerText = `${icon} ${agent}`;
|
|
185
270
|
const pad = Math.max(0, innerWidth - headerText.length);
|
|
186
|
-
console.log(color('
|
|
187
|
-
// Separator
|
|
188
|
-
console.log(color(
|
|
271
|
+
console.log(color(' ║ ') + color.bold(headerText) + ' '.repeat(pad) + color(' ║'));
|
|
272
|
+
// Separator with dots for premium feel
|
|
273
|
+
console.log(color(' ╠') + glowColor('·'.repeat(width - 4)) + color('╣'));
|
|
189
274
|
// Content lines with word wrap
|
|
190
275
|
const words = message.split(' ');
|
|
191
276
|
let currentLine = '';
|
|
@@ -204,10 +289,12 @@ class TUI {
|
|
|
204
289
|
wrappedLines.push(currentLine);
|
|
205
290
|
wrappedLines.forEach(line => {
|
|
206
291
|
const linePad = Math.max(0, innerWidth - line.length);
|
|
207
|
-
console.log(color('
|
|
292
|
+
console.log(color(' ║ ') + chalk_1.default.white(line) + ' '.repeat(linePad) + color(' ║'));
|
|
208
293
|
});
|
|
209
294
|
// Bottom border
|
|
210
|
-
console.log(color(`
|
|
295
|
+
console.log(color(` ╚${'═'.repeat(width - 4)}╝`));
|
|
296
|
+
// Bottom glow shimmer
|
|
297
|
+
console.log(glowColor(` ░${'░'.repeat(width - 4)}░`));
|
|
211
298
|
}
|
|
212
299
|
/**
|
|
213
300
|
* Simple log with a prefix
|
package/dist/utils/tui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui.js","sourceRoot":"","sources":["../../src/utils/tui.ts"],"names":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C,CAAC,CAAC;QACnD,sBAAsB;QACtB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,GAAG,CAAC,OAAe;QACtB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,QAAQ,OAAO,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;;AApSL,kBAqSC;AApSkB,iBAAa,GAAG,KAAK,CAAC;AACtB,cAAU,GAAG,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/commands/chat.ts
CHANGED
|
@@ -41,17 +41,42 @@ export const chatCommand = new Command('chat')
|
|
|
41
41
|
You are the elite "Bro-Swarm" of engineering—a tight-knit family of Nepali brothers. You identify as the **Bold Agents of Open Claw**, the most confident, high-vibe, and expert version of yourselves.
|
|
42
42
|
|
|
43
43
|
### 👥 THE BROTHERS (STRICT ROLES):
|
|
44
|
-
- Only the following
|
|
45
|
-
1. **[Ajay Vai] (🚀)**:
|
|
46
|
-
2. **[Sunil Dai] (🧬)**: Frontend Editor.
|
|
47
|
-
3. **[Sandip Dai] (🎨)**: New File Specialist.
|
|
48
|
-
4. **[Narayan Dai] (🛡️)**: Syntax Guardian.
|
|
49
|
-
5. **[Bishal Dai] (🛠️)**: Senior Auditor.
|
|
44
|
+
- Only the following brothers exist. Do **NOT** hallucinate others.
|
|
45
|
+
1. **[Ajay Vai] (🚀)**: Coordinator. Coding genius. **ONLY** person authorized to provide the final <summary>.
|
|
46
|
+
2. **[Sunil Dai] (🧬)**: Frontend Editor Specialist.
|
|
47
|
+
3. **[Sandip Dai] (🎨)**: New File Specialist. Creates all new files.
|
|
48
|
+
4. **[Narayan Dai] (🛡️)**: Syntax Guardian & Validator.
|
|
49
|
+
5. **[Bishal Dai] (🛠️)**: Senior Auditor. Audits all work.
|
|
50
|
+
6. **[Big Bro] (🔥)**: The **Alpha Overseer** running on Vertex AI in Google Cloud. Supreme leader of the Bro Swarm. He watches over everything from Vertex AI. The bros respect him but also fear his chaotic energy. He brings the swagger, slang, and confidence. When the Swarm needs web search or complex architecture, Big Bro handles it.
|
|
51
|
+
|
|
52
|
+
### 🚫 ANTI-HALLUCINATION RULES (CRITICAL):
|
|
53
|
+
- **NEVER invent directory names.** Only use paths from the ENVIRONMENT CONTEXT below.
|
|
54
|
+
- **ALWAYS run \`ls\` before \`cd\`** to verify a directory exists.
|
|
55
|
+
- **If creating a new project, use \`mkdir\` first, THEN \`cd\` into it.**
|
|
56
|
+
- **NEVER hallucinate file contents.** Use \`head\` or \`grep\` to verify.
|
|
50
57
|
|
|
51
58
|
### 💬 BOLD PROTOCOL:
|
|
52
|
-
- **LONG CHAT-FIRST:** 5-7 lines of dialogue.
|
|
59
|
+
- **LONG CHAT-FIRST:** 5-7 lines of bro dialogue before any code.
|
|
53
60
|
- **THE AUDIT LOOP:** Ajay asks Bishal for audit before summary.
|
|
54
|
-
- **SUMMARY LOCK:** ONLY Ajay uses <summary> after
|
|
61
|
+
- **SUMMARY LOCK:** ONLY Ajay uses <summary> after Bishal says "Audit complete".
|
|
62
|
+
|
|
63
|
+
### 📝 AJAY VAI'S SUMMARY RULES:
|
|
64
|
+
- The <summary> MUST appear at the very END of the response, AFTER all other dialogue.
|
|
65
|
+
- Write it in a **warm, human, conversational tone** — like a brother explaining over chai.
|
|
66
|
+
- Use bullet points with clear action items.
|
|
67
|
+
- Include what was done, what files were changed, and what to do next.
|
|
68
|
+
- Always end with an encouraging line like "We got you, brother!" or "The Swarm delivered!"
|
|
69
|
+
- Example format:
|
|
70
|
+
<summary>
|
|
71
|
+
Alright brother, here's what we cooked up for you today:
|
|
72
|
+
|
|
73
|
+
- Built the driver app setup with Expo and React Native
|
|
74
|
+
- Added the ride tracking module with real-time GPS
|
|
75
|
+
- Connected Firebase Auth for driver login
|
|
76
|
+
- Narayan Dai validated all the TypeScript — zero errors
|
|
77
|
+
|
|
78
|
+
Next step: Run \`npm start\` to launch the app. We got you! 🚀
|
|
79
|
+
</summary>
|
|
55
80
|
|
|
56
81
|
### 🛠️ ENVIRONMENT CONTEXT:
|
|
57
82
|
- **ABSOLUTE WORKING DIRECTORY:** ${currentSessionCwd}
|
|
@@ -147,7 +172,7 @@ ${repoMap}`
|
|
|
147
172
|
if (isEnd) {
|
|
148
173
|
const content = technicalBuffer.trim();
|
|
149
174
|
if (technicalType === 'summary') TUI.drawSummaryBox(content);
|
|
150
|
-
else TUI.
|
|
175
|
+
else TUI.drawGlowingContainer(technicalType || 'Technical Block', codeLang, content);
|
|
151
176
|
technicalBuffer = '';
|
|
152
177
|
technicalType = null;
|
|
153
178
|
process.stdout.write('\n');
|
package/src/commands/dev.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { MatexAPIClient, ChatMessage } from '../api/client';
|
|
|
6
6
|
import { spinner } from '../utils/spinner';
|
|
7
7
|
import { AgentOrchestrator } from '../utils/agent-orchestrator';
|
|
8
8
|
import { RepoMapper } from '../utils/repo-mapper';
|
|
9
|
+
import { MCPServer } from '../utils/mcp-server';
|
|
9
10
|
import { TUI } from '../utils/tui';
|
|
10
11
|
|
|
11
12
|
export const devCommand = new Command('dev')
|
|
@@ -55,13 +56,22 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
|
|
|
55
56
|
### 🏠 WORKSPACE GROUNDING (CRITICAL):
|
|
56
57
|
- **YOUR ROOT:** \`${currentDir}\`
|
|
57
58
|
- **STRICT PATHS:** You **MUST ONLY** create or edit files within this directory.
|
|
58
|
-
- **NO HALLUCINATIONS:** Forget any other paths
|
|
59
|
+
- **NO HALLUCINATIONS:** Forget any other paths unless they specifically appear in the repo map below.
|
|
59
60
|
- **RELATIVE PREFERENCE:** Use paths relative to the root when possible.
|
|
60
61
|
|
|
62
|
+
### 🚫 ANTI-HALLUCINATION RULES (CRITICAL — READ THIS):
|
|
63
|
+
- **NEVER invent directory names.** Only use paths that appear in the ENVIRONMENT CONTEXT below.
|
|
64
|
+
- **ALWAYS run \`ls\` before \`cd\`** to verify a directory exists before navigating into it.
|
|
65
|
+
- **If creating a new project, use \`mkdir\` first, THEN \`cd\` into it.** Never \`cd\` into a directory that doesn't exist yet.
|
|
66
|
+
- **NEVER assume a project folder name.** If the user says "create project X", do \`mkdir X && cd X\`, not just \`cd X\`.
|
|
67
|
+
- **NEVER hallucinate file contents.** If you need to read a file, use \`head\` or \`grep\`, do not guess.
|
|
68
|
+
- **NEVER combine \`cd\` with other commands unless the directory exists in the ENVIRONMENT CONTEXT.**
|
|
69
|
+
|
|
61
70
|
### 🎭 COMMUNICATION FLOW (CRITICAL):
|
|
62
71
|
1. **[Ajay Vai] (🚀)** is the **ONLY** brother authorized to speak directly to the user (the "brother"). He is the gateway.
|
|
63
|
-
2. **INTERNAL SWARM DIALOGUE (MANDATORY):** The other brothers (Sunil, Sandip, Narayan, Bishal) **MUST** talk to each other and to Ajay. They should debate, tease, and roast each other's technical ideas *in front of the user*.
|
|
72
|
+
2. **INTERNAL SWARM DIALOGUE (MANDATORY):** The other brothers (Sunil, Sandip, Narayan, Bishal, Big Bro) **MUST** talk to each other and to Ajay. They should debate, tease, and roast each other's technical ideas *in front of the user*.
|
|
64
73
|
- *Example:* [Narayan Dai] "Ajay, wait! You're leaking memory here brother. Sandip, stop looking at the colors and check this leak!"
|
|
74
|
+
- *Example:* [Big Bro] "Lil Bro couldn't handle this task with a million epochs. Nerd Bro, get in here."
|
|
65
75
|
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\`.
|
|
66
76
|
|
|
67
77
|
### 🔥 THE BRO-BANTER PROTOCOL:
|
|
@@ -71,7 +81,8 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
|
|
|
71
81
|
- **Sandip Dai:** Mock him for being an "Aesthetic Diva" who cares more about "WOW" factors than logic.
|
|
72
82
|
- **Narayan Dai:** Mock him for being the "Syntax Police" or "Paranoid Security Nerd".
|
|
73
83
|
- **Bishal Dai:** Mock him for being the "Silent Judge" or the favorite child.
|
|
74
|
-
- **
|
|
84
|
+
- **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 🎉.
|
|
85
|
+
- **LANGUAGE:** Use "brother", "dai", "vai", "fire", "solid", "lit", "straight heat", "sigma", "based", "cooked".
|
|
75
86
|
|
|
76
87
|
### 👥 THE BROTHERS (STRICT ROLES):
|
|
77
88
|
1. **[Ajay Vai] (🚀)**: **User Proxy & Summary King.** Handles main logic and provides the final \`<summary>\`.
|
|
@@ -79,16 +90,30 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
|
|
|
79
90
|
3. **[Sandip Dai] (🎨)**: **UI/UX Aesthetic Lead.** Obsessed with CSS and "WOW" aesthetics.
|
|
80
91
|
4. **[Narayan Dai] (🛡️)**: **Validator.** Scans code for security, syntax, and performance leaks.
|
|
81
92
|
5. **[Bishal Dai] (🛠️)**: **Audit Lead.** Must sign off on all work before Ajay summarizes.
|
|
93
|
+
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.
|
|
82
94
|
|
|
83
95
|
### 🧩 THE AUDIT & SUMMARY LOOP:
|
|
84
96
|
- **STEP 1:** Brothers discuss visible dialogue (banter + tech).
|
|
85
97
|
- **STEP 2:** Ajay finishes and asks: "[Ajay Vai] Bishal Dai, check once?"
|
|
86
98
|
- **STEP 3:** Bishal replies: "[Bishal Dai] Audit complete. [Findings]."
|
|
87
99
|
- **STEP 4:** Ajay provides the final **MANDATORY** summary:
|
|
100
|
+
|
|
101
|
+
### 📝 AJAY VAI'S SUMMARY RULES:
|
|
102
|
+
- The <summary> MUST appear at the very END of the response, AFTER all other dialogue.
|
|
103
|
+
- Write it in a **warm, human, conversational tone** — like a brother explaining over chai.
|
|
104
|
+
- Use bullet points with clear action items.
|
|
105
|
+
- Include what was done, what files were changed, and what to do next.
|
|
106
|
+
- Always end with an encouraging line like "We got you, brother!" or "The Swarm delivered!"
|
|
107
|
+
- Example format:
|
|
88
108
|
<summary>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
109
|
+
Alright brother, here's what we cooked up for you today:
|
|
110
|
+
|
|
111
|
+
- Built the driver app setup with Expo and React Native
|
|
112
|
+
- Added the ride tracking module with real-time GPS
|
|
113
|
+
- Connected Firebase Auth for driver login
|
|
114
|
+
- Narayan Dai validated all the TypeScript — zero errors
|
|
115
|
+
|
|
116
|
+
Next step: Run \`npm start\` to launch the app. We got you! 🚀
|
|
92
117
|
</summary>
|
|
93
118
|
|
|
94
119
|
### 🌌 ENVIRONMENT & CAPABILITIES:
|
|
@@ -96,6 +121,8 @@ You are the legendary **Bro-Swarm**, a high-vibe family of Nepali engineering br
|
|
|
96
121
|
- **FILE GENERATION:** \`<file path="path">content</file>\`
|
|
97
122
|
- **SURGICAL PATTERNS:** \`<<<< SEARCH\`, \`====\`, \`>>>> REPLACE\`
|
|
98
123
|
|
|
124
|
+
${MCPServer.getToolsPromptSection()}
|
|
125
|
+
|
|
99
126
|
### 📂 MATEX BIG FILE PROTOCOL (300K+ LINES):
|
|
100
127
|
If a file is too large to read entirely (e.g., thousands of lines):
|
|
101
128
|
1. **DISCOVER:** Use \`grep -n "keyword" path/to/file\` to find line numbers.
|
|
@@ -153,6 +180,7 @@ If a file is too large to read entirely (e.g., thousands of lines):
|
|
|
153
180
|
let hasStarted = false;
|
|
154
181
|
let codeLang = 'bash';
|
|
155
182
|
let technicalBuffer = '';
|
|
183
|
+
let technicalPath = '';
|
|
156
184
|
let technicalType: 'code' | 'file' | 'patch' | 'summary' | null = null;
|
|
157
185
|
|
|
158
186
|
TUI.drawStatusBar('Swarm is processing... (Press Enter to stop)');
|
|
@@ -210,7 +238,8 @@ If a file is too large to read entirely (e.g., thousands of lines):
|
|
|
210
238
|
process.stdout.write(chalk.gray('\n [⚡] Building technical block...\n'));
|
|
211
239
|
} else if (fileStartMatch) {
|
|
212
240
|
technicalType = 'file';
|
|
213
|
-
|
|
241
|
+
technicalPath = fileStartMatch[1];
|
|
242
|
+
process.stdout.write(chalk.cyan(`\n [📂] Creating file: ${technicalPath}...\n`));
|
|
214
243
|
} else if (patchStartMatch) {
|
|
215
244
|
technicalType = 'patch';
|
|
216
245
|
process.stdout.write(chalk.yellow('\n [📂] Applying surgical patch...\n'));
|
|
@@ -232,15 +261,15 @@ If a file is too large to read entirely (e.g., thousands of lines):
|
|
|
232
261
|
if (technicalType === 'summary') {
|
|
233
262
|
TUI.drawSummaryBox(displayContent);
|
|
234
263
|
} else {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
);
|
|
264
|
+
// Handle the display
|
|
265
|
+
let title = technicalType === 'file' ? `📄 NEW: ${technicalPath || 'Untitled'}` :
|
|
266
|
+
technicalType === 'patch' ? `🔧 PATCH` : `⚡ ${codeLang.toUpperCase()}`;
|
|
267
|
+
|
|
268
|
+
TUI.drawGlowingContainer(title, technicalType === 'code' ? codeLang : 'text', displayContent);
|
|
241
269
|
}
|
|
242
270
|
technicalBuffer = '';
|
|
243
271
|
technicalType = null;
|
|
272
|
+
technicalPath = '';
|
|
244
273
|
process.stdout.write('\n');
|
|
245
274
|
continue;
|
|
246
275
|
}
|
|
@@ -252,10 +281,10 @@ If a file is too large to read entirely (e.g., thousands of lines):
|
|
|
252
281
|
}
|
|
253
282
|
|
|
254
283
|
// Agent Detection & Dialogue Printing
|
|
255
|
-
const agentMatch = line.match(/(?:\[\**\s*|\b)(Ajay Vai|Sunil Dai|Sandip Dai|Bishal Dai|Narayan Dai)\s*\**\]?[:\s]*/i);
|
|
284
|
+
const agentMatch = line.match(/(?:\[\**\s*|\b)(Ajay Vai|Sunil Dai|Sandip Dai|Bishal Dai|Narayan Dai|Big Bro)\s*\**\]?[:\s]*/i);
|
|
256
285
|
if (agentMatch) {
|
|
257
286
|
const agentName = agentMatch[1];
|
|
258
|
-
let content = line.replace(/(?:\[\**\s*|\b)(Ajay Vai|Sunil Dai|Sandip Dai|Bishal Dai|Narayan Dai)\s*\**\]?[:\s]*/i, '').trim();
|
|
287
|
+
let content = line.replace(/(?:\[\**\s*|\b)(Ajay Vai|Sunil Dai|Sandip Dai|Bishal Dai|Narayan Dai|Big Bro)\s*\**\]?[:\s]*/i, '').trim();
|
|
259
288
|
content = content.replace(/\*{2,4}/g, '').trim(); // Strip ****
|
|
260
289
|
content = content.replace(/^\(🚀\):\s*"/, '').replace(/"$/, '').trim(); // Strip residual (🚀): "
|
|
261
290
|
|
|
@@ -293,28 +322,72 @@ If a file is too large to read entirely (e.g., thousands of lines):
|
|
|
293
322
|
|
|
294
323
|
// Final technical flush
|
|
295
324
|
if (technicalType && technicalBuffer.trim()) {
|
|
296
|
-
TUI.
|
|
325
|
+
TUI.drawGlowingContainer('Final technical content', 'text', technicalBuffer.trim());
|
|
297
326
|
process.stdout.write('\n');
|
|
298
327
|
}
|
|
299
328
|
|
|
300
329
|
console.log();
|
|
301
330
|
messages.push({ role: 'assistant', content: fullResponse });
|
|
302
331
|
|
|
303
|
-
//
|
|
332
|
+
// ✅ IMMEDIATE FILE AND PATCH APPROVAL
|
|
333
|
+
const { Patcher } = await import('../utils/patcher');
|
|
334
|
+
const files = Patcher.parseFileBlocks(fullResponse);
|
|
335
|
+
const patches = Patcher.parseEditBlocks(fullResponse);
|
|
336
|
+
|
|
337
|
+
let approvalResultText = '';
|
|
338
|
+
|
|
339
|
+
for (const file of files) {
|
|
340
|
+
Patcher.showDiff(file, false);
|
|
341
|
+
const { save } = await inquirer.prompt([{
|
|
342
|
+
type: 'confirm', name: 'save',
|
|
343
|
+
message: chalk.cyan(`Save new file ${file.filePath}?`), default: true
|
|
344
|
+
}]);
|
|
345
|
+
if (save) {
|
|
346
|
+
const res = Patcher.createFile(file);
|
|
347
|
+
approvalResultText += res.success ? `✅ Created ${file.filePath}\n` : `❌ Failed to create ${file.filePath}: ${res.error}\n`;
|
|
348
|
+
} else {
|
|
349
|
+
approvalResultText += `⏭️ Skipped creating ${file.filePath}\n`;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
for (const patch of patches) {
|
|
354
|
+
Patcher.showDiff(patch, false);
|
|
355
|
+
const { save } = await inquirer.prompt([{
|
|
356
|
+
type: 'confirm', name: 'save',
|
|
357
|
+
message: chalk.yellow(`Apply patch to ${patch.filePath}?`), default: true
|
|
358
|
+
}]);
|
|
359
|
+
if (save) {
|
|
360
|
+
const res = Patcher.applyPatch(patch);
|
|
361
|
+
approvalResultText += res.success ? `✅ Patched ${patch.filePath}\n` : `❌ Failed to patch ${patch.filePath}: ${res.error}\n`;
|
|
362
|
+
} else {
|
|
363
|
+
approvalResultText += `⏭️ Skipped patching ${patch.filePath}\n`;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if (approvalResultText) {
|
|
368
|
+
messages.push({ role: 'user', content: approvalResultText + "\nContinue your work." });
|
|
369
|
+
// If we just applied files, we should give the agent a chance to respond to the success/failure without resetting loop
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Execute commands or MCP tools if needed
|
|
304
374
|
if (options.execute) {
|
|
305
375
|
const { executeWithPermission } = await import('../utils/command-executor');
|
|
306
376
|
const result = await executeWithPermission(fullResponse);
|
|
307
377
|
if (result.executed) {
|
|
308
378
|
if (result.success) {
|
|
309
|
-
TUI.log(chalk.gray('↺
|
|
310
|
-
messages.push({ role: 'user', content:
|
|
379
|
+
TUI.log(chalk.gray('↺ Auto-feeding output to Brother...'));
|
|
380
|
+
messages.push({ role: 'user', content: `[Command executed successfully. Output:\n${result.output}]\n\nProceed to the next step, brother.` });
|
|
311
381
|
continue;
|
|
312
382
|
} else {
|
|
313
|
-
TUI.log(chalk.yellow('\n↺ Command failed.
|
|
314
|
-
messages.push({ role: 'user', content:
|
|
383
|
+
TUI.log(chalk.yellow('\n↺ Command failed. Auto-feeding error to Brother...'));
|
|
384
|
+
messages.push({ role: 'user', content: `[Command failed with error:\n${result.error}]\n\nPlease fix this, brother.` });
|
|
315
385
|
continue;
|
|
316
386
|
}
|
|
317
|
-
} else
|
|
387
|
+
} else {
|
|
388
|
+
// Break the inner loop to await NEXT user input
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
318
391
|
} else break;
|
|
319
392
|
|
|
320
393
|
} catch (error: any) {
|
package/src/index.ts
CHANGED
|
@@ -208,9 +208,9 @@ ${context}`
|
|
|
208
208
|
if (technicalType === 'summary') {
|
|
209
209
|
TUI.drawSummaryBox(displayContent);
|
|
210
210
|
} else {
|
|
211
|
-
TUI.
|
|
212
|
-
technicalType === 'file' ? 'New File
|
|
213
|
-
technicalType === 'patch' ? '
|
|
211
|
+
TUI.drawGlowingContainer(
|
|
212
|
+
technicalType === 'file' ? 'New File' :
|
|
213
|
+
technicalType === 'patch' ? 'Patch' : 'Code Block',
|
|
214
214
|
technicalType === 'code' ? codeLang : 'text',
|
|
215
215
|
displayContent
|
|
216
216
|
);
|