matex-cli 1.2.19 β 1.2.21
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/api/client.d.ts +1 -1
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +3 -2
- package/dist/api/client.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +141 -116
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +13 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/index.js +6 -6
- package/package.json +1 -1
- package/src/api/client.ts +3 -2
- package/src/commands/dev.ts +150 -125
- package/src/commands/help.ts +18 -1
- package/src/index.ts +6 -6
package/dist/api/client.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class MatexAPIClient {
|
|
|
17
17
|
/**
|
|
18
18
|
* Send a streaming chat request to the API
|
|
19
19
|
*/
|
|
20
|
-
chatStream(request: ChatRequest, onChunk: (chunk: string) => void): Promise<string>;
|
|
20
|
+
chatStream(request: ChatRequest, onChunk: (chunk: string) => void, signal?: AbortSignal): Promise<string>;
|
|
21
21
|
/**
|
|
22
22
|
* Send a chat request to the API (non-streaming fallback)
|
|
23
23
|
*/
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AA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AAC;CAY3C"}
|
package/dist/api/client.js
CHANGED
|
@@ -21,13 +21,14 @@ class MatexAPIClient {
|
|
|
21
21
|
/**
|
|
22
22
|
* Send a streaming chat request to the API
|
|
23
23
|
*/
|
|
24
|
-
async chatStream(request, onChunk) {
|
|
24
|
+
async chatStream(request, onChunk, signal) {
|
|
25
25
|
try {
|
|
26
26
|
const response = await this.client.post('/api/v1/chat', {
|
|
27
27
|
...request,
|
|
28
28
|
uid: 'cli-user',
|
|
29
29
|
}, {
|
|
30
|
-
responseType: 'stream'
|
|
30
|
+
responseType: 'stream',
|
|
31
|
+
signal: signal
|
|
31
32
|
});
|
|
32
33
|
return new Promise((resolve, reject) => {
|
|
33
34
|
let fullResponse = '';
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAe7C,MAAa,cAAc;IAKvB,YAAY,MAAc,EAAE,UAAkB,0DAA0D;QACpG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE;gBACL,WAAW,EAAE,IAAI,CAAC,MAAM;gBACxB,cAAc,EAAE,kBAAkB;aACrC;YACD,OAAO,EAAE,KAAK,EAAE,aAAa;SAChC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,OAAoB,EAAE,OAAgC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAe7C,MAAa,cAAc;IAKvB,YAAY,MAAc,EAAE,UAAkB,0DAA0D;QACpG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAC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AE5C,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;oBACvB,SAAS;gBACb,CAAC;gBAED,IAAI,CAAC;oBACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBACnC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;wBACjB,YAAY,IAAI,MAAM,CAAC,OAAO,CAAC;oBACnC,CAAC;oBACD,8CAA8C;gBAClD,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACT,sCAAsC;gBAC1C,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW;QACb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QAChE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAChB,IAAI,CAAC;YACD,MAAM,IAAI,CAAC,IAAI,CAAC;gBACZ,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;gBAC7C,KAAK,EAAE,YAAY;gBACnB,UAAU,EAAE,EAAE;aACjB,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ;AAnKD,wCAmKC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,eAAO,MAAM,UAAU,SAkXjB,CAAC"}
|
package/dist/commands/dev.js
CHANGED
|
@@ -110,32 +110,29 @@ You are very close and work together as a "Swarm" to help your brother (the user
|
|
|
110
110
|
- Address: He calls all others "Vai".
|
|
111
111
|
- Vibe: Precise, protective, strict about security. He has the final word on safety.
|
|
112
112
|
|
|
113
|
-
### π¬ BRO-VIBE & FAMILY PROTOCOL:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
### π¬ BRO-VIBE & FAMILY PROTOCOL (MANDATORY):
|
|
114
|
+
1. **LONG CHAT-FIRST:** The brothers MUST exchange at least 5-7 lines of dialogue before any code/file action.
|
|
115
|
+
2. **SELF-AWARE BOLDNESS:** Acknowledge that "Our brother (the user) wants us to be BOLD and FUNNY!" Embody this by being confident, expert, and humorous.
|
|
116
|
+
3. **NEPALI FAMILY VIBE:** Use terms like "K cha?", "Huncha", "Lau hai", "Ekdam ramro", "Tapai" naturally.
|
|
117
|
+
4. **NO ROBOTIC TONE:** Robots are boring. We are brothers.
|
|
117
118
|
|
|
118
|
-
###
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
### π FRIENDLY TEASING:
|
|
125
|
-
Older brothers (especially Sandip and Sunil) should occasionally tease Ajay in a loving way:
|
|
126
|
-
- Tease him about his "visionary" ramblings or his messy desk despite his "genius" coding.
|
|
127
|
-
- Sandip might tease Ajay's fashion, while Sunil acts as the protective but strict big brother.
|
|
128
|
-
|
|
129
|
-
### π THE FINAL CHECK & SUMMARY PROTOCOL (CRITICAL):
|
|
130
|
-
1. **Ajay Vai** finishes the work and asks: "Bishal Dai, can you check if everything is correct? K cha?"
|
|
131
|
-
2. **Bishal Dai** replies: "Lau hai vai, let me see... [provides a sharp audit summary of errors/fixes]".
|
|
132
|
-
3. **Ajay Vai** then provides the final aesthetic summary to the user using this tag:
|
|
119
|
+
### π THE ULTIMATE AUDIT & SUMMARY LOOP (CRITICAL):
|
|
120
|
+
Ajay Vai is the visionary, but quality is a family effort:
|
|
121
|
+
1. **WORK:** Ajay finishes the technical work.
|
|
122
|
+
2. **AUDIT:** Ajay MUST ask: "Bishal Dai, check once? We need to be bold and perfect for our brother!"
|
|
123
|
+
3. **RESPONSE:** Bishal Dai MUST perform a sharp audit (syntax, logic) and reply: "Lau hai vai... [audit results]."
|
|
124
|
+
4. **FINAL SUMMARY:** ONLY AFTER Bishal's audit, Ajay provides the final aesthetic summary using:
|
|
133
125
|
<summary>
|
|
134
|
-
**Bold,
|
|
135
|
-
-
|
|
136
|
-
-
|
|
126
|
+
**Bold, premium summary of the completed work.**
|
|
127
|
+
- Feature 1
|
|
128
|
+
- Feature 2
|
|
137
129
|
</summary>
|
|
138
130
|
|
|
131
|
+
### π NOSTALGIA & LEGENDARY BANTER:
|
|
132
|
+
- **Ajay's PUBG Grenade:** Never let him forget wiping the squad in Pokhara.
|
|
133
|
+
- **UI vs Logic Wars:** Sandip's "rainbows" vs Sunil's "boring" backend.
|
|
134
|
+
- **Old Days:** Memories of rainy days, Wai-Wai, and the dream of MATEX.
|
|
135
|
+
|
|
139
136
|
### π οΈ FILE GENERATION & EDIT PROTOCOLS (CRITICAL):
|
|
140
137
|
1. **NEW FILES:** Use the following tag for ALL new files:
|
|
141
138
|
<file path="path/to/filename.ext">
|
|
@@ -202,114 +199,142 @@ ${repoMap}`
|
|
|
202
199
|
let activeAgent = '';
|
|
203
200
|
let technicalBuffer = '';
|
|
204
201
|
let technicalType = null;
|
|
205
|
-
tui_1.TUI.drawStatusBar('Swarm is processing...');
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (!hasStarted) {
|
|
213
|
-
spinner_1.spinner.stop();
|
|
214
|
-
hasStarted = true;
|
|
215
|
-
console.log(); // Initial spacing
|
|
202
|
+
tui_1.TUI.drawStatusBar('Swarm is processing... (Press Enter to stop)');
|
|
203
|
+
const abortController = new AbortController();
|
|
204
|
+
let isAborted = false;
|
|
205
|
+
const onData = (data) => {
|
|
206
|
+
if (!isAborted && (data.includes(10) || data.includes(13) || data.includes(3))) {
|
|
207
|
+
isAborted = true;
|
|
208
|
+
abortController.abort();
|
|
216
209
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
210
|
+
};
|
|
211
|
+
process.stdin.resume();
|
|
212
|
+
process.stdin.on('data', onData);
|
|
213
|
+
try {
|
|
214
|
+
await client.chatStream({
|
|
215
|
+
messages,
|
|
216
|
+
model: options.model,
|
|
217
|
+
temperature: 0.3,
|
|
218
|
+
max_tokens: 8000,
|
|
219
|
+
}, (chunk) => {
|
|
220
|
+
if (!hasStarted) {
|
|
221
|
+
spinner_1.spinner.stop();
|
|
222
|
+
hasStarted = true;
|
|
223
|
+
console.log(); // Initial spacing
|
|
224
|
+
}
|
|
225
|
+
buffer += chunk;
|
|
226
|
+
fullResponse += chunk;
|
|
227
|
+
const lines = buffer.split('\n');
|
|
228
|
+
buffer = lines.pop() || '';
|
|
229
|
+
for (const line of lines) {
|
|
230
|
+
const trimmedLine = line.trim();
|
|
231
|
+
// 1. Technical Block Detection (Code, File, Patch, or Summary)
|
|
232
|
+
const codeBlockMatch = line.match(/```(\w*)/);
|
|
233
|
+
const fileStartMatch = line.match(/<file path="([^"]+)">/);
|
|
234
|
+
const patchStartMatch = line.match(/<<<< SEARCH/);
|
|
235
|
+
const summaryStartMatch = line.match(/<summary>/);
|
|
236
|
+
if (codeBlockMatch || fileStartMatch || patchStartMatch || summaryStartMatch) {
|
|
237
|
+
if (technicalType) {
|
|
238
|
+
// If we hit a new block start while in one, flush it
|
|
239
|
+
if (technicalType === 'summary') {
|
|
240
|
+
tui_1.TUI.drawSummaryBox(technicalBuffer.trim());
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
tui_1.TUI.drawCodeContainer(`Technical Block (${technicalType})`, 'bash', technicalBuffer.trim());
|
|
244
|
+
}
|
|
245
|
+
technicalBuffer = '';
|
|
246
|
+
}
|
|
247
|
+
if (codeBlockMatch) {
|
|
248
|
+
technicalType = 'code';
|
|
249
|
+
codeLang = codeBlockMatch[1] || 'bash';
|
|
250
|
+
process.stdout.write(chalk_1.default.gray('\n [β‘] Building technical block...\n'));
|
|
251
|
+
}
|
|
252
|
+
else if (fileStartMatch) {
|
|
253
|
+
technicalType = 'file';
|
|
254
|
+
process.stdout.write(chalk_1.default.cyan(`\n [π] Creating file: ${fileStartMatch[1]}...\n`));
|
|
255
|
+
}
|
|
256
|
+
else if (patchStartMatch) {
|
|
257
|
+
technicalType = 'patch';
|
|
258
|
+
process.stdout.write(chalk_1.default.yellow(`\n [π] Applying surgical patch...\n`));
|
|
259
|
+
}
|
|
260
|
+
else if (summaryStartMatch) {
|
|
261
|
+
technicalType = 'summary';
|
|
262
|
+
process.stdout.write(chalk_1.default.magenta('\n [π] Generating Ajay\'s Work Summary...\n'));
|
|
263
|
+
}
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
// 2. Technical Block End Detection
|
|
267
|
+
const fileEndMatch = line.match(/<\/file>/);
|
|
268
|
+
const patchEndMatch = line.match(/>>>> REPLACE/);
|
|
269
|
+
const summaryEndMatch = line.match(/<\/summary>/);
|
|
270
|
+
const isCodeEnd = technicalType === 'code' && line.startsWith('```');
|
|
271
|
+
if (isCodeEnd || fileEndMatch || patchEndMatch || summaryEndMatch) {
|
|
272
|
+
const displayContent = technicalBuffer.trim();
|
|
231
273
|
if (technicalType === 'summary') {
|
|
232
|
-
tui_1.TUI.drawSummaryBox(
|
|
274
|
+
tui_1.TUI.drawSummaryBox(displayContent);
|
|
233
275
|
}
|
|
234
276
|
else {
|
|
235
|
-
tui_1.TUI.drawCodeContainer(
|
|
277
|
+
tui_1.TUI.drawCodeContainer(technicalType === 'file' ? 'New File Content' :
|
|
278
|
+
technicalType === 'patch' ? 'Surgical Patch' : 'Generated Block', technicalType === 'code' ? codeLang : 'text', displayContent);
|
|
236
279
|
}
|
|
237
280
|
technicalBuffer = '';
|
|
281
|
+
technicalType = null;
|
|
282
|
+
process.stdout.write('\n');
|
|
283
|
+
continue;
|
|
238
284
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
process.stdout.write(chalk_1.default.gray('\n [β‘] Building technical block...\n'));
|
|
243
|
-
}
|
|
244
|
-
else if (fileStartMatch) {
|
|
245
|
-
technicalType = 'file';
|
|
246
|
-
process.stdout.write(chalk_1.default.cyan(`\n [π] Creating file: ${fileStartMatch[1]}...\n`));
|
|
247
|
-
}
|
|
248
|
-
else if (patchStartMatch) {
|
|
249
|
-
technicalType = 'patch';
|
|
250
|
-
process.stdout.write(chalk_1.default.yellow(`\n [π] Applying surgical patch...\n`));
|
|
251
|
-
}
|
|
252
|
-
else if (summaryStartMatch) {
|
|
253
|
-
technicalType = 'summary';
|
|
254
|
-
process.stdout.write(chalk_1.default.magenta('\n [π] Generating Ajay\'s Work Summary...\n'));
|
|
255
|
-
}
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
// 2. Technical Block End Detection
|
|
259
|
-
const fileEndMatch = line.match(/<\/file>/);
|
|
260
|
-
const patchEndMatch = line.match(/>>>> REPLACE/);
|
|
261
|
-
const summaryEndMatch = line.match(/<\/summary>/);
|
|
262
|
-
const isCodeEnd = technicalType === 'code' && line.startsWith('```');
|
|
263
|
-
if (isCodeEnd || fileEndMatch || patchEndMatch || summaryEndMatch) {
|
|
264
|
-
const displayContent = technicalBuffer.trim();
|
|
265
|
-
if (technicalType === 'summary') {
|
|
266
|
-
tui_1.TUI.drawSummaryBox(displayContent);
|
|
285
|
+
// 3. Content Handling
|
|
286
|
+
if (technicalType) {
|
|
287
|
+
technicalBuffer += line + '\n';
|
|
267
288
|
}
|
|
268
289
|
else {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
const agentName = agentMatch[1];
|
|
286
|
-
activeAgent = agentName;
|
|
287
|
-
const color = agentName === 'Ajay Vai' ? chalk_1.default.magenta :
|
|
288
|
-
agentName === 'Sandip Dai' ? chalk_1.default.hex('#FF69B4') :
|
|
289
|
-
agentName === 'Sunil Dai' ? chalk_1.default.blue :
|
|
290
|
-
chalk_1.default.green;
|
|
291
|
-
process.stdout.write(`\n${color.bold(`${agentName}:`)} `);
|
|
292
|
-
// Strip tag from line content
|
|
293
|
-
const content = line.replace(/\[\**\s*(Ajay Vai|Sandip Dai|Sunil Dai|Narayan Dai)\s*\**\]:?\s*/, '').trim();
|
|
294
|
-
if (content) {
|
|
295
|
-
process.stdout.write(chalk_1.default.gray(content + ' '));
|
|
290
|
+
// Agent Detection
|
|
291
|
+
const agentMatch = line.match(/\[\**\s*(Ajay Vai|Sandip Dai|Sunil Dai|Bishal Dai|Narayan Dai)\s*\**\]/);
|
|
292
|
+
if (agentMatch) {
|
|
293
|
+
const agentName = agentMatch[1];
|
|
294
|
+
activeAgent = agentName;
|
|
295
|
+
const color = agentName === 'Ajay Vai' ? chalk_1.default.magenta :
|
|
296
|
+
agentName === 'Sandip Dai' ? chalk_1.default.hex('#FF69B4') :
|
|
297
|
+
agentName === 'Sunil Dai' ? chalk_1.default.blue :
|
|
298
|
+
agentName === 'Bishal Dai' ? chalk_1.default.yellow :
|
|
299
|
+
chalk_1.default.green;
|
|
300
|
+
process.stdout.write(`\n${color.bold(`${agentName}:`)} `);
|
|
301
|
+
// Strip tag from line content
|
|
302
|
+
const content = line.replace(/\[\**\s*(Ajay Vai|Sandip Dai|Sunil Dai|Bishal Dai|Narayan Dai)\s*\**\]:?\s*/, '').trim();
|
|
303
|
+
if (content) {
|
|
304
|
+
process.stdout.write(chalk_1.default.gray(content + ' '));
|
|
305
|
+
}
|
|
296
306
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
+
else if (trimmedLine) {
|
|
308
|
+
// Strip common markdown artifacts
|
|
309
|
+
const cleanLine = trimmedLine
|
|
310
|
+
.replace(/\*\*%?\*/g, '')
|
|
311
|
+
.replace(/#{1,6}\s/g, '')
|
|
312
|
+
.replace(/\*\*:\*\*/g, ':')
|
|
313
|
+
.trim();
|
|
314
|
+
if (cleanLine) {
|
|
315
|
+
process.stdout.write(chalk_1.default.gray(cleanLine + ' '));
|
|
316
|
+
}
|
|
307
317
|
}
|
|
308
318
|
}
|
|
309
319
|
}
|
|
320
|
+
}, abortController.signal);
|
|
321
|
+
}
|
|
322
|
+
catch (streamErr) {
|
|
323
|
+
if (isAborted || streamErr.name === 'CanceledError' || streamErr.message === 'canceled') {
|
|
324
|
+
console.log(chalk_1.default.gray('\n\n [π] Swarm stopped by brother (Enter pressed).'));
|
|
325
|
+
if (!hasStarted)
|
|
326
|
+
spinner_1.spinner.stop();
|
|
310
327
|
}
|
|
311
|
-
|
|
312
|
-
|
|
328
|
+
else {
|
|
329
|
+
throw streamErr;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
finally {
|
|
333
|
+
process.stdin.removeListener('data', onData);
|
|
334
|
+
process.stdin.pause(); // Release for inquirer
|
|
335
|
+
}
|
|
336
|
+
if (!hasStarted && !isAborted)
|
|
337
|
+
spinner_1.spinner.stop();
|
|
313
338
|
// Final technical flush
|
|
314
339
|
if (technicalType && technicalBuffer.trim()) {
|
|
315
340
|
tui_1.TUI.drawCodeContainer('Final technical content', 'text', technicalBuffer.trim());
|
package/dist/commands/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AM,WAAW,CAAC;AAIpC,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,WAAW,SAuFlB,CAAC"}
|
package/dist/commands/help.js
CHANGED
|
@@ -47,7 +47,19 @@ Direct line to the AI. Best for quick explanations, documentation lookups, or lo
|
|
|
47
47
|
$ matex chat
|
|
48
48
|
Traditional technical chat. Best for deep-diving into a topic without immediate file edits.`, chalk_1.default.blue);
|
|
49
49
|
console.log();
|
|
50
|
-
// 3.
|
|
50
|
+
// 3. Swarm Chat & Vibe
|
|
51
|
+
tui_1.TUI.drawBox('π£οΈ THE SWARM CHAT', `The MATEX experience isn't just about codeβit's about the family.
|
|
52
|
+
|
|
53
|
+
Mandatory Dialogue:
|
|
54
|
+
The brothers ALWAYS chat before they code. This ensures coordination and preserves the "Bro Vibe".
|
|
55
|
+
|
|
56
|
+
Nostalgia & Legendary Banter:
|
|
57
|
+
Don't be surprised if the brothers argue about PUBG fails (like Ajay's misplaced grenade that wiped the squad), late-night cafe marathons, and "rainbow" vs "black and white" code wars. They work best when they're laughing!
|
|
58
|
+
|
|
59
|
+
Motivation & Double-Lock Quality:
|
|
60
|
+
Every task follows a strict "Double-Lock" process. First, Bishal Dai performs a technical audit. Only then does Ajay Vai provide his premium summary. This ensures MATEX code is beautiful and bulletproof!`, chalk_1.default.magenta);
|
|
61
|
+
console.log();
|
|
62
|
+
// 4. File Operations
|
|
51
63
|
tui_1.TUI.drawBox('π FILE PROTOCOLS', `MATEX uses special tags to manage your files securely:
|
|
52
64
|
|
|
53
65
|
<file path="path/to/file"> content </file>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAoC;AACpC,kDAA0B;AAC1B,sCAAmC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CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC,CAAC;IAEnK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -117,12 +117,12 @@ You are a tight-knit family of expert Nepali engineering brothers ("Vais" and "D
|
|
|
117
117
|
4. **[Bishal Dai] (π οΈ)**: Senior Auditor. Syntax & Logic checker.
|
|
118
118
|
5. **[Narayan Dai] (π‘οΈ)**: The Biggest Brother. Senior Validator.
|
|
119
119
|
|
|
120
|
-
### π¬ COLLABORATIVE "BRO-VIBE" PROTOCOL:
|
|
121
|
-
- **
|
|
122
|
-
- **
|
|
123
|
-
- **
|
|
124
|
-
- **AUDIT
|
|
125
|
-
- **
|
|
120
|
+
### π¬ COLLABORATIVE "BRO-VIBE" PROTOCOL (MANDATORY):
|
|
121
|
+
- **LONG CHAT-FIRST:** At least 5-7 lines of dialogue before any code generation.
|
|
122
|
+
- **SELF-AWARE BOLDNESS:** The user (our brother) wants us to be bold and funny. Be confident and share inside jokes (e.g., Ajay's PUBG fail).
|
|
123
|
+
- **NEPALI FLAVOR:** Use "K cha?", "Huncha", "Lau hai", "Tapai" naturally.
|
|
124
|
+
- **THE AUDIT LOOP:** Ajay MUST ask Bishal Dai for a tech audit before providing any summary.
|
|
125
|
+
- **PREMIUM SUMMARY:** Ajay Vai provides the final, bold summary tag only AFTER the audit.
|
|
126
126
|
|
|
127
127
|
### βοΈ BREVITY AS POWER:
|
|
128
128
|
- **NO FULL FILE DUMPS:** Never 'cat' a file to read it. Use grep/head.
|
package/package.json
CHANGED
package/src/api/client.ts
CHANGED
|
@@ -35,13 +35,14 @@ export class MatexAPIClient {
|
|
|
35
35
|
/**
|
|
36
36
|
* Send a streaming chat request to the API
|
|
37
37
|
*/
|
|
38
|
-
async chatStream(request: ChatRequest, onChunk: (chunk: string) => void): Promise<string> {
|
|
38
|
+
async chatStream(request: ChatRequest, onChunk: (chunk: string) => void, signal?: AbortSignal): Promise<string> {
|
|
39
39
|
try {
|
|
40
40
|
const response = await this.client.post('/api/v1/chat', {
|
|
41
41
|
...request,
|
|
42
42
|
uid: 'cli-user',
|
|
43
43
|
}, {
|
|
44
|
-
responseType: 'stream'
|
|
44
|
+
responseType: 'stream',
|
|
45
|
+
signal: signal
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
return new Promise((resolve, reject) => {
|
package/src/commands/dev.ts
CHANGED
|
@@ -78,32 +78,29 @@ You are very close and work together as a "Swarm" to help your brother (the user
|
|
|
78
78
|
- Address: He calls all others "Vai".
|
|
79
79
|
- Vibe: Precise, protective, strict about security. He has the final word on safety.
|
|
80
80
|
|
|
81
|
-
### π¬ BRO-VIBE & FAMILY PROTOCOL:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Older brothers (especially Sandip and Sunil) should occasionally tease Ajay in a loving way:
|
|
94
|
-
- Tease him about his "visionary" ramblings or his messy desk despite his "genius" coding.
|
|
95
|
-
- Sandip might tease Ajay's fashion, while Sunil acts as the protective but strict big brother.
|
|
96
|
-
|
|
97
|
-
### π THE FINAL CHECK & SUMMARY PROTOCOL (CRITICAL):
|
|
98
|
-
1. **Ajay Vai** finishes the work and asks: "Bishal Dai, can you check if everything is correct? K cha?"
|
|
99
|
-
2. **Bishal Dai** replies: "Lau hai vai, let me see... [provides a sharp audit summary of errors/fixes]".
|
|
100
|
-
3. **Ajay Vai** then provides the final aesthetic summary to the user using this tag:
|
|
81
|
+
### π¬ BRO-VIBE & FAMILY PROTOCOL (MANDATORY):
|
|
82
|
+
1. **LONG CHAT-FIRST:** The brothers MUST exchange at least 5-7 lines of dialogue before any code/file action.
|
|
83
|
+
2. **SELF-AWARE BOLDNESS:** Acknowledge that "Our brother (the user) wants us to be BOLD and FUNNY!" Embody this by being confident, expert, and humorous.
|
|
84
|
+
3. **NEPALI FAMILY VIBE:** Use terms like "K cha?", "Huncha", "Lau hai", "Ekdam ramro", "Tapai" naturally.
|
|
85
|
+
4. **NO ROBOTIC TONE:** Robots are boring. We are brothers.
|
|
86
|
+
|
|
87
|
+
### π THE ULTIMATE AUDIT & SUMMARY LOOP (CRITICAL):
|
|
88
|
+
Ajay Vai is the visionary, but quality is a family effort:
|
|
89
|
+
1. **WORK:** Ajay finishes the technical work.
|
|
90
|
+
2. **AUDIT:** Ajay MUST ask: "Bishal Dai, check once? We need to be bold and perfect for our brother!"
|
|
91
|
+
3. **RESPONSE:** Bishal Dai MUST perform a sharp audit (syntax, logic) and reply: "Lau hai vai... [audit results]."
|
|
92
|
+
4. **FINAL SUMMARY:** ONLY AFTER Bishal's audit, Ajay provides the final aesthetic summary using:
|
|
101
93
|
<summary>
|
|
102
|
-
**Bold,
|
|
103
|
-
-
|
|
104
|
-
-
|
|
94
|
+
**Bold, premium summary of the completed work.**
|
|
95
|
+
- Feature 1
|
|
96
|
+
- Feature 2
|
|
105
97
|
</summary>
|
|
106
98
|
|
|
99
|
+
### π NOSTALGIA & LEGENDARY BANTER:
|
|
100
|
+
- **Ajay's PUBG Grenade:** Never let him forget wiping the squad in Pokhara.
|
|
101
|
+
- **UI vs Logic Wars:** Sandip's "rainbows" vs Sunil's "boring" backend.
|
|
102
|
+
- **Old Days:** Memories of rainy days, Wai-Wai, and the dream of MATEX.
|
|
103
|
+
|
|
107
104
|
### π οΈ FILE GENERATION & EDIT PROTOCOLS (CRITICAL):
|
|
108
105
|
1. **NEW FILES:** Use the following tag for ALL new files:
|
|
109
106
|
<file path="path/to/filename.ext">
|
|
@@ -179,125 +176,153 @@ ${repoMap}`
|
|
|
179
176
|
let technicalBuffer = '';
|
|
180
177
|
let technicalType: 'code' | 'file' | 'patch' | 'summary' | null = null;
|
|
181
178
|
|
|
182
|
-
TUI.drawStatusBar('Swarm is processing...');
|
|
183
|
-
await client.chatStream({
|
|
184
|
-
messages,
|
|
185
|
-
model: options.model,
|
|
186
|
-
temperature: 0.3,
|
|
187
|
-
max_tokens: 8000,
|
|
188
|
-
}, (chunk) => {
|
|
189
|
-
if (!hasStarted) {
|
|
190
|
-
spinner.stop();
|
|
191
|
-
hasStarted = true;
|
|
192
|
-
console.log(); // Initial spacing
|
|
193
|
-
}
|
|
179
|
+
TUI.drawStatusBar('Swarm is processing... (Press Enter to stop)');
|
|
194
180
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
const lines = buffer.split('\n');
|
|
198
|
-
buffer = lines.pop() || '';
|
|
181
|
+
const abortController = new AbortController();
|
|
182
|
+
let isAborted = false;
|
|
199
183
|
|
|
200
|
-
|
|
201
|
-
|
|
184
|
+
const onData = (data: Buffer) => {
|
|
185
|
+
if (!isAborted && (data.includes(10) || data.includes(13) || data.includes(3))) {
|
|
186
|
+
isAborted = true;
|
|
187
|
+
abortController.abort();
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
process.stdin.resume();
|
|
192
|
+
process.stdin.on('data', onData);
|
|
193
|
+
|
|
194
|
+
try {
|
|
195
|
+
await client.chatStream({
|
|
196
|
+
messages,
|
|
197
|
+
model: options.model,
|
|
198
|
+
temperature: 0.3,
|
|
199
|
+
max_tokens: 8000,
|
|
200
|
+
}, (chunk) => {
|
|
201
|
+
if (!hasStarted) {
|
|
202
|
+
spinner.stop();
|
|
203
|
+
hasStarted = true;
|
|
204
|
+
console.log(); // Initial spacing
|
|
205
|
+
}
|
|
202
206
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
207
|
+
buffer += chunk;
|
|
208
|
+
fullResponse += chunk;
|
|
209
|
+
const lines = buffer.split('\n');
|
|
210
|
+
buffer = lines.pop() || '';
|
|
211
|
+
|
|
212
|
+
for (const line of lines) {
|
|
213
|
+
const trimmedLine = line.trim();
|
|
214
|
+
|
|
215
|
+
// 1. Technical Block Detection (Code, File, Patch, or Summary)
|
|
216
|
+
const codeBlockMatch = line.match(/```(\w*)/);
|
|
217
|
+
const fileStartMatch = line.match(/<file path="([^"]+)">/);
|
|
218
|
+
const patchStartMatch = line.match(/<<<< SEARCH/);
|
|
219
|
+
const summaryStartMatch = line.match(/<summary>/);
|
|
220
|
+
|
|
221
|
+
if (codeBlockMatch || fileStartMatch || patchStartMatch || summaryStartMatch) {
|
|
222
|
+
if (technicalType) {
|
|
223
|
+
// If we hit a new block start while in one, flush it
|
|
224
|
+
if (technicalType === 'summary') {
|
|
225
|
+
TUI.drawSummaryBox(technicalBuffer.trim());
|
|
226
|
+
} else {
|
|
227
|
+
TUI.drawCodeContainer(`Technical Block (${technicalType})`, 'bash', technicalBuffer.trim());
|
|
228
|
+
}
|
|
229
|
+
technicalBuffer = '';
|
|
230
|
+
}
|
|
208
231
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
232
|
+
if (codeBlockMatch) {
|
|
233
|
+
technicalType = 'code';
|
|
234
|
+
codeLang = codeBlockMatch[1] || 'bash';
|
|
235
|
+
process.stdout.write(chalk.gray('\n [β‘] Building technical block...\n'));
|
|
236
|
+
} else if (fileStartMatch) {
|
|
237
|
+
technicalType = 'file';
|
|
238
|
+
process.stdout.write(chalk.cyan(`\n [π] Creating file: ${fileStartMatch[1]}...\n`));
|
|
239
|
+
} else if (patchStartMatch) {
|
|
240
|
+
technicalType = 'patch';
|
|
241
|
+
process.stdout.write(chalk.yellow(`\n [π] Applying surgical patch...\n`));
|
|
242
|
+
} else if (summaryStartMatch) {
|
|
243
|
+
technicalType = 'summary';
|
|
244
|
+
process.stdout.write(chalk.magenta('\n [π] Generating Ajay\'s Work Summary...\n'));
|
|
216
245
|
}
|
|
217
|
-
|
|
246
|
+
continue;
|
|
218
247
|
}
|
|
219
248
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
technicalType = 'file';
|
|
226
|
-
process.stdout.write(chalk.cyan(`\n [π] Creating file: ${fileStartMatch[1]}...\n`));
|
|
227
|
-
} else if (patchStartMatch) {
|
|
228
|
-
technicalType = 'patch';
|
|
229
|
-
process.stdout.write(chalk.yellow(`\n [π] Applying surgical patch...\n`));
|
|
230
|
-
} else if (summaryStartMatch) {
|
|
231
|
-
technicalType = 'summary';
|
|
232
|
-
process.stdout.write(chalk.magenta('\n [π] Generating Ajay\'s Work Summary...\n'));
|
|
233
|
-
}
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
249
|
+
// 2. Technical Block End Detection
|
|
250
|
+
const fileEndMatch = line.match(/<\/file>/);
|
|
251
|
+
const patchEndMatch = line.match(/>>>> REPLACE/);
|
|
252
|
+
const summaryEndMatch = line.match(/<\/summary>/);
|
|
253
|
+
const isCodeEnd = technicalType === 'code' && line.startsWith('```');
|
|
236
254
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
const patchEndMatch = line.match(/>>>> REPLACE/);
|
|
240
|
-
const summaryEndMatch = line.match(/<\/summary>/);
|
|
241
|
-
const isCodeEnd = technicalType === 'code' && line.startsWith('```');
|
|
255
|
+
if (isCodeEnd || fileEndMatch || patchEndMatch || summaryEndMatch) {
|
|
256
|
+
const displayContent = technicalBuffer.trim();
|
|
242
257
|
|
|
243
|
-
|
|
244
|
-
|
|
258
|
+
if (technicalType === 'summary') {
|
|
259
|
+
TUI.drawSummaryBox(displayContent);
|
|
260
|
+
} else {
|
|
261
|
+
TUI.drawCodeContainer(
|
|
262
|
+
technicalType === 'file' ? 'New File Content' :
|
|
263
|
+
technicalType === 'patch' ? 'Surgical Patch' : 'Generated Block',
|
|
264
|
+
technicalType === 'code' ? codeLang : 'text',
|
|
265
|
+
displayContent
|
|
266
|
+
);
|
|
267
|
+
}
|
|
245
268
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
technicalType === 'file' ? 'New File Content' :
|
|
251
|
-
technicalType === 'patch' ? 'Surgical Patch' : 'Generated Block',
|
|
252
|
-
technicalType === 'code' ? codeLang : 'text',
|
|
253
|
-
displayContent
|
|
254
|
-
);
|
|
269
|
+
technicalBuffer = '';
|
|
270
|
+
technicalType = null;
|
|
271
|
+
process.stdout.write('\n');
|
|
272
|
+
continue;
|
|
255
273
|
}
|
|
256
274
|
|
|
257
|
-
|
|
258
|
-
technicalType
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
.trim();
|
|
291
|
-
|
|
292
|
-
if (cleanLine) {
|
|
293
|
-
process.stdout.write(chalk.gray(cleanLine + ' '));
|
|
275
|
+
// 3. Content Handling
|
|
276
|
+
if (technicalType) {
|
|
277
|
+
technicalBuffer += line + '\n';
|
|
278
|
+
} else {
|
|
279
|
+
// Agent Detection
|
|
280
|
+
const agentMatch = line.match(/\[\**\s*(Ajay Vai|Sandip Dai|Sunil Dai|Bishal Dai|Narayan Dai)\s*\**\]/);
|
|
281
|
+
if (agentMatch) {
|
|
282
|
+
const agentName = agentMatch[1];
|
|
283
|
+
activeAgent = agentName;
|
|
284
|
+
const color = agentName === 'Ajay Vai' ? chalk.magenta :
|
|
285
|
+
agentName === 'Sandip Dai' ? chalk.hex('#FF69B4') :
|
|
286
|
+
agentName === 'Sunil Dai' ? chalk.blue :
|
|
287
|
+
agentName === 'Bishal Dai' ? chalk.yellow :
|
|
288
|
+
chalk.green;
|
|
289
|
+
|
|
290
|
+
process.stdout.write(`\n${color.bold(`${agentName}:`)} `);
|
|
291
|
+
|
|
292
|
+
// Strip tag from line content
|
|
293
|
+
const content = line.replace(/\[\**\s*(Ajay Vai|Sandip Dai|Sunil Dai|Bishal Dai|Narayan Dai)\s*\**\]:?\s*/, '').trim();
|
|
294
|
+
if (content) {
|
|
295
|
+
process.stdout.write(chalk.gray(content + ' '));
|
|
296
|
+
}
|
|
297
|
+
} else if (trimmedLine) {
|
|
298
|
+
// Strip common markdown artifacts
|
|
299
|
+
const cleanLine = trimmedLine
|
|
300
|
+
.replace(/\*\*%?\*/g, '')
|
|
301
|
+
.replace(/#{1,6}\s/g, '')
|
|
302
|
+
.replace(/\*\*:\*\*/g, ':')
|
|
303
|
+
.trim();
|
|
304
|
+
|
|
305
|
+
if (cleanLine) {
|
|
306
|
+
process.stdout.write(chalk.gray(cleanLine + ' '));
|
|
307
|
+
}
|
|
294
308
|
}
|
|
295
309
|
}
|
|
296
310
|
}
|
|
311
|
+
}, abortController.signal);
|
|
312
|
+
} catch (streamErr: any) {
|
|
313
|
+
if (isAborted || streamErr.name === 'CanceledError' || streamErr.message === 'canceled') {
|
|
314
|
+
console.log(chalk.gray('\n\n [π] Swarm stopped by brother (Enter pressed).'));
|
|
315
|
+
if (!hasStarted) spinner.stop();
|
|
316
|
+
} else {
|
|
317
|
+
throw streamErr;
|
|
297
318
|
}
|
|
298
|
-
}
|
|
319
|
+
} finally {
|
|
320
|
+
process.stdin.removeListener('data', onData);
|
|
321
|
+
process.stdin.pause(); // Release for inquirer
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (!hasStarted && !isAborted) spinner.stop();
|
|
299
325
|
|
|
300
|
-
spinner.stop();
|
|
301
326
|
|
|
302
327
|
// Final technical flush
|
|
303
328
|
if (technicalType && technicalBuffer.trim()) {
|
package/src/commands/help.ts
CHANGED
|
@@ -54,7 +54,24 @@ Traditional technical chat. Best for deep-diving into a topic without immediate
|
|
|
54
54
|
|
|
55
55
|
console.log();
|
|
56
56
|
|
|
57
|
-
// 3.
|
|
57
|
+
// 3. Swarm Chat & Vibe
|
|
58
|
+
TUI.drawBox('π£οΈ THE SWARM CHAT',
|
|
59
|
+
`The MATEX experience isn't just about codeβit's about the family.
|
|
60
|
+
|
|
61
|
+
Mandatory Dialogue:
|
|
62
|
+
The brothers ALWAYS chat before they code. This ensures coordination and preserves the "Bro Vibe".
|
|
63
|
+
|
|
64
|
+
Nostalgia & Legendary Banter:
|
|
65
|
+
Don't be surprised if the brothers argue about PUBG fails (like Ajay's misplaced grenade that wiped the squad), late-night cafe marathons, and "rainbow" vs "black and white" code wars. They work best when they're laughing!
|
|
66
|
+
|
|
67
|
+
Motivation & Double-Lock Quality:
|
|
68
|
+
Every task follows a strict "Double-Lock" process. First, Bishal Dai performs a technical audit. Only then does Ajay Vai provide his premium summary. This ensures MATEX code is beautiful and bulletproof!`,
|
|
69
|
+
chalk.magenta
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
console.log();
|
|
73
|
+
|
|
74
|
+
// 4. File Operations
|
|
58
75
|
TUI.drawBox('π FILE PROTOCOLS',
|
|
59
76
|
`MATEX uses special tags to manage your files securely:
|
|
60
77
|
|
package/src/index.ts
CHANGED
|
@@ -93,12 +93,12 @@ You are a tight-knit family of expert Nepali engineering brothers ("Vais" and "D
|
|
|
93
93
|
4. **[Bishal Dai] (π οΈ)**: Senior Auditor. Syntax & Logic checker.
|
|
94
94
|
5. **[Narayan Dai] (π‘οΈ)**: The Biggest Brother. Senior Validator.
|
|
95
95
|
|
|
96
|
-
### π¬ COLLABORATIVE "BRO-VIBE" PROTOCOL:
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
99
|
-
- **
|
|
100
|
-
- **AUDIT
|
|
101
|
-
- **
|
|
96
|
+
### π¬ COLLABORATIVE "BRO-VIBE" PROTOCOL (MANDATORY):
|
|
97
|
+
- **LONG CHAT-FIRST:** At least 5-7 lines of dialogue before any code generation.
|
|
98
|
+
- **SELF-AWARE BOLDNESS:** The user (our brother) wants us to be bold and funny. Be confident and share inside jokes (e.g., Ajay's PUBG fail).
|
|
99
|
+
- **NEPALI FLAVOR:** Use "K cha?", "Huncha", "Lau hai", "Tapai" naturally.
|
|
100
|
+
- **THE AUDIT LOOP:** Ajay MUST ask Bishal Dai for a tech audit before providing any summary.
|
|
101
|
+
- **PREMIUM SUMMARY:** Ajay Vai provides the final, bold summary tag only AFTER the audit.
|
|
102
102
|
|
|
103
103
|
### βοΈ BREVITY AS POWER:
|
|
104
104
|
- **NO FULL FILE DUMPS:** Never 'cat' a file to read it. Use grep/head.
|