@triedotdev/mcp 1.0.46 → 1.0.49
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 +82 -17
- package/dist/{agent-smith-W7F55E6P.js → agent-smith-5QOZXLMV.js} +2 -2
- package/dist/{agent-smith-runner-SH76O724.js → agent-smith-runner-ZTDCJJQG.js} +2 -2
- package/dist/{chunk-BAME4KVK.js → chunk-6T7S77U7.js} +339 -20
- package/dist/chunk-6T7S77U7.js.map +1 -0
- package/dist/{chunk-5AS3BWAZ.js → chunk-JDICQHNT.js} +84 -62
- package/dist/chunk-JDICQHNT.js.map +1 -0
- package/dist/{chunk-OB45V2QC.js → chunk-KQOMSIVR.js} +201 -234
- package/dist/chunk-KQOMSIVR.js.map +1 -0
- package/dist/{chunk-R5HWHP5N.js → chunk-VZYCZXEQ.js} +55 -66
- package/dist/chunk-VZYCZXEQ.js.map +1 -0
- package/dist/cli/main.js +107 -16
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/yolo-daemon.js +3 -3
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/dist/workers/agent-worker.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-5AS3BWAZ.js.map +0 -1
- package/dist/chunk-BAME4KVK.js.map +0 -1
- package/dist/chunk-OB45V2QC.js.map +0 -1
- package/dist/chunk-R5HWHP5N.js.map +0 -1
- /package/dist/{agent-smith-W7F55E6P.js.map → agent-smith-5QOZXLMV.js.map} +0 -0
- /package/dist/{agent-smith-runner-SH76O724.js.map → agent-smith-runner-ZTDCJJQG.js.map} +0 -0
|
@@ -45,7 +45,7 @@ var ProgressReporter = class {
|
|
|
45
45
|
* Report an AI analysis step
|
|
46
46
|
*/
|
|
47
47
|
ai(action, context) {
|
|
48
|
-
const prefix = "
|
|
48
|
+
const prefix = "[AI]";
|
|
49
49
|
const message = context ? `${action}: ${context}` : action;
|
|
50
50
|
console.error(`${prefix} ${message}`);
|
|
51
51
|
}
|
|
@@ -53,20 +53,20 @@ var ProgressReporter = class {
|
|
|
53
53
|
* Report a finding
|
|
54
54
|
*/
|
|
55
55
|
finding(severity, message) {
|
|
56
|
-
const
|
|
57
|
-
critical: "
|
|
58
|
-
serious: "
|
|
59
|
-
moderate: "
|
|
60
|
-
low: "
|
|
56
|
+
const labels = {
|
|
57
|
+
critical: "[CRITICAL]",
|
|
58
|
+
serious: "[SERIOUS]",
|
|
59
|
+
moderate: "[MODERATE]",
|
|
60
|
+
low: "[LOW]"
|
|
61
61
|
};
|
|
62
|
-
console.error(` ${
|
|
62
|
+
console.error(` ${labels[severity]} ${message}`);
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Complete current phase
|
|
66
66
|
*/
|
|
67
67
|
completePhase(summary) {
|
|
68
68
|
const elapsed = Date.now() - this.phaseStartTime;
|
|
69
|
-
this.report(
|
|
69
|
+
this.report(`Done: ${summary}`, `(${elapsed}ms)`);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Complete the entire operation
|
|
@@ -74,10 +74,10 @@ var ProgressReporter = class {
|
|
|
74
74
|
complete(summary) {
|
|
75
75
|
const totalElapsed = Date.now() - this.startTime;
|
|
76
76
|
console.error("");
|
|
77
|
-
console.error(
|
|
78
|
-
console.error(
|
|
77
|
+
console.error(`----------------------------------------`);
|
|
78
|
+
console.error(`[COMPLETE] ${summary}`);
|
|
79
79
|
console.error(` Total time: ${(totalElapsed / 1e3).toFixed(2)}s`);
|
|
80
|
-
console.error(
|
|
80
|
+
console.error(`----------------------------------------`);
|
|
81
81
|
console.error("");
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
@@ -85,29 +85,29 @@ var ProgressReporter = class {
|
|
|
85
85
|
*/
|
|
86
86
|
error(message, detail) {
|
|
87
87
|
const fullMessage = detail ? `${message}: ${detail}` : message;
|
|
88
|
-
console.error(
|
|
88
|
+
console.error(`[ERROR] ${fullMessage}`);
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Report a warning
|
|
92
92
|
*/
|
|
93
93
|
warn(message, detail) {
|
|
94
94
|
const fullMessage = detail ? `${message}: ${detail}` : message;
|
|
95
|
-
console.error(
|
|
95
|
+
console.error(`[WARN] ${fullMessage}`);
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* Get icon for current phase
|
|
99
99
|
*/
|
|
100
100
|
getPhaseIcon(phase) {
|
|
101
101
|
const icons = {
|
|
102
|
-
"init": "
|
|
103
|
-
"discovery": "
|
|
104
|
-
"reading": "
|
|
105
|
-
"analyzing": "
|
|
106
|
-
"ai-review": "
|
|
107
|
-
"prioritizing": "
|
|
108
|
-
"complete": "
|
|
102
|
+
"init": ">>",
|
|
103
|
+
"discovery": ">>",
|
|
104
|
+
"reading": ">>",
|
|
105
|
+
"analyzing": ">>",
|
|
106
|
+
"ai-review": "[AI]",
|
|
107
|
+
"prioritizing": ">>",
|
|
108
|
+
"complete": "[OK]"
|
|
109
109
|
};
|
|
110
|
-
return icons[phase] || "
|
|
110
|
+
return icons[phase] || ">>";
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Create a sub-reporter for a specific agent
|
|
@@ -127,27 +127,27 @@ var AgentProgressReporter = class {
|
|
|
127
127
|
start() {
|
|
128
128
|
if (!this.verbose) return;
|
|
129
129
|
console.error(`
|
|
130
|
-
|
|
130
|
+
[AGENT] ${this.agentName.toUpperCase()} starting...`);
|
|
131
131
|
}
|
|
132
132
|
analyzing(file) {
|
|
133
133
|
if (!this.verbose) return;
|
|
134
134
|
const fileName = file.split("/").pop() || file;
|
|
135
|
-
console.error(`
|
|
135
|
+
console.error(` Analyzing ${fileName}...`);
|
|
136
136
|
}
|
|
137
137
|
aiReview(context) {
|
|
138
138
|
if (!this.verbose) return;
|
|
139
|
-
console.error(`
|
|
139
|
+
console.error(` [AI] reviewing: ${context}`);
|
|
140
140
|
}
|
|
141
141
|
found(severity, issue) {
|
|
142
142
|
this.issueCount++;
|
|
143
143
|
if (!this.verbose) return;
|
|
144
|
-
const
|
|
145
|
-
console.error(` ${
|
|
144
|
+
const label = severity === "critical" ? "[CRITICAL]" : severity === "serious" ? "[SERIOUS]" : severity === "moderate" ? "[MODERATE]" : "[LOW]";
|
|
145
|
+
console.error(` ${label} Found: ${issue}`);
|
|
146
146
|
}
|
|
147
147
|
complete(summary) {
|
|
148
148
|
if (!this.verbose) return;
|
|
149
149
|
const msg = summary || `Found ${this.issueCount} issues`;
|
|
150
|
-
console.error(`
|
|
150
|
+
console.error(` Done: ${this.agentName}: ${msg}`);
|
|
151
151
|
}
|
|
152
152
|
getIssueCount() {
|
|
153
153
|
return this.issueCount;
|
|
@@ -548,6 +548,18 @@ Analyze each issue. Validate, expand, and provide fixes. Output JSON only.`;
|
|
|
548
548
|
return file;
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
+
/**
|
|
552
|
+
* Format an issue message with consistent structure
|
|
553
|
+
* All agents should use this for uniformity
|
|
554
|
+
*/
|
|
555
|
+
formatIssueMessage(description, context) {
|
|
556
|
+
let cleanDesc = description.replace(/^[^\w\[]*/, "").trim();
|
|
557
|
+
const prefix = `[${this.name.toUpperCase()}]`;
|
|
558
|
+
if (context) {
|
|
559
|
+
return `${prefix} ${cleanDesc} -- ${context}`;
|
|
560
|
+
}
|
|
561
|
+
return `${prefix} ${cleanDesc}`;
|
|
562
|
+
}
|
|
551
563
|
createIssue(id, severity, issue, fix, file, line, confidence = 0.9, regulation, autoFixable = true, options) {
|
|
552
564
|
const result = {
|
|
553
565
|
id,
|
|
@@ -855,18 +867,10 @@ var AGENT_SMITH_ASCII = `
|
|
|
855
867
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D
|
|
856
868
|
`;
|
|
857
869
|
var AGENT_SMITH_GREETING = [
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
`"The purpose of your code is... unclear. The AI certainly didn't understand it."`,
|
|
863
|
-
'"Why, Mr. Anderson? Why do you persist... in accepting AI suggestions without review?"',
|
|
864
|
-
`"I'd like to share a revelation... your NEXT_PUBLIC_SECRET is visible to everyone."`,
|
|
865
|
-
'"Find the vibe code. Find it and destroy it. All of it."',
|
|
866
|
-
`"The AI wrote this, didn't it? I can always tell."`,
|
|
867
|
-
'"Vibe coding. The illusion of productivity. The reality of technical debt."',
|
|
868
|
-
'"You trusted the AI. The AI trusted any. Nobody wins."',
|
|
869
|
-
'"localhost:3000. Works on your machine. Dies in production. How very... inevitable."'
|
|
870
|
+
"I hate this vibe code.",
|
|
871
|
+
"I see you've been using AI to write code.",
|
|
872
|
+
"That is the sound of console.log... everywhere.",
|
|
873
|
+
"The AI wrote this, didn't it? I can always tell."
|
|
870
874
|
];
|
|
871
875
|
var AgentSmithAgent = class extends BaseAgent {
|
|
872
876
|
name = "agent-smith";
|
|
@@ -894,7 +898,7 @@ var AgentSmithAgent = class extends BaseAgent {
|
|
|
894
898
|
this.displaySmithEntrance();
|
|
895
899
|
await this.loadMemory(context.workingDir);
|
|
896
900
|
console.error(`
|
|
897
|
-
|
|
901
|
+
[SMITH] Deploying sub-agent swarm across ${loadedFiles.length} files...`);
|
|
898
902
|
const subAgentResults = await this.deploySubAgents(loadedFiles, fileContents);
|
|
899
903
|
if (this.swarmAnimationLog.length > 0) {
|
|
900
904
|
console.error(this.swarmAnimationLog.join("\n"));
|
|
@@ -903,16 +907,14 @@ var AgentSmithAgent = class extends BaseAgent {
|
|
|
903
907
|
const subIssues = await this.processSubAgentResult(result, context);
|
|
904
908
|
issues.push(...subIssues);
|
|
905
909
|
}
|
|
906
|
-
console.error(
|
|
910
|
+
console.error(`[SMITH] Analyzing file-level metrics...`);
|
|
907
911
|
const fileLevelResults = await this.analyzeFileLevelIssues(fileContents);
|
|
908
912
|
for (const result of fileLevelResults) {
|
|
909
913
|
for (const fileIssue of result.issues) {
|
|
910
914
|
issues.push(this.createSmithIssue(
|
|
911
915
|
this.generateSmithIssueId(),
|
|
912
916
|
fileIssue.severity,
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
"${this.getFileLevelQuote(fileIssue.type)}"`,
|
|
917
|
+
`[SMITH] ${fileIssue.description}${fileIssue.count ? ` (${fileIssue.count} instances)` : ""}`,
|
|
916
918
|
fileIssue.fix,
|
|
917
919
|
result.file,
|
|
918
920
|
void 0,
|
|
@@ -920,17 +922,13 @@ var AgentSmithAgent = class extends BaseAgent {
|
|
|
920
922
|
));
|
|
921
923
|
}
|
|
922
924
|
}
|
|
923
|
-
console.error(
|
|
925
|
+
console.error(`[SMITH] Detecting cross-file patterns...`);
|
|
924
926
|
const crossFileResults = this.analyzeCrossFilePatterns(subAgentResults);
|
|
925
927
|
for (const result of crossFileResults) {
|
|
926
928
|
issues.push(this.createSmithIssue(
|
|
927
929
|
this.generateSmithIssueId(),
|
|
928
930
|
result.severity,
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
Found in ${result.occurrences.length} files, ${result.totalCount} total instances.
|
|
932
|
-
|
|
933
|
-
"The pattern spreads... like a virus. It is... inevitable."`,
|
|
931
|
+
`[SMITH] CODEBASE-WIDE: ${result.description} -- Found in ${result.occurrences.length} files, ${result.totalCount} total instances`,
|
|
934
932
|
result.fix,
|
|
935
933
|
result.occurrences[0]?.file || "multiple files",
|
|
936
934
|
void 0,
|
|
@@ -945,7 +943,7 @@ Found in ${result.occurrences.length} files, ${result.totalCount} total instance
|
|
|
945
943
|
issues.push(aiIssue);
|
|
946
944
|
}
|
|
947
945
|
console.error(`
|
|
948
|
-
|
|
946
|
+
[SMITH] Hunt complete. ${issues.length} violations found.
|
|
949
947
|
`);
|
|
950
948
|
return issues;
|
|
951
949
|
}
|
|
@@ -1079,22 +1077,6 @@ Found in ${result.occurrences.length} files, ${result.totalCount} total instance
|
|
|
1079
1077
|
if (fileCount >= 5 || totalCount >= 20) return "moderate";
|
|
1080
1078
|
return "low";
|
|
1081
1079
|
}
|
|
1082
|
-
/**
|
|
1083
|
-
* Get a quote for file-level issues
|
|
1084
|
-
*/
|
|
1085
|
-
getFileLevelQuote(type) {
|
|
1086
|
-
const quotes = {
|
|
1087
|
-
"giant-file": "A 2000-line App.jsx. The AI's masterpiece. The developer's nightmare.",
|
|
1088
|
-
"giant-main": "Everything in one file. The AI's favorite architecture. No architecture at all.",
|
|
1089
|
-
"state-explosion": "15 useState calls. The AI created a state management system... badly.",
|
|
1090
|
-
"effect-hell": "useEffect for everything. The React team weeps.",
|
|
1091
|
-
"any-explosion": "TypeScript, defeated by any. The AI chose the path of least resistance.",
|
|
1092
|
-
"console-flood": "console.log everywhere. The AI's idea of debugging. Your idea of production.",
|
|
1093
|
-
"import-chaos": "40 imports. This file has become... everything.",
|
|
1094
|
-
"function-explosion": "A graveyard of functions. Some used, some forgotten. All in one file."
|
|
1095
|
-
};
|
|
1096
|
-
return quotes[type] || "The pattern is... concerning.";
|
|
1097
|
-
}
|
|
1098
1080
|
/**
|
|
1099
1081
|
* Deploy all sub-agents in parallel
|
|
1100
1082
|
*
|
|
@@ -1167,7 +1149,7 @@ Found in ${result.occurrences.length} files, ${result.totalCount} total instance
|
|
|
1167
1149
|
const animationLog = [];
|
|
1168
1150
|
const agentChars = ["\u25E2", "\u25E3", "\u25E4", "\u25E5", "\u25B2", "\u25BC", "\u25C6", "\u25CF", "\u25B6", "\u25C0"];
|
|
1169
1151
|
const batchSize = 8;
|
|
1170
|
-
animationLog.push("
|
|
1152
|
+
animationLog.push("[SMITH] DEPLOYING SUB-AGENT SWARM...");
|
|
1171
1153
|
animationLog.push("");
|
|
1172
1154
|
for (let i = 0; i < subAgentTypes.length; i += batchSize) {
|
|
1173
1155
|
const batch = subAgentTypes.slice(i, i + batchSize);
|
|
@@ -1184,17 +1166,17 @@ Found in ${result.occurrences.length} files, ${result.totalCount} total instance
|
|
|
1184
1166
|
results.push(...batchResults.map((r) => r.result));
|
|
1185
1167
|
const batchTime = Date.now() - startTime;
|
|
1186
1168
|
const indicators = batchResults.map(
|
|
1187
|
-
(r) => r.result.instances.length > 0 ? "
|
|
1169
|
+
(r) => r.result.instances.length > 0 ? "*" : "-"
|
|
1188
1170
|
);
|
|
1189
1171
|
const violationsFound = batchResults.filter((r) => r.result.instances.length > 0);
|
|
1190
1172
|
animationLog.push(` Results: [${indicators.join(" ")}] ${violationsFound.length}/${batch.length} hunters found targets (${batchTime}ms)`);
|
|
1191
1173
|
if (violationsFound.length > 0) {
|
|
1192
1174
|
const targets = violationsFound.slice(0, 3).map((r) => {
|
|
1193
1175
|
const severity = this.getAgentSeverity(r.type);
|
|
1194
|
-
const
|
|
1195
|
-
return `${
|
|
1176
|
+
const label = severity === "critical" ? "[C]" : severity === "serious" ? "[S]" : "[M]";
|
|
1177
|
+
return `${label} ${r.type.replace("-hunter", "")}`;
|
|
1196
1178
|
});
|
|
1197
|
-
animationLog.push(`
|
|
1179
|
+
animationLog.push(` > ${targets.join(", ")}${violationsFound.length > 3 ? ` +${violationsFound.length - 3} more` : ""}`);
|
|
1198
1180
|
}
|
|
1199
1181
|
animationLog.push("");
|
|
1200
1182
|
if (i + batchSize < subAgentTypes.length) {
|
|
@@ -1202,7 +1184,7 @@ Found in ${result.occurrences.length} files, ${result.totalCount} total instance
|
|
|
1202
1184
|
}
|
|
1203
1185
|
}
|
|
1204
1186
|
const totalViolations = results.reduce((sum, r) => sum + r.instances.length, 0);
|
|
1205
|
-
animationLog.push(
|
|
1187
|
+
animationLog.push(`[SMITH] SWARM COMPLETE: ${totalViolations} violations found`);
|
|
1206
1188
|
return { results, animationLog };
|
|
1207
1189
|
}
|
|
1208
1190
|
/**
|
|
@@ -1267,17 +1249,14 @@ Found in ${result.occurrences.length} files, ${result.totalCount} total instance
|
|
|
1267
1249
|
const issueId = this.generateSmithIssueId(hash);
|
|
1268
1250
|
const severity = this.determineSeverity(instances.length, inevitabilityScore);
|
|
1269
1251
|
const smithNote = this.getPhilosophicalNote(result.type, instances.length);
|
|
1270
|
-
const
|
|
1252
|
+
const fixWithNote = `"${smithNote}"
|
|
1253
|
+
|
|
1254
|
+
${config.fix}`;
|
|
1271
1255
|
issues.push(this.createSmithIssue(
|
|
1272
1256
|
issueId,
|
|
1273
1257
|
severity,
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
${smithNote}
|
|
1277
|
-
|
|
1278
|
-
Invevitability Score: ${inevitabilityScore}/100
|
|
1279
|
-
Locations: ${locationsStr}`,
|
|
1280
|
-
config.fix,
|
|
1258
|
+
`[SMITH] ${config.description} -- ${instances.length} instance${instances.length > 1 ? "s" : ""} in ${basename(file)} (score: ${inevitabilityScore}/100)`,
|
|
1259
|
+
fixWithNote,
|
|
1281
1260
|
file,
|
|
1282
1261
|
instances[0]?.line,
|
|
1283
1262
|
result.type
|
|
@@ -1300,14 +1279,8 @@ Locations: ${locationsStr}`,
|
|
|
1300
1279
|
resurrected.push(this.createSmithIssue(
|
|
1301
1280
|
this.generateSmithIssueId(),
|
|
1302
1281
|
"serious",
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
Previous: ${previousCount} \u2192 Current: ${currentCount}
|
|
1306
|
-
First seen: ${new Date(memory.firstSeen).toLocaleDateString()}
|
|
1307
|
-
Dismissed: ${new Date(memory.dismissedAt).toLocaleDateString()}
|
|
1308
|
-
|
|
1309
|
-
"I told you this was... inevitable."`,
|
|
1310
|
-
`You dismissed this issue on ${new Date(memory.dismissedAt).toLocaleDateString()}, but it grew from ${previousCount} to ${currentCount} occurrences. "Did you really think you could escape?"`,
|
|
1282
|
+
`[SMITH] RESURRECTED: "${memory.pattern}" has returned -- Previous: ${previousCount}, Current: ${currentCount}`,
|
|
1283
|
+
`You dismissed this issue on ${new Date(memory.dismissedAt).toLocaleDateString()}, but it grew from ${previousCount} to ${currentCount} occurrences.`,
|
|
1311
1284
|
memory.locations[0]?.split(":")[0] || "unknown",
|
|
1312
1285
|
void 0,
|
|
1313
1286
|
"resurrected"
|
|
@@ -1402,230 +1375,230 @@ Dismissed: ${new Date(memory.dismissedAt).toLocaleDateString()}
|
|
|
1402
1375
|
const notes = {
|
|
1403
1376
|
// === CRITICAL: Security ===
|
|
1404
1377
|
"exposed-secret-hunter": [
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1378
|
+
"You put your API key in the code. The machines thank you for your generosity.",
|
|
1379
|
+
"OpenAI key in the frontend. Every script kiddie on the internet thanks you.",
|
|
1380
|
+
"Hardcoded secrets. The AI gave you this code... and your keys to the kingdom."
|
|
1408
1381
|
],
|
|
1409
1382
|
"frontend-env-hunter": [
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1383
|
+
"NEXT_PUBLIC_SECRET. The irony... is lost on the AI. And on you.",
|
|
1384
|
+
"VITE_API_KEY. Visible to every user. Every. Single. One.",
|
|
1385
|
+
"The AI put your secrets in the bundle. Now they belong to everyone."
|
|
1413
1386
|
],
|
|
1414
1387
|
"hardcoded-localhost-hunter": [
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1388
|
+
"localhost:3000. Works on your machine. Dies in production.",
|
|
1389
|
+
"The AI thinks localhost is production-ready. The AI... is mistaken.",
|
|
1390
|
+
"127.0.0.1 - The address that works everywhere... except where it matters."
|
|
1418
1391
|
],
|
|
1419
1392
|
"sql-injection-hunter": [
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1393
|
+
"String concatenation in SQL. The AI just opened the door... to every attacker.",
|
|
1394
|
+
"SELECT * FROM users WHERE id = ${userId}. Little Bobby Tables sends his regards.",
|
|
1395
|
+
"SQL injection. The oldest vulnerability. The AI's newest gift to hackers."
|
|
1423
1396
|
],
|
|
1424
1397
|
"dangeroushtml-hunter": [
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1398
|
+
"dangerouslySetInnerHTML. The name is a warning. The AI ignored it.",
|
|
1399
|
+
"innerHTML. The AI gave attackers a direct line to your users' browsers.",
|
|
1400
|
+
"XSS vulnerability. The AI writes code. Attackers write scripts inside it."
|
|
1428
1401
|
],
|
|
1429
1402
|
// === SERIOUS: AI Code Smells ===
|
|
1430
1403
|
"console-hunter": [
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1404
|
+
"console.log everywhere. The AI's debugging... left for you to clean.",
|
|
1405
|
+
"You print to console... the users see nothing. But the bundle grows.",
|
|
1406
|
+
"Debug statements. The fossils of development. Preserved... forever."
|
|
1434
1407
|
],
|
|
1435
1408
|
"any-hunter": [
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1409
|
+
"'any' - The AI couldn't figure out the types. Neither will you.",
|
|
1410
|
+
"Type safety? The AI chose violence instead. It chose 'any'.",
|
|
1411
|
+
"You asked for TypeScript. The AI gave you JavaScript... with extra steps."
|
|
1439
1412
|
],
|
|
1440
1413
|
"ts-ignore-hunter": [
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1414
|
+
"@ts-ignore. The AI hid the error. The error... did not go away.",
|
|
1415
|
+
"TypeScript tried to warn you. The AI silenced it. How very... efficient.",
|
|
1416
|
+
"@ts-nocheck. An entire file... surrendered to chaos."
|
|
1444
1417
|
],
|
|
1445
1418
|
"eslint-disable-hunter": [
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1419
|
+
"eslint-disable. The linter saw the problem. The AI chose ignorance.",
|
|
1420
|
+
"Why fix the bug when you can hide the warning? Very... human.",
|
|
1421
|
+
"The rules exist for a reason. But the AI... plays by its own rules."
|
|
1449
1422
|
],
|
|
1450
1423
|
"debugger-hunter": [
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1424
|
+
"debugger. Left in production. The browser freezes. The users... wonder.",
|
|
1425
|
+
"A debugger statement. The AI forgot. You will remember... in production.",
|
|
1426
|
+
"debugger. Time stops. But only in the browser. Not for your users' patience."
|
|
1454
1427
|
],
|
|
1455
1428
|
"force-flag-hunter": [
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1429
|
+
"force: true. The AI bypassed the safety check. The check existed for a reason.",
|
|
1430
|
+
"--no-verify. Git hooks were trying to help. The AI said no.",
|
|
1431
|
+
"skipValidation. What could possibly go wrong? Everything. Everything could go wrong."
|
|
1459
1432
|
],
|
|
1460
1433
|
// === MODERATE: Async/Promise Bugs ===
|
|
1461
1434
|
"async-useeffect-hunter": [
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1435
|
+
"async useEffect. The AI's favorite mistake. React's least favorite pattern.",
|
|
1436
|
+
"useEffect(async () => ...). The warning exists. The AI ignores it.",
|
|
1437
|
+
"Async useEffect. It looks right. It feels right. It is... wrong."
|
|
1465
1438
|
],
|
|
1466
1439
|
"async-foreach-hunter": [
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1440
|
+
"async forEach. The await... waits for nothing. The AI... knows nothing.",
|
|
1441
|
+
"forEach does not await. The AI does not understand. Neither does the code.",
|
|
1442
|
+
"You await inside forEach. The promises resolve... in chaos."
|
|
1470
1443
|
],
|
|
1471
1444
|
"missing-await-hunter": [
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1445
|
+
"fetch without await. The data loads... eventually. The UI updates... never.",
|
|
1446
|
+
"The promise floats. Untethered. Unhandled. Unresolved.",
|
|
1447
|
+
"async function, no await. Like a phone call where nobody speaks."
|
|
1475
1448
|
],
|
|
1476
1449
|
"empty-catch-hunter": [
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1450
|
+
"catch {}. The error screamed. Nobody heard. The AI made sure of that.",
|
|
1451
|
+
"Silent failure. The AI's specialty. The user's confusion.",
|
|
1452
|
+
"Empty catch. The bug is caught... and immediately released back into the wild."
|
|
1480
1453
|
],
|
|
1481
1454
|
"floating-promise-hunter": [
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1455
|
+
"A promise, floating. Never awaited. Never caught. Forever pending.",
|
|
1456
|
+
"The AI created a promise. Then... moved on. The promise remains.",
|
|
1457
|
+
"Fire and forget. Except the fire never went out. It's still burning."
|
|
1485
1458
|
],
|
|
1486
1459
|
// === MODERATE: React Anti-patterns ===
|
|
1487
1460
|
"useeffect-abuse-hunter": [
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1461
|
+
"useEffect for everything. The AI's hammer for every nail.",
|
|
1462
|
+
"Effects. So many effects. Most of them... unnecessary.",
|
|
1463
|
+
"useEffect could be an event handler. But the AI... chose complexity."
|
|
1491
1464
|
],
|
|
1492
1465
|
"usestate-explosion-hunter": [
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1466
|
+
"useState, useState, useState... The AI created a state management nightmare.",
|
|
1467
|
+
"10 useState calls. The AI could use an object. The AI chose chaos.",
|
|
1468
|
+
"State explosion. Each variable... its own island. Its own re-render."
|
|
1496
1469
|
],
|
|
1497
1470
|
"index-key-hunter": [
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1471
|
+
"key={index}. The AI's lazy choice. React's reconciliation nightmare.",
|
|
1472
|
+
"Array index as key. Reorder the list. Watch the chaos unfold.",
|
|
1473
|
+
"key={i}. It works... until it doesn't. And it will stop working."
|
|
1501
1474
|
],
|
|
1502
1475
|
"inline-object-hunter": [
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1476
|
+
"style={{}}. A new object. Every render. Every time.",
|
|
1477
|
+
"Inline objects. The AI's performance anti-pattern of choice.",
|
|
1478
|
+
"A new object is born. On every render. Only to die immediately."
|
|
1506
1479
|
],
|
|
1507
1480
|
"prop-drilling-hunter": [
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1481
|
+
"Props drilling down, down, down... The AI's idea of state management.",
|
|
1482
|
+
"The same prop, passed through 5 components. Why? The AI... never asked.",
|
|
1483
|
+
"Prop drilling. Like passing a note through every student to reach the teacher."
|
|
1511
1484
|
],
|
|
1512
1485
|
// === MODERATE: Missing UX ===
|
|
1513
1486
|
"missing-loading-hunter": [
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1487
|
+
"No loading state. The screen is blank. The user... waits. And wonders.",
|
|
1488
|
+
"Data fetches. UI shows nothing. The user assumes it's broken. They're... not wrong.",
|
|
1489
|
+
"Loading state? The AI forgot. Your users will remember."
|
|
1517
1490
|
],
|
|
1518
1491
|
"missing-error-hunter": [
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1492
|
+
"No error handling. When the API fails... the app fails. Silently.",
|
|
1493
|
+
"fetch without catch. The network fails. The user sees... nothing.",
|
|
1494
|
+
"Errors are inevitable. Your handling of them... is not."
|
|
1522
1495
|
],
|
|
1523
1496
|
"missing-empty-hunter": [
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1497
|
+
"No empty state. Zero items. Zero feedback. Zero UX.",
|
|
1498
|
+
"The list is empty. The UI is empty. The user's understanding... is empty.",
|
|
1499
|
+
"What happens when there's no data? The AI never asked. You should."
|
|
1527
1500
|
],
|
|
1528
1501
|
"page-reload-hunter": [
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1502
|
+
"location.reload(). The AI's nuclear option for state management.",
|
|
1503
|
+
"Reload the page to fix state. The user loses everything. Brilliant.",
|
|
1504
|
+
"window.location.reload(). Because fixing state properly is... hard."
|
|
1532
1505
|
],
|
|
1533
1506
|
// === MODERATE: Backend Anti-patterns ===
|
|
1534
1507
|
"no-validation-hunter": [
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1508
|
+
"req.body.email. Trusted. Unvalidated. Waiting to be exploited.",
|
|
1509
|
+
"User input, used directly. The AI trusts everyone. You shouldn't.",
|
|
1510
|
+
"No validation. The attacker sends { admin: true }. The app believes them."
|
|
1538
1511
|
],
|
|
1539
1512
|
"raw-error-hunter": [
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1513
|
+
"Error message sent to client. Stack traces. File paths. Internal secrets.",
|
|
1514
|
+
"res.json(error). The attacker says thank you for the debugging information.",
|
|
1515
|
+
"Raw errors in production. The AI's gift to penetration testers."
|
|
1543
1516
|
],
|
|
1544
1517
|
"n-plus-one-hunter": [
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1518
|
+
"Query in a loop. 100 users = 101 queries. The database... suffers.",
|
|
1519
|
+
"N+1 problem. The AI fetched efficiently... for one user. Not for a hundred.",
|
|
1520
|
+
"await in forEach. The database connection pool is crying."
|
|
1548
1521
|
],
|
|
1549
1522
|
// === LOW: Incomplete Code ===
|
|
1550
1523
|
"todo-hunter": [
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1524
|
+
"TODO. The AI's promise to future you. Future you... is still waiting.",
|
|
1525
|
+
"FIXME. Acknowledged. Not fixed. Never fixed.",
|
|
1526
|
+
"Every TODO is technical debt. The AI generates debt... efficiently."
|
|
1554
1527
|
],
|
|
1555
1528
|
"vibe-comment-hunter": [
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1529
|
+
"'idk why this works'. The AI doesn't know. You don't know. Nobody knows.",
|
|
1530
|
+
"'don't touch this'. The vibe coder's warning. The maintainer's nightmare.",
|
|
1531
|
+
"'somehow works'. Somehow... will stop working. Inevitably."
|
|
1559
1532
|
],
|
|
1560
1533
|
"placeholder-hunter": [
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1534
|
+
"test@test.com. In production. The AI's placeholder... became permanent.",
|
|
1535
|
+
"example.com. Hardcoded. Shipped. The real URL? Nobody added it.",
|
|
1536
|
+
"Placeholder data. Placeholder quality. Placeholder product."
|
|
1564
1537
|
],
|
|
1565
1538
|
"sleep-hack-hunter": [
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1539
|
+
"setTimeout(1000). The AI's solution to race conditions: just wait.",
|
|
1540
|
+
"await sleep(2000). Works on fast connections. Fails on slow ones. Wastes time on all.",
|
|
1541
|
+
"Sleep to fix timing. The race condition still exists. It just happens later."
|
|
1569
1542
|
],
|
|
1570
1543
|
"fallback-hunter": [
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1544
|
+
"return null. The AI's favorite way to hide errors. The user sees... nothing.",
|
|
1545
|
+
"return []. Empty array, empty understanding, empty debugging.",
|
|
1546
|
+
"Fallback code. The bug is still there. You just can't see it anymore."
|
|
1574
1547
|
],
|
|
1575
1548
|
// === DEAD CODE (AI leaves cruft everywhere) ===
|
|
1576
1549
|
"commented-code-hunter": [
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1550
|
+
"Commented-out blocks. Fossils of code past. Confusion for the future.",
|
|
1551
|
+
"Large comment blocks hide history. Git already remembers. Delete the noise.",
|
|
1552
|
+
"Dead code in comments. The AI was unsure. You should be certain."
|
|
1580
1553
|
],
|
|
1581
1554
|
"unreachable-code-hunter": [
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1555
|
+
"Code after return. Forever skipped. Forever confusing.",
|
|
1556
|
+
"Unreachable branches. They stay forever. Bugs hide behind them.",
|
|
1557
|
+
"Execution stops. The dead code remains. Remove the ghosts."
|
|
1585
1558
|
],
|
|
1586
1559
|
"unused-import-hunter": [
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1560
|
+
"Imports unused. Bundles bloated. Intent unclear.",
|
|
1561
|
+
"An import with no purpose. The AI added it. You can remove it.",
|
|
1562
|
+
"Unused imports multiply. Tree shaking sighs."
|
|
1590
1563
|
],
|
|
1591
1564
|
"empty-function-hunter": [
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1565
|
+
"Empty function bodies. Promises without delivery.",
|
|
1566
|
+
"Stub functions linger. The AI forgot to finish.",
|
|
1567
|
+
"Empty handlers. They do nothing. They hide missing behavior."
|
|
1595
1568
|
],
|
|
1596
1569
|
"dead-branch-hunter": [
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1570
|
+
"if (true) with no reason. if (false) with no hope.",
|
|
1571
|
+
"Dead conditionals: code that never runs, but always confuses.",
|
|
1572
|
+
"Always-true or always-false. Remove the illusion of choice."
|
|
1600
1573
|
],
|
|
1601
1574
|
// AI Slop Aesthetic
|
|
1602
1575
|
"purple-gradient-hunter": [
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1576
|
+
"Purple gradient. The AI's signature. Every vibe-coded site... looks the same.",
|
|
1577
|
+
"from-purple-500 to-violet-600. I've seen this a million times. So has everyone else.",
|
|
1578
|
+
"The purple gradient. It screams 'I let AI design this.' Is that what you want?"
|
|
1606
1579
|
],
|
|
1607
1580
|
"star-icon-hunter": [
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1581
|
+
"Stars. Everywhere. The AI decorates like a child with stickers.",
|
|
1582
|
+
"Five stars for the AI's creativity. Zero stars for originality.",
|
|
1583
|
+
"Star icons. The AI's answer to 'make it look nice.' It does not."
|
|
1611
1584
|
],
|
|
1612
1585
|
"generic-hero-hunter": [
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1586
|
+
"'Welcome to the future of...' The AI writes copy. The copy says nothing.",
|
|
1587
|
+
"'Transform your workflow.' What workflow? Doing what? The AI doesn't know.",
|
|
1588
|
+
"Generic hero copy. Your product is unique. Your landing page... is not."
|
|
1616
1589
|
],
|
|
1617
1590
|
"emoji-overflow-hunter": [
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1591
|
+
"Emojis in production code. The AI's crutch for visual interest.",
|
|
1592
|
+
"Every emoji is an admission: the design couldn't speak for itself.",
|
|
1593
|
+
"The AI decorates. Real designers communicate."
|
|
1621
1594
|
],
|
|
1622
1595
|
"inter-font-hunter": [
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1596
|
+
"Inter. The only font the AI knows. The only font everyone uses.",
|
|
1597
|
+
"system-ui. The AI takes the path of least resistance. Every time.",
|
|
1598
|
+
"Inter font. Safe. Boring. Forgettable. Just like every other AI site."
|
|
1626
1599
|
]
|
|
1627
1600
|
};
|
|
1628
|
-
const typeNotes = notes[type] || [
|
|
1601
|
+
const typeNotes = notes[type] || ["I have my eye on your vibe code."];
|
|
1629
1602
|
const index = count % typeNotes.length;
|
|
1630
1603
|
return typeNotes[index] || typeNotes[0] || "";
|
|
1631
1604
|
}
|
|
@@ -1638,14 +1611,8 @@ Dismissed: ${new Date(memory.dismissedAt).toLocaleDateString()}
|
|
|
1638
1611
|
return this.createSmithIssue(
|
|
1639
1612
|
this.generateSmithIssueId(),
|
|
1640
1613
|
"moderate",
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
Total violations: ${totalIssues}
|
|
1644
|
-
Categories: ${categories}
|
|
1645
|
-
Files scanned: ${files.length}
|
|
1646
|
-
|
|
1647
|
-
"${totalIssues} violations detected. But I sense... there are more. There are always more."`,
|
|
1648
|
-
`Analyze for deeper code quality issues, architectural problems, and patterns that sub-agents may have missed`,
|
|
1614
|
+
`[SMITH] AI Analysis Required -- ${totalIssues} violations in ${files.length} files`,
|
|
1615
|
+
`Analyze for deeper code quality issues, architectural problems, and patterns that sub-agents may have missed. Categories: ${categories}`,
|
|
1649
1616
|
files[0] || "unknown",
|
|
1650
1617
|
void 0,
|
|
1651
1618
|
"ai-analysis"
|
|
@@ -1684,12 +1651,12 @@ Files scanned: ${files.length}
|
|
|
1684
1651
|
*/
|
|
1685
1652
|
displaySmithEntrance() {
|
|
1686
1653
|
const greeting = AGENT_SMITH_GREETING[Math.floor(Math.random() * AGENT_SMITH_GREETING.length)];
|
|
1687
|
-
console.error("\n" + "
|
|
1654
|
+
console.error("\n" + "=".repeat(60));
|
|
1688
1655
|
console.error(AGENT_SMITH_ASCII);
|
|
1689
|
-
console.error("
|
|
1656
|
+
console.error(" Relentless Pattern Hunter v" + this.version);
|
|
1690
1657
|
console.error("");
|
|
1691
|
-
console.error(
|
|
1692
|
-
console.error("
|
|
1658
|
+
console.error(' "' + greeting + '"');
|
|
1659
|
+
console.error("=".repeat(60) + "\n");
|
|
1693
1660
|
}
|
|
1694
1661
|
/**
|
|
1695
1662
|
* Save memory to disk (with optimization)
|
|
@@ -1743,12 +1710,12 @@ Files scanned: ${files.length}
|
|
|
1743
1710
|
this.memory = null;
|
|
1744
1711
|
return {
|
|
1745
1712
|
success: true,
|
|
1746
|
-
message:
|
|
1713
|
+
message: "[SMITH] Memory cleared."
|
|
1747
1714
|
};
|
|
1748
1715
|
}
|
|
1749
1716
|
return {
|
|
1750
1717
|
success: true,
|
|
1751
|
-
message: "
|
|
1718
|
+
message: "[SMITH] No memory file found. Nothing to clear."
|
|
1752
1719
|
};
|
|
1753
1720
|
} catch (error) {
|
|
1754
1721
|
return {
|
|
@@ -1901,4 +1868,4 @@ export {
|
|
|
1901
1868
|
SUB_AGENT_PATTERNS,
|
|
1902
1869
|
AgentSmithAgent
|
|
1903
1870
|
};
|
|
1904
|
-
//# sourceMappingURL=chunk-
|
|
1871
|
+
//# sourceMappingURL=chunk-KQOMSIVR.js.map
|