reevesagents 2.2.0 → 2.3.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/dist/web/app.js CHANGED
@@ -141,6 +141,10 @@
141
141
  'web.statusEnded': 'ended',
142
142
  'web.statusStale': 'stale',
143
143
  'web.statusRunning': 'running',
144
+ 'web.needsAttention': 'needs attention',
145
+ 'web.needsApproval': 'approval needed',
146
+ 'web.needsAnswer': 'answer needed',
147
+ 'web.hasQuestion': 'question waiting',
144
148
  'web.unknown': 'unknown',
145
149
  'web.useProvider': 'use {{name}}',
146
150
  'web.agentControl': 'Agent control',
@@ -216,6 +220,12 @@
216
220
  'web.planBlockedOwner': 'blocked',
217
221
  'web.planEmptyTitle': 'No plan yet',
218
222
  'web.planEmptyBody': 'Import the project document with `reevesagents flow plan import`.',
223
+ 'web.planSpecOrigin': 'from the spec queue',
224
+ 'web.planGated': '{{status}} ({{state}})',
225
+ 'web.planDerivedCaption': 'Rows marked "from the spec queue" are derived from the flow state, not from a plan document.',
226
+ 'web.planDispatchUnknown': 'A dispatch was sent and never confirmed — the task it belongs to cannot be identified.',
227
+ 'web.planStatus_dispatching': 'dispatching',
228
+ 'web.planStatus_handed_over': 'handed over',
219
229
  'web.logsEmptyTitle': 'No notifications yet',
220
230
  'web.logsEmptyBody': 'Runs, approvals and flow events appear here as they happen.',
221
231
  'web.logsMarkRead': 'Mark all read',
@@ -314,6 +324,8 @@
314
324
  logsPanel: document.getElementById('logs-panel'),
315
325
  planList: document.getElementById('plan-list'),
316
326
  planEmpty: document.getElementById('plan-empty'),
327
+ planDerived: document.getElementById('plan-derived'),
328
+ planUnknown: document.getElementById('plan-dispatch-unknown'),
317
329
  planDetail: document.getElementById('plan-detail'),
318
330
  planWaiting: document.getElementById('plan-waiting'),
319
331
  planTicks: document.getElementById('plan-ticks'),
@@ -364,6 +376,9 @@
364
376
  planFilter: 'all',
365
377
  runId: '',
366
378
  plan: null,
379
+ // The derived work view (rows from the flow state, the plan and the notes): a spec-only flow has no plan document and
380
+ // still knows which task is in work, who holds it and which commit closed the last one.
381
+ work: null,
367
382
  logs: [],
368
383
  readSeq: 0,
369
384
  latestSeq: 0,
@@ -660,6 +675,8 @@
660
675
  el.insightsClose.textContent = t('web.mcpClose')
661
676
  document.querySelector('#logs-panel .logs-filter span').textContent = t('web.logsRun')
662
677
  document.querySelector('#logs-panel .logs-toggle span').textContent = t('web.logsUnreadOnly')
678
+ document.querySelector('#plan-derived').textContent = t('web.planDerivedCaption')
679
+ document.querySelector('#plan-dispatch-unknown').textContent = t('web.planDispatchUnknown')
663
680
  document.querySelector('#plan-empty .empty-title').textContent = t('web.planEmptyTitle')
664
681
  document.querySelector('#plan-empty .empty-body').textContent = t('web.planEmptyBody')
665
682
  document.querySelector('#logs-empty .empty-title').textContent = t('web.logsEmptyTitle')
@@ -1057,6 +1074,9 @@
1057
1074
  function renderSidebar() {
1058
1075
  const runsWithAgents = runs.filter(r => r.status !== 'ended' && r.terminals.length > 0)
1059
1076
  const agentCount = runsWithAgents.reduce((sum, run) => sum + run.terminals.length, 0)
1077
+ const attentionCount = runsWithAgents.reduce(
1078
+ (sum, run) => sum + run.terminals.filter(agent => agent.attention).length, 0)
1079
+ updateAttentionTitle(attentionCount)
1060
1080
  el.sidebarCount.textContent = String(agentCount)
1061
1081
  el.sidebarEmpty.hidden = runsWithAgents.length > 0
1062
1082
  if (!el.sidebarEmpty.hidden) {
@@ -1113,6 +1133,14 @@
1113
1133
  const tone = run.flow.tone || 'neutral'
1114
1134
  flow.className = `run-flow flow-badge flow-badge--${tone}${run.flow.pulse ? ' is-pulsing' : ''}`
1115
1135
  flow.textContent = run.flow.label
1136
+ // The plan's progress is a **separate** segment: the label above says which task is in work, and folding the plan's
1137
+ // arithmetic into it is how "flow: plan 3/7" came to stand in for an answer about the work itself.
1138
+ if (run.flow.plan_label) {
1139
+ const planSegment = document.createElement('span')
1140
+ planSegment.className = 'flow-badge-plan'
1141
+ planSegment.textContent = ` · ${run.flow.plan_label}`
1142
+ flow.appendChild(planSegment)
1143
+ }
1116
1144
  if (run.flow.attention) {
1117
1145
  flow.dataset.attention = run.flow.attention
1118
1146
  }
@@ -1306,7 +1334,7 @@
1306
1334
  pulseRemaining: () => 0,
1307
1335
  filterPlanItems: items => items || [],
1308
1336
  planWaiting: () => ({ needsBrief: [], blocked: [], total: 0 }),
1309
- planIconVisible: flow => Boolean(flow && flow.plan),
1337
+ planIconVisible: flow => Boolean(flow && (flow.plan || flow.work_total > 0)),
1310
1338
  }
1311
1339
 
1312
1340
  // The dialog is run-scoped: the agent the operator has selected decides which run's plan opens.
@@ -1444,12 +1472,16 @@
1444
1472
 
1445
1473
  async function loadPlan(runId) {
1446
1474
  insights.plan = null
1475
+ insights.work = null
1447
1476
  if (!runId) return
1448
1477
  try {
1449
1478
  const data = await api('GET', `/api/plan?run=${encodeURIComponent(runId)}`)
1450
1479
  insights.plan = data && data.plan ? data.plan : null
1480
+ // Always present: `{ plan: null, work: {…} }` is the normal answer for a flow driven from the spec queue.
1481
+ insights.work = data && data.work ? data.work : null
1451
1482
  } catch {
1452
1483
  insights.plan = null
1484
+ insights.work = null
1453
1485
  }
1454
1486
  }
1455
1487
 
@@ -1508,65 +1540,192 @@
1508
1540
  renderPlan()
1509
1541
  }
1510
1542
 
1543
+ // Which parked state takes the owner away. The tab and the card must agree about it, and the flow state is the one fact
1544
+ // both of them already carry (`insights.flowState`, set when the dialog opens).
1545
+ const GATED_FLOW_STATES = ['paused', 'escalated', 'orphaned', 'done']
1546
+ const ACTIVE_WORK_STATUSES = ['in_work', 'reviewing', 'dispatching']
1547
+
1548
+ function currentRowId() {
1549
+ return insights.work && insights.work.current ? insights.work.current.id : null
1550
+ }
1551
+
1552
+ function currentChip() {
1553
+ const chip = document.createElement('span')
1554
+ chip.className = 'plan-current'
1555
+ chip.textContent = t('common.current')
1556
+ return chip
1557
+ }
1558
+
1559
+ // The status as this row must read: a gated row says `reviewing (paused)`, because the stored status is still what the
1560
+ // work was doing and the flow's own state is what took the owner away.
1561
+ function workStatusText(item) {
1562
+ const gated = GATED_FLOW_STATES.indexOf(insights.flowState) !== -1
1563
+ && ACTIVE_WORK_STATUSES.indexOf(item.status) !== -1
1564
+ const status = t(`web.planStatus_${item.status}`)
1565
+ return gated ? t('web.planGated', { status, state: t(`flow.status.${insights.flowState}`) }) : status
1566
+ }
1567
+
1568
+ function planRowNode(item, workRow) {
1569
+ const row = document.createElement('button')
1570
+ row.type = 'button'
1571
+ row.className = 'plan-row'
1572
+ row.dataset.status = item.status
1573
+ row.dataset.origin = 'plan'
1574
+ row.setAttribute('role', 'listitem')
1575
+ const id = document.createElement('span')
1576
+ id.className = 'plan-id'
1577
+ id.textContent = item.id
1578
+ const title = document.createElement('span')
1579
+ title.className = 'plan-title'
1580
+ title.textContent = item.title
1581
+ // A row the document no longer lists keeps its status, but the badge says so explicitly: without it the row looks like
1582
+ // ordinary open work that nobody is picking up. A row the flow still owns reads through the work view, which is what
1583
+ // knows whether the ownership gate took the agent away — `reviewing (paused)`.
1584
+ const badge = workRow && !item.missing_since ? planStatusBadgeFor(workRow) : planStatusBadge(item.missing_since ? 'missing' : item.status)
1585
+ row.append(id, title, badge)
1586
+ if (workRow && workRow.note) row.title = workRow.note
1587
+ if (currentRowId() === item.id) {
1588
+ row.classList.add('is-current')
1589
+ row.appendChild(currentChip())
1590
+ }
1591
+ row.addEventListener('click', () => showPlanDetail(item))
1592
+ return row
1593
+ }
1594
+
1595
+ // A derived row: an item of the flat spec queue, not of the plan document. It carries its origin, so a reader never
1596
+ // mistakes it for a line the document said.
1597
+ function workRowNode(item) {
1598
+ const row = document.createElement('button')
1599
+ row.type = 'button'
1600
+ row.className = 'plan-row plan-row--spec'
1601
+ row.dataset.status = item.status
1602
+ row.dataset.origin = item.origin
1603
+ row.setAttribute('role', 'listitem')
1604
+ const id = document.createElement('span')
1605
+ id.className = 'plan-id'
1606
+ id.textContent = item.id
1607
+ const title = document.createElement('span')
1608
+ title.className = 'plan-title'
1609
+ title.textContent = item.title
1610
+ const origin = document.createElement('span')
1611
+ origin.className = 'plan-origin'
1612
+ origin.textContent = t('web.planSpecOrigin')
1613
+ row.append(id, title, planStatusBadgeFor(item), origin)
1614
+ if (currentRowId() === item.id) {
1615
+ row.classList.add('is-current')
1616
+ row.appendChild(currentChip())
1617
+ }
1618
+ if (item.note) row.title = item.note
1619
+ row.addEventListener('click', () => showWorkItem(item))
1620
+ return row
1621
+ }
1622
+
1623
+ function planStatusBadgeFor(item) {
1624
+ const badge = document.createElement('span')
1625
+ badge.className = 'plan-badge'
1626
+ badge.dataset.status = item.status
1627
+ badge.textContent = workStatusText(item)
1628
+ return badge
1629
+ }
1630
+
1511
1631
  function renderPlan() {
1512
1632
  const plan = insights.plan
1513
- el.planEmpty.hidden = Boolean(plan)
1633
+ const work = insights.work
1634
+ const rows = work && Array.isArray(work.items) ? work.items : []
1635
+ // The rows the flow derived from its spec queue: never written into the plan document, and labelled as such.
1636
+ const derived = rows.filter(item => item.origin === 'spec')
1637
+ // The empty state is only for a flow with neither a plan nor a single row: a spec-only flow has work to show even
1638
+ // though nobody imported a document.
1639
+ el.planEmpty.hidden = Boolean(plan) || rows.length > 0
1514
1640
  el.planList.replaceChildren()
1515
1641
  el.planWaiting.replaceChildren()
1516
1642
  el.planDetail.hidden = true
1517
- if (!plan) {
1643
+ el.planDerived.hidden = derived.length === 0
1644
+ el.planUnknown.hidden = !(work && work.dispatch_unknown)
1645
+ if (!plan && rows.length === 0) {
1518
1646
  el.planProgressText.textContent = '0/0'
1519
1647
  el.planProgressFill.style.width = '0%'
1520
1648
  el.planWaiting.hidden = true
1521
1649
  return
1522
1650
  }
1523
- const progress = core().formatPlanProgress(plan.progress.done, plan.progress.total)
1651
+ // The plan's own arithmetic when a document exists, otherwise how far the flow got through the rows it knows. Two
1652
+ // different questions, never mixed into one number.
1653
+ const closed = rows.filter(item => item.status === 'done' || item.status === 'skipped').length
1654
+ const progress = plan
1655
+ ? core().formatPlanProgress(plan.progress.done, plan.progress.total)
1656
+ : core().formatPlanProgress(closed, rows.length)
1524
1657
  el.planProgressText.textContent = `${progress.text} · ${progress.percent}%`
1525
1658
  el.planProgressFill.style.width = `${progress.percent}%`
1526
1659
  el.planProgressBar.setAttribute('aria-valuenow', String(progress.percent))
1527
1660
 
1528
- const waiting = core().planWaiting(plan.items)
1529
- if (waiting.total > 0) {
1530
- el.planWaiting.hidden = false
1531
- const title = document.createElement('div')
1532
- title.className = 'plan-waiting-title'
1533
- title.textContent = t('web.planWaitingTitle')
1534
- el.planWaiting.appendChild(title)
1535
- for (const item of [...waiting.needsBrief.map(entry => [entry, 'needs_brief']), ...waiting.blocked.map(entry => [entry, 'blocked_owner'])]) {
1536
- const row = document.createElement('div')
1537
- row.className = 'plan-waiting-row'
1538
- const id = document.createElement('span')
1539
- id.className = 'plan-waiting-id'
1540
- id.textContent = item[0].id
1541
- const why = document.createElement('span')
1542
- why.className = 'plan-waiting-why'
1543
- why.textContent = t(item[1] === 'needs_brief' ? 'web.planNeedsBrief' : 'web.planBlockedOwner')
1544
- row.append(id, why)
1545
- el.planWaiting.appendChild(row)
1661
+ if (plan) {
1662
+ const waiting = core().planWaiting(plan.items)
1663
+ if (waiting.total > 0) {
1664
+ el.planWaiting.hidden = false
1665
+ const title = document.createElement('div')
1666
+ title.className = 'plan-waiting-title'
1667
+ title.textContent = t('web.planWaitingTitle')
1668
+ el.planWaiting.appendChild(title)
1669
+ for (const item of [...waiting.needsBrief.map(entry => [entry, 'needs_brief']), ...waiting.blocked.map(entry => [entry, 'blocked_owner'])]) {
1670
+ const row = document.createElement('div')
1671
+ row.className = 'plan-waiting-row'
1672
+ const id = document.createElement('span')
1673
+ id.className = 'plan-waiting-id'
1674
+ id.textContent = item[0].id
1675
+ const why = document.createElement('span')
1676
+ why.className = 'plan-waiting-why'
1677
+ why.textContent = t(item[1] === 'needs_brief' ? 'web.planNeedsBrief' : 'web.planBlockedOwner')
1678
+ row.append(id, why)
1679
+ el.planWaiting.appendChild(row)
1680
+ }
1681
+ } else {
1682
+ el.planWaiting.hidden = true
1683
+ }
1684
+ // The document decides membership and order; the work view answers what each row is doing right now (the gate, the
1685
+ // agent, the note), so the same row cannot say two different things in two places.
1686
+ const byId = new Map(rows.map(row => [row.id, row]))
1687
+ for (const item of core().filterPlanItems(plan.items, insights.planFilter)) {
1688
+ el.planList.appendChild(planRowNode(item, byId.get(item.id) || null))
1546
1689
  }
1547
1690
  } else {
1548
1691
  el.planWaiting.hidden = true
1549
1692
  }
1693
+ // Derived rows are not plan items, so the plan's filter does not apply: they are listed after the document's rows,
1694
+ // with their origin named beside the status.
1695
+ for (const item of derived) el.planList.appendChild(workRowNode(item))
1696
+ }
1550
1697
 
1551
- const items = core().filterPlanItems(plan.items, insights.planFilter)
1552
- for (const item of items) {
1553
- const row = document.createElement('button')
1554
- row.type = 'button'
1555
- row.className = 'plan-row'
1556
- row.dataset.status = item.status
1557
- row.setAttribute('role', 'listitem')
1558
- const id = document.createElement('span')
1559
- id.className = 'plan-id'
1560
- id.textContent = item.id
1561
- const title = document.createElement('span')
1562
- title.className = 'plan-title'
1563
- title.textContent = item.title
1564
- // A row the document no longer lists keeps its status, but the badge says so explicitly: without it the row
1565
- // looks like ordinary open work that nobody is picking up.
1566
- row.append(id, title, planStatusBadge(item.missing_since ? 'missing' : item.status))
1567
- row.addEventListener('click', () => showPlanDetail(item))
1568
- el.planList.appendChild(row)
1698
+ // The detail panel for a derived row: the same shape as a plan item's, minus the plan's own fields (a spec row has no
1699
+ // brief record and no document line), plus the agent that holds it and the note that explains the status.
1700
+ function showWorkItem(item) {
1701
+ el.planDetail.replaceChildren()
1702
+ const holder = item.holder
1703
+ ? t(item.holder.role === 'dev' ? 'flow.work.holder_dev' : 'flow.work.holder_reviewer', { agent: item.holder.agent_id })
1704
+ : '—'
1705
+ const rows = [
1706
+ [t('web.planStatus'), workStatusText(item)],
1707
+ [t('common.agent'), holder],
1708
+ [t('web.planCommit'), item.head || '—'],
1709
+ ]
1710
+ for (const [label, value] of rows) {
1711
+ const row = document.createElement('div')
1712
+ row.className = 'plan-detail-row'
1713
+ const key = document.createElement('span')
1714
+ key.className = 'plan-detail-label'
1715
+ key.textContent = label
1716
+ const val = document.createElement('span')
1717
+ val.className = 'plan-detail-value'
1718
+ val.textContent = value
1719
+ row.append(key, val)
1720
+ el.planDetail.appendChild(row)
1569
1721
  }
1722
+ if (item.note) {
1723
+ const note = document.createElement('div')
1724
+ note.className = 'plan-detail-note'
1725
+ note.textContent = item.note
1726
+ el.planDetail.appendChild(note)
1727
+ }
1728
+ el.planDetail.hidden = false
1570
1729
  }
1571
1730
 
1572
1731
  function showPlanDetail(item) {
@@ -1777,10 +1936,25 @@
1777
1936
  const dot = document.createElement('span')
1778
1937
  dot.className = 'dot'
1779
1938
  dot.dataset.status = agent.status
1939
+ if (agent.attention) dot.dataset.attention = agent.attention.reason
1780
1940
  tail.appendChild(dot)
1781
1941
  const status = document.createElement('span')
1782
1942
  status.className = 'card-status'
1783
- status.textContent = statusLabel(agent.status)
1943
+ // Attention takes over this slot instead of sitting next to it: two indicators on one
1944
+ // card read as two different states. The lifecycle value is not lost: it moves into
1945
+ // the tooltip and comes back by itself when the prompt is resolved.
1946
+ if (agent.attention) {
1947
+ const label = attentionLabel(agent.attention.reason)
1948
+ status.dataset.attention = agent.attention.reason
1949
+ status.textContent = label
1950
+ status.title = agent.attention.detail
1951
+ ? `${label} · ${statusLabel(agent.status)} · ${agent.attention.detail}`
1952
+ : `${label} · ${statusLabel(agent.status)}`
1953
+ card.dataset.attention = agent.attention.reason
1954
+ } else {
1955
+ status.textContent = statusLabel(agent.status)
1956
+ status.title = statusLabel(agent.status)
1957
+ }
1784
1958
  tail.appendChild(status)
1785
1959
  const availability = document.createElement('span')
1786
1960
  availability.className = 'card-open-hint'
@@ -2819,6 +2993,21 @@
2819
2993
  return status
2820
2994
  }
2821
2995
 
2996
+ function attentionLabel(reason) {
2997
+ if (reason === 'approval') return t('web.needsApproval')
2998
+ if (reason === 'input') return t('web.needsAnswer')
2999
+ if (reason === 'question') return t('web.hasQuestion')
3000
+ return t('web.needsAttention')
3001
+ }
3002
+
3003
+ // An inactive tab keeps its title: "(!2) ReevesAgents web" is the only signal that
3004
+ // survives when the browser chrome hides the badge. The prefix is stripped from the
3005
+ // live title instead of a captured one, so brand/theme changes to the title survive.
3006
+ function updateAttentionTitle(count) {
3007
+ const raw = document.title.replace(/^\(\d+\)\s*/, '')
3008
+ document.title = count > 0 ? `(${count}) ${raw}` : raw
3009
+ }
3010
+
2822
3011
  function shortIso(value) {
2823
3012
  if (!value) return t('web.unknown')
2824
3013
  return `${String(value).replace('T', ' ').slice(0, 16)}Z`
@@ -265,7 +265,9 @@
265
265
  <button id="plan-filter-waiting" class="chip" type="button">Waiting for you</button>
266
266
  </div>
267
267
  <div id="plan-waiting" class="plan-waiting" hidden></div>
268
- <div id="plan-list" class="plan-list" role="list" aria-label="plan items"></div>
268
+ <div id="plan-dispatch-unknown" class="plan-dispatch-unknown" hidden></div>
269
+ <div id="plan-derived" class="plan-derived" hidden></div>
270
+ <div id="plan-list" class="plan-list" role="list" aria-label="work items"></div>
269
271
  <div id="plan-detail" class="plan-detail" hidden></div>
270
272
  <div id="plan-empty" class="logs-empty" hidden>
271
273
  <div class="empty-title">No plan yet</div>
@@ -28,10 +28,12 @@
28
28
  return openRunId !== null && openRunId !== undefined && openRunId === runId ? 'true' : 'false'
29
29
  }
30
30
 
31
- // Is there a plan to open for this card? The badge itself is a label and never a control; the plan icon beside it is drawn
32
- // only when the answer is yes, because a button that cannot do anything is worse than no button (T1.6.6).
31
+ // Is there anything to open for this card? The badge itself is a label and never a control; the icon beside it is drawn
32
+ // only when the answer is yes, because a button that cannot do anything is worse than no button (T1.6.6). A flow driven
33
+ // from the spec queue has no plan document and still has work to show — the task in work, who holds it, which commit
34
+ // closed the last one — so the view's row count opens the tab too.
33
35
  function planIconVisible(flow) {
34
- return Boolean(flow && flow.plan)
36
+ return Boolean(flow && (flow.plan || flow.work_total > 0))
35
37
  }
36
38
 
37
39
  // `12/23` plus the percentage the progress bar needs. A plan with no items is `0/0` and a 0 % bar, not a crash.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reevesagents",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Local tmux-first workspace manager for AI CLI agents",
5
5
  "mcpName": "io.github.mertkayacs/reevesagents",
6
6
  "type": "module",
@@ -50,13 +50,14 @@
50
50
  },
51
51
  "pnpm": {
52
52
  "overrides": {
53
- "@hono/node-server": "2.1.6",
53
+ "@hono/node-server": "2.1.8",
54
54
  "body-parser": "2.4.0",
55
- "brace-expansion": "5.0.12",
55
+ "brace-expansion": "5.0.13",
56
56
  "esbuild": "0.28.2",
57
57
  "fast-uri": "3.1.9",
58
- "hono": "4.13.16",
59
- "ip-address": "10.7.5",
58
+ "hono": "4.13.18",
59
+ "ip-address": "10.7.6",
60
+ "minimatch": "11.0.8",
60
61
  "qs": "6.16.1",
61
62
  "source-map-js": "1.2.2"
62
63
  }
@@ -66,7 +67,7 @@
66
67
  "@types/node": "25.9.9",
67
68
  "@types/react": "19.3.0",
68
69
  "@types/ws": "8.18.2",
69
- "@typescript-eslint/parser": "8.72.1",
70
+ "@typescript-eslint/parser": "8.72.2",
70
71
  "@xterm/addon-fit": "0.11.0",
71
72
  "@xterm/xterm": "6.0.0",
72
73
  "eslint": "10.13.0",
@@ -74,7 +75,7 @@
74
75
  "ink-testing-library": "4.0.0",
75
76
  "tsup": "8.5.1",
76
77
  "typescript": "6.0.3",
77
- "vite": "8.3.5",
78
+ "vite": "8.3.7",
78
79
  "vitest": "5.0.5"
79
80
  },
80
81
  "engines": {