herdr-orchestra 6.44.1 → 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 +27 -0
- package/README.md +1 -1
- package/VERSION +1 -1
- package/bin/__pycache__/orchcpython-314.pyc +0 -0
- package/bin/orch +230 -29
- package/package.json +1 -1
- package/playbooks/onboard.md +3 -2
- package/playbooks/plan.md +1 -0
- package/view/herdr-app-mod/orch-board/main.js +110 -0
- package/view/herdr-app-mod/orch-board/mod.json +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
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
|
+
|
|
21
|
+
## [6.44.2] - 2026-11-30
|
|
22
|
+
|
|
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.
|
|
24
|
+
|
|
25
|
+
Example: Codex leads, and only Codex panes are open on the repo. Before, `orch lead onboard` listed "agy can't see the 2 skill(s) in .agents/skills" and the lead offered an Antigravity link. Now it says "Agents in this team: codex (... left out: agy, claude)", checks only Codex, and when nothing is missing for Codex it doesn't ask at all.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- **Project setup checks only the agents in this team.** The team is the agent running the command (the lead) and the agents herdr shows open on this repo or its worktrees. Installed tools that are not in the team (Antigravity, Claude Code, Pi, ...) get no folder-link gap and no `AGENTS.md`/`CLAUDE.md` choice made for them, and are never named in the setup question. When orch can't tell the team (not in herdr, unknown agent), it checks every installed agent, as before.
|
|
29
|
+
- `orch onboard --all` checks every installed agent. `orch onboard link` still checks every installed agent before it links, so a link never makes any agent see a skill twice. `ORCH_ONBOARD_TEAM=codex,claude` names the team by hand.
|
|
30
|
+
- The onboard playbook tells the lead to name only the agents in the team, and its examples no longer assume Codex and AGY.
|
|
31
|
+
|
|
5
32
|
## [6.44.1] - 2026-11-29
|
|
6
33
|
|
|
7
34
|
A held milestone no longer always stops the run for you. orch now has two kinds of hold. The lead may approve the everyday ones itself, after reading the change and giving a reason. The dangerous ones still wait for you, and you can say "approve Mn" in the lead's chat instead of going to a shell.
|
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.
|
|
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")
|
|
@@ -5240,16 +5247,56 @@ def is_tracked(root, rel):
|
|
|
5240
5247
|
return git("ls-files", "--error-unmatch", "--", rel, cwd=root, check=False).returncode == 0
|
|
5241
5248
|
|
|
5242
5249
|
|
|
5243
|
-
|
|
5250
|
+
AGENT_KIND_NAMES = {"antigravity": "agy", "gemini": "agy", "claude-code": "claude", "claude_code": "claude"}
|
|
5251
|
+
|
|
5252
|
+
|
|
5253
|
+
def onboard_team(root):
|
|
5254
|
+
"""The agent kinds in use for this repo: the lead (the agent running this command) and every herdr pane whose
|
|
5255
|
+
folder is this repo or one of its worktrees. Empty when orch can't tell (no agent mark, not inside herdr)."""
|
|
5256
|
+
kinds = set()
|
|
5257
|
+
with contextlib.suppress(Exception):
|
|
5258
|
+
lk = lead_kind()
|
|
5259
|
+
if lk:
|
|
5260
|
+
kinds.add(lk)
|
|
5261
|
+
if os.environ.get("ORCH_ONBOARD_TEAM") is not None: # tests and scripts: name the team by hand
|
|
5262
|
+
return {k.strip().lower() for k in os.environ["ORCH_ONBOARD_TEAM"].split(",") if k.strip()} | kinds
|
|
5263
|
+
if not (os.environ.get("HERDR_ENV") or os.environ.get("HERDR_PANE_ID")):
|
|
5264
|
+
return kinds
|
|
5265
|
+
common = None
|
|
5266
|
+
with contextlib.suppress(Exception):
|
|
5267
|
+
common = os.path.realpath(git_common_dir(root) or "")
|
|
5268
|
+
with contextlib.suppress(Exception):
|
|
5269
|
+
for p in (herdr_panes() or {}).values():
|
|
5270
|
+
kind = p.get("kind")
|
|
5271
|
+
if not kind:
|
|
5272
|
+
continue
|
|
5273
|
+
for c in p.get("cwds", []):
|
|
5274
|
+
here = _inside(c, root)
|
|
5275
|
+
if not here and common and os.path.isdir(c):
|
|
5276
|
+
gd = git_common_dir(c)
|
|
5277
|
+
here = bool(gd) and os.path.realpath(gd) == common
|
|
5278
|
+
if here:
|
|
5279
|
+
kinds.add(AGENT_KIND_NAMES.get(kind, kind))
|
|
5280
|
+
break
|
|
5281
|
+
return kinds
|
|
5282
|
+
|
|
5283
|
+
|
|
5284
|
+
def onboard_scan(root, reg=None, everyone=False):
|
|
5244
5285
|
"""The whole look at one repo, as a dict (`orch onboard --json`): stack, commands, rule files, skills, what each
|
|
5245
|
-
|
|
5246
|
-
something is missing), quiet (set up or skipped before, or nothing missing).
|
|
5286
|
+
agent in use sees, the gaps, and what to do now: full (no project skills: set it up), gaps (never set up, and
|
|
5287
|
+
something is missing), quiet (set up or skipped before, or nothing missing).
|
|
5288
|
+
Only the agents in use are checked (the lead and the panes open on this repo, see onboard_team): a tool that is
|
|
5289
|
+
installed but not in this team (Antigravity on a Codex-only team) gets no gap and is never named. When orch can't
|
|
5290
|
+
tell the team, or `everyone` (`orch onboard --all`), every installed agent is checked."""
|
|
5247
5291
|
root = Path(root)
|
|
5248
5292
|
reg = reg if reg is not None else (registry(required=False) or {})
|
|
5249
5293
|
stack, cmds, pm = stack_of(root)
|
|
5250
5294
|
rules = rule_files(root)
|
|
5251
5295
|
skills = project_skills(root, reg)
|
|
5252
|
-
|
|
5296
|
+
on_path = {k: v for k, v in reg.items() if shutil.which(v.get("binary", k))}
|
|
5297
|
+
team = set() if everyone else onboard_team(root)
|
|
5298
|
+
installed = {k: v for k, v in on_path.items() if k in team} if team & set(on_path) else on_path
|
|
5299
|
+
left_out = sorted(set(on_path) - set(installed))
|
|
5253
5300
|
agents = {k: agent_project_view(root, k, v, skills) for k, v in sorted(installed.items())}
|
|
5254
5301
|
clashes = clash_skills(skills)
|
|
5255
5302
|
rules_text = ""
|
|
@@ -5290,7 +5337,7 @@ def onboard_scan(root, reg=None):
|
|
|
5290
5337
|
"skills": [{k: s[k] for k in ("name", "description", "path")} for s in skills],
|
|
5291
5338
|
"agents": {k: {"reads": a["reads"], "sees": len(a["skills"]), "twice": a["twice"]} for k, a in agents.items()},
|
|
5292
5339
|
"clash": clashes, "gaps": gaps, "state": st.get("status") or "never", "when": st.get("when"),
|
|
5293
|
-
"decide": decide}
|
|
5340
|
+
"decide": decide, "team": sorted(installed) if left_out else None, "not_in_team": left_out}
|
|
5294
5341
|
|
|
5295
5342
|
|
|
5296
5343
|
def onboard_report_lines(r):
|
|
@@ -5299,6 +5346,9 @@ def onboard_report_lines(r):
|
|
|
5299
5346
|
f"Rule files: {', '.join(r['rules']) or 'none'}",
|
|
5300
5347
|
f"Project skills: {len(r['skills'])}" + (f" ({', '.join(sorted({s['path'].rsplit('/', 1)[0] for s in r['skills']}))})"
|
|
5301
5348
|
if r["skills"] else "")]
|
|
5349
|
+
if r.get("not_in_team"):
|
|
5350
|
+
out.append(f"Agents in this team: {', '.join(r['team'])} (only these are checked and named; installed but not "
|
|
5351
|
+
f"in this team, left out: {', '.join(r['not_in_team'])}; `orch onboard --all` checks them too)")
|
|
5302
5352
|
for k, a in r["agents"].items():
|
|
5303
5353
|
out.append(f" {k} reads {', '.join(a['reads']) or 'no project folder (not known)'}: sees {a['sees']}"
|
|
5304
5354
|
+ (f", TWICE: {', '.join(a['twice'])}" if a["twice"] else ""))
|
|
@@ -5377,7 +5427,7 @@ def onboard_links(root, d):
|
|
|
5377
5427
|
|
|
5378
5428
|
|
|
5379
5429
|
def cmd_onboard(args):
|
|
5380
|
-
"""orch onboard [scan] [--json] | skills [--json] | check | link <folder> <to> | done --mode local|shared [paths]
|
|
5430
|
+
"""orch onboard [scan] [--json] [--all] | skills [--json] | check | link <folder> <to> | done --mode local|shared [paths]
|
|
5381
5431
|
| skip | status."""
|
|
5382
5432
|
args = list(args)
|
|
5383
5433
|
root = onboard_root() or die("not inside a git repository")
|
|
@@ -5385,7 +5435,7 @@ def cmd_onboard(args):
|
|
|
5385
5435
|
rest = args[1:] if args and not args[0].startswith("-") else args
|
|
5386
5436
|
reg = registry(required=False) or {}
|
|
5387
5437
|
if sub == "scan":
|
|
5388
|
-
r = onboard_scan(root, reg)
|
|
5438
|
+
r = onboard_scan(root, reg, everyone="--all" in rest)
|
|
5389
5439
|
if "--json" in rest:
|
|
5390
5440
|
print(json.dumps(r, indent=2))
|
|
5391
5441
|
return
|
|
@@ -5428,7 +5478,7 @@ def cmd_onboard(args):
|
|
|
5428
5478
|
die(f"{link} already exists: orch never replaces a folder (put the skills in one of them by hand)")
|
|
5429
5479
|
lp.parent.mkdir(parents=True, exist_ok=True)
|
|
5430
5480
|
os.symlink(os.path.relpath(tp, lp.parent), lp)
|
|
5431
|
-
twice = {k: a["twice"] for k, a in onboard_scan(root, reg)["agents"].items() if a["twice"]}
|
|
5481
|
+
twice = {k: a["twice"] for k, a in onboard_scan(root, reg, everyone=True)["agents"].items() if a["twice"]}
|
|
5432
5482
|
if twice:
|
|
5433
5483
|
lp.unlink()
|
|
5434
5484
|
die("not linked: then " + "; ".join(f"{k} would see {', '.join(n)} twice" for k, n in twice.items()))
|
|
@@ -9024,6 +9074,65 @@ def _ago(secs):
|
|
|
9024
9074
|
f"{secs // 3600} h" if secs < 86400 else f"{secs // 86400} d")
|
|
9025
9075
|
|
|
9026
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
|
+
|
|
9027
9136
|
def run_notices(st):
|
|
9028
9137
|
"""Plain-words notes for the views and `orch status` when what they show is not a run that is going now:
|
|
9029
9138
|
the last run finished long ago, or a plan was written that orch will not read. Never fails."""
|
|
@@ -9034,12 +9143,7 @@ def run_notices(st):
|
|
|
9034
9143
|
state_t = 0
|
|
9035
9144
|
out = []
|
|
9036
9145
|
if st is not None:
|
|
9037
|
-
|
|
9038
|
-
active = any((tasks.get(t) or {}).get("status") in ACTIVE for t in st.get("order", []))
|
|
9039
|
-
done = bool(st.get("order")) and (
|
|
9040
|
-
all((tasks.get(t) or {}).get("status") in ("merged", "skipped") for t in st["order"])
|
|
9041
|
-
or any(e.get("kind") == "finished" for e in st.get("lead_events", [])))
|
|
9042
|
-
if active or driver_alive() or not done:
|
|
9146
|
+
if not run_finished(st):
|
|
9043
9147
|
return out # a run is going (or stopped half way): nothing to add
|
|
9044
9148
|
out.append({"kind": "old_run", "text": (
|
|
9045
9149
|
f"This is the last run ({st.get('title') or st.get('branch')}): all its milestones landed "
|
|
@@ -9351,6 +9455,50 @@ description = "orch run board"
|
|
|
9351
9455
|
"""
|
|
9352
9456
|
|
|
9353
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
|
+
|
|
9354
9502
|
def board_plugin_dir():
|
|
9355
9503
|
"""The board plugin folder to give herdr: `current/view/herdr-plugin` for an install, the checkout's folder for a
|
|
9356
9504
|
checkout. Herdr stores the real folder behind a link (it resolves `current` to the version folder), so a link
|
|
@@ -9363,6 +9511,36 @@ def board_plugin_dir():
|
|
|
9363
9511
|
return cur if installed and cur.is_dir() else asset("view/herdr-plugin")
|
|
9364
9512
|
|
|
9365
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
|
+
|
|
9366
9544
|
def board_plugin_linked():
|
|
9367
9545
|
"""True when the board plugin was linked: by this version (remembered in settings) or by an older one, which
|
|
9368
9546
|
left no note, so herdr's own plugin list is asked too."""
|
|
@@ -9396,7 +9574,7 @@ def board_plugin_link(d):
|
|
|
9396
9574
|
|
|
9397
9575
|
def cmd_view(args):
|
|
9398
9576
|
"""orch view [--lan] [--port N] [--no-open] [--bg] -> the run as a live picture in your browser (view only).
|
|
9399
|
-
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"""
|
|
9400
9578
|
sub = args[0] if args and not args[0].startswith("-") else None
|
|
9401
9579
|
if sub == "status":
|
|
9402
9580
|
v = view_info()
|
|
@@ -9418,6 +9596,20 @@ def cmd_view(args):
|
|
|
9418
9596
|
if sub == "herdr-config":
|
|
9419
9597
|
print(SIDEBAR_CONFIG, end="")
|
|
9420
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)")
|
|
9421
9613
|
if sub == "plugin":
|
|
9422
9614
|
act = args[1] if len(args) > 1 else ""
|
|
9423
9615
|
d = board_plugin_dir()
|
|
@@ -9429,6 +9621,9 @@ def cmd_view(args):
|
|
|
9429
9621
|
print(f"board popup plugin re-linked to {d}" if r.returncode == 0
|
|
9430
9622
|
else f"WARN could not re-link the board popup plugin: {(r.stdout + r.stderr).strip()} "
|
|
9431
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)}")
|
|
9432
9627
|
return
|
|
9433
9628
|
if act == "link":
|
|
9434
9629
|
if not d:
|
|
@@ -9436,13 +9631,17 @@ def cmd_view(args):
|
|
|
9436
9631
|
r = board_plugin_link(d)
|
|
9437
9632
|
print((r.stdout + r.stderr).strip() or f"linked {d}")
|
|
9438
9633
|
if r.returncode == 0:
|
|
9439
|
-
print("
|
|
9440
|
-
"
|
|
9441
|
-
"`
|
|
9442
|
-
"
|
|
9443
|
-
"
|
|
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"
|
|
9444
9640
|
"Undo with `orch view plugin unlink`.")
|
|
9445
9641
|
sys.exit(r.returncode)
|
|
9642
|
+
if act == "key":
|
|
9643
|
+
board_key_add(args[2] if len(args) > 2 else "prefix+a")
|
|
9644
|
+
return
|
|
9446
9645
|
if act == "unlink":
|
|
9447
9646
|
r = subprocess.run([HERDR, "plugin", "unlink", VIEW_PLUGIN_ID], text=True, capture_output=True)
|
|
9448
9647
|
print((r.stdout + r.stderr).strip() or f"unlinked {VIEW_PLUGIN_ID}")
|
|
@@ -9450,10 +9649,10 @@ def cmd_view(args):
|
|
|
9450
9649
|
if st.pop("board_plugin_linked", None) is not None:
|
|
9451
9650
|
settings_save(st)
|
|
9452
9651
|
sys.exit(r.returncode)
|
|
9453
|
-
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)")
|
|
9454
9653
|
if sub:
|
|
9455
9654
|
die(f"unknown `orch view {sub}` — use: orch view [--lan] [--port N] [--no-open] [--bg] | stop | status | "
|
|
9456
|
-
f"herdr-config | plugin link|unlink|refresh")
|
|
9655
|
+
f"herdr-config | plugin link|key|unlink|refresh | app link|unlink")
|
|
9457
9656
|
lan = "--lan" in args
|
|
9458
9657
|
port = 0
|
|
9459
9658
|
if "--port" in args:
|
|
@@ -10422,8 +10621,9 @@ USAGE = """usage: orch <command> [args]
|
|
|
10422
10621
|
lead run --section <EVENT|ALL_DONE|rules> one part of the run playbook (orch events prints these for you)
|
|
10423
10622
|
lead onboard the setup playbook: set this project up for its agents (rules, skills) with the
|
|
10424
10623
|
developer's tick; `orch lead plan` points the lead to it when a project needs it
|
|
10425
|
-
onboard [--json]
|
|
10426
|
-
|
|
10624
|
+
onboard [--json] [--all] what the project has for its agents: stack, commands, rule files, the skills each
|
|
10625
|
+
agent in this team sees (the lead and the panes open on this repo; --all: every
|
|
10626
|
+
installed agent), and what is missing (no AI, changes nothing)
|
|
10427
10627
|
onboard skills|check|status the project's skills (for a milestone's `Skills:`) / skills an agent sees twice /
|
|
10428
10628
|
what setup did here
|
|
10429
10629
|
onboard link <folder> <to> one folder link so another agent sees the same skills (.agents/skills -> .agent/skills)
|
|
@@ -10484,7 +10684,7 @@ USAGE = """usage: orch <command> [args]
|
|
|
10484
10684
|
view [--lan] [--port N] [--no-open] [--bg]
|
|
10485
10685
|
the run as a live picture in your browser (view only): milestone graph, agents, details,
|
|
10486
10686
|
"needs you" alert, time and cost, replay. --lan: also from your phone, with a secret link
|
|
10487
|
-
view stop|status|herdr-config|plugin link|unlink|refresh
|
|
10687
|
+
view stop|status|herdr-config|plugin link|key|unlink|refresh|app link|unlink
|
|
10488
10688
|
stop it / show its link / sidebar lines for herdr's config / the optional herdr plugin
|
|
10489
10689
|
board [--once] the run as text, redrawn when it changes: for a herdr pane or popup (any terminal);
|
|
10490
10690
|
[f] or [enter] on a milestone shows its changed files, [enter] on a file its diff
|
|
@@ -10796,6 +10996,8 @@ def cmd_lead(args):
|
|
|
10796
10996
|
if not part and not subagent:
|
|
10797
10997
|
lead_self_name()
|
|
10798
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
|
|
10799
11001
|
if sub == "plan" and not part:
|
|
10800
11002
|
print(picker_note(lead_kind()), end="")
|
|
10801
11003
|
print(onboard_plan_note(), end="") # a project never set up for its agents: set it up first
|
|
@@ -11808,8 +12010,7 @@ def lead_kind():
|
|
|
11808
12010
|
if not kind and os.environ.get("HERDR_PANE_ID"):
|
|
11809
12011
|
with contextlib.suppress(Exception):
|
|
11810
12012
|
kind = ((herdr_panes() or {}).get(os.environ["HERDR_PANE_ID"]) or {}).get("kind")
|
|
11811
|
-
|
|
11812
|
-
return names.get(kind, kind) if kind else None
|
|
12013
|
+
return AGENT_KIND_NAMES.get(kind, kind) if kind else None
|
|
11813
12014
|
|
|
11814
12015
|
|
|
11815
12016
|
def _ancestor_args():
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "herdr-orchestra",
|
|
3
|
-
"version": "6.
|
|
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/onboard.md
CHANGED
|
@@ -6,6 +6,7 @@ Hard rules:
|
|
|
6
6
|
- **Never create a skill whose name an agent already sees** (in the repo or its home folder): `orch onboard skills` lists the repo's.
|
|
7
7
|
- **No outside skill packs.** Never download, install or suggest one. You only write short skills from this repo's own code.
|
|
8
8
|
- **Never push to main** or merge a PR, even if the developer asks. Shared setup goes on its own branch with a PR that a person merges.
|
|
9
|
+
- **Name only the agents in this team.** WHAT ORCH FOUND lists the agents it checked: the agent you are and the agents open on this repo. Never offer a link, a rule file or a skill for an agent that is not on that list (no "so Antigravity sees ..." on a Codex-only team), and never name one in your questions. Nothing applies to this team: don't ask about it.
|
|
9
10
|
|
|
10
11
|
## 1. Look (read-only, a few minutes at most)
|
|
11
12
|
- Read the rule files listed above, `README`, and 3 to 5 real files that show how this repo works: one page or route, one API handler, one database change or migration, one test. Run `orch onboard skills` to see what the existing skills cover.
|
|
@@ -20,14 +21,14 @@ Make one short list. Each item is a file you would write, and only when somethin
|
|
|
20
21
|
<!-- /orch-onboard -->
|
|
21
22
|
```
|
|
22
23
|
- **A new skill** for a topic this repo does often and no existing skill covers (match on the name and the description: `frontend-developer` already covers Next.js pages, so no "nextjs" skill). Only when the folder list above says **no project skills**, or for a clear gap. Each skill is about THIS repo: real folder names, real commands, the pattern to copy and one example file to look at, at most 80 lines. Example for a Next.js + Supabase repo: `supabase-changes` ("Use when adding or changing a table: migrations live in supabase/migrations, every table gets RLS rules, run `supabase db diff` ..."). Never a general best-practices essay. At most 3 new skills.
|
|
23
|
-
- **A folder link** when an agent can't see the skills (the gap says `<agent> can't see ...`): `orch onboard link <its folder> <folder with the skills>`, for example `orch onboard link .agents/skills .agent/skills`
|
|
24
|
+
- **A folder link** when an agent can't see the skills (the gap says `<agent> can't see ...`): `orch onboard link <its folder> <folder with the skills>`, for example `orch onboard link .agents/skills .agent/skills` when Codex is in the team and the skills are in `.agent/skills`. One copy, no files copied. No `can't see` gap: no link item.
|
|
24
25
|
- **Skills that clash with orch** (the gap lists them): nothing to write. orch tells coders not to use them during a run; the skills stay as they are. Offer it as an item that is ticked by default.
|
|
25
26
|
|
|
26
27
|
Where do the new skills go: in the skill folder the repo already uses (the `Project skills:` line above), else `.agents/skills`. If the team has an agent that doesn't read that folder, add the link item too.
|
|
27
28
|
|
|
28
29
|
## 3. Ask once, in the picker
|
|
29
30
|
Use your question picker (the `QUESTION PICKER` line above names it; chat when there is none) with two questions:
|
|
30
|
-
1. **What should I set up?** Multi-select: each item from step 2 as a short line (`AGENTS.md with npm test / lint / build`, `New skill supabase-changes: how this repo adds tables`, `Link .agents/skills -> .agent/skills so Codex sees your 21 skills
|
|
31
|
+
1. **What should I set up?** Multi-select: each item from step 2 as a short line (`AGENTS.md with npm test / lint / build`, `New skill supabase-changes: how this repo adds tables`, `Link .agents/skills -> .agent/skills so Codex sees your 21 skills` (only when the gap names that agent), `Tell coders to skip 4 skills that clash with orch`). Recommended: all ticked. Plus **Skip: don't set up this project**.
|
|
31
32
|
2. **Where should it go?**
|
|
32
33
|
- **Only for me** (recommended for a company or team repo, or when the repo's remote is not the developer's own): the files stay in this folder, hidden from git on this machine only (`.git/info/exclude`; the repo's `.gitignore` is not touched). Nothing is committed, teammates never see them.
|
|
33
34
|
- **Share with the repo** (recommended for the developer's own project): the files go on branch `orch/onboard` with a PR; the developer merges it.
|
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
|
+
}
|