@triedotdev/mcp 1.0.146 → 1.0.148

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Trie: Trainable AI agent with a cryptographic governance ledger and portable context for AI-generated codebases.
1
+ # Trie: A trainable AI agent with cryptographic governance and portable context
2
2
 
3
3
 
4
4
  **The ledger that keeps your work compliant when agents and humans ship together.**
@@ -6384,9 +6384,8 @@ var TrieCloudFixTool = class {
6384
6384
  if (!apiKey) return this.setupGuard();
6385
6385
  const config = await loadAutonomyConfig(workDir);
6386
6386
  const forceCloud = args?.forceCloud === true;
6387
- console.log("About to resolve issues...");
6388
- let allIssues = await this.resolveIssues(args?.issueIds);
6389
- if (allIssues.length === 0 && args?.file && args?.issue && args?.fix) {
6387
+ let allIssues = [];
6388
+ if (args?.file && args?.issue && args?.fix) {
6390
6389
  const adHocId = `ad-hoc-${Date.now()}`;
6391
6390
  allIssues = [{
6392
6391
  id: adHocId,
@@ -6401,15 +6400,29 @@ var TrieCloudFixTool = class {
6401
6400
  agent: "user",
6402
6401
  category: args.category
6403
6402
  }];
6404
- console.log(`Created ad-hoc issue ${adHocId} for cloud dispatch`);
6403
+ console.log(`Created ad-hoc issue ${adHocId} for cloud dispatch (single incident mode)`);
6404
+ } else {
6405
+ console.log("About to resolve issues from memory...");
6406
+ allIssues = await this.resolveIssues(args?.issueIds);
6405
6407
  }
6406
6408
  if (allIssues.length === 0) {
6407
6409
  return this.text("No issues to dispatch. Run trie_scan to detect new issues, or check memory with trie_memory action:recent. For ad-hoc fixes, pass file, issue, and fix.");
6408
6410
  }
6411
+ const isAdHocMode = args?.file && args?.issue && args?.fix;
6412
+ if (isAdHocMode) {
6413
+ console.log(`Ad-hoc mode: dispatching single issue (${allIssues[0].file})`);
6414
+ } else {
6415
+ console.log(`Memory mode: loaded ${allIssues.length} issue(s) from memory/scan`);
6416
+ }
6409
6417
  const { results, summary } = triageIssues(allIssues, void 0, void 0, config);
6410
6418
  const lines = [];
6411
6419
  const toDispatch = forceCloud ? allIssues : summary.cloudAgent;
6412
- if (forceCloud) {
6420
+ if (isAdHocMode) {
6421
+ lines.push("FIX ROUTING PLAN (ad-hoc single incident mode)");
6422
+ lines.push("\u2500".repeat(68));
6423
+ lines.push(` ${shortPath2(allIssues[0].file)}:${allIssues[0].line ?? "?"} \u2192 cloud-agent (single incident)`);
6424
+ lines.push("");
6425
+ } else if (forceCloud) {
6413
6426
  lines.push("FIX ROUTING PLAN (forceCloud: bypassing triage)");
6414
6427
  lines.push("\u2500".repeat(68));
6415
6428
  for (const issue of allIssues) {
@@ -6456,7 +6469,11 @@ var TrieCloudFixTool = class {
6456
6469
  }
6457
6470
  }
6458
6471
  await this.saveJobs(workDir, store);
6472
+ const dispatchedCount = toDispatch.length;
6473
+ const jobWord = dispatchedCount === 1 ? "job" : "jobs";
6474
+ const modeDesc = isAdHocMode ? "(single incident mode)" : forceCloud ? "(forceCloud mode)" : "(triaged)";
6459
6475
  lines.push("");
6476
+ lines.push(`\u2713 ${dispatchedCount} cloud agent ${jobWord} dispatched ${modeDesc}`);
6460
6477
  lines.push("Cloud agents are running in isolated VMs. Check back with:");
6461
6478
  lines.push("trie_cloud_fix action:status");
6462
6479
  return this.text(lines.join("\n"));
@@ -6891,6 +6908,28 @@ function formatNudges(nudges) {
6891
6908
  }
6892
6909
  return out;
6893
6910
  }
6911
+ function formatIncidents(incidents) {
6912
+ if (incidents.length === 0) return "No incidents found.";
6913
+ let out = `Found ${incidents.length} incident(s):
6914
+
6915
+ `;
6916
+ for (const inc of incidents) {
6917
+ const emoji = inc.severity === "critical" ? "\u{1F534}" : inc.severity === "major" ? "\u{1F7E0}" : "\u{1F7E1}";
6918
+ const status = inc.resolved ? "\u2705 RESOLVED" : "\u26A0\uFE0F ACTIVE";
6919
+ out += `${emoji} [${inc.severity.toUpperCase()}] ${status}
6920
+ `;
6921
+ out += ` ${inc.description}
6922
+ `;
6923
+ if (inc.affectedUsers != null) {
6924
+ out += ` Affected Users: ${inc.affectedUsers}
6925
+ `;
6926
+ }
6927
+ out += ` Reported: ${new Date(inc.timestamp).toLocaleString()}
6928
+ `;
6929
+ out += "\n";
6930
+ }
6931
+ return out;
6932
+ }
6894
6933
  var TrieQueryContextTool = class {
6895
6934
  async execute(input) {
6896
6935
  const workDir = input.directory || getWorkingDirectory(void 0, true);
@@ -6906,6 +6945,7 @@ var TrieQueryContextTool = class {
6906
6945
  const includeNudges = !input.type || input.type === "nudges" || input.type === "all";
6907
6946
  const includeGovernance = !input.type || input.type === "governance" || input.type === "decisions" || input.type === "all";
6908
6947
  const includeBlockers = !input.type || input.type === "blockers" || input.type === "all";
6948
+ const includeIncidents = !input.type || input.type === "incidents" || input.type === "all";
6909
6949
  if (includeGoals) {
6910
6950
  try {
6911
6951
  const projectState = getProjectState(workDir);
@@ -7016,6 +7056,42 @@ var TrieQueryContextTool = class {
7016
7056
  output += new TrieGetBlockersTool().formatBlockers(matches);
7017
7057
  }
7018
7058
  }
7059
+ if (includeIncidents) {
7060
+ try {
7061
+ const { ContextGraph: ContextGraph2 } = await import("./graph-J4OGTYCO.js");
7062
+ const graph = new ContextGraph2(workDir);
7063
+ const allNodes = await graph.listNodes();
7064
+ const incidentNodes = allNodes.filter((n) => n.type === "incident");
7065
+ const matches = incidentNodes.filter((n) => {
7066
+ const data = n.data;
7067
+ if (keywords.length > 0 && !keywords.some((kw) => kw === "incident" || kw === "incidents" || kw === "all")) {
7068
+ return keywords.some(
7069
+ (kw) => data.description.toLowerCase().includes(kw) || data.severity.toLowerCase().includes(kw)
7070
+ );
7071
+ }
7072
+ return true;
7073
+ }).slice(0, limit);
7074
+ if (matches.length > 0) {
7075
+ output += `\u{1F6A8} INCIDENTS (${matches.length}):
7076
+ `;
7077
+ output += formatIncidents(matches.map((n) => {
7078
+ const data = n.data;
7079
+ return {
7080
+ description: data.description,
7081
+ severity: data.severity,
7082
+ timestamp: data.timestamp,
7083
+ resolved: data.resolved,
7084
+ affectedUsers: data.affectedUsers
7085
+ };
7086
+ }));
7087
+ output += "\n";
7088
+ }
7089
+ } catch (e) {
7090
+ output += `(Incidents unavailable: ${e instanceof Error ? e.message : "unknown"})
7091
+
7092
+ `;
7093
+ }
7094
+ }
7019
7095
  return {
7020
7096
  content: [{
7021
7097
  type: "text",
@@ -7719,12 +7795,12 @@ var CHAT_TOOLS = [
7719
7795
  },
7720
7796
  {
7721
7797
  name: "trie_query_context",
7722
- description: 'Natural-language search across ALL Trie context: goals, hypotheses, nudges (goal violations), governance, blockers, facts, and questions. Use for "what are my goals", "show hypotheses", "any nudges", "recent governance", etc.',
7798
+ description: 'Natural-language search across ALL Trie context: goals, hypotheses, nudges (goal violations), incidents, governance, blockers, facts, and questions. Use for "what are my goals", "show hypotheses", "any nudges", "show incidents", "recent governance", etc.',
7723
7799
  input_schema: {
7724
7800
  type: "object",
7725
7801
  properties: {
7726
- query: { type: "string", description: 'Natural language search query (e.g. "goals", "hypotheses", "nudges", "governance")' },
7727
- type: { type: "string", enum: ["goals", "hypotheses", "nudges", "governance", "decisions", "blockers", "facts", "questions", "all"], description: "Narrow to a specific category (default all)" },
7802
+ query: { type: "string", description: 'Natural language search query (e.g. "goals", "hypotheses", "nudges", "incidents", "governance")' },
7803
+ type: { type: "string", enum: ["goals", "hypotheses", "nudges", "incidents", "governance", "decisions", "blockers", "facts", "questions", "all"], description: "Narrow to a specific category (default all)" },
7728
7804
  limit: { type: "number", description: "Max results (default 10)" }
7729
7805
  },
7730
7806
  required: ["query"]
@@ -7909,7 +7985,7 @@ var CHAT_TOOLS = [
7909
7985
  },
7910
7986
  {
7911
7987
  name: "trie_cloud_fix",
7912
- description: 'Dispatch to Cursor Cloud agents. Default: triage routes issues. When user explicitly says they want cloud (e.g. "fix with cloud agent") \u2014 pass forceCloud:true to honor their choice, do not reject. For ad-hoc (no scan issues): pass file, issue, fix from prior trie_propose_fix. Actions: configure, dispatch, status, artifacts, cancel.',
7988
+ description: 'Dispatch to Cursor Cloud agents. CRITICAL: Ad-hoc mode (file+issue+fix) dispatches ONLY that single issue, ignoring all other issues. Default mode (issueIds) dispatches specified issues from scan results. When user explicitly says they want cloud (e.g. "fix with cloud agent") \u2014 pass forceCloud:true to honor their choice. Actions: configure, dispatch, status, artifacts, cancel.',
7913
7989
  input_schema: {
7914
7990
  type: "object",
7915
7991
  properties: {
@@ -7925,18 +8001,18 @@ var CHAT_TOOLS = [
7925
8001
  issueIds: {
7926
8002
  type: "array",
7927
8003
  items: { type: "string" },
7928
- description: "Issue IDs to dispatch (for action:dispatch). Omit to dispatch all cloud-eligible issues."
8004
+ description: "Issue IDs to dispatch (for action:dispatch). Omit to dispatch all cloud-eligible issues. IGNORED if file+issue+fix are provided (ad-hoc mode)."
7929
8005
  },
7930
8006
  forceCloud: {
7931
8007
  type: "boolean",
7932
- description: "When true, bypass triage and dispatch ALL issues to cloud. Use when user explicitly requests cloud fix."
8008
+ description: "When true, bypass triage and dispatch ALL issues to cloud. Use when user explicitly requests cloud fix. In ad-hoc mode, this is implied."
7933
8009
  },
7934
8010
  file: {
7935
8011
  type: "string",
7936
- description: "For ad-hoc dispatch: file path (use with issue and fix when no scan issues)"
8012
+ description: "For ad-hoc single-incident dispatch: file path. When provided with issue+fix, ONLY this single issue is dispatched (memory issues are ignored)."
7937
8013
  },
7938
- issue: { type: "string", description: "For ad-hoc dispatch: issue description" },
7939
- fix: { type: "string", description: "For ad-hoc dispatch: suggested fix" },
8014
+ issue: { type: "string", description: "For ad-hoc dispatch: issue description (use with file and fix)" },
8015
+ fix: { type: "string", description: "For ad-hoc dispatch: suggested fix (use with file and issue)" },
7940
8016
  line: { type: "number", description: "For ad-hoc dispatch: line number" },
7941
8017
  jobId: {
7942
8018
  type: "string",
@@ -8566,6 +8642,7 @@ var SYSTEM_PROMPT = `You are Trie, a code assistant embedded in a terminal TUI.
8566
8642
  **When user asks to dispatch or fix with Cursor Cloud agent:**
8567
8643
  - Default: Call trie_cloud_fix action:dispatch \u2014 triage runs and routes issues as usual.
8568
8644
  - If user EXPLICITLY says they want cloud (e.g. "fix it with cloud agent", "I want cloud", "use cursor cloud"): add forceCloud:true so triage does not override their choice. Do NOT suggest local fix instead \u2014 honor their request.
8645
+ - CRITICAL: For single incident fixes from trie_tell, use ad-hoc mode (file, issue, fix) to dispatch ONLY that incident. Ad-hoc mode bypasses memory and dispatches only the single specified issue.
8569
8646
  - If there are no scan issues but the conversation has a recent trie_propose_fix: use ad-hoc dispatch with file, issue, fix from that context.
8570
8647
  - If the tool returns "Cloud Agent dispatch requires a Cursor API key", tell the user to configure it.
8571
8648
  - For status: trie_cloud_fix action:status
@@ -8578,6 +8655,7 @@ Examples:
8578
8655
  - User: "search for TODO comments" \u2192 If there's a goal about TODOs, use trie_scan_for_goal_violations. Otherwise explain no such goal exists.
8579
8656
  - User: "fix it with cloud agent" (explicit) \u2192 Call trie_cloud_fix action:dispatch forceCloud:true \u2014 honor their choice, don't suggest local.
8580
8657
  - User: "dispatch to cloud" (generic) \u2192 Call trie_cloud_fix action:dispatch \u2014 triage as usual.
8658
+ - User: "fix this incident with cloud agent [specific incident]" \u2192 Use ad-hoc mode: trie_cloud_fix action:dispatch file:"path" issue:"description" fix:"fix" \u2014 dispatches ONLY that incident.
8581
8659
 
8582
8660
  Answer concisely. Reference specific files, decisions, and patterns when relevant.`;
8583
8661
  function ChatView() {
@@ -9660,4 +9738,4 @@ export {
9660
9738
  GitHubBranchesTool,
9661
9739
  InteractiveDashboard
9662
9740
  };
9663
- //# sourceMappingURL=chunk-US4P265N.js.map
9741
+ //# sourceMappingURL=chunk-J7CEBSEB.js.map