herdr-orchestra 6.44.2 → 6.45.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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes. Versions follow [semantic versioning](https://semver.org).
4
4
 
5
+ ## [6.45.0] - 2026-11-30
6
+
7
+ The board stopped showing the wrong run, the board popup key is set up by one command, and the board comes to the Herdr desktop app. A lead planned new work as `.orchestrate/sap-business-one-hana-plan.md` because `plan.md` still held the last, finished run. orch reads only `plan.md`, so the new plan was never loaded: the work got done, but orch never tracked it, and the board kept showing the old run. Separately, `orch view plugin link` linked the popup, but `prefix+a` did nothing: Herdr takes keys only from its own config, and nothing put the key there.
8
+
9
+ Example: M9 landed 6 days ago and its plan is still in `plan.md`. Before, the lead wrote the SAP plan under another name, and `orch sync` loaded the old M9 plan with only a warning. Now `orch lead plan` first moves the old plan to `.orchestrate/archive/2026-11-24-dashboard-dynamic-cards-plan.md` and tells the lead to write the new one in `plan.md`. If a new plan still lands under another name, `orch sync` stops and says which file to copy to `plan.md`. For the key, `orch view plugin key` adds `prefix+a` to Herdr's `config.toml` and makes Herdr reload it.
10
+
11
+ ### Fixed
12
+ - **A finished run's plan is archived when a new plan starts.** `orch lead plan` moves `.orchestrate/plan.md` to `.orchestrate/archive/<date>-<branch>-plan.md` (a second one the same day gets `-2`) when it is still the plan of a run that is over: every milestone landed, nothing running, the same `Branch:` as the run, not changed since. It prints `ARCHIVED ...`. A plan whose run is still going, or a new plan written after the run, is never moved.
13
+ - **The lead is told: one plan file.** The plan playbook says every plan, quick or full, goes in `.orchestrate/plan.md`, never under another name, and why.
14
+ - **`orch sync` stops instead of loading the old plan.** When `plan.md` is still the finished run's plan and a newer `.orchestrate/*.md` sits next to it, `orch sync` stops, names the file, and says how to keep the old plan and load the new one. While a run is going, a newer file is still only a warning.
15
+
16
+ ### Added
17
+ - **`orch view plugin key [<key>]`** puts the board popup key (default `prefix+a`) in Herdr's `config.toml` (`$XDG_CONFIG_HOME/herdr` or `~/.config/herdr`) once, and runs `herdr server reload-config`, so no restart is needed. A key the config already uses is refused, with a free one to pick. A key Herdr uses by default gets a warning. When Herdr can't reload, it says to restart Herdr. `orch view plugin link` now says that linking gives no key, and names this command.
18
+ - **The board in the Herdr desktop app.** `orch view app link` puts an `orch-board` mod in the app's mods folder (`~/.config/herdr-app/mods/`). Pick "orch: run board" in the app's command palette, or bind `mod.open:orch-board` to a key in `keys.json`. It starts `orch board` through herdr-core in the folder of the terminal you were in, and shows it in a window with a title bar. `q` or ✕ closes it and ends that terminal. If the board can't start, the window says why. Every install updates an installed mod (`orch view plugin refresh`), and `orch view app unlink` removes it. Enter-to-jump to an agent and full runs still need Herdr in a terminal. It has not been tried in a real desktop app yet.
19
+ - **Docs: the board popup, set up and fixed.** The "Watch a run" page has the two setup commands, how to undo, how to pick another key, and a table for when the popup doesn't open: nothing happens on the key, testing without the key, a command run outside the Herdr window, a popup that flashes and closes, an old popup after an update, an old run on the board, and the Herdr desktop app (its own board, below).
20
+
5
21
  ## [6.44.2] - 2026-11-30
6
22
 
7
23
  Project setup no longer asks about agents you are not using. A Codex lead ran `/orch-plan`, and the setup question offered "add a local link from .agent/skills to .agents/skills so Antigravity sees the repo's skills". Antigravity was installed on the machine, but nobody used it in that project. orch checked every agent installed on the machine, not the agents in this team.
package/README.md CHANGED
@@ -348,7 +348,7 @@ A subagent run: `/orch-plan` as usual (the plan's team is `Workers: coder (pi)`,
348
348
  Three views show a run while it goes; none of them changes it.
349
349
 
350
350
  - **`orch view`** opens the run as a live picture in your browser: the run ring, a milestone graph (arrows = "needs this first", red = needs you) with a one-line description under each milestone, the agents, the details of the milestone you click (with the exact `orch answer` command), time and cost against the estimate, a replay slider, and an optional browser alert when something needs you. `orch view --lan` also opens it to your phone on the same Wi-Fi, behind a secret link. `orch status` and the lead's "needs you" lines print its link while it runs.
351
- - **`orch board`** draws the same run as text for a Herdr pane; `orch view plugin link` adds a small Herdr plugin that opens it as a popup (Herdr 0.7.4+).
351
+ - **`orch board`** draws the same run as text for a Herdr pane; `orch view plugin link` adds a small Herdr plugin that opens it as a popup and `orch view plugin key` puts `prefix+a` in Herdr's config (Herdr 0.7.4+). In the Herdr desktop app, `orch view app link` adds the board to its command palette.
352
352
  - **What each milestone changed**: press `f` on the board, or click a milestone in `orch view`, for its changed files by folder with `+/-` counts (live while the coder works, unsaved files included), and a file for its diff. `orch changes M2` prints the same. Read-only.
353
353
  - **Herdr's sidebar** names each agent by what it does (`codex-1 · M2 building`), set by the event manager on a separate thread, display only (Herdr 0.6.3+; `ORCH_SIDEBAR=0` turns it off). `orch view herdr-config` prints extra sidebar rows.
354
354
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 6.44.2
1
+ 6.45.0
Binary file
package/bin/orch CHANGED
@@ -195,9 +195,9 @@ def driver_info():
195
195
  return {}
196
196
 
197
197
 
198
- def driver_alive():
198
+ def driver_alive(orch_dir=None):
199
199
  """True while an `orch autopilot` holds the run's driver lease (the kernel drops it if autopilot dies)."""
200
- p = ORCH / "driver.lock"
200
+ p = (orch_dir or ORCH) / "driver.lock"
201
201
  if not p.exists():
202
202
  return False
203
203
  with open(p, "a") as f:
@@ -1400,6 +1400,13 @@ def cmd_sync(args):
1400
1400
  cfg, tasks = parse_plan(plan_text)
1401
1401
  errors, warns = [], []
1402
1402
  newer = other_plan_files(plan.stat().st_mtime)
1403
+ if newer and finished_plan(ORCH):
1404
+ die(f"plan.md is still the plan of the finished run ({plan_branch(plan_text)}), and "
1405
+ f"{', '.join('.orchestrate/' + n for n in newer[:3])} {'is' if len(newer) == 1 else 'are'} newer. "
1406
+ f"orch reads only .orchestrate/plan.md, so a new plan under another name is never run or shown on the "
1407
+ f"board. If {'that is' if len(newer) == 1 else 'one of those is'} your new plan: keep the old one with "
1408
+ f"`mkdir -p .orchestrate/archive && mv .orchestrate/plan.md .orchestrate/archive/`, copy the new plan to "
1409
+ f".orchestrate/plan.md, and run `orch sync` again")
1403
1410
  if newer:
1404
1411
  warns.append(f"{', '.join(newer[:3])} {'is' if len(newer) == 1 else 'are'} newer than plan.md, but orch only "
1405
1412
  f"reads plan.md. If that is the plan you mean, copy it to plan.md and run `orch sync` again")
@@ -9067,6 +9074,65 @@ def _ago(secs):
9067
9074
  f"{secs // 3600} h" if secs < 86400 else f"{secs // 86400} d")
9068
9075
 
9069
9076
 
9077
+ def run_finished(st, orch_dir=None):
9078
+ """True when the run in `st` is over: every milestone landed or skipped (or the lead finished it), nothing is being
9079
+ worked on, and no event manager is running."""
9080
+ tasks = st.get("tasks", {})
9081
+ if any((tasks.get(t) or {}).get("status") in ACTIVE for t in st.get("order", [])) or driver_alive(orch_dir):
9082
+ return False
9083
+ return bool(st.get("order")) and (
9084
+ all((tasks.get(t) or {}).get("status") in ("merged", "skipped") for t in st["order"])
9085
+ or any(e.get("kind") == "finished" for e in st.get("lead_events", [])))
9086
+
9087
+
9088
+ def plan_branch(text):
9089
+ m = re.search(r"(?mi)^Branch:\s*(\S+)", text or "")
9090
+ return m.group(1) if m else None
9091
+
9092
+
9093
+ def finished_plan(orch_dir):
9094
+ """(plan.md, state) when .orchestrate/plan.md is still the plan of a run that is over (same Branch, not changed
9095
+ since the run), else None. Never fails."""
9096
+ plan, state = orch_dir / "plan.md", orch_dir / "state.json"
9097
+ try:
9098
+ if not plan.is_file() or not state.is_file() or plan.stat().st_mtime > state.stat().st_mtime:
9099
+ return None
9100
+ st = migrate(json.loads(state.read_text()))
9101
+ if not run_finished(st, orch_dir) or plan_branch(plan.read_text()) != st.get("branch"):
9102
+ return None
9103
+ return plan, st
9104
+ except (OSError, ValueError, AttributeError, TypeError):
9105
+ return None
9106
+
9107
+
9108
+ def archive_finished_plan():
9109
+ """`orch lead plan`: when plan.md is still the finished run's plan, move it to .orchestrate/archive/ so the lead
9110
+ writes the new plan in plan.md. Without this a lead kept the old plan and wrote the new one under another name,
9111
+ which orch never read (the run was never tracked, and the board kept showing the old run). Returns the note."""
9112
+ root = onboard_root()
9113
+ if root is None:
9114
+ return ""
9115
+ orch_dir = root / ".orchestrate"
9116
+ found = finished_plan(orch_dir)
9117
+ if not found:
9118
+ return ""
9119
+ plan, st = found
9120
+ day = time.strftime("%Y-%m-%d", time.localtime((orch_dir / "state.json").stat().st_mtime))
9121
+ slug = re.sub(r"[^A-Za-z0-9._-]+", "-", (st.get("branch") or "run").split("/")[-1]).strip("-") or "run"
9122
+ arch = orch_dir / "archive"
9123
+ try:
9124
+ arch.mkdir(exist_ok=True)
9125
+ dest, n = arch / f"{day}-{slug}-plan.md", 2
9126
+ while dest.exists():
9127
+ dest, n = arch / f"{day}-{slug}-plan-{n}.md", n + 1
9128
+ plan.rename(dest)
9129
+ except OSError as e:
9130
+ return f"WARN could not move the finished run's plan.md to .orchestrate/archive/ ({e})\n\n"
9131
+ return (f"ARCHIVED the finished run's plan ({st.get('title') or st.get('branch')}): .orchestrate/plan.md -> "
9132
+ f".orchestrate/archive/{dest.name}\n"
9133
+ f"Write the new plan in .orchestrate/plan.md. Never use another file name: orch reads only plan.md.\n\n")
9134
+
9135
+
9070
9136
  def run_notices(st):
9071
9137
  """Plain-words notes for the views and `orch status` when what they show is not a run that is going now:
9072
9138
  the last run finished long ago, or a plan was written that orch will not read. Never fails."""
@@ -9077,12 +9143,7 @@ def run_notices(st):
9077
9143
  state_t = 0
9078
9144
  out = []
9079
9145
  if st is not None:
9080
- tasks = st.get("tasks", {})
9081
- active = any((tasks.get(t) or {}).get("status") in ACTIVE for t in st.get("order", []))
9082
- done = bool(st.get("order")) and (
9083
- all((tasks.get(t) or {}).get("status") in ("merged", "skipped") for t in st["order"])
9084
- or any(e.get("kind") == "finished" for e in st.get("lead_events", [])))
9085
- if active or driver_alive() or not done:
9146
+ if not run_finished(st):
9086
9147
  return out # a run is going (or stopped half way): nothing to add
9087
9148
  out.append({"kind": "old_run", "text": (
9088
9149
  f"This is the last run ({st.get('title') or st.get('branch')}): all its milestones landed "
@@ -9394,6 +9455,50 @@ description = "orch run board"
9394
9455
  """
9395
9456
 
9396
9457
 
9458
+ BOARD_KEY_BLOCK = ('[[keys.command]]\nkey = "{key}"\ntype = "plugin_action"\n'
9459
+ 'command = "herdr-orchestra.board.open"\ndescription = "orch run board"\n')
9460
+
9461
+
9462
+ HERDR_DEFAULT_KEYS = {f"prefix+{c}" for c in "bcefghjklnopqrsvwxyz"} # herdr 0.9.5's own prefix keys
9463
+
9464
+
9465
+ def herdr_config_path():
9466
+ """herdr's config.toml, found the way herdr finds it on Linux and macOS ($XDG_CONFIG_HOME, else ~/.config)."""
9467
+ base = os.environ.get("XDG_CONFIG_HOME") or str(Path.home() / ".config")
9468
+ return Path(base) / "herdr" / "config.toml"
9469
+
9470
+
9471
+ def board_key_add(key="prefix+a"):
9472
+ """`orch view plugin key [<key>]`: put the board key in herdr's config.toml (once) and make herdr reload it.
9473
+ `orch view plugin link` alone gives no key: herdr reads keys only from its config, so prefix+a did nothing."""
9474
+ if not re.fullmatch(r"[A-Za-z0-9+_-]+", key):
9475
+ die(f"not a herdr key: {key!r} (for example prefix+a or prefix+o)")
9476
+ cfg = herdr_config_path()
9477
+ text = cfg.read_text() if cfg.is_file() else ""
9478
+ m = re.search(r'(?ms)^\[\[keys\.command\]\][^\[]*?command\s*=\s*"herdr-orchestra\.board\.open"', text)
9479
+ if m:
9480
+ km = re.search(r'(?m)^key\s*=\s*"([^"]*)"', m.group(0))
9481
+ print(f"the board key is already in {cfg} ({km.group(1) if km else 'no key line'}); nothing added")
9482
+ else:
9483
+ if re.search(rf'(?m)^\s*\w+\s*=\s*"{re.escape(key)}"', text):
9484
+ die(f"{key} is already used in {cfg}, and herdr would keep that one. Pick a free key, for example "
9485
+ f"`orch view plugin key prefix+i` (`prefix+?` in herdr shows every key in use)")
9486
+ if key.lower() in HERDR_DEFAULT_KEYS:
9487
+ print(f"WARN herdr uses {key} by default; unless your config moved that action, herdr keeps its own and "
9488
+ f"ignores this one. Free in herdr's defaults: prefix+a, prefix+d, prefix+i, prefix+m, prefix+u")
9489
+ cfg.parent.mkdir(parents=True, exist_ok=True)
9490
+ with open(cfg, "a") as f:
9491
+ f.write(("\n" if text and not text.endswith("\n") else "") + ("\n" if text else "")
9492
+ + BOARD_KEY_BLOCK.format(key=key))
9493
+ print(f"added the board key {key} to {cfg}")
9494
+ r = subprocess.run([HERDR, "server", "reload-config"], text=True, capture_output=True)
9495
+ if r.returncode == 0:
9496
+ print("herdr reloaded its config: press your herdr prefix (default ctrl+b), let go, then the key's letter")
9497
+ else:
9498
+ print(f"herdr did not reload its config ({(r.stdout + r.stderr).strip() or 'no answer'}): restart herdr, "
9499
+ f"or run `herdr server reload-config` inside herdr")
9500
+
9501
+
9397
9502
  def board_plugin_dir():
9398
9503
  """The board plugin folder to give herdr: `current/view/herdr-plugin` for an install, the checkout's folder for a
9399
9504
  checkout. Herdr stores the real folder behind a link (it resolves `current` to the version folder), so a link
@@ -9406,6 +9511,36 @@ def board_plugin_dir():
9406
9511
  return cur if installed and cur.is_dir() else asset("view/herdr-plugin")
9407
9512
 
9408
9513
 
9514
+ APP_MOD_NAME = "orch-board"
9515
+
9516
+
9517
+ def herdr_app_mods_dir():
9518
+ """The Herdr desktop app's mods folder ($XDG_CONFIG_HOME or ~/.config, then herdr-app/mods)."""
9519
+ base = os.environ.get("XDG_CONFIG_HOME") or str(Path.home() / ".config")
9520
+ return Path(base) / "herdr-app" / "mods"
9521
+
9522
+
9523
+ def app_mod_install(quiet=False):
9524
+ """Copy the board mod into the desktop app's mods folder (the app reloads a saved mod by itself). A copy, not a
9525
+ link: every install refreshes it (`orch view plugin refresh`), so updates reach the app too."""
9526
+ src = asset(f"view/herdr-app-mod/{APP_MOD_NAME}")
9527
+ if not src:
9528
+ die(f"view/herdr-app-mod/{APP_MOD_NAME} not found next to orch or in the install")
9529
+ dest = herdr_app_mods_dir() / APP_MOD_NAME
9530
+ dest.mkdir(parents=True, exist_ok=True)
9531
+ for f in src.iterdir():
9532
+ if f.is_file():
9533
+ shutil.copyfile(f, dest / f.name)
9534
+ if not quiet:
9535
+ print(f"installed the orch board mod for the Herdr desktop app: {dest}\n"
9536
+ f"In the app: Ctrl+Shift+P (Cmd+Shift+P on macOS) -> \"orch: run board\". It opens the board for the "
9537
+ f"folder of the terminal you were in; q or the x closes it.\n"
9538
+ f"For a key, add to ~/.config/herdr-app/keys.json under \"global\": "
9539
+ f"\"ctrl-shift-b\": \"mod.open:{APP_MOD_NAME}\" (Ctrl+Shift+P shows whether a key is free).\n"
9540
+ f"Undo with `orch view app unlink`.")
9541
+ return dest
9542
+
9543
+
9409
9544
  def board_plugin_linked():
9410
9545
  """True when the board plugin was linked: by this version (remembered in settings) or by an older one, which
9411
9546
  left no note, so herdr's own plugin list is asked too."""
@@ -9439,7 +9574,7 @@ def board_plugin_link(d):
9439
9574
 
9440
9575
  def cmd_view(args):
9441
9576
  """orch view [--lan] [--port N] [--no-open] [--bg] -> the run as a live picture in your browser (view only).
9442
- orch view stop | status | herdr-config | plugin link|unlink|refresh"""
9577
+ orch view stop | status | herdr-config | plugin link|key|unlink|refresh | app link|unlink"""
9443
9578
  sub = args[0] if args and not args[0].startswith("-") else None
9444
9579
  if sub == "status":
9445
9580
  v = view_info()
@@ -9461,6 +9596,20 @@ def cmd_view(args):
9461
9596
  if sub == "herdr-config":
9462
9597
  print(SIDEBAR_CONFIG, end="")
9463
9598
  return
9599
+ if sub == "app":
9600
+ act = args[1] if len(args) > 1 else ""
9601
+ if act == "link":
9602
+ app_mod_install()
9603
+ return
9604
+ if act == "unlink":
9605
+ dest = herdr_app_mods_dir() / APP_MOD_NAME
9606
+ if dest.is_dir():
9607
+ shutil.rmtree(dest)
9608
+ print(f"removed {dest}")
9609
+ else:
9610
+ print("the orch board mod is not installed in the Herdr desktop app")
9611
+ return
9612
+ die("usage: orch view app link|unlink (the Herdr desktop app's board mod)")
9464
9613
  if sub == "plugin":
9465
9614
  act = args[1] if len(args) > 1 else ""
9466
9615
  d = board_plugin_dir()
@@ -9472,6 +9621,9 @@ def cmd_view(args):
9472
9621
  print(f"board popup plugin re-linked to {d}" if r.returncode == 0
9473
9622
  else f"WARN could not re-link the board popup plugin: {(r.stdout + r.stderr).strip()} "
9474
9623
  f"(run `orch view plugin link`)")
9624
+ if (herdr_app_mods_dir() / APP_MOD_NAME / "mod.json").is_file(): # the desktop app's board mod
9625
+ with contextlib.suppress(OSError, SystemExit):
9626
+ print(f"desktop app board mod updated: {app_mod_install(quiet=True)}")
9475
9627
  return
9476
9628
  if act == "link":
9477
9629
  if not d:
@@ -9479,13 +9631,17 @@ def cmd_view(args):
9479
9631
  r = board_plugin_link(d)
9480
9632
  print((r.stdout + r.stderr).strip() or f"linked {d}")
9481
9633
  if r.returncode == 0:
9482
- print("To open the board with a key, add this to herdr's config.toml and restart herdr "
9483
- "(`orch view herdr-config` prints it too). prefix+a is free in herdr's defaults; "
9484
- "`prefix+?` shows every key in use. If the key is taken, herdr keeps its own and ignores this one.\n\n"
9485
- "[[keys.command]]\nkey = \"prefix+a\"\ntype = \"plugin_action\"\n"
9486
- "command = \"herdr-orchestra.board.open\"\ndescription = \"orch run board\"\n\n"
9634
+ print("Linking adds the popup, not a key. Next, run `orch view plugin key`: it adds prefix+a to "
9635
+ f"herdr's config ({herdr_config_path()}) and makes herdr reload it "
9636
+ "(another key: `orch view plugin key prefix+i`). Or add these lines yourself, then run `herdr server reload-config` "
9637
+ "(or restart herdr). prefix+a is free in herdr's defaults; `prefix+?` shows every key in use. "
9638
+ "If the key is taken, herdr keeps its own and ignores this one.\n\n"
9639
+ + BOARD_KEY_BLOCK.format(key="prefix+a") + "\n"
9487
9640
  "Undo with `orch view plugin unlink`.")
9488
9641
  sys.exit(r.returncode)
9642
+ if act == "key":
9643
+ board_key_add(args[2] if len(args) > 2 else "prefix+a")
9644
+ return
9489
9645
  if act == "unlink":
9490
9646
  r = subprocess.run([HERDR, "plugin", "unlink", VIEW_PLUGIN_ID], text=True, capture_output=True)
9491
9647
  print((r.stdout + r.stderr).strip() or f"unlinked {VIEW_PLUGIN_ID}")
@@ -9493,10 +9649,10 @@ def cmd_view(args):
9493
9649
  if st.pop("board_plugin_linked", None) is not None:
9494
9650
  settings_save(st)
9495
9651
  sys.exit(r.returncode)
9496
- die("usage: orch view plugin link|unlink|refresh (herdr 0.7.4 or newer)")
9652
+ die("usage: orch view plugin link|key [<key>]|unlink|refresh (herdr 0.7.4 or newer)")
9497
9653
  if sub:
9498
9654
  die(f"unknown `orch view {sub}` — use: orch view [--lan] [--port N] [--no-open] [--bg] | stop | status | "
9499
- f"herdr-config | plugin link|unlink|refresh")
9655
+ f"herdr-config | plugin link|key|unlink|refresh | app link|unlink")
9500
9656
  lan = "--lan" in args
9501
9657
  port = 0
9502
9658
  if "--port" in args:
@@ -10528,7 +10684,7 @@ USAGE = """usage: orch <command> [args]
10528
10684
  view [--lan] [--port N] [--no-open] [--bg]
10529
10685
  the run as a live picture in your browser (view only): milestone graph, agents, details,
10530
10686
  "needs you" alert, time and cost, replay. --lan: also from your phone, with a secret link
10531
- view stop|status|herdr-config|plugin link|unlink|refresh
10687
+ view stop|status|herdr-config|plugin link|key|unlink|refresh|app link|unlink
10532
10688
  stop it / show its link / sidebar lines for herdr's config / the optional herdr plugin
10533
10689
  board [--once] the run as text, redrawn when it changes: for a herdr pane or popup (any terminal);
10534
10690
  [f] or [enter] on a milestone shows its changed files, [enter] on a file its diff
@@ -10840,6 +10996,8 @@ def cmd_lead(args):
10840
10996
  if not part and not subagent:
10841
10997
  lead_self_name()
10842
10998
  guard_ensure(say_changes=False) # no agent pushes to main: the repo refuses it from the start
10999
+ if sub == "plan":
11000
+ print(archive_finished_plan(), end="") # the new plan goes in plan.md, never under another name
10843
11001
  if sub == "plan" and not part:
10844
11002
  print(picker_note(lead_kind()), end="")
10845
11003
  print(onboard_plan_note(), end="") # a project never set up for its agents: set it up first
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "herdr-orchestra",
3
- "version": "6.44.2",
3
+ "version": "6.45.0",
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": {
package/playbooks/plan.md CHANGED
@@ -11,6 +11,7 @@ You need only three herdr commands, exactly as written here: `herdr agent list`
11
11
  - You give every milestone a **role**: the specialist the coder should work as, and what that specialist cares about here (step 6, Role). That sets the standard, not the method.
12
12
  - You also decide **which level of model each milestone needs** (small, medium or high) and say why (step 6), and **how long each milestone and the whole feature should take** (step 6, Estimate).
13
13
  - **Nobody pushes to main.** No agent (you, the coders, the reviewer) ever pushes to main, master or the repo's default branch, or merges a PR, in any situation, even when the developer asks: refuse in one line and offer the run's branch and a PR, which a person merges by hand. A plan's `Branch:` is never main or master (`orch sync` refuses it), and the repo's pre-push guard (`orch guard`) refuses such a push anyway: never get around it.
14
+ - **One plan file: `.orchestrate/plan.md`.** Every plan, quick or full, goes in `.orchestrate/plan.md`, even when one is already there. Never write a plan under another name (`.orchestrate/sap-plan.md`, `new-plan.md`...): orch reads only plan.md, so a plan under another name is never run, never tracked, and the board keeps showing the old run. A finished run's plan is not lost: `orch lead plan` moved it to `.orchestrate/archive/` (the `ARCHIVED` line above). If plan.md is still there, it belongs to a run that is not over: ask the developer before replacing it.
14
15
  - You never edit application code, and you never prompt worker agents: you hand out work with `orch dispatch`, and the event manager (`orch autopilot`, a plain script) prompts the agents, watches them and wakes you when something needs a decision.
15
16
 
16
17
  Feature request = the user's message that asked you to run this playbook.
@@ -0,0 +1,110 @@
1
+ // The herdr-orchestra run board in the Herdr desktop app (herdr-app). Installed by `orch view plugin link`.
2
+ // Command palette: "orch: run board" (mod.open). It starts `orch board` in a herdr-core terminal, in the folder of
3
+ // the terminal you were in, and shows it in a window over your tabs with a thin title bar. `q` in the board, or ✕,
4
+ // closes it. Herdr in a terminal uses the herdr plugin in ../herdr-plugin instead (prefix+a).
5
+ //
6
+ // Two roles, by props:
7
+ // opener (mod.open, no props): starts the board terminal, opens the window, closes itself;
8
+ // shows the error instead when the board can't start.
9
+ // bar ({ bar: true, terminal }): the window's title bar; ends the board terminal when the window goes.
10
+
11
+ import { View, div } from "gpui-kit";
12
+ import { v_flex, h_flex } from "gpui-base";
13
+ import { hc, run, props, focused, spaces, theme, openOverlay, closeOverlay, checking } from "herdr";
14
+
15
+ // orch on PATH (the core loads the login shell's exports), else where install.sh puts it
16
+ const BOARD = 'if command -v orch >/dev/null 2>&1; then exec orch board; else exec "$HOME/.local/bin/orch" board; fi';
17
+
18
+ export default class OrchBoard extends View {
19
+ init(_props, cx) {
20
+ this.error = null;
21
+ if (props()?.bar || checking()) return;
22
+ cx.spawn(async (cx) => {
23
+ const f = focused();
24
+ const space = spaces().find((s) => s.id === f?.space) ?? spaces().find((s) => s.active);
25
+ const cwd = f?.cwd || space?.folder || null;
26
+ const args = ["run", "--bg", "--json", "--rm", "--no-parent", "--name", `orch-board-${Date.now() % 100000}`];
27
+ if (space?.machine) args.push("--on", space.machine);
28
+ if (cwd) args.push("--cwd", cwd);
29
+ args.push("--", "sh", "-c", BOARD);
30
+ let r;
31
+ try {
32
+ r = await hc(args);
33
+ } catch (e) {
34
+ r = { code: 1, stdout: "", stderr: String(e) };
35
+ }
36
+ let addr = null;
37
+ try {
38
+ addr = r.code === 0 ? JSON.parse(r.stdout).address : null;
39
+ } catch {}
40
+ if (!addr) {
41
+ this.error = `Could not start orch board: ${(r.stderr || r.stdout || "no answer from hc").trim()}`;
42
+ cx.notify();
43
+ return;
44
+ }
45
+ openOverlay({
46
+ kind: "dialog",
47
+ width: 0.9,
48
+ height: 0.85,
49
+ layout: {
50
+ type: "column",
51
+ children: [
52
+ { type: "block", size: { px: 28 }, content: { mod: "orch-board", props: { bar: true, terminal: addr } } },
53
+ { type: "block", content: { terminal: addr } },
54
+ ],
55
+ },
56
+ });
57
+ run("pane.focus", { terminal: addr });
58
+ closeOverlay(props()?.overlay);
59
+ });
60
+ }
61
+
62
+ async close(_cx) {
63
+ const p = props() ?? {};
64
+ if (p.bar && p.terminal) run("terminal.kill", { terminal: p.terminal });
65
+ }
66
+
67
+ render(_cx) {
68
+ const t = theme();
69
+ const p = props() ?? {};
70
+ if (p.bar) {
71
+ return h_flex()
72
+ .id("orch-board-bar")
73
+ .size_full()
74
+ .px(12)
75
+ .gap(8)
76
+ .items_center()
77
+ .bg(t.surface)
78
+ .border_b(1)
79
+ .border_color(t.border)
80
+ .text_size(12)
81
+ .child(div().font_semibold().text_color(t.foreground).child("orch board"))
82
+ .child(div().text_color(t.dim).child("q closes"))
83
+ .child(div().flex_1())
84
+ .child(
85
+ div()
86
+ .id("orch-board-close")
87
+ .px(8)
88
+ .py(2)
89
+ .rounded(5)
90
+ .text_color(t.muted)
91
+ .cursor_pointer()
92
+ .hover((s) => s.bg(t.hover).text_color(t.foreground))
93
+ .on_click(() => closeOverlay(p.overlay))
94
+ .child("✕"),
95
+ );
96
+ }
97
+ return v_flex()
98
+ .id("orch-board-open")
99
+ .size_full()
100
+ .p(18)
101
+ .gap(8)
102
+ .bg(t.popover)
103
+ .text_size(13)
104
+ .child(div().text_size(15).font_semibold().text_color(t.foreground).child("orch board"))
105
+ .child(div().text_color(this.error ? t.blocked ?? t.foreground : t.muted).child(this.error ?? "Starting the board…"))
106
+ .when(Boolean(this.error), (el) =>
107
+ el.child(div().text_color(t.dim).child("Check that orch is installed (`orch --version` in a terminal here), then try again.")),
108
+ );
109
+ }
110
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "place": "none",
3
+ "title": "orch board",
4
+ "overlay": {
5
+ "width": 460,
6
+ "height": 150
7
+ },
8
+ "palette": [
9
+ {
10
+ "title": "orch: run board",
11
+ "command": "mod.open",
12
+ "args": {
13
+ "name": "orch-board"
14
+ },
15
+ "words": "orch herdr-orchestra board run milestones"
16
+ }
17
+ ]
18
+ }