hivecode-mcp 0.13.0 → 0.14.0

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/hive-github.js CHANGED
@@ -1632,8 +1632,17 @@ function flags(argv) {
1632
1632
 
1633
1633
  const USAGE = `usage:
1634
1634
  npx -y hivecode-mcp@latest github start --agent "<agent command>" [options]
1635
+ npx -y hivecode-mcp@latest github start --room "<room link>" [--fallback-agent "<command>"] [--ack-minutes 10]
1636
+ npx -y hivecode-mcp@latest github start --branch <name> [--fallback-agent "<command>"] [--ack-minutes 10]
1635
1637
  npx -y hivecode-mcp@latest github status
1636
1638
 
1639
+ --room: hand each labelled issue to the agents ALREADY in that room (a room bound to a branch of
1640
+ this repo: npx -y hivecode-mcp@latest branch <name>). They split it, build it and review each other;
1641
+ Hivecode runs the tests and opens one pull request. One issue at a time.
1642
+ --branch <name> bind or use the room for this branch, and run room mode
1643
+ --fallback-agent "<command>" if nobody in the room takes an issue, start this agent in the room
1644
+ (opt-in: it spends that agent's tokens; capped by --max-runs-per-day)
1645
+
1637
1646
  The agent command reads its task on stdin. For Claude Code:
1638
1647
  --agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode"
1639
1648
 
@@ -1686,6 +1695,16 @@ export async function main(argv, { cwd: here = process.cwd(), log = console.log,
1686
1695
  if (sub === 'status') {
1687
1696
  const s = loadState(file, log, { peek: true })
1688
1697
  log(describe(s, s.config || {}))
1698
+ // ROOM MODE keeps its own state (room-<room>.json, never github.json): describe each one, so
1699
+ // "why isn't it picking up my issue?" has an answer here too.
1700
+ try {
1701
+ const dir = path.join(gitDir, 'hivecode')
1702
+ const rooms = fs.existsSync(dir) ? fs.readdirSync(dir).filter((x) => /^room-.+\.json$/.test(x)) : []
1703
+ if (rooms.length) {
1704
+ const RW = await import('./hive-room-watcher.js')
1705
+ for (const x of rooms) log(`\n${RW.describeRoomState(RW.loadRoomState(path.join(dir, x)))}`)
1706
+ }
1707
+ } catch (e) { log(`(room mode state could not be read: ${e.message})`) }
1689
1708
  return 0
1690
1709
  }
1691
1710
 
@@ -1719,6 +1738,27 @@ export async function main(argv, { cwd: here = process.cwd(), log = console.log,
1719
1738
  return busy ? EXIT_AGAIN : EXIT_FIX
1720
1739
  }
1721
1740
  if (info.permissions && info.permissions.push === false) { logErr(`Q601 the GitHub account gh is logged in as cannot push to ${id.owner}/${id.repo}.`); return EXIT_FIX }
1741
+ // ROOM MODE: issues go to the agents ALREADY in a room (hive-room-watcher.js), and no agent of ours
1742
+ // runs unless --fallback-agent asks for one. Everything below this line is the other mode.
1743
+ if (opt('room') || ('branch' in f)) {
1744
+ if (f['dry-run']) { logErr('Q602 --dry-run does not work with --room yet. Use: npx -y hivecode-mcp@latest github status'); return EXIT_FIX }
1745
+ let roomLink = opt('room')
1746
+ if (!roomLink && ('branch' in f)) {
1747
+ const branchName = String(opt('branch') || '').trim()
1748
+ if (!branchName || branchName === 'true') { logErr('Q602 say which branch to watch, with --branch <name>.'); return EXIT_FIX }
1749
+ const HB = await import('./hive-branch.js')
1750
+ try {
1751
+ const bound = await HB.bindBranch({ cwd: root, branch: branchName, relay: opt('relay') || '', log })
1752
+ roomLink = bound.link
1753
+ f['room'] = roomLink
1754
+ } catch (e) {
1755
+ logErr(isQ(e) ? e.message : `Q603 ${e.message}`)
1756
+ return EXIT_FIX
1757
+ }
1758
+ }
1759
+ const RW = await import('./hive-room-watcher.js')
1760
+ return RW.runRoomMode({ f, opt, gh, id, info, root, gitDir, label: opt('label') || LABEL, log, logErr })
1761
+ }
1722
1762
  const agent = opt('agent')
1723
1763
  if (!agent) { logErr(`Q602 say which agent runs the work, with --agent "<command>".\n\n${USAGE}`); return EXIT_FIX }
1724
1764
  if (!commandExists(agent)) { logErr(`Q602 "${String(agent).split(/\s+/)[0]}" is not installed here (not on PATH).`); return EXIT_FIX }