ai-agentmanager 1.20.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/public/speak.js CHANGED
@@ -60,6 +60,7 @@ function playNext() {
60
60
  const part = s.parts[s.i];
61
61
  const u = new SpeechSynthesisUtterance(part.text);
62
62
  u.rate = rate();
63
+ if (part.voice) u.voice = part.voice;
63
64
  u.onstart = () => part.onStart?.();
64
65
  u.onend = () => {
65
66
  if (session !== s || s.paused) return;
@@ -74,7 +75,8 @@ function playNext() {
74
75
  }
75
76
 
76
77
  /**
77
- * Play `parts` (strings, or { text, onStart } to follow along, e.g. highlight a change) under `id`.
78
+ * Play `parts` (strings, or { text, onStart, voice } to follow along, e.g. highlight a change, and
79
+ * to speak in a given voice) under `id`.
78
80
  * `onState(state)` hears 'playing' | 'paused' | 'stopped'.
79
81
  */
80
82
  export function play(id, parts, { onState, onEnd } = {}) {
@@ -83,7 +85,7 @@ export function play(id, parts, { onState, onEnd } = {}) {
83
85
  const list = parts.flatMap((p) => {
84
86
  const text = typeof p === 'string' ? p : p.text;
85
87
  const chunks = pieces(text);
86
- return chunks.map((c, k) => ({ text: c, onStart: k === 0 && typeof p !== 'string' ? p.onStart : null }));
88
+ return chunks.map((c, k) => ({ text: c, onStart: k === 0 && typeof p !== 'string' ? p.onStart : null, voice: typeof p === 'string' ? null : p.voice ?? null }));
87
89
  });
88
90
  if (!list.length) return false;
89
91
  session = { id, parts: list, i: 0, paused: false, onState, onEnd };
@@ -144,10 +146,15 @@ const notify = () => listeners.forEach((fn) => fn(now()));
144
146
  * A Listen control for `id`: 🔊 Listen, or ⏸ / ▶ with ■ and the speed while that id plays.
145
147
  * Clicks are handled by `bindListen`; `data-say` names what to read.
146
148
  */
147
- export function listenHtml(id, { title = 'Read it aloud' } = {}) {
149
+ const labels = new Map();
150
+
151
+ export function listenHtml(id, { title = 'Read it aloud', label = null } = {}) {
148
152
  if (!canSpeak()) return '';
153
+ // Remembered, so a control redrawn as playback changes keeps its words.
154
+ if (label) labels.set(id, { title, label });
155
+ const saved = labels.get(id);
149
156
  const cur = now();
150
- if (cur?.id !== id) return `<span class="say" data-say="${id}"><button type="button" class="small ghost" data-say-act="play" title="${title}">🔊 Listen</button></span>`;
157
+ if (cur?.id !== id) return `<span class="say" data-say="${id}"><button type="button" class="small ghost" data-say-act="play" title="${saved?.title ?? title}">🔊 ${saved?.label ?? 'Listen'}</button></span>`;
151
158
  return `<span class="say on" data-say="${id}"><button type="button" class="small" data-say-act="${cur.paused ? 'resume' : 'pause'}" title="${cur.paused ? 'Resume' : 'Pause'}">${cur.paused ? '▶' : '⏸'}</button><button type="button" class="small ghost" data-say-act="stop" title="Stop">■</button><button type="button" class="small ghost" data-say-act="rate" title="Speed">${rateLabel()}</button></span>`;
152
159
  }
153
160
 
@@ -0,0 +1,348 @@
1
+ // The standup player: the day's standup read aloud, one agent at a time, each in its own voice.
2
+ // When an agent needs you it stops on it with its questions beside it, answered by tap (the
3
+ // inbox's own cards) or, when turned on, by voice: what you say is read back and sent on "send".
4
+
5
+ import { canSpeak, cycleRate, pause, play, rateLabel, resume, stop, now as speaking } from '/speak.js';
6
+ import { choiceFor } from '/voice.js';
7
+
8
+ const VOICE_KEY = 'agentmgr.standupVoice';
9
+ const PLAY_ID = 'standup';
10
+ const Recognition = typeof window !== 'undefined' ? window.SpeechRecognition || window.webkitSpeechRecognition : null;
11
+
12
+ // macOS's joke and singing voices: not for a standup.
13
+ const NOVELTY = /^(Albert|Bad News|Bahh|Bells|Boing|Bubbles|Cellos|Deranged|Good News|Hysterical|Jester|Organ|Pipe Organ|Superstar|Trinoids|Whisper|Wobble|Zarvox)\b/i;
14
+ const hash = (s) => [...String(s)].reduce((h, c) => (h * 31 + c.charCodeAt(0)) >>> 0, 7);
15
+ export function initStandup({ api, $, esc, agents, needsFor, needCard, onNeed, toast, openAgent }) {
16
+ const dialog = $('#standup-dialog');
17
+ const body = $('#standup-body');
18
+ let latest = null;
19
+ let settings = null;
20
+ let idx = -1; // -1: the intro
21
+ let state = 'stopped'; // playing | paused | waiting | stopped | done
22
+ let heard = null; // { text, action: { label, run } } waiting for "send"
23
+ let listening = null;
24
+ let voiceOn = false;
25
+ try {
26
+ voiceOn = localStorage.getItem(VOICE_KEY) === '1';
27
+ } catch {}
28
+
29
+ // Each agent keeps one voice of the page's language; the intro uses the default.
30
+ let voices = [];
31
+ const loadVoices = () => {
32
+ if (!canSpeak()) return;
33
+ const lang = (navigator.language || 'en').slice(0, 2);
34
+ voices = speechSynthesis.getVoices().filter((v) => v.lang?.startsWith(lang) && !NOVELTY.test(v.name));
35
+ };
36
+ if (canSpeak()) {
37
+ loadVoices();
38
+ speechSynthesis.addEventListener?.('voiceschanged', loadVoices);
39
+ }
40
+ const voiceFor = (id) => (voices.length > 1 ? voices[hash(id) % voices.length] : null);
41
+
42
+ const items = () => latest?.items ?? [];
43
+ const current = () => items()[idx] ?? null;
44
+ const needsNow = (it) => {
45
+ const a = it && agents.get(it.agentId);
46
+ return a ? needsFor(a) : [];
47
+ };
48
+
49
+ function set(next) {
50
+ latest = next;
51
+ $('#standup-dot').hidden = !latest?.items?.length || seenAt() === latest.at;
52
+ if (dialog.open) render();
53
+ }
54
+ const seenAt = () => {
55
+ try {
56
+ return localStorage.getItem('agentmgr.standupSeen');
57
+ } catch {
58
+ return null;
59
+ }
60
+ };
61
+ const markSeen = () => {
62
+ try {
63
+ localStorage.setItem('agentmgr.standupSeen', latest?.at ?? '');
64
+ } catch {}
65
+ $('#standup-dot').hidden = true;
66
+ };
67
+
68
+ async function load() {
69
+ const v = await api('GET', '/standup');
70
+ settings = v.settings;
71
+ set(v.latest);
72
+ }
73
+
74
+ async function open({ fresh = false } = {}) {
75
+ if (!dialog.open) dialog.showModal();
76
+ try {
77
+ if (!latest || fresh) {
78
+ body.innerHTML = '<p class="hint standup-making">Putting the standup together…</p>';
79
+ const v = await api(fresh || !latest ? 'POST' : 'GET', '/standup');
80
+ settings = v.settings;
81
+ set(v.latest);
82
+ } else if (!settings) await load();
83
+ } catch (e) {
84
+ body.innerHTML = `<p class="hint error">${esc(e.message)}</p>`;
85
+ return;
86
+ }
87
+ markSeen();
88
+ playFrom(-1);
89
+ }
90
+
91
+ function close() {
92
+ stop(false);
93
+ stopListening();
94
+ state = 'stopped';
95
+ if (dialog.open) dialog.close();
96
+ }
97
+
98
+ /** Read item `i` (-1: the intro), then go on, or stop on an agent that needs you. */
99
+ function playFrom(i) {
100
+ idx = Math.max(-1, Math.min(i, items().length));
101
+ heard = null;
102
+ stopListening();
103
+ if (idx >= items().length) {
104
+ state = 'done';
105
+ render();
106
+ return play(PLAY_ID, ["That's everything."], {});
107
+ }
108
+ const it = current();
109
+ const text = it ? `${it.name}. ${it.text}` : latest?.intro ?? '';
110
+ state = 'playing';
111
+ render();
112
+ const started = play(PLAY_ID, [{ text, voice: it ? voiceFor(it.agentId) : null }], {
113
+ onEnd: () => {
114
+ if (!dialog.open) return;
115
+ if (it && needsNow(it).length) {
116
+ state = 'waiting';
117
+ render();
118
+ if (voiceOn) listen();
119
+ } else setTimeout(() => dialog.open && state === 'playing' && idx === i && playFrom(i + 1), 500);
120
+ },
121
+ });
122
+ // No speech here: show it, and let the arrows move on.
123
+ if (!started) {
124
+ state = it && needsNow(it).length ? 'waiting' : 'paused';
125
+ render();
126
+ }
127
+ }
128
+
129
+ function toggle() {
130
+ const s = speaking();
131
+ if (s?.id === PLAY_ID && !s.paused) {
132
+ pause();
133
+ state = 'paused';
134
+ } else if (s?.id === PLAY_ID && s.paused) {
135
+ resume();
136
+ state = 'playing';
137
+ } else return playFrom(state === 'done' ? -1 : idx);
138
+ render();
139
+ }
140
+
141
+ // ------------------------------------------------------------ answering by voice
142
+
143
+ /** What saying `text` does for this agent's first need: { label, run } or null. */
144
+ function actionFor(it, text) {
145
+ const a = agents.get(it.agentId);
146
+ const need = needsNow(it)[0];
147
+ if (!a || !need) return null;
148
+ const t = text.trim();
149
+ if (need.kind === 'prompt') {
150
+ const choices = a.runtime.prompt?.choices ?? [];
151
+ const key = choiceFor(t, choices);
152
+ const c = choices.find((x) => x.key === key);
153
+ return c ? { label: `choose “${c.label}”`, run: () => api('POST', `/agents/${a.id}/prompt-key`, { key }) } : null;
154
+ }
155
+ if (need.kind === 'question') return { label: `answer “${t}”`, run: () => api('POST', `/agents/${a.id}/answer`, { question: need.q.id, text: t }) };
156
+ if (need.kind === 'waiting') return { label: `reply “${t}”`, run: () => api('POST', `/agents/${a.id}/waiting/answer`, { text: t }) };
157
+ if (need.kind === 'plan' && /\b(approve|looks good|go ahead|ship it)\b/i.test(t)) return { label: 'approve its plan', run: () => api('POST', `/agents/${a.id}/plan/approve`, {}) };
158
+ return { label: `tell it “${t}”`, run: () => api('POST', `/agents/${a.id}/tell`, { text: t }) };
159
+ }
160
+
161
+ function stopListening() {
162
+ try {
163
+ listening?.abort();
164
+ } catch {}
165
+ listening = null;
166
+ }
167
+
168
+ /** Listen once: an answer, or, with one read back, "send" or "cancel". */
169
+ function listen() {
170
+ if (!Recognition || listening) return;
171
+ stop(false);
172
+ const it = current();
173
+ const r = new Recognition();
174
+ r.lang = navigator.language || 'en-US';
175
+ r.interimResults = true;
176
+ r.maxAlternatives = 1;
177
+ let text = '';
178
+ r.onresult = (e) => {
179
+ text = [...e.results].map((x) => x[0].transcript).join(' ');
180
+ const live = $('#standup-heard-live');
181
+ if (live) live.textContent = text;
182
+ };
183
+ r.onerror = (e) => {
184
+ if (e.error === 'not-allowed' || e.error === 'service-not-allowed') toast('Microphone blocked: allow it for this page, or answer with the buttons', 6000);
185
+ };
186
+ r.onend = () => {
187
+ listening = null;
188
+ if (!dialog.open || current() !== it) return render();
189
+ text = text.trim();
190
+ if (heard && text) {
191
+ if (/\b(send|yes|confirm|do it|go)\b/i.test(text)) return send();
192
+ if (/\b(cancel|no|stop|wait)\b/i.test(text)) {
193
+ heard = null;
194
+ return render();
195
+ }
196
+ } else if (text) {
197
+ const action = actionFor(it, text);
198
+ if (!action) {
199
+ play(PLAY_ID, ["Sorry, I didn't catch a choice. Say yes, no, or the option's number."], {});
200
+ return render();
201
+ }
202
+ heard = { text, action };
203
+ render();
204
+ // Read it back, then listen for "send".
205
+ return play(PLAY_ID, [`I'll ${action.label} for ${it.name}. Say send, or cancel.`], { onEnd: () => dialog.open && heard && listen() });
206
+ }
207
+ render();
208
+ };
209
+ listening = r;
210
+ try {
211
+ r.start();
212
+ } catch {
213
+ listening = null;
214
+ }
215
+ render();
216
+ }
217
+
218
+ async function send() {
219
+ const it = current();
220
+ const h = heard;
221
+ heard = null;
222
+ if (!h || !it) return render();
223
+ try {
224
+ await h.action.run();
225
+ toast(`Sent to ${it.name}`);
226
+ play(PLAY_ID, ['Sent.'], { onEnd: () => dialog.open && playFrom(idx + 1) });
227
+ } catch (e) {
228
+ toast(e.message, 6000);
229
+ }
230
+ render();
231
+ }
232
+
233
+ // ------------------------------------------------------------ drawing
234
+
235
+ function render() {
236
+ if (!dialog.open) return;
237
+ if (!latest) return;
238
+ const list = items();
239
+ const it = current();
240
+ const when = new Date(latest.at).toLocaleString([], { weekday: 'short', hour: '2-digit', minute: '2-digit' });
241
+ const chips = [`<button class="standup-chip ${idx === -1 ? 'on' : ''}" data-su="go" data-i="-1">Intro</button>`, ...list.map((x, i) => `<button class="standup-chip ${i === idx ? 'on' : ''} ${needsNow(x).length ? 'needs' : ''}" data-su="go" data-i="${i}" title="${esc(x.text)}">${esc(x.name)}</button>`)].join('');
242
+ const needs = it ? needsNow(it) : [];
243
+ const card = it
244
+ ? `<div class="standup-card">
245
+ <h3><button class="link" data-su="open" title="Open this agent">${esc(it.name)}</button>${it.project ? ` <span class="hint">${esc(it.project)}</span>` : ''}</h3>
246
+ <p class="standup-text">${esc(it.text)}</p>
247
+ ${needs.length ? `<div class="standup-needs">${needs.map((n) => needCard(n, { inDetail: true })).join('')}</div>` : '<p class="hint">Nothing needed from you.</p>'}
248
+ ${needs.length && Recognition && voiceOn
249
+ ? `<div class="standup-voice">
250
+ <button class="${listening ? 'primary listening' : ''}" data-su="mic" title="Say your answer: yes, no, an option's number, or a reply">${listening ? '● Listening…' : '🎤 Answer by voice'}</button>
251
+ <span id="standup-heard-live" class="hint"></span>
252
+ ${heard ? `<div class="standup-heard">I'll ${esc(heard.action.label)} for <b>${esc(it.name)}</b>. <button class="small primary" data-su="send">Send</button> <button class="small" data-su="cancel">Cancel</button></div>` : ''}
253
+ </div>`
254
+ : ''}
255
+ </div>`
256
+ : idx >= list.length
257
+ ? `<div class="standup-card"><p class="standup-text">That's everything.</p><p class="hint">${list.filter((x) => needsNow(x).length).length ? 'Some agents still need you: pick one above.' : 'Nothing is waiting on you.'}</p></div>`
258
+ : `<div class="standup-card"><p class="standup-text">${esc(latest.intro)}</p><p class="hint">Since ${esc(new Date(latest.since).toLocaleString([], { weekday: 'short', hour: '2-digit', minute: '2-digit' }))}${latest.ai ? '' : ' · plain wording'}</p></div>`;
259
+ const playingNow = speaking()?.id === PLAY_ID && !speaking()?.paused;
260
+ body.innerHTML = `
261
+ <div class="standup-top"><b>Standup</b> <span class="hint">${esc(when)} · ${list.length} agent${list.length === 1 ? '' : 's'}</span><span class="spacer"></span>
262
+ <button class="small" data-su="fresh" title="A new standup with what's happened since this one">↻ New</button>
263
+ <button class="small" data-su="close">Close</button></div>
264
+ <div class="standup-chips">${chips}</div>
265
+ ${card}
266
+ <div class="standup-controls">
267
+ <button data-su="prev" title="Previous" ${idx <= -1 ? 'disabled' : ''}>⏮</button>
268
+ <button class="primary" data-su="play" title="${playingNow ? 'Pause' : 'Play'}" ${canSpeak() ? '' : 'disabled'}>${playingNow ? '⏸' : '▶'}</button>
269
+ <button data-su="next" title="Next" ${idx >= list.length ? 'disabled' : ''}>⏭</button>
270
+ <button class="small" data-su="rate" title="Speed">${esc(rateLabel())}</button>
271
+ <span class="spacer"></span>
272
+ ${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
+ </div>
274
+ ${settings ? `<details class="standup-settings"><summary>Daily at ${esc(settings.at)}${settings.enabled ? '' : ' (off)'}</summary>
275
+ <label class="check"><input type="checkbox" data-su-set="enabled" ${settings.enabled ? 'checked' : ''}> A standup every ${settings.weekends ? 'day' : 'weekday'} at <input type="time" data-su-set="at" value="${esc(settings.at)}"></label>
276
+ <label class="check"><input type="checkbox" data-su-set="weekends" ${settings.weekends ? 'checked' : ''}> Weekends too</label>
277
+ <label class="check"><input type="checkbox" data-su-set="ai" ${settings.ai ? 'checked' : ''}> Worded by AI (one short call; off: plain wording)</label>
278
+ <label class="check"><input type="checkbox" data-su-set="notify" ${settings.notify ? 'checked' : ''}> Alert me when it's ready (Slack, with Alerts on)</label>
279
+ </details>` : ''}`;
280
+ }
281
+
282
+ body.addEventListener('click', (e) => {
283
+ if (e.target.closest('[data-need]')) return onNeed(e);
284
+ const el = e.target.closest('[data-su]');
285
+ if (!el) return;
286
+ const what = el.dataset.su;
287
+ if (what === 'voice') return;
288
+ e.preventDefault();
289
+ if (what === 'close') return close();
290
+ if (what === 'fresh') return open({ fresh: true });
291
+ if (what === 'play') return toggle();
292
+ if (what === 'prev') return playFrom(idx - 1);
293
+ if (what === 'next') return playFrom(idx + 1);
294
+ if (what === 'go') return playFrom(Number(el.dataset.i));
295
+ if (what === 'rate') {
296
+ cycleRate();
297
+ return render();
298
+ }
299
+ if (what === 'open') {
300
+ const id = current()?.agentId;
301
+ close();
302
+ return id && openAgent(id);
303
+ }
304
+ if (what === 'mic') return listening ? stopListening() || render() : listen();
305
+ if (what === 'send') return send();
306
+ if (what === 'cancel') {
307
+ heard = null;
308
+ return render();
309
+ }
310
+ });
311
+ body.addEventListener('change', async (e) => {
312
+ if (e.target.dataset.su === 'voice') {
313
+ voiceOn = e.target.checked;
314
+ try {
315
+ localStorage.setItem(VOICE_KEY, voiceOn ? '1' : '0');
316
+ } catch {}
317
+ if (voiceOn) toast('Voice answers on. Your browser may send what you say to its maker to turn it into text', 6000);
318
+ return render();
319
+ }
320
+ const key = e.target.dataset.suSet;
321
+ if (!key) return;
322
+ try {
323
+ settings = (await api('PUT', '/standup', { [key]: e.target.type === 'checkbox' ? e.target.checked : e.target.value })).settings;
324
+ } catch (err) {
325
+ toast(err.message, 5000);
326
+ }
327
+ render();
328
+ });
329
+ dialog.addEventListener('close', () => {
330
+ stop(false);
331
+ stopListening();
332
+ state = 'stopped';
333
+ });
334
+
335
+ // Answering on another device (or here) clears the need: an agent you were stopped on moves on.
336
+ function agentChanged() {
337
+ if (!dialog.open) return;
338
+ const it = current();
339
+ if (state === 'waiting' && it && !needsNow(it).length && !heard) return playFrom(idx + 1);
340
+ // Typing a reply in one of its cards: don't redraw under it.
341
+ if (body.contains(document.activeElement) && document.activeElement.matches('input, textarea')) return;
342
+ render();
343
+ }
344
+
345
+ $('#standup-btn').onclick = () => open();
346
+ load().catch(() => {});
347
+ return { open, set, render: agentChanged, isOpen: () => dialog.open };
348
+ }
package/public/style.css CHANGED
@@ -1062,3 +1062,171 @@ kbd { display: inline-block; min-width: 1.6em; padding: 1px 5px; border: 1px sol
1062
1062
  .keys-dialog td { padding: 3px 0; vertical-align: top; }
1063
1063
  .keys-dialog td.keys { width: 42%; white-space: nowrap; padding-right: 12px; }
1064
1064
  #keys-btn kbd { margin-left: 6px; }
1065
+
1066
+ /* ---------- standup player */
1067
+ .standup-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 16px; }
1068
+ .standup-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
1069
+ .standup-top .spacer, .standup-controls .spacer { flex: 1; }
1070
+ .standup-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
1071
+ .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
+ .standup-chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
1073
+ .standup-chip.needs::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--red); vertical-align: middle; }
1074
+ .standup-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--panel); min-height: 120px; }
1075
+ .standup-card h3 { margin: 0 0 6px; font-size: 16px; }
1076
+ .standup-text { font-size: 17px; line-height: 1.5; margin: 0 0 10px; }
1077
+ .standup-needs { display: flex; flex-direction: column; gap: 8px; }
1078
+ .standup-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
1079
+ .standup-voice .listening { animation: pulse 1s infinite; }
1080
+ .standup-heard { flex-basis: 100%; padding: 8px 10px; border-radius: 8px; background: var(--bg); }
1081
+ .standup-controls { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
1082
+ .standup-controls button { min-width: 44px; }
1083
+ .standup-settings { margin-top: 12px; font-size: 13px; }
1084
+ .standup-settings label { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
1085
+ .standup-settings input[type="time"] { width: auto; }
1086
+ @media (max-width: 640px) {
1087
+ .standup-dialog { width: calc(100% - 32px); padding: 12px; }
1088
+ .standup-text { font-size: 16px; }
1089
+ }
1090
+
1091
+ /* ---------- Map: where agents are in the code */
1092
+ body.mapping .layout, body.mapping .watch-view { display: none; }
1093
+ .map-view { flex: 1; min-height: 0; overflow: auto; padding: 10px 16px 16px; background: var(--bg); display: flex; flex-direction: column; }
1094
+ .map-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--muted); }
1095
+ .map-key { display: inline-block; width: 14px; height: 10px; margin-left: 6px; border-radius: 3px; }
1096
+ .map-key.solid { background: var(--accent); }
1097
+ .map-key.ring { border: 2px solid var(--accent); }
1098
+ .map-key.red { height: 0; border-top: 3px solid var(--red); }
1099
+ .map-key.dash { height: 0; border-top: 3px dashed var(--yellow); }
1100
+ .map-warn ul { margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; }
1101
+ .map-warn li { padding: 5px 10px; margin-bottom: 4px; border-radius: 6px; border-left: 3px solid; background: var(--panel); }
1102
+ .map-warn li.collide { border-color: var(--red); }
1103
+ .map-warn li.heading { border-color: var(--yellow); }
1104
+ .map-warn .hint { margin: 0 0 8px; }
1105
+ .map-box { position: relative; flex: 1; min-height: 320px; border-radius: 8px; overflow: hidden; background: var(--panel); }
1106
+ .map-empty { margin: 40px auto; text-align: center; }
1107
+ .map-tile { position: absolute; box-sizing: border-box; border: 1px solid var(--bg); background: color-mix(in srgb, var(--border) 45%, var(--panel)); padding: 3px 5px; overflow: hidden; font-size: 11px; }
1108
+ .map-tile.active { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
1109
+ .map-tile.more { background: var(--bg); }
1110
+ .map-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1111
+ .map-count { color: var(--muted); }
1112
+ .map-badges { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
1113
+ .map-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 9.5px; font-weight: 700; box-sizing: border-box; }
1114
+ .map-badge.solid { background: var(--c); color: #fff; }
1115
+ .map-badge.ring { border: 2px solid var(--c); color: var(--c); background: var(--panel); }
1116
+ .map-badge.busy { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent); animation: pulse 1.4s infinite; }
1117
+ .map-badge.needs { outline: 2px solid var(--red); outline-offset: 1px; }
1118
+ .map-links { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
1119
+ .map-badge.collide { outline: 2px solid var(--red); outline-offset: 2px; }
1120
+ .map-badge.heading { outline: 2px dashed var(--yellow); outline-offset: 2px; }
1121
+ .map-links line { stroke-width: 3; stroke-linecap: round; }
1122
+ .map-links line.collide { stroke: var(--red); }
1123
+ .map-links line.heading { stroke: var(--yellow); stroke-dasharray: 6 5; }
1124
+ .map-agents { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
1125
+ .map-agent { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 2px 0; cursor: pointer; font-size: 13px; color: inherit; }
1126
+ #map-btn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
1127
+
1128
+ /* ---------- Jira: issues agents work on */
1129
+ .issues-dialog { width: min(1100px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 16px; }
1130
+ /* Only while open: a display on the dialog itself would keep a closed one on screen. */
1131
+ .issues-dialog[open] { display: flex; flex-direction: column; }
1132
+ #issues-body { display: flex; flex-direction: column; min-height: 0; }
1133
+ .issues-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
1134
+ .issues-head h2 { margin: 0 6px 0 0; font-size: 18px; }
1135
+ .issues-head .spacer { flex: 1; }
1136
+ .issues-head .chips { display: flex; flex-wrap: wrap; gap: 6px; }
1137
+ .issues-head .chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; }
1138
+ .issues-head .chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
1139
+ .issues-head .chip .count { opacity: 0.75; margin-left: 2px; }
1140
+ .issues-scroll { overflow: auto; min-height: 0; border: 1px solid var(--border); border-radius: var(--radius); }
1141
+ table.issues { width: 100%; border-collapse: collapse; font-size: 13px; }
1142
+ table.issues th { position: sticky; top: 0; background: var(--panel-2); text-align: left; font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
1143
+ table.issues td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
1144
+ table.issues tr:last-child td { border-bottom: 0; }
1145
+ table.issues .issue-key { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
1146
+ table.issues .issue-title { max-width: 360px; color: var(--text); }
1147
+ table.issues tr td:first-child { border-left: 3px solid transparent; }
1148
+ table.issues tr.stage-review td:first-child, table.issues tr.stage-approved td:first-child { border-left-color: var(--green); }
1149
+ table.issues tr.stage-needs td:first-child, table.issues tr.stage-blocked td:first-child { border-left-color: var(--red); }
1150
+ table.issues tr.stage-fixing td:first-child, table.issues tr.stage-working td:first-child { border-left-color: var(--yellow); }
1151
+ table.issues tr.stage-needs .issue-note, table.issues tr.stage-blocked .issue-note { color: var(--red); }
1152
+ table.issues tr.stage-review .issue-note, table.issues tr.stage-approved .issue-note { color: var(--green); font-weight: 600; }
1153
+ .jira-status { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; padding: 2px 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
1154
+ .jira-status.indeterminate { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
1155
+ .jira-status.done { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
1156
+ table.issues .checks.passed { color: var(--green); }
1157
+ table.issues .checks.failed { color: var(--red); }
1158
+ table.issues .checks.running { color: var(--yellow); }
1159
+ table.issues .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
1160
+ table.issues .dot.busy { background: var(--green); }
1161
+ table.issues .dot.idle { background: var(--muted); }
1162
+ .issues-empty { padding: 24px 4px; }
1163
+ @media (max-width: 640px) {
1164
+ .issues-dialog { width: calc(100% - 32px); padding: 12px; }
1165
+ table.issues .col-active { display: none; }
1166
+ table.issues .issue-title { max-width: 200px; }
1167
+ }
1168
+
1169
+ /* ---------- Designs: agents' design docs */
1170
+ .designs-search { width: 180px; }
1171
+ .designs-list { overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; }
1172
+ .design-card { border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: var(--panel); }
1173
+ .design-card.stage-review, .design-card.stage-approved { border-left-color: var(--green); }
1174
+ .design-card.stage-needs, .design-card.stage-blocked { border-left-color: var(--red); }
1175
+ .design-card.stage-fixing, .design-card.stage-working { border-left-color: var(--yellow); }
1176
+ .design-card header { display: flex; align-items: baseline; gap: 10px; }
1177
+ .design-card h3 { margin: 0; font-size: 15px; flex: 1; }
1178
+ .design-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: 13px; }
1179
+ .design-meta .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
1180
+ .design-meta .dot.busy { background: var(--green); }
1181
+ .design-meta .dot.idle { background: var(--muted); }
1182
+ .design-card.stage-review .design-note, .design-card.stage-approved .design-note { color: var(--green); font-weight: 600; }
1183
+ .design-card.stage-needs .design-note, .design-card.stage-blocked .design-note { color: var(--red); }
1184
+ .design-summary { margin: 8px 0 6px; font-size: 14px; line-height: 1.45; }
1185
+ .design-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
1186
+ .design-links .sep { color: var(--muted); }
1187
+ @media (max-width: 640px) {
1188
+ .designs-search { width: 100%; order: 10; }
1189
+ }
1190
+ table.issues td.nowrap { white-space: nowrap; }
1191
+ table.issues .steps { font-variant-numeric: tabular-nums; color: var(--muted); }
1192
+ table.issues .plan-review { color: var(--red); }
1193
+ table.issues .plan-approved { color: var(--green); }
1194
+ .issues-pickbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
1195
+ table.issues th.pick, table.issues td.pick { width: 28px; padding-right: 0; }
1196
+ table.issues tr.stage-proposed td:first-child { border-left-color: var(--accent); }
1197
+ table.issues tr.stage-proposed.ticked { background: color-mix(in srgb, var(--accent) 8%, transparent); }
1198
+ table.issues tr.stage-proposed .issue-note { color: var(--accent); }
1199
+
1200
+ /* ---------- Value */
1201
+ .value-dialog { width: min(1180px, calc(100% - 32px)); }
1202
+ .value-dialog[open] { overflow: auto; }
1203
+ .value-period { margin: 0 0 8px; }
1204
+ .value-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
1205
+ .value-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--panel); }
1206
+ .value-big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
1207
+ .value-delta { font-size: 12px; margin-top: 2px; }
1208
+ .value-delta.up { color: var(--green); }
1209
+ .value-delta.down { color: var(--red); }
1210
+ .value-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 6px 2px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
1211
+ .value-bar { flex: 1 0 28px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; color: var(--muted); }
1212
+ .value-bar .stack { display: flex; flex-direction: column-reverse; justify-content: flex-start; width: 70%; height: calc(100% - 18px); }
1213
+ .value-bar .val { background: var(--accent); border-radius: 3px 3px 0 0; min-height: 1px; }
1214
+ .value-bar .rev { background: color-mix(in srgb, var(--green) 70%, transparent); }
1215
+ .value-bar .lbl { font-size: 11px; height: 18px; line-height: 18px; white-space: nowrap; }
1216
+ .value-bar.on .lbl { color: var(--text); font-weight: 700; }
1217
+ .value-bar.on .stack { outline: 2px solid var(--text); outline-offset: 1px; }
1218
+ .value-legend { margin: 6px 0 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
1219
+ .value-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
1220
+ .value-legend .sw.val { background: var(--accent); }
1221
+ .value-legend .sw.rev { background: color-mix(in srgb, var(--green) 70%, transparent); }
1222
+ table.value-items td.mine { color: var(--accent); font-weight: 600; }
1223
+ table.value-items tr.excluded td { opacity: 0.5; text-decoration: line-through; }
1224
+ table.value-items tr.excluded td:last-child { text-decoration: none; opacity: 1; }
1225
+ table.value-items tr.value-edit td { background: var(--panel-2); }
1226
+ .value-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
1227
+ .value-fields input::placeholder { color: var(--muted); opacity: 0.8; }
1228
+ .value-settings { margin-top: 14px; }
1229
+ .value-settings summary { cursor: pointer; font-weight: 600; }
1230
+ .value-report-kinds { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
1231
+ .value-report-kinds input[type="time"] { width: auto; }
1232
+ input.inline { width: 64px; display: inline-block; padding: 2px 4px; }