ai-agentmanager 1.20.0 → 1.22.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 +13 -0
- package/README.md +64 -2
- package/package.json +1 -1
- package/public/app.js +89 -3
- package/public/codemap.js +209 -0
- package/public/designs.js +172 -0
- package/public/index.html +26 -0
- package/public/issues.js +255 -0
- package/public/keys.js +8 -3
- package/public/land.js +2 -0
- package/public/prvoice.js +103 -0
- package/public/speak.js +11 -4
- package/public/standup.js +348 -0
- package/public/style.css +168 -0
- package/public/value.js +299 -0
- package/public/voice.js +16 -0
- package/src/assistant.js +16 -4
- package/src/cli.js +184 -1
- package/src/codemap.js +115 -0
- package/src/config.js +2 -0
- package/src/designs.js +72 -0
- package/src/issues.js +272 -0
- package/src/jira.js +15 -4
- package/src/manager.js +106 -1
- package/src/notify.js +2 -0
- package/src/server.js +98 -0
- package/src/standup.js +209 -0
- package/src/value.js +609 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// Designs: every agent's design doc in one list, the ones waiting for your review first: its name
|
|
2
|
+
// and summary, where it's published, the specs it builds on, and the agent and its issue.
|
|
3
|
+
|
|
4
|
+
const SAVED = 'agentmgr.designsFilter';
|
|
5
|
+
const FILTERS = [
|
|
6
|
+
['you', 'Waiting for you'],
|
|
7
|
+
['agent', 'Agents on it'],
|
|
8
|
+
['done', 'Done'],
|
|
9
|
+
['all', 'All'],
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export function initDesigns({ api, $, esc, ago, openAgent, openDoc, toast }) {
|
|
13
|
+
const dialog = $('#designs-dialog');
|
|
14
|
+
const body = $('#designs-body');
|
|
15
|
+
let rows = null;
|
|
16
|
+
let loading = false;
|
|
17
|
+
let loadedAt = 0;
|
|
18
|
+
let again = null;
|
|
19
|
+
let query = '';
|
|
20
|
+
let filter = 'you';
|
|
21
|
+
try {
|
|
22
|
+
filter = localStorage.getItem(SAVED) || 'you';
|
|
23
|
+
} catch {}
|
|
24
|
+
|
|
25
|
+
async function load({ quiet = false } = {}) {
|
|
26
|
+
if (loading) return;
|
|
27
|
+
loading = true;
|
|
28
|
+
try {
|
|
29
|
+
rows = (await api('GET', '/designs')).rows;
|
|
30
|
+
loadedAt = Date.now();
|
|
31
|
+
} catch (e) {
|
|
32
|
+
if (!quiet) toast?.(e.message, 5000);
|
|
33
|
+
} finally {
|
|
34
|
+
loading = false;
|
|
35
|
+
}
|
|
36
|
+
badge();
|
|
37
|
+
render();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The button's count: design docs waiting for your review. */
|
|
41
|
+
function badge() {
|
|
42
|
+
const n = rows ? rows.filter((r) => r.group === 'you').length : 0;
|
|
43
|
+
const el = $('#designs-count');
|
|
44
|
+
if (el) {
|
|
45
|
+
el.textContent = n ? String(n) : '';
|
|
46
|
+
el.title = n ? `${n} design docs waiting for your review` : '';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const ext = (label, url, title = '') => `<a href="${esc(url)}" target="_blank" rel="noopener" title="${esc(title)}">${esc(label)} ↗</a>`;
|
|
51
|
+
|
|
52
|
+
function card(r) {
|
|
53
|
+
const links = [
|
|
54
|
+
r.written ? `<button class="link" data-design-read="${esc(r.agent.id)}" title="Read DESIGN.md here">Read</button>` : '<span class="hint">not written yet</span>',
|
|
55
|
+
r.page?.url ? ext('Design page', r.page.url, 'The Artifact the agent published') : r.page?.note ? `<span class="hint" title="${esc(r.page.note)}">page not published</span>` : '',
|
|
56
|
+
r.google ? ext('Google Doc', r.google) : '',
|
|
57
|
+
...r.specs.map((s) => ext(s.label, s.url, s.title ?? '')),
|
|
58
|
+
].filter(Boolean);
|
|
59
|
+
const dot = r.agent.busy ? '<span class="dot busy" title="Working"></span>' : r.agent.running ? '<span class="dot idle" title="Session open"></span>' : '';
|
|
60
|
+
return `<article class="design-card stage-${esc(r.stage)}">
|
|
61
|
+
<header>
|
|
62
|
+
<h3>${esc(r.title)}</h3>
|
|
63
|
+
<span class="hint">${esc(ago(r.updatedAt))}</span>
|
|
64
|
+
</header>
|
|
65
|
+
<div class="design-meta">
|
|
66
|
+
<button class="link" data-design-open="${esc(r.agent.id)}" title="Open the agent's session">${dot}${esc(r.agent.name)}</button>
|
|
67
|
+
${r.agent.project ? `<span class="hint">${esc(r.agent.project)}</span>` : ''}
|
|
68
|
+
${r.issue ? (r.issue.url ? ext(r.issue.key, r.issue.url) : `<span>${esc(r.issue.key)}</span>`) : ''}
|
|
69
|
+
<span class="design-note">${esc(r.note)}</span>
|
|
70
|
+
</div>
|
|
71
|
+
${r.summary ? `<p class="design-summary">${esc(r.summary)}</p>` : ''}
|
|
72
|
+
<div class="design-links">${links.join('<span class="sep">·</span>')}</div>
|
|
73
|
+
</article>`;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function render() {
|
|
77
|
+
if (!dialog.open) return;
|
|
78
|
+
if (!rows) {
|
|
79
|
+
body.innerHTML = '<p class="hint">Loading…</p>';
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const count = (g) => (g === 'all' ? rows.length : rows.filter((r) => r.group === g).length);
|
|
83
|
+
const q = query.trim().toLowerCase();
|
|
84
|
+
const shown = rows
|
|
85
|
+
.filter((r) => filter === 'all' || r.group === filter)
|
|
86
|
+
.filter((r) => !q || [r.title, r.summary, r.agent.name, r.agent.project, r.issue?.key].some((s) => String(s ?? '').toLowerCase().includes(q)));
|
|
87
|
+
const empty = !rows.length
|
|
88
|
+
? 'No design docs yet. Agents write one once their plan is settled (Design doc, on by default when you create an agent).'
|
|
89
|
+
: q
|
|
90
|
+
? 'No design doc matches.'
|
|
91
|
+
: filter === 'you'
|
|
92
|
+
? 'No design doc is waiting for your review.'
|
|
93
|
+
: 'None here.';
|
|
94
|
+
const focused = document.activeElement?.dataset?.designs === 'search';
|
|
95
|
+
body.innerHTML = `
|
|
96
|
+
<div class="issues-head">
|
|
97
|
+
<h2>Designs</h2>
|
|
98
|
+
<div class="chips" role="tablist">${FILTERS.map(([k, label]) => `<button class="chip ${k === filter ? 'active' : ''}" role="tab" aria-selected="${k === filter}" data-designs-filter="${k}">${label} <span class="count">${count(k)}</span></button>`).join('')}</div>
|
|
99
|
+
<input type="search" class="designs-search" data-designs="search" placeholder="Search" value="${esc(query)}" aria-label="Search design docs" />
|
|
100
|
+
<span class="spacer"></span>
|
|
101
|
+
<button class="small" data-designs="copy" title="Copy this list as Markdown, to paste into Slack, Jira or a doc" ${shown.length ? '' : 'disabled'}>Copy</button>
|
|
102
|
+
<button class="small" data-designs="refresh" title="Look again now">↻</button>
|
|
103
|
+
<button class="small" data-designs="close" title="Close (Esc)">Close</button>
|
|
104
|
+
</div>
|
|
105
|
+
${shown.length ? `<div class="designs-list">${shown.map(card).join('')}</div>` : `<p class="hint issues-empty">${esc(empty)}</p>`}`;
|
|
106
|
+
if (focused) {
|
|
107
|
+
const s = body.querySelector('[data-designs="search"]');
|
|
108
|
+
s.focus();
|
|
109
|
+
s.setSelectionRange(s.value.length, s.value.length);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
body.addEventListener('input', (e) => {
|
|
114
|
+
if (e.target.dataset.designs !== 'search') return;
|
|
115
|
+
query = e.target.value;
|
|
116
|
+
render();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
body.addEventListener('click', async (e) => {
|
|
120
|
+
const o = e.target.closest('[data-design-open]');
|
|
121
|
+
if (o) {
|
|
122
|
+
dialog.close();
|
|
123
|
+
return openAgent(o.dataset.designOpen);
|
|
124
|
+
}
|
|
125
|
+
const rd = e.target.closest('[data-design-read]');
|
|
126
|
+
if (rd) {
|
|
127
|
+
dialog.close();
|
|
128
|
+
return openDoc(rd.dataset.designRead);
|
|
129
|
+
}
|
|
130
|
+
const f = e.target.closest('[data-designs-filter]');
|
|
131
|
+
if (f) {
|
|
132
|
+
filter = f.dataset.designsFilter;
|
|
133
|
+
try {
|
|
134
|
+
localStorage.setItem(SAVED, filter);
|
|
135
|
+
} catch {}
|
|
136
|
+
return render();
|
|
137
|
+
}
|
|
138
|
+
const b = e.target.closest('[data-designs]')?.dataset.designs;
|
|
139
|
+
if (b === 'close') return dialog.close();
|
|
140
|
+
if (b === 'refresh') return load();
|
|
141
|
+
if (b === 'copy') {
|
|
142
|
+
try {
|
|
143
|
+
const { markdown } = await api('GET', `/designs?group=${encodeURIComponent(filter)}&q=${encodeURIComponent(query)}&format=markdown`);
|
|
144
|
+
await navigator.clipboard.writeText(markdown);
|
|
145
|
+
toast?.('Copied as Markdown');
|
|
146
|
+
} catch (err) {
|
|
147
|
+
toast?.(`Couldn't copy: ${err.message}`, 5000);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
function open() {
|
|
153
|
+
if (dialog.open) return dialog.close();
|
|
154
|
+
dialog.showModal();
|
|
155
|
+
render();
|
|
156
|
+
load();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** An agent changed: look again shortly while open, and now and then for the count. */
|
|
160
|
+
function changed() {
|
|
161
|
+
if (!dialog.open && again) return;
|
|
162
|
+
clearTimeout(again);
|
|
163
|
+
const wait = dialog.open ? 1500 : Math.max(5000, 30_000 - (Date.now() - loadedAt));
|
|
164
|
+
again = setTimeout(() => {
|
|
165
|
+
again = null;
|
|
166
|
+
load({ quiet: true });
|
|
167
|
+
}, wait);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
load({ quiet: true });
|
|
171
|
+
return { open, changed, isOpen: () => dialog.open };
|
|
172
|
+
}
|
package/public/index.html
CHANGED
|
@@ -31,6 +31,11 @@
|
|
|
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="standup-btn" title="Today's standup: each agent's news read aloud, and what they need from you">Standup <span id="standup-dot" class="assistant-dot" hidden></span></button>
|
|
35
|
+
<button id="issues-btn" title="Jira: every issue an agent works on, with its Jira status, pull request and agent, the ones waiting for your review first">Jira <span id="issues-count" class="badge ready"></span></button>
|
|
36
|
+
<button id="designs-btn" title="Designs: every agent's design doc with its summary and links, the ones waiting for your review first">Designs <span id="designs-count" class="badge ready"></span></button>
|
|
37
|
+
<button id="value-btn" title="Value: what the delivered work is worth, by day, week, month and quarter, against the AI cost and your time; reports for management">Value</button>
|
|
38
|
+
<button id="map-btn" title="The codebase map: where each agent is changing and reading code, and who is about to collide">Map</button>
|
|
34
39
|
<button id="watch-btn" title="Running agents' sessions side by side, live: follow them all without clicking from one to the next">Watch</button>
|
|
35
40
|
<button id="machine-btn" title="A terminal on this computer (your home folder), from any device you're signed in on">Terminal</button>
|
|
36
41
|
<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>
|
|
@@ -60,6 +65,12 @@
|
|
|
60
65
|
</div>
|
|
61
66
|
</header>
|
|
62
67
|
|
|
68
|
+
<section id="map-view" class="map-view" hidden aria-label="Map: where agents are in the code">
|
|
69
|
+
<div id="map-bar" class="watch-bar"></div>
|
|
70
|
+
<div id="map-warn" class="map-warn"></div>
|
|
71
|
+
<div id="map-box" class="map-box"></div>
|
|
72
|
+
<div id="map-agents" class="map-agents"></div>
|
|
73
|
+
</section>
|
|
63
74
|
<section id="watch-view" class="watch-view" hidden aria-label="Watch: agents' sessions side by side">
|
|
64
75
|
<div id="watch-bar" class="watch-bar"></div>
|
|
65
76
|
<p id="watch-empty" class="hint watch-empty" hidden></p>
|
|
@@ -368,6 +379,18 @@
|
|
|
368
379
|
</form>
|
|
369
380
|
</dialog>
|
|
370
381
|
|
|
382
|
+
<dialog id="issues-dialog" class="issues-dialog" aria-label="Jira issues">
|
|
383
|
+
<div id="issues-body"></div>
|
|
384
|
+
</dialog>
|
|
385
|
+
<dialog id="designs-dialog" class="issues-dialog" aria-label="Design docs">
|
|
386
|
+
<div id="designs-body"></div>
|
|
387
|
+
</dialog>
|
|
388
|
+
<dialog id="value-dialog" class="issues-dialog value-dialog" aria-label="Value">
|
|
389
|
+
<div id="value-body"></div>
|
|
390
|
+
</dialog>
|
|
391
|
+
<dialog id="standup-dialog" class="standup-dialog" aria-label="Standup">
|
|
392
|
+
<div id="standup-body"></div>
|
|
393
|
+
</dialog>
|
|
371
394
|
<dialog id="ask-dialog">
|
|
372
395
|
<form id="ask-form" method="dialog">
|
|
373
396
|
<h2>Ask an agent</h2>
|
|
@@ -518,6 +541,8 @@
|
|
|
518
541
|
<label class="check"><input type="checkbox" name="ev_question" /> asks a question in the inbox</label>
|
|
519
542
|
<label class="check"><input type="checkbox" name="ev_assistant" /> is started for new work (by the assistant, a GitHub label or a webhook)</label>
|
|
520
543
|
<label class="check"><input type="checkbox" name="ev_budget" /> nears or reaches its budget, or today's spend reaches the daily limit</label>
|
|
544
|
+
<label class="check"><input type="checkbox" name="ev_standup" /> the daily standup is ready (with a link to play it)</label>
|
|
545
|
+
<label class="check"><input type="checkbox" name="ev_value" /> value reports (weekly, monthly, quarterly, as set in Value)</label>
|
|
521
546
|
<label class="check"><input type="checkbox" name="ev_waiting" /> finished its turn and is idle after <input name="waitingDelaySec" type="number" min="0" class="num" />s</label>
|
|
522
547
|
<label class="check"><input type="checkbox" name="skipWhenWatching" /> not while I have its terminal open</label>
|
|
523
548
|
<label class="check"><input type="checkbox" name="includeIntent" /> include the intent text in the message</label>
|
|
@@ -577,6 +602,7 @@
|
|
|
577
602
|
<label class="check"><input type="checkbox" name="src_ci" /> Failing checks on my open pull requests</label>
|
|
578
603
|
<label class="check"><input type="checkbox" name="src_slack" /> Slack messages to me that ask for work</label>
|
|
579
604
|
<label class="check"><input type="checkbox" name="src_linear" /> Linear issues newly assigned to me</label>
|
|
605
|
+
<label class="check"><input type="checkbox" name="pickIssues" /> Let me pick: list new Jira and Linear issues under <b>Jira → Not started</b>, and start agents only for the ones I tick</label>
|
|
580
606
|
</fieldset>
|
|
581
607
|
<div class="row three">
|
|
582
608
|
<label>Check every <span class="hint">minutes</span><input name="everyMin" type="number" min="1" /></label>
|
package/public/issues.js
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// Jira: every issue an agent works on in one table, the ones waiting for your review first: the
|
|
2
|
+
// issue and its Jira status, where the work stands, its plan, design doc and pull request, and a
|
|
3
|
+
// link to the agent. Issues proposed for agents (when you pick) come first, with a box to tick:
|
|
4
|
+
// agents start only for the ticked ones.
|
|
5
|
+
|
|
6
|
+
import { listenHtml } from './speak.js';
|
|
7
|
+
|
|
8
|
+
const SAVED = 'agentmgr.issuesFilter';
|
|
9
|
+
const FILTERS = [
|
|
10
|
+
['new', 'Not started'],
|
|
11
|
+
['you', 'Waiting for you'],
|
|
12
|
+
['agent', 'Agents on it'],
|
|
13
|
+
['done', 'Done'],
|
|
14
|
+
['all', 'All'],
|
|
15
|
+
];
|
|
16
|
+
const CHECKS = { passed: ['✓', 'Checks pass'], failed: ['✗', 'Checks failing'], running: ['●', 'Checks running'] };
|
|
17
|
+
|
|
18
|
+
export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
|
|
19
|
+
const dialog = $('#issues-dialog');
|
|
20
|
+
const ext = (label, url, title = '') => `<a href="${esc(url)}" target="_blank" rel="noopener" title="${esc(title)}">${esc(label)} ↗</a>`;
|
|
21
|
+
const body = $('#issues-body');
|
|
22
|
+
let data = null;
|
|
23
|
+
let loading = false;
|
|
24
|
+
let again = null;
|
|
25
|
+
let filter = 'you';
|
|
26
|
+
// Proposed issues ticked to start, by key.
|
|
27
|
+
const ticked = new Set();
|
|
28
|
+
let starting = false;
|
|
29
|
+
try {
|
|
30
|
+
filter = localStorage.getItem(SAVED) || 'you';
|
|
31
|
+
} catch {}
|
|
32
|
+
|
|
33
|
+
let loadedAt = 0;
|
|
34
|
+
|
|
35
|
+
async function load({ quiet = false } = {}) {
|
|
36
|
+
if (loading) return;
|
|
37
|
+
loading = true;
|
|
38
|
+
try {
|
|
39
|
+
data = await api('GET', '/issues');
|
|
40
|
+
loadedAt = Date.now();
|
|
41
|
+
} catch (e) {
|
|
42
|
+
if (!quiet) toast?.(e.message, 5000);
|
|
43
|
+
} finally {
|
|
44
|
+
loading = false;
|
|
45
|
+
}
|
|
46
|
+
badge();
|
|
47
|
+
render();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The button's count: issues to start or waiting for your review. */
|
|
51
|
+
function badge() {
|
|
52
|
+
const fresh = data ? data.rows.filter((r) => r.group === 'new').length : 0;
|
|
53
|
+
const n = (data ? data.rows.filter((r) => r.group === 'you').length : 0) + fresh;
|
|
54
|
+
const el = $('#issues-count');
|
|
55
|
+
if (el) {
|
|
56
|
+
el.textContent = n ? String(n) : '';
|
|
57
|
+
el.title = [fresh && `${fresh} not started`, n - fresh && `${n - fresh} waiting for your review`].filter(Boolean).join(', ');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function row(r, boxes) {
|
|
62
|
+
const box = !boxes ? '' : r.group === 'new' ? `<td class="pick"><input type="checkbox" data-issue-pick="${esc(r.key)}" ${ticked.has(r.key) ? 'checked' : ''} aria-label="Start an agent for ${esc(r.key)}" /></td>` : '<td></td>';
|
|
63
|
+
const issue = r.url ? `<a href="${esc(r.url)}" target="_blank" rel="noopener" class="issue-key">${esc(r.key)}</a>` : `<span class="issue-key">${esc(r.key)}</span>`;
|
|
64
|
+
const status = r.jira?.status ? `<span class="jira-status ${esc(r.jira.category ?? '')}">${esc(r.jira.status)}</span>` : '<span class="hint">—</span>';
|
|
65
|
+
const check = r.pr?.checks && CHECKS[r.pr.checks] ? ` <span class="checks ${esc(r.pr.checks)}" title="${CHECKS[r.pr.checks][1]}">${CHECKS[r.pr.checks][0]}</span>` : '';
|
|
66
|
+
const pr = r.pr?.url
|
|
67
|
+
? `<a href="${esc(r.pr.url)}" target="_blank" rel="noopener" title="${esc(r.pr.title ?? '')}">#${esc(r.pr.number ?? '?')}</a>${check}${r.aiReview ? `<div class="hint" title="AI review">AI: ${esc(r.aiReview)}</div>` : ''}<div>${listenHtml(`prvoice:${r.agent.id}`, { title: 'Explain the review aloud: the PR, its checks, the AI review, the riskiest changes and what is left', label: 'Explain' })}</div>`
|
|
68
|
+
: '<span class="hint">—</span>';
|
|
69
|
+
if (!r.agent) {
|
|
70
|
+
const by = r.proposal?.by === 'assistant' ? 'proposed by the assistant' : 'proposed';
|
|
71
|
+
return `<tr class="stage-proposed ${ticked.has(r.key) ? 'ticked' : ''}">${box}
|
|
72
|
+
<td>${issue}${r.title ? `<div class="issue-title">${esc(r.title)}</div>` : ''}</td>
|
|
73
|
+
<td>${status}</td>
|
|
74
|
+
<td class="issue-note">${esc(r.note)}</td>
|
|
75
|
+
<td class="hint">—</td>
|
|
76
|
+
<td class="hint">—</td>
|
|
77
|
+
<td class="hint">—</td>
|
|
78
|
+
<td><span class="hint">${esc(by)}</span>${r.proposal?.project ? `<div class="hint">@${esc(r.proposal.project)}</div>` : ''}</td>
|
|
79
|
+
<td class="hint col-active">${esc(ago(r.updatedAt))}</td>
|
|
80
|
+
</tr>`;
|
|
81
|
+
}
|
|
82
|
+
const dot = r.agent.busy ? '<span class="dot busy" title="Working"></span>' : r.agent.running ? '<span class="dot idle" title="Session open"></span>' : '';
|
|
83
|
+
const agent = `<button class="link" data-issue-open="${esc(r.agent.id)}" title="Open the agent's session">${dot}${esc(r.agent.name)}</button>${r.agent.project ? `<div class="hint">${esc(r.agent.project)}${r.agent.from ? ` · by ${esc(r.agent.from)}` : ''}</div>` : ''}`;
|
|
84
|
+
const read = (kind, label, title) => `<button class="link" data-issue-doc="${esc(kind)}" data-agent="${esc(r.agent.id)}" title="${esc(title)}">${label}</button>`;
|
|
85
|
+
const REVIEW = { writing: 'being written', review: 'waiting for your approval', approved: 'approved', changes: 'changes asked' };
|
|
86
|
+
const p = r.plan;
|
|
87
|
+
const plan = p
|
|
88
|
+
? `${p.written ? read('plan', 'Read', 'Read the plan here') : '<span class="hint">not yet</span>'}${p.total ? ` <span class="steps" title="Steps done">${p.done}/${p.total}</span>` : ''}${p.review ? `<div class="hint plan-${esc(p.review)}">${esc(REVIEW[p.review] ?? p.review)}</div>` : ''}`
|
|
89
|
+
: '<span class="hint">—</span>';
|
|
90
|
+
const d = r.design;
|
|
91
|
+
const design = d
|
|
92
|
+
? [d.written ? read('designdoc', 'Read', 'Read the design doc here') : '<span class="hint">not yet</span>', d.page && ext('Page', d.page, 'The design page the agent published'), d.google && ext('Doc', d.google, 'Google Doc')].filter(Boolean).join(' · ')
|
|
93
|
+
: '<span class="hint">—</span>';
|
|
94
|
+
return `<tr class="stage-${esc(r.stage)}">${box}
|
|
95
|
+
<td>${issue}${r.title ? `<div class="issue-title">${esc(r.title)}</div>` : ''}</td>
|
|
96
|
+
<td>${status}</td>
|
|
97
|
+
<td class="issue-note">${esc(r.note)}</td>
|
|
98
|
+
<td class="nowrap">${plan}</td>
|
|
99
|
+
<td class="nowrap">${design}</td>
|
|
100
|
+
<td>${pr}</td>
|
|
101
|
+
<td>${agent}</td>
|
|
102
|
+
<td class="hint col-active">${esc(ago(r.updatedAt))}</td>
|
|
103
|
+
</tr>`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function render() {
|
|
107
|
+
if (!dialog.open) return;
|
|
108
|
+
if (!data) {
|
|
109
|
+
body.innerHTML = '<p class="hint">Loading…</p>';
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const count = (g) => (g === 'all' ? data.rows.length : data.rows.filter((r) => r.group === g).length);
|
|
113
|
+
const rows = filter === 'all' ? data.rows : data.rows.filter((r) => r.group === filter);
|
|
114
|
+
// Ticks only for issues still on the list.
|
|
115
|
+
const fresh = new Set(data.rows.filter((r) => r.group === 'new').map((r) => r.key));
|
|
116
|
+
for (const k of ticked) if (!fresh.has(k)) ticked.delete(k);
|
|
117
|
+
const shownNew = rows.filter((r) => r.group === 'new');
|
|
118
|
+
const boxes = shownNew.length > 0;
|
|
119
|
+
const allTicked = boxes && shownNew.every((r) => ticked.has(r.key));
|
|
120
|
+
const n = ticked.size;
|
|
121
|
+
const empty = !data.rows.length
|
|
122
|
+
? 'No agent works on a Jira or Linear issue yet. Start one with the issue link first ("https://…/browse/OPS-7 fix the timeout"), or let the assistant start them for issues assigned to you.'
|
|
123
|
+
: filter === 'you'
|
|
124
|
+
? 'Nothing is waiting for your review.'
|
|
125
|
+
: filter === 'new'
|
|
126
|
+
? 'No issues waiting to be started. With "Let me pick" on in Assistant, new Jira and Linear issues assigned to you come here instead of getting agents right away (or: agentmgr issues propose).'
|
|
127
|
+
: 'None here.';
|
|
128
|
+
body.innerHTML = `
|
|
129
|
+
<div class="issues-head">
|
|
130
|
+
<h2>Jira</h2>
|
|
131
|
+
<div class="chips" role="tablist">${FILTERS.map(([k, label]) => `<button class="chip ${k === filter ? 'active' : ''}" role="tab" aria-selected="${k === filter}" data-issues-filter="${k}">${label} <span class="count">${count(k)}</span></button>`).join('')}</div>
|
|
132
|
+
<span class="spacer"></span>
|
|
133
|
+
<button class="small" data-issues="copy" title="Copy this list as a Markdown table, to paste into Slack, Jira or a doc" ${rows.length ? '' : 'disabled'}>Copy</button>
|
|
134
|
+
<button class="small" data-issues="refresh" title="Look again now">↻</button>
|
|
135
|
+
<button class="small" data-issues="close" title="Close (Esc)">Close</button>
|
|
136
|
+
</div>
|
|
137
|
+
${boxes
|
|
138
|
+
? `<div class="issues-pickbar">
|
|
139
|
+
<button class="primary small" data-issues="start" ${n && !starting ? '' : 'disabled'} title="Start an agent for each ticked issue">${starting ? 'Starting…' : `Start ${n || ''} agent${n === 1 ? '' : 's'}`.replace(' ', ' ')}</button>
|
|
140
|
+
<button class="small" data-issues="dismiss" ${n && !starting ? '' : 'disabled'} title="Take the ticked issues off the list; they won't be proposed again">Dismiss</button>
|
|
141
|
+
<span class="hint">Tick the issues to start agents for; the rest stay here.</span>
|
|
142
|
+
</div>`
|
|
143
|
+
: ''}
|
|
144
|
+
${rows.length
|
|
145
|
+
? `<div class="issues-scroll"><table class="issues">
|
|
146
|
+
<thead><tr>${boxes ? `<th class="pick"><input type="checkbox" data-issue-pick-all ${allTicked ? 'checked' : ''} aria-label="Tick all" title="Tick all" /></th>` : ''}<th>Issue</th><th>Jira status</th><th>Where it stands</th><th>Plan</th><th>Design</th><th>Pull request</th><th>Agent</th><th class="col-active">Active</th></tr></thead>
|
|
147
|
+
<tbody>${rows.map((r) => row(r, boxes)).join('')}</tbody>
|
|
148
|
+
</table></div>`
|
|
149
|
+
: `<p class="hint issues-empty">${esc(empty)}</p>`}
|
|
150
|
+
${data.jira.signedIn || !data.rows.length ? '' : '<p class="hint">Jira status shows for public issues only until you add your Jira site, email and API token in Settings → Jira.</p>'}`;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
body.addEventListener('change', (e) => {
|
|
154
|
+
const one = e.target.dataset.issuePick;
|
|
155
|
+
if (one) {
|
|
156
|
+
if (e.target.checked) ticked.add(one);
|
|
157
|
+
else ticked.delete(one);
|
|
158
|
+
return render();
|
|
159
|
+
}
|
|
160
|
+
if (e.target.dataset.issuePickAll !== undefined) {
|
|
161
|
+
const shown = data.rows.filter((r) => r.group === 'new' && (filter === 'all' || filter === 'new'));
|
|
162
|
+
for (const r of shown) e.target.checked ? ticked.add(r.key) : ticked.delete(r.key);
|
|
163
|
+
render();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
async function startTicked() {
|
|
168
|
+
const keys = [...ticked];
|
|
169
|
+
starting = true;
|
|
170
|
+
render();
|
|
171
|
+
try {
|
|
172
|
+
const r = await api('POST', '/issues/start', { keys });
|
|
173
|
+
for (const x of r.started) ticked.delete(x.key);
|
|
174
|
+
const bad = r.failed.map((x) => `${x.key}: ${x.reason}`).join('; ');
|
|
175
|
+
toast?.(`${r.started.length ? `Started ${r.started.length} agent${r.started.length === 1 ? '' : 's'}: ${r.started.map((x) => x.key).join(', ')}` : 'No agents started'}${bad ? `. Not started: ${bad}` : ''}`, bad ? 8000 : 4000);
|
|
176
|
+
} catch (err) {
|
|
177
|
+
toast?.(err.message, 6000);
|
|
178
|
+
} finally {
|
|
179
|
+
starting = false;
|
|
180
|
+
}
|
|
181
|
+
load();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
body.addEventListener('click', async (e) => {
|
|
185
|
+
const o = e.target.closest('[data-issue-open]');
|
|
186
|
+
if (o) {
|
|
187
|
+
dialog.close();
|
|
188
|
+
return openAgent(o.dataset.issueOpen);
|
|
189
|
+
}
|
|
190
|
+
const doc = e.target.closest('[data-issue-doc]');
|
|
191
|
+
if (doc) {
|
|
192
|
+
dialog.close();
|
|
193
|
+
return openDoc(doc.dataset.agent, doc.dataset.issueDoc);
|
|
194
|
+
}
|
|
195
|
+
const f = e.target.closest('[data-issues-filter]');
|
|
196
|
+
if (f) {
|
|
197
|
+
filter = f.dataset.issuesFilter;
|
|
198
|
+
try {
|
|
199
|
+
localStorage.setItem(SAVED, filter);
|
|
200
|
+
} catch {}
|
|
201
|
+
return render();
|
|
202
|
+
}
|
|
203
|
+
const b = e.target.closest('[data-issues]')?.dataset.issues;
|
|
204
|
+
if (b === 'close') return dialog.close();
|
|
205
|
+
if (b === 'refresh') return load();
|
|
206
|
+
if (b === 'start') return startTicked();
|
|
207
|
+
if (b === 'dismiss') {
|
|
208
|
+
try {
|
|
209
|
+
const r = await api('POST', '/issues/dismiss', { keys: [...ticked] });
|
|
210
|
+
ticked.clear();
|
|
211
|
+
toast?.(`${r.dismissed} dismissed`);
|
|
212
|
+
} catch (err) {
|
|
213
|
+
toast?.(err.message, 6000);
|
|
214
|
+
}
|
|
215
|
+
return load();
|
|
216
|
+
}
|
|
217
|
+
if (b === 'copy') {
|
|
218
|
+
try {
|
|
219
|
+
const { markdown } = await api('GET', `/issues?group=${encodeURIComponent(filter)}&format=markdown`);
|
|
220
|
+
await navigator.clipboard.writeText(markdown);
|
|
221
|
+
toast?.('Copied as a Markdown table');
|
|
222
|
+
} catch (err) {
|
|
223
|
+
toast?.(`Couldn't copy: ${err.message}`, 5000);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
function open() {
|
|
229
|
+
if (dialog.open) return dialog.close();
|
|
230
|
+
dialog.showModal();
|
|
231
|
+
render();
|
|
232
|
+
load();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** An agent changed: look again shortly while open, and now and then for the count. */
|
|
236
|
+
function changed() {
|
|
237
|
+
// Closed: one look at most every half minute, however busy the agents are.
|
|
238
|
+
if (!dialog.open && again) return;
|
|
239
|
+
clearTimeout(again);
|
|
240
|
+
const wait = dialog.open ? 1500 : Math.max(5000, 30_000 - (Date.now() - loadedAt));
|
|
241
|
+
again = setTimeout(() => {
|
|
242
|
+
again = null;
|
|
243
|
+
load({ quiet: true });
|
|
244
|
+
}, wait);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
load({ quiet: true });
|
|
248
|
+
/** What the table knows about an agent's issue: its key and design doc summary. */
|
|
249
|
+
const about = (agentId) => {
|
|
250
|
+
const r = data?.rows.find((x) => x.agent?.id === agentId);
|
|
251
|
+
return r ? { issueKey: r.key, designSummary: r.design?.summary ?? null } : {};
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
return { open, changed, about, isOpen: () => dialog.open };
|
|
255
|
+
}
|
package/public/keys.js
CHANGED
|
@@ -16,6 +16,11 @@ export const SHORTCUTS = [
|
|
|
16
16
|
[['a'], 'Ask Agent (a general session)', 'ask'],
|
|
17
17
|
[['/'], 'Filter agents', 'filter'],
|
|
18
18
|
[['w'], 'Watch: agents side by side', 'watch'],
|
|
19
|
+
[['p'], 'Play the standup', 'standup'],
|
|
20
|
+
[['m'], 'Map: where agents are in the code', 'map'],
|
|
21
|
+
[['i'], 'Jira: issues waiting for your review', 'issues'],
|
|
22
|
+
[['d'], 'Designs: agents\' design docs', 'designs'],
|
|
23
|
+
[['v'], 'Value: what the work is worth', 'value'],
|
|
19
24
|
[['1'], 'Agents tab', 'tab:agents'],
|
|
20
25
|
[['2'], 'Inbox: what needs you', 'tab:inbox'],
|
|
21
26
|
[['3'], 'Backlog', 'tab:backlog'],
|
|
@@ -34,11 +39,11 @@ export const SHORTCUTS = [
|
|
|
34
39
|
// A single key, as an event names it, to its action.
|
|
35
40
|
export const SINGLE = {
|
|
36
41
|
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',
|
|
42
|
+
r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', p: 'standup', m: 'map', i: 'issues', d: 'designs', v: 'value', '?': 'help',
|
|
38
43
|
1: 'tab:agents', 2: 'tab:inbox', 3: 'tab:backlog', 4: 'tab:land', 5: 'tab:built',
|
|
39
44
|
};
|
|
40
45
|
// While Watch is open: only what makes sense there.
|
|
41
|
-
const ON_WATCH = new Set(['new', 'ask', 'watch', 'help']);
|
|
46
|
+
const ON_WATCH = new Set(['new', 'ask', 'watch', 'standup', 'map', 'issues', 'designs', 'value', 'help']);
|
|
42
47
|
|
|
43
48
|
/** Typing somewhere: a field, an editor or a terminal (xterm types through a textarea). */
|
|
44
49
|
const typing = (el) => Boolean(el?.closest?.('input, textarea, select, [contenteditable=""], [contenteditable="true"], .xterm, .cm-editor'));
|
|
@@ -77,7 +82,7 @@ export function initKeys({ $, esc, run }) {
|
|
|
77
82
|
// An open dialog has the keyboard; ? still closes the shortcuts one.
|
|
78
83
|
if (document.querySelector('dialog[open]') && !(dialog.open && e.key === '?')) return;
|
|
79
84
|
const act = SINGLE[e.key];
|
|
80
|
-
if (!act || (document.body.classList.contains('watching') && !ON_WATCH.has(act))
|
|
85
|
+
if (!act || (document.body.classList.contains('watching') || document.body.classList.contains('mapping')) && !ON_WATCH.has(act)) return;
|
|
81
86
|
if (act === 'help') {
|
|
82
87
|
e.preventDefault();
|
|
83
88
|
return help();
|
package/public/land.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Land tab: every agent's open pull request, grouped by what it needs to get merged, with
|
|
2
2
|
// Review, Update, Ask to fix and Merge. Settings for sending failures back to agents at the bottom.
|
|
3
3
|
|
|
4
|
+
import { listenHtml } from './speak.js';
|
|
4
5
|
const SHORT = { ready: 'ready', fix: 'to fix', behind: 'behind', waiting: 'waiting', draft: 'draft' };
|
|
5
6
|
const GROUPS = [
|
|
6
7
|
['ready', 'Ready to merge'],
|
|
@@ -55,6 +56,7 @@ export function initLand({ api, esc, toast, agents, $, scoreBadge = () => '', se
|
|
|
55
56
|
<div class="land-chips">${scoreBadge(a.docs?.scorecard, esc)} ${prChips(pr, esc)}</div>
|
|
56
57
|
<div class="bl-actions">
|
|
57
58
|
<button class="small" data-land="review" title="Its diff, line comments for the agent, commit and push">Review</button>
|
|
59
|
+
${listenHtml(`prvoice:${a.id}`, { title: 'Explain the review aloud: the PR, its checks, the AI review, the riskiest changes and what is left', label: 'Explain' })}
|
|
58
60
|
${land === 'behind' || pr.mergeable === 'CONFLICTING' ? '<button class="small" data-land="update" title="Merge the base branch in here (when the agent is idle and its work is committed) and push; otherwise, or on conflicts, ask the agent">Update</button>' : ''}
|
|
59
61
|
${canFix ? '<button class="small" data-land="fix" title="Send the failures, requested changes or conflicts to the agent">Ask to fix</button>' : ''}
|
|
60
62
|
${land === 'ready' ? '<button class="small primary" data-land="merge">Merge</button>' : ''}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Explain the review, by voice: a short spoken briefing on an agent's pull request for the person
|
|
2
|
+
// about to review it. What the work is, the PR and its checks, what the AI review found, the
|
|
3
|
+
// riskiest changes, and what's left before it can merge. Built from what the page already has,
|
|
4
|
+
// so it starts at once; the change-by-change walkthrough in Review goes deeper.
|
|
5
|
+
|
|
6
|
+
import { speakable } from './speak.js';
|
|
7
|
+
|
|
8
|
+
const VERDICT = { complete: 'complete', partial: 'partly done', not_done: 'not done' };
|
|
9
|
+
const list = (xs, n = 3) => {
|
|
10
|
+
const items = xs.filter(Boolean).slice(0, n);
|
|
11
|
+
if (items.length <= 1) return items.join('');
|
|
12
|
+
if (items.length === 2) return items.join(' and ');
|
|
13
|
+
return `${items.slice(0, -1).join('; ')}; and ${items.at(-1)}`;
|
|
14
|
+
};
|
|
15
|
+
/** "a, b and c": for short items inside a sentence. */
|
|
16
|
+
const and = (xs) => (xs.length <= 1 ? xs.join('') : `${xs.slice(0, -1).join(', ')} and ${xs.at(-1)}`);
|
|
17
|
+
const said = (s) => speakable(String(s ?? '')).replace(/\s+/g, ' ').trim();
|
|
18
|
+
// One stop at the end, and none after a question mark.
|
|
19
|
+
const sentence = (s) => {
|
|
20
|
+
const t = said(s);
|
|
21
|
+
return !t ? '' : /[.?!]$/.test(t) ? t : `${t}.`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** The pull request a review is about: the agent's newest open one, else its newest. */
|
|
25
|
+
export function reviewedPr(a) {
|
|
26
|
+
const prs = (a.prs ?? []).filter((p) => p.source !== 'mentioned' && p.state);
|
|
27
|
+
return prs.filter((p) => p.state === 'OPEN').at(-1) ?? prs.at(-1) ?? null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** The PR's state in words: "is open, checks pass, no review yet". */
|
|
31
|
+
function prState(p) {
|
|
32
|
+
if (p.state === 'MERGED') return 'is merged';
|
|
33
|
+
if (p.state === 'CLOSED') return 'was closed without merging';
|
|
34
|
+
const out = [p.isDraft ? 'is a draft' : 'is open'];
|
|
35
|
+
const checks = p.checks?.state;
|
|
36
|
+
if (checks === 'passed') out.push('checks pass');
|
|
37
|
+
else if (checks === 'failed') out.push(`checks fail${p.checks.failed?.length ? ` (${and(p.checks.failed.slice(0, 3).map((c) => c.name ?? c))})` : ''}`);
|
|
38
|
+
else if (checks === 'running') out.push('checks are still running');
|
|
39
|
+
if (p.mergeable === 'CONFLICTING' || p.mergeState === 'DIRTY') out.push('it has merge conflicts');
|
|
40
|
+
else if (p.mergeState === 'BEHIND') out.push("it's behind its base branch");
|
|
41
|
+
if (p.review === 'APPROVED') out.push("it's approved");
|
|
42
|
+
else if (p.review === 'CHANGES_REQUESTED') out.push('changes were requested');
|
|
43
|
+
else out.push('no review yet');
|
|
44
|
+
return out.length <= 1 ? out.join('') : `${out.slice(0, -1).join(', ')}, and ${out.at(-1)}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** What's left before it can merge, as one sentence. */
|
|
48
|
+
function nextStep(a, p) {
|
|
49
|
+
if (!p) return a.results?.outcome === 'done' ? 'There is no pull request: the agent says it is done, so review its changes in the session.' : 'There is no pull request yet.';
|
|
50
|
+
if (p.state === 'MERGED') return 'Nothing left: it is merged.';
|
|
51
|
+
if (p.state === 'CLOSED') return 'Nothing left on this pull request.';
|
|
52
|
+
if (p.isDraft) return 'It is still a draft: the agent is working on it.';
|
|
53
|
+
if (p.checks?.state === 'failed') return 'Next: the failing checks need fixing; ask the agent to fix them from Land.';
|
|
54
|
+
if (p.mergeable === 'CONFLICTING' || p.mergeState === 'DIRTY') return 'Next: the merge conflicts need resolving; Update in Land, or ask the agent.';
|
|
55
|
+
if (p.review === 'CHANGES_REQUESTED') return a.runtime?.busy ? 'The agent is working on the requested changes.' : 'Changes were requested and the agent is idle: send them to it.';
|
|
56
|
+
if (p.review === 'APPROVED') return 'Next: merge it when you are ready.';
|
|
57
|
+
return 'Next: your review. Open Review to go through each change, then approve or ask for changes.';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The briefing as parts to speak. `designSummary` is the summary from the agent's design doc, when
|
|
62
|
+
* the page has it; `issueKey` names the issue.
|
|
63
|
+
*/
|
|
64
|
+
export function reviewSpeech(a, { designSummary = null, issueKey = null } = {}) {
|
|
65
|
+
if (!a) return [];
|
|
66
|
+
const p = reviewedPr(a);
|
|
67
|
+
const key = issueKey ?? a.synopsis?.key ?? null;
|
|
68
|
+
const what = a.synopsis?.text ?? String(a.intent ?? '').split('\n')[0].replace(/^<?https?:\/\/\S+>?\s*/, '');
|
|
69
|
+
const parts = [];
|
|
70
|
+
parts.push(sentence(`Review of ${key ? `${key}, ` : ''}${what || a.name}`));
|
|
71
|
+
if (p) parts.push(sentence(`Pull request ${p.number ?? ''}${p.title ? `, ${p.title},` : ''} ${prState(p)}`));
|
|
72
|
+
// What it does: the design doc's summary, else the walkthrough's, else the agent's own words.
|
|
73
|
+
const walk = a.docs?.walkthrough?.data;
|
|
74
|
+
// (Only what the agent wrote: the tracked PR is said above.)
|
|
75
|
+
const does = designSummary || walk?.summary || (a.results?.delivered ?? []).filter((d) => d.source === 'agent').slice(0, 2).map((d) => d.text).join('. ');
|
|
76
|
+
if (does) parts.push(sentence(`What it does: ${does}`));
|
|
77
|
+
const r = a.aiReview;
|
|
78
|
+
if (r?.verdict) {
|
|
79
|
+
parts.push(sentence(`The AI review says it is ${VERDICT[r.verdict] ?? r.verdict}. ${r.summary ?? ''}`));
|
|
80
|
+
if (r.met?.length) parts.push(sentence(`Met: ${list(r.met)}`));
|
|
81
|
+
if (r.missing?.length) parts.push(sentence(`Missing: ${list(r.missing)}`));
|
|
82
|
+
if (r.risks?.length) parts.push(sentence(`Risks: ${list(r.risks)}`));
|
|
83
|
+
} else {
|
|
84
|
+
parts.push('There is no AI review yet; Review with AI checks the work against the request.');
|
|
85
|
+
}
|
|
86
|
+
if (walk?.changes?.length) {
|
|
87
|
+
const high = walk.changes.filter((c) => c.risk === 'high');
|
|
88
|
+
const n = walk.changes.length;
|
|
89
|
+
parts.push(
|
|
90
|
+
sentence(
|
|
91
|
+
high.length
|
|
92
|
+
? `The walkthrough has ${n} change${n === 1 ? '' : 's'}; ${high.length} ${high.length === 1 ? 'is' : 'are'} high risk: ${list(high.map((c) => `${c.title}, in ${String(c.file).split('/').pop()}`))}`
|
|
93
|
+
: `The walkthrough has ${n} change${n === 1 ? '' : 's'}, none high risk`,
|
|
94
|
+
),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
const blockers = (a.results?.blockers ?? []).filter((b) => b.source === 'agent').map((b) => b.text);
|
|
98
|
+
if (blockers.length) parts.push(sentence(`The agent is blocked: ${list(blockers, 2)}`));
|
|
99
|
+
const open = (a.questions ?? []).filter((q) => !q.answer).map((q) => q.question);
|
|
100
|
+
if (open.length) parts.push(sentence(`It asks you: ${list(open, 2)}`));
|
|
101
|
+
parts.push(nextStep(a, p));
|
|
102
|
+
return parts.filter(Boolean);
|
|
103
|
+
}
|