ai-agentmanager 1.24.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.25.0 (2026-11-06)
4
+
5
+ - **Actions: what's asked of you in Slack and in meeting notes, in one list.** The assistant reads your Slack messages and mentions and your meetings' Notes by Gemini on its checks, and lists what's asked of you (or what you agreed to do) with who asked, where (a link), when and any due date. Decide on each on the left (assign to an agent, skip, done, remove), kept across restarts and changeable any time; **Discuss** talks one through with Claude in a session of its own, which suggests what to do and drafts any reply, but never sends anything. Turn it on under Assistant (on by default for new and existing setups); `agentmgr actions` lists them.
6
+ - **Turn off what you don't use**: Settings → What you use has Jira, Slack and Meeting notes. Off, its list and button are hidden and the assistant stops looking there; changes reach a running assistant with its next check. Settings also has your name and email, so the assistant knows what's asked of you.
7
+ - **More keyboard shortcuts**: `o` Actions, `h` Assistant, `,` Settings. In the Jira and Actions lists, `j`/`k` move between rows, `a` `s` `d` `x` assign, skip, mark done or remove, `c` discusses an action, Enter opens the source, `[` `]` switch filters. In the standup, Space plays or pauses and ← → move between agents. `?` lists them all.
8
+
3
9
  ## 1.24.0 (2026-11-06)
4
10
 
5
11
  - **Your action on each Jira issue: assign, skip, done or remove.** A picker on the left of every issue in the Jira tab. Your choice is kept by the daemon, so a restart or an update doesn't ask again, and you can change it any time (a removed issue is under Removed, to bring back). Assign starts an agent for an issue not started yet. The assistant doesn't propose or start agents for issues you skipped, marked done or removed. Also `agentmgr issues set <assign|skip|done|remove|clear> <keys...>`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agentmanager",
3
- "version": "1.24.0",
3
+ "version": "1.25.0",
4
4
  "description": "Run background coding agents (Claude Code, Codex) per intent, and keep track of them from a web UI, your phone or the CLI",
5
5
  "keywords": [
6
6
  "claude",
@@ -0,0 +1,200 @@
1
+ // Actions: what's asked of you in Slack and in meeting notes (Notes by Gemini), found by the
2
+ // assistant on its checks, in one list so nothing is missed. Your decision on the left of each
3
+ // (assign to an agent, skip, done, remove) is kept by the daemon and can be changed any time;
4
+ // Discuss talks one through with Claude in a session of its own.
5
+
6
+ import { rowKeys } from './rowkeys.js';
7
+
8
+ const SAVED = 'agentmgr.actionsFilter';
9
+ const PROJECT = 'agentmgr.actionsProject';
10
+ const FILTERS = [
11
+ ['open', 'Open'],
12
+ ['assigned', 'Assigned'],
13
+ ['skipped', 'Skipped'],
14
+ ['done', 'Done'],
15
+ ['all', 'All'],
16
+ ['removed', 'Removed'],
17
+ ];
18
+ const STATES = [
19
+ ['open', '—', 'Not decided yet'],
20
+ ['assign', 'Assign', 'An agent does it (in the project picked above)'],
21
+ ['skip', 'Skip', 'Not now'],
22
+ ['done', 'Done', 'Handled'],
23
+ ['remove', 'Remove', 'Not mine, or not needed: off the list (under Removed)'],
24
+ ];
25
+ const ICON = { slack: '💬', gemini: '📝', other: '•' };
26
+
27
+ export function initActions({ api, $, esc, ago, toast, openAgent, projects = () => [] }) {
28
+ const dialog = $('#actions-dialog');
29
+ const body = $('#actions-body');
30
+ let data = null;
31
+ let filter = 'open';
32
+ let busy = false;
33
+ let project = '';
34
+ try {
35
+ filter = localStorage.getItem(SAVED) || 'open';
36
+ project = localStorage.getItem(PROJECT) || '';
37
+ } catch {}
38
+
39
+ async function load({ quiet = false } = {}) {
40
+ try {
41
+ data = await api('GET', '/actions');
42
+ } catch (e) {
43
+ if (!quiet) toast?.(e.message, 5000);
44
+ }
45
+ badge();
46
+ render();
47
+ }
48
+
49
+ function badge() {
50
+ const n = data ? data.rows.filter((r) => r.group === 'open').length : 0;
51
+ const el = $('#actions-count');
52
+ if (el) {
53
+ el.textContent = n ? String(n) : '';
54
+ el.title = n ? `${n} to decide on` : '';
55
+ }
56
+ const f = data?.features;
57
+ const btn = $('#actions-btn');
58
+ if (btn && f) btn.hidden = !f.slack && !f.gemini;
59
+ }
60
+
61
+ function row(r) {
62
+ const opts = STATES.map(([v, label, title]) => `<option value="${v}" title="${esc(title)}" ${r.status === v ? 'selected' : ''}>${label}</option>`).join('');
63
+ const where = r.link ? `<a href="${esc(r.link)}" target="_blank" rel="noopener" title="Open where it was asked">${esc(r.sourceLabel)} ↗</a>` : esc(r.sourceLabel);
64
+ const meta = [`${ICON[r.source] ?? '•'} ${where}`, r.from && `from <b>${esc(r.from)}</b>`, r.due && `<span class="action-due">due ${esc(r.due)}</span>`, `<span title="${esc(new Date(r.when).toLocaleString())}">${esc(ago(r.when))}</span>`].filter(Boolean).join(' · ');
65
+ const agent = r.agent ? `<button class="link" data-act-open="${esc(r.agent.id)}" title="Open the agent doing it">${esc(r.agent.name)}</button>` : '';
66
+ const talk = r.discussion
67
+ ? `<button class="small" data-act-open="${esc(r.discussion.id)}" title="Open the conversation about it">💬 Open talk</button>`
68
+ : `<button class="small" data-act-discuss="${esc(r.id)}" title="Talk it through with Claude: what it asks, and what to do (c)">💬 Discuss</button>`;
69
+ return `<tr data-row-id="${esc(r.id)}" class="action-${esc(r.status)}">
70
+ <td class="issue-action"><select data-act-state="${esc(r.id)}" class="act-${esc(r.status === 'assign' ? 'none' : r.status)}" aria-label="Your decision">${opts}</select></td>
71
+ <td><div class="action-text">${esc(r.text)}</div>${r.context ? `<div class="issue-synopsis" title="${esc(r.context)}">${esc(r.context)}</div>` : ''}<div class="hint action-meta">${meta}</div></td>
72
+ <td class="nowrap">${talk}${agent ? `<div class="hint">Agent: ${agent}</div>` : ''}</td>
73
+ </tr>`;
74
+ }
75
+
76
+ function render() {
77
+ if (!dialog.open) return;
78
+ if (!data) {
79
+ body.innerHTML = '<p class="hint">Loading…</p>';
80
+ return;
81
+ }
82
+ const inGroup = (r, g) => (g === 'all' ? r.group !== 'removed' : r.group === g);
83
+ const count = (g) => data.rows.filter((r) => inGroup(r, g)).length;
84
+ const rows = data.rows.filter((r) => inGroup(r, filter));
85
+ const f = data.features ?? {};
86
+ const from = [f.slack && 'Slack', f.gemini && 'meeting notes (Notes by Gemini)'].filter(Boolean).join(' and ');
87
+ const list = projects();
88
+ body.innerHTML = `
89
+ <div class="issues-head">
90
+ <h2>Actions</h2>
91
+ <div class="chips" role="tablist">${FILTERS.map(([k, label]) => `<button class="chip ${k === filter ? 'active' : ''}" role="tab" aria-selected="${k === filter}" data-act-filter="${k}">${label} <span class="count">${count(k)}</span></button>`).join('')}</div>
92
+ <span class="spacer"></span>
93
+ <label class="hint" title="Where an agent works when you assign an action to one">Agents in <select data-act-project class="small">
94
+ <option value="">pick a project</option>
95
+ ${list.map((p) => `<option value="${esc(p.key)}" ${p.key === project ? 'selected' : ''}>${esc(p.name ?? p.key)}</option>`).join('')}
96
+ </select></label>
97
+ <button class="small" data-act="refresh" title="Look again (r)">↻</button>
98
+ <button class="small" data-act="close" title="Close (Esc)">Close</button>
99
+ </div>
100
+ <p class="hint">What's asked of you in ${esc(from || 'Slack and meeting notes')}, found by the assistant on its checks. Decide on the left; <b>Discuss</b> talks one through with Claude. Keys: j/k move, a assign, s skip, d done, x remove, o open again, c discuss, Enter opens the source.</p>
101
+ ${rows.length
102
+ ? `<div class="issues-scroll"><table class="issues actions-table">
103
+ <thead><tr><th class="issue-action">Decision</th><th>Action</th><th></th></tr></thead>
104
+ <tbody>${rows.map(row).join('')}</tbody>
105
+ </table></div>`
106
+ : `<p class="hint issues-empty">${esc(
107
+ !data.rows.length
108
+ ? `Nothing yet. With the Assistant running and "Things asked of me in Slack and in meeting notes" on, what's asked of you shows up here after its next check (or: agentmgr actions add).`
109
+ : filter === 'open'
110
+ ? 'Nothing left to decide.'
111
+ : 'None here.',
112
+ )}</p>`}`;
113
+ keys.redraw();
114
+ }
115
+
116
+ async function set(ids, state) {
117
+ if (busy) return;
118
+ busy = true;
119
+ try {
120
+ const r = await api('POST', '/actions/set', { ids, state, project: project || null });
121
+ const bad = r.failed.map((x) => x.reason).join('; ');
122
+ const label = STATES.find(([v]) => v === state)?.[1] ?? state;
123
+ toast?.(r.started.length ? `Agent ${r.started.map((x) => x.agent.name).join(', ')} started` : bad ? `Not changed: ${bad}` : state === 'open' ? 'Open again' : label, bad ? 8000 : 2500);
124
+ } catch (err) {
125
+ toast?.(err.message, 6000);
126
+ } finally {
127
+ busy = false;
128
+ }
129
+ load();
130
+ }
131
+
132
+ async function discuss(id) {
133
+ try {
134
+ const r = await api('POST', `/actions/${id}/discuss`, {});
135
+ dialog.close();
136
+ openAgent(r.agent.id);
137
+ } catch (err) {
138
+ toast?.(err.message, 6000);
139
+ }
140
+ }
141
+
142
+ const keys = rowKeys(dialog, {
143
+ rows: () => [...body.querySelectorAll('tbody tr[data-row-id]')],
144
+ filters: () => [...body.querySelectorAll('[data-act-filter]')],
145
+ keys: {
146
+ a: (r) => set([r.dataset.rowId], 'assign'),
147
+ s: (r) => set([r.dataset.rowId], 'skip'),
148
+ d: (r) => set([r.dataset.rowId], 'done'),
149
+ x: (r) => set([r.dataset.rowId], 'remove'),
150
+ o: (r) => set([r.dataset.rowId], 'open'),
151
+ c: (r) => discuss(r.dataset.rowId),
152
+ Enter: (r) => r.querySelector('.action-meta a')?.click(),
153
+ r: Object.assign(() => load(), { needsRow: false }),
154
+ },
155
+ });
156
+
157
+ body.addEventListener('change', (e) => {
158
+ const id = e.target.dataset.actState;
159
+ if (id) return set([id], e.target.value);
160
+ if (e.target.dataset.actProject !== undefined) {
161
+ project = e.target.value;
162
+ try {
163
+ localStorage.setItem(PROJECT, project);
164
+ } catch {}
165
+ }
166
+ });
167
+
168
+ body.addEventListener('click', (e) => {
169
+ const o = e.target.closest('[data-act-open]');
170
+ if (o) {
171
+ dialog.close();
172
+ return openAgent(o.dataset.actOpen);
173
+ }
174
+ const t = e.target.closest('[data-act-discuss]');
175
+ if (t) return discuss(t.dataset.actDiscuss);
176
+ const f = e.target.closest('[data-act-filter]');
177
+ if (f) {
178
+ filter = f.dataset.actFilter;
179
+ try {
180
+ localStorage.setItem(SAVED, filter);
181
+ } catch {}
182
+ return render();
183
+ }
184
+ const b = e.target.closest('[data-act]')?.dataset.act;
185
+ if (b === 'close') return dialog.close();
186
+ if (b === 'refresh') return load();
187
+ });
188
+
189
+ function open() {
190
+ if (dialog.open) return dialog.close();
191
+ dialog.showModal();
192
+ render();
193
+ load();
194
+ }
195
+
196
+ load({ quiet: true });
197
+ // The assistant adds them on its checks: look now and then for the count.
198
+ setInterval(() => load({ quiet: true }), 2 * 60_000);
199
+ return { open, load, isOpen: () => dialog.open };
200
+ }
package/public/app.js CHANGED
@@ -26,6 +26,7 @@ import { initMachine } from '/machine.js';
26
26
  import { initWatch } from '/watch.js';
27
27
  import { initStandup } from '/standup.js';
28
28
  import { initIssues } from '/issues.js';
29
+ import { initActions } from '/actions.js';
29
30
  import { reviewSpeech } from '/prvoice.js';
30
31
  import { initDesigns } from '/designs.js';
31
32
  import { initReviews } from '/reviews.js';
@@ -221,6 +222,28 @@ const issuesUi = initIssues({
221
222
  openDoc: (id, kind) => (showTab('agents'), select(id), openDoc(id, kind)),
222
223
  });
223
224
  $('#issues-btn').onclick = () => issuesUi.open();
225
+ // Actions: what's asked of you in Slack and meeting notes.
226
+ const actionsUi = initActions({
227
+ api,
228
+ $,
229
+ esc,
230
+ ago,
231
+ toast: (m, ms) => toast(m, ms),
232
+ openAgent: (id) => (showTab('agents'), select(id)),
233
+ projects: () => projectsState.map((p) => ({ key: p.shortcut, name: p.name })),
234
+ });
235
+ $('#actions-btn').onclick = () => actionsUi.open();
236
+ // What you use (Settings): lists you turned off are hidden.
237
+ function applyFeatures(f) {
238
+ if (!f) return;
239
+ $('#issues-btn').hidden = !f.jira;
240
+ $('#actions-btn').hidden = !f.slack && !f.gemini;
241
+ }
242
+ api('GET', '/features').then((r) => applyFeatures(r.features)).catch(() => {});
243
+ document.addEventListener('agentmgr:features', (e) => {
244
+ applyFeatures(e.detail);
245
+ actionsUi.load();
246
+ });
224
247
  // Designs: every agent's design doc, the ones waiting for your review first.
225
248
  const designsUi = initDesigns({
226
249
  api,
@@ -279,7 +302,11 @@ function shortcut(act) {
279
302
  if (act === 'watch') return $('#watch-btn') ? $('#watch-btn').click() : false;
280
303
  if (act === 'standup') return standupUi.open();
281
304
  if (act === 'map') return $('#map-btn').click();
282
- if (act === 'issues') return issuesUi.open();
305
+ if (act === 'issues') return $('#issues-btn').hidden ? false : issuesUi.open();
306
+ if (act === 'actions') return $('#actions-btn').hidden ? false : actionsUi.open();
307
+ if (act === 'assistant') return $('#assistant-btn').click();
308
+ if (act === 'settings') return $('#settings-btn').click();
309
+ if (act === 'results') return $('#spend-btn').click();
283
310
  if (act === 'designs') return designsUi.open();
284
311
  if (act === 'reviews') return reviewsUi.open();
285
312
  if (act === 'value') return valueUi.open();
@@ -4544,7 +4571,7 @@ $('#edit-form').addEventListener('submit', async (e) => {
4544
4571
 
4545
4572
  // ------------------------------------------------------------------ assistant
4546
4573
 
4547
- const ASSISTANT_SOURCES = ['jira', 'comments', 'reviews', 'ci', 'slack', 'linear'];
4574
+ const ASSISTANT_SOURCES = ['jira', 'comments', 'reviews', 'ci', 'slack', 'linear', 'actions'];
4548
4575
  let assistantState = null;
4549
4576
 
4550
4577
  function renderAssistantDot() {
package/public/index.html CHANGED
@@ -32,6 +32,7 @@
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
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="actions-btn" title="Actions: what's asked of you in Slack and in meeting notes, found by the assistant; decide on each one">Actions <span id="actions-count" class="badge ready"></span></button>
35
36
  <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
37
  <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
38
  <button id="reviews-btn" title="Reviews: pull requests you review. Reviewer agents ask the critical questions and find what blocks approval; you post what you pick">Reviews <span id="reviews-count" class="badge ready"></span></button>
@@ -380,6 +381,9 @@
380
381
  </form>
381
382
  </dialog>
382
383
 
384
+ <dialog id="actions-dialog" class="issues-dialog" aria-label="Your action items">
385
+ <div id="actions-body"></div>
386
+ </dialog>
383
387
  <dialog id="issues-dialog" class="issues-dialog" aria-label="Jira issues">
384
388
  <div id="issues-body"></div>
385
389
  </dialog>
@@ -606,6 +610,7 @@
606
610
  <label class="check"><input type="checkbox" name="src_ci" /> Failing checks on my open pull requests</label>
607
611
  <label class="check"><input type="checkbox" name="src_slack" /> Slack messages to me that ask for work</label>
608
612
  <label class="check"><input type="checkbox" name="src_linear" /> Linear issues newly assigned to me</label>
613
+ <label class="check"><input type="checkbox" name="src_actions" /> Things asked of me in Slack and in meeting notes (Notes by Gemini), listed under <b>Actions</b></label>
609
614
  <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>
610
615
  </fieldset>
611
616
  <div class="row three">
@@ -854,6 +859,14 @@
854
859
  </div>
855
860
  <label class="check"><input type="checkbox" name="containerDefault" /> Run new agents in containers by default</label>
856
861
  </fieldset>
862
+ <fieldset id="settings-features">
863
+ <legend>What you use</legend>
864
+ <p class="hint">Turn off what you don't need: its list and button are hidden, and the assistant stops looking there. What's already listed is kept for when you turn it back on.</p>
865
+ <label class="check"><input type="checkbox" name="feat_jira" /> Jira: the issues assigned to you and the agents on them</label>
866
+ <label class="check"><input type="checkbox" name="feat_slack" /> Slack: work and action items from your messages</label>
867
+ <label class="check"><input type="checkbox" name="feat_gemini" /> Meeting notes: action items from Google Meet's Notes by Gemini</label>
868
+ <label>You <span class="hint">your name and work email(s), so the assistant finds what's asked of you; empty: from git config</span><input name="me" placeholder="Jane Doe, jane@company.com" autocomplete="off" /></label>
869
+ </fieldset>
857
870
  <fieldset class="local-only">
858
871
  <legend>Jira</legend>
859
872
  <p class="hint">For an agent created from a Jira link, its description shows the issue's summary. Public issues on Atlassian Cloud need nothing here; for your company's site, add it with your email and an <a href="https://id.atlassian.com/manage-profile/security/api-tokens" target="_blank" rel="noopener">API token</a>. The token is kept on this computer and sent only to that site.</p>
package/public/issues.js CHANGED
@@ -5,6 +5,7 @@
5
5
  // remove), kept by the daemon across restarts and updates, and changeable any time.
6
6
 
7
7
  import { listenHtml } from './speak.js';
8
+ import { rowKeys } from './rowkeys.js';
8
9
 
9
10
  const SAVED = 'agentmgr.issuesFilter';
10
11
  const FILTERS = [
@@ -89,7 +90,7 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
89
90
  : '<span class="hint">—</span>';
90
91
  if (!r.agent) {
91
92
  const by = !r.proposal ? 'assigned to you' : r.proposal.by === 'assistant' ? 'proposed by the assistant' : r.proposal.by === 'jira' ? 'assigned to you' : 'proposed';
92
- return `<tr class="stage-proposed ${ticked.has(r.key) ? 'ticked' : ''} ${r.action ? `action-${esc(r.action)}` : ''}">${box}${actionCell(r)}
93
+ return `<tr data-row-id="${esc(r.key)}" class="stage-proposed ${ticked.has(r.key) ? 'ticked' : ''} ${r.action ? `action-${esc(r.action)}` : ''}">${box}${actionCell(r)}
93
94
  <td>${issue}${aboutIssue(r)}</td>
94
95
  <td>${status}</td>
95
96
  <td class="issue-note">${esc(r.note)}</td>
@@ -112,7 +113,7 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
112
113
  const design = d
113
114
  ? [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(' · ')
114
115
  : '<span class="hint">—</span>';
115
- return `<tr class="stage-${esc(r.stage)} action-${esc(r.action)}">${box}${actionCell(r)}
116
+ return `<tr data-row-id="${esc(r.key)}" class="stage-${esc(r.stage)} action-${esc(r.action)}">${box}${actionCell(r)}
116
117
  <td>${issue}${aboutIssue(r)}</td>
117
118
  <td>${status}</td>
118
119
  <td class="issue-note">${esc(r.note)}</td>
@@ -174,7 +175,9 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
174
175
  <tbody>${rows.map((r) => row(r, boxes)).join('')}</tbody>
175
176
  </table></div>`
176
177
  : `<p class="hint issues-empty">${esc(empty)}</p>`}
178
+ ${rows.length ? '<p class="hint">Keys: j/k move, a assign, s skip, d done, x remove, o clear, Enter opens the issue, [ ] filters.</p>' : ''}
177
179
  ${data.jira.signedIn || !data.rows.length ? '' : '<p class="hint">Jira status shows for public issues only, and the issues assigned to you aren\'t listed, until you add your Jira site, email and API token in Settings → Jira.</p>'}`;
180
+ keys.redraw();
178
181
  }
179
182
 
180
183
  /** Set your action on issues; assign starts the agents of ones not started yet. */
@@ -192,6 +195,20 @@ export function initIssues({ api, $, esc, ago, openAgent, openDoc, toast }) {
192
195
  load();
193
196
  }
194
197
 
198
+ const keys = rowKeys(dialog, {
199
+ rows: () => [...body.querySelectorAll('tbody tr[data-row-id]')],
200
+ filters: () => [...body.querySelectorAll('[data-issues-filter]')],
201
+ keys: {
202
+ a: (r) => setAction([r.dataset.rowId], 'assign'),
203
+ s: (r) => setAction([r.dataset.rowId], 'skip'),
204
+ d: (r) => setAction([r.dataset.rowId], 'done'),
205
+ x: (r) => setAction([r.dataset.rowId], 'remove'),
206
+ o: (r) => setAction([r.dataset.rowId], null),
207
+ Enter: (r) => r.querySelector('a.issue-key')?.click(),
208
+ r: Object.assign(() => load({ fresh: true }), { needsRow: false }),
209
+ },
210
+ });
211
+
195
212
  body.addEventListener('change', (e) => {
196
213
  const act = e.target.dataset.issueAction;
197
214
  if (act) return setAction([act], e.target.value);
package/public/keys.js CHANGED
@@ -19,6 +19,9 @@ export const SHORTCUTS = [
19
19
  [['p'], 'Play the standup', 'standup'],
20
20
  [['m'], 'Map: where agents are in the code', 'map'],
21
21
  [['i'], 'Jira: issues waiting for your review', 'issues'],
22
+ [['o'], "Actions: what's asked of you in Slack and meetings", 'actions'],
23
+ [['h'], 'Assistant', 'assistant'],
24
+ [[','], 'Settings', 'settings'],
22
25
  [['d'], 'Designs: agents\' design docs', 'designs'],
23
26
  [['g'], 'Reviews: pull requests you review', 'reviews'],
24
27
  [['v'], 'Value: what the work is worth', 'value'],
@@ -29,6 +32,22 @@ export const SHORTCUTS = [
29
32
  [['5'], 'Built agents', 'tab:built'],
30
33
  [['?'], 'These shortcuts', 'help'],
31
34
  ]],
35
+ ['In the Jira and Actions lists', [
36
+ [['j', 'k'], 'Next / previous row', null],
37
+ [['[', ']'], 'Previous / next filter', null],
38
+ [['a'], 'Assign (starts an agent)', null],
39
+ [['s'], 'Skip', null],
40
+ [['d'], 'Done', null],
41
+ [['x'], 'Remove', null],
42
+ [['o'], 'Undecided again (Actions) or clear (Jira)', null],
43
+ [['c'], 'Discuss it with Claude (Actions)', null],
44
+ [['Enter'], 'Open the issue or where it was asked', null],
45
+ [['r'], 'Look again', null],
46
+ ]],
47
+ ['In the standup', [
48
+ [['Space'], 'Play or pause', null],
49
+ [['←', '→'], 'Previous / next agent', null],
50
+ ]],
32
51
  ['In a terminal', [
33
52
  [['Ctrl+Shift+↓'], "Next agent's terminal", 'next-term'],
34
53
  [['Ctrl+Shift+↑'], "Previous agent's terminal", 'prev-term'],
@@ -40,11 +59,11 @@ export const SHORTCUTS = [
40
59
  // A single key, as an event names it, to its action.
41
60
  export const SINGLE = {
42
61
  j: 'next', k: 'prev', Enter: 'terminal', t: 'terminal',
43
- r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', p: 'standup', m: 'map', i: 'issues', d: 'designs', g: 'reviews', v: 'value', '?': 'help',
62
+ r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', p: 'standup', m: 'map', i: 'issues', o: 'actions', h: 'assistant', ',': 'settings', d: 'designs', g: 'reviews', v: 'value', '?': 'help',
44
63
  1: 'tab:agents', 2: 'tab:inbox', 3: 'tab:backlog', 4: 'tab:land', 5: 'tab:built',
45
64
  };
46
65
  // While Watch is open: only what makes sense there.
47
- const ON_WATCH = new Set(['new', 'ask', 'watch', 'standup', 'map', 'issues', 'designs', 'reviews', 'value', 'help']);
66
+ const ON_WATCH = new Set(['new', 'ask', 'watch', 'standup', 'map', 'issues', 'actions', 'assistant', 'settings', 'designs', 'reviews', 'value', 'help']);
48
67
 
49
68
  /** Typing somewhere: a field, an editor or a terminal (xterm types through a textarea). */
50
69
  const typing = (el) => Boolean(el?.closest?.('input, textarea, select, [contenteditable=""], [contenteditable="true"], .xterm, .cm-editor'));
package/public/menu.js CHANGED
@@ -56,6 +56,8 @@ export function initMenu({ api, esc, toast, $ }) {
56
56
  let service = null; // the login service as the dialog opened
57
57
  let jira = null; // the Jira settings as the dialog opened
58
58
  let containers = null; // Docker and the agent image as the dialog opened
59
+ let features = null; // what you use, and who you are, as the dialog opened
60
+ const FEATURE_KEYS = ['jira', 'slack', 'gemini'];
59
61
  function showContainers() {
60
62
  const c = containers;
61
63
  $('#settings-containers').hidden = !c;
@@ -93,6 +95,10 @@ export function initMenu({ api, esc, toast, $ }) {
93
95
  $('#settings-running').textContent = `Open now: ${c.running}.`;
94
96
  service = null;
95
97
  showRules(await api('GET', '/rules').catch(() => null));
98
+ features = await api('GET', '/features').catch(() => null);
99
+ $('#settings-features').hidden = !features;
100
+ for (const k of FEATURE_KEYS) form[`feat_${k}`].checked = features?.features?.[k] !== false;
101
+ form.me.value = features?.me ?? '';
96
102
  const u = await api('GET', '/update').catch(() => null);
97
103
  form.updateCheck.checked = u?.check !== false;
98
104
  if (!remote()) {
@@ -145,6 +151,13 @@ export function initMenu({ api, esc, toast, $ }) {
145
151
  try {
146
152
  const c = await api('PUT', '/cleanup', { maxRunning: form.maxRunning.value.trim() || null });
147
153
  await api('PUT', '/update', { check: form.updateCheck.checked }).catch(() => {});
154
+ if (features) {
155
+ const want = Object.fromEntries(FEATURE_KEYS.map((k) => [k, form[`feat_${k}`].checked]));
156
+ if (FEATURE_KEYS.some((k) => want[k] !== features.features[k]) || form.me.value.trim() !== (features.me ?? '')) {
157
+ const r = await api('PUT', '/features', { features: want, me: form.me.value });
158
+ document.dispatchEvent(new CustomEvent('agentmgr:features', { detail: r.features }));
159
+ }
160
+ }
148
161
  if (!remote() && jira && (form.jiraSite.value.trim() !== (jira.site ?? '') || form.jiraEmail.value.trim() !== (jira.email ?? '') || form.jiraToken.value.trim())) {
149
162
  await api('PUT', '/jira', { site: form.jiraSite.value.trim(), email: form.jiraEmail.value.trim(), token: form.jiraToken.value.trim() || undefined });
150
163
  toast('Jira saved; summaries for agents from Jira links are being fetched', 4000);
@@ -0,0 +1,54 @@
1
+ // Keys inside a list dialog (Jira, Actions): j / k move between rows, [ and ] between filters,
2
+ // and the dialog's own keys act on the selected row. Not while typing in a field.
3
+
4
+ const typing = (el) => Boolean(el?.closest?.('input:not([type="checkbox"]), textarea, [contenteditable=""], [contenteditable="true"]'));
5
+
6
+ /**
7
+ * `rows()` gives the row elements in order; `keys` maps a key to (row) => void; `filters()` gives
8
+ * the filter buttons. The selected row is marked with the class "kb-on" and kept by `idOf(row)`.
9
+ */
10
+ export function rowKeys(dialog, { rows, keys = {}, filters = () => [], idOf = (r) => r.dataset.rowId }) {
11
+ let selected = null;
12
+ const mark = () => {
13
+ const list = rows();
14
+ let row = list.find((r) => idOf(r) === selected);
15
+ if (!row && selected !== null) row = list[0];
16
+ for (const r of list) r.classList.toggle('kb-on', r === row);
17
+ return row ?? null;
18
+ };
19
+ const move = (step) => {
20
+ const list = rows();
21
+ if (!list.length) return;
22
+ const i = list.findIndex((r) => idOf(r) === selected);
23
+ const next = list[Math.max(0, Math.min(list.length - 1, i < 0 ? 0 : i + step))];
24
+ selected = idOf(next);
25
+ mark();
26
+ next.scrollIntoView({ block: 'nearest' });
27
+ };
28
+ dialog.addEventListener('keydown', (e) => {
29
+ if (e.defaultPrevented || e.isComposing || e.metaKey || e.ctrlKey || e.altKey || typing(e.target)) return;
30
+ // A focused select or checkbox keeps its own arrow keys; ours are letters.
31
+ if (e.key === 'j' || e.key === 'k') {
32
+ e.preventDefault();
33
+ return move(e.key === 'j' ? 1 : -1);
34
+ }
35
+ if (e.key === '[' || e.key === ']') {
36
+ const fs = filters();
37
+ const i = fs.findIndex((f) => f.classList.contains('active'));
38
+ const next = fs[(i + (e.key === ']' ? 1 : -1) + fs.length) % fs.length];
39
+ if (next) {
40
+ e.preventDefault();
41
+ next.click();
42
+ }
43
+ return;
44
+ }
45
+ const fn = keys[e.key];
46
+ if (!fn) return;
47
+ const row = mark();
48
+ if (!row && fn.needsRow !== false) return;
49
+ e.preventDefault();
50
+ fn(row);
51
+ });
52
+ /** After the list is drawn again: keep the selection on the same row. */
53
+ return { redraw: mark, clear: () => (selected = null) };
54
+ }
package/public/standup.js CHANGED
@@ -294,6 +294,19 @@ export function initStandup({ api, $, esc, agents, needsFor, needCard, onNeed, t
294
294
  </details>` : ''}`;
295
295
  }
296
296
 
297
+ // Space plays or pauses, the arrows move between agents (not while typing an answer).
298
+ dialog.addEventListener('keydown', (e) => {
299
+ if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.altKey || e.target.closest?.('input:not([type="checkbox"]), textarea, select, [contenteditable]')) return;
300
+ if (e.key === ' ' && !e.target.closest?.('button')) {
301
+ e.preventDefault();
302
+ return toggle();
303
+ }
304
+ if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
305
+ e.preventDefault();
306
+ return playFrom(idx + (e.key === 'ArrowRight' ? 1 : -1));
307
+ }
308
+ });
309
+
297
310
  body.addEventListener('click', (e) => {
298
311
  if (e.target.closest('[data-need]')) return onNeed(e);
299
312
  const el = e.target.closest('[data-su]');
package/public/style.css CHANGED
@@ -1278,3 +1278,11 @@ input.inline { width: 64px; display: inline-block; padding: 2px 4px; }
1278
1278
  }
1279
1279
  .rv-card input[type="checkbox"] { width: auto; flex: none; margin: 0; }
1280
1280
  .rv-item input[type="checkbox"] { margin-top: 4px; }
1281
+
1282
+ /* ---------- Lists you move through with j / k (Jira, Actions) */
1283
+ table.issues tr.kb-on td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
1284
+ table.issues tr.kb-on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
1285
+ .actions-table .action-text { font-weight: 600; color: var(--text); }
1286
+ .actions-table .action-meta { margin-top: 3px; }
1287
+ .actions-table .action-due { color: var(--yellow); font-weight: 600; }
1288
+ .actions-table tr.action-skip td:not(.issue-action), .actions-table tr.action-remove td:not(.issue-action), .actions-table tr.action-done td:not(.issue-action) { opacity: 0.65; }
package/src/actions.js ADDED
@@ -0,0 +1,172 @@
1
+ // My actions: what's asked of you in Slack and in meeting notes (Google Meet's "Notes by Gemini"),
2
+ // found by the assistant on its checks and kept in one list, so nothing is missed or has to be
3
+ // remembered. Each one has your decision on it, as for Jira issues: assign (an agent does it),
4
+ // skip, done or remove, kept in state.json and changeable any time; Discuss opens a conversation
5
+ // about it. Nothing is ever sent to Slack or anywhere else from here.
6
+
7
+ import crypto from 'node:crypto';
8
+
9
+ export const ACTION_SOURCES = { slack: 'Slack', gemini: 'Meeting notes', other: 'Other' };
10
+ export const ACTION_STATES = ['open', 'assign', 'skip', 'done', 'remove'];
11
+ const GROUP = { open: 'open', assign: 'assigned', skip: 'skipped', done: 'done', remove: 'removed' };
12
+ const MAX = 500;
13
+ const err = (status, message) => Object.assign(new Error(message), { status });
14
+ const clip = (s, n) => {
15
+ const t = String(s ?? '').replace(/\s+/g, ' ').trim();
16
+ return t.length > n ? `${t.slice(0, n - 1)}…` : t;
17
+ };
18
+ const norm = (s) => String(s ?? '').toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim();
19
+
20
+ /** The request an agent gets when you assign an action to one. */
21
+ export function actionIntent(a) {
22
+ return [
23
+ a.text,
24
+ a.link ? `\nAsked in ${ACTION_SOURCES[a.source] ?? a.source}${a.from ? ` by ${a.from}` : ''}: ${a.link}` : a.from ? `\nAsked by ${a.from}.` : '',
25
+ a.due ? `Due: ${a.due}.` : '',
26
+ a.context ? `\nContext: ${a.context}` : '',
27
+ ]
28
+ .filter(Boolean)
29
+ .join('\n')
30
+ .trim();
31
+ }
32
+
33
+ /** What Discuss starts with: a conversation to decide what to do about the action. */
34
+ export function discussPrompt(a, bin = 'agentmgr') {
35
+ return [
36
+ `Help me decide what to do about something asked of me. Talk it through with me; don't act on your own.`,
37
+ '',
38
+ `The action: ${a.text}`,
39
+ a.from ? `Asked by: ${a.from}` : '',
40
+ a.link ? `Where: ${ACTION_SOURCES[a.source] ?? a.source}, ${a.link}` : `Where: ${ACTION_SOURCES[a.source] ?? a.source}`,
41
+ a.due ? `Due: ${a.due}` : '',
42
+ a.context ? `Context: ${a.context}` : '',
43
+ '',
44
+ `If you can, read the source first (your Slack or Google Drive tools) for the full picture. Then tell me in a few lines what it really asks and suggest one of: do it myself (with the steps), hand it to a coding agent (draft the request), reply or delegate (draft the message for me to send), or drop it (and why).`,
45
+ `Never send a message, comment or email yourself. When we've decided, record it: ${bin} actions set <done|skip|remove> ${a.id}, or ${bin} actions set assign ${a.id} --project <project> to give it to an agent.`,
46
+ ]
47
+ .filter((l) => l !== '')
48
+ .join('\n');
49
+ }
50
+
51
+ export class MyActions {
52
+ constructor({ store, manager }) {
53
+ this.store = store;
54
+ this.manager = manager;
55
+ }
56
+
57
+ get all() {
58
+ return (this.store.data.myActions ??= []);
59
+ }
60
+
61
+ find(id) {
62
+ const a = this.all.find((x) => x.id === id);
63
+ if (!a) throw err(404, `No action ${id}`);
64
+ return a;
65
+ }
66
+
67
+ /** Add one (the assistant does, on its checks). The same action from the same place is kept once. */
68
+ add({ text, source = 'other', link = null, from = null, when = null, due = null, context = null, by = null } = {}) {
69
+ const t = clip(text, 400);
70
+ if (t.length < 3) throw err(400, 'Say what the action is');
71
+ if (!ACTION_SOURCES[source]) throw err(400, `The source is one of ${Object.keys(ACTION_SOURCES).join(', ')}`);
72
+ const url = link ? String(link).trim() : null;
73
+ if (url && !/^https?:\/\/\S+$/.test(url)) throw err(400, 'The link is an http(s) address');
74
+ const key = `${url ?? ''}#${norm(t).slice(0, 120)}`;
75
+ const prev = this.all.find((x) => x.key === key);
76
+ if (prev) return { ...prev, duplicate: true };
77
+ const a = {
78
+ id: crypto.randomBytes(3).toString('hex'),
79
+ key,
80
+ text: t,
81
+ source,
82
+ link: url,
83
+ from: from ? clip(from, 80) : null,
84
+ when: when && !Number.isNaN(Date.parse(when)) ? new Date(when).toISOString() : new Date().toISOString(),
85
+ due: due ? clip(due, 40) : null,
86
+ context: context ? clip(context, 1000) : null,
87
+ by: by ?? null,
88
+ status: 'open',
89
+ at: new Date().toISOString(),
90
+ };
91
+ this.all.push(a);
92
+ // Old decided ones go first when the list grows long.
93
+ while (this.all.length > MAX) {
94
+ const i = this.all.findIndex((x) => x.status !== 'open');
95
+ this.all.splice(i < 0 ? 0 : i, 1);
96
+ }
97
+ this.store.save();
98
+ return a;
99
+ }
100
+
101
+ /** The list, open ones first, newest first within: rows with their group and agents. */
102
+ rows() {
103
+ const order = Object.fromEntries(Object.values(GROUP).map((g, i) => [g, i]));
104
+ return this.all
105
+ .map((a) => {
106
+ const agent = a.agentId ? this.manager.store?.get?.(a.agentId) ?? null : null;
107
+ const talk = a.discussId ? this.manager.store?.get?.(a.discussId) ?? null : null;
108
+ return {
109
+ id: a.id,
110
+ text: a.text,
111
+ source: a.source,
112
+ sourceLabel: ACTION_SOURCES[a.source] ?? a.source,
113
+ link: a.link,
114
+ from: a.from,
115
+ when: a.when,
116
+ due: a.due,
117
+ context: a.context,
118
+ status: a.status,
119
+ group: GROUP[a.status] ?? 'open',
120
+ agent: agent ? { id: agent.id, name: agent.name } : null,
121
+ discussion: talk ? { id: talk.id, name: talk.name } : null,
122
+ updatedAt: a.updatedAt ?? a.at,
123
+ };
124
+ })
125
+ .sort((x, y) => order[x.group] - order[y.group] || String(y.when).localeCompare(String(x.when)));
126
+ }
127
+
128
+ /**
129
+ * Your decision on actions: open (undecided again), assign (starts an agent; `project` picks
130
+ * where), skip, done or remove. { set: [ids], started: [{ id, agent }], failed: [{ id, reason }] }.
131
+ */
132
+ set(ids = [], state, { project = null } = {}) {
133
+ if (!ACTION_STATES.includes(state)) throw err(400, `The decision is one of ${ACTION_STATES.join(', ')}`);
134
+ const set = [];
135
+ const started = [];
136
+ const failed = [];
137
+ for (const id of new Set(ids)) {
138
+ const a = this.all.find((x) => x.id === id);
139
+ if (!a) {
140
+ failed.push({ id, reason: 'no such action' });
141
+ continue;
142
+ }
143
+ if (state === 'assign' && !(a.agentId && this.manager.store?.get?.(a.agentId))) {
144
+ try {
145
+ const proj = project ? String(project).replace(/^@/, '') : null;
146
+ const [agent] = this.manager.createMany([actionIntent(a)], proj ? { project: proj } : {});
147
+ a.agentId = agent.id;
148
+ started.push({ id, agent: { id: agent.id, name: agent.name } });
149
+ } catch (e) {
150
+ failed.push({ id, reason: e.message });
151
+ continue;
152
+ }
153
+ }
154
+ a.status = state;
155
+ a.updatedAt = new Date().toISOString();
156
+ set.push(id);
157
+ }
158
+ this.store.save();
159
+ return { set, started, failed };
160
+ }
161
+
162
+ /** A conversation about the action (a general session), or the one already started. */
163
+ discuss(id, bin) {
164
+ const a = this.find(id);
165
+ const prev = a.discussId ? this.manager.store?.get?.(a.discussId) : null;
166
+ if (prev) return { agent: { id: prev.id, name: prev.name }, existing: true };
167
+ const agent = this.manager.createGeneral({ question: discussPrompt(a, bin), name: `About: ${clip(a.text, 40)}` });
168
+ a.discussId = agent.id;
169
+ this.store.save();
170
+ return { agent: { id: agent.id, name: agent.name }, existing: false };
171
+ }
172
+ }
package/src/assistant.js CHANGED
@@ -4,6 +4,7 @@
4
4
  // it starts agents for that work through agentmgr, or passes news to the agent already on it.
5
5
  // The daemon keeps the limits: a daily cap, a cap on its agents running at once, and no second
6
6
  // agent for the same issue.
7
+ import crypto from 'node:crypto';
7
8
  import fs from 'node:fs';
8
9
  import path from 'node:path';
9
10
  import { fileURLToPath } from 'node:url';
@@ -17,7 +18,32 @@ export const SOURCES = {
17
18
  comments: 'new comments and mentions on Jira issues the person owns',
18
19
  slack: 'Slack messages to the person (direct messages and mentions) that ask for work',
19
20
  linear: 'Linear issues newly assigned to the person',
21
+ actions: 'things asked of the person in Slack and in meeting notes (Notes by Gemini), for their Actions list',
20
22
  };
23
+
24
+ /**
25
+ * The parts of AI Agent Manager you use (config.json "features"); all on unless turned off in
26
+ * Settings. Off, its list is hidden and the assistant doesn't look there.
27
+ */
28
+ export const FEATURES = {
29
+ jira: 'Jira: the issues assigned to you and the agents on them',
30
+ slack: 'Slack: work and action items from your messages',
31
+ gemini: 'Meeting notes: action items from Google Meet\'s Notes by Gemini',
32
+ };
33
+ export function featuresOf(config = {}) {
34
+ const f = config.features ?? {};
35
+ return Object.fromEntries(Object.keys(FEATURES).map((k) => [k, f[k] !== false]));
36
+ }
37
+
38
+ /** The sources the assistant checks with these features on. */
39
+ export function activeSources(sources, features) {
40
+ return sources.filter((k) => {
41
+ if (k === 'jira' || k === 'comments') return features.jira;
42
+ if (k === 'slack') return features.slack;
43
+ if (k === 'actions') return features.slack || features.gemini;
44
+ return true;
45
+ });
46
+ }
21
47
  export const ASSISTANT_DEFAULTS = {
22
48
  everyMin: 15,
23
49
  // Linear only when chosen: most people use Jira or Linear, not both.
@@ -41,7 +67,9 @@ export const assistantDir = () => path.join(paths.home, 'assistant');
41
67
  export function assistantSettings(config = {}) {
42
68
  const c = { ...ASSISTANT_DEFAULTS, ...config.assistant };
43
69
  const n = (v, d, lo, hi) => (Number.isFinite(Number(v)) && Number(v) >= lo ? Math.min(hi, Math.floor(Number(v))) : d);
44
- const sources = Array.isArray(c.sources) ? c.sources.filter((s) => SOURCES[s]) : ASSISTANT_DEFAULTS.sources;
70
+ let sources = Array.isArray(c.sources) ? c.sources.filter((s) => SOURCES[s]) : ASSISTANT_DEFAULTS.sources;
71
+ // Lists saved before "actions" existed get it once; after that, what you chose stays.
72
+ if (Array.isArray(c.sources) && c.sourcesV2 !== true && !sources.includes('actions')) sources = [...sources, 'actions'];
45
73
  return {
46
74
  everyMin: n(c.everyMin, ASSISTANT_DEFAULTS.everyMin, 1, 1440),
47
75
  sources,
@@ -51,11 +79,15 @@ export function assistantSettings(config = {}) {
51
79
  model: typeof c.model === 'string' && c.model ? c.model : null,
52
80
  notes: typeof c.notes === 'string' ? c.notes.slice(0, 4000) : '',
53
81
  pickIssues: c.pickIssues === true,
82
+ // Who "the person" is, to find what's asked of them: name and email(s). Empty: from git config.
83
+ me: typeof c.me === 'string' ? c.me.slice(0, 300) : '',
84
+ sourcesV2: true,
54
85
  };
55
86
  }
56
87
 
57
88
  /** The assistant's standing instructions (appended to its system prompt on every launch). */
58
- export function assistantPrompt(s, dir, bin = `node ${BIN}`) {
89
+ export function assistantPrompt(s, dir, bin = `node ${BIN}`, features = featuresOf()) {
90
+ s = { ...s, sources: activeSources(s.sources, features) };
59
91
  const am = bin;
60
92
  const watch = s.sources.map((k) => `- ${SOURCES[k]}`).join('\n');
61
93
  const how = [];
@@ -106,6 +138,19 @@ export function assistantPrompt(s, dir, bin = `node ${BIN}`) {
106
138
  `Otherwise start one: ${am} add @<project> "Checks fail on <PR link>: find out why and fix it on that branch."`,
107
139
  );
108
140
  }
141
+ if (s.sources.includes('actions')) {
142
+ const where = [
143
+ features.slack && 'in Slack, direct messages to the person, messages that mention them and threads they take part in',
144
+ features.gemini && 'in meeting notes: the Google Docs named "Notes by Gemini" for their meetings (in Google Drive, or linked from the calendar event or the email Gemini sends)',
145
+ ].filter(Boolean);
146
+ const who = s.me ? `the person (${s.me})` : 'the person (their name and email: git config --global user.name and user.email)';
147
+ how.push(
148
+ `My action items: with your ${[features.slack && 'Slack', features.gemini && 'Google Drive, Calendar and Gmail'].filter(Boolean).join(' and ')} tools, read what's new since your last check ${where.join(', and ')}. ` +
149
+ `Find what is asked of ${who}, or what they agreed to do: in Gemini's notes, the action items and suggested next steps that name them. ` +
150
+ `For each one, add it to their list: ${am} actions add --source <${[features.slack && 'slack', features.gemini && 'gemini'].filter(Boolean).join('|')}> --link "<the message or doc link>" --from "<who asked>" [--due "<when, if said>"] --context "<one or two sentences of background>" "<the action in one line, starting with a verb>". ` +
151
+ `Adding the same one twice is harmless. Don't act on them, start agents for them or reply: the person decides under Actions.`,
152
+ );
153
+ }
109
154
  if (s.sources.includes('slack')) {
110
155
  how.push(
111
156
  `Slack: with your Slack tools, read direct messages to the person and messages that mention them, since your last check. ` +
@@ -129,6 +174,13 @@ export function assistantPrompt(s, dir, bin = `node ${BIN}`) {
129
174
  .join('\n\n');
130
175
  }
131
176
 
177
+ /** The instructions for the assistant as the settings stand now, and a short hash of them. */
178
+ export function currentPrompt(config = {}) {
179
+ fs.mkdirSync(assistantDir(), { recursive: true });
180
+ const text = assistantPrompt(assistantSettings(config), fs.realpathSync(assistantDir()), undefined, featuresOf(config));
181
+ return { text, hash: crypto.createHash('sha256').update(text).digest('hex').slice(0, 16) };
182
+ }
183
+
132
184
  export class Assistant {
133
185
  constructor({ manager, store, config = {}, log = (m) => console.log(`[agentmgr] ${m}`) }) {
134
186
  this.manager = manager;
@@ -207,7 +259,14 @@ export class Assistant {
207
259
  if (!a) throw err(409, 'The assistant is not set up yet: start it first');
208
260
  const last = this.state.lastCheckAt;
209
261
  const n = (this.state.checks ?? 0) + 1;
210
- const text = `Check now (check ${n}, ${new Date().toISOString()}${last ? `; last check ${last}` : '; first check'}${by === 'person' ? ', asked by the person' : ''}).`;
262
+ let text = `Check now (check ${n}, ${new Date().toISOString()}${last ? `; last check ${last}` : '; first check'}${by === 'person' ? ', asked by the person' : ''}).`;
263
+ // Settings changed since the session started (sources, features, notes): the new instructions
264
+ // come with this check, so they apply without restarting it.
265
+ const now = currentPrompt(this.config);
266
+ if (this.state.promptHash && now.hash !== this.state.promptHash) {
267
+ text += `\n\nThe person changed your settings. From now on follow these instructions instead of the ones you started with:\n\n${now.text}`;
268
+ }
269
+ this.state.promptHash = now.hash;
211
270
  this.manager.tell(a.id, text, { source: 'assistant' });
212
271
  this.state.checks = n;
213
272
  this.state.lastCheckAt = new Date().toISOString();
package/src/cli.js CHANGED
@@ -731,6 +731,60 @@ export async function main(argv) {
731
731
  for (const x of r.failed) console.log(`${red('!')} ${bold(x.key)}: ${x.reason}`);
732
732
  });
733
733
 
734
+ const actionsCmd = program.command('actions').description("Your action items from Slack and meeting notes (the assistant finds them): decide on each one");
735
+ actionsCmd
736
+ .command('ls', { isDefault: true })
737
+ .description('The open ones (--all for the decided ones too)')
738
+ .option('--all', 'also assigned, skipped, done and removed')
739
+ .option('--json', 'print JSON')
740
+ .action(async (opts) => {
741
+ await daemon();
742
+ const v = await api('GET', '/actions');
743
+ const rows = opts.all ? v.rows : v.rows.filter((r) => r.group === 'open');
744
+ if (opts.json) return console.log(JSON.stringify({ ...v, rows }, null, 2));
745
+ if (!rows.length) return console.log(dim(opts.all ? 'No action items yet.' : 'Nothing open. --all shows the decided ones.'));
746
+ for (const r of rows) {
747
+ console.log(`${bold(r.id)} ${r.group === 'open' ? yellow(r.text) : r.text}${r.group === 'open' ? '' : dim(` [${r.status}]`)}`);
748
+ console.log(dim(` ${[r.sourceLabel, r.from && `from ${r.from}`, r.due && `due ${r.due}`, r.link].filter(Boolean).join(' · ')}`));
749
+ }
750
+ });
751
+ actionsCmd
752
+ .command('add')
753
+ .description('Add an action item (the assistant does this on its checks)')
754
+ .argument('<text...>', 'the action, in one line')
755
+ .option('--source <source>', 'slack | gemini | other', 'other')
756
+ .option('--link <url>', 'the message or document it comes from')
757
+ .option('--from <who>', 'who asked')
758
+ .option('--due <when>', 'when it is due, if said')
759
+ .option('--context <text>', 'a sentence or two of background')
760
+ .action(async (words, opts) => {
761
+ await daemon();
762
+ const a = await api('POST', '/actions', { text: words.join(' '), source: opts.source, link: opts.link, from: opts.from, due: opts.due, context: opts.context });
763
+ console.log(a.duplicate ? dim(`Already listed: ${a.id}`) : `${green('+')} ${bold(a.id)} ${a.text}`);
764
+ });
765
+ actionsCmd
766
+ .command('set')
767
+ .description('Your decision: assign (an agent does it), skip, done, remove, or open again')
768
+ .argument('<state>', 'assign | skip | done | remove | open')
769
+ .argument('<ids...>')
770
+ .option('-p, --project <project>', 'with assign: the project the agent works in')
771
+ .action(async (state, ids, opts) => {
772
+ await daemon();
773
+ const r = await api('POST', '/actions/set', { ids, state, project: opts.project });
774
+ for (const x of r.started) console.log(`${green('✓')} ${bold(x.id)} → agent ${x.agent.name} (${x.agent.id})`);
775
+ if (r.set.length) console.log(`${green('✓')} ${r.set.join(', ')}: ${state}`);
776
+ for (const x of r.failed) console.log(`${red('!')} ${bold(x.id)}: ${x.reason}`);
777
+ });
778
+ actionsCmd
779
+ .command('discuss')
780
+ .description('Talk an action item through with Claude, in a session of its own')
781
+ .argument('<id>')
782
+ .action(async (id) => {
783
+ await daemon();
784
+ const r = await api('POST', `/actions/${id}/discuss`, {});
785
+ console.log(`${r.existing ? 'Already talking about it' : 'Started'}: ${bold(r.agent.name)} (${r.agent.id}); open it with agentmgr attach ${r.agent.id}`);
786
+ });
787
+
734
788
  program
735
789
  .command('designs')
736
790
  .description("Agents' design docs: name, summary and links, the ones waiting for your review first")
package/src/manager.js CHANGED
@@ -121,7 +121,7 @@ import { Judge, clashPrompt, finishMessage, hash, reviewPrompt, screenPrompt, st
121
121
  import { findLocalUrls, findSignInLinks, parseCallback, parseUrl } from './preview.js';
122
122
  import { Plugins } from './plugins.js';
123
123
  import { leadPrompt, subagents, teamDir, teamPrompt } from './teams.js';
124
- import { assistantDir, assistantPrompt, assistantSettings } from './assistant.js';
124
+ import { assistantDir, currentPrompt } from './assistant.js';
125
125
  import { learnCommand, memoryKey, memoryPrompt, memoryText } from './memory.js';
126
126
  import { Rules, describeTool } from './rules.js';
127
127
  import { runningClaude, scanClaudeSessions } from './sessions.js';
@@ -832,7 +832,8 @@ export class AgentManager extends EventEmitter {
832
832
  const views = this.store.list().map((a) => this.view(a));
833
833
  this.jiraCache ??= new Map();
834
834
  // Open issues assigned to you (kept two minutes); their fields stand in for a fetch each.
835
- if (!this.assignedAt || Date.now() - this.assignedAt > 2 * 60_000) {
835
+ if (this.jiraOff) this.assignedNow = [];
836
+ else if (!this.assignedAt || Date.now() - this.assignedAt > 2 * 60_000) {
836
837
  const got = await (this.assignedFetch ?? assignedIssues)().catch(() => null);
837
838
  this.assignedAt = Date.now();
838
839
  if (got) this.assignedNow = got;
@@ -1239,10 +1240,11 @@ export class AgentManager extends EventEmitter {
1239
1240
  allowedTools = [...(allowedTools ?? []), ...builderAllowedTools(agent.workdir)];
1240
1241
  }
1241
1242
  if (agent.kind === 'assistant') {
1242
- fs.mkdirSync(assistantDir(), { recursive: true });
1243
- const dir = fs.realpathSync(assistantDir());
1244
- writableDir = dir;
1245
- prompts.push(assistantPrompt(assistantSettings(this.config), dir));
1243
+ writableDir = fs.realpathSync((fs.mkdirSync(assistantDir(), { recursive: true }), assistantDir()));
1244
+ const p = currentPrompt(this.config);
1245
+ prompts.push(p.text);
1246
+ // What it started with: a check after a settings change brings the new instructions.
1247
+ (this.store.data.assistant ??= {}).promptHash = p.hash;
1246
1248
  }
1247
1249
  if (agent.team) {
1248
1250
  // Team members write their handoff files in the team's folder.
package/src/server.js CHANGED
@@ -14,7 +14,7 @@ import { Backlog } from './backlog.js';
14
14
  import { Races } from './races.js';
15
15
  import { Review } from './review.js';
16
16
  import { Teams } from './teams.js';
17
- import { Assistant } from './assistant.js';
17
+ import { Assistant, FEATURES, featuresOf } from './assistant.js';
18
18
  import { Cleanup } from './cleanup.js';
19
19
  import { Landing } from './landing.js';
20
20
  import { Autopilot } from './autopilot.js';
@@ -40,6 +40,7 @@ import * as remote from './remote.js';
40
40
  import * as service from './service.js';
41
41
  import { jiraView, saveJira } from './jira.js';
42
42
  import { ProposedIssues, issuesMarkdown } from './issues.js';
43
+ import { MyActions } from './actions.js';
43
44
  import { designsMarkdown } from './designs.js';
44
45
  import { Reviews, reviewDraft, reviewMarkdown } from './reviews.js';
45
46
  import { CONTAINER_ENGINES, buildImage, claudeToken, dockerStatus, isBuilding, saveSecrets } from './container.js';
@@ -92,6 +93,7 @@ export async function startServer({ port = PORT, host = HOST } = {}) {
92
93
  const manager = new AgentManager({ store, config, plugins });
93
94
  const backlog = new Backlog({ manager, store, config });
94
95
  const proposed = new ProposedIssues({ store, manager });
96
+ const myActions = new MyActions({ store, manager });
95
97
  const reviews = new Reviews({ manager, store, log: (m) => console.log(`[agentmgr] ${m}`) });
96
98
  const races = new Races({ manager, store });
97
99
  const review = new Review({ manager });
@@ -789,6 +791,7 @@ export async function startServer({ port = PORT, host = HOST } = {}) {
789
791
  api.get('/issues', wrap(async (req) => {
790
792
  // ?fresh=1 (the ↻ button) asks Jira again for the issues assigned to you.
791
793
  if (req.query.fresh === '1') manager.assignedAt = 0;
794
+ manager.jiraOff = !featuresOf(config).jira;
792
795
  const v = await manager.issues(proposed.listed(), proposed.actions);
793
796
  const group = req.query.group ? String(req.query.group) : null;
794
797
  // "all" is everything still on the list: removed ones only when asked for.
@@ -799,6 +802,21 @@ export async function startServer({ port = PORT, host = HOST } = {}) {
799
802
  api.post('/issues/proposed', wrap((req) => proposed.add({ ...req.body, by: req.headers['x-agentmgr-agent'] ? 'assistant' : 'you' })));
800
803
  api.post('/issues/start', wrap((req) => proposed.start(Array.isArray(req.body?.keys) ? req.body.keys.map(String) : [])));
801
804
  api.post('/issues/dismiss', wrap((req) => proposed.dismiss(Array.isArray(req.body?.keys) ? req.body.keys.map(String) : [])));
805
+ // My actions: what's asked of you in Slack and meeting notes (the assistant adds them).
806
+ api.get('/actions', wrap(() => ({ rows: myActions.rows(), features: featuresOf(config) })));
807
+ api.post('/actions', wrap((req) => myActions.add({ ...req.body, by: req.headers['x-agentmgr-agent'] ? 'assistant' : 'you' })));
808
+ api.post('/actions/set', wrap((req) => myActions.set(Array.isArray(req.body?.ids) ? req.body.ids.map(String) : [], String(req.body?.state ?? ''), { project: req.body?.project ?? null })));
809
+ api.post('/actions/:id/discuss', wrap((req) => myActions.discuss(req.params.id, `node ${JSON.stringify(path.join(__dirname, '..', 'bin', 'agentmgr.js'))}`)));
810
+ // The parts you use: Jira, Slack, meeting notes. Off hides its list and the assistant skips it.
811
+ api.get('/features', wrap(() => ({ features: featuresOf(config), me: assistant.settings.me })));
812
+ api.put('/features', wrap((req) => {
813
+ const next = {};
814
+ for (const k of Object.keys(FEATURES)) if (typeof req.body?.features?.[k] === 'boolean') next[k] = req.body.features[k];
815
+ config.features = { ...config.features, ...next };
816
+ saveConfig({ features: config.features });
817
+ if (typeof req.body?.me === 'string') saveConfig({ assistant: assistant.update({ me: req.body.me.trim() }) });
818
+ return { features: featuresOf(config), me: assistant.settings.me };
819
+ }));
802
820
  // Your action on issues: assign (starts an agent from the proposal), skip, done, remove, or null to clear.
803
821
  api.post('/issues/action', wrap((req) => proposed.setAction(Array.isArray(req.body?.keys) ? req.body.keys.map(String) : [], req.body?.action ?? null)));
804
822
  // Design docs of all agents; the same ?group= and ?format=markdown.