@triedotdev/mcp 1.0.55 → 1.0.57

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TrieScanTool
4
- } from "../chunk-3NTILEEL.js";
4
+ } from "../chunk-3XZO27U7.js";
5
5
  import "../chunk-KLKY34RE.js";
6
6
  import "../chunk-HUQQSQOD.js";
7
7
  import "../chunk-3CS6Z2SL.js";
package/dist/index.js CHANGED
@@ -24,9 +24,11 @@ import {
24
24
  saveCheckpoint
25
25
  } from "./chunk-AVOMCNBD.js";
26
26
  import {
27
+ InteractiveDashboard,
28
+ StreamingManager,
27
29
  TrieScanTool,
28
30
  loadConfig
29
- } from "./chunk-3NTILEEL.js";
31
+ } from "./chunk-3XZO27U7.js";
30
32
  import "./chunk-KLKY34RE.js";
31
33
  import {
32
34
  CRITICAL_REVIEW_CHECKLIST,
@@ -2550,6 +2552,8 @@ var TrieWatchTool = class {
2550
2552
  nudges: []
2551
2553
  };
2552
2554
  watchers = /* @__PURE__ */ new Map();
2555
+ streamingManager;
2556
+ dashboard;
2553
2557
  async execute(args) {
2554
2558
  const { action, directory, debounceMs = 1e3 } = args;
2555
2559
  switch (action) {
@@ -2596,11 +2600,23 @@ var TrieWatchTool = class {
2596
2600
  console.error(`Debounce: ${debounceMs}ms`);
2597
2601
  console.error("");
2598
2602
  }
2603
+ if (isInteractiveMode()) {
2604
+ this.streamingManager = new StreamingManager();
2605
+ this.dashboard = new InteractiveDashboard();
2606
+ this.streamingManager.subscribe((update) => this.dashboard?.handleStreamUpdate(update));
2607
+ await this.dashboard.start();
2608
+ this.streamingManager.reportWatchStatus({ watching: true, directories: 0, debounceMs });
2609
+ }
2599
2610
  await this.watchDirectory(directory, debounceMs);
2600
2611
  if (!isInteractiveMode()) {
2601
2612
  console.error("Running initial scan...\n");
2602
2613
  }
2603
- const initialResult = await this.scanTool.execute({ directory });
2614
+ const initialResult = await this.scanTool.execute({
2615
+ directory,
2616
+ interactive: isInteractiveMode(),
2617
+ streamingManager: this.streamingManager,
2618
+ dashboard: this.dashboard
2619
+ });
2604
2620
  return {
2605
2621
  content: [{
2606
2622
  type: "text",
@@ -2657,6 +2673,13 @@ ${initialResult.content?.[0]?.text || "Initial scan complete."}`
2657
2673
  await this.watchDirectory(join2(dir, entry.name), debounceMs);
2658
2674
  }
2659
2675
  }
2676
+ if (this.streamingManager) {
2677
+ this.streamingManager.reportWatchStatus({
2678
+ watching: true,
2679
+ directories: this.watchers.size,
2680
+ debounceMs
2681
+ });
2682
+ }
2660
2683
  } catch (error) {
2661
2684
  }
2662
2685
  }
@@ -2673,7 +2696,17 @@ Detected changes in ${files.length} file(s):`);
2673
2696
  console.error("");
2674
2697
  }
2675
2698
  try {
2676
- const result = await this.scanTool.execute({ files });
2699
+ if (this.streamingManager) {
2700
+ for (const file of files) {
2701
+ this.streamingManager.reportWatchChange(file);
2702
+ }
2703
+ }
2704
+ const result = await this.scanTool.execute({
2705
+ files,
2706
+ interactive: isInteractiveMode(),
2707
+ streamingManager: this.streamingManager,
2708
+ dashboard: this.dashboard
2709
+ });
2677
2710
  const resultText = result.content?.[0]?.text || "";
2678
2711
  this.state.filesScanned += files.length;
2679
2712
  const issueMatch = resultText.match(/(\d+) total/);
@@ -2706,7 +2739,9 @@ Found ${newIssues} issues in changed files!`);
2706
2739
  }
2707
2740
  this.maybeNudge(files, resultText);
2708
2741
  } catch (error) {
2709
- console.error(`\u274C Scan error: ${error}`);
2742
+ if (!isInteractiveMode()) {
2743
+ console.error(`\u274C Scan error: ${error}`);
2744
+ }
2710
2745
  }
2711
2746
  }
2712
2747
  isQuiet() {
@@ -2735,8 +2770,10 @@ Found ${newIssues} issues in changed files!`);
2735
2770
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
2736
2771
  };
2737
2772
  this.state.nudges.push(payload);
2738
- console.error(`
2773
+ if (!isInteractiveMode()) {
2774
+ console.error(`
2739
2775
  \u{1F6E1}\uFE0F ${payload.message}`);
2776
+ }
2740
2777
  }
2741
2778
  }
2742
2779
  stopWatching() {
@@ -2756,7 +2793,12 @@ Found ${newIssues} issues in changed files!`);
2756
2793
  clearTimeout(this.state.scanDebounceTimer);
2757
2794
  }
2758
2795
  this.state.isRunning = false;
2759
- console.error("\n\u{1F441}\uFE0F Watch mode stopped.\n");
2796
+ if (!isInteractiveMode()) {
2797
+ console.error("\n\u{1F441}\uFE0F Watch mode stopped.\n");
2798
+ }
2799
+ if (this.streamingManager) {
2800
+ this.streamingManager.reportWatchStatus({ watching: false, directories: 0 });
2801
+ }
2760
2802
  return {
2761
2803
  content: [{
2762
2804
  type: "text",