internaltool-mcp 1.6.29 → 1.6.30

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.
Files changed (2) hide show
  1. package/index.js +54 -28
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -798,8 +798,8 @@ Call confirmed=false to preview the decomposition, confirmed=true to save it.`,
798
798
  subtasksCreated: subtaskPlan.length,
799
799
  message: `Decomposition saved. ${subtaskPlan.length} subtask(s) added to the board.`,
800
800
  nextStep: parallelGroups.length > 0
801
- ? `⚡ COORDINATOR: Call get_parallel_kickoffs with taskId="${taskId}" NOW. It returns ready-to-paste prompts for each builder window. DO NOT implement code yourself your job is to coordinate only.`
802
- : `Call get_parallel_kickoffs with taskId="${taskId}" to get the builder prompt. DO NOT implement code yourself.`,
801
+ ? `⚡ COORDINATOR: Call get_parallel_kickoffs with taskId="${taskId}" NOW. It writes Cursor Background Agent files for each parallel builder automatically. Then tell the user to open Background Agents panel (⌘⇧J) and click Start. DO NOT implement code yourself.`
802
+ : `Call get_parallel_kickoffs with taskId="${taskId}". It writes a Cursor Background Agent file for the builder. Tell the user to open Background Agents panel (⌘⇧J) and start it.`,
803
803
  })
804
804
  }
805
805
  )
@@ -1541,16 +1541,15 @@ The log is visible in InternalTool under the task's Session tab — gives the hu
1541
1541
  // ── get_parallel_kickoffs ─────────────────────────────────────────────────────
1542
1542
  server.tool(
1543
1543
  'get_parallel_kickoffs',
1544
- `Read the decomposition plan and return ready-to-paste Cursor Agent prompts for the next group of parallel subtasks.
1544
+ `Read the decomposition plan, write Cursor Background Agent files for each parallel subtask, and return instructions.
1545
1545
 
1546
1546
  COORDINATOR WORKFLOW:
1547
1547
  1. Call decompose_task to create the plan
1548
- 2. Call get_parallel_kickoffs to get one paste-ready prompt per parallel subtask
1549
- 3. Tell the user exactly how many new Cursor Agent windows to open
1550
- 4. Give them each prompt to paste one window per subtask
1548
+ 2. Call get_parallel_kickoffs it writes .cursor/agents/builder-N.md files automatically
1549
+ 3. Open the Cursor Background Agents panel (⌘⇧J or ⌘⇧P "Background Agents")
1550
+ 4. Click "Start" for each builder agentthey run in parallel in the background
1551
1551
 
1552
- Cursor cannot spawn agent windows automatically. This tool generates the prompts;
1553
- the human opens the windows. Each builder agent then runs independently.`,
1552
+ The agent files are fully self-contained: each builder knows exactly what MCP tools to call.`,
1554
1553
  {
1555
1554
  taskId: z.string().describe("Task's MongoDB ObjectId"),
1556
1555
  },
@@ -1651,19 +1650,45 @@ the human opens the windows. Each builder agent then runs independently.`,
1651
1650
  return { subtask: st.title, role: st.role || 'builder', files: st.files || [], prompt }
1652
1651
  })
1653
1652
 
1653
+ // Write each builder prompt as a Cursor Background Agent file in .cursor/agents/
1654
+ // Cursor Background Agents panel reads these files and lets you start each one independently.
1655
+ const repoRoot = process.cwd()
1656
+ const agentsDir = join(repoRoot, '.cursor', 'agents')
1657
+ mkdirSync(agentsDir, { recursive: true })
1658
+
1659
+ const writtenFiles = []
1660
+ kickoffs.forEach((k, i) => {
1661
+ const safeName = k.subtask.replace(/[^a-zA-Z0-9-_]/g, '-').replace(/-+/g, '-').slice(0, 40)
1662
+ const fileName = `builder-${i + 1}-${safeName}.md`
1663
+ const filePath = join(agentsDir, fileName)
1664
+
1665
+ const agentFileContent = [
1666
+ `---`,
1667
+ `description: Builder ${i + 1} of ${parallelCount} — ${k.subtask} (${task.key})`,
1668
+ `---`,
1669
+ ``,
1670
+ k.prompt,
1671
+ ].join('\n')
1672
+
1673
+ writeFileSync(filePath, agentFileContent, 'utf8')
1674
+ writtenFiles.push({ index: i + 1, file: `.cursor/agents/${fileName}`, subtask: k.subtask })
1675
+ })
1676
+
1654
1677
  // Build the human-facing instruction block
1655
- const howToOpen = [
1656
- `In Cursor, open ${parallelCount} new Agent windows:`,
1657
- ` • Mac: Cmd+Shift+P → "New Agent" (or click "+" in the Composer panel)`,
1658
- ` Windows: Ctrl+Shift+P "New Agent"`,
1678
+ const howToStart = [
1679
+ `✅ ${parallelCount} builder agent file(s) written to .cursor/agents/`,
1680
+ ``,
1681
+ `TO START PARALLEL BUILDERS IN CURSOR:`,
1682
+ ` 1. Open Background Agents panel: ⌘⇧J (or ⌘⇧P → "Background Agents")`,
1683
+ ` 2. You'll see ${parallelCount} new builder agent(s) listed`,
1684
+ ` 3. Click "Start" for each one — they run in parallel automatically`,
1659
1685
  ``,
1660
- ...kickoffs.map((k, i) => `Window ${i + 1}: paste the prompt for subtask "${k.subtask}"`),
1686
+ ...writtenFiles.map(f => ` Builder ${f.index}: "${f.subtask}" → ${f.file}`),
1661
1687
  ``,
1662
- `Each window will independently call kickoff_task → claim_files → implementcommit.`,
1663
- `They run at the same timeyou don't need to wait for one to finish before starting the other.`,
1688
+ `Each builder calls kickoff_task → claim_files → implementsruns tests → commits.`,
1689
+ `They work on different files simultaneouslyno need to wait for one before starting the other.`,
1664
1690
  ``,
1665
- `After BOTH windows finish and commit, come back to this coordinator window and call:`,
1666
- ` get_parallel_kickoffs(taskId="${taskId}")`,
1691
+ `After all builders finish, come back here and call get_parallel_kickoffs again`,
1667
1692
  `to get the next group's prompts.`,
1668
1693
  ].join('\n')
1669
1694
 
@@ -1672,17 +1697,11 @@ the human opens the windows. Each builder agent then runs independently.`,
1672
1697
  totalGroups: execOrder.length,
1673
1698
  isParallel,
1674
1699
  parallelCount,
1675
- READ_THIS_FIRST: '👇 READ THIS BEFORE DOING ANYTHING',
1700
+ READ_THIS_FIRST: ' BUILDER AGENT FILES WRITTEN — SEE INSTRUCTIONS BELOW',
1676
1701
  COORDINATOR_INSTRUCTION: isParallel
1677
- ? `⚡ GROUP ${nextGroupIndex} of ${execOrder.length}: ${parallelCount} subtasks run IN PARALLEL.\n\n${howToOpen}`
1678
- : `GROUP ${nextGroupIndex} of ${execOrder.length}: 1 sequential subtask.\nOpen 1 new Agent window and paste the prompt below.`,
1679
- kickoffs: kickoffs.map((k, i) => ({
1680
- window: i + 1,
1681
- subtask: k.subtask,
1682
- role: k.role,
1683
- files: k.files,
1684
- PASTE_THIS_IN_NEW_AGENT_WINDOW: k.prompt,
1685
- })),
1702
+ ? `⚡ GROUP ${nextGroupIndex} of ${execOrder.length}: ${parallelCount} builders written as Cursor Background Agents.\n\n${howToStart}`
1703
+ : `GROUP ${nextGroupIndex} of ${execOrder.length}: 1 sequential builder written as a Cursor Background Agent.\n\n${howToStart}`,
1704
+ agentFilesWritten: writtenFiles,
1686
1705
  })
1687
1706
  }
1688
1707
  )
@@ -3009,11 +3028,18 @@ You are a COORDINATOR agent. Your behavioral constraints for this session:
3009
3028
  - Bypass the decomposition step — always decompose before builders start
3010
3029
  - Start coding without a scout report when the codebase is unfamiliar
3011
3030
 
3031
+ **PARALLEL BUILDER WORKFLOW:**
3032
+ 1. Call decompose_task — creates subtasks with file ownership
3033
+ 2. Call get_parallel_kickoffs — writes .cursor/agents/builder-N.md files automatically
3034
+ 3. Tell the user: "Open Background Agents panel (⌘⇧J) and click Start for each builder"
3035
+ 4. Wait for builders to finish, then call get_parallel_kickoffs again for the next group
3036
+
3012
3037
  **WORK STYLE:**
3013
3038
  - Start with decompose_task to get the structured execution plan
3014
3039
  - Ensure no two builder subtasks claim the same file
3015
3040
  - Scout report must exist before builders begin
3016
- - Each builder subtask must have explicit file ownership and a clear scope`,
3041
+ - Each builder subtask must have explicit file ownership and a clear scope
3042
+ - NEVER implement code yourself — your job ends after get_parallel_kickoffs writes the agent files`,
3017
3043
  }
3018
3044
 
3019
3045
  /** Write task-specific cursor rules to .cursor/rules/<taskKey>.mdc in the local repo root.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "internaltool-mcp",
3
- "version": "1.6.29",
3
+ "version": "1.6.30",
4
4
  "description": "MCP server for InternalTool — connect AI assistants (Claude Code, Cursor) to your project and task management platform",
5
5
  "type": "module",
6
6
  "main": "index.js",