@bonginkan/maria 4.2.22 → 4.2.24
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 +10 -3
- package/dist/bin/maria.cjs +775 -725
- package/dist/bin/maria.cjs.map +1 -1
- package/dist/cli.cjs +765 -715
- 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 +44 -6
- package/dist/server/express-server.cjs.map +1 -1
- package/package.json +2 -2
- package/src/slash-commands/READY.manifest.json +10 -3
package/dist/cli.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var fs2 = require('fs');
|
|
5
5
|
var path9 = require('path');
|
|
6
6
|
var dotenv = require('dotenv');
|
|
7
|
-
var
|
|
7
|
+
var 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 path9__namespace = /*#__PURE__*/_interopNamespace(path9);
|
|
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);
|
|
@@ -169,13 +169,13 @@ function getPackageJson() {
|
|
|
169
169
|
)
|
|
170
170
|
];
|
|
171
171
|
let packageJsonPath = null;
|
|
172
|
-
for (const
|
|
173
|
-
if (fs2.existsSync(
|
|
172
|
+
for (const path30 of possiblePaths) {
|
|
173
|
+
if (fs2.existsSync(path30)) {
|
|
174
174
|
try {
|
|
175
|
-
const content2 = fs2.readFileSync(
|
|
175
|
+
const content2 = fs2.readFileSync(path30, "utf-8");
|
|
176
176
|
const parsed = JSON.parse(content2);
|
|
177
177
|
if (parsed.name === "@bonginkan/maria") {
|
|
178
|
-
packageJsonPath =
|
|
178
|
+
packageJsonPath = path30;
|
|
179
179
|
break;
|
|
180
180
|
}
|
|
181
181
|
} catch {
|
|
@@ -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.24"}`
|
|
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
|
}
|
|
@@ -8617,22 +8617,22 @@ var init_from = __esm({
|
|
|
8617
8617
|
init_file();
|
|
8618
8618
|
init_fetch_blob();
|
|
8619
8619
|
({ stat } = fs2.promises);
|
|
8620
|
-
blobFromSync = (
|
|
8621
|
-
blobFrom = (
|
|
8622
|
-
fileFrom = (
|
|
8623
|
-
fileFromSync = (
|
|
8624
|
-
fromBlob = (stat8,
|
|
8625
|
-
path:
|
|
8620
|
+
blobFromSync = (path30, type) => fromBlob(fs2.statSync(path30), path30, type);
|
|
8621
|
+
blobFrom = (path30, type) => stat(path30).then((stat8) => fromBlob(stat8, path30, type));
|
|
8622
|
+
fileFrom = (path30, type) => stat(path30).then((stat8) => fromFile(stat8, path30, type));
|
|
8623
|
+
fileFromSync = (path30, type) => fromFile(fs2.statSync(path30), path30, type);
|
|
8624
|
+
fromBlob = (stat8, path30, type = "") => new fetch_blob_default([new BlobDataItem({
|
|
8625
|
+
path: path30,
|
|
8626
8626
|
size: stat8.size,
|
|
8627
8627
|
lastModified: stat8.mtimeMs,
|
|
8628
8628
|
start: 0
|
|
8629
8629
|
})], { type });
|
|
8630
|
-
fromFile = (stat8,
|
|
8631
|
-
path:
|
|
8630
|
+
fromFile = (stat8, path30, type = "") => new file_default([new BlobDataItem({
|
|
8631
|
+
path: path30,
|
|
8632
8632
|
size: stat8.size,
|
|
8633
8633
|
lastModified: stat8.mtimeMs,
|
|
8634
8634
|
start: 0
|
|
8635
|
-
})], path9.basename(
|
|
8635
|
+
})], path9.basename(path30), { type, lastModified: stat8.mtimeMs });
|
|
8636
8636
|
BlobDataItem = class _BlobDataItem {
|
|
8637
8637
|
#path;
|
|
8638
8638
|
#start;
|
|
@@ -12878,24 +12878,24 @@ var init_autocomplete_dropdown = __esm({
|
|
|
12878
12878
|
}
|
|
12879
12879
|
process.stdout.write(`\x1B[${linesToClear - 1}A`);
|
|
12880
12880
|
process.stdout.write(
|
|
12881
|
-
"\x1B[K" +
|
|
12881
|
+
"\x1B[K" + chalk28__default.default.white(
|
|
12882
12882
|
"\u250C\u2500 Suggestions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"
|
|
12883
12883
|
) + "\n"
|
|
12884
12884
|
);
|
|
12885
12885
|
this.suggestions.forEach((suggestion, index2) => {
|
|
12886
12886
|
const isSelected = index2 === this.selectedIndex;
|
|
12887
|
-
const prefix = isSelected ?
|
|
12888
|
-
const nameStyle = isSelected ?
|
|
12887
|
+
const prefix = isSelected ? chalk28__default.default.cyan("\u25BA ") : " ";
|
|
12888
|
+
const nameStyle = isSelected ? chalk28__default.default.inverse : (s2) => s2;
|
|
12889
12889
|
const safeName = (suggestion?.name ?? "").toString();
|
|
12890
12890
|
const safeDescRaw = suggestion?.description ?? "";
|
|
12891
12891
|
const safeDesc = typeof safeDescRaw === "string" ? safeDescRaw : String(safeDescRaw ?? "");
|
|
12892
12892
|
const displayName = safeName.padEnd(20);
|
|
12893
12893
|
const displayDesc = safeDesc.length > 30 ? safeDesc.substring(0, 27) + "..." : safeDesc.padEnd(30);
|
|
12894
|
-
const line = `\u2502${prefix}${nameStyle(
|
|
12894
|
+
const line = `\u2502${prefix}${nameStyle(chalk28__default.default.white(displayName) + " " + chalk28__default.default.gray(displayDesc))} \u2502`;
|
|
12895
12895
|
process.stdout.write("\x1B[K" + line + "\n");
|
|
12896
12896
|
});
|
|
12897
12897
|
process.stdout.write(
|
|
12898
|
-
"\x1B[K" +
|
|
12898
|
+
"\x1B[K" + chalk28__default.default.white(
|
|
12899
12899
|
"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"
|
|
12900
12900
|
)
|
|
12901
12901
|
);
|
|
@@ -13226,7 +13226,7 @@ var init_interactive_cli = __esm({
|
|
|
13226
13226
|
}
|
|
13227
13227
|
readline__namespace.cursorTo(process.stdout, 0);
|
|
13228
13228
|
readline__namespace.clearLine(process.stdout, 0);
|
|
13229
|
-
const prompt =
|
|
13229
|
+
const prompt = chalk28__default.default.cyan("> ");
|
|
13230
13230
|
const displayInput = this.currentInput;
|
|
13231
13231
|
process.stdout.write(prompt + displayInput);
|
|
13232
13232
|
const promptLength = 2;
|
|
@@ -13245,9 +13245,9 @@ var init_interactive_cli = __esm({
|
|
|
13245
13245
|
readline__namespace.moveCursor(process.stdout, 0, 2);
|
|
13246
13246
|
this.suggestions.forEach((suggestion, index2) => {
|
|
13247
13247
|
const isSelected = index2 === this.selectedIndex;
|
|
13248
|
-
const prefix = isSelected ?
|
|
13249
|
-
const nameStyle = isSelected ?
|
|
13250
|
-
const descStyle = isSelected ?
|
|
13248
|
+
const prefix = isSelected ? chalk28__default.default.cyan("\u25BA ") : " ";
|
|
13249
|
+
const nameStyle = isSelected ? chalk28__default.default.inverse.white : chalk28__default.default.white;
|
|
13250
|
+
const descStyle = isSelected ? chalk28__default.default.inverse.gray : chalk28__default.default.gray;
|
|
13251
13251
|
const name2 = suggestion.name.padEnd(15);
|
|
13252
13252
|
const desc = suggestion.description.length > 40 ? suggestion.description.substring(0, 37) + "..." : suggestion.description;
|
|
13253
13253
|
readline__namespace.cursorTo(process.stdout, 0);
|
|
@@ -13268,20 +13268,20 @@ var init_interactive_cli = __esm({
|
|
|
13268
13268
|
const promptLength = 2;
|
|
13269
13269
|
const savedX = this.cursorPosition + promptLength;
|
|
13270
13270
|
process.stdout.write("\n");
|
|
13271
|
-
process.stdout.write(
|
|
13271
|
+
process.stdout.write(chalk28__default.default.white("\u256D\u2500\u2500\u2500\u2500 Command Suggestions \u2500\u2500\u2500\u2500\u256E\n"));
|
|
13272
13272
|
this.suggestions.forEach((suggestion, index2) => {
|
|
13273
13273
|
const isSelected = index2 === this.selectedIndex;
|
|
13274
|
-
const prefix = isSelected ?
|
|
13275
|
-
const nameStyle = isSelected ?
|
|
13276
|
-
const descStyle = isSelected ?
|
|
13274
|
+
const prefix = isSelected ? chalk28__default.default.cyan("\u25BA ") : " ";
|
|
13275
|
+
const nameStyle = isSelected ? chalk28__default.default.inverse.white : chalk28__default.default.white;
|
|
13276
|
+
const descStyle = isSelected ? chalk28__default.default.inverse.gray : chalk28__default.default.gray;
|
|
13277
13277
|
const name2 = suggestion.name.padEnd(15);
|
|
13278
13278
|
const desc = suggestion.description.length > 40 ? suggestion.description.substring(0, 37) + "..." : suggestion.description;
|
|
13279
13279
|
process.stdout.write(`${prefix}${nameStyle(name2)} ${descStyle(desc)}
|
|
13280
13280
|
`);
|
|
13281
13281
|
});
|
|
13282
|
-
process.stdout.write(
|
|
13282
|
+
process.stdout.write(chalk28__default.default.white("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\n"));
|
|
13283
13283
|
process.stdout.write(
|
|
13284
|
-
|
|
13284
|
+
chalk28__default.default.dim("\u2191/\u2193: Navigate \u2022 Tab/Enter: Select \u2022 Esc: Cancel")
|
|
13285
13285
|
);
|
|
13286
13286
|
const totalLines = this.suggestions.length + 4;
|
|
13287
13287
|
readline__namespace.moveCursor(process.stdout, 0, -totalLines);
|
|
@@ -13381,27 +13381,27 @@ var init_logger = __esm({
|
|
|
13381
13381
|
}
|
|
13382
13382
|
debug(...args2) {
|
|
13383
13383
|
if (this.level <= 0 /* DEBUG */) {
|
|
13384
|
-
console.log(
|
|
13384
|
+
console.log(chalk28__default.default.magenta(`${this.prefix} [DEBUG]`), ...args2);
|
|
13385
13385
|
}
|
|
13386
13386
|
}
|
|
13387
13387
|
info(...args2) {
|
|
13388
13388
|
if (this.level <= 1 /* INFO */) {
|
|
13389
|
-
console.log(
|
|
13389
|
+
console.log(chalk28__default.default.bold.magenta(`${this.prefix} [INFO]`), ...args2);
|
|
13390
13390
|
}
|
|
13391
13391
|
}
|
|
13392
13392
|
warn(...args2) {
|
|
13393
13393
|
if (this.level <= 2 /* WARN */) {
|
|
13394
|
-
console.warn(
|
|
13394
|
+
console.warn(chalk28__default.default.bold.magenta(`${this.prefix} [WARN]`), ...args2);
|
|
13395
13395
|
}
|
|
13396
13396
|
}
|
|
13397
13397
|
error(...args2) {
|
|
13398
13398
|
if (this.level <= 3 /* ERROR */) {
|
|
13399
|
-
console.error(
|
|
13399
|
+
console.error(chalk28__default.default.bold.magenta(`${this.prefix} [ERROR]`), ...args2);
|
|
13400
13400
|
}
|
|
13401
13401
|
}
|
|
13402
13402
|
success(...args2) {
|
|
13403
13403
|
if (this.level <= 1 /* INFO */) {
|
|
13404
|
-
console.log(
|
|
13404
|
+
console.log(chalk28__default.default.bold.magenta(`${this.prefix} [SUCCESS]`), ...args2);
|
|
13405
13405
|
}
|
|
13406
13406
|
}
|
|
13407
13407
|
task(taskName, status, message) {
|
|
@@ -13415,10 +13415,10 @@ var init_logger = __esm({
|
|
|
13415
13415
|
error: "\u274C"
|
|
13416
13416
|
};
|
|
13417
13417
|
const statusColors = {
|
|
13418
|
-
start:
|
|
13419
|
-
progress:
|
|
13420
|
-
complete:
|
|
13421
|
-
error:
|
|
13418
|
+
start: chalk28__default.default.bold.magenta,
|
|
13419
|
+
progress: chalk28__default.default.magenta,
|
|
13420
|
+
complete: chalk28__default.default.bold.magenta,
|
|
13421
|
+
error: chalk28__default.default.bold.magenta
|
|
13422
13422
|
};
|
|
13423
13423
|
const icon = statusIcons[status];
|
|
13424
13424
|
const color = statusColors[status];
|
|
@@ -13435,14 +13435,14 @@ var init_logger = __esm({
|
|
|
13435
13435
|
if (this.level > 0 /* DEBUG */) {
|
|
13436
13436
|
return;
|
|
13437
13437
|
}
|
|
13438
|
-
console.log(
|
|
13438
|
+
console.log(chalk28__default.default.magenta(`${this.prefix} [JSON]`));
|
|
13439
13439
|
console.log(pretty ? JSON.stringify(obj, null, 2) : JSON.stringify(obj));
|
|
13440
13440
|
}
|
|
13441
13441
|
divider() {
|
|
13442
13442
|
if (this.level > 1 /* INFO */) {
|
|
13443
13443
|
return;
|
|
13444
13444
|
}
|
|
13445
|
-
console.log(
|
|
13445
|
+
console.log(chalk28__default.default.magenta("\u2500".repeat(60)));
|
|
13446
13446
|
}
|
|
13447
13447
|
clear() {
|
|
13448
13448
|
console.clear();
|
|
@@ -13462,7 +13462,7 @@ var init_logger = __esm({
|
|
|
13462
13462
|
const progressText = `${current}/${total}`;
|
|
13463
13463
|
const labelText = label ? ` ${label}` : "";
|
|
13464
13464
|
process.stdout.write(
|
|
13465
|
-
`\r${
|
|
13465
|
+
`\r${chalk28__default.default.bold.magenta(bar)} ${percentage}% ${progressText}${labelText}`
|
|
13466
13466
|
);
|
|
13467
13467
|
if (current === total) {
|
|
13468
13468
|
process.stdout.write("\n");
|
|
@@ -14001,6 +14001,7 @@ var init_ReadyCommandsService = __esm({
|
|
|
14001
14001
|
// Auth commands
|
|
14002
14002
|
"login": "Sign in to MARIA",
|
|
14003
14003
|
"logout": "Sign out",
|
|
14004
|
+
"whoami": "Show current authenticated user information",
|
|
14004
14005
|
"usage": "Check usage quota",
|
|
14005
14006
|
"plan": "View subscription",
|
|
14006
14007
|
// Code generation
|
|
@@ -15054,12 +15055,26 @@ var init_HelpCommand = __esm({
|
|
|
15054
15055
|
*/
|
|
15055
15056
|
async showGeneralHelp() {
|
|
15056
15057
|
const categories2 = await this.readyService.getCategories();
|
|
15058
|
+
const authCategory = categories2.find((c) => c.name === "auth");
|
|
15059
|
+
if (authCategory && !authCategory.commands.find((c) => c.name === "whoami")) {
|
|
15060
|
+
authCategory.commands.push({
|
|
15061
|
+
name: "whoami",
|
|
15062
|
+
category: "auth",
|
|
15063
|
+
aliases: [],
|
|
15064
|
+
description: "Show current authenticated user information",
|
|
15065
|
+
usage: "/whoami",
|
|
15066
|
+
examples: ["/whoami"],
|
|
15067
|
+
status: 2,
|
|
15068
|
+
contract: { tty: true, nonTty: true, pipe: true, maxResponseTime: 1e3 }
|
|
15069
|
+
});
|
|
15070
|
+
authCategory.count = authCategory.commands.length;
|
|
15071
|
+
}
|
|
15057
15072
|
const stats = await this.readyService.getStatistics();
|
|
15058
15073
|
const lines = [];
|
|
15059
15074
|
lines.push("\u2550".repeat(60));
|
|
15060
|
-
lines.push(
|
|
15075
|
+
lines.push(chalk28__default.default.bold(`${stats.totalReady} READY Commands | ${stats.categoriesCount} Categories`));
|
|
15061
15076
|
lines.push("");
|
|
15062
|
-
lines.push(
|
|
15077
|
+
lines.push(chalk28__default.default.bold("Quick Access:"));
|
|
15063
15078
|
lines.push(" /help <command> - Detailed help for specific command");
|
|
15064
15079
|
lines.push(" /help --quickstart - Essential commands for new users");
|
|
15065
15080
|
lines.push(" /help --stats - Performance statistics");
|
|
@@ -15074,7 +15089,7 @@ var init_HelpCommand = __esm({
|
|
|
15074
15089
|
}
|
|
15075
15090
|
globalMaxNameLength = Math.max(globalMaxNameLength, 18) + 1;
|
|
15076
15091
|
for (const category of categories2) {
|
|
15077
|
-
lines.push(
|
|
15092
|
+
lines.push(chalk28__default.default.bold(`${category.name.toUpperCase()} (${category.count})`));
|
|
15078
15093
|
const showCommands = category.commands.slice(0, 4);
|
|
15079
15094
|
for (const cmd of showCommands) {
|
|
15080
15095
|
const needsGpu = this.hasGpuRequirement(cmd.description);
|
|
@@ -15094,9 +15109,9 @@ var init_HelpCommand = __esm({
|
|
|
15094
15109
|
}
|
|
15095
15110
|
lines.push("");
|
|
15096
15111
|
}
|
|
15097
|
-
lines.push(
|
|
15112
|
+
lines.push(chalk28__default.default.bold("Pro Tips:"));
|
|
15098
15113
|
lines.push(" \u2022 All listed commands are production-ready");
|
|
15099
|
-
lines.push(" \u2022 Use fuzzy search: /help --search
|
|
15114
|
+
lines.push(" \u2022 Use fuzzy search: /help --search config \u2192 finds /config");
|
|
15100
15115
|
lines.push(" \u2022 Categories ordered by importance");
|
|
15101
15116
|
lines.push("");
|
|
15102
15117
|
return this.success(lines.join("\n"));
|
|
@@ -15133,33 +15148,33 @@ var init_HelpCommand = __esm({
|
|
|
15133
15148
|
formatCommandHelp(command) {
|
|
15134
15149
|
const lines = [];
|
|
15135
15150
|
lines.push("");
|
|
15136
|
-
lines.push(`\u{1F4D6} ${
|
|
15151
|
+
lines.push(`\u{1F4D6} ${chalk28__default.default.bold(`/${command.name}`)} - ${command.description}`);
|
|
15137
15152
|
lines.push("\u2550".repeat(50));
|
|
15138
15153
|
lines.push("");
|
|
15139
|
-
lines.push(
|
|
15154
|
+
lines.push(chalk28__default.default.bold("\u2139\uFE0F Information:"));
|
|
15140
15155
|
lines.push(` Category: ${this.readyService["getCategoryEmoji"](command.category)} ${command.category}`);
|
|
15141
15156
|
lines.push(` Status: \u2705 READY (contract validated)`);
|
|
15142
15157
|
if (command.aliases && command.aliases.length > 0) {
|
|
15143
15158
|
lines.push(` Aliases: ${command.aliases.map((a2) => `/${a2}`).join(", ")}`);
|
|
15144
15159
|
}
|
|
15145
15160
|
lines.push("");
|
|
15146
|
-
lines.push(
|
|
15161
|
+
lines.push(chalk28__default.default.bold("\u{1F3AF} Usage:"));
|
|
15147
15162
|
lines.push(` ${command.usage}`);
|
|
15148
15163
|
lines.push("");
|
|
15149
|
-
lines.push(
|
|
15164
|
+
lines.push(chalk28__default.default.bold("\u{1F4CB} Contract Validation:"));
|
|
15150
15165
|
lines.push(` \u26A1 Performance: ${command.contract.maxResponseTime}ms (tested)`);
|
|
15151
15166
|
lines.push(` \u{1F4BB} TTY Mode: ${command.contract.tty ? "\u2705 Supported" : "\u274C Not supported"}`);
|
|
15152
15167
|
lines.push(` \u{1F527} Non-TTY Mode: ${command.contract.nonTty ? "\u2705 Supported" : "\u274C Not supported"}`);
|
|
15153
15168
|
lines.push(` \u{1F500} Pipe Mode: ${command.contract.pipe ? "\u2705 Supported" : "\u274C Not supported"}`);
|
|
15154
15169
|
lines.push("");
|
|
15155
15170
|
if (command.examples && command.examples.length > 0) {
|
|
15156
|
-
lines.push(
|
|
15171
|
+
lines.push(chalk28__default.default.bold("\u{1F4DD} Examples:"));
|
|
15157
15172
|
for (const example of command.examples) {
|
|
15158
15173
|
lines.push(` ${example}`);
|
|
15159
15174
|
}
|
|
15160
15175
|
lines.push("");
|
|
15161
15176
|
}
|
|
15162
|
-
lines.push(
|
|
15177
|
+
lines.push(chalk28__default.default.bold("\u{1F4A1} Quick Tips:"));
|
|
15163
15178
|
lines.push(` \u2022 This command is production-ready and fully tested`);
|
|
15164
15179
|
lines.push(` \u2022 Try /${command.name} --help for additional options`);
|
|
15165
15180
|
if (command.category !== "core") {
|
|
@@ -15210,7 +15225,7 @@ var init_HelpCommand = __esm({
|
|
|
15210
15225
|
};
|
|
15211
15226
|
const emoji = emojiMap[categoryName.toLowerCase()] || "\u{1F4CB}";
|
|
15212
15227
|
lines.push("");
|
|
15213
|
-
lines.push(`${emoji} ${
|
|
15228
|
+
lines.push(`${emoji} ${chalk28__default.default.bold(categoryName.toUpperCase() + " COMMANDS")} (${commands.length} READY)`);
|
|
15214
15229
|
lines.push("\u2550".repeat(50));
|
|
15215
15230
|
lines.push("");
|
|
15216
15231
|
const maxNameLength = Math.max(...commands.map((c) => c.name.length)) + 1;
|
|
@@ -15244,7 +15259,7 @@ var init_HelpCommand = __esm({
|
|
|
15244
15259
|
formatSearchResults(searchTerm, results) {
|
|
15245
15260
|
const lines = [];
|
|
15246
15261
|
lines.push("");
|
|
15247
|
-
lines.push(`\u{1F50D} ${
|
|
15262
|
+
lines.push(`\u{1F50D} ${chalk28__default.default.bold("SEARCH RESULTS")} for "${searchTerm}" (${results.length} matches)`);
|
|
15248
15263
|
lines.push("\u2550".repeat(50));
|
|
15249
15264
|
lines.push("");
|
|
15250
15265
|
for (const result2 of results) {
|
|
@@ -15257,7 +15272,7 @@ var init_HelpCommand = __esm({
|
|
|
15257
15272
|
}
|
|
15258
15273
|
lines.push("");
|
|
15259
15274
|
}
|
|
15260
|
-
lines.push(
|
|
15275
|
+
lines.push(chalk28__default.default.bold("\u{1F4A1} Tip:") + " Higher scores indicate better matches");
|
|
15261
15276
|
lines.push("");
|
|
15262
15277
|
return lines.join("\n");
|
|
15263
15278
|
}
|
|
@@ -15268,38 +15283,38 @@ var init_HelpCommand = __esm({
|
|
|
15268
15283
|
const quickCommands = await this.readyService.getQuickStartCommands();
|
|
15269
15284
|
const lines = [];
|
|
15270
15285
|
lines.push("");
|
|
15271
|
-
lines.push(`\u{1F680} ${
|
|
15286
|
+
lines.push(`\u{1F680} ${chalk28__default.default.bold("MARIA QUICKSTART")} - Essential Commands`);
|
|
15272
15287
|
lines.push("\u2550".repeat(50));
|
|
15273
15288
|
lines.push("");
|
|
15274
|
-
lines.push(
|
|
15289
|
+
lines.push(chalk28__default.default.bold("\u{1F3AF} Get Started in 3 Steps:"));
|
|
15275
15290
|
lines.push("");
|
|
15276
|
-
lines.push(
|
|
15291
|
+
lines.push(chalk28__default.default.bold("1\uFE0F\u20E3 Configure Your AI Provider"));
|
|
15277
15292
|
const modelCmd = quickCommands.find((c) => c.name === "model");
|
|
15278
15293
|
if (modelCmd) {
|
|
15279
15294
|
lines.push(` /${modelCmd.name} - ${modelCmd.description}`);
|
|
15280
15295
|
lines.push(` Try: /model set provider=openai key=sk-...`);
|
|
15281
15296
|
}
|
|
15282
15297
|
lines.push("");
|
|
15283
|
-
lines.push(
|
|
15298
|
+
lines.push(chalk28__default.default.bold("2\uFE0F\u20E3 Check System Status"));
|
|
15284
15299
|
const statusCmd = quickCommands.find((c) => c.name === "status");
|
|
15285
15300
|
if (statusCmd) {
|
|
15286
15301
|
lines.push(` /${statusCmd.name} - ${statusCmd.description}`);
|
|
15287
15302
|
lines.push(` Try: /status`);
|
|
15288
15303
|
}
|
|
15289
15304
|
lines.push("");
|
|
15290
|
-
lines.push(
|
|
15305
|
+
lines.push(chalk28__default.default.bold("3\uFE0F\u20E3 Start Coding"));
|
|
15291
15306
|
const codeCmd = quickCommands.find((c) => c.name === "code");
|
|
15292
15307
|
if (codeCmd) {
|
|
15293
15308
|
lines.push(` /${codeCmd.name} - ${codeCmd.description}`);
|
|
15294
15309
|
lines.push(` Try: /code create a hello world function`);
|
|
15295
15310
|
}
|
|
15296
15311
|
lines.push("");
|
|
15297
|
-
lines.push(
|
|
15312
|
+
lines.push(chalk28__default.default.bold("\u{1F527} Essential Commands:"));
|
|
15298
15313
|
for (const cmd of quickCommands) {
|
|
15299
15314
|
lines.push(` /${cmd.name.padEnd(12)} - ${cmd.description}`);
|
|
15300
15315
|
}
|
|
15301
15316
|
lines.push("");
|
|
15302
|
-
lines.push(
|
|
15317
|
+
lines.push(chalk28__default.default.bold("\u{1F4A1} Next Steps:"));
|
|
15303
15318
|
lines.push(" \u2022 /help --category <name> - Explore command categories");
|
|
15304
15319
|
lines.push(" \u2022 /help --search <term> - Find specific functionality");
|
|
15305
15320
|
lines.push(" \u2022 /help <command> - Get detailed command help");
|
|
@@ -15314,20 +15329,20 @@ var init_HelpCommand = __esm({
|
|
|
15314
15329
|
const categories2 = await this.readyService.getCategories();
|
|
15315
15330
|
const lines = [];
|
|
15316
15331
|
lines.push("");
|
|
15317
|
-
lines.push(`\u{1F4CA} ${
|
|
15332
|
+
lines.push(`\u{1F4CA} ${chalk28__default.default.bold("READY COMMANDS STATISTICS")}`);
|
|
15318
15333
|
lines.push("\u2550".repeat(40));
|
|
15319
15334
|
lines.push("");
|
|
15320
|
-
lines.push(
|
|
15335
|
+
lines.push(chalk28__default.default.bold("\u{1F3AF} Overall:"));
|
|
15321
15336
|
lines.push(` Total READY Commands: ${stats.totalReady}`);
|
|
15322
15337
|
lines.push(` Categories: ${stats.categoriesCount}`);
|
|
15323
15338
|
lines.push(` Last Updated: ${stats.lastUpdated?.toLocaleString() || "Unknown"}`);
|
|
15324
15339
|
lines.push("");
|
|
15325
|
-
lines.push(
|
|
15340
|
+
lines.push(chalk28__default.default.bold("\u26A1 Performance:"));
|
|
15326
15341
|
lines.push(` Average Response Time: ${stats.avgResponseTime}ms`);
|
|
15327
15342
|
lines.push(` Fastest Command: /${stats.fastestCommand}`);
|
|
15328
15343
|
lines.push(` Slowest Command: /${stats.slowestCommand}`);
|
|
15329
15344
|
lines.push("");
|
|
15330
|
-
lines.push(
|
|
15345
|
+
lines.push(chalk28__default.default.bold("\u{1F4CB} By Category:"));
|
|
15331
15346
|
for (const category of categories2) {
|
|
15332
15347
|
const avgTime = Math.round(
|
|
15333
15348
|
category.commands.reduce((sum, cmd) => sum + cmd.contract.maxResponseTime, 0) / category.commands.length
|
|
@@ -15335,7 +15350,7 @@ var init_HelpCommand = __esm({
|
|
|
15335
15350
|
lines.push(` ${category.emoji} ${category.name.padEnd(15)}: ${category.count.toString().padStart(2)} commands (${avgTime}ms avg)`);
|
|
15336
15351
|
}
|
|
15337
15352
|
lines.push("");
|
|
15338
|
-
lines.push(
|
|
15353
|
+
lines.push(chalk28__default.default.bold("\u2705 Contract Validation:"));
|
|
15339
15354
|
lines.push(" All commands tested for:");
|
|
15340
15355
|
lines.push(" \u2022 Basic execution without crashes");
|
|
15341
15356
|
lines.push(" \u2022 TTY/non-TTY/pipe compatibility");
|
|
@@ -15376,6 +15391,7 @@ var init_VersionCommand = __esm({
|
|
|
15376
15391
|
init_base_command();
|
|
15377
15392
|
init_telemetry_helper();
|
|
15378
15393
|
init_subscription_manager();
|
|
15394
|
+
init_version();
|
|
15379
15395
|
VersionCommand = class extends BaseCommand {
|
|
15380
15396
|
name = "version";
|
|
15381
15397
|
category = "core";
|
|
@@ -15392,21 +15408,12 @@ var init_VersionCommand = __esm({
|
|
|
15392
15408
|
async execute(args2, context2) {
|
|
15393
15409
|
const startTime = Date.now();
|
|
15394
15410
|
try {
|
|
15395
|
-
const
|
|
15396
|
-
const packageContent = await fsp__namespace.readFile(packagePath, "utf-8");
|
|
15397
|
-
const packageData = JSON.parse(packageContent);
|
|
15398
|
-
const version = packageData.version || "0.0.0";
|
|
15399
|
-
let gitSha = "unknown";
|
|
15400
|
-
try {
|
|
15401
|
-
gitSha = child_process.execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim();
|
|
15402
|
-
} catch {
|
|
15403
|
-
gitSha = "release";
|
|
15404
|
-
}
|
|
15411
|
+
const version = getVersion();
|
|
15405
15412
|
let apiBuild = "";
|
|
15406
15413
|
if (context2.apiVersion) {
|
|
15407
15414
|
apiBuild = ` \xB7 API: ${context2.apiVersion}`;
|
|
15408
15415
|
}
|
|
15409
|
-
const output3 = `${
|
|
15416
|
+
const output3 = `${chalk28__default.default.bold("MARIA")} v${version}${apiBuild} \xB7 Node: ${process.version}`;
|
|
15410
15417
|
await trackCommand({
|
|
15411
15418
|
cmd: "version",
|
|
15412
15419
|
status: "success",
|
|
@@ -15423,7 +15430,7 @@ var init_VersionCommand = __esm({
|
|
|
15423
15430
|
plan: getUserPlan(),
|
|
15424
15431
|
quotaLeft: context2.quotaLeft || 999
|
|
15425
15432
|
});
|
|
15426
|
-
return this.success(`${
|
|
15433
|
+
return this.success(`${chalk28__default.default.bold("MARIA")} v${getVersion()}`);
|
|
15427
15434
|
}
|
|
15428
15435
|
}
|
|
15429
15436
|
};
|
|
@@ -19507,9 +19514,9 @@ var init_SafetyGuard = __esm({
|
|
|
19507
19514
|
}
|
|
19508
19515
|
}
|
|
19509
19516
|
if (action2.args.paths && Array.isArray(action2.args.paths)) {
|
|
19510
|
-
for (const
|
|
19511
|
-
if (!this.validatePath(
|
|
19512
|
-
violations.push(`Invalid path: ${
|
|
19517
|
+
for (const path30 of action2.args.paths) {
|
|
19518
|
+
if (!this.validatePath(path30)) {
|
|
19519
|
+
violations.push(`Invalid path: ${path30}`);
|
|
19513
19520
|
}
|
|
19514
19521
|
}
|
|
19515
19522
|
}
|
|
@@ -19565,15 +19572,15 @@ var init_SafetyGuard = __esm({
|
|
|
19565
19572
|
* Validate file path against allowed/blocked lists
|
|
19566
19573
|
*/
|
|
19567
19574
|
validatePath(filePath) {
|
|
19568
|
-
const
|
|
19569
|
-
const resolvedPath =
|
|
19575
|
+
const path30 = __require("path");
|
|
19576
|
+
const resolvedPath = path30.resolve(filePath);
|
|
19570
19577
|
for (const blockedPath of this.constraints.blockedPaths) {
|
|
19571
|
-
if (resolvedPath.startsWith(
|
|
19578
|
+
if (resolvedPath.startsWith(path30.resolve(blockedPath))) {
|
|
19572
19579
|
return false;
|
|
19573
19580
|
}
|
|
19574
19581
|
}
|
|
19575
19582
|
for (const allowedPath of this.constraints.allowedPaths) {
|
|
19576
|
-
if (resolvedPath.startsWith(
|
|
19583
|
+
if (resolvedPath.startsWith(path30.resolve(allowedPath))) {
|
|
19577
19584
|
return true;
|
|
19578
19585
|
}
|
|
19579
19586
|
}
|
|
@@ -19602,9 +19609,9 @@ var init_SafetyGuard = __esm({
|
|
|
19602
19609
|
violations.push(`Invalid path in ${action2.type}: ${action2.args.path}`);
|
|
19603
19610
|
}
|
|
19604
19611
|
if (action2.args.paths && Array.isArray(action2.args.paths)) {
|
|
19605
|
-
for (const
|
|
19606
|
-
if (!this.validatePath(
|
|
19607
|
-
violations.push(`Invalid path in ${action2.type}: ${
|
|
19612
|
+
for (const path30 of action2.args.paths) {
|
|
19613
|
+
if (!this.validatePath(path30)) {
|
|
19614
|
+
violations.push(`Invalid path in ${action2.type}: ${path30}`);
|
|
19608
19615
|
}
|
|
19609
19616
|
}
|
|
19610
19617
|
}
|
|
@@ -19664,8 +19671,8 @@ var require_package = __commonJS({
|
|
|
19664
19671
|
"package.json"(exports, module) {
|
|
19665
19672
|
module.exports = {
|
|
19666
19673
|
name: "@bonginkan/maria",
|
|
19667
|
-
version: "4.2.
|
|
19668
|
-
description: "\u{1F680} MARIA v4.2.
|
|
19674
|
+
version: "4.2.24",
|
|
19675
|
+
description: "\u{1F680} MARIA v4.2.24 - Enterprise AI Development Platform with 100% Command Availability. Features 74 production-ready commands with comprehensive fallback implementation, local LLM support, and zero external dependencies. Includes natural language coding, AI safety evaluation, intelligent evolution system, episodic memory with PII masking, and real-time monitoring dashboard. Built with TypeScript AST-powered code generation, OAuth2.0 + PKCE authentication, quantum-resistant cryptography, and enterprise-grade performance.",
|
|
19669
19676
|
keywords: [
|
|
19670
19677
|
"ai",
|
|
19671
19678
|
"cli",
|
|
@@ -21074,8 +21081,8 @@ var init_ConfigActionExecutor = __esm({
|
|
|
21074
21081
|
/**
|
|
21075
21082
|
* Set nested configuration value using dot notation
|
|
21076
21083
|
*/
|
|
21077
|
-
setNestedValue(obj,
|
|
21078
|
-
const keys =
|
|
21084
|
+
setNestedValue(obj, path30, value) {
|
|
21085
|
+
const keys = path30.split(".");
|
|
21079
21086
|
let current = obj;
|
|
21080
21087
|
for (let i2 = 0; i2 < keys.length - 1; i2++) {
|
|
21081
21088
|
const key2 = keys[i2];
|
|
@@ -22955,7 +22962,7 @@ var init_escape = __esm({
|
|
|
22955
22962
|
});
|
|
22956
22963
|
|
|
22957
22964
|
// node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/index.js
|
|
22958
|
-
var import_brace_expansion, minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform,
|
|
22965
|
+
var import_brace_expansion, minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform, path20, sep, GLOBSTAR, qmark2, star2, twoStarDot, twoStarNoDot, filter, ext, defaults, braceExpand, makeRe, match, globMagic, regExpEscape2, Minimatch;
|
|
22959
22966
|
var init_esm = __esm({
|
|
22960
22967
|
"node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/index.js"() {
|
|
22961
22968
|
import_brace_expansion = __toESM(require_brace_expansion());
|
|
@@ -23024,11 +23031,11 @@ var init_esm = __esm({
|
|
|
23024
23031
|
return (f3) => f3.length === len && f3 !== "." && f3 !== "..";
|
|
23025
23032
|
};
|
|
23026
23033
|
defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
23027
|
-
|
|
23034
|
+
path20 = {
|
|
23028
23035
|
win32: { sep: "\\" },
|
|
23029
23036
|
posix: { sep: "/" }
|
|
23030
23037
|
};
|
|
23031
|
-
sep = defaultPlatform === "win32" ?
|
|
23038
|
+
sep = defaultPlatform === "win32" ? path20.win32.sep : path20.posix.sep;
|
|
23032
23039
|
minimatch.sep = sep;
|
|
23033
23040
|
GLOBSTAR = Symbol("globstar **");
|
|
23034
23041
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -26202,12 +26209,12 @@ var init_esm4 = __esm({
|
|
|
26202
26209
|
/**
|
|
26203
26210
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
26204
26211
|
*/
|
|
26205
|
-
resolve(
|
|
26206
|
-
if (!
|
|
26212
|
+
resolve(path30) {
|
|
26213
|
+
if (!path30) {
|
|
26207
26214
|
return this;
|
|
26208
26215
|
}
|
|
26209
|
-
const rootPath = this.getRootString(
|
|
26210
|
-
const dir =
|
|
26216
|
+
const rootPath = this.getRootString(path30);
|
|
26217
|
+
const dir = path30.substring(rootPath.length);
|
|
26211
26218
|
const dirParts = dir.split(this.splitSep);
|
|
26212
26219
|
const result2 = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
26213
26220
|
return result2;
|
|
@@ -26959,8 +26966,8 @@ var init_esm4 = __esm({
|
|
|
26959
26966
|
/**
|
|
26960
26967
|
* @internal
|
|
26961
26968
|
*/
|
|
26962
|
-
getRootString(
|
|
26963
|
-
return path9.win32.parse(
|
|
26969
|
+
getRootString(path30) {
|
|
26970
|
+
return path9.win32.parse(path30).root;
|
|
26964
26971
|
}
|
|
26965
26972
|
/**
|
|
26966
26973
|
* @internal
|
|
@@ -27006,8 +27013,8 @@ var init_esm4 = __esm({
|
|
|
27006
27013
|
/**
|
|
27007
27014
|
* @internal
|
|
27008
27015
|
*/
|
|
27009
|
-
getRootString(
|
|
27010
|
-
return
|
|
27016
|
+
getRootString(path30) {
|
|
27017
|
+
return path30.startsWith("/") ? "/" : "";
|
|
27011
27018
|
}
|
|
27012
27019
|
/**
|
|
27013
27020
|
* @internal
|
|
@@ -27056,8 +27063,8 @@ var init_esm4 = __esm({
|
|
|
27056
27063
|
*
|
|
27057
27064
|
* @internal
|
|
27058
27065
|
*/
|
|
27059
|
-
constructor(cwd2 = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
27060
|
-
this.#fs = fsFromOption(
|
|
27066
|
+
constructor(cwd2 = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs25 = defaultFS } = {}) {
|
|
27067
|
+
this.#fs = fsFromOption(fs25);
|
|
27061
27068
|
if (cwd2 instanceof URL || cwd2.startsWith("file://")) {
|
|
27062
27069
|
cwd2 = url2.fileURLToPath(cwd2);
|
|
27063
27070
|
}
|
|
@@ -27096,11 +27103,11 @@ var init_esm4 = __esm({
|
|
|
27096
27103
|
/**
|
|
27097
27104
|
* Get the depth of a provided path, string, or the cwd
|
|
27098
27105
|
*/
|
|
27099
|
-
depth(
|
|
27100
|
-
if (typeof
|
|
27101
|
-
|
|
27106
|
+
depth(path30 = this.cwd) {
|
|
27107
|
+
if (typeof path30 === "string") {
|
|
27108
|
+
path30 = this.cwd.resolve(path30);
|
|
27102
27109
|
}
|
|
27103
|
-
return
|
|
27110
|
+
return path30.depth();
|
|
27104
27111
|
}
|
|
27105
27112
|
/**
|
|
27106
27113
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -27587,9 +27594,9 @@ var init_esm4 = __esm({
|
|
|
27587
27594
|
process10();
|
|
27588
27595
|
return results;
|
|
27589
27596
|
}
|
|
27590
|
-
chdir(
|
|
27597
|
+
chdir(path30 = this.cwd) {
|
|
27591
27598
|
const oldCwd = this.cwd;
|
|
27592
|
-
this.cwd = typeof
|
|
27599
|
+
this.cwd = typeof path30 === "string" ? this.cwd.resolve(path30) : path30;
|
|
27593
27600
|
this.cwd[setAsCwd](oldCwd);
|
|
27594
27601
|
}
|
|
27595
27602
|
};
|
|
@@ -27615,8 +27622,8 @@ var init_esm4 = __esm({
|
|
|
27615
27622
|
/**
|
|
27616
27623
|
* @internal
|
|
27617
27624
|
*/
|
|
27618
|
-
newRoot(
|
|
27619
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
27625
|
+
newRoot(fs25) {
|
|
27626
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs25 });
|
|
27620
27627
|
}
|
|
27621
27628
|
/**
|
|
27622
27629
|
* Return true if the provided path string is an absolute path
|
|
@@ -27644,8 +27651,8 @@ var init_esm4 = __esm({
|
|
|
27644
27651
|
/**
|
|
27645
27652
|
* @internal
|
|
27646
27653
|
*/
|
|
27647
|
-
newRoot(
|
|
27648
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
27654
|
+
newRoot(fs25) {
|
|
27655
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs25 });
|
|
27649
27656
|
}
|
|
27650
27657
|
/**
|
|
27651
27658
|
* Return true if the provided path string is an absolute path
|
|
@@ -27964,8 +27971,8 @@ var init_processor = __esm({
|
|
|
27964
27971
|
}
|
|
27965
27972
|
// match, absolute, ifdir
|
|
27966
27973
|
entries() {
|
|
27967
|
-
return [...this.store.entries()].map(([
|
|
27968
|
-
|
|
27974
|
+
return [...this.store.entries()].map(([path30, n]) => [
|
|
27975
|
+
path30,
|
|
27969
27976
|
!!(n & 2),
|
|
27970
27977
|
!!(n & 1)
|
|
27971
27978
|
]);
|
|
@@ -28178,9 +28185,9 @@ var init_walker = __esm({
|
|
|
28178
28185
|
signal;
|
|
28179
28186
|
maxDepth;
|
|
28180
28187
|
includeChildMatches;
|
|
28181
|
-
constructor(patterns2,
|
|
28188
|
+
constructor(patterns2, path30, opts) {
|
|
28182
28189
|
this.patterns = patterns2;
|
|
28183
|
-
this.path =
|
|
28190
|
+
this.path = path30;
|
|
28184
28191
|
this.opts = opts;
|
|
28185
28192
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
28186
28193
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -28199,11 +28206,11 @@ var init_walker = __esm({
|
|
|
28199
28206
|
});
|
|
28200
28207
|
}
|
|
28201
28208
|
}
|
|
28202
|
-
#ignored(
|
|
28203
|
-
return this.seen.has(
|
|
28209
|
+
#ignored(path30) {
|
|
28210
|
+
return this.seen.has(path30) || !!this.#ignore?.ignored?.(path30);
|
|
28204
28211
|
}
|
|
28205
|
-
#childrenIgnored(
|
|
28206
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
28212
|
+
#childrenIgnored(path30) {
|
|
28213
|
+
return !!this.#ignore?.childrenIgnored?.(path30);
|
|
28207
28214
|
}
|
|
28208
28215
|
// backpressure mechanism
|
|
28209
28216
|
pause() {
|
|
@@ -28418,8 +28425,8 @@ var init_walker = __esm({
|
|
|
28418
28425
|
};
|
|
28419
28426
|
GlobWalker = class extends GlobUtil {
|
|
28420
28427
|
matches = /* @__PURE__ */ new Set();
|
|
28421
|
-
constructor(patterns2,
|
|
28422
|
-
super(patterns2,
|
|
28428
|
+
constructor(patterns2, path30, opts) {
|
|
28429
|
+
super(patterns2, path30, opts);
|
|
28423
28430
|
}
|
|
28424
28431
|
matchEmit(e2) {
|
|
28425
28432
|
this.matches.add(e2);
|
|
@@ -28456,8 +28463,8 @@ var init_walker = __esm({
|
|
|
28456
28463
|
};
|
|
28457
28464
|
GlobStream = class extends GlobUtil {
|
|
28458
28465
|
results;
|
|
28459
|
-
constructor(patterns2,
|
|
28460
|
-
super(patterns2,
|
|
28466
|
+
constructor(patterns2, path30, opts) {
|
|
28467
|
+
super(patterns2, path30, opts);
|
|
28461
28468
|
this.results = new Minipass({
|
|
28462
28469
|
signal: this.signal,
|
|
28463
28470
|
objectMode: true
|
|
@@ -31045,7 +31052,7 @@ var init_clear_command = __esm({
|
|
|
31045
31052
|
plan: getUserPlan(),
|
|
31046
31053
|
quotaLeft: context2.quotaLeft || 999
|
|
31047
31054
|
});
|
|
31048
|
-
const message =
|
|
31055
|
+
const message = chalk28__default.default.green("\u2705 Cleared") + chalk28__default.default.gray(" \xB7 context reset");
|
|
31049
31056
|
return this.success(withQuotaFooter(message, context2.quotaLeft));
|
|
31050
31057
|
} catch (error2) {
|
|
31051
31058
|
await trackCommand({
|
|
@@ -31056,7 +31063,7 @@ var init_clear_command = __esm({
|
|
|
31056
31063
|
quotaLeft: context2.quotaLeft || 999
|
|
31057
31064
|
});
|
|
31058
31065
|
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
31059
|
-
return this.success(
|
|
31066
|
+
return this.success(chalk28__default.default.green("\u2705 Cleared"));
|
|
31060
31067
|
}
|
|
31061
31068
|
}
|
|
31062
31069
|
};
|
|
@@ -32087,10 +32094,21 @@ var init_WhoAmICommand = __esm({
|
|
|
32087
32094
|
authenticated: false
|
|
32088
32095
|
});
|
|
32089
32096
|
}
|
|
32090
|
-
|
|
32091
|
-
|
|
32092
|
-
|
|
32093
|
-
|
|
32097
|
+
const lines = [];
|
|
32098
|
+
lines.push(chalk28__default.default.green("\u2705 Authenticated"));
|
|
32099
|
+
if (user.name) {
|
|
32100
|
+
lines.push(chalk28__default.default.white(`\u{1F464} Name: ${chalk28__default.default.cyan(user.name)}`));
|
|
32101
|
+
}
|
|
32102
|
+
if (user.email) {
|
|
32103
|
+
lines.push(chalk28__default.default.white(`\u{1F4E7} Email: ${chalk28__default.default.cyan(user.email)}`));
|
|
32104
|
+
}
|
|
32105
|
+
if (user.provider) {
|
|
32106
|
+
lines.push(chalk28__default.default.white(`\u{1F511} Provider: ${chalk28__default.default.cyan(user.provider)}`));
|
|
32107
|
+
}
|
|
32108
|
+
if (user.plan) {
|
|
32109
|
+
lines.push(chalk28__default.default.white(`\u{1F48E} Plan: ${chalk28__default.default.cyan(user.plan)}`));
|
|
32110
|
+
}
|
|
32111
|
+
return this.success(lines.join("\n"), { authenticated: true, user });
|
|
32094
32112
|
}
|
|
32095
32113
|
};
|
|
32096
32114
|
WhoAmICommand_default = WhoAmICommand;
|
|
@@ -32115,40 +32133,40 @@ var init_about_command = __esm({
|
|
|
32115
32133
|
async execute(args2, context2) {
|
|
32116
32134
|
const output3 = [];
|
|
32117
32135
|
output3.push("");
|
|
32118
|
-
output3.push(
|
|
32119
|
-
output3.push(
|
|
32136
|
+
output3.push(chalk28__default.default.cyan.bold("\u{1F916} About MARIA v4.2.24"));
|
|
32137
|
+
output3.push(chalk28__default.default.gray("\u2550".repeat(40)));
|
|
32120
32138
|
output3.push("");
|
|
32121
|
-
output3.push(
|
|
32139
|
+
output3.push(chalk28__default.default.white.bold("MARIA - Minimal API, Maximum Power"));
|
|
32122
32140
|
output3.push("");
|
|
32123
|
-
output3.push(
|
|
32141
|
+
output3.push(chalk28__default.default.white("\u{1F3AF} Revolutionary AI Development Platform:"));
|
|
32124
32142
|
output3.push(" \u2022 Natural Language Code Operations");
|
|
32125
32143
|
output3.push(" \u2022 Graph RAG Knowledge System");
|
|
32126
32144
|
output3.push(" \u2022 Dual Memory Architecture");
|
|
32127
32145
|
output3.push(" \u2022 Enterprise-Grade Security");
|
|
32128
32146
|
output3.push(" \u2022 Multimodal AI Generation");
|
|
32129
32147
|
output3.push("");
|
|
32130
|
-
output3.push(
|
|
32148
|
+
output3.push(chalk28__default.default.white("\u{1F31F} Key Features:"));
|
|
32131
32149
|
output3.push(" \u2022 /code - Natural language coding");
|
|
32132
32150
|
output3.push(" \u2022 68+ Slash Commands");
|
|
32133
32151
|
output3.push(" \u2022 8 AI Provider Support");
|
|
32134
32152
|
output3.push(" \u2022 Business Operations Suite");
|
|
32135
32153
|
output3.push(" \u2022 Real-time Streaming");
|
|
32136
32154
|
output3.push("");
|
|
32137
|
-
output3.push(
|
|
32155
|
+
output3.push(chalk28__default.default.white("\u{1F468}\u200D\u{1F4BB} Created by:"));
|
|
32138
32156
|
output3.push(" \u2022 Bonginkan Team");
|
|
32139
32157
|
output3.push(" \u2022 Enterprise AI Solutions");
|
|
32140
32158
|
output3.push("");
|
|
32141
|
-
output3.push(
|
|
32142
|
-
output3.push(
|
|
32143
|
-
output3.push(
|
|
32144
|
-
output3.push(
|
|
32145
|
-
output3.push(
|
|
32146
|
-
output3.push(
|
|
32159
|
+
output3.push(chalk28__default.default.white("\u{1F517} Links:"));
|
|
32160
|
+
output3.push(chalk28__default.default.blue(" Website: https://maria-code.ai"));
|
|
32161
|
+
output3.push(chalk28__default.default.blue(" Company: https://bonginkan.ai"));
|
|
32162
|
+
output3.push(chalk28__default.default.blue(" Discord: https://discord.gg/SMSmSGcEQy"));
|
|
32163
|
+
output3.push(chalk28__default.default.blue(" GitHub: https://github.com/bonginkan/maria"));
|
|
32164
|
+
output3.push(chalk28__default.default.blue(" NPM: https://www.npmjs.com/package/@bonginkan/maria"));
|
|
32147
32165
|
output3.push("");
|
|
32148
|
-
output3.push(
|
|
32149
|
-
output3.push(
|
|
32166
|
+
output3.push(chalk28__default.default.white("\u{1F4C4} License: MIT"));
|
|
32167
|
+
output3.push(chalk28__default.default.white("\u{1F3D7}\uFE0F Built with: TypeScript, Node.js, React"));
|
|
32150
32168
|
output3.push("");
|
|
32151
|
-
output3.push(
|
|
32169
|
+
output3.push(chalk28__default.default.green("Thank you for using MARIA! \u{1F680}"));
|
|
32152
32170
|
output3.push("");
|
|
32153
32171
|
return {
|
|
32154
32172
|
success: true,
|
|
@@ -34167,8 +34185,8 @@ var init_ConfigCLI = __esm({
|
|
|
34167
34185
|
// Default to interactive
|
|
34168
34186
|
});
|
|
34169
34187
|
if (options2.verbose) {
|
|
34170
|
-
console.log(
|
|
34171
|
-
console.log(
|
|
34188
|
+
console.log(chalk28__default.default.gray(`Executing: ${operation} ${args2.join(" ")}`));
|
|
34189
|
+
console.log(chalk28__default.default.gray(`Options: ${JSON.stringify(options2, null, 2)}`));
|
|
34172
34190
|
}
|
|
34173
34191
|
const result2 = await command.execute();
|
|
34174
34192
|
if (result2.endReason === "success") {
|
|
@@ -34194,10 +34212,10 @@ var init_ConfigCLI = __esm({
|
|
|
34194
34212
|
await this.displayPreview(data2.preview);
|
|
34195
34213
|
if (data2.dryRun) {
|
|
34196
34214
|
console.log(
|
|
34197
|
-
|
|
34215
|
+
chalk28__default.default.blue("\n\u{1F4CB} This was a dry run - no changes were applied.")
|
|
34198
34216
|
);
|
|
34199
34217
|
console.log(
|
|
34200
|
-
|
|
34218
|
+
chalk28__default.default.gray(
|
|
34201
34219
|
"To apply changes, run the same command without --dry-run"
|
|
34202
34220
|
)
|
|
34203
34221
|
);
|
|
@@ -34205,30 +34223,30 @@ var init_ConfigCLI = __esm({
|
|
|
34205
34223
|
}
|
|
34206
34224
|
}
|
|
34207
34225
|
if (data2.message) {
|
|
34208
|
-
console.log(
|
|
34226
|
+
console.log(chalk28__default.default.green(data2.message));
|
|
34209
34227
|
}
|
|
34210
34228
|
if (data2.key && data2.value !== void 0) {
|
|
34211
|
-
console.log(
|
|
34229
|
+
console.log(chalk28__default.default.green(`\u2705 Configuration updated:`));
|
|
34212
34230
|
console.log(
|
|
34213
|
-
` ${
|
|
34231
|
+
` ${chalk28__default.default.bold(data2.key)}: ${chalk28__default.default.cyan(this.formatValue(data2.value))}`
|
|
34214
34232
|
);
|
|
34215
34233
|
if (data2.layer) {
|
|
34216
|
-
console.log(` Layer: ${
|
|
34234
|
+
console.log(` Layer: ${chalk28__default.default.magenta(data2.layer)}`);
|
|
34217
34235
|
}
|
|
34218
34236
|
}
|
|
34219
34237
|
if (data2.deleted) {
|
|
34220
34238
|
console.log(
|
|
34221
|
-
|
|
34239
|
+
chalk28__default.default.green(`\u2705 Configuration deleted: ${chalk28__default.default.bold(data2.key)}`)
|
|
34222
34240
|
);
|
|
34223
34241
|
}
|
|
34224
34242
|
if (data2.templateId) {
|
|
34225
34243
|
console.log(
|
|
34226
|
-
|
|
34244
|
+
chalk28__default.default.green(`\u2705 Template applied: ${chalk28__default.default.bold(data2.templateId)}`)
|
|
34227
34245
|
);
|
|
34228
34246
|
}
|
|
34229
34247
|
if (data2.rolledBack) {
|
|
34230
34248
|
console.log(
|
|
34231
|
-
|
|
34249
|
+
chalk28__default.default.green(`\u2705 Rolled back to entry: ${chalk28__default.default.bold(data2.entryId)}`)
|
|
34232
34250
|
);
|
|
34233
34251
|
}
|
|
34234
34252
|
if (data2.layers) {
|
|
@@ -34243,62 +34261,62 @@ var init_ConfigCLI = __esm({
|
|
|
34243
34261
|
console.log(JSON.stringify({ error: error2 }, null, 2));
|
|
34244
34262
|
return;
|
|
34245
34263
|
}
|
|
34246
|
-
console.error(
|
|
34264
|
+
console.error(chalk28__default.default.red(`\u274C Error: ${error2}`));
|
|
34247
34265
|
if (error2.includes("not found")) {
|
|
34248
34266
|
console.log(
|
|
34249
|
-
|
|
34267
|
+
chalk28__default.default.gray("\nTry: /config list # to see available configurations")
|
|
34250
34268
|
);
|
|
34251
34269
|
}
|
|
34252
34270
|
if (error2.includes("required")) {
|
|
34253
|
-
console.log(
|
|
34271
|
+
console.log(chalk28__default.default.gray("\nTry: /config help # to see command syntax"));
|
|
34254
34272
|
}
|
|
34255
34273
|
}
|
|
34256
34274
|
async displayPreview(preview) {
|
|
34257
|
-
console.log(
|
|
34258
|
-
console.log(`${
|
|
34275
|
+
console.log(chalk28__default.default.bold.cyan("\n\u{1F50D} Configuration Preview\n"));
|
|
34276
|
+
console.log(`${chalk28__default.default.bold("Operation:")} ${chalk28__default.default.cyan(preview.operation)}`);
|
|
34259
34277
|
if (preview.key) {
|
|
34260
|
-
console.log(`${
|
|
34278
|
+
console.log(`${chalk28__default.default.bold("Key:")} ${chalk28__default.default.yellow(preview.key)}`);
|
|
34261
34279
|
}
|
|
34262
34280
|
if (preview.value !== void 0) {
|
|
34263
34281
|
console.log(
|
|
34264
|
-
`${
|
|
34282
|
+
`${chalk28__default.default.bold("Value:")} ${chalk28__default.default.green(this.formatValue(preview.value))}`
|
|
34265
34283
|
);
|
|
34266
34284
|
}
|
|
34267
34285
|
if (preview.changes.length > 0) {
|
|
34268
|
-
console.log(
|
|
34286
|
+
console.log(chalk28__default.default.bold("\n\u{1F4DD} Changes:"));
|
|
34269
34287
|
for (const change of preview.changes) {
|
|
34270
34288
|
this.displayChange(change);
|
|
34271
34289
|
}
|
|
34272
34290
|
}
|
|
34273
34291
|
if (preview.affected.length > 0) {
|
|
34274
|
-
console.log(
|
|
34292
|
+
console.log(chalk28__default.default.bold("\n\u{1F517} Affected Configurations:"));
|
|
34275
34293
|
for (const affected of preview.affected) {
|
|
34276
34294
|
this.displayAffectedConfig(affected);
|
|
34277
34295
|
}
|
|
34278
34296
|
}
|
|
34279
34297
|
if (preview.risks.length > 0) {
|
|
34280
|
-
console.log(
|
|
34298
|
+
console.log(chalk28__default.default.bold("\n\u26A0\uFE0F Safety Analysis:"));
|
|
34281
34299
|
for (const risk of preview.risks) {
|
|
34282
34300
|
this.displaySafetyRisk(risk);
|
|
34283
34301
|
}
|
|
34284
34302
|
}
|
|
34285
34303
|
if (!preview.validation.ok) {
|
|
34286
|
-
console.log(
|
|
34304
|
+
console.log(chalk28__default.default.bold.red("\n\u274C Validation Errors:"));
|
|
34287
34305
|
if (preview.validation.errors) {
|
|
34288
34306
|
for (const error2 of preview.validation.errors) {
|
|
34289
|
-
console.log(` \u2022 ${
|
|
34307
|
+
console.log(` \u2022 ${chalk28__default.default.red(error2)}`);
|
|
34290
34308
|
}
|
|
34291
34309
|
}
|
|
34292
34310
|
} else if (preview.validation.warnings && preview.validation.warnings.length > 0) {
|
|
34293
|
-
console.log(
|
|
34311
|
+
console.log(chalk28__default.default.bold.yellow("\n\u26A0\uFE0F Validation Warnings:"));
|
|
34294
34312
|
for (const warning of preview.validation.warnings) {
|
|
34295
|
-
console.log(` \u2022 ${
|
|
34313
|
+
console.log(` \u2022 ${chalk28__default.default.yellow(warning)}`);
|
|
34296
34314
|
}
|
|
34297
34315
|
}
|
|
34298
34316
|
if (preview.requiresConfirmation && !preview.validation.dryRun) {
|
|
34299
34317
|
const confirmed = await this.promptConfirmation();
|
|
34300
34318
|
if (!confirmed) {
|
|
34301
|
-
console.log(
|
|
34319
|
+
console.log(chalk28__default.default.yellow("\n\u274C Operation cancelled"));
|
|
34302
34320
|
process.exit(0);
|
|
34303
34321
|
}
|
|
34304
34322
|
}
|
|
@@ -34310,42 +34328,42 @@ var init_ConfigCLI = __esm({
|
|
|
34310
34328
|
delete: "\u{1F5D1}\uFE0F"
|
|
34311
34329
|
};
|
|
34312
34330
|
const typeColor = {
|
|
34313
|
-
add:
|
|
34314
|
-
modify:
|
|
34315
|
-
delete:
|
|
34331
|
+
add: chalk28__default.default.green,
|
|
34332
|
+
modify: chalk28__default.default.yellow,
|
|
34333
|
+
delete: chalk28__default.default.red
|
|
34316
34334
|
};
|
|
34317
34335
|
console.log(
|
|
34318
|
-
` ${typeIcon[change.type]} ${typeColor[change.type](change.type.toUpperCase())}: ${
|
|
34336
|
+
` ${typeIcon[change.type]} ${typeColor[change.type](change.type.toUpperCase())}: ${chalk28__default.default.bold(change.key)}`
|
|
34319
34337
|
);
|
|
34320
34338
|
if (change.oldValue !== void 0) {
|
|
34321
34339
|
console.log(
|
|
34322
|
-
` ${
|
|
34340
|
+
` ${chalk28__default.default.gray("Old:")} ${chalk28__default.default.gray(this.formatValue(change.oldValue))}`
|
|
34323
34341
|
);
|
|
34324
34342
|
}
|
|
34325
34343
|
if (change.newValue !== void 0) {
|
|
34326
34344
|
console.log(
|
|
34327
|
-
` ${
|
|
34345
|
+
` ${chalk28__default.default.gray("New:")} ${chalk28__default.default.cyan(this.formatValue(change.newValue))}`
|
|
34328
34346
|
);
|
|
34329
34347
|
}
|
|
34330
|
-
console.log(` ${
|
|
34331
|
-
console.log(` ${
|
|
34348
|
+
console.log(` ${chalk28__default.default.gray("Layer:")} ${chalk28__default.default.magenta(change.layer)}`);
|
|
34349
|
+
console.log(` ${chalk28__default.default.gray(change.description)}`);
|
|
34332
34350
|
console.log();
|
|
34333
34351
|
}
|
|
34334
34352
|
displayAffectedConfig(affected) {
|
|
34335
34353
|
const impactColor = {
|
|
34336
|
-
low:
|
|
34337
|
-
medium:
|
|
34338
|
-
high:
|
|
34339
|
-
critical:
|
|
34354
|
+
low: chalk28__default.default.gray,
|
|
34355
|
+
medium: chalk28__default.default.yellow,
|
|
34356
|
+
high: chalk28__default.default.red,
|
|
34357
|
+
critical: chalk28__default.default.red.bold
|
|
34340
34358
|
};
|
|
34341
34359
|
console.log(
|
|
34342
|
-
` \u2022 ${
|
|
34360
|
+
` \u2022 ${chalk28__default.default.bold(affected.key)} (${chalk28__default.default.magenta(affected.layer)})`
|
|
34343
34361
|
);
|
|
34344
34362
|
console.log(
|
|
34345
34363
|
` Impact: ${impactColor[affected.impact](affected.impact.toUpperCase())}`
|
|
34346
34364
|
);
|
|
34347
|
-
console.log(` Relationship: ${
|
|
34348
|
-
console.log(` ${
|
|
34365
|
+
console.log(` Relationship: ${chalk28__default.default.cyan(affected.relationship)}`);
|
|
34366
|
+
console.log(` ${chalk28__default.default.gray(affected.description)}`);
|
|
34349
34367
|
console.log();
|
|
34350
34368
|
}
|
|
34351
34369
|
displaySafetyRisk(risk) {
|
|
@@ -34356,78 +34374,78 @@ var init_ConfigCLI = __esm({
|
|
|
34356
34374
|
critical: "\u{1F6A8}"
|
|
34357
34375
|
};
|
|
34358
34376
|
const levelColor = {
|
|
34359
|
-
info:
|
|
34360
|
-
warning:
|
|
34361
|
-
error:
|
|
34362
|
-
critical:
|
|
34377
|
+
info: chalk28__default.default.blue,
|
|
34378
|
+
warning: chalk28__default.default.yellow,
|
|
34379
|
+
error: chalk28__default.default.red,
|
|
34380
|
+
critical: chalk28__default.default.red.bold
|
|
34363
34381
|
};
|
|
34364
34382
|
console.log(
|
|
34365
34383
|
` ${levelIcon[risk.level]} ${levelColor[risk.level](risk.level.toUpperCase())}: ${risk.message}`
|
|
34366
34384
|
);
|
|
34367
34385
|
if (risk.recommendation) {
|
|
34368
34386
|
console.log(
|
|
34369
|
-
` ${
|
|
34387
|
+
` ${chalk28__default.default.gray("Recommendation:")} ${risk.recommendation}`
|
|
34370
34388
|
);
|
|
34371
34389
|
}
|
|
34372
34390
|
if (risk.autoFixable) {
|
|
34373
|
-
console.log(` ${
|
|
34391
|
+
console.log(` ${chalk28__default.default.green("Auto-fixable: Yes")}`);
|
|
34374
34392
|
}
|
|
34375
34393
|
console.log();
|
|
34376
34394
|
}
|
|
34377
34395
|
displayLayeredConfig(data2) {
|
|
34378
|
-
console.log(
|
|
34396
|
+
console.log(chalk28__default.default.bold(`
|
|
34379
34397
|
\u{1F4CB} ${data2.key} Configuration
|
|
34380
34398
|
`));
|
|
34381
34399
|
console.log(
|
|
34382
|
-
`${
|
|
34400
|
+
`${chalk28__default.default.bold("Effective Value:")} ${chalk28__default.default.cyan(this.formatValue(data2.value))}`
|
|
34383
34401
|
);
|
|
34384
|
-
console.log(`${
|
|
34402
|
+
console.log(`${chalk28__default.default.bold("Source Layer:")} ${chalk28__default.default.magenta(data2.source)}`);
|
|
34385
34403
|
console.log(
|
|
34386
|
-
`${
|
|
34404
|
+
`${chalk28__default.default.bold("Merged:")} ${data2.merged ? chalk28__default.default.yellow("Yes") : chalk28__default.default.gray("No")}`
|
|
34387
34405
|
);
|
|
34388
34406
|
if (data2.layers) {
|
|
34389
|
-
console.log(
|
|
34407
|
+
console.log(chalk28__default.default.bold("\nLayer Values:"));
|
|
34390
34408
|
const layers = ["runtime", "project", "user", "global"];
|
|
34391
34409
|
for (const layer of layers) {
|
|
34392
34410
|
const value = data2.layers[layer];
|
|
34393
34411
|
if (value !== void 0) {
|
|
34394
34412
|
const isActive = layer === data2.source;
|
|
34395
|
-
const layerDisplay = isActive ?
|
|
34413
|
+
const layerDisplay = isActive ? chalk28__default.default.bold.magenta(`${layer} (active)`) : chalk28__default.default.gray(layer);
|
|
34396
34414
|
console.log(
|
|
34397
|
-
` ${layerDisplay}: ${
|
|
34415
|
+
` ${layerDisplay}: ${chalk28__default.default.cyan(this.formatValue(value))}`
|
|
34398
34416
|
);
|
|
34399
34417
|
}
|
|
34400
34418
|
}
|
|
34401
34419
|
}
|
|
34402
34420
|
}
|
|
34403
34421
|
displayConfigList(configs) {
|
|
34404
|
-
console.log(
|
|
34422
|
+
console.log(chalk28__default.default.bold("\n\u2699\uFE0F Configuration Settings\n"));
|
|
34405
34423
|
if (Object.keys(configs).length === 0) {
|
|
34406
|
-
console.log(
|
|
34424
|
+
console.log(chalk28__default.default.gray("No configurations found."));
|
|
34407
34425
|
return;
|
|
34408
34426
|
}
|
|
34409
34427
|
const categorized = this.categorizeConfigs(configs);
|
|
34410
34428
|
for (const [category, items] of Object.entries(categorized)) {
|
|
34411
34429
|
if (Object.keys(items).length === 0) continue;
|
|
34412
34430
|
console.log(
|
|
34413
|
-
|
|
34431
|
+
chalk28__default.default.bold.cyan(`${this.getCategoryIcon(category)} ${category}`)
|
|
34414
34432
|
);
|
|
34415
|
-
console.log(
|
|
34433
|
+
console.log(chalk28__default.default.gray("\u2500".repeat(category.length + 4)));
|
|
34416
34434
|
for (const [key2, value] of Object.entries(items)) {
|
|
34417
34435
|
console.log(
|
|
34418
|
-
` ${
|
|
34436
|
+
` ${chalk28__default.default.bold(key2)}: ${chalk28__default.default.cyan(this.formatValue(value))}`
|
|
34419
34437
|
);
|
|
34420
34438
|
}
|
|
34421
34439
|
console.log();
|
|
34422
34440
|
}
|
|
34423
34441
|
console.log(
|
|
34424
|
-
|
|
34442
|
+
chalk28__default.default.gray(`Total: ${Object.keys(configs).length} configuration(s)`)
|
|
34425
34443
|
);
|
|
34426
34444
|
}
|
|
34427
34445
|
async promptConfirmation() {
|
|
34428
34446
|
return new Promise((resolve8) => {
|
|
34429
34447
|
this.rl.question(
|
|
34430
|
-
|
|
34448
|
+
chalk28__default.default.bold("\nDo you want to proceed? [y/N]: "),
|
|
34431
34449
|
(answer) => {
|
|
34432
34450
|
resolve8(["y", "yes", "Y", "YES"].includes(answer.trim()));
|
|
34433
34451
|
}
|
|
@@ -34436,20 +34454,20 @@ var init_ConfigCLI = __esm({
|
|
|
34436
34454
|
}
|
|
34437
34455
|
formatValue(value) {
|
|
34438
34456
|
if (value === null || value === void 0) {
|
|
34439
|
-
return
|
|
34457
|
+
return chalk28__default.default.gray("null");
|
|
34440
34458
|
}
|
|
34441
34459
|
if (typeof value === "string") {
|
|
34442
34460
|
const isSensitive = this.isSensitiveValue(value);
|
|
34443
34461
|
if (isSensitive) {
|
|
34444
|
-
return
|
|
34462
|
+
return chalk28__default.default.gray("********");
|
|
34445
34463
|
}
|
|
34446
34464
|
return `"${value}"`;
|
|
34447
34465
|
}
|
|
34448
34466
|
if (typeof value === "boolean") {
|
|
34449
|
-
return value ?
|
|
34467
|
+
return value ? chalk28__default.default.green("true") : chalk28__default.default.red("false");
|
|
34450
34468
|
}
|
|
34451
34469
|
if (typeof value === "number") {
|
|
34452
|
-
return
|
|
34470
|
+
return chalk28__default.default.blue(value.toString());
|
|
34453
34471
|
}
|
|
34454
34472
|
if (Array.isArray(value)) {
|
|
34455
34473
|
return `[${value.map((v) => this.formatValue(v)).join(", ")}]`;
|
|
@@ -35352,12 +35370,12 @@ ${this.toYamlLike(value, indent + 1)}`;
|
|
|
35352
35370
|
}
|
|
35353
35371
|
static async loadFromFile(configPath) {
|
|
35354
35372
|
const { importNodeBuiltin: importNodeBuiltin2 } = await Promise.resolve().then(() => (init_import_helper(), import_helper_exports));
|
|
35355
|
-
const
|
|
35373
|
+
const fs25 = await importNodeBuiltin2("fs");
|
|
35356
35374
|
const _path = await importNodeBuiltin2("path");
|
|
35357
35375
|
const os23 = await importNodeBuiltin2("os");
|
|
35358
35376
|
const targetPath = configPath || _path.join(os23.homedir(), ".maria", "config.json");
|
|
35359
35377
|
try {
|
|
35360
|
-
const data2 = await
|
|
35378
|
+
const data2 = await fs25.promises.readFile(targetPath, "utf-8");
|
|
35361
35379
|
return JSON.parse(data2);
|
|
35362
35380
|
} catch (innerError) {
|
|
35363
35381
|
if (error?.code === "ENOENT") {
|
|
@@ -35371,25 +35389,25 @@ ${this.toYamlLike(value, indent + 1)}`;
|
|
|
35371
35389
|
}
|
|
35372
35390
|
async save(configPath, options2) {
|
|
35373
35391
|
const { importNodeBuiltin: importNodeBuiltin2 } = await Promise.resolve().then(() => (init_import_helper(), import_helper_exports));
|
|
35374
|
-
const
|
|
35392
|
+
const fs25 = await importNodeBuiltin2("fs");
|
|
35375
35393
|
const _path = await importNodeBuiltin2("path");
|
|
35376
35394
|
const os23 = await importNodeBuiltin2("os");
|
|
35377
35395
|
const targetPath = configPath || _path.join(os23.homedir(), ".maria", "config.json");
|
|
35378
35396
|
try {
|
|
35379
35397
|
if (options2?.backup) {
|
|
35380
35398
|
try {
|
|
35381
|
-
await
|
|
35399
|
+
await fs25.promises.access(targetPath);
|
|
35382
35400
|
const backupPath = `${targetPath}.backup.${Date.now()}`;
|
|
35383
|
-
await
|
|
35401
|
+
await fs25.promises.copyFile(targetPath, backupPath);
|
|
35384
35402
|
} catch {
|
|
35385
35403
|
}
|
|
35386
35404
|
}
|
|
35387
|
-
await
|
|
35405
|
+
await fs25.promises.mkdir(_path.dirname(targetPath), { recursive: true });
|
|
35388
35406
|
const dataToSave = this.getAll({
|
|
35389
35407
|
maskSensitive: options2?.maskSensitive ?? true,
|
|
35390
35408
|
includeSourceMap: options2?.includeSourceMap ?? false
|
|
35391
35409
|
});
|
|
35392
|
-
await
|
|
35410
|
+
await fs25.promises.writeFile(
|
|
35393
35411
|
targetPath,
|
|
35394
35412
|
JSON.stringify(dataToSave, null, 2),
|
|
35395
35413
|
{ mode: 384 }
|
|
@@ -35433,12 +35451,12 @@ ${this.toYamlLike(value, indent + 1)}`;
|
|
|
35433
35451
|
}
|
|
35434
35452
|
if (outputPath) {
|
|
35435
35453
|
const { importNodeBuiltin: importNodeBuiltin2 } = await Promise.resolve().then(() => (init_import_helper(), import_helper_exports));
|
|
35436
|
-
const
|
|
35454
|
+
const fs25 = await importNodeBuiltin2("fs");
|
|
35437
35455
|
const _path = await importNodeBuiltin2(
|
|
35438
35456
|
"path"
|
|
35439
35457
|
);
|
|
35440
|
-
await
|
|
35441
|
-
await
|
|
35458
|
+
await fs25.promises.mkdir(_path.dirname(outputPath), { recursive: true });
|
|
35459
|
+
await fs25.promises.writeFile(outputPath, content2, "utf-8");
|
|
35442
35460
|
console.log(`\u2705 Configuration exported to ${outputPath}`);
|
|
35443
35461
|
}
|
|
35444
35462
|
return content2;
|
|
@@ -35924,8 +35942,8 @@ var init_api_caller = __esm({
|
|
|
35924
35942
|
});
|
|
35925
35943
|
function handleRateLimitError(error2) {
|
|
35926
35944
|
console.log();
|
|
35927
|
-
console.log(
|
|
35928
|
-
console.log(
|
|
35945
|
+
console.log(chalk28__default.default.yellow("\u23F1\uFE0F Rate Limit Exceeded"));
|
|
35946
|
+
console.log(chalk28__default.default.gray("\u2501".repeat(50)));
|
|
35929
35947
|
const route = error2.route || error2.details?.endpoint || "API";
|
|
35930
35948
|
const plan = error2.plan || error2.details?.plan || "Unknown";
|
|
35931
35949
|
const limit = error2.limit || (error2.details?.limit ? parseInt(error2.details.limit) : null);
|
|
@@ -35943,24 +35961,24 @@ function handleRateLimitError(error2) {
|
|
|
35943
35961
|
resetTime = `at ${resetDate.toLocaleTimeString()}`;
|
|
35944
35962
|
}
|
|
35945
35963
|
}
|
|
35946
|
-
console.log(
|
|
35947
|
-
console.log(
|
|
35964
|
+
console.log(chalk28__default.default.white(`Plan: ${chalk28__default.default.bold(plan)}`));
|
|
35965
|
+
console.log(chalk28__default.default.white(`Endpoint: ${chalk28__default.default.bold(route)}`));
|
|
35948
35966
|
if (limit !== null) {
|
|
35949
|
-
console.log(
|
|
35967
|
+
console.log(chalk28__default.default.white(`Limit: ${chalk28__default.default.bold(limit)} requests`));
|
|
35950
35968
|
}
|
|
35951
35969
|
if (error2.remaining !== void 0) {
|
|
35952
|
-
console.log(
|
|
35970
|
+
console.log(chalk28__default.default.white(`Remaining: ${chalk28__default.default.bold(error2.remaining)} requests`));
|
|
35953
35971
|
}
|
|
35954
35972
|
console.log();
|
|
35955
|
-
console.log(
|
|
35973
|
+
console.log(chalk28__default.default.cyan(`Please wait ${chalk28__default.default.bold(waitTime)} before trying again`));
|
|
35956
35974
|
if (resetTime) {
|
|
35957
|
-
console.log(
|
|
35975
|
+
console.log(chalk28__default.default.gray(`Rate limit resets ${resetTime}`));
|
|
35958
35976
|
}
|
|
35959
35977
|
if (error2.hint) {
|
|
35960
35978
|
console.log();
|
|
35961
|
-
console.log(
|
|
35979
|
+
console.log(chalk28__default.default.magenta("\u{1F4A1} " + error2.hint));
|
|
35962
35980
|
}
|
|
35963
|
-
console.log(
|
|
35981
|
+
console.log(chalk28__default.default.gray("\u2501".repeat(50)));
|
|
35964
35982
|
console.log();
|
|
35965
35983
|
}
|
|
35966
35984
|
async function parseRateLimitResponse(response2) {
|
|
@@ -39285,13 +39303,13 @@ async function checkShield(commandName, userPlan = "free") {
|
|
|
39285
39303
|
}
|
|
39286
39304
|
async function loadManifest() {
|
|
39287
39305
|
try {
|
|
39288
|
-
const
|
|
39289
|
-
const
|
|
39290
|
-
const manifestPath =
|
|
39306
|
+
const fs25 = await import('fs');
|
|
39307
|
+
const path30 = await import('path');
|
|
39308
|
+
const manifestPath = path30.join(
|
|
39291
39309
|
__dirname,
|
|
39292
39310
|
"../command-manifest-v2.1.json"
|
|
39293
39311
|
);
|
|
39294
|
-
const content2 =
|
|
39312
|
+
const content2 = fs25.readFileSync(manifestPath, "utf-8");
|
|
39295
39313
|
return JSON.parse(content2);
|
|
39296
39314
|
} catch {
|
|
39297
39315
|
return { commands: [] };
|
|
@@ -40871,7 +40889,7 @@ var init_model_selector_ui = __esm({
|
|
|
40871
40889
|
output: process.stdout,
|
|
40872
40890
|
terminal: true
|
|
40873
40891
|
});
|
|
40874
|
-
console.log(
|
|
40892
|
+
console.log(chalk28__default.default.green(
|
|
40875
40893
|
"\u250C\u2500[ MODEL MATRIX ]\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"
|
|
40876
40894
|
));
|
|
40877
40895
|
process.stdout.write("\x1B7");
|
|
@@ -40939,14 +40957,14 @@ var init_model_selector_ui = __esm({
|
|
|
40939
40957
|
}
|
|
40940
40958
|
renderFromSavedPosition() {
|
|
40941
40959
|
if (this.isDestroyed) return;
|
|
40942
|
-
console.log(
|
|
40943
|
-
"\u2502 " +
|
|
40960
|
+
console.log(chalk28__default.default.green(
|
|
40961
|
+
"\u2502 " + chalk28__default.default.greenBright("SELECT MODEL:") + " ".repeat(62) + "\u2502"
|
|
40944
40962
|
));
|
|
40945
40963
|
this.renderContent();
|
|
40946
40964
|
const scrollInfo = `[${this.selectedIndex + 1}/${this.models.length}]`;
|
|
40947
40965
|
const helpText = `\u2193:NEXT \u2191:PREV ENTER:EXEC ESC:ABORT ${scrollInfo}`;
|
|
40948
|
-
console.log(
|
|
40949
|
-
console.log(
|
|
40966
|
+
console.log(chalk28__default.default.green("\u2502 ") + chalk28__default.default.dim.green(helpText.padEnd(76)) + chalk28__default.default.green(" \u2502"));
|
|
40967
|
+
console.log(chalk28__default.default.green(
|
|
40950
40968
|
"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"
|
|
40951
40969
|
));
|
|
40952
40970
|
}
|
|
@@ -40987,19 +41005,19 @@ var init_model_selector_ui = __esm({
|
|
|
40987
41005
|
const item = displayItems[i2];
|
|
40988
41006
|
if (item.type === "group") {
|
|
40989
41007
|
console.log(
|
|
40990
|
-
|
|
41008
|
+
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")
|
|
40991
41009
|
);
|
|
40992
41010
|
} else {
|
|
40993
41011
|
const isSelected = item.modelIndex === this.selectedIndex;
|
|
40994
|
-
const prefix = isSelected ?
|
|
41012
|
+
const prefix = isSelected ? chalk28__default.default.greenBright("\u25B6 ") : " ";
|
|
40995
41013
|
const modelText = item.content;
|
|
40996
41014
|
if (isSelected) {
|
|
40997
41015
|
console.log(
|
|
40998
|
-
|
|
41016
|
+
chalk28__default.default.green("\u2502") + prefix + chalk28__default.default.black.bgGreen(modelText.padEnd(75)) + chalk28__default.default.green("\u2502")
|
|
40999
41017
|
);
|
|
41000
41018
|
} else {
|
|
41001
41019
|
console.log(
|
|
41002
|
-
|
|
41020
|
+
chalk28__default.default.green("\u2502") + prefix + chalk28__default.default.green(modelText.substring(0, 75).padEnd(75)) + chalk28__default.default.green("\u2502")
|
|
41003
41021
|
);
|
|
41004
41022
|
}
|
|
41005
41023
|
}
|
|
@@ -43073,8 +43091,8 @@ function getSafeTerminalWidth() {
|
|
|
43073
43091
|
}
|
|
43074
43092
|
if (process.platform === "win32") {
|
|
43075
43093
|
try {
|
|
43076
|
-
const { execSync
|
|
43077
|
-
const result2 =
|
|
43094
|
+
const { execSync } = __require("child_process");
|
|
43095
|
+
const result2 = execSync('powershell -command "$host.UI.RawUI.WindowSize.Width"', {
|
|
43078
43096
|
encoding: "utf8",
|
|
43079
43097
|
stdio: ["pipe", "pipe", "ignore"]
|
|
43080
43098
|
// Suppress stderr
|
|
@@ -43144,129 +43162,129 @@ function displayStartupLogo() {
|
|
|
43144
43162
|
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
43145
43163
|
console.log("");
|
|
43146
43164
|
console.log(
|
|
43147
|
-
|
|
43165
|
+
chalk28__default.default.magentaBright(
|
|
43148
43166
|
"\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"
|
|
43149
43167
|
)
|
|
43150
43168
|
);
|
|
43151
43169
|
console.log(
|
|
43152
|
-
|
|
43170
|
+
chalk28__default.default.magentaBright(
|
|
43153
43171
|
"\u2551 \u2551"
|
|
43154
43172
|
)
|
|
43155
43173
|
);
|
|
43156
43174
|
console.log(
|
|
43157
|
-
|
|
43175
|
+
chalk28__default.default.magentaBright(
|
|
43158
43176
|
"\u2551 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2551"
|
|
43159
43177
|
)
|
|
43160
43178
|
);
|
|
43161
43179
|
console.log(
|
|
43162
|
-
|
|
43180
|
+
chalk28__default.default.magentaBright(
|
|
43163
43181
|
"\u2551 \u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2551"
|
|
43164
43182
|
)
|
|
43165
43183
|
);
|
|
43166
43184
|
console.log(
|
|
43167
|
-
|
|
43185
|
+
chalk28__default.default.magentaBright(
|
|
43168
43186
|
"\u2551 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2551"
|
|
43169
43187
|
)
|
|
43170
43188
|
);
|
|
43171
43189
|
console.log(
|
|
43172
|
-
|
|
43190
|
+
chalk28__default.default.magentaBright(
|
|
43173
43191
|
"\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551 \u2551"
|
|
43174
43192
|
)
|
|
43175
43193
|
);
|
|
43176
43194
|
console.log(
|
|
43177
|
-
|
|
43195
|
+
chalk28__default.default.magentaBright(
|
|
43178
43196
|
"\u2551 \u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2551"
|
|
43179
43197
|
)
|
|
43180
43198
|
);
|
|
43181
43199
|
console.log(
|
|
43182
|
-
|
|
43200
|
+
chalk28__default.default.magentaBright(
|
|
43183
43201
|
"\u2551 \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u2551"
|
|
43184
43202
|
)
|
|
43185
43203
|
);
|
|
43186
43204
|
console.log(
|
|
43187
|
-
|
|
43205
|
+
chalk28__default.default.magentaBright(
|
|
43188
43206
|
"\u2551 \u2551"
|
|
43189
43207
|
)
|
|
43190
43208
|
);
|
|
43191
43209
|
console.log(
|
|
43192
|
-
|
|
43210
|
+
chalk28__default.default.magentaBright(
|
|
43193
43211
|
"\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2551"
|
|
43194
43212
|
)
|
|
43195
43213
|
);
|
|
43196
43214
|
console.log(
|
|
43197
|
-
|
|
43215
|
+
chalk28__default.default.magentaBright(
|
|
43198
43216
|
"\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2551"
|
|
43199
43217
|
)
|
|
43200
43218
|
);
|
|
43201
43219
|
console.log(
|
|
43202
|
-
|
|
43220
|
+
chalk28__default.default.magentaBright(
|
|
43203
43221
|
"\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2551"
|
|
43204
43222
|
)
|
|
43205
43223
|
);
|
|
43206
43224
|
console.log(
|
|
43207
|
-
|
|
43225
|
+
chalk28__default.default.magentaBright(
|
|
43208
43226
|
"\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2551"
|
|
43209
43227
|
)
|
|
43210
43228
|
);
|
|
43211
43229
|
console.log(
|
|
43212
|
-
|
|
43230
|
+
chalk28__default.default.magentaBright(
|
|
43213
43231
|
"\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2551"
|
|
43214
43232
|
)
|
|
43215
43233
|
);
|
|
43216
43234
|
console.log(
|
|
43217
|
-
|
|
43235
|
+
chalk28__default.default.magentaBright(
|
|
43218
43236
|
"\u2551 \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u2551"
|
|
43219
43237
|
)
|
|
43220
43238
|
);
|
|
43221
43239
|
console.log(
|
|
43222
|
-
|
|
43240
|
+
chalk28__default.default.magentaBright(
|
|
43223
43241
|
"\u2551 \u2551"
|
|
43224
43242
|
)
|
|
43225
43243
|
);
|
|
43226
43244
|
console.log(
|
|
43227
|
-
|
|
43245
|
+
chalk28__default.default.magentaBright(
|
|
43228
43246
|
"\u2551 AI-Powered Development Platform \u2551"
|
|
43229
43247
|
)
|
|
43230
43248
|
);
|
|
43231
43249
|
console.log(
|
|
43232
|
-
|
|
43250
|
+
chalk28__default.default.magentaBright(
|
|
43233
43251
|
"\u2551 (c) 2025 Bonginkan Inc. \u2551"
|
|
43234
43252
|
)
|
|
43235
43253
|
);
|
|
43236
43254
|
console.log(
|
|
43237
|
-
|
|
43255
|
+
chalk28__default.default.magentaBright(
|
|
43238
43256
|
"\u2551 \u2551"
|
|
43239
43257
|
)
|
|
43240
43258
|
);
|
|
43241
43259
|
console.log(
|
|
43242
|
-
|
|
43260
|
+
chalk28__default.default.magentaBright(
|
|
43243
43261
|
"\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"
|
|
43244
43262
|
)
|
|
43245
43263
|
);
|
|
43246
43264
|
console.log("");
|
|
43247
43265
|
console.log(
|
|
43248
|
-
|
|
43266
|
+
chalk28__default.default.cyan.bold(`MARIA CODE v${getVersion()}`) + chalk28__default.default.gray(" \u2014 Ready")
|
|
43249
43267
|
);
|
|
43250
43268
|
console.log(
|
|
43251
|
-
|
|
43269
|
+
chalk28__default.default.yellow("Type /login to get started \xB7 /help for commands")
|
|
43252
43270
|
);
|
|
43253
43271
|
console.log("");
|
|
43254
43272
|
}
|
|
43255
43273
|
function displayCompactLogo() {
|
|
43256
43274
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
43257
43275
|
console.log(
|
|
43258
|
-
|
|
43276
|
+
chalk28__default.default.cyan.bold(`MARIA CODE v${getVersion()}`) + chalk28__default.default.gray(" \u2014 Ready")
|
|
43259
43277
|
);
|
|
43260
43278
|
console.log(
|
|
43261
|
-
|
|
43279
|
+
chalk28__default.default.yellow("Type /login to get started \xB7 /help for commands")
|
|
43262
43280
|
);
|
|
43263
43281
|
console.log("");
|
|
43264
43282
|
}
|
|
43265
43283
|
function displayDashboardHeader() {
|
|
43266
43284
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
43267
|
-
const version =
|
|
43268
|
-
const commands =
|
|
43269
|
-
const providers =
|
|
43285
|
+
const version = chalk28__default.default.cyan.bold(`MARIA CODE v${getVersion()}`);
|
|
43286
|
+
const commands = chalk28__default.default.gray(" | /help /status /model");
|
|
43287
|
+
const providers = chalk28__default.default.gray(
|
|
43270
43288
|
"Providers: 8/8 OK (openai, anthropic, google, groq, lmstudio, ollama, vllm)"
|
|
43271
43289
|
);
|
|
43272
43290
|
console.log(version + commands);
|
|
@@ -43275,8 +43293,8 @@ function displayDashboardHeader() {
|
|
|
43275
43293
|
}
|
|
43276
43294
|
function displayLogsBox(logs) {
|
|
43277
43295
|
const width = getResponsiveWidth({ marginLeft: 5, marginRight: 5, maxWidth: 120 });
|
|
43278
|
-
const borderColor =
|
|
43279
|
-
const titleColor =
|
|
43296
|
+
const borderColor = chalk28__default.default.white;
|
|
43297
|
+
const titleColor = chalk28__default.default.cyan;
|
|
43280
43298
|
const topLeft = "\u250C";
|
|
43281
43299
|
const topRight = "\u2510";
|
|
43282
43300
|
const bottomLeft = "\u2514";
|
|
@@ -43309,7 +43327,7 @@ function displayLogsBox(logs) {
|
|
|
43309
43327
|
function displaySpinner(text = "Processing") {
|
|
43310
43328
|
const spinnerFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
43311
43329
|
const frame = spinnerFrames[Math.floor(Date.now() / 80) % spinnerFrames.length];
|
|
43312
|
-
process.stdout.write(`\r[${
|
|
43330
|
+
process.stdout.write(`\r[${chalk28__default.default.cyan(frame)}] ${text}...`);
|
|
43313
43331
|
}
|
|
43314
43332
|
function getCurrentPath() {
|
|
43315
43333
|
return process.cwd();
|
|
@@ -43327,18 +43345,18 @@ async function displayFinalStartupScreen(_selectedProvider, _selectedModel) {
|
|
|
43327
43345
|
const version = getVersion();
|
|
43328
43346
|
const systemInfo = getSystemInfo();
|
|
43329
43347
|
console.log(
|
|
43330
|
-
|
|
43348
|
+
chalk28__default.default.cyan.bold(`MARIA CODE v${version}`) + chalk28__default.default.gray(" \u2014 Ready")
|
|
43331
43349
|
);
|
|
43332
43350
|
const cwd2 = systemInfo.cwd.replace(os13__namespace.homedir(), "~");
|
|
43333
|
-
console.log(
|
|
43334
|
-
console.log(
|
|
43335
|
-
console.log(
|
|
43351
|
+
console.log(chalk28__default.default.gray("cwd: ") + chalk28__default.default.white(cwd2));
|
|
43352
|
+
console.log(chalk28__default.default.gray("Not signed in"));
|
|
43353
|
+
console.log(chalk28__default.default.yellow("Tip: /login \xB7 /help \xB7 /help code"));
|
|
43336
43354
|
console.log("");
|
|
43337
43355
|
}
|
|
43338
43356
|
function displayRoundedInputBox() {
|
|
43339
43357
|
const width = getResponsiveWidth({ marginLeft: 5, marginRight: 5, maxWidth: 90 });
|
|
43340
|
-
const borderColor =
|
|
43341
|
-
const promptColor =
|
|
43358
|
+
const borderColor = chalk28__default.default.white;
|
|
43359
|
+
const promptColor = chalk28__default.default.cyan;
|
|
43342
43360
|
const topLeft = "\u256D";
|
|
43343
43361
|
const topRight = "\u256E";
|
|
43344
43362
|
const bottomLeft = "\u2570";
|
|
@@ -43348,7 +43366,7 @@ function displayRoundedInputBox() {
|
|
|
43348
43366
|
const lines = [];
|
|
43349
43367
|
lines.push(borderColor(topLeft + horizontal.repeat(width - 2) + topRight));
|
|
43350
43368
|
const promptStr = promptColor("> ");
|
|
43351
|
-
const placeholder =
|
|
43369
|
+
const placeholder = chalk28__default.default.gray("");
|
|
43352
43370
|
const inputLine = promptStr + placeholder;
|
|
43353
43371
|
const padding = width - 4;
|
|
43354
43372
|
lines.push(
|
|
@@ -43502,29 +43520,29 @@ var init_provider_selector = __esm({
|
|
|
43502
43520
|
const inquirer = await import('inquirer');
|
|
43503
43521
|
const prompt = inquirer.default?.prompt || inquirer.prompt;
|
|
43504
43522
|
const providers = await this.getAvailableProviders();
|
|
43505
|
-
console.log(
|
|
43506
|
-
console.log(
|
|
43523
|
+
console.log(chalk28__default.default.cyan("\nAvailable AI Providers:"));
|
|
43524
|
+
console.log(chalk28__default.default.gray("\u2500".repeat(50)));
|
|
43507
43525
|
const _cloudProviders = providers.filter((p) => p.type === "cloud");
|
|
43508
43526
|
const _localProviders = providers.filter((p) => p.type === "local");
|
|
43509
43527
|
if (_cloudProviders.length > 0) {
|
|
43510
|
-
console.log(
|
|
43528
|
+
console.log(chalk28__default.default.yellow("\n\u2601\uFE0F Cloud AI:"));
|
|
43511
43529
|
_cloudProviders.forEach((p) => {
|
|
43512
43530
|
if (p.available) {
|
|
43513
43531
|
console.log(
|
|
43514
|
-
` ${
|
|
43532
|
+
` ${chalk28__default.default.green("*")} ${chalk28__default.default.white(p.name.split(" ")[0])}`
|
|
43515
43533
|
);
|
|
43516
43534
|
} else {
|
|
43517
|
-
console.log(` ${
|
|
43535
|
+
console.log(` ${chalk28__default.default.gray(p.name.split(" ")[0])}`);
|
|
43518
43536
|
}
|
|
43519
43537
|
});
|
|
43520
43538
|
}
|
|
43521
43539
|
if (_localProviders.length > 0) {
|
|
43522
|
-
console.log(
|
|
43540
|
+
console.log(chalk28__default.default.cyan("\n\u{1F4BB} Local AI:"));
|
|
43523
43541
|
_localProviders.forEach((p) => {
|
|
43524
43542
|
if (p.available) {
|
|
43525
|
-
console.log(` ${
|
|
43543
|
+
console.log(` ${chalk28__default.default.green("*")} ${chalk28__default.default.white(p.name)}`);
|
|
43526
43544
|
} else {
|
|
43527
|
-
console.log(` ${
|
|
43545
|
+
console.log(` ${chalk28__default.default.green("*")} ${chalk28__default.default.gray(p.name)}`);
|
|
43528
43546
|
}
|
|
43529
43547
|
});
|
|
43530
43548
|
}
|
|
@@ -43539,20 +43557,20 @@ var init_provider_selector = __esm({
|
|
|
43539
43557
|
});
|
|
43540
43558
|
if (selectableProviders.length === 0) {
|
|
43541
43559
|
console.log(
|
|
43542
|
-
|
|
43560
|
+
chalk28__default.default.yellow("\n\u26A0\uFE0F No AI providers are currently available.")
|
|
43543
43561
|
);
|
|
43544
|
-
console.log(
|
|
43562
|
+
console.log(chalk28__default.default.gray("\nTo use MARIA, you need to:"));
|
|
43545
43563
|
console.log(
|
|
43546
|
-
|
|
43564
|
+
chalk28__default.default.gray(
|
|
43547
43565
|
"1. Set up API keys for cloud providers (OpenAI, Anthropic, Google, etc.)"
|
|
43548
43566
|
)
|
|
43549
43567
|
);
|
|
43550
|
-
console.log(
|
|
43568
|
+
console.log(chalk28__default.default.gray(" Example: export OPENAI_API_KEY=your_api_key"));
|
|
43551
43569
|
console.log(
|
|
43552
|
-
|
|
43570
|
+
chalk28__default.default.gray("2. Or start a local AI service (Ollama, LM Studio, vLLM)")
|
|
43553
43571
|
);
|
|
43554
|
-
console.log(
|
|
43555
|
-
console.log(
|
|
43572
|
+
console.log(chalk28__default.default.gray(" Example: maria setup-ollama"));
|
|
43573
|
+
console.log(chalk28__default.default.gray("\nFor more information, run: maria --help"));
|
|
43556
43574
|
process.exit(1);
|
|
43557
43575
|
}
|
|
43558
43576
|
const choices = selectableProviders.map((p) => ({
|
|
@@ -43573,29 +43591,29 @@ var init_provider_selector = __esm({
|
|
|
43573
43591
|
const provider = providers.find((p) => p.value === selectedProvider);
|
|
43574
43592
|
if (provider && provider.type === "local" && !provider.available) {
|
|
43575
43593
|
console.log(
|
|
43576
|
-
|
|
43594
|
+
chalk28__default.default.yellow(`
|
|
43577
43595
|
\u26A0\uFE0F ${provider.name} is not currently running.`)
|
|
43578
43596
|
);
|
|
43579
|
-
console.log(
|
|
43597
|
+
console.log(chalk28__default.default.gray(`
|
|
43580
43598
|
To use ${provider.name}, you need to:`));
|
|
43581
43599
|
if (selectedProvider === "ollama") {
|
|
43582
|
-
console.log(
|
|
43583
|
-
console.log(
|
|
43584
|
-
console.log(
|
|
43600
|
+
console.log(chalk28__default.default.gray("1. Install Ollama: brew install ollama"));
|
|
43601
|
+
console.log(chalk28__default.default.gray("2. Start Ollama: ollama serve"));
|
|
43602
|
+
console.log(chalk28__default.default.gray("3. Pull a model: ollama pull llama3.2:3b"));
|
|
43585
43603
|
console.log(
|
|
43586
|
-
|
|
43604
|
+
chalk28__default.default.gray("\nOr use the setup command: maria setup-ollama")
|
|
43587
43605
|
);
|
|
43588
43606
|
} else if (selectedProvider === "lmstudio") {
|
|
43589
43607
|
console.log(
|
|
43590
|
-
|
|
43608
|
+
chalk28__default.default.gray("1. Download LM Studio from https://lmstudio.ai")
|
|
43591
43609
|
);
|
|
43592
|
-
console.log(
|
|
43593
|
-
console.log(
|
|
43594
|
-
console.log(
|
|
43610
|
+
console.log(chalk28__default.default.gray("2. Start LM Studio application"));
|
|
43611
|
+
console.log(chalk28__default.default.gray("3. Load a model in LM Studio"));
|
|
43612
|
+
console.log(chalk28__default.default.gray("4. Start the local server in LM Studio"));
|
|
43595
43613
|
} else if (selectedProvider === "vllm") {
|
|
43596
|
-
console.log(
|
|
43597
|
-
console.log(
|
|
43598
|
-
console.log(
|
|
43614
|
+
console.log(chalk28__default.default.gray("1. Install vLLM: pip install vllm"));
|
|
43615
|
+
console.log(chalk28__default.default.gray("2. Start vLLM server with a model"));
|
|
43616
|
+
console.log(chalk28__default.default.gray("\nOr use the setup command: maria setup-vllm"));
|
|
43599
43617
|
}
|
|
43600
43618
|
process.exit(1);
|
|
43601
43619
|
}
|
|
@@ -46850,7 +46868,7 @@ var init_IntelligentRouterService = __esm({
|
|
|
46850
46868
|
this.emit("initialized");
|
|
46851
46869
|
} catch (_error) {
|
|
46852
46870
|
console._error(
|
|
46853
|
-
|
|
46871
|
+
chalk28__default.default.red("Failed to initialize Intelligent Router:"),
|
|
46854
46872
|
_error
|
|
46855
46873
|
);
|
|
46856
46874
|
throw _error;
|
|
@@ -46904,7 +46922,7 @@ var init_IntelligentRouterService = __esm({
|
|
|
46904
46922
|
} catch (_error) {
|
|
46905
46923
|
this.metrics.failedRoutes++;
|
|
46906
46924
|
this.emit("route:_error", { input: input3, _error });
|
|
46907
|
-
console._error(
|
|
46925
|
+
console._error(chalk28__default.default.red("Routing _error:"), _error);
|
|
46908
46926
|
return null;
|
|
46909
46927
|
}
|
|
46910
46928
|
}
|
|
@@ -49643,16 +49661,16 @@ var init_log_symbols = __esm({
|
|
|
49643
49661
|
"node_modules/.pnpm/log-symbols@6.0.0/node_modules/log-symbols/index.js"() {
|
|
49644
49662
|
init_is_unicode_supported();
|
|
49645
49663
|
main = {
|
|
49646
|
-
info:
|
|
49647
|
-
success:
|
|
49648
|
-
warning:
|
|
49649
|
-
error:
|
|
49664
|
+
info: chalk28__default.default.blue("\u2139"),
|
|
49665
|
+
success: chalk28__default.default.green("\u2714"),
|
|
49666
|
+
warning: chalk28__default.default.yellow("\u26A0"),
|
|
49667
|
+
error: chalk28__default.default.red("\u2716")
|
|
49650
49668
|
};
|
|
49651
49669
|
fallback = {
|
|
49652
|
-
info:
|
|
49653
|
-
success:
|
|
49654
|
-
warning:
|
|
49655
|
-
error:
|
|
49670
|
+
info: chalk28__default.default.blue("i"),
|
|
49671
|
+
success: chalk28__default.default.green("\u221A"),
|
|
49672
|
+
warning: chalk28__default.default.yellow("\u203C"),
|
|
49673
|
+
error: chalk28__default.default.red("\xD7")
|
|
49656
49674
|
};
|
|
49657
49675
|
logSymbols = isUnicodeSupported() ? main : fallback;
|
|
49658
49676
|
log_symbols_default = logSymbols;
|
|
@@ -50049,7 +50067,7 @@ var init_ora = __esm({
|
|
|
50049
50067
|
const { frames } = this.#spinner;
|
|
50050
50068
|
let frame = frames[this.#frameIndex];
|
|
50051
50069
|
if (this.color) {
|
|
50052
|
-
frame =
|
|
50070
|
+
frame = chalk28__default.default[this.color](frame);
|
|
50053
50071
|
}
|
|
50054
50072
|
const fullPrefixText = typeof this.#prefixText === "string" && this.#prefixText !== "" ? this.#prefixText + " " : "";
|
|
50055
50073
|
const fullText = typeof this.text === "string" ? " " + this.text : "";
|
|
@@ -50169,28 +50187,28 @@ var init_ChalkAdapter = __esm({
|
|
|
50169
50187
|
spinnerId = 0;
|
|
50170
50188
|
async showWelcome() {
|
|
50171
50189
|
console.log(
|
|
50172
|
-
|
|
50190
|
+
chalk28__default.default.cyan.bold("\n\u{1F916} Welcome to MARIA Interactive Session v3.5.0")
|
|
50173
50191
|
);
|
|
50174
|
-
console.log(
|
|
50192
|
+
console.log(chalk28__default.default.gray("Type /help for available commands\n"));
|
|
50175
50193
|
}
|
|
50176
50194
|
showGoodbye() {
|
|
50177
50195
|
this.stopAllSpinners();
|
|
50178
|
-
console.log(
|
|
50196
|
+
console.log(chalk28__default.default.yellow("\n\u{1F44B} Goodbye! Thank you for using MARIA.\n"));
|
|
50179
50197
|
}
|
|
50180
50198
|
async print(message) {
|
|
50181
50199
|
console.log(message);
|
|
50182
50200
|
}
|
|
50183
50201
|
error(message) {
|
|
50184
|
-
console.error(
|
|
50202
|
+
console.error(chalk28__default.default.red(`\u274C ${message}`));
|
|
50185
50203
|
}
|
|
50186
50204
|
success(message) {
|
|
50187
|
-
console.log(
|
|
50205
|
+
console.log(chalk28__default.default.green(`\u2705 ${message}`));
|
|
50188
50206
|
}
|
|
50189
50207
|
warning(message) {
|
|
50190
|
-
console.warn(
|
|
50208
|
+
console.warn(chalk28__default.default.yellow(`\u26A0\uFE0F ${message}`));
|
|
50191
50209
|
}
|
|
50192
50210
|
info(message) {
|
|
50193
|
-
console.info(
|
|
50211
|
+
console.info(chalk28__default.default.blue(`\u2139\uFE0F ${message}`));
|
|
50194
50212
|
}
|
|
50195
50213
|
startSpinner(message) {
|
|
50196
50214
|
const id = `spinner-${++this.spinnerId}`;
|
|
@@ -50240,12 +50258,12 @@ var init_ChalkAdapter = __esm({
|
|
|
50240
50258
|
* Format helpers for consistent styling
|
|
50241
50259
|
*/
|
|
50242
50260
|
static format = {
|
|
50243
|
-
command: (text) =>
|
|
50244
|
-
keyword: (text) =>
|
|
50245
|
-
value: (text) =>
|
|
50246
|
-
dim: (text) =>
|
|
50247
|
-
bold: (text) =>
|
|
50248
|
-
code: (text) =>
|
|
50261
|
+
command: (text) => chalk28__default.default.cyan(text),
|
|
50262
|
+
keyword: (text) => chalk28__default.default.magenta(text),
|
|
50263
|
+
value: (text) => chalk28__default.default.green(text),
|
|
50264
|
+
dim: (text) => chalk28__default.default.gray(text),
|
|
50265
|
+
bold: (text) => chalk28__default.default.bold(text),
|
|
50266
|
+
code: (text) => chalk28__default.default.bgGray.white(` ${text} `)
|
|
50249
50267
|
};
|
|
50250
50268
|
};
|
|
50251
50269
|
}
|
|
@@ -52676,8 +52694,8 @@ var init_ConfigService = __esm({
|
|
|
52676
52694
|
/**
|
|
52677
52695
|
* ネストされた設定値の取得
|
|
52678
52696
|
*/
|
|
52679
|
-
getNestedValue(
|
|
52680
|
-
const keys =
|
|
52697
|
+
getNestedValue(path30) {
|
|
52698
|
+
const keys = path30.split(".");
|
|
52681
52699
|
let value = this._config;
|
|
52682
52700
|
for (const key2 of keys) {
|
|
52683
52701
|
if (value && typeof value === "object" && key2 in value) {
|
|
@@ -52707,8 +52725,8 @@ var init_ConfigService = __esm({
|
|
|
52707
52725
|
/**
|
|
52708
52726
|
* ネストされた設定値の更新
|
|
52709
52727
|
*/
|
|
52710
|
-
async setNestedValue(
|
|
52711
|
-
const keys =
|
|
52728
|
+
async setNestedValue(path30, value) {
|
|
52729
|
+
const keys = path30.split(".");
|
|
52712
52730
|
const lastKey = keys.pop();
|
|
52713
52731
|
let target = this._config;
|
|
52714
52732
|
for (const key2 of keys) {
|
|
@@ -52721,7 +52739,7 @@ var init_ConfigService = __esm({
|
|
|
52721
52739
|
target[lastKey] = value;
|
|
52722
52740
|
this.validateConfig();
|
|
52723
52741
|
this.emitChange({
|
|
52724
|
-
path:
|
|
52742
|
+
path: path30,
|
|
52725
52743
|
oldValue,
|
|
52726
52744
|
newValue: value,
|
|
52727
52745
|
timestamp: /* @__PURE__ */ new Date()
|
|
@@ -52766,8 +52784,8 @@ var init_ConfigService = __esm({
|
|
|
52766
52784
|
setupAutoSave() {
|
|
52767
52785
|
process.on("exit", () => {
|
|
52768
52786
|
if (this._isDirty) {
|
|
52769
|
-
const
|
|
52770
|
-
|
|
52787
|
+
const fs25 = __require("fs");
|
|
52788
|
+
fs25.writeFileSync(
|
|
52771
52789
|
this._userConfigPath,
|
|
52772
52790
|
JSON.stringify(this._config, null, 2),
|
|
52773
52791
|
"utf-8"
|
|
@@ -52778,13 +52796,13 @@ var init_ConfigService = __esm({
|
|
|
52778
52796
|
/**
|
|
52779
52797
|
* 変更リスナーの登録
|
|
52780
52798
|
*/
|
|
52781
|
-
onChange(
|
|
52782
|
-
if (!this._listeners.has(
|
|
52783
|
-
this._listeners.set(
|
|
52799
|
+
onChange(path30, listener) {
|
|
52800
|
+
if (!this._listeners.has(path30)) {
|
|
52801
|
+
this._listeners.set(path30, []);
|
|
52784
52802
|
}
|
|
52785
|
-
this._listeners.get(
|
|
52803
|
+
this._listeners.get(path30).push(listener);
|
|
52786
52804
|
return () => {
|
|
52787
|
-
const listeners = this._listeners.get(
|
|
52805
|
+
const listeners = this._listeners.get(path30);
|
|
52788
52806
|
if (listeners) {
|
|
52789
52807
|
const index2 = listeners.indexOf(listener);
|
|
52790
52808
|
if (index2 !== -1) {
|
|
@@ -53273,7 +53291,7 @@ var init_ValidationService = __esm({
|
|
|
53273
53291
|
);
|
|
53274
53292
|
this._schemas.set(
|
|
53275
53293
|
"filePath",
|
|
53276
|
-
zod.z.string().min(1).max(this._config.maxFilePathLength).refine((
|
|
53294
|
+
zod.z.string().min(1).max(this._config.maxFilePathLength).refine((path30) => !this.containsPathTraversal(path30), {
|
|
53277
53295
|
message: "Path traversal detected"
|
|
53278
53296
|
})
|
|
53279
53297
|
);
|
|
@@ -53412,11 +53430,11 @@ var init_ValidationService = __esm({
|
|
|
53412
53430
|
/**
|
|
53413
53431
|
* ファイルパス検証
|
|
53414
53432
|
*/
|
|
53415
|
-
validateFilePath(
|
|
53433
|
+
validateFilePath(path30) {
|
|
53416
53434
|
try {
|
|
53417
53435
|
const schema = this._schemas.get("filePath");
|
|
53418
|
-
const result2 = schema.parse(
|
|
53419
|
-
if (this.isSystemPath(
|
|
53436
|
+
const result2 = schema.parse(path30);
|
|
53437
|
+
if (this.isSystemPath(path30)) {
|
|
53420
53438
|
return {
|
|
53421
53439
|
valid: false,
|
|
53422
53440
|
errors: [
|
|
@@ -53562,8 +53580,8 @@ var init_ValidationService = __esm({
|
|
|
53562
53580
|
/**
|
|
53563
53581
|
* パストラバーサルの検出
|
|
53564
53582
|
*/
|
|
53565
|
-
containsPathTraversal(
|
|
53566
|
-
return /\.\.[/\\]/.test(
|
|
53583
|
+
containsPathTraversal(path30) {
|
|
53584
|
+
return /\.\.[/\\]/.test(path30) || path30.includes("..\\") || path30.includes("../");
|
|
53567
53585
|
}
|
|
53568
53586
|
/**
|
|
53569
53587
|
* 危険なコマンドの判定
|
|
@@ -53590,7 +53608,7 @@ var init_ValidationService = __esm({
|
|
|
53590
53608
|
/**
|
|
53591
53609
|
* システムパスの判定
|
|
53592
53610
|
*/
|
|
53593
|
-
isSystemPath(
|
|
53611
|
+
isSystemPath(path30) {
|
|
53594
53612
|
const systemPaths = [
|
|
53595
53613
|
"/etc",
|
|
53596
53614
|
"/sys",
|
|
@@ -53604,7 +53622,7 @@ var init_ValidationService = __esm({
|
|
|
53604
53622
|
"/sbin"
|
|
53605
53623
|
];
|
|
53606
53624
|
return systemPaths.some(
|
|
53607
|
-
(sysPath) =>
|
|
53625
|
+
(sysPath) => path30.toLowerCase().startsWith(sysPath.toLowerCase())
|
|
53608
53626
|
);
|
|
53609
53627
|
}
|
|
53610
53628
|
/**
|
|
@@ -55395,26 +55413,26 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55395
55413
|
const _lang = options2.language || "en";
|
|
55396
55414
|
const _labels = LANGUAGE_LABELS[_lang] || LANGUAGE_LABELS.en;
|
|
55397
55415
|
console.log("");
|
|
55398
|
-
console.log(
|
|
55416
|
+
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"));
|
|
55399
55417
|
console.log(
|
|
55400
|
-
|
|
55418
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
55401
55419
|
` ${_labels.approvalRequest}${" ".repeat(Math.max(0, 43 - _labels.approvalRequest.length))}`
|
|
55402
|
-
) +
|
|
55420
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55403
55421
|
);
|
|
55404
|
-
console.log(
|
|
55422
|
+
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"));
|
|
55405
55423
|
const _requestId = `AP-${(/* @__PURE__ */ new Date()).getFullYear()}-${String((/* @__PURE__ */ new Date()).getMonth() + 1).padStart(2, "0")}${String((/* @__PURE__ */ new Date()).getDate()).padStart(2, "0")}-${String(Math.floor(Math.random() * 999)).padStart(3, "0")}`;
|
|
55406
55424
|
console.log(
|
|
55407
|
-
|
|
55408
|
-
` > ${_labels.id}: ${
|
|
55409
|
-
) +
|
|
55425
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
55426
|
+
` > ${_labels.id}: ${chalk28__default.default.yellow(_requestId)}${" ".repeat(Math.max(0, 35 - _requestId.length - _labels.id.length))}`
|
|
55427
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55410
55428
|
);
|
|
55411
55429
|
const _title = _request.context?.description || _request.themeId || "API Cache Improvement";
|
|
55412
55430
|
const _titleDisplay = _title.length > 25 ? _title.substring(0, 22) + "..." : _title;
|
|
55413
55431
|
const _titleLabel = ` ${_labels._title}:`;
|
|
55414
55432
|
console.log(
|
|
55415
|
-
|
|
55433
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
55416
55434
|
`${_titleLabel} ${_titleDisplay}${" ".repeat(Math.max(0, 42 - _titleLabel.length - _titleDisplay.length))}`
|
|
55417
|
-
) +
|
|
55435
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55418
55436
|
);
|
|
55419
55437
|
const _riskLevel = this.formatRiskLevelSimple(_request.riskAssessment);
|
|
55420
55438
|
const _approvalsCount = _riskLevel === "HIGH" || _riskLevel === "CRITICAL" ? "2" : "1";
|
|
@@ -55422,37 +55440,37 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55422
55440
|
const _levelLabel = ` ${_labels.level}:`;
|
|
55423
55441
|
const _levelDisplay = `${_riskLevel} ${_approvalsText}`;
|
|
55424
55442
|
console.log(
|
|
55425
|
-
|
|
55443
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
55426
55444
|
`${_levelLabel} ${_levelDisplay}${" ".repeat(Math.max(0, 42 - _levelLabel.length - _levelDisplay.length))}`
|
|
55427
|
-
) +
|
|
55445
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55428
55446
|
);
|
|
55429
55447
|
const _impact = _request.estimatedTime || "p95 latency -20%";
|
|
55430
55448
|
const _impactLabel = ` ${_labels._impact}:`;
|
|
55431
55449
|
console.log(
|
|
55432
|
-
|
|
55450
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
55433
55451
|
`${_impactLabel} ${_impact}${" ".repeat(Math.max(0, 42 - _impactLabel.length - _impact.length))}`
|
|
55434
|
-
) +
|
|
55452
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55435
55453
|
);
|
|
55436
55454
|
const _approversLabel = ` ${_labels.approvers}:`;
|
|
55437
55455
|
const _approversStatus = "[x] Lead [ ] QA";
|
|
55438
55456
|
console.log(
|
|
55439
|
-
|
|
55457
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
55440
55458
|
`${_approversLabel} ${_approversStatus}${" ".repeat(Math.max(0, 42 - _approversLabel.length - _approversStatus.length))}`
|
|
55441
|
-
) +
|
|
55459
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55442
55460
|
);
|
|
55443
55461
|
const _deadline = new Date(Date.now() + 30 * 60 * 1e3);
|
|
55444
55462
|
const _timeStr = `${_deadline.getFullYear()}-${String(_deadline.getMonth() + 1).padStart(2, "0")}-${String(_deadline.getDate()).padStart(2, "0")} ${String(_deadline.getHours()).padStart(2, "0")}:${String(_deadline.getMinutes()).padStart(2, "0")}`;
|
|
55445
55463
|
const _deadlineLabel = ` ${_labels._deadline}:`;
|
|
55446
55464
|
console.log(
|
|
55447
|
-
|
|
55465
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
55448
55466
|
`${_deadlineLabel} ${_timeStr}${" ".repeat(Math.max(0, 42 - _deadlineLabel.length - _timeStr.length))}`
|
|
55449
|
-
) +
|
|
55467
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55450
55468
|
);
|
|
55451
|
-
console.log(
|
|
55469
|
+
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"));
|
|
55452
55470
|
console.log(
|
|
55453
|
-
|
|
55471
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
55454
55472
|
` ${_labels.actions}:${" ".repeat(Math.max(0, 42 - _labels.actions.length))}`
|
|
55455
|
-
) +
|
|
55473
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55456
55474
|
);
|
|
55457
55475
|
this.menuOptions.forEach((option, _index) => {
|
|
55458
55476
|
const _isSelected = _index === this.selectedIndex;
|
|
@@ -55463,32 +55481,32 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55463
55481
|
switch (option) {
|
|
55464
55482
|
case "approve":
|
|
55465
55483
|
label = _labels.approve;
|
|
55466
|
-
color =
|
|
55484
|
+
color = chalk28__default.default.green;
|
|
55467
55485
|
break;
|
|
55468
55486
|
case "reject":
|
|
55469
55487
|
label = _labels.reject;
|
|
55470
|
-
color =
|
|
55488
|
+
color = chalk28__default.default.red;
|
|
55471
55489
|
break;
|
|
55472
55490
|
case "cancel":
|
|
55473
55491
|
label = _labels.cancel;
|
|
55474
|
-
color =
|
|
55492
|
+
color = chalk28__default.default.yellow;
|
|
55475
55493
|
break;
|
|
55476
55494
|
}
|
|
55477
55495
|
const _optionText = `${_prefix}[${_key}] ${label}`;
|
|
55478
55496
|
const _colorFunc = _isSelected ? color.bold : color;
|
|
55479
55497
|
console.log(
|
|
55480
|
-
|
|
55498
|
+
chalk28__default.default.gray("\u2502") + _colorFunc(
|
|
55481
55499
|
`${_optionText}${" ".repeat(Math.max(0, 43 - _optionText.length))}`
|
|
55482
|
-
) +
|
|
55500
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55483
55501
|
);
|
|
55484
55502
|
});
|
|
55485
|
-
console.log(
|
|
55503
|
+
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"));
|
|
55486
55504
|
console.log(
|
|
55487
|
-
|
|
55505
|
+
chalk28__default.default.gray("\u2502") + chalk28__default.default.white(
|
|
55488
55506
|
` ${_labels.moveInstruction}${" ".repeat(Math.max(0, 43 - _labels.moveInstruction.length))}`
|
|
55489
|
-
) +
|
|
55507
|
+
) + chalk28__default.default.gray("\u2502")
|
|
55490
55508
|
);
|
|
55491
|
-
console.log(
|
|
55509
|
+
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"));
|
|
55492
55510
|
console.log("");
|
|
55493
55511
|
}
|
|
55494
55512
|
/**
|
|
@@ -55504,13 +55522,13 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55504
55522
|
};
|
|
55505
55523
|
const _formatted = keyMap[_key] || _key;
|
|
55506
55524
|
const colorMap = {
|
|
55507
|
-
"shift+tab":
|
|
55508
|
-
"ctrl+y":
|
|
55509
|
-
"ctrl+n":
|
|
55510
|
-
"ctrl+t":
|
|
55511
|
-
"ctrl+r":
|
|
55525
|
+
"shift+tab": chalk28__default.default.bgGreen.black.bold,
|
|
55526
|
+
"ctrl+y": chalk28__default.default.bgBlue.white.bold,
|
|
55527
|
+
"ctrl+n": chalk28__default.default.bgRed.white.bold,
|
|
55528
|
+
"ctrl+t": chalk28__default.default.bgMagenta.white.bold,
|
|
55529
|
+
"ctrl+r": chalk28__default.default.bgYellow.black.bold
|
|
55512
55530
|
};
|
|
55513
|
-
const _colorFunc = colorMap[_key] ||
|
|
55531
|
+
const _colorFunc = colorMap[_key] || chalk28__default.default.bgCyan.black.bold;
|
|
55514
55532
|
return _colorFunc(` ${_formatted} `);
|
|
55515
55533
|
}
|
|
55516
55534
|
/**
|
|
@@ -55519,15 +55537,15 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55519
55537
|
formatRiskLevel(risk) {
|
|
55520
55538
|
switch (risk.toLowerCase()) {
|
|
55521
55539
|
case "critical":
|
|
55522
|
-
return
|
|
55540
|
+
return chalk28__default.default.red.bold("CRITICAL");
|
|
55523
55541
|
case "high":
|
|
55524
|
-
return
|
|
55542
|
+
return chalk28__default.default.red("HIGH");
|
|
55525
55543
|
case "medium":
|
|
55526
|
-
return
|
|
55544
|
+
return chalk28__default.default.yellow("MEDIUM");
|
|
55527
55545
|
case "low":
|
|
55528
|
-
return
|
|
55546
|
+
return chalk28__default.default.green("LOW");
|
|
55529
55547
|
default:
|
|
55530
|
-
return
|
|
55548
|
+
return chalk28__default.default.white(risk);
|
|
55531
55549
|
}
|
|
55532
55550
|
}
|
|
55533
55551
|
/**
|
|
@@ -55597,7 +55615,7 @@ var init_QuickApprovalInterface = __esm({
|
|
|
55597
55615
|
}
|
|
55598
55616
|
if (_key === "") {
|
|
55599
55617
|
console.log(`
|
|
55600
|
-
${
|
|
55618
|
+
${chalk28__default.default.red("Approval cancelled by user")}`);
|
|
55601
55619
|
this.emit("approval-cancelled", this.currentRequest.id);
|
|
55602
55620
|
return;
|
|
55603
55621
|
}
|
|
@@ -55654,20 +55672,20 @@ ${chalk27__default.default.red("Approval cancelled by user")}`);
|
|
|
55654
55672
|
}
|
|
55655
55673
|
console.clear();
|
|
55656
55674
|
console.log(`
|
|
55657
|
-
${
|
|
55675
|
+
${chalk28__default.default.bgGreen.black.bold(`\u250C${"\u2500".repeat(78)}\u2510`)}`);
|
|
55658
55676
|
console.log(
|
|
55659
|
-
|
|
55677
|
+
chalk28__default.default.bgGreen.black.bold("\u2502") + chalk28__default.default.bgGreen.black.bold(
|
|
55660
55678
|
` \u2713 CHOICE SELECTED / \u9078\u629E\u5B8C\u4E86:${" ".repeat(47)}`
|
|
55661
|
-
) +
|
|
55679
|
+
) + chalk28__default.default.bgGreen.black.bold("\u2502")
|
|
55662
55680
|
);
|
|
55663
|
-
console.log(
|
|
55681
|
+
console.log(chalk28__default.default.bgGreen.black.bold(`\u251C${"\u2500".repeat(78)}\u2524`));
|
|
55664
55682
|
const _choiceText = `${_choice.label} (${_choice.labelJa})`;
|
|
55665
55683
|
const _padding = " ".repeat(Math.max(0, 76 - _choiceText.length));
|
|
55666
55684
|
console.log(
|
|
55667
|
-
|
|
55685
|
+
chalk28__default.default.bgGreen.black.bold("\u2502") + chalk28__default.default.bgGreen.black.bold(` ${_choiceText}${_padding}`) + chalk28__default.default.bgGreen.black.bold("\u2502")
|
|
55668
55686
|
);
|
|
55669
|
-
console.log(
|
|
55670
|
-
console.log(
|
|
55687
|
+
console.log(chalk28__default.default.bgGreen.black.bold(`\u2514${"\u2500".repeat(78)}\u2518`));
|
|
55688
|
+
console.log(chalk28__default.default.yellow("\n\u{1F504} Processing your approval decision..."));
|
|
55671
55689
|
try {
|
|
55672
55690
|
const _response = await this.approvalEngine.processApprovalResponse(
|
|
55673
55691
|
this.currentRequest.id,
|
|
@@ -55677,30 +55695,30 @@ ${chalk27__default.default.bgGreen.black.bold(`\u250C${"\u2500".repeat(78)}\u251
|
|
|
55677
55695
|
);
|
|
55678
55696
|
response.quickDecision = true;
|
|
55679
55697
|
console.log(`
|
|
55680
|
-
${
|
|
55698
|
+
${chalk28__default.default.bgGreen.black(`\u250C${"\u2500".repeat(78)}\u2510`)}`);
|
|
55681
55699
|
console.log(
|
|
55682
|
-
|
|
55700
|
+
chalk28__default.default.bgGreen.black("\u2502") + chalk28__default.default.bgGreen.black(
|
|
55683
55701
|
` \u{1F389} APPROVAL PROCESSED SUCCESSFULLY / \u627F\u8A8D\u51E6\u7406\u5B8C\u4E86!${" ".repeat(32)}`
|
|
55684
|
-
) +
|
|
55702
|
+
) + chalk28__default.default.bgGreen.black("\u2502")
|
|
55685
55703
|
);
|
|
55686
|
-
console.log(
|
|
55704
|
+
console.log(chalk28__default.default.bgGreen.black(`\u2514${"\u2500".repeat(78)}\u2518`));
|
|
55687
55705
|
if (_choice.trustLevel) {
|
|
55688
55706
|
console.log(
|
|
55689
|
-
|
|
55707
|
+
chalk28__default.default.blue(`
|
|
55690
55708
|
\u2728 Trust level updated: ${_choice.trustLevel}`)
|
|
55691
55709
|
);
|
|
55692
55710
|
}
|
|
55693
55711
|
this.emit("approval-_response", _response);
|
|
55694
55712
|
} catch (_error) {
|
|
55695
55713
|
console.log(`
|
|
55696
|
-
${
|
|
55714
|
+
${chalk28__default.default.bgRed.white.bold(`\u250C${"\u2500".repeat(78)}\u2510`)}`);
|
|
55697
55715
|
console.log(
|
|
55698
|
-
|
|
55716
|
+
chalk28__default.default.bgRed.white.bold("\u2502") + chalk28__default.default.bgRed.white.bold(
|
|
55699
55717
|
` \u274C ERROR PROCESSING APPROVAL / \u627F\u8A8D\u51E6\u7406\u30A8\u30E9\u30FC${" ".repeat(35)}`
|
|
55700
|
-
) +
|
|
55718
|
+
) + chalk28__default.default.bgRed.white.bold("\u2502")
|
|
55701
55719
|
);
|
|
55702
|
-
console.log(
|
|
55703
|
-
console._error(
|
|
55720
|
+
console.log(chalk28__default.default.bgRed.white.bold(`\u2514${"\u2500".repeat(78)}\u2518`));
|
|
55721
|
+
console._error(chalk28__default.default.red("\nError details:"), _error);
|
|
55704
55722
|
this.emit("approval-_error", _error);
|
|
55705
55723
|
}
|
|
55706
55724
|
}
|
|
@@ -55714,7 +55732,7 @@ ${chalk27__default.default.bgRed.white.bold(`\u250C${"\u2500".repeat(78)}\u2510`
|
|
|
55714
55732
|
timeoutId = setTimeout(() => {
|
|
55715
55733
|
console.log(
|
|
55716
55734
|
`
|
|
55717
|
-
${
|
|
55735
|
+
${chalk28__default.default.yellow("\u23F0 Approval request timed out - auto-approving...")}`
|
|
55718
55736
|
);
|
|
55719
55737
|
this.handleTimeoutResponse(resolve);
|
|
55720
55738
|
}, timeout);
|
|
@@ -55758,7 +55776,7 @@ ${chalk27__default.default.yellow("\u23F0 Approval request timed out - auto-appr
|
|
|
55758
55776
|
response.quickDecision = true;
|
|
55759
55777
|
resolve(_response);
|
|
55760
55778
|
} catch (_error) {
|
|
55761
|
-
console._error(
|
|
55779
|
+
console._error(chalk28__default.default.red("Error processing timeout approval:"), _error);
|
|
55762
55780
|
}
|
|
55763
55781
|
}
|
|
55764
55782
|
/**
|
|
@@ -55773,11 +55791,11 @@ ${chalk27__default.default.yellow("\u23F0 Approval request timed out - auto-appr
|
|
|
55773
55791
|
);
|
|
55774
55792
|
this.approvalEngine.on("trust-level-changed", (event) => {
|
|
55775
55793
|
console.log(
|
|
55776
|
-
|
|
55794
|
+
chalk28__default.default.blue(
|
|
55777
55795
|
`\u2728 Trust level changed: ${event.oldLevel} \u2192 ${event.newLevel}`
|
|
55778
55796
|
)
|
|
55779
55797
|
);
|
|
55780
|
-
console.log(
|
|
55798
|
+
console.log(chalk28__default.default.gray(`Reason: ${event.reason}`));
|
|
55781
55799
|
});
|
|
55782
55800
|
}
|
|
55783
55801
|
/**
|
|
@@ -56564,22 +56582,22 @@ function formatProgressBar(current, total, width = 20) {
|
|
|
56564
56582
|
}
|
|
56565
56583
|
function formatError2(message, code) {
|
|
56566
56584
|
const prefix = "";
|
|
56567
|
-
return
|
|
56585
|
+
return chalk28__default.default.red(`\u274C ${prefix}${message}`);
|
|
56568
56586
|
}
|
|
56569
56587
|
function formatSuccess(message) {
|
|
56570
|
-
return
|
|
56588
|
+
return chalk28__default.default.green(`\u2705 ${message}`);
|
|
56571
56589
|
}
|
|
56572
56590
|
function formatWarning(message) {
|
|
56573
|
-
return
|
|
56591
|
+
return chalk28__default.default.yellow(`\u26A0\uFE0F ${message}`);
|
|
56574
56592
|
}
|
|
56575
56593
|
function formatInfo(message) {
|
|
56576
|
-
return
|
|
56594
|
+
return chalk28__default.default.blue(`\u2139\uFE0F ${message}`);
|
|
56577
56595
|
}
|
|
56578
56596
|
function formatTable(headers, rows, options2 = {}) {
|
|
56579
56597
|
const {
|
|
56580
56598
|
columnWidths = headers.map(() => 20),
|
|
56581
56599
|
separator = " | ",
|
|
56582
|
-
headerColor =
|
|
56600
|
+
headerColor = chalk28__default.default.cyan.bold
|
|
56583
56601
|
} = options2;
|
|
56584
56602
|
const headerRow = headers.map((h2, i2) => headerColor(h2.padEnd(columnWidths[i2]))).join(separator);
|
|
56585
56603
|
const separatorLine = columnWidths.map((w) => "-".repeat(w)).join(separator);
|
|
@@ -56591,8 +56609,8 @@ function formatTable(headers, rows, options2 = {}) {
|
|
|
56591
56609
|
function formatKeyValue(data2, options2 = {}) {
|
|
56592
56610
|
const {
|
|
56593
56611
|
keyWidth = 20,
|
|
56594
|
-
keyColor =
|
|
56595
|
-
valueColor =
|
|
56612
|
+
keyColor = chalk28__default.default.gray,
|
|
56613
|
+
valueColor = chalk28__default.default.white,
|
|
56596
56614
|
separator = ": "
|
|
56597
56615
|
} = options2;
|
|
56598
56616
|
return Object.entries(data2).map(([key2, value]) => {
|
|
@@ -56642,7 +56660,7 @@ var init_DisplayManager = __esm({
|
|
|
56642
56660
|
theme: options2.theme ?? "auto"
|
|
56643
56661
|
};
|
|
56644
56662
|
if (!this.options.enableColors) {
|
|
56645
|
-
|
|
56663
|
+
chalk28__default.default.level = 0;
|
|
56646
56664
|
}
|
|
56647
56665
|
this.setupCleanupHandlers();
|
|
56648
56666
|
}
|
|
@@ -56759,7 +56777,7 @@ var init_DisplayManager = __esm({
|
|
|
56759
56777
|
const {
|
|
56760
56778
|
padding = 1,
|
|
56761
56779
|
borderStyle = "single",
|
|
56762
|
-
borderColor =
|
|
56780
|
+
borderColor = chalk28__default.default.gray
|
|
56763
56781
|
} = options2;
|
|
56764
56782
|
const lines = content2.split("\n");
|
|
56765
56783
|
const maxLength = Math.max(...lines.map((l) => l.length));
|
|
@@ -56817,7 +56835,7 @@ var init_DisplayManager = __esm({
|
|
|
56817
56835
|
*/
|
|
56818
56836
|
startSpinner(text) {
|
|
56819
56837
|
if (!this.options.enableAnimations) {
|
|
56820
|
-
this.writeLine(
|
|
56838
|
+
this.writeLine(chalk28__default.default.gray(`\u2299 ${text || "Processing..."}`));
|
|
56821
56839
|
return "no-animation";
|
|
56822
56840
|
}
|
|
56823
56841
|
return this.spinnerManager.start({ text });
|
|
@@ -56921,11 +56939,11 @@ var init_StatusDisplay = __esm({
|
|
|
56921
56939
|
*/
|
|
56922
56940
|
static renderSystemStatus(status, detailed = false) {
|
|
56923
56941
|
const lines = [];
|
|
56924
|
-
lines.push(
|
|
56942
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F4CA} System Status"));
|
|
56925
56943
|
lines.push("");
|
|
56926
56944
|
const statusIcon = status.operational ? "\u2705" : "\u274C";
|
|
56927
56945
|
const statusText = status.operational ? "Operational" : "Issues Detected";
|
|
56928
|
-
const statusColor = status.operational ?
|
|
56946
|
+
const statusColor = status.operational ? chalk28__default.default.green : chalk28__default.default.red;
|
|
56929
56947
|
lines.push(`${statusIcon} Status: ${statusColor(statusText)}`);
|
|
56930
56948
|
lines.push(
|
|
56931
56949
|
`\u23F1\uFE0F Uptime: ${formatDuration(status.uptime * 1e3)}`
|
|
@@ -56946,15 +56964,15 @@ var init_StatusDisplay = __esm({
|
|
|
56946
56964
|
if (status.errors > 0 || status.warnings > 0) {
|
|
56947
56965
|
lines.push("");
|
|
56948
56966
|
if (status.errors > 0) {
|
|
56949
|
-
lines.push(
|
|
56967
|
+
lines.push(chalk28__default.default.red(`\u274C Errors: ${status.errors}`));
|
|
56950
56968
|
}
|
|
56951
56969
|
if (status.warnings > 0) {
|
|
56952
|
-
lines.push(
|
|
56970
|
+
lines.push(chalk28__default.default.yellow(`\u26A0\uFE0F Warnings: ${status.warnings}`));
|
|
56953
56971
|
}
|
|
56954
56972
|
}
|
|
56955
56973
|
if (detailed) {
|
|
56956
56974
|
lines.push("");
|
|
56957
|
-
lines.push(
|
|
56975
|
+
lines.push(chalk28__default.default.gray("Detailed Information:"));
|
|
56958
56976
|
const details = formatKeyValue(
|
|
56959
56977
|
{
|
|
56960
56978
|
"Process ID": process.pid,
|
|
@@ -56964,8 +56982,8 @@ var init_StatusDisplay = __esm({
|
|
|
56964
56982
|
"Working Directory": process.cwd()
|
|
56965
56983
|
},
|
|
56966
56984
|
{
|
|
56967
|
-
keyColor:
|
|
56968
|
-
valueColor:
|
|
56985
|
+
keyColor: chalk28__default.default.gray,
|
|
56986
|
+
valueColor: chalk28__default.default.white
|
|
56969
56987
|
}
|
|
56970
56988
|
);
|
|
56971
56989
|
lines.push(details);
|
|
@@ -56979,9 +56997,9 @@ var init_StatusDisplay = __esm({
|
|
|
56979
56997
|
*/
|
|
56980
56998
|
static renderMemoryStatus(status) {
|
|
56981
56999
|
const lines = [];
|
|
56982
|
-
lines.push(
|
|
57000
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F9E0} Memory Status"));
|
|
56983
57001
|
lines.push("");
|
|
56984
|
-
lines.push(
|
|
57002
|
+
lines.push(chalk28__default.default.yellow("System 1 (Fast):"));
|
|
56985
57003
|
const s1NodeBar = formatProgressBar(
|
|
56986
57004
|
status.system1.nodes,
|
|
56987
57005
|
status.system1.maxNodes,
|
|
@@ -56999,7 +57017,7 @@ var init_StatusDisplay = __esm({
|
|
|
56999
57017
|
` \u2022 Tokens: ${status.system1.tokens}/${status.system1.maxTokens} ${s1TokenBar}`
|
|
57000
57018
|
);
|
|
57001
57019
|
lines.push("");
|
|
57002
|
-
lines.push(
|
|
57020
|
+
lines.push(chalk28__default.default.blue("System 2 (Deep):"));
|
|
57003
57021
|
const s2TraceBar = formatProgressBar(
|
|
57004
57022
|
status.system2.traces,
|
|
57005
57023
|
status.system2.maxTraces,
|
|
@@ -57017,7 +57035,7 @@ var init_StatusDisplay = __esm({
|
|
|
57017
57035
|
` \u2022 Tokens: ${status.system2.tokens}/${status.system2.maxTokens} ${s2TokenBar}`
|
|
57018
57036
|
);
|
|
57019
57037
|
lines.push("");
|
|
57020
|
-
lines.push(
|
|
57038
|
+
lines.push(chalk28__default.default.green("Total:"));
|
|
57021
57039
|
const totalBar = formatProgressBar(
|
|
57022
57040
|
status.total.tokens,
|
|
57023
57041
|
status.total.maxTokens,
|
|
@@ -57026,7 +57044,7 @@ var init_StatusDisplay = __esm({
|
|
|
57026
57044
|
lines.push(` \u2022 Tokens: ${status.total.tokens}/${status.total.maxTokens}`);
|
|
57027
57045
|
lines.push(` \u2022 Usage: ${totalBar}`);
|
|
57028
57046
|
const usage = status.total.tokens / status.total.maxTokens * 100;
|
|
57029
|
-
const usageColor = usage > 80 ?
|
|
57047
|
+
const usageColor = usage > 80 ? chalk28__default.default.red : usage > 60 ? chalk28__default.default.yellow : chalk28__default.default.green;
|
|
57030
57048
|
lines.push(
|
|
57031
57049
|
` \u2022 ${usageColor(formatPercentage(usage / 100, 1))} utilized`
|
|
57032
57050
|
);
|
|
@@ -57039,9 +57057,9 @@ var init_StatusDisplay = __esm({
|
|
|
57039
57057
|
*/
|
|
57040
57058
|
static renderModelStatus(status) {
|
|
57041
57059
|
const lines = [];
|
|
57042
|
-
lines.push(
|
|
57060
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F916} Model Status"));
|
|
57043
57061
|
lines.push("");
|
|
57044
|
-
lines.push(
|
|
57062
|
+
lines.push(chalk28__default.default.green(`Current: ${chalk28__default.default.bold(status.current)}`));
|
|
57045
57063
|
lines.push("");
|
|
57046
57064
|
lines.push("Available Models:");
|
|
57047
57065
|
const headers = ["Model", "Provider", "Status", "Capabilities"];
|
|
@@ -57053,7 +57071,7 @@ var init_StatusDisplay = __esm({
|
|
|
57053
57071
|
const table = formatTable(headers, rows, {
|
|
57054
57072
|
columnWidths: [20, 15, 8, 30],
|
|
57055
57073
|
separator: " \u2502 ",
|
|
57056
|
-
headerColor:
|
|
57074
|
+
headerColor: chalk28__default.default.gray
|
|
57057
57075
|
});
|
|
57058
57076
|
lines.push(table);
|
|
57059
57077
|
return lines.join("\n");
|
|
@@ -57065,19 +57083,19 @@ var init_StatusDisplay = __esm({
|
|
|
57065
57083
|
*/
|
|
57066
57084
|
static renderHealthChecks(checks) {
|
|
57067
57085
|
const lines = [];
|
|
57068
|
-
lines.push(
|
|
57086
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F3E5} Health Checks"));
|
|
57069
57087
|
lines.push("");
|
|
57070
57088
|
for (const check of checks) {
|
|
57071
57089
|
const icon = check.status === "ok" ? "\u2705" : check.status === "warning" ? "\u26A0\uFE0F" : "\u274C";
|
|
57072
|
-
const statusColor = check.status === "ok" ?
|
|
57090
|
+
const statusColor = check.status === "ok" ? chalk28__default.default.green : check.status === "warning" ? chalk28__default.default.yellow : chalk28__default.default.red;
|
|
57073
57091
|
let line = `${icon} ${check.name.padEnd(25)} ${statusColor(check.status.toUpperCase())}`;
|
|
57074
57092
|
if (check.latency !== void 0) {
|
|
57075
|
-
const latencyColor = check.latency < 100 ?
|
|
57093
|
+
const latencyColor = check.latency < 100 ? chalk28__default.default.green : check.latency < 500 ? chalk28__default.default.yellow : chalk28__default.default.red;
|
|
57076
57094
|
line += ` ${latencyColor(`(${check.latency}ms)`)}`;
|
|
57077
57095
|
}
|
|
57078
57096
|
lines.push(line);
|
|
57079
57097
|
if (check.message) {
|
|
57080
|
-
lines.push(
|
|
57098
|
+
lines.push(chalk28__default.default.gray(` ${check.message}`));
|
|
57081
57099
|
}
|
|
57082
57100
|
}
|
|
57083
57101
|
lines.push("");
|
|
@@ -57086,16 +57104,16 @@ var init_StatusDisplay = __esm({
|
|
|
57086
57104
|
const errorCount = checks.filter((c) => c.status === "error").length;
|
|
57087
57105
|
if (errorCount > 0) {
|
|
57088
57106
|
lines.push(
|
|
57089
|
-
|
|
57107
|
+
chalk28__default.default.red(
|
|
57090
57108
|
`\u26A0\uFE0F System has ${errorCount} error(s) - intervention required`
|
|
57091
57109
|
)
|
|
57092
57110
|
);
|
|
57093
57111
|
} else if (warningCount > 0) {
|
|
57094
57112
|
lines.push(
|
|
57095
|
-
|
|
57113
|
+
chalk28__default.default.yellow(`\u26A0\uFE0F System operational with ${warningCount} warning(s)`)
|
|
57096
57114
|
);
|
|
57097
57115
|
} else {
|
|
57098
|
-
lines.push(
|
|
57116
|
+
lines.push(chalk28__default.default.green("\u2705 All systems operational"));
|
|
57099
57117
|
}
|
|
57100
57118
|
return lines.join("\n");
|
|
57101
57119
|
}
|
|
@@ -57106,7 +57124,7 @@ var init_StatusDisplay = __esm({
|
|
|
57106
57124
|
*/
|
|
57107
57125
|
static renderSessionStats(stats) {
|
|
57108
57126
|
const lines = [];
|
|
57109
|
-
lines.push(
|
|
57127
|
+
lines.push(chalk28__default.default.cyan.bold("\u{1F4C8} Session Statistics"));
|
|
57110
57128
|
lines.push("");
|
|
57111
57129
|
const data2 = formatKeyValue(
|
|
57112
57130
|
{
|
|
@@ -57119,14 +57137,14 @@ var init_StatusDisplay = __esm({
|
|
|
57119
57137
|
},
|
|
57120
57138
|
{
|
|
57121
57139
|
keyWidth: 20,
|
|
57122
|
-
keyColor:
|
|
57123
|
-
valueColor:
|
|
57140
|
+
keyColor: chalk28__default.default.gray,
|
|
57141
|
+
valueColor: chalk28__default.default.white
|
|
57124
57142
|
}
|
|
57125
57143
|
);
|
|
57126
57144
|
lines.push(data2);
|
|
57127
57145
|
lines.push("");
|
|
57128
57146
|
const performance3 = stats.avgResponseTime < 100 ? "Excellent" : stats.avgResponseTime < 500 ? "Good" : stats.avgResponseTime < 1e3 ? "Fair" : "Poor";
|
|
57129
|
-
const perfColor = performance3 === "Excellent" ?
|
|
57147
|
+
const perfColor = performance3 === "Excellent" ? chalk28__default.default.green : performance3 === "Good" ? chalk28__default.default.blue : performance3 === "Fair" ? chalk28__default.default.yellow : chalk28__default.default.red;
|
|
57130
57148
|
lines.push(`Performance: ${perfColor(performance3)}`);
|
|
57131
57149
|
return lines.join("\n");
|
|
57132
57150
|
}
|
|
@@ -57138,22 +57156,22 @@ var init_StatusDisplay = __esm({
|
|
|
57138
57156
|
static renderStatusBar(data2) {
|
|
57139
57157
|
const segments = [];
|
|
57140
57158
|
if (data2.mode) {
|
|
57141
|
-
segments.push(
|
|
57159
|
+
segments.push(chalk28__default.default.cyan(`[${data2.mode}]`));
|
|
57142
57160
|
}
|
|
57143
57161
|
if (data2.model) {
|
|
57144
|
-
segments.push(
|
|
57162
|
+
segments.push(chalk28__default.default.blue(`\u{1F916} ${data2.model}`));
|
|
57145
57163
|
}
|
|
57146
57164
|
if (data2.memory !== void 0) {
|
|
57147
|
-
const memoryColor = data2.memory > 80 ?
|
|
57165
|
+
const memoryColor = data2.memory > 80 ? chalk28__default.default.red : data2.memory > 60 ? chalk28__default.default.yellow : chalk28__default.default.green;
|
|
57148
57166
|
segments.push(memoryColor(`\u{1F4BE} ${data2.memory}%`));
|
|
57149
57167
|
}
|
|
57150
57168
|
if (data2.latency !== void 0) {
|
|
57151
|
-
const latencyColor = data2.latency < 100 ?
|
|
57169
|
+
const latencyColor = data2.latency < 100 ? chalk28__default.default.green : data2.latency < 500 ? chalk28__default.default.yellow : chalk28__default.default.red;
|
|
57152
57170
|
segments.push(latencyColor(`\u26A1 ${data2.latency}ms`));
|
|
57153
57171
|
}
|
|
57154
57172
|
if (data2.time) {
|
|
57155
57173
|
segments.push(
|
|
57156
|
-
|
|
57174
|
+
chalk28__default.default.gray(formatTimestamp(data2.time, "short"))
|
|
57157
57175
|
);
|
|
57158
57176
|
}
|
|
57159
57177
|
return segments.join(" \u2502 ");
|
|
@@ -57172,7 +57190,7 @@ var init_CoreHandlers = __esm({
|
|
|
57172
57190
|
async execute(args2) {
|
|
57173
57191
|
const startTime = perf_hooks.performance.now();
|
|
57174
57192
|
const commands = this.registry.getCommands();
|
|
57175
|
-
let message =
|
|
57193
|
+
let message = chalk28__default.default.cyan(`\u{1F916} MARIA v3.5.0 - Available Commands
|
|
57176
57194
|
|
|
57177
57195
|
`);
|
|
57178
57196
|
const categories2 = {
|
|
@@ -57183,17 +57201,17 @@ var init_CoreHandlers = __esm({
|
|
|
57183
57201
|
system: ["/status", "/config", "/logs", "/approve"]
|
|
57184
57202
|
};
|
|
57185
57203
|
for (const [category, cmds] of Object.entries(categories2)) {
|
|
57186
|
-
message +=
|
|
57204
|
+
message += chalk28__default.default.yellow(`
|
|
57187
57205
|
${category.toUpperCase()}:
|
|
57188
57206
|
`);
|
|
57189
57207
|
for (const cmd of cmds) {
|
|
57190
57208
|
if (commands.includes(cmd)) {
|
|
57191
|
-
message += ` ${
|
|
57209
|
+
message += ` ${chalk28__default.default.green(cmd.padEnd(15))} - ${this.getCommandDescription(cmd)}
|
|
57192
57210
|
`;
|
|
57193
57211
|
}
|
|
57194
57212
|
}
|
|
57195
57213
|
}
|
|
57196
|
-
message +=
|
|
57214
|
+
message += chalk28__default.default.gray(
|
|
57197
57215
|
`
|
|
57198
57216
|
Type '/help <command>' for detailed information about a specific command.`
|
|
57199
57217
|
);
|
|
@@ -57241,7 +57259,7 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
57241
57259
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
57242
57260
|
return {
|
|
57243
57261
|
success: true,
|
|
57244
|
-
message:
|
|
57262
|
+
message: chalk28__default.default.gray("Terminal cleared."),
|
|
57245
57263
|
metadata: {
|
|
57246
57264
|
processingTime,
|
|
57247
57265
|
timestamp: /* @__PURE__ */ new Date()
|
|
@@ -57252,7 +57270,7 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
57252
57270
|
ExitHandler = class {
|
|
57253
57271
|
async execute(args2) {
|
|
57254
57272
|
const startTime = perf_hooks.performance.now();
|
|
57255
|
-
const message =
|
|
57273
|
+
const message = chalk28__default.default.yellow("\u{1F44B} Goodbye! Thank you for using MARIA.\n");
|
|
57256
57274
|
process.emit("SIGTERM");
|
|
57257
57275
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
57258
57276
|
return {
|
|
@@ -57276,23 +57294,23 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
57276
57294
|
platform: process.platform,
|
|
57277
57295
|
arch: process.arch
|
|
57278
57296
|
};
|
|
57279
|
-
let message =
|
|
57280
|
-
message +=
|
|
57297
|
+
let message = chalk28__default.default.cyan("\u{1F680} MARIA System Information\n\n");
|
|
57298
|
+
message += chalk28__default.default.white(` Version: ${chalk28__default.default.green(packageInfo.version)}
|
|
57281
57299
|
`);
|
|
57282
|
-
message +=
|
|
57300
|
+
message += chalk28__default.default.white(` Package: ${chalk28__default.default.green(packageInfo.name)}
|
|
57283
57301
|
`);
|
|
57284
|
-
message +=
|
|
57302
|
+
message += chalk28__default.default.white(` Node: ${chalk28__default.default.green(packageInfo.node)}
|
|
57285
57303
|
`);
|
|
57286
|
-
message +=
|
|
57287
|
-
` Platform: ${
|
|
57304
|
+
message += chalk28__default.default.white(
|
|
57305
|
+
` Platform: ${chalk28__default.default.green(packageInfo.platform)}
|
|
57288
57306
|
`
|
|
57289
57307
|
);
|
|
57290
|
-
message +=
|
|
57308
|
+
message += chalk28__default.default.white(` Arch: ${chalk28__default.default.green(packageInfo.arch)}
|
|
57291
57309
|
`);
|
|
57292
|
-
message +=
|
|
57310
|
+
message += chalk28__default.default.gray(`
|
|
57293
57311
|
Build: Production
|
|
57294
57312
|
`);
|
|
57295
|
-
message +=
|
|
57313
|
+
message += chalk28__default.default.gray(` License: MIT
|
|
57296
57314
|
`);
|
|
57297
57315
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
57298
57316
|
return {
|
|
@@ -57317,15 +57335,15 @@ Type '/help <command>' for detailed information about a specific command.`
|
|
|
57317
57335
|
this.history.push("/history");
|
|
57318
57336
|
}
|
|
57319
57337
|
const recent = this.history.slice(-limit);
|
|
57320
|
-
let message =
|
|
57338
|
+
let message = chalk28__default.default.cyan(`\u{1F4DC} Command History (last ${recent.length}):
|
|
57321
57339
|
|
|
57322
57340
|
`);
|
|
57323
57341
|
recent.forEach((cmd, index2) => {
|
|
57324
57342
|
const num = this.history.length - recent.length + index2 + 1;
|
|
57325
|
-
message +=
|
|
57343
|
+
message += chalk28__default.default.gray(` ${num.toString().padStart(3)}: `) + chalk28__default.default.white(cmd) + "\n";
|
|
57326
57344
|
});
|
|
57327
57345
|
if (recent.length === 0) {
|
|
57328
|
-
message =
|
|
57346
|
+
message = chalk28__default.default.gray("No command history available.");
|
|
57329
57347
|
}
|
|
57330
57348
|
const processingTime = perf_hooks.performance.now() - startTime;
|
|
57331
57349
|
return {
|
|
@@ -57371,13 +57389,13 @@ var init_DevHandlers = __esm({
|
|
|
57371
57389
|
if (!prompt) {
|
|
57372
57390
|
return {
|
|
57373
57391
|
ok: false,
|
|
57374
|
-
message:
|
|
57392
|
+
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")
|
|
57375
57393
|
};
|
|
57376
57394
|
}
|
|
57377
57395
|
if (signal?.aborted) {
|
|
57378
57396
|
return {
|
|
57379
57397
|
ok: false,
|
|
57380
|
-
message:
|
|
57398
|
+
message: chalk28__default.default.yellow("Code generation canceled")
|
|
57381
57399
|
};
|
|
57382
57400
|
}
|
|
57383
57401
|
try {
|
|
@@ -57388,9 +57406,9 @@ var init_DevHandlers = __esm({
|
|
|
57388
57406
|
if (dryRun) {
|
|
57389
57407
|
return {
|
|
57390
57408
|
ok: true,
|
|
57391
|
-
message:
|
|
57392
|
-
`) +
|
|
57393
|
-
`) +
|
|
57409
|
+
message: chalk28__default.default.cyan("\u{1F50D} Dry run mode - would generate:\n") + chalk28__default.default.gray(`Language: ${language}
|
|
57410
|
+
`) + chalk28__default.default.gray(`Framework: ${framework || "none"}
|
|
57411
|
+
`) + chalk28__default.default.gray(`Prompt: ${cleanPrompt}`)
|
|
57394
57412
|
};
|
|
57395
57413
|
}
|
|
57396
57414
|
const generatedCode = `// Generated code for: ${cleanPrompt}
|
|
@@ -57402,7 +57420,7 @@ function generated() {
|
|
|
57402
57420
|
export { generated };`;
|
|
57403
57421
|
return {
|
|
57404
57422
|
ok: true,
|
|
57405
|
-
message:
|
|
57423
|
+
message: chalk28__default.default.green("\u2705 Code generated successfully:\n\n") + chalk28__default.default.gray("```" + language + "\n") + generatedCode + chalk28__default.default.gray("\n```"),
|
|
57406
57424
|
data: {
|
|
57407
57425
|
code: generatedCode,
|
|
57408
57426
|
language,
|
|
@@ -57415,7 +57433,7 @@ export { generated };`;
|
|
|
57415
57433
|
} catch (error2) {
|
|
57416
57434
|
return {
|
|
57417
57435
|
ok: false,
|
|
57418
|
-
message:
|
|
57436
|
+
message: chalk28__default.default.red(`Code generation failed: ${error2}`)
|
|
57419
57437
|
};
|
|
57420
57438
|
}
|
|
57421
57439
|
}
|
|
@@ -57429,7 +57447,7 @@ export { generated };`;
|
|
|
57429
57447
|
if (signal?.aborted) {
|
|
57430
57448
|
return {
|
|
57431
57449
|
ok: false,
|
|
57432
|
-
message:
|
|
57450
|
+
message: chalk28__default.default.yellow("Test operation canceled")
|
|
57433
57451
|
};
|
|
57434
57452
|
}
|
|
57435
57453
|
const subcommand = args2[0] || "run";
|
|
@@ -57445,8 +57463,8 @@ export { generated };`;
|
|
|
57445
57463
|
default:
|
|
57446
57464
|
return {
|
|
57447
57465
|
ok: false,
|
|
57448
|
-
message:
|
|
57449
|
-
`) +
|
|
57466
|
+
message: chalk28__default.default.red(`Unknown test subcommand: ${subcommand}
|
|
57467
|
+
`) + chalk28__default.default.gray("Available: generate, run, coverage")
|
|
57450
57468
|
};
|
|
57451
57469
|
}
|
|
57452
57470
|
}
|
|
@@ -57454,7 +57472,7 @@ export { generated };`;
|
|
|
57454
57472
|
if (!target) {
|
|
57455
57473
|
return {
|
|
57456
57474
|
ok: false,
|
|
57457
|
-
message:
|
|
57475
|
+
message: chalk28__default.default.red(
|
|
57458
57476
|
"Please specify a file or function to generate tests for"
|
|
57459
57477
|
)
|
|
57460
57478
|
};
|
|
@@ -57471,9 +57489,9 @@ describe("${target}", () => {
|
|
|
57471
57489
|
});`;
|
|
57472
57490
|
return {
|
|
57473
57491
|
ok: true,
|
|
57474
|
-
message:
|
|
57492
|
+
message: chalk28__default.default.green(`\u2705 Tests generated for ${target}:
|
|
57475
57493
|
|
|
57476
|
-
`) +
|
|
57494
|
+
`) + chalk28__default.default.gray("```typescript\n") + testCode + chalk28__default.default.gray("\n```"),
|
|
57477
57495
|
data: { testCode, framework, target }
|
|
57478
57496
|
};
|
|
57479
57497
|
}
|
|
@@ -57486,23 +57504,23 @@ describe("${target}", () => {
|
|
|
57486
57504
|
if (coverage) command += " --coverage";
|
|
57487
57505
|
return {
|
|
57488
57506
|
ok: true,
|
|
57489
|
-
message:
|
|
57490
|
-
`) +
|
|
57507
|
+
message: chalk28__default.default.cyan(`\u{1F9EA} Running tests...
|
|
57508
|
+
`) + chalk28__default.default.gray(`Command: ${command}
|
|
57491
57509
|
|
|
57492
|
-
`) +
|
|
57510
|
+
`) + chalk28__default.default.green("\u2705 All tests passed!"),
|
|
57493
57511
|
data: { command, passed: true }
|
|
57494
57512
|
};
|
|
57495
57513
|
}
|
|
57496
57514
|
async showCoverage(options2) {
|
|
57497
57515
|
return {
|
|
57498
57516
|
ok: true,
|
|
57499
|
-
message:
|
|
57517
|
+
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(
|
|
57500
57518
|
"SessionStateMachine.ts".padEnd(40) + "100.00".padEnd(10) + "100.00\n"
|
|
57501
|
-
) +
|
|
57519
|
+
) + chalk28__default.default.green(
|
|
57502
57520
|
"InputController.ts".padEnd(40) + "95.50".padEnd(10) + "94.20\n"
|
|
57503
|
-
) +
|
|
57521
|
+
) + chalk28__default.default.yellow(
|
|
57504
57522
|
"SessionManager.ts".padEnd(40) + "78.30".padEnd(10) + "76.50\n"
|
|
57505
|
-
) +
|
|
57523
|
+
) + chalk28__default.default.gray("-".repeat(60) + "\n") + chalk28__default.default.cyan("Total".padEnd(40) + "85.60".padEnd(10) + "84.30")
|
|
57506
57524
|
};
|
|
57507
57525
|
}
|
|
57508
57526
|
};
|
|
@@ -57516,33 +57534,33 @@ describe("${target}", () => {
|
|
|
57516
57534
|
if (!file) {
|
|
57517
57535
|
return {
|
|
57518
57536
|
ok: false,
|
|
57519
|
-
message:
|
|
57537
|
+
message: chalk28__default.default.red("Please specify a file to review\n") + chalk28__default.default.gray("Usage: /review <file> [--security] [--performance]")
|
|
57520
57538
|
};
|
|
57521
57539
|
}
|
|
57522
57540
|
const checkSecurity = args2.includes("--security");
|
|
57523
57541
|
const checkPerformance = args2.includes("--performance");
|
|
57524
|
-
let message =
|
|
57542
|
+
let message = chalk28__default.default.cyan(`\u{1F50D} Code Review for ${file}
|
|
57525
57543
|
|
|
57526
57544
|
`);
|
|
57527
|
-
message +=
|
|
57528
|
-
message +=
|
|
57529
|
-
message +=
|
|
57530
|
-
message +=
|
|
57545
|
+
message += chalk28__default.default.yellow("\u26A0\uFE0F Issues Found (3):\n");
|
|
57546
|
+
message += chalk28__default.default.gray(" 1. Line 42: ") + chalk28__default.default.yellow("Missing error handling in async function\n");
|
|
57547
|
+
message += chalk28__default.default.gray(" 2. Line 89: ") + chalk28__default.default.yellow("Potential memory leak - event listener not removed\n");
|
|
57548
|
+
message += chalk28__default.default.gray(" 3. Line 156: ") + chalk28__default.default.yellow(
|
|
57531
57549
|
"Complex function - consider refactoring (cyclomatic complexity: 12)\n\n"
|
|
57532
57550
|
);
|
|
57533
57551
|
if (checkSecurity) {
|
|
57534
|
-
message +=
|
|
57535
|
-
message +=
|
|
57552
|
+
message += chalk28__default.default.red("\u{1F512} Security Issues (1):\n");
|
|
57553
|
+
message += chalk28__default.default.gray(" 1. Line 67: ") + chalk28__default.default.red("Potential XSS vulnerability - user input not sanitized\n\n");
|
|
57536
57554
|
}
|
|
57537
57555
|
if (checkPerformance) {
|
|
57538
|
-
message +=
|
|
57539
|
-
message +=
|
|
57540
|
-
message +=
|
|
57541
|
-
}
|
|
57542
|
-
message +=
|
|
57543
|
-
message +=
|
|
57544
|
-
message +=
|
|
57545
|
-
message +=
|
|
57556
|
+
message += chalk28__default.default.blue("\u26A1 Performance Suggestions (2):\n");
|
|
57557
|
+
message += chalk28__default.default.gray(" 1. Line 23: ") + chalk28__default.default.blue("Consider memoization for expensive calculation\n");
|
|
57558
|
+
message += chalk28__default.default.gray(" 2. Line 145: ") + chalk28__default.default.blue("Use virtualization for large list rendering\n\n");
|
|
57559
|
+
}
|
|
57560
|
+
message += chalk28__default.default.green("\u2705 Positive Findings:\n");
|
|
57561
|
+
message += chalk28__default.default.gray(" \u2022 Good TypeScript type coverage (92%)\n");
|
|
57562
|
+
message += chalk28__default.default.gray(" \u2022 Consistent code style\n");
|
|
57563
|
+
message += chalk28__default.default.gray(" \u2022 Well-documented functions\n");
|
|
57546
57564
|
return {
|
|
57547
57565
|
ok: true,
|
|
57548
57566
|
message,
|
|
@@ -57572,8 +57590,8 @@ describe("${target}", () => {
|
|
|
57572
57590
|
default:
|
|
57573
57591
|
return {
|
|
57574
57592
|
ok: false,
|
|
57575
|
-
message:
|
|
57576
|
-
`) +
|
|
57593
|
+
message: chalk28__default.default.red(`Unknown bug subcommand: ${subcommand}
|
|
57594
|
+
`) + chalk28__default.default.gray("Available: report, list, analyze")
|
|
57577
57595
|
};
|
|
57578
57596
|
}
|
|
57579
57597
|
}
|
|
@@ -57582,18 +57600,18 @@ describe("${target}", () => {
|
|
|
57582
57600
|
if (!description) {
|
|
57583
57601
|
return {
|
|
57584
57602
|
ok: false,
|
|
57585
|
-
message:
|
|
57603
|
+
message: chalk28__default.default.red("Please provide a bug description")
|
|
57586
57604
|
};
|
|
57587
57605
|
}
|
|
57588
57606
|
const bugId = `BUG-${Date.now().toString(36).toUpperCase()}`;
|
|
57589
57607
|
return {
|
|
57590
57608
|
ok: true,
|
|
57591
|
-
message:
|
|
57609
|
+
message: chalk28__default.default.green(`\u{1F41B} Bug reported successfully!
|
|
57592
57610
|
|
|
57593
|
-
`) +
|
|
57594
|
-
`) +
|
|
57595
|
-
`) +
|
|
57596
|
-
`) +
|
|
57611
|
+
`) + chalk28__default.default.cyan(`Bug ID: ${bugId}
|
|
57612
|
+
`) + chalk28__default.default.gray(`Description: ${description}
|
|
57613
|
+
`) + chalk28__default.default.gray(`Status: Open
|
|
57614
|
+
`) + chalk28__default.default.gray(`Priority: To be determined
|
|
57597
57615
|
`),
|
|
57598
57616
|
data: { bugId, description, status: "open" }
|
|
57599
57617
|
};
|
|
@@ -57601,23 +57619,23 @@ describe("${target}", () => {
|
|
|
57601
57619
|
async listBugs() {
|
|
57602
57620
|
return {
|
|
57603
57621
|
ok: true,
|
|
57604
|
-
message:
|
|
57622
|
+
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")
|
|
57605
57623
|
};
|
|
57606
57624
|
}
|
|
57607
57625
|
async analyzeBug(bugId) {
|
|
57608
57626
|
if (!bugId) {
|
|
57609
57627
|
return {
|
|
57610
57628
|
ok: false,
|
|
57611
|
-
message:
|
|
57629
|
+
message: chalk28__default.default.red("Please provide a bug ID to analyze")
|
|
57612
57630
|
};
|
|
57613
57631
|
}
|
|
57614
57632
|
return {
|
|
57615
57633
|
ok: true,
|
|
57616
|
-
message:
|
|
57634
|
+
message: chalk28__default.default.cyan(`\u{1F50D} Bug Analysis for ${bugId}:
|
|
57617
57635
|
|
|
57618
|
-
`) +
|
|
57636
|
+
`) + 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(
|
|
57619
57637
|
" 1. AbortSignal not propagated to all async operations\n"
|
|
57620
|
-
) +
|
|
57638
|
+
) + 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")
|
|
57621
57639
|
};
|
|
57622
57640
|
}
|
|
57623
57641
|
};
|
|
@@ -57641,7 +57659,7 @@ var init_SystemHandlers = __esm({
|
|
|
57641
57659
|
if (signal?.aborted) {
|
|
57642
57660
|
return {
|
|
57643
57661
|
ok: false,
|
|
57644
|
-
message:
|
|
57662
|
+
message: chalk28__default.default.yellow("Status check canceled")
|
|
57645
57663
|
};
|
|
57646
57664
|
}
|
|
57647
57665
|
const verbose = args2.includes("--verbose") || args2.includes("-v");
|
|
@@ -57652,44 +57670,44 @@ var init_SystemHandlers = __esm({
|
|
|
57652
57670
|
cpu: os13__namespace.cpus()[0],
|
|
57653
57671
|
platform: process.platform
|
|
57654
57672
|
};
|
|
57655
|
-
let message =
|
|
57656
|
-
message +=
|
|
57657
|
-
message +=
|
|
57673
|
+
let message = chalk28__default.default.cyan.bold("\u{1F4CA} System Status\n\n");
|
|
57674
|
+
message += chalk28__default.default.green("\u2705 System: Operational\n");
|
|
57675
|
+
message += chalk28__default.default.gray(
|
|
57658
57676
|
`\u23F1\uFE0F Uptime: ${Math.floor(status.uptime / 60)}m ${Math.floor(status.uptime % 60)}s
|
|
57659
57677
|
`
|
|
57660
57678
|
);
|
|
57661
|
-
message +=
|
|
57679
|
+
message += chalk28__default.default.gray(
|
|
57662
57680
|
`\u{1F4BE} Memory: ${Math.round(status.memory.heapUsed / 1024 / 1024)}MB / ${Math.round(status.memory.heapTotal / 1024 / 1024)}MB
|
|
57663
57681
|
`
|
|
57664
57682
|
);
|
|
57665
57683
|
if (verbose) {
|
|
57666
|
-
message +=
|
|
57667
|
-
message +=
|
|
57684
|
+
message += chalk28__default.default.gray("\nDetailed Information:\n");
|
|
57685
|
+
message += chalk28__default.default.gray(` \u2022 CPU: ${status.cpu.model}
|
|
57668
57686
|
`);
|
|
57669
|
-
message +=
|
|
57687
|
+
message += chalk28__default.default.gray(
|
|
57670
57688
|
` \u2022 Platform: ${status.platform} (${os13__namespace.arch()})
|
|
57671
57689
|
`
|
|
57672
57690
|
);
|
|
57673
|
-
message +=
|
|
57691
|
+
message += chalk28__default.default.gray(` \u2022 Node.js: ${process.version}
|
|
57674
57692
|
`);
|
|
57675
|
-
message +=
|
|
57693
|
+
message += chalk28__default.default.gray(` \u2022 Process ID: ${process.pid}
|
|
57676
57694
|
`);
|
|
57677
|
-
message +=
|
|
57695
|
+
message += chalk28__default.default.gray(` \u2022 Working Directory: ${process.cwd()}
|
|
57678
57696
|
`);
|
|
57679
|
-
message +=
|
|
57680
|
-
message +=
|
|
57697
|
+
message += chalk28__default.default.gray("\nMemory Details:\n");
|
|
57698
|
+
message += chalk28__default.default.gray(
|
|
57681
57699
|
` \u2022 RSS: ${Math.round(status.memory.rss / 1024 / 1024)}MB
|
|
57682
57700
|
`
|
|
57683
57701
|
);
|
|
57684
|
-
message +=
|
|
57702
|
+
message += chalk28__default.default.gray(
|
|
57685
57703
|
` \u2022 Heap Used: ${Math.round(status.memory.heapUsed / 1024 / 1024)}MB
|
|
57686
57704
|
`
|
|
57687
57705
|
);
|
|
57688
|
-
message +=
|
|
57706
|
+
message += chalk28__default.default.gray(
|
|
57689
57707
|
` \u2022 Heap Total: ${Math.round(status.memory.heapTotal / 1024 / 1024)}MB
|
|
57690
57708
|
`
|
|
57691
57709
|
);
|
|
57692
|
-
message +=
|
|
57710
|
+
message += chalk28__default.default.gray(
|
|
57693
57711
|
` \u2022 External: ${Math.round(status.memory.external / 1024 / 1024)}MB
|
|
57694
57712
|
`
|
|
57695
57713
|
);
|
|
@@ -57718,7 +57736,7 @@ var init_SystemHandlers = __esm({
|
|
|
57718
57736
|
if (signal?.aborted) {
|
|
57719
57737
|
return {
|
|
57720
57738
|
ok: false,
|
|
57721
|
-
message:
|
|
57739
|
+
message: chalk28__default.default.yellow("Model operation canceled")
|
|
57722
57740
|
};
|
|
57723
57741
|
}
|
|
57724
57742
|
if (args2.length === 0) {
|
|
@@ -57738,17 +57756,17 @@ var init_SystemHandlers = __esm({
|
|
|
57738
57756
|
}
|
|
57739
57757
|
}
|
|
57740
57758
|
async listModels() {
|
|
57741
|
-
let message =
|
|
57742
|
-
message +=
|
|
57759
|
+
let message = chalk28__default.default.cyan.bold("\u{1F916} Available Models\n\n");
|
|
57760
|
+
message += chalk28__default.default.green(`Current: ${this.currentModel}
|
|
57743
57761
|
|
|
57744
57762
|
`);
|
|
57745
57763
|
for (const model of this.availableModels) {
|
|
57746
|
-
const status = model.available ?
|
|
57747
|
-
const name2 = model.id === this.currentModel ?
|
|
57748
|
-
message += `${status} ${name2.padEnd(20)} ${
|
|
57764
|
+
const status = model.available ? chalk28__default.default.green("\u2705") : chalk28__default.default.red("\u274C");
|
|
57765
|
+
const name2 = model.id === this.currentModel ? chalk28__default.default.green.bold(model.id) : chalk28__default.default.cyan(model.id);
|
|
57766
|
+
message += `${status} ${name2.padEnd(20)} ${chalk28__default.default.gray(`[${model.provider}]`)}
|
|
57749
57767
|
`;
|
|
57750
57768
|
}
|
|
57751
|
-
message +=
|
|
57769
|
+
message += chalk28__default.default.gray("\nUse /model <name> to switch models");
|
|
57752
57770
|
return {
|
|
57753
57771
|
ok: true,
|
|
57754
57772
|
message,
|
|
@@ -57759,27 +57777,27 @@ var init_SystemHandlers = __esm({
|
|
|
57759
57777
|
if (!modelId) {
|
|
57760
57778
|
return {
|
|
57761
57779
|
ok: false,
|
|
57762
|
-
message:
|
|
57780
|
+
message: chalk28__default.default.red("Please specify a model to switch to")
|
|
57763
57781
|
};
|
|
57764
57782
|
}
|
|
57765
57783
|
const model = this.availableModels.find((m2) => m2.id === modelId);
|
|
57766
57784
|
if (!model) {
|
|
57767
57785
|
return {
|
|
57768
57786
|
ok: false,
|
|
57769
|
-
message:
|
|
57770
|
-
`) +
|
|
57787
|
+
message: chalk28__default.default.red(`Unknown model: ${modelId}
|
|
57788
|
+
`) + chalk28__default.default.gray("Use /model list to see available models")
|
|
57771
57789
|
};
|
|
57772
57790
|
}
|
|
57773
57791
|
if (!model.available) {
|
|
57774
57792
|
return {
|
|
57775
57793
|
ok: false,
|
|
57776
|
-
message:
|
|
57794
|
+
message: chalk28__default.default.yellow(`Model ${modelId} is not currently available`)
|
|
57777
57795
|
};
|
|
57778
57796
|
}
|
|
57779
57797
|
this.currentModel = modelId;
|
|
57780
57798
|
return {
|
|
57781
57799
|
ok: true,
|
|
57782
|
-
message:
|
|
57800
|
+
message: chalk28__default.default.green(`\u2705 Switched to ${modelId}`),
|
|
57783
57801
|
data: { model: modelId }
|
|
57784
57802
|
};
|
|
57785
57803
|
}
|
|
@@ -57788,27 +57806,27 @@ var init_SystemHandlers = __esm({
|
|
|
57788
57806
|
if (!model) {
|
|
57789
57807
|
return {
|
|
57790
57808
|
ok: false,
|
|
57791
|
-
message:
|
|
57809
|
+
message: chalk28__default.default.red(`Unknown model: ${modelId}`)
|
|
57792
57810
|
};
|
|
57793
57811
|
}
|
|
57794
|
-
let message =
|
|
57812
|
+
let message = chalk28__default.default.cyan(`\u{1F4CB} Model Information: ${modelId}
|
|
57795
57813
|
|
|
57796
57814
|
`);
|
|
57797
|
-
message +=
|
|
57815
|
+
message += chalk28__default.default.gray(`Provider: ${model.provider}
|
|
57798
57816
|
`);
|
|
57799
|
-
message +=
|
|
57817
|
+
message += chalk28__default.default.gray(
|
|
57800
57818
|
`Status: ${model.available ? "Available" : "Unavailable"}
|
|
57801
57819
|
`
|
|
57802
57820
|
);
|
|
57803
|
-
message +=
|
|
57821
|
+
message += chalk28__default.default.gray(
|
|
57804
57822
|
`Current: ${model.id === this.currentModel ? "Yes" : "No"}
|
|
57805
57823
|
`
|
|
57806
57824
|
);
|
|
57807
|
-
message +=
|
|
57808
|
-
message +=
|
|
57809
|
-
message +=
|
|
57810
|
-
message +=
|
|
57811
|
-
message +=
|
|
57825
|
+
message += chalk28__default.default.gray("\nCapabilities:\n");
|
|
57826
|
+
message += chalk28__default.default.gray(" \u2022 Context: 128K tokens\n");
|
|
57827
|
+
message += chalk28__default.default.gray(" \u2022 Languages: 95+\n");
|
|
57828
|
+
message += chalk28__default.default.gray(" \u2022 Code: Yes\n");
|
|
57829
|
+
message += chalk28__default.default.gray(" \u2022 Vision: ") + (modelId.includes("gpt-4") ? "Yes\n" : "No\n");
|
|
57812
57830
|
return {
|
|
57813
57831
|
ok: true,
|
|
57814
57832
|
message,
|
|
@@ -57840,39 +57858,39 @@ var init_SystemHandlers = __esm({
|
|
|
57840
57858
|
default:
|
|
57841
57859
|
return {
|
|
57842
57860
|
ok: false,
|
|
57843
|
-
message:
|
|
57844
|
-
`) +
|
|
57861
|
+
message: chalk28__default.default.red(`Unknown memory subcommand: ${subcommand}
|
|
57862
|
+
`) + chalk28__default.default.gray("Available: status, clear, export, compact")
|
|
57845
57863
|
};
|
|
57846
57864
|
}
|
|
57847
57865
|
}
|
|
57848
57866
|
async showStatus() {
|
|
57849
|
-
let message =
|
|
57850
|
-
message +=
|
|
57851
|
-
message +=
|
|
57867
|
+
let message = chalk28__default.default.cyan.bold("\u{1F9E0} Memory Status\n\n");
|
|
57868
|
+
message += chalk28__default.default.yellow("System 1 (Fast):\n");
|
|
57869
|
+
message += chalk28__default.default.gray(
|
|
57852
57870
|
` \u2022 Knowledge Nodes: ${this.memoryStats.system1.nodes}
|
|
57853
57871
|
`
|
|
57854
57872
|
);
|
|
57855
|
-
message +=
|
|
57873
|
+
message += chalk28__default.default.gray(` \u2022 Tokens: ${this.memoryStats.system1.tokens}
|
|
57856
57874
|
|
|
57857
57875
|
`);
|
|
57858
|
-
message +=
|
|
57859
|
-
message +=
|
|
57876
|
+
message += chalk28__default.default.blue("System 2 (Deep):\n");
|
|
57877
|
+
message += chalk28__default.default.gray(
|
|
57860
57878
|
` \u2022 Reasoning Traces: ${this.memoryStats.system2.traces}
|
|
57861
57879
|
`
|
|
57862
57880
|
);
|
|
57863
|
-
message +=
|
|
57881
|
+
message += chalk28__default.default.gray(` \u2022 Tokens: ${this.memoryStats.system2.tokens}
|
|
57864
57882
|
|
|
57865
57883
|
`);
|
|
57866
|
-
message +=
|
|
57867
|
-
message +=
|
|
57884
|
+
message += chalk28__default.default.green("Total:\n");
|
|
57885
|
+
message += chalk28__default.default.gray(` \u2022 Entries: ${this.memoryStats.total.entries}
|
|
57868
57886
|
`);
|
|
57869
|
-
message +=
|
|
57887
|
+
message += chalk28__default.default.gray(
|
|
57870
57888
|
` \u2022 Tokens: ${this.memoryStats.total.tokens} / 128000
|
|
57871
57889
|
`
|
|
57872
57890
|
);
|
|
57873
57891
|
const usage = Math.round(this.memoryStats.total.tokens / 128e3 * 100);
|
|
57874
57892
|
const bar = "\u2588".repeat(Math.floor(usage / 5)) + "\u2591".repeat(20 - Math.floor(usage / 5));
|
|
57875
|
-
message +=
|
|
57893
|
+
message += chalk28__default.default.gray(` \u2022 Usage: [${bar}] ${usage}%
|
|
57876
57894
|
`);
|
|
57877
57895
|
return {
|
|
57878
57896
|
ok: true,
|
|
@@ -57886,14 +57904,14 @@ var init_SystemHandlers = __esm({
|
|
|
57886
57904
|
this.memoryStats.system1 = { nodes: 0, tokens: 0 };
|
|
57887
57905
|
return {
|
|
57888
57906
|
ok: true,
|
|
57889
|
-
message:
|
|
57907
|
+
message: chalk28__default.default.green("\u2705 System 1 memory cleared")
|
|
57890
57908
|
};
|
|
57891
57909
|
}
|
|
57892
57910
|
if (system === "system2") {
|
|
57893
57911
|
this.memoryStats.system2 = { traces: 0, tokens: 0 };
|
|
57894
57912
|
return {
|
|
57895
57913
|
ok: true,
|
|
57896
|
-
message:
|
|
57914
|
+
message: chalk28__default.default.green("\u2705 System 2 memory cleared")
|
|
57897
57915
|
};
|
|
57898
57916
|
}
|
|
57899
57917
|
this.memoryStats = {
|
|
@@ -57903,15 +57921,15 @@ var init_SystemHandlers = __esm({
|
|
|
57903
57921
|
};
|
|
57904
57922
|
return {
|
|
57905
57923
|
ok: true,
|
|
57906
|
-
message:
|
|
57924
|
+
message: chalk28__default.default.green("\u{1F9F9} All memory cleared")
|
|
57907
57925
|
};
|
|
57908
57926
|
}
|
|
57909
57927
|
async exportMemory() {
|
|
57910
57928
|
const filename = `memory-export-${Date.now()}.json`;
|
|
57911
57929
|
return {
|
|
57912
57930
|
ok: true,
|
|
57913
|
-
message:
|
|
57914
|
-
`) +
|
|
57931
|
+
message: chalk28__default.default.green(`\u{1F4E6} Memory exported to ${filename}
|
|
57932
|
+
`) + chalk28__default.default.gray(
|
|
57915
57933
|
`Size: ${Math.round(JSON.stringify(this.memoryStats).length / 1024)}KB`
|
|
57916
57934
|
),
|
|
57917
57935
|
data: { filename, stats: this.memoryStats }
|
|
@@ -57929,9 +57947,9 @@ var init_SystemHandlers = __esm({
|
|
|
57929
57947
|
);
|
|
57930
57948
|
return {
|
|
57931
57949
|
ok: true,
|
|
57932
|
-
message:
|
|
57933
|
-
`) +
|
|
57934
|
-
`) +
|
|
57950
|
+
message: chalk28__default.default.green("\u2728 Memory compacted successfully\n") + chalk28__default.default.gray(`Before: ${before} tokens
|
|
57951
|
+
`) + chalk28__default.default.gray(`After: ${after} tokens
|
|
57952
|
+
`) + chalk28__default.default.gray(
|
|
57935
57953
|
`Saved: ${before - after} tokens (${Math.round((1 - after / before) * 100)}%)`
|
|
57936
57954
|
),
|
|
57937
57955
|
data: { before, after, saved: before - after }
|
|
@@ -57947,11 +57965,11 @@ var init_SystemHandlers = __esm({
|
|
|
57947
57965
|
if (signal?.aborted) {
|
|
57948
57966
|
return {
|
|
57949
57967
|
ok: false,
|
|
57950
|
-
message:
|
|
57968
|
+
message: chalk28__default.default.yellow("Health check canceled")
|
|
57951
57969
|
};
|
|
57952
57970
|
}
|
|
57953
57971
|
const detailed = args2.includes("--detailed");
|
|
57954
|
-
let message =
|
|
57972
|
+
let message = chalk28__default.default.cyan.bold("\u{1F3E5} System Health Check\n\n");
|
|
57955
57973
|
const checks = [
|
|
57956
57974
|
{ name: "Core Services", status: "ok", latency: 12 },
|
|
57957
57975
|
{ name: "Memory System", status: "ok", latency: 8 },
|
|
@@ -57960,11 +57978,11 @@ var init_SystemHandlers = __esm({
|
|
|
57960
57978
|
{ name: "Network", status: "warning", latency: 250 }
|
|
57961
57979
|
];
|
|
57962
57980
|
for (const check of checks) {
|
|
57963
|
-
const icon = check.status === "ok" ?
|
|
57964
|
-
const status = check.status === "ok" ?
|
|
57981
|
+
const icon = check.status === "ok" ? chalk28__default.default.green("\u2705") : check.status === "warning" ? chalk28__default.default.yellow("\u26A0\uFE0F") : chalk28__default.default.red("\u274C");
|
|
57982
|
+
const status = check.status === "ok" ? chalk28__default.default.green("OK") : check.status === "warning" ? chalk28__default.default.yellow("WARNING") : chalk28__default.default.red("ERROR");
|
|
57965
57983
|
message += `${icon} ${check.name.padEnd(20)} ${status}`;
|
|
57966
57984
|
if (detailed) {
|
|
57967
|
-
message +=
|
|
57985
|
+
message += chalk28__default.default.gray(` (${check.latency}ms)`);
|
|
57968
57986
|
}
|
|
57969
57987
|
message += "\n";
|
|
57970
57988
|
}
|
|
@@ -57972,11 +57990,11 @@ var init_SystemHandlers = __esm({
|
|
|
57972
57990
|
const hasErrors = checks.some((c) => c.status === "error");
|
|
57973
57991
|
message += "\n";
|
|
57974
57992
|
if (hasErrors) {
|
|
57975
|
-
message +=
|
|
57993
|
+
message += chalk28__default.default.red("\u26A0\uFE0F System has errors - intervention required");
|
|
57976
57994
|
} else if (hasWarnings) {
|
|
57977
|
-
message +=
|
|
57995
|
+
message += chalk28__default.default.yellow("\u26A0\uFE0F System operational with warnings");
|
|
57978
57996
|
} else {
|
|
57979
|
-
message +=
|
|
57997
|
+
message += chalk28__default.default.green("\u2705 All systems operational");
|
|
57980
57998
|
}
|
|
57981
57999
|
return {
|
|
57982
58000
|
ok: true,
|
|
@@ -57994,12 +58012,12 @@ var init_SystemHandlers = __esm({
|
|
|
57994
58012
|
if (signal?.aborted) {
|
|
57995
58013
|
return {
|
|
57996
58014
|
ok: false,
|
|
57997
|
-
message:
|
|
58015
|
+
message: chalk28__default.default.yellow("Doctor check canceled")
|
|
57998
58016
|
};
|
|
57999
58017
|
}
|
|
58000
58018
|
const autoFix = args2.includes("--fix");
|
|
58001
|
-
let message =
|
|
58002
|
-
message +=
|
|
58019
|
+
let message = chalk28__default.default.cyan.bold("\u{1F468}\u2695\uFE0F System Doctor\n\n");
|
|
58020
|
+
message += chalk28__default.default.gray("Running diagnostics...\n\n");
|
|
58003
58021
|
const issues = [
|
|
58004
58022
|
{
|
|
58005
58023
|
severity: "warning",
|
|
@@ -58021,20 +58039,20 @@ var init_SystemHandlers = __esm({
|
|
|
58021
58039
|
}
|
|
58022
58040
|
];
|
|
58023
58041
|
if (issues.length === 0) {
|
|
58024
|
-
message +=
|
|
58042
|
+
message += chalk28__default.default.green("\u2705 No issues found - system is healthy!");
|
|
58025
58043
|
return { ok: true, message };
|
|
58026
58044
|
}
|
|
58027
|
-
message +=
|
|
58045
|
+
message += chalk28__default.default.yellow(`Found ${issues.length} issue(s):
|
|
58028
58046
|
|
|
58029
58047
|
`);
|
|
58030
58048
|
for (const issue of issues) {
|
|
58031
|
-
const icon = issue.severity === "error" ?
|
|
58049
|
+
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");
|
|
58032
58050
|
message += `${icon} ${issue.issue}
|
|
58033
58051
|
`;
|
|
58034
|
-
message +=
|
|
58052
|
+
message += chalk28__default.default.gray(` Solution: ${issue.solution}
|
|
58035
58053
|
`);
|
|
58036
58054
|
if (autoFix && issue.fixable) {
|
|
58037
|
-
message +=
|
|
58055
|
+
message += chalk28__default.default.green(` \u2705 Auto-fixed
|
|
58038
58056
|
`);
|
|
58039
58057
|
}
|
|
58040
58058
|
message += "\n";
|
|
@@ -58042,7 +58060,7 @@ var init_SystemHandlers = __esm({
|
|
|
58042
58060
|
if (!autoFix) {
|
|
58043
58061
|
const fixableCount = issues.filter((i2) => i2.fixable).length;
|
|
58044
58062
|
if (fixableCount > 0) {
|
|
58045
|
-
message +=
|
|
58063
|
+
message += chalk28__default.default.gray(
|
|
58046
58064
|
`
|
|
58047
58065
|
Run /doctor --fix to automatically fix ${fixableCount} issue(s)`
|
|
58048
58066
|
);
|
|
@@ -58343,15 +58361,15 @@ var init_SessionOrchestrator = __esm({
|
|
|
58343
58361
|
/**
|
|
58344
58362
|
* 設定の取得
|
|
58345
58363
|
*/
|
|
58346
|
-
getConfig(
|
|
58347
|
-
return this._configService?.getNestedValue(
|
|
58364
|
+
getConfig(path30) {
|
|
58365
|
+
return this._configService?.getNestedValue(path30);
|
|
58348
58366
|
}
|
|
58349
58367
|
/**
|
|
58350
58368
|
* 設定の更新
|
|
58351
58369
|
*/
|
|
58352
|
-
async setConfig(
|
|
58370
|
+
async setConfig(path30, value) {
|
|
58353
58371
|
if (this._configService) {
|
|
58354
|
-
await this._configService.setNestedValue(
|
|
58372
|
+
await this._configService.setNestedValue(path30, value);
|
|
58355
58373
|
}
|
|
58356
58374
|
}
|
|
58357
58375
|
/**
|
|
@@ -58469,11 +58487,11 @@ var init_interactive_session = __esm({
|
|
|
58469
58487
|
getStats() {
|
|
58470
58488
|
return this.orchestrator.getSessionStats();
|
|
58471
58489
|
}
|
|
58472
|
-
getConfig(
|
|
58473
|
-
return this.orchestrator.getConfig(
|
|
58490
|
+
getConfig(path30) {
|
|
58491
|
+
return this.orchestrator.getConfig(path30);
|
|
58474
58492
|
}
|
|
58475
|
-
async setConfig(
|
|
58476
|
-
await this.orchestrator.setConfig(
|
|
58493
|
+
async setConfig(path30, value) {
|
|
58494
|
+
await this.orchestrator.setConfig(path30, value);
|
|
58477
58495
|
}
|
|
58478
58496
|
};
|
|
58479
58497
|
}
|
|
@@ -58505,14 +58523,14 @@ function createCLI() {
|
|
|
58505
58523
|
}
|
|
58506
58524
|
});
|
|
58507
58525
|
program2.command("setup-ollama").description("Setup Ollama for local AI").action(async () => {
|
|
58508
|
-
console.log(
|
|
58526
|
+
console.log(chalk28__default.default.cyan("Setting up Ollama..."));
|
|
58509
58527
|
console.log(
|
|
58510
|
-
|
|
58528
|
+
chalk28__default.default.yellow("Please run: brew install ollama && ollama serve")
|
|
58511
58529
|
);
|
|
58512
58530
|
});
|
|
58513
58531
|
program2.command("setup-vllm").description("Setup vLLM for local AI").action(async () => {
|
|
58514
|
-
console.log(
|
|
58515
|
-
console.log(
|
|
58532
|
+
console.log(chalk28__default.default.cyan("Setting up vLLM..."));
|
|
58533
|
+
console.log(chalk28__default.default.yellow("Please run: pip install vllm"));
|
|
58516
58534
|
});
|
|
58517
58535
|
return program2;
|
|
58518
58536
|
}
|
|
@@ -58540,13 +58558,13 @@ var init_maria_ai = __esm({
|
|
|
58540
58558
|
await this.providerSelector.initialize();
|
|
58541
58559
|
const { provider, model } = await this.providerSelector.selectProvider();
|
|
58542
58560
|
console.log(
|
|
58543
|
-
|
|
58561
|
+
chalk28__default.default.green(`
|
|
58544
58562
|
\u2705 Selected: ${provider} with model ${model}`)
|
|
58545
58563
|
);
|
|
58546
58564
|
this.config.set("currentProvider", provider);
|
|
58547
58565
|
this.config.set("currentModel", model);
|
|
58548
58566
|
await this.config.save();
|
|
58549
|
-
console.log(
|
|
58567
|
+
console.log(chalk28__default.default.cyan("\n\u{1F9E0} Initializing Intelligent Router..."));
|
|
58550
58568
|
this.router = new IntelligentRouterService({
|
|
58551
58569
|
confidenceThreshold: 0.85,
|
|
58552
58570
|
enableLearning: true,
|
|
@@ -58554,12 +58572,12 @@ var init_maria_ai = __esm({
|
|
|
58554
58572
|
});
|
|
58555
58573
|
await this.router.initialize();
|
|
58556
58574
|
console.log(
|
|
58557
|
-
|
|
58575
|
+
chalk28__default.default.green("\u2705 Intelligent Router initialized successfully\n")
|
|
58558
58576
|
);
|
|
58559
58577
|
this.session = createInteractiveSession(this);
|
|
58560
58578
|
await this.session.start();
|
|
58561
58579
|
} catch (error2) {
|
|
58562
|
-
console.error(
|
|
58580
|
+
console.error(chalk28__default.default.red("\n\u274C Initialization failed:"), error2);
|
|
58563
58581
|
process.exit(1);
|
|
58564
58582
|
}
|
|
58565
58583
|
}
|
|
@@ -58567,7 +58585,7 @@ var init_maria_ai = __esm({
|
|
|
58567
58585
|
if (this.session) {
|
|
58568
58586
|
await this.session.stop();
|
|
58569
58587
|
}
|
|
58570
|
-
console.log(
|
|
58588
|
+
console.log(chalk28__default.default.cyan("\n\u{1F44B} Goodbye!"));
|
|
58571
58589
|
}
|
|
58572
58590
|
};
|
|
58573
58591
|
}
|
|
@@ -58596,8 +58614,8 @@ async function loadServices() {
|
|
|
58596
58614
|
try {
|
|
58597
58615
|
const commandName = command.startsWith("/") ? command.slice(1) : command;
|
|
58598
58616
|
if (commandName === "battlecard") {
|
|
58599
|
-
console.log(
|
|
58600
|
-
console.log(
|
|
58617
|
+
console.log(chalk28__default.default.yellow("\u{1F512} /battlecard is not available on Free plan"));
|
|
58618
|
+
console.log(chalk28__default.default.gray(" Join the waitlist for business features: https://maria-code.ai/waitlist"));
|
|
58601
58619
|
return {
|
|
58602
58620
|
success: false,
|
|
58603
58621
|
message: "Command not available on Free plan"
|
|
@@ -58658,7 +58676,7 @@ async function loadServices() {
|
|
|
58658
58676
|
commandManager.setLegacyHandler(legacyHandlerAdapter);
|
|
58659
58677
|
}
|
|
58660
58678
|
} catch (e2) {
|
|
58661
|
-
console.warn(
|
|
58679
|
+
console.warn(chalk28__default.default.yellow("\u26A0 Some services unavailable, using fallbacks"));
|
|
58662
58680
|
}
|
|
58663
58681
|
}
|
|
58664
58682
|
async function init() {
|
|
@@ -58780,17 +58798,17 @@ async function enforceAuth(cmd) {
|
|
|
58780
58798
|
try {
|
|
58781
58799
|
const tokens = await authManager.getValidTokens();
|
|
58782
58800
|
if (!tokens) {
|
|
58783
|
-
console.log(
|
|
58801
|
+
console.log(chalk28__default.default.red("\u{1F510} Authentication required \xB7 Run: maria /login"));
|
|
58784
58802
|
return false;
|
|
58785
58803
|
}
|
|
58786
58804
|
return true;
|
|
58787
58805
|
} catch (error2) {
|
|
58788
58806
|
if (error2.code === "AUTH_REQUIRED") {
|
|
58789
|
-
console.log(
|
|
58807
|
+
console.log(chalk28__default.default.red("\u{1F510} Authentication required \xB7 Run: maria /login"));
|
|
58790
58808
|
} else if (error2.code === "REAUTH_REQUIRED") {
|
|
58791
|
-
console.log(
|
|
58809
|
+
console.log(chalk28__default.default.yellow("\u{1F504} Please re-authenticate \xB7 Run: maria /login"));
|
|
58792
58810
|
} else {
|
|
58793
|
-
console.log(
|
|
58811
|
+
console.log(chalk28__default.default.red("\u{1F310} Network error, check connection"));
|
|
58794
58812
|
}
|
|
58795
58813
|
return false;
|
|
58796
58814
|
}
|
|
@@ -58829,7 +58847,7 @@ async function handleSlash(input3) {
|
|
|
58829
58847
|
console.log(JSON.stringify(result2.data, null, 2));
|
|
58830
58848
|
}
|
|
58831
58849
|
} else {
|
|
58832
|
-
console.log(
|
|
58850
|
+
console.log(chalk28__default.default.red(`Help Error: ${result2.message}`));
|
|
58833
58851
|
}
|
|
58834
58852
|
return true;
|
|
58835
58853
|
}
|
|
@@ -58837,7 +58855,7 @@ async function handleSlash(input3) {
|
|
|
58837
58855
|
if (process.env.MARIA_DEBUG === "1") {
|
|
58838
58856
|
console.error("HelpCommand error:", helpError);
|
|
58839
58857
|
}
|
|
58840
|
-
console.log(
|
|
58858
|
+
console.log(chalk28__default.default.yellow("\u26A0 Dynamic help unavailable, using fallback"));
|
|
58841
58859
|
}
|
|
58842
58860
|
const help = `
|
|
58843
58861
|
\u{1F4D6} MARIA CLI Help
|
|
@@ -58847,6 +58865,11 @@ Core:
|
|
|
58847
58865
|
/clear Clear conversation context
|
|
58848
58866
|
/exit Exit MARIA
|
|
58849
58867
|
|
|
58868
|
+
Auth:
|
|
58869
|
+
/login Sign in to MARIA
|
|
58870
|
+
/logout Sign out
|
|
58871
|
+
/whoami Show current authenticated user information
|
|
58872
|
+
|
|
58850
58873
|
Generation:
|
|
58851
58874
|
/code <req> Generate code (AI with template fallback)
|
|
58852
58875
|
|
|
@@ -58862,7 +58885,7 @@ Chat:
|
|
|
58862
58885
|
session.length = 0;
|
|
58863
58886
|
if (ctx?.clearContext) ctx.clearContext();
|
|
58864
58887
|
console.clear();
|
|
58865
|
-
console.log(
|
|
58888
|
+
console.log(chalk28__default.default.cyan("\u2728 Session cleared"));
|
|
58866
58889
|
return true;
|
|
58867
58890
|
}
|
|
58868
58891
|
if (cmd === "code") {
|
|
@@ -58871,7 +58894,7 @@ Chat:
|
|
|
58871
58894
|
const prompt = args2.join(" ").trim();
|
|
58872
58895
|
if (!prompt) {
|
|
58873
58896
|
console.log(
|
|
58874
|
-
|
|
58897
|
+
chalk28__default.default.red("Usage: /code <request> e.g. /code build a REST API")
|
|
58875
58898
|
);
|
|
58876
58899
|
return true;
|
|
58877
58900
|
}
|
|
@@ -58884,7 +58907,7 @@ Chat:
|
|
|
58884
58907
|
const prompt = args2.join(" ").trim();
|
|
58885
58908
|
if (!prompt) {
|
|
58886
58909
|
console.log(
|
|
58887
|
-
|
|
58910
|
+
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")
|
|
58888
58911
|
);
|
|
58889
58912
|
return true;
|
|
58890
58913
|
}
|
|
@@ -58896,14 +58919,14 @@ Chat:
|
|
|
58896
58919
|
options: {},
|
|
58897
58920
|
logger: {
|
|
58898
58921
|
info: (msg) => console.log(msg),
|
|
58899
|
-
error: (msg) => console.error(
|
|
58900
|
-
warn: (msg) => console.warn(
|
|
58922
|
+
error: (msg) => console.error(chalk28__default.default.red(msg)),
|
|
58923
|
+
warn: (msg) => console.warn(chalk28__default.default.yellow(msg))
|
|
58901
58924
|
}
|
|
58902
58925
|
};
|
|
58903
58926
|
await imageCommand2.execute(context2);
|
|
58904
58927
|
}
|
|
58905
58928
|
} catch (error2) {
|
|
58906
|
-
console.error(
|
|
58929
|
+
console.error(chalk28__default.default.red("Image generation failed:"), error2.message);
|
|
58907
58930
|
}
|
|
58908
58931
|
return true;
|
|
58909
58932
|
}
|
|
@@ -58913,7 +58936,7 @@ Chat:
|
|
|
58913
58936
|
const prompt = args2.join(" ").trim();
|
|
58914
58937
|
if (!prompt) {
|
|
58915
58938
|
console.log(
|
|
58916
|
-
|
|
58939
|
+
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")
|
|
58917
58940
|
);
|
|
58918
58941
|
return true;
|
|
58919
58942
|
}
|
|
@@ -58925,14 +58948,14 @@ Chat:
|
|
|
58925
58948
|
options: {},
|
|
58926
58949
|
logger: {
|
|
58927
58950
|
info: (msg) => console.log(msg),
|
|
58928
|
-
error: (msg) => console.error(
|
|
58929
|
-
warn: (msg) => console.warn(
|
|
58951
|
+
error: (msg) => console.error(chalk28__default.default.red(msg)),
|
|
58952
|
+
warn: (msg) => console.warn(chalk28__default.default.yellow(msg))
|
|
58930
58953
|
}
|
|
58931
58954
|
};
|
|
58932
58955
|
await videoCommand2.execute(context2);
|
|
58933
58956
|
}
|
|
58934
58957
|
} catch (error2) {
|
|
58935
|
-
console.error(
|
|
58958
|
+
console.error(chalk28__default.default.red("Video generation failed:"), error2.message);
|
|
58936
58959
|
}
|
|
58937
58960
|
return true;
|
|
58938
58961
|
}
|
|
@@ -58942,7 +58965,7 @@ Chat:
|
|
|
58942
58965
|
const prompt = args2.join(" ").trim();
|
|
58943
58966
|
if (!prompt) {
|
|
58944
58967
|
console.log(
|
|
58945
|
-
|
|
58968
|
+
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")
|
|
58946
58969
|
);
|
|
58947
58970
|
return true;
|
|
58948
58971
|
}
|
|
@@ -58954,14 +58977,14 @@ Chat:
|
|
|
58954
58977
|
options: {},
|
|
58955
58978
|
logger: {
|
|
58956
58979
|
info: (msg) => console.log(msg),
|
|
58957
|
-
error: (msg) => console.error(
|
|
58958
|
-
warn: (msg) => console.warn(
|
|
58980
|
+
error: (msg) => console.error(chalk28__default.default.red(msg)),
|
|
58981
|
+
warn: (msg) => console.warn(chalk28__default.default.yellow(msg))
|
|
58959
58982
|
}
|
|
58960
58983
|
};
|
|
58961
58984
|
await voiceCommand2.execute(context2);
|
|
58962
58985
|
}
|
|
58963
58986
|
} catch (error2) {
|
|
58964
|
-
console.error(
|
|
58987
|
+
console.error(chalk28__default.default.red("Voice synthesis failed:"), error2.message);
|
|
58965
58988
|
}
|
|
58966
58989
|
return true;
|
|
58967
58990
|
}
|
|
@@ -58980,36 +59003,49 @@ Chat:
|
|
|
58980
59003
|
if (args2.includes("status")) {
|
|
58981
59004
|
if (await authManager.isAuthenticated()) {
|
|
58982
59005
|
const user = await authManager.getCurrentUser();
|
|
58983
|
-
console.log(
|
|
58984
|
-
|
|
58985
|
-
|
|
59006
|
+
console.log(chalk28__default.default.green("\u2705 Authenticated"));
|
|
59007
|
+
if (user.name) {
|
|
59008
|
+
console.log(chalk28__default.default.white(`\u{1F464} Name: ${chalk28__default.default.cyan(user.name)}`));
|
|
59009
|
+
}
|
|
59010
|
+
console.log(chalk28__default.default.white(`\u{1F4E7} Email: ${chalk28__default.default.cyan(user.email)}`));
|
|
59011
|
+
if (user.provider) {
|
|
59012
|
+
console.log(chalk28__default.default.white(`\u{1F511} Provider: ${chalk28__default.default.cyan(user.provider)}`));
|
|
59013
|
+
}
|
|
59014
|
+
console.log(chalk28__default.default.white(`\u{1F4CA} Plan: ${chalk28__default.default.cyan(user.plan)}`));
|
|
58986
59015
|
} else {
|
|
58987
|
-
console.log(
|
|
58988
|
-
console.log(
|
|
59016
|
+
console.log(chalk28__default.default.yellow("\u26A0\uFE0F Not authenticated"));
|
|
59017
|
+
console.log(chalk28__default.default.gray("Use /login to sign in"));
|
|
58989
59018
|
}
|
|
58990
59019
|
} else {
|
|
58991
59020
|
const result2 = await authManager.login(options3);
|
|
58992
59021
|
if (result2.success && result2.user) {
|
|
58993
|
-
console.log(
|
|
58994
|
-
|
|
58995
|
-
|
|
59022
|
+
console.log(chalk28__default.default.green("\u2705 Successfully logged in!"));
|
|
59023
|
+
const u = result2.user;
|
|
59024
|
+
if (u.name) {
|
|
59025
|
+
console.log(chalk28__default.default.white(`\u{1F464} Name: ${chalk28__default.default.cyan(u.name)}`));
|
|
59026
|
+
}
|
|
59027
|
+
console.log(chalk28__default.default.white(`\u{1F4E7} Email: ${chalk28__default.default.cyan(u.email)}`));
|
|
59028
|
+
if (u.provider) {
|
|
59029
|
+
console.log(chalk28__default.default.white(`\u{1F511} Provider: ${chalk28__default.default.cyan(u.provider)}`));
|
|
59030
|
+
}
|
|
59031
|
+
console.log(chalk28__default.default.white(`\u{1F4CA} Plan: ${chalk28__default.default.cyan(u.plan)}`));
|
|
58996
59032
|
} else {
|
|
58997
|
-
console.log(
|
|
58998
|
-
if (result2.error) console.log(
|
|
59033
|
+
console.log(chalk28__default.default.red("\u274C Login failed"));
|
|
59034
|
+
if (result2.error) console.log(chalk28__default.default.gray(result2.error));
|
|
58999
59035
|
}
|
|
59000
59036
|
}
|
|
59001
59037
|
}
|
|
59002
59038
|
} catch (error2) {
|
|
59003
|
-
console.error(
|
|
59039
|
+
console.error(chalk28__default.default.red("Login error:"), error2.message);
|
|
59004
59040
|
}
|
|
59005
59041
|
return true;
|
|
59006
59042
|
}
|
|
59007
59043
|
if (cmd === "logout" || cmd === "signout") {
|
|
59008
59044
|
try {
|
|
59009
59045
|
await authManager.logout();
|
|
59010
|
-
console.log(
|
|
59046
|
+
console.log(chalk28__default.default.green("\u{1F44B} Signed out. Local credentials removed."));
|
|
59011
59047
|
} catch (error2) {
|
|
59012
|
-
console.error(
|
|
59048
|
+
console.error(chalk28__default.default.red("Logout error:"), error2.message);
|
|
59013
59049
|
}
|
|
59014
59050
|
return true;
|
|
59015
59051
|
}
|
|
@@ -59085,10 +59121,17 @@ Chat:
|
|
|
59085
59121
|
}
|
|
59086
59122
|
if (commandManager) {
|
|
59087
59123
|
try {
|
|
59124
|
+
let currentUser = null;
|
|
59125
|
+
try {
|
|
59126
|
+
if (await authManager.isAuthenticated()) {
|
|
59127
|
+
currentUser = await authManager.getCurrentUser();
|
|
59128
|
+
}
|
|
59129
|
+
} catch {
|
|
59130
|
+
}
|
|
59088
59131
|
const context2 = {
|
|
59089
59132
|
sessionId: "cli",
|
|
59090
59133
|
timestamp: /* @__PURE__ */ new Date(),
|
|
59091
|
-
user:
|
|
59134
|
+
user: currentUser,
|
|
59092
59135
|
history: session
|
|
59093
59136
|
};
|
|
59094
59137
|
const result2 = await commandManager.handleCommand(`/${cmd}`, args2, context2);
|
|
@@ -59114,6 +59157,13 @@ Chat:
|
|
|
59114
59157
|
const { commandRegistry: commandRegistry2 } = await Promise.resolve().then(() => (init_registry(), registry_exports));
|
|
59115
59158
|
const command = commandRegistry2.get(cmd);
|
|
59116
59159
|
if (command && command.execute) {
|
|
59160
|
+
let currentUser = void 0;
|
|
59161
|
+
try {
|
|
59162
|
+
if (await authManager.isAuthenticated()) {
|
|
59163
|
+
currentUser = await authManager.getCurrentUser();
|
|
59164
|
+
}
|
|
59165
|
+
} catch {
|
|
59166
|
+
}
|
|
59117
59167
|
const result2 = await command.execute(
|
|
59118
59168
|
{
|
|
59119
59169
|
raw: args2.join(" "),
|
|
@@ -59123,7 +59173,7 @@ Chat:
|
|
|
59123
59173
|
},
|
|
59124
59174
|
{
|
|
59125
59175
|
session: { id: "cli", commandHistory: [] },
|
|
59126
|
-
user:
|
|
59176
|
+
user: currentUser,
|
|
59127
59177
|
environment: { cwd: process.cwd() }
|
|
59128
59178
|
}
|
|
59129
59179
|
);
|
|
@@ -59136,7 +59186,7 @@ Chat:
|
|
|
59136
59186
|
} else if (result2.message) {
|
|
59137
59187
|
console.log(result2.message);
|
|
59138
59188
|
} else if (result2.success) {
|
|
59139
|
-
console.log(
|
|
59189
|
+
console.log(chalk28__default.default.green("\u2705 Command executed successfully"));
|
|
59140
59190
|
}
|
|
59141
59191
|
if (result2.data && process.env.MARIA_DEBUG === "1") {
|
|
59142
59192
|
console.log(JSON.stringify(result2.data, null, 2));
|
|
@@ -59150,11 +59200,11 @@ Chat:
|
|
|
59150
59200
|
}
|
|
59151
59201
|
}
|
|
59152
59202
|
if (!["battlecard", "sales-dashboard", "tune", "pilot-setup"].includes(cmd)) {
|
|
59153
|
-
console.log(
|
|
59154
|
-
console.log(
|
|
59155
|
-
console.log(
|
|
59156
|
-
console.log(
|
|
59157
|
-
console.log(
|
|
59203
|
+
console.log(chalk28__default.default.red(`\u274C Unknown command: /${cmd}`));
|
|
59204
|
+
console.log(chalk28__default.default.yellow("\n\u{1F4A1} Suggestions:"));
|
|
59205
|
+
console.log(chalk28__default.default.gray(" \u2022 Try /help to see available commands"));
|
|
59206
|
+
console.log(chalk28__default.default.gray(" \u2022 Check if you need to /login first"));
|
|
59207
|
+
console.log(chalk28__default.default.gray(` \u2022 Try similar commands: /help --search ${cmd}`));
|
|
59158
59208
|
}
|
|
59159
59209
|
return true;
|
|
59160
59210
|
}
|
|
@@ -59422,11 +59472,11 @@ async function handleCodeCommand(prompt) {
|
|
|
59422
59472
|
const filepath = path9__namespace.resolve(process.cwd(), filename);
|
|
59423
59473
|
await fsp__namespace.writeFile(filepath, code, "utf-8");
|
|
59424
59474
|
console.log(
|
|
59425
|
-
|
|
59426
|
-
`) +
|
|
59427
|
-
`) +
|
|
59428
|
-
`) +
|
|
59429
|
-
`) +
|
|
59475
|
+
chalk28__default.default.green("\n\u2705 **Code Saved**\n") + chalk28__default.default.white(`\u{1F4C1} **File (Click to open):**
|
|
59476
|
+
`) + chalk28__default.default.cyan(`\u2022 [${filename}](file://${filepath})
|
|
59477
|
+
`) + chalk28__default.default.gray(` \u{1F4CD} Path: \`${filepath}\`
|
|
59478
|
+
`) + chalk28__default.default.white(` \u{1F4DD} Language: ${language}
|
|
59479
|
+
`) + chalk28__default.default.dim(`
|
|
59430
59480
|
\u{1F4A1} Tip: Command+Click (Mac) or Ctrl+Click (Windows/Linux) to open file`)
|
|
59431
59481
|
);
|
|
59432
59482
|
} else {
|
|
@@ -59435,11 +59485,11 @@ async function handleCodeCommand(prompt) {
|
|
|
59435
59485
|
} catch (e2) {
|
|
59436
59486
|
spinner.stop();
|
|
59437
59487
|
if (process.env.MARIA_DEBUG === "1") {
|
|
59438
|
-
console.error(
|
|
59488
|
+
console.error(chalk28__default.default.red("Code generation error:"), e2.message || e2);
|
|
59439
59489
|
}
|
|
59440
59490
|
const fallbackCode = templateFallback(prompt);
|
|
59441
59491
|
console.log(
|
|
59442
|
-
|
|
59492
|
+
chalk28__default.default.yellow("\u26A0 AI unavailable, using template fallback:\n")
|
|
59443
59493
|
);
|
|
59444
59494
|
console.log(fallbackCode);
|
|
59445
59495
|
try {
|
|
@@ -59448,14 +59498,14 @@ async function handleCodeCommand(prompt) {
|
|
|
59448
59498
|
const filepath = path9__namespace.resolve(process.cwd(), filename);
|
|
59449
59499
|
await fsp__namespace.writeFile(filepath, code, "utf-8");
|
|
59450
59500
|
console.log(
|
|
59451
|
-
|
|
59452
|
-
`) +
|
|
59453
|
-
`) +
|
|
59454
|
-
`) +
|
|
59501
|
+
chalk28__default.default.green("\n\u2705 **Template Code Saved**\n") + chalk28__default.default.white(`\u{1F4C1} **File (Click to open):**
|
|
59502
|
+
`) + chalk28__default.default.cyan(`\u2022 [${filename}](file://${filepath})
|
|
59503
|
+
`) + chalk28__default.default.gray(` \u{1F4CD} Path: \`${filepath}\`
|
|
59504
|
+
`) + chalk28__default.default.dim(`
|
|
59455
59505
|
\u{1F4A1} Tip: Command+Click (Mac) or Ctrl+Click (Windows/Linux) to open file`)
|
|
59456
59506
|
);
|
|
59457
59507
|
} catch (saveError) {
|
|
59458
|
-
console.error(
|
|
59508
|
+
console.error(chalk28__default.default.red("Failed to save code:"), saveError);
|
|
59459
59509
|
}
|
|
59460
59510
|
}
|
|
59461
59511
|
}
|
|
@@ -59511,7 +59561,7 @@ ${userPrompt}`;
|
|
|
59511
59561
|
(seq) => response2.includes(seq)
|
|
59512
59562
|
);
|
|
59513
59563
|
if (guidedFlowDetected) {
|
|
59514
|
-
console.log(
|
|
59564
|
+
console.log(chalk28__default.default.yellow("\u26A0 Guided flow detected, switching to fallback"));
|
|
59515
59565
|
return null;
|
|
59516
59566
|
}
|
|
59517
59567
|
const codeMatch = response2.match(/```[\s\S]*?```/);
|
|
@@ -59679,14 +59729,14 @@ async function streamAnswer(text) {
|
|
|
59679
59729
|
if (store?.addMessage) await store.addMessage(msg);
|
|
59680
59730
|
} else {
|
|
59681
59731
|
animation.stop();
|
|
59682
|
-
console.log(
|
|
59732
|
+
console.log(chalk28__default.default.yellow("AI service unavailable. Please check your configuration."));
|
|
59683
59733
|
}
|
|
59684
59734
|
} catch (e2) {
|
|
59685
59735
|
animation.stop();
|
|
59686
59736
|
if (e2.message?.includes("timeout") || e2.message?.includes("\u23F1\uFE0F")) {
|
|
59687
|
-
console.log(
|
|
59737
|
+
console.log(chalk28__default.default.yellow(e2.message));
|
|
59688
59738
|
} else {
|
|
59689
|
-
console.log(
|
|
59739
|
+
console.log(chalk28__default.default.red("Error generating response:"), e2.message || e2);
|
|
59690
59740
|
}
|
|
59691
59741
|
}
|
|
59692
59742
|
}
|
|
@@ -59701,9 +59751,9 @@ async function handleLine(line) {
|
|
|
59701
59751
|
if (consumed) return;
|
|
59702
59752
|
const isAuthenticated = await authManager.isAuthenticated();
|
|
59703
59753
|
if (!isAuthenticated) {
|
|
59704
|
-
console.log(
|
|
59705
|
-
console.log(
|
|
59706
|
-
console.log(
|
|
59754
|
+
console.log(chalk28__default.default.yellow("\n\u26A0\uFE0F Authentication required for chat features"));
|
|
59755
|
+
console.log(chalk28__default.default.cyan("Please run: /login"));
|
|
59756
|
+
console.log(chalk28__default.default.gray("Or use slash commands like /help, /version"));
|
|
59707
59757
|
return;
|
|
59708
59758
|
}
|
|
59709
59759
|
const user = { role: "user", content: input3, timestamp: /* @__PURE__ */ new Date() };
|
|
@@ -59725,7 +59775,7 @@ async function startInteractiveSession() {
|
|
|
59725
59775
|
}
|
|
59726
59776
|
}
|
|
59727
59777
|
const stop = async () => {
|
|
59728
|
-
console.log(
|
|
59778
|
+
console.log(chalk28__default.default.cyan("\n\u{1F44B} Goodbye!"));
|
|
59729
59779
|
if (store?.close) await store.close().catch(() => {
|
|
59730
59780
|
});
|
|
59731
59781
|
if (interactiveCLI?.cleanup) interactiveCLI.cleanup();
|
|
@@ -59739,7 +59789,7 @@ async function startInteractiveSession() {
|
|
|
59739
59789
|
process.once("SIGINT", stop);
|
|
59740
59790
|
process.once("SIGTERM", stop);
|
|
59741
59791
|
if (!isTTY) {
|
|
59742
|
-
console.log(
|
|
59792
|
+
console.log(chalk28__default.default.gray("[Pipe mode detected - streaming input/output]"));
|
|
59743
59793
|
const rl = readline6__namespace.createInterface({
|
|
59744
59794
|
input: process6.stdin,
|
|
59745
59795
|
output: process6.stdout,
|
|
@@ -59754,7 +59804,7 @@ async function startInteractiveSession() {
|
|
|
59754
59804
|
if (interactiveCLI) {
|
|
59755
59805
|
while (true) {
|
|
59756
59806
|
try {
|
|
59757
|
-
const prompt =
|
|
59807
|
+
const prompt = chalk28__default.default.gray("> ");
|
|
59758
59808
|
process.stdout.write(prompt);
|
|
59759
59809
|
const line = await interactiveCLI.question("");
|
|
59760
59810
|
console.log();
|
|
@@ -59769,14 +59819,14 @@ async function startInteractiveSession() {
|
|
|
59769
59819
|
await stop();
|
|
59770
59820
|
return;
|
|
59771
59821
|
}
|
|
59772
|
-
console.error(
|
|
59822
|
+
console.error(chalk28__default.default.red("Error:"), error2?.message || error2);
|
|
59773
59823
|
}
|
|
59774
59824
|
}
|
|
59775
59825
|
} else {
|
|
59776
59826
|
const rl = readline6__namespace.createInterface({ input: process6.stdin, output: process6.stdout });
|
|
59777
59827
|
while (true) {
|
|
59778
59828
|
try {
|
|
59779
|
-
const prompt =
|
|
59829
|
+
const prompt = chalk28__default.default.gray("> ");
|
|
59780
59830
|
const line = await rl.question(prompt);
|
|
59781
59831
|
console.log();
|
|
59782
59832
|
if (line.toLowerCase() === "exit" || line.toLowerCase() === "quit") {
|
|
@@ -59790,7 +59840,7 @@ async function startInteractiveSession() {
|
|
|
59790
59840
|
await stop();
|
|
59791
59841
|
return;
|
|
59792
59842
|
}
|
|
59793
|
-
console.error(
|
|
59843
|
+
console.error(chalk28__default.default.red("Error:"), error2?.message || error2);
|
|
59794
59844
|
}
|
|
59795
59845
|
}
|
|
59796
59846
|
}
|
|
@@ -59800,7 +59850,7 @@ function createCLI2() {
|
|
|
59800
59850
|
program2.name("maria").description(`\u{1F680} MARIA v${getVersion()} - Intelligent AI Assistant`).version(getVersion()).option("--v3-session", "Use v3 session architecture").option("--no-interactive", "Disable interactive mode for CI/CD").action(async (options2) => {
|
|
59801
59851
|
loadEnvironmentVariables();
|
|
59802
59852
|
if (options2.server) {
|
|
59803
|
-
console.log(
|
|
59853
|
+
console.log(chalk28__default.default.green("\u{1F680} Starting MARIA server mode..."));
|
|
59804
59854
|
try {
|
|
59805
59855
|
const distDir = path9__namespace.dirname(process.argv[1] || process.cwd());
|
|
59806
59856
|
const candidateNames = [
|
|
@@ -59830,9 +59880,9 @@ function createCLI2() {
|
|
|
59830
59880
|
if (serverPath) break;
|
|
59831
59881
|
}
|
|
59832
59882
|
if (!serverPath) {
|
|
59833
|
-
console.error(
|
|
59834
|
-
console.error(
|
|
59835
|
-
console.error(
|
|
59883
|
+
console.error(chalk28__default.default.red("\u274C Could not locate server-express entry file"));
|
|
59884
|
+
console.error(chalk28__default.default.gray("Searched names: " + candidateNames.join(", ")));
|
|
59885
|
+
console.error(chalk28__default.default.gray("Searched dirs: " + candidateDirs.join(" | ")));
|
|
59836
59886
|
process.exit(1);
|
|
59837
59887
|
}
|
|
59838
59888
|
const { spawn: spawn3 } = await import('child_process');
|
|
@@ -59879,7 +59929,7 @@ function createCLI2() {
|
|
|
59879
59929
|
process.once("SIGINT", () => forwardAndExit("SIGINT"));
|
|
59880
59930
|
process.once("SIGTERM", () => forwardAndExit("SIGTERM"));
|
|
59881
59931
|
serverProcess.on("error", (error2) => {
|
|
59882
|
-
console.error(
|
|
59932
|
+
console.error(chalk28__default.default.red("\u274C Server process error:"), error2);
|
|
59883
59933
|
process.exit(1);
|
|
59884
59934
|
});
|
|
59885
59935
|
serverProcess.on("exit", (code, _signal) => {
|
|
@@ -59892,7 +59942,7 @@ function createCLI2() {
|
|
|
59892
59942
|
});
|
|
59893
59943
|
return;
|
|
59894
59944
|
} catch (error2) {
|
|
59895
|
-
console.error(
|
|
59945
|
+
console.error(chalk28__default.default.red("\u274C Failed to start server mode:"), error2);
|
|
59896
59946
|
process.exit(1);
|
|
59897
59947
|
}
|
|
59898
59948
|
}
|
|
@@ -59917,7 +59967,7 @@ function createCLI2() {
|
|
|
59917
59967
|
displayStartupLogo2();
|
|
59918
59968
|
startupDisplayed = true;
|
|
59919
59969
|
} catch {
|
|
59920
|
-
console.log(
|
|
59970
|
+
console.log(chalk28__default.default.cyan(`
|
|
59921
59971
|
\u{1F680} MARIA v${getVersion()}
|
|
59922
59972
|
`));
|
|
59923
59973
|
startupDisplayed = true;
|
|
@@ -59926,13 +59976,13 @@ function createCLI2() {
|
|
|
59926
59976
|
const useV3 = options2.v3Session || process.env.MARIA_USE_V3_SESSION === "1";
|
|
59927
59977
|
if (useV3) {
|
|
59928
59978
|
try {
|
|
59929
|
-
console.log(
|
|
59979
|
+
console.log(chalk28__default.default.cyan("\u{1F680} Starting MARIA v3 session..."));
|
|
59930
59980
|
const { MariaAI: MariaAI2 } = await Promise.resolve().then(() => (init_maria_ai(), maria_ai_exports));
|
|
59931
59981
|
const maria = new MariaAI2();
|
|
59932
59982
|
await maria.initialize();
|
|
59933
59983
|
return;
|
|
59934
59984
|
} catch (e2) {
|
|
59935
|
-
console.warn(
|
|
59985
|
+
console.warn(chalk28__default.default.yellow("\u26A0 V3 session unavailable, using standard mode"));
|
|
59936
59986
|
}
|
|
59937
59987
|
}
|
|
59938
59988
|
await startInteractiveSession();
|