create-pmos 0.352.0 → 0.354.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/package.json +25 -35
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-test.js +75 -47
- package/workspace/briefing-premium-work-test.js +1 -1
- package/workspace/changelog.json +24 -0
- package/workspace/guide/briefing-premium.md +14 -4
- package/workspace/lib/briefing-premium-agent.js +1 -1
- package/workspace/lib/briefing-premium.js +1 -1
- package/workspace/lib/goal-chat.js +11 -2
- package/workspace/lib/routes-briefing-premium.js +5 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/premium-insights.js +2 -2
- package/workspace/public/pm/premium-shell.js +172 -81
- package/workspace/public/pm/premium.css +83 -14
- package/workspace/public/pm/premium.js +1 -2
- package/workspace/public/pm/session-rail.js +92 -0
- package/workspace/server.js +21 -0
- package/workspace/test-files.json +2 -0
|
@@ -7,6 +7,7 @@ import { chipActs, openLive, openFocus, mountRecord, HL_LINE } from './premium-v
|
|
|
7
7
|
import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words.js';
|
|
8
8
|
import { splitGoal, shownUser, goalBlockHtml, goalProgressHtml, slashMatches } from './goal-chat.js';
|
|
9
9
|
import { mdHtml, userHtml, toolLine, webKind } from './chat-md.js';
|
|
10
|
+
import { railModel, railHtml, teaser, menuCount, loudestRow, factsOf, titleOf, DOT, WORD } from './session-rail.js';
|
|
10
11
|
export const $ = (s, r = document) => r.querySelector(s);
|
|
11
12
|
export const $$ = (s, r = document) => [...r.querySelectorAll(s)];
|
|
12
13
|
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
@@ -14,7 +15,7 @@ export const RM = matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
|
14
15
|
export const store = { get(k) { try { return localStorage.getItem(k); } catch { return null; } }, set(k, v) { try { localStorage.setItem(k, v); } catch { /* no storage */ } } };
|
|
15
16
|
export const THEME_KEY = 'pmos.c3.theme';
|
|
16
17
|
export const AI = '<svg class="i" viewBox="0 0 24 24"><path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/></svg>';
|
|
17
|
-
export const S = { key: null }; // the key of the row whose dialog is open (the agent's thread belongs to it)
|
|
18
|
+
export const S = { key: null, sid: null }; // the key of the row whose dialog is open (the agent's thread belongs to it); sid: a session the list opened that has no row (premium-session-list)
|
|
18
19
|
let lastFocus = null;
|
|
19
20
|
/* ── theme ──────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
20
21
|
export function theme(t) {
|
|
@@ -27,7 +28,7 @@ export function flip() {
|
|
|
27
28
|
}
|
|
28
29
|
{ const t = new URLSearchParams(location.search).get('theme') || store.get(THEME_KEY); theme(t); }
|
|
29
30
|
/* ── the top bar (initiative premium-topbar): where you are and Chat on the left; the Sources chip, the bell and one menu on the right.
|
|
30
|
-
* The menu holds what left the bar: Search,
|
|
31
|
+
* The menu holds what left the bar: Search, Sessions, Console, Theme, Settings, and on Board how an initiative opens. Every item keeps
|
|
31
32
|
* the id the pages and the code below wire, so a press does what it did as a round button. ── */
|
|
32
33
|
export const CHAT = '<svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg>';
|
|
33
34
|
const MORE = '<svg class="i" viewBox="0 0 24 24"><circle cx="6" cy="12" r="1.3"/><circle cx="12" cy="12" r="1.3"/><circle cx="18" cy="12" r="1.3"/></svg>';
|
|
@@ -40,7 +41,7 @@ function tbMount() {
|
|
|
40
41
|
+ '<div class="crmenu tbmenu" id="moreMenu" role="menu" aria-label="More" hidden>'
|
|
41
42
|
+ '<button role="menuitem" id="pvSearch" aria-haspopup="dialog">Search<em>Ctrl K</em></button>'
|
|
42
43
|
+ '<button role="menuitem" id="srcItem" class="tbm-src" aria-haspopup="dialog">Sources</button>'
|
|
43
|
-
+ '<button role="menuitem" id="sessBtn" aria-haspopup="dialog" aria-label="
|
|
44
|
+
+ '<button role="menuitem" id="sessBtn" aria-haspopup="dialog" aria-label="Sessions">Sessions<em id="sessBdg" hidden></em></button>'
|
|
44
45
|
+ '<a role="menuitem" id="toConsole" href="/console.html" aria-label="Open the console">Console</a>'
|
|
45
46
|
+ '<div class="tbrow" id="modeRow" hidden><span>Open initiatives</span></div>'
|
|
46
47
|
+ `<div class="tbrow" role="group" aria-label="Theme"><span>Theme</span><span class="tbseg" id="tbTheme">${TH.map(([k, w]) => `<button role="menuitemradio" data-th="${k}" aria-checked="false">${w}</button>`).join('')}</span></div>`
|
|
@@ -157,7 +158,7 @@ export function openPageChat(key, page) {
|
|
|
157
158
|
$('#askIn').placeholder = 'Message Claude about this page';
|
|
158
159
|
loadThread(key);
|
|
159
160
|
}
|
|
160
|
-
tbMount(); // the top bar first: the menu holds the Settings,
|
|
161
|
+
tbMount(); // the top bar first: the menu holds the Settings, Sessions, Console and Search items the code below wires
|
|
161
162
|
{ const t2 = $('#theme2'); if (t2) t2.onclick = flip; }
|
|
162
163
|
{ const b = $('#settingsBtn'); if (b) b.onclick = () => openSettings(); } // hoisted: the function below is declared, not assigned
|
|
163
164
|
|
|
@@ -193,14 +194,15 @@ export function openDlg(o) {
|
|
|
193
194
|
$('#dlg').inert = false; document.documentElement.style.overflow = 'hidden';
|
|
194
195
|
$('#dEye').textContent = o.eye; $('#dTitle').textContent = o.title; $('#dSub').textContent = o.sub || ''; $('#dSub').hidden = !o.sub;
|
|
195
196
|
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail'; vwReset(); // extra viewer tabs belong to the dialog that opened them
|
|
196
|
-
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div><
|
|
197
|
+
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div><textarea id="askIn" rows="1" placeholder="Message Claude, or type /" maxlength="8000" autocomplete="off" enterkeyhint="send" aria-label="A message for Claude" aria-controls="slashM"></textarea><button type="submit" data-act="ask" id="askGo" aria-label="Send to Claude" title="Send to Claude"><svg class="i" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></form><p class="fine2" id="askNote">${CHAT_NOTE}</p>`;
|
|
197
198
|
$('#dlg').classList.remove('full'); setMode('split'); setTab('out'); // on a phone the dialog opens on the Detail tab and the Detail / Conversation switch brings the conversation, as the mockup draws it
|
|
198
199
|
$('#veil').classList.add('on'); $('#dlg').classList.add('on');
|
|
199
200
|
$$('#dGrid .pane').forEach((p) => { p.scrollTop = 0; });
|
|
201
|
+
railOnOpen(o);
|
|
200
202
|
setTimeout(() => $('#dlg').focus(), 60);
|
|
201
203
|
}
|
|
202
204
|
export function closeDlg() {
|
|
203
|
-
clearTimeout(threadTimer); S.key = null;
|
|
205
|
+
clearTimeout(threadTimer); S.key = null; railOnClose();
|
|
204
206
|
park();
|
|
205
207
|
$('#veil').classList.remove('on'); $$('.rail,main.stage,#dock').forEach((x) => { x.inert = false; });
|
|
206
208
|
$('#dlg').inert = true; document.documentElement.style.overflow = ''; $('#dlg').classList.remove('on');
|
|
@@ -216,7 +218,7 @@ export function setMode(m) {
|
|
|
216
218
|
if (innerWidth < 1000) setTab(m === 'detail' ? 'out' : 'chat');
|
|
217
219
|
}
|
|
218
220
|
$('#dPane').onclick = () => setMode($('#dlg').dataset.mode === 'split' ? 'detail' : 'split');
|
|
219
|
-
export function setFull(f) { $('#dlg').classList.toggle('full', f); const b = $('#dExpand'); b.setAttribute('aria-pressed', f); b.title = f ? 'Exit full screen' : 'Full screen'; $('#dExpP').setAttribute('d', f ? 'M20 10h-6V4M4 14h6v6M14 10l7-7M3 21l7-7' : 'M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'); }
|
|
221
|
+
export function setFull(f) { $('#dlg').classList.toggle('full', f); $('#dlg').classList.remove('srl-open'); if (R.model) railDraw(); if (f) { railRead(); railTick(); } const b = $('#dExpand'); b.setAttribute('aria-pressed', f); b.title = f ? 'Exit full screen' : 'Full screen'; $('#dExpP').setAttribute('d', f ? 'M20 10h-6V4M4 14h6v6M14 10l7-7M3 21l7-7' : 'M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'); }
|
|
220
222
|
$('#tabGo').onclick = () => setTab('chat');
|
|
221
223
|
$('#dClose').onclick = closeDlg; $('#veil').onclick = closeDlg;
|
|
222
224
|
$('#dExpand').onclick = () => setFull(!$('#dlg').classList.contains('full'));
|
|
@@ -311,8 +313,9 @@ function readyDraft(conv) {
|
|
|
311
313
|
}
|
|
312
314
|
const chatPost = (act, body) => { const ws = new URLSearchParams(location.search).get('ws'); return pmPost('/api/briefing-premium/' + act + (ws ? '?ws=' + encodeURIComponent(ws) : ''), body).catch(() => null); };
|
|
313
315
|
$('#dBody').addEventListener('click', async (e) => {
|
|
314
|
-
const p = e.target.closest('[data-chat-press]'); if (!p || !S.key) return;
|
|
316
|
+
const p = e.target.closest('[data-chat-press]'); if (!p || (!S.key && !S.sid)) return;
|
|
315
317
|
p.disabled = true;
|
|
318
|
+
if (S.sid) { const id = S.sid, r = await pmPost('/api/session/keys', { id, press: p.dataset.chatPress }); if (!r || !r.ok) $('#askNote').textContent = (r && r.error) || 'The key did not reach the session.'; setTimeout(() => loadSid(id), 500); return; }
|
|
316
319
|
const r = await chatPost('press', { key: S.key, press: p.dataset.chatPress });
|
|
317
320
|
if (!r || !r.ok) $('#askNote').textContent = (r && r.error) || 'The key did not reach the session.';
|
|
318
321
|
setTimeout(() => loadThread(S.key), 500);
|
|
@@ -368,21 +371,33 @@ function drawSlash() {
|
|
|
368
371
|
m.innerHTML = list.map((x, i) => `<button type="button" role="option" id="slash-${i}" aria-selected="${i === slashAt}" class="${i === slashAt ? 'sel' : ''}" data-slash="${esc(x.cmd)}"><code>${esc(x.cmd)}</code><b>${esc(x.name)}</b><em>${esc(x.say)}</em></button>`).join('');
|
|
369
372
|
m.hidden = false; m.setAttribute('data-esc-layer', ''); inp.setAttribute('aria-activedescendant', 'slash-' + slashAt);
|
|
370
373
|
}
|
|
371
|
-
function pickSlash(cmd) { const inp = $('#askIn'); inp.value = cmd + ' '; slashAt = 0; drawSlash(); inp.focus(); }
|
|
372
|
-
|
|
374
|
+
function pickSlash(cmd) { const inp = $('#askIn'); inp.value = cmd + ' '; slashAt = 0; drawSlash(); growAsk(); inp.focus(); }
|
|
375
|
+
/** The reply box grows with its lines up to the CSS max-height, then scrolls. Call it after any code sets the value. */
|
|
376
|
+
export function growAsk() {
|
|
377
|
+
const t = $('#askIn'); if (!t || t.tagName !== 'TEXTAREA') return;
|
|
378
|
+
t.style.height = 'auto'; t.style.height = t.scrollHeight + 'px';
|
|
379
|
+
}
|
|
380
|
+
$('#dBody').addEventListener('input', (e) => { if (e.target.id === 'askIn') { slashAt = 0; drawSlash(); growAsk(); } });
|
|
373
381
|
$('#dBody').addEventListener('keydown', (e) => {
|
|
374
|
-
if (e.target.id !== 'askIn') return;
|
|
375
|
-
const list = slashMatches(e.target.value)
|
|
376
|
-
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') { e.preventDefault(); slashAt = (slashAt + (e.key === 'ArrowDown' ? 1 : list.length - 1)) % list.length; drawSlash(); }
|
|
377
|
-
else if (e.key === 'Tab' || (e.key === 'Enter' && e.target.value !== list[slashAt].cmd)) { e.preventDefault(); pickSlash(list[slashAt].cmd); }
|
|
378
|
-
else if (e.key === 'Escape') { e.preventDefault(); e.target.value = ''; drawSlash(); }
|
|
382
|
+
if (e.target.id !== 'askIn' || e.isComposing || e.keyCode === 229) return; // an IME is still composing: its Enter picks the word, it does not send
|
|
383
|
+
const list = slashMatches(e.target.value), menu = list.length && !$('#slashM').hidden;
|
|
384
|
+
if (menu && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) { e.preventDefault(); slashAt = (slashAt + (e.key === 'ArrowDown' ? 1 : list.length - 1)) % list.length; drawSlash(); }
|
|
385
|
+
else if (menu && (e.key === 'Tab' || (e.key === 'Enter' && !e.shiftKey && e.target.value !== list[slashAt].cmd))) { e.preventDefault(); pickSlash(list[slashAt].cmd); }
|
|
386
|
+
else if (menu && e.key === 'Escape') { e.preventDefault(); e.target.value = ''; drawSlash(); growAsk(); }
|
|
387
|
+
else if (e.key === 'Enter' && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey) { e.preventDefault(); e.target.form.requestSubmit(); } // Enter sends, Shift+Enter is a new line
|
|
379
388
|
});
|
|
380
389
|
$('#dBody').addEventListener('submit', async (e) => {
|
|
381
390
|
e.preventDefault();
|
|
382
391
|
const inp = $('#askIn'), text = inp.value.trim(), key = S.key;
|
|
392
|
+
if (!key && S.sid) { // premium-session-list: a session the list opened that has no row of its own
|
|
393
|
+
if (!text) { $('#askNote').textContent = 'Write a message for Claude.'; return; }
|
|
394
|
+
const id = S.sid, r = await pmPost('/api/session/say', { id, text });
|
|
395
|
+
if (!r || !r.ok) { $('#askNote').textContent = (r && r.error) || 'The message was not sent.'; return; }
|
|
396
|
+
inp.value = ''; $('#askNote').textContent = 'Sent.'; drawSlash(); setTimeout(() => loadSid(id), 400); return;
|
|
397
|
+
}
|
|
383
398
|
if (!key) { $('#askNote').textContent = 'This row has no conversation, so the message was not sent.'; return; }
|
|
384
399
|
if (!text) { $('#askNote').textContent = 'Write a message for Claude.'; return; }
|
|
385
|
-
if (await sendText(key, text)) { inp.value = ''; inp.placeholder = 'Message Claude, or type /'; drawSlash(); }
|
|
400
|
+
if (await sendText(key, text)) { inp.value = ''; inp.placeholder = 'Message Claude, or type /'; drawSlash(); growAsk(); }
|
|
386
401
|
});
|
|
387
402
|
|
|
388
403
|
/* ── the hero folds into the dock on scroll ─────────────────────────────────────────────────────────────── */
|
|
@@ -851,76 +866,152 @@ export async function openSettings() {
|
|
|
851
866
|
await load();
|
|
852
867
|
}
|
|
853
868
|
|
|
854
|
-
/* ──
|
|
855
|
-
*
|
|
856
|
-
*
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
const
|
|
863
|
-
const
|
|
864
|
-
|
|
869
|
+
/* ── Sessions: the list beside the chat (initiative premium-session-list; PM decisions 2026-10-20) ─────────────────────────────────────────
|
|
870
|
+
* In full screen the dialog has three panels: the session list, the conversation and the viewer; the list and the viewer fold. A normal-size
|
|
871
|
+
* chat dialog shows a chip that opens the list. The list reads GET /api/sessions (the list the console dock reads) and the goals of the chat
|
|
872
|
+
* conversations; lib/session-rail.js groups them. Pressing a row switches the dialog to that session: a chat row opens its own conversation,
|
|
873
|
+
* any other session its transcript. The writes are a page press each: a message or a key (POST /api/session/say|keys), Stop (/api/session/remove)
|
|
874
|
+
* and an answer to a run's question (/api/runs/answer). The Agent sessions popup this replaces is gone; the ⋯ menu's Sessions opens this. */
|
|
875
|
+
const R = { rows: [], goals: {}, model: null, sel: null, shut: [], showAll: false, timer: null, asks: {}, ask: null, busy: false, slow: null, err: '', sidTimer: null,
|
|
876
|
+
railMin: store.get('pmos.srl.rail') === 'min', viewMin: store.get('pmos.srl.view') === 'min' };
|
|
877
|
+
const SRL_POLL = 3000, BADGE_POLL = 15000;
|
|
878
|
+
const desk = () => innerWidth >= 1000;
|
|
879
|
+
const railShowing = () => $('#dlg').classList.contains('on') && $('#dlg').classList.contains('srl-on') && ($('#dlg').classList.contains('full') ? desk() : $('#dlg').classList.contains('srl-open'));
|
|
880
|
+
function railMount() {
|
|
881
|
+
const g = $('#dGrid'); if (!g || $('#sRail')) return;
|
|
882
|
+
g.insertAdjacentHTML('afterbegin', `<aside class="srl" id="sRail" aria-label="Sessions"><div class="srl-hd"><b>Sessions</b><button type="button" class="srl-fold" id="srlFold" aria-label="Fold the list" title="Fold the list"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M9 4v16"/></svg></button></div><div class="srl-list" id="srlList"></div><div class="srl-lg" aria-hidden="true"><span><i class="sdot2 ready"></i>Ready</span><span><i class="sdot2 run"></i>Running</span><span><i class="sdot2 blk"></i>Maybe blocked</span></div></aside>`);
|
|
883
|
+
$('#dlg .dtools').insertAdjacentHTML('afterbegin', '<button type="button" class="stease" id="sTease" aria-haspopup="true" hidden><i class="sdot2" aria-hidden="true"></i><span>Sessions</span><em></em></button>');
|
|
884
|
+
const ot = $('#dOut .otop'); if (ot) ot.insertAdjacentHTML('afterbegin', '<button type="button" class="vfold" id="vFold" aria-label="Fold the viewer" title="Fold the viewer"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M15 4v16"/></svg></button>');
|
|
885
|
+
$('#srlFold').onclick = () => { R.railMin = !R.railMin; store.set('pmos.srl.rail', R.railMin ? 'min' : 'open'); railLayout(); };
|
|
886
|
+
$('#vFold').onclick = () => { R.viewMin = !R.viewMin; store.set('pmos.srl.view', R.viewMin ? 'min' : 'open'); railLayout(); };
|
|
887
|
+
$('#sTease').onclick = () => {
|
|
888
|
+
if (desk()) { setFull(true); railLayout(); railRead(); return; }
|
|
889
|
+
$('#dlg').classList.toggle('srl-open'); railDraw(); if ($('#dlg').classList.contains('srl-open')) railRead();
|
|
890
|
+
};
|
|
891
|
+
$('#srlList').onclick = (e) => {
|
|
892
|
+
const gh = e.target.closest('[data-sg]'), mo = e.target.closest('[data-smore]'), r = e.target.closest('[data-sid]');
|
|
893
|
+
if (mo) { R.showAll = !R.showAll; railDraw(); return; }
|
|
894
|
+
if (gh) { if (R.railMin) { R.railMin = false; store.set('pmos.srl.rail', 'open'); railLayout(); return; } const k = gh.dataset.sg; R.shut = R.shut.includes(k) ? R.shut.filter((x) => x !== k) : [...R.shut, k]; railDraw(); return; }
|
|
895
|
+
if (r) pickSession(r.dataset.sid);
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
function railLayout() {
|
|
899
|
+
const d = $('#dlg');
|
|
900
|
+
d.classList.toggle('srl-min', R.railMin); d.classList.toggle('vw-min', R.viewMin);
|
|
901
|
+
const f = $('#srlFold'), v = $('#vFold');
|
|
902
|
+
if (f) { f.title = R.railMin ? 'Open the list' : 'Fold the list'; f.setAttribute('aria-label', f.title); f.setAttribute('aria-pressed', String(R.railMin)); }
|
|
903
|
+
if (v) { v.title = R.viewMin ? 'Open the viewer' : 'Fold the viewer'; v.setAttribute('aria-label', v.title); v.setAttribute('aria-pressed', String(R.viewMin)); }
|
|
904
|
+
}
|
|
905
|
+
function railDraw() {
|
|
906
|
+
const m = R.model = railModel(R.rows, R.goals, { showAll: R.showAll });
|
|
907
|
+
const l = $('#srlList'); if (l) l.innerHTML = railHtml(m, { sel: R.sel, shut: R.shut, showAll: R.showAll });
|
|
908
|
+
const t = $('#sTease'), tz = teaser(m);
|
|
909
|
+
if (t) {
|
|
910
|
+
t.hidden = !tz || !t.dataset.on || $('#dlg').classList.contains('full');
|
|
911
|
+
if (tz) { $('i', t).className = 'sdot2 ' + tz.dot; $('em', t).textContent = tz.text; t.setAttribute('aria-label', 'Sessions, ' + tz.text + '. Switch between sessions'); t.title = 'Switch between sessions'; t.setAttribute('aria-expanded', String($('#dlg').classList.contains('srl-open'))); }
|
|
912
|
+
}
|
|
913
|
+
sessBadge(menuCount(R.rows));
|
|
914
|
+
}
|
|
915
|
+
async function railRead() {
|
|
916
|
+
const [s, g] = await Promise.all([pmGet('/api/sessions').catch(() => null), pmGet('/api/briefing-premium/goals').catch(() => null)]);
|
|
917
|
+
if (s && Array.isArray(s.sessions)) R.rows = s.sessions;
|
|
918
|
+
if (g && g.ok && g.goals) R.goals = g.goals;
|
|
919
|
+
if (R.sel && !R.rows.some((x) => x.id === R.sel && x.shown !== 'exited') && S.sid === R.sel) { S.sid = null; sessionCard(null); }
|
|
920
|
+
railDraw();
|
|
921
|
+
}
|
|
922
|
+
function railTick() { clearTimeout(R.timer); R.timer = setTimeout(async () => { if (!document.hidden && railShowing()) await railRead(); railTick(); }, SRL_POLL); }
|
|
923
|
+
/** openDlg calls this: a dialog with a conversation shows the chip; the list marks the session this dialog's conversation runs in. */
|
|
924
|
+
function railOnOpen(o) {
|
|
925
|
+
railMount(); clearTimeout(R.sidTimer); S.sid = null; R.ask = null; R.slow = null; R.err = '';
|
|
926
|
+
$('#dlg').classList.remove('srl-open');
|
|
927
|
+
const t = $('#sTease'); if (t) { if (o.noteKey || o.sessions) t.dataset.on = '1'; else delete t.dataset.on; }
|
|
928
|
+
$('#dlg').classList.toggle('srl-on', !!(o.noteKey || o.sessions)); // only a dialog with a conversation gets the list
|
|
929
|
+
R.sel = o.noteKey ? ((R.rows.find((x) => x.origin === 'chat:' + o.noteKey && x.shown !== 'exited') || {}).id || null) : null;
|
|
930
|
+
railLayout(); railDraw(); railRead().then(() => { if (o.noteKey && !R.sel) { R.sel = (R.rows.find((x) => x.origin === 'chat:' + o.noteKey && x.shown !== 'exited') || {}).id || null; railDraw(); } });
|
|
931
|
+
railTick();
|
|
932
|
+
}
|
|
933
|
+
function railOnClose() { clearTimeout(R.timer); clearTimeout(R.sidTimer); S.sid = null; $('#dlg').classList.remove('srl-open'); }
|
|
934
|
+
/** Switch the dialog to one session. A chat row is its own conversation (key); any other session is read from its transcript (S.sid). */
|
|
935
|
+
function pickSession(id) {
|
|
936
|
+
const r = (R.model && R.model.rows.find((x) => x.id === id)) || null; if (!r) return;
|
|
937
|
+
clearTimeout(R.sidTimer); R.sel = id; R.ask = null; R.slow = null; R.err = '';
|
|
938
|
+
$('#dlg').classList.remove('srl-open');
|
|
939
|
+
$('#dEye').textContent = r.group === 'pmos' ? 'Started by PMOS' : r.goal ? 'Goal' : 'Session'; $('#dTitle').textContent = r.name; $('#dSub').hidden = true;
|
|
940
|
+
const st = $('#dBody .stream'); if (st) st.innerHTML = '';
|
|
941
|
+
$('#askF').hidden = !!r.headless; $('#askIn').value = ''; $('#askIn').placeholder = r.key ? 'Message Claude, or type /' : 'Message this session';
|
|
942
|
+
if (r.key) { S.sid = null; S.key = r.key; loadThread(r.key); } else { S.key = null; S.sid = id; loadSid(id); }
|
|
943
|
+
sessionCard(r); railDraw();
|
|
944
|
+
if (!desk()) setTab('chat');
|
|
945
|
+
const go = $('#askIn'); if (go && !r.headless && desk()) go.focus();
|
|
946
|
+
}
|
|
947
|
+
async function loadSid(id) {
|
|
948
|
+
clearTimeout(R.sidTimer);
|
|
949
|
+
const c = await pmGet('/api/sessions/conversation?id=' + encodeURIComponent(id)).catch(() => null);
|
|
950
|
+
if (S.sid !== id) return;
|
|
951
|
+
const box = $('#dBody .stream'); if (!box) return;
|
|
952
|
+
const b = $('#dBody'), atEnd = b.scrollHeight - b.scrollTop - b.clientHeight < 80;
|
|
953
|
+
box.innerHTML = c && c.ok ? sessionHtml(c) : turnA(ptx('The conversation of this session could not be read.'));
|
|
954
|
+
$('#askNote').textContent = c && c.ask ? 'Claude is waiting for your answer above.' : 'Your message goes to this session.';
|
|
955
|
+
if (atEnd) b.scrollTop = b.scrollHeight;
|
|
956
|
+
if (c && c.ok && c.state !== 'ended' && $('#dlg').classList.contains('on')) R.sidTimer = setTimeout(() => loadSid(id), 2000);
|
|
957
|
+
}
|
|
958
|
+
/* the viewer for a session the list opened: its facts, the question a run asks, and Stop (asks first; says so when it has not exited yet) */
|
|
959
|
+
async function sessionCard(r) {
|
|
960
|
+
vwReset(); $('#oLab').textContent = 'Session';
|
|
961
|
+
if (!r) { $('#oMain').innerHTML = '<article class="paper doc"><p class="note">This session has ended. Pick another from the list.</p></article>'; return; }
|
|
962
|
+
const runs = await pmGet('/api/runs').catch(() => null); R.asks = {};
|
|
963
|
+
if (runs && runs.ok && runs.cards) for (const [k, c] of Object.entries(runs.cards)) if (c && c.state === 'asking' && c.ask && c.ask.q && Array.isArray(c.ask.options) && c.ask.options.length) R.asks[k] = { request: c.asked || c.ask.id, q: c.ask.q, options: c.ask.options };
|
|
964
|
+
cardDraw(r);
|
|
965
|
+
}
|
|
966
|
+
function cardDraw(r) {
|
|
967
|
+
if (R.sel !== r.id) return;
|
|
968
|
+
const q = R.asks[r.id], what = r.headless ? 'This ends the background run.' : 'This ends the session and closes its terminal.';
|
|
969
|
+
$('#oMain').innerHTML = `<article class="paper doc scard"><p class="scs"><i class="sdot2 ${DOT[r.state]}" aria-hidden="true"></i>${esc(WORD[r.state])}</p><h3 class="d2">${esc(r.name)}</h3>${kv(factsOf(r))}
|
|
970
|
+
${q ? `<div class="ssc ssq" role="group" aria-label="${esc(r.name)} asks"><p><b>${esc(q.q)}</b></p><div class="ssx">${q.options.map((o) => `<button type="button" class="cta${o.rec ? '' : ' alt'}" data-ans="${esc(o.label)}"${R.busy ? ' disabled' : ''}>${esc(o.label)}</button>`).join('')}</div></div>` : ''}
|
|
971
|
+
${R.ask ? `<div class="ssc" role="group" aria-label="Confirm stop"><p><b>Stop “${esc(r.name)}”?</b> ${what} Files it already wrote stay where they are.</p><div class="ssx"><button type="button" class="cta bad" data-yes="1">Stop</button><button type="button" class="cta alt" data-no="1">Keep running</button></div></div>`
|
|
972
|
+
: R.slow ? `<div class="ssc" role="group" aria-label="Still running"><p><b>Asked “${esc(r.name)}” to end.</b> It has not exited yet. Press Stop again to remove it.</p><div class="ssx"><button type="button" class="cta bad" data-yes="1">Stop again</button><button type="button" class="cta alt" data-no="1">Keep running</button></div></div>`
|
|
973
|
+
: `<div class="ssx"><button type="button" class="cta alt" data-stop="1"${R.busy ? ' disabled' : ''}>${R.busy ? 'Ending…' : 'Stop'}</button></div>`}
|
|
974
|
+
<p class="note" role="status">${esc(R.err)}</p><p class="note">Its terminal is in the console. <a href="/console.html">Open the console</a>.</p></article>`;
|
|
975
|
+
}
|
|
976
|
+
$('#oMain').addEventListener('click', async (e) => {
|
|
977
|
+
const card = e.target.closest('.scard'); if (!card || R.busy) return;
|
|
978
|
+
const r = R.model && R.model.rows.find((x) => x.id === R.sel); if (!r) return;
|
|
979
|
+
const an = e.target.closest('[data-ans]'), st = e.target.closest('[data-stop]'), yes = e.target.closest('[data-yes]'), no = e.target.closest('[data-no]');
|
|
980
|
+
R.err = '';
|
|
981
|
+
if (an) {
|
|
982
|
+
const a = R.asks[r.id]; if (!a) return;
|
|
983
|
+
R.busy = true; cardDraw(r);
|
|
984
|
+
const res = await pmPost('/api/runs/answer', { run: r.id, request: a.request, behavior: 'answer', message: an.dataset.ans }); R.busy = false;
|
|
985
|
+
if (res && res.ok) { toast('Answered. The agent continues with your choice.'); delete R.asks[r.id]; } else R.err = (res && (res.error || res.reason)) || 'Not answered.';
|
|
986
|
+
cardDraw(r); return;
|
|
987
|
+
}
|
|
988
|
+
if (st) { R.ask = true; cardDraw(r); const k = $('#oMain [data-no]'); if (k) k.focus(); return; }
|
|
989
|
+
if (no) { R.ask = null; R.slow = null; cardDraw(r); return; }
|
|
990
|
+
if (yes) {
|
|
991
|
+
R.busy = true; R.ask = null; R.slow = null; cardDraw(r);
|
|
992
|
+
const res = await pmPost('/api/session/remove', { id: r.id }); R.busy = false;
|
|
993
|
+
if (res && res.ok && res.removed === false) R.slow = true; // asked to end, not exited yet: say so, never claim an end that did not happen
|
|
994
|
+
else if (res && res.ok) { toast('Ended “' + r.name + '”.'); R.rows = R.rows.filter((x) => x.id !== r.id); if (S.sid === r.id) S.sid = null; R.sel = null; railDraw(); sessionCard(null); railRead(); return; }
|
|
995
|
+
else R.err = (res && (res.error || res.reason)) || 'Not stopped.';
|
|
996
|
+
cardDraw(r);
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
function sessBadge(n) { const b = $('#sessBdg'); if (!b) return; b.textContent = String(n || ''); b.hidden = !n; const a = $('#sessBtn'); if (a) a.setAttribute('aria-label', 'Sessions, ' + (n ? n + ' need you' : 'none need you')); }
|
|
865
1000
|
{
|
|
866
1001
|
const b = $('#sessBtn');
|
|
867
1002
|
if (b) {
|
|
868
1003
|
b.onclick = () => openSessions();
|
|
869
|
-
const poll = async () => { if (document.hidden) return; const
|
|
870
|
-
poll(); setInterval(poll,
|
|
1004
|
+
const poll = async () => { if (document.hidden || railShowing()) return; const s = await pmGet('/api/sessions').catch(() => null); if (s && Array.isArray(s.sessions)) { R.rows = s.sessions; sessBadge(menuCount(R.rows)); } };
|
|
1005
|
+
poll(); setInterval(poll, BADGE_POLL);
|
|
871
1006
|
}
|
|
872
1007
|
}
|
|
1008
|
+
/** The ⋯ menu's Sessions: the chat panel, full screen with the list (the list itself on a phone), on the session that needs you most. */
|
|
873
1009
|
export async function openSessions() {
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
const what = x.headless ? 'This ends the background run.' : 'This ends the session and closes its terminal.';
|
|
882
|
-
return `<li class="ssr"${busy ? ' aria-busy="true"' : ''}><i class="ssd ${esc(x.shown || '')}" aria-hidden="true"></i>
|
|
883
|
-
<div class="ssb"><h3>${esc(x.name)}</h3><p class="ssn">${esc(x.note || 'No note')}</p>
|
|
884
|
-
<p class="ssm">${[x.headless ? 'Background run' : '', x.agent, x.label, x.cwd, sessAgo(x.created), x.automatic ? 'Started by PMOS' : ''].filter(Boolean).map((t) => `<span>${esc(t)}</span>`).join('')}</p></div>
|
|
885
|
-
<button type="button" class="cta alt" data-stop="${esc(x.id)}" aria-label="Stop ${esc(x.name)}"${ask || busy || slow ? ' disabled' : ''}>${busy ? 'Ending…' : 'Stop'}</button>
|
|
886
|
-
${M.asks[x.id] ? `<div class="ssc ssq" role="group" aria-label="${esc(x.name)} asks"><p><b>${esc(M.asks[x.id].q)}</b></p><div class="ssx">${M.asks[x.id].options.map((o) => `<button type="button" class="cta${o.rec ? '' : ' alt'}" data-ans="${esc(x.id)}" data-opt="${esc(o.label)}"${M.ans ? ' disabled' : ''}>${esc(o.label)}</button>`).join('')}</div></div>` : ''}
|
|
887
|
-
${ask && !busy ? `<div class="ssc" role="group" aria-label="Confirm stop"><p><b>Stop “${esc(x.name)}”?</b> ${what} Files it already wrote stay where they are.</p><div class="ssx"><button type="button" class="cta bad" data-yes="${esc(x.id)}">Stop</button><button type="button" class="cta alt" data-no="${esc(x.id)}">Keep running</button></div></div>` : ''}
|
|
888
|
-
${slow ? `<div class="ssc" role="group" aria-label="Still running"><p><b>Asked “${esc(x.name)}” to end.</b> It has not exited yet. Press Stop again to remove it.</p><div class="ssx"><button type="button" class="cta bad" data-yes="${esc(x.id)}">Stop again</button><button type="button" class="cta alt" data-no="${esc(x.id)}">Keep running</button></div></div>` : ''}</li>`;
|
|
889
|
-
}).join('')}</ul>` : '<div class="sse"><b>No agent sessions running.</b><p>New sessions start in the console.</p></div>';
|
|
890
|
-
const w = l ? sessWorking(l) : 0;
|
|
891
|
-
const warn = w > SESS_MANY ? `<p class="note ssw" role="status"><b>${w} agents are working at once.</b> Each one is a program running on this computer, so many at once can slow it. Stop the ones you are not watching.</p>` : '';
|
|
892
|
-
$('#oMain').innerHTML = `<article class="paper doc"><div class="addf">${warn}${rows}
|
|
893
|
-
<p class="note" id="ssM" role="status" style="margin:0;min-height:1.2em">${esc(M.err)}</p>
|
|
894
|
-
<p class="note" style="margin:0">Terminals and new sessions stay in the console. <a href="/console.html">Open the console</a>.</p></div></article>`;
|
|
895
|
-
};
|
|
896
|
-
openDlg({ eye: 'Agent sessions · real data', title: 'Agent sessions', say: 'The sessions running now. Stop ends one.', stream: turnA(ptx('The sessions running now, read from the same list the console shows. Stop ends one and says so.')), noteKey: null, pane: '<article class="paper doc"></article>', label: 'Sessions' });
|
|
897
|
-
$('#askF').hidden = true; setMode('detail'); draw();
|
|
898
|
-
const load = async () => { M.list = await readSessions(); M.asks = M.list ? await readAsks() : {}; if (M.list === null) { M.list = []; M.err = 'The sessions could not be read.'; } else sessBadge(M.list.length); draw(); };
|
|
899
|
-
const focusNext = () => { const b = $('#oMain [data-stop]:not([disabled])') || $('#dTitle'); if (b) b.focus(); };
|
|
900
|
-
$('#oMain').onclick = async (e) => {
|
|
901
|
-
if (M.busy) return;
|
|
902
|
-
const an = e.target.closest('[data-ans]');
|
|
903
|
-
if (an) {
|
|
904
|
-
const id = an.dataset.ans, a = M.asks[id]; if (!a) return;
|
|
905
|
-
M.ans = id; M.err = ''; draw();
|
|
906
|
-
const r = await pmPost('/api/runs/answer', { run: id, request: a.request, behavior: 'answer', message: an.dataset.opt }); M.ans = null;
|
|
907
|
-
if (r && r.ok) { toast('Answered. The agent continues with your choice.'); delete M.asks[id]; } else M.err = (r && (r.error || r.reason)) || 'Not answered.';
|
|
908
|
-
draw(); return;
|
|
909
|
-
}
|
|
910
|
-
const st = e.target.closest('[data-stop]'), yes = e.target.closest('[data-yes]'), no = e.target.closest('[data-no]');
|
|
911
|
-
M.err = '';
|
|
912
|
-
if (st) { M.ask = st.dataset.stop; M.slow = null; draw(); const k = $(`#oMain [data-no="${M.ask}"]`); if (k) k.focus(); }
|
|
913
|
-
else if (no) { const id = no.dataset.no; M.ask = null; M.slow = null; draw(); const b = $(`#oMain [data-stop="${id}"]`); if (b) b.focus(); }
|
|
914
|
-
else if (yes) {
|
|
915
|
-
const id = yes.dataset.yes, x = M.list.find((y) => y.id === id); if (!x) return;
|
|
916
|
-
M.busy = id; M.ask = null; M.slow = null; draw();
|
|
917
|
-
const r = await pmPost('/api/session/remove', { id }); M.busy = null;
|
|
918
|
-
if (r && r.ok && r.removed === false) M.slow = id; // asked to end, not exited yet: say so, never claim an end that did not happen
|
|
919
|
-
else if (r && r.ok) { M.done = x; toast('Ended “' + x.name + '”.'); } else M.err = (r && (r.error || r.reason)) || 'Not stopped.';
|
|
920
|
-
draw();
|
|
921
|
-
if (M.done) setTimeout(async () => { M.done = null; await load(); focusNext(); }, 1600);
|
|
922
|
-
else if (M.slow) { const b = $(`#oMain [data-yes="${id}"]`); if (b) b.focus(); }
|
|
923
|
-
}
|
|
924
|
-
};
|
|
925
|
-
await load();
|
|
1010
|
+
openDlg({ eye: 'Sessions', title: 'Sessions', say: 'Pick a session from the list.', stream: turnA(ptx('Pick a session from the list. A dot shows its state: Ready, Running or Maybe blocked.')), noteKey: null, sessions: true, pane: '<article class="paper doc"><p class="note">Pick a session from the list.</p></article>', label: 'Session' });
|
|
1011
|
+
$('#askF').hidden = true;
|
|
1012
|
+
if (desk()) setFull(true); else $('#dlg').classList.add('srl-open');
|
|
1013
|
+
await railRead();
|
|
1014
|
+
if (!R.sel) $('#dTitle').textContent = titleOf(R.model);
|
|
1015
|
+
const top = loudestRow(R.model);
|
|
1016
|
+
if (top && desk()) pickSession(top.id);
|
|
926
1017
|
}
|
|
@@ -469,7 +469,7 @@ a.round{color:inherit;text-decoration:none}
|
|
|
469
469
|
.kv2{display:grid;grid-template-columns:minmax(110px,auto) minmax(0,1fr);gap:8px 18px;font-size:var(--fs-3);margin:6px 0}
|
|
470
470
|
.kv2 span:nth-child(odd){color:var(--ink-3)}.kv2 span:nth-child(even){color:var(--ink);font-weight:500;line-height:1.5;overflow-wrap:anywhere}
|
|
471
471
|
.vtb{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px;margin:6px 0}.vtb div{display:grid;gap:2px;padding:10px 12px;border-radius:12px;background:var(--well)}.vtb span{font:600 var(--fs-1) var(--mono);color:var(--ink-3);text-transform:uppercase;letter-spacing:.04em;overflow-wrap:anywhere}.vtb b{font-size:var(--fs-3)}
|
|
472
|
-
.askbar input:disabled,.askbar button:disabled{opacity:.55;cursor:not-allowed}
|
|
472
|
+
.askbar input:disabled,.askbar textarea:disabled,.askbar button:disabled{opacity:.55;cursor:not-allowed}
|
|
473
473
|
@media (max-width:700px){.card .ch{flex-wrap:wrap}.kv2{grid-template-columns:minmax(96px,auto) minmax(0,1fr)}}
|
|
474
474
|
/* floors the mockup left under 44 px (PRD deviation D6) */
|
|
475
475
|
.rpin{min-width:44px!important;min-height:44px!important}.fchip{min-height:44px!important}.fbtn{min-width:44px!important;min-height:44px!important}#theme2{min-width:44px!important;min-height:44px!important;flex:none}
|
|
@@ -484,7 +484,7 @@ a.round{color:inherit;text-decoration:none}
|
|
|
484
484
|
.whyl{display:block;margin:4px 0 6px;font:600 var(--t-micro) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3)}
|
|
485
485
|
.nodef.err{color:var(--bad)}
|
|
486
486
|
.nodef.err[hidden]{display:none}
|
|
487
|
-
.askbar input,.askbar button{min-height:44px}
|
|
487
|
+
.askbar input,.askbar textarea,.askbar button{min-height:44px}
|
|
488
488
|
|
|
489
489
|
/* slice 3: the agent's answers */
|
|
490
490
|
.agtag{margin:0 0 6px;font:600 var(--t-micro) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3)}
|
|
@@ -1635,25 +1635,14 @@ button.dsn:hover{box-shadow:inset 0 0 0 1.5px rgb(79,109,245)}
|
|
|
1635
1635
|
.sbtn{position:relative}
|
|
1636
1636
|
.sbdg{position:absolute;top:-3px;right:-3px;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--ember);color:rgb(20,22,31);font:600 var(--fs-2) var(--mono);display:grid;place-items:center;pointer-events:none}
|
|
1637
1637
|
.sbdg[hidden]{display:none}
|
|
1638
|
-
.
|
|
1639
|
-
.ssr{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:6px 14px;align-items:start;padding:16px 18px;border-radius:var(--r-in);background:var(--well)}
|
|
1640
|
-
.ssd{width:10px;height:10px;border-radius:50%;margin-top:7px;background:var(--ink-3)}
|
|
1641
|
-
.ssd.working{background:var(--ok)}.ssd.needs,.ssd.blocked{background:var(--ember)}
|
|
1642
|
-
.ssb{min-width:0}.ssb h3{font-size:var(--fs-4);font-weight:600;letter-spacing:-.01em;overflow-wrap:anywhere}
|
|
1643
|
-
.ssn{color:var(--ink-2);font-size:var(--t-small);margin-top:2px;overflow-wrap:anywhere}
|
|
1644
|
-
.ssm{display:flex;flex-wrap:wrap;gap:2px 14px;margin-top:8px;font:500 var(--fs-2) var(--mono);color:var(--ink-3)}
|
|
1645
|
-
.ssr>.cta{height:44px;padding:0 20px}
|
|
1646
|
-
.ssc,.ssdone{grid-column:1/-1}
|
|
1638
|
+
.ssc{grid-column:1/-1}
|
|
1647
1639
|
.ssc{border-top:1px solid var(--hair);padding-top:14px;margin-top:8px;font-size:var(--t-small);color:var(--ink-2)}
|
|
1648
1640
|
.ssc b{color:var(--ink);font-weight:600}
|
|
1649
1641
|
.ssx{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}.ssx .cta{height:44px;padding:0 20px}
|
|
1650
1642
|
.cta.bad{background:var(--bad);color:rgb(255,255,255)}
|
|
1651
1643
|
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .cta.bad{color:rgb(40,12,10)}}
|
|
1652
1644
|
:root[data-theme="dark"] .cta.bad{color:rgb(40,12,10)}
|
|
1653
|
-
.ssdone{color:var(--ok);font-weight:600}
|
|
1654
1645
|
.ssw{margin:0;padding:12px 16px;border-radius:var(--r-in);background:var(--well);border-left:3px solid var(--ember);color:var(--ink-2)}.ssw b{color:var(--ink);font-weight:600}
|
|
1655
|
-
.sse{padding:34px 20px;text-align:center;border-radius:var(--r-in);background:var(--well)}.sse b{display:block;font-size:var(--fs-4);font-weight:600}.sse p{color:var(--ink-2);margin-top:6px;font-size:var(--t-small)}
|
|
1656
|
-
@media (max-width:700px){.ssr{grid-template-columns:auto minmax(0,1fr)}.ssr>.cta{grid-column:2}}
|
|
1657
1646
|
|
|
1658
1647
|
/* Issue it on a core document draft (initiative premium-core-doc-issue) */
|
|
1659
1648
|
.dsiss{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 16px;border-radius:14px;background:color-mix(in oklab,var(--ember) 12%,transparent);margin:0 0 12px;font-size:var(--fs-2)}
|
|
@@ -2374,3 +2363,83 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2374
2363
|
.ilead{margin:6px 0 14px;font-size:var(--fs-3);font-weight:600;color:var(--ember-ink)}
|
|
2375
2364
|
.footi{margin-top:28px;display:flex;align-items:center}
|
|
2376
2365
|
.ifold .foot{margin:0;max-width:90ch}
|
|
2366
|
+
/* the chat reply box is several lines: it grows with what is typed up to a cap, then scrolls; the send button stays at its foot */
|
|
2367
|
+
.askbar:has(textarea){align-items:flex-end}
|
|
2368
|
+
.askbar textarea{flex:1;min-width:0;height:46px;min-height:46px;max-height:min(220px,32vh);box-sizing:border-box;resize:none;overflow-y:auto;border-radius:23px;border:0;background:var(--well);padding:12px 18px;font:inherit;line-height:22px;color:var(--ink);outline:0;scrollbar-width:thin}
|
|
2369
|
+
.askbar textarea:focus{box-shadow:0 0 0 2px var(--b3)}
|
|
2370
|
+
/* ── Sessions beside the chat (initiative premium-session-list): the list, its dots, the chip, the folds ── */
|
|
2371
|
+
.srl{display:none;flex-direction:column;min-height:0;overflow:hidden;border-right:1px solid var(--hair);padding-right:10px}
|
|
2372
|
+
.srl-hd{display:flex;align-items:center;gap:6px;padding:4px 2px 8px 8px}
|
|
2373
|
+
.srl-hd b{flex:1;font-size:var(--fs-3);font-weight:600;white-space:nowrap}
|
|
2374
|
+
.srl-fold,.vfold{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;color:var(--ink-2);flex:none}
|
|
2375
|
+
.srl-fold:hover,.vfold:hover{background:var(--well);color:var(--ink)}
|
|
2376
|
+
.srl-fold svg,.vfold svg{width:16px;height:16px}
|
|
2377
|
+
.vfold{display:none}
|
|
2378
|
+
.srl-list{flex:1;overflow:auto;min-height:0;scrollbar-width:thin}
|
|
2379
|
+
.srl ul{list-style:none;margin:0;padding:0}
|
|
2380
|
+
.srl-gh{display:flex;align-items:center;gap:6px;width:100%;min-height:32px;padding:4px 8px;border-radius:10px;font-size:var(--fs-2);font-weight:600;color:var(--ink-2);margin-top:6px}
|
|
2381
|
+
.srl-gh:hover{background:var(--well)}
|
|
2382
|
+
.srl-gh .chev{width:12px;height:12px;transition:transform .15s}
|
|
2383
|
+
.srl-gh[aria-expanded="false"] .chev{transform:rotate(-90deg)}
|
|
2384
|
+
.srl-gh em{font:500 var(--fs-1) var(--mono);font-style:normal;color:var(--ink-3)}
|
|
2385
|
+
.srl-r{display:flex;align-items:center;gap:8px;width:100%;min-height:32px;padding:4px 8px;border-radius:10px;text-align:left;font-size:var(--fs-2);color:var(--ink);position:relative}
|
|
2386
|
+
.srl-r:hover{background:var(--well)}
|
|
2387
|
+
.srl-r.on{background:var(--solid);color:var(--on-solid)}
|
|
2388
|
+
.srl-ic{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;background:var(--well);color:var(--ink-2);flex:none}
|
|
2389
|
+
.srl-r.on .srl-ic{background:color-mix(in oklab,var(--on-solid) 16%,transparent);color:inherit}
|
|
2390
|
+
.srl-ic svg{width:12px;height:12px}
|
|
2391
|
+
.srl-n{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
2392
|
+
.srl-r.rd .srl-n{font-weight:600}
|
|
2393
|
+
.srl-h{display:none;font:500 var(--fs-1) var(--mono);color:var(--ink-3);white-space:nowrap}
|
|
2394
|
+
.srl-r:hover .srl-h,.srl-r:focus-visible .srl-h,.srl-r.on .srl-h{display:inline}
|
|
2395
|
+
.srl-r.on .srl-h{color:inherit;opacity:.75}
|
|
2396
|
+
.srl-more{display:block;width:100%;text-align:left;min-height:32px;padding:4px 8px 4px 36px;border-radius:10px;color:var(--ink-3);font-size:var(--fs-2)}
|
|
2397
|
+
.srl-more:hover{background:var(--well);color:var(--ink)}
|
|
2398
|
+
.srl-lg{display:flex;flex-wrap:wrap;gap:4px 12px;padding:8px 8px 0;border-top:1px solid var(--hair);font-size:var(--fs-1);color:var(--ink-3)}
|
|
2399
|
+
.srl-lg span{display:inline-flex;align-items:center;gap:5px}
|
|
2400
|
+
.srl-warn{margin:4px 2px 8px;padding:8px 10px;border-radius:10px;background:var(--spot);font-size:var(--fs-2);color:var(--ink-2)}
|
|
2401
|
+
.srl-warn b{color:var(--ink);font-weight:600}
|
|
2402
|
+
.srl-none{padding:8px;color:var(--ink-3);font-size:var(--fs-2)}
|
|
2403
|
+
.sdot2{display:inline-block;width:8px;height:8px;border-radius:50%;flex:none}
|
|
2404
|
+
.sdot2.ready{background:var(--ember)}
|
|
2405
|
+
.sdot2.run{background:var(--ok);animation:spulse 2s infinite}
|
|
2406
|
+
.sdot2.blk{box-shadow:inset 0 0 0 2px var(--ember)}
|
|
2407
|
+
.sdot2.idle{background:transparent}
|
|
2408
|
+
@keyframes spulse{0%{box-shadow:0 0 0 0 color-mix(in oklab,var(--ok) 50%,transparent)}70%{box-shadow:0 0 0 5px transparent}100%{box-shadow:0 0 0 0 transparent}}
|
|
2409
|
+
@media (prefers-reduced-motion:reduce){.sdot2.run{animation:none}}
|
|
2410
|
+
.stease{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 13px;border-radius:999px;background:var(--well);font-size:var(--fs-2);font-weight:600;color:var(--ink);align-self:center}
|
|
2411
|
+
.stease[hidden]{display:none}
|
|
2412
|
+
.stease em{font-style:normal;font-weight:500;color:var(--ink-2)}
|
|
2413
|
+
.stease:hover{background:var(--b3)}
|
|
2414
|
+
.scard .scs{display:flex;align-items:center;gap:8px;font-size:var(--fs-2);color:var(--ink-2);margin:0 0 4px}
|
|
2415
|
+
.scard .ssx{margin-top:12px}
|
|
2416
|
+
@media (min-width:1000px){
|
|
2417
|
+
.dlg.full.srl-on .dgrid{grid-template-columns:var(--srw,232px) minmax(360px,.75fr) minmax(0,1.25fr);gap:22px}
|
|
2418
|
+
.dlg.full.srl-on .srl{display:flex}
|
|
2419
|
+
.dlg.full.srl-on.srl-min{--srw:52px}
|
|
2420
|
+
.dlg.full.srl-on.vw-min .dgrid{grid-template-columns:var(--srw,232px) minmax(0,1fr) 52px}
|
|
2421
|
+
.dlg.full.vw-min:not(.srl-on) .dgrid{grid-template-columns:minmax(0,1fr) 52px}
|
|
2422
|
+
.dlg.full[data-mode="detail"].srl-on .dgrid{grid-template-columns:var(--srw,232px) minmax(0,1fr)}
|
|
2423
|
+
.dlg.full .vfold{display:grid}
|
|
2424
|
+
.dlg.full.vw-min .p-out{background:transparent;overflow:hidden}
|
|
2425
|
+
.dlg.full.vw-min .p-out>:not(.otop),.dlg.full.vw-min .otop>:not(#vFold){display:none!important}
|
|
2426
|
+
.dlg.full.vw-min .otop{padding:0;background:transparent;justify-content:center}
|
|
2427
|
+
.dlg.full.srl-on #dBody .tt,.dlg.full.srl-on #dBody .ub,.dlg.full.srl-on #dBody .md,.dlg.full.srl-on #dBody .md p,.dlg.full.srl-on #dBody .md li{font-size:var(--fs-2)}
|
|
2428
|
+
.dlg.full.srl-on .stream{gap:12px}
|
|
2429
|
+
.dlg.full.vw-min #dBody{padding-inline:max(0px,calc((100% - 880px) / 2))}
|
|
2430
|
+
.srl-min .srl-hd b,.srl-min .srl-lg,.srl-min .srl-n,.srl-min .srl-h,.srl-min .srl-more,.srl-min .srl-warn,.srl-min .srl-gh>*{display:none!important}
|
|
2431
|
+
.srl-min .srl{padding-right:6px}
|
|
2432
|
+
.srl-min .srl-hd{justify-content:center;padding-left:0}
|
|
2433
|
+
.srl-min .srl-gh{min-height:1px;height:1px;padding:0;margin:8px 6px;background:var(--hair)}
|
|
2434
|
+
.srl-min .srl-r{justify-content:center;padding:6px 0}
|
|
2435
|
+
.srl-min .srl-r .sdot2{position:absolute;top:4px;right:6px;width:7px;height:7px}
|
|
2436
|
+
.srl-min .srl-ic{width:26px;height:26px}
|
|
2437
|
+
}
|
|
2438
|
+
@media (max-width:999px){
|
|
2439
|
+
.dlg.srl-open .srl{display:flex;border-right:0;padding-right:0;grid-column:1/-1}
|
|
2440
|
+
.dlg.srl-open .dgrid>.pane,.dlg.srl-open #dTabs{display:none!important}
|
|
2441
|
+
.dlg.srl-open .srl-r,.dlg.srl-open .srl-gh,.dlg.srl-open .srl-more{min-height:44px;font-size:var(--fs-3)}
|
|
2442
|
+
.dlg.srl-open .srl-h{display:inline}
|
|
2443
|
+
.dlg.srl-open .srl-hd{display:none}
|
|
2444
|
+
.stease{height:44px}
|
|
2445
|
+
}
|
|
@@ -292,8 +292,7 @@ $('#dBody').addEventListener('click', (e) => {
|
|
|
292
292
|
$$('#card button').forEach((b) => { b.disabled = true; });
|
|
293
293
|
startAgent({ ws: w.ws || new URLSearchParams(location.search).get('ws') || undefined, task: 'draft', initiative: w.initiative, what: w.what }).then((res) => {
|
|
294
294
|
if (!res.ok) { $$('#card button').forEach((b) => { b.disabled = false; }); showErr('Not started: ' + res.error); return; }
|
|
295
|
-
delete START[key]; toast('The agent started. It is listed in
|
|
296
|
-
const bd = $('#sessBdg'); if (bd) { bd.textContent = String((+bd.textContent || 0) + 1); bd.hidden = false; }
|
|
295
|
+
delete START[key]; toast('The agent started. It is listed in Sessions, and its draft waits for you to read.'); closeDlg();
|
|
297
296
|
});
|
|
298
297
|
return;
|
|
299
298
|
}
|