@bonginkan/maria 4.2.21 → 4.2.22
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/README.md +5 -5
- package/dist/READY.manifest.json +1 -1
- package/dist/bin/maria.cjs +684 -606
- package/dist/bin/maria.cjs.map +1 -1
- package/dist/cli.cjs +677 -599
- package/dist/cli.cjs.map +1 -1
- package/dist/index.js +56 -23582
- package/dist/index.js.map +1 -1
- package/dist/server/express-server.cjs +348 -0
- package/dist/server/express-server.cjs.map +1 -0
- package/package.json +10 -7
- package/src/slash-commands/READY.manifest.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var fs2 = require('fs');
|
|
5
5
|
var path9 = require('path');
|
|
6
6
|
var dotenv = require('dotenv');
|
|
7
|
-
var
|
|
7
|
+
var chalk27 = require('chalk');
|
|
8
8
|
var crypto3 = require('crypto');
|
|
9
9
|
var http2 = require('http');
|
|
10
10
|
var url2 = require('url');
|
|
@@ -51,7 +51,7 @@ function _interopNamespace(e) {
|
|
|
51
51
|
var fs2__namespace = /*#__PURE__*/_interopNamespace(fs2);
|
|
52
52
|
var path9__namespace = /*#__PURE__*/_interopNamespace(path9);
|
|
53
53
|
var dotenv__namespace = /*#__PURE__*/_interopNamespace(dotenv);
|
|
54
|
-
var
|
|
54
|
+
var chalk27__default = /*#__PURE__*/_interopDefault(chalk27);
|
|
55
55
|
var crypto3__namespace = /*#__PURE__*/_interopNamespace(crypto3);
|
|
56
56
|
var http2__namespace = /*#__PURE__*/_interopNamespace(http2);
|
|
57
57
|
var url2__namespace = /*#__PURE__*/_interopNamespace(url2);
|
|
@@ -252,7 +252,7 @@ var init_animations = __esm({
|
|
|
252
252
|
start() {
|
|
253
253
|
this.interval = setInterval(() => {
|
|
254
254
|
process.stdout.write(
|
|
255
|
-
`\r${
|
|
255
|
+
`\r${chalk27__default.default.cyan(this.frames[this.currentFrame])} ${chalk27__default.default.gray(this.message)}...`
|
|
256
256
|
);
|
|
257
257
|
this.currentFrame = (this.currentFrame + 1) % this.frames.length;
|
|
258
258
|
}, 80);
|
|
@@ -290,7 +290,7 @@ var init_animations = __esm({
|
|
|
290
290
|
const elapsed = Math.floor((Date.now() - this.startTime) / 1e3);
|
|
291
291
|
const stage = this.stages[this.currentStage];
|
|
292
292
|
process.stdout.write(
|
|
293
|
-
`\r${
|
|
293
|
+
`\r${chalk27__default.default.cyan(this.spinnerFrames[this.currentFrame])} ${stage.icon} ${chalk27__default.default.gray(stage.message)}... ${chalk27__default.default.dim(`[${elapsed}s]`)}`
|
|
294
294
|
);
|
|
295
295
|
this.currentFrame = (this.currentFrame + 1) % this.spinnerFrames.length;
|
|
296
296
|
}, 80);
|
|
@@ -352,11 +352,11 @@ var init_animations = __esm({
|
|
|
352
352
|
const stage = stages[this.currentStage];
|
|
353
353
|
if (this.isComplex) {
|
|
354
354
|
process.stdout.write(
|
|
355
|
-
`\r${
|
|
355
|
+
`\r${chalk27__default.default.cyan(this.spinnerFrames[this.currentFrame])} ${stage} ${chalk27__default.default.dim(`[${elapsed}s]`)}`
|
|
356
356
|
);
|
|
357
357
|
} else {
|
|
358
358
|
process.stdout.write(
|
|
359
|
-
`\r${
|
|
359
|
+
`\r${chalk27__default.default.cyan(this.spinnerFrames[this.currentFrame])} ${chalk27__default.default.gray(stage)}...`
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
362
|
this.currentFrame = (this.currentFrame + 1) % this.spinnerFrames.length;
|
|
@@ -399,7 +399,7 @@ var init_animations = __esm({
|
|
|
399
399
|
start() {
|
|
400
400
|
this.interval = setInterval(() => {
|
|
401
401
|
process.stdout.write(
|
|
402
|
-
`\r${
|
|
402
|
+
`\r${chalk27__default.default.cyan(this.message)}${this.dots[this.currentDot]}`
|
|
403
403
|
);
|
|
404
404
|
this.currentDot = (this.currentDot + 1) % this.dots.length;
|
|
405
405
|
}, 300);
|
|
@@ -428,7 +428,7 @@ var init_animations = __esm({
|
|
|
428
428
|
const frame = this.frames[this.currentFrame];
|
|
429
429
|
const message = this.messages[this.currentFrame];
|
|
430
430
|
process.stdout.write(
|
|
431
|
-
`\r${frame} ${
|
|
431
|
+
`\r${frame} ${chalk27__default.default.cyan(message)}...`
|
|
432
432
|
);
|
|
433
433
|
this.currentFrame = (this.currentFrame + 1) % this.frames.length;
|
|
434
434
|
}, 1e3);
|
|
@@ -456,7 +456,7 @@ var init_animations = __esm({
|
|
|
456
456
|
const percentage = Math.floor(this.current / this.total * 100);
|
|
457
457
|
const filled = Math.floor(this.current / this.total * this.width);
|
|
458
458
|
const empty = this.width - filled;
|
|
459
|
-
const bar =
|
|
459
|
+
const bar = chalk27__default.default.green("\u2588").repeat(filled) + chalk27__default.default.gray("\u2591").repeat(empty);
|
|
460
460
|
process.stdout.write(`\r${this.label}: [${bar}] ${percentage}%`);
|
|
461
461
|
if (this.current >= this.total) {
|
|
462
462
|
process.stdout.write("\n");
|
|
@@ -1893,7 +1893,7 @@ var init_AuthenticationManager = __esm({
|
|
|
1893
1893
|
const response2 = await fetch(`${this.apiBase}/api/user/profile`, {
|
|
1894
1894
|
headers: {
|
|
1895
1895
|
"Authorization": `Bearer ${tokens.accessToken}`,
|
|
1896
|
-
"User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.2.
|
|
1896
|
+
"User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.2.22"}`
|
|
1897
1897
|
}
|
|
1898
1898
|
});
|
|
1899
1899
|
if (response2.status === 401) {
|
|
@@ -2436,7 +2436,7 @@ function withAuth(fn) {
|
|
|
2436
2436
|
try {
|
|
2437
2437
|
const tokens = await authManager.getValidTokens();
|
|
2438
2438
|
if (!tokens) {
|
|
2439
|
-
console.log(
|
|
2439
|
+
console.log(chalk27__default.default.red("\u{1F510} Authentication required \xB7 Run: maria /login"));
|
|
2440
2440
|
if (!testMode) process.exit(AUTH_EXIT_CODES.AUTH_REQUIRED);
|
|
2441
2441
|
return { success: false, message: "AUTH_REQUIRED" };
|
|
2442
2442
|
}
|
|
@@ -2446,33 +2446,33 @@ function withAuth(fn) {
|
|
|
2446
2446
|
return await fn(...args2);
|
|
2447
2447
|
} catch (error2) {
|
|
2448
2448
|
if (error2.code === "AUTH_REQUIRED") {
|
|
2449
|
-
console.log(
|
|
2449
|
+
console.log(chalk27__default.default.red("\u{1F510} Authentication required \xB7 Run: maria /login"));
|
|
2450
2450
|
if (!testMode) process.exit(AUTH_EXIT_CODES.AUTH_REQUIRED);
|
|
2451
2451
|
return { success: false, message: "AUTH_REQUIRED" };
|
|
2452
2452
|
}
|
|
2453
2453
|
if (error2.code === "REAUTH_REQUIRED" || error2.code === "TOKEN_EXPIRED") {
|
|
2454
|
-
console.log(
|
|
2454
|
+
console.log(chalk27__default.default.yellow("\u{1F504} Please re-authenticate \xB7 Run: maria /login"));
|
|
2455
2455
|
if (!testMode) process.exit(AUTH_EXIT_CODES.REAUTH_REQUIRED);
|
|
2456
2456
|
return { success: false, message: "REAUTH_REQUIRED" };
|
|
2457
2457
|
}
|
|
2458
2458
|
if (error2.code === "QUOTA_EXCEEDED") {
|
|
2459
|
-
console.log(
|
|
2459
|
+
console.log(chalk27__default.default.yellow("\u26A0 Quota exceeded \xB7 Run: maria /billing"));
|
|
2460
2460
|
if (!testMode) process.exit(AUTH_EXIT_CODES.QUOTA_EXCEEDED);
|
|
2461
2461
|
return { success: false, message: "QUOTA_EXCEEDED" };
|
|
2462
2462
|
}
|
|
2463
2463
|
if (error2.code === "PLAN_RESTRICTED") {
|
|
2464
|
-
console.log(
|
|
2464
|
+
console.log(chalk27__default.default.yellow("\u{1F512} Not available in current plan"));
|
|
2465
2465
|
if (!testMode) process.exit(AUTH_EXIT_CODES.PLAN_RESTRICTED);
|
|
2466
2466
|
return { success: false, message: "PLAN_RESTRICTED" };
|
|
2467
2467
|
}
|
|
2468
2468
|
if (error2.code === "RATE_LIMITED") {
|
|
2469
2469
|
const retryAfter = error2.retryAfter || 5;
|
|
2470
|
-
console.log(
|
|
2470
|
+
console.log(chalk27__default.default.yellow(`\u23F1\uFE0F Rate limit: wait ${retryAfter}s`));
|
|
2471
2471
|
if (!testMode) process.exit(AUTH_EXIT_CODES.RATE_LIMITED);
|
|
2472
2472
|
return { success: false, message: "RATE_LIMITED" };
|
|
2473
2473
|
}
|
|
2474
2474
|
if (error2.code === "NETWORK_ERROR") {
|
|
2475
|
-
console.log(
|
|
2475
|
+
console.log(chalk27__default.default.red("\u{1F310} Network error, check connection"));
|
|
2476
2476
|
if (!testMode) process.exit(AUTH_EXIT_CODES.NETWORK_ERROR);
|
|
2477
2477
|
return { success: false, message: "NETWORK_ERROR" };
|
|
2478
2478
|
}
|
|
@@ -12878,24 +12878,24 @@ var init_autocomplete_dropdown = __esm({
|
|
|
12878
12878
|
}
|
|
12879
12879
|
process.stdout.write(`\x1B[${linesToClear - 1}A`);
|
|
12880
12880
|
process.stdout.write(
|
|
12881
|
-
"\x1B[K" +
|
|
12881
|
+
"\x1B[K" + chalk27__default.default.white(
|
|
12882
12882
|
"\u250C\u2500 Suggestions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"
|
|
12883
12883
|
) + "\n"
|
|
12884
12884
|
);
|
|
12885
12885
|
this.suggestions.forEach((suggestion, index2) => {
|
|
12886
12886
|
const isSelected = index2 === this.selectedIndex;
|
|
12887
|
-
const prefix = isSelected ?
|
|
12888
|
-
const nameStyle = isSelected ?
|
|
12887
|
+
const prefix = isSelected ? chalk27__default.default.cyan("\u25BA ") : " ";
|
|
12888
|
+
const nameStyle = isSelected ? chalk27__default.default.inverse : (s2) => s2;
|
|
12889
12889
|
const safeName = (suggestion?.name ?? "").toString();
|
|
12890
12890
|
const safeDescRaw = suggestion?.description ?? "";
|
|
12891
12891
|
const safeDesc = typeof safeDescRaw === "string" ? safeDescRaw : String(safeDescRaw ?? "");
|
|
12892
12892
|
const displayName = safeName.padEnd(20);
|
|
12893
12893
|
const displayDesc = safeDesc.length > 30 ? safeDesc.substring(0, 27) + "..." : safeDesc.padEnd(30);
|
|
12894
|
-
const line = `\u2502${prefix}${nameStyle(
|
|
12894
|
+
const line = `\u2502${prefix}${nameStyle(chalk27__default.default.white(displayName) + " " + chalk27__default.default.gray(displayDesc))} \u2502`;
|
|
12895
12895
|
process.stdout.write("\x1B[K" + line + "\n");
|
|
12896
12896
|
});
|
|
12897
12897
|
process.stdout.write(
|
|
12898
|
-
"\x1B[K" +
|
|
12898
|
+
"\x1B[K" + chalk27__default.default.white(
|
|
12899
12899
|
"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"
|
|
12900
12900
|
)
|
|
12901
12901
|
);
|
|
@@ -13226,7 +13226,7 @@ var init_interactive_cli = __esm({
|
|
|
13226
13226
|
}
|
|
13227
13227
|
readline__namespace.cursorTo(process.stdout, 0);
|
|
13228
13228
|
readline__namespace.clearLine(process.stdout, 0);
|
|
13229
|
-
const prompt =
|
|
13229
|
+
const prompt = chalk27__default.default.cyan("> ");
|
|
13230
13230
|
const displayInput = this.currentInput;
|
|
13231
13231
|
process.stdout.write(prompt + displayInput);
|
|
13232
13232
|
const promptLength = 2;
|
|
@@ -13245,9 +13245,9 @@ var init_interactive_cli = __esm({
|
|
|
13245
13245
|
readline__namespace.moveCursor(process.stdout, 0, 2);
|
|
13246
13246
|
this.suggestions.forEach((suggestion, index2) => {
|
|
13247
13247
|
const isSelected = index2 === this.selectedIndex;
|
|
13248
|
-
const prefix = isSelected ?
|
|
13249
|
-
const nameStyle = isSelected ?
|
|
13250
|
-
const descStyle = isSelected ?
|
|
13248
|
+
const prefix = isSelected ? chalk27__default.default.cyan("\u25BA ") : " ";
|
|
13249
|
+
const nameStyle = isSelected ? chalk27__default.default.inverse.white : chalk27__default.default.white;
|
|
13250
|
+
const descStyle = isSelected ? chalk27__default.default.inverse.gray : chalk27__default.default.gray;
|
|
13251
13251
|
const name2 = suggestion.name.padEnd(15);
|
|
13252
13252
|
const desc = suggestion.description.length > 40 ? suggestion.description.substring(0, 37) + "..." : suggestion.description;
|
|
13253
13253
|
readline__namespace.cursorTo(process.stdout, 0);
|
|
@@ -13268,20 +13268,20 @@ var init_interactive_cli = __esm({
|
|
|
13268
13268
|
const promptLength = 2;
|
|
13269
13269
|
const savedX = this.cursorPosition + promptLength;
|
|
13270
13270
|
process.stdout.write("\n");
|
|
13271
|
-
process.stdout.write(
|
|
13271
|
+
process.stdout.write(chalk27__default.default.white("\u256D\u2500\u2500\u2500\u2500 Command Suggestions \u2500\u2500\u2500\u2500\u256E\n"));
|
|
13272
13272
|
this.suggestions.forEach((suggestion, index2) => {
|
|
13273
13273
|
const isSelected = index2 === this.selectedIndex;
|
|
13274
|
-
const prefix = isSelected ?
|
|
13275
|
-
const nameStyle = isSelected ?
|
|
13276
|
-
const descStyle = isSelected ?
|
|
13274
|
+
const prefix = isSelected ? chalk27__default.default.cyan("\u25BA ") : " ";
|
|
13275
|
+
const nameStyle = isSelected ? chalk27__default.default.inverse.white : chalk27__default.default.white;
|
|
13276
|
+
const descStyle = isSelected ? chalk27__default.default.inverse.gray : chalk27__default.default.gray;
|
|
13277
13277
|
const name2 = suggestion.name.padEnd(15);
|
|
13278
13278
|
const desc = suggestion.description.length > 40 ? suggestion.description.substring(0, 37) + "..." : suggestion.description;
|
|
13279
13279
|
process.stdout.write(`${prefix}${nameStyle(name2)} ${descStyle(desc)}
|
|
13280
13280
|
`);
|
|
13281
13281
|
});
|
|
13282
|
-
process.stdout.write(
|
|
13282
|
+
process.stdout.write(chalk27__default.default.white("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\n"));
|
|
13283
13283
|
process.stdout.write(
|
|
13284
|
-
|
|
13284
|
+
chalk27__default.default.dim("\u2191/\u2193: Navigate \u2022 Tab/Enter: Select \u2022 Esc: Cancel")
|
|
13285
13285
|
);
|
|
13286
13286
|
const totalLines = this.suggestions.length + 4;
|
|
13287
13287
|
readline__namespace.moveCursor(process.stdout, 0, -totalLines);
|
|
@@ -13381,27 +13381,27 @@ var init_logger = __esm({
|
|
|
13381
13381
|
}
|
|
13382
13382
|
debug(...args2) {
|
|
13383
13383
|
if (this.level <= 0 /* DEBUG */) {
|
|
13384
|
-
console.log(
|
|
13384
|
+
console.log(chalk27__default.default.magenta(`${this.prefix} [DEBUG]`), ...args2);
|
|
13385
13385
|
}
|
|
13386
13386
|
}
|
|
13387
13387
|
info(...args2) {
|
|
13388
13388
|
if (this.level <= 1 /* INFO */) {
|
|
13389
|
-
console.log(
|
|
13389
|
+
console.log(chalk27__default.default.bold.magenta(`${this.prefix} [INFO]`), ...args2);
|
|
13390
13390
|
}
|
|
13391
13391
|
}
|
|
13392
13392
|
warn(...args2) {
|
|
13393
13393
|
if (this.level <= 2 /* WARN */) {
|
|
13394
|
-
console.warn(
|
|
13394
|
+
console.warn(chalk27__default.default.bold.magenta(`${this.prefix} [WARN]`), ...args2);
|
|
13395
13395
|
}
|
|
13396
13396
|
}
|
|
13397
13397
|
error(...args2) {
|
|
13398
13398
|
if (this.level <= 3 /* ERROR */) {
|
|
13399
|
-
console.error(
|
|
13399
|
+
console.error(chalk27__default.default.bold.magenta(`${this.prefix} [ERROR]`), ...args2);
|
|
13400
13400
|
}
|
|
13401
13401
|
}
|
|
13402
13402
|
success(...args2) {
|
|
13403
13403
|
if (this.level <= 1 /* INFO */) {
|
|
13404
|
-
console.log(
|
|
13404
|
+
console.log(chalk27__default.default.bold.magenta(`${this.prefix} [SUCCESS]`), ...args2);
|
|
13405
13405
|
}
|
|
13406
13406
|
}
|
|
13407
13407
|
task(taskName, status, message) {
|
|
@@ -13415,10 +13415,10 @@ var init_logger = __esm({
|
|
|
13415
13415
|
error: "\u274C"
|
|
13416
13416
|
};
|
|
13417
13417
|
const statusColors = {
|
|
13418
|
-
start:
|
|
13419
|
-
progress:
|
|
13420
|
-
complete:
|
|
13421
|
-
error:
|
|
13418
|
+
start: chalk27__default.default.bold.magenta,
|
|
13419
|
+
progress: chalk27__default.default.magenta,
|
|
13420
|
+
complete: chalk27__default.default.bold.magenta,
|
|
13421
|
+
error: chalk27__default.default.bold.magenta
|
|
13422
13422
|
};
|
|
13423
13423
|
const icon = statusIcons[status];
|
|
13424
13424
|
const color = statusColors[status];
|
|
@@ -13435,14 +13435,14 @@ var init_logger = __esm({
|
|
|
13435
13435
|
if (this.level > 0 /* DEBUG */) {
|
|
13436
13436
|
return;
|
|
13437
13437
|
}
|
|
13438
|
-
console.log(
|
|
13438
|
+
console.log(chalk27__default.default.magenta(`${this.prefix} [JSON]`));
|
|
13439
13439
|
console.log(pretty ? JSON.stringify(obj, null, 2) : JSON.stringify(obj));
|
|
13440
13440
|
}
|
|
13441
13441
|
divider() {
|
|
13442
13442
|
if (this.level > 1 /* INFO */) {
|
|
13443
13443
|
return;
|
|
13444
13444
|
}
|
|
13445
|
-
console.log(
|
|
13445
|
+
console.log(chalk27__default.default.magenta("\u2500".repeat(60)));
|
|
13446
13446
|
}
|
|
13447
13447
|
clear() {
|
|
13448
13448
|
console.clear();
|
|
@@ -13462,7 +13462,7 @@ var init_logger = __esm({
|
|
|
13462
13462
|
const progressText = `${current}/${total}`;
|
|
13463
13463
|
const labelText = label ? ` ${label}` : "";
|
|
13464
13464
|
process.stdout.write(
|
|
13465
|
-
`\r${
|
|
13465
|
+
`\r${chalk27__default.default.bold.magenta(bar)} ${percentage}% ${progressText}${labelText}`
|
|
13466
13466
|
);
|
|
13467
13467
|
if (current === total) {
|
|
13468
13468
|
process.stdout.write("\n");
|
|
@@ -15057,9 +15057,9 @@ var init_HelpCommand = __esm({
|
|
|
15057
15057
|
const stats = await this.readyService.getStatistics();
|
|
15058
15058
|
const lines = [];
|
|
15059
15059
|
lines.push("\u2550".repeat(60));
|
|
15060
|
-
lines.push(
|
|
15060
|
+
lines.push(chalk27__default.default.bold(`${stats.totalReady} READY Commands | ${stats.categoriesCount} Categories`));
|
|
15061
15061
|
lines.push("");
|
|
15062
|
-
lines.push(
|
|
15062
|
+
lines.push(chalk27__default.default.bold("Quick Access:"));
|
|
15063
15063
|
lines.push(" /help <command> - Detailed help for specific command");
|
|
15064
15064
|
lines.push(" /help --quickstart - Essential commands for new users");
|
|
15065
15065
|
lines.push(" /help --stats - Performance statistics");
|
|
@@ -15074,7 +15074,7 @@ var init_HelpCommand = __esm({
|
|
|
15074
15074
|
}
|
|
15075
15075
|
globalMaxNameLength = Math.max(globalMaxNameLength, 18) + 1;
|
|
15076
15076
|
for (const category of categories2) {
|
|
15077
|
-
lines.push(
|
|
15077
|
+
lines.push(chalk27__default.default.bold(`${category.name.toUpperCase()} (${category.count})`));
|
|
15078
15078
|
const showCommands = category.commands.slice(0, 4);
|
|
15079
15079
|
for (const cmd of showCommands) {
|
|
15080
15080
|
const needsGpu = this.hasGpuRequirement(cmd.description);
|
|
@@ -15094,7 +15094,7 @@ var init_HelpCommand = __esm({
|
|
|
15094
15094
|
}
|
|
15095
15095
|
lines.push("");
|
|
15096
15096
|
}
|
|
15097
|
-
lines.push(
|
|
15097
|
+
lines.push(chalk27__default.default.bold("Pro Tips:"));
|
|
15098
15098
|
lines.push(" \u2022 All listed commands are production-ready");
|
|
15099
15099
|
lines.push(" \u2022 Use fuzzy search: /help --search confi \u2192 finds /config");
|
|
15100
15100
|
lines.push(" \u2022 Categories ordered by importance");
|
|
@@ -15133,33 +15133,33 @@ var init_HelpCommand = __esm({
|
|
|
15133
15133
|
formatCommandHelp(command) {
|
|
15134
15134
|
const lines = [];
|
|
15135
15135
|
lines.push("");
|
|
15136
|
-
lines.push(`\u{1F4D6} ${
|
|
15136
|
+
lines.push(`\u{1F4D6} ${chalk27__default.default.bold(`/${command.name}`)} - ${command.description}`);
|
|
15137
15137
|
lines.push("\u2550".repeat(50));
|
|
15138
15138
|
lines.push("");
|
|
15139
|
-
lines.push(
|
|
15139
|
+
lines.push(chalk27__default.default.bold("\u2139\uFE0F Information:"));
|
|
15140
15140
|
lines.push(` Category: ${this.readyService["getCategoryEmoji"](command.category)} ${command.category}`);
|
|
15141
15141
|
lines.push(` Status: \u2705 READY (contract validated)`);
|
|
15142
15142
|
if (command.aliases && command.aliases.length > 0) {
|
|
15143
15143
|
lines.push(` Aliases: ${command.aliases.map((a2) => `/${a2}`).join(", ")}`);
|
|
15144
15144
|
}
|
|
15145
15145
|
lines.push("");
|
|
15146
|
-
lines.push(
|
|
15146
|
+
lines.push(chalk27__default.default.bold("\u{1F3AF} Usage:"));
|
|
15147
15147
|
lines.push(` ${command.usage}`);
|
|
15148
15148
|
lines.push("");
|
|
15149
|
-
lines.push(
|
|
15149
|
+
lines.push(chalk27__default.default.bold("\u{1F4CB} Contract Validation:"));
|
|
15150
15150
|
lines.push(` \u26A1 Performance: ${command.contract.maxResponseTime}ms (tested)`);
|
|
15151
15151
|
lines.push(` \u{1F4BB} TTY Mode: ${command.contract.tty ? "\u2705 Supported" : "\u274C Not supported"}`);
|
|
15152
15152
|
lines.push(` \u{1F527} Non-TTY Mode: ${command.contract.nonTty ? "\u2705 Supported" : "\u274C Not supported"}`);
|
|
15153
15153
|
lines.push(` \u{1F500} Pipe Mode: ${command.contract.pipe ? "\u2705 Supported" : "\u274C Not supported"}`);
|
|
15154
15154
|
lines.push("");
|
|
15155
15155
|
if (command.examples && command.examples.length > 0) {
|
|
15156
|
-
lines.push(
|
|
15156
|
+
lines.push(chalk27__default.default.bold("\u{1F4DD} Examples:"));
|
|
15157
15157
|
for (const example of command.examples) {
|
|
15158
15158
|
lines.push(` ${example}`);
|
|
15159
15159
|
}
|
|
15160
15160
|
lines.push("");
|
|
15161
15161
|
}
|
|
15162
|
-
lines.push(
|
|
15162
|
+
lines.push(chalk27__default.default.bold("\u{1F4A1} Quick Tips:"));
|
|
15163
15163
|
lines.push(` \u2022 This command is production-ready and fully tested`);
|
|
15164
15164
|
lines.push(` \u2022 Try /${command.name} --help for additional options`);
|
|
15165
15165
|
if (command.category !== "core") {
|
|
@@ -15210,7 +15210,7 @@ var init_HelpCommand = __esm({
|
|
|
15210
15210
|
};
|
|
15211
15211
|
const emoji = emojiMap[categoryName.toLowerCase()] || "\u{1F4CB}";
|
|
15212
15212
|
lines.push("");
|
|
15213
|
-
lines.push(`${emoji} ${
|
|
15213
|
+
lines.push(`${emoji} ${chalk27__default.default.bold(categoryName.toUpperCase() + " COMMANDS")} (${commands.length} READY)`);
|
|
15214
15214
|
lines.push("\u2550".repeat(50));
|
|
15215
15215
|
lines.push("");
|
|
15216
15216
|
const maxNameLength = Math.max(...commands.map((c) => c.name.length)) + 1;
|
|
@@ -15244,7 +15244,7 @@ var init_HelpCommand = __esm({
|
|
|
15244
15244
|
formatSearchResults(searchTerm, results) {
|
|
15245
15245
|
const lines = [];
|
|
15246
15246
|
lines.push("");
|
|
15247
|
-
lines.push(`\u{1F50D} ${
|
|
15247
|
+
lines.push(`\u{1F50D} ${chalk27__default.default.bold("SEARCH RESULTS")} for "${searchTerm}" (${results.length} matches)`);
|
|
15248
15248
|
lines.push("\u2550".repeat(50));
|
|
15249
15249
|
lines.push("");
|
|
15250
15250
|
for (const result2 of results) {
|
|
@@ -15257,7 +15257,7 @@ var init_HelpCommand = __esm({
|
|
|
15257
15257
|
}
|
|
15258
15258
|
lines.push("");
|
|
15259
15259
|
}
|
|
15260
|
-
lines.push(
|
|
15260
|
+
lines.push(chalk27__default.default.bold("\u{1F4A1} Tip:") + " Higher scores indicate better matches");
|
|
15261
15261
|
lines.push("");
|
|
15262
15262
|
return lines.join("\n");
|
|
15263
15263
|
}
|
|
@@ -15268,38 +15268,38 @@ var init_HelpCommand = __esm({
|
|
|
15268
15268
|
const quickCommands = await this.readyService.getQuickStartCommands();
|
|
15269
15269
|
const lines = [];
|
|
15270
15270
|
lines.push("");
|
|
15271
|
-
lines.push(`\u{1F680} ${
|
|
15271
|
+
lines.push(`\u{1F680} ${chalk27__default.default.bold("MARIA QUICKSTART")} - Essential Commands`);
|
|
15272
15272
|
lines.push("\u2550".repeat(50));
|
|
15273
15273
|
lines.push("");
|
|
15274
|
-
lines.push(
|
|
15274
|
+
lines.push(chalk27__default.default.bold("\u{1F3AF} Get Started in 3 Steps:"));
|
|
15275
15275
|
lines.push("");
|
|
15276
|
-
lines.push(
|
|
15276
|
+
lines.push(chalk27__default.default.bold("1\uFE0F\u20E3 Configure Your AI Provider"));
|
|
15277
15277
|
const modelCmd = quickCommands.find((c) => c.name === "model");
|
|
15278
15278
|
if (modelCmd) {
|
|
15279
15279
|
lines.push(` /${modelCmd.name} - ${modelCmd.description}`);
|
|
15280
15280
|
lines.push(` Try: /model set provider=openai key=sk-...`);
|
|
15281
15281
|
}
|
|
15282
15282
|
lines.push("");
|
|
15283
|
-
lines.push(
|
|
15283
|
+
lines.push(chalk27__default.default.bold("2\uFE0F\u20E3 Check System Status"));
|
|
15284
15284
|
const statusCmd = quickCommands.find((c) => c.name === "status");
|
|
15285
15285
|
if (statusCmd) {
|
|
15286
15286
|
lines.push(` /${statusCmd.name} - ${statusCmd.description}`);
|
|
15287
15287
|
lines.push(` Try: /status`);
|
|
15288
15288
|
}
|
|
15289
15289
|
lines.push("");
|
|
15290
|
-
lines.push(
|
|
15290
|
+
lines.push(chalk27__default.default.bold("3\uFE0F\u20E3 Start Coding"));
|
|
15291
15291
|
const codeCmd = quickCommands.find((c) => c.name === "code");
|
|
15292
15292
|
if (codeCmd) {
|
|
15293
15293
|
lines.push(` /${codeCmd.name} - ${codeCmd.description}`);
|
|
15294
15294
|
lines.push(` Try: /code create a hello world function`);
|
|
15295
15295
|
}
|
|
15296
15296
|
lines.push("");
|
|
15297
|
-
lines.push(
|
|
15297
|
+
lines.push(chalk27__default.default.bold("\u{1F527} Essential Commands:"));
|
|
15298
15298
|
for (const cmd of quickCommands) {
|
|
15299
15299
|
lines.push(` /${cmd.name.padEnd(12)} - ${cmd.description}`);
|
|
15300
15300
|
}
|
|
15301
15301
|
lines.push("");
|
|
15302
|
-
lines.push(
|
|
15302
|
+
lines.push(chalk27__default.default.bold("\u{1F4A1} Next Steps:"));
|
|
15303
15303
|
lines.push(" \u2022 /help --category <name> - Explore command categories");
|
|
15304
15304
|
lines.push(" \u2022 /help --search <term> - Find specific functionality");
|
|
15305
15305
|
lines.push(" \u2022 /help <command> - Get detailed command help");
|
|
@@ -15314,20 +15314,20 @@ var init_HelpCommand = __esm({
|
|
|
15314
15314
|
const categories2 = await this.readyService.getCategories();
|
|
15315
15315
|
const lines = [];
|
|
15316
15316
|
lines.push("");
|
|
15317
|
-
lines.push(`\u{1F4CA} ${
|
|
15317
|
+
lines.push(`\u{1F4CA} ${chalk27__default.default.bold("READY COMMANDS STATISTICS")}`);
|
|
15318
15318
|
lines.push("\u2550".repeat(40));
|
|
15319
15319
|
lines.push("");
|
|
15320
|
-
lines.push(
|
|
15320
|
+
lines.push(chalk27__default.default.bold("\u{1F3AF} Overall:"));
|
|
15321
15321
|
lines.push(` Total READY Commands: ${stats.totalReady}`);
|
|
15322
15322
|
lines.push(` Categories: ${stats.categoriesCount}`);
|
|
15323
15323
|
lines.push(` Last Updated: ${stats.lastUpdated?.toLocaleString() || "Unknown"}`);
|
|
15324
15324
|
lines.push("");
|
|
15325
|
-
lines.push(
|
|
15325
|
+
lines.push(chalk27__default.default.bold("\u26A1 Performance:"));
|
|
15326
15326
|
lines.push(` Average Response Time: ${stats.avgResponseTime}ms`);
|
|
15327
15327
|
lines.push(` Fastest Command: /${stats.fastestCommand}`);
|
|
15328
15328
|
lines.push(` Slowest Command: /${stats.slowestCommand}`);
|
|
15329
15329
|
lines.push("");
|
|
15330
|
-
lines.push(
|
|
15330
|
+
lines.push(chalk27__default.default.bold("\u{1F4CB} By Category:"));
|
|
15331
15331
|
for (const category of categories2) {
|
|
15332
15332
|
const avgTime = Math.round(
|
|
15333
15333
|
category.commands.reduce((sum, cmd) => sum + cmd.contract.maxResponseTime, 0) / category.commands.length
|
|
@@ -15335,7 +15335,7 @@ var init_HelpCommand = __esm({
|
|
|
15335
15335
|
lines.push(` ${category.emoji} ${category.name.padEnd(15)}: ${category.count.toString().padStart(2)} commands (${avgTime}ms avg)`);
|
|
15336
15336
|
}
|
|
15337
15337
|
lines.push("");
|
|
15338
|
-
lines.push(
|
|
15338
|
+
lines.push(chalk27__default.default.bold("\u2705 Contract Validation:"));
|
|
15339
15339
|
lines.push(" All commands tested for:");
|
|
15340
15340
|
lines.push(" \u2022 Basic execution without crashes");
|
|
15341
15341
|
lines.push(" \u2022 TTY/non-TTY/pipe compatibility");
|
|
@@ -15406,7 +15406,7 @@ var init_VersionCommand = __esm({
|
|
|
15406
15406
|
if (context2.apiVersion) {
|
|
15407
15407
|
apiBuild = ` \xB7 API: ${context2.apiVersion}`;
|
|
15408
15408
|
}
|
|
15409
|
-
const output3 = `${
|
|
15409
|
+
const output3 = `${chalk27__default.default.bold("MARIA")} v${version} (${gitSha})${apiBuild} \xB7 Node: ${process.version}`;
|
|
15410
15410
|
await trackCommand({
|
|
15411
15411
|
cmd: "version",
|
|
15412
15412
|
status: "success",
|
|
@@ -15423,7 +15423,7 @@ var init_VersionCommand = __esm({
|
|
|
15423
15423
|
plan: getUserPlan(),
|
|
15424
15424
|
quotaLeft: context2.quotaLeft || 999
|
|
15425
15425
|
});
|
|
15426
|
-
return this.success(`${
|
|
15426
|
+
return this.success(`${chalk27__default.default.bold("MARIA")} v3.9.15`);
|
|
15427
15427
|
}
|
|
15428
15428
|
}
|
|
15429
15429
|
};
|
|
@@ -19664,8 +19664,8 @@ var require_package = __commonJS({
|
|
|
19664
19664
|
"package.json"(exports, module) {
|
|
19665
19665
|
module.exports = {
|
|
19666
19666
|
name: "@bonginkan/maria",
|
|
19667
|
-
version: "4.2.
|
|
19668
|
-
description: "\u{1F680} MARIA v4.2.
|
|
19667
|
+
version: "4.2.22",
|
|
19668
|
+
description: "\u{1F680} MARIA v4.2.22 - Enterprise AI Development Platform with 100% Command Availability. Features 74 production-ready commands with comprehensive fallback implementation, local LLM support, and zero external dependencies. Includes natural language coding, AI safety evaluation, intelligent evolution system, episodic memory with PII masking, and real-time monitoring dashboard. Built with TypeScript AST-powered code generation, OAuth2.0 + PKCE authentication, quantum-resistant cryptography, and enterprise-grade performance.",
|
|
19669
19669
|
keywords: [
|
|
19670
19670
|
"ai",
|
|
19671
19671
|
"cli",
|
|
@@ -20080,7 +20080,11 @@ var require_package = __commonJS({
|
|
|
20080
20080
|
uuid: "^9.0.1",
|
|
20081
20081
|
winston: "^3.11.0",
|
|
20082
20082
|
ws: "^8.16.0",
|
|
20083
|
-
zod: "^3.22.4"
|
|
20083
|
+
zod: "^3.22.4",
|
|
20084
|
+
compression: "^1.8.1",
|
|
20085
|
+
cors: "^2.8.5",
|
|
20086
|
+
express: "^5.1.0",
|
|
20087
|
+
helmet: "^8.1.0"
|
|
20084
20088
|
},
|
|
20085
20089
|
devDependencies: {
|
|
20086
20090
|
"@babel/parser": "^7.28.3",
|
|
@@ -20107,8 +20111,6 @@ var require_package = __commonJS({
|
|
|
20107
20111
|
"@vitest/coverage-v8": "^1.2.0",
|
|
20108
20112
|
"better-sqlite3": "^12.2.0",
|
|
20109
20113
|
"cli-highlight": "^2.1.11",
|
|
20110
|
-
compression: "^1.8.1",
|
|
20111
|
-
cors: "^2.8.5",
|
|
20112
20114
|
"cross-env": "^10.0.0",
|
|
20113
20115
|
"dependency-cruiser": "^16.10.4",
|
|
20114
20116
|
eslint: "^8.56.0",
|
|
@@ -20117,11 +20119,9 @@ var require_package = __commonJS({
|
|
|
20117
20119
|
"eslint-plugin-node": "^11.1.0",
|
|
20118
20120
|
"eslint-plugin-prettier": "^5.1.3",
|
|
20119
20121
|
execa: "^9.6.0",
|
|
20120
|
-
express: "^5.1.0",
|
|
20121
20122
|
"fast-glob": "^3.3.3",
|
|
20122
20123
|
figures: "^6.1.0",
|
|
20123
20124
|
glob: "^10.3.10",
|
|
20124
|
-
helmet: "^8.1.0",
|
|
20125
20125
|
jscodeshift: "^17.3.0",
|
|
20126
20126
|
"lint-staged": "^16.1.5",
|
|
20127
20127
|
"node-fetch": "^3.3.2",
|
|
@@ -31045,7 +31045,7 @@ var init_clear_command = __esm({
|
|
|
31045
31045
|
plan: getUserPlan(),
|
|
31046
31046
|
quotaLeft: context2.quotaLeft || 999
|
|
31047
31047
|
});
|
|
31048
|
-
const message =
|
|
31048
|
+
const message = chalk27__default.default.green("\u2705 Cleared") + chalk27__default.default.gray(" \xB7 context reset");
|
|
31049
31049
|
return this.success(withQuotaFooter(message, context2.quotaLeft));
|
|
31050
31050
|
} catch (error2) {
|
|
31051
31051
|
await trackCommand({
|
|
@@ -31056,7 +31056,7 @@ var init_clear_command = __esm({
|
|
|
31056
31056
|
quotaLeft: context2.quotaLeft || 999
|
|
31057
31057
|
});
|
|
31058
31058
|
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
31059
|
-
return this.success(
|
|
31059
|
+
return this.success(chalk27__default.default.green("\u2705 Cleared"));
|
|
31060
31060
|
}
|
|
31061
31061
|
}
|
|
31062
31062
|
};
|
|
@@ -32115,40 +32115,40 @@ var init_about_command = __esm({
|
|
|
32115
32115
|
async execute(args2, context2) {
|
|
32116
32116
|
const output3 = [];
|
|
32117
32117
|
output3.push("");
|
|
32118
|
-
output3.push(
|
|
32119
|
-
output3.push(
|
|
32118
|
+
output3.push(chalk27__default.default.cyan.bold("\u{1F916} About MARIA v4.2.22"));
|
|
32119
|
+
output3.push(chalk27__default.default.gray("\u2550".repeat(40)));
|
|
32120
32120
|
output3.push("");
|
|
32121
|
-
output3.push(
|
|
32121
|
+
output3.push(chalk27__default.default.white.bold("MARIA - Minimal API, Maximum Power"));
|
|
32122
32122
|
output3.push("");
|
|
32123
|
-
output3.push(
|
|
32123
|
+
output3.push(chalk27__default.default.white("\u{1F3AF} Revolutionary AI Development Platform:"));
|
|
32124
32124
|
output3.push(" \u2022 Natural Language Code Operations");
|
|
32125
32125
|
output3.push(" \u2022 Graph RAG Knowledge System");
|
|
32126
32126
|
output3.push(" \u2022 Dual Memory Architecture");
|
|
32127
32127
|
output3.push(" \u2022 Enterprise-Grade Security");
|
|
32128
32128
|
output3.push(" \u2022 Multimodal AI Generation");
|
|
32129
32129
|
output3.push("");
|
|
32130
|
-
output3.push(
|
|
32130
|
+
output3.push(chalk27__default.default.white("\u{1F31F} Key Features:"));
|
|
32131
32131
|
output3.push(" \u2022 /code - Natural language coding");
|
|
32132
32132
|
output3.push(" \u2022 68+ Slash Commands");
|
|
32133
32133
|
output3.push(" \u2022 8 AI Provider Support");
|
|
32134
32134
|
output3.push(" \u2022 Business Operations Suite");
|
|
32135
32135
|
output3.push(" \u2022 Real-time Streaming");
|
|
32136
32136
|
output3.push("");
|
|
32137
|
-
output3.push(
|
|
32137
|
+
output3.push(chalk27__default.default.white("\u{1F468}\u200D\u{1F4BB} Created by:"));
|
|
32138
32138
|
output3.push(" \u2022 Bonginkan Team");
|
|
32139
32139
|
output3.push(" \u2022 Enterprise AI Solutions");
|
|
32140
32140
|
output3.push("");
|
|
32141
|
-
output3.push(
|
|
32142
|
-
output3.push(
|
|
32143
|
-
output3.push(
|
|
32144
|
-
output3.push(
|
|
32145
|
-
output3.push(
|
|
32146
|
-
output3.push(
|
|
32141
|
+
output3.push(chalk27__default.default.white("\u{1F517} Links:"));
|
|
32142
|
+
output3.push(chalk27__default.default.blue(" Website: https://maria-code.ai"));
|
|
32143
|
+
output3.push(chalk27__default.default.blue(" Company: https://bonginkan.ai"));
|
|
32144
|
+
output3.push(chalk27__default.default.blue(" Discord: https://discord.gg/SMSmSGcEQy"));
|
|
32145
|
+
output3.push(chalk27__default.default.blue(" GitHub: https://github.com/bonginkan/maria"));
|
|
32146
|
+
output3.push(chalk27__default.default.blue(" NPM: https://www.npmjs.com/package/@bonginkan/maria"));
|
|
32147
32147
|
output3.push("");
|
|
32148
|
-
output3.push(
|
|
32149
|
-
output3.push(
|
|
32148
|
+
output3.push(chalk27__default.default.white("\u{1F4C4} License: MIT"));
|
|
32149
|
+
output3.push(chalk27__default.default.white("\u{1F3D7}\uFE0F Built with: TypeScript, Node.js, React"));
|
|
32150
32150
|
output3.push("");
|
|
32151
|
-
output3.push(
|
|
32151
|
+
output3.push(chalk27__default.default.green("Thank you for using MARIA! \u{1F680}"));
|
|
32152
32152
|
output3.push("");
|
|
32153
32153
|
return {
|
|
32154
32154
|
success: true,
|
|
@@ -34167,8 +34167,8 @@ var init_ConfigCLI = __esm({
|
|
|
34167
34167
|
// Default to interactive
|
|
34168
34168
|
});
|
|
34169
34169
|
if (options2.verbose) {
|
|
34170
|
-
console.log(
|
|
34171
|
-
console.log(
|
|
34170
|
+
console.log(chalk27__default.default.gray(`Executing: ${operation} ${args2.join(" ")}`));
|
|
34171
|
+
console.log(chalk27__default.default.gray(`Options: ${JSON.stringify(options2, null, 2)}`));
|
|
34172
34172
|
}
|
|
34173
34173
|
const result2 = await command.execute();
|
|
34174
34174
|
if (result2.endReason === "success") {
|
|
@@ -34194,10 +34194,10 @@ var init_ConfigCLI = __esm({
|
|
|
34194
34194
|
await this.displayPreview(data2.preview);
|
|
34195
34195
|
if (data2.dryRun) {
|
|
34196
34196
|
console.log(
|
|
34197
|
-
|
|
34197
|
+
chalk27__default.default.blue("\n\u{1F4CB} This was a dry run - no changes were applied.")
|
|
34198
34198
|
);
|
|
34199
34199
|
console.log(
|
|
34200
|
-
|
|
34200
|
+
chalk27__default.default.gray(
|
|
34201
34201
|
"To apply changes, run the same command without --dry-run"
|
|
34202
34202
|
)
|
|
34203
34203
|
);
|
|
@@ -34205,30 +34205,30 @@ var init_ConfigCLI = __esm({
|
|
|
34205
34205
|
}
|
|
34206
34206
|
}
|
|
34207
34207
|
if (data2.message) {
|
|
34208
|
-
console.log(
|
|
34208
|
+
console.log(chalk27__default.default.green(data2.message));
|
|
34209
34209
|
}
|
|
34210
34210
|
if (data2.key && data2.value !== void 0) {
|
|
34211
|
-
console.log(
|
|
34211
|
+
console.log(chalk27__default.default.green(`\u2705 Configuration updated:`));
|
|
34212
34212
|
console.log(
|
|
34213
|
-
` ${
|
|
34213
|
+
` ${chalk27__default.default.bold(data2.key)}: ${chalk27__default.default.cyan(this.formatValue(data2.value))}`
|
|
34214
34214
|
);
|
|
34215
34215
|
if (data2.layer) {
|
|
34216
|
-
console.log(` Layer: ${
|
|
34216
|
+
console.log(` Layer: ${chalk27__default.default.magenta(data2.layer)}`);
|
|
34217
34217
|
}
|
|
34218
34218
|
}
|
|
34219
34219
|
if (data2.deleted) {
|
|
34220
34220
|
console.log(
|
|
34221
|
-
|
|
34221
|
+
chalk27__default.default.green(`\u2705 Configuration deleted: ${chalk27__default.default.bold(data2.key)}`)
|
|
34222
34222
|
);
|
|
34223
34223
|
}
|
|
34224
34224
|
if (data2.templateId) {
|
|
34225
34225
|
console.log(
|
|
34226
|
-
|
|
34226
|
+
chalk27__default.default.green(`\u2705 Template applied: ${chalk27__default.default.bold(data2.templateId)}`)
|
|
34227
34227
|
);
|
|
34228
34228
|
}
|
|
34229
34229
|
if (data2.rolledBack) {
|
|
34230
34230
|
console.log(
|
|
34231
|
-
|
|
34231
|
+
chalk27__default.default.green(`\u2705 Rolled back to entry: ${chalk27__default.default.bold(data2.entryId)}`)
|
|
34232
34232
|
);
|
|
34233
34233
|
}
|
|
34234
34234
|
if (data2.layers) {
|
|
@@ -34243,62 +34243,62 @@ var init_ConfigCLI = __esm({
|
|
|
34243
34243
|
console.log(JSON.stringify({ error: error2 }, null, 2));
|
|
34244
34244
|
return;
|
|
34245
34245
|
}
|
|
34246
|
-
console.error(
|
|
34246
|
+
console.error(chalk27__default.default.red(`\u274C Error: ${error2}`));
|
|
34247
34247
|
if (error2.includes("not found")) {
|
|
34248
34248
|
console.log(
|
|
34249
|
-
|
|
34249
|
+
chalk27__default.default.gray("\nTry: /config list # to see available configurations")
|
|
34250
34250
|
);
|
|
34251
34251
|
}
|
|
34252
34252
|
if (error2.includes("required")) {
|
|
34253
|
-
console.log(
|
|
34253
|
+
console.log(chalk27__default.default.gray("\nTry: /config help # to see command syntax"));
|
|
34254
34254
|
}
|
|
34255
34255
|
}
|
|
34256
34256
|
async displayPreview(preview) {
|
|
34257
|
-
console.log(
|
|
34258
|
-
console.log(`${
|
|
34257
|
+
console.log(chalk27__default.default.bold.cyan("\n\u{1F50D} Configuration Preview\n"));
|
|
34258
|
+
console.log(`${chalk27__default.default.bold("Operation:")} ${chalk27__default.default.cyan(preview.operation)}`);
|
|
34259
34259
|
if (preview.key) {
|
|
34260
|
-
console.log(`${
|
|
34260
|
+
console.log(`${chalk27__default.default.bold("Key:")} ${chalk27__default.default.yellow(preview.key)}`);
|
|
34261
34261
|
}
|
|
34262
34262
|
if (preview.value !== void 0) {
|
|
34263
34263
|
console.log(
|
|
34264
|
-
`${
|
|
34264
|
+
`${chalk27__default.default.bold("Value:")} ${chalk27__default.default.green(this.formatValue(preview.value))}`
|
|
34265
34265
|
);
|
|
34266
34266
|
}
|
|
34267
34267
|
if (preview.changes.length > 0) {
|
|
34268
|
-
console.log(
|
|
34268
|
+
console.log(chalk27__default.default.bold("\n\u{1F4DD} Changes:"));
|
|
34269
34269
|
for (const change of preview.changes) {
|
|
34270
34270
|
this.displayChange(change);
|
|
34271
34271
|
}
|
|
34272
34272
|
}
|
|
34273
34273
|
if (preview.affected.length > 0) {
|
|
34274
|
-
console.log(
|
|
34274
|
+
console.log(chalk27__default.default.bold("\n\u{1F517} Affected Configurations:"));
|
|
34275
34275
|
for (const affected of preview.affected) {
|
|
34276
34276
|
this.displayAffectedConfig(affected);
|
|
34277
34277
|
}
|
|
34278
34278
|
}
|
|
34279
34279
|
if (preview.risks.length > 0) {
|
|
34280
|
-
console.log(
|
|
34280
|
+
console.log(chalk27__default.default.bold("\n\u26A0\uFE0F Safety Analysis:"));
|
|
34281
34281
|
for (const risk of preview.risks) {
|
|
34282
34282
|
this.displaySafetyRisk(risk);
|
|
34283
34283
|
}
|
|
34284
34284
|
}
|
|
34285
34285
|
if (!preview.validation.ok) {
|
|
34286
|
-
console.log(
|
|
34286
|
+
console.log(chalk27__default.default.bold.red("\n\u274C Validation Errors:"));
|
|
34287
34287
|
if (preview.validation.errors) {
|
|
34288
34288
|
for (const error2 of preview.validation.errors) {
|
|
34289
|
-
console.log(` \u2022 ${
|
|
34289
|
+
console.log(` \u2022 ${chalk27__default.default.red(error2)}`);
|
|
34290
34290
|
}
|
|
34291
34291
|
}
|
|
34292
34292
|
} else if (preview.validation.warnings && preview.validation.warnings.length > 0) {
|
|
34293
|
-
console.log(
|
|
34293
|
+
console.log(chalk27__default.default.bold.yellow("\n\u26A0\uFE0F Validation Warnings:"));
|
|
34294
34294
|
for (const warning of preview.validation.warnings) {
|
|
34295
|
-
console.log(` \u2022 ${
|
|
34295
|
+
console.log(` \u2022 ${chalk27__default.default.yellow(warning)}`);
|
|
34296
34296
|
}
|
|
34297
34297
|
}
|
|
34298
34298
|
if (preview.requiresConfirmation && !preview.validation.dryRun) {
|
|
34299
34299
|
const confirmed = await this.promptConfirmation();
|
|
34300
34300
|
if (!confirmed) {
|
|
34301
|
-
console.log(
|
|
34301
|
+
console.log(chalk27__default.default.yellow("\n\u274C Operation cancelled"));
|
|
34302
34302
|
process.exit(0);
|
|
34303
34303
|
}
|
|
34304
34304
|
}
|
|
@@ -34310,42 +34310,42 @@ var init_ConfigCLI = __esm({
|
|
|
34310
34310
|
delete: "\u{1F5D1}\uFE0F"
|
|
34311
34311
|
};
|
|
34312
34312
|
const typeColor = {
|
|
34313
|
-
add:
|
|
34314
|
-
modify:
|
|
34315
|
-
delete:
|
|
34313
|
+
add: chalk27__default.default.green,
|
|
34314
|
+
modify: chalk27__default.default.yellow,
|
|
34315
|
+
delete: chalk27__default.default.red
|
|
34316
34316
|
};
|
|
34317
34317
|
console.log(
|
|
34318
|
-
` ${typeIcon[change.type]} ${typeColor[change.type](change.type.toUpperCase())}: ${
|
|
34318
|
+
` ${typeIcon[change.type]} ${typeColor[change.type](change.type.toUpperCase())}: ${chalk27__default.default.bold(change.key)}`
|
|
34319
34319
|
);
|
|
34320
34320
|
if (change.oldValue !== void 0) {
|
|
34321
34321
|
console.log(
|
|
34322
|
-
` ${
|
|
34322
|
+
` ${chalk27__default.default.gray("Old:")} ${chalk27__default.default.gray(this.formatValue(change.oldValue))}`
|
|
34323
34323
|
);
|
|
34324
34324
|
}
|
|
34325
34325
|
if (change.newValue !== void 0) {
|
|
34326
34326
|
console.log(
|
|
34327
|
-
` ${
|
|
34327
|
+
` ${chalk27__default.default.gray("New:")} ${chalk27__default.default.cyan(this.formatValue(change.newValue))}`
|
|
34328
34328
|
);
|
|
34329
34329
|
}
|
|
34330
|
-
console.log(` ${
|
|
34331
|
-
console.log(` ${
|
|
34330
|
+
console.log(` ${chalk27__default.default.gray("Layer:")} ${chalk27__default.default.magenta(change.layer)}`);
|
|
34331
|
+
console.log(` ${chalk27__default.default.gray(change.description)}`);
|
|
34332
34332
|
console.log();
|
|
34333
34333
|
}
|
|
34334
34334
|
displayAffectedConfig(affected) {
|
|
34335
34335
|
const impactColor = {
|
|
34336
|
-
low:
|
|
34337
|
-
medium:
|
|
34338
|
-
high:
|
|
34339
|
-
critical:
|
|
34336
|
+
low: chalk27__default.default.gray,
|
|
34337
|
+
medium: chalk27__default.default.yellow,
|
|
34338
|
+
high: chalk27__default.default.red,
|
|
34339
|
+
critical: chalk27__default.default.red.bold
|
|
34340
34340
|
};
|
|
34341
34341
|
console.log(
|
|
34342
|
-
` \u2022 ${
|
|
34342
|
+
` \u2022 ${chalk27__default.default.bold(affected.key)} (${chalk27__default.default.magenta(affected.layer)})`
|
|
34343
34343
|
);
|
|
34344
34344
|
console.log(
|
|
34345
34345
|
` Impact: ${impactColor[affected.impact](affected.impact.toUpperCase())}`
|
|
34346
34346
|
);
|
|
34347
|
-
console.log(` Relationship: ${
|
|
34348
|
-
console.log(` ${
|
|
34347
|
+
console.log(` Relationship: ${chalk27__default.default.cyan(affected.relationship)}`);
|
|
34348
|
+
console.log(` ${chalk27__default.default.gray(affected.description)}`);
|
|
34349
34349
|
console.log();
|
|
34350
34350
|
}
|
|
34351
34351
|
displaySafetyRisk(risk) {
|
|
@@ -34356,78 +34356,78 @@ var init_ConfigCLI = __esm({
|
|
|
34356
34356
|
critical: "\u{1F6A8}"
|
|
34357
34357
|
};
|
|
34358
34358
|
const levelColor = {
|
|
34359
|
-
info:
|
|
34360
|
-
warning:
|
|
34361
|
-
error:
|
|
34362
|
-
critical:
|
|
34359
|
+
info: chalk27__default.default.blue,
|
|
34360
|
+
warning: chalk27__default.default.yellow,
|
|
34361
|
+
error: chalk27__default.default.red,
|
|
34362
|
+
critical: chalk27__default.default.red.bold
|
|
34363
34363
|
};
|
|
34364
34364
|
console.log(
|
|
34365
34365
|
` ${levelIcon[risk.level]} ${levelColor[risk.level](risk.level.toUpperCase())}: ${risk.message}`
|
|
34366
34366
|
);
|
|
34367
34367
|
if (risk.recommendation) {
|
|
34368
34368
|
console.log(
|
|
34369
|
-
` ${
|
|
34369
|
+
` ${chalk27__default.default.gray("Recommendation:")} ${risk.recommendation}`
|
|
34370
34370
|
);
|
|
34371
34371
|
}
|
|
34372
34372
|
if (risk.autoFixable) {
|
|
34373
|
-
console.log(` ${
|
|
34373
|
+
console.log(` ${chalk27__default.default.green("Auto-fixable: Yes")}`);
|
|
34374
34374
|
}
|
|
34375
34375
|
console.log();
|
|
34376
34376
|
}
|
|
34377
34377
|
displayLayeredConfig(data2) {
|
|
34378
|
-
console.log(
|
|
34378
|
+
console.log(chalk27__default.default.bold(`
|
|
34379
34379
|
\u{1F4CB} ${data2.key} Configuration
|
|
34380
34380
|
`));
|
|
34381
34381
|
console.log(
|
|
34382
|
-
`${
|
|
34382
|
+
`${chalk27__default.default.bold("Effective Value:")} ${chalk27__default.default.cyan(this.formatValue(data2.value))}`
|
|
34383
34383
|
);
|
|
34384
|
-
console.log(`${
|
|
34384
|
+
console.log(`${chalk27__default.default.bold("Source Layer:")} ${chalk27__default.default.magenta(data2.source)}`);
|
|
34385
34385
|
console.log(
|
|
34386
|
-
`${
|
|
34386
|
+
`${chalk27__default.default.bold("Merged:")} ${data2.merged ? chalk27__default.default.yellow("Yes") : chalk27__default.default.gray("No")}`
|
|
34387
34387
|
);
|
|
34388
34388
|
if (data2.layers) {
|
|
34389
|
-
console.log(
|
|
34389
|
+
console.log(chalk27__default.default.bold("\nLayer Values:"));
|
|
34390
34390
|
const layers = ["runtime", "project", "user", "global"];
|
|
34391
34391
|
for (const layer of layers) {
|
|
34392
34392
|
const value = data2.layers[layer];
|
|
34393
34393
|
if (value !== void 0) {
|
|
34394
34394
|
const isActive = layer === data2.source;
|
|
34395
|
-
const layerDisplay = isActive ?
|
|
34395
|
+
const layerDisplay = isActive ? chalk27__default.default.bold.magenta(`${layer} (active)`) : chalk27__default.default.gray(layer);
|
|
34396
34396
|
console.log(
|
|
34397
|
-
` ${layerDisplay}: ${
|
|
34397
|
+
` ${layerDisplay}: ${chalk27__default.default.cyan(this.formatValue(value))}`
|
|
34398
34398
|
);
|
|
34399
34399
|
}
|
|
34400
34400
|
}
|
|
34401
34401
|
}
|
|
34402
34402
|
}
|
|
34403
34403
|
displayConfigList(configs) {
|
|
34404
|
-
console.log(
|
|
34404
|
+
console.log(chalk27__default.default.bold("\n\u2699\uFE0F Configuration Settings\n"));
|
|
34405
34405
|
if (Object.keys(configs).length === 0) {
|
|
34406
|
-
console.log(
|
|
34406
|
+
console.log(chalk27__default.default.gray("No configurations found."));
|
|
34407
34407
|
return;
|
|
34408
34408
|
}
|
|
34409
34409
|
const categorized = this.categorizeConfigs(configs);
|
|
34410
34410
|
for (const [category, items] of Object.entries(categorized)) {
|
|
34411
34411
|
if (Object.keys(items).length === 0) continue;
|
|
34412
34412
|
console.log(
|
|
34413
|
-
|
|
34413
|
+
chalk27__default.default.bold.cyan(`${this.getCategoryIcon(category)} ${category}`)
|
|
34414
34414
|
);
|
|
34415
|
-
console.log(
|
|
34415
|
+
console.log(chalk27__default.default.gray("\u2500".repeat(category.length + 4)));
|
|
34416
34416
|
for (const [key2, value] of Object.entries(items)) {
|
|
34417
34417
|
console.log(
|
|
34418
|
-
` ${
|
|
34418
|
+
` ${chalk27__default.default.bold(key2)}: ${chalk27__default.default.cyan(this.formatValue(value))}`
|
|
34419
34419
|
);
|
|
34420
34420
|
}
|
|
34421
34421
|
console.log();
|
|
34422
34422
|
}
|
|
34423
34423
|
console.log(
|
|
34424
|
-
|
|
34424
|
+
chalk27__default.default.gray(`Total: ${Object.keys(configs).length} configuration(s)`)
|
|
34425
34425
|
);
|
|
34426
34426
|
}
|
|
34427
34427
|
async promptConfirmation() {
|
|
34428
34428
|
return new Promise((resolve8) => {
|
|
34429
34429
|
this.rl.question(
|
|
34430
|
-
|
|
34430
|
+
chalk27__default.default.bold("\nDo you want to proceed? [y/N]: "),
|
|
34431
34431
|
(answer) => {
|
|
34432
34432
|
resolve8(["y", "yes", "Y", "YES"].includes(answer.trim()));
|
|
34433
34433
|
}
|
|
@@ -34436,20 +34436,20 @@ var init_ConfigCLI = __esm({
|
|
|
34436
34436
|
}
|
|
34437
34437
|
formatValue(value) {
|
|
34438
34438
|
if (value === null || value === void 0) {
|
|
34439
|
-
return
|
|
34439
|
+
return chalk27__default.default.gray("null");
|
|
34440
34440
|
}
|
|
34441
34441
|
if (typeof value === "string") {
|
|
34442
34442
|
const isSensitive = this.isSensitiveValue(value);
|
|
34443
34443
|
if (isSensitive) {
|
|
34444
|
-
return
|
|
34444
|
+
return chalk27__default.default.gray("********");
|
|
34445
34445
|
}
|
|
34446
34446
|
return `"${value}"`;
|
|
34447
34447
|
}
|
|
34448
34448
|
if (typeof value === "boolean") {
|
|
34449
|
-
return value ?
|
|
34449
|
+
return value ? chalk27__default.default.green("true") : chalk27__default.default.red("false");
|
|
34450
34450
|
}
|
|
34451
34451
|
if (typeof value === "number") {
|
|
34452
|
-
return
|
|
34452
|
+
return chalk27__default.default.blue(value.toString());
|
|
34453
34453
|
}
|
|
34454
34454
|
if (Array.isArray(value)) {
|
|
34455
34455
|
return `[${value.map((v) => this.formatValue(v)).join(", ")}]`;
|
|
@@ -35924,8 +35924,8 @@ var init_api_caller = __esm({
|
|
|
35924
35924
|
});
|
|
35925
35925
|
function handleRateLimitError(error2) {
|
|
35926
35926
|
console.log();
|
|
35927
|
-
console.log(
|
|
35928
|
-
console.log(
|
|
35927
|
+
console.log(chalk27__default.default.yellow("\u23F1\uFE0F Rate Limit Exceeded"));
|
|
35928
|
+
console.log(chalk27__default.default.gray("\u2501".repeat(50)));
|
|
35929
35929
|
const route = error2.route || error2.details?.endpoint || "API";
|
|
35930
35930
|
const plan = error2.plan || error2.details?.plan || "Unknown";
|
|
35931
35931
|
const limit = error2.limit || (error2.details?.limit ? parseInt(error2.details.limit) : null);
|
|
@@ -35943,24 +35943,24 @@ function handleRateLimitError(error2) {
|
|
|
35943
35943
|
resetTime = `at ${resetDate.toLocaleTimeString()}`;
|
|
35944
35944
|
}
|
|
35945
35945
|
}
|
|
35946
|
-
console.log(
|
|
35947
|
-
console.log(
|
|
35946
|
+
console.log(chalk27__default.default.white(`Plan: ${chalk27__default.default.bold(plan)}`));
|
|
35947
|
+
console.log(chalk27__default.default.white(`Endpoint: ${chalk27__default.default.bold(route)}`));
|
|
35948
35948
|
if (limit !== null) {
|
|
35949
|
-
console.log(
|
|
35949
|
+
console.log(chalk27__default.default.white(`Limit: ${chalk27__default.default.bold(limit)} requests`));
|
|
35950
35950
|
}
|
|
35951
35951
|
if (error2.remaining !== void 0) {
|
|
35952
|
-
console.log(
|
|
35952
|
+
console.log(chalk27__default.default.white(`Remaining: ${chalk27__default.default.bold(error2.remaining)} requests`));
|
|
35953
35953
|
}
|
|
35954
35954
|
console.log();
|
|
35955
|
-
console.log(
|
|
35955
|
+
console.log(chalk27__default.default.cyan(`Please wait ${chalk27__default.default.bold(waitTime)} before trying again`));
|
|
35956
35956
|
if (resetTime) {
|
|
35957
|
-
console.log(
|
|
35957
|
+
console.log(chalk27__default.default.gray(`Rate limit resets ${resetTime}`));
|
|
35958
35958
|
}
|
|
35959
35959
|
if (error2.hint) {
|
|
35960
35960
|
console.log();
|
|
35961
|
-
console.log(
|
|
35961
|
+
console.log(chalk27__default.default.magenta("\u{1F4A1} " + error2.hint));
|
|
35962
35962
|
}
|
|
35963
|
-
console.log(
|
|
35963
|
+
console.log(chalk27__default.default.gray("\u2501".repeat(50)));
|
|
35964
35964
|
console.log();
|
|
35965
35965
|
}
|
|
35966
35966
|
async function parseRateLimitResponse(response2) {
|
|
@@ -40871,7 +40871,7 @@ var init_model_selector_ui = __esm({
|
|
|
40871
40871
|
output: process.stdout,
|
|
40872
40872
|
terminal: true
|
|
40873
40873
|
});
|
|
40874
|
-
console.log(
|
|
40874
|
+
console.log(chalk27__default.default.green(
|
|
40875
40875
|
"\u250C\u2500[ MODEL MATRIX ]\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"
|
|
40876
40876
|
));
|
|
40877
40877
|
process.stdout.write("\x1B7");
|
|
@@ -40939,14 +40939,14 @@ var init_model_selector_ui = __esm({
|
|
|
40939
40939
|
}
|
|
40940
40940
|
renderFromSavedPosition() {
|
|
40941
40941
|
if (this.isDestroyed) return;
|
|
40942
|
-
console.log(
|
|
40943
|
-
"\u2502 " +
|
|
40942
|
+
console.log(chalk27__default.default.green(
|
|
40943
|
+
"\u2502 " + chalk27__default.default.greenBright("SELECT MODEL:") + " ".repeat(62) + "\u2502"
|
|
40944
40944
|
));
|
|
40945
40945
|
this.renderContent();
|
|
40946
40946
|
const scrollInfo = `[${this.selectedIndex + 1}/${this.models.length}]`;
|
|
40947
40947
|
const helpText = `\u2193:NEXT \u2191:PREV ENTER:EXEC ESC:ABORT ${scrollInfo}`;
|
|
40948
|
-
console.log(
|
|
40949
|
-
console.log(
|
|
40948
|
+
console.log(chalk27__default.default.green("\u2502 ") + chalk27__default.default.dim.green(helpText.padEnd(76)) + chalk27__default.default.green(" \u2502"));
|
|
40949
|
+
console.log(chalk27__default.default.green(
|
|
40950
40950
|
"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"
|
|
40951
40951
|
));
|
|
40952
40952
|
}
|
|
@@ -40987,19 +40987,19 @@ var init_model_selector_ui = __esm({
|
|
|
40987
40987
|
const item = displayItems[i2];
|
|
40988
40988
|
if (item.type === "group") {
|
|
40989
40989
|
console.log(
|
|
40990
|
-
|
|
40990
|
+
chalk27__default.default.green("\u2502") + chalk27__default.default.dim.green(" \u2501\u2501\u2501 ") + chalk27__default.default.greenBright(item.content.substring(2, item.content.indexOf(" \u2500"))) + chalk27__default.default.dim.green(" " + "\u2501".repeat(71 - item.content.indexOf(" \u2500"))) + chalk27__default.default.green("\u2502")
|
|
40991
40991
|
);
|
|
40992
40992
|
} else {
|
|
40993
40993
|
const isSelected = item.modelIndex === this.selectedIndex;
|
|
40994
|
-
const prefix = isSelected ?
|
|
40994
|
+
const prefix = isSelected ? chalk27__default.default.greenBright("\u25B6 ") : " ";
|
|
40995
40995
|
const modelText = item.content;
|
|
40996
40996
|
if (isSelected) {
|
|
40997
40997
|
console.log(
|
|
40998
|
-
|
|
40998
|
+
chalk27__default.default.green("\u2502") + prefix + chalk27__default.default.black.bgGreen(modelText.padEnd(75)) + chalk27__default.default.green("\u2502")
|
|
40999
40999
|
);
|
|
41000
41000
|
} else {
|
|
41001
41001
|
console.log(
|
|
41002
|
-
|
|
41002
|
+
chalk27__default.default.green("\u2502") + prefix + chalk27__default.default.green(modelText.substring(0, 75).padEnd(75)) + chalk27__default.default.green("\u2502")
|
|
41003
41003
|
);
|
|
41004
41004
|
}
|
|
41005
41005
|
}
|
|
@@ -43144,129 +43144,129 @@ function displayStartupLogo() {
|
|
|
43144
43144
|
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
43145
43145
|
console.log("");
|
|
43146
43146
|
console.log(
|
|
43147
|
-
|
|
43147
|
+
chalk27__default.default.magentaBright(
|
|
43148
43148
|
"\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"
|
|
43149
43149
|
)
|
|
43150
43150
|
);
|
|
43151
43151
|
console.log(
|
|
43152
|
-
|
|
43152
|
+
chalk27__default.default.magentaBright(
|
|
43153
43153
|
"\u2551 \u2551"
|
|
43154
43154
|
)
|
|
43155
43155
|
);
|
|
43156
43156
|
console.log(
|
|
43157
|
-
|
|
43157
|
+
chalk27__default.default.magentaBright(
|
|
43158
43158
|
"\u2551 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2551"
|
|
43159
43159
|
)
|
|
43160
43160
|
);
|
|
43161
43161
|
console.log(
|
|
43162
|
-
|
|
43162
|
+
chalk27__default.default.magentaBright(
|
|
43163
43163
|
"\u2551 \u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2551"
|
|
43164
43164
|
)
|
|
43165
43165
|
);
|
|
43166
43166
|
console.log(
|
|
43167
|
-
|
|
43167
|
+
chalk27__default.default.magentaBright(
|
|
43168
43168
|
"\u2551 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2551"
|
|
43169
43169
|
)
|
|
43170
43170
|
);
|
|
43171
43171
|
console.log(
|
|
43172
|
-
|
|
43172
|
+
chalk27__default.default.magentaBright(
|
|
43173
43173
|
"\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551 \u2551"
|
|
43174
43174
|
)
|
|
43175
43175
|
);
|
|
43176
43176
|
console.log(
|
|
43177
|
-
|
|
43177
|
+
chalk27__default.default.magentaBright(
|
|
43178
43178
|
"\u2551 \u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2551"
|
|
43179
43179
|
)
|
|
43180
43180
|
);
|
|
43181
43181
|
console.log(
|
|
43182
|
-
|
|
43182
|
+
chalk27__default.default.magentaBright(
|
|
43183
43183
|
"\u2551 \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u2551"
|
|
43184
43184
|
)
|
|
43185
43185
|
);
|
|
43186
43186
|
console.log(
|
|
43187
|
-
|
|
43187
|
+
chalk27__default.default.magentaBright(
|
|
43188
43188
|
"\u2551 \u2551"
|
|
43189
43189
|
)
|
|
43190
43190
|
);
|
|
43191
43191
|
console.log(
|
|
43192
|
-
|
|
43192
|
+
chalk27__default.default.magentaBright(
|
|
43193
43193
|
"\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2551"
|
|
43194
43194
|
)
|
|
43195
43195
|
);
|
|
43196
43196
|
console.log(
|
|
43197
|
-
|
|
43197
|
+
chalk27__default.default.magentaBright(
|
|
43198
43198
|
"\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2551"
|
|
43199
43199
|
)
|
|
43200
43200
|
);
|
|
43201
43201
|
console.log(
|
|
43202
|
-
|
|
43202
|
+
chalk27__default.default.magentaBright(
|
|
43203
43203
|
"\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2551"
|
|
43204
43204
|
)
|
|
43205
43205
|
);
|
|
43206
43206
|
console.log(
|
|
43207
|
-
|
|
43207
|
+
chalk27__default.default.magentaBright(
|
|
43208
43208
|
"\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2551"
|
|
43209
43209
|
)
|
|
43210
43210
|
);
|
|
43211
43211
|
console.log(
|
|
43212
|
-
|
|
43212
|
+
chalk27__default.default.magentaBright(
|
|
43213
43213
|
"\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2551"
|
|
43214
43214
|
)
|
|
43215
43215
|
);
|
|
43216
43216
|
console.log(
|
|
43217
|
-
|
|
43217
|
+
chalk27__default.default.magentaBright(
|
|
43218
43218
|
"\u2551 \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u2551"
|
|
43219
43219
|
)
|
|
43220
43220
|
);
|
|
43221
43221
|
console.log(
|
|
43222
|
-
|
|
43222
|
+
chalk27__default.default.magentaBright(
|
|
43223
43223
|
"\u2551 \u2551"
|
|
43224
43224
|
)
|
|
43225
43225
|
);
|
|
43226
43226
|
console.log(
|
|
43227
|
-
|
|
43227
|
+
chalk27__default.default.magentaBright(
|
|
43228
43228
|
"\u2551 AI-Powered Development Platform \u2551"
|
|
43229
43229
|
)
|
|
43230
43230
|
);
|
|
43231
43231
|
console.log(
|
|
43232
|
-
|
|
43232
|
+
chalk27__default.default.magentaBright(
|
|
43233
43233
|
"\u2551 (c) 2025 Bonginkan Inc. \u2551"
|
|
43234
43234
|
)
|
|
43235
43235
|
);
|
|
43236
43236
|
console.log(
|
|
43237
|
-
|
|
43237
|
+
chalk27__default.default.magentaBright(
|
|
43238
43238
|
"\u2551 \u2551"
|
|
43239
43239
|
)
|
|
43240
43240
|
);
|
|
43241
43241
|
console.log(
|
|
43242
|
-
|
|
43242
|
+
chalk27__default.default.magentaBright(
|
|
43243
43243
|
"\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"
|
|
43244
43244
|
)
|
|
43245
43245
|
);
|
|
43246
43246
|
console.log("");
|
|
43247
43247
|
console.log(
|
|
43248
|
-
|
|
43248
|
+
chalk27__default.default.cyan.bold(`MARIA CODE v${getVersion()}`) + chalk27__default.default.gray(" \u2014 Ready")
|
|
43249
43249
|
);
|
|
43250
43250
|
console.log(
|
|
43251
|
-
|
|
43251
|
+
chalk27__default.default.yellow("Type /login to get started \xB7 /help for commands")
|
|
43252
43252
|
);
|
|
43253
43253
|
console.log("");
|
|
43254
43254
|
}
|
|
43255
43255
|
function displayCompactLogo() {
|
|
43256
43256
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
43257
43257
|
console.log(
|
|
43258
|
-
|
|
43258
|
+
chalk27__default.default.cyan.bold(`MARIA CODE v${getVersion()}`) + chalk27__default.default.gray(" \u2014 Ready")
|
|
43259
43259
|
);
|
|
43260
43260
|
console.log(
|
|
43261
|
-
|
|
43261
|
+
chalk27__default.default.yellow("Type /login to get started \xB7 /help for commands")
|
|
43262
43262
|
);
|
|
43263
43263
|
console.log("");
|
|
43264
43264
|
}
|
|
43265
43265
|
function displayDashboardHeader() {
|
|
43266
43266
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
43267
|
-
const version =
|
|
43268
|
-
const commands =
|
|
43269
|
-
const providers =
|
|
43267
|
+
const version = chalk27__default.default.cyan.bold(`MARIA CODE v${getVersion()}`);
|
|
43268
|
+
const commands = chalk27__default.default.gray(" | /help /status /model");
|
|
43269
|
+
const providers = chalk27__default.default.gray(
|
|
43270
43270
|
"Providers: 8/8 OK (openai, anthropic, google, groq, lmstudio, ollama, vllm)"
|
|
43271
43271
|
);
|
|
43272
43272
|
console.log(version + commands);
|
|
@@ -43275,8 +43275,8 @@ function displayDashboardHeader() {
|
|
|
43275
43275
|
}
|
|
43276
43276
|
function displayLogsBox(logs) {
|
|
43277
43277
|
const width = getResponsiveWidth({ marginLeft: 5, marginRight: 5, maxWidth: 120 });
|
|
43278
|
-
const borderColor =
|
|
43279
|
-
const titleColor =
|
|
43278
|
+
const borderColor = chalk27__default.default.white;
|
|
43279
|
+
const titleColor = chalk27__default.default.cyan;
|
|
43280
43280
|
const topLeft = "\u250C";
|
|
43281
43281
|
const topRight = "\u2510";
|
|
43282
43282
|
const bottomLeft = "\u2514";
|
|
@@ -43309,7 +43309,7 @@ function displayLogsBox(logs) {
|
|
|
43309
43309
|
function displaySpinner(text = "Processing") {
|
|
43310
43310
|
const spinnerFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
43311
43311
|
const frame = spinnerFrames[Math.floor(Date.now() / 80) % spinnerFrames.length];
|
|
43312
|
-
process.stdout.write(`\r[${
|
|
43312
|
+
process.stdout.write(`\r[${chalk27__default.default.cyan(frame)}] ${text}...`);
|
|
43313
43313
|
}
|
|
43314
43314
|
function getCurrentPath() {
|
|
43315
43315
|
return process.cwd();
|
|
@@ -43327,18 +43327,18 @@ async function displayFinalStartupScreen(_selectedProvider, _selectedModel) {
|
|
|
43327
43327
|
const version = getVersion();
|
|
43328
43328
|
const systemInfo = getSystemInfo();
|
|
43329
43329
|
console.log(
|
|
43330
|
-
|
|
43330
|
+
chalk27__default.default.cyan.bold(`MARIA CODE v${version}`) + chalk27__default.default.gray(" \u2014 Ready")
|
|
43331
43331
|
);
|
|
43332
43332
|
const cwd2 = systemInfo.cwd.replace(os13__namespace.homedir(), "~");
|
|
43333
|
-
console.log(
|
|
43334
|
-
console.log(
|
|
43335
|
-
console.log(
|
|
43333
|
+
console.log(chalk27__default.default.gray("cwd: ") + chalk27__default.default.white(cwd2));
|
|
43334
|
+
console.log(chalk27__default.default.gray("Not signed in"));
|
|
43335
|
+
console.log(chalk27__default.default.yellow("Tip: /login \xB7 /help \xB7 /help code"));
|
|
43336
43336
|
console.log("");
|
|
43337
43337
|
}
|
|
43338
43338
|
function displayRoundedInputBox() {
|
|
43339
43339
|
const width = getResponsiveWidth({ marginLeft: 5, marginRight: 5, maxWidth: 90 });
|
|
43340
|
-
const borderColor =
|
|
43341
|
-
const promptColor =
|
|
43340
|
+
const borderColor = chalk27__default.default.white;
|
|
43341
|
+
const promptColor = chalk27__default.default.cyan;
|
|
43342
43342
|
const topLeft = "\u256D";
|
|
43343
43343
|
const topRight = "\u256E";
|
|
43344
43344
|
const bottomLeft = "\u2570";
|
|
@@ -43348,7 +43348,7 @@ function displayRoundedInputBox() {
|
|
|
43348
43348
|
const lines = [];
|
|
43349
43349
|
lines.push(borderColor(topLeft + horizontal.repeat(width - 2) + topRight));
|
|
43350
43350
|
const promptStr = promptColor("> ");
|
|
43351
|
-
const placeholder =
|
|
43351
|
+
const placeholder = chalk27__default.default.gray("");
|
|
43352
43352
|
const inputLine = promptStr + placeholder;
|
|
43353
43353
|
const padding = width - 4;
|
|
43354
43354
|
lines.push(
|
|
@@ -43502,29 +43502,29 @@ var init_provider_selector = __esm({
|
|
|
43502
43502
|
const inquirer = await import('inquirer');
|
|
43503
43503
|
const prompt = inquirer.default?.prompt || inquirer.prompt;
|
|
43504
43504
|
const providers = await this.getAvailableProviders();
|
|
43505
|
-
console.log(
|
|
43506
|
-
console.log(
|
|
43505
|
+
console.log(chalk27__default.default.cyan("\nAvailable AI Providers:"));
|
|
43506
|
+
console.log(chalk27__default.default.gray("\u2500".repeat(50)));
|
|
43507
43507
|
const _cloudProviders = providers.filter((p) => p.type === "cloud");
|
|
43508
43508
|
const _localProviders = providers.filter((p) => p.type === "local");
|
|
43509
43509
|
if (_cloudProviders.length > 0) {
|
|
43510
|
-
console.log(
|
|
43510
|
+
console.log(chalk27__default.default.yellow("\n\u2601\uFE0F Cloud AI:"));
|
|
43511
43511
|
_cloudProviders.forEach((p) => {
|
|
43512
43512
|
if (p.available) {
|
|
43513
43513
|
console.log(
|
|
43514
|
-
` ${
|
|
43514
|
+
` ${chalk27__default.default.green("*")} ${chalk27__default.default.white(p.name.split(" ")[0])}`
|
|
43515
43515
|
);
|
|
43516
43516
|
} else {
|
|
43517
|
-
console.log(` ${
|
|
43517
|
+
console.log(` ${chalk27__default.default.gray(p.name.split(" ")[0])}`);
|
|
43518
43518
|
}
|
|
43519
43519
|
});
|
|
43520
43520
|
}
|
|
43521
43521
|
if (_localProviders.length > 0) {
|
|
43522
|
-
console.log(
|
|
43522
|
+
console.log(chalk27__default.default.cyan("\n\u{1F4BB} Local AI:"));
|
|
43523
43523
|
_localProviders.forEach((p) => {
|
|
43524
43524
|
if (p.available) {
|
|
43525
|
-
console.log(` ${
|
|
43525
|
+
console.log(` ${chalk27__default.default.green("*")} ${chalk27__default.default.white(p.name)}`);
|
|
43526
43526
|
} else {
|
|
43527
|
-
console.log(` ${
|
|
43527
|
+
console.log(` ${chalk27__default.default.green("*")} ${chalk27__default.default.gray(p.name)}`);
|
|
43528
43528
|
}
|
|
43529
43529
|
});
|
|
43530
43530
|
}
|
|
@@ -43539,20 +43539,20 @@ var init_provider_selector = __esm({
|
|
|
43539
43539
|
});
|
|
43540
43540
|
if (selectableProviders.length === 0) {
|
|
43541
43541
|
console.log(
|
|
43542
|
-
|
|
43542
|
+
chalk27__default.default.yellow("\n\u26A0\uFE0F No AI providers are currently available.")
|
|
43543
43543
|
);
|
|
43544
|
-
console.log(
|
|
43544
|
+
console.log(chalk27__default.default.gray("\nTo use MARIA, you need to:"));
|
|
43545
43545
|
console.log(
|
|
43546
|
-
|
|
43546
|
+
chalk27__default.default.gray(
|
|
43547
43547
|
"1. Set up API keys for cloud providers (OpenAI, Anthropic, Google, etc.)"
|
|
43548
43548
|
)
|
|
43549
43549
|
);
|
|
43550
|
-
console.log(
|
|
43550
|
+
console.log(chalk27__default.default.gray(" Example: export OPENAI_API_KEY=your_api_key"));
|
|
43551
43551
|
console.log(
|
|
43552
|
-
|
|
43552
|
+
chalk27__default.default.gray("2. Or start a local AI service (Ollama, LM Studio, vLLM)")
|
|
43553
43553
|
);
|
|
43554
|
-
console.log(
|
|
43555
|
-
console.log(
|
|
43554
|
+
console.log(chalk27__default.default.gray(" Example: maria setup-ollama"));
|
|
43555
|
+
console.log(chalk27__default.default.gray("\nFor more information, run: maria --help"));
|
|
43556
43556
|
process.exit(1);
|
|
43557
43557
|
}
|
|
43558
43558
|
const choices = selectableProviders.map((p) => ({
|
|
@@ -43573,29 +43573,29 @@ var init_provider_selector = __esm({
|
|
|
43573
43573
|
const provider = providers.find((p) => p.value === selectedProvider);
|
|
43574
43574
|
if (provider && provider.type === "local" && !provider.available) {
|
|
43575
43575
|
console.log(
|
|
43576
|
-
|
|
43576
|
+
chalk27__default.default.yellow(`
|
|
43577
43577
|
\u26A0\uFE0F ${provider.name} is not currently running.`)
|
|
43578
43578
|
);
|
|
43579
|
-
console.log(
|
|
43579
|
+
console.log(chalk27__default.default.gray(`
|
|
43580
43580
|
To use ${provider.name}, you need to:`));
|
|
43581
43581
|
if (selectedProvider === "ollama") {
|
|
43582
|
-
console.log(
|
|
43583
|
-
console.log(
|
|
43584
|
-
console.log(
|
|
43582
|
+
console.log(chalk27__default.default.gray("1. Install Ollama: brew install ollama"));
|
|
43583
|
+
console.log(chalk27__default.default.gray("2. Start Ollama: ollama serve"));
|
|
43584
|
+
console.log(chalk27__default.default.gray("3. Pull a model: ollama pull llama3.2:3b"));
|
|
43585
43585
|
console.log(
|
|
43586
|
-
|
|
43586
|
+
chalk27__default.default.gray("\nOr use the setup command: maria setup-ollama")
|
|
43587
43587
|
);
|
|
43588
43588
|
} else if (selectedProvider === "lmstudio") {
|
|
43589
43589
|
console.log(
|
|
43590
|
-
|
|
43590
|
+
chalk27__default.default.gray("1. Download LM Studio from https://lmstudio.ai")
|
|
43591
43591
|
);
|
|
43592
|
-
console.log(
|
|
43593
|
-
console.log(
|
|
43594
|
-
console.log(
|
|
43592
|
+
console.log(chalk27__default.default.gray("2. Start LM Studio application"));
|
|
43593
|
+
console.log(chalk27__default.default.gray("3. Load a model in LM Studio"));
|
|
43594
|
+
console.log(chalk27__default.default.gray("4. Start the local server in LM Studio"));
|
|
43595
43595
|
} else if (selectedProvider === "vllm") {
|
|
43596
|
-
console.log(
|
|
43597
|
-
console.log(
|
|
43598
|
-
console.log(
|
|
43596
|
+
console.log(chalk27__default.default.gray("1. Install vLLM: pip install vllm"));
|
|
43597
|
+
console.log(chalk27__default.default.gray("2. Start vLLM server with a model"));
|
|
43598
|
+
console.log(chalk27__default.default.gray("\nOr use the setup command: maria setup-vllm"));
|
|
43599
43599
|
}
|
|
43600
43600
|
process.exit(1);
|
|
43601
43601
|
}
|
|
@@ -46850,7 +46850,7 @@ var init_IntelligentRouterService = __esm({
|
|
|
46850
46850
|
this.emit("initialized");
|
|
46851
46851
|
} catch (_error) {
|
|
46852
46852
|
console._error(
|
|
46853
|
-
|
|
46853
|
+
chalk27__default.default.red("Failed to initialize Intelligent Router:"),
|
|
46854
46854
|
_error
|
|
46855
46855
|
);
|
|
46856
46856
|
throw _error;
|
|
@@ -46904,7 +46904,7 @@ var init_IntelligentRouterService = __esm({
|
|
|
46904
46904
|
} catch (_error) {
|
|
46905
46905
|
this.metrics.failedRoutes++;
|
|
46906
46906
|
this.emit("route:_error", { input: input3, _error });
|
|
46907
|
-
console._error(
|
|
46907
|
+
console._error(chalk27__default.default.red("Routing _error:"), _error);
|
|
46908
46908
|
return null;
|
|
46909
46909
|
}
|
|
46910
46910
|
}
|
|
@@ -49643,16 +49643,16 @@ var init_log_symbols = __esm({
|
|
|
49643
49643
|
"node_modules/.pnpm/log-symbols@6.0.0/node_modules/log-symbols/index.js"() {
|
|
49644
49644
|
init_is_unicode_supported();
|
|
49645
49645
|
main = {
|
|
49646
|
-
info:
|
|
49647
|
-
success:
|
|
49648
|
-
warning:
|
|
49649
|
-
error:
|
|
49646
|
+
info: chalk27__default.default.blue("\u2139"),
|
|
49647
|
+
success: chalk27__default.default.green("\u2714"),
|
|
49648
|
+
warning: chalk27__default.default.yellow("\u26A0"),
|
|
49649
|
+
error: chalk27__default.default.red("\u2716")
|
|
49650
49650
|
};
|
|
49651
49651
|
fallback = {
|
|
49652
|
-
info:
|
|
49653
|
-
success:
|
|
49654
|
-
warning:
|
|
49655
|
-
error:
|
|
49652
|
+
info: chalk27__default.default.blue("i"),
|
|
49653
|
+
success: chalk27__default.default.green("\u221A"),
|
|
49654
|
+
warning: chalk27__default.default.yellow("\u203C"),
|
|
49655
|
+
error: chalk27__default.default.red("\xD7")
|
|
49656
49656
|
};
|
|
49657
49657
|
logSymbols = isUnicodeSupported() ? main : fallback;
|
|
49658
49658
|
log_symbols_default = logSymbols;
|
|
@@ -50049,7 +50049,7 @@ var init_ora = __esm({
|
|
|
50049
50049
|
const { frames } = this.#spinner;
|
|
50050
50050
|
let frame = frames[this.#frameIndex];
|
|
50051
50051
|
if (this.color) {
|
|
50052
|
-
frame =
|
|
50052
|
+
frame = chalk27__default.default[this.color](frame);
|
|
50053
50053
|
}
|
|
50054
50054
|
const fullPrefixText = typeof this.#prefixText === "string" && this.#prefixText !== "" ? this.#prefixText + " " : "";
|
|
50055
50055
|
const fullText = typeof this.text === "string" ? " " + this.text : "";
|
|
@@ -50169,28 +50169,28 @@ var init_ChalkAdapter = __esm({
|
|
|
50169
50169
|
spinnerId = 0;
|
|
50170
50170
|
async showWelcome() {
|
|
50171
50171
|
console.log(
|
|
50172
|
-
|
|
50172
|
+
chalk27__default.default.cyan.bold("\n\u{1F916} Welcome to MARIA Interactive Session v3.5.0")
|
|
50173
50173
|
);
|
|
50174
|
-
console.log(
|
|
50174
|
+
console.log(chalk27__default.default.gray("Type /help for available commands\n"));
|
|
50175
50175
|
}
|
|
50176
50176
|
showGoodbye() {
|
|
50177
50177
|
this.stopAllSpinners();
|
|
50178
|
-
console.log(
|
|
50178
|
+
console.log(chalk27__default.default.yellow("\n\u{1F44B} Goodbye! Thank you for using MARIA.\n"));
|
|
50179
50179
|
}
|
|
50180
50180
|
async print(message) {
|
|
50181
50181
|
console.log(message);
|
|
50182
50182
|
}
|
|
50183
50183
|
error(message) {
|
|
50184
|
-
console.error(
|
|
50184
|
+
console.error(chalk27__default.default.red(`\u274C ${message}`));
|
|
50185
50185
|
}
|
|
50186
50186
|
success(message) {
|
|
50187
|
-
console.log(
|
|
50187
|
+
console.log(chalk27__default.default.green(`\u2705 ${message}`));
|
|
50188
50188
|
}
|
|
50189
50189
|
warning(message) {
|
|
50190
|
-
console.warn(
|
|
50190
|
+
console.warn(chalk27__default.default.yellow(`\u26A0\uFE0F ${message}`));
|
|
50191
50191
|
}
|
|
50192
50192
|
info(message) {
|
|
50193
|
-
console.info(
|
|
50193
|
+
console.info(chalk27__default.default.blue(`\u2139\uFE0F ${message}`));
|
|
50194
50194
|
}
|
|
50195
50195
|
startSpinner(message) {
|
|
50196
50196
|
const id = `spinner-${++this.spinnerId}`;
|
|
@@ -50240,12 +50240,12 @@ var init_ChalkAdapter = __esm({
|
|
|
50240
50240
|
* Format helpers for consistent styling
|
|
50241
50241
|
*/
|
|
50242
50242
|
static format = {
|
|
50243
|
-
command: (text) =>
|
|
50244
|
-
keyword: (text) =>
|
|
50245
|
-
value: (text) =>
|
|
50246
|
-
dim: (text) =>
|
|
50247
|
-
bold: (text) =>
|
|
50248
|
-
code: (text) =>
|
|
50243
|
+
command: (text) => chalk27__default.default.cyan(text),
|
|
50244
|
+
keyword: (text) => chalk27__default.default.magenta(text),
|
|
50245
|
+
value: (text) => chalk27__default.default.green(text),
|
|
50246
|
+
dim: (text) => chalk27__default.default.gray(text),
|
|
50247
|
+
bold: (text) => chalk27__default.default.bold(text),
|
|
50248
|
+
code: (text) => chalk27__default.default.bgGray.white(` ${text} `)
|
|
50249
50249
|
};
|
|
50250
50250
|
};
|
|
50251
50251
|
}
|
|
@@ -55395,26 +55395,26 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55395
55395
|
const _lang = options2.language || "en";
|
|
55396
55396
|
const _labels = LANGUAGE_LABELS[_lang] || LANGUAGE_LABELS.en;
|
|
55397
55397
|
console.log("");
|
|
55398
|
-
console.log(
|
|
55398
|
+
console.log(chalk27__default.default.gray("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
55399
55399
|
console.log(
|
|
55400
|
-
|
|
55400
|
+
chalk27__default.default.gray("\u2502") + chalk27__default.default.white(
|
|
55401
55401
|
` ${_labels.approvalRequest}${" ".repeat(Math.max(0, 43 - _labels.approvalRequest.length))}`
|
|
55402
|
-
) +
|
|
55402
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55403
55403
|
);
|
|
55404
|
-
console.log(
|
|
55404
|
+
console.log(chalk27__default.default.gray("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"));
|
|
55405
55405
|
const _requestId = `AP-${(/* @__PURE__ */ new Date()).getFullYear()}-${String((/* @__PURE__ */ new Date()).getMonth() + 1).padStart(2, "0")}${String((/* @__PURE__ */ new Date()).getDate()).padStart(2, "0")}-${String(Math.floor(Math.random() * 999)).padStart(3, "0")}`;
|
|
55406
55406
|
console.log(
|
|
55407
|
-
|
|
55408
|
-
` > ${_labels.id}: ${
|
|
55409
|
-
) +
|
|
55407
|
+
chalk27__default.default.gray("\u2502") + chalk27__default.default.white(
|
|
55408
|
+
` > ${_labels.id}: ${chalk27__default.default.yellow(_requestId)}${" ".repeat(Math.max(0, 35 - _requestId.length - _labels.id.length))}`
|
|
55409
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55410
55410
|
);
|
|
55411
55411
|
const _title = _request.context?.description || _request.themeId || "API Cache Improvement";
|
|
55412
55412
|
const _titleDisplay = _title.length > 25 ? _title.substring(0, 22) + "..." : _title;
|
|
55413
55413
|
const _titleLabel = ` ${_labels._title}:`;
|
|
55414
55414
|
console.log(
|
|
55415
|
-
|
|
55415
|
+
chalk27__default.default.gray("\u2502") + chalk27__default.default.white(
|
|
55416
55416
|
`${_titleLabel} ${_titleDisplay}${" ".repeat(Math.max(0, 42 - _titleLabel.length - _titleDisplay.length))}`
|
|
55417
|
-
) +
|
|
55417
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55418
55418
|
);
|
|
55419
55419
|
const _riskLevel = this.formatRiskLevelSimple(_request.riskAssessment);
|
|
55420
55420
|
const _approvalsCount = _riskLevel === "HIGH" || _riskLevel === "CRITICAL" ? "2" : "1";
|
|
@@ -55422,37 +55422,37 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55422
55422
|
const _levelLabel = ` ${_labels.level}:`;
|
|
55423
55423
|
const _levelDisplay = `${_riskLevel} ${_approvalsText}`;
|
|
55424
55424
|
console.log(
|
|
55425
|
-
|
|
55425
|
+
chalk27__default.default.gray("\u2502") + chalk27__default.default.white(
|
|
55426
55426
|
`${_levelLabel} ${_levelDisplay}${" ".repeat(Math.max(0, 42 - _levelLabel.length - _levelDisplay.length))}`
|
|
55427
|
-
) +
|
|
55427
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55428
55428
|
);
|
|
55429
55429
|
const _impact = _request.estimatedTime || "p95 latency -20%";
|
|
55430
55430
|
const _impactLabel = ` ${_labels._impact}:`;
|
|
55431
55431
|
console.log(
|
|
55432
|
-
|
|
55432
|
+
chalk27__default.default.gray("\u2502") + chalk27__default.default.white(
|
|
55433
55433
|
`${_impactLabel} ${_impact}${" ".repeat(Math.max(0, 42 - _impactLabel.length - _impact.length))}`
|
|
55434
|
-
) +
|
|
55434
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55435
55435
|
);
|
|
55436
55436
|
const _approversLabel = ` ${_labels.approvers}:`;
|
|
55437
55437
|
const _approversStatus = "[x] Lead [ ] QA";
|
|
55438
55438
|
console.log(
|
|
55439
|
-
|
|
55439
|
+
chalk27__default.default.gray("\u2502") + chalk27__default.default.white(
|
|
55440
55440
|
`${_approversLabel} ${_approversStatus}${" ".repeat(Math.max(0, 42 - _approversLabel.length - _approversStatus.length))}`
|
|
55441
|
-
) +
|
|
55441
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55442
55442
|
);
|
|
55443
55443
|
const _deadline = new Date(Date.now() + 30 * 60 * 1e3);
|
|
55444
55444
|
const _timeStr = `${_deadline.getFullYear()}-${String(_deadline.getMonth() + 1).padStart(2, "0")}-${String(_deadline.getDate()).padStart(2, "0")} ${String(_deadline.getHours()).padStart(2, "0")}:${String(_deadline.getMinutes()).padStart(2, "0")}`;
|
|
55445
55445
|
const _deadlineLabel = ` ${_labels._deadline}:`;
|
|
55446
55446
|
console.log(
|
|
55447
|
-
|
|
55447
|
+
chalk27__default.default.gray("\u2502") + chalk27__default.default.white(
|
|
55448
55448
|
`${_deadlineLabel} ${_timeStr}${" ".repeat(Math.max(0, 42 - _deadlineLabel.length - _timeStr.length))}`
|
|
55449
|
-
) +
|
|
55449
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55450
55450
|
);
|
|
55451
|
-
console.log(
|
|
55451
|
+
console.log(chalk27__default.default.gray("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"));
|
|
55452
55452
|
console.log(
|
|
55453
|
-
|
|
55453
|
+
chalk27__default.default.gray("\u2502") + chalk27__default.default.white(
|
|
55454
55454
|
` ${_labels.actions}:${" ".repeat(Math.max(0, 42 - _labels.actions.length))}`
|
|
55455
|
-
) +
|
|
55455
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55456
55456
|
);
|
|
55457
55457
|
this.menuOptions.forEach((option, _index) => {
|
|
55458
55458
|
const _isSelected = _index === this.selectedIndex;
|
|
@@ -55463,32 +55463,32 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55463
55463
|
switch (option) {
|
|
55464
55464
|
case "approve":
|
|
55465
55465
|
label = _labels.approve;
|
|
55466
|
-
color =
|
|
55466
|
+
color = chalk27__default.default.green;
|
|
55467
55467
|
break;
|
|
55468
55468
|
case "reject":
|
|
55469
55469
|
label = _labels.reject;
|
|
55470
|
-
color =
|
|
55470
|
+
color = chalk27__default.default.red;
|
|
55471
55471
|
break;
|
|
55472
55472
|
case "cancel":
|
|
55473
55473
|
label = _labels.cancel;
|
|
55474
|
-
color =
|
|
55474
|
+
color = chalk27__default.default.yellow;
|
|
55475
55475
|
break;
|
|
55476
55476
|
}
|
|
55477
55477
|
const _optionText = `${_prefix}[${_key}] ${label}`;
|
|
55478
55478
|
const _colorFunc = _isSelected ? color.bold : color;
|
|
55479
55479
|
console.log(
|
|
55480
|
-
|
|
55480
|
+
chalk27__default.default.gray("\u2502") + _colorFunc(
|
|
55481
55481
|
`${_optionText}${" ".repeat(Math.max(0, 43 - _optionText.length))}`
|
|
55482
|
-
) +
|
|
55482
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55483
55483
|
);
|
|
55484
55484
|
});
|
|
55485
|
-
console.log(
|
|
55485
|
+
console.log(chalk27__default.default.gray("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"));
|
|
55486
55486
|
console.log(
|
|
55487
|
-
|
|
55487
|
+
chalk27__default.default.gray("\u2502") + chalk27__default.default.white(
|
|
55488
55488
|
` ${_labels.moveInstruction}${" ".repeat(Math.max(0, 43 - _labels.moveInstruction.length))}`
|
|
55489
|
-
) +
|
|
55489
|
+
) + chalk27__default.default.gray("\u2502")
|
|
55490
55490
|
);
|
|
55491
|
-
console.log(
|
|
55491
|
+
console.log(chalk27__default.default.gray("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"));
|
|
55492
55492
|
console.log("");
|
|
55493
55493
|
}
|
|
55494
55494
|
/**
|
|
@@ -55504,13 +55504,13 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55504
55504
|
};
|
|
55505
55505
|
const _formatted = keyMap[_key] || _key;
|
|
55506
55506
|
const colorMap = {
|
|
55507
|
-
"shift+tab":
|
|
55508
|
-
"ctrl+y":
|
|
55509
|
-
"ctrl+n":
|
|
55510
|
-
"ctrl+t":
|
|
55511
|
-
"ctrl+r":
|
|
55507
|
+
"shift+tab": chalk27__default.default.bgGreen.black.bold,
|
|
55508
|
+
"ctrl+y": chalk27__default.default.bgBlue.white.bold,
|
|
55509
|
+
"ctrl+n": chalk27__default.default.bgRed.white.bold,
|
|
55510
|
+
"ctrl+t": chalk27__default.default.bgMagenta.white.bold,
|
|
55511
|
+
"ctrl+r": chalk27__default.default.bgYellow.black.bold
|
|
55512
55512
|
};
|
|
55513
|
-
const _colorFunc = colorMap[_key] ||
|
|
55513
|
+
const _colorFunc = colorMap[_key] || chalk27__default.default.bgCyan.black.bold;
|
|
55514
55514
|
return _colorFunc(` ${_formatted} `);
|
|
55515
55515
|
}
|
|
55516
55516
|
/**
|
|
@@ -55519,15 +55519,15 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55519
55519
|
formatRiskLevel(risk) {
|
|
55520
55520
|
switch (risk.toLowerCase()) {
|
|
55521
55521
|
case "critical":
|
|
55522
|
-
return
|
|
55522
|
+
return chalk27__default.default.red.bold("CRITICAL");
|
|
55523
55523
|
case "high":
|
|
55524
|
-
return
|
|
55524
|
+
return chalk27__default.default.red("HIGH");
|
|
55525
55525
|
case "medium":
|
|
55526
|
-
return
|
|
55526
|
+
return chalk27__default.default.yellow("MEDIUM");
|
|
55527
55527
|
case "low":
|
|
55528
|
-
return
|
|
55528
|
+
return chalk27__default.default.green("LOW");
|
|
55529
55529
|
default:
|
|
55530
|
-
return
|
|
55530
|
+
return chalk27__default.default.white(risk);
|
|
55531
55531
|
}
|
|
55532
55532
|
}
|
|
55533
55533
|
/**
|
|
@@ -55597,7 +55597,7 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55597
55597
|
}
|
|
55598
55598
|
if (_key === "") {
|
|
55599
55599
|
console.log(`
|
|
55600
|
-
${
|
|
55600
|
+
${chalk27__default.default.red("Approval cancelled by user")}`);
|
|
55601
55601
|
this.emit("approval-cancelled", this.currentRequest.id);
|
|
55602
55602
|
return;
|
|
55603
55603
|
}
|
|
@@ -55654,20 +55654,20 @@ ${chalk24__default.default.red("Approval cancelled by user")}`);
|
|
|
55654
55654
|
}
|
|
55655
55655
|
console.clear();
|
|
55656
55656
|
console.log(`
|
|
55657
|
-
${
|
|
55657
|
+
${chalk27__default.default.bgGreen.black.bold(`\u250C${"\u2500".repeat(78)}\u2510`)}`);
|
|
55658
55658
|
console.log(
|
|
55659
|
-
|
|
55659
|
+
chalk27__default.default.bgGreen.black.bold("\u2502") + chalk27__default.default.bgGreen.black.bold(
|
|
55660
55660
|
` \u2713 CHOICE SELECTED / \u9078\u629E\u5B8C\u4E86:${" ".repeat(47)}`
|
|
55661
|
-
) +
|
|
55661
|
+
) + chalk27__default.default.bgGreen.black.bold("\u2502")
|
|
55662
55662
|
);
|
|
55663
|
-
console.log(
|
|
55663
|
+
console.log(chalk27__default.default.bgGreen.black.bold(`\u251C${"\u2500".repeat(78)}\u2524`));
|
|
55664
55664
|
const _choiceText = `${_choice.label} (${_choice.labelJa})`;
|
|
55665
55665
|
const _padding = " ".repeat(Math.max(0, 76 - _choiceText.length));
|
|
55666
55666
|
console.log(
|
|
55667
|
-
|
|
55667
|
+
chalk27__default.default.bgGreen.black.bold("\u2502") + chalk27__default.default.bgGreen.black.bold(` ${_choiceText}${_padding}`) + chalk27__default.default.bgGreen.black.bold("\u2502")
|
|
55668
55668
|
);
|
|
55669
|
-
console.log(
|
|
55670
|
-
console.log(
|
|
55669
|
+
console.log(chalk27__default.default.bgGreen.black.bold(`\u2514${"\u2500".repeat(78)}\u2518`));
|
|
55670
|
+
console.log(chalk27__default.default.yellow("\n\u{1F504} Processing your approval decision..."));
|
|
55671
55671
|
try {
|
|
55672
55672
|
const _response = await this.approvalEngine.processApprovalResponse(
|
|
55673
55673
|
this.currentRequest.id,
|
|
@@ -55677,30 +55677,30 @@ ${chalk24__default.default.bgGreen.black.bold(`\u250C${"\u2500".repeat(78)}\u251
|
|
|
55677
55677
|
);
|
|
55678
55678
|
response.quickDecision = true;
|
|
55679
55679
|
console.log(`
|
|
55680
|
-
${
|
|
55680
|
+
${chalk27__default.default.bgGreen.black(`\u250C${"\u2500".repeat(78)}\u2510`)}`);
|
|
55681
55681
|
console.log(
|
|
55682
|
-
|
|
55682
|
+
chalk27__default.default.bgGreen.black("\u2502") + chalk27__default.default.bgGreen.black(
|
|
55683
55683
|
` \u{1F389} APPROVAL PROCESSED SUCCESSFULLY / \u627F\u8A8D\u51E6\u7406\u5B8C\u4E86!${" ".repeat(32)}`
|
|
55684
|
-
) +
|
|
55684
|
+
) + chalk27__default.default.bgGreen.black("\u2502")
|
|
55685
55685
|
);
|
|
55686
|
-
console.log(
|
|
55686
|
+
console.log(chalk27__default.default.bgGreen.black(`\u2514${"\u2500".repeat(78)}\u2518`));
|
|
55687
55687
|
if (_choice.trustLevel) {
|
|
55688
55688
|
console.log(
|
|
55689
|
-
|
|
55689
|
+
chalk27__default.default.blue(`
|
|
55690
55690
|
\u2728 Trust level updated: ${_choice.trustLevel}`)
|
|
55691
55691
|
);
|
|
55692
55692
|
}
|
|
55693
55693
|
this.emit("approval-_response", _response);
|
|
55694
55694
|
} catch (_error) {
|
|
55695
55695
|
console.log(`
|
|
55696
|
-
${
|
|
55696
|
+
${chalk27__default.default.bgRed.white.bold(`\u250C${"\u2500".repeat(78)}\u2510`)}`);
|
|
55697
55697
|
console.log(
|
|
55698
|
-
|
|
55698
|
+
chalk27__default.default.bgRed.white.bold("\u2502") + chalk27__default.default.bgRed.white.bold(
|
|
55699
55699
|
` \u274C ERROR PROCESSING APPROVAL / \u627F\u8A8D\u51E6\u7406\u30A8\u30E9\u30FC${" ".repeat(35)}`
|
|
55700
|
-
) +
|
|
55700
|
+
) + chalk27__default.default.bgRed.white.bold("\u2502")
|
|
55701
55701
|
);
|
|
55702
|
-
console.log(
|
|
55703
|
-
console._error(
|
|
55702
|
+
console.log(chalk27__default.default.bgRed.white.bold(`\u2514${"\u2500".repeat(78)}\u2518`));
|
|
55703
|
+
console._error(chalk27__default.default.red("\nError details:"), _error);
|
|
55704
55704
|
this.emit("approval-_error", _error);
|
|
55705
55705
|
}
|
|
55706
55706
|
}
|
|
@@ -55714,7 +55714,7 @@ ${chalk24__default.default.bgRed.white.bold(`\u250C${"\u2500".repeat(78)}\u2510`
|
|
|
55714
55714
|
timeoutId = setTimeout(() => {
|
|
55715
55715
|
console.log(
|
|
55716
55716
|
`
|
|
55717
|
-
${
|
|
55717
|
+
${chalk27__default.default.yellow("\u23F0 Approval request timed out - auto-approving...")}`
|
|
55718
55718
|
);
|
|
55719
55719
|
this.handleTimeoutResponse(resolve);
|
|
55720
55720
|
}, timeout);
|
|
@@ -55758,7 +55758,7 @@ ${chalk24__default.default.yellow("\u23F0 Approval request timed out - auto-appr
|
|
|
55758
55758
|
response.quickDecision = true;
|
|
55759
55759
|
resolve(_response);
|
|
55760
55760
|
} catch (_error) {
|
|
55761
|
-
console._error(
|
|
55761
|
+
console._error(chalk27__default.default.red("Error processing timeout approval:"), _error);
|
|
55762
55762
|
}
|
|
55763
55763
|
}
|
|
55764
55764
|
/**
|
|
@@ -55773,11 +55773,11 @@ ${chalk24__default.default.yellow("\u23F0 Approval request timed out - auto-appr
|
|
|
55773
55773
|
);
|
|
55774
55774
|
this.approvalEngine.on("trust-level-changed", (event) => {
|
|
55775
55775
|
console.log(
|
|
55776
|
-
|
|
55776
|
+
chalk27__default.default.blue(
|
|
55777
55777
|
`\u2728 Trust level changed: ${event.oldLevel} \u2192 ${event.newLevel}`
|
|
55778
55778
|
)
|
|
55779
55779
|
);
|
|
55780
|
-
console.log(
|
|
55780
|
+
console.log(chalk27__default.default.gray(`Reason: ${event.reason}`));
|
|
55781
55781
|
});
|
|
55782
55782
|
}
|
|
55783
55783
|
/**
|
|
@@ -56564,22 +56564,22 @@ function formatProgressBar(current, total, width = 20) {
|
|
|
56564
56564
|
}
|
|
56565
56565
|
function formatError2(message, code) {
|
|
56566
56566
|
const prefix = "";
|
|
56567
|
-
return
|
|
56567
|
+
return chalk27__default.default.red(`\u274C ${prefix}${message}`);
|
|
56568
56568
|
}
|
|
56569
56569
|
function formatSuccess(message) {
|
|
56570
|
-
return
|
|
56570
|
+
return chalk27__default.default.green(`\u2705 ${message}`);
|
|
56571
56571
|
}
|
|
56572
56572
|
function formatWarning(message) {
|
|
56573
|
-
return
|
|
56573
|
+
return chalk27__default.default.yellow(`\u26A0\uFE0F ${message}`);
|
|
56574
56574
|
}
|
|
56575
56575
|
function formatInfo(message) {
|
|
56576
|
-
return
|
|
56576
|
+
return chalk27__default.default.blue(`\u2139\uFE0F ${message}`);
|
|
56577
56577
|
}
|
|
56578
56578
|
function formatTable(headers, rows, options2 = {}) {
|
|
56579
56579
|
const {
|
|
56580
56580
|
columnWidths = headers.map(() => 20),
|
|
56581
56581
|
separator = " | ",
|
|
56582
|
-
headerColor =
|
|
56582
|
+
headerColor = chalk27__default.default.cyan.bold
|
|
56583
56583
|
} = options2;
|
|
56584
56584
|
const headerRow = headers.map((h2, i2) => headerColor(h2.padEnd(columnWidths[i2]))).join(separator);
|
|
56585
56585
|
const separatorLine = columnWidths.map((w) => "-".repeat(w)).join(separator);
|
|
@@ -56591,8 +56591,8 @@ function formatTable(headers, rows, options2 = {}) {
|
|
|
56591
56591
|
function formatKeyValue(data2, options2 = {}) {
|
|
56592
56592
|
const {
|
|
56593
56593
|
keyWidth = 20,
|
|
56594
|
-
keyColor =
|
|
56595
|
-
valueColor =
|
|
56594
|
+
keyColor = chalk27__default.default.gray,
|
|
56595
|
+
valueColor = chalk27__default.default.white,
|
|
56596
56596
|
separator = ": "
|
|
56597
56597
|
} = options2;
|
|
56598
56598
|
return Object.entries(data2).map(([key2, value]) => {
|
|
@@ -56642,7 +56642,7 @@ var init_DisplayManager = __esm({
|
|
|
56642
56642
|
theme: options2.theme ?? "auto"
|
|
56643
56643
|
};
|
|
56644
56644
|
if (!this.options.enableColors) {
|
|
56645
|
-
|
|
56645
|
+
chalk27__default.default.level = 0;
|
|
56646
56646
|
}
|
|
56647
56647
|
this.setupCleanupHandlers();
|
|
56648
56648
|
}
|
|
@@ -56759,7 +56759,7 @@ var init_DisplayManager = __esm({
|
|
|
56759
56759
|
const {
|
|
56760
56760
|
padding = 1,
|
|
56761
56761
|
borderStyle = "single",
|
|
56762
|
-
borderColor =
|
|
56762
|
+
borderColor = chalk27__default.default.gray
|
|
56763
56763
|
} = options2;
|
|
56764
56764
|
const lines = content2.split("\n");
|
|
56765
56765
|
const maxLength = Math.max(...lines.map((l) => l.length));
|
|
@@ -56817,7 +56817,7 @@ var init_DisplayManager = __esm({
|
|
|
56817
56817
|
*/
|
|
56818
56818
|
startSpinner(text) {
|
|
56819
56819
|
if (!this.options.enableAnimations) {
|
|
56820
|
-
this.writeLine(
|
|
56820
|
+
this.writeLine(chalk27__default.default.gray(`\u2299 ${text || "Processing..."}`));
|
|
56821
56821
|
return "no-animation";
|
|
56822
56822
|
}
|
|
56823
56823
|
return this.spinnerManager.start({ text });
|
|
@@ -56921,11 +56921,11 @@ var init_StatusDisplay = __esm({
|
|
|
56921
56921
|
*/
|
|
56922
56922
|
static renderSystemStatus(status, detailed = false) {
|
|
56923
56923
|
const lines = [];
|
|
56924
|
-
lines.push(
|
|
56924
|
+
lines.push(chalk27__default.default.cyan.bold("\u{1F4CA} System Status"));
|
|
56925
56925
|
lines.push("");
|
|
56926
56926
|
const statusIcon = status.operational ? "\u2705" : "\u274C";
|
|
56927
56927
|
const statusText = status.operational ? "Operational" : "Issues Detected";
|
|
56928
|
-
const statusColor = status.operational ?
|
|
56928
|
+
const statusColor = status.operational ? chalk27__default.default.green : chalk27__default.default.red;
|
|
56929
56929
|
lines.push(`${statusIcon} Status: ${statusColor(statusText)}`);
|
|
56930
56930
|
lines.push(
|
|
56931
56931
|
`\u23F1\uFE0F Uptime: ${formatDuration(status.uptime * 1e3)}`
|
|
@@ -56946,15 +56946,15 @@ var init_StatusDisplay = __esm({
|
|
|
56946
56946
|
if (status.errors > 0 || status.warnings > 0) {
|
|
56947
56947
|
lines.push("");
|
|
56948
56948
|
if (status.errors > 0) {
|
|
56949
|
-
lines.push(
|
|
56949
|
+
lines.push(chalk27__default.default.red(`\u274C Errors: ${status.errors}`));
|
|
56950
56950
|
}
|
|
56951
56951
|
if (status.warnings > 0) {
|
|
56952
|
-
lines.push(
|
|
56952
|
+
lines.push(chalk27__default.default.yellow(`\u26A0\uFE0F Warnings: ${status.warnings}`));
|
|
56953
56953
|
}
|
|
56954
56954
|
}
|
|
56955
56955
|
if (detailed) {
|
|
56956
56956
|
lines.push("");
|
|
56957
|
-
lines.push(
|
|
56957
|
+
lines.push(chalk27__default.default.gray("Detailed Information:"));
|
|
56958
56958
|
const details = formatKeyValue(
|
|
56959
56959
|
{
|
|
56960
56960
|
"Process ID": process.pid,
|
|
@@ -56964,8 +56964,8 @@ var init_StatusDisplay = __esm({
|
|
|
56964
56964
|
"Working Directory": process.cwd()
|
|
56965
56965
|
},
|
|
56966
56966
|
{
|
|
56967
|
-
keyColor:
|
|
56968
|
-
valueColor:
|
|
56967
|
+
keyColor: chalk27__default.default.gray,
|
|
56968
|
+
valueColor: chalk27__default.default.white
|
|
56969
56969
|
}
|
|
56970
56970
|
);
|
|
56971
56971
|
lines.push(details);
|
|
@@ -56979,9 +56979,9 @@ var init_StatusDisplay = __esm({
|
|
|
56979
56979
|
*/
|
|
56980
56980
|
static renderMemoryStatus(status) {
|
|
56981
56981
|
const lines = [];
|
|
56982
|
-
lines.push(
|
|
56982
|
+
lines.push(chalk27__default.default.cyan.bold("\u{1F9E0} Memory Status"));
|
|
56983
56983
|
lines.push("");
|
|
56984
|
-
lines.push(
|
|
56984
|
+
lines.push(chalk27__default.default.yellow("System 1 (Fast):"));
|
|
56985
56985
|
const s1NodeBar = formatProgressBar(
|
|
56986
56986
|
status.system1.nodes,
|
|
56987
56987
|
status.system1.maxNodes,
|
|
@@ -56999,7 +56999,7 @@ var init_StatusDisplay = __esm({
|
|
|
56999
56999
|
` \u2022 Tokens: ${status.system1.tokens}/${status.system1.maxTokens} ${s1TokenBar}`
|
|
57000
57000
|
);
|
|
57001
57001
|
lines.push("");
|
|
57002
|
-
lines.push(
|
|
57002
|
+
lines.push(chalk27__default.default.blue("System 2 (Deep):"));
|
|
57003
57003
|
const s2TraceBar = formatProgressBar(
|
|
57004
57004
|
status.system2.traces,
|
|
57005
57005
|
status.system2.maxTraces,
|
|
@@ -57017,7 +57017,7 @@ var init_StatusDisplay = __esm({
|
|
|
57017
57017
|
` \u2022 Tokens: ${status.system2.tokens}/${status.system2.maxTokens} ${s2TokenBar}`
|
|
57018
57018
|
);
|
|
57019
57019
|
lines.push("");
|
|
57020
|
-
lines.push(
|
|
57020
|
+
lines.push(chalk27__default.default.green("Total:"));
|
|
57021
57021
|
const totalBar = formatProgressBar(
|
|
57022
57022
|
status.total.tokens,
|
|
57023
57023
|
status.total.maxTokens,
|
|
@@ -57026,7 +57026,7 @@ var init_StatusDisplay = __esm({
|
|
|
57026
57026
|
lines.push(` \u2022 Tokens: ${status.total.tokens}/${status.total.maxTokens}`);
|
|
57027
57027
|
lines.push(` \u2022 Usage: ${totalBar}`);
|
|
57028
57028
|
const usage = status.total.tokens / status.total.maxTokens * 100;
|
|
57029
|
-
const usageColor = usage > 80 ?
|
|
57029
|
+
const usageColor = usage > 80 ? chalk27__default.default.red : usage > 60 ? chalk27__default.default.yellow : chalk27__default.default.green;
|
|
57030
57030
|
lines.push(
|
|
57031
57031
|
` \u2022 ${usageColor(formatPercentage(usage / 100, 1))} utilized`
|
|
57032
57032
|
);
|
|
@@ -57039,9 +57039,9 @@ var init_StatusDisplay = __esm({
|
|
|
57039
57039
|
*/
|
|
57040
57040
|
static renderModelStatus(status) {
|
|
57041
57041
|
const lines = [];
|
|
57042
|
-
lines.push(
|
|
57042
|
+
lines.push(chalk27__default.default.cyan.bold("\u{1F916} Model Status"));
|
|
57043
57043
|
lines.push("");
|
|
57044
|
-
lines.push(
|
|
57044
|
+
lines.push(chalk27__default.default.green(`Current: ${chalk27__default.default.bold(status.current)}`));
|
|
57045
57045
|
lines.push("");
|
|
57046
57046
|
lines.push("Available Models:");
|
|
57047
57047
|
const headers = ["Model", "Provider", "Status", "Capabilities"];
|
|
@@ -57053,7 +57053,7 @@ var init_StatusDisplay = __esm({
|
|
|
57053
57053
|
const table = formatTable(headers, rows, {
|
|
57054
57054
|
columnWidths: [20, 15, 8, 30],
|
|
57055
57055
|
separator: " \u2502 ",
|
|
57056
|
-
headerColor:
|
|
57056
|
+
headerColor: chalk27__default.default.gray
|
|
57057
57057
|
});
|
|
57058
57058
|
lines.push(table);
|
|
57059
57059
|
return lines.join("\n");
|
|
@@ -57065,19 +57065,19 @@ var init_StatusDisplay = __esm({
|
|
|
57065
57065
|
*/
|
|
57066
57066
|
static renderHealthChecks(checks) {
|
|
57067
57067
|
const lines = [];
|
|
57068
|
-
lines.push(
|
|
57068
|
+
lines.push(chalk27__default.default.cyan.bold("\u{1F3E5} Health Checks"));
|
|
57069
57069
|
lines.push("");
|
|
57070
57070
|
for (const check of checks) {
|
|
57071
57071
|
const icon = check.status === "ok" ? "\u2705" : check.status === "warning" ? "\u26A0\uFE0F" : "\u274C";
|
|
57072
|
-
const statusColor = check.status === "ok" ?
|
|
57072
|
+
const statusColor = check.status === "ok" ? chalk27__default.default.green : check.status === "warning" ? chalk27__default.default.yellow : chalk27__default.default.red;
|
|
57073
57073
|
let line = `${icon} ${check.name.padEnd(25)} ${statusColor(check.status.toUpperCase())}`;
|
|
57074
57074
|
if (check.latency !== void 0) {
|
|
57075
|
-
const latencyColor = check.latency < 100 ?
|
|
57075
|
+
const latencyColor = check.latency < 100 ? chalk27__default.default.green : check.latency < 500 ? chalk27__default.default.yellow : chalk27__default.default.red;
|
|
57076
57076
|
line += ` ${latencyColor(`(${check.latency}ms)`)}`;
|
|
57077
57077
|
}
|
|
57078
57078
|
lines.push(line);
|
|
57079
57079
|
if (check.message) {
|
|
57080
|
-
lines.push(
|
|
57080
|
+
lines.push(chalk27__default.default.gray(` ${check.message}`));
|
|
57081
57081
|
}
|
|
57082
57082
|
}
|
|
57083
57083
|
lines.push("");
|
|
@@ -57086,16 +57086,16 @@ var init_StatusDisplay = __esm({
|
|
|
57086
57086
|
const errorCount = checks.filter((c) => c.status === "error").length;
|
|
57087
57087
|
if (errorCount > 0) {
|
|
57088
57088
|
lines.push(
|
|
57089
|
-
|
|
57089
|
+
chalk27__default.default.red(
|
|
57090
57090
|
`\u26A0\uFE0F System has ${errorCount} error(s) - intervention required`
|
|
57091
57091
|
)
|
|
57092
57092
|
);
|
|
57093
57093
|
} else if (warningCount > 0) {
|
|
57094
57094
|
lines.push(
|
|
57095
|
-
|
|
57095
|
+
chalk27__default.default.yellow(`\u26A0\uFE0F System operational with ${warningCount} warning(s)`)
|
|
57096
57096
|
);
|
|
57097
57097
|
} else {
|
|
57098
|
-
lines.push(
|
|
57098
|
+
lines.push(chalk27__default.default.green("\u2705 All systems operational"));
|
|
57099
57099
|
}
|
|
57100
57100
|
return lines.join("\n");
|
|
57101
57101
|
}
|
|
@@ -57106,7 +57106,7 @@ var init_StatusDisplay = __esm({
|
|
|
57106
57106
|
*/
|
|
57107
57107
|
static renderSessionStats(stats) {
|
|
57108
57108
|
const lines = [];
|
|
57109
|
-
lines.push(
|
|
57109
|
+
lines.push(chalk27__default.default.cyan.bold("\u{1F4C8} Session Statistics"));
|
|
57110
57110
|
lines.push("");
|
|
57111
57111
|
const data2 = formatKeyValue(
|
|
57112
57112
|
{
|
|
@@ -57119,14 +57119,14 @@ var init_StatusDisplay = __esm({
|
|
|
57119
57119
|
},
|
|
57120
57120
|
{
|
|
57121
57121
|
keyWidth: 20,
|
|
57122
|
-
keyColor:
|
|
57123
|
-
valueColor:
|
|
57122
|
+
keyColor: chalk27__default.default.gray,
|
|
57123
|
+
valueColor: chalk27__default.default.white
|
|
57124
57124
|
}
|
|
57125
57125
|
);
|
|
57126
57126
|
lines.push(data2);
|
|
57127
57127
|
lines.push("");
|
|
57128
57128
|
const performance3 = stats.avgResponseTime < 100 ? "Excellent" : stats.avgResponseTime < 500 ? "Good" : stats.avgResponseTime < 1e3 ? "Fair" : "Poor";
|
|
57129
|
-
const perfColor = performance3 === "Excellent" ?
|
|
57129
|
+
const perfColor = performance3 === "Excellent" ? chalk27__default.default.green : performance3 === "Good" ? chalk27__default.default.blue : performance3 === "Fair" ? chalk27__default.default.yellow : chalk27__default.default.red;
|
|
57130
57130
|
lines.push(`Performance: ${perfColor(performance3)}`);
|
|
57131
57131
|
return lines.join("\n");
|
|
57132
57132
|
}
|
|
@@ -57138,22 +57138,22 @@ var init_StatusDisplay = __esm({
|
|
|
57138
57138
|
static renderStatusBar(data2) {
|
|
57139
57139
|
const segments = [];
|
|
57140
57140
|
if (data2.mode) {
|
|
57141
|
-
segments.push(
|
|
57141
|
+
segments.push(chalk27__default.default.cyan(`[${data2.mode}]`));
|
|
57142
57142
|
}
|
|
57143
57143
|
if (data2.model) {
|
|
57144
|
-
segments.push(
|
|
57144
|
+
segments.push(chalk27__default.default.blue(`\u{1F916} ${data2.model}`));
|
|
57145
57145
|
}
|
|
57146
57146
|
if (data2.memory !== void 0) {
|
|
57147
|
-
const memoryColor = data2.memory > 80 ?
|
|
57147
|
+
const memoryColor = data2.memory > 80 ? chalk27__default.default.red : data2.memory > 60 ? chalk27__default.default.yellow : chalk27__default.default.green;
|
|
57148
57148
|
segments.push(memoryColor(`\u{1F4BE} ${data2.memory}%`));
|
|
57149
57149
|
}
|
|
57150
57150
|
if (data2.latency !== void 0) {
|
|
57151
|
-
const latencyColor = data2.latency < 100 ?
|
|
57151
|
+
const latencyColor = data2.latency < 100 ? chalk27__default.default.green : data2.latency < 500 ? chalk27__default.default.yellow : chalk27__default.default.red;
|
|
57152
57152
|
segments.push(latencyColor(`\u26A1 ${data2.latency}ms`));
|
|
57153
57153
|
}
|
|
57154
57154
|
if (data2.time) {
|
|
57155
57155
|
segments.push(
|
|
57156
|
-
|
|
57156
|
+
chalk27__default.default.gray(formatTimestamp(data2.time, "short"))
|
|
57157
57157
|
);
|
|
57158
57158
|
}
|
|
57159
57159
|
return segments.join(" \u2502 ");
|
|
@@ -57172,7 +57172,7 @@ var init_CoreHandlers = __esm({
|
|
|
57172
57172
|
async execute(args2) {
|
|
57173
57173
|
const startTime = perf_hooks.performance.now();
|
|
57174
57174
|
const commands = this.registry.getCommands();
|
|
57175
|
-
let message =
|
|
57175
|
+
let message = chalk27__default.default.cyan(`\u{1F916} MARIA v3.5.0 - Available Commands
|
|
57176
57176
|
|
|
57177
57177
|
`);
|
|
57178
57178
|
const categories2 = {
|
|
@@ -57183,17 +57183,17 @@ var init_CoreHandlers = __esm({
|
|
|
57183
57183
|
system: ["/status", "/config", "/logs", "/approve"]
|
|
57184
57184
|
};
|
|
57185
57185
|
for (const [category, cmds] of Object.entries(categories2)) {
|
|
57186
|
-
message +=
|
|
57186
|
+
message += chalk27__default.default.yellow(`
|
|
57187
57187
|
${category.toUpperCase()}:
|
|
57188
57188
|
`);
|
|
57189
57189
|
for (const cmd of cmds) {
|
|
57190
57190
|
if (commands.includes(cmd)) {
|
|
57191
|
-
message += ` ${
|
|
57191
|
+
message += ` ${chalk27__default.default.green(cmd.padEnd(15))} - ${this.getCommandDescription(cmd)}
|
|
57192
57192
|
`;
|
|
57193
57193
|
}
|
|
57194
57194
|
}
|
|
57195
57195
|
}
|
|
57196
|
-
message +=
|
|
57196
|
+
message += chalk27__default.default.gray(
|
|
57197
57197
|
`
|
|
57198
57198
|
Type '/help <command>' for detailed information about a specific command.`
|
|
57199
57199
|
);
|
|
@@ -57241,7 +57241,7 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
57241
57241
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
57242
57242
|
return {
|
|
57243
57243
|
success: true,
|
|
57244
|
-
message:
|
|
57244
|
+
message: chalk27__default.default.gray("Terminal cleared."),
|
|
57245
57245
|
metadata: {
|
|
57246
57246
|
processingTime,
|
|
57247
57247
|
timestamp: /* @__PURE__ */ new Date()
|
|
@@ -57252,7 +57252,7 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
57252
57252
|
ExitHandler = class {
|
|
57253
57253
|
async execute(args2) {
|
|
57254
57254
|
const startTime = perf_hooks.performance.now();
|
|
57255
|
-
const message =
|
|
57255
|
+
const message = chalk27__default.default.yellow("\u{1F44B} Goodbye! Thank you for using MARIA.\n");
|
|
57256
57256
|
process.emit("SIGTERM");
|
|
57257
57257
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
57258
57258
|
return {
|
|
@@ -57276,23 +57276,23 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
57276
57276
|
platform: process.platform,
|
|
57277
57277
|
arch: process.arch
|
|
57278
57278
|
};
|
|
57279
|
-
let message =
|
|
57280
|
-
message +=
|
|
57279
|
+
let message = chalk27__default.default.cyan("\u{1F680} MARIA System Information\n\n");
|
|
57280
|
+
message += chalk27__default.default.white(` Version: ${chalk27__default.default.green(packageInfo.version)}
|
|
57281
57281
|
`);
|
|
57282
|
-
message +=
|
|
57282
|
+
message += chalk27__default.default.white(` Package: ${chalk27__default.default.green(packageInfo.name)}
|
|
57283
57283
|
`);
|
|
57284
|
-
message +=
|
|
57284
|
+
message += chalk27__default.default.white(` Node: ${chalk27__default.default.green(packageInfo.node)}
|
|
57285
57285
|
`);
|
|
57286
|
-
message +=
|
|
57287
|
-
` Platform: ${
|
|
57286
|
+
message += chalk27__default.default.white(
|
|
57287
|
+
` Platform: ${chalk27__default.default.green(packageInfo.platform)}
|
|
57288
57288
|
`
|
|
57289
57289
|
);
|
|
57290
|
-
message +=
|
|
57290
|
+
message += chalk27__default.default.white(` Arch: ${chalk27__default.default.green(packageInfo.arch)}
|
|
57291
57291
|
`);
|
|
57292
|
-
message +=
|
|
57292
|
+
message += chalk27__default.default.gray(`
|
|
57293
57293
|
Build: Production
|
|
57294
57294
|
`);
|
|
57295
|
-
message +=
|
|
57295
|
+
message += chalk27__default.default.gray(` License: MIT
|
|
57296
57296
|
`);
|
|
57297
57297
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
57298
57298
|
return {
|
|
@@ -57317,15 +57317,15 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
57317
57317
|
this.history.push("/history");
|
|
57318
57318
|
}
|
|
57319
57319
|
const recent = this.history.slice(-limit);
|
|
57320
|
-
let message =
|
|
57320
|
+
let message = chalk27__default.default.cyan(`\u{1F4DC} Command History (last ${recent.length}):
|
|
57321
57321
|
|
|
57322
57322
|
`);
|
|
57323
57323
|
recent.forEach((cmd, index2) => {
|
|
57324
57324
|
const num = this.history.length - recent.length + index2 + 1;
|
|
57325
|
-
message +=
|
|
57325
|
+
message += chalk27__default.default.gray(` ${num.toString().padStart(3)}: `) + chalk27__default.default.white(cmd) + "\n";
|
|
57326
57326
|
});
|
|
57327
57327
|
if (recent.length === 0) {
|
|
57328
|
-
message =
|
|
57328
|
+
message = chalk27__default.default.gray("No command history available.");
|
|
57329
57329
|
}
|
|
57330
57330
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
57331
57331
|
return {
|
|
@@ -57371,13 +57371,13 @@ var init_DevHandlers = __esm({
|
|
|
57371
57371
|
if (!prompt) {
|
|
57372
57372
|
return {
|
|
57373
57373
|
ok: false,
|
|
57374
|
-
message:
|
|
57374
|
+
message: chalk27__default.default.red("\u274C Please provide a code generation request.\n") + chalk27__default.default.gray("Usage: /code <description>\n") + chalk27__default.default.gray("Example: /code create a React button component")
|
|
57375
57375
|
};
|
|
57376
57376
|
}
|
|
57377
57377
|
if (signal?.aborted) {
|
|
57378
57378
|
return {
|
|
57379
57379
|
ok: false,
|
|
57380
|
-
message:
|
|
57380
|
+
message: chalk27__default.default.yellow("Code generation canceled")
|
|
57381
57381
|
};
|
|
57382
57382
|
}
|
|
57383
57383
|
try {
|
|
@@ -57388,9 +57388,9 @@ var init_DevHandlers = __esm({
|
|
|
57388
57388
|
if (dryRun) {
|
|
57389
57389
|
return {
|
|
57390
57390
|
ok: true,
|
|
57391
|
-
message:
|
|
57392
|
-
`) +
|
|
57393
|
-
`) +
|
|
57391
|
+
message: chalk27__default.default.cyan("\u{1F50D} Dry run mode - would generate:\n") + chalk27__default.default.gray(`Language: ${language}
|
|
57392
|
+
`) + chalk27__default.default.gray(`Framework: ${framework || "none"}
|
|
57393
|
+
`) + chalk27__default.default.gray(`Prompt: ${cleanPrompt}`)
|
|
57394
57394
|
};
|
|
57395
57395
|
}
|
|
57396
57396
|
const generatedCode = `// Generated code for: ${cleanPrompt}
|
|
@@ -57402,7 +57402,7 @@ function generated() {
|
|
|
57402
57402
|
export { generated };`;
|
|
57403
57403
|
return {
|
|
57404
57404
|
ok: true,
|
|
57405
|
-
message:
|
|
57405
|
+
message: chalk27__default.default.green("\u2705 Code generated successfully:\n\n") + chalk27__default.default.gray("```" + language + "\n") + generatedCode + chalk27__default.default.gray("\n```"),
|
|
57406
57406
|
data: {
|
|
57407
57407
|
code: generatedCode,
|
|
57408
57408
|
language,
|
|
@@ -57415,7 +57415,7 @@ export { generated };`;
|
|
|
57415
57415
|
} catch (error2) {
|
|
57416
57416
|
return {
|
|
57417
57417
|
ok: false,
|
|
57418
|
-
message:
|
|
57418
|
+
message: chalk27__default.default.red(`Code generation failed: ${error2}`)
|
|
57419
57419
|
};
|
|
57420
57420
|
}
|
|
57421
57421
|
}
|
|
@@ -57429,7 +57429,7 @@ export { generated };`;
|
|
|
57429
57429
|
if (signal?.aborted) {
|
|
57430
57430
|
return {
|
|
57431
57431
|
ok: false,
|
|
57432
|
-
message:
|
|
57432
|
+
message: chalk27__default.default.yellow("Test operation canceled")
|
|
57433
57433
|
};
|
|
57434
57434
|
}
|
|
57435
57435
|
const subcommand = args2[0] || "run";
|
|
@@ -57445,8 +57445,8 @@ export { generated };`;
|
|
|
57445
57445
|
default:
|
|
57446
57446
|
return {
|
|
57447
57447
|
ok: false,
|
|
57448
|
-
message:
|
|
57449
|
-
`) +
|
|
57448
|
+
message: chalk27__default.default.red(`Unknown test subcommand: ${subcommand}
|
|
57449
|
+
`) + chalk27__default.default.gray("Available: generate, run, coverage")
|
|
57450
57450
|
};
|
|
57451
57451
|
}
|
|
57452
57452
|
}
|
|
@@ -57454,7 +57454,7 @@ export { generated };`;
|
|
|
57454
57454
|
if (!target) {
|
|
57455
57455
|
return {
|
|
57456
57456
|
ok: false,
|
|
57457
|
-
message:
|
|
57457
|
+
message: chalk27__default.default.red(
|
|
57458
57458
|
"Please specify a file or function to generate tests for"
|
|
57459
57459
|
)
|
|
57460
57460
|
};
|
|
@@ -57471,9 +57471,9 @@ describe("${target}", () => {
|
|
|
57471
57471
|
});`;
|
|
57472
57472
|
return {
|
|
57473
57473
|
ok: true,
|
|
57474
|
-
message:
|
|
57474
|
+
message: chalk27__default.default.green(`\u2705 Tests generated for ${target}:
|
|
57475
57475
|
|
|
57476
|
-
`) +
|
|
57476
|
+
`) + chalk27__default.default.gray("```typescript\n") + testCode + chalk27__default.default.gray("\n```"),
|
|
57477
57477
|
data: { testCode, framework, target }
|
|
57478
57478
|
};
|
|
57479
57479
|
}
|
|
@@ -57486,23 +57486,23 @@ describe("${target}", () => {
|
|
|
57486
57486
|
if (coverage) command += " --coverage";
|
|
57487
57487
|
return {
|
|
57488
57488
|
ok: true,
|
|
57489
|
-
message:
|
|
57490
|
-
`) +
|
|
57489
|
+
message: chalk27__default.default.cyan(`\u{1F9EA} Running tests...
|
|
57490
|
+
`) + chalk27__default.default.gray(`Command: ${command}
|
|
57491
57491
|
|
|
57492
|
-
`) +
|
|
57492
|
+
`) + chalk27__default.default.green("\u2705 All tests passed!"),
|
|
57493
57493
|
data: { command, passed: true }
|
|
57494
57494
|
};
|
|
57495
57495
|
}
|
|
57496
57496
|
async showCoverage(options2) {
|
|
57497
57497
|
return {
|
|
57498
57498
|
ok: true,
|
|
57499
|
-
message:
|
|
57499
|
+
message: chalk27__default.default.cyan("\u{1F4CA} Test Coverage Report:\n\n") + chalk27__default.default.gray("File".padEnd(40) + "% Stmts".padEnd(10) + "% Lines\n") + chalk27__default.default.gray("-".repeat(60) + "\n") + chalk27__default.default.green(
|
|
57500
57500
|
"SessionStateMachine.ts".padEnd(40) + "100.00".padEnd(10) + "100.00\n"
|
|
57501
|
-
) +
|
|
57501
|
+
) + chalk27__default.default.green(
|
|
57502
57502
|
"InputController.ts".padEnd(40) + "95.50".padEnd(10) + "94.20\n"
|
|
57503
|
-
) +
|
|
57503
|
+
) + chalk27__default.default.yellow(
|
|
57504
57504
|
"SessionManager.ts".padEnd(40) + "78.30".padEnd(10) + "76.50\n"
|
|
57505
|
-
) +
|
|
57505
|
+
) + chalk27__default.default.gray("-".repeat(60) + "\n") + chalk27__default.default.cyan("Total".padEnd(40) + "85.60".padEnd(10) + "84.30")
|
|
57506
57506
|
};
|
|
57507
57507
|
}
|
|
57508
57508
|
};
|
|
@@ -57516,33 +57516,33 @@ describe("${target}", () => {
|
|
|
57516
57516
|
if (!file) {
|
|
57517
57517
|
return {
|
|
57518
57518
|
ok: false,
|
|
57519
|
-
message:
|
|
57519
|
+
message: chalk27__default.default.red("Please specify a file to review\n") + chalk27__default.default.gray("Usage: /review <file> [--security] [--performance]")
|
|
57520
57520
|
};
|
|
57521
57521
|
}
|
|
57522
57522
|
const checkSecurity = args2.includes("--security");
|
|
57523
57523
|
const checkPerformance = args2.includes("--performance");
|
|
57524
|
-
let message =
|
|
57524
|
+
let message = chalk27__default.default.cyan(`\u{1F50D} Code Review for ${file}
|
|
57525
57525
|
|
|
57526
57526
|
`);
|
|
57527
|
-
message +=
|
|
57528
|
-
message +=
|
|
57529
|
-
message +=
|
|
57530
|
-
message +=
|
|
57527
|
+
message += chalk27__default.default.yellow("\u26A0\uFE0F Issues Found (3):\n");
|
|
57528
|
+
message += chalk27__default.default.gray(" 1. Line 42: ") + chalk27__default.default.yellow("Missing error handling in async function\n");
|
|
57529
|
+
message += chalk27__default.default.gray(" 2. Line 89: ") + chalk27__default.default.yellow("Potential memory leak - event listener not removed\n");
|
|
57530
|
+
message += chalk27__default.default.gray(" 3. Line 156: ") + chalk27__default.default.yellow(
|
|
57531
57531
|
"Complex function - consider refactoring (cyclomatic complexity: 12)\n\n"
|
|
57532
57532
|
);
|
|
57533
57533
|
if (checkSecurity) {
|
|
57534
|
-
message +=
|
|
57535
|
-
message +=
|
|
57534
|
+
message += chalk27__default.default.red("\u{1F512} Security Issues (1):\n");
|
|
57535
|
+
message += chalk27__default.default.gray(" 1. Line 67: ") + chalk27__default.default.red("Potential XSS vulnerability - user input not sanitized\n\n");
|
|
57536
57536
|
}
|
|
57537
57537
|
if (checkPerformance) {
|
|
57538
|
-
message +=
|
|
57539
|
-
message +=
|
|
57540
|
-
message +=
|
|
57541
|
-
}
|
|
57542
|
-
message +=
|
|
57543
|
-
message +=
|
|
57544
|
-
message +=
|
|
57545
|
-
message +=
|
|
57538
|
+
message += chalk27__default.default.blue("\u26A1 Performance Suggestions (2):\n");
|
|
57539
|
+
message += chalk27__default.default.gray(" 1. Line 23: ") + chalk27__default.default.blue("Consider memoization for expensive calculation\n");
|
|
57540
|
+
message += chalk27__default.default.gray(" 2. Line 145: ") + chalk27__default.default.blue("Use virtualization for large list rendering\n\n");
|
|
57541
|
+
}
|
|
57542
|
+
message += chalk27__default.default.green("\u2705 Positive Findings:\n");
|
|
57543
|
+
message += chalk27__default.default.gray(" \u2022 Good TypeScript type coverage (92%)\n");
|
|
57544
|
+
message += chalk27__default.default.gray(" \u2022 Consistent code style\n");
|
|
57545
|
+
message += chalk27__default.default.gray(" \u2022 Well-documented functions\n");
|
|
57546
57546
|
return {
|
|
57547
57547
|
ok: true,
|
|
57548
57548
|
message,
|
|
@@ -57572,8 +57572,8 @@ describe("${target}", () => {
|
|
|
57572
57572
|
default:
|
|
57573
57573
|
return {
|
|
57574
57574
|
ok: false,
|
|
57575
|
-
message:
|
|
57576
|
-
`) +
|
|
57575
|
+
message: chalk27__default.default.red(`Unknown bug subcommand: ${subcommand}
|
|
57576
|
+
`) + chalk27__default.default.gray("Available: report, list, analyze")
|
|
57577
57577
|
};
|
|
57578
57578
|
}
|
|
57579
57579
|
}
|
|
@@ -57582,18 +57582,18 @@ describe("${target}", () => {
|
|
|
57582
57582
|
if (!description) {
|
|
57583
57583
|
return {
|
|
57584
57584
|
ok: false,
|
|
57585
|
-
message:
|
|
57585
|
+
message: chalk27__default.default.red("Please provide a bug description")
|
|
57586
57586
|
};
|
|
57587
57587
|
}
|
|
57588
57588
|
const bugId = `BUG-${Date.now().toString(36).toUpperCase()}`;
|
|
57589
57589
|
return {
|
|
57590
57590
|
ok: true,
|
|
57591
|
-
message:
|
|
57591
|
+
message: chalk27__default.default.green(`\u{1F41B} Bug reported successfully!
|
|
57592
57592
|
|
|
57593
|
-
`) +
|
|
57594
|
-
`) +
|
|
57595
|
-
`) +
|
|
57596
|
-
`) +
|
|
57593
|
+
`) + chalk27__default.default.cyan(`Bug ID: ${bugId}
|
|
57594
|
+
`) + chalk27__default.default.gray(`Description: ${description}
|
|
57595
|
+
`) + chalk27__default.default.gray(`Status: Open
|
|
57596
|
+
`) + chalk27__default.default.gray(`Priority: To be determined
|
|
57597
57597
|
`),
|
|
57598
57598
|
data: { bugId, description, status: "open" }
|
|
57599
57599
|
};
|
|
@@ -57601,23 +57601,23 @@ describe("${target}", () => {
|
|
|
57601
57601
|
async listBugs() {
|
|
57602
57602
|
return {
|
|
57603
57603
|
ok: true,
|
|
57604
|
-
message:
|
|
57604
|
+
message: chalk27__default.default.cyan("\u{1F41B} Active Bugs:\n\n") + chalk27__default.default.yellow("1. BUG-A1B2C3: ") + chalk27__default.default.gray("Session timeout not handled properly\n") + chalk27__default.default.yellow("2. BUG-D4E5F6: ") + chalk27__default.default.gray("Memory leak in streaming responses\n") + chalk27__default.default.yellow("3. BUG-G7H8I9: ") + chalk27__default.default.gray("Spinner not stopping on error\n\n") + chalk27__default.default.gray("Total: 3 open bugs")
|
|
57605
57605
|
};
|
|
57606
57606
|
}
|
|
57607
57607
|
async analyzeBug(bugId) {
|
|
57608
57608
|
if (!bugId) {
|
|
57609
57609
|
return {
|
|
57610
57610
|
ok: false,
|
|
57611
|
-
message:
|
|
57611
|
+
message: chalk27__default.default.red("Please provide a bug ID to analyze")
|
|
57612
57612
|
};
|
|
57613
57613
|
}
|
|
57614
57614
|
return {
|
|
57615
57615
|
ok: true,
|
|
57616
|
-
message:
|
|
57616
|
+
message: chalk27__default.default.cyan(`\u{1F50D} Bug Analysis for ${bugId}:
|
|
57617
57617
|
|
|
57618
|
-
`) +
|
|
57618
|
+
`) + chalk27__default.default.yellow("Summary: ") + chalk27__default.default.gray("Session timeout not handled properly\n") + chalk27__default.default.yellow("Severity: ") + chalk27__default.default.orange("Medium\n") + chalk27__default.default.yellow("Component: ") + chalk27__default.default.gray("SessionManager\n") + chalk27__default.default.yellow("Reported: ") + chalk27__default.default.gray("2 days ago\n\n") + chalk27__default.default.cyan("Possible Causes:\n") + chalk27__default.default.gray(
|
|
57619
57619
|
" 1. AbortSignal not propagated to all async operations\n"
|
|
57620
|
-
) +
|
|
57620
|
+
) + chalk27__default.default.gray(" 2. Deadline timer not cleared on completion\n") + chalk27__default.default.gray(" 3. Race condition in state transitions\n\n") + chalk27__default.default.green("Suggested Fix:\n") + chalk27__default.default.gray(" Ensure all async operations respect the AbortSignal\n") + chalk27__default.default.gray(" Add finally block to clear timers\n")
|
|
57621
57621
|
};
|
|
57622
57622
|
}
|
|
57623
57623
|
};
|
|
@@ -57641,7 +57641,7 @@ var init_SystemHandlers = __esm({
|
|
|
57641
57641
|
if (signal?.aborted) {
|
|
57642
57642
|
return {
|
|
57643
57643
|
ok: false,
|
|
57644
|
-
message:
|
|
57644
|
+
message: chalk27__default.default.yellow("Status check canceled")
|
|
57645
57645
|
};
|
|
57646
57646
|
}
|
|
57647
57647
|
const verbose = args2.includes("--verbose") || args2.includes("-v");
|
|
@@ -57652,44 +57652,44 @@ var init_SystemHandlers = __esm({
|
|
|
57652
57652
|
cpu: os13__namespace.cpus()[0],
|
|
57653
57653
|
platform: process.platform
|
|
57654
57654
|
};
|
|
57655
|
-
let message =
|
|
57656
|
-
message +=
|
|
57657
|
-
message +=
|
|
57655
|
+
let message = chalk27__default.default.cyan.bold("\u{1F4CA} System Status\n\n");
|
|
57656
|
+
message += chalk27__default.default.green("\u2705 System: Operational\n");
|
|
57657
|
+
message += chalk27__default.default.gray(
|
|
57658
57658
|
`\u23F1\uFE0F Uptime: ${Math.floor(status.uptime / 60)}m ${Math.floor(status.uptime % 60)}s
|
|
57659
57659
|
`
|
|
57660
57660
|
);
|
|
57661
|
-
message +=
|
|
57661
|
+
message += chalk27__default.default.gray(
|
|
57662
57662
|
`\u{1F4BE} Memory: ${Math.round(status.memory.heapUsed / 1024 / 1024)}MB / ${Math.round(status.memory.heapTotal / 1024 / 1024)}MB
|
|
57663
57663
|
`
|
|
57664
57664
|
);
|
|
57665
57665
|
if (verbose) {
|
|
57666
|
-
message +=
|
|
57667
|
-
message +=
|
|
57666
|
+
message += chalk27__default.default.gray("\nDetailed Information:\n");
|
|
57667
|
+
message += chalk27__default.default.gray(` \u2022 CPU: ${status.cpu.model}
|
|
57668
57668
|
`);
|
|
57669
|
-
message +=
|
|
57669
|
+
message += chalk27__default.default.gray(
|
|
57670
57670
|
` \u2022 Platform: ${status.platform} (${os13__namespace.arch()})
|
|
57671
57671
|
`
|
|
57672
57672
|
);
|
|
57673
|
-
message +=
|
|
57673
|
+
message += chalk27__default.default.gray(` \u2022 Node.js: ${process.version}
|
|
57674
57674
|
`);
|
|
57675
|
-
message +=
|
|
57675
|
+
message += chalk27__default.default.gray(` \u2022 Process ID: ${process.pid}
|
|
57676
57676
|
`);
|
|
57677
|
-
message +=
|
|
57677
|
+
message += chalk27__default.default.gray(` \u2022 Working Directory: ${process.cwd()}
|
|
57678
57678
|
`);
|
|
57679
|
-
message +=
|
|
57680
|
-
message +=
|
|
57679
|
+
message += chalk27__default.default.gray("\nMemory Details:\n");
|
|
57680
|
+
message += chalk27__default.default.gray(
|
|
57681
57681
|
` \u2022 RSS: ${Math.round(status.memory.rss / 1024 / 1024)}MB
|
|
57682
57682
|
`
|
|
57683
57683
|
);
|
|
57684
|
-
message +=
|
|
57684
|
+
message += chalk27__default.default.gray(
|
|
57685
57685
|
` \u2022 Heap Used: ${Math.round(status.memory.heapUsed / 1024 / 1024)}MB
|
|
57686
57686
|
`
|
|
57687
57687
|
);
|
|
57688
|
-
message +=
|
|
57688
|
+
message += chalk27__default.default.gray(
|
|
57689
57689
|
` \u2022 Heap Total: ${Math.round(status.memory.heapTotal / 1024 / 1024)}MB
|
|
57690
57690
|
`
|
|
57691
57691
|
);
|
|
57692
|
-
message +=
|
|
57692
|
+
message += chalk27__default.default.gray(
|
|
57693
57693
|
` \u2022 External: ${Math.round(status.memory.external / 1024 / 1024)}MB
|
|
57694
57694
|
`
|
|
57695
57695
|
);
|
|
@@ -57718,7 +57718,7 @@ var init_SystemHandlers = __esm({
|
|
|
57718
57718
|
if (signal?.aborted) {
|
|
57719
57719
|
return {
|
|
57720
57720
|
ok: false,
|
|
57721
|
-
message:
|
|
57721
|
+
message: chalk27__default.default.yellow("Model operation canceled")
|
|
57722
57722
|
};
|
|
57723
57723
|
}
|
|
57724
57724
|
if (args2.length === 0) {
|
|
@@ -57738,17 +57738,17 @@ var init_SystemHandlers = __esm({
|
|
|
57738
57738
|
}
|
|
57739
57739
|
}
|
|
57740
57740
|
async listModels() {
|
|
57741
|
-
let message =
|
|
57742
|
-
message +=
|
|
57741
|
+
let message = chalk27__default.default.cyan.bold("\u{1F916} Available Models\n\n");
|
|
57742
|
+
message += chalk27__default.default.green(`Current: ${this.currentModel}
|
|
57743
57743
|
|
|
57744
57744
|
`);
|
|
57745
57745
|
for (const model of this.availableModels) {
|
|
57746
|
-
const status = model.available ?
|
|
57747
|
-
const name2 = model.id === this.currentModel ?
|
|
57748
|
-
message += `${status} ${name2.padEnd(20)} ${
|
|
57746
|
+
const status = model.available ? chalk27__default.default.green("\u2705") : chalk27__default.default.red("\u274C");
|
|
57747
|
+
const name2 = model.id === this.currentModel ? chalk27__default.default.green.bold(model.id) : chalk27__default.default.cyan(model.id);
|
|
57748
|
+
message += `${status} ${name2.padEnd(20)} ${chalk27__default.default.gray(`[${model.provider}]`)}
|
|
57749
57749
|
`;
|
|
57750
57750
|
}
|
|
57751
|
-
message +=
|
|
57751
|
+
message += chalk27__default.default.gray("\nUse /model <name> to switch models");
|
|
57752
57752
|
return {
|
|
57753
57753
|
ok: true,
|
|
57754
57754
|
message,
|
|
@@ -57759,27 +57759,27 @@ var init_SystemHandlers = __esm({
|
|
|
57759
57759
|
if (!modelId) {
|
|
57760
57760
|
return {
|
|
57761
57761
|
ok: false,
|
|
57762
|
-
message:
|
|
57762
|
+
message: chalk27__default.default.red("Please specify a model to switch to")
|
|
57763
57763
|
};
|
|
57764
57764
|
}
|
|
57765
57765
|
const model = this.availableModels.find((m2) => m2.id === modelId);
|
|
57766
57766
|
if (!model) {
|
|
57767
57767
|
return {
|
|
57768
57768
|
ok: false,
|
|
57769
|
-
message:
|
|
57770
|
-
`) +
|
|
57769
|
+
message: chalk27__default.default.red(`Unknown model: ${modelId}
|
|
57770
|
+
`) + chalk27__default.default.gray("Use /model list to see available models")
|
|
57771
57771
|
};
|
|
57772
57772
|
}
|
|
57773
57773
|
if (!model.available) {
|
|
57774
57774
|
return {
|
|
57775
57775
|
ok: false,
|
|
57776
|
-
message:
|
|
57776
|
+
message: chalk27__default.default.yellow(`Model ${modelId} is not currently available`)
|
|
57777
57777
|
};
|
|
57778
57778
|
}
|
|
57779
57779
|
this.currentModel = modelId;
|
|
57780
57780
|
return {
|
|
57781
57781
|
ok: true,
|
|
57782
|
-
message:
|
|
57782
|
+
message: chalk27__default.default.green(`\u2705 Switched to ${modelId}`),
|
|
57783
57783
|
data: { model: modelId }
|
|
57784
57784
|
};
|
|
57785
57785
|
}
|
|
@@ -57788,27 +57788,27 @@ var init_SystemHandlers = __esm({
|
|
|
57788
57788
|
if (!model) {
|
|
57789
57789
|
return {
|
|
57790
57790
|
ok: false,
|
|
57791
|
-
message:
|
|
57791
|
+
message: chalk27__default.default.red(`Unknown model: ${modelId}`)
|
|
57792
57792
|
};
|
|
57793
57793
|
}
|
|
57794
|
-
let message =
|
|
57794
|
+
let message = chalk27__default.default.cyan(`\u{1F4CB} Model Information: ${modelId}
|
|
57795
57795
|
|
|
57796
57796
|
`);
|
|
57797
|
-
message +=
|
|
57797
|
+
message += chalk27__default.default.gray(`Provider: ${model.provider}
|
|
57798
57798
|
`);
|
|
57799
|
-
message +=
|
|
57799
|
+
message += chalk27__default.default.gray(
|
|
57800
57800
|
`Status: ${model.available ? "Available" : "Unavailable"}
|
|
57801
57801
|
`
|
|
57802
57802
|
);
|
|
57803
|
-
message +=
|
|
57803
|
+
message += chalk27__default.default.gray(
|
|
57804
57804
|
`Current: ${model.id === this.currentModel ? "Yes" : "No"}
|
|
57805
57805
|
`
|
|
57806
57806
|
);
|
|
57807
|
-
message +=
|
|
57808
|
-
message +=
|
|
57809
|
-
message +=
|
|
57810
|
-
message +=
|
|
57811
|
-
message +=
|
|
57807
|
+
message += chalk27__default.default.gray("\nCapabilities:\n");
|
|
57808
|
+
message += chalk27__default.default.gray(" \u2022 Context: 128K tokens\n");
|
|
57809
|
+
message += chalk27__default.default.gray(" \u2022 Languages: 95+\n");
|
|
57810
|
+
message += chalk27__default.default.gray(" \u2022 Code: Yes\n");
|
|
57811
|
+
message += chalk27__default.default.gray(" \u2022 Vision: ") + (modelId.includes("gpt-4") ? "Yes\n" : "No\n");
|
|
57812
57812
|
return {
|
|
57813
57813
|
ok: true,
|
|
57814
57814
|
message,
|
|
@@ -57840,39 +57840,39 @@ var init_SystemHandlers = __esm({
|
|
|
57840
57840
|
default:
|
|
57841
57841
|
return {
|
|
57842
57842
|
ok: false,
|
|
57843
|
-
message:
|
|
57844
|
-
`) +
|
|
57843
|
+
message: chalk27__default.default.red(`Unknown memory subcommand: ${subcommand}
|
|
57844
|
+
`) + chalk27__default.default.gray("Available: status, clear, export, compact")
|
|
57845
57845
|
};
|
|
57846
57846
|
}
|
|
57847
57847
|
}
|
|
57848
57848
|
async showStatus() {
|
|
57849
|
-
let message =
|
|
57850
|
-
message +=
|
|
57851
|
-
message +=
|
|
57849
|
+
let message = chalk27__default.default.cyan.bold("\u{1F9E0} Memory Status\n\n");
|
|
57850
|
+
message += chalk27__default.default.yellow("System 1 (Fast):\n");
|
|
57851
|
+
message += chalk27__default.default.gray(
|
|
57852
57852
|
` \u2022 Knowledge Nodes: ${this.memoryStats.system1.nodes}
|
|
57853
57853
|
`
|
|
57854
57854
|
);
|
|
57855
|
-
message +=
|
|
57855
|
+
message += chalk27__default.default.gray(` \u2022 Tokens: ${this.memoryStats.system1.tokens}
|
|
57856
57856
|
|
|
57857
57857
|
`);
|
|
57858
|
-
message +=
|
|
57859
|
-
message +=
|
|
57858
|
+
message += chalk27__default.default.blue("System 2 (Deep):\n");
|
|
57859
|
+
message += chalk27__default.default.gray(
|
|
57860
57860
|
` \u2022 Reasoning Traces: ${this.memoryStats.system2.traces}
|
|
57861
57861
|
`
|
|
57862
57862
|
);
|
|
57863
|
-
message +=
|
|
57863
|
+
message += chalk27__default.default.gray(` \u2022 Tokens: ${this.memoryStats.system2.tokens}
|
|
57864
57864
|
|
|
57865
57865
|
`);
|
|
57866
|
-
message +=
|
|
57867
|
-
message +=
|
|
57866
|
+
message += chalk27__default.default.green("Total:\n");
|
|
57867
|
+
message += chalk27__default.default.gray(` \u2022 Entries: ${this.memoryStats.total.entries}
|
|
57868
57868
|
`);
|
|
57869
|
-
message +=
|
|
57869
|
+
message += chalk27__default.default.gray(
|
|
57870
57870
|
` \u2022 Tokens: ${this.memoryStats.total.tokens} / 128000
|
|
57871
57871
|
`
|
|
57872
57872
|
);
|
|
57873
57873
|
const usage = Math.round(this.memoryStats.total.tokens / 128e3 * 100);
|
|
57874
57874
|
const bar = "\u2588".repeat(Math.floor(usage / 5)) + "\u2591".repeat(20 - Math.floor(usage / 5));
|
|
57875
|
-
message +=
|
|
57875
|
+
message += chalk27__default.default.gray(` \u2022 Usage: [${bar}] ${usage}%
|
|
57876
57876
|
`);
|
|
57877
57877
|
return {
|
|
57878
57878
|
ok: true,
|
|
@@ -57886,14 +57886,14 @@ var init_SystemHandlers = __esm({
|
|
|
57886
57886
|
this.memoryStats.system1 = { nodes: 0, tokens: 0 };
|
|
57887
57887
|
return {
|
|
57888
57888
|
ok: true,
|
|
57889
|
-
message:
|
|
57889
|
+
message: chalk27__default.default.green("\u2705 System 1 memory cleared")
|
|
57890
57890
|
};
|
|
57891
57891
|
}
|
|
57892
57892
|
if (system === "system2") {
|
|
57893
57893
|
this.memoryStats.system2 = { traces: 0, tokens: 0 };
|
|
57894
57894
|
return {
|
|
57895
57895
|
ok: true,
|
|
57896
|
-
message:
|
|
57896
|
+
message: chalk27__default.default.green("\u2705 System 2 memory cleared")
|
|
57897
57897
|
};
|
|
57898
57898
|
}
|
|
57899
57899
|
this.memoryStats = {
|
|
@@ -57903,15 +57903,15 @@ var init_SystemHandlers = __esm({
|
|
|
57903
57903
|
};
|
|
57904
57904
|
return {
|
|
57905
57905
|
ok: true,
|
|
57906
|
-
message:
|
|
57906
|
+
message: chalk27__default.default.green("\u{1F9F9} All memory cleared")
|
|
57907
57907
|
};
|
|
57908
57908
|
}
|
|
57909
57909
|
async exportMemory() {
|
|
57910
57910
|
const filename = `memory-export-${Date.now()}.json`;
|
|
57911
57911
|
return {
|
|
57912
57912
|
ok: true,
|
|
57913
|
-
message:
|
|
57914
|
-
`) +
|
|
57913
|
+
message: chalk27__default.default.green(`\u{1F4E6} Memory exported to ${filename}
|
|
57914
|
+
`) + chalk27__default.default.gray(
|
|
57915
57915
|
`Size: ${Math.round(JSON.stringify(this.memoryStats).length / 1024)}KB`
|
|
57916
57916
|
),
|
|
57917
57917
|
data: { filename, stats: this.memoryStats }
|
|
@@ -57929,9 +57929,9 @@ var init_SystemHandlers = __esm({
|
|
|
57929
57929
|
);
|
|
57930
57930
|
return {
|
|
57931
57931
|
ok: true,
|
|
57932
|
-
message:
|
|
57933
|
-
`) +
|
|
57934
|
-
`) +
|
|
57932
|
+
message: chalk27__default.default.green("\u2728 Memory compacted successfully\n") + chalk27__default.default.gray(`Before: ${before} tokens
|
|
57933
|
+
`) + chalk27__default.default.gray(`After: ${after} tokens
|
|
57934
|
+
`) + chalk27__default.default.gray(
|
|
57935
57935
|
`Saved: ${before - after} tokens (${Math.round((1 - after / before) * 100)}%)`
|
|
57936
57936
|
),
|
|
57937
57937
|
data: { before, after, saved: before - after }
|
|
@@ -57947,11 +57947,11 @@ var init_SystemHandlers = __esm({
|
|
|
57947
57947
|
if (signal?.aborted) {
|
|
57948
57948
|
return {
|
|
57949
57949
|
ok: false,
|
|
57950
|
-
message:
|
|
57950
|
+
message: chalk27__default.default.yellow("Health check canceled")
|
|
57951
57951
|
};
|
|
57952
57952
|
}
|
|
57953
57953
|
const detailed = args2.includes("--detailed");
|
|
57954
|
-
let message =
|
|
57954
|
+
let message = chalk27__default.default.cyan.bold("\u{1F3E5} System Health Check\n\n");
|
|
57955
57955
|
const checks = [
|
|
57956
57956
|
{ name: "Core Services", status: "ok", latency: 12 },
|
|
57957
57957
|
{ name: "Memory System", status: "ok", latency: 8 },
|
|
@@ -57960,11 +57960,11 @@ var init_SystemHandlers = __esm({
|
|
|
57960
57960
|
{ name: "Network", status: "warning", latency: 250 }
|
|
57961
57961
|
];
|
|
57962
57962
|
for (const check of checks) {
|
|
57963
|
-
const icon = check.status === "ok" ?
|
|
57964
|
-
const status = check.status === "ok" ?
|
|
57963
|
+
const icon = check.status === "ok" ? chalk27__default.default.green("\u2705") : check.status === "warning" ? chalk27__default.default.yellow("\u26A0\uFE0F") : chalk27__default.default.red("\u274C");
|
|
57964
|
+
const status = check.status === "ok" ? chalk27__default.default.green("OK") : check.status === "warning" ? chalk27__default.default.yellow("WARNING") : chalk27__default.default.red("ERROR");
|
|
57965
57965
|
message += `${icon} ${check.name.padEnd(20)} ${status}`;
|
|
57966
57966
|
if (detailed) {
|
|
57967
|
-
message +=
|
|
57967
|
+
message += chalk27__default.default.gray(` (${check.latency}ms)`);
|
|
57968
57968
|
}
|
|
57969
57969
|
message += "\n";
|
|
57970
57970
|
}
|
|
@@ -57972,11 +57972,11 @@ var init_SystemHandlers = __esm({
|
|
|
57972
57972
|
const hasErrors = checks.some((c) => c.status === "error");
|
|
57973
57973
|
message += "\n";
|
|
57974
57974
|
if (hasErrors) {
|
|
57975
|
-
message +=
|
|
57975
|
+
message += chalk27__default.default.red("\u26A0\uFE0F System has errors - intervention required");
|
|
57976
57976
|
} else if (hasWarnings) {
|
|
57977
|
-
message +=
|
|
57977
|
+
message += chalk27__default.default.yellow("\u26A0\uFE0F System operational with warnings");
|
|
57978
57978
|
} else {
|
|
57979
|
-
message +=
|
|
57979
|
+
message += chalk27__default.default.green("\u2705 All systems operational");
|
|
57980
57980
|
}
|
|
57981
57981
|
return {
|
|
57982
57982
|
ok: true,
|
|
@@ -57994,12 +57994,12 @@ var init_SystemHandlers = __esm({
|
|
|
57994
57994
|
if (signal?.aborted) {
|
|
57995
57995
|
return {
|
|
57996
57996
|
ok: false,
|
|
57997
|
-
message:
|
|
57997
|
+
message: chalk27__default.default.yellow("Doctor check canceled")
|
|
57998
57998
|
};
|
|
57999
57999
|
}
|
|
58000
58000
|
const autoFix = args2.includes("--fix");
|
|
58001
|
-
let message =
|
|
58002
|
-
message +=
|
|
58001
|
+
let message = chalk27__default.default.cyan.bold("\u{1F468}\u2695\uFE0F System Doctor\n\n");
|
|
58002
|
+
message += chalk27__default.default.gray("Running diagnostics...\n\n");
|
|
58003
58003
|
const issues = [
|
|
58004
58004
|
{
|
|
58005
58005
|
severity: "warning",
|
|
@@ -58021,20 +58021,20 @@ var init_SystemHandlers = __esm({
|
|
|
58021
58021
|
}
|
|
58022
58022
|
];
|
|
58023
58023
|
if (issues.length === 0) {
|
|
58024
|
-
message +=
|
|
58024
|
+
message += chalk27__default.default.green("\u2705 No issues found - system is healthy!");
|
|
58025
58025
|
return { ok: true, message };
|
|
58026
58026
|
}
|
|
58027
|
-
message +=
|
|
58027
|
+
message += chalk27__default.default.yellow(`Found ${issues.length} issue(s):
|
|
58028
58028
|
|
|
58029
58029
|
`);
|
|
58030
58030
|
for (const issue of issues) {
|
|
58031
|
-
const icon = issue.severity === "error" ?
|
|
58031
|
+
const icon = issue.severity === "error" ? chalk27__default.default.red("\u274C") : issue.severity === "warning" ? chalk27__default.default.yellow("\u26A0\uFE0F") : chalk27__default.default.blue("\u2139\uFE0F");
|
|
58032
58032
|
message += `${icon} ${issue.issue}
|
|
58033
58033
|
`;
|
|
58034
|
-
message +=
|
|
58034
|
+
message += chalk27__default.default.gray(` Solution: ${issue.solution}
|
|
58035
58035
|
`);
|
|
58036
58036
|
if (autoFix && issue.fixable) {
|
|
58037
|
-
message +=
|
|
58037
|
+
message += chalk27__default.default.green(` \u2705 Auto-fixed
|
|
58038
58038
|
`);
|
|
58039
58039
|
}
|
|
58040
58040
|
message += "\n";
|
|
@@ -58042,7 +58042,7 @@ var init_SystemHandlers = __esm({
|
|
|
58042
58042
|
if (!autoFix) {
|
|
58043
58043
|
const fixableCount = issues.filter((i2) => i2.fixable).length;
|
|
58044
58044
|
if (fixableCount > 0) {
|
|
58045
|
-
message +=
|
|
58045
|
+
message += chalk27__default.default.gray(
|
|
58046
58046
|
`
|
|
58047
58047
|
Run /doctor --fix to automatically fix ${fixableCount} issue(s)`
|
|
58048
58048
|
);
|
|
@@ -58505,14 +58505,14 @@ function createCLI() {
|
|
|
58505
58505
|
}
|
|
58506
58506
|
});
|
|
58507
58507
|
program2.command("setup-ollama").description("Setup Ollama for local AI").action(async () => {
|
|
58508
|
-
console.log(
|
|
58508
|
+
console.log(chalk27__default.default.cyan("Setting up Ollama..."));
|
|
58509
58509
|
console.log(
|
|
58510
|
-
|
|
58510
|
+
chalk27__default.default.yellow("Please run: brew install ollama && ollama serve")
|
|
58511
58511
|
);
|
|
58512
58512
|
});
|
|
58513
58513
|
program2.command("setup-vllm").description("Setup vLLM for local AI").action(async () => {
|
|
58514
|
-
console.log(
|
|
58515
|
-
console.log(
|
|
58514
|
+
console.log(chalk27__default.default.cyan("Setting up vLLM..."));
|
|
58515
|
+
console.log(chalk27__default.default.yellow("Please run: pip install vllm"));
|
|
58516
58516
|
});
|
|
58517
58517
|
return program2;
|
|
58518
58518
|
}
|
|
@@ -58540,13 +58540,13 @@ var init_maria_ai = __esm({
|
|
|
58540
58540
|
await this.providerSelector.initialize();
|
|
58541
58541
|
const { provider, model } = await this.providerSelector.selectProvider();
|
|
58542
58542
|
console.log(
|
|
58543
|
-
|
|
58543
|
+
chalk27__default.default.green(`
|
|
58544
58544
|
\u2705 Selected: ${provider} with model ${model}`)
|
|
58545
58545
|
);
|
|
58546
58546
|
this.config.set("currentProvider", provider);
|
|
58547
58547
|
this.config.set("currentModel", model);
|
|
58548
58548
|
await this.config.save();
|
|
58549
|
-
console.log(
|
|
58549
|
+
console.log(chalk27__default.default.cyan("\n\u{1F9E0} Initializing Intelligent Router..."));
|
|
58550
58550
|
this.router = new IntelligentRouterService({
|
|
58551
58551
|
confidenceThreshold: 0.85,
|
|
58552
58552
|
enableLearning: true,
|
|
@@ -58554,12 +58554,12 @@ var init_maria_ai = __esm({
|
|
|
58554
58554
|
});
|
|
58555
58555
|
await this.router.initialize();
|
|
58556
58556
|
console.log(
|
|
58557
|
-
|
|
58557
|
+
chalk27__default.default.green("\u2705 Intelligent Router initialized successfully\n")
|
|
58558
58558
|
);
|
|
58559
58559
|
this.session = createInteractiveSession(this);
|
|
58560
58560
|
await this.session.start();
|
|
58561
58561
|
} catch (error2) {
|
|
58562
|
-
console.error(
|
|
58562
|
+
console.error(chalk27__default.default.red("\n\u274C Initialization failed:"), error2);
|
|
58563
58563
|
process.exit(1);
|
|
58564
58564
|
}
|
|
58565
58565
|
}
|
|
@@ -58567,7 +58567,7 @@ var init_maria_ai = __esm({
|
|
|
58567
58567
|
if (this.session) {
|
|
58568
58568
|
await this.session.stop();
|
|
58569
58569
|
}
|
|
58570
|
-
console.log(
|
|
58570
|
+
console.log(chalk27__default.default.cyan("\n\u{1F44B} Goodbye!"));
|
|
58571
58571
|
}
|
|
58572
58572
|
};
|
|
58573
58573
|
}
|
|
@@ -58596,8 +58596,8 @@ async function loadServices() {
|
|
|
58596
58596
|
try {
|
|
58597
58597
|
const commandName = command.startsWith("/") ? command.slice(1) : command;
|
|
58598
58598
|
if (commandName === "battlecard") {
|
|
58599
|
-
console.log(
|
|
58600
|
-
console.log(
|
|
58599
|
+
console.log(chalk27__default.default.yellow("\u{1F512} /battlecard is not available on Free plan"));
|
|
58600
|
+
console.log(chalk27__default.default.gray(" Join the waitlist for business features: https://maria-code.ai/waitlist"));
|
|
58601
58601
|
return {
|
|
58602
58602
|
success: false,
|
|
58603
58603
|
message: "Command not available on Free plan"
|
|
@@ -58658,7 +58658,7 @@ async function loadServices() {
|
|
|
58658
58658
|
commandManager.setLegacyHandler(legacyHandlerAdapter);
|
|
58659
58659
|
}
|
|
58660
58660
|
} catch (e2) {
|
|
58661
|
-
console.warn(
|
|
58661
|
+
console.warn(chalk27__default.default.yellow("\u26A0 Some services unavailable, using fallbacks"));
|
|
58662
58662
|
}
|
|
58663
58663
|
}
|
|
58664
58664
|
async function init() {
|
|
@@ -58780,17 +58780,17 @@ async function enforceAuth(cmd) {
|
|
|
58780
58780
|
try {
|
|
58781
58781
|
const tokens = await authManager.getValidTokens();
|
|
58782
58782
|
if (!tokens) {
|
|
58783
|
-
console.log(
|
|
58783
|
+
console.log(chalk27__default.default.red("\u{1F510} Authentication required \xB7 Run: maria /login"));
|
|
58784
58784
|
return false;
|
|
58785
58785
|
}
|
|
58786
58786
|
return true;
|
|
58787
58787
|
} catch (error2) {
|
|
58788
58788
|
if (error2.code === "AUTH_REQUIRED") {
|
|
58789
|
-
console.log(
|
|
58789
|
+
console.log(chalk27__default.default.red("\u{1F510} Authentication required \xB7 Run: maria /login"));
|
|
58790
58790
|
} else if (error2.code === "REAUTH_REQUIRED") {
|
|
58791
|
-
console.log(
|
|
58791
|
+
console.log(chalk27__default.default.yellow("\u{1F504} Please re-authenticate \xB7 Run: maria /login"));
|
|
58792
58792
|
} else {
|
|
58793
|
-
console.log(
|
|
58793
|
+
console.log(chalk27__default.default.red("\u{1F310} Network error, check connection"));
|
|
58794
58794
|
}
|
|
58795
58795
|
return false;
|
|
58796
58796
|
}
|
|
@@ -58829,7 +58829,7 @@ async function handleSlash(input3) {
|
|
|
58829
58829
|
console.log(JSON.stringify(result2.data, null, 2));
|
|
58830
58830
|
}
|
|
58831
58831
|
} else {
|
|
58832
|
-
console.log(
|
|
58832
|
+
console.log(chalk27__default.default.red(`Help Error: ${result2.message}`));
|
|
58833
58833
|
}
|
|
58834
58834
|
return true;
|
|
58835
58835
|
}
|
|
@@ -58837,7 +58837,7 @@ async function handleSlash(input3) {
|
|
|
58837
58837
|
if (process.env.MARIA_DEBUG === "1") {
|
|
58838
58838
|
console.error("HelpCommand error:", helpError);
|
|
58839
58839
|
}
|
|
58840
|
-
console.log(
|
|
58840
|
+
console.log(chalk27__default.default.yellow("\u26A0 Dynamic help unavailable, using fallback"));
|
|
58841
58841
|
}
|
|
58842
58842
|
const help = `
|
|
58843
58843
|
\u{1F4D6} MARIA CLI Help
|
|
@@ -58862,7 +58862,7 @@ Chat:
|
|
|
58862
58862
|
session.length = 0;
|
|
58863
58863
|
if (ctx?.clearContext) ctx.clearContext();
|
|
58864
58864
|
console.clear();
|
|
58865
|
-
console.log(
|
|
58865
|
+
console.log(chalk27__default.default.cyan("\u2728 Session cleared"));
|
|
58866
58866
|
return true;
|
|
58867
58867
|
}
|
|
58868
58868
|
if (cmd === "code") {
|
|
@@ -58871,7 +58871,7 @@ Chat:
|
|
|
58871
58871
|
const prompt = args2.join(" ").trim();
|
|
58872
58872
|
if (!prompt) {
|
|
58873
58873
|
console.log(
|
|
58874
|
-
|
|
58874
|
+
chalk27__default.default.red("Usage: /code <request> e.g. /code build a REST API")
|
|
58875
58875
|
);
|
|
58876
58876
|
return true;
|
|
58877
58877
|
}
|
|
@@ -58884,7 +58884,7 @@ Chat:
|
|
|
58884
58884
|
const prompt = args2.join(" ").trim();
|
|
58885
58885
|
if (!prompt) {
|
|
58886
58886
|
console.log(
|
|
58887
|
-
|
|
58887
|
+
chalk27__default.default.cyan("\u{1F3A8} **Image Generation**\n") + chalk27__default.default.white("Usage: /image <prompt>\n") + chalk27__default.default.gray("Example: /image \u5BCC\u58EB\u5C71\u306E\u65E5\u306E\u51FA")
|
|
58888
58888
|
);
|
|
58889
58889
|
return true;
|
|
58890
58890
|
}
|
|
@@ -58896,14 +58896,14 @@ Chat:
|
|
|
58896
58896
|
options: {},
|
|
58897
58897
|
logger: {
|
|
58898
58898
|
info: (msg) => console.log(msg),
|
|
58899
|
-
error: (msg) => console.error(
|
|
58900
|
-
warn: (msg) => console.warn(
|
|
58899
|
+
error: (msg) => console.error(chalk27__default.default.red(msg)),
|
|
58900
|
+
warn: (msg) => console.warn(chalk27__default.default.yellow(msg))
|
|
58901
58901
|
}
|
|
58902
58902
|
};
|
|
58903
58903
|
await imageCommand2.execute(context2);
|
|
58904
58904
|
}
|
|
58905
58905
|
} catch (error2) {
|
|
58906
|
-
console.error(
|
|
58906
|
+
console.error(chalk27__default.default.red("Image generation failed:"), error2.message);
|
|
58907
58907
|
}
|
|
58908
58908
|
return true;
|
|
58909
58909
|
}
|
|
@@ -58913,7 +58913,7 @@ Chat:
|
|
|
58913
58913
|
const prompt = args2.join(" ").trim();
|
|
58914
58914
|
if (!prompt) {
|
|
58915
58915
|
console.log(
|
|
58916
|
-
|
|
58916
|
+
chalk27__default.default.cyan("\u{1F3AC} **Video Generation**\n") + chalk27__default.default.white("Usage: /video <prompt>\n") + chalk27__default.default.gray("Example: /video \u6D77\u306E\u6CE2\u304C\u6253\u3061\u5BC4\u305B\u308B\u69D8\u5B50")
|
|
58917
58917
|
);
|
|
58918
58918
|
return true;
|
|
58919
58919
|
}
|
|
@@ -58925,14 +58925,14 @@ Chat:
|
|
|
58925
58925
|
options: {},
|
|
58926
58926
|
logger: {
|
|
58927
58927
|
info: (msg) => console.log(msg),
|
|
58928
|
-
error: (msg) => console.error(
|
|
58929
|
-
warn: (msg) => console.warn(
|
|
58928
|
+
error: (msg) => console.error(chalk27__default.default.red(msg)),
|
|
58929
|
+
warn: (msg) => console.warn(chalk27__default.default.yellow(msg))
|
|
58930
58930
|
}
|
|
58931
58931
|
};
|
|
58932
58932
|
await videoCommand2.execute(context2);
|
|
58933
58933
|
}
|
|
58934
58934
|
} catch (error2) {
|
|
58935
|
-
console.error(
|
|
58935
|
+
console.error(chalk27__default.default.red("Video generation failed:"), error2.message);
|
|
58936
58936
|
}
|
|
58937
58937
|
return true;
|
|
58938
58938
|
}
|
|
@@ -58942,7 +58942,7 @@ Chat:
|
|
|
58942
58942
|
const prompt = args2.join(" ").trim();
|
|
58943
58943
|
if (!prompt) {
|
|
58944
58944
|
console.log(
|
|
58945
|
-
|
|
58945
|
+
chalk27__default.default.cyan("\u{1F399}\uFE0F **Voice Synthesis**\n") + chalk27__default.default.white("Usage: /voice <text>\n") + chalk27__default.default.gray("Example: /voice \u3053\u3093\u306B\u3061\u306F\u3001\u5143\u6C17\u3067\u3059\u304B\uFF1F")
|
|
58946
58946
|
);
|
|
58947
58947
|
return true;
|
|
58948
58948
|
}
|
|
@@ -58954,14 +58954,14 @@ Chat:
|
|
|
58954
58954
|
options: {},
|
|
58955
58955
|
logger: {
|
|
58956
58956
|
info: (msg) => console.log(msg),
|
|
58957
|
-
error: (msg) => console.error(
|
|
58958
|
-
warn: (msg) => console.warn(
|
|
58957
|
+
error: (msg) => console.error(chalk27__default.default.red(msg)),
|
|
58958
|
+
warn: (msg) => console.warn(chalk27__default.default.yellow(msg))
|
|
58959
58959
|
}
|
|
58960
58960
|
};
|
|
58961
58961
|
await voiceCommand2.execute(context2);
|
|
58962
58962
|
}
|
|
58963
58963
|
} catch (error2) {
|
|
58964
|
-
console.error(
|
|
58964
|
+
console.error(chalk27__default.default.red("Voice synthesis failed:"), error2.message);
|
|
58965
58965
|
}
|
|
58966
58966
|
return true;
|
|
58967
58967
|
}
|
|
@@ -58980,36 +58980,36 @@ Chat:
|
|
|
58980
58980
|
if (args2.includes("status")) {
|
|
58981
58981
|
if (await authManager.isAuthenticated()) {
|
|
58982
58982
|
const user = await authManager.getCurrentUser();
|
|
58983
|
-
console.log(
|
|
58984
|
-
console.log(
|
|
58985
|
-
console.log(
|
|
58983
|
+
console.log(chalk27__default.default.green("\u2705 Authenticated"));
|
|
58984
|
+
console.log(chalk27__default.default.white(`\u{1F464} User: ${chalk27__default.default.cyan(user.email)}`));
|
|
58985
|
+
console.log(chalk27__default.default.white(`\u{1F4CA} Plan: ${chalk27__default.default.cyan(user.plan)}`));
|
|
58986
58986
|
} else {
|
|
58987
|
-
console.log(
|
|
58988
|
-
console.log(
|
|
58987
|
+
console.log(chalk27__default.default.yellow("\u26A0\uFE0F Not authenticated"));
|
|
58988
|
+
console.log(chalk27__default.default.gray("Use /login to sign in"));
|
|
58989
58989
|
}
|
|
58990
58990
|
} else {
|
|
58991
58991
|
const result2 = await authManager.login(options3);
|
|
58992
58992
|
if (result2.success && result2.user) {
|
|
58993
|
-
console.log(
|
|
58994
|
-
console.log(
|
|
58995
|
-
console.log(
|
|
58993
|
+
console.log(chalk27__default.default.green("\u2705 Successfully logged in!"));
|
|
58994
|
+
console.log(chalk27__default.default.white(`\u{1F464} User: ${chalk27__default.default.cyan(result2.user.email)}`));
|
|
58995
|
+
console.log(chalk27__default.default.white(`\u{1F4CA} Plan: ${chalk27__default.default.cyan(result2.user.plan)}`));
|
|
58996
58996
|
} else {
|
|
58997
|
-
console.log(
|
|
58998
|
-
if (result2.error) console.log(
|
|
58997
|
+
console.log(chalk27__default.default.red("\u274C Login failed"));
|
|
58998
|
+
if (result2.error) console.log(chalk27__default.default.gray(result2.error));
|
|
58999
58999
|
}
|
|
59000
59000
|
}
|
|
59001
59001
|
}
|
|
59002
59002
|
} catch (error2) {
|
|
59003
|
-
console.error(
|
|
59003
|
+
console.error(chalk27__default.default.red("Login error:"), error2.message);
|
|
59004
59004
|
}
|
|
59005
59005
|
return true;
|
|
59006
59006
|
}
|
|
59007
59007
|
if (cmd === "logout" || cmd === "signout") {
|
|
59008
59008
|
try {
|
|
59009
59009
|
await authManager.logout();
|
|
59010
|
-
console.log(
|
|
59010
|
+
console.log(chalk27__default.default.green("\u{1F44B} Signed out. Local credentials removed."));
|
|
59011
59011
|
} catch (error2) {
|
|
59012
|
-
console.error(
|
|
59012
|
+
console.error(chalk27__default.default.red("Logout error:"), error2.message);
|
|
59013
59013
|
}
|
|
59014
59014
|
return true;
|
|
59015
59015
|
}
|
|
@@ -59136,7 +59136,7 @@ Chat:
|
|
|
59136
59136
|
} else if (result2.message) {
|
|
59137
59137
|
console.log(result2.message);
|
|
59138
59138
|
} else if (result2.success) {
|
|
59139
|
-
console.log(
|
|
59139
|
+
console.log(chalk27__default.default.green("\u2705 Command executed successfully"));
|
|
59140
59140
|
}
|
|
59141
59141
|
if (result2.data && process.env.MARIA_DEBUG === "1") {
|
|
59142
59142
|
console.log(JSON.stringify(result2.data, null, 2));
|
|
@@ -59150,11 +59150,11 @@ Chat:
|
|
|
59150
59150
|
}
|
|
59151
59151
|
}
|
|
59152
59152
|
if (!["battlecard", "sales-dashboard", "tune", "pilot-setup"].includes(cmd)) {
|
|
59153
|
-
console.log(
|
|
59154
|
-
console.log(
|
|
59155
|
-
console.log(
|
|
59156
|
-
console.log(
|
|
59157
|
-
console.log(
|
|
59153
|
+
console.log(chalk27__default.default.red(`\u274C Unknown command: /${cmd}`));
|
|
59154
|
+
console.log(chalk27__default.default.yellow("\n\u{1F4A1} Suggestions:"));
|
|
59155
|
+
console.log(chalk27__default.default.gray(" \u2022 Try /help to see available commands"));
|
|
59156
|
+
console.log(chalk27__default.default.gray(" \u2022 Check if you need to /login first"));
|
|
59157
|
+
console.log(chalk27__default.default.gray(` \u2022 Try similar commands: /help --search ${cmd}`));
|
|
59158
59158
|
}
|
|
59159
59159
|
return true;
|
|
59160
59160
|
}
|
|
@@ -59422,11 +59422,11 @@ async function handleCodeCommand(prompt) {
|
|
|
59422
59422
|
const filepath = path9__namespace.resolve(process.cwd(), filename);
|
|
59423
59423
|
await fsp__namespace.writeFile(filepath, code, "utf-8");
|
|
59424
59424
|
console.log(
|
|
59425
|
-
|
|
59426
|
-
`) +
|
|
59427
|
-
`) +
|
|
59428
|
-
`) +
|
|
59429
|
-
`) +
|
|
59425
|
+
chalk27__default.default.green("\n\u2705 **Code Saved**\n") + chalk27__default.default.white(`\u{1F4C1} **File (Click to open):**
|
|
59426
|
+
`) + chalk27__default.default.cyan(`\u2022 [${filename}](file://${filepath})
|
|
59427
|
+
`) + chalk27__default.default.gray(` \u{1F4CD} Path: \`${filepath}\`
|
|
59428
|
+
`) + chalk27__default.default.white(` \u{1F4DD} Language: ${language}
|
|
59429
|
+
`) + chalk27__default.default.dim(`
|
|
59430
59430
|
\u{1F4A1} Tip: Command+Click (Mac) or Ctrl+Click (Windows/Linux) to open file`)
|
|
59431
59431
|
);
|
|
59432
59432
|
} else {
|
|
@@ -59435,11 +59435,11 @@ async function handleCodeCommand(prompt) {
|
|
|
59435
59435
|
} catch (e2) {
|
|
59436
59436
|
spinner.stop();
|
|
59437
59437
|
if (process.env.MARIA_DEBUG === "1") {
|
|
59438
|
-
console.error(
|
|
59438
|
+
console.error(chalk27__default.default.red("Code generation error:"), e2.message || e2);
|
|
59439
59439
|
}
|
|
59440
59440
|
const fallbackCode = templateFallback(prompt);
|
|
59441
59441
|
console.log(
|
|
59442
|
-
|
|
59442
|
+
chalk27__default.default.yellow("\u26A0 AI unavailable, using template fallback:\n")
|
|
59443
59443
|
);
|
|
59444
59444
|
console.log(fallbackCode);
|
|
59445
59445
|
try {
|
|
@@ -59448,14 +59448,14 @@ async function handleCodeCommand(prompt) {
|
|
|
59448
59448
|
const filepath = path9__namespace.resolve(process.cwd(), filename);
|
|
59449
59449
|
await fsp__namespace.writeFile(filepath, code, "utf-8");
|
|
59450
59450
|
console.log(
|
|
59451
|
-
|
|
59452
|
-
`) +
|
|
59453
|
-
`) +
|
|
59454
|
-
`) +
|
|
59451
|
+
chalk27__default.default.green("\n\u2705 **Template Code Saved**\n") + chalk27__default.default.white(`\u{1F4C1} **File (Click to open):**
|
|
59452
|
+
`) + chalk27__default.default.cyan(`\u2022 [${filename}](file://${filepath})
|
|
59453
|
+
`) + chalk27__default.default.gray(` \u{1F4CD} Path: \`${filepath}\`
|
|
59454
|
+
`) + chalk27__default.default.dim(`
|
|
59455
59455
|
\u{1F4A1} Tip: Command+Click (Mac) or Ctrl+Click (Windows/Linux) to open file`)
|
|
59456
59456
|
);
|
|
59457
59457
|
} catch (saveError) {
|
|
59458
|
-
console.error(
|
|
59458
|
+
console.error(chalk27__default.default.red("Failed to save code:"), saveError);
|
|
59459
59459
|
}
|
|
59460
59460
|
}
|
|
59461
59461
|
}
|
|
@@ -59511,7 +59511,7 @@ ${userPrompt}`;
|
|
|
59511
59511
|
(seq) => response2.includes(seq)
|
|
59512
59512
|
);
|
|
59513
59513
|
if (guidedFlowDetected) {
|
|
59514
|
-
console.log(
|
|
59514
|
+
console.log(chalk27__default.default.yellow("\u26A0 Guided flow detected, switching to fallback"));
|
|
59515
59515
|
return null;
|
|
59516
59516
|
}
|
|
59517
59517
|
const codeMatch = response2.match(/```[\s\S]*?```/);
|
|
@@ -59679,14 +59679,14 @@ async function streamAnswer(text) {
|
|
|
59679
59679
|
if (store?.addMessage) await store.addMessage(msg);
|
|
59680
59680
|
} else {
|
|
59681
59681
|
animation.stop();
|
|
59682
|
-
console.log(
|
|
59682
|
+
console.log(chalk27__default.default.yellow("AI service unavailable. Please check your configuration."));
|
|
59683
59683
|
}
|
|
59684
59684
|
} catch (e2) {
|
|
59685
59685
|
animation.stop();
|
|
59686
59686
|
if (e2.message?.includes("timeout") || e2.message?.includes("\u23F1\uFE0F")) {
|
|
59687
|
-
console.log(
|
|
59687
|
+
console.log(chalk27__default.default.yellow(e2.message));
|
|
59688
59688
|
} else {
|
|
59689
|
-
console.log(
|
|
59689
|
+
console.log(chalk27__default.default.red("Error generating response:"), e2.message || e2);
|
|
59690
59690
|
}
|
|
59691
59691
|
}
|
|
59692
59692
|
}
|
|
@@ -59701,9 +59701,9 @@ async function handleLine(line) {
|
|
|
59701
59701
|
if (consumed) return;
|
|
59702
59702
|
const isAuthenticated = await authManager.isAuthenticated();
|
|
59703
59703
|
if (!isAuthenticated) {
|
|
59704
|
-
console.log(
|
|
59705
|
-
console.log(
|
|
59706
|
-
console.log(
|
|
59704
|
+
console.log(chalk27__default.default.yellow("\n\u26A0\uFE0F Authentication required for chat features"));
|
|
59705
|
+
console.log(chalk27__default.default.cyan("Please run: /login"));
|
|
59706
|
+
console.log(chalk27__default.default.gray("Or use slash commands like /help, /version"));
|
|
59707
59707
|
return;
|
|
59708
59708
|
}
|
|
59709
59709
|
const user = { role: "user", content: input3, timestamp: /* @__PURE__ */ new Date() };
|
|
@@ -59725,7 +59725,7 @@ async function startInteractiveSession() {
|
|
|
59725
59725
|
}
|
|
59726
59726
|
}
|
|
59727
59727
|
const stop = async () => {
|
|
59728
|
-
console.log(
|
|
59728
|
+
console.log(chalk27__default.default.cyan("\n\u{1F44B} Goodbye!"));
|
|
59729
59729
|
if (store?.close) await store.close().catch(() => {
|
|
59730
59730
|
});
|
|
59731
59731
|
if (interactiveCLI?.cleanup) interactiveCLI.cleanup();
|
|
@@ -59739,7 +59739,7 @@ async function startInteractiveSession() {
|
|
|
59739
59739
|
process.once("SIGINT", stop);
|
|
59740
59740
|
process.once("SIGTERM", stop);
|
|
59741
59741
|
if (!isTTY) {
|
|
59742
|
-
console.log(
|
|
59742
|
+
console.log(chalk27__default.default.gray("[Pipe mode detected - streaming input/output]"));
|
|
59743
59743
|
const rl = readline6__namespace.createInterface({
|
|
59744
59744
|
input: process6.stdin,
|
|
59745
59745
|
output: process6.stdout,
|
|
@@ -59754,7 +59754,7 @@ async function startInteractiveSession() {
|
|
|
59754
59754
|
if (interactiveCLI) {
|
|
59755
59755
|
while (true) {
|
|
59756
59756
|
try {
|
|
59757
|
-
const prompt =
|
|
59757
|
+
const prompt = chalk27__default.default.gray("> ");
|
|
59758
59758
|
process.stdout.write(prompt);
|
|
59759
59759
|
const line = await interactiveCLI.question("");
|
|
59760
59760
|
console.log();
|
|
@@ -59769,14 +59769,14 @@ async function startInteractiveSession() {
|
|
|
59769
59769
|
await stop();
|
|
59770
59770
|
return;
|
|
59771
59771
|
}
|
|
59772
|
-
console.error(
|
|
59772
|
+
console.error(chalk27__default.default.red("Error:"), error2?.message || error2);
|
|
59773
59773
|
}
|
|
59774
59774
|
}
|
|
59775
59775
|
} else {
|
|
59776
59776
|
const rl = readline6__namespace.createInterface({ input: process6.stdin, output: process6.stdout });
|
|
59777
59777
|
while (true) {
|
|
59778
59778
|
try {
|
|
59779
|
-
const prompt =
|
|
59779
|
+
const prompt = chalk27__default.default.gray("> ");
|
|
59780
59780
|
const line = await rl.question(prompt);
|
|
59781
59781
|
console.log();
|
|
59782
59782
|
if (line.toLowerCase() === "exit" || line.toLowerCase() === "quit") {
|
|
@@ -59790,31 +59790,109 @@ async function startInteractiveSession() {
|
|
|
59790
59790
|
await stop();
|
|
59791
59791
|
return;
|
|
59792
59792
|
}
|
|
59793
|
-
console.error(
|
|
59793
|
+
console.error(chalk27__default.default.red("Error:"), error2?.message || error2);
|
|
59794
59794
|
}
|
|
59795
59795
|
}
|
|
59796
59796
|
}
|
|
59797
59797
|
}
|
|
59798
59798
|
function createCLI2() {
|
|
59799
59799
|
const program2 = new commander.Command();
|
|
59800
|
-
program2.name("maria").description(`\u{1F680} MARIA v${getVersion()} - Intelligent AI Assistant`).version(getVersion()).option("--v3-session", "Use v3 session architecture").option("--no-interactive", "Disable interactive mode for CI/CD").
|
|
59800
|
+
program2.name("maria").description(`\u{1F680} MARIA v${getVersion()} - Intelligent AI Assistant`).version(getVersion()).option("--v3-session", "Use v3 session architecture").option("--no-interactive", "Disable interactive mode for CI/CD").action(async (options2) => {
|
|
59801
59801
|
loadEnvironmentVariables();
|
|
59802
59802
|
if (options2.server) {
|
|
59803
|
-
console.log(
|
|
59803
|
+
console.log(chalk27__default.default.green("\u{1F680} Starting MARIA server mode..."));
|
|
59804
59804
|
try {
|
|
59805
|
-
const
|
|
59805
|
+
const distDir = path9__namespace.dirname(process.argv[1] || process.cwd());
|
|
59806
|
+
const candidateNames = [
|
|
59807
|
+
"server-express.mjs",
|
|
59808
|
+
"server-express.cjs",
|
|
59809
|
+
"server-express.js",
|
|
59810
|
+
// tsup emits CJS for server entry as dist/server/express-server.js
|
|
59811
|
+
path9__namespace.join("server", "express-server.js"),
|
|
59812
|
+
path9__namespace.join("server", "express-server.cjs")
|
|
59813
|
+
];
|
|
59814
|
+
const candidateDirs = [
|
|
59815
|
+
distDir,
|
|
59816
|
+
path9__namespace.resolve(distDir, ".."),
|
|
59817
|
+
process.cwd()
|
|
59818
|
+
];
|
|
59819
|
+
let serverPath = null;
|
|
59820
|
+
for (const dir of candidateDirs) {
|
|
59821
|
+
for (const name2 of candidateNames) {
|
|
59822
|
+
const p = path9__namespace.join(dir, name2);
|
|
59823
|
+
try {
|
|
59824
|
+
await fsp__namespace.access(p);
|
|
59825
|
+
serverPath = p;
|
|
59826
|
+
break;
|
|
59827
|
+
} catch {
|
|
59828
|
+
}
|
|
59829
|
+
}
|
|
59830
|
+
if (serverPath) break;
|
|
59831
|
+
}
|
|
59832
|
+
if (!serverPath) {
|
|
59833
|
+
console.error(chalk27__default.default.red("\u274C Could not locate server-express entry file"));
|
|
59834
|
+
console.error(chalk27__default.default.gray("Searched names: " + candidateNames.join(", ")));
|
|
59835
|
+
console.error(chalk27__default.default.gray("Searched dirs: " + candidateDirs.join(" | ")));
|
|
59836
|
+
process.exit(1);
|
|
59837
|
+
}
|
|
59806
59838
|
const { spawn: spawn3 } = await import('child_process');
|
|
59807
59839
|
const serverProcess = spawn3("node", [serverPath], {
|
|
59808
59840
|
stdio: "inherit",
|
|
59809
|
-
env: process.env
|
|
59841
|
+
env: process.env,
|
|
59842
|
+
cwd: path9__namespace.dirname(serverPath)
|
|
59810
59843
|
});
|
|
59844
|
+
let shutdownTimer = null;
|
|
59845
|
+
const forceExit = (defaultCode) => {
|
|
59846
|
+
if (shutdownTimer) {
|
|
59847
|
+
clearTimeout(shutdownTimer);
|
|
59848
|
+
shutdownTimer = null;
|
|
59849
|
+
}
|
|
59850
|
+
process.exit(defaultCode);
|
|
59851
|
+
};
|
|
59852
|
+
const forwardAndExit = (signal) => {
|
|
59853
|
+
try {
|
|
59854
|
+
if (!serverProcess.killed) {
|
|
59855
|
+
const forwardSignal = process.platform === "win32" ? "SIGTERM" : signal;
|
|
59856
|
+
try {
|
|
59857
|
+
serverProcess.kill(forwardSignal);
|
|
59858
|
+
} catch {
|
|
59859
|
+
}
|
|
59860
|
+
}
|
|
59861
|
+
} finally {
|
|
59862
|
+
if (!shutdownTimer) {
|
|
59863
|
+
shutdownTimer = setTimeout(() => {
|
|
59864
|
+
try {
|
|
59865
|
+
if (!serverProcess.killed) {
|
|
59866
|
+
try {
|
|
59867
|
+
serverProcess.kill("SIGKILL");
|
|
59868
|
+
} catch {
|
|
59869
|
+
}
|
|
59870
|
+
}
|
|
59871
|
+
} finally {
|
|
59872
|
+
const code = signal === "SIGINT" ? 130 : 143;
|
|
59873
|
+
process.exit(code);
|
|
59874
|
+
}
|
|
59875
|
+
}, 2e3);
|
|
59876
|
+
}
|
|
59877
|
+
}
|
|
59878
|
+
};
|
|
59879
|
+
process.once("SIGINT", () => forwardAndExit("SIGINT"));
|
|
59880
|
+
process.once("SIGTERM", () => forwardAndExit("SIGTERM"));
|
|
59811
59881
|
serverProcess.on("error", (error2) => {
|
|
59812
|
-
console.error(
|
|
59882
|
+
console.error(chalk27__default.default.red("\u274C Server process error:"), error2);
|
|
59813
59883
|
process.exit(1);
|
|
59814
59884
|
});
|
|
59885
|
+
serverProcess.on("exit", (code, _signal) => {
|
|
59886
|
+
if (shutdownTimer) {
|
|
59887
|
+
clearTimeout(shutdownTimer);
|
|
59888
|
+
shutdownTimer = null;
|
|
59889
|
+
}
|
|
59890
|
+
const exitCode = typeof code === "number" ? code : 0;
|
|
59891
|
+
process.exit(exitCode);
|
|
59892
|
+
});
|
|
59815
59893
|
return;
|
|
59816
59894
|
} catch (error2) {
|
|
59817
|
-
console.error(
|
|
59895
|
+
console.error(chalk27__default.default.red("\u274C Failed to start server mode:"), error2);
|
|
59818
59896
|
process.exit(1);
|
|
59819
59897
|
}
|
|
59820
59898
|
}
|
|
@@ -59839,7 +59917,7 @@ function createCLI2() {
|
|
|
59839
59917
|
displayStartupLogo2();
|
|
59840
59918
|
startupDisplayed = true;
|
|
59841
59919
|
} catch {
|
|
59842
|
-
console.log(
|
|
59920
|
+
console.log(chalk27__default.default.cyan(`
|
|
59843
59921
|
\u{1F680} MARIA v${getVersion()}
|
|
59844
59922
|
`));
|
|
59845
59923
|
startupDisplayed = true;
|
|
@@ -59848,13 +59926,13 @@ function createCLI2() {
|
|
|
59848
59926
|
const useV3 = options2.v3Session || process.env.MARIA_USE_V3_SESSION === "1";
|
|
59849
59927
|
if (useV3) {
|
|
59850
59928
|
try {
|
|
59851
|
-
console.log(
|
|
59929
|
+
console.log(chalk27__default.default.cyan("\u{1F680} Starting MARIA v3 session..."));
|
|
59852
59930
|
const { MariaAI: MariaAI2 } = await Promise.resolve().then(() => (init_maria_ai(), maria_ai_exports));
|
|
59853
59931
|
const maria = new MariaAI2();
|
|
59854
59932
|
await maria.initialize();
|
|
59855
59933
|
return;
|
|
59856
59934
|
} catch (e2) {
|
|
59857
|
-
console.warn(
|
|
59935
|
+
console.warn(chalk27__default.default.yellow("\u26A0 V3 session unavailable, using standard mode"));
|
|
59858
59936
|
}
|
|
59859
59937
|
}
|
|
59860
59938
|
await startInteractiveSession();
|