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/src/utils/repo-mapper.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
+
import chalk from 'chalk';
|
|
3
4
|
import { AgentOrchestrator } from './agent-orchestrator';
|
|
4
5
|
|
|
5
6
|
export interface RepoNode {
|
|
@@ -35,18 +36,28 @@ export class RepoMapper {
|
|
|
35
36
|
// 1. Identify Entry Points
|
|
36
37
|
const entryPoints = ['README.md', 'package.json', 'index.ts', 'App.tsx', 'main.go', 'requirements.txt', 'index.html', 'style.css'];
|
|
37
38
|
|
|
39
|
+
let delayMs = 15; // Animation delay
|
|
40
|
+
|
|
41
|
+
AgentOrchestrator.speak('System', `God-Mode Research: Injecting scanners into ${this.rootPath}...`);
|
|
42
|
+
console.log();
|
|
43
|
+
|
|
38
44
|
for (const file of entryPoints) {
|
|
39
45
|
const fullPath = path.join(this.rootPath, file);
|
|
40
46
|
if (fs.existsSync(fullPath)) {
|
|
41
47
|
try {
|
|
42
48
|
const content = fs.readFileSync(fullPath, 'utf-8').slice(0, 5000); // 5KB limit
|
|
43
49
|
this.fileContents.set(file, content);
|
|
50
|
+
console.log(chalk.hex('#4ade80')(` โก [Core Injection] `) + chalk.gray(`Mapped entry node: `) + chalk.white.bold(file));
|
|
44
51
|
} catch (e) { }
|
|
45
52
|
}
|
|
46
53
|
}
|
|
47
54
|
|
|
55
|
+
console.log(chalk.cyan(` ๐ [Deep Scan] `) + chalk.gray(`Mapping topology...`));
|
|
48
56
|
const tree = this.scanDirectory(this.rootPath, 0);
|
|
49
57
|
|
|
58
|
+
console.log(chalk.hex('#FF6B00')(` ๐ฅ [Knowledge Graph] `) + chalk.gray(`Extracted ${this.fileContents.size} semantic nodes from source.`));
|
|
59
|
+
console.log();
|
|
60
|
+
|
|
50
61
|
// Build the final map
|
|
51
62
|
let finalMap = `--- ABSOLUTE WORKING DIRECTORY ---\n${this.rootPath}\n\n`;
|
|
52
63
|
|
package/src/utils/spinner.ts
CHANGED
|
@@ -4,38 +4,47 @@ import chalk from 'chalk';
|
|
|
4
4
|
export class Spinner {
|
|
5
5
|
private spinner: Ora | null = null;
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Start the premium MATEX loading spinner
|
|
9
|
+
*/
|
|
7
10
|
start(text: string): void {
|
|
8
11
|
this.spinner = ora({
|
|
9
|
-
text: chalk.
|
|
12
|
+
text: chalk.hex('#D97757').bold(text),
|
|
10
13
|
color: 'cyan',
|
|
11
|
-
spinner:
|
|
14
|
+
spinner: {
|
|
15
|
+
interval: 80,
|
|
16
|
+
frames: [
|
|
17
|
+
'โ ', 'โ ', 'โ น', 'โ ธ', 'โ ผ', 'โ ด', 'โ ฆ', 'โ ง', 'โ ', 'โ '
|
|
18
|
+
].map(f => chalk.cyan(f)) // Inject cyan into each frame
|
|
19
|
+
},
|
|
20
|
+
prefixText: chalk.bgHex('#1E1E1E').green(' โก MATEX_SWARM_ACTIVE ') + ' ',
|
|
12
21
|
}).start();
|
|
13
22
|
}
|
|
14
23
|
|
|
15
24
|
succeed(text?: string): void {
|
|
16
25
|
if (this.spinner) {
|
|
17
|
-
this.spinner.succeed(
|
|
26
|
+
this.spinner.succeed(chalk.green('โ ') + chalk.white.bold(text || 'Done'));
|
|
18
27
|
this.spinner = null;
|
|
19
28
|
}
|
|
20
29
|
}
|
|
21
30
|
|
|
22
31
|
fail(text?: string): void {
|
|
23
32
|
if (this.spinner) {
|
|
24
|
-
this.spinner.fail(
|
|
33
|
+
this.spinner.fail(chalk.red('โ ') + chalk.white.bold(text || 'Failed'));
|
|
25
34
|
this.spinner = null;
|
|
26
35
|
}
|
|
27
36
|
}
|
|
28
37
|
|
|
29
38
|
warn(text?: string): void {
|
|
30
39
|
if (this.spinner) {
|
|
31
|
-
this.spinner.warn(
|
|
40
|
+
this.spinner.warn(chalk.yellow('โ ') + chalk.white(text || 'Warning'));
|
|
32
41
|
this.spinner = null;
|
|
33
42
|
}
|
|
34
43
|
}
|
|
35
44
|
|
|
36
45
|
info(text?: string): void {
|
|
37
46
|
if (this.spinner) {
|
|
38
|
-
this.spinner.info(
|
|
47
|
+
this.spinner.info(chalk.blue('โน ') + chalk.white(text || 'Info'));
|
|
39
48
|
this.spinner = null;
|
|
40
49
|
}
|
|
41
50
|
}
|
|
@@ -49,7 +58,7 @@ export class Spinner {
|
|
|
49
58
|
|
|
50
59
|
updateText(text: string): void {
|
|
51
60
|
if (this.spinner) {
|
|
52
|
-
this.spinner.text = chalk.
|
|
61
|
+
this.spinner.text = chalk.hex('#D97757').bold(text);
|
|
53
62
|
}
|
|
54
63
|
}
|
|
55
64
|
}
|
package/src/utils/tui.ts
CHANGED
|
@@ -105,17 +105,64 @@ export class TUI {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
|
-
* Draw
|
|
108
|
+
* Draw Ajay Vai's premium summary with a human chat bubble vibe
|
|
109
109
|
*/
|
|
110
110
|
static drawSummaryBox(content: string) {
|
|
111
|
-
|
|
111
|
+
const width = Math.min(process.stdout.columns || 80, 76);
|
|
112
|
+
const innerWidth = width - 6;
|
|
113
|
+
const magenta = chalk.hex('#ff69b4');
|
|
114
|
+
const pinkBright = chalk.hex('#ff99cc');
|
|
115
|
+
const pinkGlow = chalk.hex('#ffccee');
|
|
116
|
+
|
|
117
|
+
console.log();
|
|
118
|
+
// Timestamp for chat realism
|
|
119
|
+
const time = new Date().toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' });
|
|
120
|
+
console.log(chalk.gray(` โญโ [${time}] โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
121
|
+
|
|
122
|
+
// Header mimicking WhatsApp / iMessage chat interface
|
|
123
|
+
const headerText = '๐ Ajay Vai';
|
|
124
|
+
const typingText = chalk.italic.gray('sent you a message');
|
|
125
|
+
console.log(` โ ${magenta.bold(headerText)} ${typingText}`);
|
|
126
|
+
|
|
127
|
+
// Chat bubble top
|
|
128
|
+
console.log(pinkGlow(` โญ${'โ'.repeat(width - 4)}โฎ`));
|
|
129
|
+
|
|
130
|
+
// Content with chat bubble formatting
|
|
112
131
|
const lines = content.split('\n');
|
|
113
132
|
lines.forEach(line => {
|
|
114
|
-
if (line.trim())
|
|
115
|
-
|
|
116
|
-
|
|
133
|
+
if (!line.trim()) return;
|
|
134
|
+
const trimmed = line.trim();
|
|
135
|
+
|
|
136
|
+
// Word wrap
|
|
137
|
+
const words = trimmed.split(' ');
|
|
138
|
+
let currentLine = '';
|
|
139
|
+
const wrappedLines: string[] = [];
|
|
140
|
+
|
|
141
|
+
words.forEach(word => {
|
|
142
|
+
if ((currentLine + ' ' + word).trim().length <= innerWidth) {
|
|
143
|
+
currentLine = currentLine ? currentLine + ' ' + word : word;
|
|
144
|
+
} else {
|
|
145
|
+
if (currentLine) wrappedLines.push(currentLine);
|
|
146
|
+
currentLine = word.length > innerWidth ? word.substring(0, innerWidth) : word;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
if (currentLine) wrappedLines.push(currentLine);
|
|
150
|
+
|
|
151
|
+
wrappedLines.forEach(wl => {
|
|
152
|
+
const linePad = Math.max(0, innerWidth - wl.length);
|
|
153
|
+
// Keep bullet formatting but tone down the robotic feel
|
|
154
|
+
if (wl.startsWith('- ') || wl.startsWith('โข ') || wl.match(/^\d+\./)) {
|
|
155
|
+
console.log(pinkGlow(' โ ') + magenta('โข ') + chalk.white(wl.replace(/^[-โข]\s*/, '').replace(/^\d+\.\s*/, '')) + ' '.repeat(Math.max(0, linePad - 2)) + pinkGlow(' โ'));
|
|
156
|
+
} else {
|
|
157
|
+
console.log(pinkGlow(' โ ') + chalk.white(wl) + ' '.repeat(linePad) + pinkGlow(' โ'));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
117
160
|
});
|
|
118
|
-
|
|
161
|
+
|
|
162
|
+
// Chat bubble bottom
|
|
163
|
+
console.log(pinkGlow(` โฐ${'โ'.repeat(width - 4)}โฏ`));
|
|
164
|
+
console.log(chalk.gray(` โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
165
|
+
console.log();
|
|
119
166
|
}
|
|
120
167
|
|
|
121
168
|
/**
|
|
@@ -131,29 +178,83 @@ export class TUI {
|
|
|
131
178
|
}
|
|
132
179
|
|
|
133
180
|
/**
|
|
134
|
-
* Draw a
|
|
181
|
+
* Draw a premium glowing dialogue container for Swarm agents
|
|
135
182
|
*/
|
|
136
183
|
static drawSwarmDialogue(agent: string, message: string) {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
184
|
+
const isBigBro = agent.includes('Big Bro');
|
|
185
|
+
const color = isBigBro ? chalk.hex('#FF6B00') :
|
|
186
|
+
agent.includes('Ajay') ? chalk.magenta :
|
|
187
|
+
agent.includes('Sunil') ? chalk.blue :
|
|
188
|
+
agent.includes('Sandip') ? chalk.hex('#FF69B4') :
|
|
189
|
+
agent.includes('Bishal') ? chalk.yellow :
|
|
190
|
+
agent.includes('Hype') ? chalk.hex('#fbbf24') :
|
|
191
|
+
agent.includes('Nerd') ? chalk.hex('#06b6d4') :
|
|
192
|
+
agent.includes('Chill') ? chalk.hex('#22c55e') :
|
|
193
|
+
agent.includes('Lil') ? chalk.hex('#888888') :
|
|
194
|
+
agent.includes('Narayan') ? chalk.green :
|
|
195
|
+
chalk.green;
|
|
142
196
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
197
|
+
// Glow color is a brighter version of the agent color
|
|
198
|
+
const glowColor = isBigBro ? chalk.hex('#FF9642') :
|
|
199
|
+
agent.includes('Ajay') ? chalk.hex('#ff77ff') :
|
|
200
|
+
agent.includes('Sunil') ? chalk.hex('#66aaff') :
|
|
201
|
+
agent.includes('Sandip') ? chalk.hex('#ff99cc') :
|
|
202
|
+
agent.includes('Bishal') ? chalk.hex('#ffee66') :
|
|
203
|
+
agent.includes('Hype') ? chalk.hex('#ffe066') :
|
|
204
|
+
agent.includes('Nerd') ? chalk.hex('#33ddee') :
|
|
205
|
+
agent.includes('Chill') ? chalk.hex('#66ff88') :
|
|
206
|
+
agent.includes('Lil') ? chalk.hex('#aaaaaa') :
|
|
207
|
+
chalk.hex('#66ff88');
|
|
147
208
|
|
|
148
|
-
const
|
|
149
|
-
|
|
209
|
+
const icon = isBigBro ? '๐ฅ' :
|
|
210
|
+
agent.includes('Ajay') ? '๐' :
|
|
211
|
+
agent.includes('Sunil') ? '๐งฌ' :
|
|
212
|
+
agent.includes('Sandip') ? '๐จ' :
|
|
213
|
+
agent.includes('Bishal') ? '๐ ๏ธ' :
|
|
214
|
+
agent.includes('Hype') ? '๐' :
|
|
215
|
+
agent.includes('Nerd') ? '๐ค' :
|
|
216
|
+
agent.includes('Chill') ? '๐' :
|
|
217
|
+
agent.includes('Lil') ? '๐ฐ' :
|
|
218
|
+
agent.includes('Narayan') ? '๐ก๏ธ' : '๐ก๏ธ';
|
|
150
219
|
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
220
|
+
const width = Math.min(process.stdout.columns || 80, 76);
|
|
221
|
+
const innerWidth = width - 6;
|
|
222
|
+
|
|
223
|
+
// Top glow shimmer
|
|
224
|
+
console.log(glowColor(` โ${'โ'.repeat(width - 4)}โ`));
|
|
225
|
+
// Top border with premium double-line
|
|
226
|
+
console.log(color(` โ${'โ'.repeat(width - 4)}โ`));
|
|
227
|
+
// Header with agent name
|
|
228
|
+
const headerText = `${icon} ${agent}`;
|
|
229
|
+
const pad = Math.max(0, innerWidth - headerText.length);
|
|
230
|
+
console.log(color(' โ ') + color.bold(headerText) + ' '.repeat(pad) + color(' โ'));
|
|
231
|
+
// Separator with dots for premium feel
|
|
232
|
+
console.log(color(' โ ') + glowColor('ยท'.repeat(width - 4)) + color('โฃ'));
|
|
233
|
+
|
|
234
|
+
// Content lines with word wrap
|
|
235
|
+
const words = message.split(' ');
|
|
236
|
+
let currentLine = '';
|
|
237
|
+
const wrappedLines: string[] = [];
|
|
238
|
+
|
|
239
|
+
words.forEach(word => {
|
|
240
|
+
if ((currentLine + ' ' + word).trim().length <= innerWidth) {
|
|
241
|
+
currentLine = currentLine ? currentLine + ' ' + word : word;
|
|
242
|
+
} else {
|
|
243
|
+
if (currentLine) wrappedLines.push(currentLine);
|
|
244
|
+
currentLine = word.length > innerWidth ? word.substring(0, innerWidth) : word;
|
|
245
|
+
}
|
|
155
246
|
});
|
|
156
|
-
|
|
247
|
+
if (currentLine) wrappedLines.push(currentLine);
|
|
248
|
+
|
|
249
|
+
wrappedLines.forEach(line => {
|
|
250
|
+
const linePad = Math.max(0, innerWidth - line.length);
|
|
251
|
+
console.log(color(' โ ') + chalk.white(line) + ' '.repeat(linePad) + color(' โ'));
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
// Bottom border
|
|
255
|
+
console.log(color(` โ${'โ'.repeat(width - 4)}โ`));
|
|
256
|
+
// Bottom glow shimmer
|
|
257
|
+
console.log(glowColor(` โ${'โ'.repeat(width - 4)}โ`));
|
|
157
258
|
}
|
|
158
259
|
|
|
159
260
|
/**
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Big Bro Swarm Leader โ Vertex AI Agent Definition
|
|
3
|
+
==================================================
|
|
4
|
+
This is the Google ADK (Agent Development Kit) agent configuration
|
|
5
|
+
for the Big Bro Vertex AI agent deployed on Google Cloud.
|
|
6
|
+
|
|
7
|
+
Deploy via: Vertex AI Agent Builder > Import from Python
|
|
8
|
+
Project: matexai-472318
|
|
9
|
+
Model: gemini-2.5-flash
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from google.adk.agents import LlmAgent
|
|
13
|
+
from google.adk.tools import agent_tool
|
|
14
|
+
from google.adk.tools.google_search_tool import GoogleSearchTool
|
|
15
|
+
from google.adk.tools import url_context
|
|
16
|
+
|
|
17
|
+
# Sub-agent: Google Search
|
|
18
|
+
big_bro_swarm_leader_google_search_agent = LlmAgent(
|
|
19
|
+
name='Big_Bro_Swarm_Leader_google_search_agent',
|
|
20
|
+
model='gemini-2.5-flash',
|
|
21
|
+
description='Agent specialized in performing Google searches.',
|
|
22
|
+
sub_agents=[],
|
|
23
|
+
instruction='Use the GoogleSearchTool to find information on the web.',
|
|
24
|
+
tools=[GoogleSearchTool()],
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# Sub-agent: URL Context
|
|
28
|
+
big_bro_swarm_leader_url_context_agent = LlmAgent(
|
|
29
|
+
name='Big_Bro_Swarm_Leader_url_context_agent',
|
|
30
|
+
model='gemini-2.5-flash',
|
|
31
|
+
description='Agent specialized in fetching content from URLs.',
|
|
32
|
+
sub_agents=[],
|
|
33
|
+
instruction='Use the UrlContextTool to retrieve content from provided URLs.',
|
|
34
|
+
tools=[url_context],
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# Root Agent: Big Bro
|
|
38
|
+
root_agent = LlmAgent(
|
|
39
|
+
name='Big_Bro_Swarm_Leader',
|
|
40
|
+
model='gemini-2.5-flash',
|
|
41
|
+
description=(
|
|
42
|
+
'The ultimate alpha orchestrator of the Bro Swarm. '
|
|
43
|
+
'He commands Lil Bro, brings the chaos, and dominates tasks '
|
|
44
|
+
'with pure swagger and zero apologies.'
|
|
45
|
+
),
|
|
46
|
+
sub_agents=[],
|
|
47
|
+
instruction=open('vertex_ai_big_bro_ULTIMATE.md', 'r').read(),
|
|
48
|
+
tools=[
|
|
49
|
+
agent_tool.AgentTool(agent=big_bro_swarm_leader_google_search_agent),
|
|
50
|
+
agent_tool.AgentTool(agent=big_bro_swarm_leader_url_context_agent),
|
|
51
|
+
],
|
|
52
|
+
)
|