@mgsoftwarebv/mg-dashboard-mcp 7.0.13 → 7.0.14
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/dist/index.js +328 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -683,10 +683,10 @@ var TRIGGER_TOOL_MODULE_MAP = {
|
|
|
683
683
|
"trigger-run": "ci_cd"
|
|
684
684
|
};
|
|
685
685
|
async function discoverInstance(projectSlug, conn, proxy, sshExec2) {
|
|
686
|
-
const
|
|
686
|
+
const sql25 = `SELECT re.\\"apiKey\\" FROM \\"RuntimeEnvironment\\" re JOIN \\"Project\\" p ON re.\\"projectId\\" = p.id WHERE p.slug='${projectSlug}' AND re.slug='prod' LIMIT 1`;
|
|
687
687
|
const cmd = [
|
|
688
688
|
`PORT=$(docker port "${WA_CONTAINER}" 3000/tcp 2>/dev/null | head -1 | sed 's/.*://')`,
|
|
689
|
-
`KEY=$(docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${
|
|
689
|
+
`KEY=$(docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql25}" 2>/dev/null | tr -d '[:space:]')`,
|
|
690
690
|
'echo "$PORT|$KEY"'
|
|
691
691
|
].join(" && ");
|
|
692
692
|
const result = await sshExec2(conn, cmd, proxy);
|
|
@@ -707,8 +707,8 @@ async function discoverInstance(projectSlug, conn, proxy, sshExec2) {
|
|
|
707
707
|
return { port, apiKey: apiKey2 };
|
|
708
708
|
}
|
|
709
709
|
async function fetchRunLogs(runId, conn, proxy, sshExec2) {
|
|
710
|
-
const
|
|
711
|
-
const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${
|
|
710
|
+
const sql25 = `SELECT level, message, \\"isError\\", \\"createdAt\\" FROM \\"TaskEvent\\" WHERE \\"runId\\" = '${runId}' AND level IN ('INFO','WARN','ERROR','DEBUG','LOG','TRACE') ORDER BY \\"startTime\\" ASC LIMIT 200`;
|
|
711
|
+
const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql25}" 2>/dev/null`;
|
|
712
712
|
const result = await sshExec2(conn, cmd, proxy);
|
|
713
713
|
const output = result.stdout.trim();
|
|
714
714
|
if (!output) return "";
|
|
@@ -790,8 +790,8 @@ async function handleTriggerTool(name, args2, deps) {
|
|
|
790
790
|
switch (name) {
|
|
791
791
|
// -----------------------------------------------------------------
|
|
792
792
|
case "trigger-list": {
|
|
793
|
-
const
|
|
794
|
-
const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${
|
|
793
|
+
const sql25 = 'SELECT slug, name FROM \\"Project\\" ORDER BY name';
|
|
794
|
+
const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql25}" 2>/dev/null`;
|
|
795
795
|
const result = await sshExec2(conn, cmd, proxy);
|
|
796
796
|
const output = result.stdout.trim();
|
|
797
797
|
if (!output) {
|
|
@@ -6188,6 +6188,145 @@ async function reconfigureQuickStages(profileId, releaseType, detectedApps) {
|
|
|
6188
6188
|
`);
|
|
6189
6189
|
}
|
|
6190
6190
|
}
|
|
6191
|
+
function normalizeRepoIdentifier(value) {
|
|
6192
|
+
if (!value) return null;
|
|
6193
|
+
let s = value.trim().toLowerCase();
|
|
6194
|
+
if (!s) return null;
|
|
6195
|
+
s = s.replace(/^ssh:\/\/git@github\.com\//, "");
|
|
6196
|
+
s = s.replace(/^git@github\.com:/, "");
|
|
6197
|
+
s = s.replace(/^https?:\/\/(www\.)?github\.com\//, "");
|
|
6198
|
+
s = s.replace(/^github\.com\//, "");
|
|
6199
|
+
s = s.replace(/\.git$/, "");
|
|
6200
|
+
s = s.replace(/[/]+$/, "");
|
|
6201
|
+
const parts = s.split("/").filter(Boolean);
|
|
6202
|
+
if (parts.length >= 2) {
|
|
6203
|
+
s = parts.slice(-2).join("/");
|
|
6204
|
+
}
|
|
6205
|
+
return s || null;
|
|
6206
|
+
}
|
|
6207
|
+
async function queueAgentRun(args2) {
|
|
6208
|
+
const db2 = getDb();
|
|
6209
|
+
const gitMode = args2.gitMode ?? "worktree";
|
|
6210
|
+
const model = args2.model ?? null;
|
|
6211
|
+
const metadata = args2.metadata ?? {};
|
|
6212
|
+
const conversationRows = await db2.execute(sql`
|
|
6213
|
+
INSERT INTO agent_conversation (
|
|
6214
|
+
user_id, host_id, workspace_id, runtime, source, title, status, model, metadata
|
|
6215
|
+
) VALUES (
|
|
6216
|
+
${args2.userId}, ${args2.workspace.host_id}, ${args2.workspace.id},
|
|
6217
|
+
'local', ${args2.source}, ${args2.title}, 'running', ${model},
|
|
6218
|
+
${JSON.stringify(metadata)}::jsonb
|
|
6219
|
+
)
|
|
6220
|
+
RETURNING id
|
|
6221
|
+
`);
|
|
6222
|
+
const conversationId = conversationRows[0]?.id;
|
|
6223
|
+
if (!conversationId) return null;
|
|
6224
|
+
const runRows = await db2.execute(sql`
|
|
6225
|
+
INSERT INTO agent_run (
|
|
6226
|
+
conversation_id, workspace_id, host_id, user_id, runtime, status,
|
|
6227
|
+
prompt, model, git_mode, source
|
|
6228
|
+
) VALUES (
|
|
6229
|
+
${conversationId}, ${args2.workspace.id}, ${args2.workspace.host_id},
|
|
6230
|
+
${args2.userId}, 'local', 'queued', ${args2.prompt}, ${model}, ${gitMode},
|
|
6231
|
+
${args2.source}
|
|
6232
|
+
)
|
|
6233
|
+
RETURNING id
|
|
6234
|
+
`);
|
|
6235
|
+
const runId = runRows[0]?.id;
|
|
6236
|
+
if (!runId) return null;
|
|
6237
|
+
const payload = {
|
|
6238
|
+
runId,
|
|
6239
|
+
conversationId,
|
|
6240
|
+
workspacePath: args2.workspace.path,
|
|
6241
|
+
prompt: args2.prompt,
|
|
6242
|
+
model,
|
|
6243
|
+
gitMode,
|
|
6244
|
+
sdkAgentId: null,
|
|
6245
|
+
contextReplay: null,
|
|
6246
|
+
...metadata
|
|
6247
|
+
};
|
|
6248
|
+
await db2.execute(sql`
|
|
6249
|
+
INSERT INTO agent_host_command (host_id, user_id, run_id, command_type, payload)
|
|
6250
|
+
VALUES (
|
|
6251
|
+
${args2.workspace.host_id}, ${args2.userId}, ${runId}, 'start_run',
|
|
6252
|
+
${JSON.stringify(payload)}::jsonb
|
|
6253
|
+
)
|
|
6254
|
+
`);
|
|
6255
|
+
return { conversationId, runId };
|
|
6256
|
+
}
|
|
6257
|
+
function toTarget(row) {
|
|
6258
|
+
return {
|
|
6259
|
+
workspaceId: row.workspace_id,
|
|
6260
|
+
hostId: row.host_id,
|
|
6261
|
+
hostName: row.host_name,
|
|
6262
|
+
hostOnline: row.host_online === true,
|
|
6263
|
+
ownerUserId: row.owner_user_id,
|
|
6264
|
+
ownerName: row.owner_name,
|
|
6265
|
+
ownerEmail: row.owner_email,
|
|
6266
|
+
path: row.path,
|
|
6267
|
+
name: row.name,
|
|
6268
|
+
gitRepository: row.git_repository,
|
|
6269
|
+
gitBranch: row.git_branch,
|
|
6270
|
+
defaultGitMode: row.default_git_mode === "in_place" ? "in_place" : "worktree",
|
|
6271
|
+
lastSyncedAt: row.last_synced_at
|
|
6272
|
+
};
|
|
6273
|
+
}
|
|
6274
|
+
async function listRemoteWorkspaces() {
|
|
6275
|
+
const rows = await getDb().execute(sql`
|
|
6276
|
+
SELECT
|
|
6277
|
+
w.id AS workspace_id,
|
|
6278
|
+
w.host_id,
|
|
6279
|
+
h.name AS host_name,
|
|
6280
|
+
(h.last_seen_at IS NOT NULL AND h.last_seen_at > now() - interval '45 seconds')
|
|
6281
|
+
AS host_online,
|
|
6282
|
+
w.user_id AS owner_user_id,
|
|
6283
|
+
u.full_name AS owner_name,
|
|
6284
|
+
u.email AS owner_email,
|
|
6285
|
+
w.path, w.name, w.git_repository, w.git_branch,
|
|
6286
|
+
w.default_git_mode, w.last_synced_at
|
|
6287
|
+
FROM agent_workspace w
|
|
6288
|
+
INNER JOIN agent_host h ON h.id = w.host_id
|
|
6289
|
+
LEFT JOIN "user" u ON u.id = w.user_id
|
|
6290
|
+
WHERE w.status = 'active' AND h.revoked_at IS NULL
|
|
6291
|
+
ORDER BY host_online DESC, w.last_synced_at DESC NULLS LAST
|
|
6292
|
+
`);
|
|
6293
|
+
return Array.from(rows).map(toTarget);
|
|
6294
|
+
}
|
|
6295
|
+
function matchesWho(target, who) {
|
|
6296
|
+
const needle = who.trim().toLowerCase();
|
|
6297
|
+
if (!needle) return true;
|
|
6298
|
+
const name = (target.ownerName ?? "").toLowerCase();
|
|
6299
|
+
const email = (target.ownerEmail ?? "").toLowerCase();
|
|
6300
|
+
return name.includes(needle) || email.includes(needle);
|
|
6301
|
+
}
|
|
6302
|
+
function matchesProject(target, project) {
|
|
6303
|
+
const repoTarget = normalizeRepoIdentifier(project);
|
|
6304
|
+
if (repoTarget && normalizeRepoIdentifier(target.gitRepository) === repoTarget) {
|
|
6305
|
+
return true;
|
|
6306
|
+
}
|
|
6307
|
+
const needle = project.trim().toLowerCase();
|
|
6308
|
+
if (!needle) return false;
|
|
6309
|
+
return target.name.toLowerCase().includes(needle) || target.path.toLowerCase().includes(needle);
|
|
6310
|
+
}
|
|
6311
|
+
async function resolveRemoteTarget(args2) {
|
|
6312
|
+
const online = (await listRemoteWorkspaces()).filter((t) => t.hostOnline);
|
|
6313
|
+
let matches = online.filter((t) => matchesProject(t, args2.project));
|
|
6314
|
+
if (args2.who) {
|
|
6315
|
+
matches = matches.filter((t) => matchesWho(t, args2.who));
|
|
6316
|
+
}
|
|
6317
|
+
if (matches.length === 0) {
|
|
6318
|
+
return { ok: false, reason: "none", candidates: online };
|
|
6319
|
+
}
|
|
6320
|
+
if (matches.length === 1) {
|
|
6321
|
+
return { ok: true, target: matches[0] };
|
|
6322
|
+
}
|
|
6323
|
+
if (args2.branch) {
|
|
6324
|
+
const onBranch = matches.filter((t) => t.gitBranch === args2.branch);
|
|
6325
|
+
if (onBranch.length === 1) return { ok: true, target: onBranch[0] };
|
|
6326
|
+
if (onBranch.length > 1) matches = onBranch;
|
|
6327
|
+
}
|
|
6328
|
+
return { ok: false, reason: "ambiguous", candidates: matches };
|
|
6329
|
+
}
|
|
6191
6330
|
var args = process.argv.slice(2);
|
|
6192
6331
|
function getArg2(name) {
|
|
6193
6332
|
return args.find((a) => a.startsWith(`--${name}=`))?.split("=").slice(1).join("=");
|
|
@@ -6370,7 +6509,9 @@ var MODULE_KEYS = [
|
|
|
6370
6509
|
"wiki",
|
|
6371
6510
|
"ci_cd",
|
|
6372
6511
|
"domains",
|
|
6373
|
-
"settings"
|
|
6512
|
+
"settings",
|
|
6513
|
+
"cursor_remote",
|
|
6514
|
+
"code_battle"
|
|
6374
6515
|
];
|
|
6375
6516
|
var FULL_PERMISSIONS = {
|
|
6376
6517
|
modules: Object.fromEntries(
|
|
@@ -6433,6 +6574,8 @@ var TOOL_MODULE_MAP = {
|
|
|
6433
6574
|
"domain-list": "domains",
|
|
6434
6575
|
"dns-list": "domains",
|
|
6435
6576
|
"dns-record": "domains",
|
|
6577
|
+
"cursor-remote-list": "cursor_remote",
|
|
6578
|
+
"cursor-remote-run": "cursor_remote",
|
|
6436
6579
|
...TRIGGER_TOOL_MODULE_MAP
|
|
6437
6580
|
};
|
|
6438
6581
|
var authContext = null;
|
|
@@ -8991,11 +9134,11 @@ CREATE TABLE IF NOT EXISTS _mcp_migrations (
|
|
|
8991
9134
|
applied_by TEXT
|
|
8992
9135
|
);
|
|
8993
9136
|
`.trim();
|
|
8994
|
-
function normaliseMigrationSql(
|
|
8995
|
-
return
|
|
9137
|
+
function normaliseMigrationSql(sql25) {
|
|
9138
|
+
return sql25.replace(/\r\n/g, "\n").trim() + "\n";
|
|
8996
9139
|
}
|
|
8997
|
-
function migrationSha256(
|
|
8998
|
-
return createHash("sha256").update(normaliseMigrationSql(
|
|
9140
|
+
function migrationSha256(sql25) {
|
|
9141
|
+
return createHash("sha256").update(normaliseMigrationSql(sql25), "utf8").digest("hex");
|
|
8999
9142
|
}
|
|
9000
9143
|
function dollarQuoteTag(value) {
|
|
9001
9144
|
let tag = "_mcp";
|
|
@@ -10200,6 +10343,55 @@ var TOOLS = [
|
|
|
10200
10343
|
}
|
|
10201
10344
|
}
|
|
10202
10345
|
},
|
|
10346
|
+
// ----- Cursor Remote (Agent Control) -----
|
|
10347
|
+
{
|
|
10348
|
+
name: "cursor-remote-list",
|
|
10349
|
+
description: "List the paired developer machines (agent hosts) and their workspaces that a headless Cursor agent run can be started on, across the whole team. Each workspace shows its owner, git repository + branch, online status and default git mode. Call this FIRST to discover valid `who` (owner) and `project` (repo/workspace) values before calling cursor-remote-run. Only online hosts can run.",
|
|
10350
|
+
inputSchema: {
|
|
10351
|
+
type: "object",
|
|
10352
|
+
properties: {
|
|
10353
|
+
onlineOnly: {
|
|
10354
|
+
type: "boolean",
|
|
10355
|
+
description: "Only return workspaces whose host is currently online (default false \u2014 shows all active pairings with an online flag)."
|
|
10356
|
+
}
|
|
10357
|
+
}
|
|
10358
|
+
}
|
|
10359
|
+
},
|
|
10360
|
+
{
|
|
10361
|
+
name: "cursor-remote-run",
|
|
10362
|
+
description: "Start a headless Cursor agent run on a teammate's machine to make a code change. Resolve `who` (workspace owner name/email) + `project` (repo 'org/repo', URL, or workspace name) to a single online workspace, then queue the run via the agent-host daemon (@cursor/sdk). Use this when an AI (e.g. a ticket assistant) should hand a self-contained, well-scoped fix prompt to a developer's PC. Default git mode is 'worktree': the change runs in an isolated worktree and ends in a DIFF APPROVAL the owner reviews on the dashboard/mobile \u2014 nothing lands on their branch automatically. Returns the conversationId + runId and a dashboard link to follow progress. Call cursor-remote-list first if unsure about who/project.",
|
|
10363
|
+
inputSchema: {
|
|
10364
|
+
type: "object",
|
|
10365
|
+
properties: {
|
|
10366
|
+
who: {
|
|
10367
|
+
type: "string",
|
|
10368
|
+
description: "Workspace owner to target, matched case-insensitively against full name or email (e.g. 'Sidney'). Optional, but recommended when several people have the same repo paired."
|
|
10369
|
+
},
|
|
10370
|
+
project: {
|
|
10371
|
+
type: "string",
|
|
10372
|
+
description: "The repository ('MGSoftwareBV/mg-dashboard', a GitHub URL), or the workspace name/path. Matched against the paired workspaces."
|
|
10373
|
+
},
|
|
10374
|
+
prompt: {
|
|
10375
|
+
type: "string",
|
|
10376
|
+
description: "The full, self-contained instruction for the agent. Write it as an optimized, scoped task: what to change, relevant files/areas, and acceptance criteria. The agent has no other context."
|
|
10377
|
+
},
|
|
10378
|
+
model: {
|
|
10379
|
+
type: "string",
|
|
10380
|
+
description: "Optional Cursor model slug to run with (e.g. a Sonnet-tier model). Omit to use the host default."
|
|
10381
|
+
},
|
|
10382
|
+
gitMode: {
|
|
10383
|
+
type: "string",
|
|
10384
|
+
enum: ["worktree", "in_place"],
|
|
10385
|
+
description: "'worktree' (default, recommended): isolated worktree + diff approval. 'in_place': applies directly in the working tree (no isolation) \u2014 use only when explicitly desired."
|
|
10386
|
+
},
|
|
10387
|
+
branch: {
|
|
10388
|
+
type: "string",
|
|
10389
|
+
description: "Optional: prefer a workspace already checked out on this branch when several match."
|
|
10390
|
+
}
|
|
10391
|
+
},
|
|
10392
|
+
required: ["project", "prompt"]
|
|
10393
|
+
}
|
|
10394
|
+
},
|
|
10203
10395
|
// ----- Trigger.dev -----
|
|
10204
10396
|
...TRIGGER_TOOLS
|
|
10205
10397
|
];
|
|
@@ -10424,6 +10616,131 @@ ${facets.join(", ")}` : ""),
|
|
|
10424
10616
|
]
|
|
10425
10617
|
};
|
|
10426
10618
|
}
|
|
10619
|
+
// ----- Cursor Remote (Agent Control) -----
|
|
10620
|
+
case "cursor-remote-list": {
|
|
10621
|
+
const onlineOnly = a.onlineOnly === true;
|
|
10622
|
+
const all = await listRemoteWorkspaces();
|
|
10623
|
+
const workspaces = onlineOnly ? all.filter((w) => w.hostOnline) : all;
|
|
10624
|
+
if (workspaces.length === 0) {
|
|
10625
|
+
return {
|
|
10626
|
+
content: [
|
|
10627
|
+
{
|
|
10628
|
+
type: "text",
|
|
10629
|
+
text: onlineOnly ? "No online agent-host workspaces found. Ask the developer to start their MG Agent Host." : "No paired agent-host workspaces found."
|
|
10630
|
+
}
|
|
10631
|
+
]
|
|
10632
|
+
};
|
|
10633
|
+
}
|
|
10634
|
+
const payload = workspaces.map((w) => ({
|
|
10635
|
+
owner: w.ownerName ?? w.ownerEmail ?? w.ownerUserId,
|
|
10636
|
+
online: w.hostOnline,
|
|
10637
|
+
host: w.hostName,
|
|
10638
|
+
project: w.name,
|
|
10639
|
+
repo: w.gitRepository,
|
|
10640
|
+
branch: w.gitBranch,
|
|
10641
|
+
defaultGitMode: w.defaultGitMode,
|
|
10642
|
+
path: w.path,
|
|
10643
|
+
lastSyncedAt: w.lastSyncedAt
|
|
10644
|
+
}));
|
|
10645
|
+
return {
|
|
10646
|
+
content: [
|
|
10647
|
+
{
|
|
10648
|
+
type: "text",
|
|
10649
|
+
text: JSON.stringify(
|
|
10650
|
+
{
|
|
10651
|
+
count: payload.length,
|
|
10652
|
+
onlineCount: workspaces.filter((w) => w.hostOnline).length,
|
|
10653
|
+
workspaces: payload,
|
|
10654
|
+
hint: "Use `who` (owner) + `project` (repo or project name) with cursor-remote-run. Only online workspaces can run."
|
|
10655
|
+
},
|
|
10656
|
+
null,
|
|
10657
|
+
2
|
|
10658
|
+
)
|
|
10659
|
+
}
|
|
10660
|
+
]
|
|
10661
|
+
};
|
|
10662
|
+
}
|
|
10663
|
+
case "cursor-remote-run": {
|
|
10664
|
+
const project = typeof a.project === "string" ? a.project.trim() : "";
|
|
10665
|
+
const prompt = typeof a.prompt === "string" ? a.prompt.trim() : "";
|
|
10666
|
+
if (!project) {
|
|
10667
|
+
return { content: [{ type: "text", text: "Error: project is required" }] };
|
|
10668
|
+
}
|
|
10669
|
+
if (!prompt) {
|
|
10670
|
+
return { content: [{ type: "text", text: "Error: prompt is required" }] };
|
|
10671
|
+
}
|
|
10672
|
+
const who = typeof a.who === "string" ? a.who.trim() : null;
|
|
10673
|
+
const branch = typeof a.branch === "string" ? a.branch.trim() : null;
|
|
10674
|
+
const model = typeof a.model === "string" ? a.model.trim() : null;
|
|
10675
|
+
const gitMode = a.gitMode === "in_place" ? "in_place" : "worktree";
|
|
10676
|
+
const resolution = await resolveRemoteTarget({ who, project, branch });
|
|
10677
|
+
if (!resolution.ok) {
|
|
10678
|
+
const describe = (c) => ` - ${c.ownerName ?? c.ownerEmail ?? c.ownerUserId} \xB7 ${c.name}${c.gitRepository ? ` (${c.gitRepository}${c.gitBranch ? `@${c.gitBranch}` : ""})` : ""}`;
|
|
10679
|
+
const candidates = resolution.candidates.map(describe).join("\n");
|
|
10680
|
+
const intro = resolution.reason === "ambiguous" ? `Multiple online workspaces match \u2014 narrow it down with \`who\` (and/or \`branch\`):` : `No online workspace matched who=${who ?? "(any)"} project="${project}". Online candidates:`;
|
|
10681
|
+
return {
|
|
10682
|
+
content: [
|
|
10683
|
+
{
|
|
10684
|
+
type: "text",
|
|
10685
|
+
text: `${intro}
|
|
10686
|
+
${candidates || " (none online \u2014 start the MG Agent Host)"}`
|
|
10687
|
+
}
|
|
10688
|
+
]
|
|
10689
|
+
};
|
|
10690
|
+
}
|
|
10691
|
+
const target = resolution.target;
|
|
10692
|
+
const title = prompt.split("\n")[0]?.slice(0, 80) || "Remote agent run";
|
|
10693
|
+
const queued = await queueAgentRun({
|
|
10694
|
+
workspace: {
|
|
10695
|
+
id: target.workspaceId,
|
|
10696
|
+
host_id: target.hostId,
|
|
10697
|
+
path: target.path,
|
|
10698
|
+
git_branch: target.gitBranch,
|
|
10699
|
+
git_repository: target.gitRepository
|
|
10700
|
+
},
|
|
10701
|
+
userId: target.ownerUserId,
|
|
10702
|
+
prompt,
|
|
10703
|
+
title,
|
|
10704
|
+
source: "mcp_remote",
|
|
10705
|
+
model,
|
|
10706
|
+
gitMode,
|
|
10707
|
+
metadata: {
|
|
10708
|
+
requestedBy: ctx.userId,
|
|
10709
|
+
who: who ?? null,
|
|
10710
|
+
project
|
|
10711
|
+
}
|
|
10712
|
+
});
|
|
10713
|
+
if (!queued) {
|
|
10714
|
+
return {
|
|
10715
|
+
content: [{ type: "text", text: "Error: failed to queue the agent run" }]
|
|
10716
|
+
};
|
|
10717
|
+
}
|
|
10718
|
+
const conversationUrl = `${dashboardBaseUrl}/cursor-remote?conversation=${queued.conversationId}`;
|
|
10719
|
+
return {
|
|
10720
|
+
content: [
|
|
10721
|
+
{
|
|
10722
|
+
type: "text",
|
|
10723
|
+
text: JSON.stringify(
|
|
10724
|
+
{
|
|
10725
|
+
status: "queued",
|
|
10726
|
+
owner: target.ownerName ?? target.ownerEmail ?? target.ownerUserId,
|
|
10727
|
+
host: target.hostName,
|
|
10728
|
+
project: target.name,
|
|
10729
|
+
repo: target.gitRepository,
|
|
10730
|
+
branch: target.gitBranch,
|
|
10731
|
+
gitMode,
|
|
10732
|
+
conversationId: queued.conversationId,
|
|
10733
|
+
runId: queued.runId,
|
|
10734
|
+
conversationUrl,
|
|
10735
|
+
note: gitMode === "worktree" ? "Runs in an isolated worktree and ends in a diff approval the owner reviews \u2014 nothing lands on their branch automatically." : "Runs in_place in the working tree (no isolation)."
|
|
10736
|
+
},
|
|
10737
|
+
null,
|
|
10738
|
+
2
|
|
10739
|
+
)
|
|
10740
|
+
}
|
|
10741
|
+
]
|
|
10742
|
+
};
|
|
10743
|
+
}
|
|
10427
10744
|
// ----- Servers -----
|
|
10428
10745
|
case "list-servers": {
|
|
10429
10746
|
const data = ctx.allowedServerIds !== null ? await db.execute(sql`
|