ai-agentmanager 1.22.0 → 1.24.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 +16 -0
- package/README.md +22 -0
- package/package.json +1 -1
- package/public/app.js +30 -3
- package/public/diagram.js +38 -0
- package/public/index.html +4 -0
- package/public/issues.js +65 -28
- package/public/keys.js +3 -2
- package/public/reviews.js +318 -0
- package/public/share.js +3 -2
- package/public/speak.js +69 -2
- package/public/standup.js +30 -9
- package/public/style.css +49 -1
- package/src/assistant.js +6 -3
- package/src/cli.js +83 -2
- package/src/issues.js +141 -20
- package/src/jira.js +75 -2
- package/src/manager.js +31 -11
- package/src/reviews.js +359 -0
- package/src/server.js +27 -2
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
// Reviews: pull requests you review. Reviewer agents read someone else's change, ask the critical
|
|
2
|
+
// questions and find what blocks approval; you pick what to send and post it as a pending review
|
|
3
|
+
// under your name (or copy it). PRs where your review is requested and no reviewer has started
|
|
4
|
+
// come first, with a box to tick.
|
|
5
|
+
|
|
6
|
+
import { listenHtml, speakable } from './speak.js';
|
|
7
|
+
|
|
8
|
+
const VERDICT = { approve: ['Approve', 'ok'], approve_with_nits: ['Approve with nits', 'ok'], blocked: ['Blocked', 'bad'] };
|
|
9
|
+
const CHECKS = { passed: ['✓', 'Checks pass'], failed: ['✗', 'Checks failing'], running: ['●', 'Checks running'] };
|
|
10
|
+
const CATEGORY = { correctness: 'Correctness', security: 'Security', data: 'Data', breaking: 'Breaking change', tests: 'Tests', performance: 'Performance', design: 'Design', other: 'Other' };
|
|
11
|
+
|
|
12
|
+
/** The verdict, blockers and questions as parts to read aloud. */
|
|
13
|
+
export function reviewerSpeech(row) {
|
|
14
|
+
const r = row?.review;
|
|
15
|
+
if (!r) return [];
|
|
16
|
+
const said = (s) => speakable(String(s ?? '')).replace(/\s+/g, ' ').trim();
|
|
17
|
+
const open = r.blockers.filter((b) => b.status === 'open');
|
|
18
|
+
const parts = [said(`Review of pull request ${row.pr.number}${row.pr.title ? `, ${row.pr.title}` : ''}. Verdict: ${VERDICT[r.verdict]?.[0] ?? 'none yet'}. ${r.why}`)];
|
|
19
|
+
if (r.summary) parts.push(said(`What it does: ${r.summary}`));
|
|
20
|
+
if (open.length) parts.push(said(`${open.length} blocker${open.length === 1 ? '' : 's'}.`), ...open.slice(0, 5).map((b, i) => said(`${i + 1}: ${b.title}. ${b.why}`)));
|
|
21
|
+
const resolved = r.blockers.length - open.length;
|
|
22
|
+
if (resolved) parts.push(`${resolved} earlier blocker${resolved === 1 ? ' is' : 's are'} resolved.`);
|
|
23
|
+
if (r.questions.length) parts.push(said(`Questions for the author: ${r.questions.slice(0, 4).map((q) => q.question).join(' ')}`));
|
|
24
|
+
if (row.stale) parts.push('The author pushed since this review; the reviewer is checking again.');
|
|
25
|
+
return parts.filter(Boolean);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function initReviews({ api, $, esc, ago, openAgent, toast }) {
|
|
29
|
+
const dialog = $('#reviews-dialog');
|
|
30
|
+
const body = $('#reviews-body');
|
|
31
|
+
const ext = (label, url, title = '') => `<a href="${esc(url)}" target="_blank" rel="noopener" title="${esc(title)}">${esc(label)} ↗</a>`;
|
|
32
|
+
let rows = null;
|
|
33
|
+
let loading = false;
|
|
34
|
+
let loadedAt = 0;
|
|
35
|
+
let again = null;
|
|
36
|
+
let openId = null;
|
|
37
|
+
// The open review's items picked to send, by agent id.
|
|
38
|
+
const picks = new Map();
|
|
39
|
+
// Requested PRs ticked to start a reviewer, by URL.
|
|
40
|
+
const ticked = new Set();
|
|
41
|
+
let busy = false;
|
|
42
|
+
|
|
43
|
+
async function load({ quiet = false, fresh = false } = {}) {
|
|
44
|
+
if (loading) return;
|
|
45
|
+
loading = true;
|
|
46
|
+
try {
|
|
47
|
+
rows = (await api('GET', `/reviews${fresh ? '?fresh=1' : ''}`)).rows;
|
|
48
|
+
loadedAt = Date.now();
|
|
49
|
+
} catch (e) {
|
|
50
|
+
if (!quiet) toast?.(e.message, 5000);
|
|
51
|
+
} finally {
|
|
52
|
+
loading = false;
|
|
53
|
+
}
|
|
54
|
+
badge();
|
|
55
|
+
render();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** The button's count: requests with no reviewer, blocked reviews, and ones the author pushed to. */
|
|
59
|
+
function badge() {
|
|
60
|
+
const n = rows ? rows.filter((r) => !r.agent || r.stale || r.review?.verdict).filter((r) => !r.posted || r.stale).length : 0;
|
|
61
|
+
const el = $('#reviews-count');
|
|
62
|
+
if (el) {
|
|
63
|
+
el.textContent = n ? String(n) : '';
|
|
64
|
+
el.title = n ? `${n} pull request${n === 1 ? '' : 's'} to look at` : '';
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const prLabel = (r) => `${r.pr.repo ? `${esc(r.pr.repo)}` : ''}#${esc(r.pr.number)}`;
|
|
69
|
+
|
|
70
|
+
function verdictHtml(r) {
|
|
71
|
+
if (!r.agent) return '<span class="verdict new">Requested</span>';
|
|
72
|
+
const v = r.review?.verdict;
|
|
73
|
+
if (!v) return `<span class="verdict wait">${r.agent.busy || r.status === 'reviewing' ? 'Reviewing…' : 'No review yet'}</span>`;
|
|
74
|
+
const n = r.review.openBlockers;
|
|
75
|
+
return `<span class="verdict ${VERDICT[v][1]}">${VERDICT[v][0]}${n ? `: ${n} blocker${n === 1 ? '' : 's'}` : ''}</span>`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function defaults(r) {
|
|
79
|
+
if (!picks.has(r.agent.id)) picks.set(r.agent.id, new Set([...r.review.blockers.filter((b) => b.status === 'open').map((b) => b.id), ...r.review.questions.map((q) => q.id)]));
|
|
80
|
+
return picks.get(r.agent.id);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const where = (x) => (x.file ? `<code class="rv-where">${esc(x.file)}${x.line ? `:${esc(x.line)}` : ''}</code>` : '');
|
|
84
|
+
const box = (id, picked, label) => `<input type="checkbox" data-rv-pick="${esc(id)}" ${picked.has(id) ? 'checked' : ''} aria-label="Send: ${esc(label)}" />`;
|
|
85
|
+
|
|
86
|
+
function detail(r) {
|
|
87
|
+
const rv = r.review;
|
|
88
|
+
if (!rv) return `<p class="hint">The reviewer is reading the change. Its blockers and questions show here when it has written them.</p>`;
|
|
89
|
+
const picked = defaults(r);
|
|
90
|
+
const blockers = rv.blockers.map(
|
|
91
|
+
(b) => `<li class="rv-item ${b.status}">
|
|
92
|
+
${b.status === 'open' ? box(b.id, picked, b.title) : '<span class="rv-done" title="Resolved">✓</span>'}
|
|
93
|
+
<div><strong>${esc(b.title)}</strong> <span class="rv-cat">${esc(CATEGORY[b.category] ?? b.category)}</span> ${where(b)}${b.status === 'resolved' ? ' <span class="hint">resolved</span>' : ''}
|
|
94
|
+
<p>${esc(b.why)}</p>${b.unblock ? `<p class="hint">To resolve: ${esc(b.unblock)}</p>` : ''}</div></li>`,
|
|
95
|
+
);
|
|
96
|
+
const questions = rv.questions.map((q) => `<li class="rv-item">${box(q.id, picked, q.question)}<div>${esc(q.question)} ${where(q)}${q.why ? `<p class="hint">${esc(q.why)}</p>` : ''}</div></li>`);
|
|
97
|
+
const nits = rv.nits.map((n) => `<li class="rv-item">${box(n.id, picked, n.text)}<div>${esc(n.text)} ${where(n)}</div></li>`);
|
|
98
|
+
const plain = (title, xs) => (xs.length ? `<h4>${title}</h4><ul class="rv-plain">${xs.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>` : '');
|
|
99
|
+
const posted = r.posted ? `<p class="hint">Posted ${esc(ago(r.posted.at))} as a pending review: ${ext('finish it on GitHub', r.posted.url)}${r.posted.moved ? ` (${r.posted.moved} line comment(s) went in the body)` : ''}</p>` : '';
|
|
100
|
+
return `
|
|
101
|
+
<p class="rv-why"><strong>${esc(VERDICT[rv.verdict]?.[0] ?? 'No verdict yet')}.</strong> ${esc(rv.why)}</p>
|
|
102
|
+
${rv.summary ? `<p>${esc(rv.summary)}</p>` : ''}
|
|
103
|
+
${r.stale ? '<p class="rv-stale">The author pushed since this review. The reviewer has been told to check again.</p>' : ''}
|
|
104
|
+
${blockers.length ? `<h4>Blockers</h4><ul class="rv-list">${blockers.join('')}</ul>` : '<h4>Blockers</h4><p class="hint">None found.</p>'}
|
|
105
|
+
${questions.length ? `<h4>Questions for the author</h4><ul class="rv-list">${questions.join('')}</ul>` : ''}
|
|
106
|
+
${plain('Risks', rv.risks)}
|
|
107
|
+
${plain('Test gaps', rv.testGaps)}
|
|
108
|
+
${nits.length ? `<h4>Nits</h4><ul class="rv-list">${nits.join('')}</ul>` : ''}
|
|
109
|
+
${rv.tests ? `<h4>Tests</h4><p>${esc(rv.tests)}</p>` : ''}
|
|
110
|
+
${posted}
|
|
111
|
+
<div class="rv-actions">
|
|
112
|
+
<button class="primary small" data-rv="post" ${picked.size && !busy ? '' : 'disabled'} title="Create a pending review on GitHub, under your name, with the ticked items. Nothing is visible to the author until you submit it there.">Post ${picked.size} as pending review</button>
|
|
113
|
+
<button class="small" data-rv="copy" title="Copy the ticked items as Markdown">Copy</button>
|
|
114
|
+
${listenHtml(`reviewer:${r.agent.id}`, { title: 'Read the verdict, blockers and questions aloud', label: 'Explain' })}
|
|
115
|
+
</div>`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function card(r) {
|
|
119
|
+
const check = r.pr.checks?.state && CHECKS[r.pr.checks.state] ? ` <span class="checks ${esc(r.pr.checks.state)}" title="${CHECKS[r.pr.checks.state][1]}">${CHECKS[r.pr.checks.state][0]}</span>` : '';
|
|
120
|
+
const state = r.pr.state && r.pr.state !== 'OPEN' ? ` <span class="hint">${esc(r.pr.state.toLowerCase())}</span>` : r.pr.isDraft ? ' <span class="hint">draft</span>' : '';
|
|
121
|
+
if (!r.agent) {
|
|
122
|
+
return `<article class="rv-card requested ${ticked.has(r.pr.url) ? 'ticked' : ''}">
|
|
123
|
+
<header>
|
|
124
|
+
<input type="checkbox" data-rv-start="${esc(r.pr.url)}" ${ticked.has(r.pr.url) ? 'checked' : ''} aria-label="Start a reviewer for ${esc(r.pr.title ?? r.pr.url)}" />
|
|
125
|
+
<h3>${ext(`${r.pr.repo ?? ''}#${r.pr.number}`, r.pr.url)} ${esc(r.pr.title ?? '')}</h3>
|
|
126
|
+
${verdictHtml(r)}
|
|
127
|
+
</header>
|
|
128
|
+
<div class="design-meta"><span class="hint">${r.pr.author ? `by ${esc(r.pr.author)} · ` : ''}your review is requested · ${esc(ago(r.updatedAt))}</span></div>
|
|
129
|
+
</article>`;
|
|
130
|
+
}
|
|
131
|
+
const isOpen = openId === r.agent.id;
|
|
132
|
+
const dot = r.agent.busy ? '<span class="dot busy" title="Working"></span>' : r.agent.running ? '<span class="dot idle" title="Session open"></span>' : '';
|
|
133
|
+
return `<article class="rv-card ${esc(r.review?.verdict ?? 'pending')} ${r.stale ? 'stale' : ''}">
|
|
134
|
+
<header data-rv-toggle="${esc(r.agent.id)}" role="button" tabindex="0" aria-expanded="${isOpen}">
|
|
135
|
+
<span class="rv-caret">${isOpen ? '▾' : '▸'}</span>
|
|
136
|
+
<h3>${prLabel(r)} ${esc(r.pr.title ?? '')}${check}${state}</h3>
|
|
137
|
+
${r.stale ? '<span class="verdict wait" title="The author pushed since this review">New commits</span>' : ''}
|
|
138
|
+
${r.posted ? '<span class="hint">posted</span>' : ''}
|
|
139
|
+
${verdictHtml(r)}
|
|
140
|
+
</header>
|
|
141
|
+
<div class="design-meta">
|
|
142
|
+
${ext('Pull request', r.pr.url)}
|
|
143
|
+
<button class="link" data-rv-open="${esc(r.agent.id)}" title="Open the reviewer's session: ask it about the change">${dot}${esc(r.agent.name)}</button>
|
|
144
|
+
${r.review ? `<span class="hint">${r.review.questions.length} question${r.review.questions.length === 1 ? '' : 's'} · ${esc(ago(r.updatedAt))}</span>` : ''}
|
|
145
|
+
</div>
|
|
146
|
+
${isOpen ? `<div class="rv-detail">${detail(r)}</div>` : ''}
|
|
147
|
+
</article>`;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function render() {
|
|
151
|
+
if (!dialog.open) return;
|
|
152
|
+
if (!rows) {
|
|
153
|
+
body.innerHTML = '<p class="hint">Loading…</p>';
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const requested = rows.filter((r) => !r.agent);
|
|
157
|
+
const mine = rows.filter((r) => r.agent);
|
|
158
|
+
const focused = document.activeElement?.dataset?.rv === 'url' ? document.activeElement.value : null;
|
|
159
|
+
body.innerHTML = `
|
|
160
|
+
<div class="issues-head">
|
|
161
|
+
<h2>Reviews</h2>
|
|
162
|
+
<form class="rv-new" data-rv-form>
|
|
163
|
+
<input type="url" data-rv="url" placeholder="Pull request link to review" aria-label="Pull request link" required />
|
|
164
|
+
<button class="small primary" type="submit" title="Start a reviewer agent: it reads the change and finds what blocks approval; nothing is posted">Review</button>
|
|
165
|
+
</form>
|
|
166
|
+
<span class="spacer"></span>
|
|
167
|
+
<button class="small" data-rv="refresh" title="Look again now, including GitHub">↻</button>
|
|
168
|
+
<button class="small" data-rv="close" title="Close (Esc)">Close</button>
|
|
169
|
+
</div>
|
|
170
|
+
${requested.length ? `<div class="issues-pickbar"><span>${requested.length} pull request${requested.length === 1 ? '' : 's'} where your review is requested.</span>
|
|
171
|
+
<button class="small primary" data-rv="start" ${ticked.size && !busy ? '' : 'disabled'}>Review ${ticked.size || ''} with agents</button>
|
|
172
|
+
<button class="small" data-rv="dismiss" ${ticked.size && !busy ? '' : 'disabled'} title="Take the ticked ones off this list">Dismiss</button></div>` : ''}
|
|
173
|
+
${rows.length ? `<div class="designs-list">${[...requested, ...mine].map(card).join('')}</div>` : '<p class="hint issues-empty">No reviews yet. Paste a pull request link above, or turn on "GitHub reviews" in Assistant to find the ones where your review is requested.</p>'}`;
|
|
174
|
+
if (focused !== null) {
|
|
175
|
+
const u = body.querySelector('[data-rv="url"]');
|
|
176
|
+
u.value = focused;
|
|
177
|
+
u.focus();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const rowOf = (id) => rows?.find((r) => r.agent?.id === id) ?? null;
|
|
182
|
+
|
|
183
|
+
async function copy(r) {
|
|
184
|
+
const picked = picks.get(r.agent.id) ?? new Set();
|
|
185
|
+
const rv = r.review;
|
|
186
|
+
const lines = [`Review of ${r.pr.url}`, `${VERDICT[rv.verdict]?.[0] ?? ''}: ${rv.why}`];
|
|
187
|
+
for (const b of rv.blockers.filter((x) => picked.has(x.id))) lines.push(`- **Blocker: ${b.title}**${b.file ? ` (\`${b.file}${b.line ? `:${b.line}` : ''}\`)` : ''}: ${b.why}${b.unblock ? ` To resolve: ${b.unblock}` : ''}`);
|
|
188
|
+
for (const q of rv.questions.filter((x) => picked.has(x.id))) lines.push(`- **Question:** ${q.question}${q.file ? ` (\`${q.file}${q.line ? `:${q.line}` : ''}\`)` : ''}`);
|
|
189
|
+
for (const n of rv.nits.filter((x) => picked.has(x.id))) lines.push(`- Nit: ${n.text}${n.file ? ` (\`${n.file}${n.line ? `:${n.line}` : ''}\`)` : ''}`);
|
|
190
|
+
try {
|
|
191
|
+
await navigator.clipboard.writeText(lines.join('\n'));
|
|
192
|
+
toast?.('Copied as Markdown');
|
|
193
|
+
} catch (e) {
|
|
194
|
+
toast?.(`Couldn't copy: ${e.message}`, 5000);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
body.addEventListener('submit', async (e) => {
|
|
199
|
+
if (!e.target.matches('[data-rv-form]')) return;
|
|
200
|
+
e.preventDefault();
|
|
201
|
+
const url = body.querySelector('[data-rv="url"]').value.trim();
|
|
202
|
+
try {
|
|
203
|
+
const a = await api('POST', '/reviews', { url });
|
|
204
|
+
toast?.(`Reviewer ${a.name} started`);
|
|
205
|
+
openId = a.id;
|
|
206
|
+
await load();
|
|
207
|
+
} catch (err) {
|
|
208
|
+
toast?.(err.message, 6000);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
body.addEventListener('change', (e) => {
|
|
213
|
+
const s = e.target.closest('[data-rv-start]');
|
|
214
|
+
if (s) {
|
|
215
|
+
if (s.checked) ticked.add(s.dataset.rvStart);
|
|
216
|
+
else ticked.delete(s.dataset.rvStart);
|
|
217
|
+
return render();
|
|
218
|
+
}
|
|
219
|
+
const p = e.target.closest('[data-rv-pick]');
|
|
220
|
+
if (p && openId) {
|
|
221
|
+
const set = picks.get(openId) ?? new Set();
|
|
222
|
+
if (p.checked) set.add(p.dataset.rvPick);
|
|
223
|
+
else set.delete(p.dataset.rvPick);
|
|
224
|
+
picks.set(openId, set);
|
|
225
|
+
render();
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
const toggle = (id) => {
|
|
230
|
+
openId = openId === id ? null : id;
|
|
231
|
+
render();
|
|
232
|
+
};
|
|
233
|
+
body.addEventListener('keydown', (e) => {
|
|
234
|
+
const t = e.target.closest('[data-rv-toggle]');
|
|
235
|
+
if (t && (e.key === 'Enter' || e.key === ' ')) {
|
|
236
|
+
e.preventDefault();
|
|
237
|
+
toggle(t.dataset.rvToggle);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
body.addEventListener('click', async (e) => {
|
|
242
|
+
const o = e.target.closest('[data-rv-open]');
|
|
243
|
+
if (o) {
|
|
244
|
+
dialog.close();
|
|
245
|
+
return openAgent(o.dataset.rvOpen);
|
|
246
|
+
}
|
|
247
|
+
// Links, boxes and Listen do their own thing.
|
|
248
|
+
if (e.target.closest('a, input, [data-say]')) return;
|
|
249
|
+
const t = e.target.closest('[data-rv-toggle]');
|
|
250
|
+
if (t) return toggle(t.dataset.rvToggle);
|
|
251
|
+
const b = e.target.closest('[data-rv]')?.dataset.rv;
|
|
252
|
+
if (b === 'close') return dialog.close();
|
|
253
|
+
if (b === 'refresh') return load({ fresh: true });
|
|
254
|
+
if (b === 'start' || b === 'dismiss') {
|
|
255
|
+
busy = true;
|
|
256
|
+
render();
|
|
257
|
+
const urls = [...ticked];
|
|
258
|
+
try {
|
|
259
|
+
if (b === 'dismiss') {
|
|
260
|
+
await api('POST', '/reviews/dismiss', { urls });
|
|
261
|
+
} else {
|
|
262
|
+
const failed = [];
|
|
263
|
+
for (const url of urls) {
|
|
264
|
+
try {
|
|
265
|
+
await api('POST', '/reviews', { url });
|
|
266
|
+
} catch (err) {
|
|
267
|
+
failed.push(err.message);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
toast?.(failed.length ? `Started ${urls.length - failed.length}; ${failed.join('; ')}` : `Started ${urls.length} reviewer${urls.length === 1 ? '' : 's'}`, failed.length ? 7000 : 3000);
|
|
271
|
+
}
|
|
272
|
+
ticked.clear();
|
|
273
|
+
} finally {
|
|
274
|
+
busy = false;
|
|
275
|
+
await load();
|
|
276
|
+
}
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const r = rowOf(openId);
|
|
280
|
+
if (!r?.review) return;
|
|
281
|
+
if (b === 'copy') return copy(r);
|
|
282
|
+
if (b === 'post') {
|
|
283
|
+
busy = true;
|
|
284
|
+
render();
|
|
285
|
+
try {
|
|
286
|
+
const res = await api('POST', `/reviews/${r.agent.id}/post`, { ids: [...(picks.get(r.agent.id) ?? [])] });
|
|
287
|
+
toast?.(`Pending review created with ${res.ids.length} item${res.ids.length === 1 ? '' : 's'}: submit it on GitHub`, 6000);
|
|
288
|
+
window.open(res.url, '_blank', 'noopener');
|
|
289
|
+
} catch (err) {
|
|
290
|
+
toast?.(err.message, 7000);
|
|
291
|
+
} finally {
|
|
292
|
+
busy = false;
|
|
293
|
+
await load();
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
function open() {
|
|
299
|
+
if (dialog.open) return dialog.close();
|
|
300
|
+
dialog.showModal();
|
|
301
|
+
render();
|
|
302
|
+
load();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/** An agent changed: look again shortly while open, and now and then for the count. */
|
|
306
|
+
function changed() {
|
|
307
|
+
if (!dialog.open && again) return;
|
|
308
|
+
clearTimeout(again);
|
|
309
|
+
const wait = dialog.open ? 1500 : Math.max(5000, 60_000 - (Date.now() - loadedAt));
|
|
310
|
+
again = setTimeout(() => {
|
|
311
|
+
again = null;
|
|
312
|
+
load({ quiet: true });
|
|
313
|
+
}, wait);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
load({ quiet: true });
|
|
317
|
+
return { open, changed, isOpen: () => dialog.open, speech: (id) => reviewerSpeech(rowOf(id)), show: (id) => ((openId = id), dialog.open ? render() : open()) };
|
|
318
|
+
}
|
package/public/share.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Print-ready view of one agent document: /share.html#<agent id>/<analysis|design|flow|proposal>
|
|
2
2
|
import { marked } from '/vendor/marked/marked.esm.js';
|
|
3
3
|
import DOMPurify from '/vendor/dompurify/purify.es.mjs';
|
|
4
|
+
import { drawDiagram } from '/diagram.js';
|
|
4
5
|
|
|
5
6
|
const $ = (s) => document.querySelector(s);
|
|
6
7
|
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
@@ -24,10 +25,10 @@ async function main() {
|
|
|
24
25
|
document.title = (d.markdown.match(/^#\s+(.+)$/m)?.[1] ?? `${kind} · ${a.name}`).slice(0, 120);
|
|
25
26
|
if (blocks.length) {
|
|
26
27
|
const mermaid = (await import('/vendor/mermaid/mermaid.esm.min.mjs')).default;
|
|
27
|
-
mermaid.initialize({ startOnLoad: false, securityLevel: 'strict', theme: 'default', htmlLabels: false, flowchart: { htmlLabels: false } });
|
|
28
|
+
mermaid.initialize({ startOnLoad: false, suppressErrorRendering: true, securityLevel: 'strict', theme: 'default', htmlLabels: false, flowchart: { htmlLabels: false } });
|
|
28
29
|
for (const el of document.querySelectorAll('.diagram')) {
|
|
29
30
|
try {
|
|
30
|
-
el.innerHTML = (await mermaid
|
|
31
|
+
el.innerHTML = (await drawDiagram(mermaid, `d${el.dataset.i}`, blocks[Number(el.dataset.i)])).svg;
|
|
31
32
|
} catch {
|
|
32
33
|
el.innerHTML = `<pre>${esc(blocks[Number(el.dataset.i)])}</pre>`;
|
|
33
34
|
}
|
package/public/speak.js
CHANGED
|
@@ -1,9 +1,72 @@
|
|
|
1
1
|
// Listening instead of reading: Explain, the documents and the change walkthrough read aloud with
|
|
2
|
-
// the browser's own speech (
|
|
2
|
+
// the browser's own speech (on-device voices only unless you pick an online one; it works on
|
|
3
|
+
// phones). The clearest voice here is used, never the robotic or novelty ones. Text goes in short
|
|
3
4
|
// pieces, since some browsers stop a long utterance partway. One thing plays at a time.
|
|
4
5
|
|
|
5
6
|
const RATES = [0.85, 1, 1.25, 1.5, 1.75];
|
|
6
7
|
const RATE_KEY = 'agentmgr.speechRate';
|
|
8
|
+
const VOICE_KEY = 'agentmgr.voice';
|
|
9
|
+
|
|
10
|
+
// Voices that sound robotic or are made for fun: macOS's old and Eloquence voices, and its
|
|
11
|
+
// novelty ones. Not used unless chosen by name.
|
|
12
|
+
const ROBOTIC = /^(Albert|Bad News|Bahh|Bells|Boing|Bruce|Bubbles|Cellos|Deranged|Eddy|Flo|Fred|Good News|Grandma|Grandpa|Hysterical|Jester|Junior|Kathy|Organ|Pipe Organ|Princess|Ralph|Reed|Rocko|Sandy|Shelley|Superstar|Trinoids|Vicki|Victoria|Whisper|Wobble|Zarvox)\b/i;
|
|
13
|
+
// Clear, natural voices: the downloadable high-quality ones, Siri's, Edge's neural and Google's.
|
|
14
|
+
const NATURAL = /\b(Premium|Enhanced|Siri|Natural|Neural|Online)\b|^Google /i;
|
|
15
|
+
const CLEAR = /^(Samantha|Alex|Ava|Allison|Susan|Tom|Karen|Daniel|Moira|Tessa|Serena|Zoe|Evan|Nathan|Joelle|Noelle|Aaron|Nicky|Rishi|Veena|Lee)\b/i;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* How good a voice sounds for reading aloud in `lang` ("en-US"); below 0 means don't use it.
|
|
19
|
+
* Online voices (Chrome's Google ones) send the text to their maker, so they count only when
|
|
20
|
+
* `online` (you pick one by name).
|
|
21
|
+
*/
|
|
22
|
+
export function voiceScore(v, lang = 'en-US', { online = false } = {}) {
|
|
23
|
+
const want = String(lang).toLowerCase();
|
|
24
|
+
const have = String(v?.lang ?? '').toLowerCase().replace('_', '-');
|
|
25
|
+
if (!have.startsWith(want.slice(0, 2)) || ROBOTIC.test(v.name ?? '')) return -1;
|
|
26
|
+
if (v.localService === false && !online) return -1;
|
|
27
|
+
return (NATURAL.test(v.name) ? 6 : 0) + (CLEAR.test(v.name) ? 3 : 0) + (have === want ? 2 : 0) + (v.default ? 1 : 0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** The voices worth using for `lang`, best first. */
|
|
31
|
+
export function rankVoices(voices = [], lang = 'en-US', opts = {}) {
|
|
32
|
+
return voices
|
|
33
|
+
.map((v) => ({ v, s: voiceScore(v, lang, opts) }))
|
|
34
|
+
.filter((x) => x.s >= 0)
|
|
35
|
+
.sort((a, b) => b.s - a.s || String(a.v.name).localeCompare(String(b.v.name)))
|
|
36
|
+
.map((x) => x.v);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const lang = () => (typeof navigator !== 'undefined' && navigator.language) || 'en-US';
|
|
40
|
+
|
|
41
|
+
/** This browser's good voices for the page's language, best first (`online`: those too). */
|
|
42
|
+
export function goodVoices(opts = {}) {
|
|
43
|
+
return canSpeak() ? rankVoices(speechSynthesis.getVoices(), lang(), opts) : [];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** The voice you picked (by name), or null for "the best one here". */
|
|
47
|
+
export function chosenVoice() {
|
|
48
|
+
try {
|
|
49
|
+
return localStorage.getItem(VOICE_KEY) || null;
|
|
50
|
+
} catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function setVoice(name) {
|
|
56
|
+
try {
|
|
57
|
+
if (name) localStorage.setItem(VOICE_KEY, name);
|
|
58
|
+
else localStorage.removeItem(VOICE_KEY);
|
|
59
|
+
} catch {}
|
|
60
|
+
notify();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The voice to read with when none is given: yours, else the best one here. */
|
|
64
|
+
export function preferredVoice() {
|
|
65
|
+
if (!canSpeak()) return null;
|
|
66
|
+
const name = chosenVoice();
|
|
67
|
+
const all = speechSynthesis.getVoices();
|
|
68
|
+
return (name && all.find((v) => v.name === name)) || goodVoices()[0] || null;
|
|
69
|
+
}
|
|
7
70
|
|
|
8
71
|
export const canSpeak = () => typeof window !== 'undefined' && 'speechSynthesis' in window && 'SpeechSynthesisUtterance' in window;
|
|
9
72
|
|
|
@@ -60,7 +123,11 @@ function playNext() {
|
|
|
60
123
|
const part = s.parts[s.i];
|
|
61
124
|
const u = new SpeechSynthesisUtterance(part.text);
|
|
62
125
|
u.rate = rate();
|
|
63
|
-
|
|
126
|
+
const voice = part.voice ?? preferredVoice();
|
|
127
|
+
if (voice) {
|
|
128
|
+
u.voice = voice;
|
|
129
|
+
u.lang = voice.lang;
|
|
130
|
+
}
|
|
64
131
|
u.onstart = () => part.onStart?.();
|
|
65
132
|
u.onend = () => {
|
|
66
133
|
if (session !== s || s.paused) return;
|
package/public/standup.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// When an agent needs you it stops on it with its questions beside it, answered by tap (the
|
|
3
3
|
// inbox's own cards) or, when turned on, by voice: what you say is read back and sent on "send".
|
|
4
4
|
|
|
5
|
-
import { canSpeak, cycleRate, pause, play, rateLabel, resume, stop, now as speaking } from '/speak.js';
|
|
5
|
+
import { canSpeak, chosenVoice, cycleRate, goodVoices, voiceScore, pause, play, rateLabel, resume, setVoice, speakable, stop, now as speaking } from '/speak.js';
|
|
6
6
|
import { choiceFor } from '/voice.js';
|
|
7
7
|
|
|
8
8
|
const VOICE_KEY = 'agentmgr.standupVoice';
|
|
9
9
|
const PLAY_ID = 'standup';
|
|
10
10
|
const Recognition = typeof window !== 'undefined' ? window.SpeechRecognition || window.webkitSpeechRecognition : null;
|
|
11
11
|
|
|
12
|
-
//
|
|
13
|
-
const
|
|
12
|
+
// Agents take turns among this many of the best voices (fewer when fewer sound good).
|
|
13
|
+
const MIXED = 4;
|
|
14
14
|
const hash = (s) => [...String(s)].reduce((h, c) => (h * 31 + c.charCodeAt(0)) >>> 0, 7);
|
|
15
15
|
export function initStandup({ api, $, esc, agents, needsFor, needCard, onNeed, toast, openAgent }) {
|
|
16
16
|
const dialog = $('#standup-dialog');
|
|
@@ -26,18 +26,29 @@ export function initStandup({ api, $, esc, agents, needsFor, needCard, onNeed, t
|
|
|
26
26
|
voiceOn = localStorage.getItem(VOICE_KEY) === '1';
|
|
27
27
|
} catch {}
|
|
28
28
|
|
|
29
|
-
// Each agent keeps one
|
|
29
|
+
// Each agent keeps one of the few best voices here, unless you picked one voice for all; robotic
|
|
30
|
+
// and novelty voices are never used. The intro uses the best one (or yours).
|
|
30
31
|
let voices = [];
|
|
32
|
+
let pickable = [];
|
|
31
33
|
const loadVoices = () => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
voices = goodVoices();
|
|
35
|
+
pickable = goodVoices({ online: true }).slice(0, 15);
|
|
36
|
+
if (dialog.open) render();
|
|
35
37
|
};
|
|
36
38
|
if (canSpeak()) {
|
|
37
39
|
loadVoices();
|
|
38
40
|
speechSynthesis.addEventListener?.('voiceschanged', loadVoices);
|
|
39
41
|
}
|
|
40
|
-
const voiceFor = (id) =>
|
|
42
|
+
const voiceFor = (id) => {
|
|
43
|
+
if (chosenVoice()) return null;
|
|
44
|
+
// Only voices about as good as the best: a mix that includes a poor one sounds worse than one voice.
|
|
45
|
+
const lang = navigator.language || 'en-US';
|
|
46
|
+
const top = voices[0] ? voiceScore(voices[0], lang) : 0;
|
|
47
|
+
const best = voices.slice(0, MIXED).filter((v) => voiceScore(v, lang) >= top - 2);
|
|
48
|
+
return best.length > 1 ? best[hash(id) % best.length] : null;
|
|
49
|
+
};
|
|
50
|
+
// Names as they'd be said: "WEB-41" → "WEB 41", "fix-login-timeout" → "fix login timeout".
|
|
51
|
+
const sayName = (name) => String(name ?? '').replace(/[-_/]+/g, ' ');
|
|
41
52
|
|
|
42
53
|
const items = () => latest?.items ?? [];
|
|
43
54
|
const current = () => items()[idx] ?? null;
|
|
@@ -106,7 +117,7 @@ export function initStandup({ api, $, esc, agents, needsFor, needCard, onNeed, t
|
|
|
106
117
|
return play(PLAY_ID, ["That's everything."], {});
|
|
107
118
|
}
|
|
108
119
|
const it = current();
|
|
109
|
-
const text = it ? `${it.name}. ${it.text}` : latest?.intro ?? '';
|
|
120
|
+
const text = speakable(it ? `${sayName(it.name)}. ${it.text}` : latest?.intro ?? '');
|
|
110
121
|
state = 'playing';
|
|
111
122
|
render();
|
|
112
123
|
const started = play(PLAY_ID, [{ text, voice: it ? voiceFor(it.agentId) : null }], {
|
|
@@ -268,6 +279,10 @@ export function initStandup({ api, $, esc, agents, needsFor, needCard, onNeed, t
|
|
|
268
279
|
<button class="primary" data-su="play" title="${playingNow ? 'Pause' : 'Play'}" ${canSpeak() ? '' : 'disabled'}>${playingNow ? '⏸' : '▶'}</button>
|
|
269
280
|
<button data-su="next" title="Next" ${idx >= list.length ? 'disabled' : ''}>⏭</button>
|
|
270
281
|
<button class="small" data-su="rate" title="Speed">${esc(rateLabel())}</button>
|
|
282
|
+
${pickable.length ? `<select class="small standup-voice-pick" data-su-voice title="Voice: a mix of the best voices here, or one for everything read aloud" aria-label="Voice">
|
|
283
|
+
<option value="" ${chosenVoice() ? '' : 'selected'}>Best voices</option>
|
|
284
|
+
${pickable.map((v) => `<option value="${esc(v.name)}" ${chosenVoice() === v.name ? 'selected' : ''}>${esc(v.name)}${v.localService === false ? ' · online' : ''}</option>`).join('')}
|
|
285
|
+
</select>` : ''}
|
|
271
286
|
<span class="spacer"></span>
|
|
272
287
|
${Recognition ? `<label class="check" title="Answer agents by speaking. Your browser may send the audio to its maker to turn it into text."><input type="checkbox" data-su="voice" ${voiceOn ? 'checked' : ''}> Answer by voice</label>` : ''}
|
|
273
288
|
</div>
|
|
@@ -309,6 +324,12 @@ export function initStandup({ api, $, esc, agents, needsFor, needCard, onNeed, t
|
|
|
309
324
|
}
|
|
310
325
|
});
|
|
311
326
|
body.addEventListener('change', async (e) => {
|
|
327
|
+
if (e.target.dataset.suVoice !== undefined) {
|
|
328
|
+
setVoice(e.target.value || null);
|
|
329
|
+
// Hear it right away.
|
|
330
|
+
if (state !== 'playing') play(PLAY_ID, [`This is how the standup sounds.`], {});
|
|
331
|
+
return render();
|
|
332
|
+
}
|
|
312
333
|
if (e.target.dataset.su === 'voice') {
|
|
313
334
|
voiceOn = e.target.checked;
|
|
314
335
|
try {
|
package/public/style.css
CHANGED
|
@@ -1067,6 +1067,8 @@ kbd { display: inline-block; min-width: 1.6em; padding: 1px 5px; border: 1px sol
|
|
|
1067
1067
|
.standup-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 16px; }
|
|
1068
1068
|
.standup-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
|
|
1069
1069
|
.standup-top .spacer, .standup-controls .spacer { flex: 1; }
|
|
1070
|
+
.standup-controls .standup-voice-pick { width: auto; max-width: 170px; flex: none; font-size: 12px; padding: 3px 6px; }
|
|
1071
|
+
.standup-controls label.check input[type="checkbox"] { width: auto; flex: none; }
|
|
1070
1072
|
.standup-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
|
|
1071
1073
|
.standup-chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1072
1074
|
.standup-chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
|
|
@@ -1144,6 +1146,14 @@ table.issues td { padding: 7px 10px; border-bottom: 1px solid var(--border); ver
|
|
|
1144
1146
|
table.issues tr:last-child td { border-bottom: 0; }
|
|
1145
1147
|
table.issues .issue-key { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
|
|
1146
1148
|
table.issues .issue-title { max-width: 360px; color: var(--text); }
|
|
1149
|
+
table.issues .issue-synopsis { max-width: 420px; margin-top: 2px; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
1150
|
+
table.issues .issue-action { width: 1%; white-space: nowrap; }
|
|
1151
|
+
table.issues .issue-type { font-size: 10px; font-weight: 600; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); white-space: nowrap; }
|
|
1152
|
+
table.issues .issue-action select { width: auto; font-size: 12px; padding: 2px 4px; }
|
|
1153
|
+
table.issues select.act-skip { color: var(--yellow); }
|
|
1154
|
+
table.issues select.act-done { color: var(--green); }
|
|
1155
|
+
table.issues select.act-remove { color: var(--red); }
|
|
1156
|
+
table.issues tr.action-skip td:not(.issue-action), table.issues tr.action-remove td:not(.issue-action) { opacity: 0.65; }
|
|
1147
1157
|
table.issues tr td:first-child { border-left: 3px solid transparent; }
|
|
1148
1158
|
table.issues tr.stage-review td:first-child, table.issues tr.stage-approved td:first-child { border-left-color: var(--green); }
|
|
1149
1159
|
table.issues tr.stage-needs td:first-child, table.issues tr.stage-blocked td:first-child { border-left-color: var(--red); }
|
|
@@ -1163,7 +1173,7 @@ table.issues .dot.idle { background: var(--muted); }
|
|
|
1163
1173
|
@media (max-width: 640px) {
|
|
1164
1174
|
.issues-dialog { width: calc(100% - 32px); padding: 12px; }
|
|
1165
1175
|
table.issues .col-active { display: none; }
|
|
1166
|
-
table.issues .issue-title { max-width: 200px; }
|
|
1176
|
+
table.issues .issue-title, table.issues .issue-synopsis { max-width: 200px; }
|
|
1167
1177
|
}
|
|
1168
1178
|
|
|
1169
1179
|
/* ---------- Designs: agents' design docs */
|
|
@@ -1230,3 +1240,41 @@ table.value-items tr.value-edit td { background: var(--panel-2); }
|
|
|
1230
1240
|
.value-report-kinds { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
|
|
1231
1241
|
.value-report-kinds input[type="time"] { width: auto; }
|
|
1232
1242
|
input.inline { width: 64px; display: inline-block; padding: 2px 4px; }
|
|
1243
|
+
|
|
1244
|
+
/* ---------- Reviews: other people's pull requests, reviewed by agents */
|
|
1245
|
+
.rv-new { display: flex; gap: 6px; flex: 1; min-width: 220px; max-width: 460px; }
|
|
1246
|
+
.rv-new input { flex: 1; min-width: 0; }
|
|
1247
|
+
.rv-card { border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: var(--panel); }
|
|
1248
|
+
.rv-card.blocked { border-left-color: var(--red); }
|
|
1249
|
+
.rv-card.approve, .rv-card.approve_with_nits { border-left-color: var(--green); }
|
|
1250
|
+
.rv-card.requested, .rv-card.stale { border-left-color: var(--yellow); }
|
|
1251
|
+
.rv-card.ticked { background: color-mix(in srgb, var(--yellow) 8%, var(--panel)); }
|
|
1252
|
+
.rv-card header { display: flex; align-items: baseline; gap: 10px; }
|
|
1253
|
+
.rv-card header[data-rv-toggle] { cursor: pointer; }
|
|
1254
|
+
.rv-card h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|
1255
|
+
.rv-caret { color: var(--muted); width: 10px; }
|
|
1256
|
+
.verdict { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; white-space: nowrap; border: 1px solid currentColor; }
|
|
1257
|
+
.verdict.ok { color: var(--green); }
|
|
1258
|
+
.verdict.bad { color: var(--red); }
|
|
1259
|
+
.verdict.wait, .verdict.new { color: var(--yellow); }
|
|
1260
|
+
.rv-detail { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; font-size: 14px; line-height: 1.45; }
|
|
1261
|
+
.rv-detail h4 { margin: 12px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
|
|
1262
|
+
.rv-detail p { margin: 4px 0; }
|
|
1263
|
+
.rv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
|
1264
|
+
.rv-item { display: flex; gap: 8px; align-items: flex-start; }
|
|
1265
|
+
.rv-item input { margin-top: 4px; }
|
|
1266
|
+
.rv-item.resolved { opacity: .65; }
|
|
1267
|
+
.rv-item.resolved strong { text-decoration: line-through; }
|
|
1268
|
+
.rv-done { color: var(--green); width: 13px; }
|
|
1269
|
+
.rv-cat { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; }
|
|
1270
|
+
.rv-where { font-size: 12px; }
|
|
1271
|
+
.rv-plain { margin: 0; padding-left: 20px; }
|
|
1272
|
+
.rv-stale { color: var(--yellow); font-weight: 600; }
|
|
1273
|
+
.rv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
|
|
1274
|
+
@media (max-width: 640px) {
|
|
1275
|
+
.rv-new { max-width: none; order: 10; flex-basis: 100%; }
|
|
1276
|
+
.rv-card header { flex-wrap: wrap; }
|
|
1277
|
+
.rv-card.requested header { flex-wrap: nowrap; }
|
|
1278
|
+
}
|
|
1279
|
+
.rv-card input[type="checkbox"] { width: auto; flex: none; margin: 0; }
|
|
1280
|
+
.rv-item input[type="checkbox"] { margin-top: 4px; }
|
package/src/assistant.js
CHANGED
|
@@ -63,14 +63,14 @@ export function assistantPrompt(s, dir, bin = `node ${BIN}`) {
|
|
|
63
63
|
const pick =
|
|
64
64
|
`Don't start agents for new issues: the person picks which ones get agents. Propose each one you haven't handled instead: ${am} issues propose @<project> "<the issue link> <a one-line summary of what to do>". ` +
|
|
65
65
|
`It is listed for them under Jira, Not started, and an agent starts only if they tick it. Record it as "proposed". ` +
|
|
66
|
-
`A proposal for an issue they
|
|
66
|
+
`A proposal for an issue they skipped, marked done or removed, or one that already has an agent, is refused: record it as skipped and don't propose it again.`;
|
|
67
67
|
if (s.sources.includes('jira')) {
|
|
68
68
|
how.push(
|
|
69
69
|
`Jira, new assignments: with your Jira / Atlassian tools, find unresolved issues assigned to the person that were created or assigned since your last check (on the first check, the last 2 days). ` +
|
|
70
70
|
(s.pickIssues
|
|
71
71
|
? pick
|
|
72
72
|
: `For each one you haven't handled, start an agent: ${am} add @<project> "<the issue link> <a one-line summary of what to do>". ` +
|
|
73
|
-
`Start the request with the issue link: the agent is then named after the issue key, and the daemon refuses a second agent for the same key.`),
|
|
73
|
+
`Start the request with the issue link: the agent is then named after the issue key, and the daemon refuses a second agent for the same key, or one for an issue the person skipped, marked done or removed under Jira (record those as skipped).`),
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
if (s.sources.includes('linear')) {
|
|
@@ -93,7 +93,10 @@ export function assistantPrompt(s, dir, bin = `node ${BIN}`) {
|
|
|
93
93
|
if (s.sources.includes('reviews')) {
|
|
94
94
|
how.push(
|
|
95
95
|
`GitHub reviews: gh search prs --review-requested=@me --state=open --json url,title,repository,updatedAt. ` +
|
|
96
|
-
|
|
96
|
+
(s.pickIssues
|
|
97
|
+
? `Don't start reviewers: the person picks. These pull requests are listed for them under Reviews, where they start a reviewer with one click. Record them as "listed".`
|
|
98
|
+
: `For each pull request you haven't handled, start a reviewer agent: ${am} review <the PR link>. It reviews the change read-only, writes its blockers and questions for the person, and never posts on GitHub. ` +
|
|
99
|
+
`A second reviewer for the same pull request is refused: record it as skipped.`),
|
|
97
100
|
);
|
|
98
101
|
}
|
|
99
102
|
if (s.sources.includes('ci')) {
|