@triedotdev/mcp 1.0.56 → 1.0.57
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.
|
@@ -3158,6 +3158,40 @@ var IssueAnalyzer = class {
|
|
|
3158
3158
|
// src/cli/interactive-dashboard.ts
|
|
3159
3159
|
import { stdin as input, stdout as output } from "process";
|
|
3160
3160
|
import * as readline from "readline";
|
|
3161
|
+
import pc from "picocolors";
|
|
3162
|
+
var colors = {
|
|
3163
|
+
// UI elements
|
|
3164
|
+
border: (s) => pc.cyan(s),
|
|
3165
|
+
header: (s) => pc.bold(pc.cyan(s)),
|
|
3166
|
+
brand: (s) => pc.bold(pc.cyan(s)),
|
|
3167
|
+
dim: (s) => pc.dim(s),
|
|
3168
|
+
// Severity levels
|
|
3169
|
+
critical: (s) => pc.bold(pc.red(s)),
|
|
3170
|
+
serious: (s) => pc.yellow(s),
|
|
3171
|
+
moderate: (s) => pc.blue(s),
|
|
3172
|
+
low: (s) => pc.dim(s),
|
|
3173
|
+
// Status
|
|
3174
|
+
success: (s) => pc.green(s),
|
|
3175
|
+
running: (s) => pc.yellow(s),
|
|
3176
|
+
waiting: (s) => pc.dim(s),
|
|
3177
|
+
alert: (s) => pc.bold(pc.red(s)),
|
|
3178
|
+
// Interactive
|
|
3179
|
+
selected: (s) => pc.bold(pc.magenta(s)),
|
|
3180
|
+
highlight: (s) => pc.bold(pc.white(s))
|
|
3181
|
+
};
|
|
3182
|
+
var box = {
|
|
3183
|
+
topLeft: "\u250C",
|
|
3184
|
+
topRight: "\u2510",
|
|
3185
|
+
bottomLeft: "\u2514",
|
|
3186
|
+
bottomRight: "\u2518",
|
|
3187
|
+
horizontal: "\u2500",
|
|
3188
|
+
vertical: "\u2502",
|
|
3189
|
+
leftT: "\u251C",
|
|
3190
|
+
rightT: "\u2524",
|
|
3191
|
+
topT: "\u252C",
|
|
3192
|
+
bottomT: "\u2534",
|
|
3193
|
+
cross: "\u253C"
|
|
3194
|
+
};
|
|
3161
3195
|
var InteractiveDashboard = class {
|
|
3162
3196
|
rl;
|
|
3163
3197
|
state;
|
|
@@ -3181,7 +3215,9 @@ var InteractiveDashboard = class {
|
|
|
3181
3215
|
search: ""
|
|
3182
3216
|
},
|
|
3183
3217
|
view: "overview",
|
|
3218
|
+
previousView: null,
|
|
3184
3219
|
selectedIssue: 0,
|
|
3220
|
+
selectedAgent: 0,
|
|
3185
3221
|
lastUpdate: Date.now(),
|
|
3186
3222
|
scanComplete: false,
|
|
3187
3223
|
startTime: Date.now(),
|
|
@@ -3247,7 +3283,7 @@ var InteractiveDashboard = class {
|
|
|
3247
3283
|
}
|
|
3248
3284
|
break;
|
|
3249
3285
|
case "agent_start":
|
|
3250
|
-
this.addActivity(`[*]
|
|
3286
|
+
this.addActivity(`[*] Scout started: ${update.data.agent}`);
|
|
3251
3287
|
this.state.agents[update.data.agent] = {
|
|
3252
3288
|
...this.state.agents[update.data.agent] || { issues: 0, status: "queued" },
|
|
3253
3289
|
status: "running",
|
|
@@ -3255,7 +3291,7 @@ var InteractiveDashboard = class {
|
|
|
3255
3291
|
};
|
|
3256
3292
|
break;
|
|
3257
3293
|
case "agent_complete":
|
|
3258
|
-
this.addActivity(`[+]
|
|
3294
|
+
this.addActivity(`[+] Scout complete: ${update.data.agent} (${update.data.issueCount} issues)`);
|
|
3259
3295
|
{
|
|
3260
3296
|
const prev = this.state.agents[update.data.agent];
|
|
3261
3297
|
const start = prev?.start;
|
|
@@ -3376,15 +3412,11 @@ var InteractiveDashboard = class {
|
|
|
3376
3412
|
case "p":
|
|
3377
3413
|
this.prevPage();
|
|
3378
3414
|
break;
|
|
3379
|
-
case "r":
|
|
3380
|
-
this.addActivity("Rerun requested (press q to exit and rerun command)");
|
|
3381
|
-
break;
|
|
3382
|
-
case "w":
|
|
3383
|
-
this.state.watch.watching = !this.state.watch.watching;
|
|
3384
|
-
this.addActivity(this.state.watch.watching ? "Watch resumed" : "Watch paused (visual only)");
|
|
3385
|
-
break;
|
|
3386
3415
|
case "s":
|
|
3387
|
-
this.
|
|
3416
|
+
this.promptAgentFilter();
|
|
3417
|
+
break;
|
|
3418
|
+
case "b":
|
|
3419
|
+
this.goBack();
|
|
3388
3420
|
break;
|
|
3389
3421
|
case "h":
|
|
3390
3422
|
case "?":
|
|
@@ -3405,43 +3437,54 @@ var InteractiveDashboard = class {
|
|
|
3405
3437
|
}, 100);
|
|
3406
3438
|
}
|
|
3407
3439
|
/**
|
|
3408
|
-
* Create a horizontal line
|
|
3440
|
+
* Create a horizontal line (Unicode box-drawing)
|
|
3409
3441
|
*/
|
|
3410
3442
|
line(width = 78) {
|
|
3411
|
-
return
|
|
3443
|
+
return box.horizontal.repeat(width);
|
|
3412
3444
|
}
|
|
3413
3445
|
/**
|
|
3414
|
-
* Create progress bar
|
|
3446
|
+
* Create progress bar with color
|
|
3415
3447
|
*/
|
|
3416
3448
|
progressBar(current, total, width = 50) {
|
|
3417
|
-
if (total === 0) return "[" + "
|
|
3449
|
+
if (total === 0) return colors.dim("[" + "\u2588".repeat(width) + "]");
|
|
3418
3450
|
const progress = Math.min(1, current / total);
|
|
3419
3451
|
const filled = Math.round(width * progress);
|
|
3420
3452
|
const empty = width - filled;
|
|
3421
|
-
|
|
3453
|
+
const filledBar = colors.border("\u2588".repeat(filled));
|
|
3454
|
+
const emptyBar = colors.dim("\u2591".repeat(empty));
|
|
3455
|
+
return "[" + filledBar + emptyBar + "]";
|
|
3422
3456
|
}
|
|
3423
3457
|
/**
|
|
3424
|
-
* Get severity icon
|
|
3458
|
+
* Get severity icon with color
|
|
3425
3459
|
*/
|
|
3426
3460
|
severityIcon(severity) {
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3461
|
+
switch (severity) {
|
|
3462
|
+
case "critical":
|
|
3463
|
+
return colors.critical("[!]");
|
|
3464
|
+
case "serious":
|
|
3465
|
+
return colors.serious("[x]");
|
|
3466
|
+
case "moderate":
|
|
3467
|
+
return colors.moderate("[~]");
|
|
3468
|
+
case "low":
|
|
3469
|
+
return colors.low("[-]");
|
|
3470
|
+
default:
|
|
3471
|
+
return colors.dim("[-]");
|
|
3472
|
+
}
|
|
3434
3473
|
}
|
|
3435
3474
|
/**
|
|
3436
|
-
* Get agent status icon
|
|
3475
|
+
* Get agent status icon with color
|
|
3437
3476
|
*/
|
|
3438
3477
|
agentIcon(status) {
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3478
|
+
switch (status) {
|
|
3479
|
+
case "running":
|
|
3480
|
+
return colors.running("\u25CF");
|
|
3481
|
+
case "done":
|
|
3482
|
+
return colors.success("\u2713");
|
|
3483
|
+
case "waiting":
|
|
3484
|
+
return colors.waiting("\u25CB");
|
|
3485
|
+
default:
|
|
3486
|
+
return colors.dim("\u25CB");
|
|
3487
|
+
}
|
|
3445
3488
|
}
|
|
3446
3489
|
/**
|
|
3447
3490
|
* Main render function
|
|
@@ -3475,17 +3518,27 @@ var InteractiveDashboard = class {
|
|
|
3475
3518
|
* Render header with title and status
|
|
3476
3519
|
*/
|
|
3477
3520
|
renderHeader(width) {
|
|
3478
|
-
const time = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
3479
|
-
|
|
3521
|
+
const time = colors.dim((/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" }));
|
|
3522
|
+
const watchLabel = this.state.watch.watching ? colors.success("[WATCH ON]") : colors.dim("[WATCH OFF]");
|
|
3523
|
+
let statusText = "";
|
|
3480
3524
|
if (this.state.scanComplete) {
|
|
3481
|
-
|
|
3525
|
+
statusText = colors.success("COMPLETE") + " " + colors.success("[OK]");
|
|
3526
|
+
} else {
|
|
3527
|
+
statusText = colors.running("SCANNING") + " " + colors.dim("(...)");
|
|
3482
3528
|
}
|
|
3529
|
+
let alertText = "";
|
|
3483
3530
|
if (this.state.alerts.hasCritical) {
|
|
3484
|
-
|
|
3485
|
-
}
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3531
|
+
alertText = " " + colors.alert("\u2502 ALERT: CRITICAL");
|
|
3532
|
+
}
|
|
3533
|
+
const borderColor = colors.border;
|
|
3534
|
+
const topBorder = borderColor(box.topLeft + this.line(width - 2) + box.topRight);
|
|
3535
|
+
const midBorder = borderColor(box.leftT + this.line(width - 2) + box.rightT);
|
|
3536
|
+
const brandRaw = "TRIE GUARDIAN";
|
|
3537
|
+
const brand = colors.brand("TRIE GUARDIAN");
|
|
3538
|
+
const contentPadding = width - 4 - brandRaw.length;
|
|
3539
|
+
console.log(topBorder);
|
|
3540
|
+
console.log(borderColor(box.vertical) + " " + brand + " ".repeat(Math.max(1, contentPadding - 30)) + statusText + " " + watchLabel + alertText + " " + time + " " + borderColor(box.vertical));
|
|
3541
|
+
console.log(midBorder);
|
|
3489
3542
|
}
|
|
3490
3543
|
/**
|
|
3491
3544
|
* Render scanning in progress view
|
|
@@ -3493,6 +3546,8 @@ var InteractiveDashboard = class {
|
|
|
3493
3546
|
renderScanningView(width, height) {
|
|
3494
3547
|
const { processedFiles, totalFiles, currentFile, activeAgents, completedAgents } = this.state.progress;
|
|
3495
3548
|
const { issuesBySeverity } = this.state.progress;
|
|
3549
|
+
const v = colors.border(box.vertical);
|
|
3550
|
+
const sectionBorder = colors.border(box.leftT + this.line(width - 2) + box.rightT);
|
|
3496
3551
|
const baseTotal = 21;
|
|
3497
3552
|
const variableBudget = Math.max(0, height - baseTotal);
|
|
3498
3553
|
const agentRows = Math.max(1, Math.min(4, Math.floor(variableBudget / 2)));
|
|
@@ -3501,13 +3556,13 @@ var InteractiveDashboard = class {
|
|
|
3501
3556
|
const percent = totalFiles > 0 ? Math.round(processedFiles / totalFiles * 100) : 0;
|
|
3502
3557
|
const current = currentFile ? currentFile.split("/").pop() || "" : "";
|
|
3503
3558
|
const progressBar = this.progressBar(processedFiles, totalFiles, 50);
|
|
3504
|
-
console.log(
|
|
3505
|
-
console.log(
|
|
3506
|
-
console.log(
|
|
3507
|
-
console.log(
|
|
3508
|
-
console.log(
|
|
3509
|
-
console.log("
|
|
3510
|
-
console.log("
|
|
3559
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3560
|
+
console.log(v + " " + colors.dim("Scanning:") + " " + colors.highlight(current.slice(0, 40).padEnd(40)) + " ".repeat(Math.max(0, width - 56)) + v);
|
|
3561
|
+
console.log(v + " " + progressBar + " " + colors.highlight(`${percent}%`) + " " + colors.dim(`(${processedFiles}/${totalFiles} files)`) + " ".repeat(Math.max(0, width - 75)) + v);
|
|
3562
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3563
|
+
console.log(sectionBorder);
|
|
3564
|
+
console.log(v + " " + colors.header("SCOUTS") + " ".repeat(width - 11) + v);
|
|
3565
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3511
3566
|
const allAgents = [.../* @__PURE__ */ new Set([...activeAgents, ...completedAgents])];
|
|
3512
3567
|
const waitingAgents = ["security", "privacy", "typecheck", "accessibility", "legal", "test", "moneybags", "production-ready"].filter((a) => !activeAgents.includes(a) && !completedAgents.includes(a));
|
|
3513
3568
|
const leftAgents = [];
|
|
@@ -3516,8 +3571,8 @@ var InteractiveDashboard = class {
|
|
|
3516
3571
|
const isActive = activeAgents.includes(agent);
|
|
3517
3572
|
const isDone = completedAgents.includes(agent);
|
|
3518
3573
|
const icon = isActive ? this.agentIcon("running") : isDone ? this.agentIcon("done") : this.agentIcon("waiting");
|
|
3519
|
-
const
|
|
3520
|
-
const entry = `${icon} ${agent.slice(0, 12).padEnd(12)}
|
|
3574
|
+
const statusText = isActive ? colors.running("analyzing") : isDone ? colors.success(`done (${this.getAgentIssueCount(agent)})`) : colors.waiting("waiting");
|
|
3575
|
+
const entry = `${icon} ${agent.slice(0, 12).padEnd(12)} ${colors.dim("...")} ${statusText}`;
|
|
3521
3576
|
if (i % 2 === 0) {
|
|
3522
3577
|
leftAgents.push(entry);
|
|
3523
3578
|
} else {
|
|
@@ -3525,7 +3580,7 @@ var InteractiveDashboard = class {
|
|
|
3525
3580
|
}
|
|
3526
3581
|
});
|
|
3527
3582
|
waitingAgents.slice(0, 4).forEach((agent, i) => {
|
|
3528
|
-
const entry = `${this.agentIcon("waiting")} ${agent.slice(0, 12).padEnd(12)} ... waiting
|
|
3583
|
+
const entry = `${this.agentIcon("waiting")} ${agent.slice(0, 12).padEnd(12)} ${colors.dim("...")} ${colors.waiting("waiting")}`;
|
|
3529
3584
|
if ((allAgents.length + i) % 2 === 0) {
|
|
3530
3585
|
leftAgents.push(entry);
|
|
3531
3586
|
} else {
|
|
@@ -3536,37 +3591,62 @@ var InteractiveDashboard = class {
|
|
|
3536
3591
|
for (let i = 0; i < maxRows && i < agentRows; i++) {
|
|
3537
3592
|
const left = leftAgents[i] || " ".repeat(35);
|
|
3538
3593
|
const right = rightAgents[i] || " ".repeat(35);
|
|
3539
|
-
console.log(
|
|
3540
|
-
}
|
|
3541
|
-
console.log(
|
|
3542
|
-
console.log(
|
|
3543
|
-
console.log("
|
|
3544
|
-
console.log("
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
console.log("
|
|
3550
|
-
console.log("
|
|
3551
|
-
|
|
3552
|
-
console.log(
|
|
3553
|
-
|
|
3554
|
-
console.log(
|
|
3555
|
-
const
|
|
3556
|
-
console.log(
|
|
3557
|
-
|
|
3558
|
-
console.log("
|
|
3559
|
-
|
|
3594
|
+
console.log(v + " " + left + " " + right + " " + v);
|
|
3595
|
+
}
|
|
3596
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3597
|
+
console.log(sectionBorder);
|
|
3598
|
+
console.log(v + " " + colors.header("ISSUES FOUND") + " ".repeat(width - 17) + v);
|
|
3599
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3600
|
+
const criticalLine = `${colors.critical("[!]")} ${colors.critical("Critical")} ${colors.critical(issuesBySeverity.critical.toString().padStart(4))}`;
|
|
3601
|
+
const moderateLine = `${colors.moderate("[~]")} ${colors.moderate("Moderate")} ${colors.moderate(issuesBySeverity.moderate.toString().padStart(5))}`;
|
|
3602
|
+
const seriousLine = `${colors.serious("[x]")} ${colors.serious("Serious")} ${colors.serious(issuesBySeverity.serious.toString().padStart(4))}`;
|
|
3603
|
+
const lowLine = `${colors.low("[-]")} ${colors.low("Low")} ${colors.low(issuesBySeverity.low.toString().padStart(5))}`;
|
|
3604
|
+
console.log(v + " " + criticalLine + " " + moderateLine + " ".repeat(Math.max(0, width - 60)) + v);
|
|
3605
|
+
console.log(v + " " + seriousLine + " " + lowLine + " ".repeat(Math.max(0, width - 60)) + v);
|
|
3606
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3607
|
+
console.log(sectionBorder);
|
|
3608
|
+
console.log(v + " " + colors.header("WATCH STATUS") + " ".repeat(width - 17) + v);
|
|
3609
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3610
|
+
const watchLine = this.state.watch.watching ? colors.success(`Watching ${this.state.watch.directories} dirs`) + colors.dim(this.state.watch.debounceMs ? ` \u2022 debounce ${this.state.watch.debounceMs}ms` : "") : colors.dim("Watch idle");
|
|
3611
|
+
console.log(v + " " + watchLine + " ".repeat(Math.max(0, width - 40)) + v);
|
|
3612
|
+
const lastChange = this.state.watch.lastChange ? colors.dim("Last change: ") + colors.highlight(this.state.watch.lastChange) : colors.dim("Last change: --");
|
|
3613
|
+
console.log(v + " " + lastChange + " ".repeat(Math.max(0, width - 30)) + v);
|
|
3614
|
+
const recentChange = this.state.watch.recentChanges[0]?.file ? colors.dim("Recent: ") + this.state.watch.recentChanges[0].file : "";
|
|
3615
|
+
console.log(v + " " + recentChange + " ".repeat(Math.max(0, width - 30)) + v);
|
|
3616
|
+
console.log(sectionBorder);
|
|
3617
|
+
console.log(v + " " + colors.header("ACTIVITY LOG") + " ".repeat(width - 17) + v);
|
|
3618
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3560
3619
|
const startIdx = this.state.activityPage * activityRows;
|
|
3561
3620
|
const recentActivity = this.state.activityLog.slice(startIdx, startIdx + activityRows);
|
|
3562
3621
|
for (const entry of recentActivity) {
|
|
3563
|
-
const
|
|
3564
|
-
console.log(
|
|
3622
|
+
const logLine = colors.dim(entry.time) + " " + this.colorizeActivityMessage(entry.message);
|
|
3623
|
+
console.log(v + " " + logLine + " ".repeat(Math.max(0, width - 50)) + v);
|
|
3565
3624
|
}
|
|
3566
3625
|
for (let i = recentActivity.length; i < activityRows; i++) {
|
|
3567
|
-
console.log(
|
|
3626
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3568
3627
|
}
|
|
3569
3628
|
}
|
|
3629
|
+
/**
|
|
3630
|
+
* Colorize activity log messages based on content
|
|
3631
|
+
*/
|
|
3632
|
+
colorizeActivityMessage(message) {
|
|
3633
|
+
if (message.includes("[!]") || message.includes("CRITICAL")) {
|
|
3634
|
+
return colors.critical(message);
|
|
3635
|
+
}
|
|
3636
|
+
if (message.includes("[x]") || message.includes("SERIOUS")) {
|
|
3637
|
+
return colors.serious(message);
|
|
3638
|
+
}
|
|
3639
|
+
if (message.includes("[+]") || message.includes("complete")) {
|
|
3640
|
+
return colors.success(message);
|
|
3641
|
+
}
|
|
3642
|
+
if (message.includes("[*]") || message.includes("started")) {
|
|
3643
|
+
return colors.running(message);
|
|
3644
|
+
}
|
|
3645
|
+
if (message.includes("===")) {
|
|
3646
|
+
return colors.header(message);
|
|
3647
|
+
}
|
|
3648
|
+
return message;
|
|
3649
|
+
}
|
|
3570
3650
|
/**
|
|
3571
3651
|
* Get issue count for an agent
|
|
3572
3652
|
*/
|
|
@@ -3581,49 +3661,51 @@ var InteractiveDashboard = class {
|
|
|
3581
3661
|
const { completedAgents } = this.state.progress;
|
|
3582
3662
|
const elapsed = ((Date.now() - this.state.startTime) / 1e3).toFixed(1);
|
|
3583
3663
|
const activityRows = Math.max(2, Math.min(8, Math.max(0, height - 26)));
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
console.log(
|
|
3587
|
-
console.log("
|
|
3588
|
-
console.log("+" +
|
|
3589
|
-
console.log(
|
|
3590
|
-
console.log(
|
|
3591
|
-
|
|
3592
|
-
console.log(
|
|
3593
|
-
|
|
3594
|
-
console.log(
|
|
3595
|
-
console.log(
|
|
3596
|
-
console.log("
|
|
3664
|
+
const v = colors.border(box.vertical);
|
|
3665
|
+
const sectionBorder = colors.border(box.leftT + this.line(width - 2) + box.rightT);
|
|
3666
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3667
|
+
console.log(v + " " + colors.highlight(`${processedFiles}`) + colors.dim(` files scanned in ${elapsed}s`) + " ".repeat(Math.max(0, width - 35)) + v);
|
|
3668
|
+
console.log(v + " " + colors.highlight(`${completedAgents.length}`) + colors.dim(" scouts activated") + " ".repeat(Math.max(0, width - 30)) + v);
|
|
3669
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3670
|
+
console.log(sectionBorder);
|
|
3671
|
+
console.log(v + " " + colors.header("SUMMARY") + " ".repeat(width - 12) + v);
|
|
3672
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3673
|
+
const criticalLabel = issuesBySeverity.critical > 0 ? colors.alert("<- FIX NOW") : "";
|
|
3674
|
+
console.log(v + " " + colors.critical("[!]") + " " + colors.critical(issuesBySeverity.critical.toString().padStart(4)) + " " + colors.critical("Critical issues") + " " + criticalLabel + " ".repeat(Math.max(0, width - 45)) + v);
|
|
3675
|
+
console.log(v + " " + colors.serious("[x]") + " " + colors.serious(issuesBySeverity.serious.toString().padStart(4)) + " " + colors.serious("Serious issues") + " ".repeat(Math.max(0, width - 30)) + v);
|
|
3676
|
+
console.log(v + " " + colors.moderate("[~]") + " " + colors.moderate(issuesBySeverity.moderate.toString().padStart(4)) + " " + colors.moderate("Moderate issues") + " ".repeat(Math.max(0, width - 30)) + v);
|
|
3677
|
+
console.log(v + " " + colors.low("[-]") + " " + colors.low(issuesBySeverity.low.toString().padStart(4)) + " " + colors.low("Low issues") + " ".repeat(Math.max(0, width - 30)) + v);
|
|
3678
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3597
3679
|
const criticalIssues = this.state.issues.filter((i) => i.severity === "critical").slice(0, 3);
|
|
3598
3680
|
if (criticalIssues.length > 0) {
|
|
3599
|
-
console.log(
|
|
3600
|
-
console.log("
|
|
3601
|
-
console.log("
|
|
3681
|
+
console.log(sectionBorder);
|
|
3682
|
+
console.log(v + " " + colors.critical("TOP CRITICAL ISSUES") + " ".repeat(width - 24) + v);
|
|
3683
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3602
3684
|
for (const issue of criticalIssues) {
|
|
3603
3685
|
const filename = issue.file.split("/").pop() || issue.file;
|
|
3604
|
-
const
|
|
3605
|
-
const location = `${filename}${
|
|
3686
|
+
const lineNum = issue.line ? `:${issue.line}` : "";
|
|
3687
|
+
const location = `${filename}${lineNum}`;
|
|
3606
3688
|
const description = issue.issue.slice(0, 40) + (issue.issue.length > 40 ? "..." : "");
|
|
3607
|
-
console.log(
|
|
3608
|
-
console.log(
|
|
3609
|
-
console.log(
|
|
3689
|
+
console.log(v + " " + colors.critical("\u25B8") + " " + colors.critical(description) + " ".repeat(Math.max(0, width - 50)) + v);
|
|
3690
|
+
console.log(v + " " + colors.dim(location) + " ".repeat(Math.max(0, width - 30)) + v);
|
|
3691
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3610
3692
|
}
|
|
3611
3693
|
} else if (totalIssues === 0) {
|
|
3612
|
-
console.log(
|
|
3613
|
-
console.log("
|
|
3614
|
-
console.log(
|
|
3694
|
+
console.log(sectionBorder);
|
|
3695
|
+
console.log(v + " " + colors.success("\u2713 No issues found - code looks good!") + " ".repeat(Math.max(0, width - 45)) + v);
|
|
3696
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3615
3697
|
}
|
|
3616
|
-
console.log(
|
|
3617
|
-
console.log("
|
|
3618
|
-
console.log("
|
|
3698
|
+
console.log(sectionBorder);
|
|
3699
|
+
console.log(v + " " + colors.header("ACTIVITY LOG") + " ".repeat(width - 17) + v);
|
|
3700
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3619
3701
|
const startIdx = this.state.activityPage * activityRows;
|
|
3620
3702
|
const recentActivity = this.state.activityLog.slice(startIdx, startIdx + activityRows);
|
|
3621
3703
|
for (const entry of recentActivity) {
|
|
3622
|
-
const
|
|
3623
|
-
console.log(
|
|
3704
|
+
const logLine = colors.dim(entry.time) + " " + this.colorizeActivityMessage(entry.message);
|
|
3705
|
+
console.log(v + " " + logLine + " ".repeat(Math.max(0, width - 50)) + v);
|
|
3624
3706
|
}
|
|
3625
3707
|
for (let i = recentActivity.length; i < activityRows; i++) {
|
|
3626
|
-
console.log(
|
|
3708
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3627
3709
|
}
|
|
3628
3710
|
}
|
|
3629
3711
|
/**
|
|
@@ -3632,8 +3714,10 @@ var InteractiveDashboard = class {
|
|
|
3632
3714
|
renderIssuesList(width) {
|
|
3633
3715
|
const filteredIssues = this.getFilteredIssues();
|
|
3634
3716
|
const { selectedIssue } = this.state;
|
|
3635
|
-
|
|
3636
|
-
|
|
3717
|
+
const v = colors.border(box.vertical);
|
|
3718
|
+
const sectionBorder = colors.border(box.leftT + this.line(width - 2) + box.rightT);
|
|
3719
|
+
console.log(v + " " + colors.dim("Filter:") + " " + this.getFilterDescription() + " ".repeat(Math.max(0, width - 25)) + v);
|
|
3720
|
+
console.log(sectionBorder);
|
|
3637
3721
|
const pageSize = 10;
|
|
3638
3722
|
const startIndex = Math.floor(selectedIssue / pageSize) * pageSize;
|
|
3639
3723
|
const pageIssues = filteredIssues.slice(startIndex, startIndex + pageSize);
|
|
@@ -3641,29 +3725,29 @@ var InteractiveDashboard = class {
|
|
|
3641
3725
|
const issue = pageIssues[i];
|
|
3642
3726
|
const globalIndex = startIndex + i;
|
|
3643
3727
|
const isSelected = globalIndex === selectedIssue;
|
|
3644
|
-
const cursor = isSelected ? "
|
|
3728
|
+
const cursor = isSelected ? colors.selected("\u25B8") : " ";
|
|
3645
3729
|
const severityIcon = this.severityIcon(issue.severity);
|
|
3646
3730
|
const filename = issue.file.split("/").pop() || issue.file;
|
|
3647
|
-
const location = `${filename}:${issue.line || "?"}
|
|
3731
|
+
const location = colors.dim(`${filename}:${issue.line || "?"}`);
|
|
3648
3732
|
const description = issue.issue.slice(0, 35) + (issue.issue.length > 35 ? "..." : "");
|
|
3649
|
-
const
|
|
3650
|
-
console.log(
|
|
3733
|
+
const descText = isSelected ? colors.selected(description) : description;
|
|
3734
|
+
console.log(v + " " + severityIcon + " " + cursor + " " + descText + " " + location + " ".repeat(Math.max(0, width - 70)) + v);
|
|
3651
3735
|
}
|
|
3652
3736
|
for (let i = pageIssues.length; i < pageSize; i++) {
|
|
3653
|
-
console.log(
|
|
3737
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3654
3738
|
}
|
|
3655
3739
|
if (filteredIssues[selectedIssue]) {
|
|
3656
3740
|
const selected = filteredIssues[selectedIssue];
|
|
3657
|
-
console.log(
|
|
3658
|
-
console.log("
|
|
3659
|
-
console.log("
|
|
3660
|
-
console.log(
|
|
3661
|
-
console.log(
|
|
3662
|
-
console.log(
|
|
3741
|
+
console.log(sectionBorder);
|
|
3742
|
+
console.log(v + " " + colors.header("SELECTED:") + " " + colors.highlight(selected.issue.slice(0, width - 20)) + " ".repeat(Math.max(0, width - 60)) + v);
|
|
3743
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3744
|
+
console.log(v + " " + colors.dim("File:") + " " + selected.file.slice(0, width - 15) + " ".repeat(Math.max(0, width - 50)) + v);
|
|
3745
|
+
console.log(v + " " + colors.dim("Line:") + " " + (selected.line || "Unknown") + " " + colors.dim("Scout:") + " " + selected.agent + " ".repeat(Math.max(0, width - 40)) + v);
|
|
3746
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3663
3747
|
const fixLines = this.wrapText(selected.fix, width - 8);
|
|
3664
|
-
console.log("
|
|
3748
|
+
console.log(v + " " + colors.success("Fix:") + " ".repeat(Math.max(0, width - 10)) + v);
|
|
3665
3749
|
for (const line of fixLines.slice(0, 2)) {
|
|
3666
|
-
console.log(
|
|
3750
|
+
console.log(v + " " + colors.success(line) + " ".repeat(Math.max(0, width - line.length - 10)) + v);
|
|
3667
3751
|
}
|
|
3668
3752
|
}
|
|
3669
3753
|
}
|
|
@@ -3671,52 +3755,55 @@ var InteractiveDashboard = class {
|
|
|
3671
3755
|
* Render agents view
|
|
3672
3756
|
*/
|
|
3673
3757
|
renderAgentsView(width) {
|
|
3674
|
-
const
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
status: meta.status,
|
|
3678
|
-
duration: meta.durationMs ? `${(meta.durationMs / 1e3).toFixed(1)}s` : "\u2014",
|
|
3679
|
-
issues: meta.issues ?? 0,
|
|
3680
|
-
start: meta.start,
|
|
3681
|
-
end: meta.end
|
|
3682
|
-
};
|
|
3683
|
-
});
|
|
3684
|
-
for (const name of this.state.progress.activeAgents) {
|
|
3685
|
-
if (!this.state.agents[name]) {
|
|
3686
|
-
agentEntries.push({ name, status: "running", duration: "\u2014", issues: 0, start: void 0, end: void 0 });
|
|
3687
|
-
}
|
|
3688
|
-
}
|
|
3689
|
-
for (const name of this.state.progress.completedAgents) {
|
|
3690
|
-
if (!this.state.agents[name]) {
|
|
3691
|
-
agentEntries.push({ name, status: "done", duration: "\u2014", issues: this.getAgentIssueCount(name), start: void 0, end: void 0 });
|
|
3692
|
-
}
|
|
3693
|
-
}
|
|
3694
|
-
const order = { running: 0, queued: 1, done: 2 };
|
|
3695
|
-
const sorted = agentEntries.sort((a, b) => {
|
|
3696
|
-
return order[a.status] - order[b.status] || a.name.localeCompare(b.name);
|
|
3697
|
-
});
|
|
3758
|
+
const v = colors.border(box.vertical);
|
|
3759
|
+
const sectionBorder = colors.border(box.leftT + this.line(width - 2) + box.rightT);
|
|
3760
|
+
const sorted = this.getSortedAgents();
|
|
3698
3761
|
const pageSize = 6;
|
|
3699
3762
|
const startIdx = this.state.agentPage * pageSize;
|
|
3700
3763
|
const slice = sorted.slice(startIdx, startIdx + pageSize);
|
|
3701
|
-
console.log("
|
|
3702
|
-
console.log(
|
|
3703
|
-
console.log(
|
|
3764
|
+
console.log(v + " " + colors.header("SCOUT STATUS") + " " + colors.dim("(Enter to view issues, j/k to navigate)") + " ".repeat(Math.max(0, width - 60)) + v);
|
|
3765
|
+
console.log(sectionBorder);
|
|
3766
|
+
console.log(v + " " + colors.dim(`Page ${this.state.agentPage + 1} / ${Math.max(1, Math.ceil(sorted.length / pageSize))}`) + " ".repeat(Math.max(0, width - 20)) + v);
|
|
3704
3767
|
if (slice.length === 0) {
|
|
3705
|
-
console.log("
|
|
3768
|
+
console.log(v + " " + colors.dim("No scouts yet") + " ".repeat(Math.max(0, width - 20)) + v);
|
|
3706
3769
|
return;
|
|
3707
3770
|
}
|
|
3708
|
-
console.log("
|
|
3709
|
-
console.log("
|
|
3710
|
-
for (
|
|
3711
|
-
const
|
|
3712
|
-
|
|
3713
|
-
|
|
3771
|
+
console.log(v + " " + colors.dim("Name Status Issues Duration") + " ".repeat(Math.max(0, width - 58)) + v);
|
|
3772
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3773
|
+
for (let i = 0; i < slice.length; i++) {
|
|
3774
|
+
const agent = slice[i];
|
|
3775
|
+
if (!agent) continue;
|
|
3776
|
+
const globalIdx = startIdx + i;
|
|
3777
|
+
const isSelected = globalIdx === this.state.selectedAgent;
|
|
3778
|
+
const cursor = isSelected ? colors.selected("\u25B8") : " ";
|
|
3779
|
+
const statusIcon = agent.status === "running" ? this.agentIcon("running") : agent.status === "done" ? this.agentIcon("done") : this.agentIcon("waiting");
|
|
3780
|
+
const statusText = agent.status === "running" ? colors.running(agent.status.padEnd(9)) : agent.status === "done" ? colors.success(agent.status.padEnd(9)) : colors.waiting(agent.status.padEnd(9));
|
|
3781
|
+
const issueCount = agent.issues > 0 ? colors.serious(agent.issues.toString().padStart(6)) : colors.dim(agent.issues.toString().padStart(6));
|
|
3782
|
+
const duration = colors.dim(agent.duration.padEnd(8));
|
|
3783
|
+
const nameText = isSelected ? colors.selected(agent.name.padEnd(18)) : agent.name.padEnd(18);
|
|
3784
|
+
console.log(v + " " + cursor + " " + statusIcon + " " + nameText + " " + statusText + " " + issueCount + " " + duration + " ".repeat(Math.max(0, width - 65)) + v);
|
|
3785
|
+
}
|
|
3786
|
+
for (let i = slice.length; i < pageSize; i++) {
|
|
3787
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3788
|
+
}
|
|
3789
|
+
const selected = sorted[this.state.selectedAgent];
|
|
3790
|
+
if (selected) {
|
|
3791
|
+
const agentIssues = this.state.issues.filter((i) => i.agent === selected.name);
|
|
3792
|
+
const criticals = agentIssues.filter((i) => i.severity === "critical").length;
|
|
3793
|
+
const serious = agentIssues.filter((i) => i.severity === "serious").length;
|
|
3794
|
+
console.log(sectionBorder);
|
|
3795
|
+
console.log(v + " " + colors.header("SELECTED:") + " " + colors.highlight(selected.name) + " ".repeat(Math.max(0, width - 30)) + v);
|
|
3796
|
+
console.log(v + " " + colors.dim(this.line(width - 6)) + " " + v);
|
|
3797
|
+
console.log(v + " " + colors.dim("Issues:") + " " + colors.highlight(agentIssues.length.toString()) + " total (" + colors.critical(`[!] ${criticals} critical`) + ", " + colors.serious(`[x] ${serious} serious`) + ")" + " ".repeat(Math.max(0, width - 65)) + v);
|
|
3798
|
+
console.log(v + " " + colors.dim("Press Enter to view all issues from this scout") + " ".repeat(Math.max(0, width - 55)) + v);
|
|
3714
3799
|
}
|
|
3715
3800
|
}
|
|
3716
3801
|
/**
|
|
3717
3802
|
* Render files view
|
|
3718
3803
|
*/
|
|
3719
3804
|
renderFilesView(width) {
|
|
3805
|
+
const v = colors.border(box.vertical);
|
|
3806
|
+
const sectionBorder = colors.border(box.leftT + this.line(width - 2) + box.rightT);
|
|
3720
3807
|
const fileIssues = /* @__PURE__ */ new Map();
|
|
3721
3808
|
for (const issue of this.state.issues) {
|
|
3722
3809
|
if (!fileIssues.has(issue.file)) {
|
|
@@ -3725,25 +3812,38 @@ var InteractiveDashboard = class {
|
|
|
3725
3812
|
fileIssues.get(issue.file).push(issue);
|
|
3726
3813
|
}
|
|
3727
3814
|
const sortedFiles = Array.from(fileIssues.entries()).sort((a, b) => b[1].length - a[1].length).slice(0, 15);
|
|
3728
|
-
console.log("
|
|
3729
|
-
console.log(
|
|
3815
|
+
console.log(v + " " + colors.header("FILES WITH ISSUES") + " ".repeat(width - 22) + v);
|
|
3816
|
+
console.log(sectionBorder);
|
|
3730
3817
|
for (const [file, issues] of sortedFiles) {
|
|
3731
3818
|
const filename = file.split("/").pop() || file;
|
|
3732
3819
|
const criticalCount = issues.filter((i) => i.severity === "critical").length;
|
|
3733
3820
|
const totalCount = issues.length;
|
|
3734
|
-
const criticalText = criticalCount > 0 ? ` (${criticalCount} critical)` : "";
|
|
3735
|
-
|
|
3821
|
+
const criticalText = criticalCount > 0 ? colors.critical(` (${criticalCount} critical)`) : "";
|
|
3822
|
+
const countText = criticalCount > 0 ? colors.serious(`${totalCount} issues`) : colors.dim(`${totalCount} issues`);
|
|
3823
|
+
console.log(v + " " + filename.padEnd(35) + " " + countText + criticalText + " ".repeat(Math.max(0, width - 60)) + v);
|
|
3824
|
+
}
|
|
3825
|
+
for (let i = sortedFiles.length; i < 10; i++) {
|
|
3826
|
+
console.log(v + " ".repeat(width - 2) + v);
|
|
3736
3827
|
}
|
|
3737
3828
|
}
|
|
3738
3829
|
/**
|
|
3739
3830
|
* Render footer with controls
|
|
3740
3831
|
*/
|
|
3741
3832
|
renderFooter(width) {
|
|
3742
|
-
|
|
3833
|
+
const bottomBorder = colors.border(box.bottomLeft + this.line(width - 2) + box.bottomRight);
|
|
3834
|
+
console.log(bottomBorder);
|
|
3835
|
+
const key = (k) => colors.border("[") + colors.highlight(k) + colors.border("]");
|
|
3836
|
+
const hint = (k, desc) => key(k) + colors.dim(` ${desc}`);
|
|
3743
3837
|
if (!this.state.scanComplete) {
|
|
3744
|
-
console.log("
|
|
3838
|
+
console.log(" " + hint("q", "Quit") + " " + hint("?", "Help"));
|
|
3839
|
+
} else if (this.state.view === "agents") {
|
|
3840
|
+
console.log(" " + hint("j/k", "Select") + " " + hint("Enter", "View issues") + " " + hint("n/p", "Pages") + " " + hint("Tab", "Views") + " " + hint("?", "Help") + " " + hint("q", "Quit"));
|
|
3841
|
+
} else if (this.state.view === "issues" && this.state.previousView === "agents") {
|
|
3842
|
+
console.log(" " + hint("b", "Back") + " " + hint("j/k", "Nav") + " " + hint("Enter", "Details") + " " + hint("1-4", "Severity") + " " + hint("f", "Search") + " " + hint("?", "Help") + " " + hint("q", "Quit"));
|
|
3843
|
+
} else if (this.state.view === "issues") {
|
|
3844
|
+
console.log(" " + hint("j/k", "Nav") + " " + hint("Enter", "Details") + " " + hint("1-4", "Severity") + " " + hint("f", "Search") + " " + hint("s", "Scout") + " " + hint("c", "Clear") + " " + hint("Tab", "Views") + " " + hint("?", "Help") + " " + hint("q", "Quit"));
|
|
3745
3845
|
} else {
|
|
3746
|
-
console.log("
|
|
3846
|
+
console.log(" " + hint("Tab", "Views") + " " + hint("n/p", "Pages") + " " + hint("?", "Help") + " " + hint("q", "Quit"));
|
|
3747
3847
|
}
|
|
3748
3848
|
}
|
|
3749
3849
|
// Helper methods
|
|
@@ -3757,14 +3857,48 @@ var InteractiveDashboard = class {
|
|
|
3757
3857
|
navigateUp() {
|
|
3758
3858
|
if (this.state.view === "issues") {
|
|
3759
3859
|
this.state.selectedIssue = Math.max(0, this.state.selectedIssue - 1);
|
|
3860
|
+
} else if (this.state.view === "agents") {
|
|
3861
|
+
this.state.selectedAgent = Math.max(0, this.state.selectedAgent - 1);
|
|
3862
|
+
const pageSize = 6;
|
|
3863
|
+
const page = Math.floor(this.state.selectedAgent / pageSize);
|
|
3864
|
+
if (page !== this.state.agentPage) {
|
|
3865
|
+
this.state.agentPage = page;
|
|
3866
|
+
}
|
|
3760
3867
|
}
|
|
3761
3868
|
}
|
|
3762
3869
|
navigateDown() {
|
|
3763
3870
|
if (this.state.view === "issues") {
|
|
3764
3871
|
const filteredIssues = this.getFilteredIssues();
|
|
3765
3872
|
this.state.selectedIssue = Math.min(filteredIssues.length - 1, this.state.selectedIssue + 1);
|
|
3873
|
+
} else if (this.state.view === "agents") {
|
|
3874
|
+
const agents = this.getSortedAgents();
|
|
3875
|
+
this.state.selectedAgent = Math.min(agents.length - 1, this.state.selectedAgent + 1);
|
|
3876
|
+
const pageSize = 6;
|
|
3877
|
+
const page = Math.floor(this.state.selectedAgent / pageSize);
|
|
3878
|
+
if (page !== this.state.agentPage) {
|
|
3879
|
+
this.state.agentPage = page;
|
|
3880
|
+
}
|
|
3766
3881
|
}
|
|
3767
3882
|
}
|
|
3883
|
+
getSortedAgents() {
|
|
3884
|
+
const agentEntries = [];
|
|
3885
|
+
for (const [name, data] of Object.entries(this.state.agents)) {
|
|
3886
|
+
const duration = data.durationMs ? `${(data.durationMs / 1e3).toFixed(1)}s` : "\u2014";
|
|
3887
|
+
agentEntries.push({ name, status: data.status, issues: data.issues, duration });
|
|
3888
|
+
}
|
|
3889
|
+
for (const name of this.state.progress.activeAgents) {
|
|
3890
|
+
if (!this.state.agents[name]) {
|
|
3891
|
+
agentEntries.push({ name, status: "running", issues: 0, duration: "\u2014" });
|
|
3892
|
+
}
|
|
3893
|
+
}
|
|
3894
|
+
for (const name of this.state.progress.completedAgents) {
|
|
3895
|
+
if (!this.state.agents[name]) {
|
|
3896
|
+
agentEntries.push({ name, status: "done", issues: this.getAgentIssueCount(name), duration: "\u2014" });
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
const order = { running: 0, queued: 1, done: 2 };
|
|
3900
|
+
return agentEntries.sort((a, b) => (order[a.status] ?? 2) - (order[b.status] ?? 2) || a.name.localeCompare(b.name));
|
|
3901
|
+
}
|
|
3768
3902
|
nextPage() {
|
|
3769
3903
|
if (this.state.view === "agents") {
|
|
3770
3904
|
const total = Math.max(1, Math.ceil(Object.keys(this.state.agents).length / 6));
|
|
@@ -3788,6 +3922,24 @@ var InteractiveDashboard = class {
|
|
|
3788
3922
|
if (selected) {
|
|
3789
3923
|
this.showIssueDetails(selected);
|
|
3790
3924
|
}
|
|
3925
|
+
} else if (this.state.view === "agents") {
|
|
3926
|
+
const agents = this.getSortedAgents();
|
|
3927
|
+
const selected = agents[this.state.selectedAgent];
|
|
3928
|
+
if (selected) {
|
|
3929
|
+
this.state.previousView = "agents";
|
|
3930
|
+
this.state.filter.agent = selected.name;
|
|
3931
|
+
this.state.selectedIssue = 0;
|
|
3932
|
+
this.state.view = "issues";
|
|
3933
|
+
}
|
|
3934
|
+
}
|
|
3935
|
+
}
|
|
3936
|
+
goBack() {
|
|
3937
|
+
if (this.state.previousView) {
|
|
3938
|
+
if (this.state.previousView === "agents" && this.state.filter.agent !== "all") {
|
|
3939
|
+
this.state.filter.agent = "all";
|
|
3940
|
+
}
|
|
3941
|
+
this.state.view = this.state.previousView;
|
|
3942
|
+
this.state.previousView = null;
|
|
3791
3943
|
}
|
|
3792
3944
|
}
|
|
3793
3945
|
setFilter(type, value) {
|
|
@@ -3819,7 +3971,7 @@ var InteractiveDashboard = class {
|
|
|
3819
3971
|
getFilterDescription() {
|
|
3820
3972
|
const parts = [];
|
|
3821
3973
|
if (this.state.filter.severity !== "all") parts.push(`Severity: ${this.state.filter.severity}`);
|
|
3822
|
-
if (this.state.filter.agent !== "all") parts.push(`
|
|
3974
|
+
if (this.state.filter.agent !== "all") parts.push(`Scout: ${this.state.filter.agent}`);
|
|
3823
3975
|
if (this.state.filter.search) parts.push(`Search: "${this.state.filter.search}"`);
|
|
3824
3976
|
return parts.length > 0 ? parts.join(", ") : "All issues";
|
|
3825
3977
|
}
|
|
@@ -3839,38 +3991,108 @@ var InteractiveDashboard = class {
|
|
|
3839
3991
|
return lines;
|
|
3840
3992
|
}
|
|
3841
3993
|
async promptFilter() {
|
|
3994
|
+
if (this.updateInterval) {
|
|
3995
|
+
clearInterval(this.updateInterval);
|
|
3996
|
+
this.updateInterval = void 0;
|
|
3997
|
+
}
|
|
3842
3998
|
if (input.isTTY) {
|
|
3843
3999
|
input.setRawMode(false);
|
|
3844
4000
|
}
|
|
3845
|
-
|
|
4001
|
+
const v = colors.border(box.vertical);
|
|
4002
|
+
const w = 62;
|
|
4003
|
+
process.stdout.write("\x1B[2J\x1B[H\x1B[?25h");
|
|
4004
|
+
console.log(colors.border(box.topLeft + this.line(w - 2) + box.topRight));
|
|
4005
|
+
console.log(v + " " + colors.header("FILTER ISSUES") + " ".repeat(w - 18) + v);
|
|
4006
|
+
console.log(colors.border(box.leftT + this.line(w - 2) + box.rightT));
|
|
4007
|
+
console.log(v + " " + colors.dim("Current filters:") + " ".repeat(w - 21) + v);
|
|
4008
|
+
console.log(v + " " + colors.dim("Severity:") + " " + colors.highlight(this.state.filter.severity) + " ".repeat(Math.max(0, w - 20)) + v);
|
|
4009
|
+
console.log(v + " " + colors.dim("Scout:") + " " + colors.highlight(this.state.filter.agent) + " ".repeat(Math.max(0, w - 18)) + v);
|
|
4010
|
+
console.log(v + " " + colors.dim("Search:") + " " + colors.highlight(this.state.filter.search || "(none)") + " ".repeat(Math.max(0, w - 20)) + v);
|
|
4011
|
+
console.log(colors.border(box.bottomLeft + this.line(w - 2) + box.bottomRight));
|
|
4012
|
+
console.log("");
|
|
4013
|
+
this.rl.question(colors.border("\u25B8 ") + "Enter search term (empty to clear): ", (answer) => {
|
|
3846
4014
|
this.state.filter.search = answer.trim();
|
|
3847
4015
|
this.state.selectedIssue = 0;
|
|
3848
4016
|
if (input.isTTY) {
|
|
3849
4017
|
input.setRawMode(true);
|
|
3850
4018
|
}
|
|
4019
|
+
this.startUpdateLoop();
|
|
4020
|
+
this.render();
|
|
4021
|
+
});
|
|
4022
|
+
}
|
|
4023
|
+
async promptAgentFilter() {
|
|
4024
|
+
if (this.updateInterval) {
|
|
4025
|
+
clearInterval(this.updateInterval);
|
|
4026
|
+
this.updateInterval = void 0;
|
|
4027
|
+
}
|
|
4028
|
+
if (input.isTTY) {
|
|
4029
|
+
input.setRawMode(false);
|
|
4030
|
+
}
|
|
4031
|
+
const agents = [.../* @__PURE__ */ new Set([
|
|
4032
|
+
...this.state.progress.completedAgents,
|
|
4033
|
+
...this.state.progress.activeAgents,
|
|
4034
|
+
...Object.keys(this.state.agents)
|
|
4035
|
+
])].sort();
|
|
4036
|
+
const v = colors.border(box.vertical);
|
|
4037
|
+
const w = 62;
|
|
4038
|
+
process.stdout.write("\x1B[2J\x1B[H\x1B[?25h");
|
|
4039
|
+
console.log(colors.border(box.topLeft + this.line(w - 2) + box.topRight));
|
|
4040
|
+
console.log(v + " " + colors.header("FILTER BY SCOUT") + " ".repeat(w - 20) + v);
|
|
4041
|
+
console.log(colors.border(box.leftT + this.line(w - 2) + box.rightT));
|
|
4042
|
+
console.log(v + " " + colors.dim("Current scout filter:") + " " + colors.highlight(this.state.filter.agent) + " ".repeat(Math.max(0, w - 30)) + v);
|
|
4043
|
+
console.log(colors.border(box.leftT + this.line(w - 2) + box.rightT));
|
|
4044
|
+
console.log(v + " " + colors.dim("Available scouts:") + " ".repeat(w - 22) + v);
|
|
4045
|
+
for (const agent of agents.slice(0, 10)) {
|
|
4046
|
+
console.log(v + " " + colors.success("\u2022") + " " + agent + " ".repeat(Math.max(0, w - agent.length - 8)) + v);
|
|
4047
|
+
}
|
|
4048
|
+
if (agents.length > 10) {
|
|
4049
|
+
console.log(v + " " + colors.dim(`... and ${agents.length - 10} more`) + " ".repeat(Math.max(0, w - 25)) + v);
|
|
4050
|
+
}
|
|
4051
|
+
console.log(colors.border(box.bottomLeft + this.line(w - 2) + box.bottomRight));
|
|
4052
|
+
console.log("");
|
|
4053
|
+
this.rl.question(colors.border("\u25B8 ") + "Enter scout name (empty for all): ", (answer) => {
|
|
4054
|
+
const trimmed = answer.trim();
|
|
4055
|
+
if (trimmed === "" || trimmed.toLowerCase() === "all") {
|
|
4056
|
+
this.state.filter.agent = "all";
|
|
4057
|
+
} else {
|
|
4058
|
+
const match = agents.find((a) => a.toLowerCase().includes(trimmed.toLowerCase()));
|
|
4059
|
+
this.state.filter.agent = match || trimmed;
|
|
4060
|
+
}
|
|
4061
|
+
this.state.selectedIssue = 0;
|
|
4062
|
+
if (input.isTTY) {
|
|
4063
|
+
input.setRawMode(true);
|
|
4064
|
+
}
|
|
4065
|
+
this.startUpdateLoop();
|
|
3851
4066
|
this.render();
|
|
3852
4067
|
});
|
|
3853
4068
|
}
|
|
3854
4069
|
showHelp() {
|
|
3855
4070
|
this.isActive = false;
|
|
3856
4071
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
console.log(
|
|
3860
|
-
console.log("
|
|
3861
|
-
console.log(
|
|
3862
|
-
console.log("
|
|
3863
|
-
console.log("
|
|
3864
|
-
console.log("
|
|
3865
|
-
console.log("
|
|
3866
|
-
console.log("
|
|
3867
|
-
console.log("
|
|
3868
|
-
console.log(
|
|
3869
|
-
console.log("
|
|
3870
|
-
console.log("
|
|
3871
|
-
console.log("
|
|
3872
|
-
console.log(
|
|
3873
|
-
console.log("
|
|
4072
|
+
const v = colors.border(box.vertical);
|
|
4073
|
+
const w = 68;
|
|
4074
|
+
console.log(colors.border(box.topLeft + this.line(w - 2) + box.topRight));
|
|
4075
|
+
console.log(v + " " + colors.brand("TRIE GUARDIAN") + " " + colors.dim("-") + " " + colors.header("HELP") + " ".repeat(w - 26) + v);
|
|
4076
|
+
console.log(colors.border(box.leftT + this.line(w - 2) + box.rightT));
|
|
4077
|
+
console.log(v + " " + colors.header("Navigation") + " ".repeat(w - 15) + v);
|
|
4078
|
+
console.log(v + " " + colors.highlight("Tab") + " " + colors.dim("Switch view (overview/issues/scouts/files)") + " ".repeat(w - 56) + v);
|
|
4079
|
+
console.log(v + " " + colors.highlight("j/k") + " " + colors.dim("Navigate up/down in lists") + " ".repeat(w - 40) + v);
|
|
4080
|
+
console.log(v + " " + colors.highlight("n/p") + " " + colors.dim("Next/previous page") + " ".repeat(w - 33) + v);
|
|
4081
|
+
console.log(v + " " + colors.highlight("Enter") + " " + colors.dim("View details / drill into scout") + " ".repeat(w - 46) + v);
|
|
4082
|
+
console.log(v + " " + colors.highlight("b") + " " + colors.dim("Go back (after drilling into scout)") + " ".repeat(w - 50) + v);
|
|
4083
|
+
console.log(v + " ".repeat(w - 2) + v);
|
|
4084
|
+
console.log(v + " " + colors.header("Filters") + " ".repeat(w - 12) + v);
|
|
4085
|
+
console.log(v + " " + colors.highlight("1-4") + " " + colors.dim("Filter by severity (1=critical, 4=low)") + " ".repeat(w - 53) + v);
|
|
4086
|
+
console.log(v + " " + colors.highlight("0") + " " + colors.dim("Show all severities") + " ".repeat(w - 34) + v);
|
|
4087
|
+
console.log(v + " " + colors.highlight("f") + " " + colors.dim("Search issues by text") + " ".repeat(w - 36) + v);
|
|
4088
|
+
console.log(v + " " + colors.highlight("s") + " " + colors.dim("Filter by scout name") + " ".repeat(w - 35) + v);
|
|
4089
|
+
console.log(v + " " + colors.highlight("c") + " " + colors.dim("Clear all filters") + " ".repeat(w - 32) + v);
|
|
4090
|
+
console.log(v + " ".repeat(w - 2) + v);
|
|
4091
|
+
console.log(v + " " + colors.header("Other") + " ".repeat(w - 10) + v);
|
|
4092
|
+
console.log(v + " " + colors.highlight("h") + " or " + colors.highlight("?") + " " + colors.dim("Show this help") + " ".repeat(w - 31) + v);
|
|
4093
|
+
console.log(v + " " + colors.highlight("q") + " or " + colors.highlight("Esc") + " " + colors.dim("Quit") + " ".repeat(w - 23) + v);
|
|
4094
|
+
console.log(colors.border(box.bottomLeft + this.line(w - 2) + box.bottomRight));
|
|
4095
|
+
console.log(" " + colors.dim("Press any key to return..."));
|
|
3874
4096
|
const resume = () => {
|
|
3875
4097
|
this.isActive = true;
|
|
3876
4098
|
this.render();
|
|
@@ -3880,25 +4102,28 @@ var InteractiveDashboard = class {
|
|
|
3880
4102
|
showIssueDetails(issue) {
|
|
3881
4103
|
this.isActive = false;
|
|
3882
4104
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
console.log(
|
|
3887
|
-
console.log(
|
|
3888
|
-
console.log(
|
|
3889
|
-
console.log("
|
|
3890
|
-
|
|
4105
|
+
const v = colors.border(box.vertical);
|
|
4106
|
+
const w = 68;
|
|
4107
|
+
const severityColor = issue.severity === "critical" ? colors.critical : issue.severity === "serious" ? colors.serious : issue.severity === "moderate" ? colors.moderate : colors.low;
|
|
4108
|
+
console.log(colors.border(box.topLeft + this.line(w - 2) + box.topRight));
|
|
4109
|
+
console.log(v + " " + colors.header("ISSUE DETAILS") + " " + severityColor(`[${issue.severity.toUpperCase()}]`) + " ".repeat(Math.max(0, w - 30)) + v);
|
|
4110
|
+
console.log(colors.border(box.leftT + this.line(w - 2) + box.rightT));
|
|
4111
|
+
console.log(v + " " + colors.dim("File:") + " " + issue.file.slice(0, w - 12) + " ".repeat(Math.max(0, w - issue.file.length - 10)) + v);
|
|
4112
|
+
console.log(v + " " + colors.dim("Line:") + " " + (issue.line || "Unknown") + " " + colors.dim("Scout:") + " " + issue.agent + " ".repeat(Math.max(0, w - 40)) + v);
|
|
4113
|
+
console.log(colors.border(box.leftT + this.line(w - 2) + box.rightT));
|
|
4114
|
+
console.log(v + " " + colors.header("Issue") + " ".repeat(w - 10) + v);
|
|
4115
|
+
const issueLines = this.wrapText(issue.issue, w - 8);
|
|
3891
4116
|
for (const line of issueLines.slice(0, 4)) {
|
|
3892
|
-
console.log(
|
|
4117
|
+
console.log(v + " " + severityColor(line) + " ".repeat(Math.max(0, w - line.length - 6)) + v);
|
|
3893
4118
|
}
|
|
3894
|
-
console.log(
|
|
3895
|
-
console.log("
|
|
3896
|
-
const fixLines = this.wrapText(issue.fix,
|
|
4119
|
+
console.log(colors.border(box.leftT + this.line(w - 2) + box.rightT));
|
|
4120
|
+
console.log(v + " " + colors.success("Fix") + " ".repeat(w - 8) + v);
|
|
4121
|
+
const fixLines = this.wrapText(issue.fix, w - 8);
|
|
3897
4122
|
for (const line of fixLines.slice(0, 4)) {
|
|
3898
|
-
console.log(
|
|
4123
|
+
console.log(v + " " + colors.success(line) + " ".repeat(Math.max(0, w - line.length - 6)) + v);
|
|
3899
4124
|
}
|
|
3900
|
-
console.log(
|
|
3901
|
-
console.log(" Press any key to return...");
|
|
4125
|
+
console.log(colors.border(box.bottomLeft + this.line(w - 2) + box.bottomRight));
|
|
4126
|
+
console.log(" " + colors.dim("Press any key to return..."));
|
|
3902
4127
|
const resume = () => {
|
|
3903
4128
|
this.isActive = true;
|
|
3904
4129
|
this.render();
|
|
@@ -4652,13 +4877,13 @@ ${overdueAssignments.length} issues are overdue and require attention.`
|
|
|
4652
4877
|
* Get color for assignment priority
|
|
4653
4878
|
*/
|
|
4654
4879
|
getAssignmentColor(priority) {
|
|
4655
|
-
const
|
|
4880
|
+
const colors2 = {
|
|
4656
4881
|
urgent: "danger",
|
|
4657
4882
|
high: "warning",
|
|
4658
4883
|
medium: "good",
|
|
4659
4884
|
low: "#36a64f"
|
|
4660
4885
|
};
|
|
4661
|
-
return
|
|
4886
|
+
return colors2[priority] ?? "good";
|
|
4662
4887
|
}
|
|
4663
4888
|
/**
|
|
4664
4889
|
* Test Slack connection
|
|
@@ -5925,4 +6150,4 @@ export {
|
|
|
5925
6150
|
InteractiveDashboard,
|
|
5926
6151
|
TrieScanTool
|
|
5927
6152
|
};
|
|
5928
|
-
//# sourceMappingURL=chunk-
|
|
6153
|
+
//# sourceMappingURL=chunk-3XZO27U7.js.map
|