@triedotdev/mcp 1.0.111 → 1.0.112

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.
@@ -4925,13 +4925,14 @@ ${checkpoint.files.length > 0 ? `**Files:** ${checkpoint.files.join(", ")}` : ""
4925
4925
  }
4926
4926
 
4927
4927
  // src/cli/dashboard/chat-tools.ts
4928
+ import { createHash } from "crypto";
4928
4929
  function textFromResult(result) {
4929
4930
  return result.content.map((c) => c.text).join("\n");
4930
4931
  }
4931
4932
  var CHAT_TOOLS = [
4932
4933
  {
4933
4934
  name: "trie_tell",
4934
- description: "Record an incident or observation about the codebase. Use when the user reports a bug, crash, or notable event.",
4935
+ description: "Record an incident about the codebase. Use when the user reports a bug, crash, outage, or notable problem. This is the incident tracker \u2014 NOT for goals or hypotheses.",
4935
4936
  input_schema: {
4936
4937
  type: "object",
4937
4938
  properties: {
@@ -5023,6 +5024,46 @@ var CHAT_TOOLS = [
5023
5024
  },
5024
5025
  required: ["action"]
5025
5026
  }
5027
+ },
5028
+ {
5029
+ name: "trie_add_goal",
5030
+ description: "Create a new goal for the user to track. Use when the user asks to set, add, or create a goal.",
5031
+ input_schema: {
5032
+ type: "object",
5033
+ properties: {
5034
+ description: { type: "string", description: "What the user wants to achieve" },
5035
+ category: { type: "string", enum: ["security", "quality", "performance", "coverage", "general"], description: "Goal category (default general)" }
5036
+ },
5037
+ required: ["description"]
5038
+ }
5039
+ },
5040
+ {
5041
+ name: "trie_add_hypothesis",
5042
+ description: "Create a hypothesis to test. Use when the user has a theory they want to track and validate over time.",
5043
+ input_schema: {
5044
+ type: "object",
5045
+ properties: {
5046
+ statement: { type: "string", description: "The hypothesis statement to test" },
5047
+ category: { type: "string", enum: ["timing", "pattern", "team", "code", "general"], description: "Hypothesis category (default general)" },
5048
+ test_criteria: { type: "string", description: "How to validate or invalidate this hypothesis" }
5049
+ },
5050
+ required: ["statement"]
5051
+ }
5052
+ },
5053
+ {
5054
+ name: "trie_add_decision",
5055
+ description: "Record an architectural or coding decision. Use when the user makes, announces, or wants to log a decision about the codebase.",
5056
+ input_schema: {
5057
+ type: "object",
5058
+ properties: {
5059
+ decision: { type: "string", description: "What was decided" },
5060
+ context: { type: "string", description: "Why this decision was made \u2014 the situation or problem" },
5061
+ reasoning: { type: "string", description: "The reasoning behind the choice" },
5062
+ files: { type: "array", items: { type: "string" }, description: "Files affected by this decision" },
5063
+ tags: { type: "array", items: { type: "string" }, description: "Tags for categorization" }
5064
+ },
5065
+ required: ["decision", "context"]
5066
+ }
5026
5067
  }
5027
5068
  ];
5028
5069
  async function executeTool(name, input) {
@@ -5068,6 +5109,94 @@ async function executeTool(name, input) {
5068
5109
  const result = await handleCheckpointTool(input);
5069
5110
  return result;
5070
5111
  }
5112
+ case "trie_add_goal": {
5113
+ const desc = String(input.description || "").trim();
5114
+ if (!desc) return "Goal description is required.";
5115
+ const category = input.category || "general";
5116
+ const agentState = getGuardianState(directory);
5117
+ await agentState.load();
5118
+ const goal = {
5119
+ id: `goal-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
5120
+ description: desc,
5121
+ type: "custom",
5122
+ metric: "progress",
5123
+ target: 100,
5124
+ currentValue: 0,
5125
+ startValue: 0,
5126
+ status: "active",
5127
+ autoGenerated: false,
5128
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5129
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
5130
+ deadline: new Date(Date.now() + 14 * 864e5).toISOString(),
5131
+ category
5132
+ };
5133
+ await agentState.addGoal(goal);
5134
+ return `Goal created: "${desc}" [${category}]`;
5135
+ }
5136
+ case "trie_add_hypothesis": {
5137
+ const stmt = String(input.statement || "").trim();
5138
+ if (!stmt) return "Hypothesis statement is required.";
5139
+ const category = input.category || "general";
5140
+ const agentState = getGuardianState(directory);
5141
+ await agentState.load();
5142
+ const hypothesis = {
5143
+ id: `hyp-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
5144
+ statement: stmt,
5145
+ confidence: 0.5,
5146
+ status: "proposed",
5147
+ evidence: [],
5148
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5149
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
5150
+ testCriteria: String(input.test_criteria || "Collect evidence from scans"),
5151
+ category
5152
+ };
5153
+ await agentState.addHypothesis(hypothesis);
5154
+ return `Hypothesis created: "${stmt}" [${category}]`;
5155
+ }
5156
+ case "trie_add_decision": {
5157
+ const dec = String(input.decision || "").trim();
5158
+ const ctx = String(input.context || "").trim();
5159
+ if (!dec) return "Decision text is required.";
5160
+ if (!ctx) return "Decision context is required.";
5161
+ const now = (/* @__PURE__ */ new Date()).toISOString();
5162
+ const id = `dec-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
5163
+ const hash = createHash("sha256").update(`${dec}|${ctx}|${now}`).digest("hex").slice(0, 16);
5164
+ const files = Array.isArray(input.files) ? input.files.map(String) : [];
5165
+ const tags = Array.isArray(input.tags) ? input.tags.map(String) : [];
5166
+ const reasoningStr = input.reasoning ? String(input.reasoning) : null;
5167
+ const decisionObj = {
5168
+ id,
5169
+ decision: dec,
5170
+ context: ctx,
5171
+ when: now,
5172
+ who: "user",
5173
+ files,
5174
+ tags,
5175
+ status: "active",
5176
+ hash,
5177
+ ...reasoningStr ? { reasoning: reasoningStr } : {}
5178
+ };
5179
+ const storage = new TieredStorage(directory);
5180
+ await storage.storeSignal({
5181
+ decisions: [decisionObj],
5182
+ facts: [],
5183
+ blockers: [],
5184
+ questions: [],
5185
+ metadata: {
5186
+ extractedAt: now,
5187
+ sourceType: "conversation"
5188
+ }
5189
+ });
5190
+ const graph = new ContextGraph(directory);
5191
+ await graph.addNode("decision", {
5192
+ context: ctx,
5193
+ decision: dec,
5194
+ reasoning: reasoningStr,
5195
+ outcome: "unknown",
5196
+ timestamp: now
5197
+ });
5198
+ return `Decision recorded [${hash}]: "${dec}"`;
5199
+ }
5071
5200
  default:
5072
5201
  return `Unknown tool: ${name}`;
5073
5202
  }
@@ -5576,4 +5705,4 @@ export {
5576
5705
  handleCheckpointTool,
5577
5706
  InteractiveDashboard
5578
5707
  };
5579
- //# sourceMappingURL=chunk-HGEKZ2VS.js.map
5708
+ //# sourceMappingURL=chunk-WBAWHEYX.js.map