@triedotdev/mcp 1.0.143 → 1.0.144
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
|
@@ -374,9 +374,15 @@ Links PRs to changed files and to Linear tickets mentioned in PR descriptions. R
|
|
|
374
374
|
# Via MCP
|
|
375
375
|
trie_cloud_fix action:configure apiKey:"key-..."
|
|
376
376
|
trie_cloud_fix action:dispatch issueIds:["issue-1", "issue-2"]
|
|
377
|
+
|
|
378
|
+
# Force cloud dispatch (bypass triage when user explicitly wants cloud)
|
|
379
|
+
trie_cloud_fix action:dispatch forceCloud:true
|
|
380
|
+
|
|
381
|
+
# Ad-hoc dispatch (no scan issues — e.g. from trie_propose_fix)
|
|
382
|
+
trie_cloud_fix action:dispatch file:"src/storage/tiered-storage.ts" issue:"Concurrent file writes corrupt ledger" fix:"Add file locking and atomic writes"
|
|
377
383
|
```
|
|
378
384
|
|
|
379
|
-
The cloud agent runs in an isolated VM, applies the fix, runs tests, captures screenshots, and opens a PR. Requires `CURSOR_API_KEY`. Use `trie_fix action:route` first to see which issues qualify.
|
|
385
|
+
The cloud agent runs in an isolated VM, applies the fix, runs tests, captures screenshots, and opens a PR. Requires `CURSOR_API_KEY`. Use `trie_fix action:route` first to see which issues qualify. Add `forceCloud:true` to bypass triage when you explicitly want cloud.
|
|
380
386
|
|
|
381
387
|
### Fix Triage System
|
|
382
388
|
|
|
@@ -6381,33 +6381,61 @@ var TrieCloudFixTool = class {
|
|
|
6381
6381
|
const apiKey = await this.resolveApiKey(workDir);
|
|
6382
6382
|
if (!apiKey) return this.setupGuard();
|
|
6383
6383
|
const config = await loadAutonomyConfig(workDir);
|
|
6384
|
+
const forceCloud = args?.forceCloud === true;
|
|
6384
6385
|
console.log("About to resolve issues...");
|
|
6385
|
-
|
|
6386
|
-
|
|
6386
|
+
let allIssues = await this.resolveIssues(args?.issueIds);
|
|
6387
|
+
if (allIssues.length === 0 && args?.file && args?.issue && args?.fix) {
|
|
6388
|
+
const adHocId = `ad-hoc-${Date.now()}`;
|
|
6389
|
+
allIssues = [{
|
|
6390
|
+
id: adHocId,
|
|
6391
|
+
severity: args.severity ?? "critical",
|
|
6392
|
+
effort: args.effort ?? "hard",
|
|
6393
|
+
issue: args.issue,
|
|
6394
|
+
fix: args.fix,
|
|
6395
|
+
file: args.file,
|
|
6396
|
+
line: args.line ?? 1,
|
|
6397
|
+
confidence: 0.9,
|
|
6398
|
+
autoFixable: false,
|
|
6399
|
+
agent: "user",
|
|
6400
|
+
category: args.category
|
|
6401
|
+
}];
|
|
6402
|
+
console.log(`Created ad-hoc issue ${adHocId} for cloud dispatch`);
|
|
6403
|
+
}
|
|
6387
6404
|
if (allIssues.length === 0) {
|
|
6388
|
-
return this.text("No issues to dispatch. Run trie_scan to detect new issues, or check memory with trie_memory action:recent.");
|
|
6405
|
+
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.");
|
|
6389
6406
|
}
|
|
6390
6407
|
const { results, summary } = triageIssues(allIssues, void 0, void 0, config);
|
|
6391
6408
|
const lines = [];
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
lines.push(`
|
|
6409
|
+
const toDispatch = forceCloud ? allIssues : summary.cloudAgent;
|
|
6410
|
+
if (forceCloud) {
|
|
6411
|
+
lines.push("FIX ROUTING PLAN (forceCloud: bypassing triage)");
|
|
6412
|
+
lines.push("\u2500".repeat(68));
|
|
6413
|
+
for (const issue of allIssues) {
|
|
6414
|
+
lines.push(` ${shortPath2(issue.file)}:${issue.line ?? "?"} \u2192 cloud-agent (user requested)`);
|
|
6415
|
+
}
|
|
6416
|
+
lines.push("");
|
|
6417
|
+
} else {
|
|
6418
|
+
lines.push(formatTriageTable(results, allIssues));
|
|
6419
|
+
lines.push("");
|
|
6420
|
+
for (const issue of allIssues) {
|
|
6421
|
+
const r = results.get(issue.id);
|
|
6422
|
+
if (r && r.strategy !== "cloud-agent") {
|
|
6423
|
+
lines.push(`Skipped ${issue.id}: routed to ${r.strategy} (score ${r.score >= 0 ? "+" : ""}${r.score} \u2014 ${r.reasons.join(", ")})`);
|
|
6424
|
+
}
|
|
6425
|
+
}
|
|
6426
|
+
if (summary.cloudAgent.length === 0) {
|
|
6427
|
+
lines.push("\nNo issues qualify for cloud dispatch. Use trie_fix for local fixes.");
|
|
6428
|
+
lines.push("To force cloud dispatch: trie_cloud_fix action:dispatch forceCloud:true");
|
|
6429
|
+
return this.text(lines.join("\n"));
|
|
6398
6430
|
}
|
|
6399
|
-
}
|
|
6400
|
-
if (summary.cloudAgent.length === 0) {
|
|
6401
|
-
lines.push("\nNo issues qualify for cloud dispatch. Use trie_fix for local fixes.");
|
|
6402
|
-
return this.text(lines.join("\n"));
|
|
6403
6431
|
}
|
|
6404
6432
|
const client = new CursorCloudAgentClient(apiKey);
|
|
6405
6433
|
const repoUrl = this.getRepoUrl(workDir);
|
|
6406
6434
|
const branch = this.getBranch(workDir);
|
|
6407
6435
|
const store = await this.loadJobs(workDir);
|
|
6408
6436
|
lines.push("\nDISPATCHED");
|
|
6409
|
-
for (const issue of
|
|
6410
|
-
const triageResult = results.get(issue.id);
|
|
6437
|
+
for (const issue of toDispatch) {
|
|
6438
|
+
const triageResult = forceCloud ? { strategy: "cloud-agent", score: 6, confidence: 1, reasons: ["forceCloud: user requested cloud dispatch"], fallback: "local-ai" } : results.get(issue.id);
|
|
6411
6439
|
try {
|
|
6412
6440
|
const job = await client.dispatch(issue, triageResult, repoUrl, branch);
|
|
6413
6441
|
store.jobs[issue.id] = {
|
|
@@ -7879,7 +7907,7 @@ var CHAT_TOOLS = [
|
|
|
7879
7907
|
},
|
|
7880
7908
|
{
|
|
7881
7909
|
name: "trie_cloud_fix",
|
|
7882
|
-
description: 'Dispatch
|
|
7910
|
+
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.',
|
|
7883
7911
|
input_schema: {
|
|
7884
7912
|
type: "object",
|
|
7885
7913
|
properties: {
|
|
@@ -7897,6 +7925,17 @@ var CHAT_TOOLS = [
|
|
|
7897
7925
|
items: { type: "string" },
|
|
7898
7926
|
description: "Issue IDs to dispatch (for action:dispatch). Omit to dispatch all cloud-eligible issues."
|
|
7899
7927
|
},
|
|
7928
|
+
forceCloud: {
|
|
7929
|
+
type: "boolean",
|
|
7930
|
+
description: "When true, bypass triage and dispatch ALL issues to cloud. Use when user explicitly requests cloud fix."
|
|
7931
|
+
},
|
|
7932
|
+
file: {
|
|
7933
|
+
type: "string",
|
|
7934
|
+
description: "For ad-hoc dispatch: file path (use with issue and fix when no scan issues)"
|
|
7935
|
+
},
|
|
7936
|
+
issue: { type: "string", description: "For ad-hoc dispatch: issue description" },
|
|
7937
|
+
fix: { type: "string", description: "For ad-hoc dispatch: suggested fix" },
|
|
7938
|
+
line: { type: "number", description: "For ad-hoc dispatch: line number" },
|
|
7900
7939
|
jobId: {
|
|
7901
7940
|
type: "string",
|
|
7902
7941
|
description: "Job ID for action:artifacts or action:cancel"
|
|
@@ -8268,6 +8307,13 @@ ${truncated}`;
|
|
|
8268
8307
|
if (input.apiKey) cloudFixArgs.apiKey = String(input.apiKey);
|
|
8269
8308
|
if (Array.isArray(input.issueIds)) cloudFixArgs.issueIds = input.issueIds;
|
|
8270
8309
|
if (input.jobId) cloudFixArgs.jobId = String(input.jobId);
|
|
8310
|
+
if (input.forceCloud === true) cloudFixArgs.forceCloud = true;
|
|
8311
|
+
if (input.file) cloudFixArgs.file = String(input.file);
|
|
8312
|
+
if (input.issue) cloudFixArgs.issue = String(input.issue);
|
|
8313
|
+
if (input.fix) cloudFixArgs.fix = String(input.fix);
|
|
8314
|
+
if (typeof input.line === "number") cloudFixArgs.line = input.line;
|
|
8315
|
+
if (input.severity) cloudFixArgs.severity = String(input.severity);
|
|
8316
|
+
if (input.effort) cloudFixArgs.effort = String(input.effort);
|
|
8271
8317
|
const result = await cloudFixTool.execute(cloudFixArgs);
|
|
8272
8318
|
return textFromResult(result);
|
|
8273
8319
|
}
|
|
@@ -8452,10 +8498,17 @@ async function buildContext(workDir, dashboardState) {
|
|
|
8452
8498
|
return parts.length > 0 ? parts.join("\n\n") : "No context data available yet.";
|
|
8453
8499
|
}
|
|
8454
8500
|
function chatHistoryToMessages(history) {
|
|
8455
|
-
return history.map((m) =>
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8501
|
+
return history.map((m) => {
|
|
8502
|
+
let content = m.content;
|
|
8503
|
+
const fixes = m.pendingFixes ?? (m.pendingFix ? [m.pendingFix] : []);
|
|
8504
|
+
if (fixes.length > 0) {
|
|
8505
|
+
const fixCtx = fixes.map((f) => `file: ${f.file}, goal: ${f.goal}, violation: ${f.violation}${f.suggestedFix ? `, suggestedFix: ${f.suggestedFix}` : ""}`).join("; ");
|
|
8506
|
+
content = content ? `${content}
|
|
8507
|
+
|
|
8508
|
+
[Proposed fix context: ${fixCtx}]` : `[Proposed fix context: ${fixCtx}]`;
|
|
8509
|
+
}
|
|
8510
|
+
return { role: m.role, content };
|
|
8511
|
+
});
|
|
8459
8512
|
}
|
|
8460
8513
|
var SYSTEM_PROMPT = `You are Trie, a code assistant embedded in a terminal TUI.
|
|
8461
8514
|
|
|
@@ -8508,11 +8561,12 @@ var SYSTEM_PROMPT = `You are Trie, a code assistant embedded in a terminal TUI.
|
|
|
8508
8561
|
5. AFTER the tool call completes, the system will ask for user confirmation - do NOT add your own confirmation message
|
|
8509
8562
|
6. When the user says "yes", "yes to all", or "no", the system handles spawning Claude Code automatically
|
|
8510
8563
|
|
|
8511
|
-
**When user asks to
|
|
8512
|
-
-
|
|
8513
|
-
- If
|
|
8564
|
+
**When user asks to dispatch or fix with Cursor Cloud agent:**
|
|
8565
|
+
- Default: Call trie_cloud_fix action:dispatch \u2014 triage runs and routes issues as usual.
|
|
8566
|
+
- 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.
|
|
8567
|
+
- 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.
|
|
8568
|
+
- If the tool returns "Cloud Agent dispatch requires a Cursor API key", tell the user to configure it.
|
|
8514
8569
|
- For status: trie_cloud_fix action:status
|
|
8515
|
-
- The key must be in Config (API Keys \u2192 Cursor) or set as CURSOR_API_KEY env var
|
|
8516
8570
|
|
|
8517
8571
|
Examples:
|
|
8518
8572
|
- User: "do we have emojis?" \u2192 Check nudges first. If none or unclear: Call trie_scan_for_goal_violations to scan the codebase.
|
|
@@ -8520,7 +8574,8 @@ Examples:
|
|
|
8520
8574
|
- User: "fix the emoji violations" \u2192 Find ALL emoji violations in nudges, call trie_propose_fixes_batch ONCE with all fixes, then STOP
|
|
8521
8575
|
- User responds "yes to all" after proposal \u2192 Just say "Spawning Claude Code to fix all files..." The system handles it.
|
|
8522
8576
|
- 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.
|
|
8523
|
-
- User: "
|
|
8577
|
+
- User: "fix it with cloud agent" (explicit) \u2192 Call trie_cloud_fix action:dispatch forceCloud:true \u2014 honor their choice, don't suggest local.
|
|
8578
|
+
- User: "dispatch to cloud" (generic) \u2192 Call trie_cloud_fix action:dispatch \u2014 triage as usual.
|
|
8524
8579
|
|
|
8525
8580
|
Answer concisely. Reference specific files, decisions, and patterns when relevant.`;
|
|
8526
8581
|
function ChatView() {
|
|
@@ -9603,4 +9658,4 @@ export {
|
|
|
9603
9658
|
GitHubBranchesTool,
|
|
9604
9659
|
InteractiveDashboard
|
|
9605
9660
|
};
|
|
9606
|
-
//# sourceMappingURL=chunk-
|
|
9661
|
+
//# sourceMappingURL=chunk-5FQTNPBP.js.map
|