@triedotdev/mcp 1.0.119 → 1.0.120

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.
@@ -901,16 +901,16 @@ var VIEW_SHORT = {
901
901
  };
902
902
  var TAB_VIEWS = ["overview", "memory", "goals", "hypotheses", "agent", "chat"];
903
903
  var CONTEXT_HINTS = {
904
- goals: "j/k nav \xB7 a add \xB7 s scan \xB7 enter complete \xB7 d delete \xB7 c clear achieved",
905
- hypotheses: "j/k nav \xB7 a add \xB7 t test \xB7 v validate \xB7 x invalidate",
904
+ goals: "j/k nav \xB7 a add \xB7 r run check \xB7 enter complete \xB7 d delete \xB7 x clear achieved",
905
+ hypotheses: "j/k nav \xB7 a add \xB7 r run check \xB7 v validate \xB7 x invalidate",
906
906
  agent: "j/k nav \xB7 enter expand \xB7 d dismiss",
907
907
  memory: "j/k nav \xB7 enter expand",
908
908
  chat: "type to ask \xB7 enter send \xB7 esc clear",
909
909
  rawlog: "n/p pages \xB7 b back"
910
910
  };
911
911
  var CONTEXT_HINTS_SHORT = {
912
- goals: "j/k a s d c",
913
- hypotheses: "j/k a t v x",
912
+ goals: "j/k a r d x",
913
+ hypotheses: "j/k a r v x",
914
914
  agent: "j/k enter d",
915
915
  memory: "j/k enter",
916
916
  chat: "enter esc",
@@ -1712,29 +1712,34 @@ function GoalsView() {
1712
1712
  const goal = goalsPanel.goals.find((g) => g.id === goalId);
1713
1713
  if (!goal) return;
1714
1714
  dispatch({ type: "ADD_ACTIVITY", message: `Checking goal: ${goal.description.slice(0, 30)}...` });
1715
- dispatch({ type: "SHOW_NOTIFICATION", message: `Scanning files for goal violations...`, severity: "info", autoHideMs: 3e3 });
1716
- const { checkFilesForGoalViolations } = await import("./goal-validator-P67RNO2U.js");
1715
+ dispatch({ type: "SHOW_NOTIFICATION", message: `Scanning files for violations...`, severity: "info", autoHideMs: 3e3 });
1716
+ const { checkFilesForGoalViolations } = await import("./goal-validator-RD6QBQJB.js");
1717
1717
  const violations = await checkFilesForGoalViolations([goal], workDir);
1718
1718
  if (violations.length === 0) {
1719
1719
  dispatch({ type: "SHOW_NOTIFICATION", message: `\u2713 No violations found for: ${goal.description.slice(0, 40)}`, severity: "info", autoHideMs: 5e3 });
1720
1720
  dispatch({ type: "ADD_ACTIVITY", message: `No violations found` });
1721
1721
  } else {
1722
- dispatch({ type: "SHOW_NOTIFICATION", message: `Found ${violations.length} violation(s) for: ${goal.description.slice(0, 30)}`, severity: "warning", autoHideMs: 5e3 });
1722
+ dispatch({ type: "SHOW_NOTIFICATION", message: `Found ${violations.length} violation(s) - check Nudges tab`, severity: "warning", autoHideMs: 5e3 });
1723
1723
  dispatch({ type: "ADD_ACTIVITY", message: `Found ${violations.length} violation(s)` });
1724
1724
  for (const violation of violations) {
1725
1725
  dispatch({ type: "ADD_INSIGHTS", insights: [{
1726
+ id: `scan-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
1726
1727
  message: violation.message,
1727
1728
  severity: violation.severity,
1728
1729
  timestamp: Date.now(),
1729
1730
  category: "goal",
1731
+ type: "warning",
1730
1732
  dismissed: false,
1731
- priority: "high",
1732
- file: violation.file
1733
+ priority: violation.severity === "critical" ? 9 : 6,
1734
+ file: violation.file,
1735
+ relatedIssues: []
1733
1736
  }] });
1734
1737
  }
1735
1738
  }
1736
1739
  } catch (error) {
1737
- dispatch({ type: "ADD_ACTIVITY", message: `Check failed: ${error instanceof Error ? error.message : "unknown"}` });
1740
+ const errorMsg = error instanceof Error ? error.message : "unknown error";
1741
+ dispatch({ type: "SHOW_NOTIFICATION", message: `Check failed: ${errorMsg}`, severity: "warning", autoHideMs: 5e3 });
1742
+ dispatch({ type: "ADD_ACTIVITY", message: `Check failed: ${errorMsg}` });
1738
1743
  }
1739
1744
  }, [dispatch, goalsPanel.goals]);
1740
1745
  useInput4((_input, key) => {
@@ -1754,7 +1759,7 @@ function GoalsView() {
1754
1759
  if (_input === "a") dispatch({ type: "SET_GOALS_INPUT_MODE", mode: "add" });
1755
1760
  else if (key.upArrow || _input === "k") dispatch({ type: "SELECT_GOAL", index: Math.max(0, goalsPanel.selectedIndex - 1) });
1756
1761
  else if (key.downArrow || _input === "j") dispatch({ type: "SELECT_GOAL", index: Math.min(activeGoals.length - 1, goalsPanel.selectedIndex + 1) });
1757
- else if (_input === "s") {
1762
+ else if (_input === "r") {
1758
1763
  const selected = activeGoals[goalsPanel.selectedIndex];
1759
1764
  if (selected) void checkGoalNow(selected.id);
1760
1765
  } else if (key.return) {
@@ -1763,11 +1768,8 @@ function GoalsView() {
1763
1768
  } else if (_input === "d") {
1764
1769
  const selected = activeGoals[goalsPanel.selectedIndex];
1765
1770
  if (selected) void deleteGoal(selected.id);
1766
- } else if (_input === "c") {
1767
- void clearAchievedGoals();
1768
1771
  } else if (_input === "x") {
1769
- const completed = goalsPanel.goals.filter((g) => g.status === "achieved" || g.status === "failed");
1770
- if (completed[0]) void deleteGoal(completed[0].id);
1772
+ void clearAchievedGoals();
1771
1773
  } else if (_input === "u") {
1772
1774
  const recent = goalsPanel.goals.filter((g) => g.status === "achieved").sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
1773
1775
  if (recent[0]) void reactivateGoal(recent[0].id);
@@ -1943,7 +1945,7 @@ function HypothesesView() {
1943
1945
  if (_input === "a") dispatch({ type: "SET_HYPOTHESES_INPUT_MODE", mode: "add" });
1944
1946
  else if (key.upArrow || _input === "k") dispatch({ type: "SELECT_HYPOTHESIS", index: Math.max(0, hypothesesPanel.selectedIndex - 1) });
1945
1947
  else if (key.downArrow || _input === "j") dispatch({ type: "SELECT_HYPOTHESIS", index: Math.min(testing.length - 1, hypothesesPanel.selectedIndex + 1) });
1946
- else if (_input === "t") {
1948
+ else if (_input === "r") {
1947
1949
  const selected = testing[hypothesesPanel.selectedIndex];
1948
1950
  if (selected) void checkHypothesisNow(selected.id);
1949
1951
  } else if (_input === "v") {
@@ -4990,10 +4992,9 @@ Type "yes" to proceed, or "no" to cancel.
4990
4992
  const filePattern = input.filePattern ? String(input.filePattern).trim() : void 0;
4991
4993
  const contextLines = typeof input.contextLines === "number" ? input.contextLines : 2;
4992
4994
  if (!pattern) return "Search pattern is required.";
4993
- const { execSync } = await import("child_process");
4995
+ const { spawnSync } = await import("child_process");
4994
4996
  try {
4995
4997
  const rgArgs = [
4996
- "rg",
4997
4998
  "--context",
4998
4999
  String(contextLines),
4999
5000
  "--heading",
@@ -5019,29 +5020,37 @@ Type "yes" to proceed, or "no" to cancel.
5019
5020
  "!coverage/**"
5020
5021
  );
5021
5022
  rgArgs.push(pattern, directory);
5022
- const result = execSync(rgArgs.join(" "), {
5023
+ const result = spawnSync("rg", rgArgs, {
5023
5024
  encoding: "utf-8",
5024
- maxBuffer: 10 * 1024 * 1024
5025
+ maxBuffer: 10 * 1024 * 1024,
5025
5026
  // 10MB
5027
+ cwd: directory
5026
5028
  });
5027
- if (!result.trim()) {
5029
+ if (result.error) {
5030
+ if (result.error.code === "ENOENT") {
5031
+ return `Error: ripgrep (rg) not found. Please install it:
5032
+ brew install ripgrep (macOS)
5033
+ apt install ripgrep (Ubuntu)
5034
+ Or search files using the AI-powered goal scan instead.`;
5035
+ }
5036
+ return `Search failed: ${result.error.message}`;
5037
+ }
5038
+ if (result.status === 1 || !result.stdout || !result.stdout.trim()) {
5028
5039
  return `No matches found for pattern: ${pattern}`;
5029
5040
  }
5041
+ if (result.status === 2) {
5042
+ return `Search error: ${result.stderr || "Unknown error"}`;
5043
+ }
5030
5044
  const maxLength = 5e3;
5031
- const truncated = result.length > maxLength ? result.slice(0, maxLength) + `
5045
+ const output = result.stdout;
5046
+ const truncated = output.length > maxLength ? output.slice(0, maxLength) + `
5032
5047
 
5033
- ... (truncated, ${result.length - maxLength} more characters)` : result;
5034
- const matchCount = (result.match(/^\d+:/gm) || []).length;
5048
+ ... (truncated, ${output.length - maxLength} more characters)` : output;
5049
+ const matchCount = (output.match(/^\d+:/gm) || []).length;
5035
5050
  return `Found ${matchCount} match(es) for "${pattern}":
5036
5051
 
5037
5052
  ${truncated}`;
5038
5053
  } catch (error) {
5039
- if (error.status === 1) {
5040
- return `No matches found for pattern: ${pattern}`;
5041
- }
5042
- if (error.status === 2) {
5043
- return `Error: ripgrep not found. Please install ripgrep (brew install ripgrep)`;
5044
- }
5045
5054
  return `Search failed: ${error.message}`;
5046
5055
  }
5047
5056
  }
@@ -5148,17 +5157,24 @@ var SYSTEM_PROMPT = `You are Trie, a code guardian assistant embedded in a termi
5148
5157
 
5149
5158
  **What you CAN do:**
5150
5159
  - Check recent goal violations (nudges) in the provided project context
5151
- - Search source code files using trie_search_files (uses ripgrep)
5152
5160
  - Record incidents, decisions, and feedback about the codebase
5153
5161
  - Query stored decisions, blockers, facts, and questions from the decision ledger
5154
5162
  - Create and manage goals and hypotheses
5155
5163
  - Propose fixes for goal violations (requires user confirmation before spawning Claude Code)
5156
5164
  - Save work checkpoints
5157
5165
 
5166
+ **IMPORTANT - File Searching:**
5167
+ - You have a trie_search_files tool but it requires ripgrep to be installed
5168
+ - For searching code patterns (like emojis, TODO comments, etc.), use the provided project context first
5169
+ - If the user asks about emojis or goal violations, check the "Recent goal violations (nudges)" section
5170
+ - DO NOT use regex Unicode ranges in search patterns - they don't work reliably
5171
+ - Instead, suggest the user press 'r' in Goals view to run an AI-powered scan
5172
+
5158
5173
  **When user asks about code content:**
5159
5174
  1. First check the "Recent goal violations (nudges)" section in project context
5160
- 2. If not found in nudges, use trie_search_files to search source code directly
5161
- 3. For emojis specifically, search for common emoji patterns or unicode ranges
5175
+ 2. If found, report what you see
5176
+ 3. If not found, suggest: "Press 'r' in Goals view to run an AI-powered scan"
5177
+ 4. Do NOT attempt manual file searches for emoji detection
5162
5178
 
5163
5179
  **When user asks to fix violations:**
5164
5180
  1. Look in "Recent goal violations (nudges)" section of project context
@@ -5167,9 +5183,9 @@ var SYSTEM_PROMPT = `You are Trie, a code guardian assistant embedded in a termi
5167
5183
  4. Do NOT assume the user wants to proceed - always get confirmation first
5168
5184
 
5169
5185
  Examples:
5170
- - User: "do we have emojis?" \u2192 Check nudges first. If none, use trie_search_files to search for emoji patterns.
5186
+ - User: "do we have emojis?" \u2192 Check nudges first. If none: "I don't see emoji violations in recent nudges. Press 'r' in Goals view to run a scan."
5171
5187
  - User: "fix the emoji violation" \u2192 Find emoji violation in nudges, call trie_propose_fix (will ask user to confirm)
5172
- - User: "search for TODO comments" \u2192 Use trie_search_files with pattern "TODO|FIXME"
5188
+ - User: "search for TODO comments" \u2192 "The file search tool requires ripgrep. I recommend checking recent nudges or running a goal scan."
5173
5189
 
5174
5190
  Answer concisely. Reference specific files, decisions, and patterns when relevant.`;
5175
5191
  function ChatView() {
@@ -5412,7 +5428,7 @@ ${content}
5412
5428
  fixedContent = fixedContent.replace(/^```\w*\n?/, "").replace(/\n?```$/, "");
5413
5429
  }
5414
5430
  await writeFile(fullPath, fixedContent, "utf-8");
5415
- const { recordGoalViolationFixed, getActiveGoals } = await import("./goal-validator-P67RNO2U.js");
5431
+ const { recordGoalViolationFixed, getActiveGoals } = await import("./goal-validator-RD6QBQJB.js");
5416
5432
  const goals = await getActiveGoals(projectPath);
5417
5433
  const matchedGoal = goals.find((g) => g.description === fix.goalDescription);
5418
5434
  if (matchedGoal) {
@@ -5606,6 +5622,9 @@ function DashboardApp({ onReady }) {
5606
5622
  dispatch({ type: "SET_VIEW", view: MAIN_VIEWS[nextIndex] || "overview" });
5607
5623
  return;
5608
5624
  }
5625
+ if (state.view === "goals" || state.view === "hypotheses") {
5626
+ return;
5627
+ }
5609
5628
  if (input === "s") {
5610
5629
  setShowConfig(true);
5611
5630
  return;
@@ -5669,7 +5688,7 @@ function DashboardApp({ onReady }) {
5669
5688
  }
5670
5689
  return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", height: process.stdout.rows || 40, children: [
5671
5690
  /* @__PURE__ */ jsx13(Header, {}),
5672
- /* @__PURE__ */ jsx13(Notification, {}),
5691
+ !showConfig && /* @__PURE__ */ jsx13(Notification, {}),
5673
5692
  /* @__PURE__ */ jsx13(Box12, { flexGrow: 1, flexDirection: "column", overflow: "hidden", children: showConfig ? /* @__PURE__ */ jsx13(ConfigDialog, { onClose: () => {
5674
5693
  setShowConfig(false);
5675
5694
  void persistConfig();
@@ -5733,4 +5752,4 @@ export {
5733
5752
  handleCheckpointTool,
5734
5753
  InteractiveDashboard
5735
5754
  };
5736
- //# sourceMappingURL=chunk-GSYMJLZY.js.map
5755
+ //# sourceMappingURL=chunk-XNAVAA52.js.map