@triedotdev/mcp 1.0.92 → 1.0.93

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 (34) hide show
  1. package/dist/{chunk-FK3DUQ5T.js → chunk-5Z7O66DE.js} +56 -5
  2. package/dist/chunk-5Z7O66DE.js.map +1 -0
  3. package/dist/{chunk-5DQLHWTT.js → chunk-BG2BHWCC.js} +65 -18
  4. package/dist/chunk-BG2BHWCC.js.map +1 -0
  5. package/dist/{chunk-R6YM6YSV.js → chunk-CUXXRM3T.js} +2 -2
  6. package/dist/{chunk-P6XMIUD7.js → chunk-F55XBLIA.js} +3 -3
  7. package/dist/{chunk-76Q5DMYV.js → chunk-IOUOVBJZ.js} +21 -5
  8. package/dist/chunk-IOUOVBJZ.js.map +1 -0
  9. package/dist/{chunk-IYMJTY27.js → chunk-LVVG2DMW.js} +61 -6
  10. package/dist/{chunk-IYMJTY27.js.map → chunk-LVVG2DMW.js.map} +1 -1
  11. package/dist/{chunk-PSVRO76R.js → chunk-MZI46HQT.js} +2 -2
  12. package/dist/{chunk-3HDWOSLX.js → chunk-R6AUYN3R.js} +88 -34
  13. package/dist/{chunk-3HDWOSLX.js.map → chunk-R6AUYN3R.js.map} +1 -1
  14. package/dist/{chunk-ZOKQJZKN.js → chunk-YTJXD664.js} +6 -6
  15. package/dist/cli/main.js +7 -7
  16. package/dist/cli/yolo-daemon.js +8 -8
  17. package/dist/{git-5WJHCMNO.js → git-PZV3BBYI.js} +2 -2
  18. package/dist/{guardian-agent-IXG3YWFP.js → guardian-agent-ZHJXLBOU.js} +5 -5
  19. package/dist/index.js +12 -12
  20. package/dist/{vibe-code-signatures-MHFK5KXF.js → vibe-code-signatures-K4UIWKJZ.js} +2 -2
  21. package/dist/{vulnerability-signatures-DRIYDFG3.js → vulnerability-signatures-ZKVLMBRG.js} +2 -2
  22. package/dist/workers/agent-worker.js +2 -2
  23. package/package.json +1 -1
  24. package/dist/chunk-5DQLHWTT.js.map +0 -1
  25. package/dist/chunk-76Q5DMYV.js.map +0 -1
  26. package/dist/chunk-FK3DUQ5T.js.map +0 -1
  27. /package/dist/{chunk-R6YM6YSV.js.map → chunk-CUXXRM3T.js.map} +0 -0
  28. /package/dist/{chunk-P6XMIUD7.js.map → chunk-F55XBLIA.js.map} +0 -0
  29. /package/dist/{chunk-PSVRO76R.js.map → chunk-MZI46HQT.js.map} +0 -0
  30. /package/dist/{chunk-ZOKQJZKN.js.map → chunk-YTJXD664.js.map} +0 -0
  31. /package/dist/{git-5WJHCMNO.js.map → git-PZV3BBYI.js.map} +0 -0
  32. /package/dist/{guardian-agent-IXG3YWFP.js.map → guardian-agent-ZHJXLBOU.js.map} +0 -0
  33. /package/dist/{vibe-code-signatures-MHFK5KXF.js.map → vibe-code-signatures-K4UIWKJZ.js.map} +0 -0
  34. /package/dist/{vulnerability-signatures-DRIYDFG3.js.map → vulnerability-signatures-ZKVLMBRG.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SlackIntegration,
3
3
  getGuardian
4
- } from "./chunk-PSVRO76R.js";
4
+ } from "./chunk-MZI46HQT.js";
5
5
  import {
6
6
  Executor,
7
7
  Triager,
@@ -13,16 +13,16 @@ import {
13
13
  isTrieInitialized,
14
14
  loadConfig,
15
15
  loadSavedPatterns
16
- } from "./chunk-R6YM6YSV.js";
16
+ } from "./chunk-CUXXRM3T.js";
17
17
  import {
18
18
  getChangedFilesSinceTimestamp,
19
19
  isGitRepo
20
- } from "./chunk-76Q5DMYV.js";
20
+ } from "./chunk-IOUOVBJZ.js";
21
21
  import {
22
22
  getVulnerabilityStats,
23
23
  getVulnerabilityTrie,
24
24
  scanForVulnerabilities
25
- } from "./chunk-FK3DUQ5T.js";
25
+ } from "./chunk-5Z7O66DE.js";
26
26
  import {
27
27
  getGuardianState
28
28
  } from "./chunk-T5UOH56R.js";
@@ -35,7 +35,7 @@ import {
35
35
  loadContextState,
36
36
  removeGlobalSkill,
37
37
  updateContextAfterScan
38
- } from "./chunk-5DQLHWTT.js";
38
+ } from "./chunk-BG2BHWCC.js";
39
39
  import {
40
40
  runShellCommand
41
41
  } from "./chunk-MURGTWG4.js";
@@ -8073,9 +8073,9 @@ var IncrementalScanner = class {
8073
8073
  * 1. Fast pre-check (mtime + size) - O(1), avoids file read
8074
8074
  * 2. Hash comparison - O(n), only if pre-check fails
8075
8075
  */
8076
- async scanFile(filePath, forceRescan2 = false) {
8076
+ async scanFile(filePath, forceRescan = false) {
8077
8077
  const cached = this.cache.files[filePath];
8078
- if (!forceRescan2 && cached) {
8078
+ if (!forceRescan && cached) {
8079
8079
  const preCheck = await this.fastPreCheck(filePath);
8080
8080
  if (!preCheck.changed) {
8081
8081
  return {
@@ -8095,7 +8095,7 @@ var IncrementalScanner = class {
8095
8095
  return { vulnerabilities: [], fromCache: false, symbolCount: 0 };
8096
8096
  }
8097
8097
  const hash = this.computeHash(content);
8098
- if (!forceRescan2 && cached && cached.hash === hash) {
8098
+ if (!forceRescan && cached && cached.hash === hash) {
8099
8099
  if (fileStats) {
8100
8100
  cached.mtime = fileStats.mtime;
8101
8101
  cached.size = fileStats.size;
@@ -8135,7 +8135,7 @@ var IncrementalScanner = class {
8135
8135
  * 2. Parallel file scanning with concurrency limit
8136
8136
  * 3. Fast pre-check (mtime + size) per file
8137
8137
  */
8138
- async scanFiles(filePaths, forceRescan2 = false, onFileProgress) {
8138
+ async scanFiles(filePaths, forceRescan = false, onFileProgress) {
8139
8139
  const startTime = Date.now();
8140
8140
  getVulnerabilityTrie();
8141
8141
  let filesScanned = 0;
@@ -8148,15 +8148,23 @@ var IncrementalScanner = class {
8148
8148
  previousVulnerabilities.set(path, state.vulnerabilities);
8149
8149
  }
8150
8150
  let gitChangedFiles = null;
8151
- if (!forceRescan2) {
8152
- gitChangedFiles = await this.getGitChangedFiles();
8153
- if (gitChangedFiles && !isInteractiveMode()) {
8154
- console.error(` Git detected ${gitChangedFiles.size} changed files`);
8151
+ if (!forceRescan) {
8152
+ try {
8153
+ const gitPromise = this.getGitChangedFiles();
8154
+ const timeoutPromise = new Promise((resolve2) => {
8155
+ setTimeout(() => resolve2(null), 5e3);
8156
+ });
8157
+ gitChangedFiles = await Promise.race([gitPromise, timeoutPromise]);
8158
+ if (gitChangedFiles && !isInteractiveMode()) {
8159
+ console.error(` Git detected ${gitChangedFiles.size} changed files`);
8160
+ }
8161
+ } catch (error) {
8162
+ gitChangedFiles = null;
8155
8163
  }
8156
8164
  }
8157
8165
  const scanResults = await this.parallelScan(
8158
8166
  filePaths,
8159
- forceRescan2,
8167
+ forceRescan,
8160
8168
  gitChangedFiles,
8161
8169
  onFileProgress
8162
8170
  );
@@ -8208,31 +8216,71 @@ var IncrementalScanner = class {
8208
8216
  /**
8209
8217
  * Parallel file scanning with concurrency limit
8210
8218
  * Processes SCAN_CONCURRENCY files at a time
8219
+ * Includes timeout protection to prevent hanging
8211
8220
  */
8212
- async parallelScan(filePaths, forceRescan2, gitChangedFiles, onFileProgress) {
8221
+ async parallelScan(filePaths, forceRescan, gitChangedFiles, onFileProgress) {
8213
8222
  const results = [];
8223
+ const FILE_SCAN_TIMEOUT_MS = 3e4;
8214
8224
  for (let i = 0; i < filePaths.length; i += SCAN_CONCURRENCY) {
8215
8225
  const batch = filePaths.slice(i, i + SCAN_CONCURRENCY);
8216
8226
  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
- };
8227
+ try {
8228
+ if (gitChangedFiles && !gitChangedFiles.has(filePath)) {
8229
+ const cached = this.cache.files[filePath];
8230
+ if (cached) {
8231
+ onFileProgress?.(filePath, true);
8232
+ return {
8233
+ filePath,
8234
+ result: {
8235
+ vulnerabilities: cached.vulnerabilities,
8236
+ fromCache: true,
8237
+ symbolCount: cached.symbolCount
8238
+ }
8239
+ };
8240
+ }
8229
8241
  }
8242
+ const scanPromise = this.scanFile(filePath, forceRescan);
8243
+ const timeoutPromise = new Promise((resolve2) => {
8244
+ setTimeout(() => {
8245
+ resolve2({
8246
+ vulnerabilities: [],
8247
+ fromCache: false,
8248
+ symbolCount: 0
8249
+ });
8250
+ }, FILE_SCAN_TIMEOUT_MS);
8251
+ });
8252
+ const result = await Promise.race([scanPromise, timeoutPromise]);
8253
+ onFileProgress?.(filePath, result.fromCache);
8254
+ return { filePath, result };
8255
+ } catch (error) {
8256
+ onFileProgress?.(filePath, false);
8257
+ return {
8258
+ filePath,
8259
+ result: {
8260
+ vulnerabilities: [],
8261
+ fromCache: false,
8262
+ symbolCount: 0
8263
+ }
8264
+ };
8265
+ }
8266
+ });
8267
+ const batchSettled = await Promise.allSettled(batchPromises);
8268
+ const batchResults = batchSettled.map((settled, idx) => {
8269
+ if (settled.status === "fulfilled") {
8270
+ return settled.value;
8271
+ } else {
8272
+ const filePath = batch[idx];
8273
+ onFileProgress?.(filePath, false);
8274
+ return {
8275
+ filePath,
8276
+ result: {
8277
+ vulnerabilities: [],
8278
+ fromCache: false,
8279
+ symbolCount: 0
8280
+ }
8281
+ };
8230
8282
  }
8231
- const result = await this.scanFile(filePath, forceRescan2);
8232
- onFileProgress?.(filePath, result.fromCache);
8233
- return { filePath, result };
8234
8283
  });
8235
- const batchResults = await Promise.all(batchPromises);
8236
8284
  results.push(...batchResults);
8237
8285
  }
8238
8286
  return results;
@@ -9253,14 +9301,19 @@ var TrieScanTool = class {
9253
9301
  throw new Error("No valid files found to scan. Specify files or run from project root.");
9254
9302
  }
9255
9303
  streamingManager?.startScan(validFiles.length);
9304
+ const forceRescan = !cacheEnabled;
9256
9305
  if (!this.incrementalScanner) {
9257
9306
  this.incrementalScanner = new IncrementalScanner(workDir);
9258
9307
  await this.incrementalScanner.loadCache();
9259
9308
  }
9260
9309
  if (cacheEnabled && !forceRescan) {
9261
9310
  try {
9262
- const { getGitChangedFiles } = await import("./git-5WJHCMNO.js");
9263
- const gitChangedFiles = await getGitChangedFiles(workDir);
9311
+ const { getGitChangedFiles } = await import("./git-PZV3BBYI.js");
9312
+ const gitPromise = getGitChangedFiles(workDir);
9313
+ const timeoutPromise = new Promise((resolve2) => {
9314
+ setTimeout(() => resolve2(null), 3e3);
9315
+ });
9316
+ const gitChangedFiles = await Promise.race([gitPromise, timeoutPromise]);
9264
9317
  if (gitChangedFiles && gitChangedFiles.length > 0) {
9265
9318
  const { CacheManager } = await import("./cache-manager-7SKX3IGO.js");
9266
9319
  const cacheManager = new CacheManager(workDir);
@@ -9280,6 +9333,7 @@ var TrieScanTool = class {
9280
9333
  const trieResult = await this.incrementalScanner.scanFiles(
9281
9334
  validFiles,
9282
9335
  forceRescan,
9336
+ // Already defined above
9283
9337
  (filePath) => {
9284
9338
  if (streamingManager) {
9285
9339
  streamingManager.updateCurrentFile(filePath);
@@ -10038,4 +10092,4 @@ export {
10038
10092
  InteractiveDashboard,
10039
10093
  TrieScanTool
10040
10094
  };
10041
- //# sourceMappingURL=chunk-3HDWOSLX.js.map
10095
+ //# sourceMappingURL=chunk-R6AUYN3R.js.map