@triedotdev/mcp 1.0.133 → 1.0.135

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.
@@ -5802,13 +5802,6 @@ function ChatView() {
5802
5802
  useEffect3(() => {
5803
5803
  setScrollOffset(0);
5804
5804
  }, [messages.length]);
5805
- useEffect3(() => {
5806
- if (!loading && messageQueue.length > 0) {
5807
- const msg = messageQueue[0];
5808
- dispatch({ type: "DEQUEUE_CHAT_MESSAGE" });
5809
- void sendMessage(msg);
5810
- }
5811
- }, [loading, messageQueue.length, sendMessage, dispatch]);
5812
5805
  useEffect3(() => {
5813
5806
  if (messages.length === 0) return;
5814
5807
  const saveChat = async () => {
@@ -5834,9 +5827,9 @@ function ChatView() {
5834
5827
  const sendMessage = useCallback5(async (question) => {
5835
5828
  if (loadingRef.current) return;
5836
5829
  loadingRef.current = true;
5830
+ dispatch({ type: "SET_CHAT_LOADING", loading: true });
5837
5831
  dispatch({ type: "ADD_CHAT_MESSAGE", role: "user", content: question });
5838
5832
  dispatch({ type: "SET_CHAT_INPUT", buffer: "" });
5839
- dispatch({ type: "SET_CHAT_LOADING", loading: true });
5840
5833
  dispatch({ type: "SET_CHAT_PROGRESS", message: "Thinking..." });
5841
5834
  try {
5842
5835
  const workDir = getWorkingDirectory(void 0, true);
@@ -6026,7 +6019,14 @@ ${contextBlock}`;
6026
6019
  dispatch({ type: "SET_CHAT_PROGRESS", message: null });
6027
6020
  loadingRef.current = false;
6028
6021
  }
6029
- }, [dispatch, messages, state]);
6022
+ }, [dispatch, state]);
6023
+ useEffect3(() => {
6024
+ if (!loading && messageQueue.length > 0 && !loadingRef.current) {
6025
+ const msg = messageQueue[0];
6026
+ dispatch({ type: "DEQUEUE_CHAT_MESSAGE" });
6027
+ void sendMessage(msg);
6028
+ }
6029
+ }, [loading, messageQueue.length, dispatch, sendMessage]);
6030
6030
  useInput8((input, key) => {
6031
6031
  if (loading && key.escape) {
6032
6032
  loadingRef.current = false;
@@ -6510,10 +6510,35 @@ function DashboardApp({ onReady }) {
6510
6510
  } catch {
6511
6511
  }
6512
6512
  }, []);
6513
+ const loadPersistedNudges = useCallback7(async () => {
6514
+ try {
6515
+ const workDir = getWorkingDirectory(void 0, true);
6516
+ const { getStorage: getStorage2 } = await import("./tiered-storage-QW2G7GSG.js");
6517
+ const storage = getStorage2(workDir);
6518
+ await storage.initialize();
6519
+ const nudges = await storage.queryNudges({ resolved: false, limit: 50 });
6520
+ if (nudges.length === 0) return;
6521
+ const insights = nudges.map((n) => ({
6522
+ id: n.id,
6523
+ type: n.severity === "critical" || n.severity === "warning" ? "warning" : "observation",
6524
+ message: n.message,
6525
+ suggestedAction: n.suggestedAction ?? (n.file ? `Review ${n.file}` : void 0),
6526
+ relatedIssues: Array.isArray(n.relatedIssues) ? n.relatedIssues.map(String) : [],
6527
+ priority: n.priority ?? (n.severity === "critical" ? 9 : 6),
6528
+ timestamp: typeof n.timestamp === "string" ? new Date(n.timestamp).getTime() : n.timestamp,
6529
+ dismissed: n.dismissed ?? false,
6530
+ category: n.category || "quality"
6531
+ }));
6532
+ dispatchRef.current({ type: "ADD_INSIGHTS", insights });
6533
+ } catch {
6534
+ }
6535
+ }, []);
6513
6536
  useEffect5(() => {
6514
6537
  void loadConfig();
6515
6538
  void refreshGoals();
6516
6539
  void refreshHypotheses();
6540
+ void processInsights([]);
6541
+ void loadPersistedNudges();
6517
6542
  const outputManager = getOutputManager();
6518
6543
  outputManager.setMode("tui");
6519
6544
  outputManager.registerTUICallbacks({
@@ -6588,7 +6613,7 @@ function DashboardApp({ onReady }) {
6588
6613
  outputManager.clearTUICallbacks();
6589
6614
  outputManager.setMode("console");
6590
6615
  };
6591
- }, [loadConfig, onReady, processInsights, refreshGoals, refreshHypotheses]);
6616
+ }, [loadConfig, onReady, processInsights, refreshGoals, refreshHypotheses, loadPersistedNudges]);
6592
6617
  useEffect5(() => {
6593
6618
  const interval = setInterval(() => {
6594
6619
  dispatchRef.current({ type: "AUTO_DISMISS_NOTIFICATIONS" });
@@ -6600,7 +6625,11 @@ function DashboardApp({ onReady }) {
6600
6625
  const toApply = state.pendingFixes.filter((f) => f.status === "applying" && !applyingFixIds.current.has(f.id));
6601
6626
  for (const fix of toApply) {
6602
6627
  applyingFixIds.current.add(fix.id);
6603
- void applyGoalFix(fix, dispatchRef.current);
6628
+ applyGoalFix(fix, dispatchRef.current).catch((error) => {
6629
+ console.error(`Failed to apply fix for ${fix.file}:`, error);
6630
+ dispatchRef.current({ type: "DISMISS_FIX", id: fix.id });
6631
+ getOutputManager().nudge(`Fix failed for ${fix.file}: ${error instanceof Error ? error.message : "unknown error"}`, "warning");
6632
+ });
6604
6633
  }
6605
6634
  }, [state.pendingFixes]);
6606
6635
  useInput10((input, key) => {
@@ -6766,4 +6795,4 @@ export {
6766
6795
  handleCheckpointTool,
6767
6796
  InteractiveDashboard
6768
6797
  };
6769
- //# sourceMappingURL=chunk-LMFREFAP.js.map
6798
+ //# sourceMappingURL=chunk-TFGNTSMH.js.map