@triedotdev/mcp 1.0.109 → 1.0.110

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.
@@ -2630,17 +2630,33 @@ function ChatView() {
2630
2630
  try {
2631
2631
  const snap = await graph.getSnapshot();
2632
2632
  const fileNodes = snap.nodes.filter((n) => n.type === "file");
2633
- const riskFiles = fileNodes.filter((n) => n.data && "riskLevel" in n.data && (n.data.riskLevel === "critical" || n.data.riskLevel === "high")).slice(0, 10);
2634
- if (riskFiles.length > 0) {
2635
- contextParts.push("High-risk files:\n" + riskFiles.map(
2636
- (n) => `- ${n.data.path} (${n.data.riskLevel})`
2637
- ).join("\n"));
2633
+ const changeNodes = snap.nodes.filter((n) => n.type === "change");
2634
+ const patternNodes = snap.nodes.filter((n) => n.type === "pattern");
2635
+ const incidentNodes = snap.nodes.filter((n) => n.type === "incident");
2636
+ contextParts.push(`Context graph: ${snap.nodes.length} nodes, ${snap.edges.length} edges (${fileNodes.length} files, ${changeNodes.length} changes, ${patternNodes.length} patterns, ${incidentNodes.length} incidents)`);
2637
+ if (fileNodes.length > 0) {
2638
+ const sorted = [...fileNodes].sort((a, b) => {
2639
+ const riskOrder = { critical: 0, high: 1, medium: 2, low: 3 };
2640
+ const ad = a.data, bd = b.data;
2641
+ return (riskOrder[ad.riskLevel] ?? 4) - (riskOrder[bd.riskLevel] ?? 4);
2642
+ });
2643
+ contextParts.push("Project files (by risk):\n" + sorted.slice(0, 20).map((n) => {
2644
+ const d = n.data;
2645
+ return `- ${d.path} (${d.riskLevel}, ${d.changeCount} changes${d.incidentCount > 0 ? `, ${d.incidentCount} incidents` : ""})`;
2646
+ }).join("\n") + (sorted.length > 20 ? `
2647
+ ...and ${sorted.length - 20} more files` : ""));
2648
+ }
2649
+ if (changeNodes.length > 0) {
2650
+ contextParts.push("Recent changes:\n" + changeNodes.slice(0, 5).map((n) => {
2651
+ const d = n.data;
2652
+ return `- ${d.message} (${d.timestamp}, ${d.files.length} files, outcome: ${d.outcome})`;
2653
+ }).join("\n"));
2638
2654
  }
2639
- const patternNodes = snap.nodes.filter((n) => n.type === "pattern").slice(0, 5);
2640
2655
  if (patternNodes.length > 0) {
2641
- contextParts.push("Learned patterns:\n" + patternNodes.map(
2642
- (n) => `- ${n.data.description} (${Math.round(n.data.confidence * 100)}% confidence)`
2643
- ).join("\n"));
2656
+ contextParts.push("Learned patterns:\n" + patternNodes.slice(0, 5).map((n) => {
2657
+ const d = n.data;
2658
+ return `- ${d.description} (${Math.round(d.confidence * 100)}% confidence${d.isAntiPattern ? ", anti-pattern" : ""})`;
2659
+ }).join("\n"));
2644
2660
  }
2645
2661
  } catch {
2646
2662
  }
@@ -3012,4 +3028,4 @@ export {
3012
3028
  getOutputManager,
3013
3029
  InteractiveDashboard
3014
3030
  };
3015
- //# sourceMappingURL=chunk-G6EC4JNL.js.map
3031
+ //# sourceMappingURL=chunk-OD4SLUIV.js.map