@bonginkan/maria 4.2.28 → 4.2.29
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 +622 -623
- package/dist/bin/maria.cjs.map +1 -1
- package/dist/cli.cjs +615 -616
- package/dist/cli.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/server/express-server.cjs +2 -2
- package/dist/server/express-server.cjs.map +1 -1
- package/package.json +2 -2
- 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 path8 = require('path');
|
|
6
6
|
var dotenv = require('dotenv');
|
|
7
|
-
var
|
|
7
|
+
var chalk28 = 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 path8__namespace = /*#__PURE__*/_interopNamespace(path8);
|
|
53
53
|
var dotenv__namespace = /*#__PURE__*/_interopNamespace(dotenv);
|
|
54
|
-
var
|
|
54
|
+
var chalk28__default = /*#__PURE__*/_interopDefault(chalk28);
|
|
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${chalk28__default.default.cyan(this.frames[this.currentFrame])} ${chalk28__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${chalk28__default.default.cyan(this.spinnerFrames[this.currentFrame])} ${stage.icon} ${chalk28__default.default.gray(stage.message)}... ${chalk28__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${chalk28__default.default.cyan(this.spinnerFrames[this.currentFrame])} ${stage} ${chalk28__default.default.dim(`[${elapsed}s]`)}`
|
|
356
356
|
);
|
|
357
357
|
} else {
|
|
358
358
|
process.stdout.write(
|
|
359
|
-
`\r${
|
|
359
|
+
`\r${chalk28__default.default.cyan(this.spinnerFrames[this.currentFrame])} ${chalk28__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${chalk28__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} ${chalk28__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 = chalk28__default.default.green("\u2588").repeat(filled) + chalk28__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.29"}`
|
|
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(chalk28__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(chalk28__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(chalk28__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(chalk28__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(chalk28__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(chalk28__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(chalk28__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
|
}
|
|
@@ -12101,8 +12101,6 @@ var init_continuation = __esm({
|
|
|
12101
12101
|
init_common();
|
|
12102
12102
|
}
|
|
12103
12103
|
});
|
|
12104
|
-
|
|
12105
|
-
// src/services/ai-response/responders/question.ts
|
|
12106
12104
|
function buildQuestionResponse(options2) {
|
|
12107
12105
|
const { question, topics = [], includeExample = true } = options2;
|
|
12108
12106
|
const isJapanese = false;
|
|
@@ -12159,7 +12157,8 @@ function buildQuestionResponse(options2) {
|
|
|
12159
12157
|
parts.push(
|
|
12160
12158
|
"Choose a number for details or ask a follow-up question."
|
|
12161
12159
|
);
|
|
12162
|
-
|
|
12160
|
+
const output3 = parts.join("\n");
|
|
12161
|
+
return chalk28__default.default.green(output3);
|
|
12163
12162
|
}
|
|
12164
12163
|
function generateQuickAnswer(question, isJapanese, topics) {
|
|
12165
12164
|
const lowerQuestion = question.toLowerCase();
|
|
@@ -12711,27 +12710,27 @@ var init_logger = __esm({
|
|
|
12711
12710
|
}
|
|
12712
12711
|
debug(...args2) {
|
|
12713
12712
|
if (this.level <= 0 /* DEBUG */) {
|
|
12714
|
-
console.log(
|
|
12713
|
+
console.log(chalk28__default.default.magenta(`${this.prefix} [DEBUG]`), ...args2);
|
|
12715
12714
|
}
|
|
12716
12715
|
}
|
|
12717
12716
|
info(...args2) {
|
|
12718
12717
|
if (this.level <= 1 /* INFO */) {
|
|
12719
|
-
console.log(
|
|
12718
|
+
console.log(chalk28__default.default.bold.magenta(`${this.prefix} [INFO]`), ...args2);
|
|
12720
12719
|
}
|
|
12721
12720
|
}
|
|
12722
12721
|
warn(...args2) {
|
|
12723
12722
|
if (this.level <= 2 /* WARN */) {
|
|
12724
|
-
console.warn(
|
|
12723
|
+
console.warn(chalk28__default.default.bold.magenta(`${this.prefix} [WARN]`), ...args2);
|
|
12725
12724
|
}
|
|
12726
12725
|
}
|
|
12727
12726
|
error(...args2) {
|
|
12728
12727
|
if (this.level <= 3 /* ERROR */) {
|
|
12729
|
-
console.error(
|
|
12728
|
+
console.error(chalk28__default.default.bold.magenta(`${this.prefix} [ERROR]`), ...args2);
|
|
12730
12729
|
}
|
|
12731
12730
|
}
|
|
12732
12731
|
success(...args2) {
|
|
12733
12732
|
if (this.level <= 1 /* INFO */) {
|
|
12734
|
-
console.log(
|
|
12733
|
+
console.log(chalk28__default.default.bold.magenta(`${this.prefix} [SUCCESS]`), ...args2);
|
|
12735
12734
|
}
|
|
12736
12735
|
}
|
|
12737
12736
|
task(taskName, status, message) {
|
|
@@ -12745,10 +12744,10 @@ var init_logger = __esm({
|
|
|
12745
12744
|
error: "\u274C"
|
|
12746
12745
|
};
|
|
12747
12746
|
const statusColors = {
|
|
12748
|
-
start:
|
|
12749
|
-
progress:
|
|
12750
|
-
complete:
|
|
12751
|
-
error:
|
|
12747
|
+
start: chalk28__default.default.bold.magenta,
|
|
12748
|
+
progress: chalk28__default.default.magenta,
|
|
12749
|
+
complete: chalk28__default.default.bold.magenta,
|
|
12750
|
+
error: chalk28__default.default.bold.magenta
|
|
12752
12751
|
};
|
|
12753
12752
|
const icon = statusIcons[status];
|
|
12754
12753
|
const color = statusColors[status];
|
|
@@ -12765,14 +12764,14 @@ var init_logger = __esm({
|
|
|
12765
12764
|
if (this.level > 0 /* DEBUG */) {
|
|
12766
12765
|
return;
|
|
12767
12766
|
}
|
|
12768
|
-
console.log(
|
|
12767
|
+
console.log(chalk28__default.default.magenta(`${this.prefix} [JSON]`));
|
|
12769
12768
|
console.log(pretty ? JSON.stringify(obj, null, 2) : JSON.stringify(obj));
|
|
12770
12769
|
}
|
|
12771
12770
|
divider() {
|
|
12772
12771
|
if (this.level > 1 /* INFO */) {
|
|
12773
12772
|
return;
|
|
12774
12773
|
}
|
|
12775
|
-
console.log(
|
|
12774
|
+
console.log(chalk28__default.default.magenta("\u2500".repeat(60)));
|
|
12776
12775
|
}
|
|
12777
12776
|
clear() {
|
|
12778
12777
|
console.clear();
|
|
@@ -12792,7 +12791,7 @@ var init_logger = __esm({
|
|
|
12792
12791
|
const progressText = `${current}/${total}`;
|
|
12793
12792
|
const labelText = label ? ` ${label}` : "";
|
|
12794
12793
|
process.stdout.write(
|
|
12795
|
-
`\r${
|
|
12794
|
+
`\r${chalk28__default.default.bold.magenta(bar)} ${percentage}% ${progressText}${labelText}`
|
|
12796
12795
|
);
|
|
12797
12796
|
if (current === total) {
|
|
12798
12797
|
process.stdout.write("\n");
|
|
@@ -14485,9 +14484,9 @@ var init_HelpCommand = __esm({
|
|
|
14485
14484
|
const stats = await this.readyService.getStatistics();
|
|
14486
14485
|
const lines = [];
|
|
14487
14486
|
lines.push("\u2550".repeat(60));
|
|
14488
|
-
lines.push(
|
|
14487
|
+
lines.push(chalk28__default.default.bold(`${stats.totalReady} READY Commands | ${stats.categoriesCount} Categories`));
|
|
14489
14488
|
lines.push("");
|
|
14490
|
-
lines.push(
|
|
14489
|
+
lines.push(chalk28__default.default.bold("Quick Access:"));
|
|
14491
14490
|
lines.push(" /help <command> - Detailed help for specific command");
|
|
14492
14491
|
lines.push(" /help --quickstart - Essential commands for new users");
|
|
14493
14492
|
lines.push(" /help --stats - Performance statistics");
|
|
@@ -14502,7 +14501,7 @@ var init_HelpCommand = __esm({
|
|
|
14502
14501
|
}
|
|
14503
14502
|
globalMaxNameLength = Math.max(globalMaxNameLength, 18) + 1;
|
|
14504
14503
|
for (const category of categories2) {
|
|
14505
|
-
lines.push(
|
|
14504
|
+
lines.push(chalk28__default.default.bold(`${category.name.toUpperCase()} (${category.count})`));
|
|
14506
14505
|
const showCommands = category.commands.slice(0, 4);
|
|
14507
14506
|
for (const cmd of showCommands) {
|
|
14508
14507
|
const needsGpu = this.hasGpuRequirement(cmd.description);
|
|
@@ -14522,7 +14521,7 @@ var init_HelpCommand = __esm({
|
|
|
14522
14521
|
}
|
|
14523
14522
|
lines.push("");
|
|
14524
14523
|
}
|
|
14525
|
-
lines.push(
|
|
14524
|
+
lines.push(chalk28__default.default.bold("Pro Tips:"));
|
|
14526
14525
|
lines.push(" \u2022 All listed commands are production-ready");
|
|
14527
14526
|
lines.push(" \u2022 Use fuzzy search: /help --search config \u2192 finds /config");
|
|
14528
14527
|
lines.push(" \u2022 Categories ordered by importance");
|
|
@@ -14561,33 +14560,33 @@ var init_HelpCommand = __esm({
|
|
|
14561
14560
|
formatCommandHelp(command) {
|
|
14562
14561
|
const lines = [];
|
|
14563
14562
|
lines.push("");
|
|
14564
|
-
lines.push(`\u{1F4D6} ${
|
|
14563
|
+
lines.push(`\u{1F4D6} ${chalk28__default.default.bold(`/${command.name}`)} - ${command.description}`);
|
|
14565
14564
|
lines.push("\u2550".repeat(50));
|
|
14566
14565
|
lines.push("");
|
|
14567
|
-
lines.push(
|
|
14566
|
+
lines.push(chalk28__default.default.bold("\u2139\uFE0F Information:"));
|
|
14568
14567
|
lines.push(` Category: ${this.readyService["getCategoryEmoji"](command.category)} ${command.category}`);
|
|
14569
14568
|
lines.push(` Status: \u2705 READY (contract validated)`);
|
|
14570
14569
|
if (command.aliases && command.aliases.length > 0) {
|
|
14571
14570
|
lines.push(` Aliases: ${command.aliases.map((a2) => `/${a2}`).join(", ")}`);
|
|
14572
14571
|
}
|
|
14573
14572
|
lines.push("");
|
|
14574
|
-
lines.push(
|
|
14573
|
+
lines.push(chalk28__default.default.bold("\u{1F3AF} Usage:"));
|
|
14575
14574
|
lines.push(` ${command.usage}`);
|
|
14576
14575
|
lines.push("");
|
|
14577
|
-
lines.push(
|
|
14576
|
+
lines.push(chalk28__default.default.bold("\u{1F4CB} Contract Validation:"));
|
|
14578
14577
|
lines.push(` \u26A1 Performance: ${command.contract.maxResponseTime}ms (tested)`);
|
|
14579
14578
|
lines.push(` \u{1F4BB} TTY Mode: ${command.contract.tty ? "\u2705 Supported" : "\u274C Not supported"}`);
|
|
14580
14579
|
lines.push(` \u{1F527} Non-TTY Mode: ${command.contract.nonTty ? "\u2705 Supported" : "\u274C Not supported"}`);
|
|
14581
14580
|
lines.push(` \u{1F500} Pipe Mode: ${command.contract.pipe ? "\u2705 Supported" : "\u274C Not supported"}`);
|
|
14582
14581
|
lines.push("");
|
|
14583
14582
|
if (command.examples && command.examples.length > 0) {
|
|
14584
|
-
lines.push(
|
|
14583
|
+
lines.push(chalk28__default.default.bold("\u{1F4DD} Examples:"));
|
|
14585
14584
|
for (const example of command.examples) {
|
|
14586
14585
|
lines.push(` ${example}`);
|
|
14587
14586
|
}
|
|
14588
14587
|
lines.push("");
|
|
14589
14588
|
}
|
|
14590
|
-
lines.push(
|
|
14589
|
+
lines.push(chalk28__default.default.bold("\u{1F4A1} Quick Tips:"));
|
|
14591
14590
|
lines.push(` \u2022 This command is production-ready and fully tested`);
|
|
14592
14591
|
lines.push(` \u2022 Try /${command.name} --help for additional options`);
|
|
14593
14592
|
if (command.category !== "core") {
|
|
@@ -14638,7 +14637,7 @@ var init_HelpCommand = __esm({
|
|
|
14638
14637
|
};
|
|
14639
14638
|
const emoji = emojiMap[categoryName.toLowerCase()] || "\u{1F4CB}";
|
|
14640
14639
|
lines.push("");
|
|
14641
|
-
lines.push(`${emoji} ${
|
|
14640
|
+
lines.push(`${emoji} ${chalk28__default.default.bold(categoryName.toUpperCase() + " COMMANDS")} (${commands.length} READY)`);
|
|
14642
14641
|
lines.push("\u2550".repeat(50));
|
|
14643
14642
|
lines.push("");
|
|
14644
14643
|
const maxNameLength = Math.max(...commands.map((c) => c.name.length)) + 1;
|
|
@@ -14672,7 +14671,7 @@ var init_HelpCommand = __esm({
|
|
|
14672
14671
|
formatSearchResults(searchTerm, results) {
|
|
14673
14672
|
const lines = [];
|
|
14674
14673
|
lines.push("");
|
|
14675
|
-
lines.push(`\u{1F50D} ${
|
|
14674
|
+
lines.push(`\u{1F50D} ${chalk28__default.default.bold("SEARCH RESULTS")} for "${searchTerm}" (${results.length} matches)`);
|
|
14676
14675
|
lines.push("\u2550".repeat(50));
|
|
14677
14676
|
lines.push("");
|
|
14678
14677
|
for (const result2 of results) {
|
|
@@ -14685,7 +14684,7 @@ var init_HelpCommand = __esm({
|
|
|
14685
14684
|
}
|
|
14686
14685
|
lines.push("");
|
|
14687
14686
|
}
|
|
14688
|
-
lines.push(
|
|
14687
|
+
lines.push(chalk28__default.default.bold("\u{1F4A1} Tip:") + " Higher scores indicate better matches");
|
|
14689
14688
|
lines.push("");
|
|
14690
14689
|
return lines.join("\n");
|
|
14691
14690
|
}
|
|
@@ -14696,38 +14695,38 @@ var init_HelpCommand = __esm({
|
|
|
14696
14695
|
const quickCommands = await this.readyService.getQuickStartCommands();
|
|
14697
14696
|
const lines = [];
|
|
14698
14697
|
lines.push("");
|
|
14699
|
-
lines.push(`\u{1F680} ${
|
|
14698
|
+
lines.push(`\u{1F680} ${chalk28__default.default.bold("MARIA QUICKSTART")} - Essential Commands`);
|
|
14700
14699
|
lines.push("\u2550".repeat(50));
|
|
14701
14700
|
lines.push("");
|
|
14702
|
-
lines.push(
|
|
14701
|
+
lines.push(chalk28__default.default.bold("\u{1F3AF} Get Started in 3 Steps:"));
|
|
14703
14702
|
lines.push("");
|
|
14704
|
-
lines.push(
|
|
14703
|
+
lines.push(chalk28__default.default.bold("1\uFE0F\u20E3 Configure Your AI Provider"));
|
|
14705
14704
|
const modelCmd = quickCommands.find((c) => c.name === "model");
|
|
14706
14705
|
if (modelCmd) {
|
|
14707
14706
|
lines.push(` /${modelCmd.name} - ${modelCmd.description}`);
|
|
14708
14707
|
lines.push(` Try: /model set provider=openai key=sk-...`);
|
|
14709
14708
|
}
|
|
14710
14709
|
lines.push("");
|
|
14711
|
-
lines.push(
|
|
14710
|
+
lines.push(chalk28__default.default.bold("2\uFE0F\u20E3 Check System Status"));
|
|
14712
14711
|
const statusCmd = quickCommands.find((c) => c.name === "status");
|
|
14713
14712
|
if (statusCmd) {
|
|
14714
14713
|
lines.push(` /${statusCmd.name} - ${statusCmd.description}`);
|
|
14715
14714
|
lines.push(` Try: /status`);
|
|
14716
14715
|
}
|
|
14717
14716
|
lines.push("");
|
|
14718
|
-
lines.push(
|
|
14717
|
+
lines.push(chalk28__default.default.bold("3\uFE0F\u20E3 Start Coding"));
|
|
14719
14718
|
const codeCmd = quickCommands.find((c) => c.name === "code");
|
|
14720
14719
|
if (codeCmd) {
|
|
14721
14720
|
lines.push(` /${codeCmd.name} - ${codeCmd.description}`);
|
|
14722
14721
|
lines.push(` Try: /code create a hello world function`);
|
|
14723
14722
|
}
|
|
14724
14723
|
lines.push("");
|
|
14725
|
-
lines.push(
|
|
14724
|
+
lines.push(chalk28__default.default.bold("\u{1F527} Essential Commands:"));
|
|
14726
14725
|
for (const cmd of quickCommands) {
|
|
14727
14726
|
lines.push(` /${cmd.name.padEnd(12)} - ${cmd.description}`);
|
|
14728
14727
|
}
|
|
14729
14728
|
lines.push("");
|
|
14730
|
-
lines.push(
|
|
14729
|
+
lines.push(chalk28__default.default.bold("\u{1F4A1} Next Steps:"));
|
|
14731
14730
|
lines.push(" \u2022 /help --category <name> - Explore command categories");
|
|
14732
14731
|
lines.push(" \u2022 /help --search <term> - Find specific functionality");
|
|
14733
14732
|
lines.push(" \u2022 /help <command> - Get detailed command help");
|
|
@@ -14742,20 +14741,20 @@ var init_HelpCommand = __esm({
|
|
|
14742
14741
|
const categories2 = await this.readyService.getCategories();
|
|
14743
14742
|
const lines = [];
|
|
14744
14743
|
lines.push("");
|
|
14745
|
-
lines.push(`\u{1F4CA} ${
|
|
14744
|
+
lines.push(`\u{1F4CA} ${chalk28__default.default.bold("READY COMMANDS STATISTICS")}`);
|
|
14746
14745
|
lines.push("\u2550".repeat(40));
|
|
14747
14746
|
lines.push("");
|
|
14748
|
-
lines.push(
|
|
14747
|
+
lines.push(chalk28__default.default.bold("\u{1F3AF} Overall:"));
|
|
14749
14748
|
lines.push(` Total READY Commands: ${stats.totalReady}`);
|
|
14750
14749
|
lines.push(` Categories: ${stats.categoriesCount}`);
|
|
14751
14750
|
lines.push(` Last Updated: ${stats.lastUpdated?.toLocaleString() || "Unknown"}`);
|
|
14752
14751
|
lines.push("");
|
|
14753
|
-
lines.push(
|
|
14752
|
+
lines.push(chalk28__default.default.bold("\u26A1 Performance:"));
|
|
14754
14753
|
lines.push(` Average Response Time: ${stats.avgResponseTime}ms`);
|
|
14755
14754
|
lines.push(` Fastest Command: /${stats.fastestCommand}`);
|
|
14756
14755
|
lines.push(` Slowest Command: /${stats.slowestCommand}`);
|
|
14757
14756
|
lines.push("");
|
|
14758
|
-
lines.push(
|
|
14757
|
+
lines.push(chalk28__default.default.bold("\u{1F4CB} By Category:"));
|
|
14759
14758
|
for (const category of categories2) {
|
|
14760
14759
|
const avgTime = Math.round(
|
|
14761
14760
|
category.commands.reduce((sum, cmd) => sum + cmd.contract.maxResponseTime, 0) / category.commands.length
|
|
@@ -14763,7 +14762,7 @@ var init_HelpCommand = __esm({
|
|
|
14763
14762
|
lines.push(` ${category.emoji} ${category.name.padEnd(15)}: ${category.count.toString().padStart(2)} commands (${avgTime}ms avg)`);
|
|
14764
14763
|
}
|
|
14765
14764
|
lines.push("");
|
|
14766
|
-
lines.push(
|
|
14765
|
+
lines.push(chalk28__default.default.bold("\u2705 Contract Validation:"));
|
|
14767
14766
|
lines.push(" All commands tested for:");
|
|
14768
14767
|
lines.push(" \u2022 Basic execution without crashes");
|
|
14769
14768
|
lines.push(" \u2022 TTY/non-TTY/pipe compatibility");
|
|
@@ -14826,7 +14825,7 @@ var init_VersionCommand = __esm({
|
|
|
14826
14825
|
if (context2.apiVersion) {
|
|
14827
14826
|
apiBuild = ` \xB7 API: ${context2.apiVersion}`;
|
|
14828
14827
|
}
|
|
14829
|
-
const output3 = `${
|
|
14828
|
+
const output3 = `${chalk28__default.default.bold("MARIA")} v${version}${apiBuild} \xB7 Node: ${process.version}`;
|
|
14830
14829
|
await trackCommand({
|
|
14831
14830
|
cmd: "version",
|
|
14832
14831
|
status: "success",
|
|
@@ -14843,7 +14842,7 @@ var init_VersionCommand = __esm({
|
|
|
14843
14842
|
plan: getUserPlan(),
|
|
14844
14843
|
quotaLeft: context2.quotaLeft || 999
|
|
14845
14844
|
});
|
|
14846
|
-
return this.success(`${
|
|
14845
|
+
return this.success(`${chalk28__default.default.bold("MARIA")} v${getVersion()}`);
|
|
14847
14846
|
}
|
|
14848
14847
|
}
|
|
14849
14848
|
};
|
|
@@ -15293,7 +15292,7 @@ var init_setup_command = __esm({
|
|
|
15293
15292
|
errors: [],
|
|
15294
15293
|
warnings: []
|
|
15295
15294
|
});
|
|
15296
|
-
const message =
|
|
15295
|
+
const message = chalk28__default.default.green(
|
|
15297
15296
|
'\u26A1 Quick setup completed in under 2 minutes!\n \u2022 Configured: OpenAI GPT-4, Environment variables, Git ignore\n \u2022 Next: Run `maria chat` or try `maria code "Hello World function"`'
|
|
15298
15297
|
);
|
|
15299
15298
|
return this.success(message);
|
|
@@ -15488,37 +15487,37 @@ Estimated time: 3-5 minutes
|
|
|
15488
15487
|
const providers = result2.providersConfigured.length > 0 ? result2.providersConfigured.join(", ") : "none";
|
|
15489
15488
|
const files = result2.filesGenerated.length > 0 ? result2.filesGenerated.join(", ") : "none";
|
|
15490
15489
|
lines.push("");
|
|
15491
|
-
lines.push(
|
|
15490
|
+
lines.push(chalk28__default.default.green.bold("\u{1F389} Setup Complete! Welcome to MARIA CODE!"));
|
|
15492
15491
|
lines.push("");
|
|
15493
|
-
lines.push(
|
|
15494
|
-
lines.push(
|
|
15492
|
+
lines.push(chalk28__default.default.white(`\u2022 Status: ${chalk28__default.default.green("success")}`));
|
|
15493
|
+
lines.push(chalk28__default.default.white(`\u2022 Duration: ${chalk28__default.default.cyan(`${durationSec}s`)}`));
|
|
15495
15494
|
lines.push(
|
|
15496
|
-
|
|
15497
|
-
`\u2022 Steps: ${
|
|
15495
|
+
chalk28__default.default.white(
|
|
15496
|
+
`\u2022 Steps: ${chalk28__default.default.cyan(
|
|
15498
15497
|
result2.stepsCompleted.map((s2) => s2.replace(/^_/, "")).join(", ") || "none"
|
|
15499
15498
|
)}`
|
|
15500
15499
|
)
|
|
15501
15500
|
);
|
|
15502
|
-
lines.push(
|
|
15503
|
-
lines.push(
|
|
15501
|
+
lines.push(chalk28__default.default.white(`\u2022 Providers: ${chalk28__default.default.cyan(providers)}`));
|
|
15502
|
+
lines.push(chalk28__default.default.white(`\u2022 Files: ${chalk28__default.default.cyan(files)}`));
|
|
15504
15503
|
if (result2.warnings.length > 0) {
|
|
15505
15504
|
lines.push(
|
|
15506
|
-
|
|
15505
|
+
chalk28__default.default.yellow(
|
|
15507
15506
|
`\u2022 Warnings: ${result2.warnings.map((w) => w.replace(/^_/, "")).join(", ")}`
|
|
15508
15507
|
)
|
|
15509
15508
|
);
|
|
15510
15509
|
}
|
|
15511
15510
|
if (result2.errors.length > 0) {
|
|
15512
|
-
lines.push(
|
|
15511
|
+
lines.push(chalk28__default.default.red(`\u2022 Errors: ${result2.errors.join(", ")}`));
|
|
15513
15512
|
}
|
|
15514
15513
|
lines.push("");
|
|
15515
|
-
lines.push(
|
|
15516
|
-
lines.push(
|
|
15517
|
-
lines.push(
|
|
15518
|
-
lines.push(
|
|
15519
|
-
lines.push(
|
|
15514
|
+
lines.push(chalk28__default.default.white("\u{1F680} Ready to start! Try:"));
|
|
15515
|
+
lines.push(chalk28__default.default.white(" - maria chat \xB7 Start interactive mode"));
|
|
15516
|
+
lines.push(chalk28__default.default.white(' - maria code "create a React component"'));
|
|
15517
|
+
lines.push(chalk28__default.default.white(" - maria test \xB7 Generate tests"));
|
|
15518
|
+
lines.push(chalk28__default.default.white(" - maria help \xB7 View all commands"));
|
|
15520
15519
|
lines.push("");
|
|
15521
|
-
lines.push(
|
|
15520
|
+
lines.push(chalk28__default.default.green(`Setup completed in ${durationSec}s \xB7 Happy coding! \u{1F680}`));
|
|
15522
15521
|
logger.info(lines.join("\n"));
|
|
15523
15522
|
}
|
|
15524
15523
|
/**
|
|
@@ -15530,23 +15529,23 @@ Estimated time: 3-5 minutes
|
|
|
15530
15529
|
const files = result2.filesGenerated.length > 0 ? result2.filesGenerated.join(", ") : "none";
|
|
15531
15530
|
const steps = result2.stepsCompleted.map((s2) => s2.replace(/^_/, "")).join(", ") || "none";
|
|
15532
15531
|
const lines = [];
|
|
15533
|
-
lines.push(
|
|
15532
|
+
lines.push(chalk28__default.default.green.bold("\u{1F389} Setup completed successfully!"));
|
|
15534
15533
|
lines.push("");
|
|
15535
|
-
lines.push(
|
|
15536
|
-
lines.push(
|
|
15537
|
-
lines.push(
|
|
15538
|
-
lines.push(
|
|
15539
|
-
lines.push(
|
|
15534
|
+
lines.push(chalk28__default.default.green(`\u2022 Status: success`));
|
|
15535
|
+
lines.push(chalk28__default.default.green(`\u2022 Duration: ${durationSec}s`));
|
|
15536
|
+
lines.push(chalk28__default.default.green(`\u2022 Steps: ${steps}`));
|
|
15537
|
+
lines.push(chalk28__default.default.green(`\u2022 Providers: ${providers}`));
|
|
15538
|
+
lines.push(chalk28__default.default.green(`\u2022 Files: ${files}`));
|
|
15540
15539
|
if (result2.warnings.length > 0) {
|
|
15541
|
-
lines.push(
|
|
15540
|
+
lines.push(chalk28__default.default.yellow(`\u2022 Warnings: ${result2.warnings.map((w) => w.replace(/^_/, "")).join(", ")}`));
|
|
15542
15541
|
}
|
|
15543
15542
|
if (result2.errors.length > 0) {
|
|
15544
|
-
lines.push(
|
|
15543
|
+
lines.push(chalk28__default.default.red(`\u2022 Errors: ${result2.errors.join(", ")}`));
|
|
15545
15544
|
}
|
|
15546
15545
|
if (nextSteps.length > 0) {
|
|
15547
15546
|
lines.push("");
|
|
15548
|
-
lines.push(
|
|
15549
|
-
nextSteps.forEach((s2) => lines.push(
|
|
15547
|
+
lines.push(chalk28__default.default.green("Next steps:"));
|
|
15548
|
+
nextSteps.forEach((s2) => lines.push(chalk28__default.default.green(` - ${s2}`)));
|
|
15550
15549
|
}
|
|
15551
15550
|
return lines.join("\n");
|
|
15552
15551
|
}
|
|
@@ -19128,8 +19127,8 @@ var require_package = __commonJS({
|
|
|
19128
19127
|
"package.json"(exports, module) {
|
|
19129
19128
|
module.exports = {
|
|
19130
19129
|
name: "@bonginkan/maria",
|
|
19131
|
-
version: "4.2.
|
|
19132
|
-
description: "\u{1F680} MARIA v4.2.
|
|
19130
|
+
version: "4.2.29",
|
|
19131
|
+
description: "\u{1F680} MARIA v4.2.29 - 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.",
|
|
19133
19132
|
keywords: [
|
|
19134
19133
|
"ai",
|
|
19135
19134
|
"cli",
|
|
@@ -30509,7 +30508,7 @@ var init_clear_command = __esm({
|
|
|
30509
30508
|
plan: getUserPlan(),
|
|
30510
30509
|
quotaLeft: context2.quotaLeft || 999
|
|
30511
30510
|
});
|
|
30512
|
-
const message =
|
|
30511
|
+
const message = chalk28__default.default.green("\u2705 Cleared") + chalk28__default.default.gray(" \xB7 context reset");
|
|
30513
30512
|
return this.success(withQuotaFooter(message, context2.quotaLeft));
|
|
30514
30513
|
} catch (error2) {
|
|
30515
30514
|
await trackCommand({
|
|
@@ -30520,7 +30519,7 @@ var init_clear_command = __esm({
|
|
|
30520
30519
|
quotaLeft: context2.quotaLeft || 999
|
|
30521
30520
|
});
|
|
30522
30521
|
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
30523
|
-
return this.success(
|
|
30522
|
+
return this.success(chalk28__default.default.green("\u2705 Cleared"));
|
|
30524
30523
|
}
|
|
30525
30524
|
}
|
|
30526
30525
|
};
|
|
@@ -31552,18 +31551,18 @@ var init_WhoAmICommand = __esm({
|
|
|
31552
31551
|
});
|
|
31553
31552
|
}
|
|
31554
31553
|
const lines = [];
|
|
31555
|
-
lines.push(
|
|
31554
|
+
lines.push(chalk28__default.default.green("\u2705 Authenticated"));
|
|
31556
31555
|
if (user.name) {
|
|
31557
|
-
lines.push(
|
|
31556
|
+
lines.push(chalk28__default.default.white(`\u{1F464} Name: ${chalk28__default.default.cyan(user.name)}`));
|
|
31558
31557
|
}
|
|
31559
31558
|
if (user.email) {
|
|
31560
|
-
lines.push(
|
|
31559
|
+
lines.push(chalk28__default.default.white(`\u{1F4E7} Email: ${chalk28__default.default.cyan(user.email)}`));
|
|
31561
31560
|
}
|
|
31562
31561
|
if (user.provider) {
|
|
31563
|
-
lines.push(
|
|
31562
|
+
lines.push(chalk28__default.default.white(`\u{1F511} Provider: ${chalk28__default.default.cyan(user.provider)}`));
|
|
31564
31563
|
}
|
|
31565
31564
|
if (user.plan) {
|
|
31566
|
-
lines.push(
|
|
31565
|
+
lines.push(chalk28__default.default.white(`\u{1F48E} Plan: ${chalk28__default.default.cyan(user.plan)}`));
|
|
31567
31566
|
}
|
|
31568
31567
|
return this.success(lines.join("\n"), { authenticated: true, user });
|
|
31569
31568
|
}
|
|
@@ -31590,40 +31589,40 @@ var init_about_command = __esm({
|
|
|
31590
31589
|
async execute(args2, context2) {
|
|
31591
31590
|
const output3 = [];
|
|
31592
31591
|
output3.push("");
|
|
31593
|
-
output3.push(
|
|
31594
|
-
output3.push(
|
|
31592
|
+
output3.push(chalk28__default.default.cyan.bold("\u{1F916} About MARIA v4.2.29"));
|
|
31593
|
+
output3.push(chalk28__default.default.gray("\u2550".repeat(40)));
|
|
31595
31594
|
output3.push("");
|
|
31596
|
-
output3.push(
|
|
31595
|
+
output3.push(chalk28__default.default.white.bold("MARIA - Minimal API, Maximum Power"));
|
|
31597
31596
|
output3.push("");
|
|
31598
|
-
output3.push(
|
|
31597
|
+
output3.push(chalk28__default.default.white("\u{1F3AF} Revolutionary AI Development Platform:"));
|
|
31599
31598
|
output3.push(" \u2022 Natural Language Code Operations");
|
|
31600
31599
|
output3.push(" \u2022 Graph RAG Knowledge System");
|
|
31601
31600
|
output3.push(" \u2022 Dual Memory Architecture");
|
|
31602
31601
|
output3.push(" \u2022 Enterprise-Grade Security");
|
|
31603
31602
|
output3.push(" \u2022 Multimodal AI Generation");
|
|
31604
31603
|
output3.push("");
|
|
31605
|
-
output3.push(
|
|
31604
|
+
output3.push(chalk28__default.default.white("\u{1F31F} Key Features:"));
|
|
31606
31605
|
output3.push(" \u2022 /code - Natural language coding");
|
|
31607
31606
|
output3.push(" \u2022 68+ Slash Commands");
|
|
31608
31607
|
output3.push(" \u2022 8 AI Provider Support");
|
|
31609
31608
|
output3.push(" \u2022 Business Operations Suite");
|
|
31610
31609
|
output3.push(" \u2022 Real-time Streaming");
|
|
31611
31610
|
output3.push("");
|
|
31612
|
-
output3.push(
|
|
31611
|
+
output3.push(chalk28__default.default.white("\u{1F468}\u200D\u{1F4BB} Created by:"));
|
|
31613
31612
|
output3.push(" \u2022 Bonginkan Team");
|
|
31614
31613
|
output3.push(" \u2022 Enterprise AI Solutions");
|
|
31615
31614
|
output3.push("");
|
|
31616
|
-
output3.push(
|
|
31617
|
-
output3.push(
|
|
31618
|
-
output3.push(
|
|
31619
|
-
output3.push(
|
|
31620
|
-
output3.push(
|
|
31621
|
-
output3.push(
|
|
31615
|
+
output3.push(chalk28__default.default.white("\u{1F517} Links:"));
|
|
31616
|
+
output3.push(chalk28__default.default.blue(" Website: https://maria-code.ai"));
|
|
31617
|
+
output3.push(chalk28__default.default.blue(" Company: https://bonginkan.ai"));
|
|
31618
|
+
output3.push(chalk28__default.default.blue(" Discord: https://discord.gg/SMSmSGcEQy"));
|
|
31619
|
+
output3.push(chalk28__default.default.blue(" GitHub: https://github.com/bonginkan/maria"));
|
|
31620
|
+
output3.push(chalk28__default.default.blue(" NPM: https://www.npmjs.com/package/@bonginkan/maria"));
|
|
31622
31621
|
output3.push("");
|
|
31623
|
-
output3.push(
|
|
31624
|
-
output3.push(
|
|
31622
|
+
output3.push(chalk28__default.default.white("\u{1F4C4} License: MIT"));
|
|
31623
|
+
output3.push(chalk28__default.default.white("\u{1F3D7}\uFE0F Built with: TypeScript, Node.js, React"));
|
|
31625
31624
|
output3.push("");
|
|
31626
|
-
output3.push(
|
|
31625
|
+
output3.push(chalk28__default.default.green("Thank you for using MARIA! \u{1F680}"));
|
|
31627
31626
|
output3.push("");
|
|
31628
31627
|
return {
|
|
31629
31628
|
success: true,
|
|
@@ -33642,8 +33641,8 @@ var init_ConfigCLI = __esm({
|
|
|
33642
33641
|
// Default to interactive
|
|
33643
33642
|
});
|
|
33644
33643
|
if (options2.verbose) {
|
|
33645
|
-
console.log(
|
|
33646
|
-
console.log(
|
|
33644
|
+
console.log(chalk28__default.default.gray(`Executing: ${operation} ${args2.join(" ")}`));
|
|
33645
|
+
console.log(chalk28__default.default.gray(`Options: ${JSON.stringify(options2, null, 2)}`));
|
|
33647
33646
|
}
|
|
33648
33647
|
const result2 = await command.execute();
|
|
33649
33648
|
if (result2.endReason === "success") {
|
|
@@ -33669,10 +33668,10 @@ var init_ConfigCLI = __esm({
|
|
|
33669
33668
|
await this.displayPreview(data2.preview);
|
|
33670
33669
|
if (data2.dryRun) {
|
|
33671
33670
|
console.log(
|
|
33672
|
-
|
|
33671
|
+
chalk28__default.default.blue("\n\u{1F4CB} This was a dry run - no changes were applied.")
|
|
33673
33672
|
);
|
|
33674
33673
|
console.log(
|
|
33675
|
-
|
|
33674
|
+
chalk28__default.default.gray(
|
|
33676
33675
|
"To apply changes, run the same command without --dry-run"
|
|
33677
33676
|
)
|
|
33678
33677
|
);
|
|
@@ -33680,30 +33679,30 @@ var init_ConfigCLI = __esm({
|
|
|
33680
33679
|
}
|
|
33681
33680
|
}
|
|
33682
33681
|
if (data2.message) {
|
|
33683
|
-
console.log(
|
|
33682
|
+
console.log(chalk28__default.default.green(data2.message));
|
|
33684
33683
|
}
|
|
33685
33684
|
if (data2.key && data2.value !== void 0) {
|
|
33686
|
-
console.log(
|
|
33685
|
+
console.log(chalk28__default.default.green(`\u2705 Configuration updated:`));
|
|
33687
33686
|
console.log(
|
|
33688
|
-
` ${
|
|
33687
|
+
` ${chalk28__default.default.bold(data2.key)}: ${chalk28__default.default.cyan(this.formatValue(data2.value))}`
|
|
33689
33688
|
);
|
|
33690
33689
|
if (data2.layer) {
|
|
33691
|
-
console.log(` Layer: ${
|
|
33690
|
+
console.log(` Layer: ${chalk28__default.default.magenta(data2.layer)}`);
|
|
33692
33691
|
}
|
|
33693
33692
|
}
|
|
33694
33693
|
if (data2.deleted) {
|
|
33695
33694
|
console.log(
|
|
33696
|
-
|
|
33695
|
+
chalk28__default.default.green(`\u2705 Configuration deleted: ${chalk28__default.default.bold(data2.key)}`)
|
|
33697
33696
|
);
|
|
33698
33697
|
}
|
|
33699
33698
|
if (data2.templateId) {
|
|
33700
33699
|
console.log(
|
|
33701
|
-
|
|
33700
|
+
chalk28__default.default.green(`\u2705 Template applied: ${chalk28__default.default.bold(data2.templateId)}`)
|
|
33702
33701
|
);
|
|
33703
33702
|
}
|
|
33704
33703
|
if (data2.rolledBack) {
|
|
33705
33704
|
console.log(
|
|
33706
|
-
|
|
33705
|
+
chalk28__default.default.green(`\u2705 Rolled back to entry: ${chalk28__default.default.bold(data2.entryId)}`)
|
|
33707
33706
|
);
|
|
33708
33707
|
}
|
|
33709
33708
|
if (data2.layers) {
|
|
@@ -33718,62 +33717,62 @@ var init_ConfigCLI = __esm({
|
|
|
33718
33717
|
console.log(JSON.stringify({ error: error2 }, null, 2));
|
|
33719
33718
|
return;
|
|
33720
33719
|
}
|
|
33721
|
-
console.error(
|
|
33720
|
+
console.error(chalk28__default.default.red(`\u274C Error: ${error2}`));
|
|
33722
33721
|
if (error2.includes("not found")) {
|
|
33723
33722
|
console.log(
|
|
33724
|
-
|
|
33723
|
+
chalk28__default.default.gray("\nTry: /config list # to see available configurations")
|
|
33725
33724
|
);
|
|
33726
33725
|
}
|
|
33727
33726
|
if (error2.includes("required")) {
|
|
33728
|
-
console.log(
|
|
33727
|
+
console.log(chalk28__default.default.gray("\nTry: /config help # to see command syntax"));
|
|
33729
33728
|
}
|
|
33730
33729
|
}
|
|
33731
33730
|
async displayPreview(preview) {
|
|
33732
|
-
console.log(
|
|
33733
|
-
console.log(`${
|
|
33731
|
+
console.log(chalk28__default.default.bold.cyan("\n\u{1F50D} Configuration Preview\n"));
|
|
33732
|
+
console.log(`${chalk28__default.default.bold("Operation:")} ${chalk28__default.default.cyan(preview.operation)}`);
|
|
33734
33733
|
if (preview.key) {
|
|
33735
|
-
console.log(`${
|
|
33734
|
+
console.log(`${chalk28__default.default.bold("Key:")} ${chalk28__default.default.yellow(preview.key)}`);
|
|
33736
33735
|
}
|
|
33737
33736
|
if (preview.value !== void 0) {
|
|
33738
33737
|
console.log(
|
|
33739
|
-
`${
|
|
33738
|
+
`${chalk28__default.default.bold("Value:")} ${chalk28__default.default.green(this.formatValue(preview.value))}`
|
|
33740
33739
|
);
|
|
33741
33740
|
}
|
|
33742
33741
|
if (preview.changes.length > 0) {
|
|
33743
|
-
console.log(
|
|
33742
|
+
console.log(chalk28__default.default.bold("\n\u{1F4DD} Changes:"));
|
|
33744
33743
|
for (const change of preview.changes) {
|
|
33745
33744
|
this.displayChange(change);
|
|
33746
33745
|
}
|
|
33747
33746
|
}
|
|
33748
33747
|
if (preview.affected.length > 0) {
|
|
33749
|
-
console.log(
|
|
33748
|
+
console.log(chalk28__default.default.bold("\n\u{1F517} Affected Configurations:"));
|
|
33750
33749
|
for (const affected of preview.affected) {
|
|
33751
33750
|
this.displayAffectedConfig(affected);
|
|
33752
33751
|
}
|
|
33753
33752
|
}
|
|
33754
33753
|
if (preview.risks.length > 0) {
|
|
33755
|
-
console.log(
|
|
33754
|
+
console.log(chalk28__default.default.bold("\n\u26A0\uFE0F Safety Analysis:"));
|
|
33756
33755
|
for (const risk of preview.risks) {
|
|
33757
33756
|
this.displaySafetyRisk(risk);
|
|
33758
33757
|
}
|
|
33759
33758
|
}
|
|
33760
33759
|
if (!preview.validation.ok) {
|
|
33761
|
-
console.log(
|
|
33760
|
+
console.log(chalk28__default.default.bold.red("\n\u274C Validation Errors:"));
|
|
33762
33761
|
if (preview.validation.errors) {
|
|
33763
33762
|
for (const error2 of preview.validation.errors) {
|
|
33764
|
-
console.log(` \u2022 ${
|
|
33763
|
+
console.log(` \u2022 ${chalk28__default.default.red(error2)}`);
|
|
33765
33764
|
}
|
|
33766
33765
|
}
|
|
33767
33766
|
} else if (preview.validation.warnings && preview.validation.warnings.length > 0) {
|
|
33768
|
-
console.log(
|
|
33767
|
+
console.log(chalk28__default.default.bold.yellow("\n\u26A0\uFE0F Validation Warnings:"));
|
|
33769
33768
|
for (const warning of preview.validation.warnings) {
|
|
33770
|
-
console.log(` \u2022 ${
|
|
33769
|
+
console.log(` \u2022 ${chalk28__default.default.yellow(warning)}`);
|
|
33771
33770
|
}
|
|
33772
33771
|
}
|
|
33773
33772
|
if (preview.requiresConfirmation && !preview.validation.dryRun) {
|
|
33774
33773
|
const confirmed = await this.promptConfirmation();
|
|
33775
33774
|
if (!confirmed) {
|
|
33776
|
-
console.log(
|
|
33775
|
+
console.log(chalk28__default.default.yellow("\n\u274C Operation cancelled"));
|
|
33777
33776
|
process.exit(0);
|
|
33778
33777
|
}
|
|
33779
33778
|
}
|
|
@@ -33785,42 +33784,42 @@ var init_ConfigCLI = __esm({
|
|
|
33785
33784
|
delete: "\u{1F5D1}\uFE0F"
|
|
33786
33785
|
};
|
|
33787
33786
|
const typeColor = {
|
|
33788
|
-
add:
|
|
33789
|
-
modify:
|
|
33790
|
-
delete:
|
|
33787
|
+
add: chalk28__default.default.green,
|
|
33788
|
+
modify: chalk28__default.default.yellow,
|
|
33789
|
+
delete: chalk28__default.default.red
|
|
33791
33790
|
};
|
|
33792
33791
|
console.log(
|
|
33793
|
-
` ${typeIcon[change.type]} ${typeColor[change.type](change.type.toUpperCase())}: ${
|
|
33792
|
+
` ${typeIcon[change.type]} ${typeColor[change.type](change.type.toUpperCase())}: ${chalk28__default.default.bold(change.key)}`
|
|
33794
33793
|
);
|
|
33795
33794
|
if (change.oldValue !== void 0) {
|
|
33796
33795
|
console.log(
|
|
33797
|
-
` ${
|
|
33796
|
+
` ${chalk28__default.default.gray("Old:")} ${chalk28__default.default.gray(this.formatValue(change.oldValue))}`
|
|
33798
33797
|
);
|
|
33799
33798
|
}
|
|
33800
33799
|
if (change.newValue !== void 0) {
|
|
33801
33800
|
console.log(
|
|
33802
|
-
` ${
|
|
33801
|
+
` ${chalk28__default.default.gray("New:")} ${chalk28__default.default.cyan(this.formatValue(change.newValue))}`
|
|
33803
33802
|
);
|
|
33804
33803
|
}
|
|
33805
|
-
console.log(` ${
|
|
33806
|
-
console.log(` ${
|
|
33804
|
+
console.log(` ${chalk28__default.default.gray("Layer:")} ${chalk28__default.default.magenta(change.layer)}`);
|
|
33805
|
+
console.log(` ${chalk28__default.default.gray(change.description)}`);
|
|
33807
33806
|
console.log();
|
|
33808
33807
|
}
|
|
33809
33808
|
displayAffectedConfig(affected) {
|
|
33810
33809
|
const impactColor = {
|
|
33811
|
-
low:
|
|
33812
|
-
medium:
|
|
33813
|
-
high:
|
|
33814
|
-
critical:
|
|
33810
|
+
low: chalk28__default.default.gray,
|
|
33811
|
+
medium: chalk28__default.default.yellow,
|
|
33812
|
+
high: chalk28__default.default.red,
|
|
33813
|
+
critical: chalk28__default.default.red.bold
|
|
33815
33814
|
};
|
|
33816
33815
|
console.log(
|
|
33817
|
-
` \u2022 ${
|
|
33816
|
+
` \u2022 ${chalk28__default.default.bold(affected.key)} (${chalk28__default.default.magenta(affected.layer)})`
|
|
33818
33817
|
);
|
|
33819
33818
|
console.log(
|
|
33820
33819
|
` Impact: ${impactColor[affected.impact](affected.impact.toUpperCase())}`
|
|
33821
33820
|
);
|
|
33822
|
-
console.log(` Relationship: ${
|
|
33823
|
-
console.log(` ${
|
|
33821
|
+
console.log(` Relationship: ${chalk28__default.default.cyan(affected.relationship)}`);
|
|
33822
|
+
console.log(` ${chalk28__default.default.gray(affected.description)}`);
|
|
33824
33823
|
console.log();
|
|
33825
33824
|
}
|
|
33826
33825
|
displaySafetyRisk(risk) {
|
|
@@ -33831,78 +33830,78 @@ var init_ConfigCLI = __esm({
|
|
|
33831
33830
|
critical: "\u{1F6A8}"
|
|
33832
33831
|
};
|
|
33833
33832
|
const levelColor = {
|
|
33834
|
-
info:
|
|
33835
|
-
warning:
|
|
33836
|
-
error:
|
|
33837
|
-
critical:
|
|
33833
|
+
info: chalk28__default.default.blue,
|
|
33834
|
+
warning: chalk28__default.default.yellow,
|
|
33835
|
+
error: chalk28__default.default.red,
|
|
33836
|
+
critical: chalk28__default.default.red.bold
|
|
33838
33837
|
};
|
|
33839
33838
|
console.log(
|
|
33840
33839
|
` ${levelIcon[risk.level]} ${levelColor[risk.level](risk.level.toUpperCase())}: ${risk.message}`
|
|
33841
33840
|
);
|
|
33842
33841
|
if (risk.recommendation) {
|
|
33843
33842
|
console.log(
|
|
33844
|
-
` ${
|
|
33843
|
+
` ${chalk28__default.default.gray("Recommendation:")} ${risk.recommendation}`
|
|
33845
33844
|
);
|
|
33846
33845
|
}
|
|
33847
33846
|
if (risk.autoFixable) {
|
|
33848
|
-
console.log(` ${
|
|
33847
|
+
console.log(` ${chalk28__default.default.green("Auto-fixable: Yes")}`);
|
|
33849
33848
|
}
|
|
33850
33849
|
console.log();
|
|
33851
33850
|
}
|
|
33852
33851
|
displayLayeredConfig(data2) {
|
|
33853
|
-
console.log(
|
|
33852
|
+
console.log(chalk28__default.default.bold(`
|
|
33854
33853
|
\u{1F4CB} ${data2.key} Configuration
|
|
33855
33854
|
`));
|
|
33856
33855
|
console.log(
|
|
33857
|
-
`${
|
|
33856
|
+
`${chalk28__default.default.bold("Effective Value:")} ${chalk28__default.default.cyan(this.formatValue(data2.value))}`
|
|
33858
33857
|
);
|
|
33859
|
-
console.log(`${
|
|
33858
|
+
console.log(`${chalk28__default.default.bold("Source Layer:")} ${chalk28__default.default.magenta(data2.source)}`);
|
|
33860
33859
|
console.log(
|
|
33861
|
-
`${
|
|
33860
|
+
`${chalk28__default.default.bold("Merged:")} ${data2.merged ? chalk28__default.default.yellow("Yes") : chalk28__default.default.gray("No")}`
|
|
33862
33861
|
);
|
|
33863
33862
|
if (data2.layers) {
|
|
33864
|
-
console.log(
|
|
33863
|
+
console.log(chalk28__default.default.bold("\nLayer Values:"));
|
|
33865
33864
|
const layers = ["runtime", "project", "user", "global"];
|
|
33866
33865
|
for (const layer of layers) {
|
|
33867
33866
|
const value = data2.layers[layer];
|
|
33868
33867
|
if (value !== void 0) {
|
|
33869
33868
|
const isActive = layer === data2.source;
|
|
33870
|
-
const layerDisplay = isActive ?
|
|
33869
|
+
const layerDisplay = isActive ? chalk28__default.default.bold.magenta(`${layer} (active)`) : chalk28__default.default.gray(layer);
|
|
33871
33870
|
console.log(
|
|
33872
|
-
` ${layerDisplay}: ${
|
|
33871
|
+
` ${layerDisplay}: ${chalk28__default.default.cyan(this.formatValue(value))}`
|
|
33873
33872
|
);
|
|
33874
33873
|
}
|
|
33875
33874
|
}
|
|
33876
33875
|
}
|
|
33877
33876
|
}
|
|
33878
33877
|
displayConfigList(configs) {
|
|
33879
|
-
console.log(
|
|
33878
|
+
console.log(chalk28__default.default.bold("\n\u2699\uFE0F Configuration Settings\n"));
|
|
33880
33879
|
if (Object.keys(configs).length === 0) {
|
|
33881
|
-
console.log(
|
|
33880
|
+
console.log(chalk28__default.default.gray("No configurations found."));
|
|
33882
33881
|
return;
|
|
33883
33882
|
}
|
|
33884
33883
|
const categorized = this.categorizeConfigs(configs);
|
|
33885
33884
|
for (const [category, items] of Object.entries(categorized)) {
|
|
33886
33885
|
if (Object.keys(items).length === 0) continue;
|
|
33887
33886
|
console.log(
|
|
33888
|
-
|
|
33887
|
+
chalk28__default.default.bold.cyan(`${this.getCategoryIcon(category)} ${category}`)
|
|
33889
33888
|
);
|
|
33890
|
-
console.log(
|
|
33889
|
+
console.log(chalk28__default.default.gray("\u2500".repeat(category.length + 4)));
|
|
33891
33890
|
for (const [key2, value] of Object.entries(items)) {
|
|
33892
33891
|
console.log(
|
|
33893
|
-
` ${
|
|
33892
|
+
` ${chalk28__default.default.bold(key2)}: ${chalk28__default.default.cyan(this.formatValue(value))}`
|
|
33894
33893
|
);
|
|
33895
33894
|
}
|
|
33896
33895
|
console.log();
|
|
33897
33896
|
}
|
|
33898
33897
|
console.log(
|
|
33899
|
-
|
|
33898
|
+
chalk28__default.default.gray(`Total: ${Object.keys(configs).length} configuration(s)`)
|
|
33900
33899
|
);
|
|
33901
33900
|
}
|
|
33902
33901
|
async promptConfirmation() {
|
|
33903
33902
|
return new Promise((resolve8) => {
|
|
33904
33903
|
this.rl.question(
|
|
33905
|
-
|
|
33904
|
+
chalk28__default.default.bold("\nDo you want to proceed? [y/N]: "),
|
|
33906
33905
|
(answer) => {
|
|
33907
33906
|
resolve8(["y", "yes", "Y", "YES"].includes(answer.trim()));
|
|
33908
33907
|
}
|
|
@@ -33911,20 +33910,20 @@ var init_ConfigCLI = __esm({
|
|
|
33911
33910
|
}
|
|
33912
33911
|
formatValue(value) {
|
|
33913
33912
|
if (value === null || value === void 0) {
|
|
33914
|
-
return
|
|
33913
|
+
return chalk28__default.default.gray("null");
|
|
33915
33914
|
}
|
|
33916
33915
|
if (typeof value === "string") {
|
|
33917
33916
|
const isSensitive = this.isSensitiveValue(value);
|
|
33918
33917
|
if (isSensitive) {
|
|
33919
|
-
return
|
|
33918
|
+
return chalk28__default.default.gray("********");
|
|
33920
33919
|
}
|
|
33921
33920
|
return `"${value}"`;
|
|
33922
33921
|
}
|
|
33923
33922
|
if (typeof value === "boolean") {
|
|
33924
|
-
return value ?
|
|
33923
|
+
return value ? chalk28__default.default.green("true") : chalk28__default.default.red("false");
|
|
33925
33924
|
}
|
|
33926
33925
|
if (typeof value === "number") {
|
|
33927
|
-
return
|
|
33926
|
+
return chalk28__default.default.blue(value.toString());
|
|
33928
33927
|
}
|
|
33929
33928
|
if (Array.isArray(value)) {
|
|
33930
33929
|
return `[${value.map((v) => this.formatValue(v)).join(", ")}]`;
|
|
@@ -35399,8 +35398,8 @@ var init_api_caller = __esm({
|
|
|
35399
35398
|
});
|
|
35400
35399
|
function handleRateLimitError(error2) {
|
|
35401
35400
|
console.log();
|
|
35402
|
-
console.log(
|
|
35403
|
-
console.log(
|
|
35401
|
+
console.log(chalk28__default.default.yellow("\u23F1\uFE0F Rate Limit Exceeded"));
|
|
35402
|
+
console.log(chalk28__default.default.gray("\u2501".repeat(50)));
|
|
35404
35403
|
const route = error2.route || error2.details?.endpoint || "API";
|
|
35405
35404
|
const plan = error2.plan || error2.details?.plan || "Unknown";
|
|
35406
35405
|
const limit = error2.limit || (error2.details?.limit ? parseInt(error2.details.limit) : null);
|
|
@@ -35418,24 +35417,24 @@ function handleRateLimitError(error2) {
|
|
|
35418
35417
|
resetTime = `at ${resetDate.toLocaleTimeString()}`;
|
|
35419
35418
|
}
|
|
35420
35419
|
}
|
|
35421
|
-
console.log(
|
|
35422
|
-
console.log(
|
|
35420
|
+
console.log(chalk28__default.default.white(`Plan: ${chalk28__default.default.bold(plan)}`));
|
|
35421
|
+
console.log(chalk28__default.default.white(`Endpoint: ${chalk28__default.default.bold(route)}`));
|
|
35423
35422
|
if (limit !== null) {
|
|
35424
|
-
console.log(
|
|
35423
|
+
console.log(chalk28__default.default.white(`Limit: ${chalk28__default.default.bold(limit)} requests`));
|
|
35425
35424
|
}
|
|
35426
35425
|
if (error2.remaining !== void 0) {
|
|
35427
|
-
console.log(
|
|
35426
|
+
console.log(chalk28__default.default.white(`Remaining: ${chalk28__default.default.bold(error2.remaining)} requests`));
|
|
35428
35427
|
}
|
|
35429
35428
|
console.log();
|
|
35430
|
-
console.log(
|
|
35429
|
+
console.log(chalk28__default.default.cyan(`Please wait ${chalk28__default.default.bold(waitTime)} before trying again`));
|
|
35431
35430
|
if (resetTime) {
|
|
35432
|
-
console.log(
|
|
35431
|
+
console.log(chalk28__default.default.gray(`Rate limit resets ${resetTime}`));
|
|
35433
35432
|
}
|
|
35434
35433
|
if (error2.hint) {
|
|
35435
35434
|
console.log();
|
|
35436
|
-
console.log(
|
|
35435
|
+
console.log(chalk28__default.default.magenta("\u{1F4A1} " + error2.hint));
|
|
35437
35436
|
}
|
|
35438
|
-
console.log(
|
|
35437
|
+
console.log(chalk28__default.default.gray("\u2501".repeat(50)));
|
|
35439
35438
|
console.log();
|
|
35440
35439
|
}
|
|
35441
35440
|
async function parseRateLimitResponse(response2) {
|
|
@@ -40346,7 +40345,7 @@ var init_model_selector_ui = __esm({
|
|
|
40346
40345
|
output: process.stdout,
|
|
40347
40346
|
terminal: true
|
|
40348
40347
|
});
|
|
40349
|
-
console.log(
|
|
40348
|
+
console.log(chalk28__default.default.green(
|
|
40350
40349
|
"\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"
|
|
40351
40350
|
));
|
|
40352
40351
|
process.stdout.write("\x1B7");
|
|
@@ -40414,14 +40413,14 @@ var init_model_selector_ui = __esm({
|
|
|
40414
40413
|
}
|
|
40415
40414
|
renderFromSavedPosition() {
|
|
40416
40415
|
if (this.isDestroyed) return;
|
|
40417
|
-
console.log(
|
|
40418
|
-
"\u2502 " +
|
|
40416
|
+
console.log(chalk28__default.default.green(
|
|
40417
|
+
"\u2502 " + chalk28__default.default.greenBright("SELECT MODEL:") + " ".repeat(62) + "\u2502"
|
|
40419
40418
|
));
|
|
40420
40419
|
this.renderContent();
|
|
40421
40420
|
const scrollInfo = `[${this.selectedIndex + 1}/${this.models.length}]`;
|
|
40422
40421
|
const helpText = `\u2193:NEXT \u2191:PREV ENTER:EXEC ESC:ABORT ${scrollInfo}`;
|
|
40423
|
-
console.log(
|
|
40424
|
-
console.log(
|
|
40422
|
+
console.log(chalk28__default.default.green("\u2502 ") + chalk28__default.default.dim.green(helpText.padEnd(76)) + chalk28__default.default.green(" \u2502"));
|
|
40423
|
+
console.log(chalk28__default.default.green(
|
|
40425
40424
|
"\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"
|
|
40426
40425
|
));
|
|
40427
40426
|
}
|
|
@@ -40462,19 +40461,19 @@ var init_model_selector_ui = __esm({
|
|
|
40462
40461
|
const item = displayItems[i2];
|
|
40463
40462
|
if (item.type === "group") {
|
|
40464
40463
|
console.log(
|
|
40465
|
-
|
|
40464
|
+
chalk28__default.default.green("\u2502") + chalk28__default.default.dim.green(" \u2501\u2501\u2501 ") + chalk28__default.default.greenBright(item.content.substring(2, item.content.indexOf(" \u2500"))) + chalk28__default.default.dim.green(" " + "\u2501".repeat(71 - item.content.indexOf(" \u2500"))) + chalk28__default.default.green("\u2502")
|
|
40466
40465
|
);
|
|
40467
40466
|
} else {
|
|
40468
40467
|
const isSelected = item.modelIndex === this.selectedIndex;
|
|
40469
|
-
const prefix = isSelected ?
|
|
40468
|
+
const prefix = isSelected ? chalk28__default.default.greenBright("\u25B6 ") : " ";
|
|
40470
40469
|
const modelText = item.content;
|
|
40471
40470
|
if (isSelected) {
|
|
40472
40471
|
console.log(
|
|
40473
|
-
|
|
40472
|
+
chalk28__default.default.green("\u2502") + prefix + chalk28__default.default.black.bgGreen(modelText.padEnd(75)) + chalk28__default.default.green("\u2502")
|
|
40474
40473
|
);
|
|
40475
40474
|
} else {
|
|
40476
40475
|
console.log(
|
|
40477
|
-
|
|
40476
|
+
chalk28__default.default.green("\u2502") + prefix + chalk28__default.default.green(modelText.substring(0, 75).padEnd(75)) + chalk28__default.default.green("\u2502")
|
|
40478
40477
|
);
|
|
40479
40478
|
}
|
|
40480
40479
|
}
|
|
@@ -42619,129 +42618,129 @@ function displayStartupLogo() {
|
|
|
42619
42618
|
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
42620
42619
|
console.log("");
|
|
42621
42620
|
console.log(
|
|
42622
|
-
|
|
42621
|
+
chalk28__default.default.magentaBright(
|
|
42623
42622
|
"\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"
|
|
42624
42623
|
)
|
|
42625
42624
|
);
|
|
42626
42625
|
console.log(
|
|
42627
|
-
|
|
42626
|
+
chalk28__default.default.magentaBright(
|
|
42628
42627
|
"\u2551 \u2551"
|
|
42629
42628
|
)
|
|
42630
42629
|
);
|
|
42631
42630
|
console.log(
|
|
42632
|
-
|
|
42631
|
+
chalk28__default.default.magentaBright(
|
|
42633
42632
|
"\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"
|
|
42634
42633
|
)
|
|
42635
42634
|
);
|
|
42636
42635
|
console.log(
|
|
42637
|
-
|
|
42636
|
+
chalk28__default.default.magentaBright(
|
|
42638
42637
|
"\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"
|
|
42639
42638
|
)
|
|
42640
42639
|
);
|
|
42641
42640
|
console.log(
|
|
42642
|
-
|
|
42641
|
+
chalk28__default.default.magentaBright(
|
|
42643
42642
|
"\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"
|
|
42644
42643
|
)
|
|
42645
42644
|
);
|
|
42646
42645
|
console.log(
|
|
42647
|
-
|
|
42646
|
+
chalk28__default.default.magentaBright(
|
|
42648
42647
|
"\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"
|
|
42649
42648
|
)
|
|
42650
42649
|
);
|
|
42651
42650
|
console.log(
|
|
42652
|
-
|
|
42651
|
+
chalk28__default.default.magentaBright(
|
|
42653
42652
|
"\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"
|
|
42654
42653
|
)
|
|
42655
42654
|
);
|
|
42656
42655
|
console.log(
|
|
42657
|
-
|
|
42656
|
+
chalk28__default.default.magentaBright(
|
|
42658
42657
|
"\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"
|
|
42659
42658
|
)
|
|
42660
42659
|
);
|
|
42661
42660
|
console.log(
|
|
42662
|
-
|
|
42661
|
+
chalk28__default.default.magentaBright(
|
|
42663
42662
|
"\u2551 \u2551"
|
|
42664
42663
|
)
|
|
42665
42664
|
);
|
|
42666
42665
|
console.log(
|
|
42667
|
-
|
|
42666
|
+
chalk28__default.default.magentaBright(
|
|
42668
42667
|
"\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"
|
|
42669
42668
|
)
|
|
42670
42669
|
);
|
|
42671
42670
|
console.log(
|
|
42672
|
-
|
|
42671
|
+
chalk28__default.default.magentaBright(
|
|
42673
42672
|
"\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"
|
|
42674
42673
|
)
|
|
42675
42674
|
);
|
|
42676
42675
|
console.log(
|
|
42677
|
-
|
|
42676
|
+
chalk28__default.default.magentaBright(
|
|
42678
42677
|
"\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2551"
|
|
42679
42678
|
)
|
|
42680
42679
|
);
|
|
42681
42680
|
console.log(
|
|
42682
|
-
|
|
42681
|
+
chalk28__default.default.magentaBright(
|
|
42683
42682
|
"\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2551"
|
|
42684
42683
|
)
|
|
42685
42684
|
);
|
|
42686
42685
|
console.log(
|
|
42687
|
-
|
|
42686
|
+
chalk28__default.default.magentaBright(
|
|
42688
42687
|
"\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"
|
|
42689
42688
|
)
|
|
42690
42689
|
);
|
|
42691
42690
|
console.log(
|
|
42692
|
-
|
|
42691
|
+
chalk28__default.default.magentaBright(
|
|
42693
42692
|
"\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"
|
|
42694
42693
|
)
|
|
42695
42694
|
);
|
|
42696
42695
|
console.log(
|
|
42697
|
-
|
|
42696
|
+
chalk28__default.default.magentaBright(
|
|
42698
42697
|
"\u2551 \u2551"
|
|
42699
42698
|
)
|
|
42700
42699
|
);
|
|
42701
42700
|
console.log(
|
|
42702
|
-
|
|
42701
|
+
chalk28__default.default.magentaBright(
|
|
42703
42702
|
"\u2551 AI-Powered Development Platform \u2551"
|
|
42704
42703
|
)
|
|
42705
42704
|
);
|
|
42706
42705
|
console.log(
|
|
42707
|
-
|
|
42706
|
+
chalk28__default.default.magentaBright(
|
|
42708
42707
|
"\u2551 (c) 2025 Bonginkan Inc. \u2551"
|
|
42709
42708
|
)
|
|
42710
42709
|
);
|
|
42711
42710
|
console.log(
|
|
42712
|
-
|
|
42711
|
+
chalk28__default.default.magentaBright(
|
|
42713
42712
|
"\u2551 \u2551"
|
|
42714
42713
|
)
|
|
42715
42714
|
);
|
|
42716
42715
|
console.log(
|
|
42717
|
-
|
|
42716
|
+
chalk28__default.default.magentaBright(
|
|
42718
42717
|
"\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"
|
|
42719
42718
|
)
|
|
42720
42719
|
);
|
|
42721
42720
|
console.log("");
|
|
42722
42721
|
console.log(
|
|
42723
|
-
|
|
42722
|
+
chalk28__default.default.cyan.bold(`MARIA CODE v${getVersion()}`) + chalk28__default.default.gray(" \u2014 Ready")
|
|
42724
42723
|
);
|
|
42725
42724
|
console.log(
|
|
42726
|
-
|
|
42725
|
+
chalk28__default.default.yellow("Type /login to get started \xB7 /help for commands")
|
|
42727
42726
|
);
|
|
42728
42727
|
console.log("");
|
|
42729
42728
|
}
|
|
42730
42729
|
function displayCompactLogo() {
|
|
42731
42730
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
42732
42731
|
console.log(
|
|
42733
|
-
|
|
42732
|
+
chalk28__default.default.cyan.bold(`MARIA CODE v${getVersion()}`) + chalk28__default.default.gray(" \u2014 Ready")
|
|
42734
42733
|
);
|
|
42735
42734
|
console.log(
|
|
42736
|
-
|
|
42735
|
+
chalk28__default.default.yellow("Type /login to get started \xB7 /help for commands")
|
|
42737
42736
|
);
|
|
42738
42737
|
console.log("");
|
|
42739
42738
|
}
|
|
42740
42739
|
function displayDashboardHeader() {
|
|
42741
42740
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
42742
|
-
const version =
|
|
42743
|
-
const commands =
|
|
42744
|
-
const providers =
|
|
42741
|
+
const version = chalk28__default.default.cyan.bold(`MARIA CODE v${getVersion()}`);
|
|
42742
|
+
const commands = chalk28__default.default.gray(" | /help /status /model");
|
|
42743
|
+
const providers = chalk28__default.default.gray(
|
|
42745
42744
|
"Providers: 8/8 OK (openai, anthropic, google, groq, lmstudio, ollama, vllm)"
|
|
42746
42745
|
);
|
|
42747
42746
|
console.log(version + commands);
|
|
@@ -42750,8 +42749,8 @@ function displayDashboardHeader() {
|
|
|
42750
42749
|
}
|
|
42751
42750
|
function displayLogsBox(logs) {
|
|
42752
42751
|
const width = getResponsiveWidth({ marginLeft: 5, marginRight: 5, maxWidth: 120 });
|
|
42753
|
-
const borderColor =
|
|
42754
|
-
const titleColor =
|
|
42752
|
+
const borderColor = chalk28__default.default.white;
|
|
42753
|
+
const titleColor = chalk28__default.default.cyan;
|
|
42755
42754
|
const topLeft = "\u250C";
|
|
42756
42755
|
const topRight = "\u2510";
|
|
42757
42756
|
const bottomLeft = "\u2514";
|
|
@@ -42784,7 +42783,7 @@ function displayLogsBox(logs) {
|
|
|
42784
42783
|
function displaySpinner(text = "Processing") {
|
|
42785
42784
|
const spinnerFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
42786
42785
|
const frame = spinnerFrames[Math.floor(Date.now() / 80) % spinnerFrames.length];
|
|
42787
|
-
process.stdout.write(`\r[${
|
|
42786
|
+
process.stdout.write(`\r[${chalk28__default.default.cyan(frame)}] ${text}...`);
|
|
42788
42787
|
}
|
|
42789
42788
|
function getCurrentPath() {
|
|
42790
42789
|
return process.cwd();
|
|
@@ -42802,18 +42801,18 @@ async function displayFinalStartupScreen(_selectedProvider, _selectedModel) {
|
|
|
42802
42801
|
const version = getVersion();
|
|
42803
42802
|
const systemInfo = getSystemInfo();
|
|
42804
42803
|
console.log(
|
|
42805
|
-
|
|
42804
|
+
chalk28__default.default.cyan.bold(`MARIA CODE v${version}`) + chalk28__default.default.gray(" \u2014 Ready")
|
|
42806
42805
|
);
|
|
42807
42806
|
const cwd2 = systemInfo.cwd.replace(os12__namespace.homedir(), "~");
|
|
42808
|
-
console.log(
|
|
42809
|
-
console.log(
|
|
42810
|
-
console.log(
|
|
42807
|
+
console.log(chalk28__default.default.gray("cwd: ") + chalk28__default.default.white(cwd2));
|
|
42808
|
+
console.log(chalk28__default.default.gray("Not signed in"));
|
|
42809
|
+
console.log(chalk28__default.default.yellow("Tip: /login \xB7 /help \xB7 /help code"));
|
|
42811
42810
|
console.log("");
|
|
42812
42811
|
}
|
|
42813
42812
|
function displayRoundedInputBox() {
|
|
42814
42813
|
const width = getResponsiveWidth({ marginLeft: 5, marginRight: 5, maxWidth: 90 });
|
|
42815
|
-
const borderColor =
|
|
42816
|
-
const promptColor =
|
|
42814
|
+
const borderColor = chalk28__default.default.white;
|
|
42815
|
+
const promptColor = chalk28__default.default.cyan;
|
|
42817
42816
|
const topLeft = "\u256D";
|
|
42818
42817
|
const topRight = "\u256E";
|
|
42819
42818
|
const bottomLeft = "\u2570";
|
|
@@ -42823,7 +42822,7 @@ function displayRoundedInputBox() {
|
|
|
42823
42822
|
const lines = [];
|
|
42824
42823
|
lines.push(borderColor(topLeft + horizontal.repeat(width - 2) + topRight));
|
|
42825
42824
|
const promptStr = promptColor("> ");
|
|
42826
|
-
const placeholder =
|
|
42825
|
+
const placeholder = chalk28__default.default.gray("");
|
|
42827
42826
|
const inputLine = promptStr + placeholder;
|
|
42828
42827
|
const padding = width - 4;
|
|
42829
42828
|
lines.push(
|
|
@@ -42977,29 +42976,29 @@ var init_provider_selector = __esm({
|
|
|
42977
42976
|
const inquirer = await import('inquirer');
|
|
42978
42977
|
const prompt = inquirer.default?.prompt || inquirer.prompt;
|
|
42979
42978
|
const providers = await this.getAvailableProviders();
|
|
42980
|
-
console.log(
|
|
42981
|
-
console.log(
|
|
42979
|
+
console.log(chalk28__default.default.cyan("\nAvailable AI Providers:"));
|
|
42980
|
+
console.log(chalk28__default.default.gray("\u2500".repeat(50)));
|
|
42982
42981
|
const _cloudProviders = providers.filter((p) => p.type === "cloud");
|
|
42983
42982
|
const _localProviders = providers.filter((p) => p.type === "local");
|
|
42984
42983
|
if (_cloudProviders.length > 0) {
|
|
42985
|
-
console.log(
|
|
42984
|
+
console.log(chalk28__default.default.yellow("\n\u2601\uFE0F Cloud AI:"));
|
|
42986
42985
|
_cloudProviders.forEach((p) => {
|
|
42987
42986
|
if (p.available) {
|
|
42988
42987
|
console.log(
|
|
42989
|
-
` ${
|
|
42988
|
+
` ${chalk28__default.default.green("*")} ${chalk28__default.default.white(p.name.split(" ")[0])}`
|
|
42990
42989
|
);
|
|
42991
42990
|
} else {
|
|
42992
|
-
console.log(` ${
|
|
42991
|
+
console.log(` ${chalk28__default.default.gray(p.name.split(" ")[0])}`);
|
|
42993
42992
|
}
|
|
42994
42993
|
});
|
|
42995
42994
|
}
|
|
42996
42995
|
if (_localProviders.length > 0) {
|
|
42997
|
-
console.log(
|
|
42996
|
+
console.log(chalk28__default.default.cyan("\n\u{1F4BB} Local AI:"));
|
|
42998
42997
|
_localProviders.forEach((p) => {
|
|
42999
42998
|
if (p.available) {
|
|
43000
|
-
console.log(` ${
|
|
42999
|
+
console.log(` ${chalk28__default.default.green("*")} ${chalk28__default.default.white(p.name)}`);
|
|
43001
43000
|
} else {
|
|
43002
|
-
console.log(` ${
|
|
43001
|
+
console.log(` ${chalk28__default.default.green("*")} ${chalk28__default.default.gray(p.name)}`);
|
|
43003
43002
|
}
|
|
43004
43003
|
});
|
|
43005
43004
|
}
|
|
@@ -43014,20 +43013,20 @@ var init_provider_selector = __esm({
|
|
|
43014
43013
|
});
|
|
43015
43014
|
if (selectableProviders.length === 0) {
|
|
43016
43015
|
console.log(
|
|
43017
|
-
|
|
43016
|
+
chalk28__default.default.yellow("\n\u26A0\uFE0F No AI providers are currently available.")
|
|
43018
43017
|
);
|
|
43019
|
-
console.log(
|
|
43018
|
+
console.log(chalk28__default.default.gray("\nTo use MARIA, you need to:"));
|
|
43020
43019
|
console.log(
|
|
43021
|
-
|
|
43020
|
+
chalk28__default.default.gray(
|
|
43022
43021
|
"1. Set up API keys for cloud providers (OpenAI, Anthropic, Google, etc.)"
|
|
43023
43022
|
)
|
|
43024
43023
|
);
|
|
43025
|
-
console.log(
|
|
43024
|
+
console.log(chalk28__default.default.gray(" Example: export OPENAI_API_KEY=your_api_key"));
|
|
43026
43025
|
console.log(
|
|
43027
|
-
|
|
43026
|
+
chalk28__default.default.gray("2. Or start a local AI service (Ollama, LM Studio, vLLM)")
|
|
43028
43027
|
);
|
|
43029
|
-
console.log(
|
|
43030
|
-
console.log(
|
|
43028
|
+
console.log(chalk28__default.default.gray(" Example: maria setup-ollama"));
|
|
43029
|
+
console.log(chalk28__default.default.gray("\nFor more information, run: maria --help"));
|
|
43031
43030
|
process.exit(1);
|
|
43032
43031
|
}
|
|
43033
43032
|
const choices = selectableProviders.map((p) => ({
|
|
@@ -43048,29 +43047,29 @@ var init_provider_selector = __esm({
|
|
|
43048
43047
|
const provider = providers.find((p) => p.value === selectedProvider);
|
|
43049
43048
|
if (provider && provider.type === "local" && !provider.available) {
|
|
43050
43049
|
console.log(
|
|
43051
|
-
|
|
43050
|
+
chalk28__default.default.yellow(`
|
|
43052
43051
|
\u26A0\uFE0F ${provider.name} is not currently running.`)
|
|
43053
43052
|
);
|
|
43054
|
-
console.log(
|
|
43053
|
+
console.log(chalk28__default.default.gray(`
|
|
43055
43054
|
To use ${provider.name}, you need to:`));
|
|
43056
43055
|
if (selectedProvider === "ollama") {
|
|
43057
|
-
console.log(
|
|
43058
|
-
console.log(
|
|
43059
|
-
console.log(
|
|
43056
|
+
console.log(chalk28__default.default.gray("1. Install Ollama: brew install ollama"));
|
|
43057
|
+
console.log(chalk28__default.default.gray("2. Start Ollama: ollama serve"));
|
|
43058
|
+
console.log(chalk28__default.default.gray("3. Pull a model: ollama pull llama3.2:3b"));
|
|
43060
43059
|
console.log(
|
|
43061
|
-
|
|
43060
|
+
chalk28__default.default.gray("\nOr use the setup command: maria setup-ollama")
|
|
43062
43061
|
);
|
|
43063
43062
|
} else if (selectedProvider === "lmstudio") {
|
|
43064
43063
|
console.log(
|
|
43065
|
-
|
|
43064
|
+
chalk28__default.default.gray("1. Download LM Studio from https://lmstudio.ai")
|
|
43066
43065
|
);
|
|
43067
|
-
console.log(
|
|
43068
|
-
console.log(
|
|
43069
|
-
console.log(
|
|
43066
|
+
console.log(chalk28__default.default.gray("2. Start LM Studio application"));
|
|
43067
|
+
console.log(chalk28__default.default.gray("3. Load a model in LM Studio"));
|
|
43068
|
+
console.log(chalk28__default.default.gray("4. Start the local server in LM Studio"));
|
|
43070
43069
|
} else if (selectedProvider === "vllm") {
|
|
43071
|
-
console.log(
|
|
43072
|
-
console.log(
|
|
43073
|
-
console.log(
|
|
43070
|
+
console.log(chalk28__default.default.gray("1. Install vLLM: pip install vllm"));
|
|
43071
|
+
console.log(chalk28__default.default.gray("2. Start vLLM server with a model"));
|
|
43072
|
+
console.log(chalk28__default.default.gray("\nOr use the setup command: maria setup-vllm"));
|
|
43074
43073
|
}
|
|
43075
43074
|
process.exit(1);
|
|
43076
43075
|
}
|
|
@@ -46325,7 +46324,7 @@ var init_IntelligentRouterService = __esm({
|
|
|
46325
46324
|
this.emit("initialized");
|
|
46326
46325
|
} catch (_error) {
|
|
46327
46326
|
console._error(
|
|
46328
|
-
|
|
46327
|
+
chalk28__default.default.red("Failed to initialize Intelligent Router:"),
|
|
46329
46328
|
_error
|
|
46330
46329
|
);
|
|
46331
46330
|
throw _error;
|
|
@@ -46379,7 +46378,7 @@ var init_IntelligentRouterService = __esm({
|
|
|
46379
46378
|
} catch (_error) {
|
|
46380
46379
|
this.metrics.failedRoutes++;
|
|
46381
46380
|
this.emit("route:_error", { input: input3, _error });
|
|
46382
|
-
console._error(
|
|
46381
|
+
console._error(chalk28__default.default.red("Routing _error:"), _error);
|
|
46383
46382
|
return null;
|
|
46384
46383
|
}
|
|
46385
46384
|
}
|
|
@@ -49118,16 +49117,16 @@ var init_log_symbols = __esm({
|
|
|
49118
49117
|
"node_modules/.pnpm/log-symbols@6.0.0/node_modules/log-symbols/index.js"() {
|
|
49119
49118
|
init_is_unicode_supported();
|
|
49120
49119
|
main = {
|
|
49121
|
-
info:
|
|
49122
|
-
success:
|
|
49123
|
-
warning:
|
|
49124
|
-
error:
|
|
49120
|
+
info: chalk28__default.default.blue("\u2139"),
|
|
49121
|
+
success: chalk28__default.default.green("\u2714"),
|
|
49122
|
+
warning: chalk28__default.default.yellow("\u26A0"),
|
|
49123
|
+
error: chalk28__default.default.red("\u2716")
|
|
49125
49124
|
};
|
|
49126
49125
|
fallback = {
|
|
49127
|
-
info:
|
|
49128
|
-
success:
|
|
49129
|
-
warning:
|
|
49130
|
-
error:
|
|
49126
|
+
info: chalk28__default.default.blue("i"),
|
|
49127
|
+
success: chalk28__default.default.green("\u221A"),
|
|
49128
|
+
warning: chalk28__default.default.yellow("\u203C"),
|
|
49129
|
+
error: chalk28__default.default.red("\xD7")
|
|
49131
49130
|
};
|
|
49132
49131
|
logSymbols = isUnicodeSupported() ? main : fallback;
|
|
49133
49132
|
log_symbols_default = logSymbols;
|
|
@@ -49524,7 +49523,7 @@ var init_ora = __esm({
|
|
|
49524
49523
|
const { frames } = this.#spinner;
|
|
49525
49524
|
let frame = frames[this.#frameIndex];
|
|
49526
49525
|
if (this.color) {
|
|
49527
|
-
frame =
|
|
49526
|
+
frame = chalk28__default.default[this.color](frame);
|
|
49528
49527
|
}
|
|
49529
49528
|
const fullPrefixText = typeof this.#prefixText === "string" && this.#prefixText !== "" ? this.#prefixText + " " : "";
|
|
49530
49529
|
const fullText = typeof this.text === "string" ? " " + this.text : "";
|
|
@@ -49644,28 +49643,28 @@ var init_ChalkAdapter = __esm({
|
|
|
49644
49643
|
spinnerId = 0;
|
|
49645
49644
|
async showWelcome() {
|
|
49646
49645
|
console.log(
|
|
49647
|
-
|
|
49646
|
+
chalk28__default.default.cyan.bold("\n\u{1F916} Welcome to MARIA Interactive Session v3.5.0")
|
|
49648
49647
|
);
|
|
49649
|
-
console.log(
|
|
49648
|
+
console.log(chalk28__default.default.gray("Type /help for available commands\n"));
|
|
49650
49649
|
}
|
|
49651
49650
|
showGoodbye() {
|
|
49652
49651
|
this.stopAllSpinners();
|
|
49653
|
-
console.log(
|
|
49652
|
+
console.log(chalk28__default.default.green("\n\u{1F44B} Goodbye! Thank you for using MARIA.\n"));
|
|
49654
49653
|
}
|
|
49655
49654
|
async print(message) {
|
|
49656
49655
|
console.log(message);
|
|
49657
49656
|
}
|
|
49658
49657
|
error(message) {
|
|
49659
|
-
console.error(
|
|
49658
|
+
console.error(chalk28__default.default.red(`\u274C ${message}`));
|
|
49660
49659
|
}
|
|
49661
49660
|
success(message) {
|
|
49662
|
-
console.log(
|
|
49661
|
+
console.log(chalk28__default.default.green(`\u2705 ${message}`));
|
|
49663
49662
|
}
|
|
49664
49663
|
warning(message) {
|
|
49665
|
-
console.warn(
|
|
49664
|
+
console.warn(chalk28__default.default.yellow(`\u26A0\uFE0F ${message}`));
|
|
49666
49665
|
}
|
|
49667
49666
|
info(message) {
|
|
49668
|
-
console.info(
|
|
49667
|
+
console.info(chalk28__default.default.blue(`\u2139\uFE0F ${message}`));
|
|
49669
49668
|
}
|
|
49670
49669
|
startSpinner(message) {
|
|
49671
49670
|
const id = `spinner-${++this.spinnerId}`;
|
|
@@ -49715,12 +49714,12 @@ var init_ChalkAdapter = __esm({
|
|
|
49715
49714
|
* Format helpers for consistent styling
|
|
49716
49715
|
*/
|
|
49717
49716
|
static format = {
|
|
49718
|
-
command: (text) =>
|
|
49719
|
-
keyword: (text) =>
|
|
49720
|
-
value: (text) =>
|
|
49721
|
-
dim: (text) =>
|
|
49722
|
-
bold: (text) =>
|
|
49723
|
-
code: (text) =>
|
|
49717
|
+
command: (text) => chalk28__default.default.cyan(text),
|
|
49718
|
+
keyword: (text) => chalk28__default.default.magenta(text),
|
|
49719
|
+
value: (text) => chalk28__default.default.green(text),
|
|
49720
|
+
dim: (text) => chalk28__default.default.gray(text),
|
|
49721
|
+
bold: (text) => chalk28__default.default.bold(text),
|
|
49722
|
+
code: (text) => chalk28__default.default.bgGray.white(` ${text} `)
|
|
49724
49723
|
};
|
|
49725
49724
|
};
|
|
49726
49725
|
}
|
|
@@ -54870,26 +54869,26 @@ var init_QuickApprovalInterface = __esm({
|
|
|
54870
54869
|
const _lang = options2.language || "en";
|
|
54871
54870
|
const _labels = LANGUAGE_LABELS[_lang] || LANGUAGE_LABELS.en;
|
|
54872
54871
|
console.log("");
|
|
54873
|
-
console.log(
|
|
54872
|
+
console.log(chalk28__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"));
|
|
54874
54873
|
console.log(
|
|
54875
|
-
|
|
54874
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
54876
54875
|
` ${_labels.approvalRequest}${" ".repeat(Math.max(0, 43 - _labels.approvalRequest.length))}`
|
|
54877
|
-
) +
|
|
54876
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54878
54877
|
);
|
|
54879
|
-
console.log(
|
|
54878
|
+
console.log(chalk28__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"));
|
|
54880
54879
|
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")}`;
|
|
54881
54880
|
console.log(
|
|
54882
|
-
|
|
54883
|
-
` > ${_labels.id}: ${
|
|
54884
|
-
) +
|
|
54881
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
54882
|
+
` > ${_labels.id}: ${chalk28__default.default.yellow(_requestId)}${" ".repeat(Math.max(0, 35 - _requestId.length - _labels.id.length))}`
|
|
54883
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54885
54884
|
);
|
|
54886
54885
|
const _title = _request.context?.description || _request.themeId || "API Cache Improvement";
|
|
54887
54886
|
const _titleDisplay = _title.length > 25 ? _title.substring(0, 22) + "..." : _title;
|
|
54888
54887
|
const _titleLabel = ` ${_labels._title}:`;
|
|
54889
54888
|
console.log(
|
|
54890
|
-
|
|
54889
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
54891
54890
|
`${_titleLabel} ${_titleDisplay}${" ".repeat(Math.max(0, 42 - _titleLabel.length - _titleDisplay.length))}`
|
|
54892
|
-
) +
|
|
54891
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54893
54892
|
);
|
|
54894
54893
|
const _riskLevel = this.formatRiskLevelSimple(_request.riskAssessment);
|
|
54895
54894
|
const _approvalsCount = _riskLevel === "HIGH" || _riskLevel === "CRITICAL" ? "2" : "1";
|
|
@@ -54897,37 +54896,37 @@ var init_QuickApprovalInterface = __esm({
|
|
|
54897
54896
|
const _levelLabel = ` ${_labels.level}:`;
|
|
54898
54897
|
const _levelDisplay = `${_riskLevel} ${_approvalsText}`;
|
|
54899
54898
|
console.log(
|
|
54900
|
-
|
|
54899
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
54901
54900
|
`${_levelLabel} ${_levelDisplay}${" ".repeat(Math.max(0, 42 - _levelLabel.length - _levelDisplay.length))}`
|
|
54902
|
-
) +
|
|
54901
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54903
54902
|
);
|
|
54904
54903
|
const _impact = _request.estimatedTime || "p95 latency -20%";
|
|
54905
54904
|
const _impactLabel = ` ${_labels._impact}:`;
|
|
54906
54905
|
console.log(
|
|
54907
|
-
|
|
54906
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
54908
54907
|
`${_impactLabel} ${_impact}${" ".repeat(Math.max(0, 42 - _impactLabel.length - _impact.length))}`
|
|
54909
|
-
) +
|
|
54908
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54910
54909
|
);
|
|
54911
54910
|
const _approversLabel = ` ${_labels.approvers}:`;
|
|
54912
54911
|
const _approversStatus = "[x] Lead [ ] QA";
|
|
54913
54912
|
console.log(
|
|
54914
|
-
|
|
54913
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
54915
54914
|
`${_approversLabel} ${_approversStatus}${" ".repeat(Math.max(0, 42 - _approversLabel.length - _approversStatus.length))}`
|
|
54916
|
-
) +
|
|
54915
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54917
54916
|
);
|
|
54918
54917
|
const _deadline = new Date(Date.now() + 30 * 60 * 1e3);
|
|
54919
54918
|
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")}`;
|
|
54920
54919
|
const _deadlineLabel = ` ${_labels._deadline}:`;
|
|
54921
54920
|
console.log(
|
|
54922
|
-
|
|
54921
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
54923
54922
|
`${_deadlineLabel} ${_timeStr}${" ".repeat(Math.max(0, 42 - _deadlineLabel.length - _timeStr.length))}`
|
|
54924
|
-
) +
|
|
54923
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54925
54924
|
);
|
|
54926
|
-
console.log(
|
|
54925
|
+
console.log(chalk28__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"));
|
|
54927
54926
|
console.log(
|
|
54928
|
-
|
|
54927
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
54929
54928
|
` ${_labels.actions}:${" ".repeat(Math.max(0, 42 - _labels.actions.length))}`
|
|
54930
|
-
) +
|
|
54929
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54931
54930
|
);
|
|
54932
54931
|
this.menuOptions.forEach((option, _index) => {
|
|
54933
54932
|
const _isSelected = _index === this.selectedIndex;
|
|
@@ -54938,32 +54937,32 @@ var init_QuickApprovalInterface = __esm({
|
|
|
54938
54937
|
switch (option) {
|
|
54939
54938
|
case "approve":
|
|
54940
54939
|
label = _labels.approve;
|
|
54941
|
-
color =
|
|
54940
|
+
color = chalk28__default.default.green;
|
|
54942
54941
|
break;
|
|
54943
54942
|
case "reject":
|
|
54944
54943
|
label = _labels.reject;
|
|
54945
|
-
color =
|
|
54944
|
+
color = chalk28__default.default.red;
|
|
54946
54945
|
break;
|
|
54947
54946
|
case "cancel":
|
|
54948
54947
|
label = _labels.cancel;
|
|
54949
|
-
color =
|
|
54948
|
+
color = chalk28__default.default.yellow;
|
|
54950
54949
|
break;
|
|
54951
54950
|
}
|
|
54952
54951
|
const _optionText = `${_prefix}[${_key}] ${label}`;
|
|
54953
54952
|
const _colorFunc = _isSelected ? color.bold : color;
|
|
54954
54953
|
console.log(
|
|
54955
|
-
|
|
54954
|
+
chalk28__default.default.gray("\u2502") + _colorFunc(
|
|
54956
54955
|
`${_optionText}${" ".repeat(Math.max(0, 43 - _optionText.length))}`
|
|
54957
|
-
) +
|
|
54956
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54958
54957
|
);
|
|
54959
54958
|
});
|
|
54960
|
-
console.log(
|
|
54959
|
+
console.log(chalk28__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"));
|
|
54961
54960
|
console.log(
|
|
54962
|
-
|
|
54961
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
54963
54962
|
` ${_labels.moveInstruction}${" ".repeat(Math.max(0, 43 - _labels.moveInstruction.length))}`
|
|
54964
|
-
) +
|
|
54963
|
+
) + chalk28__default.default.gray("\u2502")
|
|
54965
54964
|
);
|
|
54966
|
-
console.log(
|
|
54965
|
+
console.log(chalk28__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"));
|
|
54967
54966
|
console.log("");
|
|
54968
54967
|
}
|
|
54969
54968
|
/**
|
|
@@ -54979,13 +54978,13 @@ var init_QuickApprovalInterface = __esm({
|
|
|
54979
54978
|
};
|
|
54980
54979
|
const _formatted = keyMap[_key] || _key;
|
|
54981
54980
|
const colorMap = {
|
|
54982
|
-
"shift+tab":
|
|
54983
|
-
"ctrl+y":
|
|
54984
|
-
"ctrl+n":
|
|
54985
|
-
"ctrl+t":
|
|
54986
|
-
"ctrl+r":
|
|
54981
|
+
"shift+tab": chalk28__default.default.bgGreen.black.bold,
|
|
54982
|
+
"ctrl+y": chalk28__default.default.bgBlue.white.bold,
|
|
54983
|
+
"ctrl+n": chalk28__default.default.bgRed.white.bold,
|
|
54984
|
+
"ctrl+t": chalk28__default.default.bgMagenta.white.bold,
|
|
54985
|
+
"ctrl+r": chalk28__default.default.bgYellow.black.bold
|
|
54987
54986
|
};
|
|
54988
|
-
const _colorFunc = colorMap[_key] ||
|
|
54987
|
+
const _colorFunc = colorMap[_key] || chalk28__default.default.bgCyan.black.bold;
|
|
54989
54988
|
return _colorFunc(` ${_formatted} `);
|
|
54990
54989
|
}
|
|
54991
54990
|
/**
|
|
@@ -54994,15 +54993,15 @@ var init_QuickApprovalInterface = __esm({
|
|
|
54994
54993
|
formatRiskLevel(risk) {
|
|
54995
54994
|
switch (risk.toLowerCase()) {
|
|
54996
54995
|
case "critical":
|
|
54997
|
-
return
|
|
54996
|
+
return chalk28__default.default.red.bold("CRITICAL");
|
|
54998
54997
|
case "high":
|
|
54999
|
-
return
|
|
54998
|
+
return chalk28__default.default.red("HIGH");
|
|
55000
54999
|
case "medium":
|
|
55001
|
-
return
|
|
55000
|
+
return chalk28__default.default.yellow("MEDIUM");
|
|
55002
55001
|
case "low":
|
|
55003
|
-
return
|
|
55002
|
+
return chalk28__default.default.green("LOW");
|
|
55004
55003
|
default:
|
|
55005
|
-
return
|
|
55004
|
+
return chalk28__default.default.white(risk);
|
|
55006
55005
|
}
|
|
55007
55006
|
}
|
|
55008
55007
|
/**
|
|
@@ -55072,7 +55071,7 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55072
55071
|
}
|
|
55073
55072
|
if (_key === "") {
|
|
55074
55073
|
console.log(`
|
|
55075
|
-
${
|
|
55074
|
+
${chalk28__default.default.red("Approval cancelled by user")}`);
|
|
55076
55075
|
this.emit("approval-cancelled", this.currentRequest.id);
|
|
55077
55076
|
return;
|
|
55078
55077
|
}
|
|
@@ -55129,20 +55128,20 @@ ${chalk27__default.default.red("Approval cancelled by user")}`);
|
|
|
55129
55128
|
}
|
|
55130
55129
|
console.clear();
|
|
55131
55130
|
console.log(`
|
|
55132
|
-
${
|
|
55131
|
+
${chalk28__default.default.bgGreen.black.bold(`\u250C${"\u2500".repeat(78)}\u2510`)}`);
|
|
55133
55132
|
console.log(
|
|
55134
|
-
|
|
55133
|
+
chalk28__default.default.bgGreen.black.bold("\u2502") + chalk28__default.default.bgGreen.black.bold(
|
|
55135
55134
|
` \u2713 CHOICE SELECTED / \u9078\u629E\u5B8C\u4E86:${" ".repeat(47)}`
|
|
55136
|
-
) +
|
|
55135
|
+
) + chalk28__default.default.bgGreen.black.bold("\u2502")
|
|
55137
55136
|
);
|
|
55138
|
-
console.log(
|
|
55137
|
+
console.log(chalk28__default.default.bgGreen.black.bold(`\u251C${"\u2500".repeat(78)}\u2524`));
|
|
55139
55138
|
const _choiceText = `${_choice.label} (${_choice.labelJa})`;
|
|
55140
55139
|
const _padding = " ".repeat(Math.max(0, 76 - _choiceText.length));
|
|
55141
55140
|
console.log(
|
|
55142
|
-
|
|
55141
|
+
chalk28__default.default.bgGreen.black.bold("\u2502") + chalk28__default.default.bgGreen.black.bold(` ${_choiceText}${_padding}`) + chalk28__default.default.bgGreen.black.bold("\u2502")
|
|
55143
55142
|
);
|
|
55144
|
-
console.log(
|
|
55145
|
-
console.log(
|
|
55143
|
+
console.log(chalk28__default.default.bgGreen.black.bold(`\u2514${"\u2500".repeat(78)}\u2518`));
|
|
55144
|
+
console.log(chalk28__default.default.yellow("\n\u{1F504} Processing your approval decision..."));
|
|
55146
55145
|
try {
|
|
55147
55146
|
const _response = await this.approvalEngine.processApprovalResponse(
|
|
55148
55147
|
this.currentRequest.id,
|
|
@@ -55152,30 +55151,30 @@ ${chalk27__default.default.bgGreen.black.bold(`\u250C${"\u2500".repeat(78)}\u251
|
|
|
55152
55151
|
);
|
|
55153
55152
|
response.quickDecision = true;
|
|
55154
55153
|
console.log(`
|
|
55155
|
-
${
|
|
55154
|
+
${chalk28__default.default.bgGreen.black(`\u250C${"\u2500".repeat(78)}\u2510`)}`);
|
|
55156
55155
|
console.log(
|
|
55157
|
-
|
|
55156
|
+
chalk28__default.default.bgGreen.black("\u2502") + chalk28__default.default.bgGreen.black(
|
|
55158
55157
|
` \u{1F389} APPROVAL PROCESSED SUCCESSFULLY / \u627F\u8A8D\u51E6\u7406\u5B8C\u4E86!${" ".repeat(32)}`
|
|
55159
|
-
) +
|
|
55158
|
+
) + chalk28__default.default.bgGreen.black("\u2502")
|
|
55160
55159
|
);
|
|
55161
|
-
console.log(
|
|
55160
|
+
console.log(chalk28__default.default.bgGreen.black(`\u2514${"\u2500".repeat(78)}\u2518`));
|
|
55162
55161
|
if (_choice.trustLevel) {
|
|
55163
55162
|
console.log(
|
|
55164
|
-
|
|
55163
|
+
chalk28__default.default.blue(`
|
|
55165
55164
|
\u2728 Trust level updated: ${_choice.trustLevel}`)
|
|
55166
55165
|
);
|
|
55167
55166
|
}
|
|
55168
55167
|
this.emit("approval-_response", _response);
|
|
55169
55168
|
} catch (_error) {
|
|
55170
55169
|
console.log(`
|
|
55171
|
-
${
|
|
55170
|
+
${chalk28__default.default.bgRed.white.bold(`\u250C${"\u2500".repeat(78)}\u2510`)}`);
|
|
55172
55171
|
console.log(
|
|
55173
|
-
|
|
55172
|
+
chalk28__default.default.bgRed.white.bold("\u2502") + chalk28__default.default.bgRed.white.bold(
|
|
55174
55173
|
` \u274C ERROR PROCESSING APPROVAL / \u627F\u8A8D\u51E6\u7406\u30A8\u30E9\u30FC${" ".repeat(35)}`
|
|
55175
|
-
) +
|
|
55174
|
+
) + chalk28__default.default.bgRed.white.bold("\u2502")
|
|
55176
55175
|
);
|
|
55177
|
-
console.log(
|
|
55178
|
-
console._error(
|
|
55176
|
+
console.log(chalk28__default.default.bgRed.white.bold(`\u2514${"\u2500".repeat(78)}\u2518`));
|
|
55177
|
+
console._error(chalk28__default.default.red("\nError details:"), _error);
|
|
55179
55178
|
this.emit("approval-_error", _error);
|
|
55180
55179
|
}
|
|
55181
55180
|
}
|
|
@@ -55189,7 +55188,7 @@ ${chalk27__default.default.bgRed.white.bold(`\u250C${"\u2500".repeat(78)}\u2510`
|
|
|
55189
55188
|
timeoutId = setTimeout(() => {
|
|
55190
55189
|
console.log(
|
|
55191
55190
|
`
|
|
55192
|
-
${
|
|
55191
|
+
${chalk28__default.default.yellow("\u23F0 Approval request timed out - auto-approving...")}`
|
|
55193
55192
|
);
|
|
55194
55193
|
this.handleTimeoutResponse(resolve);
|
|
55195
55194
|
}, timeout);
|
|
@@ -55233,7 +55232,7 @@ ${chalk27__default.default.yellow("\u23F0 Approval request timed out - auto-appr
|
|
|
55233
55232
|
response.quickDecision = true;
|
|
55234
55233
|
resolve(_response);
|
|
55235
55234
|
} catch (_error) {
|
|
55236
|
-
console._error(
|
|
55235
|
+
console._error(chalk28__default.default.red("Error processing timeout approval:"), _error);
|
|
55237
55236
|
}
|
|
55238
55237
|
}
|
|
55239
55238
|
/**
|
|
@@ -55248,11 +55247,11 @@ ${chalk27__default.default.yellow("\u23F0 Approval request timed out - auto-appr
|
|
|
55248
55247
|
);
|
|
55249
55248
|
this.approvalEngine.on("trust-level-changed", (event) => {
|
|
55250
55249
|
console.log(
|
|
55251
|
-
|
|
55250
|
+
chalk28__default.default.blue(
|
|
55252
55251
|
`\u2728 Trust level changed: ${event.oldLevel} \u2192 ${event.newLevel}`
|
|
55253
55252
|
)
|
|
55254
55253
|
);
|
|
55255
|
-
console.log(
|
|
55254
|
+
console.log(chalk28__default.default.gray(`Reason: ${event.reason}`));
|
|
55256
55255
|
});
|
|
55257
55256
|
}
|
|
55258
55257
|
/**
|
|
@@ -56039,22 +56038,22 @@ function formatProgressBar(current, total, width = 20) {
|
|
|
56039
56038
|
}
|
|
56040
56039
|
function formatError2(message, code) {
|
|
56041
56040
|
const prefix = "";
|
|
56042
|
-
return
|
|
56041
|
+
return chalk28__default.default.red(`\u274C ${prefix}${message}`);
|
|
56043
56042
|
}
|
|
56044
56043
|
function formatSuccess(message) {
|
|
56045
|
-
return
|
|
56044
|
+
return chalk28__default.default.green(`\u2705 ${message}`);
|
|
56046
56045
|
}
|
|
56047
56046
|
function formatWarning(message) {
|
|
56048
|
-
return
|
|
56047
|
+
return chalk28__default.default.yellow(`\u26A0\uFE0F ${message}`);
|
|
56049
56048
|
}
|
|
56050
56049
|
function formatInfo(message) {
|
|
56051
|
-
return
|
|
56050
|
+
return chalk28__default.default.blue(`\u2139\uFE0F ${message}`);
|
|
56052
56051
|
}
|
|
56053
56052
|
function formatTable(headers, rows, options2 = {}) {
|
|
56054
56053
|
const {
|
|
56055
56054
|
columnWidths = headers.map(() => 20),
|
|
56056
56055
|
separator = " | ",
|
|
56057
|
-
headerColor =
|
|
56056
|
+
headerColor = chalk28__default.default.cyan.bold
|
|
56058
56057
|
} = options2;
|
|
56059
56058
|
const headerRow = headers.map((h2, i2) => headerColor(h2.padEnd(columnWidths[i2]))).join(separator);
|
|
56060
56059
|
const separatorLine = columnWidths.map((w) => "-".repeat(w)).join(separator);
|
|
@@ -56066,8 +56065,8 @@ function formatTable(headers, rows, options2 = {}) {
|
|
|
56066
56065
|
function formatKeyValue(data2, options2 = {}) {
|
|
56067
56066
|
const {
|
|
56068
56067
|
keyWidth = 20,
|
|
56069
|
-
keyColor =
|
|
56070
|
-
valueColor =
|
|
56068
|
+
keyColor = chalk28__default.default.gray,
|
|
56069
|
+
valueColor = chalk28__default.default.white,
|
|
56071
56070
|
separator = ": "
|
|
56072
56071
|
} = options2;
|
|
56073
56072
|
return Object.entries(data2).map(([key2, value]) => {
|
|
@@ -56117,7 +56116,7 @@ var init_DisplayManager = __esm({
|
|
|
56117
56116
|
theme: options2.theme ?? "auto"
|
|
56118
56117
|
};
|
|
56119
56118
|
if (!this.options.enableColors) {
|
|
56120
|
-
|
|
56119
|
+
chalk28__default.default.level = 0;
|
|
56121
56120
|
}
|
|
56122
56121
|
this.setupCleanupHandlers();
|
|
56123
56122
|
}
|
|
@@ -56234,7 +56233,7 @@ var init_DisplayManager = __esm({
|
|
|
56234
56233
|
const {
|
|
56235
56234
|
padding = 1,
|
|
56236
56235
|
borderStyle = "single",
|
|
56237
|
-
borderColor =
|
|
56236
|
+
borderColor = chalk28__default.default.gray
|
|
56238
56237
|
} = options2;
|
|
56239
56238
|
const lines = content2.split("\n");
|
|
56240
56239
|
const maxLength = Math.max(...lines.map((l) => l.length));
|
|
@@ -56292,7 +56291,7 @@ var init_DisplayManager = __esm({
|
|
|
56292
56291
|
*/
|
|
56293
56292
|
startSpinner(text) {
|
|
56294
56293
|
if (!this.options.enableAnimations) {
|
|
56295
|
-
this.writeLine(
|
|
56294
|
+
this.writeLine(chalk28__default.default.gray(`\u2299 ${text || "Processing..."}`));
|
|
56296
56295
|
return "no-animation";
|
|
56297
56296
|
}
|
|
56298
56297
|
return this.spinnerManager.start({ text });
|
|
@@ -56396,11 +56395,11 @@ var init_StatusDisplay = __esm({
|
|
|
56396
56395
|
*/
|
|
56397
56396
|
static renderSystemStatus(status, detailed = false) {
|
|
56398
56397
|
const lines = [];
|
|
56399
|
-
lines.push(
|
|
56398
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F4CA} System Status"));
|
|
56400
56399
|
lines.push("");
|
|
56401
56400
|
const statusIcon = status.operational ? "\u2705" : "\u274C";
|
|
56402
56401
|
const statusText = status.operational ? "Operational" : "Issues Detected";
|
|
56403
|
-
const statusColor = status.operational ?
|
|
56402
|
+
const statusColor = status.operational ? chalk28__default.default.green : chalk28__default.default.red;
|
|
56404
56403
|
lines.push(`${statusIcon} Status: ${statusColor(statusText)}`);
|
|
56405
56404
|
lines.push(
|
|
56406
56405
|
`\u23F1\uFE0F Uptime: ${formatDuration(status.uptime * 1e3)}`
|
|
@@ -56421,15 +56420,15 @@ var init_StatusDisplay = __esm({
|
|
|
56421
56420
|
if (status.errors > 0 || status.warnings > 0) {
|
|
56422
56421
|
lines.push("");
|
|
56423
56422
|
if (status.errors > 0) {
|
|
56424
|
-
lines.push(
|
|
56423
|
+
lines.push(chalk28__default.default.red(`\u274C Errors: ${status.errors}`));
|
|
56425
56424
|
}
|
|
56426
56425
|
if (status.warnings > 0) {
|
|
56427
|
-
lines.push(
|
|
56426
|
+
lines.push(chalk28__default.default.yellow(`\u26A0\uFE0F Warnings: ${status.warnings}`));
|
|
56428
56427
|
}
|
|
56429
56428
|
}
|
|
56430
56429
|
if (detailed) {
|
|
56431
56430
|
lines.push("");
|
|
56432
|
-
lines.push(
|
|
56431
|
+
lines.push(chalk28__default.default.gray("Detailed Information:"));
|
|
56433
56432
|
const details = formatKeyValue(
|
|
56434
56433
|
{
|
|
56435
56434
|
"Process ID": process.pid,
|
|
@@ -56439,8 +56438,8 @@ var init_StatusDisplay = __esm({
|
|
|
56439
56438
|
"Working Directory": process.cwd()
|
|
56440
56439
|
},
|
|
56441
56440
|
{
|
|
56442
|
-
keyColor:
|
|
56443
|
-
valueColor:
|
|
56441
|
+
keyColor: chalk28__default.default.gray,
|
|
56442
|
+
valueColor: chalk28__default.default.white
|
|
56444
56443
|
}
|
|
56445
56444
|
);
|
|
56446
56445
|
lines.push(details);
|
|
@@ -56454,9 +56453,9 @@ var init_StatusDisplay = __esm({
|
|
|
56454
56453
|
*/
|
|
56455
56454
|
static renderMemoryStatus(status) {
|
|
56456
56455
|
const lines = [];
|
|
56457
|
-
lines.push(
|
|
56456
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F9E0} Memory Status"));
|
|
56458
56457
|
lines.push("");
|
|
56459
|
-
lines.push(
|
|
56458
|
+
lines.push(chalk28__default.default.yellow("System 1 (Fast):"));
|
|
56460
56459
|
const s1NodeBar = formatProgressBar(
|
|
56461
56460
|
status.system1.nodes,
|
|
56462
56461
|
status.system1.maxNodes,
|
|
@@ -56474,7 +56473,7 @@ var init_StatusDisplay = __esm({
|
|
|
56474
56473
|
` \u2022 Tokens: ${status.system1.tokens}/${status.system1.maxTokens} ${s1TokenBar}`
|
|
56475
56474
|
);
|
|
56476
56475
|
lines.push("");
|
|
56477
|
-
lines.push(
|
|
56476
|
+
lines.push(chalk28__default.default.blue("System 2 (Deep):"));
|
|
56478
56477
|
const s2TraceBar = formatProgressBar(
|
|
56479
56478
|
status.system2.traces,
|
|
56480
56479
|
status.system2.maxTraces,
|
|
@@ -56492,7 +56491,7 @@ var init_StatusDisplay = __esm({
|
|
|
56492
56491
|
` \u2022 Tokens: ${status.system2.tokens}/${status.system2.maxTokens} ${s2TokenBar}`
|
|
56493
56492
|
);
|
|
56494
56493
|
lines.push("");
|
|
56495
|
-
lines.push(
|
|
56494
|
+
lines.push(chalk28__default.default.green("Total:"));
|
|
56496
56495
|
const totalBar = formatProgressBar(
|
|
56497
56496
|
status.total.tokens,
|
|
56498
56497
|
status.total.maxTokens,
|
|
@@ -56501,7 +56500,7 @@ var init_StatusDisplay = __esm({
|
|
|
56501
56500
|
lines.push(` \u2022 Tokens: ${status.total.tokens}/${status.total.maxTokens}`);
|
|
56502
56501
|
lines.push(` \u2022 Usage: ${totalBar}`);
|
|
56503
56502
|
const usage = status.total.tokens / status.total.maxTokens * 100;
|
|
56504
|
-
const usageColor = usage > 80 ?
|
|
56503
|
+
const usageColor = usage > 80 ? chalk28__default.default.red : usage > 60 ? chalk28__default.default.yellow : chalk28__default.default.green;
|
|
56505
56504
|
lines.push(
|
|
56506
56505
|
` \u2022 ${usageColor(formatPercentage(usage / 100, 1))} utilized`
|
|
56507
56506
|
);
|
|
@@ -56514,9 +56513,9 @@ var init_StatusDisplay = __esm({
|
|
|
56514
56513
|
*/
|
|
56515
56514
|
static renderModelStatus(status) {
|
|
56516
56515
|
const lines = [];
|
|
56517
|
-
lines.push(
|
|
56516
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F916} Model Status"));
|
|
56518
56517
|
lines.push("");
|
|
56519
|
-
lines.push(
|
|
56518
|
+
lines.push(chalk28__default.default.green(`Current: ${chalk28__default.default.bold(status.current)}`));
|
|
56520
56519
|
lines.push("");
|
|
56521
56520
|
lines.push("Available Models:");
|
|
56522
56521
|
const headers = ["Model", "Provider", "Status", "Capabilities"];
|
|
@@ -56528,7 +56527,7 @@ var init_StatusDisplay = __esm({
|
|
|
56528
56527
|
const table = formatTable(headers, rows, {
|
|
56529
56528
|
columnWidths: [20, 15, 8, 30],
|
|
56530
56529
|
separator: " \u2502 ",
|
|
56531
|
-
headerColor:
|
|
56530
|
+
headerColor: chalk28__default.default.gray
|
|
56532
56531
|
});
|
|
56533
56532
|
lines.push(table);
|
|
56534
56533
|
return lines.join("\n");
|
|
@@ -56540,19 +56539,19 @@ var init_StatusDisplay = __esm({
|
|
|
56540
56539
|
*/
|
|
56541
56540
|
static renderHealthChecks(checks) {
|
|
56542
56541
|
const lines = [];
|
|
56543
|
-
lines.push(
|
|
56542
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F3E5} Health Checks"));
|
|
56544
56543
|
lines.push("");
|
|
56545
56544
|
for (const check of checks) {
|
|
56546
56545
|
const icon = check.status === "ok" ? "\u2705" : check.status === "warning" ? "\u26A0\uFE0F" : "\u274C";
|
|
56547
|
-
const statusColor = check.status === "ok" ?
|
|
56546
|
+
const statusColor = check.status === "ok" ? chalk28__default.default.green : check.status === "warning" ? chalk28__default.default.yellow : chalk28__default.default.red;
|
|
56548
56547
|
let line = `${icon} ${check.name.padEnd(25)} ${statusColor(check.status.toUpperCase())}`;
|
|
56549
56548
|
if (check.latency !== void 0) {
|
|
56550
|
-
const latencyColor = check.latency < 100 ?
|
|
56549
|
+
const latencyColor = check.latency < 100 ? chalk28__default.default.green : check.latency < 500 ? chalk28__default.default.yellow : chalk28__default.default.red;
|
|
56551
56550
|
line += ` ${latencyColor(`(${check.latency}ms)`)}`;
|
|
56552
56551
|
}
|
|
56553
56552
|
lines.push(line);
|
|
56554
56553
|
if (check.message) {
|
|
56555
|
-
lines.push(
|
|
56554
|
+
lines.push(chalk28__default.default.gray(` ${check.message}`));
|
|
56556
56555
|
}
|
|
56557
56556
|
}
|
|
56558
56557
|
lines.push("");
|
|
@@ -56561,16 +56560,16 @@ var init_StatusDisplay = __esm({
|
|
|
56561
56560
|
const errorCount = checks.filter((c) => c.status === "error").length;
|
|
56562
56561
|
if (errorCount > 0) {
|
|
56563
56562
|
lines.push(
|
|
56564
|
-
|
|
56563
|
+
chalk28__default.default.red(
|
|
56565
56564
|
`\u26A0\uFE0F System has ${errorCount} error(s) - intervention required`
|
|
56566
56565
|
)
|
|
56567
56566
|
);
|
|
56568
56567
|
} else if (warningCount > 0) {
|
|
56569
56568
|
lines.push(
|
|
56570
|
-
|
|
56569
|
+
chalk28__default.default.yellow(`\u26A0\uFE0F System operational with ${warningCount} warning(s)`)
|
|
56571
56570
|
);
|
|
56572
56571
|
} else {
|
|
56573
|
-
lines.push(
|
|
56572
|
+
lines.push(chalk28__default.default.green("\u2705 All systems operational"));
|
|
56574
56573
|
}
|
|
56575
56574
|
return lines.join("\n");
|
|
56576
56575
|
}
|
|
@@ -56581,7 +56580,7 @@ var init_StatusDisplay = __esm({
|
|
|
56581
56580
|
*/
|
|
56582
56581
|
static renderSessionStats(stats) {
|
|
56583
56582
|
const lines = [];
|
|
56584
|
-
lines.push(
|
|
56583
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F4C8} Session Statistics"));
|
|
56585
56584
|
lines.push("");
|
|
56586
56585
|
const data2 = formatKeyValue(
|
|
56587
56586
|
{
|
|
@@ -56594,14 +56593,14 @@ var init_StatusDisplay = __esm({
|
|
|
56594
56593
|
},
|
|
56595
56594
|
{
|
|
56596
56595
|
keyWidth: 20,
|
|
56597
|
-
keyColor:
|
|
56598
|
-
valueColor:
|
|
56596
|
+
keyColor: chalk28__default.default.gray,
|
|
56597
|
+
valueColor: chalk28__default.default.white
|
|
56599
56598
|
}
|
|
56600
56599
|
);
|
|
56601
56600
|
lines.push(data2);
|
|
56602
56601
|
lines.push("");
|
|
56603
56602
|
const performance3 = stats.avgResponseTime < 100 ? "Excellent" : stats.avgResponseTime < 500 ? "Good" : stats.avgResponseTime < 1e3 ? "Fair" : "Poor";
|
|
56604
|
-
const perfColor = performance3 === "Excellent" ?
|
|
56603
|
+
const perfColor = performance3 === "Excellent" ? chalk28__default.default.green : performance3 === "Good" ? chalk28__default.default.blue : performance3 === "Fair" ? chalk28__default.default.yellow : chalk28__default.default.red;
|
|
56605
56604
|
lines.push(`Performance: ${perfColor(performance3)}`);
|
|
56606
56605
|
return lines.join("\n");
|
|
56607
56606
|
}
|
|
@@ -56613,22 +56612,22 @@ var init_StatusDisplay = __esm({
|
|
|
56613
56612
|
static renderStatusBar(data2) {
|
|
56614
56613
|
const segments = [];
|
|
56615
56614
|
if (data2.mode) {
|
|
56616
|
-
segments.push(
|
|
56615
|
+
segments.push(chalk28__default.default.cyan(`[${data2.mode}]`));
|
|
56617
56616
|
}
|
|
56618
56617
|
if (data2.model) {
|
|
56619
|
-
segments.push(
|
|
56618
|
+
segments.push(chalk28__default.default.blue(`\u{1F916} ${data2.model}`));
|
|
56620
56619
|
}
|
|
56621
56620
|
if (data2.memory !== void 0) {
|
|
56622
|
-
const memoryColor = data2.memory > 80 ?
|
|
56621
|
+
const memoryColor = data2.memory > 80 ? chalk28__default.default.red : data2.memory > 60 ? chalk28__default.default.yellow : chalk28__default.default.green;
|
|
56623
56622
|
segments.push(memoryColor(`\u{1F4BE} ${data2.memory}%`));
|
|
56624
56623
|
}
|
|
56625
56624
|
if (data2.latency !== void 0) {
|
|
56626
|
-
const latencyColor = data2.latency < 100 ?
|
|
56625
|
+
const latencyColor = data2.latency < 100 ? chalk28__default.default.green : data2.latency < 500 ? chalk28__default.default.yellow : chalk28__default.default.red;
|
|
56627
56626
|
segments.push(latencyColor(`\u26A1 ${data2.latency}ms`));
|
|
56628
56627
|
}
|
|
56629
56628
|
if (data2.time) {
|
|
56630
56629
|
segments.push(
|
|
56631
|
-
|
|
56630
|
+
chalk28__default.default.gray(formatTimestamp(data2.time, "short"))
|
|
56632
56631
|
);
|
|
56633
56632
|
}
|
|
56634
56633
|
return segments.join(" \u2502 ");
|
|
@@ -56647,7 +56646,7 @@ var init_CoreHandlers = __esm({
|
|
|
56647
56646
|
async execute(args2) {
|
|
56648
56647
|
const startTime = perf_hooks.performance.now();
|
|
56649
56648
|
const commands = this.registry.getCommands();
|
|
56650
|
-
let message =
|
|
56649
|
+
let message = chalk28__default.default.cyan(`\u{1F916} MARIA v3.5.0 - Available Commands
|
|
56651
56650
|
|
|
56652
56651
|
`);
|
|
56653
56652
|
const categories2 = {
|
|
@@ -56658,17 +56657,17 @@ var init_CoreHandlers = __esm({
|
|
|
56658
56657
|
system: ["/status", "/config", "/logs", "/approve"]
|
|
56659
56658
|
};
|
|
56660
56659
|
for (const [category, cmds] of Object.entries(categories2)) {
|
|
56661
|
-
message +=
|
|
56660
|
+
message += chalk28__default.default.yellow(`
|
|
56662
56661
|
${category.toUpperCase()}:
|
|
56663
56662
|
`);
|
|
56664
56663
|
for (const cmd of cmds) {
|
|
56665
56664
|
if (commands.includes(cmd)) {
|
|
56666
|
-
message += ` ${
|
|
56665
|
+
message += ` ${chalk28__default.default.green(cmd.padEnd(15))} - ${this.getCommandDescription(cmd)}
|
|
56667
56666
|
`;
|
|
56668
56667
|
}
|
|
56669
56668
|
}
|
|
56670
56669
|
}
|
|
56671
|
-
message +=
|
|
56670
|
+
message += chalk28__default.default.gray(
|
|
56672
56671
|
`
|
|
56673
56672
|
Type '/help <command>' for detailed information about a specific command.`
|
|
56674
56673
|
);
|
|
@@ -56716,7 +56715,7 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
56716
56715
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
56717
56716
|
return {
|
|
56718
56717
|
success: true,
|
|
56719
|
-
message:
|
|
56718
|
+
message: chalk28__default.default.gray("Terminal cleared."),
|
|
56720
56719
|
metadata: {
|
|
56721
56720
|
processingTime,
|
|
56722
56721
|
timestamp: /* @__PURE__ */ new Date()
|
|
@@ -56727,7 +56726,7 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
56727
56726
|
ExitHandler = class {
|
|
56728
56727
|
async execute(args2) {
|
|
56729
56728
|
const startTime = perf_hooks.performance.now();
|
|
56730
|
-
const message =
|
|
56729
|
+
const message = chalk28__default.default.green("\u{1F44B} Goodbye! Thank you for using MARIA.\n");
|
|
56731
56730
|
process.emit("SIGTERM");
|
|
56732
56731
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
56733
56732
|
return {
|
|
@@ -56751,23 +56750,23 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
56751
56750
|
platform: process.platform,
|
|
56752
56751
|
arch: process.arch
|
|
56753
56752
|
};
|
|
56754
|
-
let message =
|
|
56755
|
-
message +=
|
|
56753
|
+
let message = chalk28__default.default.cyan("\u{1F680} MARIA System Information\n\n");
|
|
56754
|
+
message += chalk28__default.default.white(` Version: ${chalk28__default.default.green(packageInfo.version)}
|
|
56756
56755
|
`);
|
|
56757
|
-
message +=
|
|
56756
|
+
message += chalk28__default.default.white(` Package: ${chalk28__default.default.green(packageInfo.name)}
|
|
56758
56757
|
`);
|
|
56759
|
-
message +=
|
|
56758
|
+
message += chalk28__default.default.white(` Node: ${chalk28__default.default.green(packageInfo.node)}
|
|
56760
56759
|
`);
|
|
56761
|
-
message +=
|
|
56762
|
-
` Platform: ${
|
|
56760
|
+
message += chalk28__default.default.white(
|
|
56761
|
+
` Platform: ${chalk28__default.default.green(packageInfo.platform)}
|
|
56763
56762
|
`
|
|
56764
56763
|
);
|
|
56765
|
-
message +=
|
|
56764
|
+
message += chalk28__default.default.white(` Arch: ${chalk28__default.default.green(packageInfo.arch)}
|
|
56766
56765
|
`);
|
|
56767
|
-
message +=
|
|
56766
|
+
message += chalk28__default.default.gray(`
|
|
56768
56767
|
Build: Production
|
|
56769
56768
|
`);
|
|
56770
|
-
message +=
|
|
56769
|
+
message += chalk28__default.default.gray(` License: MIT
|
|
56771
56770
|
`);
|
|
56772
56771
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
56773
56772
|
return {
|
|
@@ -56792,15 +56791,15 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
56792
56791
|
this.history.push("/history");
|
|
56793
56792
|
}
|
|
56794
56793
|
const recent = this.history.slice(-limit);
|
|
56795
|
-
let message =
|
|
56794
|
+
let message = chalk28__default.default.cyan(`\u{1F4DC} Command History (last ${recent.length}):
|
|
56796
56795
|
|
|
56797
56796
|
`);
|
|
56798
56797
|
recent.forEach((cmd, index2) => {
|
|
56799
56798
|
const num = this.history.length - recent.length + index2 + 1;
|
|
56800
|
-
message +=
|
|
56799
|
+
message += chalk28__default.default.gray(` ${num.toString().padStart(3)}: `) + chalk28__default.default.white(cmd) + "\n";
|
|
56801
56800
|
});
|
|
56802
56801
|
if (recent.length === 0) {
|
|
56803
|
-
message =
|
|
56802
|
+
message = chalk28__default.default.gray("No command history available.");
|
|
56804
56803
|
}
|
|
56805
56804
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
56806
56805
|
return {
|
|
@@ -56846,13 +56845,13 @@ var init_DevHandlers = __esm({
|
|
|
56846
56845
|
if (!prompt) {
|
|
56847
56846
|
return {
|
|
56848
56847
|
ok: false,
|
|
56849
|
-
message:
|
|
56848
|
+
message: chalk28__default.default.red("\u274C Please provide a code generation request.\n") + chalk28__default.default.gray("Usage: /code <description>\n") + chalk28__default.default.gray("Example: /code create a React button component")
|
|
56850
56849
|
};
|
|
56851
56850
|
}
|
|
56852
56851
|
if (signal?.aborted) {
|
|
56853
56852
|
return {
|
|
56854
56853
|
ok: false,
|
|
56855
|
-
message:
|
|
56854
|
+
message: chalk28__default.default.yellow("Code generation canceled")
|
|
56856
56855
|
};
|
|
56857
56856
|
}
|
|
56858
56857
|
try {
|
|
@@ -56863,9 +56862,9 @@ var init_DevHandlers = __esm({
|
|
|
56863
56862
|
if (dryRun) {
|
|
56864
56863
|
return {
|
|
56865
56864
|
ok: true,
|
|
56866
|
-
message:
|
|
56867
|
-
`) +
|
|
56868
|
-
`) +
|
|
56865
|
+
message: chalk28__default.default.cyan("\u{1F50D} Dry run mode - would generate:\n") + chalk28__default.default.gray(`Language: ${language}
|
|
56866
|
+
`) + chalk28__default.default.gray(`Framework: ${framework || "none"}
|
|
56867
|
+
`) + chalk28__default.default.gray(`Prompt: ${cleanPrompt}`)
|
|
56869
56868
|
};
|
|
56870
56869
|
}
|
|
56871
56870
|
const generatedCode = `// Generated code for: ${cleanPrompt}
|
|
@@ -56877,7 +56876,7 @@ function generated() {
|
|
|
56877
56876
|
export { generated };`;
|
|
56878
56877
|
return {
|
|
56879
56878
|
ok: true,
|
|
56880
|
-
message:
|
|
56879
|
+
message: chalk28__default.default.green("\u2705 Code generated successfully:\n\n") + chalk28__default.default.gray("```" + language + "\n") + generatedCode + chalk28__default.default.gray("\n```"),
|
|
56881
56880
|
data: {
|
|
56882
56881
|
code: generatedCode,
|
|
56883
56882
|
language,
|
|
@@ -56890,7 +56889,7 @@ export { generated };`;
|
|
|
56890
56889
|
} catch (error2) {
|
|
56891
56890
|
return {
|
|
56892
56891
|
ok: false,
|
|
56893
|
-
message:
|
|
56892
|
+
message: chalk28__default.default.red(`Code generation failed: ${error2}`)
|
|
56894
56893
|
};
|
|
56895
56894
|
}
|
|
56896
56895
|
}
|
|
@@ -56904,7 +56903,7 @@ export { generated };`;
|
|
|
56904
56903
|
if (signal?.aborted) {
|
|
56905
56904
|
return {
|
|
56906
56905
|
ok: false,
|
|
56907
|
-
message:
|
|
56906
|
+
message: chalk28__default.default.yellow("Test operation canceled")
|
|
56908
56907
|
};
|
|
56909
56908
|
}
|
|
56910
56909
|
const subcommand = args2[0] || "run";
|
|
@@ -56920,8 +56919,8 @@ export { generated };`;
|
|
|
56920
56919
|
default:
|
|
56921
56920
|
return {
|
|
56922
56921
|
ok: false,
|
|
56923
|
-
message:
|
|
56924
|
-
`) +
|
|
56922
|
+
message: chalk28__default.default.red(`Unknown test subcommand: ${subcommand}
|
|
56923
|
+
`) + chalk28__default.default.gray("Available: generate, run, coverage")
|
|
56925
56924
|
};
|
|
56926
56925
|
}
|
|
56927
56926
|
}
|
|
@@ -56929,7 +56928,7 @@ export { generated };`;
|
|
|
56929
56928
|
if (!target) {
|
|
56930
56929
|
return {
|
|
56931
56930
|
ok: false,
|
|
56932
|
-
message:
|
|
56931
|
+
message: chalk28__default.default.red(
|
|
56933
56932
|
"Please specify a file or function to generate tests for"
|
|
56934
56933
|
)
|
|
56935
56934
|
};
|
|
@@ -56946,9 +56945,9 @@ describe("${target}", () => {
|
|
|
56946
56945
|
});`;
|
|
56947
56946
|
return {
|
|
56948
56947
|
ok: true,
|
|
56949
|
-
message:
|
|
56948
|
+
message: chalk28__default.default.green(`\u2705 Tests generated for ${target}:
|
|
56950
56949
|
|
|
56951
|
-
`) +
|
|
56950
|
+
`) + chalk28__default.default.gray("```typescript\n") + testCode + chalk28__default.default.gray("\n```"),
|
|
56952
56951
|
data: { testCode, framework, target }
|
|
56953
56952
|
};
|
|
56954
56953
|
}
|
|
@@ -56961,23 +56960,23 @@ describe("${target}", () => {
|
|
|
56961
56960
|
if (coverage) command += " --coverage";
|
|
56962
56961
|
return {
|
|
56963
56962
|
ok: true,
|
|
56964
|
-
message:
|
|
56965
|
-
`) +
|
|
56963
|
+
message: chalk28__default.default.cyan(`\u{1F9EA} Running tests...
|
|
56964
|
+
`) + chalk28__default.default.gray(`Command: ${command}
|
|
56966
56965
|
|
|
56967
|
-
`) +
|
|
56966
|
+
`) + chalk28__default.default.green("\u2705 All tests passed!"),
|
|
56968
56967
|
data: { command, passed: true }
|
|
56969
56968
|
};
|
|
56970
56969
|
}
|
|
56971
56970
|
async showCoverage(options2) {
|
|
56972
56971
|
return {
|
|
56973
56972
|
ok: true,
|
|
56974
|
-
message:
|
|
56973
|
+
message: chalk28__default.default.cyan("\u{1F4CA} Test Coverage Report:\n\n") + chalk28__default.default.gray("File".padEnd(40) + "% Stmts".padEnd(10) + "% Lines\n") + chalk28__default.default.gray("-".repeat(60) + "\n") + chalk28__default.default.green(
|
|
56975
56974
|
"SessionStateMachine.ts".padEnd(40) + "100.00".padEnd(10) + "100.00\n"
|
|
56976
|
-
) +
|
|
56975
|
+
) + chalk28__default.default.green(
|
|
56977
56976
|
"InputController.ts".padEnd(40) + "95.50".padEnd(10) + "94.20\n"
|
|
56978
|
-
) +
|
|
56977
|
+
) + chalk28__default.default.yellow(
|
|
56979
56978
|
"SessionManager.ts".padEnd(40) + "78.30".padEnd(10) + "76.50\n"
|
|
56980
|
-
) +
|
|
56979
|
+
) + chalk28__default.default.gray("-".repeat(60) + "\n") + chalk28__default.default.cyan("Total".padEnd(40) + "85.60".padEnd(10) + "84.30")
|
|
56981
56980
|
};
|
|
56982
56981
|
}
|
|
56983
56982
|
};
|
|
@@ -56991,33 +56990,33 @@ describe("${target}", () => {
|
|
|
56991
56990
|
if (!file) {
|
|
56992
56991
|
return {
|
|
56993
56992
|
ok: false,
|
|
56994
|
-
message:
|
|
56993
|
+
message: chalk28__default.default.red("Please specify a file to review\n") + chalk28__default.default.gray("Usage: /review <file> [--security] [--performance]")
|
|
56995
56994
|
};
|
|
56996
56995
|
}
|
|
56997
56996
|
const checkSecurity = args2.includes("--security");
|
|
56998
56997
|
const checkPerformance = args2.includes("--performance");
|
|
56999
|
-
let message =
|
|
56998
|
+
let message = chalk28__default.default.cyan(`\u{1F50D} Code Review for ${file}
|
|
57000
56999
|
|
|
57001
57000
|
`);
|
|
57002
|
-
message +=
|
|
57003
|
-
message +=
|
|
57004
|
-
message +=
|
|
57005
|
-
message +=
|
|
57001
|
+
message += chalk28__default.default.yellow("\u26A0\uFE0F Issues Found (3):\n");
|
|
57002
|
+
message += chalk28__default.default.gray(" 1. Line 42: ") + chalk28__default.default.yellow("Missing error handling in async function\n");
|
|
57003
|
+
message += chalk28__default.default.gray(" 2. Line 89: ") + chalk28__default.default.yellow("Potential memory leak - event listener not removed\n");
|
|
57004
|
+
message += chalk28__default.default.gray(" 3. Line 156: ") + chalk28__default.default.yellow(
|
|
57006
57005
|
"Complex function - consider refactoring (cyclomatic complexity: 12)\n\n"
|
|
57007
57006
|
);
|
|
57008
57007
|
if (checkSecurity) {
|
|
57009
|
-
message +=
|
|
57010
|
-
message +=
|
|
57008
|
+
message += chalk28__default.default.red("\u{1F512} Security Issues (1):\n");
|
|
57009
|
+
message += chalk28__default.default.gray(" 1. Line 67: ") + chalk28__default.default.red("Potential XSS vulnerability - user input not sanitized\n\n");
|
|
57011
57010
|
}
|
|
57012
57011
|
if (checkPerformance) {
|
|
57013
|
-
message +=
|
|
57014
|
-
message +=
|
|
57015
|
-
message +=
|
|
57016
|
-
}
|
|
57017
|
-
message +=
|
|
57018
|
-
message +=
|
|
57019
|
-
message +=
|
|
57020
|
-
message +=
|
|
57012
|
+
message += chalk28__default.default.blue("\u26A1 Performance Suggestions (2):\n");
|
|
57013
|
+
message += chalk28__default.default.gray(" 1. Line 23: ") + chalk28__default.default.blue("Consider memoization for expensive calculation\n");
|
|
57014
|
+
message += chalk28__default.default.gray(" 2. Line 145: ") + chalk28__default.default.blue("Use virtualization for large list rendering\n\n");
|
|
57015
|
+
}
|
|
57016
|
+
message += chalk28__default.default.green("\u2705 Positive Findings:\n");
|
|
57017
|
+
message += chalk28__default.default.gray(" \u2022 Good TypeScript type coverage (92%)\n");
|
|
57018
|
+
message += chalk28__default.default.gray(" \u2022 Consistent code style\n");
|
|
57019
|
+
message += chalk28__default.default.gray(" \u2022 Well-documented functions\n");
|
|
57021
57020
|
return {
|
|
57022
57021
|
ok: true,
|
|
57023
57022
|
message,
|
|
@@ -57047,8 +57046,8 @@ describe("${target}", () => {
|
|
|
57047
57046
|
default:
|
|
57048
57047
|
return {
|
|
57049
57048
|
ok: false,
|
|
57050
|
-
message:
|
|
57051
|
-
`) +
|
|
57049
|
+
message: chalk28__default.default.red(`Unknown bug subcommand: ${subcommand}
|
|
57050
|
+
`) + chalk28__default.default.gray("Available: report, list, analyze")
|
|
57052
57051
|
};
|
|
57053
57052
|
}
|
|
57054
57053
|
}
|
|
@@ -57057,18 +57056,18 @@ describe("${target}", () => {
|
|
|
57057
57056
|
if (!description) {
|
|
57058
57057
|
return {
|
|
57059
57058
|
ok: false,
|
|
57060
|
-
message:
|
|
57059
|
+
message: chalk28__default.default.red("Please provide a bug description")
|
|
57061
57060
|
};
|
|
57062
57061
|
}
|
|
57063
57062
|
const bugId = `BUG-${Date.now().toString(36).toUpperCase()}`;
|
|
57064
57063
|
return {
|
|
57065
57064
|
ok: true,
|
|
57066
|
-
message:
|
|
57065
|
+
message: chalk28__default.default.green(`\u{1F41B} Bug reported successfully!
|
|
57067
57066
|
|
|
57068
|
-
`) +
|
|
57069
|
-
`) +
|
|
57070
|
-
`) +
|
|
57071
|
-
`) +
|
|
57067
|
+
`) + chalk28__default.default.cyan(`Bug ID: ${bugId}
|
|
57068
|
+
`) + chalk28__default.default.gray(`Description: ${description}
|
|
57069
|
+
`) + chalk28__default.default.gray(`Status: Open
|
|
57070
|
+
`) + chalk28__default.default.gray(`Priority: To be determined
|
|
57072
57071
|
`),
|
|
57073
57072
|
data: { bugId, description, status: "open" }
|
|
57074
57073
|
};
|
|
@@ -57076,23 +57075,23 @@ describe("${target}", () => {
|
|
|
57076
57075
|
async listBugs() {
|
|
57077
57076
|
return {
|
|
57078
57077
|
ok: true,
|
|
57079
|
-
message:
|
|
57078
|
+
message: chalk28__default.default.cyan("\u{1F41B} Active Bugs:\n\n") + chalk28__default.default.yellow("1. BUG-A1B2C3: ") + chalk28__default.default.gray("Session timeout not handled properly\n") + chalk28__default.default.yellow("2. BUG-D4E5F6: ") + chalk28__default.default.gray("Memory leak in streaming responses\n") + chalk28__default.default.yellow("3. BUG-G7H8I9: ") + chalk28__default.default.gray("Spinner not stopping on error\n\n") + chalk28__default.default.gray("Total: 3 open bugs")
|
|
57080
57079
|
};
|
|
57081
57080
|
}
|
|
57082
57081
|
async analyzeBug(bugId) {
|
|
57083
57082
|
if (!bugId) {
|
|
57084
57083
|
return {
|
|
57085
57084
|
ok: false,
|
|
57086
|
-
message:
|
|
57085
|
+
message: chalk28__default.default.red("Please provide a bug ID to analyze")
|
|
57087
57086
|
};
|
|
57088
57087
|
}
|
|
57089
57088
|
return {
|
|
57090
57089
|
ok: true,
|
|
57091
|
-
message:
|
|
57090
|
+
message: chalk28__default.default.cyan(`\u{1F50D} Bug Analysis for ${bugId}:
|
|
57092
57091
|
|
|
57093
|
-
`) +
|
|
57092
|
+
`) + chalk28__default.default.yellow("Summary: ") + chalk28__default.default.gray("Session timeout not handled properly\n") + chalk28__default.default.yellow("Severity: ") + chalk28__default.default.orange("Medium\n") + chalk28__default.default.yellow("Component: ") + chalk28__default.default.gray("SessionManager\n") + chalk28__default.default.yellow("Reported: ") + chalk28__default.default.gray("2 days ago\n\n") + chalk28__default.default.cyan("Possible Causes:\n") + chalk28__default.default.gray(
|
|
57094
57093
|
" 1. AbortSignal not propagated to all async operations\n"
|
|
57095
|
-
) +
|
|
57094
|
+
) + chalk28__default.default.gray(" 2. Deadline timer not cleared on completion\n") + chalk28__default.default.gray(" 3. Race condition in state transitions\n\n") + chalk28__default.default.green("Suggested Fix:\n") + chalk28__default.default.gray(" Ensure all async operations respect the AbortSignal\n") + chalk28__default.default.gray(" Add finally block to clear timers\n")
|
|
57096
57095
|
};
|
|
57097
57096
|
}
|
|
57098
57097
|
};
|
|
@@ -57116,7 +57115,7 @@ var init_SystemHandlers = __esm({
|
|
|
57116
57115
|
if (signal?.aborted) {
|
|
57117
57116
|
return {
|
|
57118
57117
|
ok: false,
|
|
57119
|
-
message:
|
|
57118
|
+
message: chalk28__default.default.yellow("Status check canceled")
|
|
57120
57119
|
};
|
|
57121
57120
|
}
|
|
57122
57121
|
const verbose = args2.includes("--verbose") || args2.includes("-v");
|
|
@@ -57127,44 +57126,44 @@ var init_SystemHandlers = __esm({
|
|
|
57127
57126
|
cpu: os12__namespace.cpus()[0],
|
|
57128
57127
|
platform: process.platform
|
|
57129
57128
|
};
|
|
57130
|
-
let message =
|
|
57131
|
-
message +=
|
|
57132
|
-
message +=
|
|
57129
|
+
let message = chalk28__default.default.cyan.bold("\u{1F4CA} System Status\n\n");
|
|
57130
|
+
message += chalk28__default.default.green("\u2705 System: Operational\n");
|
|
57131
|
+
message += chalk28__default.default.gray(
|
|
57133
57132
|
`\u23F1\uFE0F Uptime: ${Math.floor(status.uptime / 60)}m ${Math.floor(status.uptime % 60)}s
|
|
57134
57133
|
`
|
|
57135
57134
|
);
|
|
57136
|
-
message +=
|
|
57135
|
+
message += chalk28__default.default.gray(
|
|
57137
57136
|
`\u{1F4BE} Memory: ${Math.round(status.memory.heapUsed / 1024 / 1024)}MB / ${Math.round(status.memory.heapTotal / 1024 / 1024)}MB
|
|
57138
57137
|
`
|
|
57139
57138
|
);
|
|
57140
57139
|
if (verbose) {
|
|
57141
|
-
message +=
|
|
57142
|
-
message +=
|
|
57140
|
+
message += chalk28__default.default.gray("\nDetailed Information:\n");
|
|
57141
|
+
message += chalk28__default.default.gray(` \u2022 CPU: ${status.cpu.model}
|
|
57143
57142
|
`);
|
|
57144
|
-
message +=
|
|
57143
|
+
message += chalk28__default.default.gray(
|
|
57145
57144
|
` \u2022 Platform: ${status.platform} (${os12__namespace.arch()})
|
|
57146
57145
|
`
|
|
57147
57146
|
);
|
|
57148
|
-
message +=
|
|
57147
|
+
message += chalk28__default.default.gray(` \u2022 Node.js: ${process.version}
|
|
57149
57148
|
`);
|
|
57150
|
-
message +=
|
|
57149
|
+
message += chalk28__default.default.gray(` \u2022 Process ID: ${process.pid}
|
|
57151
57150
|
`);
|
|
57152
|
-
message +=
|
|
57151
|
+
message += chalk28__default.default.gray(` \u2022 Working Directory: ${process.cwd()}
|
|
57153
57152
|
`);
|
|
57154
|
-
message +=
|
|
57155
|
-
message +=
|
|
57153
|
+
message += chalk28__default.default.gray("\nMemory Details:\n");
|
|
57154
|
+
message += chalk28__default.default.gray(
|
|
57156
57155
|
` \u2022 RSS: ${Math.round(status.memory.rss / 1024 / 1024)}MB
|
|
57157
57156
|
`
|
|
57158
57157
|
);
|
|
57159
|
-
message +=
|
|
57158
|
+
message += chalk28__default.default.gray(
|
|
57160
57159
|
` \u2022 Heap Used: ${Math.round(status.memory.heapUsed / 1024 / 1024)}MB
|
|
57161
57160
|
`
|
|
57162
57161
|
);
|
|
57163
|
-
message +=
|
|
57162
|
+
message += chalk28__default.default.gray(
|
|
57164
57163
|
` \u2022 Heap Total: ${Math.round(status.memory.heapTotal / 1024 / 1024)}MB
|
|
57165
57164
|
`
|
|
57166
57165
|
);
|
|
57167
|
-
message +=
|
|
57166
|
+
message += chalk28__default.default.gray(
|
|
57168
57167
|
` \u2022 External: ${Math.round(status.memory.external / 1024 / 1024)}MB
|
|
57169
57168
|
`
|
|
57170
57169
|
);
|
|
@@ -57193,7 +57192,7 @@ var init_SystemHandlers = __esm({
|
|
|
57193
57192
|
if (signal?.aborted) {
|
|
57194
57193
|
return {
|
|
57195
57194
|
ok: false,
|
|
57196
|
-
message:
|
|
57195
|
+
message: chalk28__default.default.yellow("Model operation canceled")
|
|
57197
57196
|
};
|
|
57198
57197
|
}
|
|
57199
57198
|
if (args2.length === 0) {
|
|
@@ -57213,17 +57212,17 @@ var init_SystemHandlers = __esm({
|
|
|
57213
57212
|
}
|
|
57214
57213
|
}
|
|
57215
57214
|
async listModels() {
|
|
57216
|
-
let message =
|
|
57217
|
-
message +=
|
|
57215
|
+
let message = chalk28__default.default.cyan.bold("\u{1F916} Available Models\n\n");
|
|
57216
|
+
message += chalk28__default.default.green(`Current: ${this.currentModel}
|
|
57218
57217
|
|
|
57219
57218
|
`);
|
|
57220
57219
|
for (const model of this.availableModels) {
|
|
57221
|
-
const status = model.available ?
|
|
57222
|
-
const name2 = model.id === this.currentModel ?
|
|
57223
|
-
message += `${status} ${name2.padEnd(20)} ${
|
|
57220
|
+
const status = model.available ? chalk28__default.default.green("\u2705") : chalk28__default.default.red("\u274C");
|
|
57221
|
+
const name2 = model.id === this.currentModel ? chalk28__default.default.green.bold(model.id) : chalk28__default.default.cyan(model.id);
|
|
57222
|
+
message += `${status} ${name2.padEnd(20)} ${chalk28__default.default.gray(`[${model.provider}]`)}
|
|
57224
57223
|
`;
|
|
57225
57224
|
}
|
|
57226
|
-
message +=
|
|
57225
|
+
message += chalk28__default.default.gray("\nUse /model <name> to switch models");
|
|
57227
57226
|
return {
|
|
57228
57227
|
ok: true,
|
|
57229
57228
|
message,
|
|
@@ -57234,27 +57233,27 @@ var init_SystemHandlers = __esm({
|
|
|
57234
57233
|
if (!modelId) {
|
|
57235
57234
|
return {
|
|
57236
57235
|
ok: false,
|
|
57237
|
-
message:
|
|
57236
|
+
message: chalk28__default.default.red("Please specify a model to switch to")
|
|
57238
57237
|
};
|
|
57239
57238
|
}
|
|
57240
57239
|
const model = this.availableModels.find((m2) => m2.id === modelId);
|
|
57241
57240
|
if (!model) {
|
|
57242
57241
|
return {
|
|
57243
57242
|
ok: false,
|
|
57244
|
-
message:
|
|
57245
|
-
`) +
|
|
57243
|
+
message: chalk28__default.default.red(`Unknown model: ${modelId}
|
|
57244
|
+
`) + chalk28__default.default.gray("Use /model list to see available models")
|
|
57246
57245
|
};
|
|
57247
57246
|
}
|
|
57248
57247
|
if (!model.available) {
|
|
57249
57248
|
return {
|
|
57250
57249
|
ok: false,
|
|
57251
|
-
message:
|
|
57250
|
+
message: chalk28__default.default.yellow(`Model ${modelId} is not currently available`)
|
|
57252
57251
|
};
|
|
57253
57252
|
}
|
|
57254
57253
|
this.currentModel = modelId;
|
|
57255
57254
|
return {
|
|
57256
57255
|
ok: true,
|
|
57257
|
-
message:
|
|
57256
|
+
message: chalk28__default.default.green(`\u2705 Switched to ${modelId}`),
|
|
57258
57257
|
data: { model: modelId }
|
|
57259
57258
|
};
|
|
57260
57259
|
}
|
|
@@ -57263,27 +57262,27 @@ var init_SystemHandlers = __esm({
|
|
|
57263
57262
|
if (!model) {
|
|
57264
57263
|
return {
|
|
57265
57264
|
ok: false,
|
|
57266
|
-
message:
|
|
57265
|
+
message: chalk28__default.default.red(`Unknown model: ${modelId}`)
|
|
57267
57266
|
};
|
|
57268
57267
|
}
|
|
57269
|
-
let message =
|
|
57268
|
+
let message = chalk28__default.default.cyan(`\u{1F4CB} Model Information: ${modelId}
|
|
57270
57269
|
|
|
57271
57270
|
`);
|
|
57272
|
-
message +=
|
|
57271
|
+
message += chalk28__default.default.gray(`Provider: ${model.provider}
|
|
57273
57272
|
`);
|
|
57274
|
-
message +=
|
|
57273
|
+
message += chalk28__default.default.gray(
|
|
57275
57274
|
`Status: ${model.available ? "Available" : "Unavailable"}
|
|
57276
57275
|
`
|
|
57277
57276
|
);
|
|
57278
|
-
message +=
|
|
57277
|
+
message += chalk28__default.default.gray(
|
|
57279
57278
|
`Current: ${model.id === this.currentModel ? "Yes" : "No"}
|
|
57280
57279
|
`
|
|
57281
57280
|
);
|
|
57282
|
-
message +=
|
|
57283
|
-
message +=
|
|
57284
|
-
message +=
|
|
57285
|
-
message +=
|
|
57286
|
-
message +=
|
|
57281
|
+
message += chalk28__default.default.gray("\nCapabilities:\n");
|
|
57282
|
+
message += chalk28__default.default.gray(" \u2022 Context: 128K tokens\n");
|
|
57283
|
+
message += chalk28__default.default.gray(" \u2022 Languages: 95+\n");
|
|
57284
|
+
message += chalk28__default.default.gray(" \u2022 Code: Yes\n");
|
|
57285
|
+
message += chalk28__default.default.gray(" \u2022 Vision: ") + (modelId.includes("gpt-4") ? "Yes\n" : "No\n");
|
|
57287
57286
|
return {
|
|
57288
57287
|
ok: true,
|
|
57289
57288
|
message,
|
|
@@ -57315,39 +57314,39 @@ var init_SystemHandlers = __esm({
|
|
|
57315
57314
|
default:
|
|
57316
57315
|
return {
|
|
57317
57316
|
ok: false,
|
|
57318
|
-
message:
|
|
57319
|
-
`) +
|
|
57317
|
+
message: chalk28__default.default.red(`Unknown memory subcommand: ${subcommand}
|
|
57318
|
+
`) + chalk28__default.default.gray("Available: status, clear, export, compact")
|
|
57320
57319
|
};
|
|
57321
57320
|
}
|
|
57322
57321
|
}
|
|
57323
57322
|
async showStatus() {
|
|
57324
|
-
let message =
|
|
57325
|
-
message +=
|
|
57326
|
-
message +=
|
|
57323
|
+
let message = chalk28__default.default.cyan.bold("\u{1F9E0} Memory Status\n\n");
|
|
57324
|
+
message += chalk28__default.default.yellow("System 1 (Fast):\n");
|
|
57325
|
+
message += chalk28__default.default.gray(
|
|
57327
57326
|
` \u2022 Knowledge Nodes: ${this.memoryStats.system1.nodes}
|
|
57328
57327
|
`
|
|
57329
57328
|
);
|
|
57330
|
-
message +=
|
|
57329
|
+
message += chalk28__default.default.gray(` \u2022 Tokens: ${this.memoryStats.system1.tokens}
|
|
57331
57330
|
|
|
57332
57331
|
`);
|
|
57333
|
-
message +=
|
|
57334
|
-
message +=
|
|
57332
|
+
message += chalk28__default.default.blue("System 2 (Deep):\n");
|
|
57333
|
+
message += chalk28__default.default.gray(
|
|
57335
57334
|
` \u2022 Reasoning Traces: ${this.memoryStats.system2.traces}
|
|
57336
57335
|
`
|
|
57337
57336
|
);
|
|
57338
|
-
message +=
|
|
57337
|
+
message += chalk28__default.default.gray(` \u2022 Tokens: ${this.memoryStats.system2.tokens}
|
|
57339
57338
|
|
|
57340
57339
|
`);
|
|
57341
|
-
message +=
|
|
57342
|
-
message +=
|
|
57340
|
+
message += chalk28__default.default.green("Total:\n");
|
|
57341
|
+
message += chalk28__default.default.gray(` \u2022 Entries: ${this.memoryStats.total.entries}
|
|
57343
57342
|
`);
|
|
57344
|
-
message +=
|
|
57343
|
+
message += chalk28__default.default.gray(
|
|
57345
57344
|
` \u2022 Tokens: ${this.memoryStats.total.tokens} / 128000
|
|
57346
57345
|
`
|
|
57347
57346
|
);
|
|
57348
57347
|
const usage = Math.round(this.memoryStats.total.tokens / 128e3 * 100);
|
|
57349
57348
|
const bar = "\u2588".repeat(Math.floor(usage / 5)) + "\u2591".repeat(20 - Math.floor(usage / 5));
|
|
57350
|
-
message +=
|
|
57349
|
+
message += chalk28__default.default.gray(` \u2022 Usage: [${bar}] ${usage}%
|
|
57351
57350
|
`);
|
|
57352
57351
|
return {
|
|
57353
57352
|
ok: true,
|
|
@@ -57361,14 +57360,14 @@ var init_SystemHandlers = __esm({
|
|
|
57361
57360
|
this.memoryStats.system1 = { nodes: 0, tokens: 0 };
|
|
57362
57361
|
return {
|
|
57363
57362
|
ok: true,
|
|
57364
|
-
message:
|
|
57363
|
+
message: chalk28__default.default.green("\u2705 System 1 memory cleared")
|
|
57365
57364
|
};
|
|
57366
57365
|
}
|
|
57367
57366
|
if (system === "system2") {
|
|
57368
57367
|
this.memoryStats.system2 = { traces: 0, tokens: 0 };
|
|
57369
57368
|
return {
|
|
57370
57369
|
ok: true,
|
|
57371
|
-
message:
|
|
57370
|
+
message: chalk28__default.default.green("\u2705 System 2 memory cleared")
|
|
57372
57371
|
};
|
|
57373
57372
|
}
|
|
57374
57373
|
this.memoryStats = {
|
|
@@ -57378,15 +57377,15 @@ var init_SystemHandlers = __esm({
|
|
|
57378
57377
|
};
|
|
57379
57378
|
return {
|
|
57380
57379
|
ok: true,
|
|
57381
|
-
message:
|
|
57380
|
+
message: chalk28__default.default.green("\u{1F9F9} All memory cleared")
|
|
57382
57381
|
};
|
|
57383
57382
|
}
|
|
57384
57383
|
async exportMemory() {
|
|
57385
57384
|
const filename = `memory-export-${Date.now()}.json`;
|
|
57386
57385
|
return {
|
|
57387
57386
|
ok: true,
|
|
57388
|
-
message:
|
|
57389
|
-
`) +
|
|
57387
|
+
message: chalk28__default.default.green(`\u{1F4E6} Memory exported to ${filename}
|
|
57388
|
+
`) + chalk28__default.default.gray(
|
|
57390
57389
|
`Size: ${Math.round(JSON.stringify(this.memoryStats).length / 1024)}KB`
|
|
57391
57390
|
),
|
|
57392
57391
|
data: { filename, stats: this.memoryStats }
|
|
@@ -57404,9 +57403,9 @@ var init_SystemHandlers = __esm({
|
|
|
57404
57403
|
);
|
|
57405
57404
|
return {
|
|
57406
57405
|
ok: true,
|
|
57407
|
-
message:
|
|
57408
|
-
`) +
|
|
57409
|
-
`) +
|
|
57406
|
+
message: chalk28__default.default.green("\u2728 Memory compacted successfully\n") + chalk28__default.default.gray(`Before: ${before} tokens
|
|
57407
|
+
`) + chalk28__default.default.gray(`After: ${after} tokens
|
|
57408
|
+
`) + chalk28__default.default.gray(
|
|
57410
57409
|
`Saved: ${before - after} tokens (${Math.round((1 - after / before) * 100)}%)`
|
|
57411
57410
|
),
|
|
57412
57411
|
data: { before, after, saved: before - after }
|
|
@@ -57422,11 +57421,11 @@ var init_SystemHandlers = __esm({
|
|
|
57422
57421
|
if (signal?.aborted) {
|
|
57423
57422
|
return {
|
|
57424
57423
|
ok: false,
|
|
57425
|
-
message:
|
|
57424
|
+
message: chalk28__default.default.yellow("Health check canceled")
|
|
57426
57425
|
};
|
|
57427
57426
|
}
|
|
57428
57427
|
const detailed = args2.includes("--detailed");
|
|
57429
|
-
let message =
|
|
57428
|
+
let message = chalk28__default.default.cyan.bold("\u{1F3E5} System Health Check\n\n");
|
|
57430
57429
|
const checks = [
|
|
57431
57430
|
{ name: "Core Services", status: "ok", latency: 12 },
|
|
57432
57431
|
{ name: "Memory System", status: "ok", latency: 8 },
|
|
@@ -57435,11 +57434,11 @@ var init_SystemHandlers = __esm({
|
|
|
57435
57434
|
{ name: "Network", status: "warning", latency: 250 }
|
|
57436
57435
|
];
|
|
57437
57436
|
for (const check of checks) {
|
|
57438
|
-
const icon = check.status === "ok" ?
|
|
57439
|
-
const status = check.status === "ok" ?
|
|
57437
|
+
const icon = check.status === "ok" ? chalk28__default.default.green("\u2705") : check.status === "warning" ? chalk28__default.default.yellow("\u26A0\uFE0F") : chalk28__default.default.red("\u274C");
|
|
57438
|
+
const status = check.status === "ok" ? chalk28__default.default.green("OK") : check.status === "warning" ? chalk28__default.default.yellow("WARNING") : chalk28__default.default.red("ERROR");
|
|
57440
57439
|
message += `${icon} ${check.name.padEnd(20)} ${status}`;
|
|
57441
57440
|
if (detailed) {
|
|
57442
|
-
message +=
|
|
57441
|
+
message += chalk28__default.default.gray(` (${check.latency}ms)`);
|
|
57443
57442
|
}
|
|
57444
57443
|
message += "\n";
|
|
57445
57444
|
}
|
|
@@ -57447,11 +57446,11 @@ var init_SystemHandlers = __esm({
|
|
|
57447
57446
|
const hasErrors = checks.some((c) => c.status === "error");
|
|
57448
57447
|
message += "\n";
|
|
57449
57448
|
if (hasErrors) {
|
|
57450
|
-
message +=
|
|
57449
|
+
message += chalk28__default.default.red("\u26A0\uFE0F System has errors - intervention required");
|
|
57451
57450
|
} else if (hasWarnings) {
|
|
57452
|
-
message +=
|
|
57451
|
+
message += chalk28__default.default.yellow("\u26A0\uFE0F System operational with warnings");
|
|
57453
57452
|
} else {
|
|
57454
|
-
message +=
|
|
57453
|
+
message += chalk28__default.default.green("\u2705 All systems operational");
|
|
57455
57454
|
}
|
|
57456
57455
|
return {
|
|
57457
57456
|
ok: true,
|
|
@@ -57469,12 +57468,12 @@ var init_SystemHandlers = __esm({
|
|
|
57469
57468
|
if (signal?.aborted) {
|
|
57470
57469
|
return {
|
|
57471
57470
|
ok: false,
|
|
57472
|
-
message:
|
|
57471
|
+
message: chalk28__default.default.yellow("Doctor check canceled")
|
|
57473
57472
|
};
|
|
57474
57473
|
}
|
|
57475
57474
|
const autoFix = args2.includes("--fix");
|
|
57476
|
-
let message =
|
|
57477
|
-
message +=
|
|
57475
|
+
let message = chalk28__default.default.cyan.bold("\u{1F468}\u2695\uFE0F System Doctor\n\n");
|
|
57476
|
+
message += chalk28__default.default.gray("Running diagnostics...\n\n");
|
|
57478
57477
|
const issues = [
|
|
57479
57478
|
{
|
|
57480
57479
|
severity: "warning",
|
|
@@ -57496,20 +57495,20 @@ var init_SystemHandlers = __esm({
|
|
|
57496
57495
|
}
|
|
57497
57496
|
];
|
|
57498
57497
|
if (issues.length === 0) {
|
|
57499
|
-
message +=
|
|
57498
|
+
message += chalk28__default.default.green("\u2705 No issues found - system is healthy!");
|
|
57500
57499
|
return { ok: true, message };
|
|
57501
57500
|
}
|
|
57502
|
-
message +=
|
|
57501
|
+
message += chalk28__default.default.yellow(`Found ${issues.length} issue(s):
|
|
57503
57502
|
|
|
57504
57503
|
`);
|
|
57505
57504
|
for (const issue of issues) {
|
|
57506
|
-
const icon = issue.severity === "error" ?
|
|
57505
|
+
const icon = issue.severity === "error" ? chalk28__default.default.red("\u274C") : issue.severity === "warning" ? chalk28__default.default.yellow("\u26A0\uFE0F") : chalk28__default.default.blue("\u2139\uFE0F");
|
|
57507
57506
|
message += `${icon} ${issue.issue}
|
|
57508
57507
|
`;
|
|
57509
|
-
message +=
|
|
57508
|
+
message += chalk28__default.default.gray(` Solution: ${issue.solution}
|
|
57510
57509
|
`);
|
|
57511
57510
|
if (autoFix && issue.fixable) {
|
|
57512
|
-
message +=
|
|
57511
|
+
message += chalk28__default.default.green(` \u2705 Auto-fixed
|
|
57513
57512
|
`);
|
|
57514
57513
|
}
|
|
57515
57514
|
message += "\n";
|
|
@@ -57517,7 +57516,7 @@ var init_SystemHandlers = __esm({
|
|
|
57517
57516
|
if (!autoFix) {
|
|
57518
57517
|
const fixableCount = issues.filter((i2) => i2.fixable).length;
|
|
57519
57518
|
if (fixableCount > 0) {
|
|
57520
|
-
message +=
|
|
57519
|
+
message += chalk28__default.default.gray(
|
|
57521
57520
|
`
|
|
57522
57521
|
Run /doctor --fix to automatically fix ${fixableCount} issue(s)`
|
|
57523
57522
|
);
|
|
@@ -57980,14 +57979,14 @@ function createCLI() {
|
|
|
57980
57979
|
}
|
|
57981
57980
|
});
|
|
57982
57981
|
program2.command("setup-ollama").description("Setup Ollama for local AI").action(async () => {
|
|
57983
|
-
console.log(
|
|
57982
|
+
console.log(chalk28__default.default.cyan("Setting up Ollama..."));
|
|
57984
57983
|
console.log(
|
|
57985
|
-
|
|
57984
|
+
chalk28__default.default.yellow("Please run: brew install ollama && ollama serve")
|
|
57986
57985
|
);
|
|
57987
57986
|
});
|
|
57988
57987
|
program2.command("setup-vllm").description("Setup vLLM for local AI").action(async () => {
|
|
57989
|
-
console.log(
|
|
57990
|
-
console.log(
|
|
57988
|
+
console.log(chalk28__default.default.cyan("Setting up vLLM..."));
|
|
57989
|
+
console.log(chalk28__default.default.yellow("Please run: pip install vllm"));
|
|
57991
57990
|
});
|
|
57992
57991
|
return program2;
|
|
57993
57992
|
}
|
|
@@ -58015,13 +58014,13 @@ var init_maria_ai = __esm({
|
|
|
58015
58014
|
await this.providerSelector.initialize();
|
|
58016
58015
|
const { provider, model } = await this.providerSelector.selectProvider();
|
|
58017
58016
|
console.log(
|
|
58018
|
-
|
|
58017
|
+
chalk28__default.default.green(`
|
|
58019
58018
|
\u2705 Selected: ${provider} with model ${model}`)
|
|
58020
58019
|
);
|
|
58021
58020
|
this.config.set("currentProvider", provider);
|
|
58022
58021
|
this.config.set("currentModel", model);
|
|
58023
58022
|
await this.config.save();
|
|
58024
|
-
console.log(
|
|
58023
|
+
console.log(chalk28__default.default.cyan("\n\u{1F9E0} Initializing Intelligent Router..."));
|
|
58025
58024
|
this.router = new IntelligentRouterService({
|
|
58026
58025
|
confidenceThreshold: 0.85,
|
|
58027
58026
|
enableLearning: true,
|
|
@@ -58029,12 +58028,12 @@ var init_maria_ai = __esm({
|
|
|
58029
58028
|
});
|
|
58030
58029
|
await this.router.initialize();
|
|
58031
58030
|
console.log(
|
|
58032
|
-
|
|
58031
|
+
chalk28__default.default.green("\u2705 Intelligent Router initialized successfully\n")
|
|
58033
58032
|
);
|
|
58034
58033
|
this.session = createInteractiveSession(this);
|
|
58035
58034
|
await this.session.start();
|
|
58036
58035
|
} catch (error2) {
|
|
58037
|
-
console.error(
|
|
58036
|
+
console.error(chalk28__default.default.red("\n\u274C Initialization failed:"), error2);
|
|
58038
58037
|
process.exit(1);
|
|
58039
58038
|
}
|
|
58040
58039
|
}
|
|
@@ -58042,7 +58041,7 @@ var init_maria_ai = __esm({
|
|
|
58042
58041
|
if (this.session) {
|
|
58043
58042
|
await this.session.stop();
|
|
58044
58043
|
}
|
|
58045
|
-
console.log(
|
|
58044
|
+
console.log(chalk28__default.default.green("\n\u{1F44B} Goodbye!"));
|
|
58046
58045
|
}
|
|
58047
58046
|
};
|
|
58048
58047
|
}
|
|
@@ -58086,8 +58085,8 @@ async function loadServices() {
|
|
|
58086
58085
|
try {
|
|
58087
58086
|
const commandName = command.startsWith("/") ? command.slice(1) : command;
|
|
58088
58087
|
if (commandName === "battlecard") {
|
|
58089
|
-
console.log(
|
|
58090
|
-
console.log(
|
|
58088
|
+
console.log(chalk28__default.default.yellow("\u{1F512} /battlecard is not available on Free plan"));
|
|
58089
|
+
console.log(chalk28__default.default.gray(" Join the waitlist for business features: https://maria-code.ai/waitlist"));
|
|
58091
58090
|
return {
|
|
58092
58091
|
success: false,
|
|
58093
58092
|
message: "Command not available on Free plan"
|
|
@@ -58148,7 +58147,7 @@ async function loadServices() {
|
|
|
58148
58147
|
commandManager.setLegacyHandler(legacyHandlerAdapter);
|
|
58149
58148
|
}
|
|
58150
58149
|
} catch (e2) {
|
|
58151
|
-
console.warn(
|
|
58150
|
+
console.warn(chalk28__default.default.yellow("\u26A0 Some services unavailable, using fallbacks"));
|
|
58152
58151
|
}
|
|
58153
58152
|
}
|
|
58154
58153
|
async function init() {
|
|
@@ -58270,17 +58269,17 @@ async function enforceAuth(cmd) {
|
|
|
58270
58269
|
try {
|
|
58271
58270
|
const tokens = await authManager.getValidTokens();
|
|
58272
58271
|
if (!tokens) {
|
|
58273
|
-
console.log(
|
|
58272
|
+
console.log(chalk28__default.default.red("\u{1F510} Authentication required \xB7 Run: maria /login"));
|
|
58274
58273
|
return false;
|
|
58275
58274
|
}
|
|
58276
58275
|
return true;
|
|
58277
58276
|
} catch (error2) {
|
|
58278
58277
|
if (error2.code === "AUTH_REQUIRED") {
|
|
58279
|
-
console.log(
|
|
58278
|
+
console.log(chalk28__default.default.red("\u{1F510} Authentication required \xB7 Run: maria /login"));
|
|
58280
58279
|
} else if (error2.code === "REAUTH_REQUIRED") {
|
|
58281
|
-
console.log(
|
|
58280
|
+
console.log(chalk28__default.default.yellow("\u{1F504} Please re-authenticate \xB7 Run: maria /login"));
|
|
58282
58281
|
} else {
|
|
58283
|
-
console.log(
|
|
58282
|
+
console.log(chalk28__default.default.red("\u{1F310} Network error, check connection"));
|
|
58284
58283
|
}
|
|
58285
58284
|
return false;
|
|
58286
58285
|
}
|
|
@@ -58319,7 +58318,7 @@ async function handleSlash(input3) {
|
|
|
58319
58318
|
console.log(JSON.stringify(result2.data, null, 2));
|
|
58320
58319
|
}
|
|
58321
58320
|
} else {
|
|
58322
|
-
console.log(
|
|
58321
|
+
console.log(chalk28__default.default.red(`Help Error: ${result2.message}`));
|
|
58323
58322
|
}
|
|
58324
58323
|
return true;
|
|
58325
58324
|
}
|
|
@@ -58327,7 +58326,7 @@ async function handleSlash(input3) {
|
|
|
58327
58326
|
if (process.env.MARIA_DEBUG === "1") {
|
|
58328
58327
|
console.error("HelpCommand error:", helpError);
|
|
58329
58328
|
}
|
|
58330
|
-
console.log(
|
|
58329
|
+
console.log(chalk28__default.default.yellow("\u26A0 Dynamic help unavailable, using fallback"));
|
|
58331
58330
|
}
|
|
58332
58331
|
const help = `
|
|
58333
58332
|
\u{1F4D6} MARIA CLI Help
|
|
@@ -58357,7 +58356,7 @@ Chat:
|
|
|
58357
58356
|
session.length = 0;
|
|
58358
58357
|
if (ctx?.clearContext) ctx.clearContext();
|
|
58359
58358
|
console.clear();
|
|
58360
|
-
console.log(
|
|
58359
|
+
console.log(chalk28__default.default.green("\u2728 Session cleared"));
|
|
58361
58360
|
return true;
|
|
58362
58361
|
}
|
|
58363
58362
|
if (cmd === "code") {
|
|
@@ -58366,7 +58365,7 @@ Chat:
|
|
|
58366
58365
|
const prompt = args2.join(" ").trim();
|
|
58367
58366
|
if (!prompt) {
|
|
58368
58367
|
console.log(
|
|
58369
|
-
|
|
58368
|
+
chalk28__default.default.red("Usage: /code <request> e.g. /code build a REST API")
|
|
58370
58369
|
);
|
|
58371
58370
|
return true;
|
|
58372
58371
|
}
|
|
@@ -58379,7 +58378,7 @@ Chat:
|
|
|
58379
58378
|
const prompt = args2.join(" ").trim();
|
|
58380
58379
|
if (!prompt) {
|
|
58381
58380
|
console.log(
|
|
58382
|
-
|
|
58381
|
+
chalk28__default.default.cyan("\u{1F3A8} **Image Generation**\n") + chalk28__default.default.white("Usage: /image <prompt>\n") + chalk28__default.default.gray("Example: /image \u5BCC\u58EB\u5C71\u306E\u65E5\u306E\u51FA")
|
|
58383
58382
|
);
|
|
58384
58383
|
return true;
|
|
58385
58384
|
}
|
|
@@ -58391,14 +58390,14 @@ Chat:
|
|
|
58391
58390
|
options: {},
|
|
58392
58391
|
logger: {
|
|
58393
58392
|
info: (msg) => console.log(msg),
|
|
58394
|
-
error: (msg) => console.error(
|
|
58395
|
-
warn: (msg) => console.warn(
|
|
58393
|
+
error: (msg) => console.error(chalk28__default.default.red(msg)),
|
|
58394
|
+
warn: (msg) => console.warn(chalk28__default.default.yellow(msg))
|
|
58396
58395
|
}
|
|
58397
58396
|
};
|
|
58398
58397
|
await imageCommand2.execute(context2);
|
|
58399
58398
|
}
|
|
58400
58399
|
} catch (error2) {
|
|
58401
|
-
console.error(
|
|
58400
|
+
console.error(chalk28__default.default.red("Image generation failed:"), error2.message);
|
|
58402
58401
|
}
|
|
58403
58402
|
return true;
|
|
58404
58403
|
}
|
|
@@ -58408,7 +58407,7 @@ Chat:
|
|
|
58408
58407
|
const prompt = args2.join(" ").trim();
|
|
58409
58408
|
if (!prompt) {
|
|
58410
58409
|
console.log(
|
|
58411
|
-
|
|
58410
|
+
chalk28__default.default.cyan("\u{1F3AC} **Video Generation**\n") + chalk28__default.default.white("Usage: /video <prompt>\n") + chalk28__default.default.gray("Example: /video \u6D77\u306E\u6CE2\u304C\u6253\u3061\u5BC4\u305B\u308B\u69D8\u5B50")
|
|
58412
58411
|
);
|
|
58413
58412
|
return true;
|
|
58414
58413
|
}
|
|
@@ -58420,14 +58419,14 @@ Chat:
|
|
|
58420
58419
|
options: {},
|
|
58421
58420
|
logger: {
|
|
58422
58421
|
info: (msg) => console.log(msg),
|
|
58423
|
-
error: (msg) => console.error(
|
|
58424
|
-
warn: (msg) => console.warn(
|
|
58422
|
+
error: (msg) => console.error(chalk28__default.default.red(msg)),
|
|
58423
|
+
warn: (msg) => console.warn(chalk28__default.default.yellow(msg))
|
|
58425
58424
|
}
|
|
58426
58425
|
};
|
|
58427
58426
|
await videoCommand2.execute(context2);
|
|
58428
58427
|
}
|
|
58429
58428
|
} catch (error2) {
|
|
58430
|
-
console.error(
|
|
58429
|
+
console.error(chalk28__default.default.red("Video generation failed:"), error2.message);
|
|
58431
58430
|
}
|
|
58432
58431
|
return true;
|
|
58433
58432
|
}
|
|
@@ -58437,7 +58436,7 @@ Chat:
|
|
|
58437
58436
|
const prompt = args2.join(" ").trim();
|
|
58438
58437
|
if (!prompt) {
|
|
58439
58438
|
console.log(
|
|
58440
|
-
|
|
58439
|
+
chalk28__default.default.cyan("\u{1F399}\uFE0F **Voice Synthesis**\n") + chalk28__default.default.white("Usage: /voice <text>\n") + chalk28__default.default.gray("Example: /voice \u3053\u3093\u306B\u3061\u306F\u3001\u5143\u6C17\u3067\u3059\u304B\uFF1F")
|
|
58441
58440
|
);
|
|
58442
58441
|
return true;
|
|
58443
58442
|
}
|
|
@@ -58449,14 +58448,14 @@ Chat:
|
|
|
58449
58448
|
options: {},
|
|
58450
58449
|
logger: {
|
|
58451
58450
|
info: (msg) => console.log(msg),
|
|
58452
|
-
error: (msg) => console.error(
|
|
58453
|
-
warn: (msg) => console.warn(
|
|
58451
|
+
error: (msg) => console.error(chalk28__default.default.red(msg)),
|
|
58452
|
+
warn: (msg) => console.warn(chalk28__default.default.yellow(msg))
|
|
58454
58453
|
}
|
|
58455
58454
|
};
|
|
58456
58455
|
await voiceCommand2.execute(context2);
|
|
58457
58456
|
}
|
|
58458
58457
|
} catch (error2) {
|
|
58459
|
-
console.error(
|
|
58458
|
+
console.error(chalk28__default.default.red("Voice synthesis failed:"), error2.message);
|
|
58460
58459
|
}
|
|
58461
58460
|
return true;
|
|
58462
58461
|
}
|
|
@@ -58475,49 +58474,49 @@ Chat:
|
|
|
58475
58474
|
if (args2.includes("status")) {
|
|
58476
58475
|
if (await authManager.isAuthenticated()) {
|
|
58477
58476
|
const user = await authManager.getCurrentUser();
|
|
58478
|
-
console.log(
|
|
58477
|
+
console.log(chalk28__default.default.green("\u2705 Authenticated"));
|
|
58479
58478
|
if (user.name) {
|
|
58480
|
-
console.log(
|
|
58479
|
+
console.log(chalk28__default.default.white(`\u{1F464} Name: ${chalk28__default.default.cyan(user.name)}`));
|
|
58481
58480
|
}
|
|
58482
|
-
console.log(
|
|
58481
|
+
console.log(chalk28__default.default.white(`\u{1F4E7} Email: ${chalk28__default.default.cyan(user.email)}`));
|
|
58483
58482
|
if (user.provider) {
|
|
58484
|
-
console.log(
|
|
58483
|
+
console.log(chalk28__default.default.white(`\u{1F511} Provider: ${chalk28__default.default.cyan(user.provider)}`));
|
|
58485
58484
|
}
|
|
58486
|
-
console.log(
|
|
58485
|
+
console.log(chalk28__default.default.white(`\u{1F4CA} Plan: ${chalk28__default.default.cyan(user.plan)}`));
|
|
58487
58486
|
} else {
|
|
58488
|
-
console.log(
|
|
58489
|
-
console.log(
|
|
58487
|
+
console.log(chalk28__default.default.yellow("\u26A0\uFE0F Not authenticated"));
|
|
58488
|
+
console.log(chalk28__default.default.gray("Use /login to sign in"));
|
|
58490
58489
|
}
|
|
58491
58490
|
} else {
|
|
58492
58491
|
const result2 = await authManager.login(options3);
|
|
58493
58492
|
if (result2.success && result2.user) {
|
|
58494
|
-
console.log(
|
|
58493
|
+
console.log(chalk28__default.default.green("\u2705 Successfully logged in!"));
|
|
58495
58494
|
const u = result2.user;
|
|
58496
58495
|
if (u.name) {
|
|
58497
|
-
console.log(
|
|
58496
|
+
console.log(chalk28__default.default.white(`\u{1F464} Name: ${chalk28__default.default.cyan(u.name)}`));
|
|
58498
58497
|
}
|
|
58499
|
-
console.log(
|
|
58498
|
+
console.log(chalk28__default.default.white(`\u{1F4E7} Email: ${chalk28__default.default.cyan(u.email)}`));
|
|
58500
58499
|
if (u.provider) {
|
|
58501
|
-
console.log(
|
|
58500
|
+
console.log(chalk28__default.default.white(`\u{1F511} Provider: ${chalk28__default.default.cyan(u.provider)}`));
|
|
58502
58501
|
}
|
|
58503
|
-
console.log(
|
|
58502
|
+
console.log(chalk28__default.default.white(`\u{1F4CA} Plan: ${chalk28__default.default.cyan(u.plan)}`));
|
|
58504
58503
|
} else {
|
|
58505
|
-
console.log(
|
|
58506
|
-
if (result2.error) console.log(
|
|
58504
|
+
console.log(chalk28__default.default.red("\u274C Login failed"));
|
|
58505
|
+
if (result2.error) console.log(chalk28__default.default.gray(result2.error));
|
|
58507
58506
|
}
|
|
58508
58507
|
}
|
|
58509
58508
|
}
|
|
58510
58509
|
} catch (error2) {
|
|
58511
|
-
console.error(
|
|
58510
|
+
console.error(chalk28__default.default.red("Login error:"), error2.message);
|
|
58512
58511
|
}
|
|
58513
58512
|
return true;
|
|
58514
58513
|
}
|
|
58515
58514
|
if (cmd === "logout" || cmd === "signout") {
|
|
58516
58515
|
try {
|
|
58517
58516
|
await authManager.logout();
|
|
58518
|
-
console.log(
|
|
58517
|
+
console.log(chalk28__default.default.green("\u{1F44B} Signed out. Local credentials removed."));
|
|
58519
58518
|
} catch (error2) {
|
|
58520
|
-
console.error(
|
|
58519
|
+
console.error(chalk28__default.default.red("Logout error:"), error2.message);
|
|
58521
58520
|
}
|
|
58522
58521
|
return true;
|
|
58523
58522
|
}
|
|
@@ -58658,7 +58657,7 @@ Chat:
|
|
|
58658
58657
|
} else if (result2.message) {
|
|
58659
58658
|
console.log(result2.message);
|
|
58660
58659
|
} else if (result2.success) {
|
|
58661
|
-
console.log(
|
|
58660
|
+
console.log(chalk28__default.default.green("\u2705 Command executed successfully"));
|
|
58662
58661
|
}
|
|
58663
58662
|
if (result2.data && process.env.MARIA_DEBUG === "1") {
|
|
58664
58663
|
console.log(JSON.stringify(result2.data, null, 2));
|
|
@@ -58672,11 +58671,11 @@ Chat:
|
|
|
58672
58671
|
}
|
|
58673
58672
|
}
|
|
58674
58673
|
if (!["battlecard", "sales-dashboard", "tune", "pilot-setup"].includes(cmd)) {
|
|
58675
|
-
console.log(
|
|
58676
|
-
console.log(
|
|
58677
|
-
console.log(
|
|
58678
|
-
console.log(
|
|
58679
|
-
console.log(
|
|
58674
|
+
console.log(chalk28__default.default.red(`\u274C Unknown command: /${cmd}`));
|
|
58675
|
+
console.log(chalk28__default.default.yellow("\n\u{1F4A1} Suggestions:"));
|
|
58676
|
+
console.log(chalk28__default.default.gray(" \u2022 Try /help to see available commands"));
|
|
58677
|
+
console.log(chalk28__default.default.gray(" \u2022 Check if you need to /login first"));
|
|
58678
|
+
console.log(chalk28__default.default.gray(` \u2022 Try similar commands: /help --search ${cmd}`));
|
|
58680
58679
|
}
|
|
58681
58680
|
return true;
|
|
58682
58681
|
}
|
|
@@ -58944,11 +58943,11 @@ async function handleCodeCommand(prompt) {
|
|
|
58944
58943
|
const filepath = path8__namespace.resolve(process.cwd(), filename);
|
|
58945
58944
|
await fsp__namespace.writeFile(filepath, code, "utf-8");
|
|
58946
58945
|
console.log(
|
|
58947
|
-
|
|
58948
|
-
`) +
|
|
58949
|
-
`) +
|
|
58950
|
-
`) +
|
|
58951
|
-
`) +
|
|
58946
|
+
chalk28__default.default.green("\n\u2705 **Code Saved**\n") + chalk28__default.default.white(`\u{1F4C1} **File (Click to open):**
|
|
58947
|
+
`) + chalk28__default.default.cyan(`\u2022 [${filename}](file://${filepath})
|
|
58948
|
+
`) + chalk28__default.default.gray(` \u{1F4CD} Path: \`${filepath}\`
|
|
58949
|
+
`) + chalk28__default.default.white(` \u{1F4DD} Language: ${language}
|
|
58950
|
+
`) + chalk28__default.default.dim(`
|
|
58952
58951
|
\u{1F4A1} Tip: Command+Click (Mac) or Ctrl+Click (Windows/Linux) to open file`)
|
|
58953
58952
|
);
|
|
58954
58953
|
} else {
|
|
@@ -58957,11 +58956,11 @@ async function handleCodeCommand(prompt) {
|
|
|
58957
58956
|
} catch (e2) {
|
|
58958
58957
|
spinner.stop();
|
|
58959
58958
|
if (process.env.MARIA_DEBUG === "1") {
|
|
58960
|
-
console.error(
|
|
58959
|
+
console.error(chalk28__default.default.red("Code generation error:"), e2.message || e2);
|
|
58961
58960
|
}
|
|
58962
58961
|
const fallbackCode = templateFallback(prompt);
|
|
58963
58962
|
console.log(
|
|
58964
|
-
|
|
58963
|
+
chalk28__default.default.yellow("\u26A0 AI unavailable, using template fallback:\n")
|
|
58965
58964
|
);
|
|
58966
58965
|
console.log(fallbackCode);
|
|
58967
58966
|
try {
|
|
@@ -58970,14 +58969,14 @@ async function handleCodeCommand(prompt) {
|
|
|
58970
58969
|
const filepath = path8__namespace.resolve(process.cwd(), filename);
|
|
58971
58970
|
await fsp__namespace.writeFile(filepath, code, "utf-8");
|
|
58972
58971
|
console.log(
|
|
58973
|
-
|
|
58974
|
-
`) +
|
|
58975
|
-
`) +
|
|
58976
|
-
`) +
|
|
58972
|
+
chalk28__default.default.green("\n\u2705 **Template Code Saved**\n") + chalk28__default.default.white(`\u{1F4C1} **File (Click to open):**
|
|
58973
|
+
`) + chalk28__default.default.cyan(`\u2022 [${filename}](file://${filepath})
|
|
58974
|
+
`) + chalk28__default.default.gray(` \u{1F4CD} Path: \`${filepath}\`
|
|
58975
|
+
`) + chalk28__default.default.dim(`
|
|
58977
58976
|
\u{1F4A1} Tip: Command+Click (Mac) or Ctrl+Click (Windows/Linux) to open file`)
|
|
58978
58977
|
);
|
|
58979
58978
|
} catch (saveError) {
|
|
58980
|
-
console.error(
|
|
58979
|
+
console.error(chalk28__default.default.red("Failed to save code:"), saveError);
|
|
58981
58980
|
}
|
|
58982
58981
|
}
|
|
58983
58982
|
}
|
|
@@ -59033,7 +59032,7 @@ ${userPrompt}`;
|
|
|
59033
59032
|
(seq) => response2.includes(seq)
|
|
59034
59033
|
);
|
|
59035
59034
|
if (guidedFlowDetected) {
|
|
59036
|
-
console.log(
|
|
59035
|
+
console.log(chalk28__default.default.yellow("\u26A0 Guided flow detected, switching to fallback"));
|
|
59037
59036
|
return null;
|
|
59038
59037
|
}
|
|
59039
59038
|
const codeMatch = response2.match(/```[\s\S]*?```/);
|
|
@@ -59201,14 +59200,14 @@ async function streamAnswer(text) {
|
|
|
59201
59200
|
if (store?.addMessage) await store.addMessage(msg);
|
|
59202
59201
|
} else {
|
|
59203
59202
|
animation.stop();
|
|
59204
|
-
console.log(
|
|
59203
|
+
console.log(chalk28__default.default.yellow("AI service unavailable. Please check your configuration."));
|
|
59205
59204
|
}
|
|
59206
59205
|
} catch (e2) {
|
|
59207
59206
|
animation.stop();
|
|
59208
59207
|
if (e2.message?.includes("timeout") || e2.message?.includes("\u23F1\uFE0F")) {
|
|
59209
|
-
console.log(
|
|
59208
|
+
console.log(chalk28__default.default.yellow(e2.message));
|
|
59210
59209
|
} else {
|
|
59211
|
-
console.log(
|
|
59210
|
+
console.log(chalk28__default.default.red("Error generating response:"), e2.message || e2);
|
|
59212
59211
|
}
|
|
59213
59212
|
}
|
|
59214
59213
|
}
|
|
@@ -59223,9 +59222,9 @@ async function handleLine(line) {
|
|
|
59223
59222
|
if (consumed) return;
|
|
59224
59223
|
const isAuthenticated = await authManager.isAuthenticated();
|
|
59225
59224
|
if (!isAuthenticated) {
|
|
59226
|
-
console.log(
|
|
59227
|
-
console.log(
|
|
59228
|
-
console.log(
|
|
59225
|
+
console.log(chalk28__default.default.yellow("\n\u26A0\uFE0F Authentication required for chat features"));
|
|
59226
|
+
console.log(chalk28__default.default.yellow("Please run: /login"));
|
|
59227
|
+
console.log(chalk28__default.default.yellow("Or use slash commands like /help, /version"));
|
|
59229
59228
|
return;
|
|
59230
59229
|
}
|
|
59231
59230
|
const user = { role: "user", content: input3, timestamp: /* @__PURE__ */ new Date() };
|
|
@@ -59247,7 +59246,7 @@ async function startInteractiveSession() {
|
|
|
59247
59246
|
}
|
|
59248
59247
|
}
|
|
59249
59248
|
const stop = async () => {
|
|
59250
|
-
console.log(
|
|
59249
|
+
console.log(chalk28__default.default.green("\n\u{1F44B} Goodbye!"));
|
|
59251
59250
|
if (store?.close) await store.close().catch(() => {
|
|
59252
59251
|
});
|
|
59253
59252
|
if (interactiveCLI?.cleanup) interactiveCLI.cleanup();
|
|
@@ -59261,7 +59260,7 @@ async function startInteractiveSession() {
|
|
|
59261
59260
|
process.once("SIGINT", stop);
|
|
59262
59261
|
process.once("SIGTERM", stop);
|
|
59263
59262
|
if (!isTTY) {
|
|
59264
|
-
console.log(
|
|
59263
|
+
console.log(chalk28__default.default.gray("[Pipe mode detected - streaming input/output]"));
|
|
59265
59264
|
const rl = readline5__namespace.createInterface({
|
|
59266
59265
|
input: process6.stdin,
|
|
59267
59266
|
output: process6.stdout,
|
|
@@ -59290,14 +59289,14 @@ async function startInteractiveSession() {
|
|
|
59290
59289
|
await stop();
|
|
59291
59290
|
return;
|
|
59292
59291
|
}
|
|
59293
|
-
console.error(
|
|
59292
|
+
console.error(chalk28__default.default.red("Error:"), error2?.message || error2);
|
|
59294
59293
|
}
|
|
59295
59294
|
}
|
|
59296
59295
|
} else {
|
|
59297
59296
|
const rl = readline5__namespace.createInterface({ input: process6.stdin, output: process6.stdout });
|
|
59298
59297
|
while (true) {
|
|
59299
59298
|
try {
|
|
59300
|
-
const prompt =
|
|
59299
|
+
const prompt = chalk28__default.default.cyan("> ");
|
|
59301
59300
|
const line = await rl.question(prompt);
|
|
59302
59301
|
console.log();
|
|
59303
59302
|
if (line.toLowerCase() === "exit" || line.toLowerCase() === "quit") {
|
|
@@ -59311,7 +59310,7 @@ async function startInteractiveSession() {
|
|
|
59311
59310
|
await stop();
|
|
59312
59311
|
return;
|
|
59313
59312
|
}
|
|
59314
|
-
console.error(
|
|
59313
|
+
console.error(chalk28__default.default.red("Error:"), error2?.message || error2);
|
|
59315
59314
|
}
|
|
59316
59315
|
}
|
|
59317
59316
|
}
|
|
@@ -59321,7 +59320,7 @@ function createCLI2() {
|
|
|
59321
59320
|
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) => {
|
|
59322
59321
|
loadEnvironmentVariables();
|
|
59323
59322
|
if (options2.server) {
|
|
59324
|
-
console.log(
|
|
59323
|
+
console.log(chalk28__default.default.green("\u{1F680} Starting MARIA server mode..."));
|
|
59325
59324
|
try {
|
|
59326
59325
|
const distDir = path8__namespace.dirname(process.argv[1] || process.cwd());
|
|
59327
59326
|
const candidateNames = [
|
|
@@ -59351,9 +59350,9 @@ function createCLI2() {
|
|
|
59351
59350
|
if (serverPath) break;
|
|
59352
59351
|
}
|
|
59353
59352
|
if (!serverPath) {
|
|
59354
|
-
console.error(
|
|
59355
|
-
console.error(
|
|
59356
|
-
console.error(
|
|
59353
|
+
console.error(chalk28__default.default.red("\u274C Could not locate server-express entry file"));
|
|
59354
|
+
console.error(chalk28__default.default.gray("Searched names: " + candidateNames.join(", ")));
|
|
59355
|
+
console.error(chalk28__default.default.gray("Searched dirs: " + candidateDirs.join(" | ")));
|
|
59357
59356
|
process.exit(1);
|
|
59358
59357
|
}
|
|
59359
59358
|
const { spawn: spawn3 } = await import('child_process');
|
|
@@ -59400,7 +59399,7 @@ function createCLI2() {
|
|
|
59400
59399
|
process.once("SIGINT", () => forwardAndExit("SIGINT"));
|
|
59401
59400
|
process.once("SIGTERM", () => forwardAndExit("SIGTERM"));
|
|
59402
59401
|
serverProcess.on("error", (error2) => {
|
|
59403
|
-
console.error(
|
|
59402
|
+
console.error(chalk28__default.default.red("\u274C Server process error:"), error2);
|
|
59404
59403
|
process.exit(1);
|
|
59405
59404
|
});
|
|
59406
59405
|
serverProcess.on("exit", (code, _signal) => {
|
|
@@ -59413,7 +59412,7 @@ function createCLI2() {
|
|
|
59413
59412
|
});
|
|
59414
59413
|
return;
|
|
59415
59414
|
} catch (error2) {
|
|
59416
|
-
console.error(
|
|
59415
|
+
console.error(chalk28__default.default.red("\u274C Failed to start server mode:"), error2);
|
|
59417
59416
|
process.exit(1);
|
|
59418
59417
|
}
|
|
59419
59418
|
}
|
|
@@ -59438,7 +59437,7 @@ function createCLI2() {
|
|
|
59438
59437
|
displayStartupLogo2();
|
|
59439
59438
|
startupDisplayed = true;
|
|
59440
59439
|
} catch {
|
|
59441
|
-
console.log(
|
|
59440
|
+
console.log(chalk28__default.default.cyan(`
|
|
59442
59441
|
\u{1F680} MARIA v${getVersion()}
|
|
59443
59442
|
`));
|
|
59444
59443
|
startupDisplayed = true;
|
|
@@ -59447,13 +59446,13 @@ function createCLI2() {
|
|
|
59447
59446
|
const useV3 = options2.v3Session || process.env.MARIA_USE_V3_SESSION === "1";
|
|
59448
59447
|
if (useV3) {
|
|
59449
59448
|
try {
|
|
59450
|
-
console.log(
|
|
59449
|
+
console.log(chalk28__default.default.cyan("\u{1F680} Starting MARIA v3 session..."));
|
|
59451
59450
|
const { MariaAI: MariaAI2 } = await Promise.resolve().then(() => (init_maria_ai(), maria_ai_exports));
|
|
59452
59451
|
const maria = new MariaAI2();
|
|
59453
59452
|
await maria.initialize();
|
|
59454
59453
|
return;
|
|
59455
59454
|
} catch (e2) {
|
|
59456
|
-
console.warn(
|
|
59455
|
+
console.warn(chalk28__default.default.yellow("\u26A0 V3 session unavailable, using standard mode"));
|
|
59457
59456
|
}
|
|
59458
59457
|
}
|
|
59459
59458
|
await startInteractiveSession();
|