internaltool-mcp 1.6.27 → 1.6.29

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 +58 -25
  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
- ? `Start with parallel group 1: ${parallelGroups[0].join(', ')}. Each builder agent should call kickoff_task with agentRole="builder" and claim_files before coding.`
802
- : 'Start the subtasks in order. Each builder should call kickoff_task with agentRole="builder" and claim_files.',
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.`,
803
803
  })
804
804
  }
805
805
  )
@@ -1618,41 +1618,71 @@ the human opens the windows. Each builder agent then runs independently.`,
1618
1618
  })
1619
1619
  }
1620
1620
 
1621
- // Build one ready-to-paste prompt per pending subtask in this group
1621
+ // Build one ready-to-paste prompt per pending subtask in this group.
1622
+ // These prompts are designed to be pasted verbatim into a NEW Cursor Agent window.
1623
+ // They begin with explicit MCP calls so the agent has no ambiguity about what to do first.
1622
1624
  const kickoffs = pendingInGroup.map((subtaskTitle, i) => {
1623
1625
  const st = subtasks.find(s => s.title === subtaskTitle) || { title: subtaskTitle, role: 'builder', files: [], description: '' }
1624
- const fileList = (st.files || []).map(f => ` - ${f}`).join('\n')
1626
+ const filesArg = (st.files || []).map(f => `"${f}"`).join(', ')
1627
+ const fileList = (st.files || []).map(f => ` - \`${f}\``).join('\n')
1628
+
1629
+ // Prompt is a short, direct imperative Cursor immediately executes.
1630
+ // Key: start with "Use the InternalTool MCP" so Cursor knows to call tools.
1631
+ // Avoid pseudocode like fn(arg=val) — use plain English with quoted values.
1632
+ const fileListPlain = (st.files || []).join(', ')
1625
1633
  const prompt = [
1626
- `You are a ${st.role || 'builder'} agent for TASK-011 (${task.key}).`,
1634
+ `Use the InternalTool MCP tools to implement subtask "${st.title}" for task ${task.key}.`,
1627
1635
  ``,
1628
- `## Your subtask (${i + 1} of ${parallelCount} running in parallel)`,
1629
- `**Title:** ${st.title}`,
1630
- `**Description:** ${st.description || ''}`,
1631
- `**Your files:**`,
1632
- fileList || ' (to be determined)',
1636
+ `Do these steps immediately in order do not ask for confirmation, do not skip any step:`,
1633
1637
  ``,
1634
- `## Steps`,
1635
- `1. Call \`get_agent_context\` with taskId \`${taskId}\``,
1636
- `2. Call \`claim_files\` with taskId \`${taskId}\` and files: [${(st.files || []).map(f => `"${f}"`).join(', ')}]`,
1637
- `3. Implement the subtask only modify your claimed files`,
1638
- `4. Run tests to verify nothing is broken`,
1639
- `5. Commit your changes with a clear message referencing ${task.key}`,
1640
- `6. Mark the subtask done in InternalTool by calling \`update_task\` to tick off "${st.title}" in the subtasks list`,
1638
+ `1. Call kickoff_task with taskId "${taskId}", agentRole "builder", confirmed true`,
1639
+ `2. Call claim_files with taskId "${taskId}" and files [${filesArg}]`,
1640
+ `3. Call get_agent_context with taskId "${taskId}" to read the full task plan`,
1641
+ `4. Implement the subtask: ${st.description || st.title}`,
1642
+ ` - You may ONLY modify these files: ${fileListPlain}`,
1643
+ ` - Do NOT touch any other file`,
1644
+ `5. Run npm test all tests must pass before continuing`,
1645
+ `6. Call commit_helper with taskId "${taskId}"`,
1646
+ `7. Call update_task with taskId "${taskId}" and mark the subtask "${st.title}" as done`,
1641
1647
  ``,
1642
- `Do NOT touch files owned by other parallel agents.`,
1648
+ `You are builder ${i + 1} of ${parallelCount} running in parallel. Another builder is working on different files at the same time.`,
1643
1649
  ].join('\n')
1644
- return { subtask: st.title, role: st.role, files: st.files, prompt }
1650
+
1651
+ return { subtask: st.title, role: st.role || 'builder', files: st.files || [], prompt }
1645
1652
  })
1646
1653
 
1654
+ // 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"`,
1659
+ ``,
1660
+ ...kickoffs.map((k, i) => `Window ${i + 1}: paste the prompt for subtask "${k.subtask}"`),
1661
+ ``,
1662
+ `Each window will independently call kickoff_task → claim_files → implement → commit.`,
1663
+ `They run at the same time — you don't need to wait for one to finish before starting the other.`,
1664
+ ``,
1665
+ `After BOTH windows finish and commit, come back to this coordinator window and call:`,
1666
+ ` get_parallel_kickoffs(taskId="${taskId}")`,
1667
+ `to get the next group's prompts.`,
1668
+ ].join('\n')
1669
+
1647
1670
  return text({
1648
1671
  group: nextGroupIndex,
1649
1672
  totalGroups: execOrder.length,
1650
1673
  isParallel,
1651
1674
  parallelCount,
1652
- instruction: isParallel
1653
- ? `⚡ GROUP ${nextGroupIndex} runs ${parallelCount} subtasks IN PARALLEL.\n\nTell the user:\n"Please open ${parallelCount} new Cursor Agent windows (Cmd+Shift+P → New Agent Session or open a new Composer tab set to Agent mode).\nPaste prompt 1 in window 1, prompt 2 in window 2. They will run independently."`
1654
- : `GROUP ${nextGroupIndex} has 1 sequential subtask. Paste the prompt below in a new Agent window (or handle it yourself).`,
1655
- kickoffs,
1675
+ READ_THIS_FIRST: '👇 READ THIS BEFORE DOING ANYTHING',
1676
+ 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
+ })),
1656
1686
  })
1657
1687
  }
1658
1688
  )
@@ -2418,8 +2448,11 @@ Use this when a developer says "start task", "brief me on", or "what do I need t
2418
2448
  }
2419
2449
 
2420
2450
  // Dynamically generate .cursor/agents, .cursor/skills, .cursor/commands
2421
- // based on live task data — so every agent gets the right task ID, files, and role
2422
- const workspaceResult = writeCursorWorkspace(task, projectAgentConfig, repoPath || process.cwd())
2451
+ // based on live task data — so every agent gets the right task ID, files, and role.
2452
+ // IMPORTANT: inject the NEW agentRole from this kickoff call (not the stale task.agentRole)
2453
+ // so active-agent.md reflects the role being kicked off, not the previous session's role.
2454
+ const taskForWorkspace = agentRole ? { ...task, agentRole } : task
2455
+ const workspaceResult = writeCursorWorkspace(taskForWorkspace, projectAgentConfig, repoPath || process.cwd())
2423
2456
 
2424
2457
  // Persist agentRole + workspace status to server
2425
2458
  const workspacePatch = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "internaltool-mcp",
3
- "version": "1.6.27",
3
+ "version": "1.6.29",
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",