@triedotdev/mcp 1.0.51 → 1.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-smith-BECRZH73.js → agent-smith-MCTLZS2P.js} +2 -2
- package/dist/{agent-smith-runner-LZRXM2Q2.js → agent-smith-runner-IPEGL4HM.js} +2 -2
- package/dist/{chunk-IEFAQFDQ.js → chunk-HPNTWPZU.js} +3 -13
- package/dist/{chunk-IEFAQFDQ.js.map → chunk-HPNTWPZU.js.map} +1 -1
- package/dist/{chunk-A43476GB.js → chunk-JMW3JVYT.js} +21 -7
- package/dist/chunk-JMW3JVYT.js.map +1 -0
- package/dist/{chunk-TOE75CFZ.js → chunk-MVC27YMB.js} +6 -4
- package/dist/{chunk-TOE75CFZ.js.map → chunk-MVC27YMB.js.map} +1 -1
- package/dist/{chunk-C3AS5OXW.js → chunk-NCRZZNPC.js} +2 -2
- package/dist/{chunk-YKUCIKTU.js → chunk-XWD5SUPP.js} +280 -146
- package/dist/chunk-XWD5SUPP.js.map +1 -0
- package/dist/cli/main.js +112 -60
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/yolo-daemon.js +15 -8
- package/dist/cli/yolo-daemon.js.map +1 -1
- package/dist/index.js +53 -42
- package/dist/index.js.map +1 -1
- package/dist/workers/agent-worker.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-A43476GB.js.map +0 -1
- package/dist/chunk-YKUCIKTU.js.map +0 -1
- /package/dist/{agent-smith-BECRZH73.js.map → agent-smith-MCTLZS2P.js.map} +0 -0
- /package/dist/{agent-smith-runner-LZRXM2Q2.js.map → agent-smith-runner-IPEGL4HM.js.map} +0 -0
- /package/dist/{chunk-C3AS5OXW.js.map → chunk-NCRZZNPC.js.map} +0 -0
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Executor,
|
|
3
3
|
Triager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NCRZZNPC.js";
|
|
5
5
|
import {
|
|
6
6
|
getSkillRegistry,
|
|
7
7
|
updateContextAfterScan
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MVC27YMB.js";
|
|
9
9
|
import {
|
|
10
|
-
ProgressReporter
|
|
11
|
-
|
|
10
|
+
ProgressReporter,
|
|
11
|
+
isInteractiveMode,
|
|
12
|
+
setInteractiveMode
|
|
13
|
+
} from "./chunk-JMW3JVYT.js";
|
|
12
14
|
import {
|
|
13
15
|
getWorkingDirectory
|
|
14
16
|
} from "./chunk-ASGSTVVF.js";
|
|
@@ -2786,6 +2788,9 @@ var StreamingManager = class {
|
|
|
2786
2788
|
}
|
|
2787
2789
|
};
|
|
2788
2790
|
function formatConsoleUpdate(update) {
|
|
2791
|
+
if (isInteractiveMode()) {
|
|
2792
|
+
return null;
|
|
2793
|
+
}
|
|
2789
2794
|
switch (update.type) {
|
|
2790
2795
|
case "agent_start":
|
|
2791
2796
|
return `>> Starting ${update.data.agent}...`;
|
|
@@ -2806,13 +2811,6 @@ function formatConsoleUpdate(update) {
|
|
|
2806
2811
|
return null;
|
|
2807
2812
|
}
|
|
2808
2813
|
}
|
|
2809
|
-
function createProgressBar(current, total, width = 40) {
|
|
2810
|
-
if (total === 0) return "\u2588".repeat(width);
|
|
2811
|
-
const progress = current / total;
|
|
2812
|
-
const filled = Math.round(width * progress);
|
|
2813
|
-
const empty = width - filled;
|
|
2814
|
-
return "\u2588".repeat(filled) + "\u2591".repeat(empty);
|
|
2815
|
-
}
|
|
2816
2814
|
|
|
2817
2815
|
// src/utils/issue-analyzer.ts
|
|
2818
2816
|
var IssueAnalyzer = class {
|
|
@@ -3172,7 +3170,10 @@ var InteractiveDashboard = class {
|
|
|
3172
3170
|
},
|
|
3173
3171
|
view: "overview",
|
|
3174
3172
|
selectedIssue: 0,
|
|
3175
|
-
lastUpdate: Date.now()
|
|
3173
|
+
lastUpdate: Date.now(),
|
|
3174
|
+
scanComplete: false,
|
|
3175
|
+
startTime: Date.now(),
|
|
3176
|
+
activityLog: []
|
|
3176
3177
|
};
|
|
3177
3178
|
}
|
|
3178
3179
|
/**
|
|
@@ -3180,6 +3181,8 @@ var InteractiveDashboard = class {
|
|
|
3180
3181
|
*/
|
|
3181
3182
|
async start() {
|
|
3182
3183
|
this.isActive = true;
|
|
3184
|
+
this.state.startTime = Date.now();
|
|
3185
|
+
this.addActivity("Guardian started");
|
|
3183
3186
|
this.setupKeyboardHandlers();
|
|
3184
3187
|
this.startUpdateLoop();
|
|
3185
3188
|
this.render();
|
|
@@ -3193,6 +3196,17 @@ var InteractiveDashboard = class {
|
|
|
3193
3196
|
clearInterval(this.updateInterval);
|
|
3194
3197
|
}
|
|
3195
3198
|
this.rl.close();
|
|
3199
|
+
process.stdout.write("\x1B[2J\x1B[H\x1B[?25h");
|
|
3200
|
+
}
|
|
3201
|
+
/**
|
|
3202
|
+
* Add activity log entry
|
|
3203
|
+
*/
|
|
3204
|
+
addActivity(message) {
|
|
3205
|
+
const time = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
3206
|
+
this.state.activityLog.unshift({ time, message });
|
|
3207
|
+
if (this.state.activityLog.length > 10) {
|
|
3208
|
+
this.state.activityLog.pop();
|
|
3209
|
+
}
|
|
3196
3210
|
}
|
|
3197
3211
|
/**
|
|
3198
3212
|
* Process streaming updates
|
|
@@ -3203,14 +3217,23 @@ var InteractiveDashboard = class {
|
|
|
3203
3217
|
case "progress":
|
|
3204
3218
|
this.state.progress = update.data;
|
|
3205
3219
|
break;
|
|
3220
|
+
case "agent_start":
|
|
3221
|
+
this.addActivity(`Agent started: ${update.data.agent}`);
|
|
3222
|
+
break;
|
|
3223
|
+
case "agent_complete":
|
|
3224
|
+
this.addActivity(`Agent complete: ${update.data.agent} (${update.data.issueCount} issues)`);
|
|
3225
|
+
break;
|
|
3206
3226
|
case "issue_found":
|
|
3207
3227
|
this.state.issues.push(update.data);
|
|
3208
3228
|
break;
|
|
3209
3229
|
case "scan_complete":
|
|
3230
|
+
this.state.scanComplete = true;
|
|
3210
3231
|
this.state.progress = {
|
|
3211
3232
|
...this.state.progress,
|
|
3212
3233
|
processedFiles: this.state.progress.totalFiles
|
|
3213
3234
|
};
|
|
3235
|
+
const elapsed = ((Date.now() - this.state.startTime) / 1e3).toFixed(1);
|
|
3236
|
+
this.addActivity(`Scan complete - ${this.state.progress.totalIssues} issues in ${elapsed}s`);
|
|
3214
3237
|
break;
|
|
3215
3238
|
}
|
|
3216
3239
|
if (this.isActive) {
|
|
@@ -3285,150 +3308,252 @@ var InteractiveDashboard = class {
|
|
|
3285
3308
|
}
|
|
3286
3309
|
}, 100);
|
|
3287
3310
|
}
|
|
3311
|
+
/**
|
|
3312
|
+
* Create a horizontal line
|
|
3313
|
+
*/
|
|
3314
|
+
line(width = 78) {
|
|
3315
|
+
return "-".repeat(width);
|
|
3316
|
+
}
|
|
3317
|
+
/**
|
|
3318
|
+
* Create progress bar
|
|
3319
|
+
*/
|
|
3320
|
+
progressBar(current, total, width = 50) {
|
|
3321
|
+
if (total === 0) return "[" + "#".repeat(width) + "]";
|
|
3322
|
+
const progress = Math.min(1, current / total);
|
|
3323
|
+
const filled = Math.round(width * progress);
|
|
3324
|
+
const empty = width - filled;
|
|
3325
|
+
return "[" + "#".repeat(filled) + ".".repeat(empty) + "]";
|
|
3326
|
+
}
|
|
3327
|
+
/**
|
|
3328
|
+
* Get severity icon
|
|
3329
|
+
*/
|
|
3330
|
+
severityIcon(severity) {
|
|
3331
|
+
const icons = {
|
|
3332
|
+
critical: "[!]",
|
|
3333
|
+
serious: "[x]",
|
|
3334
|
+
moderate: "[~]",
|
|
3335
|
+
low: "[-]"
|
|
3336
|
+
};
|
|
3337
|
+
return icons[severity] || "[-]";
|
|
3338
|
+
}
|
|
3339
|
+
/**
|
|
3340
|
+
* Get agent status icon
|
|
3341
|
+
*/
|
|
3342
|
+
agentIcon(status) {
|
|
3343
|
+
const icons = {
|
|
3344
|
+
running: "*",
|
|
3345
|
+
done: "+",
|
|
3346
|
+
waiting: "o"
|
|
3347
|
+
};
|
|
3348
|
+
return icons[status];
|
|
3349
|
+
}
|
|
3288
3350
|
/**
|
|
3289
3351
|
* Main render function
|
|
3290
3352
|
*/
|
|
3291
3353
|
render() {
|
|
3292
|
-
process.stdout.write("\x1B[2J\x1B[H");
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3354
|
+
process.stdout.write("\x1B[2J\x1B[H\x1B[?25l");
|
|
3355
|
+
const width = Math.min(80, process.stdout.columns || 80);
|
|
3356
|
+
this.renderHeader(width);
|
|
3357
|
+
if (!this.state.scanComplete) {
|
|
3358
|
+
this.renderScanningView(width);
|
|
3359
|
+
} else {
|
|
3360
|
+
switch (this.state.view) {
|
|
3361
|
+
case "overview":
|
|
3362
|
+
this.renderOverview(width);
|
|
3363
|
+
break;
|
|
3364
|
+
case "issues":
|
|
3365
|
+
this.renderIssuesList(width);
|
|
3366
|
+
break;
|
|
3367
|
+
case "agents":
|
|
3368
|
+
this.renderAgentsView(width);
|
|
3369
|
+
break;
|
|
3370
|
+
case "files":
|
|
3371
|
+
this.renderFilesView(width);
|
|
3372
|
+
break;
|
|
3373
|
+
}
|
|
3307
3374
|
}
|
|
3308
|
-
this.renderFooter();
|
|
3375
|
+
this.renderFooter(width);
|
|
3309
3376
|
}
|
|
3310
3377
|
/**
|
|
3311
|
-
* Render header with
|
|
3378
|
+
* Render header with title and status
|
|
3312
3379
|
*/
|
|
3313
|
-
renderHeader() {
|
|
3314
|
-
const
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3380
|
+
renderHeader(width) {
|
|
3381
|
+
const time = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
3382
|
+
let status = "SCANNING (...)";
|
|
3383
|
+
if (this.state.scanComplete) {
|
|
3384
|
+
status = "SCAN COMPLETE [OK]";
|
|
3385
|
+
}
|
|
3386
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3387
|
+
console.log("| TRIE GUARDIAN" + " ".repeat(width - 35 - status.length) + status + " " + time + " |");
|
|
3388
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3389
|
+
}
|
|
3390
|
+
/**
|
|
3391
|
+
* Render scanning in progress view
|
|
3392
|
+
*/
|
|
3393
|
+
renderScanningView(width) {
|
|
3394
|
+
const { processedFiles, totalFiles, currentFile, activeAgents, completedAgents } = this.state.progress;
|
|
3395
|
+
const { issuesBySeverity } = this.state.progress;
|
|
3396
|
+
const percent = totalFiles > 0 ? Math.round(processedFiles / totalFiles * 100) : 0;
|
|
3397
|
+
const current = currentFile ? currentFile.split("/").pop() || "" : "";
|
|
3398
|
+
const progressBar = this.progressBar(processedFiles, totalFiles, 50);
|
|
3399
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3400
|
+
console.log(`| Scanning: ${current.slice(0, 40).padEnd(40)}` + " ".repeat(width - 56) + "|");
|
|
3401
|
+
console.log(`| ${progressBar} ${percent}% (${processedFiles}/${totalFiles} files)`.padEnd(width - 1) + "|");
|
|
3402
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3403
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3404
|
+
console.log("| AGENTS" + " ".repeat(width - 11) + "|");
|
|
3405
|
+
console.log("| " + this.line(width - 6) + " |");
|
|
3406
|
+
const allAgents = [.../* @__PURE__ */ new Set([...activeAgents, ...completedAgents])];
|
|
3407
|
+
const waitingAgents = ["security", "privacy", "typecheck", "accessibility", "legal", "test", "moneybags", "production-ready"].filter((a) => !activeAgents.includes(a) && !completedAgents.includes(a));
|
|
3408
|
+
const leftAgents = [];
|
|
3409
|
+
const rightAgents = [];
|
|
3410
|
+
allAgents.forEach((agent, i) => {
|
|
3411
|
+
const isActive = activeAgents.includes(agent);
|
|
3412
|
+
const isDone = completedAgents.includes(agent);
|
|
3413
|
+
const icon = isActive ? this.agentIcon("running") : isDone ? this.agentIcon("done") : this.agentIcon("waiting");
|
|
3414
|
+
const status = isActive ? "analyzing" : isDone ? `done (${this.getAgentIssueCount(agent)})` : "waiting";
|
|
3415
|
+
const entry = `${icon} ${agent.slice(0, 12).padEnd(12)} ... ${status.padEnd(15)}`;
|
|
3416
|
+
if (i % 2 === 0) {
|
|
3417
|
+
leftAgents.push(entry);
|
|
3418
|
+
} else {
|
|
3419
|
+
rightAgents.push(entry);
|
|
3420
|
+
}
|
|
3421
|
+
});
|
|
3422
|
+
waitingAgents.slice(0, 4).forEach((agent, i) => {
|
|
3423
|
+
const entry = `${this.agentIcon("waiting")} ${agent.slice(0, 12).padEnd(12)} ... waiting`.padEnd(35);
|
|
3424
|
+
if ((allAgents.length + i) % 2 === 0) {
|
|
3425
|
+
leftAgents.push(entry);
|
|
3426
|
+
} else {
|
|
3427
|
+
rightAgents.push(entry);
|
|
3428
|
+
}
|
|
3429
|
+
});
|
|
3430
|
+
const maxRows = Math.max(leftAgents.length, rightAgents.length, 4);
|
|
3431
|
+
for (let i = 0; i < maxRows && i < 4; i++) {
|
|
3432
|
+
const left = leftAgents[i] || " ".repeat(35);
|
|
3433
|
+
const right = rightAgents[i] || " ".repeat(35);
|
|
3434
|
+
console.log(`| ${left} ${right}`.slice(0, width - 1).padEnd(width - 1) + "|");
|
|
3435
|
+
}
|
|
3436
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3437
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3438
|
+
console.log("| ISSUES FOUND" + " ".repeat(width - 17) + "|");
|
|
3439
|
+
console.log("| " + this.line(width - 6) + " |");
|
|
3440
|
+
console.log(`| [!] Critical ${issuesBySeverity.critical.toString().padStart(4)} [~] Moderate ${issuesBySeverity.moderate.toString().padStart(5)}`.padEnd(width - 1) + "|");
|
|
3441
|
+
console.log(`| [x] Serious ${issuesBySeverity.serious.toString().padStart(4)} [-] Low ${issuesBySeverity.low.toString().padStart(5)}`.padEnd(width - 1) + "|");
|
|
3442
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3443
|
+
}
|
|
3444
|
+
/**
|
|
3445
|
+
* Get issue count for an agent
|
|
3446
|
+
*/
|
|
3447
|
+
getAgentIssueCount(agent) {
|
|
3448
|
+
return this.state.issues.filter((i) => i.agent === agent).length;
|
|
3326
3449
|
}
|
|
3327
3450
|
/**
|
|
3328
3451
|
* Render overview with summary statistics
|
|
3329
3452
|
*/
|
|
3330
|
-
renderOverview() {
|
|
3331
|
-
const { issuesBySeverity, totalIssues } = this.state.progress;
|
|
3453
|
+
renderOverview(width) {
|
|
3454
|
+
const { issuesBySeverity, totalIssues, processedFiles } = this.state.progress;
|
|
3332
3455
|
const { completedAgents } = this.state.progress;
|
|
3333
|
-
|
|
3334
|
-
console.log("
|
|
3335
|
-
console.log(
|
|
3336
|
-
console.log(
|
|
3337
|
-
console.log(
|
|
3338
|
-
console.log("
|
|
3339
|
-
console.log("
|
|
3340
|
-
console.log("
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
}
|
|
3346
|
-
|
|
3456
|
+
const elapsed = ((Date.now() - this.state.startTime) / 1e3).toFixed(1);
|
|
3457
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3458
|
+
console.log(`| ${processedFiles} files scanned in ${elapsed}s`.padEnd(width - 1) + "|");
|
|
3459
|
+
console.log(`| ${completedAgents.length} agents activated`.padEnd(width - 1) + "|");
|
|
3460
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3461
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3462
|
+
console.log("| SUMMARY" + " ".repeat(width - 12) + "|");
|
|
3463
|
+
console.log("| " + this.line(width - 6) + " |");
|
|
3464
|
+
const criticalLabel = issuesBySeverity.critical > 0 ? "<- FIX NOW" : "";
|
|
3465
|
+
console.log(`| [!] ${issuesBySeverity.critical.toString().padStart(4)} Critical issues ${criticalLabel}`.padEnd(width - 1) + "|");
|
|
3466
|
+
console.log(`| [x] ${issuesBySeverity.serious.toString().padStart(4)} Serious issues`.padEnd(width - 1) + "|");
|
|
3467
|
+
console.log(`| [~] ${issuesBySeverity.moderate.toString().padStart(4)} Moderate issues`.padEnd(width - 1) + "|");
|
|
3468
|
+
console.log(`| [-] ${issuesBySeverity.low.toString().padStart(4)} Low issues`.padEnd(width - 1) + "|");
|
|
3469
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3470
|
+
const criticalIssues = this.state.issues.filter((i) => i.severity === "critical").slice(0, 3);
|
|
3347
3471
|
if (criticalIssues.length > 0) {
|
|
3348
|
-
console.log("
|
|
3349
|
-
console.log("
|
|
3350
|
-
console.log("
|
|
3472
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3473
|
+
console.log("| TOP CRITICAL ISSUES" + " ".repeat(width - 24) + "|");
|
|
3474
|
+
console.log("| " + this.line(width - 6) + " |");
|
|
3351
3475
|
for (const issue of criticalIssues) {
|
|
3352
3476
|
const filename = issue.file.split("/").pop() || issue.file;
|
|
3353
3477
|
const line = issue.line ? `:${issue.line}` : "";
|
|
3354
3478
|
const location = `${filename}${line}`;
|
|
3355
|
-
const description = issue.issue.slice(0,
|
|
3356
|
-
console.log(
|
|
3479
|
+
const description = issue.issue.slice(0, 40) + (issue.issue.length > 40 ? "..." : "");
|
|
3480
|
+
console.log(`| > ${description}`.slice(0, width - 1).padEnd(width - 1) + "|");
|
|
3481
|
+
console.log(`| ${location}`.slice(0, width - 1).padEnd(width - 1) + "|");
|
|
3482
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3357
3483
|
}
|
|
3484
|
+
} else if (totalIssues === 0) {
|
|
3485
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3486
|
+
console.log("| [OK] No issues found - code looks good!".padEnd(width - 1) + "|");
|
|
3487
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3358
3488
|
}
|
|
3359
3489
|
}
|
|
3360
3490
|
/**
|
|
3361
3491
|
* Render filtered issues list
|
|
3362
3492
|
*/
|
|
3363
|
-
renderIssuesList() {
|
|
3493
|
+
renderIssuesList(width) {
|
|
3364
3494
|
const filteredIssues = this.getFilteredIssues();
|
|
3365
3495
|
const { selectedIssue } = this.state;
|
|
3366
|
-
console.log("
|
|
3367
|
-
console.log("
|
|
3368
|
-
const
|
|
3369
|
-
console.log(`\u2502 Filter: ${filterText}`.padEnd(79) + " \u2502");
|
|
3370
|
-
console.log("\u251C\u2500" + "\u2500".repeat(78) + "\u2500\u2524");
|
|
3371
|
-
const pageSize = 15;
|
|
3496
|
+
console.log("| Filter: " + this.getFilterDescription().padEnd(width - 13) + "|");
|
|
3497
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3498
|
+
const pageSize = 10;
|
|
3372
3499
|
const startIndex = Math.floor(selectedIssue / pageSize) * pageSize;
|
|
3373
3500
|
const pageIssues = filteredIssues.slice(startIndex, startIndex + pageSize);
|
|
3374
3501
|
for (let i = 0; i < pageIssues.length; i++) {
|
|
3375
3502
|
const issue = pageIssues[i];
|
|
3376
3503
|
const globalIndex = startIndex + i;
|
|
3377
3504
|
const isSelected = globalIndex === selectedIssue;
|
|
3378
|
-
const cursor = isSelected ? "
|
|
3379
|
-
const severityIcon = this.
|
|
3505
|
+
const cursor = isSelected ? ">" : " ";
|
|
3506
|
+
const severityIcon = this.severityIcon(issue.severity);
|
|
3380
3507
|
const filename = issue.file.split("/").pop() || issue.file;
|
|
3381
3508
|
const location = `${filename}:${issue.line || "?"}`;
|
|
3382
|
-
const description = issue.issue.slice(0,
|
|
3383
|
-
const line = `${
|
|
3384
|
-
console.log(
|
|
3509
|
+
const description = issue.issue.slice(0, 35) + (issue.issue.length > 35 ? "..." : "");
|
|
3510
|
+
const line = `${severityIcon} ${cursor} ${description.padEnd(38)} ${location.padEnd(20)}`;
|
|
3511
|
+
console.log(`| ${line}`.slice(0, width - 1).padEnd(width - 1) + "|");
|
|
3512
|
+
}
|
|
3513
|
+
for (let i = pageIssues.length; i < pageSize; i++) {
|
|
3514
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3385
3515
|
}
|
|
3386
3516
|
if (filteredIssues[selectedIssue]) {
|
|
3387
3517
|
const selected = filteredIssues[selectedIssue];
|
|
3388
|
-
console.log("
|
|
3389
|
-
console.log("
|
|
3390
|
-
console.log("
|
|
3391
|
-
console.log(
|
|
3392
|
-
console.log(
|
|
3393
|
-
console.log(
|
|
3394
|
-
const
|
|
3395
|
-
console.log(
|
|
3396
|
-
for (const line of
|
|
3397
|
-
console.log(
|
|
3398
|
-
}
|
|
3399
|
-
const fixLines = this.wrapText(selected.fix, 75);
|
|
3400
|
-
console.log(`\u2502 Fix:`.padEnd(79) + " \u2502");
|
|
3401
|
-
for (const line of fixLines.slice(0, 3)) {
|
|
3402
|
-
console.log(`\u2502 ${line}`.padEnd(79) + " \u2502");
|
|
3518
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3519
|
+
console.log("| SELECTED: " + selected.issue.slice(0, width - 15).padEnd(width - 15) + "|");
|
|
3520
|
+
console.log("| " + this.line(width - 6) + " |");
|
|
3521
|
+
console.log(`| File: ${selected.file}`.slice(0, width - 1).padEnd(width - 1) + "|");
|
|
3522
|
+
console.log(`| Line: ${selected.line || "Unknown"} Agent: ${selected.agent}`.padEnd(width - 1) + "|");
|
|
3523
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3524
|
+
const fixLines = this.wrapText(selected.fix, width - 8);
|
|
3525
|
+
console.log("| Fix:".padEnd(width - 1) + "|");
|
|
3526
|
+
for (const line of fixLines.slice(0, 2)) {
|
|
3527
|
+
console.log(`| ${line}`.padEnd(width - 1) + "|");
|
|
3403
3528
|
}
|
|
3404
3529
|
}
|
|
3405
3530
|
}
|
|
3406
3531
|
/**
|
|
3407
3532
|
* Render agents view
|
|
3408
3533
|
*/
|
|
3409
|
-
renderAgentsView() {
|
|
3534
|
+
renderAgentsView(width) {
|
|
3410
3535
|
const { completedAgents, activeAgents } = this.state.progress;
|
|
3411
|
-
console.log("
|
|
3412
|
-
console.log("
|
|
3536
|
+
console.log("| AGENTS STATUS" + " ".repeat(width - 18) + "|");
|
|
3537
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3413
3538
|
if (activeAgents.length > 0) {
|
|
3414
|
-
console.log("
|
|
3539
|
+
console.log("| * ACTIVE AGENTS" + " ".repeat(width - 20) + "|");
|
|
3415
3540
|
for (const agent of activeAgents) {
|
|
3416
|
-
console.log(
|
|
3541
|
+
console.log(`| - ${agent}`.padEnd(width - 1) + "|");
|
|
3417
3542
|
}
|
|
3418
|
-
console.log("
|
|
3543
|
+
console.log("|" + " ".repeat(width - 2) + "|");
|
|
3419
3544
|
}
|
|
3420
|
-
console.log("
|
|
3545
|
+
console.log("| + COMPLETED AGENTS" + " ".repeat(width - 23) + "|");
|
|
3421
3546
|
for (const agent of completedAgents) {
|
|
3422
3547
|
const agentIssues = this.state.issues.filter((i) => i.agent === agent);
|
|
3423
3548
|
const criticalCount = agentIssues.filter((i) => i.severity === "critical").length;
|
|
3424
3549
|
const statusText = criticalCount > 0 ? `${criticalCount} critical` : `${agentIssues.length} issues`;
|
|
3425
|
-
console.log(
|
|
3550
|
+
console.log(`| - ${agent.padEnd(25)} ${statusText}`.padEnd(width - 1) + "|");
|
|
3426
3551
|
}
|
|
3427
3552
|
}
|
|
3428
3553
|
/**
|
|
3429
3554
|
* Render files view
|
|
3430
3555
|
*/
|
|
3431
|
-
renderFilesView() {
|
|
3556
|
+
renderFilesView(width) {
|
|
3432
3557
|
const fileIssues = /* @__PURE__ */ new Map();
|
|
3433
3558
|
for (const issue of this.state.issues) {
|
|
3434
3559
|
if (!fileIssues.has(issue.file)) {
|
|
@@ -3436,29 +3561,31 @@ var InteractiveDashboard = class {
|
|
|
3436
3561
|
}
|
|
3437
3562
|
fileIssues.get(issue.file).push(issue);
|
|
3438
3563
|
}
|
|
3439
|
-
const sortedFiles = Array.from(fileIssues.entries()).sort((a, b) => b[1].length - a[1].length).slice(0,
|
|
3440
|
-
console.log("
|
|
3441
|
-
console.log("
|
|
3564
|
+
const sortedFiles = Array.from(fileIssues.entries()).sort((a, b) => b[1].length - a[1].length).slice(0, 15);
|
|
3565
|
+
console.log("| FILES WITH ISSUES" + " ".repeat(width - 22) + "|");
|
|
3566
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3442
3567
|
for (const [file, issues] of sortedFiles) {
|
|
3443
3568
|
const filename = file.split("/").pop() || file;
|
|
3444
3569
|
const criticalCount = issues.filter((i) => i.severity === "critical").length;
|
|
3445
3570
|
const totalCount = issues.length;
|
|
3446
3571
|
const criticalText = criticalCount > 0 ? ` (${criticalCount} critical)` : "";
|
|
3447
|
-
console.log(
|
|
3572
|
+
console.log(`| ${filename.padEnd(35)} ${totalCount} issues${criticalText}`.slice(0, width - 1).padEnd(width - 1) + "|");
|
|
3448
3573
|
}
|
|
3449
3574
|
}
|
|
3450
3575
|
/**
|
|
3451
3576
|
* Render footer with controls
|
|
3452
3577
|
*/
|
|
3453
|
-
renderFooter() {
|
|
3454
|
-
console.log("
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3578
|
+
renderFooter(width) {
|
|
3579
|
+
console.log("+" + this.line(width - 2) + "+");
|
|
3580
|
+
if (!this.state.scanComplete) {
|
|
3581
|
+
console.log(" [q] Quit [v] Verbose mode [Esc] Cancel scan");
|
|
3582
|
+
} else {
|
|
3583
|
+
console.log(" [Tab] Switch view [up/down] Navigate [1-4] Filter [q] Quit");
|
|
3584
|
+
}
|
|
3459
3585
|
}
|
|
3460
3586
|
// Helper methods
|
|
3461
3587
|
switchView() {
|
|
3588
|
+
if (!this.state.scanComplete) return;
|
|
3462
3589
|
const views = ["overview", "issues", "agents", "files"];
|
|
3463
3590
|
const currentIndex = views.indexOf(this.state.view);
|
|
3464
3591
|
const nextIndex = (currentIndex + 1) % views.length;
|
|
@@ -3515,10 +3642,7 @@ var InteractiveDashboard = class {
|
|
|
3515
3642
|
if (this.state.filter.severity !== "all") parts.push(`Severity: ${this.state.filter.severity}`);
|
|
3516
3643
|
if (this.state.filter.agent !== "all") parts.push(`Agent: ${this.state.filter.agent}`);
|
|
3517
3644
|
if (this.state.filter.search) parts.push(`Search: "${this.state.filter.search}"`);
|
|
3518
|
-
return parts.length > 0 ? parts.join(", ") : "
|
|
3519
|
-
}
|
|
3520
|
-
getSeverityIcon(severity) {
|
|
3521
|
-
return { critical: "\u{1F534}", serious: "\u{1F7E0}", moderate: "\u{1F7E1}", low: "\u{1F535}" }[severity];
|
|
3645
|
+
return parts.length > 0 ? parts.join(", ") : "All issues";
|
|
3522
3646
|
}
|
|
3523
3647
|
wrapText(text, width) {
|
|
3524
3648
|
const words = text.split(" ");
|
|
@@ -3551,21 +3675,23 @@ var InteractiveDashboard = class {
|
|
|
3551
3675
|
showHelp() {
|
|
3552
3676
|
this.isActive = false;
|
|
3553
3677
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
3554
|
-
console.log("
|
|
3555
|
-
console.log("
|
|
3556
|
-
console.log("
|
|
3557
|
-
console.log("
|
|
3558
|
-
console.log("
|
|
3559
|
-
console.log("
|
|
3560
|
-
console.log("
|
|
3561
|
-
console.log("
|
|
3562
|
-
console.log("
|
|
3563
|
-
console.log("
|
|
3564
|
-
console.log("
|
|
3565
|
-
console.log("
|
|
3566
|
-
console.log("
|
|
3567
|
-
console.log("
|
|
3568
|
-
console.log("
|
|
3678
|
+
console.log("+" + this.line(66) + "+");
|
|
3679
|
+
console.log("| TRIE GUARDIAN - HELP" + " ".repeat(44) + "|");
|
|
3680
|
+
console.log("+" + this.line(66) + "+");
|
|
3681
|
+
console.log("| Navigation" + " ".repeat(54) + "|");
|
|
3682
|
+
console.log("| Tab Switch view (overview/issues/agents/files)" + " ".repeat(8) + "|");
|
|
3683
|
+
console.log("| up/down Navigate issues list" + " ".repeat(29) + "|");
|
|
3684
|
+
console.log("| Enter View issue details" + " ".repeat(31) + "|");
|
|
3685
|
+
console.log("| Filters" + " ".repeat(57) + "|");
|
|
3686
|
+
console.log("| 1-4 Filter by severity (critical->low)" + " ".repeat(16) + "|");
|
|
3687
|
+
console.log("| 0 Clear severity filter" + " ".repeat(28) + "|");
|
|
3688
|
+
console.log("| f Search filter" + " ".repeat(36) + "|");
|
|
3689
|
+
console.log("| c Clear all filters" + " ".repeat(32) + "|");
|
|
3690
|
+
console.log("| Other" + " ".repeat(59) + "|");
|
|
3691
|
+
console.log("| h or ? Show this help" + " ".repeat(35) + "|");
|
|
3692
|
+
console.log("| q Quit" + " ".repeat(45) + "|");
|
|
3693
|
+
console.log("+" + this.line(66) + "+");
|
|
3694
|
+
console.log(" Press any key to return...");
|
|
3569
3695
|
const resume = () => {
|
|
3570
3696
|
this.isActive = true;
|
|
3571
3697
|
this.render();
|
|
@@ -3575,23 +3701,25 @@ var InteractiveDashboard = class {
|
|
|
3575
3701
|
showIssueDetails(issue) {
|
|
3576
3702
|
this.isActive = false;
|
|
3577
3703
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
3578
|
-
console.log("
|
|
3579
|
-
console.log(
|
|
3580
|
-
console.log(
|
|
3581
|
-
console.log("
|
|
3582
|
-
console.log("
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3704
|
+
console.log("+" + this.line(66) + "+");
|
|
3705
|
+
console.log("| ISSUE DETAILS" + " ".repeat(51) + "|");
|
|
3706
|
+
console.log("+" + this.line(66) + "+");
|
|
3707
|
+
console.log(`| File: ${issue.file}`.slice(0, 66).padEnd(66) + "|");
|
|
3708
|
+
console.log(`| Line: ${issue.line || "Unknown"} Agent: ${issue.agent}`.slice(0, 66).padEnd(66) + "|");
|
|
3709
|
+
console.log("+" + this.line(66) + "+");
|
|
3710
|
+
console.log("| Issue" + " ".repeat(59) + "|");
|
|
3711
|
+
const issueLines = this.wrapText(issue.issue, 62);
|
|
3712
|
+
for (const line of issueLines.slice(0, 4)) {
|
|
3713
|
+
console.log(`| ${line}`.padEnd(66) + "|");
|
|
3714
|
+
}
|
|
3715
|
+
console.log("+" + this.line(66) + "+");
|
|
3716
|
+
console.log("| Fix" + " ".repeat(61) + "|");
|
|
3717
|
+
const fixLines = this.wrapText(issue.fix, 62);
|
|
3718
|
+
for (const line of fixLines.slice(0, 4)) {
|
|
3719
|
+
console.log(`| ${line}`.padEnd(66) + "|");
|
|
3720
|
+
}
|
|
3721
|
+
console.log("+" + this.line(66) + "+");
|
|
3722
|
+
console.log(" Press any key to return...");
|
|
3595
3723
|
const resume = () => {
|
|
3596
3724
|
this.isActive = true;
|
|
3597
3725
|
this.render();
|
|
@@ -4872,6 +5000,9 @@ var TrieScanTool = class {
|
|
|
4872
5000
|
const useWorkerThreads = args?.workers ?? true;
|
|
4873
5001
|
const streamingManager = streamingEnabled ? new StreamingManager() : void 0;
|
|
4874
5002
|
const dashboard = interactiveEnabled ? new InteractiveDashboard() : void 0;
|
|
5003
|
+
if (interactiveEnabled) {
|
|
5004
|
+
setInteractiveMode(true);
|
|
5005
|
+
}
|
|
4875
5006
|
if (dashboard && streamingManager) {
|
|
4876
5007
|
streamingManager.subscribe((update) => dashboard.handleStreamUpdate(update));
|
|
4877
5008
|
await dashboard.start();
|
|
@@ -5185,6 +5316,7 @@ var TrieScanTool = class {
|
|
|
5185
5316
|
}
|
|
5186
5317
|
}
|
|
5187
5318
|
logContextAnalysis(context) {
|
|
5319
|
+
if (isInteractiveMode()) return;
|
|
5188
5320
|
console.error("\n Detected Context Signals:");
|
|
5189
5321
|
const signals = [];
|
|
5190
5322
|
if (context.touchesAuth) signals.push("* Authentication/Authorization");
|
|
@@ -5207,6 +5339,7 @@ var TrieScanTool = class {
|
|
|
5207
5339
|
console.error("");
|
|
5208
5340
|
}
|
|
5209
5341
|
logRiskAssessment(context, riskLevel) {
|
|
5342
|
+
if (isInteractiveMode()) return;
|
|
5210
5343
|
const riskLabel = {
|
|
5211
5344
|
low: "[LOW]",
|
|
5212
5345
|
medium: "[MEDIUM]",
|
|
@@ -5231,6 +5364,7 @@ var TrieScanTool = class {
|
|
|
5231
5364
|
console.error("");
|
|
5232
5365
|
}
|
|
5233
5366
|
logTriaging(selectedNames, allAgentNames, context, riskLevel) {
|
|
5367
|
+
if (isInteractiveMode()) return;
|
|
5234
5368
|
console.error(`
|
|
5235
5369
|
Agents Selected: ${selectedNames.length} of ${allAgentNames.length} available`);
|
|
5236
5370
|
console.error("");
|
|
@@ -5606,4 +5740,4 @@ export {
|
|
|
5606
5740
|
loadConfig,
|
|
5607
5741
|
TrieScanTool
|
|
5608
5742
|
};
|
|
5609
|
-
//# sourceMappingURL=chunk-
|
|
5743
|
+
//# sourceMappingURL=chunk-XWD5SUPP.js.map
|