@triedotdev/mcp 1.0.144 → 1.0.145
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.
|
@@ -5520,7 +5520,7 @@ import { join as join2 } from "path";
|
|
|
5520
5520
|
import { execSync } from "child_process";
|
|
5521
5521
|
|
|
5522
5522
|
// src/integrations/cursor-cloud-agent.ts
|
|
5523
|
-
var BASE_URL = "https://api.cursor.com/
|
|
5523
|
+
var BASE_URL = "https://api.cursor.com/v0";
|
|
5524
5524
|
var CursorCloudAgentClient = class {
|
|
5525
5525
|
apiKey;
|
|
5526
5526
|
constructor(apiKey) {
|
|
@@ -5528,13 +5528,16 @@ var CursorCloudAgentClient = class {
|
|
|
5528
5528
|
}
|
|
5529
5529
|
/**
|
|
5530
5530
|
* Dispatch an issue to a cloud agent for fixing.
|
|
5531
|
+
* Uses Cursor Background Agent API: POST /agents
|
|
5531
5532
|
*/
|
|
5532
5533
|
async dispatch(issue, triageResult, repoUrl, branch) {
|
|
5533
|
-
const
|
|
5534
|
+
const promptText = this.buildPrompt(issue, triageResult);
|
|
5534
5535
|
const body = {
|
|
5535
|
-
prompt,
|
|
5536
|
-
|
|
5537
|
-
|
|
5536
|
+
prompt: { text: promptText },
|
|
5537
|
+
source: {
|
|
5538
|
+
repository: repoUrl,
|
|
5539
|
+
ref: branch
|
|
5540
|
+
},
|
|
5538
5541
|
metadata: {
|
|
5539
5542
|
issueId: issue.id,
|
|
5540
5543
|
file: issue.file,
|
|
@@ -5543,19 +5546,20 @@ var CursorCloudAgentClient = class {
|
|
|
5543
5546
|
agent: issue.agent
|
|
5544
5547
|
}
|
|
5545
5548
|
};
|
|
5546
|
-
const res = await this.request("POST", "/agents
|
|
5549
|
+
const res = await this.request("POST", "/agents", body);
|
|
5547
5550
|
return {
|
|
5548
5551
|
jobId: res.id ?? res.taskId ?? res.jobId,
|
|
5549
5552
|
status: "dispatched",
|
|
5550
5553
|
artifactUrls: [],
|
|
5551
|
-
dispatchedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
5554
|
+
dispatchedAt: res.createdAt ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
5552
5555
|
};
|
|
5553
5556
|
}
|
|
5554
5557
|
/**
|
|
5555
5558
|
* Poll job status.
|
|
5559
|
+
* Uses Cursor Background Agent API: GET /agents/:id
|
|
5556
5560
|
*/
|
|
5557
5561
|
async poll(jobId) {
|
|
5558
|
-
const res = await this.request("GET", `/agents
|
|
5562
|
+
const res = await this.request("GET", `/agents/${jobId}`);
|
|
5559
5563
|
const status = mapStatus(res.status);
|
|
5560
5564
|
const prUrl = extractPrUrl(res);
|
|
5561
5565
|
const artifactUrls = this.extractArtifacts(res);
|
|
@@ -5565,14 +5569,15 @@ var CursorCloudAgentClient = class {
|
|
|
5565
5569
|
* Get artifact URLs for a completed job.
|
|
5566
5570
|
*/
|
|
5567
5571
|
async getArtifacts(jobId) {
|
|
5568
|
-
const res = await this.request("GET", `/agents
|
|
5572
|
+
const res = await this.request("GET", `/agents/${jobId}`);
|
|
5569
5573
|
return this.extractArtifacts(res);
|
|
5570
5574
|
}
|
|
5571
5575
|
/**
|
|
5572
5576
|
* Cancel a running job.
|
|
5577
|
+
* Uses Cursor Background Agent API: DELETE /agents/:id
|
|
5573
5578
|
*/
|
|
5574
5579
|
async cancelJob(jobId) {
|
|
5575
|
-
await this.request("DELETE", `/agents
|
|
5580
|
+
await this.request("DELETE", `/agents/${jobId}`);
|
|
5576
5581
|
}
|
|
5577
5582
|
// --------------------------------------------------------------------------
|
|
5578
5583
|
// Internal
|
|
@@ -5616,7 +5621,10 @@ var CursorCloudAgentClient = class {
|
|
|
5616
5621
|
);
|
|
5617
5622
|
}
|
|
5618
5623
|
if (res.status === 404) {
|
|
5619
|
-
|
|
5624
|
+
const isLaunch = path2 === "/agents" && method === "POST";
|
|
5625
|
+
throw new Error(
|
|
5626
|
+
isLaunch ? "Cursor Background Agent API endpoint not found. Ensure your Cursor API key has Background Agent access (cursor.com/dashboard \u2192 Integrations)." : `Job not found: ${path2}`
|
|
5627
|
+
);
|
|
5620
5628
|
}
|
|
5621
5629
|
if (res.status >= 500) {
|
|
5622
5630
|
throw new Error(
|
|
@@ -9658,4 +9666,4 @@ export {
|
|
|
9658
9666
|
GitHubBranchesTool,
|
|
9659
9667
|
InteractiveDashboard
|
|
9660
9668
|
};
|
|
9661
|
-
//# sourceMappingURL=chunk-
|
|
9669
|
+
//# sourceMappingURL=chunk-JTGKHPDR.js.map
|