ai-agentmanager 1.18.2 → 1.20.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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.20.0 (2026-11-06)
4
+
5
+ - **Review comments reach the agent while its pull request is open.** New comments, reviews and line comments on an agent's open pull request are sent to it in one message (waking it if closed), checked every couple of minutes; it makes the changes, pushes and replies on the pull request. Only the repo's owners, members and collaborators (and review bots on the code) count; approvals, resolved threads and the agent's own replies don't. On by default: **Send new review comments** in the Land tab, `agentmgr land set --fix-comments off`, or `"landing": { "fixComments": false }`.
6
+ - **Demo page and micro benchmarks, as options.** Tick **Demo page** on the new-agent form (`--demo-page`) and, once the change works, the agent makes a self-contained sample page showing it with real inputs and outputs, published as a claude.ai Artifact and opened here (sandboxed) with **Demo page ↗**. Tick **Micro benchmarks** (`--benchmarks`) and it times the code it changed before and after, writing a results table you open with **Benchmark**, also folded into the pull request description. Both are off by default (`"demoPage"`, `"benchmarks"` in config.json).
7
+ - **Watch: agents side by side.** A **Watch** page (top bar, or `#watch`) shows every running agent's live session at once, up to 12, so you can follow them without clicking from one to another. **Fit** puts them all on screen; an agent waiting on you gets a red border and a count at the top; click a tile and type to answer it in place, or click its name to open the agent. Filter by running, waiting on you or working, and by project.
8
+ - **Keyboard shortcuts.** Quick actions without the mouse: `j`/`k` to move through agents, `Enter` for the terminal, `r` review changes, `s` resume, `Shift+X` close, `e` edit, `n` new agents, `a` Ask Agent, `/` filter, `w` Watch, `1`-`5` tabs; `Ctrl+Shift+↓`/`↑` jump between agents' terminals and `Ctrl+Shift+L` leaves one. **?** (or **Keyboard shortcuts…** in the menu) lists them.
9
+ - A live browser tab keeps trying for its first picture and title for up to 15 seconds when Chrome is slow to start, instead of staying blank.
10
+
11
+ ## 1.19.0 (2026-11-05)
12
+
13
+ - **Design docs, written automatically.** Once its plan is settled, a task agent writes a short design doc and publishes it as a claude.ai Artifact; the link goes in its brief. The doc covers a summary, the architecture, the design, the data flow and the decisions and risks, with at most three small diagrams and no repeats of the spec or plan. When the work is done, the agent brings it up to date at the same link. It's on by default; untick **Design doc** on the new-agent form, use `agentmgr add --no-design-doc`, or set `"designDoc": false`. View it under **Design doc** next to Intent · Spec · Plan; it's also folded into the pull request description.
14
+ - **Publish to Google Drive.** One button (or `agentmgr publish <agent>`) puts all of an agent's documents in a Google Drive folder, one Google Doc each: the brief, intent, spec, plan, design doc and any documents written. It goes through your Claude account's Google Drive connector. Publishing again replaces them with the latest, moving the earlier ones to the trash.
15
+ - A live browser tab you open always shows the page: when the page is holding still and Chrome sends no picture, a screenshot is taken instead of leaving the view blank. Its title is fresh too.
16
+
3
17
  ## 1.18.2 (2026-11-05)
4
18
 
5
19
  - **Show one project's agents.** A project picker above the agents list shows only that project's agents (**All projects** for everyone). Each browser remembers it.
package/README.md CHANGED
@@ -29,7 +29,9 @@ Run one background [Claude Code](https://claude.com/claude-code) agent per inten
29
29
  - **Share for review.** One click writes an **Analysis**, **Design**, **Flow** or **Proposal** document from the agent's work. Copy it as Markdown, download it, or print it to PDF with diagrams.
30
30
  - **Human vs AI.** It splits the open questions about the work into the top 5 that need your judgment and the ones a model can answer from the evidence. It answers those, then a second model double-checks every answer.
31
31
  - **Review changes.** Each agent's diff file by file, line comments sent back to the agent as one message, then **Commit all** and **Push & open PR**, without leaving the page.
32
- - **Landing.** A **Land** tab with every agent's open pull request: ready to merge, needs fixes, behind, waiting. Failing checks and requested changes go back to the agent automatically (a few times at most); **Update**, **Ask to fix** and **Merge** in one click.
32
+ - **Watch.** Every running agent's session side by side on one page, live (**Watch** at the top, or `#watch`), so you follow them all without clicking from one to the next. Tiles keep a fixed order; one waiting on you gets a red border and is counted at the top. Click a tile and type to answer it there; its name opens the agent. Show running agents, only those waiting on you or only those working, one project's, or a fixed number per row; **Fit** sizes the tiles so all of them (up to 12) are on screen, keeping the newest lines in view. Tiles show each session at its own size and never resize it.
33
+ - **Keyboard shortcuts.** Press **?** for the list. `j`/`k` move through the agents, `Enter` opens the terminal, `r` reviews changes, `s` resumes, `Shift+X` closes the session, `e` edits; `n` new agents, `a` Ask Agent, `/` filter, `w` Watch, `1`-`5` the side tabs. Single keys work when you're not typing in a field or a terminal. From inside a terminal, `Ctrl+Shift+↓`/`↑` switch to the next or previous agent's terminal and `Ctrl+Shift+L` leaves it.
34
+ - **Landing.** A **Land** tab with every agent's open pull request: ready to merge, needs fixes, behind, waiting. Failing checks and requested changes go back to the agent automatically (a few times at most), and so does every new review comment while the PR is open; **Update**, **Ask to fix** and **Merge** in one click.
33
35
  - **Triggers.** A label on a GitHub issue starts an agent for it, `/agent …` comments on an agent's pull request reach the agent, and a webhook starts agents from Jira automation or CI. No model watches, so no tokens are spent waiting.
34
36
  - **Repo memory.** What one agent learns about a repo (how to run its tests, a gotcha) is recorded in one line and given to every later agent there.
35
37
  - **Playbooks.** Saved requests with `{{values}}`, run in several projects at once (one agent each), by hand or every hour, day, weekday or week.
@@ -399,6 +401,10 @@ Each card has at most **three points of about 12 words each**, so they're easy t
399
401
  - **Explain changes** explains each change one by one: a title, what it changes, why (from the request and the conversation), the risk and what to check, in the order a reviewer should read them. Each explanation sits above its hunk, and **◀ / ▶** (or **[** and **]**) step through them, opening folded files on the way. When the agent changes the code afterwards, the page says so and **Explain again** brings it up to date. From the CLI: `agentmgr doc <agent> walkthrough`.
400
402
  - **Commit all** commits everything in the worktree, new files included, with your git name and email.
401
403
  - **Intent, spec and plan.** Each agent keeps INTENT.md (what was asked, written by AI Agent Manager), SPEC.md (requirements and acceptance criteria, written by the agent before it changes code) and PLAN.md (steps, ticked off as it goes) next to its brief. Open them with **Intent · Spec · Plan** or in the split view's Docs; Explain, the documents and AI review read them too. `"specs": false` in config.json stops asking agents for the spec and plan.
404
+ - **Design doc.** Once its plan is settled (approved, with plan review on), each task agent writes DESIGN.md next to its brief and publishes it, without waiting for you, as a **claude.ai Artifact** with the diagrams drawn (its Artifact tool). The link goes in its brief's References as **Design page**. It's short on purpose, about 300-700 words: a summary, the architecture, the design, the data flow and the decisions and risks, with at most three small diagrams and nothing repeated from the spec, plan or brief. When the work is done, the agent brings it up to date and republishes the Artifact at the same link. If the tool is missing, the agent notes it and carries on. Open it with **Design doc** next to Intent · Spec · Plan; it also goes, folded, into the pull request description. It's on by default: untick **Design doc** on the new-agent form (`agentmgr add --no-design-doc`) for small fixes, or set `"designDoc": false` in config.json.
405
+ - **Demo page** (off unless ticked; `agentmgr add --demo-page`, or `"demoPage": true`). Once the change works, the agent makes DEMO.html: one self-contained page showing what changed with realistic sample data and the outputs it actually got. That means runnable examples for a library or CLI, the changed screen rebuilt with sample data or screenshots for a UI, and before and after for a fix. It's published as a claude.ai Artifact (**Demo page** in the brief) and opens here with **Demo page ↗**, sandboxed so it can't reach AI Agent Manager or load anything from elsewhere.
406
+ - **Micro benchmarks** (off unless ticked; `agentmgr add --benchmarks`, or `"benchmarks": true`). Once the change works, the agent times the functions it changed with sample inputs at a few sizes, on the base commit and on its change, back to back, and writes BENCHMARK.md: what was measured and how to rerun it, a before | after | change table, the machine, and a line on any slowdown over 5%. It uses the repo's own benchmark setup when there is one; otherwise the scripts stay next to the brief, uncommitted. Open it with **Benchmark**; it's also folded into the pull request description and published to Google Drive with the rest.
407
+ - **Publish to Google Drive.** One click (or `agentmgr publish <agent>`) puts all of an agent's documents in a Google Drive folder named after it, one Google Doc each: the brief, intent, spec, plan, design doc and any documents written for it (analysis, design, flow, proposal, diagrams and so on). It goes through the Google Drive connector of your Claude account, so AI Agent Manager holds no Google credentials. The call can use only the Drive tools that create and trash files. **Google Drive ↗** opens the folder. Publishing again puts the latest versions in the same folder and moves the earlier ones to the trash, because the connector can't edit a doc's content. Mermaid diagrams stay as code in the Google Docs, with a pointer to where they're drawn.
402
408
  - **Push & open PR** pushes the branch and opens a pull request with `gh`, against the branch the agent started from (title from your text, or from the commits; **Draft** if you like). Its description carries the intent, and the spec and plan in folded sections. With a pull request already open, it pushes to it. The pull request is linked to the agent.
403
409
 
404
410
  The same from the API: `GET /api/agents/:id/changes`, `POST …/changes/comments`, `…/changes/commit`, `…/changes/pr`. Plugins can refuse a commit or a pull request (`agent.commit`, `agent.pr`).
@@ -414,10 +420,14 @@ The **Land** tab lists every agent's open pull request by what it needs to get m
414
420
 
415
421
  Each agent's pull requests show the same tags (checks, review, conflicts). Pull requests are checked every couple of minutes for running agents, and every few minutes for closed agents with a PR still open.
416
422
 
417
- **Failures go back to the agent by themselves.** When checks fail on an agent's pull request, the agent is told which ones and how to read their logs; when a reviewer requests changes, it is told to read and address the review. Each commit is reported once, and at most 3 times per pull request, so an agent can't loop on a broken main. Change this at the bottom of the Land tab, with `agentmgr land set`, or in config.json:
423
+ **Failures go back to the agent by themselves.** When checks fail on an agent's pull request, the agent is told which ones and how to read their logs; when a reviewer requests changes, it is told to read and address the review. Each commit is reported once, and at most 3 times per pull request, so an agent can't loop on a broken main.
424
+
425
+ **Review comments go back to the agent too, for as long as the pull request is open.** Each time the pull request is checked, new comments, reviews and line comments are sent to its agent in one message, which wakes a closed agent. The agent makes the changes (or says why not), pushes, and replies on the pull request, answering line comments in their own threads. Only comments from the repo's owners, members and collaborators count, plus review bots' comments on the code (Copilot, for one); approvals, resolved threads, `/agent` commands and the agent's own replies are left out. Comments from before an agent's last turn aren't sent again. The Land tab shows how many were sent.
426
+
427
+ Change these at the bottom of the Land tab, with `agentmgr land set` (`--fix-comments off`), or in config.json:
418
428
 
419
429
  ```json
420
- "landing": { "fixChecks": true, "fixReviews": true, "maxFixes": 3, "mergeMethod": "squash", "deleteBranch": true }
430
+ "landing": { "fixChecks": true, "fixReviews": true, "fixComments": true, "maxFixes": 3, "mergeMethod": "squash", "deleteBranch": true }
421
431
  ```
422
432
 
423
433
  From a terminal: `agentmgr land` lists them, `agentmgr land update|fix|merge <agent>` (`--auto` for auto-merge). With `agentmgr changes`, `comment`, `commit` and `pr` you can review and open the pull request too. Plugins can refuse a merge (`agent.merge`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agentmanager",
3
- "version": "1.18.2",
3
+ "version": "1.20.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
@@ -23,6 +23,8 @@ import { initUpdate } from '/update.js';
23
23
  import { initMenu } from '/menu.js';
24
24
  import { initCode } from '/code.js';
25
25
  import { initMachine } from '/machine.js';
26
+ import { initWatch } from '/watch.js';
27
+ import { initKeys } from '/keys.js';
26
28
  import { morph } from '/morph.js';
27
29
 
28
30
  const $ = (sel) => document.querySelector(sel);
@@ -43,7 +45,10 @@ const loginHash = location.hash.match(/(?:^#|&)login=([\w-]+)/)?.[1] ?? null;
43
45
  const ticketHash = location.hash.match(/(?:^#|&)ticket=([\w-]+)/)?.[1] ?? null;
44
46
  const goHash = ticketHash ? decodeURIComponent(location.hash.match(/(?:^#|&)go=([^&]*)/)?.[1] ?? '') : '';
45
47
  const [hashId, hashView] = loginHash ? [null, null] : (ticketHash ? goHash : location.hash.slice(1)).split('/');
46
- let selectedId = hashId || null;
48
+ // "#watch": the Watch page, not an agent.
49
+ const watchOnLoad = hashId === 'watch';
50
+ let watchShown = false;
51
+ let selectedId = (watchOnLoad ? null : hashId) || null;
47
52
  let openTermOnLoad = hashView === 'term' || hashView === 'code' || isShell(hashView) || isBrowser(hashView);
48
53
  let filterText = '';
49
54
  // "Only agents created in the last N days": remembered in this browser.
@@ -162,6 +167,63 @@ const builtUi = initBuilt({
162
167
  });
163
168
  const landUi = initLand({ api, esc, toast, agents, $, scoreBadge, select: (id) => (showTab('agents'), select(id)), openReview: (id) => reviewUi.open(id), isOpen: () => sideTab === 'land' });
164
169
 
170
+ // Watch: running agents' sessions side by side.
171
+ const watchUi = initWatch({
172
+ agents,
173
+ $,
174
+ esc,
175
+ Terminal,
176
+ openStream,
177
+ statusOf: (a) => statusOf(a),
178
+ pillText: (st) => pillText(st),
179
+ projectKey: (a) => a.projectInfo?.key ?? 'other',
180
+ projectLabel: (a) => a.projectInfo?.name ?? 'Other',
181
+ openAgent: (id) => (showTab('agents'), select(id), term.open(id)),
182
+ });
183
+ $('#watch-btn').onclick = () => watchUi.show(!watchUi.isOpen());
184
+ // Keyboard shortcuts (keys.js): the same actions as the buttons.
185
+ const keysUi = initKeys({ $, esc, run: (act) => shortcut(act) });
186
+ $('#keys-btn').onclick = () => keysUi.help();
187
+
188
+ /** The agents in the list as shown (collapsed projects left out), top to bottom. */
189
+ const listedIds = () => [...document.querySelectorAll('#agent-list li.agent[data-id]')].filter((li) => li.offsetParent).map((li) => li.dataset.id);
190
+
191
+ /** The next or previous agent in the list; from a terminal (Ctrl+Shift), its terminal. */
192
+ function stepAgent(dir, { withTerm = false } = {}) {
193
+ if (sideTab !== 'agents') showTab('agents');
194
+ const ids = listedIds();
195
+ if (!ids.length) return;
196
+ const i = ids.indexOf(selectedId);
197
+ const id = ids[i < 0 ? (dir > 0 ? 0 : ids.length - 1) : (i + dir + ids.length) % ids.length];
198
+ select(id);
199
+ document.querySelector(`#agent-list li[data-id="${id}"]`)?.scrollIntoView({ block: 'nearest' });
200
+ if (withTerm && agents.get(id)?.runtime.running) term.open(id);
201
+ else document.activeElement?.blur();
202
+ }
203
+
204
+ /** Press one of the selected agent's buttons (false when it has none, or it's off). */
205
+ function detailAct(name) {
206
+ const b = selectedId && document.querySelector(`#detail [data-act="${name}"]`);
207
+ if (!b || b.disabled) return false;
208
+ b.click();
209
+ }
210
+
211
+ function shortcut(act) {
212
+ if (act === 'next' || act === 'prev') return stepAgent(act === 'next' ? 1 : -1);
213
+ if (act === 'next-term' || act === 'prev-term') return stepAgent(act === 'next-term' ? 1 : -1, { withTerm: true });
214
+ if (act === 'leave') return document.activeElement?.blur();
215
+ if (['terminal', 'changes', 'start', 'stop', 'edit'].includes(act)) return detailAct(act);
216
+ if (act === 'new') return $('#new-btn').click();
217
+ if (act === 'ask') return $('#ask-btn').click();
218
+ if (act === 'filter') {
219
+ $('#filter').focus();
220
+ return $('#filter').select();
221
+ }
222
+ if (act === 'watch') return $('#watch-btn') ? $('#watch-btn').click() : false;
223
+ if (act.startsWith('tab:')) return showTab(act.slice(4));
224
+ return false;
225
+ }
226
+
165
227
  function statusOf(a) {
166
228
  if (a.runtime.planning) return a.runtime.attention ? 'attention' : 'planning';
167
229
  if (a.status === 'running') {
@@ -310,9 +372,14 @@ const INSIGHT_ICONS = { why: '🎯', what: '📦', how: '🛠', now: '📍' };
310
372
  const DOCS = { analysis: 'Analysis', design: 'Design', flow: 'Flow', proposal: 'Proposal', humanai: 'Human vs AI', diagrams: 'Diagrams', scorecard: 'Scorecard' };
311
373
  // Optional extras that "Write all" leaves out.
312
374
  const DOC_EXTRAS = new Set(['diagrams', 'scorecard']);
313
- const DOC_TITLES = { ...DOCS, plan: 'Plan', intent: 'Intent', spec: 'Spec' };
375
+ const DOC_TITLES = { ...DOCS, plan: 'Plan', intent: 'Intent', spec: 'Spec', designdoc: 'Design doc', benchmark: 'Benchmark' };
314
376
  // The agent's intent, spec and plan files (read from the daemon when opened; kept here by agent and kind).
315
- const SPEC_KINDS = { intent: 'Intent', spec: 'Spec', plan: 'Plan' };
377
+ const SPEC_KINDS = { intent: 'Intent', spec: 'Spec', plan: 'Plan', designdoc: 'Design doc', benchmark: 'Benchmark' };
378
+ // What each optional file is, for its button before it's written.
379
+ const SPEC_PENDING = {
380
+ designdoc: 'The agent writes it once its plan is settled, publishes it as an Artifact (the link is in its brief) and updates it when done',
381
+ benchmark: 'The agent times the code it changed, before and after, once the change works',
382
+ };
316
383
  const specCache = new Map(); // "<agent>:<kind>" -> { markdown, at }
317
384
  const isSpecKind = (a, kind) => Boolean(SPEC_KINDS[kind]) && !(kind === 'plan' && a?.planReview);
318
385
  async function loadSpec(agentId, kind) {
@@ -392,18 +459,37 @@ function docButtons(a) {
392
459
  return `<button class="small doc-btn ${d?.markdown ? 'has' : ''}" data-doc="${k}" ${d?.pending ? 'disabled' : ''}
393
460
  title="${k === 'scorecard' ? (d?.markdown ? `Open the review scorecard: ${d.data?.overall ?? '—'}/100` : 'Score the changes for review: intent, spec, scope, plan, tests and safety, with an overall readiness and where to look') : k === 'diagrams' ? (d?.markdown ? `Open the diagrams${stale ? ' (the brief changed since)' : ''}` : 'Draw the problem and its solution for a quick grasp: architecture, design, data flow (animated) and the key interaction, diagrams only. Built from the documents already written and the agent\'s work') : d?.markdown ? `Open the ${label.toLowerCase()} document${stale ? ' (the brief changed since)' : ''}` : `Write a ${label.toLowerCase()} document for stakeholders`}">${d?.pending ? `${label}…` : label}${d?.markdown ? (stale ? ' •' : ' ✓') : ''}</button>`;
394
461
  })
395
- .join('')}</span>${specButtons(a)}`;
462
+ .join('')}</span>${specButtons(a)}${driveButton(a)}`;
463
+ }
464
+
465
+ /** Publish to Google Drive: all the agent's documents, one Google Doc each, in one folder (again: replaced). */
466
+ function driveButton(a) {
467
+ if (!a.specDocs) return '';
468
+ const d = a.drive ?? {};
469
+ const n = Object.keys(d.files ?? {}).length;
470
+ const tip = 'Put all of this agent\'s documents (brief, intent, spec, plan, design doc and any documents written) in a Google Drive folder, one Google Doc each, through the Google Drive connector of your Claude account. Publishing again replaces them with the latest (the earlier ones go to the trash)';
471
+ return `<span class="doc-buttons drive-buttons">${d.folderUrl ? `<a class="small doc-btn has" href="${esc(d.folderUrl)}" target="_blank" rel="noopener" title="${n} document${n === 1 ? '' : 's'} published ${ago(d.at)}">Google Drive ↗</a>` : ''}<button class="small doc-btn" data-act="drive" ${d.pending ? 'disabled' : ''} title="${esc(tip)}">${d.pending ? 'Publishing…' : d.folderUrl ? 'Publish again' : 'Publish to Google Drive'}</button>${d.error && !d.pending ? `<span class="hint error" title="${esc(d.error)}">Publish: ${esc(d.error.slice(0, 80))}</span>` : ''}</span>`;
396
472
  }
397
473
 
398
474
  /** Intent · Spec · Plan: the files kept for reviewers (and put in the pull request's description). */
399
475
  function specButtons(a) {
400
476
  if (!a.specDocs) return '';
401
477
  return `<span class="doc-buttons spec-buttons" title="For reviewers, people and agents: what was asked, what done means, and the plan. Push & open PR puts them in the description">${Object.entries(SPEC_KINDS)
478
+ .filter(([k]) => (k === 'designdoc' ? a.designDoc : k === 'benchmark' ? a.benchmarks : true) || a.specDocs[k])
402
479
  .map(([k, label]) => {
403
480
  const at = a.specDocs[k] ?? (k === 'plan' ? a.planReview?.updatedAt : null);
404
- return `<button class="small doc-btn ${at ? 'has' : ''}" data-doc="${k}" title="${at ? `Open ${label} (updated ${ago(at)})` : k === 'intent' ? 'Written when the agent is created' : `The agent writes it ${k === 'spec' ? 'before changing code' : 'and keeps it current'}`}">${label}${at ? ' ✓' : ''}</button>`;
481
+ return `<button class="small doc-btn ${at ? 'has' : ''}" data-doc="${k}" title="${at ? `Open ${label} (updated ${ago(at)})` : k === 'intent' ? 'Written when the agent is created' : SPEC_PENDING[k] ?? `The agent writes it ${k === 'spec' ? 'before changing code' : 'and keeps it current'}`}">${label}${at ? ' ✓' : ''}</button>`;
405
482
  })
406
- .join('')}</span>`;
483
+ .join('')}${demoButton(a)}</span>`;
484
+ }
485
+
486
+ /** The sample demo page: opens in its own tab, sandboxed. */
487
+ function demoButton(a) {
488
+ if (!a.demoPage && !a.specDocs.demo) return '';
489
+ const at = a.specDocs.demo;
490
+ return at
491
+ ? `<a class="small doc-btn has" href="/api/agents/${a.id}/demo" target="_blank" rel="noopener" title="Open the demo page (updated ${ago(at)}); the published copy is linked in the brief">Demo page ↗</a>`
492
+ : '<button class="small doc-btn" disabled title="The agent makes it once the change works and publishes it as an Artifact">Demo page</button>';
407
493
  }
408
494
 
409
495
  let docView = null; // { agentId, kind }
@@ -425,7 +511,7 @@ function renderDocDialog() {
425
511
  } else if (d?.error) body.innerHTML = `<p class="error">Couldn't write it: ${esc(d.error)}</p>`;
426
512
  else if (plan && !d?.markdown) body.innerHTML = '<p class="hint">The agent is investigating and hasn\'t written its plan yet. You\'ll see it here (and in the inbox) when it has.</p>';
427
513
  else if (specKind && !d?.loaded) body.innerHTML = '<p class="hint">Loading…</p>';
428
- else if (specKind && !d?.markdown) body.innerHTML = `<p class="hint">${docView.kind === 'intent' ? 'No intent file for this agent (agents created before 1.9 have none).' : `The agent hasn't written its ${label.toLowerCase()} yet. It writes ${docView.kind === 'spec' ? 'the spec before changing code' : 'the plan and keeps it current'}.`}</p>`;
514
+ else if (specKind && !d?.markdown) body.innerHTML = `<p class="hint">${docView.kind === 'intent' ? 'No intent file for this agent (agents created before 1.9 have none).' : `The agent hasn't written its ${label.toLowerCase()} yet. It writes ${docView.kind === 'spec' ? 'the spec before changing code' : docView.kind === 'designdoc' ? 'the design doc once its plan is settled and publishes it as an Artifact' : docView.kind === 'benchmark' ? 'the benchmark results once the change works' : 'the plan and keeps it current'}.`}</p>`;
429
515
  else if (d?.markdown) {
430
516
  // The scorecard's Improve button follows the agent being improved.
431
517
  const version = docView.kind === 'scorecard' ? `${d.at}:${Boolean(a.improving)}` : d.at;
@@ -2085,6 +2171,7 @@ const VIEWS = {
2085
2171
  doc: () => renderDocDialog(),
2086
2172
  detail: () => renderDetail(),
2087
2173
  overlay: () => term.syncOverlay(),
2174
+ watch: () => watchUi?.render(),
2088
2175
  };
2089
2176
  const ALL_VIEWS = Object.keys(VIEWS);
2090
2177
 
@@ -3484,6 +3571,14 @@ $('#detail-body').addEventListener('click', async (e) => {
3484
3571
  btn.textContent = 'Reviewing…';
3485
3572
  act(async () => upsert(await api('POST', `/agents/${a.id}/review`)));
3486
3573
  break;
3574
+ case 'drive':
3575
+ btn.disabled = true;
3576
+ btn.textContent = 'Publishing…';
3577
+ act(async () => {
3578
+ upsert(await api('POST', `/agents/${a.id}/drive`));
3579
+ toast('Publishing to Google Drive: the documents appear in its folder in a minute or two');
3580
+ });
3581
+ break;
3487
3582
  case 'explain':
3488
3583
  btn.disabled = true;
3489
3584
  btn.textContent = 'Explaining…';
@@ -3795,6 +3890,11 @@ $('#new-form').addEventListener('submit', async (e) => {
3795
3890
  ...containerChoice(e.target),
3796
3891
  plan: Boolean(f.get('plan')),
3797
3892
  planReview: Boolean(f.get('planReview')),
3893
+ designDoc: Boolean(f.get('designDoc')),
3894
+ demoPage: Boolean(f.get('demoPage')),
3895
+ benchmarks: Boolean(f.get('benchmarks')),
3896
+ demoPage: Boolean(f.get('demoPage')),
3897
+ benchmarks: Boolean(f.get('benchmarks')),
3798
3898
  priority: Number(f.get('priority')),
3799
3899
  });
3800
3900
  dialog.close();
@@ -3823,6 +3923,7 @@ $('#new-form').addEventListener('submit', async (e) => {
3823
3923
  project: f.get('project') || undefined,
3824
3924
  plan: Boolean(f.get('plan')),
3825
3925
  planReview: Boolean(f.get('planReview')),
3926
+ designDoc: Boolean(f.get('designDoc')),
3826
3927
  start: Boolean(f.get('start')),
3827
3928
  ...containerChoice(e.target),
3828
3929
  });
@@ -3973,6 +4074,10 @@ function handleEvent(msg) {
3973
4074
  else if (agents.get(selectedId).runtime.running) term.open(selectedId);
3974
4075
  }
3975
4076
  openTermOnLoad = false;
4077
+ if (watchOnLoad && !watchUi.isOpen() && !watchShown) {
4078
+ watchShown = true;
4079
+ watchUi.show(true);
4080
+ }
3976
4081
  } else if (msg.t === 'agent') {
3977
4082
  const id = msg.agent.id;
3978
4083
  agents.set(id, msg.agent);
@@ -3982,6 +4087,7 @@ function handleEvent(msg) {
3982
4087
  // The detail, terminal and document views show one agent; another agent's update leaves them be.
3983
4088
  return invalidate([
3984
4089
  'list', 'backlog', 'land', 'inbox', 'race', 'team',
4090
+ ...(watchUi.isOpen() ? ['watch'] : []),
3985
4091
  ...(docView?.agentId === id ? ['doc'] : []),
3986
4092
  ...(id === selectedId || msg.agent.forkOf?.agentId === selectedId ? ['detail'] : []),
3987
4093
  ...(id === term.agentId ? ['overlay'] : []),
package/public/index.html CHANGED
@@ -31,6 +31,7 @@
31
31
  <input id="filter" type="search" placeholder="Filter agents" aria-label="Filter agents" />
32
32
  <button id="assistant-btn" title="An always-on session that finds new work and starts agents for it">Assistant <span id="assistant-dot" class="assistant-dot" hidden></span></button>
33
33
  <button id="spend-btn" title="Results across agents (merge rate, time to PR, cost per merged PR), what they cost, and spending limits">Results <span id="spend-today" class="spend-today"></span></button>
34
+ <button id="watch-btn" title="Running agents' sessions side by side, live: follow them all without clicking from one to the next">Watch</button>
34
35
  <button id="machine-btn" title="A terminal on this computer (your home folder), from any device you're signed in on">Terminal</button>
35
36
  <button id="ask-btn" title="A general session with no repo or folder, on Claude Code or another engine you have (Codex, Muse Code, …)">Ask Agent</button>
36
37
  <button id="new-btn" class="primary">+ New agents</button>
@@ -52,12 +53,18 @@
52
53
  <div class="menu-sep"></div>
53
54
  <div class="menu-theme"><span>Theme</span><span class="seg" role="radiogroup" aria-label="Theme"><button type="button" data-theme-set="auto" title="Follow this device's setting">Auto</button><button type="button" data-theme-set="light">Light</button><button type="button" data-theme-set="dark">Dark</button></span></div>
54
55
  <div class="menu-sep"></div>
56
+ <button role="menuitem" id="keys-btn" title="Quick actions from the keyboard">Keyboard shortcuts… <kbd>?</kbd></button>
55
57
  <button role="menuitem" id="menu-about">About and updates…</button>
56
58
  </div>
57
59
  </div>
58
60
  </div>
59
61
  </header>
60
62
 
63
+ <section id="watch-view" class="watch-view" hidden aria-label="Watch: agents' sessions side by side">
64
+ <div id="watch-bar" class="watch-bar"></div>
65
+ <p id="watch-empty" class="hint watch-empty" hidden></p>
66
+ <div id="watch-grid" class="watch-grid"></div>
67
+ </section>
61
68
  <main class="layout">
62
69
  <aside class="sidebar">
63
70
  <div class="side-tabs" role="tablist">
@@ -269,6 +276,18 @@
269
276
  <input type="checkbox" name="planReview" />
270
277
  Review the implementation plan first <span class="hint">(the agent writes a plan and waits for your approval before changing anything)</span>
271
278
  </label>
279
+ <label class="check">
280
+ <input type="checkbox" name="designDoc" checked />
281
+ Design doc <span class="hint">(after the plan: architecture, design and data flow, viewable here and published as an Artifact; updated when done)</span>
282
+ </label>
283
+ <label class="check">
284
+ <input type="checkbox" name="demoPage" />
285
+ Demo page <span class="hint">(once it works: a sample page showing the change with real inputs and outputs, viewable here and published as an Artifact)</span>
286
+ </label>
287
+ <label class="check">
288
+ <input type="checkbox" name="benchmarks" />
289
+ Micro benchmarks <span class="hint">(the changed code timed before and after, results in a table)</span>
290
+ </label>
272
291
  <div class="row when">
273
292
  <label class="check"><input type="radio" name="when" value="now" checked /> Start now</label>
274
293
  <label class="check"><input type="radio" name="when" value="backlog" /> Queue in backlog</label>
package/public/keys.js ADDED
@@ -0,0 +1,91 @@
1
+ // Keyboard shortcuts: one key for the common actions, never while you type (a field or a
2
+ // terminal has the keys then), plus Ctrl+Shift ones that work from inside a terminal. ? lists them.
3
+
4
+ export const SHORTCUTS = [
5
+ ['Agents', [
6
+ [['j'], 'Next agent', 'next'],
7
+ [['k'], 'Previous agent', 'prev'],
8
+ [['Enter', 't'], 'Open its terminal', 'terminal'],
9
+ [['r'], 'Review its changes', 'changes'],
10
+ [['s'], 'Resume it in the background', 'start'],
11
+ [['Shift+X'], 'Close its session (it can be resumed)', 'stop'],
12
+ [['e'], 'Edit it', 'edit'],
13
+ ]],
14
+ ['Anywhere', [
15
+ [['n'], 'New agents', 'new'],
16
+ [['a'], 'Ask Agent (a general session)', 'ask'],
17
+ [['/'], 'Filter agents', 'filter'],
18
+ [['w'], 'Watch: agents side by side', 'watch'],
19
+ [['1'], 'Agents tab', 'tab:agents'],
20
+ [['2'], 'Inbox: what needs you', 'tab:inbox'],
21
+ [['3'], 'Backlog', 'tab:backlog'],
22
+ [['4'], 'Land: pull requests', 'tab:land'],
23
+ [['5'], 'Built agents', 'tab:built'],
24
+ [['?'], 'These shortcuts', 'help'],
25
+ ]],
26
+ ['In a terminal', [
27
+ [['Ctrl+Shift+↓'], "Next agent's terminal", 'next-term'],
28
+ [['Ctrl+Shift+↑'], "Previous agent's terminal", 'prev-term'],
29
+ [['Ctrl+Shift+L'], 'Leave the terminal (then the keys above work)', 'leave'],
30
+ [['Ctrl+Shift+E'], 'Expand or shrink the terminal', null],
31
+ ]],
32
+ ];
33
+
34
+ // A single key, as an event names it, to its action.
35
+ export const SINGLE = {
36
+ j: 'next', k: 'prev', Enter: 'terminal', t: 'terminal',
37
+ r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', '?': 'help',
38
+ 1: 'tab:agents', 2: 'tab:inbox', 3: 'tab:backlog', 4: 'tab:land', 5: 'tab:built',
39
+ };
40
+ // While Watch is open: only what makes sense there.
41
+ const ON_WATCH = new Set(['new', 'ask', 'watch', 'help']);
42
+
43
+ /** Typing somewhere: a field, an editor or a terminal (xterm types through a textarea). */
44
+ const typing = (el) => Boolean(el?.closest?.('input, textarea, select, [contenteditable=""], [contenteditable="true"], .xterm, .cm-editor'));
45
+
46
+ export function initKeys({ $, esc, run }) {
47
+ const dialog = document.createElement('dialog');
48
+ dialog.id = 'keys-dialog';
49
+ dialog.className = 'keys-dialog';
50
+ const kbd = (k) => k.split('+').map((p) => `<kbd>${esc(p)}</kbd>`).join('+');
51
+ dialog.innerHTML = `<form method="dialog">
52
+ <h3>Keyboard shortcuts</h3>
53
+ ${SHORTCUTS.map(([group, rows]) => `<h4>${esc(group)}</h4><table>${rows.map(([keys, what]) => `<tr><td class="keys">${keys.map(kbd).join(' <span class="hint">or</span> ')}</td><td>${esc(what)}</td></tr>`).join('')}</table>`).join('')}
54
+ <p class="hint">Single keys work when you're not typing in a field or a terminal.</p>
55
+ <div class="actions"><button class="primary" value="close">Close</button></div>
56
+ </form>`;
57
+ document.body.appendChild(dialog);
58
+ const help = () => (dialog.open ? dialog.close() : dialog.showModal());
59
+
60
+ // Ctrl+Shift ones, first, so a focused terminal doesn't take them.
61
+ document.addEventListener('keydown', (e) => {
62
+ if (!e.ctrlKey || !e.shiftKey || e.altKey || e.metaKey) return;
63
+ const act = e.code === 'ArrowDown' ? 'next-term' : e.code === 'ArrowUp' ? 'prev-term' : e.code === 'KeyL' ? 'leave' : null;
64
+ if (!act) return;
65
+ e.preventDefault();
66
+ e.stopPropagation();
67
+ run(act);
68
+ }, true);
69
+
70
+ document.addEventListener('keydown', (e) => {
71
+ if (e.defaultPrevented || e.isComposing || e.metaKey || e.ctrlKey || e.altKey) return;
72
+ if (e.key === 'Escape' && document.activeElement === $('#filter')) {
73
+ $('#filter').blur();
74
+ return;
75
+ }
76
+ if (typing(e.target) || typing(document.activeElement)) return;
77
+ // An open dialog has the keyboard; ? still closes the shortcuts one.
78
+ if (document.querySelector('dialog[open]') && !(dialog.open && e.key === '?')) return;
79
+ const act = SINGLE[e.key];
80
+ if (!act || (document.body.classList.contains('watching') && !ON_WATCH.has(act))) return;
81
+ if (act === 'help') {
82
+ e.preventDefault();
83
+ return help();
84
+ }
85
+ // Enter on a focused button or link is that button's.
86
+ if (e.key === 'Enter' && e.target.closest?.('button, a, summary')) return;
87
+ if (run(act) !== false) e.preventDefault();
88
+ });
89
+
90
+ return { help };
91
+ }
package/public/land.js CHANGED
@@ -40,12 +40,18 @@ export function initLand({ api, esc, toast, agents, $, scoreBadge = () => '', se
40
40
  return out.sort((x, y) => (x.a.priority ?? 2) - (y.a.priority ?? 2));
41
41
  };
42
42
 
43
+ // Review comments sent to the agent so far, and when last.
44
+ function commentsHint(c) {
45
+ if (!c?.count) return '';
46
+ return ` <span class="hint" title="Last sent ${esc(new Date(c.lastAt).toLocaleString())}">${c.count} review comment${c.count === 1 ? '' : 's'} sent</span>`;
47
+ }
48
+
43
49
  function rowHtml({ a, pr, land }) {
44
50
  const canFix = land === 'fix' || land === 'behind';
45
51
  return `<li class="agent land-row" data-agent="${a.id}" data-url="${esc(pr.url)}">
46
52
  <div class="line1"><span class="prio p${a.priority ?? 2}">P${a.priority ?? 2}</span>
47
53
  <a class="name" href="${esc(pr.url)}" target="_blank" rel="noopener" title="${esc(pr.title ?? pr.url)}">#${esc(pr.number ?? '')} ${esc(pr.title ?? pr.url)}</a></div>
48
- <div class="line2"><button class="link" data-land="goto">${esc(a.name)}</button>${a.runtime?.busy ? ' <span class="hint">working</span>' : ''}</div>
54
+ <div class="line2"><button class="link" data-land="goto">${esc(a.name)}</button>${a.runtime?.busy ? ' <span class="hint">working</span>' : ''}${commentsHint(a.landing?.comments?.[pr.url])}</div>
49
55
  <div class="land-chips">${scoreBadge(a.docs?.scorecard, esc)} ${prChips(pr, esc)}</div>
50
56
  <div class="bl-actions">
51
57
  <button class="small" data-land="review" title="Its diff, line comments for the agent, commit and push">Review</button>
@@ -76,9 +82,10 @@ export function initLand({ api, esc, toast, agents, $, scoreBadge = () => '', se
76
82
  return g.length ? `<li class="project open"><div class="project-head bl-head"><span class="pname">${label}</span><span class="pcount">${g.length}</span></div><ul>${g.map(rowHtml).join('')}</ul></li>` : '';
77
83
  }).join('')}</ul>`
78
84
  : '<p class="hint land-empty">No open pull requests from agents. Open one from <b>Review changes</b> on an agent, or let the agent open it.</p>'}
79
- ${s ? `<details class="land-settings"><summary>When checks fail or changes are requested</summary>
85
+ ${s ? `<details class="land-settings"><summary>When checks fail or reviewers comment</summary>
80
86
  <label class="check"><input type="checkbox" data-set="fixChecks" ${s.fixChecks ? 'checked' : ''}> Send failing checks to the agent</label>
81
87
  <label class="check"><input type="checkbox" data-set="fixReviews" ${s.fixReviews ? 'checked' : ''}> Send requested changes to the agent</label>
88
+ <label class="check"><input type="checkbox" data-set="fixComments" ${s.fixComments ? 'checked' : ''}> Send new review comments to the agent while the pull request is open (from the repo's members and review bots)</label>
82
89
  <label>At most <input type="number" min="0" max="20" data-set="maxFixes" value="${s.maxFixes}"> times per pull request</label>
83
90
  <label>Merge with <select data-set="mergeMethod">${['squash', 'merge', 'rebase'].map((m) => `<option ${m === s.mergeMethod ? 'selected' : ''}>${m}</option>`).join('')}</select></label>
84
91
  <label class="check"><input type="checkbox" data-set="deleteBranch" ${s.deleteBranch ? 'checked' : ''}> Delete the branch on GitHub after merging</label>
package/public/style.css CHANGED
@@ -1028,3 +1028,37 @@ body.remote .settings-links .local-only { display: none; }
1028
1028
  .goal-projects { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 8px; }
1029
1029
  .goal-proj { display: inline-flex; align-items: center; gap: 4px; font-weight: normal; }
1030
1030
  .goal-proj input { width: auto; margin: 0; }
1031
+
1032
+ /* ---------- Watch: agents' sessions side by side */
1033
+ body.watching .layout { display: none; }
1034
+ .watch-view { flex: 1; min-height: 0; overflow: auto; padding: 10px 16px 16px; background: var(--bg); }
1035
+ .watch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; font-size: 13px; }
1036
+ .watch-bar select { width: auto; }
1037
+ .watch-bar .spacer { flex: 1; }
1038
+ .watch-empty { margin: 40px auto; text-align: center; }
1039
+ .watch-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); align-items: start; }
1040
+ /* Fit: every tile on screen; the newest lines stay in view when the session is taller than its tile. */
1041
+ .watch-grid.fit .watch-term { height: var(--watch-term-h, 300px); display: flex; flex-direction: column; justify-content: flex-end; }
1042
+ .watch-tile { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); overflow: hidden; }
1043
+ .watch-tile.attention { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
1044
+ .watch-tile:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
1045
+ .watch-head { display: flex; align-items: center; gap: 8px; padding: 5px 8px; font-size: 12.5px; border-bottom: 1px solid var(--border); min-width: 0; }
1046
+ .watch-head .spacer { flex: 1; }
1047
+ .watch-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
1048
+ .watch-what { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
1049
+ .watch-x { font-size: 16px; line-height: 1; color: var(--muted); }
1050
+ .watch-term { background: #0f1117; padding: 4px; overflow: hidden; cursor: text; }
1051
+ .watch-term .xterm-viewport { overflow-y: hidden; }
1052
+ #watch-btn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
1053
+ @media (max-width: 640px) {
1054
+ .watch-view { padding: 8px 16px; }
1055
+ .watch-grid:not(.fit) { grid-template-columns: minmax(0, 1fr) !important; }
1056
+ }
1057
+ /* ---------- keyboard shortcuts */
1058
+ kbd { display: inline-block; min-width: 1.6em; padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--bg); font: 11.5px var(--mono); text-align: center; line-height: 1.4; }
1059
+ .keys-dialog { max-width: 520px; width: calc(100% - 32px); }
1060
+ .keys-dialog h4 { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
1061
+ .keys-dialog table { width: 100%; border-collapse: collapse; font-size: 13px; }
1062
+ .keys-dialog td { padding: 3px 0; vertical-align: top; }
1063
+ .keys-dialog td.keys { width: 42%; white-space: nowrap; padding-right: 12px; }
1064
+ #keys-btn kbd { margin-left: 6px; }