herdr-orchestra 6.48.2 → 6.48.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,44 @@
2
2
 
3
3
  All notable changes. Versions follow [semantic versioning](https://semver.org).
4
4
 
5
+ ## [6.48.3] - 2026-12-02
6
+
7
+ `orch board` can now show one agent in detail. On the Agents tab or the Tokens tab, pick an agent with up/down and press Enter. You see its tool, model, role, skills and what it does right now; its tokens (in, cached, out) in total, for the job it runs now, and for each milestone it worked on; its milestones with the time it spent on each; and its pane. Esc or Backspace goes back to the list. The numbers come from the same agent logs the board already reads, so no agent spends a single extra token. Where a tool keeps no counts (OpenCode, an old agy), it says "n/a" and why, never a guess.
8
+
9
+ Every agent name on the board now has its job in brackets: `codex-1 (coder)`, `rev-1 (reviewer)`, `lead-1 (lead)`, on the Milestones, Agents and Tokens tabs and in the details.
10
+
11
+ Example (Enter on codex-1):
12
+ ```
13
+ orch board · agent 18:47 · live
14
+
15
+ ● codex-1 (coder)
16
+ tool: codex
17
+ model: gpt-6.2-sol (medium)
18
+ state: M2 · building
19
+ step role: senior frontend engineer
20
+ pane: codex-1 · coder · M2
21
+
22
+ TOKENS read live from its own log
23
+ in cached out
24
+ total 100k 76k 7k
25
+ now (M2) 40k 30k 4k
26
+ M2 40k 30k 4k
27
+ M3 60k 46k 3k
28
+
29
+ MILESTONES 1 landed of 2
30
+ ● M2 Card building 1m
31
+ ✔ M3 Codex step landed 8m
32
+
33
+ [j] jump to its pane [f] changed files [esc ⌫ q] back
34
+ ```
35
+
36
+ ### Changed
37
+ - Enter on an agent (Agents tab) used to jump straight to its pane. It now opens the details, and `j` there jumps to the pane (in the board popup it still closes the popup too). The footer says so.
38
+
39
+ ### Added
40
+ - `orch board`: agent details from the Agents and Tokens tabs (Enter; Esc, Backspace or q back; `j` jump; `f` its milestone's changed files). `orch board --once --agent <name>` prints them once.
41
+ - Every agent name on the board shows its job in brackets.
42
+
5
43
  ## [6.48.2] - 2026-12-02
6
44
 
7
45
  `orch board` now has three tabs: Milestones, Agents and Tokens. The run's top lines (how many landed, time so far, total tokens, who needs you) stay on every tab, so nothing important is ever hidden. Switch with Tab, the left and right arrows, or the keys 1, 2 and 3. The board opens on Milestones. Every tab updates live, and the old keys still work: up/down to pick, Enter for a milestone's changed files (Milestones tab) or to jump to an agent (Agents tab), f, w and q. Agent names show in full, however long they are.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 6.48.2
1
+ 6.48.3
Binary file
package/bin/orch CHANGED
@@ -3032,23 +3032,26 @@ def token_live(st, agent, kind, marker, start, end=None):
3032
3032
 
3033
3033
  def agent_tokens(st):
3034
3034
  """Tokens per agent (lead, each coder, the reviewer): every finished job plus the one it runs now, read live.
3035
- [{name, role, kind, in, cached, out, known, jobs, na: [why], task: running milestone, now: its tokens so far}]"""
3035
+ [{name, role, kind, in, cached, out, known, jobs, na: [why], task: running milestone, now: its tokens so far,
3036
+ per: {milestone: the same counts for its jobs on that milestone}}]"""
3036
3037
  rows, t_now = {}, now()
3037
3038
 
3038
3039
  def row(name, role, kind):
3039
3040
  if name not in rows:
3040
3041
  rows[name] = {"name": name, "role": role, "kind": kind, "in": 0, "cached": 0, "out": 0, "known": 0,
3041
- "jobs": 0, "na": [], "task": None, "now": None}
3042
+ "jobs": 0, "na": [], "task": None, "now": None, "per": {}}
3042
3043
  return rows[name]
3043
3044
 
3044
- def add(r, u):
3045
- r["jobs"] += 1
3046
- if "na" in u:
3047
- r["na"].append(u["na"])
3048
- return
3049
- r["known"] += 1
3050
- for k in ("in", "cached", "out"):
3051
- r[k] += int(u.get(k) or 0)
3045
+ def add(r, u, tid=None):
3046
+ for x in [r] + ([r["per"].setdefault(tid, {"in": 0, "cached": 0, "out": 0, "known": 0, "jobs": 0, "na": []})]
3047
+ if tid else []):
3048
+ x["jobs"] += 1
3049
+ if "na" in u:
3050
+ x["na"].append(u["na"])
3051
+ continue
3052
+ x["known"] += 1
3053
+ for k in ("in", "cached", "out"):
3054
+ x[k] += int(u.get(k) or 0)
3052
3055
  ld, run = st.get("lead") or {}, st.get("run") or {}
3053
3056
  if ld.get("name"):
3054
3057
  r = row(ld["name"], "lead", ld.get("kind"))
@@ -3077,14 +3080,14 @@ def agent_tokens(st):
3077
3080
  if t_now - a.get("end", t_now) < TOKEN_GIVE_UP_S:
3078
3081
  continue
3079
3082
  u = {"na": f"no {r['kind']} log has this job's prompt"}
3080
- add(r, u if isinstance(u, dict) else {"na": "not read"})
3083
+ add(r, u if isinstance(u, dict) else {"na": "not read"}, tid)
3081
3084
  w = t.get("wait") or {}
3082
3085
  if w.get("agent") and w.get("prompt") and t.get("status") in ACTIVE:
3083
3086
  r = row(w["agent"], "reviewer" if w.get("kind") == "reviewer" else "coder", agent_kind_of(st, w["agent"]))
3084
3087
  u = token_live(st, w["agent"], r["kind"], token_marker(w["prompt"]), w.get("started", w.get("since", 0)))
3085
3088
  r["task"], r["now"] = tid, u or {"in": 0, "cached": 0, "out": 0}
3086
3089
  if u:
3087
- add(r, u)
3090
+ add(r, u, tid)
3088
3091
  return list(rows.values())
3089
3092
 
3090
3093
 
@@ -9773,6 +9776,13 @@ def view_model(st=None, recent=40):
9773
9776
  by_model.setdefault(a["model"], []).append(a["usage"])
9774
9777
  open_ev = [e for e in st.get("lead_events", []) if e.get("task") == tid and e["kind"] in LEAD_BLOCKING
9775
9778
  and event_open(st, e)]
9779
+ by_agent = {} # each agent's time and jobs on this milestone (the board's details)
9780
+ for a in atts + ([{"agent": w.get("agent"), "kind": w.get("kind"), "secs": cur}] if cur else []):
9781
+ if a.get("agent"):
9782
+ b = by_agent.setdefault(a["agent"], {"secs": 0, "jobs": 0, "review": False})
9783
+ b["secs"] += int(a.get("secs") or 0)
9784
+ b["jobs"] += 1
9785
+ b["review"] = b["review"] or a.get("kind") == "reviewer"
9776
9786
  ms.append({
9777
9787
  "id": tid, "title": t.get("title", tid), "plain": t.get("plain") or "",
9778
9788
  "desc": (t.get("plain") or t.get("title") or tid).strip(),
@@ -9790,7 +9800,7 @@ def view_model(st=None, recent=40):
9790
9800
  "attempts": [{"kind": a.get("kind"), "agent": a.get("agent"), "model": a.get("model"),
9791
9801
  "tier": a.get("tier"), "secs": a.get("secs"), "outcome": a.get("outcome")}
9792
9802
  for a in atts[-12:]],
9793
- "files": t.get("files", [])[:20],
9803
+ "files": t.get("files", [])[:20], "by_agent": by_agent,
9794
9804
  })
9795
9805
  agents = []
9796
9806
  if st.get("lead"):
@@ -9818,7 +9828,9 @@ def view_model(st=None, recent=40):
9818
9828
  steps = agent_steps(st)
9819
9829
  except Exception: # a broken plan or registry never stops the board
9820
9830
  steps = {}
9831
+ labels = pane_label_map(st)
9821
9832
  for a in agents:
9833
+ a["pane"], a["label"] = agent_info(st, a["name"]).get("pane"), labels.get(a["name"]) # the board's details
9822
9834
  sp = steps.get(a["name"])
9823
9835
  if sp and sp["task"] == a.get("task"):
9824
9836
  a["step_role"], a["skills"] = sp["role"], sp["skills"]
@@ -10735,6 +10747,11 @@ def changes_tree_lines(ch, width=100, color=True, sel=None):
10735
10747
  return out, rows
10736
10748
 
10737
10749
 
10750
+ def _named(name, role):
10751
+ """An agent's name on the board, always in full, with its job in brackets: `codex-1 (coder)`."""
10752
+ return f"{name} ({role})" if name and role else str(name or "")
10753
+
10754
+
10738
10755
  def _fmt_min(s):
10739
10756
  if s is None:
10740
10757
  return "?"
@@ -10787,7 +10804,7 @@ def render_board(vm, width=100, color=True, sel=None, note="", tab=None):
10787
10804
  def line(m, pre, sub):
10788
10805
  g = m["group"]
10789
10806
  word = m["word"] + (f" {m['fix']}" if m["status"] == "needs-fix" and m.get("fix") else "")
10790
- who = m.get("worker") or ""
10807
+ who = _named(m.get("worker"), "coder")
10791
10808
  extra = (f"{_fmt_min(m['spent_s'])} of ~{_fmt_min(m['estimate_s'])}" if m.get("started")
10792
10809
  and m.get("estimate_s") else f"{_fmt_min(m['spent_s'])}" if m["spent_s"] else "")
10793
10810
  mt = m.get("tokens")
@@ -10810,7 +10827,7 @@ def render_board(vm, width=100, color=True, sel=None, note="", tab=None):
10810
10827
  if m["group"] == "needs_you" and (m.get("question") or m.get("reason")):
10811
10828
  out.append(" " + sub + c("r", cut(f"\"{m.get('question') or m.get('reason')}\"", width - len(sub) - 2)))
10812
10829
 
10813
- nw_ = max([12] + [len(str(a.get("name") or "")) for a in (vm.get("agents") or []) + at]) # names in full
10830
+ nw_ = max([12] + [len(_named(a.get("name"), a.get("role"))) for a in (vm.get("agents") or []) + at]) # in full
10814
10831
 
10815
10832
  def agents_part():
10816
10833
  for i, a in enumerate(vm["agents"]):
@@ -10818,7 +10835,7 @@ def render_board(vm, width=100, color=True, sel=None, note="", tab=None):
10818
10835
  col = "a" if a["role"] == "lead" else ("p" if a["role"] == "reviewer" else "b") if a.get("task") else "d"
10819
10836
  mark = "›" if picked == ("a", i) else " "
10820
10837
  out.append(f"{mark}{c(col, '◆' if a['role'] == 'lead' else '●' if busy else '○')} "
10821
- f"{a['name']:<{nw_}} {str(a.get('kind') or ''):<8} {str(a.get('tier') or ''):<7} "
10838
+ f"{_named(a['name'], a['role']):<{nw_}} {str(a.get('kind') or ''):<8} {str(a.get('tier') or ''):<7} "
10822
10839
  + c(col if busy else "d", (f"{a['task']} · " if a.get("task") else "") + a["state"]))
10823
10840
  if a.get("step_role") or a.get("skills"):
10824
10841
  sk = ", ".join(x["name"] + (f" ({x['note']})" if x.get("note") else "") for x in a.get("skills") or [])
@@ -10830,13 +10847,15 @@ def render_board(vm, width=100, color=True, sel=None, note="", tab=None):
10830
10847
  if not at:
10831
10848
  out.append(c("d", "No token counts yet: they show once an agent has done a job."))
10832
10849
  return
10850
+ pk = " " if tab == "t" and sel is not None else "" # picking a row: a column for the › mark
10833
10851
  out.extend(([c("d", "TOKENS") + c("d", " read live from each agent's own log")] if tab is None else
10834
10852
  [c("d", "read live from each agent's own log")])
10835
- + [c("d", f" {'':<{nw_}} {'':<8} {'in':>7} {'cached':>8} {'out':>7}")])
10836
- for r in at:
10853
+ + [c("d", f"{pk} {'':<{nw_}} {'':<8} {'in':>7} {'cached':>8} {'out':>7}")])
10854
+ for i, r in enumerate(at):
10837
10855
  col = "a" if r["role"] == "lead" else "p" if r["role"] == "reviewer" else "b"
10838
- mark = c(col, "◆" if r["role"] == "lead" else "●" if r.get("task") else "○")
10839
- head = f"{mark} {r['name']:<{nw_}} {str(r.get('kind') or ''):<8} "
10856
+ mark = (("›" if picked == ("t", i) else " ") if pk else "") \
10857
+ + c(col, "◆" if r["role"] == "lead" else "●" if r.get("task") else "○")
10858
+ head = f"{mark} {_named(r['name'], r['role']):<{nw_}} {str(r.get('kind') or ''):<8} "
10840
10859
  if r.get("kind") and r["kind"] not in TOKEN_KINDS:
10841
10860
  out.append(head + c("d", f"n/a: orch can't read {r['kind']}'s logs yet"))
10842
10861
  continue
@@ -10856,7 +10875,7 @@ def render_board(vm, width=100, color=True, sel=None, note="", tab=None):
10856
10875
  out.append(head + f"{_tk(r['in']):>7} {_tk(r['cached']):>8} {_tk(r['out']):>7}"
10857
10876
  + (c("d", " " + " · ".join(tnote)) if tnote else ""))
10858
10877
  tot_in, tot_out = sum(r["in"] for r in at), sum(r["out"] for r in at)
10859
- out.append(c("B", f" {'total':<{nw_ + 9}} {_tk(tot_in):>7} {_tk(sum(r['cached'] for r in at)):>8} {_tk(tot_out):>7}")
10878
+ out.append(c("B", f"{pk} {'total':<{nw_ + 9}} {_tk(tot_in):>7} {_tk(sum(r['cached'] for r in at)):>8} {_tk(tot_out):>7}")
10860
10879
  + (c("d", " + some jobs n/a") if any(r["na"] for r in at) else ""))
10861
10880
  if tab == "t":
10862
10881
  per = [f"{m['id']} " + (f"{_tk(m['tokens']['total'])}{'+' if m['tokens']['partial'] else ''}"
@@ -10878,11 +10897,12 @@ def render_board(vm, width=100, color=True, sel=None, note="", tab=None):
10878
10897
  for e in vm["recent"][:6]:
10879
10898
  out.append(c("d", time.strftime("%H:%M", time.localtime(e["ts"] or 0))) + f" {e['task']} {e['from']} → {e['to']}"
10880
10899
  + (c("d", f" {cut(e.get('why') or '', 50)}") if e.get("why") else ""))
10881
- keys = {None: "[↑↓] pick [enter] a milestone's changed files / jump to an agent [f] changed files [w] web view "
10882
- "[q] close",
10900
+ keys = {None: "[↑↓] pick [enter] a milestone's changed files / an agent's details [f] changed files "
10901
+ "[w] web view [q] close",
10883
10902
  "m": "[tab ←→ 1-3] switch [↑↓] pick [enter] changed files [f] files [w] web [q] close",
10884
- "a": "[tab ←→ 1-3] switch [↑↓] pick [enter] jump to that agent [f] files [w] web [q] close",
10885
- "t": "[tab ←→ 1-3] switch [f] files [w] web [q] close"}[tab]
10903
+ "a": "[tab ←→ 1-3] switch [↑↓] pick [enter] details ([j] there: jump to that agent) [f] files [w] web "
10904
+ "[q] close",
10905
+ "t": "[tab ←→ 1-3] switch [↑↓] pick [enter] that agent's details [f] files [w] web [q] close"}[tab]
10886
10906
  foot = (["", c("a", note)] if note else []) + ["", c("d", keys)]
10887
10907
  return BoardLines(out + foot, foot=len(foot))
10888
10908
 
@@ -10933,8 +10953,10 @@ BOARD_TABS = (("m", "Milestones"), ("a", "Agents"), ("t", "Tokens")) # the liv
10933
10953
 
10934
10954
  def board_rows(vm, tab=None):
10935
10955
  """What [↑↓] moves through on the board: the Milestones tab its milestones (board order), the Agents tab its
10936
- agents, the Tokens tab nothing; with no tab (the whole board) every milestone, then every agent."""
10956
+ agents, the Tokens tab its token rows; with no tab (the whole board) every milestone, then every agent."""
10937
10957
  ms = [("m", tid) for tid, _, _ in board_tree(vm)] if tab in (None, "m") else []
10958
+ if tab == "t":
10959
+ return [("t", i) for i in range(len(vm.get("agent_tokens") or []))]
10938
10960
  return ms + ([("a", i) for i in range(len(vm.get("agents", [])))] if tab in (None, "a") else [])
10939
10961
 
10940
10962
 
@@ -10956,6 +10978,85 @@ def board_default_milestone(vm, row=None):
10956
10978
  return (landed[-1] if landed else ms[0])["id"] if ms else None
10957
10979
 
10958
10980
 
10981
+ def board_agent_names(vm, tab):
10982
+ """The agent each row of the Agents or Tokens tab opens with [enter] (names, in the tab's order)."""
10983
+ return [a["name"] for a in (vm.get("agent_tokens") if tab == "t" else vm.get("agents")) or []]
10984
+
10985
+
10986
+ def render_agent(vm, name, width=100, color=True, note=""):
10987
+ """The board's detail view of one agent (6.48.3): who it is, what it does now, its tokens (in total, now and per
10988
+ milestone) and its milestones. Read from the same run summary as the board: no agent is asked anything."""
10989
+ def c(k, s):
10990
+ return f"\x1b[{_C[k]}m{s}\x1b[0m" if color and k else s
10991
+
10992
+ def cut(s, n):
10993
+ return s if len(s) <= n else s[:max(0, n - 1)] + "…"
10994
+ a = next((x for x in vm.get("agents") or [] if x["name"] == name), None) or {}
10995
+ r = next((x for x in vm.get("agent_tokens") or [] if x["name"] == name), None)
10996
+ keys = "[j] jump to its pane [f] changed files [esc ⌫ q] back"
10997
+ foot = (["", c("a", note)] if note else []) + ["", c("d", keys)]
10998
+ out = [c("a", "orch board · agent") + c("d", f" {time.strftime('%H:%M')} · live"), ""]
10999
+ if not a and not r:
11000
+ return BoardLines(out + [f"No agent named {name} in this run."] + foot, foot=len(foot))
11001
+ role, kind = a.get("role") or (r or {}).get("role") or "?", a.get("kind") or (r or {}).get("kind")
11002
+ col = "a" if role == "lead" else "p" if role == "reviewer" else "b"
11003
+ task = a.get("task") or (r or {}).get("task")
11004
+ out.append(c(col, "◆ " if role == "lead" else "● " if task else "○ ") + c("B", _named(name, role)))
11005
+ model = a.get("model") or "not known"
11006
+ rows = [("tool", kind or "not known"),
11007
+ ("model", model + (f" ({a['tier']})" if a.get("tier") else "")),
11008
+ ("state", (f"{task} · " if task and role != "lead" else "") + (a.get("state") or ("working" if task else "free")))]
11009
+ if a.get("step_role"):
11010
+ rows.append(("step role", a["step_role"]))
11011
+ if role == "coder":
11012
+ sk = ", ".join(x["name"] + (f" ({x['note']})" if x.get("note") else "") for x in a.get("skills") or [])
11013
+ rows.append(("skills", sk or "none for this step"))
11014
+ rows.append(("pane", (a.get("label") or name) + (f" (herdr pane {a['pane']})" if a.get("pane") else "")))
11015
+ out += [c("d", f" {k + ':':<11}") + cut(str(v), width - 14) for k, v in rows]
11016
+
11017
+ out += ["", c("d", "TOKENS") + c("d", " read live from its own log")]
11018
+ nums = lambda u: f"{_tk(u['in']):>7} {_tk(u['cached']):>8} {_tk(u['out']):>7}"
11019
+ if not kind:
11020
+ out.append(" n/a: orch does not know which tool this agent runs")
11021
+ elif kind not in TOKEN_KINDS:
11022
+ out.append(f" n/a: orch can't read {kind}'s logs yet, so no number is shown (never a guess)")
11023
+ elif not r or (not r["jobs"] and not r.get("task")):
11024
+ out.append(c("d", " no jobs yet"))
11025
+ else:
11026
+ out.append(c("d", f" {'':<16} {'in':>7} {'cached':>8} {'out':>7}"))
11027
+ tot = "whole run" if role == "lead" else "total"
11028
+ out.append(f" {tot:<16} " + (nums(r) if r["known"] else c("d", cut(f"n/a: {r['na'][0]}", width - 20)) if r["na"]
11029
+ else nums(r)) + (c("d", f" + {len(r['na'])} job(s) n/a") if r["known"] and r["na"] else ""))
11030
+ if r.get("task"):
11031
+ nw = r.get("now") or {}
11032
+ out.append(f" {'now (' + r['task'] + ')':<16} " + (c("d", cut(f"n/a: {nw['na']}", width - 20)) if "na" in nw
11033
+ else nums({"in": 0, "cached": 0, "out": 0, **nw})))
11034
+ order = [m["id"] for m in vm.get("milestones", [])]
11035
+ for tid in sorted(r.get("per") or {}, key=lambda t: order.index(t) if t in order else len(order)):
11036
+ u = r["per"][tid]
11037
+ out.append(f" {tid:<16} " + (nums(u) if u["known"] else c("d", cut(f"n/a: {u['na'][0]}", width - 20)))
11038
+ + (c("d", f" + {len(u['na'])} job(s) n/a: {u['na'][0]}") if u["known"] and u["na"] else ""))
11039
+ if role == "lead":
11040
+ out.append(c("d", " the lead works for the whole run, so it has no count per milestone"))
11041
+
11042
+ mine = [m for m in vm.get("milestones", []) if name in (m.get("by_agent") or {}) or m.get("worker") == name]
11043
+ landed = [m for m in mine if m["group"] == "landed"]
11044
+ out += ["", c("d", "MILESTONES") + c("d", f" {len(landed)} landed of {len(mine)}" if mine else "")]
11045
+ if not mine:
11046
+ out.append(c("d", " none yet" if role != "lead" else " the lead plans and steers; it builds no milestone"))
11047
+ tw = min(max([0] + [len(f" ○ {m['id']} {m['title']}") for m in mine]), max(20, width - 40))
11048
+ ww = max([0] + [len(m["word"]) for m in mine])
11049
+ for m in mine:
11050
+ b = (m.get("by_agent") or {}).get(name) or {"secs": 0, "jobs": 0, "review": False}
11051
+ g = m["group"]
11052
+ what = "reviewed" if b["review"] and role == "reviewer" else ""
11053
+ extra = f"{_fmt_min(b['secs'])}" + (f" · {b['jobs']} jobs" if b["jobs"] > 1 else "") + (f" · {what}" if what else "")
11054
+ head = cut(f" {_GROUP_ICON[g]} {m['id']} {m['title']}", tw).ljust(tw)
11055
+ out.append(head.replace(_GROUP_ICON[g], c(_GROUP_C[g], _GROUP_ICON[g]), 1)
11056
+ + " " + c(_GROUP_C[g], m["word"].ljust(ww)) + c("d", f" {extra}"))
11057
+ return BoardLines(out + foot, foot=len(foot))
11058
+
11059
+
10959
11060
  def board_error_lines(e, what="this run", back="[q] close"):
10960
11061
  """What the live board shows when drawing failed, instead of ending (herdr would close the popup and the error
10961
11062
  with it). The full traceback is saved for a bug report; the board tries again when the run changes."""
@@ -10991,7 +11092,7 @@ def render_changes(ch, width=100, height=40, color=True, sel=0, top=0):
10991
11092
  head = [c("a", "orch board · changed files") + c("d", f" {time.strftime('%H:%M')}"
10992
11093
  + (" · live" if ch["kind"] == "live" else "")),
10993
11094
  c(_GROUP_C.get(g, "d"), f"{_GROUP_ICON.get(g, '○')} ") + c("B", _safe(f"{ch['id']} {ch['title']}", width - 30))
10994
- + c("d", f" {VIEW_WORDS.get(ch['status'], ch['status'])}" + (f" · {ch['worker']}" if ch.get("worker") else "")),
11095
+ + c("d", f" {VIEW_WORDS.get(ch['status'], ch['status'])}" + (f" · {_named(ch['worker'], 'coder')}" if ch.get("worker") else "")),
10995
11096
  c("d", _safe(ch["note"], width))]
10996
11097
  tot = ch["totals"]
10997
11098
  if ch["files"]:
@@ -11141,10 +11242,11 @@ def cmd_changes(args):
11141
11242
 
11142
11243
 
11143
11244
  def cmd_board(args):
11144
- """orch board [--once] [--tab milestones|agents|tokens] [--no-color] -> the run as text, redrawn when it changes
11145
- (for a herdr pane or popup). Three tabs under the top lines: Milestones, Agents, Tokens ([tab], [←→] or 1-3).
11146
- [f] or [enter] on a milestone opens its changed files, [enter] on a file its diff; q goes back one screen.
11147
- [enter] on an agent jumps to it; in the board popup (prefix+a) it also closes the popup."""
11245
+ """orch board [--once] [--tab milestones|agents|tokens] [--agent <name>] [--no-color] -> the run as text, redrawn
11246
+ when it changes (for a herdr pane or popup). Three tabs under the top lines: Milestones, Agents, Tokens ([tab],
11247
+ [←→] or 1-3). [f] or [enter] on a milestone opens its changed files, [enter] on a file its diff; q goes back one
11248
+ screen. [enter] on an agent (Agents or Tokens tab) opens its details; [j] there jumps to its pane, and in the
11249
+ board popup (prefix+a) also closes the popup. --once --agent <name> prints one agent's details."""
11148
11250
  # live needs a keyboard and a screen: with stdin or stdout not a terminal, draw once (termios would fail)
11149
11251
  once = "--once" in args or not (sys.stdout.isatty() and sys.stdin.isatty())
11150
11252
  color = "--no-color" not in args and sys.stdout.isatty() and not os.environ.get("NO_COLOR")
@@ -11154,8 +11256,14 @@ def cmd_board(args):
11154
11256
  tab = next((k for k, w in BOARD_TABS if want in (k, w.lower())), None) or \
11155
11257
  die("usage: orch board [--once] [--tab milestones|agents|tokens]")
11156
11258
  if once:
11157
- print("\n".join(render_board(view_model(), shutil.get_terminal_size((100, 40)).columns, color,
11158
- tab=tab if "--tab" in args else None)))
11259
+ vm, cols = view_model(), shutil.get_terminal_size((100, 40)).columns
11260
+ if "--agent" in args:
11261
+ name = (args[args.index("--agent") + 1:] or [""])[0]
11262
+ if name not in board_agent_names(vm, "a") + board_agent_names(vm, "t"):
11263
+ die(f"no agent named {name or '?'} in this run (`orch board --once --tab agents` lists them)")
11264
+ print("\n".join(render_agent(vm, name, cols, color)))
11265
+ return
11266
+ print("\n".join(render_board(vm, cols, color, tab=tab if "--tab" in args else None)))
11159
11267
  return
11160
11268
  import select
11161
11269
  import termios
@@ -11167,6 +11275,7 @@ def cmd_board(args):
11167
11275
  screen, vm, need, redraw = "run", {}, True, True # need: read the run (and git) again; redraw: draw again
11168
11276
  mid, ch, fsel, ftop = None, None, 0, 0 # the changed-files screen: milestone, its changes, picked file, scroll
11169
11277
  dfile, dlines, derr, dtop = None, [], None, 0 # the diff screen
11278
+ aname, back = None, "run" # the agent details screen; where q on the changed files goes
11170
11279
  try:
11171
11280
  # TCSANOW, not the default TCSAFLUSH: that throws away every key typed while the board was starting up
11172
11281
  tty.setcbreak(fd, termios.TCSANOW)
@@ -11183,7 +11292,7 @@ def cmd_board(args):
11183
11292
  if need:
11184
11293
  fetched = time.time()
11185
11294
  vm = view_model()
11186
- if screen != "run":
11295
+ if screen in ("files", "diff"):
11187
11296
  st = _board_state()
11188
11297
  ch = milestone_changes(st, mid)
11189
11298
  if screen == "diff":
@@ -11191,6 +11300,8 @@ def cmd_board(args):
11191
11300
  need = redraw = False
11192
11301
  if screen == "run":
11193
11302
  lines = render_board(vm, size.columns, color, sel, note, tab)
11303
+ elif screen == "agent":
11304
+ lines = render_agent(vm, aname, size.columns, color, note)
11194
11305
  elif screen == "files":
11195
11306
  fsel = min(fsel, max(0, len(ch["files"]) - 1))
11196
11307
  lines, ftop = render_changes(ch, size.columns, size.lines, color, fsel, ftop)
@@ -11199,7 +11310,8 @@ def cmd_board(args):
11199
11310
  lines, dtop = render_diff(ch, f, dlines, size.columns, size.lines, color, dtop, derr)
11200
11311
  except Exception as e: # noqa: BLE001 - a popup closes when its program ends: show it, keep going
11201
11312
  need = redraw = False
11202
- lines = board_error_lines(e, "this run" if screen == "run" else f"{mid}'s changes",
11313
+ lines = board_error_lines(e, "this run" if screen == "run" else f"{aname}'s details"
11314
+ if screen == "agent" else f"{mid}'s changes",
11203
11315
  "[q] close" if screen == "run" else "[q] back")
11204
11316
  sys.stdout.write("\x1b[H\x1b[2J" + "\n".join(fit_screen(lines, size.lines)))
11205
11317
  sys.stdout.flush()
@@ -11231,7 +11343,7 @@ def cmd_board(args):
11231
11343
  ids = [m["id"] for m in vm.get("milestones", [])]
11232
11344
  n = len(ch["files"]) if ch else 0
11233
11345
  if key in ("q", "Q", "\x1b"):
11234
- screen, ch, need = "run", None, True
11346
+ screen, ch, need = back, None, True
11235
11347
  elif key in (UP, "k") and n:
11236
11348
  fsel = max(0, fsel - 1)
11237
11349
  elif key in (DOWN, "j") and n:
@@ -11243,6 +11355,27 @@ def cmd_board(args):
11243
11355
  dfile, dtop, screen, need = ch["files"][fsel], 0, "diff", True
11244
11356
  redraw = True
11245
11357
  continue
11358
+ if screen == "agent":
11359
+ if key in ("q", "Q", "\x1b", "\x7f", "\x08", LEFT, "h"):
11360
+ screen, note, back = "run", "", "run"
11361
+ elif key in ("j", "J"):
11362
+ r2 = subprocess.run([HERDR, "agent", "focus", aname], text=True, capture_output=True)
11363
+ if r2.returncode == 0 and os.environ.get("HERDR_PLUGIN_ID") == VIEW_PLUGIN_ID:
11364
+ closed_by = f"j (jumped to {aname})" # in the popup: get out of the way of the agent
11365
+ break
11366
+ rl = next((x.get("role") for x in (vm.get("agents") or []) + (vm.get("agent_tokens") or [])
11367
+ if x["name"] == aname), None)
11368
+ note = f"{'jumped to' if r2.returncode == 0 else 'herdr could not focus'} {_named(aname, rl)}"
11369
+ elif key in ("f", "F"):
11370
+ a = next((x for x in vm.get("agents") or [] if x["name"] == aname), {})
11371
+ mine = [m["id"] for m in vm.get("milestones", []) if aname in (m.get("by_agent") or {})]
11372
+ mid = a.get("task") or (mine[-1] if mine else None)
11373
+ if mid:
11374
+ screen, back, ch, fsel, ftop, need = "files", "agent", None, 0, 0, True
11375
+ else:
11376
+ note = f"{aname} has no milestone yet"
11377
+ redraw = True
11378
+ continue
11246
11379
  rows = board_rows(vm, tab)
11247
11380
  n = len(rows)
11248
11381
  if key in ("q", "Q", "\x1b"):
@@ -11267,13 +11400,10 @@ def cmd_board(args):
11267
11400
  screen, ch, fsel, ftop, need = "files", None, 0, 0, True
11268
11401
  else:
11269
11402
  note = "no milestones in this run yet"
11270
- elif key in ("\r", "\n") and sel is not None and n:
11271
- a = vm["agents"][rows[sel][1]]
11272
- r2 = subprocess.run([HERDR, "agent", "focus", a["name"]], text=True, capture_output=True)
11273
- if r2.returncode == 0 and os.environ.get("HERDR_PLUGIN_ID") == VIEW_PLUGIN_ID:
11274
- closed_by = f"enter (jumped to {a['name']})" # in the popup: get out of the way of the agent
11275
- break
11276
- note = f"jumped to {a['name']}" if r2.returncode == 0 else f"herdr could not focus {a['name']}"
11403
+ elif key in ("\r", "\n") and sel is not None and sel < n: # an agent (Agents or Tokens tab)
11404
+ names = board_agent_names(vm, "t" if rows[sel][0] == "t" else "a")
11405
+ if rows[sel][1] < len(names):
11406
+ aname, screen, note = names[rows[sel][1]], "agent", ""
11277
11407
  elif key in ("w", "W"):
11278
11408
  r2 = subprocess.run([sys.executable, os.path.abspath(__file__), "view", "--bg"], text=True,
11279
11409
  capture_output=True, cwd=ROOT)
@@ -11396,9 +11526,10 @@ USAGE = """usage: orch <command> [args]
11396
11526
  "needs you" alert, time and cost, replay. --lan: also from your phone, with a secret link
11397
11527
  view stop|status|herdr-config|plugin link|key|unlink|refresh|app link|unlink
11398
11528
  stop it / show its link / sidebar lines for herdr's config / the optional herdr plugin
11399
- board [--once] [--tab milestones|agents|tokens] the run as text, redrawn when it changes: for a herdr pane or
11400
- popup (any terminal); tabs Milestones, Agents, Tokens ([tab], [←→] or 1-3);
11401
- [f] or [enter] on a milestone shows its changed files, [enter] on a file its diff
11529
+ board [--once] [--tab milestones|agents|tokens] [--agent <name>] the run as text, redrawn when it changes: for
11530
+ a herdr pane or popup (any terminal); tabs Milestones, Agents, Tokens ([tab], [←→] or 1-3);
11531
+ [f] or [enter] on a milestone shows its changed files, [enter] on a file its diff;
11532
+ [enter] on an agent its details (tokens, milestones), [j] there jumps to its pane
11402
11533
  changes [Mn [file]] [--json] what each milestone changed: files with +/- counts, or one file's diff
11403
11534
  (live while a coder works, unsaved files included; landed = its commit). Read-only
11404
11535
  report [--json] [--no-tokens] estimate vs actual time (why longer, who), tokens per milestone, rounds,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "herdr-orchestra",
3
- "version": "6.48.2",
3
+ "version": "6.48.3",
4
4
  "description": "Orchestrate AI coding agents (Claude Code, Codex, OpenCode, Amp, Pi) as one team: a lead plans, coders build, a reviewer checks, you get one PR. Runs in Herdr panes, or in one Pi window with subagents.",
5
5
  "license": "MIT",
6
6
  "bin": {