internaltool-mcp 1.6.1 → 1.6.2

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 +30 -10
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -896,11 +896,16 @@ Use this when a developer says "start task", "brief me on", or "what do I need t
896
896
  if (commitsRes?.success) recentCommits = commitsRes.data.commits || []
897
897
  } catch { /* GitHub may not be linked */ }
898
898
 
899
+ // If the task already has a branch linked, it's safe to move to in_progress now.
900
+ // If not, create_branch will do the move once the branch is created.
901
+ const alreadyHasBranch = !!task.github?.headBranch
899
902
  let moved = false
900
- try {
901
- const moveRes = await api.post(`/api/tasks/${taskId}/move`, { column: 'in_progress', toIndex: 0 })
902
- moved = moveRes?.success ?? false
903
- } catch { /* might already be in_progress */ }
903
+ if (alreadyHasBranch) {
904
+ try {
905
+ const moveRes = await api.post(`/api/tasks/${taskId}/move`, { column: 'in_progress', toIndex: 0 })
906
+ moved = moveRes?.success ?? false
907
+ } catch { /* might already be in_progress */ }
908
+ }
904
909
 
905
910
  return text({
906
911
  started: {
@@ -908,6 +913,7 @@ Use this when a developer says "start task", "brief me on", or "what do I need t
908
913
  title: task.title,
909
914
  priority: task.priority,
910
915
  column: moved ? 'in_progress' : task.column,
916
+ branch: task.github?.headBranch || null,
911
917
  subtasks,
912
918
  },
913
919
  implementationPlan: hasReadme ? task.readmeMarkdown : null,
@@ -918,8 +924,10 @@ Use this when a developer says "start task", "brief me on", or "what do I need t
918
924
  date: c.commit?.author?.date,
919
925
  })),
920
926
  movedToInProgress: moved,
921
- suggestedBranch,
922
- nextStep: `Use create_branch to create "${suggestedBranch}" on GitHub — it will automatically check your local git state before creating.`,
927
+ suggestedBranch: alreadyHasBranch ? null : suggestedBranch,
928
+ nextStep: alreadyHasBranch
929
+ ? `Branch "${task.github.headBranch}" already exists. Task is now In progress — start coding.`
930
+ : `Call create_branch to create "${suggestedBranch}" — it will check your local git state and move the task to In progress automatically.`,
923
931
  })
924
932
  }
925
933
  )
@@ -1530,6 +1538,17 @@ If you have uncommitted tracked changes, it will tell you exactly what to do bef
1530
1538
  await api.patch(`/api/tasks/${taskId}/github/branch`, { headBranch: branchName })
1531
1539
  } catch { /* non-fatal — branch was still created on GitHub */ }
1532
1540
 
1541
+ // Move task to in_progress now that the branch exists (server guard now allows it)
1542
+ let movedToInProgress = false
1543
+ try {
1544
+ const freshTask = await api.get(`/api/tasks/${taskId}`)
1545
+ const col = freshTask?.data?.task?.column
1546
+ if (col && ['todo', 'backlog'].includes(col)) {
1547
+ const moveRes = await api.post(`/api/tasks/${taskId}/move`, { column: 'in_progress', toIndex: 0 })
1548
+ movedToInProgress = moveRes?.success ?? false
1549
+ }
1550
+ } catch { /* non-fatal */ }
1551
+
1533
1552
  const checkoutSteps = [
1534
1553
  'git fetch origin',
1535
1554
  `git checkout ${branchName}`,
@@ -1545,12 +1564,13 @@ If you have uncommitted tracked changes, it will tell you exactly what to do bef
1545
1564
 
1546
1565
  return text({
1547
1566
  branchName,
1548
- url: res.data.url,
1567
+ url: res.data.url,
1549
1568
  localState,
1550
- message: `Branch "${branchName}" created on GitHub.`,
1551
- gitSteps: checkoutSteps,
1569
+ movedToInProgress,
1570
+ message: `Branch "${branchName}" created on GitHub.${movedToInProgress ? ' Task moved to In progress.' : ''}`,
1571
+ gitSteps: checkoutSteps,
1552
1572
  localStateNote,
1553
- nextStep: 'Run the git steps above to switch locally, then start coding. When commits are pushed, use raise_pr.',
1573
+ nextStep: 'Run the git steps above to switch locally, then start coding. When commits are pushed, use raise_pr.',
1554
1574
  })
1555
1575
  } catch (e) {
1556
1576
  return errorText(e.message)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "internaltool-mcp",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
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",