ai-agentmanager 1.39.0 → 1.41.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 +12 -0
- package/README.md +9 -3
- package/package.json +1 -1
- package/public/app.js +63 -10
- package/public/index.html +10 -0
- package/public/side.js +2 -0
- package/public/style.css +10 -1
- package/src/brief.js +47 -2
- package/src/cli.js +4 -4
- package/src/drive.js +2 -0
- package/src/manager.js +9 -1
- package/src/server.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.41.0 (2026-11-11)
|
|
4
|
+
|
|
5
|
+
- **Estimate.** A human time estimate for planning any Jira fix or feature: how long one experienced developer would take to do it by hand, without an AI agent. It's split into tasks of a day or less, each with optimistic, likely, pessimistic and expected hours and a total. Work over about 3 days gets a suggested split into tickets, and it lists the roles, assumptions and risks.
|
|
6
|
+
- **Documentation.** The docs for the change, written from the actual diff: what's new, how to use it, configuration, upgrade notes and which docs to add or update. When the change touches an HTTP API, it includes an OpenAPI 3.0 spec of the changed endpoints; **Download OpenAPI** saves it as a .yaml file.
|
|
7
|
+
- Both sit with the other documents (Analysis, Design and the rest), and are included in **Write all**, `agentmgr doc`, Google Drive publishing and the side pane.
|
|
8
|
+
|
|
9
|
+
## 1.40.0 (2026-11-11)
|
|
10
|
+
|
|
11
|
+
- **A calmer agent list.** No summary line under each name (it's the name's tooltip, and search still finds it); the engine, container, assistant and playbook tags move to the line below. The project name shows where the branch was (the branch is in its tooltip).
|
|
12
|
+
- **Open sessions stand out** with a green background, a little stronger while the agent is working and when selected.
|
|
13
|
+
- **Overview and Questions panels.** In an agent's detail, **Overview** (the AI review, marked *new* until you've seen it) and **Questions** (open questions with their answer buttons, and what you answered) sit next to **Review changes**, each in its own panel, instead of filling the page. Prompts, limits, stuck warnings and overlaps still show on the page.
|
|
14
|
+
|
|
3
15
|
## 1.39.0 (2026-11-11)
|
|
4
16
|
|
|
5
17
|
- **Limits: agents carry on after a usage limit.** When an engine stops at a usage limit or exhausted quota ("5-hour limit reached ∙ resets 3pm", Codex's "try again at 3:05 PM") or a busy or failing service (429, 529 overloaded, 5xx), the inbox shows a **Limit** card with the message and when it resets, read in the time zone it names. A minute after the reset the agent is told to continue (a busy service: after 5 minutes), at most three times an hour; `"limits": { "autoResume": false }` turns that off. **Continue now** does it at once.
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Run one background [Claude Code](https://claude.com/claude-code) agent per inten
|
|
|
26
26
|
- **Backlog.** Queue asks as work orders. Agents pick them up one by one, up to N in parallel per project, until each is done. You accept or reopen each one.
|
|
27
27
|
- **Slack alerts.** A message in your channel when an agent needs input, finishes a backlog item, or fails.
|
|
28
28
|
- **Priority.** Mark agents P0–P3. P0 and P1 are highlighted, and lists sort by priority.
|
|
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.
|
|
29
|
+
- **Share for review.** One click writes an **Analysis**, **Design**, **Flow** or **Proposal** document from the agent's work, a human time **Estimate** for planning, or the change's **Documentation** with an OpenAPI spec of any API changes. 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
32
|
- **Standup.** Each weekday at 9:00 (or whenever you press **Standup**, or `p`), each agent with news since the last one is read aloud in a sentence or two, each in its own voice: what it did, what it's on, what it needs from you. Agents that need you go first and quiet ones are left out. It stops on an agent that needs you, with its questions beside it to answer by tap, or by voice when **Answer by voice** is on (what you say is read back, then sent when you say "send"). The wording comes from one short tool-less model call, plain wording if that fails. A Slack alert says when it's ready (Alerts). Change the time, weekends and wording in the player, or in config.json: `"standup": { "at": "09:00", "weekends": false, "ai": true, "notify": true }`. Speech is your browser's own; voice answers may be sent to your browser's maker to be turned into text.
|
|
@@ -173,8 +173,8 @@ agentmgr attach <agent> # live terminal here; Ctrl-] detac
|
|
|
173
173
|
agentmgr shell <agent> [-n 2] # a shell in the agent's folder (-n picks another one); Ctrl-] detaches
|
|
174
174
|
agentmgr brief <agent> # print the agent's brief (Markdown)
|
|
175
175
|
agentmgr priority <agent> P0 # P0 urgent, P1 high, P2 normal (default), P3 low
|
|
176
|
-
agentmgr doc <agent> proposal -o p.md # analysis | design | flow | proposal
|
|
177
|
-
agentmgr doc <agent> all --background # write all
|
|
176
|
+
agentmgr doc <agent> proposal -o p.md # analysis | design | flow | proposal | estimate | documentation
|
|
177
|
+
agentmgr doc <agent> all --background # write them all (and Human vs AI) in the background
|
|
178
178
|
agentmgr insights <agent> # Why / What / How / Now, three points each
|
|
179
179
|
agentmgr explain <agent> # full briefing: ask, status, plan, solution, conclusions, needs
|
|
180
180
|
agentmgr remote on | off | status | rotate # phone / remote access (see below)
|
|
@@ -340,6 +340,8 @@ The Brief panel's **Share for review** buttons, or `agentmgr doc <agent> <kind>`
|
|
|
340
340
|
| **Flow** | Summary, end-to-end flowchart with a step-by-step walk-through, key interactions as a sequence diagram, failure and edge cases |
|
|
341
341
|
| **Proposal** | Summary, problem, recommendation, scope, plan, effort and dependencies, risks, decisions needed |
|
|
342
342
|
| **Human vs AI** | Your top 5 decisions, each with why it needs you, the stakes, options and what the work suggests, plus a box for your answer. Up to 5 questions the AI answers, each with its confidence, evidence and how to check it. A second model's verdict on each. |
|
|
343
|
+
| **Estimate** | Human time estimate for planning: summary with a range and confidence, a task breakdown with optimistic, likely, pessimistic and expected hours, a suggested split into tickets, roles and skills, assumptions, risks and unknowns |
|
|
344
|
+
| **Documentation** | Summary, what's new or changed, how to use it, configuration, upgrade and operations notes, docs to add or update, and API changes with an OpenAPI 3.0 spec of the changed endpoints |
|
|
343
345
|
| **Diagrams** | Diagrams only, for a quick grasp: the problem, the architecture (with what changes highlighted), the design, the data flow (animated) and the key interaction, plus the plan. Drawn from the documents already written and the agent's work. Optional: **Write all** leaves it out. |
|
|
344
346
|
|
|
345
347
|
Each drawn diagram has **Copy image** (paste it into Slack, a PR comment or a doc), **PNG** and **SVG**, and a document with diagrams also downloads as one **.html** file. **🔊 Listen** reads Explain, documents and the change walkthrough aloud with the browser's own voices; the walkthrough is read change by change, showing each as it goes.
|
|
@@ -352,6 +354,10 @@ The second model is another installed engine by default (Codex or Antigravity fo
|
|
|
352
354
|
|
|
353
355
|
Type your answers in the viewer, or tap an option to fill one in. **Send my answers to the agent** passes them on, together with any AI conclusions the second model doubted, so the agent re-checks those.
|
|
354
356
|
|
|
357
|
+
**Estimate.** A human time estimate for planning: how long one experienced developer who knows the codebase would take to do the ticket by hand, without an AI agent. It's split into tasks of a day or less (understanding, design, each part of the implementation, tests, docs, review, QA, release), each with optimistic, likely and pessimistic hours and the expected (PERT) figure, and a total. Larger work also gets a suggested split into tickets that can ship on their own, with their dependencies. Then come the roles needed, the assumptions, and the risks that could move the number. It's sized from the ticket, the brief and the changes so far.
|
|
358
|
+
|
|
359
|
+
**Documentation.** The docs for the change: what's new, how to use it, configuration, upgrade and operations notes, and which docs in the repository to add or update. It's written from the actual diff. When the change touches an HTTP API, it adds a table of the changed endpoints and an OpenAPI 3.0 spec covering only those endpoints. **Download OpenAPI** saves the spec as a .yaml file for Swagger, Postman or your API portal.
|
|
360
|
+
|
|
355
361
|
**How they're written.** Documents name the real files, tickets and docs, separate facts from proposals, and say "To be confirmed" where the context doesn't. They're written for reviewers: no mention of the agent or its tools.
|
|
356
362
|
|
|
357
363
|
**Sharing.** Each document opens in a viewer:
|
package/package.json
CHANGED
package/public/app.js
CHANGED
|
@@ -501,10 +501,17 @@ const INSIGHT_ICONS = { why: '🎯', what: '📦', how: '🛠', now: '📍' };
|
|
|
501
501
|
|
|
502
502
|
// ------------------------------------------------------------------ stakeholder documents
|
|
503
503
|
|
|
504
|
-
const DOCS = { analysis: 'Analysis', design: 'Design', flow: 'Flow', proposal: 'Proposal', humanai: 'Human vs AI', diagrams: 'Diagrams', scorecard: 'Scorecard' };
|
|
504
|
+
const DOCS = { analysis: 'Analysis', design: 'Design', flow: 'Flow', proposal: 'Proposal', humanai: 'Human vs AI', estimate: 'Estimate', documentation: 'Documentation', diagrams: 'Diagrams', scorecard: 'Scorecard' };
|
|
505
|
+
// What a document is before it's written, where "Write a … document for stakeholders" doesn't say it.
|
|
506
|
+
const DOC_HINTS = {
|
|
507
|
+
estimate: 'For planning: how long a person would take to do this work by hand, split into tasks with optimistic, likely and pessimistic hours, a suggested split into tickets, the roles needed and the risks',
|
|
508
|
+
documentation: 'The documentation for this change: what is new, how to use it, configuration, upgrade notes, which docs to add or update, and an OpenAPI spec of any API changes',
|
|
509
|
+
};
|
|
510
|
+
/** The OpenAPI spec in a Documentation document (its ```yaml block), if the change has API changes. */
|
|
511
|
+
const openApiOf = (markdown) => (markdown ?? '').match(/```ya?ml\s*\n((?:#.*\n|\s*\n)*openapi:[\s\S]*?)```/)?.[1] ?? null;
|
|
505
512
|
// Optional extras that "Write all" leaves out.
|
|
506
513
|
const DOC_EXTRAS = new Set(['diagrams', 'scorecard']);
|
|
507
|
-
const DOC_TITLES = { ...DOCS, eval: 'Eval', plan: 'Plan', intent: 'Intent', spec: 'Spec', designdoc: 'Design doc', benchmark: 'Benchmark' };
|
|
514
|
+
const DOC_TITLES = { ...DOCS, estimate: 'Human time estimate', eval: 'Eval', plan: 'Plan', intent: 'Intent', spec: 'Spec', designdoc: 'Design doc', benchmark: 'Benchmark' };
|
|
508
515
|
// The agent's intent, spec and plan files (read from the daemon when opened; kept here by agent and kind).
|
|
509
516
|
const SPEC_KINDS = { intent: 'Intent', spec: 'Spec', plan: 'Plan', designdoc: 'Design doc', benchmark: 'Benchmark' };
|
|
510
517
|
// What each optional file is, for its button before it's written.
|
|
@@ -589,7 +596,7 @@ function docButtons(a) {
|
|
|
589
596
|
const d = a.docs?.[k];
|
|
590
597
|
const stale = d?.markdown && a.brief?.updatedAt && d.briefUpdatedAt !== a.brief.updatedAt;
|
|
591
598
|
return `<button class="small doc-btn ${d?.markdown ? 'has' : ''}" data-doc="${k}" ${d?.pending ? 'disabled' : ''}
|
|
592
|
-
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>`;
|
|
599
|
+
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)' : ''}` : DOC_HINTS[k] ?? `Write a ${label.toLowerCase()} document for stakeholders`}">${d?.pending ? `${label}…` : label}${d?.markdown ? (stale ? ' •' : ' ✓') : ''}</button>`;
|
|
593
600
|
})
|
|
594
601
|
.join('')}</span>${specButtons(a)}${driveButton(a)}`;
|
|
595
602
|
}
|
|
@@ -660,6 +667,7 @@ function renderDocDialog() {
|
|
|
660
667
|
for (const id of ['doc-copy', 'doc-download', 'doc-print']) $(`#${id}`).disabled = !d?.markdown;
|
|
661
668
|
// Diagrams: the whole document as one HTML file with every diagram (each also has Copy / PNG / SVG).
|
|
662
669
|
$('#doc-html').hidden = !/```mermaid/.test(d?.markdown ?? '');
|
|
670
|
+
$('#doc-openapi').hidden = docView.kind !== 'documentation' || !openApiOf(d?.markdown);
|
|
663
671
|
$('#doc-listen').innerHTML = d?.markdown && docView.kind !== 'diagrams' ? listenHtml(docView.kind === 'scorecard' ? `score:${docView.agentId}` : `doc:${docView.agentId}:${docView.kind}`, { title: 'Read the document aloud' }) : '';
|
|
664
672
|
$('#doc-print').hidden = plan || specKind;
|
|
665
673
|
$('#doc-regen').hidden = plan || specKind;
|
|
@@ -704,6 +712,7 @@ function renderEval(a, body, d) {
|
|
|
704
712
|
$('#doc-meta').textContent = ev?.at ? `Worked out ${ago(ev.at)}${ev.postedTo ? ' · posted on the pull request' : ''}` : '';
|
|
705
713
|
for (const id of ['doc-copy', 'doc-download', 'doc-print']) $(`#${id}`).disabled = !d?.markdown;
|
|
706
714
|
$('#doc-html').hidden = true;
|
|
715
|
+
$('#doc-openapi').hidden = true;
|
|
707
716
|
$('#doc-listen').innerHTML = '';
|
|
708
717
|
$('#doc-print').hidden = true;
|
|
709
718
|
$('#doc-regen').hidden = true;
|
|
@@ -784,6 +793,13 @@ $('#doc-download').onclick = () => {
|
|
|
784
793
|
link.click();
|
|
785
794
|
setTimeout(() => URL.revokeObjectURL(link.href), 1000);
|
|
786
795
|
};
|
|
796
|
+
$('#doc-openapi').onclick = () => {
|
|
797
|
+
const a = agents.get(docView.agentId);
|
|
798
|
+
const blob = new Blob([openApiOf(docOf(a, docView.kind)?.markdown)], { type: 'application/yaml' });
|
|
799
|
+
const link = Object.assign(document.createElement('a'), { href: URL.createObjectURL(blob), download: `${a.slug}-openapi.yaml` });
|
|
800
|
+
link.click();
|
|
801
|
+
setTimeout(() => URL.revokeObjectURL(link.href), 1000);
|
|
802
|
+
};
|
|
787
803
|
const haAnswers = () => Object.fromEntries([...document.querySelectorAll('#doc-body [data-ha]')].map((t) => [t.dataset.ha, t.value]));
|
|
788
804
|
$('#doc-body').addEventListener('click', (e) => {
|
|
789
805
|
const pick = e.target.closest('[data-ha-pick]');
|
|
@@ -1027,16 +1043,15 @@ function agentItem(a, { project = false } = {}) {
|
|
|
1027
1043
|
const st = statusOf(a);
|
|
1028
1044
|
const idle = !isActive(a);
|
|
1029
1045
|
const p = project && a.projectInfo && !['other', 'general', 'assistant'].includes(a.projectInfo.key) ? a.projectInfo : null;
|
|
1030
|
-
return `<li data-id="${a.id}" ${a.kind === 'general' || a.kind === 'assistant' ? '' : 'draggable="true" '}class="agent pr${a.priority ?? 2} ${a.id === selectedId ? 'selected' : ''} ${idle ? 'idle' : ''}">
|
|
1031
|
-
<div class="line1">${prioChip(a.priority ?? 2)}${a.results?.outcome === 'blocked' ? '<span class="outcome-mark" title="Blocked">⛔</span>' : a.results?.outcome === 'done' ? '<span class="outcome-mark" title="Done">✅</span>' : ''}<span class="name">${esc(a.name)}</span>${flags(a)}<span class="pill ${st}">${pillText(st)}</span></div>
|
|
1032
|
-
<div class="intent" title="${esc(describeTitle(a) ?? '')}">${a.builds ? `<span class="tag assistant" title="Develops the agent ${esc(a.builds.name)} (Built tab)">⚙ builds agent</span> ` : ''}${a.kind === 'general' ? '<span class="tag">general</span> ' : a.kind === 'assistant' ? '<span class="tag assistant">assistant</span> ' : a.startedBy ? '<span class="tag assistant" title="Started by the assistant">🤖 by assistant</span> ' : a.trigger ? `<span class="tag assistant" title="Started from ${a.trigger.source === 'github' ? 'a labeled GitHub issue' : 'the webhook'}${a.trigger.url ? `: ${esc(a.trigger.url)}` : ''}">⚡ ${a.trigger.source === 'github' ? 'GitHub' : 'webhook'}</span> ` : a.playbook ? `<span class="tag assistant" title="Started by the playbook ${esc(a.playbook.name)}">▶ ${esc(a.playbook.name)}</span> ` : ''}${a.engine && a.engine !== 'claude' ? `<span class="tag engine">${esc(ENGINE_LABEL[a.engine] ?? a.engine)}</span> ` : ''}${a.isolation === 'container' ? '<span class="tag engine" title="Runs in its own Docker container: it sees only its own folder">📦 container</span> ' : ''}${esc(describe(a) || (a.kind === 'assistant' ? 'Finds new work and starts agents for it' : 'General session'))}</div>
|
|
1046
|
+
return `<li data-id="${a.id}" ${a.kind === 'general' || a.kind === 'assistant' ? '' : 'draggable="true" '}class="agent pr${a.priority ?? 2} ${a.id === selectedId ? 'selected' : ''} ${idle ? 'idle' : ''} ${a.runtime.running ? `running ${st}` : ''}">
|
|
1047
|
+
<div class="line1">${prioChip(a.priority ?? 2)}${a.results?.outcome === 'blocked' ? '<span class="outcome-mark" title="Blocked">⛔</span>' : a.results?.outcome === 'done' ? '<span class="outcome-mark" title="Done">✅</span>' : ''}<span class="name" title="${esc(describeTitle(a) || (a.kind === 'assistant' ? 'Finds new work and starts agents for it' : 'General session'))}">${esc(a.name)}</span>${flags(a)}<span class="pill ${st}">${pillText(st)}</span></div>
|
|
1033
1048
|
${a.status === 'preparing' && a.progress ? `<div class="progress-line">${esc(progressText(a.progress))}</div>` : ''}
|
|
1034
1049
|
<div class="meta">
|
|
1035
1050
|
<span class="mono">${a.id}</span>
|
|
1036
|
-
${
|
|
1051
|
+
${a.builds ? `<span class="tag assistant" title="Develops the agent ${esc(a.builds.name)} (Built tab)">⚙ builds agent</span> ` : ''}${a.kind === 'general' ? '<span class="tag">general</span> ' : a.kind === 'assistant' ? '<span class="tag assistant">assistant</span> ' : a.startedBy ? '<span class="tag assistant" title="Started by the assistant">🤖 by assistant</span> ' : a.trigger ? `<span class="tag assistant" title="Started from ${a.trigger.source === 'github' ? 'a labeled GitHub issue' : 'the webhook'}${a.trigger.url ? `: ${esc(a.trigger.url)}` : ''}">⚡ ${a.trigger.source === 'github' ? 'GitHub' : 'webhook'}</span> ` : a.playbook ? `<span class="tag assistant" title="Started by the playbook ${esc(a.playbook.name)}">▶ ${esc(a.playbook.name)}</span> ` : ''}${a.engine && a.engine !== 'claude' ? `<span class="tag engine">${esc(ENGINE_LABEL[a.engine] ?? a.engine)}</span> ` : ''}${a.isolation === 'container' ? '<span class="tag engine" title="Runs in its own Docker container: it sees only its own folder">📦 container</span> ' : ''}
|
|
1037
1052
|
${!idle && project && a.activeAt ? `<span title="Last used">${ago(a.activeAt)}</span>` : ''}
|
|
1038
1053
|
${idle && a.activeAt ? `<span title="Idle: no work and no input from you for over a day">💤 ${ago(a.activeAt)}</span>` : ''}
|
|
1039
|
-
${
|
|
1054
|
+
${p ? `<span class="branch proj-name" title="Project: ${esc(p.full || p.name)}${a.git?.branch ? ` · branch ${esc(a.git.branch)}` : ''}">${esc(p.name)}</span>` : ''}
|
|
1040
1055
|
${a.prs.length ? `<span>${a.prs.length} PR</span>` : ''}
|
|
1041
1056
|
${a.bugs.length ? `<span>${a.bugs.length} bug</span>` : ''}
|
|
1042
1057
|
${a.usage?.total ? `<span title="${esc(usageTitle(a.usage))}">${fmtTokens(ioOf(a.usage))} tok</span>` : ''}
|
|
@@ -1784,11 +1799,42 @@ async function onNeedSubmit(e) {
|
|
|
1784
1799
|
}
|
|
1785
1800
|
done();
|
|
1786
1801
|
}
|
|
1787
|
-
for (const root of [$('#inbox-view'), $('#detail-body')]) {
|
|
1802
|
+
for (const root of [$('#inbox-view'), $('#detail-body'), $('#needs-body')]) {
|
|
1788
1803
|
root.addEventListener('click', onNeed);
|
|
1789
1804
|
root.addEventListener('submit', onNeedSubmit);
|
|
1790
1805
|
}
|
|
1791
1806
|
|
|
1807
|
+
// ------------------------------------------------------------------ overview and questions panels
|
|
1808
|
+
|
|
1809
|
+
const openQuestions = (a) => (a.questions ?? []).filter((q) => !q.answer).length;
|
|
1810
|
+
let needsOpen = null; // { id, kind: 'overview' | 'questions' }
|
|
1811
|
+
|
|
1812
|
+
function openNeeds(id, kind) {
|
|
1813
|
+
needsOpen = { id, kind };
|
|
1814
|
+
renderNeeds();
|
|
1815
|
+
if (!$('#needs-dialog').open) $('#needs-dialog').showModal();
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
/** The open panel's cards, redrawn as the agent changes (an answer sent, the review marked seen). */
|
|
1819
|
+
function renderNeeds() {
|
|
1820
|
+
if (!needsOpen) return;
|
|
1821
|
+
const a = agents.get(needsOpen.id);
|
|
1822
|
+
if (!a) return $('#needs-dialog').close();
|
|
1823
|
+
$('#needs-title').textContent = `${needsOpen.kind === 'overview' ? 'Overview' : 'Questions'}: ${a.name}`;
|
|
1824
|
+
let html;
|
|
1825
|
+
if (needsOpen.kind === 'overview') {
|
|
1826
|
+
html = a.aiReview?.verdict ? needCard({ a, kind: 'review', key: `review:${a.id}` }, { inDetail: true }) : '<p class="hint">No AI review yet.</p>';
|
|
1827
|
+
} else {
|
|
1828
|
+
const open = (a.questions ?? []).filter((q) => !q.answer);
|
|
1829
|
+
const answered = (a.questions ?? []).filter((q) => q.answer);
|
|
1830
|
+
html = (open.length ? `<div class="needs">${open.map((q) => needCard({ a, kind: 'question', key: `q:${a.id}:${q.id}`, q }, { inDetail: true })).join('')}</div>` : '<p class="hint">No open questions.</p>') +
|
|
1831
|
+
(answered.length ? `<h4>Answered</h4><ul class="answered">${answered.map((q) => `<li><b>${esc(q.question)}</b><br>${esc(q.answer.text ?? q.answer)} <span class="hint">${q.answer.at ? ago(q.answer.at) : ""}</span></li>`).join('')}</ul>` : '');
|
|
1832
|
+
}
|
|
1833
|
+
morph($('#needs-body'), `<div class="needs">${html}</div>`);
|
|
1834
|
+
}
|
|
1835
|
+
$('#needs-close').onclick = () => $('#needs-dialog').close();
|
|
1836
|
+
$('#needs-dialog').addEventListener('close', () => (needsOpen = null));
|
|
1837
|
+
|
|
1792
1838
|
// ------------------------------------------------------------------ checkpoints and forks
|
|
1793
1839
|
|
|
1794
1840
|
function checkpointsCard(a) {
|
|
@@ -2193,6 +2239,7 @@ function bugRow(a, b) {
|
|
|
2193
2239
|
}
|
|
2194
2240
|
|
|
2195
2241
|
function renderDetail() {
|
|
2242
|
+
renderNeeds();
|
|
2196
2243
|
const a = agents.get(selectedId);
|
|
2197
2244
|
$('#placeholder').hidden = Boolean(a);
|
|
2198
2245
|
const body = $('#detail-body');
|
|
@@ -2239,6 +2286,8 @@ function renderDetail() {
|
|
|
2239
2286
|
${(a.engine ?? 'claude') === 'claude' && a.isolation !== 'container' && !a.movedTo && !REMOTE ? `<button data-act="desktop" ${a.sessionId && a.workdir && a.status !== 'preparing' ? '' : 'disabled'} title="Continue this conversation in the Claude desktop app. Its session here closes; Resume here later picks up what was said there">Open in Claude desktop</button>` : ''}
|
|
2240
2287
|
<button data-act="shell" ${a.workdir && a.status !== 'preparing' ? '' : 'disabled'} title="A separate terminal in this agent's folder for running commands by hand">Open shell</button>
|
|
2241
2288
|
${noRepo(a) ? '' : `<button data-act="changes" ${a.workdir && a.status !== 'preparing' ? '' : 'disabled'} title="Read its changes, comment on lines for the agent, commit and open a pull request">Review changes${a.git?.dirtyFiles ? ` <span class="count">${a.git.dirtyFiles}</span>` : ''}</button>`}
|
|
2289
|
+
${a.aiReview?.verdict ? `<button data-act="overview" title="The AI review: what's done, what's missing, the risks">Overview${a.aiReview.seen ? '' : ' <span class="count">new</span>'}</button>` : ''}
|
|
2290
|
+
${a.questions?.length ? `<button data-act="questions" title="What the agent asked you, and your answers">Questions${openQuestions(a) ? ` <span class="count">${openQuestions(a)}</span>` : ''}</button>` : ''}
|
|
2242
2291
|
<button data-act="fork" ${a.workdir && a.git?.branch ? '' : 'disabled'} title="A new agent with this one's code and conversation, in its own worktree, to try another approach">Fork</button>
|
|
2243
2292
|
<button data-act="edit" title="Change its name, request, project, priority, permission mode or model">Edit</button>
|
|
2244
2293
|
<button data-act="refresh" title="Re-scan git, PRs and transcripts">Refresh</button>
|
|
@@ -2282,7 +2331,8 @@ function renderDetail() {
|
|
|
2282
2331
|
${a.builds ? builtUi.panel(a) : ''}
|
|
2283
2332
|
${a.forkOf ? `<div class="bl-banner">⑂ Forked from <a href="#${a.forkOf.agentId}" data-goto="${a.forkOf.agentId}">${esc(a.forkOf.name)}</a>${a.forkOf.checkpoint ? ` at checkpoint ${a.forkOf.checkpoint}` : ''} ${ago(a.forkOf.at)}</div>` : ''}
|
|
2284
2333
|
${(() => {
|
|
2285
|
-
|
|
2334
|
+
// The AI review and the questions have their own panels (Overview, Questions).
|
|
2335
|
+
const items = needsFor(a, { both: true }).filter((it) => it.kind !== 'review' && it.kind !== 'question');
|
|
2286
2336
|
return items.length ? `<div class="needs">${items.map((it) => needCard(it, { inDetail: true })).join('')}</div>` : '';
|
|
2287
2337
|
})()}
|
|
2288
2338
|
${a.outbox ? `<div class="hint outbox-note">✉ ${a.outbox} message${a.outbox > 1 ? 's' : ''} waiting to be typed into the session when the agent is idle</div>` : ''}
|
|
@@ -3829,6 +3879,9 @@ $('#detail-body').addEventListener('click', async (e) => {
|
|
|
3829
3879
|
break;
|
|
3830
3880
|
case 'changes':
|
|
3831
3881
|
return reviewUi.open(a.id);
|
|
3882
|
+
case 'overview':
|
|
3883
|
+
case 'questions':
|
|
3884
|
+
return openNeeds(a.id, btn.dataset.act);
|
|
3832
3885
|
case 'memory':
|
|
3833
3886
|
return openMemory(a);
|
|
3834
3887
|
case 'fork':
|
package/public/index.html
CHANGED
|
@@ -483,6 +483,7 @@
|
|
|
483
483
|
<button type="button" id="doc-copy" class="small" title="Copy as Markdown">Copy Markdown</button>
|
|
484
484
|
<span id="doc-listen"></span>
|
|
485
485
|
<button type="button" id="doc-download" class="small">Download .md</button>
|
|
486
|
+
<button type="button" id="doc-openapi" class="small" hidden title="The OpenAPI 3 spec of the API changes, as a YAML file for Swagger, Postman or your API docs">Download OpenAPI</button>
|
|
486
487
|
<button type="button" id="doc-html" class="small" hidden title="One HTML file with every diagram: open it anywhere, attach it, or print it">Download .html</button>
|
|
487
488
|
<button type="button" id="doc-print" class="small primary" title="Open a print-ready page (Save as PDF)">Print / PDF</button>
|
|
488
489
|
<button type="button" id="doc-close" class="small ghost">Close</button>
|
|
@@ -526,6 +527,15 @@
|
|
|
526
527
|
<div id="team-body" class="race-body team-body"></div>
|
|
527
528
|
</dialog>
|
|
528
529
|
|
|
530
|
+
<dialog id="needs-dialog" class="doc-dialog">
|
|
531
|
+
<div class="doc-head">
|
|
532
|
+
<h2 id="needs-title">Overview</h2>
|
|
533
|
+
<span class="spacer"></span>
|
|
534
|
+
<button type="button" id="needs-close" class="small ghost">Close</button>
|
|
535
|
+
</div>
|
|
536
|
+
<div id="needs-body" class="needs-body"></div>
|
|
537
|
+
</dialog>
|
|
538
|
+
|
|
529
539
|
<dialog id="review-dialog" class="doc-dialog review-dialog">
|
|
530
540
|
<div class="doc-head">
|
|
531
541
|
<h2 id="review-title">Review</h2>
|
package/public/side.js
CHANGED
package/public/style.css
CHANGED
|
@@ -223,7 +223,7 @@ body.term-max .layout { grid-template-columns: 1fr; }
|
|
|
223
223
|
#list-order, #list-project { width: auto; flex: none; padding: 1px 4px; font-size: 12px; }
|
|
224
224
|
#list-project { max-width: 160px; }
|
|
225
225
|
#list-project[hidden] { display: none; }
|
|
226
|
-
.agent-list
|
|
226
|
+
.agent-list .meta .proj-name { color: var(--text); font-weight: 500; }
|
|
227
227
|
.agent-list { list-style: none; margin: 0; padding: 0; }
|
|
228
228
|
.agent-list li.project { border-bottom: 1px solid var(--border); }
|
|
229
229
|
.agent-list li.agent[draggable='true'] { cursor: grab; }
|
|
@@ -250,6 +250,11 @@ body.term-max .layout { grid-template-columns: 1fr; }
|
|
|
250
250
|
.agent-list li.agent::before { content: ''; position: absolute; left: 19px; top: 0; bottom: 0; border-left: 1px solid var(--border); }
|
|
251
251
|
.agent-list li.agent:hover { background: var(--panel-2); }
|
|
252
252
|
.agent-list li.agent.selected { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
|
|
253
|
+
/* Open sessions stand out: a green tint, a little stronger while working. */
|
|
254
|
+
.agent-list li.agent.running { background: color-mix(in srgb, var(--green) 8%, var(--panel)); }
|
|
255
|
+
.agent-list li.agent.running.working { background: color-mix(in srgb, var(--green) 14%, var(--panel)); }
|
|
256
|
+
.agent-list li.agent.running:hover { background: color-mix(in srgb, var(--green) 16%, var(--panel)); }
|
|
257
|
+
.agent-list li.agent.running.selected { background: color-mix(in srgb, var(--green) 20%, var(--panel)); }
|
|
253
258
|
.agent-list .line1 { display: flex; align-items: center; gap: 8px; }
|
|
254
259
|
.agent-list .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
|
|
255
260
|
.agent-list .intent { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
@@ -722,6 +727,10 @@ pre.diff .meta { color: var(--muted); font-weight: 600; }
|
|
|
722
727
|
/* Review changes */
|
|
723
728
|
.review-dialog { width: min(1400px, calc(100vw - 24px)); height: calc(100vh - 32px); max-height: none; }
|
|
724
729
|
.review-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px 18px 14px; }
|
|
730
|
+
.needs-body { flex: 1; min-height: 0; overflow: auto; padding: 0 18px 16px; }
|
|
731
|
+
.needs-body .needs .needs { margin-top: 0; }
|
|
732
|
+
.needs-body h4 { margin: 16px 0 6px; }
|
|
733
|
+
.needs-body .answered { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
|
|
725
734
|
.rv-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; }
|
|
726
735
|
.rv-warn { margin: 0; color: var(--yellow); }
|
|
727
736
|
.rv-add { color: var(--green); font-family: var(--mono); font-size: 12px; }
|
package/src/brief.js
CHANGED
|
@@ -307,9 +307,52 @@ export const DOC_KINDS = {
|
|
|
307
307
|
],
|
|
308
308
|
diagram: 'Include one small diagram if it helps the decision.',
|
|
309
309
|
},
|
|
310
|
+
estimate: {
|
|
311
|
+
title: 'Human time estimate',
|
|
312
|
+
sections: [
|
|
313
|
+
['Summary', 'The total in hours and working days (6 focused hours a day) for one experienced developer who knows the codebase, the likely figure with its range, and how confident the estimate is.'],
|
|
314
|
+
[
|
|
315
|
+
'Breakdown',
|
|
316
|
+
'A Markdown table with columns: #, Task, What it covers, Optimistic (h), Likely (h), Pessimistic (h), Expected (h). Split the work into tasks of at most about 8 likely hours each: understanding the ticket and code, design, each part of the implementation (one row per component or module), tests (unit, integration, end-to-end), documentation, code review and fixes, QA and verification, release or rollout. Expected = (optimistic + 4 × likely + pessimistic) / 6, rounded to the nearest half hour. End with a bold Total row.',
|
|
317
|
+
],
|
|
318
|
+
['Suggested split', 'If the total is more than about 3 days, how to split it into tickets or sub-tasks that can be delivered and reviewed on their own: each with a one-line scope, its estimate and what it depends on. Otherwise say that one ticket is enough.'],
|
|
319
|
+
['Roles and skills', 'Who is needed (for example backend, frontend, QA, DevOps, a reviewer who knows a component) and the hours for each.'],
|
|
320
|
+
['Assumptions', 'What the estimate takes as given.'],
|
|
321
|
+
['Risks and unknowns', 'What could move the estimate, by how much, and how to reduce the uncertainty early.'],
|
|
322
|
+
],
|
|
323
|
+
diagram: 'No diagram unless a ```mermaid gantt chart of the tasks helps the plan.',
|
|
324
|
+
rules: [
|
|
325
|
+
'This is for planning: estimate the time a person would take to do this work by hand, without an AI agent. Never give the agent\'s own time.',
|
|
326
|
+
'Size it from the evidence: the ticket and intent, the files and lines changed so far (diffstat) and the brief. Where the work is not done yet, estimate what is left as well as what is done, and say which.',
|
|
327
|
+
'Use hours. Keep the numbers consistent: the Total row is the sum of the rows above it.',
|
|
328
|
+
],
|
|
329
|
+
words: '300-900',
|
|
330
|
+
},
|
|
331
|
+
documentation: {
|
|
332
|
+
title: 'Documentation',
|
|
333
|
+
diff: true,
|
|
334
|
+
sections: [
|
|
335
|
+
['Summary', 'What changed and who it is for, in two or three sentences.'],
|
|
336
|
+
['What is new or changed', 'The changes as users see them, as bullets.'],
|
|
337
|
+
['How to use it', 'Steps, commands, UI paths or code examples for the main uses.'],
|
|
338
|
+
['Configuration', 'Settings, environment variables, flags and their defaults that were added or changed, as a table; or "No configuration changes."'],
|
|
339
|
+
['Upgrade and operations notes', 'Migrations, compatibility, permissions, rollout and rollback, monitoring; or "None."'],
|
|
340
|
+
['Docs to add or update', 'Each documentation file or page in the repository (README, docs/, changelog, help text) that should be added or changed, with what goes in it.'],
|
|
341
|
+
[
|
|
342
|
+
'API changes',
|
|
343
|
+
'If the work adds, changes or removes HTTP API endpoints, parameters, request or response fields or status codes, a summary table of the endpoints (method, path, change), then one ```yaml block with an OpenAPI 3.0.3 document covering only those endpoints: paths, parameters, request bodies, responses and component schemas, with descriptions and examples. Mark removed or deprecated endpoints with deprecated: true. If there are no API changes, write "No API changes."',
|
|
344
|
+
],
|
|
345
|
+
],
|
|
346
|
+
diagram: 'No diagram unless one makes the usage clearer.',
|
|
347
|
+
rules: [
|
|
348
|
+
'Write it from the actual changes in <diff> and the brief: only document behaviour the code has. Read routes, handlers, schemas and validation in the diff to get the API right (paths, methods, field names and types).',
|
|
349
|
+
'The OpenAPI block must be valid YAML that an OpenAPI 3.0 tool can load on its own: openapi, info (title and version), paths and, when used, components.',
|
|
350
|
+
],
|
|
351
|
+
words: '400-1500',
|
|
352
|
+
},
|
|
310
353
|
};
|
|
311
354
|
|
|
312
|
-
export function docPrompt(kind, { intent, status, digest, repo, briefMarkdown, agentName }) {
|
|
355
|
+
export function docPrompt(kind, { intent, status, digest, repo, briefMarkdown, agentName, diff }) {
|
|
313
356
|
const d = DOC_KINDS[kind];
|
|
314
357
|
return [
|
|
315
358
|
`Write a ${d.title} document about an AI coding agent's work, for stakeholders who will review it.`,
|
|
@@ -323,7 +366,8 @@ export function docPrompt(kind, { intent, status, digest, repo, briefMarkdown, a
|
|
|
323
366
|
`- ${d.diagram} Diagrams go in \`\`\`mermaid code blocks with valid Mermaid syntax; keep node labels short and quote labels that contain punctuation.`,
|
|
324
367
|
'- Be specific: name the real files, components, tickets and documents from the context.',
|
|
325
368
|
'- Separate facts from proposals. Where the context does not say, write "To be confirmed" rather than guessing.',
|
|
326
|
-
|
|
369
|
+
...(d.rules ?? []).map((r) => `- ${r}`),
|
|
370
|
+
`- Clear, neutral, professional prose; bullets where they help. Roughly ${d.words ?? '400-900'} words${d.rules ? ' (not counting tables and code)' : ''}.`,
|
|
327
371
|
'- Output only the Markdown document.',
|
|
328
372
|
'',
|
|
329
373
|
'<agent_status>',
|
|
@@ -341,6 +385,7 @@ export function docPrompt(kind, { intent, status, digest, repo, briefMarkdown, a
|
|
|
341
385
|
'<brief>',
|
|
342
386
|
briefMarkdown || '(no brief yet)',
|
|
343
387
|
'</brief>',
|
|
388
|
+
...(diff == null ? [] : ['<diff>', diff || '(no changes yet)', '</diff>']),
|
|
344
389
|
].join('\n');
|
|
345
390
|
}
|
|
346
391
|
|
package/src/cli.js
CHANGED
|
@@ -475,18 +475,18 @@ export async function main(argv) {
|
|
|
475
475
|
|
|
476
476
|
program
|
|
477
477
|
.command('doc')
|
|
478
|
-
.description('Write a stakeholder document from the agent work: analysis, design, flow, proposal, humanai (Human vs AI), diagrams (diagrams only), walkthrough (its changes explained one by one) or scorecard (its changes scored for review)')
|
|
478
|
+
.description('Write a stakeholder document from the agent work: analysis, design, flow, proposal, humanai (Human vs AI), estimate (human time estimate for planning), documentation (user, developer and OpenAPI docs), diagrams (diagrams only), walkthrough (its changes explained one by one) or scorecard (its changes scored for review)')
|
|
479
479
|
.argument('<agent>')
|
|
480
|
-
.argument('<kind>', 'analysis, design, flow, proposal, humanai, diagrams, walkthrough, scorecard, or all (background; diagrams, walkthrough and scorecard not included)')
|
|
480
|
+
.argument('<kind>', 'analysis, design, flow, proposal, humanai, estimate, documentation, diagrams, walkthrough, scorecard, or all (background; diagrams, walkthrough and scorecard not included)')
|
|
481
481
|
.option('-o, --output <file>', 'also save the Markdown to this file')
|
|
482
482
|
.option('--cached', 'print the last version instead of writing a new one')
|
|
483
|
-
.option('-b, --background', 'start writing and return at once (kind "all" writes all
|
|
483
|
+
.option('-b, --background', 'start writing and return at once (kind "all" writes all seven)')
|
|
484
484
|
.action(async (ref, kind, opts) => {
|
|
485
485
|
await daemon();
|
|
486
486
|
const a = await resolveAgent(ref);
|
|
487
487
|
if (opts.background || kind === 'all') {
|
|
488
488
|
const res = await api('POST', `/agents/${a.id}/docs/${encodeURIComponent(kind)}?background=1`);
|
|
489
|
-
const kinds = kind === 'all' ? ['analysis', 'design', 'flow', 'proposal', 'humanai'] : [kind];
|
|
489
|
+
const kinds = kind === 'all' ? ['analysis', 'design', 'flow', 'proposal', 'humanai', 'estimate', 'documentation'] : [kind];
|
|
490
490
|
console.log(`${green('…')} writing ${kinds.join(', ')} for ${res.name} in the background`);
|
|
491
491
|
console.log(dim(` read it when ready: agentmgr doc ${a.id} ${kinds[0]} --cached (or open the agent in the UI)`));
|
|
492
492
|
return;
|
package/src/drive.js
CHANGED
|
@@ -23,6 +23,8 @@ export const DRIVE_DOCS = [
|
|
|
23
23
|
['design', 'Design'],
|
|
24
24
|
['flow', 'Flow'],
|
|
25
25
|
['proposal', 'Proposal'],
|
|
26
|
+
['estimate', 'Human time estimate'],
|
|
27
|
+
['documentation', 'Documentation'],
|
|
26
28
|
['diagrams', 'Diagrams'],
|
|
27
29
|
['walkthrough', 'Change walkthrough'],
|
|
28
30
|
['scorecard', 'Review scorecard'],
|
package/src/manager.js
CHANGED
|
@@ -2407,7 +2407,7 @@ export class AgentManager extends EventEmitter {
|
|
|
2407
2407
|
return this.view(this.store.get(agent.id));
|
|
2408
2408
|
}
|
|
2409
2409
|
|
|
2410
|
-
/** A stakeholder document: analysis, design, flow or
|
|
2410
|
+
/** A stakeholder document: analysis, design, flow, proposal, estimate or documentation. */
|
|
2411
2411
|
document(ref, kind) {
|
|
2412
2412
|
if (!SUMMARIES[kind]?.doc) throw Object.assign(new Error(`Unknown document "${kind}"`), { status: 400 });
|
|
2413
2413
|
return this.summarize(ref, kind);
|
|
@@ -2422,6 +2422,7 @@ export class AgentManager extends EventEmitter {
|
|
|
2422
2422
|
const run = this.summarySlot()
|
|
2423
2423
|
.then((release) =>
|
|
2424
2424
|
this.explainContext(agent)
|
|
2425
|
+
.then(async (ctx) => (DOC_KINDS[kind]?.diff ? { ...ctx, diff: await this.docDiff(agent) } : ctx))
|
|
2425
2426
|
.then((ctx) => (SUMMARIES[kind].run ? this[SUMMARIES[kind].run](agent, ctx) : this.runExplain(agent, { ...ctx, agentName: agent.name }, kind)))
|
|
2426
2427
|
.finally(release),
|
|
2427
2428
|
)
|
|
@@ -2435,6 +2436,13 @@ export class AgentManager extends EventEmitter {
|
|
|
2435
2436
|
return run;
|
|
2436
2437
|
}
|
|
2437
2438
|
|
|
2439
|
+
/** The agent's changes for a document that needs the code itself (Documentation: the API), cut to fit a prompt. */
|
|
2440
|
+
async docDiff(agent, max = 80_000) {
|
|
2441
|
+
if (!this.changesSource || NO_REPO.has(agent.kind) || !agent.workdir) return null;
|
|
2442
|
+
const diff = (await this.changesSource(agent.id).catch(() => null))?.diff ?? '';
|
|
2443
|
+
return diff.length > max ? `${diff.slice(0, max)}\n… (the rest of the diff was cut)` : diff;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2438
2446
|
/** What the agent is actually doing: its session, repo changes, live status and brief. */
|
|
2439
2447
|
async explainContext(agent) {
|
|
2440
2448
|
const v = this.view(agent);
|
package/src/server.js
CHANGED
|
@@ -396,7 +396,7 @@ export async function startServer({ port = PORT, host = HOST, evalTimer = true }
|
|
|
396
396
|
const bg = (req) => req.query.background === '1' || req.body?.background === true;
|
|
397
397
|
api.post('/agents/:id/explain', wrap((req) => (bg(req) ? manager.summarizeInBackground(req.params.id, ['explain']) : manager.explain(req.params.id))));
|
|
398
398
|
api.post('/agents/:id/insights', wrap((req) => (bg(req) ? manager.summarizeInBackground(req.params.id, ['insights']) : manager.insights(req.params.id))));
|
|
399
|
-
const DOC_LIST = ['analysis', 'design', 'flow', 'proposal', 'humanai'];
|
|
399
|
+
const DOC_LIST = ['analysis', 'design', 'flow', 'proposal', 'humanai', 'estimate', 'documentation'];
|
|
400
400
|
api.post('/agents/:id/humanai/answers', wrap((req) => manager.humanAiAnswers(req.params.id, req.body?.answers, { send: req.body?.send === true })));
|
|
401
401
|
api.post(
|
|
402
402
|
'/agents/:id/docs/:kind',
|