@triedotdev/mcp 1.0.158 → 1.0.161

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.
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-JVMBCWKS.js";
4
4
  import {
5
5
  getTrieAgent
6
- } from "./chunk-UAQXKEMS.js";
6
+ } from "./chunk-ZGVPZZFM.js";
7
7
  import {
8
8
  CodebaseIndex
9
9
  } from "./chunk-Q5EKA5YA.js";
@@ -30,11 +30,11 @@ import {
30
30
  } from "./chunk-TN5WEKWI.js";
31
31
  import {
32
32
  findCrossProjectPatterns
33
- } from "./chunk-E2DRW5XC.js";
33
+ } from "./chunk-OWYOC5DX.js";
34
34
  import {
35
35
  TieredStorage,
36
36
  getStorage
37
- } from "./chunk-IW7VZ2XD.js";
37
+ } from "./chunk-XMW2WTZB.js";
38
38
  import {
39
39
  ContextGraph
40
40
  } from "./chunk-VUL52BQL.js";
@@ -653,6 +653,21 @@ function dashboardReducer(state, action) {
653
653
  s = addActivity(s, `Cleared ${dismissedCount} dismissed insight${dismissedCount !== 1 ? "s" : ""}`);
654
654
  return s;
655
655
  }
656
+ case "CLEAR_ALL_INSIGHTS": {
657
+ const totalCount = state.agentInsights.filter((i) => !i.dismissed).length;
658
+ if (totalCount === 0) return addActivity(state, "No insights to clear");
659
+ const dismissed = state.agentInsights.map((i) => ({ ...i, dismissed: true }));
660
+ let s = {
661
+ ...state,
662
+ agentInsights: dismissed,
663
+ selectedInsight: 0,
664
+ expandedInsight: null,
665
+ unreadNudgesCount: 0,
666
+ scrollPositions: { ...state.scrollPositions, agent: 0 }
667
+ };
668
+ s = addActivity(s, `Cleared ${totalCount} nudge${totalCount !== 1 ? "s" : ""}`);
669
+ return s;
670
+ }
656
671
  case "SET_GOALS":
657
672
  return { ...state, goalsPanel: { ...state.goalsPanel, goals: action.goals } };
658
673
  case "SET_GOALS_INPUT_MODE":
@@ -1625,8 +1640,9 @@ var VIEW_HELP = {
1625
1640
  { key: "j / \u2193", description: "Move down" },
1626
1641
  { key: "k / \u2191", description: "Move up" },
1627
1642
  { key: "enter", description: "Fix goal violation (or expand if not a violation)" },
1628
- { key: "f", description: "Force spawn Claude Code fix" },
1643
+ { key: "f", description: "Force spawn Claude Code to fix any nudge" },
1629
1644
  { key: "d", description: "Dismiss selected nudge" },
1645
+ { key: "c", description: "Clear all nudges" },
1630
1646
  { key: "tab", description: "Navigate between views" },
1631
1647
  { key: "s", description: "Open Settings" },
1632
1648
  { key: "q / esc", description: "Quit" }
@@ -1950,7 +1966,7 @@ function AgentView() {
1950
1966
  const { getInsightStore } = await import("./insight-store-EC4PLSAW.js");
1951
1967
  const store = getInsightStore(workDir);
1952
1968
  await store.dismissInsight(insight.id);
1953
- const { getStorage: getStorage2 } = await import("./tiered-storage-WWVVHGFR.js");
1969
+ const { getStorage: getStorage2 } = await import("./tiered-storage-THHKROJF.js");
1954
1970
  const storage = getStorage2(workDir);
1955
1971
  await storage.dismissNudge(insight.id).catch(() => {
1956
1972
  });
@@ -1959,26 +1975,52 @@ function AgentView() {
1959
1975
  }
1960
1976
  dispatch({ type: "DISMISS_INSIGHT", index: selectedInsight });
1961
1977
  }, [selectedInsight, state, dispatch]);
1978
+ const clearAllNudges = useCallback(async () => {
1979
+ try {
1980
+ const workDir = getWorkingDirectory(void 0, true);
1981
+ const { getStorage: getStorage2 } = await import("./tiered-storage-THHKROJF.js");
1982
+ const storage = getStorage2(workDir);
1983
+ await storage.clearAllNudges();
1984
+ dispatch({ type: "CLEAR_ALL_INSIGHTS" });
1985
+ dispatch({ type: "ADD_ACTIVITY", message: "Cleared all nudges" });
1986
+ } catch (error) {
1987
+ console.error("Failed to clear nudges:", error);
1988
+ dispatch({ type: "ADD_ACTIVITY", message: "Failed to clear nudges" });
1989
+ }
1990
+ }, [dispatch]);
1962
1991
  const spawnFixForInsight = useCallback(async () => {
1963
1992
  const visible = getVisibleInsights(state);
1964
1993
  const insight = visible[selectedInsight];
1965
1994
  if (!insight) return;
1966
- const parsed = parseGoalViolation(insight.message);
1967
- if (!parsed) {
1968
- dispatch({ type: "ADD_ACTIVITY", message: "Selected nudge is not a goal violation (cannot fix)" });
1969
- return;
1970
- }
1971
1995
  const workDir = getWorkingDirectory(void 0, true);
1996
+ const parsed = parseGoalViolation(insight.message);
1972
1997
  try {
1973
- const { spawnClaudeCodeFix } = await import("./terminal-spawn-P5M5PHAV.js");
1974
- await spawnClaudeCodeFix({
1975
- file: parsed.file,
1976
- goal: parsed.goal,
1977
- violation: parsed.violation,
1978
- ...insight.suggestedAction ? { suggestedFix: insight.suggestedAction } : {},
1979
- cwd: workDir
1980
- });
1981
- dispatch({ type: "ADD_ACTIVITY", message: `Spawned Claude Code to fix ${parsed.file}` });
1998
+ if (parsed) {
1999
+ const { spawnClaudeCodeFix } = await import("./terminal-spawn-5YXDMUCF.js");
2000
+ await spawnClaudeCodeFix({
2001
+ file: parsed.file,
2002
+ goal: parsed.goal,
2003
+ violation: parsed.violation,
2004
+ ...insight.suggestedAction ? { suggestedFix: insight.suggestedAction } : {},
2005
+ cwd: workDir
2006
+ });
2007
+ dispatch({ type: "ADD_ACTIVITY", message: `Spawned Claude Code to fix ${parsed.file}` });
2008
+ } else {
2009
+ const { spawnClaudeCodeFixIssue } = await import("./terminal-spawn-5YXDMUCF.js");
2010
+ let file;
2011
+ const fileMatch = insight.message.match(/(?:in|file|at)\s+([^\s:]+\.(?:ts|js|tsx|jsx|py|java|go|rs|cpp|c|h))/i);
2012
+ if (fileMatch) {
2013
+ file = fileMatch[1];
2014
+ }
2015
+ await spawnClaudeCodeFixIssue({
2016
+ message: insight.message,
2017
+ file,
2018
+ suggestedAction: insight.suggestedAction,
2019
+ cwd: workDir
2020
+ });
2021
+ const fileDisplay = file ? ` for ${file.split("/").pop()}` : "";
2022
+ dispatch({ type: "ADD_ACTIVITY", message: `Spawned Claude Code to fix issue${fileDisplay}` });
2023
+ }
1982
2024
  } catch (error) {
1983
2025
  const msg = error instanceof Error ? error.message : "Unknown error";
1984
2026
  dispatch({ type: "ADD_ACTIVITY", message: `Fix spawn failed: ${msg}` });
@@ -2000,6 +2042,7 @@ function AgentView() {
2000
2042
  }
2001
2043
  } else if (input === "d") void dismissInsight();
2002
2044
  else if (input === "f") void spawnFixForInsight();
2045
+ else if (input === "c") void clearAllNudges();
2003
2046
  });
2004
2047
  const alertCount = alerts.length;
2005
2048
  const decCount = decisions.length;
@@ -2844,11 +2887,18 @@ function MemoryTreeView() {
2844
2887
  ...n.data.reasoning != null ? { reasoning: n.data.reasoning } : {},
2845
2888
  ...n.data.outcome != null ? { outcome: n.data.outcome } : {}
2846
2889
  }));
2890
+ const productGovernance = governance.filter(
2891
+ (g) => g.tags.includes("product") || g.tags.includes("decision") || g.context.includes("user") || g.context.includes("product") || g.decision.length > 100
2892
+ // Longer decisions are likely product decisions
2893
+ );
2894
+ const learnedSignals = governance.filter(
2895
+ (g) => !productGovernance.includes(g)
2896
+ );
2847
2897
  const hotspots = fileNodes.filter((n) => n.data.riskLevel === "critical" || n.data.riskLevel === "high").sort((a, b) => {
2848
2898
  const order = { critical: 0, high: 1 };
2849
2899
  return (order[a.data.riskLevel] ?? 2) - (order[b.data.riskLevel] ?? 2);
2850
2900
  });
2851
- const totalEntries = governance.length + incidentNodes.length + patternNodes.length + globalPatterns.length + hotspots.length + ledgerBlocks.length;
2901
+ const totalEntries = productGovernance.length + learnedSignals.length + incidentNodes.length + patternNodes.length + globalPatterns.length + hotspots.length + ledgerBlocks.length;
2852
2902
  const expandedGovernance = expandedItemId?.startsWith("decision-") ? governance.find((g) => `decision-${g.id}` === expandedItemId) : null;
2853
2903
  const expandedIncident = expandedItemId?.startsWith("incident-") ? incidentNodes.find((n) => `incident-${n.id}` === expandedItemId) : null;
2854
2904
  const expandedGotcha = expandedItemId?.startsWith("gotcha-") ? storageGotchas.find((g) => `gotcha-${g.id}` === expandedItemId) ?? null : null;
@@ -3042,8 +3092,8 @@ function MemoryTreeView() {
3042
3092
  ] }) })
3043
3093
  ] }),
3044
3094
  /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", marginTop: 1, children: [
3045
- renderHeader("decisions", "Product Governance", governance.length, "-- use trie tell or chat"),
3046
- expandedNodes.has("decisions") && governance.slice(0, 10).map((g) => {
3095
+ renderHeader("decisions", "Product Governance", productGovernance.length, "-- use trie tell or chat"),
3096
+ expandedNodes.has("decisions") && productGovernance.slice(0, 10).map((g) => {
3047
3097
  const nodeId = `decision-${g.id}`;
3048
3098
  const decWidth = Math.max(30, contentWidth - 25);
3049
3099
  const dec = g.decision.length > decWidth ? g.decision.slice(0, decWidth - 3) + "..." : g.decision;
@@ -3114,31 +3164,66 @@ function MemoryTreeView() {
3114
3164
  ] })
3115
3165
  ] }, g.id);
3116
3166
  }),
3117
- renderHeader("patterns", "Learned Patterns", patternNodes.length, "-- Trie learns as you work"),
3118
- expandedNodes.has("patterns") && patternNodes.slice(0, 10).map((n) => {
3119
- const nodeId = `pattern-${n.id}`;
3120
- const conf = Math.round(n.data.confidence * 100);
3121
- const confColor = conf > 70 ? "green" : conf > 40 ? "yellow" : void 0;
3122
- const descWidth = Math.max(30, contentWidth - 15);
3123
- const desc = n.data.description.length > descWidth ? n.data.description.slice(0, descWidth - 3) + "..." : n.data.description;
3124
- return /* @__PURE__ */ jsxs10(Text10, { wrap: "truncate", children: [
3125
- sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: "> " }) : " ",
3167
+ renderHeader("patterns", "Learned Signals", learnedSignals.length + patternNodes.length, learnedSignals.length === 0 && patternNodes.length === 0 ? "-- Trie learns as you work" : void 0),
3168
+ expandedNodes.has("patterns") && /* @__PURE__ */ jsxs10(Fragment6, { children: [
3169
+ learnedSignals.length > 0 && /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
3170
+ /* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
3171
+ " ",
3172
+ " ",
3173
+ "Governance & Facts"
3174
+ ] }),
3175
+ learnedSignals.slice(0, 5).map((g) => {
3176
+ const descWidth = Math.max(30, contentWidth - 15);
3177
+ const desc = g.decision.length > descWidth ? g.decision.slice(0, descWidth - 3) + "..." : g.decision;
3178
+ return /* @__PURE__ */ jsxs10(Text10, { wrap: "truncate", children: [
3179
+ " ",
3180
+ /* @__PURE__ */ jsx11(Text10, { color: "cyan", children: "\u25CB" }),
3181
+ " ",
3182
+ /* @__PURE__ */ jsx11(Text10, { children: desc }),
3183
+ narrow ? null : /* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
3184
+ " ",
3185
+ timeAgo2(g.when)
3186
+ ] })
3187
+ ] }, g.id);
3188
+ })
3189
+ ] }),
3190
+ patternNodes.length > 0 && /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", marginTop: learnedSignals.length > 0 ? 1 : 0, children: [
3191
+ learnedSignals.length > 0 && /* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
3192
+ " ",
3193
+ " ",
3194
+ "Patterns"
3195
+ ] }),
3196
+ patternNodes.slice(0, 10).map((n) => {
3197
+ const nodeId = `pattern-${n.id}`;
3198
+ const conf = Math.round(n.data.confidence * 100);
3199
+ const confColor = conf > 70 ? "green" : conf > 40 ? "yellow" : void 0;
3200
+ const descWidth = Math.max(30, contentWidth - 15);
3201
+ const desc = n.data.description.length > descWidth ? n.data.description.slice(0, descWidth - 3) + "..." : n.data.description;
3202
+ return /* @__PURE__ */ jsxs10(Text10, { wrap: "truncate", children: [
3203
+ sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: "> " }) : learnedSignals.length > 0 ? " " : " ",
3204
+ learnedSignals.length === 0 && " ",
3205
+ n.data.isAntiPattern ? /* @__PURE__ */ jsx11(Text10, { color: "red", children: "!" }) : /* @__PURE__ */ jsx11(Text10, { dimColor: true, children: "\u25CB" }),
3206
+ " ",
3207
+ sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: desc }) : /* @__PURE__ */ jsx11(Text10, { children: desc }),
3208
+ narrow ? null : /* @__PURE__ */ jsxs10(Fragment6, { children: [
3209
+ " ",
3210
+ confColor ? /* @__PURE__ */ jsxs10(Text10, { color: confColor, children: [
3211
+ conf,
3212
+ "%"
3213
+ ] }) : /* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
3214
+ conf,
3215
+ "%"
3216
+ ] })
3217
+ ] })
3218
+ ] }, n.id);
3219
+ })
3220
+ ] }),
3221
+ patternNodes.length === 0 && learnedSignals.length === 0 && /* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
3126
3222
  " ",
3127
- n.data.isAntiPattern ? /* @__PURE__ */ jsx11(Text10, { color: "red", children: "!" }) : /* @__PURE__ */ jsx11(Text10, { dimColor: true, children: "\u25CB" }),
3128
- " ",
3129
- sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: desc }) : /* @__PURE__ */ jsx11(Text10, { children: desc }),
3130
- narrow ? null : /* @__PURE__ */ jsxs10(Fragment6, { children: [
3131
- " ",
3132
- confColor ? /* @__PURE__ */ jsxs10(Text10, { color: confColor, children: [
3133
- conf,
3134
- "%"
3135
- ] }) : /* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
3136
- conf,
3137
- "%"
3138
- ] })
3139
- ] })
3140
- ] }, n.id);
3141
- }),
3223
+ " ",
3224
+ "No signals learned yet. Trie will extract insights as you work."
3225
+ ] })
3226
+ ] }),
3142
3227
  renderHeader("cross-project", "Cross-Project", globalPatterns.length),
3143
3228
  expandedNodes.has("cross-project") && globalPatterns.slice(0, 8).map((pattern) => {
3144
3229
  const patternId = `global-${pattern.id}`;
@@ -8698,7 +8783,7 @@ function ChatView() {
8698
8783
  }
8699
8784
  const fixesToApply = isYesToAll ? allPendingFixes : lastFixes;
8700
8785
  if (fixesToApply.length > 0) {
8701
- const { spawnClaudeCodeFix } = await import("./terminal-spawn-P5M5PHAV.js");
8786
+ const { spawnClaudeCodeFix } = await import("./terminal-spawn-5YXDMUCF.js");
8702
8787
  const results = [];
8703
8788
  const errors = [];
8704
8789
  for (const fix of fixesToApply) {
@@ -9420,7 +9505,7 @@ function DashboardApp({ onReady }) {
9420
9505
  const loadPersistedNudges = useCallback7(async () => {
9421
9506
  try {
9422
9507
  const workDir = getWorkingDirectory(void 0, true);
9423
- const { getStorage: getStorage2 } = await import("./tiered-storage-WWVVHGFR.js");
9508
+ const { getStorage: getStorage2 } = await import("./tiered-storage-THHKROJF.js");
9424
9509
  const storage = getStorage2(workDir);
9425
9510
  await storage.initialize();
9426
9511
  const nudges = await storage.queryNudges({ resolved: false, limit: 50 });
@@ -11011,7 +11096,7 @@ Use \`trie_watch start\` to begin autonomous scanning.`
11011
11096
  ).join("\n");
11012
11097
  let agencyStatus = "";
11013
11098
  try {
11014
- const { getTrieAgent: getTrieAgent2 } = await import("./trie-agent-ZLKBEWPW.js");
11099
+ const { getTrieAgent: getTrieAgent2 } = await import("./trie-agent-VRV6GKJP.js");
11015
11100
  const trieAgent = getTrieAgent2(this.watchedDirectory || getWorkingDirectory(void 0, true));
11016
11101
  await trieAgent.initialize();
11017
11102
  const status = await trieAgent.getAgencyStatus();
@@ -11148,4 +11233,4 @@ export {
11148
11233
  InteractiveDashboard,
11149
11234
  TrieWatchTool
11150
11235
  };
11151
- //# sourceMappingURL=chunk-NYYVYJPJ.js.map
11236
+ //# sourceMappingURL=chunk-MPHYM7M6.js.map