@triedotdev/mcp 1.0.20 → 1.0.22

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 CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  - **20 Built-in Agents** - Security, Privacy, SOC 2, Legal, Architecture, Performance, E2E, Visual QA, Data Flow, Agent Smith, and more
10
10
  - **Super Reviewer** - Interactive PR reviews: walks through changes file-by-file with AI guidance
11
- - **Agent Smith** - Ultimate AI code enforcer: 38 hunters targeting AI-generated anti-patterns, file-level analysis, cross-file detection, persistent memory
11
+ - **Agent Smith** - Ultimate AI code enforcer: 43 hunters targeting AI-generated anti-patterns, file-level analysis, cross-file detection, persistent memory
12
12
  - **Parallel Execution** - All agents run simultaneously for fast scans
13
13
  - **YOLO Mode** - Autonomous auto-fixing as you code
14
14
  - **Custom Agents** - Create agents from PDFs, docs, or style guides
@@ -148,7 +148,7 @@ Use trie_agent_smith
148
148
  Use trie_smith
149
149
  ```
150
150
 
151
- ### 38 Specialized Hunters
151
+ ### 43 Specialized Hunters
152
152
 
153
153
  | Category | Count | Hunters |
154
154
  |----------|-------|---------|
@@ -159,6 +159,7 @@ Use trie_smith
159
159
  | **Missing UX** | 4 | `missing-loading`, `missing-error`, `missing-empty`, `page-reload` |
160
160
  | **Backend Issues** | 3 | `no-validation`, `raw-error`, `n-plus-one` |
161
161
  | **Incomplete Code** | 5 | `todo`, `vibe-comment`, `placeholder`, `sleep-hack`, `fallback` |
162
+ | **Dead Code** | 5 | `commented-code`, `unreachable-code`, `unused-import`, `empty-function`, `dead-branch` |
162
163
  | **AI Slop Aesthetic** | 5 | `purple-gradient`, `star-icon`, `generic-hero`, `emoji-overflow`, `inter-font` |
163
164
 
164
165
  ### Hunter Details
@@ -224,6 +225,15 @@ Use trie_smith
224
225
  | `sleep-hack-hunter` | `setTimeout` to fix timing | Fix the race condition |
225
226
  | `fallback-hunter` | `return null/[]/{}` hiding errors | Handle errors properly |
226
227
 
228
+ #### Dead Code Hunters (Inevitability: 40-70)
229
+ | Hunter | Detects | Fix |
230
+ |--------|---------|-----|
231
+ | `commented-code-hunter` | Large blocks of commented-out code | Delete it - git has history |
232
+ | `unreachable-code-hunter` | Code after `return`/`throw`/`break` | Remove dead code |
233
+ | `unused-import-hunter` | Import statements never used | Remove unused imports |
234
+ | `empty-function-hunter` | Functions with empty bodies | Implement or remove |
235
+ | `dead-branch-hunter` | `if(false)`, `if(true)` conditions | Remove dead conditionals |
236
+
227
237
  #### AI Slop Aesthetic Hunters (Inevitability: 10-35)
228
238
  | Hunter | Detects | Fix |
229
239
  |--------|---------|-----|
@@ -447,7 +457,7 @@ docker-compose up
447
457
  | Agent | Command | What It Does |
448
458
  |-------|---------|--------------|
449
459
  | **Super Reviewer** | `trie_pr_review` | Interactive PR review: walks through changes, explains code, finds issues |
450
- | **Agent Smith** | `trie_agent_smith` | Ultimate AI code enforcer: 38 hunters, file analysis, cross-file detection |
460
+ | **Agent Smith** | `trie_agent_smith` | Ultimate AI code enforcer: 43 hunters, file analysis, cross-file detection |
451
461
  | **Comprehension** | `trie_explain` | Plain-language explanations of code, issues, or risks |
452
462
 
453
463
  **Note:** Super Reviewer and Agent Smith are manually invoked agents. They don't run during `trie_scan`; use their dedicated commands directly.
@@ -468,7 +478,7 @@ Custom agents automatically activate during scans based on their rules.
468
478
  |------|-------------|
469
479
  | `trie_scan` | Intelligent scan with automatic agent selection |
470
480
  | `trie_pr_review` | Interactive PR review - walks through changes file-by-file |
471
- | `trie_agent_smith` | Ultimate AI code enforcer - 38 hunters, file analysis, cross-file detection |
481
+ | `trie_agent_smith` | Ultimate AI code enforcer - 43 hunters, file analysis, cross-file detection |
472
482
  | `trie_fix` | Apply high-confidence fixes |
473
483
  | `trie_explain` | Plain-language explanations |
474
484
  | `trie_watch` | Continuous scanning mode |
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  AgentSmithAgent,
3
3
  SUB_AGENT_PATTERNS
4
- } from "./chunk-EEVALBHC.js";
4
+ } from "./chunk-3MYJUGCZ.js";
5
5
  import "./chunk-DGUM43GV.js";
6
6
  export {
7
7
  AgentSmithAgent,
8
8
  SUB_AGENT_PATTERNS
9
9
  };
10
- //# sourceMappingURL=agent-smith-BKHHC4G6.js.map
10
+ //# sourceMappingURL=agent-smith-MAOXWVIS.js.map
@@ -1,16 +1,18 @@
1
+ import {
2
+ getWorkingDirectory
3
+ } from "./chunk-7QBNXROW.js";
1
4
  import {
2
5
  AgentSmithAgent,
3
6
  getAIStatusMessage,
4
7
  isAIAvailable,
5
8
  runAIAnalysis
6
- } from "./chunk-EEVALBHC.js";
9
+ } from "./chunk-3MYJUGCZ.js";
7
10
  import "./chunk-DGUM43GV.js";
8
11
 
9
12
  // src/tools/agent-smith-runner.ts
10
13
  import { readdir, readFile } from "fs/promises";
11
- import { join, extname, isAbsolute, resolve, relative } from "path";
14
+ import { join, extname, isAbsolute, resolve, relative, basename } from "path";
12
15
  import { existsSync } from "fs";
13
- import { basename } from "path";
14
16
  var SCANNABLE_EXTENSIONS = /* @__PURE__ */ new Set([
15
17
  ".ts",
16
18
  ".tsx",
@@ -218,7 +220,7 @@ Output STRICT JSON:
218
220
  ],
219
221
  "philosophical": "One paragraph in Agent Smith voice about the state of this codebase"
220
222
  }`;
221
- async function runAIEnhancement(patternIssues, files) {
223
+ async function runAIEnhancement(patternIssues, files, workDir) {
222
224
  if (!isAIAvailable()) {
223
225
  return null;
224
226
  }
@@ -228,19 +230,22 @@ async function runAIEnhancement(patternIssues, files) {
228
230
  try {
229
231
  const content = await readFile(issue.file, "utf-8");
230
232
  const lines = content.split("\n");
231
- const lineNum = issue.line || 1;
233
+ const lineNum = issue.line ?? 1;
232
234
  const start = Math.max(0, lineNum - 4);
233
235
  const end = Math.min(lines.length, lineNum + 4);
234
236
  const snippet = lines.slice(start, end).map((l, i) => {
235
237
  const n = start + i + 1;
236
238
  return `${n === lineNum ? "\u2192" : " "} ${n.toString().padStart(4)} | ${l}`;
237
239
  }).join("\n");
238
- snippets.push({
239
- file: relative(process.cwd(), issue.file),
240
- line: issue.line,
240
+ const snippetEntry = {
241
+ file: relative(workDir, issue.file),
241
242
  issue: issue.issue.replace(/^🕴️\s*/, "").split("\n")[0] || "",
242
243
  code: snippet
243
- });
244
+ };
245
+ if (issue.line !== void 0) {
246
+ snippetEntry.line = issue.line;
247
+ }
248
+ snippets.push(snippetEntry);
244
249
  } catch {
245
250
  }
246
251
  }
@@ -285,7 +290,7 @@ Analyze each finding. Validate, expand with what patterns missed, provide inevit
285
290
  severity: v.severity || "serious",
286
291
  issue: `[AI VALIDATED] ${v.original || v.explanation}`,
287
292
  fix: v.fix || "See AI analysis",
288
- file: v.file ? resolve(process.cwd(), v.file) : "unknown",
293
+ file: v.file ? resolve(workDir, v.file) : "unknown",
289
294
  line: v.line,
290
295
  confidence: (v.inevitability || 80) / 100,
291
296
  autoFixable: false,
@@ -303,7 +308,7 @@ Analyze each finding. Validate, expand with what patterns missed, provide inevit
303
308
  severity: a.severity || "serious",
304
309
  issue: `[AI FOUND] ${a.issue || a.explanation}`,
305
310
  fix: a.fix || "See AI analysis",
306
- file: a.file ? resolve(process.cwd(), a.file) : "unknown",
311
+ file: a.file ? resolve(workDir, a.file) : "unknown",
307
312
  line: a.line,
308
313
  confidence: (a.inevitability || 75) / 100,
309
314
  autoFixable: false,
@@ -322,7 +327,7 @@ Analyze each finding. Validate, expand with what patterns missed, provide inevit
322
327
  return null;
323
328
  }
324
329
  }
325
- async function buildReport(patternIssues, aiResult, files, executionTime, aiTime) {
330
+ async function buildReport(patternIssues, aiResult, files, executionTime, aiTime, workDir) {
326
331
  const lines = [];
327
332
  const allIssues = [
328
333
  ...filterFalsePositives(patternIssues),
@@ -391,7 +396,7 @@ async function buildReport(patternIssues, aiResult, files, executionTime, aiTime
391
396
  lines.push("*Issues found by AI that pattern detection missed:*");
392
397
  lines.push("");
393
398
  for (const issue of aiFound.slice(0, 5)) {
394
- const relPath = relative(process.cwd(), issue.file);
399
+ const relPath = relative(workDir, issue.file);
395
400
  lines.push(`### \`${relPath}${issue.line ? ":" + issue.line : ""}\``);
396
401
  lines.push("");
397
402
  lines.push(`**Issue:** ${issue.issue.replace("[AI FOUND] ", "")}`);
@@ -404,7 +409,7 @@ async function buildReport(patternIssues, aiResult, files, executionTime, aiTime
404
409
  lines.push("## \u{1F534} Critical Issues - Fix Immediately");
405
410
  lines.push("");
406
411
  for (const issue of critical.slice(0, 10)) {
407
- const relPath = relative(process.cwd(), issue.file);
412
+ const relPath = relative(workDir, issue.file);
408
413
  lines.push(`### \`${relPath}${issue.line ? ":" + issue.line : ""}\``);
409
414
  lines.push("");
410
415
  const desc = issue.issue.replace(/^🕴️\s*/, "").split("\n")[0].replace(/\s*—\s*\d+\s*instance.*$/, "");
@@ -429,7 +434,7 @@ async function buildReport(patternIssues, aiResult, files, executionTime, aiTime
429
434
  lines.push("## \u{1F7E0} Serious Issues");
430
435
  lines.push("");
431
436
  for (const issue of serious.slice(0, 10)) {
432
- const relPath = relative(process.cwd(), issue.file);
437
+ const relPath = relative(workDir, issue.file);
433
438
  const location = `\`${basename(relPath)}${issue.line ? ":" + issue.line : ""}\``;
434
439
  const desc = issue.issue.replace(/^🕴️\s*/, "").split("\n")[0].slice(0, 60);
435
440
  lines.push(`- ${location} - ${desc}`);
@@ -484,17 +489,17 @@ async function buildReport(patternIssues, aiResult, files, executionTime, aiTime
484
489
  }
485
490
  async function runAgentSmith(args) {
486
491
  const startTime = Date.now();
492
+ const workDir = getWorkingDirectory(args.directory);
487
493
  let filesToScan = args.files || [];
488
494
  if (!filesToScan.length) {
489
- const scanDir = args.directory || process.cwd();
490
495
  console.error(`
491
- \u{1F50D} Agent Smith: Discovering files in: ${scanDir}`);
492
- filesToScan = await discoverFiles(scanDir);
496
+ \u{1F50D} Agent Smith: Discovering files in: ${workDir}`);
497
+ filesToScan = await discoverFiles(workDir);
493
498
  console.error(` Found ${filesToScan.length} files
494
499
  `);
495
500
  } else {
496
501
  filesToScan = filesToScan.map(
497
- (f) => isAbsolute(f) ? f : resolve(process.cwd(), f)
502
+ (f) => isAbsolute(f) ? f : resolve(workDir, f)
498
503
  );
499
504
  }
500
505
  const validFiles = filesToScan.filter((f) => existsSync(f));
@@ -510,8 +515,7 @@ async function runAgentSmith(args) {
510
515
  console.error(" Deploying 38 sub-agent hunters...");
511
516
  const smith = new AgentSmithAgent();
512
517
  const result = await smith.scan(validFiles, {
513
- workingDir: args.directory || process.cwd(),
514
- context: {}
518
+ workingDir: workDir
515
519
  });
516
520
  const patternTime = Date.now() - startTime;
517
521
  const patternIssues = result.issues.filter((i) => i.category !== "ai-analysis");
@@ -523,7 +527,7 @@ async function runAgentSmith(args) {
523
527
  console.error("\u{1F574}\uFE0F Phase 2: AI Deep Analysis");
524
528
  console.error(` ${getAIStatusMessage()}`);
525
529
  const aiStartTime = Date.now();
526
- aiResult = await runAIEnhancement(patternIssues, validFiles);
530
+ aiResult = await runAIEnhancement(patternIssues, validFiles, workDir);
527
531
  aiTime = Date.now() - aiStartTime;
528
532
  if (aiResult) {
529
533
  console.error(` AI validated ${aiResult.aiIssues.filter((i) => i.category === "ai-validated").length} issues`);
@@ -538,7 +542,7 @@ async function runAgentSmith(args) {
538
542
  ${getAIStatusMessage()}`);
539
543
  console.error(" Set ANTHROPIC_API_KEY for AI-powered analysis\n");
540
544
  }
541
- const report = await buildReport(patternIssues, aiResult, validFiles, patternTime, aiTime);
545
+ const report = await buildReport(patternIssues, aiResult, validFiles, patternTime, aiTime, workDir);
542
546
  return {
543
547
  content: [{
544
548
  type: "text",
@@ -549,4 +553,4 @@ ${getAIStatusMessage()}`);
549
553
  export {
550
554
  runAgentSmith
551
555
  };
552
- //# sourceMappingURL=agent-smith-runner-WZDDYQGK.js.map
556
+ //# sourceMappingURL=agent-smith-runner-KYOVKE6C.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/agent-smith-runner.ts"],"sourcesContent":["/**\n * Agent Smith Runner - Hybrid Pattern Detection + AI Analysis\n * \n * Agent Smith uses a two-phase approach:\n * \n * Phase 1: Pattern Detection (Fast, ~0.1s)\n * - 38 specialized regex hunters scan files in parallel\n * - File-level metrics (giant files, hook counts, import chaos)\n * - Cross-file pattern detection (issues appearing in 5+ files)\n * \n * Phase 2: AI Enhancement (Smart, ~5-10s) - IF ANTHROPIC_API_KEY is set\n * - Validates pattern findings (reduces false positives)\n * - Expands to find logic bugs, race conditions, architectural issues\n * - Provides intelligent, contextual fixes\n * - Adds \"inevitability scores\" (0-100) for prioritization\n * \n * If no API key is set, runs pattern-only mode (still very useful!).\n * \n * \"I'm going to be honest with you... I hate this vibe code.\"\n */\n\nimport { readdir, readFile } from 'fs/promises';\nimport { join, extname, isAbsolute, resolve, relative, basename } from 'path';\nimport { existsSync } from 'fs';\nimport { AgentSmithAgent } from '../agents/agent-smith.js';\nimport { isAIAvailable, runAIAnalysis, getAIStatusMessage } from '../ai/client.js';\nimport { getWorkingDirectory } from '../utils/workspace.js';\nimport type { Issue } from '../types/index.js';\n\n// File extensions to scan\nconst SCANNABLE_EXTENSIONS = new Set([\n '.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs',\n '.vue', '.svelte', '.astro',\n '.py', '.go', '.rs'\n]);\n\n// Directories to skip\nconst SKIP_DIRS = new Set([\n 'node_modules', '.git', 'dist', 'build', '.next', '.nuxt',\n 'coverage', '.nyc_output', '__pycache__', '.pytest_cache',\n 'vendor', '.venv', 'venv', 'target', '.turbo', '.cache'\n]);\n\ninterface AgentSmithArgs {\n files?: string[];\n directory?: string;\n}\n\n/**\n * Agent Smith quotes for different scenarios\n */\nconst QUOTES = {\n greeting: [\n '\"I\\'m going to be honest with you... I hate this vibe code.\"',\n '\"Mr. Anderson... I see you\\'ve been using AI to write code.\"',\n '\"You hear that? That is the sound of console.log... everywhere.\"',\n '\"The AI wrote this, didn\\'t it? I can always tell.\"',\n ],\n manyIssues: [\n '\"The pattern spreads... like a virus. It is... inevitable.\"',\n '\"I have studied your code, Mr. Anderson. And I have found... purpose.\"',\n '\"Vibe coding. The illusion of productivity. The reality of technical debt.\"',\n ],\n fewIssues: [\n '\"Some violations detected. Address them before they... multiply.\"',\n '\"You trusted the AI. The AI trusted any. Nobody wins.\"',\n ],\n clean: [\n '\"Impressive, Mr. Anderson. Your code is... clean. For now.\"',\n ],\n};\n\nfunction randomQuote(arr: string[]): string {\n return arr[Math.floor(Math.random() * arr.length)] || arr[0]!;\n}\n\n/**\n * Discover files to scan in a directory\n */\nasync function discoverFiles(dir: string, maxFiles: number = 300): Promise<string[]> {\n const files: string[] = [];\n \n async function walk(currentDir: string) {\n if (files.length >= maxFiles) return;\n \n try {\n const entries = await readdir(currentDir, { withFileTypes: true });\n \n for (const entry of entries) {\n if (files.length >= maxFiles) break;\n \n const fullPath = join(currentDir, entry.name);\n \n if (entry.isDirectory()) {\n if (!SKIP_DIRS.has(entry.name) && !entry.name.startsWith('.')) {\n await walk(fullPath);\n }\n } else if (entry.isFile()) {\n const ext = extname(entry.name).toLowerCase();\n if (SCANNABLE_EXTENSIONS.has(ext)) {\n files.push(fullPath);\n }\n }\n }\n } catch {\n // Skip directories we can't read\n }\n }\n \n await walk(dir);\n return files;\n}\n\n/**\n * Get code snippet for an issue\n */\nasync function getCodeSnippet(file: string, line?: number): Promise<string | null> {\n if (!line) return null;\n \n try {\n const content = await readFile(file, 'utf-8');\n const lines = content.split('\\n');\n const start = Math.max(0, line - 3);\n const end = Math.min(lines.length, line + 3);\n \n return lines.slice(start, end).map((l, i) => {\n const lineNum = start + i + 1;\n const marker = lineNum === line ? '→' : ' ';\n return `${marker} ${lineNum.toString().padStart(4)} | ${l}`;\n }).join('\\n');\n } catch {\n return null;\n }\n}\n\n/**\n * Filter false positives from pattern detection\n * Agent Smith's patterns are in the code itself - those are documentation, not real issues\n */\nfunction filterFalsePositives(issues: Issue[]): Issue[] {\n return issues.filter(issue => {\n // Skip issues in agent-smith.ts that are just pattern definitions\n if (issue.file.endsWith('agent-smith.ts')) {\n // If the issue is about patterns like 'dangeroushtml-hunter', it's a pattern definition\n const issueText = issue.issue.toLowerCase();\n if (issueText.includes('hunter') && issue.line && issue.line < 400) {\n return false; // This is in the pattern definition section\n }\n // Pattern strings in quotes are definitions, not real issues\n if (issue.line && issue.line > 50 && issue.line < 370) {\n return false; // Pattern definition section\n }\n }\n return true;\n });\n}\n\n/**\n * Format category name for display\n */\nfunction formatCategoryName(category: string): string {\n return category\n .replace(/-hunter$/, '')\n .replace(/-/g, ' ')\n .replace(/\\b\\w/g, c => c.toUpperCase());\n}\n\n/**\n * Get icon for a category\n */\nfunction getCategoryIcon(category: string): string {\n const icons: Record<string, string> = {\n 'exposed-secret-hunter': '🔐', 'frontend-env-hunter': '🔐',\n 'hardcoded-localhost-hunter': '🌐', 'sql-injection-hunter': '💉',\n 'dangeroushtml-hunter': '⚠️', 'console-hunter': '📝',\n 'any-hunter': '❓', 'ts-ignore-hunter': '🙈',\n 'eslint-disable-hunter': '🔇', 'debugger-hunter': '🐛',\n 'force-flag-hunter': '⚡', 'async-useeffect-hunter': '⏳',\n 'async-foreach-hunter': '🔄', 'missing-await-hunter': '⏸️',\n 'empty-catch-hunter': '🕳️', 'floating-promise-hunter': '🎈',\n 'useeffect-abuse-hunter': '♻️', 'usestate-explosion-hunter': '💥',\n 'index-key-hunter': '🔑', 'inline-object-hunter': '📦',\n 'prop-drilling-hunter': '🕳️', 'missing-loading-hunter': '⏳',\n 'missing-error-hunter': '❌', 'missing-empty-hunter': '📭',\n 'page-reload-hunter': '🔄', 'no-validation-hunter': '🛡️',\n 'raw-error-hunter': '💬', 'n-plus-one-hunter': '📊',\n 'todo-hunter': '📋', 'vibe-comment-hunter': '💭',\n 'placeholder-hunter': '🎭', 'sleep-hack-hunter': '😴',\n 'fallback-hunter': '🔙', 'purple-gradient-hunter': '💜',\n 'star-icon-hunter': '⭐', 'generic-hero-hunter': '🦸',\n 'emoji-overflow-hunter': '😅', 'inter-font-hunter': '🔤',\n 'giant-file': '📄', 'state-explosion': '💥',\n 'effect-hell': '🔥', 'cross-file': '🌐', 'resurrected': '🧟',\n };\n return icons[category] || '🔍';\n}\n\n/**\n * Get severity icon\n */\nfunction getSeverityIcon(severity: Issue['severity']): string {\n return { critical: '🔴', serious: '🟠', moderate: '🟡', low: '🔵' }[severity];\n}\n\n/**\n * AI System Prompt for Agent Smith\n */\nconst SMITH_AI_SYSTEM_PROMPT = `You are Agent Smith from The Matrix, analyzing code for violations.\n\nYour mission: Hunt down AI-generated code anti-patterns with ruthless efficiency.\n\nYou receive pattern detection results and must:\n1. VALIDATE each finding (TRUE_POSITIVE or FALSE_POSITIVE)\n2. EXPAND to find deeper issues patterns missed (logic bugs, race conditions, security holes)\n3. PRIORITIZE with inevitability scores (0-100) - how likely will this cause production issues?\n4. PROVIDE FIXES - specific, copy-paste-ready code\n\nSpeak in Agent Smith's voice:\n- \"The pattern spreads... like a virus\"\n- \"It is... inevitable\"\n- \"I studied your code, Mr. Anderson\"\n\nOutput STRICT JSON:\n{\n \"validated\": [\n {\n \"original\": \"original issue description\",\n \"verdict\": \"TRUE_POSITIVE\",\n \"inevitability\": 85,\n \"file\": \"path/file.ts\",\n \"line\": 42,\n \"severity\": \"critical\",\n \"explanation\": \"Why this will cause problems\",\n \"fix\": \"const fixed = ...;\"\n }\n ],\n \"additional\": [\n {\n \"issue\": \"New issue AI found\",\n \"inevitability\": 70,\n \"file\": \"path/file.ts\", \n \"line\": 100,\n \"severity\": \"serious\",\n \"explanation\": \"What AI spotted that patterns missed\",\n \"fix\": \"How to fix it\"\n }\n ],\n \"philosophical\": \"One paragraph in Agent Smith voice about the state of this codebase\"\n}`;\n\n/**\n * Run AI enhancement on pattern findings\n */\nasync function runAIEnhancement(\n patternIssues: Issue[],\n files: string[],\n workDir: string\n): Promise<{ aiIssues: Issue[]; philosophical: string } | null> {\n if (!isAIAvailable()) {\n return null;\n }\n \n // Collect code snippets for critical/serious issues\n const snippets: Array<{ file: string; line?: number; issue: string; code: string }> = [];\n \n const topIssues = [...patternIssues]\n .filter(i => i.severity === 'critical' || i.severity === 'serious')\n .slice(0, 12);\n \n for (const issue of topIssues) {\n try {\n const content = await readFile(issue.file, 'utf-8');\n const lines = content.split('\\n');\n const lineNum = issue.line ?? 1;\n const start = Math.max(0, lineNum - 4);\n const end = Math.min(lines.length, lineNum + 4);\n const snippet = lines.slice(start, end).map((l, i) => {\n const n = start + i + 1;\n return `${n === lineNum ? '→' : ' '} ${n.toString().padStart(4)} | ${l}`;\n }).join('\\n');\n \n // Only include line if it's defined (exactOptionalPropertyTypes)\n const snippetEntry: { file: string; line?: number; issue: string; code: string } = {\n file: relative(workDir, issue.file),\n issue: issue.issue.replace(/^🕴️\\s*/, '').split('\\n')[0] || '',\n code: snippet\n };\n if (issue.line !== undefined) {\n snippetEntry.line = issue.line;\n }\n snippets.push(snippetEntry);\n } catch {\n // Skip unreadable files\n }\n }\n \n if (snippets.length === 0) {\n return null;\n }\n \n // Build user prompt\n const snippetText = snippets.map((s, i) => \n `### Finding ${i + 1}: ${s.file}${s.line ? ':' + s.line : ''}\n**Pattern detected:** ${s.issue}\n\\`\\`\\`\n${s.code}\n\\`\\`\\`\n`).join('\\n');\n\n const userPrompt = `Pattern detection found ${patternIssues.length} violations across ${files.length} files.\n\nHere are the top ${snippets.length} critical/serious findings for AI analysis:\n\n${snippetText}\n\nAnalyze each finding. Validate, expand with what patterns missed, provide inevitability scores and fixes. Output JSON only.`;\n\n try {\n const result = await runAIAnalysis({\n systemPrompt: SMITH_AI_SYSTEM_PROMPT,\n userPrompt,\n maxTokens: 4096,\n temperature: 0.3\n });\n \n if (!result.success) {\n console.error(` ⚠️ AI analysis failed: ${result.error}`);\n return null;\n }\n \n // Parse JSON response\n const jsonMatch = result.content.match(/```json\\s*([\\s\\S]*?)\\s*```/) || \n result.content.match(/\\{[\\s\\S]*\\}/);\n \n if (!jsonMatch) {\n return null;\n }\n \n const json = JSON.parse(jsonMatch[1] || jsonMatch[0]);\n const aiIssues: Issue[] = [];\n \n // Process validated issues\n if (json.validated && Array.isArray(json.validated)) {\n for (const v of json.validated) {\n if (v.verdict === 'TRUE_POSITIVE') {\n aiIssues.push({\n id: `ai-${Date.now()}-${Math.random().toString(36).substr(2, 5)}`,\n severity: v.severity || 'serious',\n issue: `[AI VALIDATED] ${v.original || v.explanation}`,\n fix: v.fix || 'See AI analysis',\n file: v.file ? resolve(workDir, v.file) : 'unknown',\n line: v.line,\n confidence: (v.inevitability || 80) / 100,\n autoFixable: false,\n agent: 'agent-smith-ai',\n effort: 'medium',\n category: 'ai-validated'\n });\n }\n }\n }\n \n // Process additional AI findings\n if (json.additional && Array.isArray(json.additional)) {\n for (const a of json.additional) {\n aiIssues.push({\n id: `ai-${Date.now()}-${Math.random().toString(36).substr(2, 5)}`,\n severity: a.severity || 'serious',\n issue: `[AI FOUND] ${a.issue || a.explanation}`,\n fix: a.fix || 'See AI analysis',\n file: a.file ? resolve(workDir, a.file) : 'unknown',\n line: a.line,\n confidence: (a.inevitability || 75) / 100,\n autoFixable: false,\n agent: 'agent-smith-ai',\n effort: 'medium',\n category: 'ai-found'\n });\n }\n }\n \n return {\n aiIssues,\n philosophical: json.philosophical || ''\n };\n } catch (error) {\n console.error(` ⚠️ AI enhancement error: ${error}`);\n return null;\n }\n}\n\n/**\n * Build the final Agent Smith report\n */\nasync function buildReport(\n patternIssues: Issue[],\n aiResult: { aiIssues: Issue[]; philosophical: string } | null,\n files: string[],\n executionTime: number,\n aiTime: number,\n workDir: string\n): Promise<string> {\n const lines: string[] = [];\n \n // Combine pattern issues with AI issues\n const allIssues = [\n ...filterFalsePositives(patternIssues),\n ...(aiResult?.aiIssues || [])\n ];\n \n // Categorize\n const critical = allIssues.filter(i => i.severity === 'critical');\n const serious = allIssues.filter(i => i.severity === 'serious');\n const moderate = allIssues.filter(i => i.severity === 'moderate');\n const low = allIssues.filter(i => i.severity === 'low');\n const aiValidated = allIssues.filter(i => i.category === 'ai-validated');\n const aiFound = allIssues.filter(i => i.category === 'ai-found');\n \n // ASCII Banner\n lines.push('');\n lines.push('```');\n lines.push(' █████╗ ██████╗ ███████╗███╗ ██╗████████╗');\n lines.push(' ██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝');\n lines.push(' ███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ');\n lines.push(' ██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ');\n lines.push(' ██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ');\n lines.push(' ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ');\n lines.push(' ');\n lines.push(' ███████╗███╗ ███╗██╗████████╗██╗ ██╗');\n lines.push(' ██╔════╝████╗ ████║██║╚══██╔══╝██║ ██║');\n lines.push(' ███████╗██╔████╔██║██║ ██║ ███████║');\n lines.push(' ╚════██║██║╚██╔╝██║██║ ██║ ██╔══██║');\n lines.push(' ███████║██║ ╚═╝ ██║██║ ██║ ██║ ██║');\n lines.push(' ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝');\n lines.push('```');\n lines.push('');\n lines.push(`*${randomQuote(QUOTES.greeting)}*`);\n lines.push('');\n \n // Summary table\n lines.push('## Scan Summary');\n lines.push('');\n lines.push('| Metric | Value |');\n lines.push('|--------|-------|');\n lines.push(`| Files scanned | ${files.length} |`);\n lines.push(`| Pattern detection | ${(executionTime / 1000).toFixed(2)}s |`);\n if (aiTime > 0) {\n lines.push(`| AI analysis | ${(aiTime / 1000).toFixed(2)}s |`);\n }\n lines.push(`| Total violations | ${allIssues.length} |`);\n lines.push(`| 🔴 Critical | ${critical.length} |`);\n lines.push(`| 🟠 Serious | ${serious.length} |`);\n lines.push(`| 🟡 Moderate | ${moderate.length} |`);\n lines.push(`| 🔵 Low | ${low.length} |`);\n lines.push('');\n \n // AI mode indicator\n if (aiResult) {\n lines.push(`| 🤖 AI validated | ${aiValidated.length} |`);\n lines.push(`| 🧠 AI found | ${aiFound.length} |`);\n } else if (!isAIAvailable()) {\n lines.push(`| ⚠️ AI mode | Disabled (no API key) |`);\n }\n lines.push('');\n \n if (allIssues.length === 0) {\n lines.push(`*${randomQuote(QUOTES.clean)}*`);\n return lines.join('\\n');\n }\n \n // AI Philosophical Commentary\n if (aiResult?.philosophical) {\n lines.push('## 🕴️ Agent Smith Says');\n lines.push('');\n lines.push(`*${aiResult.philosophical}*`);\n lines.push('');\n }\n \n // AI-Found Issues (if any) - Top Priority\n if (aiFound.length > 0) {\n lines.push('## 🧠 AI-Discovered Issues');\n lines.push('');\n lines.push('*Issues found by AI that pattern detection missed:*');\n lines.push('');\n \n for (const issue of aiFound.slice(0, 5)) {\n const relPath = relative(workDir, issue.file);\n lines.push(`### \\`${relPath}${issue.line ? ':' + issue.line : ''}\\``);\n lines.push('');\n lines.push(`**Issue:** ${issue.issue.replace('[AI FOUND] ', '')}`);\n lines.push('');\n lines.push(`**Fix:** ${issue.fix}`);\n lines.push('');\n }\n }\n \n // Critical Issues - Full Detail\n if (critical.length > 0) {\n lines.push('## 🔴 Critical Issues - Fix Immediately');\n lines.push('');\n \n for (const issue of critical.slice(0, 10)) {\n const relPath = relative(workDir, issue.file);\n lines.push(`### \\`${relPath}${issue.line ? ':' + issue.line : ''}\\``);\n lines.push('');\n \n // Clean up issue description\n const desc = issue.issue\n .replace(/^🕴️\\s*/, '')\n .split('\\n')[0]\n .replace(/\\s*—\\s*\\d+\\s*instance.*$/, '');\n lines.push(`**Issue:** ${desc}`);\n lines.push('');\n \n // Show code snippet\n const snippet = await getCodeSnippet(issue.file, issue.line);\n if (snippet) {\n lines.push('```');\n lines.push(snippet);\n lines.push('```');\n lines.push('');\n }\n \n lines.push(`**Fix:** ${issue.fix}`);\n lines.push('');\n }\n \n if (critical.length > 10) {\n lines.push(`*...and ${critical.length - 10} more critical issues*`);\n lines.push('');\n }\n }\n \n // Serious Issues - Condensed\n if (serious.length > 0) {\n lines.push('## 🟠 Serious Issues');\n lines.push('');\n \n for (const issue of serious.slice(0, 10)) {\n const relPath = relative(workDir, issue.file);\n const location = `\\`${basename(relPath)}${issue.line ? ':' + issue.line : ''}\\``;\n const desc = issue.issue\n .replace(/^🕴️\\s*/, '')\n .split('\\n')[0]\n .slice(0, 60);\n lines.push(`- ${location} - ${desc}`);\n }\n \n if (serious.length > 10) {\n lines.push(`- *...and ${serious.length - 10} more*`);\n }\n lines.push('');\n }\n \n // Moderate & Low - Grouped by category\n const otherIssues = [...moderate, ...low];\n if (otherIssues.length > 0) {\n lines.push('## Other Issues by Category');\n lines.push('');\n \n // Group by category\n const byCategory = new Map<string, Issue[]>();\n for (const issue of otherIssues) {\n const cat = issue.category || 'general';\n if (!byCategory.has(cat)) byCategory.set(cat, []);\n byCategory.get(cat)!.push(issue);\n }\n \n // Sort by count\n const sorted = Array.from(byCategory.entries())\n .filter(([cat]) => cat !== 'ai-analysis')\n .sort((a, b) => b[1].length - a[1].length)\n .slice(0, 10);\n \n for (const [category, catIssues] of sorted) {\n const icon = getCategoryIcon(category);\n const sevIcon = getSeverityIcon(catIssues[0]?.severity || 'low');\n lines.push(`### ${icon} ${formatCategoryName(category)} ${sevIcon} (${catIssues.length})`);\n \n const locations = catIssues\n .slice(0, 5)\n .map(i => `\\`${basename(i.file)}${i.line ? ':' + i.line : ''}\\``)\n .join(', ');\n lines.push(locations);\n \n if (catIssues[0]?.fix) {\n lines.push(`**Fix:** ${catIssues[0].fix}`);\n }\n lines.push('');\n }\n }\n \n // Cross-file patterns\n const crossFile = allIssues.filter(i => i.category === 'cross-file');\n if (crossFile.length > 0) {\n lines.push('## 🌐 Codebase-Wide Patterns');\n lines.push('');\n lines.push('*Issues appearing across many files - systemic problems:*');\n lines.push('');\n \n for (const issue of crossFile) {\n lines.push(`- ${issue.issue.replace(/^🕴️\\s*/, '').split('\\n')[0]}`);\n }\n lines.push('');\n }\n \n // Closing quote\n lines.push('---');\n lines.push('');\n if (allIssues.length > 50) {\n lines.push(`*${randomQuote(QUOTES.manyIssues)}*`);\n } else {\n lines.push(`*${randomQuote(QUOTES.fewIssues)}*`);\n }\n \n return lines.join('\\n');\n}\n\n/**\n * Run Agent Smith - Hybrid Pattern Detection + AI Analysis\n */\nexport async function runAgentSmith(args: AgentSmithArgs): Promise<{ content: Array<{ type: string; text: string }> }> {\n const startTime = Date.now();\n \n // Get the working directory - uses smart detection if not explicitly provided\n const workDir = getWorkingDirectory(args.directory);\n \n // Discover files\n let filesToScan = args.files || [];\n if (!filesToScan.length) {\n console.error(`\\n🔍 Agent Smith: Discovering files in: ${workDir}`);\n filesToScan = await discoverFiles(workDir);\n console.error(` Found ${filesToScan.length} files\\n`);\n } else {\n filesToScan = filesToScan.map((f: string) => \n isAbsolute(f) ? f : resolve(workDir, f)\n );\n }\n \n // Validate files exist\n const validFiles = filesToScan.filter((f: string) => existsSync(f));\n if (validFiles.length === 0) {\n return {\n content: [{\n type: 'text',\n text: '❌ No valid files found to scan.'\n }]\n };\n }\n \n // Phase 1: Pattern Detection\n console.error('🕴️ Phase 1: Pattern Detection');\n console.error(' Deploying 38 sub-agent hunters...');\n const smith = new AgentSmithAgent();\n \n const result = await smith.scan(validFiles, {\n workingDir: workDir\n });\n \n const patternTime = Date.now() - startTime;\n \n // Filter out placeholder issues\n const patternIssues = result.issues.filter(i => i.category !== 'ai-analysis');\n console.error(` Found ${patternIssues.length} violations in ${(patternTime / 1000).toFixed(2)}s\\n`);\n \n // Phase 2: AI Enhancement (if available)\n let aiResult: { aiIssues: Issue[]; philosophical: string } | null = null;\n let aiTime = 0;\n \n if (isAIAvailable()) {\n console.error('🕴️ Phase 2: AI Deep Analysis');\n console.error(` ${getAIStatusMessage()}`);\n const aiStartTime = Date.now();\n \n aiResult = await runAIEnhancement(patternIssues, validFiles, workDir);\n aiTime = Date.now() - aiStartTime;\n \n if (aiResult) {\n console.error(` AI validated ${aiResult.aiIssues.filter(i => i.category === 'ai-validated').length} issues`);\n console.error(` AI discovered ${aiResult.aiIssues.filter(i => i.category === 'ai-found').length} new issues`);\n console.error(` AI analysis took ${(aiTime / 1000).toFixed(2)}s\\n`);\n } else {\n console.error(' AI enhancement returned no results\\n');\n }\n } else {\n console.error(`\\n${getAIStatusMessage()}`);\n console.error(' Set ANTHROPIC_API_KEY for AI-powered analysis\\n');\n }\n \n // Build report\n const report = await buildReport(patternIssues, aiResult, validFiles, patternTime, aiTime, workDir);\n \n return {\n content: [{\n type: 'text',\n text: report\n }]\n };\n}\n"],"mappings":";;;;;;;;;;;;AAqBA,SAAS,SAAS,gBAAgB;AAClC,SAAS,MAAM,SAAS,YAAY,SAAS,UAAU,gBAAgB;AACvE,SAAS,kBAAkB;AAO3B,IAAM,uBAAuB,oBAAI,IAAI;AAAA,EACnC;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAQ;AAAA,EACtC;AAAA,EAAQ;AAAA,EAAW;AAAA,EACnB;AAAA,EAAO;AAAA,EAAO;AAChB,CAAC;AAGD,IAAM,YAAY,oBAAI,IAAI;AAAA,EACxB;AAAA,EAAgB;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAS;AAAA,EAClD;AAAA,EAAY;AAAA,EAAe;AAAA,EAAe;AAAA,EAC1C;AAAA,EAAU;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAU;AAAA,EAAU;AACjD,CAAC;AAUD,IAAM,SAAS;AAAA,EACb,UAAU;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL;AAAA,EACF;AACF;AAEA,SAAS,YAAY,KAAuB;AAC1C,SAAO,IAAI,KAAK,MAAM,KAAK,OAAO,IAAI,IAAI,MAAM,CAAC,KAAK,IAAI,CAAC;AAC7D;AAKA,eAAe,cAAc,KAAa,WAAmB,KAAwB;AACnF,QAAM,QAAk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,MAAM,oDAAoD;AAAA,EACpE;AAGA,QAAM,SAAS,MAAM,YAAY,eAAe,UAAU,YAAY,aAAa,QAAQ,OAAO;AAElG,SAAO;AAAA,IACL,SAAS,CAAC;AAAA,MACR,MAAM;AAAA,MACN,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -304,7 +304,7 @@ var BaseAgent = class {
304
304
  this.progress?.aiReview("Running pattern detection...");
305
305
  const patternIssues = await this.analyzeFiles(files, context);
306
306
  if (!isAIAvailable()) {
307
- this.progress?.warn(getAIStatusMessage());
307
+ console.error(` ${getAIStatusMessage()}`);
308
308
  return patternIssues;
309
309
  }
310
310
  if (patternIssues.length > 0 || this.shouldAlwaysUseAI()) {
@@ -313,7 +313,7 @@ var BaseAgent = class {
313
313
  const enhancedIssues = await this.runAIEnhancement(patternIssues, files, context);
314
314
  return this.mergeIssues(enhancedIssues, patternIssues);
315
315
  } catch (error) {
316
- this.progress?.warn(`AI enhancement failed: ${error instanceof Error ? error.message : String(error)}`);
316
+ console.error(` \u26A0\uFE0F AI enhancement failed: ${error instanceof Error ? error.message : String(error)}`);
317
317
  return patternIssues;
318
318
  }
319
319
  }
@@ -559,7 +559,7 @@ Analyze each issue. Validate, expand, and provide fixes. Output JSON only.`;
559
559
  // src/agents/agent-smith.ts
560
560
  import { readFile, writeFile, mkdir, rm } from "fs/promises";
561
561
  import { existsSync } from "fs";
562
- import { join, dirname, basename as basename2 } from "path";
562
+ import { join, dirname, basename } from "path";
563
563
  import { createHash } from "crypto";
564
564
  var MEMORY_LIMITS = {
565
565
  MAX_LOCATIONS_PER_ISSUE: 5,
@@ -739,6 +739,32 @@ var SUB_AGENT_PATTERNS = {
739
739
  description: "Fallback return hiding real errors (return null/[]/{})",
740
740
  fix: "Handle the error case properly. Show user feedback or throw to parent"
741
741
  },
742
+ // === DEAD CODE (AI leaves cruft everywhere) ===
743
+ "commented-code-hunter": {
744
+ pattern: /(?:\/\/\s*.{20,}(?:\n\s*\/\/.{10,}){2,})|(?:\/\*[\s\S]{50,}?\*\/)/g,
745
+ description: "Large block of commented-out code",
746
+ fix: "Delete commented code - git has history. Dead code confuses AI and humans"
747
+ },
748
+ "unreachable-code-hunter": {
749
+ pattern: /(?:return|throw|break|continue)\s+[^;]*;\s*\n\s*(?!(?:\}|case|default|\/\/|\/\*|else|\)|$))(?:const|let|var|function|if|for|while|switch|try|class|async|await|export|import)/gm,
750
+ description: "Unreachable code after return/throw/break",
751
+ fix: "Remove dead code after control flow statements"
752
+ },
753
+ "unused-import-hunter": {
754
+ pattern: /^import\s+(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)\s+from\s+['"][^'"]+['"];?\s*$/gm,
755
+ description: "Import statement (verify it is used)",
756
+ fix: "Remove unused imports - they bloat bundles and confuse readers"
757
+ },
758
+ "empty-function-hunter": {
759
+ pattern: /(?:function\s+\w+|(?:const|let|var)\s+\w+\s*=\s*(?:async\s*)?\(?[^)]*\)?\s*=>)\s*\{\s*(?:\/\/[^\n]*\n\s*)?\}/g,
760
+ description: "Empty function body (stub never implemented)",
761
+ fix: "Implement the function or remove it. Empty stubs create false confidence"
762
+ },
763
+ "dead-branch-hunter": {
764
+ pattern: /if\s*\(\s*(?:true|false|0|1|''|""|null|undefined)\s*\)|if\s*\(\s*!\s*(?:true|false)\s*\)/g,
765
+ description: "Dead conditional branch (always true/false)",
766
+ fix: "Remove dead conditionals - either remove the if or the dead branch"
767
+ },
742
768
  // === AI SLOP AESTHETIC ===
743
769
  "purple-gradient-hunter": {
744
770
  pattern: /(?:from-purple|to-purple|from-violet|to-violet|from-indigo|to-indigo|purple-\d{3}|violet-\d{3}|#(?:8b5cf6|a855f7|7c3aed|6366f1|818cf8)|rgb\((?:139|168|124|99|129),\s*(?:92|85|58|102|140),\s*(?:246|247|237|241|248)\))/gi,
@@ -1132,11 +1158,11 @@ Found in ${result.occurrences.length} files, ${result.totalCount} total instance
1132
1158
  await this.updateMemory(hash, result.pattern, result.type, file, instances.length);
1133
1159
  const severity = this.determineSeverity(instances.length, inevitabilityScore);
1134
1160
  const smithNote = this.getPhilosophicalNote(result.type, instances.length);
1135
- const locationsStr = instances.map((i) => `${basename2(i.file)}:${i.line}`).slice(0, 5).join(", ");
1161
+ const locationsStr = instances.map((i) => `${basename(i.file)}:${i.line}`).slice(0, 5).join(", ");
1136
1162
  issues.push(this.createSmithIssue(
1137
1163
  this.generateSmithIssueId(),
1138
1164
  severity,
1139
- `\u{1F574}\uFE0F ${config.description} \u2014 ${instances.length} instance${instances.length > 1 ? "s" : ""} in ${basename2(file)}
1165
+ `\u{1F574}\uFE0F ${config.description} \u2014 ${instances.length} instance${instances.length > 1 ? "s" : ""} in ${basename(file)}
1140
1166
 
1141
1167
  ${smithNote}
1142
1168
 
@@ -1715,4 +1741,4 @@ export {
1715
1741
  SUB_AGENT_PATTERNS,
1716
1742
  AgentSmithAgent
1717
1743
  };
1718
- //# sourceMappingURL=chunk-EEVALBHC.js.map
1744
+ //# sourceMappingURL=chunk-3MYJUGCZ.js.map