|
35 | 35 | # generated artifact). Pass a second positional arg to write elsewhere. |
36 | 36 | set -uo pipefail |
37 | 37 |
|
38 | | -script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
39 | | -root="$(cd "$script_dir/../.." && pwd)" |
| 38 | +# Two-root derivation (issue #63): script_dir = sibling scripts, root = consumer project. |
| 39 | +# shellcheck source=resolve-roots.sh |
| 40 | +. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/resolve-roots.sh" |
40 | 41 | self="$script_dir/cockpit.sh" |
| 42 | +# Agent definitions ship with the PLUGIN, not the consumer repo: prefer the |
| 43 | +# project's own .claude/agents (repo/worktree layout, or a consumer override), |
| 44 | +# else the plugin-cache layout where agents/ sits beside scripts/. |
| 45 | +agents_dir="$root/.claude/agents" |
| 46 | +[ -d "$agents_dir" ] || agents_dir="$script_dir/../agents" |
41 | 47 |
|
42 | 48 | # --------------------------------------------------------------------------- |
43 | 49 | # Hidden seam: the blocking-graph parser as its own subcommand, so it has |
@@ -169,7 +175,7 @@ node -e ' |
169 | 175 | out.push({ role, model, description }); |
170 | 176 | } |
171 | 177 | fs.writeFileSync(process.argv[2], JSON.stringify(out)); |
172 | | -' "$root/.claude/agents" "$tmpdir/agents.json" |
| 178 | +' "$agents_dir" "$tmpdir/agents.json" |
173 | 179 |
|
174 | 180 | # ---- adapter (review lenses/skills, budget) ------------------------------------ |
175 | 181 | node -e ' |
@@ -310,11 +316,11 @@ function phaseBadge(phase) { |
310 | 316 | } |
311 | 317 | } |
312 | 318 | function renderLiveProgress() { |
313 | | - const latest = new Map(); // "role task" -> event |
| 319 | + const latest = new Map(); // "role\u0000task" -> event |
314 | 320 | for (const ev of events) { |
315 | 321 | const role = ev.role != null ? String(ev.role) : ""; |
316 | 322 | const task = ev.task != null ? String(ev.task) : ""; |
317 | | - const key = role + " |
| 323 | + const key = role + "\u0000" + task; |
318 | 324 | latest.set(key, ev); // later lines overwrite earlier ones for the same key |
319 | 325 | } |
320 | 326 | const workers = [...latest.values()]; |
|
0 commit comments