ai-agentmanager 1.52.0 → 1.54.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
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.54.0 (2026-11-15)
4
+
5
+ - **Repeat runs: flaky or broken.** One test run can pass or fail by chance, so the app's own test runs (the Eval's, and a race's) can be repeated on the same code. By default a run that passes is believed and a run that fails is run once more, which tells a flaky test from a broken one. **Runs** (1 to 5) beside the test command, in the Eval (kept for the project) or in a race (`agentmgr race test <race> --runs 3`), makes that many runs every time. Passed in some runs and failed in others is **flaky**: in the Eval it counts for part of the tests' weight, is listed as pending and keeps confidence under 100%, so nothing merges on it automatically; in a race the attempt shows `≈ flaky 2/3`. A failing test command now takes twice as long, since it is run again.
6
+
7
+ ## 1.53.0 (2026-11-15)
8
+
9
+ - **Lanes: each agent's own ports.** Worktrees keep agents' files apart, but two dev servers still want the same port. Every agent now gets a range of ten ports (from 21000) and a name ending (`_a1`, `_a2`) no other agent has, in its environment (`AGENT_PORTS`, `AGENT_SUFFIX`, and `PORT` set to its first port) and in its instructions. A lane is given when a session next starts, stays across restarts, and is free again when the agent is deleted. **OS** has a **Ports** column with each open session's lane and what it listens on now; a port outside the lane is marked, and a click opens it in a browser tab. On by default; switches in OS, or `agentmgr lanes` (`--off`, `--port off` if your projects use `PORT` for something else, `--base`, `--size`). Not for agents in containers.
10
+ - **Board.** **Board** in the top bar (or `B`, `#board`): every agent as a card in the column for where its work stands: Starting, Working, Needs you, Waiting, In review, Done, Closed. Cards move by themselves. Drag one onto Closed to close its session, or from Closed onto Waiting to resume it; the Close and Resume buttons on the cards do the same.
11
+
3
12
  ## 1.52.0 (2026-11-14)
4
13
 
5
14
  - **Lean output.** A switch in **Usage** (off by default; `agentmgr usage --lean on`): long command output (test runs, installs, builds) is trimmed before the agent reads it, so a plan's limits last longer. Colour codes and progress redraws go, runs of near-identical lines are folded, and of a long middle only the lines that look like errors or warnings stay. The start and end are kept, and the whole output is saved to a file the agent is told about and can read. Usage shows how many outputs were trimmed and about how many tokens were not read. Claude Code only, for sessions started after you switch it on.
package/README.md CHANGED
@@ -34,6 +34,8 @@ Run one background [Claude Code](https://claude.com/claude-code) agent per inten
34
34
  - **Reverse engineer.** Name a target (an app's folder, a binary, a website) and what you want to understand, in the **Reverse** tab beside an agent's session: the agent investigates with [REA](https://github.com/morluto/rea)'s tools and keeps a report with animated diagrams of how it works, the evidence, what could not be determined, and a plan to build your own version.
35
35
  - **Security audit.** **🛡 Security audit** in an agent's detail (or the **Security** tab of the split, or `agentmgr audit`) has the agent audit the code in its session: it maps where untrusted input comes in, follows it through the code, runs the project's own dependency audit, and checks every finding a second time before listing it. The report beside the session has the attack surface as an animated diagram, findings by severity with evidence and a fix, what was checked and found sound, and what was not covered. It changes no code until you press **Fix findings**. It finds what a careful reader finds; it does not replace a penetration test.
36
36
  - **Skills.** **Skills…** in the menu (or `agentmgr skills`) lists the Agent Skills Claude Code has here, yours and each project's, with which agents used them. Add more from a git repository (`anthropics/skills`, or any https address): you see what it offers first, with each skill's scripts flagged, then pick. A skill added here remembers its repository and commit, so **Check** says when a newer version is there and **Update** brings it; one you edited says so.
37
+ - **Board.** **Board** in the top bar (or `B`, `#board`): every agent as a card in the column for where its work stands: starting, working, needs you, waiting, in review, done, closed. Cards move by themselves; drag one onto **Closed** to close its session, or from Closed onto **Waiting** to resume it.
38
+ - **Lanes.** Every agent gets a range of ports and a name ending no other agent has, in its environment and its instructions, so dev servers and test databases of agents working side by side don't collide. **OS** shows what each open session listens on (`agentmgr lanes`).
37
39
  - **Lean output.** A switch in **Usage** (off by default; `agentmgr usage --lean on`): long command output (test runs, installs, builds) is trimmed before the agent reads it, so a plan's limits last longer. Colours and progress redraws go, runs of near-identical lines are folded, and of a long middle only the lines that look like errors or warnings stay; the start and end are kept, and the whole output is saved to a file the agent can read. Claude Code only, for sessions started after you switch it on. Usage shows how much was trimmed.
38
40
  - **Runbooks for support.** A runbook for the support team written from a release ticket, every ticket of an epic, or a project's code changes in a time frame: what changed, what customers may see, how to check it, troubleshooting, rollback, when to escalate, and what to confirm with engineering.
39
41
  - **Decide.** Help with the decisions, not only the tasks: a plan to review or an agent's question arrives with its options, the one recommended, why, and the risk; calls you keep making become standing decisions that are handled for you and reported; the backlog is ranked by impact; a date at risk is laid out as choices; and past decisions are looked back on.
@@ -200,6 +202,7 @@ agentmgr decisions [project] [--md] # the decision log; --add "<questi
200
202
  agentmgr debt <project> --scan # the tech debt radar: files that change often and are hard to read
201
203
  agentmgr audit <agent> --start # security audit in its session (a scope in words, --fix "1 and 3"; no arguments: the report)
202
204
  agentmgr skills # Claude Code's skills here (look <repo>, add <repo> <names...>, check|update|rm <id>)
205
+ agentmgr lanes # every agent's own ports and name ending (--off, --port off, --base, --size)
203
206
  agentmgr usage # each engine's plan limits: used, left, resets (--now, --lean on, --warn 80, --hold 95, --default codex)
204
207
  agentmgr runbook --ticket REL-42 # a support runbook from a release ticket (or --epic KEY, or --since 2026-10-01 -p <project>; -o file.md)
205
208
  agentmgr decide # what waits for your decision, with its recommendation (--do <n>, --handled, --standing, --autonomy p=level, --priority, --risk)
@@ -752,12 +755,22 @@ Either way, the roles hand off through Markdown files in the team's folder (`~/.
752
755
 
753
756
  - **Status and outcome**, from each agent's brief, plus its checks
754
757
  - **Change**: files and lines added and removed, with the smallest marked
755
- - **Tests**: the race's test command, run in every attempt's worktree two at a time (15-minute limit each)
758
+ - **Tests**: the race's test command, run in every attempt's worktree two at a time (15-minute limit each). **Runs** beside the command (or `agentmgr race test <race> --runs 3`) runs it up to five times in each attempt; an attempt that passes some runs and fails others shows as **flaky**
756
759
  - **Cost and time**
757
760
  - **Diff**: each attempt's full changes against where it started
758
761
 
759
762
  **Pick** marks the winner and can close and delete the other attempts, worktrees included.
760
763
 
764
+ ### Repeat runs: flaky or broken
765
+
766
+ One test run can pass or fail by chance, so the app's own test runs can be repeated on the same code. This holds for a race's tests and for the **Eval** of an agent on a Jira issue (the tests the app runs again itself when the agent says it is done).
767
+
768
+ - **Once (the default)**: a run that passes is believed. A run that fails is run once more, which tells a flaky test (failed, then passed) from a broken one (failed twice). A run that timed out is not repeated.
769
+ - **More than once**: set **Runs** (2 to 5) beside the test command, in the race or in the Eval; for the Eval it is kept for the project. Every run is made, whatever the first says.
770
+ - **Flaky** means it passed some runs and failed others. In the Eval that counts for part of the tests' weight, is listed as pending, and keeps the confidence under 100%, so nothing is merged on it automatically. The output shown is a failed run's.
771
+
772
+ Repeating costs test time, not AI usage.
773
+
761
774
  ## Slack alerts
762
775
 
763
776
  **Three ways to connect Slack:**
@@ -1311,6 +1324,42 @@ Turn it all off with `"decide": { "enabled": false }` in config.json.
1311
1324
  - **Agent sessions**: each open session with the processor and memory it takes, counting everything it started (Claude Code, the tools and tests it runs). Click a name to open the agent.
1312
1325
  - **Busiest processes**: the top of everything running on the computer.
1313
1326
 
1327
+ ### Lanes: each agent's own ports
1328
+
1329
+ Worktrees keep agents' files apart, but two dev servers still want port 3000 and two test runs the same database. So every agent gets a **lane**: a range of ports (ten, from 21000: the first agent has 21000–21009, the next 21010–21019) and a name ending (`_a1`, `_a2`) that no other agent has. A lane is given when an agent's session first starts, stays with the agent across restarts, and is free for a new agent once the agent is deleted.
1330
+
1331
+ - **In its environment**: `AGENT_PORTS` (`21010-21019`), `AGENT_PORT` and `AGENT_PORT_END` (first and last), `AGENT_LANE` (its number), `AGENT_SUFFIX` (`_a2`), and `PORT` set to its first port, which many dev servers listen on by themselves. The shells you open in its folder get the same.
1332
+ - **In its instructions**: to use its own ports for anything it starts that listens, to leave what holds a port outside them alone, and to end the names of things it creates outside its folder (a database, a container, a compose project) with its ending.
1333
+ - **In OS**: the **Ports** column of Agent sessions shows each open session's lane and what it listens on now, read from the system (`lsof`, or `ss` on Linux). Click a port to open it in a browser tab beside the session. A port outside the lane is marked, and so is a port of the lane that something else holds.
1334
+ - **In an agent's detail**: **Lane** under Workspace.
1335
+
1336
+ The switches are under Agent sessions in OS: **A lane of ports for each agent**, and **Set PORT to its first port** (turn it off if your projects use `PORT` for something else). A change reaches a session the next time it starts. From the command line:
1337
+
1338
+ ```sh
1339
+ agentmgr lanes # the settings, and every agent's lane
1340
+ agentmgr lanes --off # no lanes (--on brings them back)
1341
+ agentmgr lanes --port off # keep the lanes, leave PORT alone
1342
+ agentmgr lanes --base 30000 --size 20
1343
+ ```
1344
+
1345
+ Lanes are a convention the agent is told and given, not a wall: nothing stops a tool that ignores `PORT` from taking 3000. That is what the Ports column is for. Agents in containers get no lane; a container has its own ports.
1346
+
1347
+ ## Board
1348
+
1349
+ **Board** in the top bar (or `B`, or `#board`) shows every agent as a card, in the column for where its work stands:
1350
+
1351
+ | Column | An agent is here when |
1352
+ | --- | --- |
1353
+ | Starting | its workspace is being prepared, or it is planning |
1354
+ | Working | it is producing output now |
1355
+ | Needs you | a prompt, an open question, a plan to approve, a usage limit, an error, or it may be stuck. This comes before every other column |
1356
+ | Waiting | its session is open and waits for its next instruction |
1357
+ | In review | it has an open pull request (the card says ready to merge, needs fixes, behind, checks running or draft) |
1358
+ | Done | its pull request merged, or it reported its work done |
1359
+ | Closed | its session is closed and can be resumed |
1360
+
1361
+ Cards are ordered by priority, then the most recently active. A card moves by itself as its agent's work moves; the columns are not something you set. Two drags do something: a card onto **Closed** closes its session (not while it is working), and a card from Closed onto **Waiting** resumes it; the **Close** and **Resume** buttons on the cards do the same. Any other drop says why nothing moved. Click a card to open its agent. With more than one project, a list at the top narrows the board to one.
1362
+
1314
1363
  It reads again every 3 seconds while open, with `ps` and the system's own counters; nothing leaves the computer.
1315
1364
 
1316
1365
  Above the agent list, **N running** is a filter: click it to list only the agents whose session is open, and again to list them all.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agentmanager",
3
- "version": "1.52.0",
3
+ "version": "1.54.0",
4
4
  "description": "Run background coding agents (Claude Code, Codex) per intent, and keep track of them from a web UI, your phone or the CLI",
5
5
  "keywords": [
6
6
  "claude",
package/public/app.js CHANGED
@@ -44,6 +44,7 @@ import { initSystem } from '/system.js';
44
44
  import { adviceHtml, initDecide } from '/decide.js';
45
45
  import { initUsage } from '/usage.js';
46
46
  import { initSkills } from '/skills.js';
47
+ import { initBoard } from '/board.js';
47
48
  import { initMcp } from '/mcp.js';
48
49
  import { initCodeMap } from '/codemap.js';
49
50
  import { initKeys } from '/keys.js';
@@ -76,19 +77,21 @@ const newsOnLoad = hashId === 'news';
76
77
  // "#plan" or "#plan/<dates|decisions|debt>".
77
78
  const planOnLoad = hashId === 'plan';
78
79
  const osOnLoad = hashId === 'os';
80
+ const boardOnLoad = hashId === 'board';
79
81
  // "#decide" or "#decide/<waiting|handled|standing|priority|tradeoffs|lookback>".
80
82
  const decideOnLoad = hashId === 'decide';
81
83
  const reviewsOnLoad = hashId === 'reviews';
82
84
  // "#mcp" or "#mcp/<agent>": the MCP window on its own.
83
85
  const mcpOnLoad = hashId === 'mcp';
84
86
  let watchShown = false;
85
- let selectedId = (watchOnLoad || standupOnLoad || mapOnLoad || valueOnLoad || newsOnLoad || planOnLoad || osOnLoad || decideOnLoad || reviewsOnLoad || mcpOnLoad ? null : hashId) || null;
87
+ let selectedId = (watchOnLoad || standupOnLoad || mapOnLoad || valueOnLoad || newsOnLoad || planOnLoad || osOnLoad || boardOnLoad || decideOnLoad || reviewsOnLoad || mcpOnLoad ? null : hashId) || null;
86
88
  let openTermOnLoad = hashView === 'term' || hashView === 'code' || isShell(hashView) || isBrowser(hashView);
87
89
  let filterText = '';
88
90
  // Only agents whose session is open (the "running" count above the list, clicked).
89
91
  let listRunning = false;
90
92
  // Decide: the recommendations shown on inbox cards come from it (set once the page is wired).
91
93
  let decideUi = null;
94
+ let boardUi = null;
92
95
  // "Only agents created in the last N days": remembered in this browser.
93
96
  const recent = (() => {
94
97
  try {
@@ -336,8 +339,11 @@ const planUi = initPlan({
336
339
  });
337
340
  $('#plan-btn').onclick = () => planUi.open();
338
341
  // OS: this computer and its load right now.
339
- const osUi = initSystem({ api, $, esc, toast: (m, ms) => toast(m, ms), openAgent: (id) => (showTab('agents'), select(id)) });
342
+ const osUi = initSystem({ api, $, esc, toast: (m, ms) => toast(m, ms), openAgent: (id) => (showTab('agents'), select(id)), openPort: (id, port) => openPort(id, port) });
340
343
  $('#os-btn').onclick = () => osUi.open();
344
+ // Board: every agent as a card in the column for where its work stands.
345
+ boardUi = initBoard({ api, $, esc, ago, toast: (m, ms) => toast(m, ms), agents: () => agents, openAgent: (id) => (showTab('agents'), select(id)), upsert: (a) => upsert(a) });
346
+ $('#board-btn').onclick = () => boardUi.open();
341
347
  // Decide: recommendations on what waits for you, standing decisions, impact, trade-offs, looking back.
342
348
  decideUi = initDecide({
343
349
  api,
@@ -413,6 +419,7 @@ function shortcut(act) {
413
419
  if (act === 'news') return newsUi.open();
414
420
  if (act === 'plan') return planUi.open();
415
421
  if (act === 'os') return osUi.open();
422
+ if (act === 'board') return boardUi.open();
416
423
  if (act === 'decide') return decideUi.open();
417
424
  if (act === 'usage') return usageUi.open();
418
425
  if (act === 'skills') return skillsUi.open();
@@ -811,9 +818,9 @@ $('#doc-body').addEventListener('submit', (e) => {
811
818
  e.preventDefault();
812
819
  const id = docView.agentId;
813
820
  act(async () => {
814
- const r = await api('PUT', `/agents/${id}/eval/command`, { command: f.command.value });
821
+ const r = await api('PUT', `/agents/${id}/eval/command`, { command: f.command.value, runs: Number(f.runs.value) || 1 });
815
822
  await api('POST', `/agents/${id}/eval/verify`);
816
- toast(r.testCommand ? `Saved; running ${r.testCommand}` : 'Saved', 4000);
823
+ toast(r.testCommand ? `Saved; running ${r.testCommand}${r.testRuns > 1 ? ` ${r.testRuns} times` : ''}` : 'Saved', 4000);
817
824
  });
818
825
  });
819
826
 
@@ -2181,7 +2188,7 @@ function openRace(id) {
2181
2188
 
2182
2189
  const fmtCost = (c) => (c ? `$${c.toFixed(2)}` : '—');
2183
2190
  const testCell = (t) =>
2184
- !t ? '<span class="hint">—</span>' : `<span class="test ${t.status}" title="${esc(t.output ?? '')}">${{ passed: '✓ passed', failed: '✗ failed', running: '… running', queued: 'queued', error: '⚠ error' }[t.status] ?? t.status}${t.seconds != null ? ` <span class="hint">${t.seconds}s</span>` : ''}</span>`;
2191
+ !t ? '<span class="hint">—</span>' : `<span class="test ${t.status}" title="${esc(t.output ?? '')}">${{ passed: t.runs > 1 ? `✓ passed ${t.runs}×` : '✓ passed', failed: t.runs > 1 ? `✗ failed ${t.runs}×` : '✗ failed', flaky: `≈ flaky ${t.passes}/${t.runs}`, running: '… running', queued: 'queued', error: '⚠ error' }[t.status] ?? t.status}${t.seconds != null ? ` <span class="hint">${t.seconds}s</span>` : ''}</span>`;
2185
2192
 
2186
2193
  function renderRace() {
2187
2194
  const dlg = $('#race-dialog');
@@ -2191,7 +2198,7 @@ function renderRace() {
2191
2198
  $('#race-body').innerHTML = '<p class="hint">Loading…</p>';
2192
2199
  return;
2193
2200
  }
2194
- if ($('#race-body').contains(document.activeElement) && document.activeElement.name === 'testCommand') return;
2201
+ if ($('#race-body').contains(document.activeElement) && ['testCommand', 'testRuns'].includes(document.activeElement.name)) return;
2195
2202
  $('#race-title').textContent = `Race: ${r.intent.split('\n')[0].slice(0, 80)}`;
2196
2203
  // Tag a row only when it is strictly the best of several.
2197
2204
  const uniqueMin = (vals) => {
@@ -2204,6 +2211,7 @@ function renderRace() {
2204
2211
  $('#race-body').innerHTML = `
2205
2212
  <form class="race-tests" id="race-tests">
2206
2213
  <label>Test command <input name="testCommand" value="${esc(r.testCommand ?? '')}" placeholder="npm test" /></label>
2214
+ <label title="How many times it is run in each attempt. More than one shows a flaky test: one that passes in some runs and fails in others. With 1, a run that fails is run once more">Runs <input name="testRuns" type="number" min="1" max="5" value="${r.testRuns ?? 1}" /></label>
2207
2215
  <button class="small primary">Run in every attempt</button>
2208
2216
  </form>
2209
2217
  <div class="race-table-wrap"><table class="race-table">
@@ -2262,8 +2270,8 @@ $('#race-delete').onclick = () => {
2262
2270
  };
2263
2271
  $('#race-body').addEventListener('submit', (e) => {
2264
2272
  e.preventDefault();
2265
- const command = new FormData(e.target).get('testCommand');
2266
- act(async () => races.set(openRaceId, await api('POST', `/races/${openRaceId}/tests`, { command })), 'Running tests');
2273
+ const f = new FormData(e.target);
2274
+ act(async () => races.set(openRaceId, await api('POST', `/races/${openRaceId}/tests`, { command: f.get('testCommand'), runs: Number(f.get('testRuns')) || 1 })), 'Running tests');
2267
2275
  });
2268
2276
  $('#race-body').addEventListener('click', (e) => {
2269
2277
  const t = e.target;
@@ -2455,6 +2463,7 @@ function renderDetail() {
2455
2463
  <dt>Head</dt><dd>${a.git?.head ? `<code>${esc(a.git.head.sha)}</code> ${esc(a.git.head.subject)}` : '—'}</dd>
2456
2464
  ${a.baseRef ? `<dt>Branched from</dt><dd><code>${esc(a.baseRef)}</code></dd>` : ''}
2457
2465
  ${a.worktree ? `<dt>Worktree of</dt><dd><code>${esc(a.sourceDir)}</code></dd>` : ''}
2466
+ ${a.laneInfo ? `<dt title="Its own ports and name ending, in its environment and instructions, so what it starts doesn't collide with another agent's. What it listens on now is in OS">Lane</dt><dd>ports <code>${a.laneInfo.first}–${a.laneInfo.last}</code> · names end with <code>${esc(a.laneInfo.suffix)}</code></dd>` : ''}
2458
2467
  ${noRepo(a) ? '' : `<dt>Repo memory</dt><dd><button class="link" data-act="memory" title="What agents learned working in this repo; every agent here gets it">View and edit</button></dd>`}
2459
2468
  </dl>
2460
2469
  </div>
@@ -2566,6 +2575,7 @@ const perf = {
2566
2575
  on: new URLSearchParams(location.search).has('perf'),
2567
2576
  runs: [], // [at, ms, { view: ms }] over the last 5 seconds
2568
2577
  draw(views) {
2578
+ boardUi?.refresh();
2569
2579
  if (!this.on) {
2570
2580
  for (const v of views) VIEWS[v]();
2571
2581
  return;
@@ -3118,6 +3128,16 @@ const browserLabel = (url) => {
3118
3128
  const u = new URL(url);
3119
3129
  return u.host + (u.pathname === '/' ? '' : u.pathname);
3120
3130
  };
3131
+ /** What an agent listens on, in a browser tab beside its session. */
3132
+ async function openPort(id, port) {
3133
+ showTab('agents');
3134
+ select(id);
3135
+ await act(async () => {
3136
+ const tab = await api('POST', `/agents/${id}/browsers`, { url: `localhost:${port}`, mode: liveAvailable ? 'live' : 'lite' });
3137
+ upsertBrowsers(id, tab.n, tab.url, tab.mode);
3138
+ term.open(id, `browser:${tab.n}`);
3139
+ });
3140
+ }
3121
3141
  async function openAddress(url) {
3122
3142
  const id = term.agentId;
3123
3143
  if (!id || !url.trim()) return;
@@ -4511,6 +4531,11 @@ function handleEvent(msg) {
4511
4531
  history.replaceState(null, '', '#');
4512
4532
  osUi.open();
4513
4533
  }
4534
+ if (boardOnLoad && !watchShown) {
4535
+ watchShown = true;
4536
+ history.replaceState(null, '', '#');
4537
+ boardUi.open();
4538
+ }
4514
4539
  if (newsOnLoad && !watchShown) {
4515
4540
  watchShown = true;
4516
4541
  history.replaceState(null, '', '#');
@@ -0,0 +1,177 @@
1
+ // Board: every agent as a card in the column for where its work stands: starting, working, needs
2
+ // you, waiting for its next instruction, in review (an open pull request), done, closed. An agent
3
+ // moves between columns by itself as its work moves. Dragging a card does the two things a drag
4
+ // can honestly do: onto Closed closes its session, and from Closed onto Waiting resumes it.
5
+
6
+ import { expandButton, expandable } from './expand.js';
7
+ import { morph } from './morph.js';
8
+ import { BOARD_COLUMNS, columnOf, dropAction, needOf, openPrs } from './boardcols.js';
9
+
10
+ const LAND = { ready: 'ready to merge', fix: 'needs fixes', behind: 'behind', waiting: 'checks running', draft: 'draft', merged: 'merged', closed: 'closed' };
11
+ const MANY = 30; // closed and done cards shown before "and N more"
12
+
13
+ export function initBoard({ api, $, esc, ago, toast, agents, openAgent, upsert }) {
14
+ const dialog = $('#board-dialog');
15
+ const body = $('#board-body');
16
+ let project = '';
17
+ let all = false; // every closed and done card, not the latest ones
18
+ let dragging = null;
19
+ let stale = false;
20
+ try {
21
+ project = localStorage.getItem('agentmgr.board.project') ?? '';
22
+ } catch {}
23
+
24
+ const shown = () => [...agents().values()].filter((a) => a.kind !== 'assistant');
25
+ const projects = () => {
26
+ const seen = new Map();
27
+ for (const a of shown()) if (a.projectInfo?.key && !['other', 'general', 'assistant'].includes(a.projectInfo.key)) seen.set(a.projectInfo.key, a.projectInfo.name);
28
+ return [...seen].sort((x, y) => x[1].localeCompare(y[1]));
29
+ };
30
+
31
+ function card(a, col) {
32
+ const need = col === 'needs' ? needOf(a) : null;
33
+ const pr = col === 'review' ? openPrs(a)[0] : col === 'done' ? (a.prs ?? []).find((p) => p.land === 'merged') : null;
34
+ const rt = a.runtime ?? {};
35
+ const move = col === 'closed' && a.workdir ? `<button class="small" data-board-act="start" data-id="${esc(a.id)}" title="Resume its session in the background">Resume</button>` : col === 'idle' ? `<button class="small ghost" data-board-act="stop" data-id="${esc(a.id)}" title="Close its session; it can be resumed">Close</button>` : '';
36
+ return `<li class="board-card pr${a.priority ?? 2}" draggable="true" data-board-card="${esc(a.id)}" tabindex="0" title="${esc(a.synopsis?.text || a.intent || '')}">
37
+ <div class="board-card-head">${(a.priority ?? 2) === 2 ? '' : `<span class="prio p${a.priority}">P${a.priority}</span>`}<b>${esc(a.name)}</b></div>
38
+ ${need ? `<div class="board-need">${esc(need)}</div>` : ''}
39
+ ${pr ? `<div class="board-pr ${esc(pr.land)}">#${esc(String(pr.number ?? ''))} ${esc(LAND[pr.land] ?? pr.land)}</div>` : ''}
40
+ ${col === 'starting' && a.progress?.phase ? `<div class="hint">${esc(a.progress.phase)}</div>` : ''}
41
+ <div class="board-meta">${a.projectInfo?.name && !project && !['other', 'general', 'assistant'].includes(a.projectInfo.key) ? `<span class="branch">${esc(a.projectInfo.name)}</span>` : ''}${a.kind === 'general' ? '<span class="tag">general</span>' : ''}${a.activeAt ? `<span class="hint">${esc(ago(a.activeAt))}</span>` : ''}${a.brief?.summary?.total ? `<span class="hint${a.brief.summary.failed ? ' fail' : ''}">✓${a.brief.summary.passed}/${a.brief.summary.total}</span>` : ''}${rt.running && col !== 'working' && col !== 'idle' ? '<span class="hint" title="Its session is open">◉</span>' : ''}<span class="spacer"></span>${move}</div>
42
+ </li>`;
43
+ }
44
+
45
+ function draw() {
46
+ const list = shown().filter((a) => !project || a.projectInfo?.key === project);
47
+ const by = new Map(BOARD_COLUMNS.map((c) => [c.id, []]));
48
+ for (const a of list) by.get(columnOf(a)).push(a);
49
+ for (const cards of by.values()) cards.sort((x, y) => (x.priority ?? 2) - (y.priority ?? 2) || String(y.activeAt ?? y.createdAt ?? '').localeCompare(String(x.activeAt ?? x.createdAt ?? '')));
50
+ const ps = projects();
51
+ return `
52
+ <div class="issues-head">
53
+ <h2>Board</h2><span class="hint">${list.length} agent${list.length === 1 ? '' : 's'}</span>
54
+ <span class="spacer"></span>
55
+ ${ps.length > 1 ? `<select data-board-project aria-label="Project"><option value="">Every project</option>${ps.map(([k, n]) => `<option value="${esc(k)}" ${k === project ? 'selected' : ''}>${esc(n)}</option>`).join('')}</select>` : ''}
56
+ ${expandButton(dialog)}
57
+ <button class="small" data-board="close">Close</button>
58
+ </div>
59
+ <div class="board-cols">
60
+ ${BOARD_COLUMNS.map((c) => {
61
+ const cards = by.get(c.id);
62
+ const cut = !all && (c.id === 'closed' || c.id === 'done') && cards.length > MANY ? cards.length - MANY : 0;
63
+ return `<section class="board-col col-${c.id}" data-board-col="${c.id}" aria-label="${esc(c.label)}">
64
+ <h3 title="${esc(c.hint)}">${esc(c.label)} <span class="hint">${cards.length}</span></h3>
65
+ <ul>${(cut ? cards.slice(0, MANY) : cards).map((a) => card(a, c.id)).join('')}</ul>
66
+ ${cut ? `<button class="link" data-board="all">and ${cut} more</button>` : ''}
67
+ </section>`;
68
+ }).join('')}
69
+ </div>
70
+ <p class="hint">A card moves by itself as its agent's work moves. Drag one onto Closed to close its session, or from Closed onto Waiting to resume it. Click a card to open its agent.</p>`;
71
+ }
72
+
73
+ const render = () => {
74
+ // A redraw mid-drag would drop the card being dragged: draw when it lands.
75
+ if (dragging) return (stale = true);
76
+ morph(body, draw());
77
+ };
78
+
79
+ async function run(id, what) {
80
+ try {
81
+ upsert(await api('POST', `/agents/${id}/${what}`, {}));
82
+ toast?.(what === 'stop' ? 'Session closed. Resume brings it back' : 'Resumed in the background', 3000);
83
+ } catch (e) {
84
+ toast?.(e.message, 5000);
85
+ }
86
+ render();
87
+ }
88
+
89
+ body.addEventListener('click', (e) => {
90
+ if (e.target.closest('[data-board="close"]')) return dialog.close();
91
+ if (e.target.closest('[data-board="all"]')) {
92
+ all = true;
93
+ return render();
94
+ }
95
+ const b = e.target.closest('[data-board-act]');
96
+ if (b) return run(b.dataset.id, b.dataset.boardAct);
97
+ const c = e.target.closest('[data-board-card]');
98
+ if (c) {
99
+ dialog.close();
100
+ openAgent?.(c.dataset.boardCard);
101
+ }
102
+ });
103
+ body.addEventListener('keydown', (e) => {
104
+ const c = e.target.matches?.('[data-board-card]') ? e.target : null;
105
+ if (!c || (e.key !== 'Enter' && e.key !== ' ')) return;
106
+ e.preventDefault();
107
+ dialog.close();
108
+ openAgent?.(c.dataset.boardCard);
109
+ });
110
+ body.addEventListener('change', (e) => {
111
+ if (!e.target.matches('[data-board-project]')) return;
112
+ project = e.target.value;
113
+ try {
114
+ localStorage.setItem('agentmgr.board.project', project);
115
+ } catch {}
116
+ render();
117
+ });
118
+
119
+ const colAt = (e) => e.target.closest?.('[data-board-col]');
120
+ const clear = () => body.querySelectorAll('.board-col.drop').forEach((x) => x.classList.remove('drop'));
121
+ body.addEventListener('dragstart', (e) => {
122
+ const c = e.target.closest?.('[data-board-card]');
123
+ if (!c) return;
124
+ dragging = c.dataset.boardCard;
125
+ e.dataTransfer.effectAllowed = 'move';
126
+ e.dataTransfer.setData('text/plain', dragging);
127
+ c.classList.add('dragging');
128
+ });
129
+ body.addEventListener('dragover', (e) => {
130
+ const col = colAt(e);
131
+ if (!dragging || !col) return;
132
+ e.preventDefault();
133
+ if (!col.classList.contains('drop')) {
134
+ clear();
135
+ col.classList.add('drop');
136
+ }
137
+ });
138
+ body.addEventListener('drop', (e) => {
139
+ const col = colAt(e);
140
+ const a = agents().get(dragging);
141
+ if (!col || !a) return;
142
+ e.preventDefault();
143
+ const r = dropAction(a, col.dataset.boardCol);
144
+ if (r.act) run(a.id, r.act);
145
+ else if (r.why) toast?.(r.why, 6000);
146
+ });
147
+ body.addEventListener('dragend', () => {
148
+ dragging = null;
149
+ clear();
150
+ body.querySelector('.board-card.dragging')?.classList.remove('dragging');
151
+ if (stale) {
152
+ stale = false;
153
+ render();
154
+ }
155
+ });
156
+
157
+ let queued = false;
158
+ /** Agents changed: draw again, once a frame at most, while the board is open. */
159
+ function refresh() {
160
+ if (!dialog.open || queued) return;
161
+ queued = true;
162
+ setTimeout(() => {
163
+ queued = false;
164
+ if (dialog.open) render();
165
+ }, 200);
166
+ }
167
+
168
+ function open() {
169
+ if (dialog.open) return dialog.close();
170
+ all = false;
171
+ dialog.showModal();
172
+ render();
173
+ }
174
+
175
+ expandable(dialog, render);
176
+ return { open, refresh, isOpen: () => dialog.open };
177
+ }
@@ -0,0 +1,54 @@
1
+ // Board: which column an agent's card is in, why it needs the person, and what a drag does. No
2
+ // page needed, so it is tested by itself (board.js draws it).
3
+
4
+ export const BOARD_COLUMNS = [
5
+ { id: 'starting', label: 'Starting', hint: 'Its workspace is being prepared, or it is planning' },
6
+ { id: 'working', label: 'Working', hint: 'Producing output now' },
7
+ { id: 'needs', label: 'Needs you', hint: 'A prompt, a question, a plan to approve, a limit, an error, or it may be stuck' },
8
+ { id: 'idle', label: 'Waiting', hint: 'Its session is open and waits for its next instruction' },
9
+ { id: 'review', label: 'In review', hint: 'It has an open pull request' },
10
+ { id: 'done', label: 'Done', hint: 'Its pull request merged, or it reported its work done' },
11
+ { id: 'closed', label: 'Closed', hint: 'Its session is closed and can be resumed' },
12
+ ];
13
+
14
+ export const openPrs = (a) => (a.prs ?? []).filter((p) => p.land && p.land !== 'merged' && p.land !== 'closed');
15
+
16
+ /** Why an agent needs the person, in a few words, or null. */
17
+ export function needOf(a) {
18
+ const rt = a.runtime ?? {};
19
+ if (rt.attention) return 'a prompt to answer';
20
+ if (a.status === 'error') return 'an error';
21
+ if (rt.limited) return 'stopped at a limit';
22
+ if (a.planReview?.status === 'review') return 'a plan to approve';
23
+ const q = (a.questions ?? []).filter((x) => !x.answer).length;
24
+ if (q) return q === 1 ? 'a question' : `${q} questions`;
25
+ if (rt.waiting) return rt.waiting.kind === 'error' ? 'an error on its screen' : 'a question on its screen';
26
+ if (a.stuck?.length) return 'may be stuck';
27
+ return null;
28
+ }
29
+
30
+ /** The column an agent's card is in. */
31
+ export function columnOf(a) {
32
+ const rt = a.runtime ?? {};
33
+ if (needOf(a)) return 'needs';
34
+ if (a.status === 'preparing' || rt.planning) return 'starting';
35
+ if (rt.running && rt.busy) return 'working';
36
+ if (openPrs(a).length) return 'review';
37
+ if ((a.prs ?? []).some((p) => p.land === 'merged') || a.results?.outcome === 'done') return 'done';
38
+ return rt.running ? 'idle' : 'closed';
39
+ }
40
+
41
+ /** What a card dropped on a column does: { act: 'stop' | 'start' } or { why } when it does nothing. */
42
+ export function dropAction(a, to) {
43
+ const from = columnOf(a);
44
+ const rt = a.runtime ?? {};
45
+ if (from === to) return { why: null };
46
+ if (to === 'closed') {
47
+ if (!rt.running) return { why: 'Its session is already closed' };
48
+ if (rt.busy) return { why: 'It is working. Close its session from its detail if you mean to stop it' };
49
+ return { act: 'stop' };
50
+ }
51
+ if (to === 'idle' && !rt.running && a.workdir && a.status !== 'preparing') return { act: 'start' };
52
+ const col = BOARD_COLUMNS.find((c) => c.id === to);
53
+ return { why: `An agent moves to ${col?.label ?? to} by itself. Drag onto Closed to close a session, or from Closed onto Waiting to resume it` };
54
+ }
package/public/eval.js CHANGED
@@ -32,10 +32,10 @@ export function evalHtml(ev, esc, { canPost = false } = {}) {
32
32
  ${ev.criteria.length ? `<h4>Acceptance criteria</h4><ul class="eval-list">${ev.criteria.map((c) => `<li>${c.status === 'met' ? '✅' : c.status === 'not_met' ? '❌' : '⏳'} ${esc(c.criterion)}${c.evidence ? ` <span class="hint">— ${esc(c.evidence)}</span>` : ''}</li>`).join('')}</ul>` : ''}
33
33
  <h4>Tests run</h4>
34
34
  <ul class="eval-list">
35
- ${rerun && !rerun.running ? `<li>${rerun.passed ? '✅' : '❌'} <code>${esc(rerun.command)}</code> run again by AI Agent Manager${counts(rerun.counts)} <span class="hint">${esc(new Date(rerun.at).toLocaleString())}${rerun.ms ? ` · ${Math.round(rerun.ms / 1000)}s` : ''}</span>${rerun.passed ? '' : `<pre class="eval-tail">${esc(rerun.tail ?? '')}</pre>`}</li>` : ''}
35
+ ${rerun && !rerun.running ? `<li>${rerun.passed ? '✅' : rerun.flaky ? '🟡' : '❌'} <code>${esc(rerun.command)}</code> run again by AI Agent Manager${rerun.runs > 1 ? ` <b>${rerun.flaky ? `flaky: passed ${rerun.passes} of ${rerun.runs} runs` : `${rerun.runs} runs`}</b>` : ''}${counts(rerun.counts)} <span class="hint">${esc(new Date(rerun.at).toLocaleString())}${rerun.ms ? ` · ${Math.round(rerun.ms / 1000)}s` : ''}</span>${rerun.passed ? '' : `<pre class="eval-tail">${esc(rerun.tail ?? '')}</pre>`}</li>` : ''}
36
36
  ${[...last.values()].map((r) => `<li>${r.passed ? '✅' : '❌'} <code>${esc(r.command)}</code> by the agent${counts(r.counts)} ${ev.runs.filter((x) => x.command === r.command).length > 1 ? `<span class="hint">· ran ${ev.runs.filter((x) => x.command === r.command).length}×, last shown</span>` : ''}</li>`).join('') || '<li class="hint">The agent ran no tests in its session.</li>'}
37
37
  </ul>
38
- <form class="eval-command" data-eval-command><label class="hint">Test command for this project <input name="command" value="${esc(ev.testCommand ?? '')}" placeholder="e.g. npm test" autocomplete="off" /></label> <button class="small">Save</button></form>
38
+ <form class="eval-command" data-eval-command><label class="hint">Test command for this project <input name="command" value="${esc(ev.testCommand ?? '')}" placeholder="e.g. npm test" autocomplete="off" /></label> <label class="hint" title="How many times the tests are run each time, on the same code. More than one shows a flaky test: one that passes in some runs and fails in others. With 1, a run that fails is run once more">Runs <input name="runs" type="number" min="1" max="5" value="${ev.testRuns ?? 1}" /></label> <button class="small">Save</button></form>
39
39
  ${ev.pending.length ? `<h4>Pending</h4><ul class="eval-list">${ev.pending.map((p) => `<li>⏳ ${esc(p)}</li>`).join('')}</ul>` : '<p class="hint">Nothing pending.</p>'}
40
40
  <p class="hint">Confidence comes from fixed rules over these, not from a model: it is 100% only when the tests pass when run again on the code as it is now, every acceptance criterion is met, CI and the AI judge agree, and nothing is pending.</p>
41
41
  </div>`;
package/public/index.html CHANGED
@@ -45,6 +45,7 @@
45
45
  <button id="plan-btn" title="Plan: a project's dates (code complete, RC, GA) with their checklists and reminders, the decision log, and the tech debt radar">Plan <span id="plan-count" class="badge"></span></button>
46
46
  <button id="news-btn" title="AI News: the frontier labs' latest releases (Anthropic, OpenAI, Google and the other top labs), each summarized, with links">AI News <span id="news-count" class="badge ready"></span></button>
47
47
  <button id="map-btn" title="The codebase map: where each agent is changing and reading code, and who is about to collide">Map</button>
48
+ <button id="board-btn" title="Board: every agent as a card in the column for where its work stands: starting, working, needs you, waiting, in review, done, closed (B)">Board</button>
48
49
  <button id="watch-btn" title="Running agents' sessions side by side, live: follow them all without clicking from one to the next">Watch</button>
49
50
  <button id="mcp-btn" title="MCP: the MCP servers Claude Code has (yours, projects', claude.ai connectors and plugins), their tools, and running one in an agent's session or workspace">MCP</button>
50
51
  <button id="os-btn" title="OS: this computer and how loaded it is right now: processor, memory, disks, what each open agent session takes, and the busiest processes">OS</button>
@@ -437,6 +438,9 @@
437
438
  <dialog id="decide-dialog" class="issues-dialog decide-dialog" aria-label="Decide">
438
439
  <div id="decide-body"></div>
439
440
  </dialog>
441
+ <dialog id="board-dialog" class="issues-dialog board-dialog" aria-label="Board">
442
+ <div id="board-body"></div>
443
+ </dialog>
440
444
  <dialog id="os-dialog" class="issues-dialog os-dialog" aria-label="OS">
441
445
  <div id="os-body"></div>
442
446
  </dialog>
package/public/keys.js CHANGED
@@ -30,6 +30,7 @@ export const SHORTCUTS = [
30
30
  [['l'], 'AI News: the latest frontier releases', 'news'],
31
31
  [['c'], 'Plan: project dates, decisions and tech debt', 'plan'],
32
32
  [['u'], 'OS: this computer and its load', 'os'],
33
+ [['B'], 'Board: every agent as a card, by where its work stands', 'board'],
33
34
  [['q'], 'Decide: recommendations, standing decisions, impact, dates at risk', 'decide'],
34
35
  [['z'], "Usage: each engine's plan limits, used and left", 'usage'],
35
36
  [['1'], 'Agents tab', 'tab:agents'],
@@ -75,11 +76,11 @@ export const SHORTCUTS = [
75
76
  // A single key, as an event names it, to its action.
76
77
  export const SINGLE = {
77
78
  j: 'next', k: 'prev', Enter: 'terminal', t: 'terminal',
78
- r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', p: 'standup', m: 'map', i: 'issues', o: 'actions', h: 'assistant', ',': 'settings', d: 'designs', g: 'reviews', v: 'value', l: 'news', c: 'plan', u: 'os', q: 'decide', z: 'usage', y: 'today', b: 'bugs', '?': 'help',
79
+ r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', p: 'standup', m: 'map', i: 'issues', o: 'actions', h: 'assistant', ',': 'settings', d: 'designs', g: 'reviews', v: 'value', l: 'news', c: 'plan', u: 'os', B: 'board', q: 'decide', z: 'usage', y: 'today', b: 'bugs', '?': 'help',
79
80
  1: 'tab:agents', 2: 'tab:inbox', 3: 'tab:backlog', 4: 'tab:land', 5: 'tab:built',
80
81
  };
81
82
  // While Watch is open: only what makes sense there.
82
- const ON_WATCH = new Set(['today', 'new', 'ask', 'watch', 'standup', 'map', 'issues', 'actions', 'assistant', 'settings', 'designs', 'reviews', 'value', 'news', 'plan', 'os', 'decide', 'usage', 'bugs', 'help']);
83
+ const ON_WATCH = new Set(['today', 'new', 'ask', 'watch', 'standup', 'map', 'issues', 'actions', 'assistant', 'settings', 'designs', 'reviews', 'value', 'news', 'plan', 'os', 'board', 'decide', 'usage', 'bugs', 'help']);
83
84
 
84
85
  /** Typing somewhere: a field, an editor or a terminal (xterm types through a textarea). */
85
86
  const typing = (el) => Boolean(el?.closest?.('input, textarea, select, [contenteditable=""], [contenteditable="true"], .xterm, .cm-editor'));
package/public/style.css CHANGED
@@ -621,6 +621,7 @@ dialog::backdrop { background: rgba(0, 0, 0, .45); }
621
621
  .del { color: var(--red); }
622
622
  .test.passed { color: var(--green); }
623
623
  .test.failed, .test.error { color: var(--red); }
624
+ .test.flaky { color: var(--yellow); }
624
625
  .test.running, .test.queued { color: var(--yellow); }
625
626
  .race-diff { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
626
627
  pre.diff { margin: 6px 0 0; max-height: 50vh; overflow: auto; font: 12px/1.45 var(--mono); background: var(--panel-2); padding: 8px 10px; border-radius: 6px; }
@@ -1746,4 +1747,40 @@ table.eval-items tr.eval-na td { color: var(--muted); }
1746
1747
  .eval-tail { margin: 4px 0 0 1.2em; text-indent: 0; max-height: 160px; overflow: auto; font-size: 11.5px; white-space: pre-wrap; }
1747
1748
  .eval-command { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
1748
1749
  .eval-command input { min-width: 220px; }
1750
+ .eval-command input[type='number'], .race-tests input[type='number'] { min-width: 0; width: 56px; }
1749
1751
  @media (max-width: 600px) { table.eval-items td:nth-child(2) { white-space: normal; } .eval-acts { margin-left: 0; } }
1752
+
1753
+ /* OS: an agent's lane of ports and what it listens on. */
1754
+ .os-ports { white-space: normal; font-variant-numeric: tabular-nums; }
1755
+ .os-port-out { color: var(--yellow); }
1756
+ .os-lanes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 8px 0 14px; font-size: 13px; }
1757
+ .os-lanes label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
1758
+ .os-lanes input { width: auto; flex: none; margin: 0; }
1759
+
1760
+ /* Board: agents as cards in columns by where their work stands. */
1761
+ .board-dialog { width: min(1500px, calc(100% - 32px)); height: min(820px, calc(100% - 32px)); }
1762
+ #board-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
1763
+ .board-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 10px; flex: 1; min-height: 0; overflow-x: auto; padding-bottom: 6px; }
1764
+ .board-col { display: flex; flex-direction: column; min-height: 0; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
1765
+ .board-col.drop { border-color: var(--accent); outline: 1px dashed var(--accent); }
1766
+ .board-col h3 { margin: 0 0 8px; font-size: 13px; display: flex; justify-content: space-between; align-items: baseline; }
1767
+ .board-col.col-needs h3 { color: var(--red); }
1768
+ .board-col.col-working h3 { color: var(--green); }
1769
+ .board-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 40px; flex: 1; }
1770
+ .board-card { padding: 8px; border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 6px; background: var(--panel); cursor: pointer; font-size: 13px; }
1771
+ .board-card:hover, .board-card:focus-visible { border-color: var(--accent); outline: none; }
1772
+ .board-card.pr0 { border-left-color: var(--red); }
1773
+ .board-card.pr1 { border-left-color: var(--yellow); }
1774
+ .board-card.dragging { opacity: .5; }
1775
+ .board-card-head { display: flex; gap: 6px; align-items: center; min-width: 0; }
1776
+ .board-card-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1777
+ .board-need { color: var(--red); margin-top: 2px; }
1778
+ .board-pr { margin-top: 2px; color: var(--muted); }
1779
+ .board-pr.ready, .board-pr.merged { color: var(--green); }
1780
+ .board-pr.fix { color: var(--red); }
1781
+ .board-pr.behind { color: var(--yellow); }
1782
+ .board-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; }
1783
+ .board-meta .fail { color: var(--red); }
1784
+ @media (max-width: 720px) {
1785
+ .board-cols { grid-auto-columns: minmax(220px, 80%); }
1786
+ }