@mgsoftwarebv/mg-dashboard-mcp 7.0.19 → 7.0.21

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 CHANGED
@@ -6205,9 +6205,25 @@ function normalizeRepoIdentifier(value) {
6205
6205
  return s || null;
6206
6206
  }
6207
6207
  var HANDOFF_PROMPT_CHARS = 4e3;
6208
+ function buildCommitInstruction(args2) {
6209
+ const branchLine = args2.commitBranch ? `Create or switch to the branch \`${args2.commitBranch}\` (from the current HEAD) and push it with \`git push -u origin ${args2.commitBranch}\`.` : "Push to the current branch.";
6210
+ return [
6211
+ "",
6212
+ "---",
6213
+ "When the task is complete, commit and push your work:",
6214
+ "- Stage ONLY the files you changed for this task \u2014 never commit unrelated, pre-existing local changes.",
6215
+ `- Use this commit message: \`${args2.commitMessage}\`.`,
6216
+ `- ${branchLine}`,
6217
+ "- If the push is rejected, run `git pull --rebase` and push again."
6218
+ ].join("\n");
6219
+ }
6208
6220
  async function queueAgentRun(args2) {
6209
6221
  const db2 = getDb();
6210
- const handoffPrompt = args2.prompt.trim().slice(0, HANDOFF_PROMPT_CHARS);
6222
+ const cappedPrompt = args2.prompt.trim().slice(0, HANDOFF_PROMPT_CHARS);
6223
+ const handoffPrompt = args2.autoCommit ? cappedPrompt + buildCommitInstruction({
6224
+ commitMessage: args2.commitMessage ?? "agent: automated change",
6225
+ commitBranch: args2.commitBranch
6226
+ }) : cappedPrompt;
6211
6227
  const metadata = { ...args2.metadata ?? {}, source: args2.source };
6212
6228
  await db2.execute(sql`
6213
6229
  INSERT INTO agent_host_command (host_id, user_id, command_type, payload)
@@ -10357,7 +10373,7 @@ var TOOLS = [
10357
10373
  },
10358
10374
  {
10359
10375
  name: "cursor-remote-run",
10360
- description: "Open a Cursor agent chat in a teammate's real IDE to make a code change. Resolve `who` (workspace owner name/email or machine name) + `project` (repo 'org/repo', URL, or workspace name) to a single online workspace, then hand off via the agent-host daemon: it opens that workspace's Cursor window, prefills the prompt and auto-submits it, so the developer sees the agent working live in their IDE. Use this when an AI (e.g. a ticket assistant) should hand a self-contained, well-scoped fix prompt to a developer's PC. There is no headless run and no diff-approval step \u2014 the developer reviews and commits in the IDE itself. The chat runs on the developer's default Cursor model (no model override). Returns the conversationId and a dashboard link to follow the chat. Call cursor-remote-list first if unsure about who/project.",
10376
+ description: "Open a Cursor agent chat in a teammate's real IDE to make a code change. Resolve `who` (workspace owner name/email or machine name) + `project` (repo 'org/repo', URL, or workspace name) to a single online workspace, then hand off via the agent-host daemon: it opens that workspace's Cursor window, prefills the prompt and auto-submits it, so the developer sees the agent working live in their IDE. Use this when an AI (e.g. a ticket assistant) should hand a self-contained, well-scoped fix prompt to a developer's PC. There is no headless run and no diff-approval step \u2014 the developer reviews and commits in the IDE itself, unless autoCommit is set. The chat runs on the developer's default Cursor model (no model override). Set autoCommit to append a commit + push instruction to the prompt so the agent itself commits and pushes its work when done (it stages only the files it changed). Returns the conversationId and a dashboard link to follow the chat. Call cursor-remote-list first if unsure about who/project.",
10361
10377
  inputSchema: {
10362
10378
  type: "object",
10363
10379
  properties: {
@@ -10376,6 +10392,14 @@ var TOOLS = [
10376
10392
  branch: {
10377
10393
  type: "string",
10378
10394
  description: "Optional: prefer a workspace already checked out on this branch when several match."
10395
+ },
10396
+ autoCommit: {
10397
+ type: "boolean",
10398
+ description: "When true, a commit + push instruction is appended to the prompt so the agent commits and pushes its own work when the task is done (staging only the files it changed, leaving any pre-existing local changes untouched). Default false (developer commits manually in the IDE)."
10399
+ },
10400
+ commitBranch: {
10401
+ type: "string",
10402
+ description: "Only with autoCommit. Branch the agent is told to commit + push to (e.g. a ticket number like '2025-REFRO-119'); created from the current HEAD if it doesn't exist. Omit to commit on the workspace's current branch."
10379
10403
  }
10380
10404
  },
10381
10405
  required: ["project", "prompt"]
@@ -10671,6 +10695,8 @@ ${facets.join(", ")}` : ""),
10671
10695
  }
10672
10696
  const who = typeof a.who === "string" ? a.who.trim() : null;
10673
10697
  const branch = typeof a.branch === "string" ? a.branch.trim() : null;
10698
+ const autoCommit = a.autoCommit === true;
10699
+ const commitBranch = typeof a.commitBranch === "string" && a.commitBranch.trim() ? a.commitBranch.trim() : null;
10674
10700
  const resolution = await resolveRemoteTarget({ who, project, branch });
10675
10701
  if (!resolution.ok) {
10676
10702
  const describe = (c) => ` - ${c.ownerName ?? c.ownerEmail ?? c.ownerUserId} \xB7 ${c.name}${c.gitRepository ? ` (${c.gitRepository}${c.gitBranch ? `@${c.gitBranch}` : ""})` : ""}`;
@@ -10700,6 +10726,9 @@ ${candidates || " (none online \u2014 start the MG Agent Host)"}`
10700
10726
  prompt,
10701
10727
  title,
10702
10728
  source: "mcp_remote",
10729
+ autoCommit,
10730
+ commitBranch,
10731
+ commitMessage: autoCommit ? `agent: ${title}` : null,
10703
10732
  metadata: {
10704
10733
  requestedBy: ctx.userId,
10705
10734
  who: who ?? null,
@@ -10726,7 +10755,9 @@ ${candidates || " (none online \u2014 start the MG Agent Host)"}`
10726
10755
  branch: target.gitBranch,
10727
10756
  conversationId: queued.conversationId,
10728
10757
  conversationUrl,
10729
- note: "Opens the workspace's real Cursor IDE, prefills the prompt and auto-submits it. The developer sees the agent working live and reviews/commits in the IDE \u2014 no diff approval step."
10758
+ autoCommit,
10759
+ commitBranch: autoCommit ? commitBranch ?? "(current branch)" : null,
10760
+ note: autoCommit ? `Opens the workspace's real Cursor IDE, prefills the prompt and auto-submits it. The prompt instructs the agent to commit + push its own changes to ${commitBranch ?? "the current branch"} when done (staging only what it changed).` : "Opens the workspace's real Cursor IDE, prefills the prompt and auto-submits it. The developer sees the agent working live and reviews/commits in the IDE \u2014 no diff approval step."
10730
10761
  },
10731
10762
  null,
10732
10763
  2