@mgsoftwarebv/mg-dashboard-mcp 7.0.20 → 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)
@@ -6215,12 +6231,7 @@ async function queueAgentRun(args2) {
6215
6231
  ${args2.workspace.host_id}, ${args2.userId}, 'open_chat_in_ide',
6216
6232
  ${JSON.stringify({
6217
6233
  workspacePath: args2.workspace.path,
6218
- prompt: handoffPrompt,
6219
- ...args2.autoCommit ? {
6220
- autoCommit: true,
6221
- commitBranch: args2.commitBranch ?? null,
6222
- commitMessage: args2.commitMessage ?? null
6223
- } : {}
6234
+ prompt: handoffPrompt
6224
6235
  })}::jsonb
6225
6236
  )
6226
6237
  `);
@@ -10362,7 +10373,7 @@ var TOOLS = [
10362
10373
  },
10363
10374
  {
10364
10375
  name: "cursor-remote-run",
10365
- 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). Optionally set autoCommit to have the daemon wait until the agent stops editing, then pull --rebase + commit + push the changes (clean-only: skipped if the workspace already had uncommitted changes). 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.",
10366
10377
  inputSchema: {
10367
10378
  type: "object",
10368
10379
  properties: {
@@ -10384,11 +10395,11 @@ var TOOLS = [
10384
10395
  },
10385
10396
  autoCommit: {
10386
10397
  type: "boolean",
10387
- description: "When true, after the agent finishes editing the daemon runs pull --rebase + commit + push automatically. Clean-only: skipped if the workspace already had uncommitted changes at handoff time, so pre-existing work-in-progress is never committed. Default false (developer commits manually in the IDE)."
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)."
10388
10399
  },
10389
10400
  commitBranch: {
10390
10401
  type: "string",
10391
- description: "Only with autoCommit. Branch to commit + push the agent's changes 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."
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."
10392
10403
  }
10393
10404
  },
10394
10405
  required: ["project", "prompt"]
@@ -10746,7 +10757,7 @@ ${candidates || " (none online \u2014 start the MG Agent Host)"}`
10746
10757
  conversationUrl,
10747
10758
  autoCommit,
10748
10759
  commitBranch: autoCommit ? commitBranch ?? "(current branch)" : null,
10749
- note: autoCommit ? `Opens the workspace's real Cursor IDE, prefills the prompt and auto-submits it. After the agent stops editing, the daemon will pull --rebase + commit + push to ${commitBranch ?? "the current branch"} (skipped if the workspace had uncommitted changes at start).` : "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."
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."
10750
10761
  },
10751
10762
  null,
10752
10763
  2