@triedotdev/mcp 1.0.92 → 1.0.94

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.
Files changed (74) hide show
  1. package/dist/{agent-smith-QYDXPFPJ.js → agent-smith-MYQ35URL.js} +5 -5
  2. package/dist/{agent-smith-runner-GXGDJTSR.js → agent-smith-runner-4TBONXCP.js} +5 -5
  3. package/dist/cache-manager-RMPRPD5T.js +10 -0
  4. package/dist/{chunk-ZOKQJZKN.js → chunk-AZRCKBGF.js} +8 -8
  5. package/dist/{chunk-NMGINYYX.js → chunk-CKM6A3G6.js} +4 -4
  6. package/dist/{chunk-5DQLHWTT.js → chunk-E2ZATINO.js} +73 -26
  7. package/dist/chunk-E2ZATINO.js.map +1 -0
  8. package/dist/{chunk-LT7MKIXU.js → chunk-FFWNZUG2.js} +2 -2
  9. package/dist/{chunk-76Q5DMYV.js → chunk-FK6DQKDY.js} +22 -6
  10. package/dist/chunk-FK6DQKDY.js.map +1 -0
  11. package/dist/{chunk-PSVRO76R.js → chunk-HLSBTOVE.js} +8 -8
  12. package/dist/{chunk-MURGTWG4.js → chunk-IFGF33R5.js} +2 -2
  13. package/dist/{chunk-3HDWOSLX.js → chunk-IIF5XDCJ.js} +128 -48
  14. package/dist/chunk-IIF5XDCJ.js.map +1 -0
  15. package/dist/chunk-JAAIHNOE.js +298 -0
  16. package/dist/chunk-JAAIHNOE.js.map +1 -0
  17. package/dist/{chunk-FK3DUQ5T.js → chunk-JO6RVXS6.js} +57 -6
  18. package/dist/chunk-JO6RVXS6.js.map +1 -0
  19. package/dist/{chunk-74NPKTZV.js → chunk-ODWDESYP.js} +2 -2
  20. package/dist/{chunk-LP4MVJDW.js → chunk-OEYIOOYB.js} +2 -2
  21. package/dist/{chunk-SJFJ6GLR.js → chunk-OWBWNXSC.js} +2 -2
  22. package/dist/{chunk-R6YM6YSV.js → chunk-Q764X2WD.js} +7 -7
  23. package/dist/{chunk-HFQ5ORON.js → chunk-RE6ZWXJC.js} +3 -3
  24. package/dist/{chunk-KWDNYWOR.js → chunk-RNJ6JKMA.js} +4 -4
  25. package/dist/{chunk-T5UOH56R.js → chunk-RYRVEO2B.js} +3 -3
  26. package/dist/{chunk-IYMJTY27.js → chunk-STEFLYPR.js} +62 -7
  27. package/dist/{chunk-IYMJTY27.js.map → chunk-STEFLYPR.js.map} +1 -1
  28. package/dist/{chunk-RDOJCRKJ.js → chunk-WT3XQCG2.js} +2 -2
  29. package/dist/{chunk-P6XMIUD7.js → chunk-Y62VM3ER.js} +6 -6
  30. package/dist/cli/create-agent.js +3 -3
  31. package/dist/cli/main.js +16 -16
  32. package/dist/cli/yolo-daemon.js +18 -18
  33. package/dist/{git-5WJHCMNO.js → git-45LZUUYA.js} +5 -5
  34. package/dist/{goal-manager-ESJCJXFS.js → goal-manager-HOZ7R2QV.js} +6 -6
  35. package/dist/guardian-agent-RB2UQP5V.js +21 -0
  36. package/dist/index.js +25 -25
  37. package/dist/{issue-store-JZ2LCQEG.js → issue-store-DXIOP6AK.js} +4 -4
  38. package/dist/{progress-PH6NNWZM.js → progress-LHI66U7B.js} +2 -2
  39. package/dist/{vibe-code-signatures-MHFK5KXF.js → vibe-code-signatures-C5A4BHXD.js} +3 -3
  40. package/dist/{vulnerability-signatures-DRIYDFG3.js → vulnerability-signatures-SVIHJQO5.js} +3 -3
  41. package/dist/workers/agent-worker.js +9 -9
  42. package/package.json +1 -1
  43. package/dist/cache-manager-7SKX3IGO.js +0 -10
  44. package/dist/chunk-3HDWOSLX.js.map +0 -1
  45. package/dist/chunk-5DQLHWTT.js.map +0 -1
  46. package/dist/chunk-76Q5DMYV.js.map +0 -1
  47. package/dist/chunk-D25EIBPO.js +0 -183
  48. package/dist/chunk-D25EIBPO.js.map +0 -1
  49. package/dist/chunk-FK3DUQ5T.js.map +0 -1
  50. package/dist/guardian-agent-IXG3YWFP.js +0 -21
  51. /package/dist/{agent-smith-QYDXPFPJ.js.map → agent-smith-MYQ35URL.js.map} +0 -0
  52. /package/dist/{agent-smith-runner-GXGDJTSR.js.map → agent-smith-runner-4TBONXCP.js.map} +0 -0
  53. /package/dist/{cache-manager-7SKX3IGO.js.map → cache-manager-RMPRPD5T.js.map} +0 -0
  54. /package/dist/{chunk-ZOKQJZKN.js.map → chunk-AZRCKBGF.js.map} +0 -0
  55. /package/dist/{chunk-NMGINYYX.js.map → chunk-CKM6A3G6.js.map} +0 -0
  56. /package/dist/{chunk-LT7MKIXU.js.map → chunk-FFWNZUG2.js.map} +0 -0
  57. /package/dist/{chunk-PSVRO76R.js.map → chunk-HLSBTOVE.js.map} +0 -0
  58. /package/dist/{chunk-MURGTWG4.js.map → chunk-IFGF33R5.js.map} +0 -0
  59. /package/dist/{chunk-74NPKTZV.js.map → chunk-ODWDESYP.js.map} +0 -0
  60. /package/dist/{chunk-LP4MVJDW.js.map → chunk-OEYIOOYB.js.map} +0 -0
  61. /package/dist/{chunk-SJFJ6GLR.js.map → chunk-OWBWNXSC.js.map} +0 -0
  62. /package/dist/{chunk-R6YM6YSV.js.map → chunk-Q764X2WD.js.map} +0 -0
  63. /package/dist/{chunk-HFQ5ORON.js.map → chunk-RE6ZWXJC.js.map} +0 -0
  64. /package/dist/{chunk-KWDNYWOR.js.map → chunk-RNJ6JKMA.js.map} +0 -0
  65. /package/dist/{chunk-T5UOH56R.js.map → chunk-RYRVEO2B.js.map} +0 -0
  66. /package/dist/{chunk-RDOJCRKJ.js.map → chunk-WT3XQCG2.js.map} +0 -0
  67. /package/dist/{chunk-P6XMIUD7.js.map → chunk-Y62VM3ER.js.map} +0 -0
  68. /package/dist/{git-5WJHCMNO.js.map → git-45LZUUYA.js.map} +0 -0
  69. /package/dist/{goal-manager-ESJCJXFS.js.map → goal-manager-HOZ7R2QV.js.map} +0 -0
  70. /package/dist/{guardian-agent-IXG3YWFP.js.map → guardian-agent-RB2UQP5V.js.map} +0 -0
  71. /package/dist/{issue-store-JZ2LCQEG.js.map → issue-store-DXIOP6AK.js.map} +0 -0
  72. /package/dist/{progress-PH6NNWZM.js.map → progress-LHI66U7B.js.map} +0 -0
  73. /package/dist/{vibe-code-signatures-MHFK5KXF.js.map → vibe-code-signatures-C5A4BHXD.js.map} +0 -0
  74. /package/dist/{vulnerability-signatures-DRIYDFG3.js.map → vulnerability-signatures-SVIHJQO5.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  GlobalPatternsIndexSchema,
4
4
  atomicWriteJSON,
5
5
  safeParseAndValidate
6
- } from "./chunk-LP4MVJDW.js";
6
+ } from "./chunk-OEYIOOYB.js";
7
7
 
8
8
  // src/memory/global-memory.ts
9
9
  import { mkdir, writeFile, readFile, readdir } from "fs/promises";
@@ -263,4 +263,4 @@ export {
263
263
  updateGlobalMemoryMd,
264
264
  searchGlobalPatterns
265
265
  };
266
- //# sourceMappingURL=chunk-LT7MKIXU.js.map
266
+ //# sourceMappingURL=chunk-FFWNZUG2.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runExecFile
3
- } from "./chunk-MURGTWG4.js";
3
+ } from "./chunk-IFGF33R5.js";
4
4
 
5
5
  // src/agent/git.ts
6
6
  import { existsSync } from "fs";
@@ -118,16 +118,32 @@ async function getChangedFilesSinceTimestamp(projectPath, timestamp) {
118
118
  if (!isRepo) return null;
119
119
  try {
120
120
  const sinceDate = new Date(timestamp).toISOString();
121
- const committedChanges = await execGit(
121
+ const GIT_TIMEOUT_MS = 5e3;
122
+ const startTime = Date.now();
123
+ const committedChangesPromise = execGit(
122
124
  ["log", `--since=${sinceDate}`, "--name-only", "--pretty=format:"],
123
125
  projectPath
124
126
  );
125
- const stagedChanges = await execGit(["diff", "--cached", "--name-only"], projectPath);
126
- const unstagedChanges = await execGit(["diff", "--name-only"], projectPath);
127
- const untrackedFiles = await execGit(
127
+ const committedChangesTimeout = new Promise((resolve) => {
128
+ setTimeout(() => resolve(null), GIT_TIMEOUT_MS);
129
+ });
130
+ const committedChanges = await Promise.race([committedChangesPromise, committedChangesTimeout]);
131
+ if (Date.now() - startTime > GIT_TIMEOUT_MS) {
132
+ return null;
133
+ }
134
+ const stagedPromise = execGit(["diff", "--cached", "--name-only"], projectPath);
135
+ const unstagedPromise = execGit(["diff", "--name-only"], projectPath);
136
+ const untrackedPromise = execGit(
128
137
  ["ls-files", "--others", "--exclude-standard"],
129
138
  projectPath
130
139
  );
140
+ const timeoutPromise = new Promise((resolve) => {
141
+ setTimeout(() => resolve(null), Math.max(0, GIT_TIMEOUT_MS - (Date.now() - startTime)));
142
+ });
143
+ const [stagedChanges, unstagedChanges, untrackedFiles] = await Promise.race([
144
+ Promise.all([stagedPromise, unstagedPromise, untrackedPromise]),
145
+ timeoutPromise.then(() => [null, null, null])
146
+ ]);
131
147
  const changedFiles = /* @__PURE__ */ new Set();
132
148
  const addFiles = (output) => {
133
149
  if (output) {
@@ -156,4 +172,4 @@ export {
156
172
  isGitRepo,
157
173
  getChangedFilesSinceTimestamp
158
174
  };
159
- //# sourceMappingURL=chunk-76Q5DMYV.js.map
175
+ //# sourceMappingURL=chunk-FK6DQKDY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agent/git.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport path from 'node:path';\nimport { runExecFile } from '../utils/command-runner.js';\n\nexport interface Commit {\n hash: string;\n author: string;\n date: string;\n message: string;\n}\n\nexport interface Change {\n path: string;\n status: string;\n oldPath?: string;\n}\n\nasync function execGit(args: string[], cwd: string): Promise<string | null> {\n try {\n const { stdout } = await runExecFile(\n 'git',\n ['-C', cwd, ...args],\n { actor: 'internal:git', triggeredBy: 'manual', targetPath: cwd },\n { maxBuffer: 10 * 1024 * 1024, captureOutput: false }\n );\n return stdout.trim();\n } catch (error: any) {\n const stderr: string | undefined = error?.stderr?.toString();\n // Gracefully handle non-git directories and repos with no commits\n if (stderr?.includes('not a git repository') || stderr?.includes('does not have any commits')) {\n return null;\n }\n throw error;\n }\n}\n\nasync function ensureRepo(projectPath: string): Promise<boolean> {\n const result = await execGit(['rev-parse', '--is-inside-work-tree'], projectPath);\n return result === 'true';\n}\n\nfunction parseNameStatus(output: string): Change[] {\n return output\n .split('\\n')\n .map((line) => line.trim())\n .filter(Boolean)\n .map((line) => {\n const parts = line.split('\\t');\n const status = parts[0] ?? '';\n const filePath = parts[1] ?? '';\n const oldPath = parts[2];\n const change: Change = { status, path: filePath };\n if (oldPath) change.oldPath = oldPath;\n return change;\n })\n .filter((entry) => entry.path.length > 0);\n}\n\nexport async function getRecentCommits(projectPath: string, limit: number): Promise<Commit[]> {\n const isRepo = await ensureRepo(projectPath);\n if (!isRepo) return [];\n\n const output = await execGit(\n ['log', `-n`, String(limit), '--pretty=format:%H%x09%an%x09%ad%x09%s', '--date=iso'],\n projectPath\n );\n\n if (!output) return [];\n\n return output.split('\\n').map((line) => {\n const [hash, author, date, message] = line.split('\\t');\n return { hash, author, date, message } as Commit;\n });\n}\n\nexport async function getLastCommit(projectPath: string): Promise<Commit | null> {\n const commits = await getRecentCommits(projectPath, 1);\n return commits[0] ?? null;\n}\n\nexport async function getStagedChanges(projectPath: string): Promise<Change[]> {\n const isRepo = await ensureRepo(projectPath);\n if (!isRepo) return [];\n\n const output = await execGit(['diff', '--cached', '--name-status'], projectPath);\n if (!output) return [];\n return parseNameStatus(output);\n}\n\nexport async function getUncommittedChanges(projectPath: string): Promise<Change[]> {\n const isRepo = await ensureRepo(projectPath);\n if (!isRepo) return [];\n\n const changes: Change[] = [];\n\n const unstaged = await execGit(['diff', '--name-status'], projectPath);\n if (unstaged) {\n changes.push(...parseNameStatus(unstaged));\n }\n\n const untracked = await execGit(['ls-files', '--others', '--exclude-standard'], projectPath);\n if (untracked) {\n changes.push(\n ...untracked\n .split('\\n')\n .map((p) => p.trim())\n .filter(Boolean)\n .map((p) => ({ status: '??', path: p }))\n );\n }\n\n return changes;\n}\n\nexport async function getDiff(projectPath: string, commitHash: string): Promise<string> {\n const isRepo = await ensureRepo(projectPath);\n if (!isRepo) return '';\n\n const diff = await execGit(['show', commitHash, '--unified=3', '--no-color'], projectPath);\n return diff ?? '';\n}\n\nexport async function getWorkingTreeDiff(projectPath: string, stagedOnly = false): Promise<string> {\n const isRepo = await ensureRepo(projectPath);\n if (!isRepo) return '';\n\n const args = stagedOnly ? ['diff', '--cached', '--unified=3', '--no-color'] : ['diff', '--unified=3', '--no-color'];\n const diff = await execGit(args, projectPath);\n return diff ?? '';\n}\n\nexport async function getUnpushedCommits(projectPath: string): Promise<Commit[]> {\n const isRepo = await ensureRepo(projectPath);\n if (!isRepo) return [];\n\n // Handles detached HEAD by falling back to HEAD if upstream missing\n const upstream = await execGit(['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{u}'], projectPath);\n if (!upstream) {\n return getRecentCommits(projectPath, 10);\n }\n\n const output = await execGit(['log', `${upstream}..HEAD`, '--pretty=format:%H%x09%an%x09%ad%x09%s', '--date=iso'], projectPath);\n if (!output) return [];\n\n return output.split('\\n').filter(Boolean).map((line) => {\n const [hash, author, date, message] = line.split('\\t');\n return { hash, author, date, message } as Commit;\n });\n}\n\nexport function resolveRepoPath(projectPath: string): string {\n const gitDir = path.join(projectPath, '.git');\n if (existsSync(gitDir)) return projectPath;\n return projectPath;\n}\n\n/**\n * Check if the given path is inside a git repository\n */\nexport async function isGitRepo(projectPath: string): Promise<boolean> {\n const result = await execGit(['rev-parse', '--is-inside-work-tree'], projectPath);\n return result === 'true';\n}\n\n/**\n * Get files changed since a given timestamp\n * Uses git log to find commits after timestamp, then gets affected files\n * Returns null if not a git repo or on error\n */\nexport async function getChangedFilesSinceTimestamp(\n projectPath: string,\n timestamp: number\n): Promise<string[] | null> {\n const isRepo = await isGitRepo(projectPath);\n if (!isRepo) return null;\n\n try {\n // Convert timestamp to ISO date for git\n const sinceDate = new Date(timestamp).toISOString();\n \n // Set timeout for git operations (5 seconds total)\n const GIT_TIMEOUT_MS = 5000;\n const startTime = Date.now();\n \n // Get all files that changed in commits since the timestamp\n // Use Promise.race to timeout if git operations take too long\n const committedChangesPromise = execGit(\n ['log', `--since=${sinceDate}`, '--name-only', '--pretty=format:'],\n projectPath\n );\n const committedChangesTimeout = new Promise<string | null>((resolve) => {\n setTimeout(() => resolve(null), GIT_TIMEOUT_MS);\n });\n const committedChanges = await Promise.race([committedChangesPromise, committedChangesTimeout]);\n\n // Check if we've exceeded timeout\n if (Date.now() - startTime > GIT_TIMEOUT_MS) {\n return null;\n }\n\n // Get currently modified files (staged + unstaged) - run in parallel with timeout\n const stagedPromise = execGit(['diff', '--cached', '--name-only'], projectPath);\n const unstagedPromise = execGit(['diff', '--name-only'], projectPath);\n const untrackedPromise = execGit(\n ['ls-files', '--others', '--exclude-standard'],\n projectPath\n );\n \n const timeoutPromise = new Promise<null>((resolve) => {\n setTimeout(() => resolve(null), Math.max(0, GIT_TIMEOUT_MS - (Date.now() - startTime)));\n });\n \n const [stagedChanges, unstagedChanges, untrackedFiles] = await Promise.race([\n Promise.all([stagedPromise, unstagedPromise, untrackedPromise]),\n timeoutPromise.then(() => [null, null, null] as const)\n ]);\n\n // Combine all changed files\n const changedFiles = new Set<string>();\n \n const addFiles = (output: string | null) => {\n if (output) {\n output.split('\\n')\n .map(f => f.trim())\n .filter(Boolean)\n .forEach(f => changedFiles.add(path.join(projectPath, f)));\n }\n };\n\n addFiles(committedChanges);\n addFiles(stagedChanges);\n addFiles(unstagedChanges);\n addFiles(untrackedFiles);\n\n return Array.from(changedFiles);\n } catch {\n return null;\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,kBAAkB;AAC3B,OAAO,UAAU;AAgBjB,eAAe,QAAQ,MAAgB,KAAqC;AAC1E,MAAI;AACF,UAAM,EAAE,OAAO,IAAI,MAAM;AAAA,MACvB;AAAA,MACA,CAAC,MAAM,KAAK,GAAG,IAAI;AAAA,MACnB,EAAE,OAAO,gBAAgB,aAAa,UAAU,YAAY,IAAI;AAAA,MAChE,EAAE,WAAW,KAAK,OAAO,MAAM,eAAe,MAAM;AAAA,IACtD;AACA,WAAO,OAAO,KAAK;AAAA,E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","names":[]}
@@ -1,29 +1,29 @@
1
1
  import {
2
2
  getGoalManager,
3
3
  getInsightStore
4
- } from "./chunk-NMGINYYX.js";
4
+ } from "./chunk-CKM6A3G6.js";
5
5
  import {
6
6
  ContextGraph,
7
7
  GotchaPredictor
8
- } from "./chunk-P6XMIUD7.js";
8
+ } from "./chunk-Y62VM3ER.js";
9
9
  import {
10
10
  getGuardianState
11
- } from "./chunk-T5UOH56R.js";
11
+ } from "./chunk-RYRVEO2B.js";
12
12
  import {
13
13
  findCrossProjectPatterns,
14
14
  recordToGlobalMemory
15
- } from "./chunk-LT7MKIXU.js";
15
+ } from "./chunk-FFWNZUG2.js";
16
16
  import {
17
17
  autoResolveIssues,
18
18
  getHistoricalInsights,
19
19
  getIssueHash,
20
20
  searchIssues,
21
21
  storeIssues
22
- } from "./chunk-LP4MVJDW.js";
22
+ } from "./chunk-OEYIOOYB.js";
23
23
  import {
24
24
  isAIAvailable,
25
25
  runAIAnalysis
26
- } from "./chunk-74NPKTZV.js";
26
+ } from "./chunk-ODWDESYP.js";
27
27
 
28
28
  // src/guardian/guardian-agent.ts
29
29
  import { basename as basename2 } from "path";
@@ -2362,7 +2362,7 @@ var GuardianAgent = class {
2362
2362
  await this.guardianState.recordScan();
2363
2363
  try {
2364
2364
  const riskLevel = issues.filter((i) => i.severity === "critical").length > 0 ? "critical" : issues.filter((i) => i.severity === "serious").length >= 3 ? "high" : issues.length > 10 ? "medium" : "low";
2365
- const { calculateAdaptiveScanFrequency } = await import("./goal-manager-ESJCJXFS.js");
2365
+ const { calculateAdaptiveScanFrequency } = await import("./goal-manager-HOZ7R2QV.js");
2366
2366
  const result = await calculateAdaptiveScanFrequency(riskLevel);
2367
2367
  await this.guardianState.setScanFrequency(result.frequencyMs);
2368
2368
  } catch {
@@ -2596,4 +2596,4 @@ export {
2596
2596
  GuardianAgent,
2597
2597
  getGuardian
2598
2598
  };
2599
- //# sourceMappingURL=chunk-PSVRO76R.js.map
2599
+ //# sourceMappingURL=chunk-HLSBTOVE.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getTrieDirectory,
3
3
  getWorkingDirectory
4
- } from "./chunk-RDOJCRKJ.js";
4
+ } from "./chunk-WT3XQCG2.js";
5
5
 
6
6
  // src/utils/command-runner.ts
7
7
  import { exec, execFile, execSync } from "child_process";
@@ -276,4 +276,4 @@ export {
276
276
  runShellCommandSync,
277
277
  runExecFile
278
278
  };
279
- //# sourceMappingURL=chunk-MURGTWG4.js.map
279
+ //# sourceMappingURL=chunk-IFGF33R5.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SlackIntegration,
3
3
  getGuardian
4
- } from "./chunk-PSVRO76R.js";
4
+ } from "./chunk-HLSBTOVE.js";
5
5
  import {
6
6
  Executor,
7
7
  Triager,
@@ -13,19 +13,19 @@ import {
13
13
  isTrieInitialized,
14
14
  loadConfig,
15
15
  loadSavedPatterns
16
- } from "./chunk-R6YM6YSV.js";
16
+ } from "./chunk-Q764X2WD.js";
17
17
  import {
18
18
  getChangedFilesSinceTimestamp,
19
19
  isGitRepo
20
- } from "./chunk-76Q5DMYV.js";
20
+ } from "./chunk-FK6DQKDY.js";
21
21
  import {
22
22
  getVulnerabilityStats,
23
23
  getVulnerabilityTrie,
24
24
  scanForVulnerabilities
25
- } from "./chunk-FK3DUQ5T.js";
25
+ } from "./chunk-JO6RVXS6.js";
26
26
  import {
27
27
  getGuardianState
28
- } from "./chunk-T5UOH56R.js";
28
+ } from "./chunk-RYRVEO2B.js";
29
29
  import {
30
30
  createSkillFromFile,
31
31
  getSkillRegistry,
@@ -35,37 +35,37 @@ import {
35
35
  loadContextState,
36
36
  removeGlobalSkill,
37
37
  updateContextAfterScan
38
- } from "./chunk-5DQLHWTT.js";
38
+ } from "./chunk-E2ZATINO.js";
39
39
  import {
40
40
  runShellCommand
41
- } from "./chunk-MURGTWG4.js";
41
+ } from "./chunk-IFGF33R5.js";
42
42
  import {
43
43
  findCrossProjectPatterns
44
- } from "./chunk-LT7MKIXU.js";
44
+ } from "./chunk-FFWNZUG2.js";
45
45
  import {
46
46
  atomicWriteJSON,
47
47
  getMemoryStats,
48
48
  getRecentIssues,
49
49
  searchIssues
50
- } from "./chunk-LP4MVJDW.js";
50
+ } from "./chunk-OEYIOOYB.js";
51
51
  import {
52
52
  Trie
53
53
  } from "./chunk-6NLHFIYA.js";
54
54
  import {
55
55
  getOutputManager
56
- } from "./chunk-KWDNYWOR.js";
56
+ } from "./chunk-RNJ6JKMA.js";
57
57
  import {
58
58
  isAIAvailable
59
- } from "./chunk-74NPKTZV.js";
59
+ } from "./chunk-ODWDESYP.js";
60
60
  import {
61
61
  getTrieDirectory,
62
62
  getWorkingDirectory
63
- } from "./chunk-RDOJCRKJ.js";
63
+ } from "./chunk-WT3XQCG2.js";
64
64
  import {
65
65
  ProgressReporter,
66
66
  isInteractiveMode,
67
67
  setInteractiveMode
68
- } from "./chunk-D25EIBPO.js";
68
+ } from "./chunk-JAAIHNOE.js";
69
69
 
70
70
  // src/utils/streaming.ts
71
71
  var shouldSuppressConsole = () => isInteractiveMode();
@@ -284,18 +284,44 @@ function formatConsoleUpdate(update) {
284
284
  }
285
285
  switch (update.type) {
286
286
  case "agent_start":
287
- return `>> Starting ${update.data.agent}...`;
287
+ return null;
288
288
  case "agent_complete":
289
289
  const label = update.data.issueCount > 0 ? "[WARN]" : "[OK]";
290
- return `${label} ${update.data.agent} found ${update.data.issueCount} issues`;
290
+ const severityBreakdown = [];
291
+ if (update.data.issues && Array.isArray(update.data.issues)) {
292
+ const bySeverity = { critical: 0, serious: 0, moderate: 0, low: 0 };
293
+ for (const issue of update.data.issues) {
294
+ if (issue.severity && bySeverity.hasOwnProperty(issue.severity)) {
295
+ bySeverity[issue.severity]++;
296
+ }
297
+ }
298
+ if (bySeverity.critical > 0) severityBreakdown.push(`${bySeverity.critical} critical`);
299
+ if (bySeverity.serious > 0) severityBreakdown.push(`${bySeverity.serious} serious`);
300
+ if (bySeverity.moderate > 0) severityBreakdown.push(`${bySeverity.moderate} moderate`);
301
+ if (bySeverity.low > 0) severityBreakdown.push(`${bySeverity.low} low`);
302
+ }
303
+ const breakdown = severityBreakdown.length > 0 ? ` (${severityBreakdown.join(", ")})` : "";
304
+ return `${label} ${update.data.agent}: ${update.data.issueCount} issues${breakdown}`;
291
305
  case "progress":
292
306
  const { processedFiles, totalFiles, currentFile, activeAgents } = update.data;
293
307
  const progress = totalFiles > 0 ? Math.round(processedFiles / totalFiles * 100) : 0;
308
+ if (totalFiles > 10 && progress % 10 !== 0 && processedFiles !== totalFiles) {
309
+ return null;
310
+ }
294
311
  const active = activeAgents.length > 0 ? ` (${activeAgents.join(", ")})` : "";
295
- const current = currentFile ? ` - ${currentFile.split("/").pop()}` : "";
312
+ const current = currentFile && totalFiles <= 10 ? ` - ${currentFile.split("/").pop()}` : "";
296
313
  return `Progress: ${progress}% (${processedFiles}/${totalFiles})${active}${current}`;
297
314
  case "scan_complete":
298
- return `[ALL SYSTEMS GO] Scan finished. Found ${update.data.totalIssues} issues across ${update.data.totalFiles} files`;
315
+ const { totalIssues, totalFiles: filesScanned, issuesBySeverity } = update.data;
316
+ const severitySummary = [];
317
+ if (issuesBySeverity) {
318
+ if (issuesBySeverity.critical > 0) severitySummary.push(`${issuesBySeverity.critical} critical`);
319
+ if (issuesBySeverity.serious > 0) severitySummary.push(`${issuesBySeverity.serious} serious`);
320
+ if (issuesBySeverity.moderate > 0) severitySummary.push(`${issuesBySeverity.moderate} moderate`);
321
+ if (issuesBySeverity.low > 0) severitySummary.push(`${issuesBySeverity.low} low`);
322
+ }
323
+ const summary = severitySummary.length > 0 ? ` [${severitySummary.join(", ")}]` : "";
324
+ return `[COMPLETE] Scan finished: ${totalIssues} issues across ${filesScanned} files${summary}`;
299
325
  case "error":
300
326
  return `[ERROR] ${update.data.message}`;
301
327
  default:
@@ -3397,7 +3423,7 @@ var InteractiveDashboard = class {
3397
3423
  */
3398
3424
  async measureSemanticGoalBaseline(description, workDir) {
3399
3425
  try {
3400
- const { searchIssues: searchIssues2 } = await import("./issue-store-JZ2LCQEG.js");
3426
+ const { searchIssues: searchIssues2 } = await import("./issue-store-DXIOP6AK.js");
3401
3427
  const issues = await searchIssues2("", {
3402
3428
  workDir,
3403
3429
  limit: 1e3,
@@ -8073,9 +8099,9 @@ var IncrementalScanner = class {
8073
8099
  * 1. Fast pre-check (mtime + size) - O(1), avoids file read
8074
8100
  * 2. Hash comparison - O(n), only if pre-check fails
8075
8101
  */
8076
- async scanFile(filePath, forceRescan2 = false) {
8102
+ async scanFile(filePath, forceRescan = false) {
8077
8103
  const cached = this.cache.files[filePath];
8078
- if (!forceRescan2 && cached) {
8104
+ if (!forceRescan && cached) {
8079
8105
  const preCheck = await this.fastPreCheck(filePath);
8080
8106
  if (!preCheck.changed) {
8081
8107
  return {
@@ -8095,7 +8121,7 @@ var IncrementalScanner = class {
8095
8121
  return { vulnerabilities: [], fromCache: false, symbolCount: 0 };
8096
8122
  }
8097
8123
  const hash = this.computeHash(content);
8098
- if (!forceRescan2 && cached && cached.hash === hash) {
8124
+ if (!forceRescan && cached && cached.hash === hash) {
8099
8125
  if (fileStats) {
8100
8126
  cached.mtime = fileStats.mtime;
8101
8127
  cached.size = fileStats.size;
@@ -8135,7 +8161,7 @@ var IncrementalScanner = class {
8135
8161
  * 2. Parallel file scanning with concurrency limit
8136
8162
  * 3. Fast pre-check (mtime + size) per file
8137
8163
  */
8138
- async scanFiles(filePaths, forceRescan2 = false, onFileProgress) {
8164
+ async scanFiles(filePaths, forceRescan = false, onFileProgress) {
8139
8165
  const startTime = Date.now();
8140
8166
  getVulnerabilityTrie();
8141
8167
  let filesScanned = 0;
@@ -8148,15 +8174,23 @@ var IncrementalScanner = class {
8148
8174
  previousVulnerabilities.set(path, state.vulnerabilities);
8149
8175
  }
8150
8176
  let gitChangedFiles = null;
8151
- if (!forceRescan2) {
8152
- gitChangedFiles = await this.getGitChangedFiles();
8153
- if (gitChangedFiles && !isInteractiveMode()) {
8154
- console.error(` Git detected ${gitChangedFiles.size} changed files`);
8177
+ if (!forceRescan) {
8178
+ try {
8179
+ const gitPromise = this.getGitChangedFiles();
8180
+ const timeoutPromise = new Promise((resolve2) => {
8181
+ setTimeout(() => resolve2(null), 5e3);
8182
+ });
8183
+ gitChangedFiles = await Promise.race([gitPromise, timeoutPromise]);
8184
+ if (gitChangedFiles && !isInteractiveMode()) {
8185
+ console.error(` Git detected ${gitChangedFiles.size} changed files`);
8186
+ }
8187
+ } catch (error) {
8188
+ gitChangedFiles = null;
8155
8189
  }
8156
8190
  }
8157
8191
  const scanResults = await this.parallelScan(
8158
8192
  filePaths,
8159
- forceRescan2,
8193
+ forceRescan,
8160
8194
  gitChangedFiles,
8161
8195
  onFileProgress
8162
8196
  );
@@ -8208,31 +8242,71 @@ var IncrementalScanner = class {
8208
8242
  /**
8209
8243
  * Parallel file scanning with concurrency limit
8210
8244
  * Processes SCAN_CONCURRENCY files at a time
8245
+ * Includes timeout protection to prevent hanging
8211
8246
  */
8212
- async parallelScan(filePaths, forceRescan2, gitChangedFiles, onFileProgress) {
8247
+ async parallelScan(filePaths, forceRescan, gitChangedFiles, onFileProgress) {
8213
8248
  const results = [];
8249
+ const FILE_SCAN_TIMEOUT_MS = 3e4;
8214
8250
  for (let i = 0; i < filePaths.length; i += SCAN_CONCURRENCY) {
8215
8251
  const batch = filePaths.slice(i, i + SCAN_CONCURRENCY);
8216
8252
  const batchPromises = batch.map(async (filePath) => {
8217
- if (gitChangedFiles && !gitChangedFiles.has(filePath)) {
8218
- const cached = this.cache.files[filePath];
8219
- if (cached) {
8220
- onFileProgress?.(filePath, true);
8221
- return {
8222
- filePath,
8223
- result: {
8224
- vulnerabilities: cached.vulnerabilities,
8225
- fromCache: true,
8226
- symbolCount: cached.symbolCount
8227
- }
8228
- };
8253
+ try {
8254
+ if (gitChangedFiles && !gitChangedFiles.has(filePath)) {
8255
+ const cached = this.cache.files[filePath];
8256
+ if (cached) {
8257
+ onFileProgress?.(filePath, true);
8258
+ return {
8259
+ filePath,
8260
+ result: {
8261
+ vulnerabilities: cached.vulnerabilities,
8262
+ fromCache: true,
8263
+ symbolCount: cached.symbolCount
8264
+ }
8265
+ };
8266
+ }
8229
8267
  }
8268
+ const scanPromise = this.scanFile(filePath, forceRescan);
8269
+ const timeoutPromise = new Promise((resolve2) => {
8270
+ setTimeout(() => {
8271
+ resolve2({
8272
+ vulnerabilities: [],
8273
+ fromCache: false,
8274
+ symbolCount: 0
8275
+ });
8276
+ }, FILE_SCAN_TIMEOUT_MS);
8277
+ });
8278
+ const result = await Promise.race([scanPromise, timeoutPromise]);
8279
+ onFileProgress?.(filePath, result.fromCache);
8280
+ return { filePath, result };
8281
+ } catch (error) {
8282
+ onFileProgress?.(filePath, false);
8283
+ return {
8284
+ filePath,
8285
+ result: {
8286
+ vulnerabilities: [],
8287
+ fromCache: false,
8288
+ symbolCount: 0
8289
+ }
8290
+ };
8291
+ }
8292
+ });
8293
+ const batchSettled = await Promise.allSettled(batchPromises);
8294
+ const batchResults = batchSettled.map((settled, idx) => {
8295
+ if (settled.status === "fulfilled") {
8296
+ return settled.value;
8297
+ } else {
8298
+ const filePath = batch[idx];
8299
+ onFileProgress?.(filePath, false);
8300
+ return {
8301
+ filePath,
8302
+ result: {
8303
+ vulnerabilities: [],
8304
+ fromCache: false,
8305
+ symbolCount: 0
8306
+ }
8307
+ };
8230
8308
  }
8231
- const result = await this.scanFile(filePath, forceRescan2);
8232
- onFileProgress?.(filePath, result.fromCache);
8233
- return { filePath, result };
8234
8309
  });
8235
- const batchResults = await Promise.all(batchPromises);
8236
8310
  results.push(...batchResults);
8237
8311
  }
8238
8312
  return results;
@@ -9253,16 +9327,21 @@ var TrieScanTool = class {
9253
9327
  throw new Error("No valid files found to scan. Specify files or run from project root.");
9254
9328
  }
9255
9329
  streamingManager?.startScan(validFiles.length);
9330
+ const forceRescan = !cacheEnabled;
9256
9331
  if (!this.incrementalScanner) {
9257
9332
  this.incrementalScanner = new IncrementalScanner(workDir);
9258
9333
  await this.incrementalScanner.loadCache();
9259
9334
  }
9260
9335
  if (cacheEnabled && !forceRescan) {
9261
9336
  try {
9262
- const { getGitChangedFiles } = await import("./git-5WJHCMNO.js");
9263
- const gitChangedFiles = await getGitChangedFiles(workDir);
9337
+ const { getGitChangedFiles } = await import("./git-45LZUUYA.js");
9338
+ const gitPromise = getGitChangedFiles(workDir);
9339
+ const timeoutPromise = new Promise((resolve2) => {
9340
+ setTimeout(() => resolve2(null), 3e3);
9341
+ });
9342
+ const gitChangedFiles = await Promise.race([gitPromise, timeoutPromise]);
9264
9343
  if (gitChangedFiles && gitChangedFiles.length > 0) {
9265
- const { CacheManager } = await import("./cache-manager-7SKX3IGO.js");
9344
+ const { CacheManager } = await import("./cache-manager-RMPRPD5T.js");
9266
9345
  const cacheManager = new CacheManager(workDir);
9267
9346
  const invalidated = await cacheManager.cleanupStaleEntries(gitChangedFiles);
9268
9347
  if (invalidated > 0 && !isInteractiveMode()) {
@@ -9280,6 +9359,7 @@ var TrieScanTool = class {
9280
9359
  const trieResult = await this.incrementalScanner.scanFiles(
9281
9360
  validFiles,
9282
9361
  forceRescan,
9362
+ // Already defined above
9283
9363
  (filePath) => {
9284
9364
  if (streamingManager) {
9285
9365
  streamingManager.updateCurrentFile(filePath);
@@ -10038,4 +10118,4 @@ export {
10038
10118
  InteractiveDashboard,
10039
10119
  TrieScanTool
10040
10120
  };
10041
- //# sourceMappingURL=chunk-3HDWOSLX.js.map
10121
+ //# sourceMappingURL=chunk-IIF5XDCJ.js.map