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.
- package/index.js +54 -28
- 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
|
|
802
|
-
: `Call get_parallel_kickoffs with taskId="${taskId}"
|
|
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
|
|
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
|
|
1549
|
-
3.
|
|
1550
|
-
4.
|
|
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 agent — they run in parallel in the background
|
|
1551
1551
|
|
|
1552
|
-
|
|
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
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
`
|
|
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
|
-
...
|
|
1686
|
+
...writtenFiles.map(f => ` • Builder ${f.index}: "${f.subtask}" → ${f.file}`),
|
|
1661
1687
|
``,
|
|
1662
|
-
`Each
|
|
1663
|
-
`They
|
|
1688
|
+
`Each builder calls kickoff_task → claim_files → implements → runs tests → commits.`,
|
|
1689
|
+
`They work on different files simultaneously — no need to wait for one before starting the other.`,
|
|
1664
1690
|
``,
|
|
1665
|
-
`After
|
|
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: '
|
|
1700
|
+
READ_THIS_FIRST: '⚡ BUILDER AGENT FILES WRITTEN — SEE INSTRUCTIONS BELOW',
|
|
1676
1701
|
COORDINATOR_INSTRUCTION: isParallel
|
|
1677
|
-
? `⚡ GROUP ${nextGroupIndex} of ${execOrder.length}: ${parallelCount}
|
|
1678
|
-
: `GROUP ${nextGroupIndex} of ${execOrder.length}: 1 sequential
|
|
1679
|
-
|
|
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