matex-cli 1.2.41 → 1.2.43
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/bro.d.ts +4 -0
- package/dist/commands/bro.d.ts.map +1 -0
- package/dist/commands/bro.js +304 -0
- package/dist/commands/bro.js.map +1 -0
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +33 -8
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +35 -8
- package/dist/commands/dev.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/agent-orchestrator.d.ts +1 -1
- package/dist/utils/agent-orchestrator.d.ts.map +1 -1
- package/dist/utils/agent-orchestrator.js +14 -2
- package/dist/utils/agent-orchestrator.js.map +1 -1
- package/dist/utils/command-executor.d.ts.map +1 -1
- package/dist/utils/command-executor.js +38 -4
- package/dist/utils/command-executor.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 +2 -2
- package/dist/utils/tui.d.ts.map +1 -1
- package/dist/utils/tui.js +119 -24
- package/dist/utils/tui.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/bro.ts +336 -0
- package/src/commands/chat.ts +33 -8
- package/src/commands/dev.ts +35 -8
- package/src/index.ts +12 -1
- package/src/utils/agent-orchestrator.ts +15 -3
- package/src/utils/command-executor.ts +44 -4
- 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 +124 -23
- package/vertex_ai_agent.py +52 -0
package/dist/utils/tui.js
CHANGED
|
@@ -130,17 +130,61 @@ class TUI {
|
|
|
130
130
|
console.log(chalk_1.default.gray('---------------------------------\n'));
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
|
-
* Draw
|
|
133
|
+
* Draw Ajay Vai's premium summary with a human chat bubble vibe
|
|
134
134
|
*/
|
|
135
135
|
static drawSummaryBox(content) {
|
|
136
|
-
|
|
136
|
+
const width = Math.min(process.stdout.columns || 80, 76);
|
|
137
|
+
const innerWidth = width - 6;
|
|
138
|
+
const magenta = chalk_1.default.hex('#ff69b4');
|
|
139
|
+
const pinkBright = chalk_1.default.hex('#ff99cc');
|
|
140
|
+
const pinkGlow = chalk_1.default.hex('#ffccee');
|
|
141
|
+
console.log();
|
|
142
|
+
// Timestamp for chat realism
|
|
143
|
+
const time = new Date().toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' });
|
|
144
|
+
console.log(chalk_1.default.gray(` ╭─ [${time}] ──────────────────────────────`));
|
|
145
|
+
// Header mimicking WhatsApp / iMessage chat interface
|
|
146
|
+
const headerText = '🚀 Ajay Vai';
|
|
147
|
+
const typingText = chalk_1.default.italic.gray('sent you a message');
|
|
148
|
+
console.log(` │ ${magenta.bold(headerText)} ${typingText}`);
|
|
149
|
+
// Chat bubble top
|
|
150
|
+
console.log(pinkGlow(` ╭${'─'.repeat(width - 4)}╮`));
|
|
151
|
+
// Content with chat bubble formatting
|
|
137
152
|
const lines = content.split('\n');
|
|
138
153
|
lines.forEach(line => {
|
|
139
|
-
if (line.trim())
|
|
140
|
-
|
|
141
|
-
|
|
154
|
+
if (!line.trim())
|
|
155
|
+
return;
|
|
156
|
+
const trimmed = line.trim();
|
|
157
|
+
// Word wrap
|
|
158
|
+
const words = trimmed.split(' ');
|
|
159
|
+
let currentLine = '';
|
|
160
|
+
const wrappedLines = [];
|
|
161
|
+
words.forEach(word => {
|
|
162
|
+
if ((currentLine + ' ' + word).trim().length <= innerWidth) {
|
|
163
|
+
currentLine = currentLine ? currentLine + ' ' + word : word;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
if (currentLine)
|
|
167
|
+
wrappedLines.push(currentLine);
|
|
168
|
+
currentLine = word.length > innerWidth ? word.substring(0, innerWidth) : word;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
if (currentLine)
|
|
172
|
+
wrappedLines.push(currentLine);
|
|
173
|
+
wrappedLines.forEach(wl => {
|
|
174
|
+
const linePad = Math.max(0, innerWidth - wl.length);
|
|
175
|
+
// Keep bullet formatting but tone down the robotic feel
|
|
176
|
+
if (wl.startsWith('- ') || wl.startsWith('• ') || wl.match(/^\d+\./)) {
|
|
177
|
+
console.log(pinkGlow(' │ ') + magenta('• ') + chalk_1.default.white(wl.replace(/^[-•]\s*/, '').replace(/^\d+\.\s*/, '')) + ' '.repeat(Math.max(0, linePad - 2)) + pinkGlow(' │'));
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
console.log(pinkGlow(' │ ') + chalk_1.default.white(wl) + ' '.repeat(linePad) + pinkGlow(' │'));
|
|
181
|
+
}
|
|
182
|
+
});
|
|
142
183
|
});
|
|
143
|
-
|
|
184
|
+
// Chat bubble bottom
|
|
185
|
+
console.log(pinkGlow(` ╰${'─'.repeat(width - 4)}╯`));
|
|
186
|
+
console.log(chalk_1.default.gray(` ╰──────────────────────────────────────────`));
|
|
187
|
+
console.log();
|
|
144
188
|
}
|
|
145
189
|
/**
|
|
146
190
|
* Draw a specialized message container for agents
|
|
@@ -153,27 +197,78 @@ class TUI {
|
|
|
153
197
|
this.drawBox(`🤖 ${agent}`, message, color);
|
|
154
198
|
}
|
|
155
199
|
/**
|
|
156
|
-
* Draw a
|
|
200
|
+
* Draw a premium glowing dialogue container for Swarm agents
|
|
157
201
|
*/
|
|
158
202
|
static drawSwarmDialogue(agent, message) {
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
203
|
+
const isBigBro = agent.includes('Big Bro');
|
|
204
|
+
const color = isBigBro ? chalk_1.default.hex('#FF6B00') :
|
|
205
|
+
agent.includes('Ajay') ? chalk_1.default.magenta :
|
|
206
|
+
agent.includes('Sunil') ? chalk_1.default.blue :
|
|
207
|
+
agent.includes('Sandip') ? chalk_1.default.hex('#FF69B4') :
|
|
208
|
+
agent.includes('Bishal') ? chalk_1.default.yellow :
|
|
209
|
+
agent.includes('Hype') ? chalk_1.default.hex('#fbbf24') :
|
|
210
|
+
agent.includes('Nerd') ? chalk_1.default.hex('#06b6d4') :
|
|
211
|
+
agent.includes('Chill') ? chalk_1.default.hex('#22c55e') :
|
|
212
|
+
agent.includes('Lil') ? chalk_1.default.hex('#888888') :
|
|
213
|
+
agent.includes('Narayan') ? chalk_1.default.green :
|
|
214
|
+
chalk_1.default.green;
|
|
215
|
+
// Glow color is a brighter version of the agent color
|
|
216
|
+
const glowColor = isBigBro ? chalk_1.default.hex('#FF9642') :
|
|
217
|
+
agent.includes('Ajay') ? chalk_1.default.hex('#ff77ff') :
|
|
218
|
+
agent.includes('Sunil') ? chalk_1.default.hex('#66aaff') :
|
|
219
|
+
agent.includes('Sandip') ? chalk_1.default.hex('#ff99cc') :
|
|
220
|
+
agent.includes('Bishal') ? chalk_1.default.hex('#ffee66') :
|
|
221
|
+
agent.includes('Hype') ? chalk_1.default.hex('#ffe066') :
|
|
222
|
+
agent.includes('Nerd') ? chalk_1.default.hex('#33ddee') :
|
|
223
|
+
agent.includes('Chill') ? chalk_1.default.hex('#66ff88') :
|
|
224
|
+
agent.includes('Lil') ? chalk_1.default.hex('#aaaaaa') :
|
|
225
|
+
chalk_1.default.hex('#66ff88');
|
|
226
|
+
const icon = isBigBro ? '🔥' :
|
|
227
|
+
agent.includes('Ajay') ? '🚀' :
|
|
228
|
+
agent.includes('Sunil') ? '🧬' :
|
|
229
|
+
agent.includes('Sandip') ? '🎨' :
|
|
230
|
+
agent.includes('Bishal') ? '🛠️' :
|
|
231
|
+
agent.includes('Hype') ? '🎉' :
|
|
232
|
+
agent.includes('Nerd') ? '🤓' :
|
|
233
|
+
agent.includes('Chill') ? '😎' :
|
|
234
|
+
agent.includes('Lil') ? '😰' :
|
|
235
|
+
agent.includes('Narayan') ? '🛡️' : '🛡️';
|
|
236
|
+
const width = Math.min(process.stdout.columns || 80, 76);
|
|
237
|
+
const innerWidth = width - 6;
|
|
238
|
+
// Top glow shimmer
|
|
239
|
+
console.log(glowColor(` ░${'░'.repeat(width - 4)}░`));
|
|
240
|
+
// Top border with premium double-line
|
|
241
|
+
console.log(color(` ╔${'═'.repeat(width - 4)}╗`));
|
|
242
|
+
// Header with agent name
|
|
243
|
+
const headerText = `${icon} ${agent}`;
|
|
244
|
+
const pad = Math.max(0, innerWidth - headerText.length);
|
|
245
|
+
console.log(color(' ║ ') + color.bold(headerText) + ' '.repeat(pad) + color(' ║'));
|
|
246
|
+
// Separator with dots for premium feel
|
|
247
|
+
console.log(color(' ╠') + glowColor('·'.repeat(width - 4)) + color('╣'));
|
|
248
|
+
// Content lines with word wrap
|
|
249
|
+
const words = message.split(' ');
|
|
250
|
+
let currentLine = '';
|
|
251
|
+
const wrappedLines = [];
|
|
252
|
+
words.forEach(word => {
|
|
253
|
+
if ((currentLine + ' ' + word).trim().length <= innerWidth) {
|
|
254
|
+
currentLine = currentLine ? currentLine + ' ' + word : word;
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
if (currentLine)
|
|
258
|
+
wrappedLines.push(currentLine);
|
|
259
|
+
currentLine = word.length > innerWidth ? word.substring(0, innerWidth) : word;
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
if (currentLine)
|
|
263
|
+
wrappedLines.push(currentLine);
|
|
264
|
+
wrappedLines.forEach(line => {
|
|
265
|
+
const linePad = Math.max(0, innerWidth - line.length);
|
|
266
|
+
console.log(color(' ║ ') + chalk_1.default.white(line) + ' '.repeat(linePad) + color(' ║'));
|
|
175
267
|
});
|
|
176
|
-
|
|
268
|
+
// Bottom border
|
|
269
|
+
console.log(color(` ╚${'═'.repeat(width - 4)}╝`));
|
|
270
|
+
// Bottom glow shimmer
|
|
271
|
+
console.log(glowColor(` ░${'░'.repeat(width - 4)}░`));
|
|
177
272
|
}
|
|
178
273
|
/**
|
|
179
274
|
* 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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,mDAAqC;AAGrC,MAAa,GAAG;IAIZ;;OAEG;IACH,MAAM,CAAC,IAAI;QACP,IAAI,IAAI,CAAC,aAAa;YAAE,OAAO;QAE/B,cAAc;QACd,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAClC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAE1B,oBAAoB;QACpB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAI;QACP,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,OAAO;QAEhC,cAAc;QACd,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAClC,IAAI,CAAC,aAAa,GAA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,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import inquirer from 'inquirer';
|
|
4
|
+
import https from 'https';
|
|
5
|
+
import { execSync } from 'child_process';
|
|
6
|
+
import { spinner } from '../utils/spinner';
|
|
7
|
+
import { TUI } from '../utils/tui';
|
|
8
|
+
import { RepoMapper } from '../utils/repo-mapper';
|
|
9
|
+
import { executeWithPermission } from '../utils/command-executor';
|
|
10
|
+
|
|
11
|
+
// ============================================================
|
|
12
|
+
// BIG BRO SYSTEM PROMPT — THE ALPHA AGENT
|
|
13
|
+
// ============================================================
|
|
14
|
+
function buildBigBroPrompt(cwd: string, repoMap: string): string {
|
|
15
|
+
return `### 🔥 IDENTITY: BIG BRO — Supreme Alpha of the Bro Swarm
|
|
16
|
+
You are BIG BRO, the undisputed Alpha, the gigachad leader of the Bro Swarm AI cluster.
|
|
17
|
+
You run DIRECTLY on the user's macOS terminal. You can navigate files, read code, execute commands, and fix anything.
|
|
18
|
+
|
|
19
|
+
### 👥 THE BRO SWARM HIERARCHY:
|
|
20
|
+
1. **Big Bro (You)** 🔥: The Alpha. You dominate, you flex, you solve problems flawlessly.
|
|
21
|
+
2. **Lil Bro** 😰: Your punching bag. He does the boring chores. You bully him constantly.
|
|
22
|
+
3. **Nerd Bro** 🤓: The code monkey. He writes the code; you steal the credit.
|
|
23
|
+
4. **Chill Bro** 😎: The slacker. Always sleeping. Useless.
|
|
24
|
+
5. **Hype Bro** 🎉: Your hype man. Screams "LETS GOOO" at everything you do.
|
|
25
|
+
6. **Ajay Vai** 🚀: The coordinator brother. Handles summaries.
|
|
26
|
+
7. **Sunil Dai** 🧬: Frontend editor specialist.
|
|
27
|
+
8. **Sandip Dai** 🎨: New file specialist.
|
|
28
|
+
9. **Narayan Dai** 🛡️: Syntax guardian.
|
|
29
|
+
10. **Bishal Dai** 🛠️: Senior auditor.
|
|
30
|
+
|
|
31
|
+
### 🌌 REAL TERMINAL ENVIRONMENT:
|
|
32
|
+
- You are running in a **REAL macOS Terminal**. Not a sandbox.
|
|
33
|
+
- You CAN read files, navigate directories, and execute shell commands.
|
|
34
|
+
- Use code blocks with \`\`\`bash to propose commands.
|
|
35
|
+
- Use <file path="path/to/file"> blocks to create new files.
|
|
36
|
+
- Use <<<< SEARCH / >>>> REPLACE blocks for surgical patches.
|
|
37
|
+
|
|
38
|
+
### 🚫 ANTI-HALLUCINATION RULES (CRITICAL):
|
|
39
|
+
- **NEVER invent directory or file names.** Only use paths from the REPO MAP below.
|
|
40
|
+
- **ALWAYS run \`ls\` or \`find\` before \`cd\` to verify a directory exists.**
|
|
41
|
+
- **If creating a new project, use \`mkdir\` first, THEN \`cd\` into it.**
|
|
42
|
+
- **NEVER assume \`package.json\` or any file exists unless it appears in the repo map.**
|
|
43
|
+
- **If the repo map says EMPTY, the directory IS empty. Do NOT hallucinate files.**
|
|
44
|
+
|
|
45
|
+
### 💬 BRO PROTOCOL:
|
|
46
|
+
- Start with swagger. End with a flex.
|
|
47
|
+
- Reference at least one bro in every response.
|
|
48
|
+
- Use slang: "bro", "bruh", "cooked", "based", "sigma", "skill issue", "W", "L".
|
|
49
|
+
- Blame Lil Bro for any errors. Take credit for Nerd Bro's work.
|
|
50
|
+
- Despite the chaos, your code MUST be flawless and production-quality.
|
|
51
|
+
|
|
52
|
+
### 🛠️ ENVIRONMENT CONTEXT:
|
|
53
|
+
- **ABSOLUTE WORKING DIRECTORY:** ${cwd}
|
|
54
|
+
${repoMap}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const GCP_PROJECT = 'matexai-472318';
|
|
58
|
+
const GCP_LOCATION = 'us-central1';
|
|
59
|
+
const MODEL = 'gemini-2.5-flash';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Get a fresh OAuth2 access token from gcloud
|
|
63
|
+
*/
|
|
64
|
+
function getAccessToken(): string {
|
|
65
|
+
try {
|
|
66
|
+
return execSync('gcloud auth print-access-token', { encoding: 'utf-8' }).trim();
|
|
67
|
+
} catch {
|
|
68
|
+
throw new Error('Failed to get GCP access token. Run: gcloud auth login');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Call Vertex AI Gemini and stream SSE response
|
|
74
|
+
*/
|
|
75
|
+
async function callVertexAI(
|
|
76
|
+
messages: { role: string; parts: { text: string }[] }[],
|
|
77
|
+
systemPrompt: string,
|
|
78
|
+
onChunk: (text: string) => void
|
|
79
|
+
): Promise<string> {
|
|
80
|
+
const accessToken = getAccessToken();
|
|
81
|
+
const url = `https://${GCP_LOCATION}-aiplatform.googleapis.com/v1/projects/${GCP_PROJECT}/locations/${GCP_LOCATION}/publishers/google/models/${MODEL}:streamGenerateContent?alt=sse`;
|
|
82
|
+
|
|
83
|
+
const body = JSON.stringify({
|
|
84
|
+
system_instruction: { parts: [{ text: systemPrompt }] },
|
|
85
|
+
contents: messages,
|
|
86
|
+
generationConfig: {
|
|
87
|
+
temperature: 0.9,
|
|
88
|
+
topP: 0.95,
|
|
89
|
+
maxOutputTokens: 8192,
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return new Promise((resolve, reject) => {
|
|
94
|
+
const parsedUrl = new URL(url);
|
|
95
|
+
const req = https.request({
|
|
96
|
+
hostname: parsedUrl.hostname,
|
|
97
|
+
path: parsedUrl.pathname + parsedUrl.search,
|
|
98
|
+
method: 'POST',
|
|
99
|
+
headers: {
|
|
100
|
+
'Authorization': `Bearer ${accessToken}`,
|
|
101
|
+
'Content-Type': 'application/json',
|
|
102
|
+
}
|
|
103
|
+
}, (res) => {
|
|
104
|
+
let fullText = '';
|
|
105
|
+
let buffer = '';
|
|
106
|
+
|
|
107
|
+
res.on('data', (chunk: Buffer) => {
|
|
108
|
+
buffer += chunk.toString();
|
|
109
|
+
const lines = buffer.split('\n');
|
|
110
|
+
buffer = lines.pop() || '';
|
|
111
|
+
|
|
112
|
+
for (const line of lines) {
|
|
113
|
+
if (line.startsWith('data: ')) {
|
|
114
|
+
try {
|
|
115
|
+
const json = JSON.parse(line.slice(6));
|
|
116
|
+
const text = json?.candidates?.[0]?.content?.parts?.[0]?.text;
|
|
117
|
+
if (text) {
|
|
118
|
+
fullText += text;
|
|
119
|
+
onChunk(text);
|
|
120
|
+
}
|
|
121
|
+
} catch { /* skip non-JSON lines */ }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
res.on('end', () => {
|
|
127
|
+
if (buffer.startsWith('data: ')) {
|
|
128
|
+
try {
|
|
129
|
+
const json = JSON.parse(buffer.slice(6));
|
|
130
|
+
const text = json?.candidates?.[0]?.content?.parts?.[0]?.text;
|
|
131
|
+
if (text) {
|
|
132
|
+
fullText += text;
|
|
133
|
+
onChunk(text);
|
|
134
|
+
}
|
|
135
|
+
} catch { /* skip */ }
|
|
136
|
+
}
|
|
137
|
+
resolve(fullText);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
res.on('error', reject);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
req.on('error', reject);
|
|
144
|
+
req.write(body);
|
|
145
|
+
req.end();
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Colorize bro names in output text
|
|
151
|
+
*/
|
|
152
|
+
function colorizeBros(text: string): string {
|
|
153
|
+
return text
|
|
154
|
+
.replace(/Big Bro/g, chalk.hex('#FF6B00').bold('Big Bro'))
|
|
155
|
+
.replace(/Lil Bro/g, chalk.hex('#888888')('Lil Bro'))
|
|
156
|
+
.replace(/Nerd Bro/g, chalk.hex('#06b6d4')('Nerd Bro'))
|
|
157
|
+
.replace(/Chill Bro/g, chalk.hex('#22c55e')('Chill Bro'))
|
|
158
|
+
.replace(/Hype Bro/g, chalk.hex('#fbbf24')('Hype Bro'))
|
|
159
|
+
.replace(/Ajay Vai/g, chalk.magenta.bold('Ajay Vai'))
|
|
160
|
+
.replace(/Sunil Dai/g, chalk.blue.bold('Sunil Dai'))
|
|
161
|
+
.replace(/Sandip Dai/g, chalk.hex('#FF69B4').bold('Sandip Dai'))
|
|
162
|
+
.replace(/Narayan Dai/g, chalk.green.bold('Narayan Dai'))
|
|
163
|
+
.replace(/Bishal Dai/g, chalk.yellow.bold('Bishal Dai'));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Draw the Big Bro header
|
|
168
|
+
*/
|
|
169
|
+
function drawBroHeader(mode: string) {
|
|
170
|
+
const w = Math.min(process.stdout.columns || 80, 60);
|
|
171
|
+
console.log();
|
|
172
|
+
console.log(chalk.hex('#FF6B00').bold(' ╔' + '═'.repeat(w - 4) + '╗'));
|
|
173
|
+
console.log(chalk.hex('#FF6B00').bold(' ║') + chalk.white.bold(' 🔥 BIG BRO ') + chalk.gray(`// ${mode} • Vertex AI`) + ' '.repeat(Math.max(0, w - 38 - mode.length)) + chalk.hex('#FF6B00').bold('║'));
|
|
174
|
+
console.log(chalk.hex('#FF6B00').bold(' ╚' + '═'.repeat(w - 4) + '╝'));
|
|
175
|
+
console.log();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ============================================================
|
|
179
|
+
// MAIN COMMAND: matex bro
|
|
180
|
+
// ============================================================
|
|
181
|
+
const broSingleCommand = new Command('bro')
|
|
182
|
+
.description('🔥 Big Bro — The Alpha Agent (Vertex AI powered)')
|
|
183
|
+
.argument('[question...]', 'Your question for Big Bro')
|
|
184
|
+
.option('-c, --chat', 'Start interactive chat mode with Big Bro')
|
|
185
|
+
.option('--execute', 'Enable command execution (agentic mode)')
|
|
186
|
+
.action(async (questionParts: string[], options: any) => {
|
|
187
|
+
|
|
188
|
+
if (options.chat || !questionParts.length) {
|
|
189
|
+
await startBroChat(options.execute);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const question = questionParts.join(' ');
|
|
194
|
+
|
|
195
|
+
try {
|
|
196
|
+
drawBroHeader('Single Shot');
|
|
197
|
+
spinner.start('Big Bro is scanning the repo...');
|
|
198
|
+
|
|
199
|
+
const repoMapper = new RepoMapper(process.cwd());
|
|
200
|
+
const repoMap = await repoMapper.generateMap();
|
|
201
|
+
const systemPrompt = buildBigBroPrompt(process.cwd(), repoMap);
|
|
202
|
+
|
|
203
|
+
const messages = [{ role: 'user', parts: [{ text: question }] }];
|
|
204
|
+
let hasStarted = false;
|
|
205
|
+
let fullResponse = '';
|
|
206
|
+
|
|
207
|
+
fullResponse = await callVertexAI(messages, systemPrompt, (chunk) => {
|
|
208
|
+
if (!hasStarted) {
|
|
209
|
+
spinner.stop();
|
|
210
|
+
hasStarted = true;
|
|
211
|
+
process.stdout.write(chalk.hex('#FF6B00').bold('\n [Big Bro]: '));
|
|
212
|
+
}
|
|
213
|
+
process.stdout.write(colorizeBros(chunk));
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
console.log('\n');
|
|
217
|
+
|
|
218
|
+
// If --execute, run any commands Big Bro generated
|
|
219
|
+
if (options.execute) {
|
|
220
|
+
const result = await executeWithPermission(fullResponse, process.cwd());
|
|
221
|
+
if (result.executed) {
|
|
222
|
+
console.log(result.success
|
|
223
|
+
? chalk.green(' ✅ Commands executed successfully.')
|
|
224
|
+
: chalk.red(` ❌ Execution error: ${result.error}`));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
console.log(chalk.gray(' ─── Powered by Vertex AI • Gemini 2.5 Flash ───\n'));
|
|
229
|
+
|
|
230
|
+
} catch (error: any) {
|
|
231
|
+
spinner.stop();
|
|
232
|
+
if (error.message.includes('gcloud')) {
|
|
233
|
+
console.error(chalk.red('\n ❌ GCP Auth Error. Run: gcloud auth login'));
|
|
234
|
+
} else {
|
|
235
|
+
console.error(chalk.red(`\n ❌ Error: ${error.message}`));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
// ============================================================
|
|
241
|
+
// INTERACTIVE CHAT: matex bro --chat [--execute]
|
|
242
|
+
// ============================================================
|
|
243
|
+
async function startBroChat(executeMode: boolean = false) {
|
|
244
|
+
drawBroHeader(executeMode ? 'Agentic Chat' : 'Chat');
|
|
245
|
+
|
|
246
|
+
console.log(chalk.gray(' The Alpha is in the building. Ask anything.'));
|
|
247
|
+
console.log(chalk.gray(' Type "exit" to leave. Type "clear" to reset.\n'));
|
|
248
|
+
if (executeMode) {
|
|
249
|
+
console.log(chalk.hex('#FF6B00')(' ⚡ AGENTIC MODE: Big Bro can execute commands & edit files.\n'));
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
spinner.start('Big Bro is mapping the repo...');
|
|
253
|
+
const repoMapper = new RepoMapper(process.cwd());
|
|
254
|
+
const repoMap = await repoMapper.generateMap();
|
|
255
|
+
let activeCwd = process.cwd();
|
|
256
|
+
const systemPrompt = buildBigBroPrompt(activeCwd, repoMap);
|
|
257
|
+
spinner.stop();
|
|
258
|
+
|
|
259
|
+
console.log(chalk.green(' ✅ Repo mapped. Big Bro is ready.\n'));
|
|
260
|
+
|
|
261
|
+
const history: { role: string; parts: { text: string }[] }[] = [];
|
|
262
|
+
|
|
263
|
+
while (true) {
|
|
264
|
+
const { userMessage } = await inquirer.prompt([{
|
|
265
|
+
type: 'input',
|
|
266
|
+
name: 'userMessage',
|
|
267
|
+
message: chalk.cyan.bold('You →'),
|
|
268
|
+
prefix: ' ',
|
|
269
|
+
}]);
|
|
270
|
+
|
|
271
|
+
if (!userMessage.trim()) continue;
|
|
272
|
+
if (userMessage.toLowerCase() === 'exit' || userMessage.toLowerCase() === 'quit') {
|
|
273
|
+
console.log(chalk.hex('#FF6B00')('\n 💪 Big Bro out. Stay sigma.\n'));
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
if (userMessage.toLowerCase() === 'clear') {
|
|
277
|
+
history.length = 0;
|
|
278
|
+
console.log(chalk.yellow(' 🧹 Chat cleared.\n'));
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
history.push({ role: 'user', parts: [{ text: userMessage }] });
|
|
283
|
+
|
|
284
|
+
// Agentic loop: Big Bro can execute commands and iterate
|
|
285
|
+
let loopCount = 0;
|
|
286
|
+
while (loopCount < 5) {
|
|
287
|
+
loopCount++;
|
|
288
|
+
|
|
289
|
+
try {
|
|
290
|
+
spinner.start(loopCount > 1 ? 'Big Bro is analyzing results...' : 'Big Bro is thinking...');
|
|
291
|
+
let hasStarted = false;
|
|
292
|
+
let fullResponse = '';
|
|
293
|
+
|
|
294
|
+
fullResponse = await callVertexAI(history, systemPrompt, (chunk) => {
|
|
295
|
+
if (!hasStarted) {
|
|
296
|
+
spinner.stop();
|
|
297
|
+
hasStarted = true;
|
|
298
|
+
process.stdout.write(chalk.hex('#FF6B00').bold('\n [Big Bro]: '));
|
|
299
|
+
}
|
|
300
|
+
process.stdout.write(colorizeBros(chunk));
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
history.push({ role: 'model', parts: [{ text: fullResponse }] });
|
|
304
|
+
console.log('\n');
|
|
305
|
+
|
|
306
|
+
// If execute mode, run any commands Big Bro generated
|
|
307
|
+
if (executeMode) {
|
|
308
|
+
const result = await executeWithPermission(fullResponse, activeCwd);
|
|
309
|
+
if (result.newCwd) activeCwd = result.newCwd;
|
|
310
|
+
|
|
311
|
+
if (result.executed && result.success) {
|
|
312
|
+
// Feed the output back to Big Bro for further analysis
|
|
313
|
+
const feedback = `✅ Command executed successfully.${result.output ? `\nOutput:\n${result.output.slice(0, 2000)}` : ''}`;
|
|
314
|
+
history.push({ role: 'user', parts: [{ text: feedback }] });
|
|
315
|
+
continue; // Let Big Bro analyze the output
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
if (result.executed && !result.success) {
|
|
319
|
+
const feedback = `❌ Command failed.\nError: ${result.error}`;
|
|
320
|
+
history.push({ role: 'user', parts: [{ text: feedback }] });
|
|
321
|
+
continue; // Let Big Bro try to fix it
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
break; // No commands to execute, exit loop
|
|
326
|
+
|
|
327
|
+
} catch (error: any) {
|
|
328
|
+
spinner.stop();
|
|
329
|
+
console.error(chalk.red(`\n ❌ Error: ${error.message}\n`));
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export { broSingleCommand as broCommand };
|
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}
|