create-pmos 0.398.0 → 0.399.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.
Files changed (126) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +18 -14
  7. package/workspace/briefing-premium-board-test.js +80 -48
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +6 -2
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +46 -42
  18. package/workspace/briefing-premium-work-test.js +9 -9
  19. package/workspace/changelog.json +12 -0
  20. package/workspace/ev-everywhere-test.js +210 -0
  21. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  22. package/workspace/guide/home.md +39 -18
  23. package/workspace/guide/index.md +1 -1
  24. package/workspace/lib/board-grill.js +63 -0
  25. package/workspace/lib/board-premium.js +36 -5
  26. package/workspace/lib/initiative-layout.js +77 -0
  27. package/workspace/lib/insights-premium.js +3 -2
  28. package/workspace/lib/insights-records.js +21 -7
  29. package/workspace/lib/meeting-points.js +52 -0
  30. package/workspace/lib/news-for-you.js +88 -0
  31. package/workspace/lib/notes-series.js +29 -6
  32. package/workspace/lib/report-confirm.js +48 -0
  33. package/workspace/lib/route-modules.js +8 -0
  34. package/workspace/lib/routes-board-docs.js +46 -0
  35. package/workspace/lib/routes-board-grill.js +90 -0
  36. package/workspace/lib/routes-home-review.js +108 -0
  37. package/workspace/lib/routes-initiative-layout.js +57 -0
  38. package/workspace/lib/routes-insights-premium.js +4 -1
  39. package/workspace/lib/routes-insights-records.js +8 -4
  40. package/workspace/lib/routes-meeting-points.js +37 -0
  41. package/workspace/lib/routes-news.js +57 -0
  42. package/workspace/lib/routes-notes.js +2 -1
  43. package/workspace/lib/routes-report-confirm.js +31 -0
  44. package/workspace/lib/routes-search.js +38 -0
  45. package/workspace/lib/search-index.js +176 -0
  46. package/workspace/package-lock.json +2 -2
  47. package/workspace/package.json +1 -1
  48. package/workspace/premium-board-actions-test.js +86 -50
  49. package/workspace/premium-briefing-depth-test.js +55 -54
  50. package/workspace/premium-chat-chart-tab-test.js +4 -2
  51. package/workspace/premium-chat-report-tab-test.js +16 -2
  52. package/workspace/premium-core-doc-issue-test.js +15 -13
  53. package/workspace/premium-phone-card-test.js +5 -3
  54. package/workspace/premium-report-read-test.js +55 -18
  55. package/workspace/premium-vw-backlog-test.js +2 -2
  56. package/workspace/premium-vw-cal-test.js +50 -35
  57. package/workspace/premium-vw-doc-test.js +9 -3
  58. package/workspace/premium-vw-item-test.js +1 -1
  59. package/workspace/premium-vw-jira-test.js +2 -2
  60. package/workspace/premium-vw-meet-test.js +37 -40
  61. package/workspace/premium-vw-notes-test.js +21 -19
  62. package/workspace/premium-vw-rec-test.js +11 -12
  63. package/workspace/premium-welcome-test.js +3 -3
  64. package/workspace/premium-work-depth-test.js +3 -3
  65. package/workspace/public/pm/bd-acts.js +303 -225
  66. package/workspace/public/pm/bd-asks.js +261 -0
  67. package/workspace/public/pm/bd-pop.js +59 -0
  68. package/workspace/public/pm/bd-span.js +49 -13
  69. package/workspace/public/pm/bd-views.js +169 -0
  70. package/workspace/public/pm/cozy-board.css +301 -0
  71. package/workspace/public/pm/cozy-ev.css +228 -0
  72. package/workspace/public/pm/cozy-evmodel.js +106 -0
  73. package/workspace/public/pm/cozy-evui.js +47 -0
  74. package/workspace/public/pm/cozy-insights.css +148 -10
  75. package/workspace/public/pm/cozy-nav.js +103 -39
  76. package/workspace/public/pm/cozy-news.js +140 -0
  77. package/workspace/public/pm/cozy-search.js +203 -0
  78. package/workspace/public/pm/cozy-settings.js +198 -0
  79. package/workspace/public/pm/cozy-sources.js +89 -0
  80. package/workspace/public/pm/cozy-today.css +217 -0
  81. package/workspace/public/pm/cozy-viewer.js +1 -0
  82. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  83. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  84. package/workspace/public/pm/home-adddoc.js +5 -5
  85. package/workspace/public/pm/home-app.js +329 -55
  86. package/workspace/public/pm/home-around.js +24 -126
  87. package/workspace/public/pm/home-chat.js +67 -14
  88. package/workspace/public/pm/home-data.js +6 -6
  89. package/workspace/public/pm/home-dictate.js +54 -0
  90. package/workspace/public/pm/home-draft.js +6 -6
  91. package/workspace/public/pm/home-ini-model.js +190 -0
  92. package/workspace/public/pm/home-ini.css +171 -0
  93. package/workspace/public/pm/home-ini.js +456 -0
  94. package/workspace/public/pm/home-list.js +276 -0
  95. package/workspace/public/pm/home-more.js +17 -134
  96. package/workspace/public/pm/home-phone-card.js +4 -4
  97. package/workspace/public/pm/home-review.js +104 -0
  98. package/workspace/public/pm/home-task.js +67 -0
  99. package/workspace/public/pm/home-today.js +144 -0
  100. package/workspace/public/pm/home-work.js +54 -26
  101. package/workspace/public/pm/premium-board.js +163 -39
  102. package/workspace/public/pm/premium-chart-tab.js +4 -5
  103. package/workspace/public/pm/premium-first.js +5 -7
  104. package/workspace/public/pm/premium-insights.js +499 -202
  105. package/workspace/public/pm/premium-mtg-present.js +138 -0
  106. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  107. package/workspace/public/pm/premium-report-read.js +216 -52
  108. package/workspace/public/pm/premium-report-tab.js +44 -19
  109. package/workspace/public/pm/premium-shell.js +7 -7
  110. package/workspace/public/pm/premium-vw-cal.js +150 -60
  111. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  112. package/workspace/public/pm/premium-vw-notes.js +61 -0
  113. package/workspace/public/pm/rp-parts.js +269 -0
  114. package/workspace/public/premium-board.html +4 -3
  115. package/workspace/public/premium-insights.html +10 -10
  116. package/workspace/public/premium.html +3 -1
  117. package/workspace/r/m1.png +0 -0
  118. package/workspace/r/m2.png +0 -0
  119. package/workspace/r/m3.png +0 -0
  120. package/workspace/r/nl.png +0 -0
  121. package/workspace/test-lists/initiative-layout.json +9 -0
  122. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  123. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  124. package/workspace/test-lists/uf-everywhere.json +15 -0
  125. package/workspace/test-lists/uf-home.json +9 -0
  126. package/workspace/test-lists/uncovered-board.json +9 -0
@@ -0,0 +1,198 @@
1
+ /* pm/cozy-settings.js — Settings (initiative premium-uncovered-features, E3; canvas EvSettings). A dialog over the page, its sections on the left:
2
+ * General Theme (this device), Viewer opens as a column or a popup (this device), Product (which products Home reads: the Products card),
3
+ * Your day (when the end-of-day card shows: time.workEnd, POST /api/settings), Agents write to Jira (fixed: only after Commit)
4
+ * Connectors what PMOS reads on its own, and the connectors your sessions have (GET and POST /api/proactive/settings)
5
+ * Workspaces the repositories PMOS works in (GET and POST /api/workspaces, POST /api/workspaces/forget; the folder is never touched)
6
+ * Updates the versions and Check now, Update, Restart to update (GET /api/kit/status, POST /api/kit/check | update | upgrade-app)
7
+ * What's new what each published kit changed, newest first (the kit status's changelog lines)
8
+ * The card at the bottom of General says when an update is ready. Every write is the PM's press (pmPost carries the launch nonce).
9
+ * openSettings(section?) */
10
+ import { pmGet, pmPost } from './http.js';
11
+ import { esc, svg, ICON, toast } from './cozy-evui.js';
12
+
13
+ const SECTIONS = [['general', 'General'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['updates', 'Updates'], ['whatsnew', "What's new"]];
14
+ const SRC = { calendar: 'Calendar', wispr: 'Wispr Flow', mail: 'Mail', slack: 'Slack', jira: 'Jira', confluence: 'Confluence', github: 'GitHub', drive: 'Google Drive', figma: 'Figma', website: 'Your websites' };
15
+ const VIEWER_KEY = 'pmos.cz.viewer';
16
+ const T = { el: null, sec: 'general', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null };
17
+ const cmpVer = (a, b) => { const x = String(a || '0').split('-')[0].split('.').map(Number), y = String(b || '0').split('-')[0].split('.').map(Number); for (let i = 0; i < 3; i++) if ((x[i] || 0) !== (y[i] || 0)) return (x[i] || 0) < (y[i] || 0) ? -1 : 1; return 0; };
18
+ const home = () => (T.ws && T.ws[0] ? T.st[T.ws[0].id] : null);
19
+ const latest = () => { const s = home(); return (s && (s.latest || (s.lastCheck && s.lastCheck.latest))) || null; };
20
+ const fromGit = () => { const s = home(); return !!(s && s.app && s.app.fromCheckout && !(s.source && s.source.kind === 'local')); };
21
+ const kitsBehind = () => (T.ws || []).filter((w) => T.st[w.id] && T.st[w.id].kitBehind);
22
+ const appBehind = () => { const s = home(); return !!(s && s.appBehind && !fromGit()); };
23
+ const ready = () => appBehind() || kitsBehind().length > 0;
24
+ const store = { get(k) { try { return localStorage.getItem(k); } catch { return null; } }, set(k, v) { try { localStorage.setItem(k, v); } catch { /* no storage */ } } };
25
+ const pad = (n) => String(n).padStart(2, '0');
26
+
27
+ function changes() {
28
+ const s = home(); if (!s) return [];
29
+ const all = new Map();
30
+ for (const e of [...((s.lastCheck && s.lastCheck.changes) || []), ...(s.latestChanges || []), ...(s.changes || [])]) if (e && e.v && !all.has(e.v)) all.set(e.v, e);
31
+ return [...all.values()].sort((a, b) => cmpVer(b.v, a.v));
32
+ }
33
+ const seg = (label, key, cur, opts) => `<span class="ev-seg" role="group" aria-label="${esc(label)}">${opts.map(([k, w]) => `<button type="button" data-ev-seg="${key}" data-v="${k}" aria-pressed="${cur === k}">${esc(w)}</button>`).join('')}</span>`;
34
+ const trow = (title, sub, right) => `<div class="ev-trow"><div class="ev-tx"><b>${esc(title)}</b>${sub ? `<p class="ev-small ev-mut">${esc(sub)}</p>` : ''}</div>${right}</div>`;
35
+ const sw = (on, attrs, label) => `<button type="button" class="ev-sw" role="switch" aria-checked="${!!on}" aria-label="${esc(label)}" ${attrs}>${on ? 'On' : 'Off'}</button>`;
36
+
37
+ function general() {
38
+ const theme = (() => { const t = store.get('pmos.c3.theme'); return t === 'light' || t === 'dark' ? t : 'auto'; })();
39
+ const vw = store.get(VIEWER_KEY) === 'popup' ? 'popup' : 'column';
40
+ const P = T.prods, on = P ? P.filter((x) => x.on) : null;
41
+ const pname = !P ? 'Reading' : !P.length ? 'No product' : on.length === 1 ? on[0].name : on.length + ' of ' + P.length + ' products';
42
+ const we = T.set && Array.isArray(T.set.settings) ? T.set.settings.find((x) => x.key === 'time.workEnd') : null, end = we ? Number(we.value) : 18;
43
+ const hours = []; for (let h = 13; h <= 23; h++) hours.push(h);
44
+ const upd = ready() ? `<div class="ev-card ev-upd"><span class="ev-pill y">Update</span><p><b>PMOS ${esc(latest())} is ready.</b> <span class="ev-mut">${esc(firstLine())}</span></p><button type="button" class="ev-btn sm" data-ev-go="whatsnew">What's new</button><button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button></div>` : '';
45
+ return trow('Theme', 'Auto follows your computer', seg('Theme', 'theme', theme, [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']]))
46
+ + trow('Viewer opens as', 'A column beside the chat, or a popup over it', seg('Viewer opens as', 'viewer', vw, [['column', 'Column'], ['popup', 'Popup']]))
47
+ + trow('Product', 'Which products Home, Board and Insights read', `<button type="button" class="ev-pick" data-ev-products aria-haspopup="dialog">${esc(pname)} ${svg(ICON.down, 14)}</button>`)
48
+ + trow('Your day', 'When the end-of-day card shows', `<label class="ev-vh" for="evDay">Your day ends at</label><select id="evDay" class="ev-inp" data-ev-day>${hours.map((h) => `<option value="${h}"${h === end ? ' selected' : ''}>${pad(h)}:00</option>`).join('')}</select>`)
49
+ + trow('Agents write to Jira', 'Only after you press Commit. Never on their own.', '<span class="ev-pill ok">Fixed</span>')
50
+ + upd;
51
+ }
52
+ const firstLine = () => { const c = changes().find((e) => e.v === latest()); const p = c && c.prs && c.prs[0]; return p ? (p.t || p.s || '') : ''; };
53
+ function connectors() {
54
+ if (T.src === null) return '<p class="ev-small ev-mut">Reading the connectors.</p>';
55
+ const brief = Object.keys(SRC).filter((k) => k in T.src).map((k) => trow(SRC[k], T.src[k] ? 'PMOS reads it on its own' : 'PMOS does not read it on its own', sw(T.src[k], `data-ev-src="${k}"`, SRC[k])));
56
+ const more = T.conn.filter((c) => !c.source).map((c) => trow(c.label, T.con[c.name] ? 'On. Your sessions can use it' : 'Your sessions can use it', sw(T.con[c.name], `data-ev-conn="${esc(c.name)}"`, c.label)));
57
+ return '<p class="ev-small ev-mut">Every connector your Claude session has. A switch chooses only what PMOS reads on its own. PMOS reads and never posts.</p>' + brief.join('') + more.join('');
58
+ }
59
+ function workspaces() {
60
+ if (T.ws === null) return '<p class="ev-small ev-mut">Reading the repositories.</p>';
61
+ return '<p class="ev-small ev-mut">A workspace is one repository PMOS works in. Removing one forgets the address only; the folder is not deleted.</p>'
62
+ + T.ws.map((x) => trow(x.label || x.name || x.id, (x.root || '') + (x.home ? ' · home' : ''), x.home ? '<span class="ev-pill">Home</span>' : `<button type="button" class="ev-btn sm" data-ev-rm="${esc(x.id)}">Remove</button>`)).join('')
63
+ + '<div class="ev-add"><label class="ev-vh" for="evRoot">Folder path of a repository</label><input id="evRoot" class="ev-inp" placeholder="Folder path of a repository"><button type="button" class="ev-btn pri" data-ev-add>Add</button></div>';
64
+ }
65
+ function updates() {
66
+ const s = home();
67
+ if (!s) return '<p class="ev-small ev-mut">Reading the versions.</p>';
68
+ const app = (s.app && s.app.version) || '?', L = latest();
69
+ const head = T.phase === 'busy' ? `<b>Updating to ${esc(L)}</b><p class="ev-small ev-mut" role="status" aria-live="polite">${esc(T.say || 'Working.')}</p>`
70
+ : ready() ? `<b>PMOS ${esc(L)} is ready</b><p class="ev-small ev-mut">You have ${esc(app)}.${appBehind() ? ' PMOS stops for about a minute while it installs. Open terminals keep running.' : ''}</p>`
71
+ : L ? `<b>PMOS ${esc(app)} is up to date</b><p class="ev-small ev-mut">${fromGit() && s.appBehind ? esc(L) + ' is published. This PMOS runs from a checkout: update it with git pull.' : 'The newest published kit is ' + esc(L) + '.'}</p>`
72
+ : `<b>PMOS ${esc(app)}</b><p class="ev-small ev-mut">Press Check now to ask for the latest version.</p>`;
73
+ const acts = T.phase === 'busy' ? '' : T.phase === 'confirm' ? '<button type="button" class="ev-btn sm" data-ev-upd="cancel">Cancel</button><button type="button" class="ev-btn sm dark" data-ev-upd="go">Restart and update</button>'
74
+ : `<button type="button" class="ev-btn sm" data-ev-upd="check"${T.busy ? ' disabled' : ''}>Check now</button>${ready() ? `<button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button>` : ''}`;
75
+ const kits = (T.ws || []).map((w) => { const k = T.st[w.id], kit = k && k.kit; return trow(w.label || w.name || w.id, kit && kit.present ? 'kit ' + (kit.version || 'vendored by hand') : 'no kit in this workspace', k && k.kitBehind && L ? `<span class="ev-pill y">${esc(L)} ready</span>` : kit && kit.present && (k.lastCheck || k.latest) ? '<span class="ev-pill ok">Up to date</span>' : ''); }).join('');
76
+ const last = s.lastCheck ? 'Last checked ' + new Date(s.lastCheck.at).toLocaleString() + '. ' : '';
77
+ return `<div class="ev-card ev-upd"><div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="ev-small ev-mut">${esc(last)}${s.checkDaily ? 'PMOS checks once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p>`;
78
+ }
79
+ function whatsnew() {
80
+ const L = changes(), s = home(), mine = s && s.app && !fromGit() ? s.app.version : null;
81
+ if (!L.length) return '<p class="ev-small ev-mut">No kit summaries yet. Each kit published from now on carries one, and Check now reads the newest ones.</p>';
82
+ return `<ul class="ev-kv">${L.slice(0, 40).map((e) => `<li><b>${esc(e.v)}</b><div class="ev-tx">${mine && e.v === mine ? '<span class="ev-pill">Yours</span> ' : mine && cmpVer(e.v, mine) > 0 ? '<span class="ev-pill y">Newer</span> ' : ''}${(e.prs || []).map((p) => `<p>${esc(p.t && p.t !== p.s ? p.t + ': ' + p.s : p.s)}${p.n ? ' <span class="ev-mut">#' + esc(p.n) + '</span>' : ''}</p>`).join('') || '<p class="ev-mut">No summary was recorded for this kit.</p>'}</div></li>`).join('')}</ul>`;
83
+ }
84
+ const BODY = { general, connectors, workspaces, updates, whatsnew };
85
+ function draw() {
86
+ const el = T.el; if (!el || el.hidden) return;
87
+ // a redraw replaces the nodes: keep focus on the same control (by its data-ev-* key), else on the open section, never on the body
88
+ const ae = document.activeElement, had = ae && el.contains(ae), key = had ? [...ae.attributes].find((a) => a.name.startsWith('data-ev-')) : null;
89
+ const n = { connectors: T.src === null ? '' : Object.keys(SRC).filter((k) => T.src[k]).length + T.conn.filter((c) => !c.source && T.con[c.name]).length, workspaces: T.ws ? T.ws.length : '', updates: ready() ? '<span class="ev-pill y">1</span>' : '' };
90
+ el.querySelector('.ev-st-nav').innerHTML = '<h2 class="ev-h2">Settings</h2>' + SECTIONS.map(([k, l]) => `<a href="#${k}" class="ev-mi" data-ev-sec="${k}"${T.sec === k ? ' aria-current="page"' : ''}>${esc(l)}${n[k] !== undefined && n[k] !== '' ? `<span class="ev-k">${typeof n[k] === 'number' ? n[k] : n[k]}</span>` : ''}</a>`).join('');
91
+ const label = (SECTIONS.find((x) => x[0] === T.sec) || SECTIONS[0])[1];
92
+ el.querySelector('.ev-st-main').innerHTML = `<div class="ev-top"><h3 class="ev-h2" id="evStTitle">${esc(label)}</h3><button type="button" class="ev-ib" data-ev-close aria-label="Close settings" title="Close settings">${svg(ICON.close, 18)}</button></div>`
93
+ + BODY[T.sec]() + `<p role="status">${esc(T.msg)}</p>`;
94
+ if (had && !ae.isConnected) { const f = (key && el.querySelector(`[${key.name}="${CSS.escape(key.value)}"]`)) || el.querySelector('[aria-current="page"]'); if (f) f.focus(); }
95
+ }
96
+ function mount() {
97
+ if (T.el && T.el.isConnected) return T.el;
98
+ const d = document.createElement('div');
99
+ d.innerHTML = '<div class="ev-st-scrim" id="evStScrim" hidden></div><div class="ev-st" id="evSettings" role="dialog" aria-modal="true" aria-label="Settings" hidden><nav class="ev-st-nav" aria-label="Settings sections"></nav><div class="ev-st-main"></div></div>';
100
+ document.body.append(...d.childNodes);
101
+ T.el = document.getElementById('evSettings');
102
+ document.getElementById('evStScrim').addEventListener('click', closeSettings);
103
+ T.el.addEventListener('keydown', (e) => { if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); closeSettings(); } });
104
+ // the dialog is modal: Escape closes it even when focus is outside it (a click on the scrim's edge, a redraw)
105
+ document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && T.el && !T.el.hidden && !T.el.contains(e.target)) { e.preventDefault(); e.stopPropagation(); closeSettings(); } }, true);
106
+ T.el.addEventListener('change', async (e) => {
107
+ if (!e.target.matches('[data-ev-day]')) return;
108
+ const r = await pmPost('/api/settings', { key: 'time.workEnd', value: Number(e.target.value) });
109
+ T.msg = r && r.ok ? 'Saved. The end-of-day card shows from ' + pad(Number(e.target.value)) + ':00.' : (r && r.error) || 'Not saved.';
110
+ const we = r && r.ok && T.set && Array.isArray(T.set.settings) ? T.set.settings.find((x) => x.key === 'time.workEnd') : null; if (we) we.value = Number(e.target.value);
111
+ draw();
112
+ });
113
+ T.el.addEventListener('click', press);
114
+ return T.el;
115
+ }
116
+ async function press(e) {
117
+ const t = e.target.closest('a[data-ev-sec], button'); if (!t) return;
118
+ if (t.dataset.evSec) { e.preventDefault(); T.sec = t.dataset.evSec; T.msg = ''; draw(); const f = T.el.querySelector(`[data-ev-sec="${T.sec}"]`); if (f) f.focus(); return; }
119
+ if ('evClose' in t.dataset) { closeSettings(); return; }
120
+ if (t.dataset.evGo) { T.sec = t.dataset.evGo; draw(); return; }
121
+ if (t.dataset.evSeg === 'theme') { const M = await import('./cozy-nav.js'); M.setTheme(t.dataset.v); draw(); return; }
122
+ if (t.dataset.evSeg === 'viewer') { store.set(VIEWER_KEY, t.dataset.v); document.body.classList.toggle('ev-vw-popup', t.dataset.v === 'popup'); draw(); return; }
123
+ if ('evProducts' in t.dataset) { closeSettings(); import('./home-more.js').then((M) => M.openProducts()); return; }
124
+ if (T.busy) return;
125
+ T.busy = true; T.msg = '';
126
+ try {
127
+ if (t.dataset.evSrc) { const k = t.dataset.evSrc, on = !T.src[k]; const r = await pmPost('/api/proactive/settings', { briefSources: { [k]: on } }); if (r && r.ok) T.src[k] = on; else T.msg = (r && r.error) || 'Not saved.'; }
128
+ else if (t.dataset.evConn) { const k = t.dataset.evConn, on = !T.con[k]; const r = await pmPost('/api/proactive/settings', { connectors: { [k]: on } }); if (r && r.ok) T.con[k] = on; else T.msg = (r && r.error) || 'Not saved.'; }
129
+ else if ('evAdd' in t.dataset) {
130
+ const root = (T.el.querySelector('#evRoot').value || '').trim();
131
+ if (!root) T.msg = 'Paste the folder path of a repository.';
132
+ else { const r = await pmPost('/api/workspaces', { root, focus: false }); if (r && r.ok) { T.ws = [...T.ws.filter((y) => y.id !== r.workspace.id), r.workspace]; toast('Added.'); } else T.msg = (r && r.error) || 'Not added.'; }
133
+ } else if (t.dataset.evRm) { const r = await pmPost('/api/workspaces/forget', { id: t.dataset.evRm }); if (r && r.ok) { T.ws = T.ws.filter((y) => y.id !== t.dataset.evRm); toast('Removed. The folder is untouched.'); } else T.msg = (r && (r.error || r.reason)) || 'Not removed.'; }
134
+ else if (t.dataset.evUpd) await upd(t.dataset.evUpd);
135
+ } finally { T.busy = false; }
136
+ draw();
137
+ }
138
+ async function upd(a) {
139
+ if (a === 'cancel') { T.phase = ''; return; }
140
+ if (a === 'check') {
141
+ for (const w of T.ws || []) { const r = await pmPost('/api/kit/check', { ws: w.id }); if (r && r.ok) T.st[w.id] = { ...(T.st[w.id] || {}), ...r }; else T.msg = (r && r.error) || 'The check failed.'; }
142
+ if (!T.msg) toast(ready() ? 'PMOS ' + latest() + ' is ready' : 'Checked. PMOS is up to date');
143
+ return;
144
+ }
145
+ if (a === 'update' && appBehind()) { T.sec = 'updates'; T.phase = 'confirm'; return; }
146
+ const v = latest(); T.sec = 'updates'; T.phase = 'busy';
147
+ for (const w of kitsBehind()) {
148
+ T.say = 'Updating the kit in ' + (w.label || w.name || w.id) + '.'; draw();
149
+ const r = await pmPost('/api/kit/update', { ws: w.id, version: v });
150
+ if (!(r && r.ok)) { T.phase = ''; T.msg = (r && r.error) || 'The kit was not updated.'; return; }
151
+ T.st[w.id] = { ...T.st[w.id], ...r, kitBehind: false };
152
+ }
153
+ if (!appBehind()) { T.phase = ''; toast('Updated the kits to ' + v + '.'); return; }
154
+ T.say = 'Installing PMOS ' + v + '. This page reloads when the new version starts.'; draw();
155
+ const from = home() && home().app && home().app.version;
156
+ const r = await pmPost('/api/kit/upgrade-app', { ws: T.ws[0].id, version: v });
157
+ if (!r || r.ok === false) { T.phase = ''; T.msg = (r && r.error) || 'The update did not start.'; return; }
158
+ waitRestart(from, r.log || 'the update log');
159
+ }
160
+ /** The app update stops this server and starts a new one: wait for it, then reload. */
161
+ async function waitRestart(from, log) {
162
+ let down = false; const until = Date.now() + 5 * 60000;
163
+ while (Date.now() < until) {
164
+ await new Promise((ok) => setTimeout(ok, 2000));
165
+ const j = await pmGet('/api/sessions').catch(() => null);
166
+ if (!j || j.ok === false || !j.version) { down = true; continue; }
167
+ if (j.version !== from) { location.reload(); return; }
168
+ if (down) { T.phase = ''; T.msg = 'PMOS started again on ' + j.version + ', so the update did not finish. The update log is ' + log + '.'; draw(); return; }
169
+ }
170
+ T.phase = ''; T.msg = 'PMOS did not come back on this address. Type pmos in a terminal to open it. The update log is ' + log + '.'; draw();
171
+ }
172
+ async function load() {
173
+ const [w, p, s, b] = await Promise.all([pmGet('/api/workspaces'), pmGet('/api/proactive/settings'), pmGet('/api/settings'), pmGet('/api/briefing-premium')]);
174
+ T.ws = w && Array.isArray(w.workspaces) ? w.workspaces : [];
175
+ T.src = p && p.ok && p.settings ? { ...p.settings.briefSources } : {}; T.con = p && p.ok && p.settings ? { ...p.settings.connectors } : {};
176
+ T.conn = p && p.connectors && Array.isArray(p.connectors.list) ? p.connectors.list : [];
177
+ T.set = s && s.ok ? s : null;
178
+ T.prods = b && b.ok && b.model && b.model.products ? b.model.products.available || [] : [];
179
+ if (!w || !Array.isArray(w.workspaces)) T.msg = 'The repositories could not be read.'; else if (!p || !p.ok) T.msg = 'The connectors could not be read.';
180
+ draw();
181
+ await Promise.all(T.ws.map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) T.st[x.id] = r; }));
182
+ draw();
183
+ }
184
+ export function openSettings(section) {
185
+ const el = mount();
186
+ if (section && BODY[section]) T.sec = section;
187
+ if (el.hidden) { const ae = document.activeElement; T.back = ae && ae !== document.body ? ae : null; T.ws = null; T.src = null; T.msg = ''; T.phase = ''; }
188
+ el.hidden = false; document.getElementById('evStScrim').hidden = false; el.setAttribute('data-esc-layer', '');
189
+ draw();
190
+ const f = el.querySelector('[aria-current="page"]'); if (f) f.focus();
191
+ load();
192
+ return el;
193
+ }
194
+ export function closeSettings() {
195
+ if (!T.el || T.el.hidden) return;
196
+ T.el.hidden = true; document.getElementById('evStScrim').hidden = true; T.el.removeAttribute('data-esc-layer');
197
+ const b = T.back; T.back = null; if (b && b.isConnected) { try { b.focus(); } catch { /* gone */ } }
198
+ }
@@ -0,0 +1,89 @@
1
+ /* pm/cozy-sources.js — Sources, in the Viewer (initiative premium-uncovered-features, E3; canvas EvSources).
2
+ *
3
+ * What PMOS reads, and how old each reading is (GET /api/sources). The source furthest behind leads in an amber box that names what may be
4
+ * out of date, with Read again. Then the table: each source, when it was last read, and Read again for one that is old, failed or never
5
+ * read (POST /api/sources/refresh), or Connect for one that is off (Settings › Connectors). Read all again reads every source and then
6
+ * writes Home's list from those reads (POST /api/sources/refresh-all). The read lines say which reads Home shows. Every press is the PM's
7
+ * (pmPost carries the launch nonce); PMOS reads these sources and never posts to them.
8
+ * openSources() → the body element */
9
+ import { pmGet, pmPost } from './http.js';
10
+ import { open as vwOpen, current as vwCurrent } from './cozy-viewer.js';
11
+ import { esc, svg, ICON, toast, wsParam, wsQ, skelRows, cantRead } from './cozy-evui.js';
12
+ import { sourceRows, staleOf, partsOf } from './cozy-evmodel.js';
13
+
14
+ const TILE = { repository: ICON.repo, initiatives: ICON.flag, calendar: ICON.cal, jira: ICON.jira, 'my-work': ICON.check, tracker: ICON.board, tools: ICON.tools };
15
+ const two = (n) => String(n).padStart(2, '0');
16
+ const hm = (d) => two(d.getHours()) + ':' + two(d.getMinutes());
17
+ const M = { r: null, at: null, busy: '', note: {}, body: null };
18
+
19
+ /** The read line of each part of Home (briefing-source-flow slice 5), from one GET /api/sources answer; home-more.js readLine words. */
20
+ function readsHtml(s) {
21
+ return import('./home-more.js').then((H) => {
22
+ const L = [['Today', H.readLine(s, ['calendar'])], ['Needs you', H.readLine(s, ['initiatives', 'my-work', 'd:brief'])]].filter((x) => x[1]);
23
+ return L.map(([k, v]) => `<p class="ev-small ev-mut ev-reads" data-reads="${esc(k)}"><b>${esc(k)}:</b> ${esc(v)}</p>`).join('');
24
+ }).catch(() => '');
25
+ }
26
+ async function draw() {
27
+ const b = M.body; if (!b || !b.isConnected) return;
28
+ { const c = vwCurrent(); if (!c || c.id !== 'sources') return; } // the Viewer moved on to another item: a late read draws nothing
29
+ const s = M.r;
30
+ const head = `<div><h2 class="ev-h2">Sources</h2><p class="ev-sub">What PMOS reads, and how old each reading is. All real data${M.at ? ', as of ' + hm(M.at) : ''}.</p></div>`;
31
+ if (!s) { b.innerHTML = head + skelRows(4); return; }
32
+ if (!s.ok) { b.innerHTML = head + cantRead({ what: 'The sources', why: s.error || '', sources: false }); return; }
33
+ const st = staleOf(s.sources);
34
+ const warn = st ? `<div class="ev-warn ev-line" id="srcWarn"><i class="ev-dot risk" aria-hidden="true"></i><p class="ev-grow"><b>${esc(st.state === 'stale' ? st.name + ' was last read ' + st.ago + '.' : st.text + '.')}</b> ${esc(partsOf(st.id))} may be out of date.</p><button type="button" class="ev-btn sm" data-ev-read="${esc(st.id)}"${M.busy ? ' disabled' : ''}>${svg(ICON.refresh, 16)}Read again</button></div>` : '';
35
+ // the background line (harness-health): quiet when all is well, a box when something needs a look
36
+ const hl = s.health && s.health.level;
37
+ const health = !s.health ? '' : hl === 'warn' || hl === 'bad'
38
+ ? `<div class="ev-box ev-small ev-line" id="srcHealth" data-level="${esc(hl)}" role="status"><i class="ev-dot risk" aria-hidden="true"></i><p class="ev-grow"><b>${esc(s.health.line)}</b>${(s.health.issues || []).slice(1, 4).map((i) => `<br>${esc(i.text)}`).join('')}</p></div>`
39
+ : `<p class="ev-small ev-mut ev-line" id="srcHealth" data-level="ok"><i class="ev-dot ok" aria-hidden="true"></i>${esc(s.health.line || '')}</p>`;
40
+ const rows = sourceRows(s.sources).map((x) => {
41
+ const name = x.id === 'repository' ? (s.ws || 'This product') + ' · main' : x.sub;
42
+ const act = x.act === 'read' ? `<button type="button" class="ev-btn sm soft" data-ev-read="${esc(x.id)}" aria-label="Read ${esc(x.name)} again"${M.busy ? ' disabled' : ''}>Read again</button>`
43
+ : x.act === 'connect' ? `<button type="button" class="ev-btn sm" data-ev-connect="${esc(x.id)}">Connect</button>` : '';
44
+ return `<div class="ev-trow" data-src="${esc(x.id)}"><span class="ev-tile" aria-hidden="true">${svg(TILE[x.id] || ICON.sources, 16)}</span><div class="ev-tx"><b>${esc(x.name)}</b><p class="ev-small ev-mut">${esc(name)}</p>${M.note[x.id] ? `<p class="ev-small" role="status">${esc(M.note[x.id])}</p>` : ''}</div><span class="ev-w-140 ev-small ${x.risk ? 'ev-late' : 'ev-mut'}">${esc(x.when)}</span><span class="ev-w-96">${act}</span></div>`;
45
+ }).join('');
46
+ const all = s.all && !s.all.done;
47
+ b.innerHTML = head + warn + health
48
+ + `<div><div class="ev-th"><span class="ev-grow">Source</span><span class="ev-w-140">Last read</span><span class="ev-w-96"></span></div>${rows}</div>`
49
+ + `<div class="ev-acts"><button type="button" class="ev-btn sm" data-ev-all${M.busy || all ? ' disabled' : ''}>${svg(ICON.refresh, 16)}${all ? 'Reading every source' : 'Read all again'}</button></div>`
50
+ + '<div id="srcReads"></div>'
51
+ + '<p class="ev-small ev-mut">PMOS reads these sources and never posts to them. To send anything, you press Send.</p>';
52
+ const reads = await readsHtml(s);
53
+ const box = b.querySelector('#srcReads'); if (box) box.innerHTML = reads;
54
+ }
55
+ async function read() {
56
+ M.r = await pmGet('/api/sources' + wsQ());
57
+ if (!M.r || M.r.ok === false) M.r = { ok: false, error: (M.r && M.r.error) || 'the server did not answer' };
58
+ M.at = new Date();
59
+ draw();
60
+ if (M.r.ok) window.dispatchEvent(new CustomEvent('pm:sources', { detail: M.r }));
61
+ }
62
+ export function openSources() {
63
+ M.r = null; M.note = {};
64
+ M.body = vwOpen({ id: 'sources', kind: 'What PMOS reads', title: 'Sources', icon: 'source', render: (b) => { b.classList.add('ev-card-b', 'ev-src'); M.body = b; draw(); } });
65
+ M.body.onclick = async (e) => {
66
+ const t = e.target.closest('button'); if (!t || M.busy) return;
67
+ if ('evRetry' in t.dataset) { M.r = null; draw(); read(); return; }
68
+ if (t.dataset.evConnect) { import('./cozy-settings.js').then((S) => S.openSettings('connectors')); return; }
69
+ const ws = (M.r && M.r.ws) || wsParam() || '';
70
+ if ('evAll' in t.dataset) {
71
+ M.busy = 'all'; draw();
72
+ const r = await pmPost('/api/sources/refresh-all', { ws });
73
+ M.busy = '';
74
+ toast(r && r.ok ? (r.joined ? 'Every source is already being read.' : 'Reading every source, then Home\'s list.') : 'Read all again did not start: ' + ((r && r.error) || 'the server did not answer') + '.');
75
+ await read(); setTimeout(read, 4000); return;
76
+ }
77
+ if (t.dataset.evRead) {
78
+ const id = t.dataset.evRead;
79
+ M.busy = id; draw();
80
+ const r = await pmPost('/api/sources/refresh', { ws, source: id });
81
+ M.busy = '';
82
+ M.note[id] = r && r.ok ? (r.started === 'session' ? 'An agent session started to read it, with your own connection.' : 'Reading it again on this machine.') : 'It did not start: ' + ((r && r.error) || 'the server did not answer') + '.';
83
+ toast(r && r.ok ? 'Reading again.' : M.note[id]);
84
+ await read(); setTimeout(read, 4000);
85
+ }
86
+ };
87
+ read();
88
+ return M.body;
89
+ }
@@ -0,0 +1,217 @@
1
+ /* pm/cozy-today.css — Home's one list, the Today card, the products picker, the task and the review in the Viewer, the decision card in
2
+ * the chat and the mic (initiative premium-uncovered-features, H1 and H2; canvas HmMyWork, HmReview, HmProducts, HmMic, HmDay, HmDecide,
3
+ * HmPhone, HmPhone2). Token vars only (cozy.css :root holds every raw value). Loaded after cozy-home.css, so a rule here may narrow one there.
4
+ * Motion only for info, warning and critical (cozy.css .cz-dot.m-*): nothing here animates. */
5
+
6
+ /* ── the list head ── */
7
+ body.cz-home .hm-hd { padding: 2px 6px 6px 10px; gap: 6px; }
8
+ body.cz-home .hm-hd h1 { font-size: 16px; font-weight: 800; color: var(--cz-ink); margin-right: auto; }
9
+ .hm-pk { height: 30px; font-size: 13px; font-weight: 700; color: var(--cz-ink2); background: var(--cz-card); }
10
+ .hm-pk svg, .ut-ib svg, .hm-tg svg, .ut-btn svg, .hm-tch svg, .hm-cap svg, .ut-mic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
11
+ .ut-ib { width: 32px; height: 32px; border-radius: 999px; border: 0; padding: 0; background: none; color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; font-family: var(--cz-sans); }
12
+ .ut-ib.lg { width: 40px; height: 40px; }
13
+ .ut-ib.solid { background: var(--cz-ink); color: var(--cz-card); }
14
+ .ut-ib.solid svg.fill, .ut-ib svg.fill { fill: currentColor; stroke: none; }
15
+ .ut-ib.on { background: var(--cz-bluebg); color: var(--cz-blueink); }
16
+ .ut-ib.pri { width: 44px; height: 44px; background: var(--cz-solid); color: var(--cz-onsolid); }
17
+ @media (hover: hover) { .ut-ib:hover { background: var(--cz-well); } .ut-ib.solid:hover { background: var(--cz-ink); } .ut-ib.pri:hover { background: var(--cz-solid); } }
18
+
19
+ /* ── buttons, boxes and fields the canvas draws ── */
20
+ .ut-btn { height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-family: var(--cz-sans); font-size: 13.5px; font-weight: 700; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); white-space: nowrap; cursor: pointer; text-decoration: none; box-sizing: border-box; }
21
+ .ut-btn.pri { background: var(--cz-solid); border-color: transparent; color: var(--cz-onsolid); }
22
+ .ut-btn.dark { background: var(--cz-ink); border-color: transparent; color: var(--cz-card); }
23
+ .ut-btn.soft { background: var(--cz-well); border-color: transparent; }
24
+ .ut-btn.ghost { border-color: transparent; background: transparent; color: var(--cz-ink2); }
25
+ .ut-btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
26
+ .ut-btn:disabled { opacity: .5; cursor: not-allowed; }
27
+ .ut-lbl { margin: 0; font-size: 12px; font-weight: 800; color: var(--cz-ink3); }
28
+ .ut-h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--cz-ink); }
29
+ .ut-sub { margin: 0; font-size: 13px; color: var(--cz-ink3); }
30
+ .ut-small { font-size: 12.5px; }
31
+ .ut-mut { color: var(--cz-ink3); }
32
+ .ut-bl { color: var(--cz-blueink); }
33
+ .ut-box { background: var(--cz-well); border-radius: 16px; padding: 12px 14px; font-size: 12.5px; color: var(--cz-ink); }
34
+ .ut-card { background: var(--cz-card); border-radius: 16px; border: 1px solid var(--cz-hair); padding: 12px 14px; }
35
+ .ut-need { background: var(--cz-bluebg); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
36
+ .ut-chk { width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--cz-c-c5c9d0); flex: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
37
+ .ut-chk.on { background: var(--cz-ink); box-shadow: none; color: var(--cz-card); }
38
+ .ut-chk svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
39
+ .ut-field { display: flex; flex-direction: column; gap: 6px; }
40
+ .ut-field > span, .ut-field > label { font-size: 12.5px; font-weight: 800; color: var(--cz-ink2); }
41
+ .ut-field em { font-style: normal; font-weight: 600; color: var(--cz-ink3); }
42
+ .ut-field textarea, .ut-field input { font: inherit; font-family: var(--cz-sans); font-size: 14px; color: var(--cz-ink); border: 0; outline: 0; border-radius: 14px; background: var(--cz-well); padding: 10px 14px; min-height: 72px; resize: vertical; box-sizing: border-box; width: 100%; }
43
+ .ut-field input { min-height: 42px; }
44
+ .ut-field textarea:focus-visible, .ut-field input:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
45
+ .ut-radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--cz-hair); width: 100%; background: var(--cz-card); color: var(--cz-ink); text-align: left; cursor: pointer; font: inherit; font-family: var(--cz-sans); font-size: 14px; box-sizing: border-box; }
46
+ .ut-radio .o { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--cz-c-c5c9d0); flex: none; margin-top: 1px; box-sizing: border-box; }
47
+ .ut-radio[aria-checked="true"] { border-color: var(--cz-blue); box-shadow: 0 0 0 3px var(--cz-bluebg); }
48
+ .ut-radio[aria-checked="true"] .o { box-shadow: inset 0 0 0 5px var(--cz-blue); }
49
+ .ut-radio b { font-weight: 700; }
50
+ .ut-radio small { display: block; font-size: 12.5px; color: var(--cz-ink3); }
51
+ .ut-trow { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--cz-hair); font-size: 13.5px; color: var(--cz-ink); }
52
+ .ut-trow:last-child { border-bottom: 0; }
53
+ .ut-trow > span { flex: 1; min-width: 0; }
54
+ .ut-trow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; color: var(--cz-ink2); }
55
+ .ut-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
56
+ .ut-acts .sp { margin-left: auto; }
57
+ .ut-rec { width: 10px; height: 10px; border-radius: 50%; background: var(--cz-dot-red); flex: none; display: inline-block; }
58
+ .ut-rec.b { background: var(--cz-blue); }
59
+ .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
60
+
61
+ /* ── the Today card ── */
62
+ .hm-tc { box-sizing: border-box; width: 100%; display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; padding: 12px 14px; border-radius: 18px; border: 0; background: var(--cz-card); color: var(--cz-ink); text-align: left; font: inherit; font-family: var(--cz-sans); box-shadow: 0 1px 2px var(--cz-hair); }
63
+ button.hm-tc { cursor: pointer; }
64
+ .hm-tc .big { display: block; font-size: 15px; font-weight: 800; }
65
+ .hm-tc .sub { margin: 0; font-size: 13px; color: var(--cz-ink3); }
66
+ .hm-tc.soon, .hm-tc.live { gap: 8px; }
67
+ .hm-tc.eod { gap: 10px; }
68
+ .hm-tc.rec { flex-direction: row; align-items: center; gap: 10px; }
69
+ .hm-tc.rec > div { flex: 1; min-width: 0; }
70
+ .hm-tc.rec p { margin: 0; font-size: 12.5px; color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
71
+ .hm-tch { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
72
+ .hm-tch > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
73
+ .hm-tch > .r { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--cz-blueink); white-space: nowrap; }
74
+ .hm-tch > .r.q { color: var(--cz-ink3); font-weight: 600; }
75
+ .hm-tch svg { color: var(--cz-blueink); width: 18px; height: 18px; }
76
+ .hm-tch .ut-ib { margin-right: -6px; }
77
+ .hm-tc .ut-acts { gap: 6px; }
78
+ .hm-load { display: flex; gap: 2px; height: 6px; margin-top: 10px; }
79
+ .hm-load i { flex: var(--bd-f, 1); border-radius: 3px; background: var(--cz-c-eceae6); }
80
+ .hm-load i.m { background: var(--cz-c-b6c6dc); }
81
+ .hm-load i.n { background: var(--cz-blue); }
82
+ .hm-lx { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12.5px; color: var(--cz-ink3); }
83
+ .hm-eodl { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
84
+ .hm-eodl span { display: flex; gap: 8px; }
85
+ .hm-eodl b { width: 74px; flex: none; }
86
+ .hm-tc.clear { font-size: 13px; color: var(--cz-ink2); }
87
+
88
+ /* ── the filters ── */
89
+ .hm-flt { display: flex; gap: 4px; padding: 2px 4px; flex-wrap: wrap; margin: 0 0 4px; }
90
+ .hm-flt .cz-chip { font-weight: 600; }
91
+
92
+ /* ── a product group and its rows (canvas .ghd and .lrow) ── */
93
+ .hm-pg { margin: 0; }
94
+ .hm-ghd { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 10px 4px 8px; font-size: 13px; font-weight: 800; color: var(--cz-ink2); border: 0; background: none; text-align: left; font-family: var(--cz-sans); box-sizing: border-box; }
95
+ button.hm-ghd { cursor: pointer; }
96
+ .hm-ghd svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
97
+ .hm-ghd .n, .hm-gn { margin-left: auto; font-weight: 700; color: var(--cz-ink3); font-size: 12px; }
98
+ .hm-ghr2 { display: flex; align-items: center; }
99
+ .hm-ghr2 .hm-ghd { flex: 1; min-width: 0; }
100
+ .hm-gn { border: 0; background: none; padding: 10px 10px 4px 4px; cursor: pointer; font-family: var(--cz-sans); white-space: nowrap; }
101
+ body.cz-home .hm-r.lr { min-height: 0; margin: 0; border-radius: 16px; gap: 0; }
102
+ body.cz-home .hm-r.lr .hm-rm { min-height: 48px; padding: 8px 10px; gap: 10px; border-radius: 16px; }
103
+ body.cz-home .hm-r.lr.kid { margin: 0; }
104
+ body.cz-home .hm-r.lr.kid .hm-rm { min-height: 44px; padding: 6px 10px; }
105
+ body.cz-home .hm-r.lr .hm-tile { width: 32px; height: 32px; }
106
+ .hm-r.lr .hm-rt { flex: 1; gap: 1px; }
107
+ .hm-r.lr .hm-rt em { font-size: 12.5px; }
108
+ .hm-r.lr .hm-rt em.q, .hm-r.lr.st-quiet .hm-rt em, .hm-r.lr.st-wait .hm-rt em { color: var(--cz-ink3); }
109
+ .hm-r.lr.task .hm-rt b, .hm-r.lr.item .hm-rt b { font-weight: 600; }
110
+ .hm-r.lr.st-wait .hm-rt b { color: var(--cz-ink2); }
111
+ .hm-rr { font-size: 12px; font-weight: 700; color: var(--cz-blueink); white-space: nowrap; flex: none; }
112
+ .hm-rr.q { color: var(--cz-ink3); font-weight: 600; }
113
+ .hm-tg { flex: none; width: 32px; height: 32px; margin-left: 10px; margin-right: -4px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink2); cursor: pointer; padding: 0; z-index: 1; }
114
+ .hm-r.lr.ini .hm-rm { padding-left: 14px; }
115
+ .hm-ck { flex: none; width: 32px; height: 32px; margin: 0 -10px 0 4px; display: grid; place-items: center; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 10px; z-index: 1; }
116
+ .hm-ck.wait { cursor: default; }
117
+ .hm-ck.wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--cz-c-c5c9d0); }
118
+ .hm-r.lr.done .hm-rt b { color: var(--cz-ink3); text-decoration: line-through; }
119
+ .hm-nest { margin: 0 0 4px 26px; padding-left: 8px; border-left: 2px solid var(--cz-hair); }
120
+ .hm-r.lr.sel { background: var(--cz-card); box-shadow: 0 6px 18px -10px var(--cz-c-9da3ac); }
121
+ @media (hover: hover) { body.cz-home .hm-r.lr:hover { background: var(--cz-well2); } body.cz-home .hm-r.lr.sel:hover { background: var(--cz-card); } .hm-tg:hover { background: var(--cz-well); } }
122
+ .hm-r.lr .hm-x { width: 32px; height: 32px; }
123
+ .hm-tile.wk { box-shadow: none; background: var(--cz-well2); }
124
+ .hm-more2 { display: block; margin: 2px 0 4px 10px; height: 32px; border: 0; background: none; font-size: 12px; font-weight: 700; color: var(--cz-ink3); cursor: pointer; padding: 0 2px; font-family: var(--cz-sans); }
125
+
126
+ /* ── the capture box and the untouched row ── */
127
+ .hm-cap { display: flex; align-items: center; gap: 8px; margin: 6px 4px 2px; height: 40px; border-radius: 14px; background: var(--cz-card); padding: 0 6px 0 12px; border: 1px solid var(--cz-hair); }
128
+ .hm-cap input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-family: var(--cz-sans); font-size: 13px; color: var(--cz-ink); }
129
+ .hm-cap input::placeholder { color: var(--cz-ink3); }
130
+ .hm-cap.on { box-shadow: 0 0 0 2px var(--cz-bluebg); }
131
+ .hm-un { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; min-height: 36px; border: 0; background: none; border-radius: 16px; cursor: pointer; font-family: var(--cz-sans); text-align: left; }
132
+ .hm-un b { flex: 1; font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); }
133
+ .hm-un span { font-size: 12px; font-weight: 600; color: var(--cz-ink3); }
134
+ .hm-all { display: none; }
135
+
136
+ /* ── the small menus: the products picker and Later (home-app.js menu()) ── */
137
+ .hm-menu .ut-mi { flex-direction: row; align-items: center; gap: 10px; min-height: 40px; }
138
+ .hm-menu .ut-mi.tall { min-height: 52px; }
139
+ .hm-menu .ut-mi > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
140
+ .hm-menu .ut-mi .k { margin-left: auto; font-size: 12px; color: var(--cz-ink3); font-weight: 600; flex: none; }
141
+ .hm-menu .ut-mi svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; color: var(--cz-ink2); flex: none; }
142
+ .hm-menu .ut-it { width: 28px; height: 28px; border-radius: 9px; background: var(--cz-well2); color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none; }
143
+ .hm-menu .ut-it.p { background: var(--cz-bluebg); color: var(--cz-blueink); }
144
+ .hm-menu .ut-hr { height: 1px; background: var(--cz-hair); margin: 4px 0; flex: none; }
145
+
146
+ /* ── the task in the Viewer (HmMyWork) and the weekly review (HmReview) ── */
147
+ .ut-vc { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px; min-height: 100%; box-sizing: border-box; }
148
+ .cz-vw-body:not(.hx) > .ut-vc { padding: 16px 20px 24px; }
149
+ .ut-ib svg.dots { stroke-width: 3.2; }
150
+ .ut-btn.ghost svg { width: 16px; height: 16px; }
151
+ .ut-vh { display: flex; align-items: flex-start; gap: 10px; }
152
+ .ut-vh > div { flex: 1; min-width: 0; }
153
+ .ut-vh .ut-chk, .ut-vh .hm-ck { margin-top: 4px; }
154
+ .ut-vh .hm-ck { margin: 2px 0 0 -7px; }
155
+ .ut-chips { display: flex; gap: 6px; flex-wrap: wrap; }
156
+ .ut-foot { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
157
+ .ut-steps { display: flex; flex-direction: column; gap: 8px; }
158
+ .ut-step { display: flex; align-items: center; gap: 10px; border-radius: 16px; padding: 12px 14px; border: 1px solid var(--cz-hair); background: transparent; width: 100%; box-sizing: border-box; font: inherit; font-family: var(--cz-sans); color: var(--cz-ink); text-align: left; }
159
+ .ut-step > b { flex: 1; }
160
+ .ut-step.later { border-style: dashed; border-color: var(--cz-c-c5c9d0); }
161
+ .ut-step.later > b { color: var(--cz-ink3); }
162
+ .ut-step.now { flex-direction: column; align-items: stretch; background: var(--cz-card); border-color: var(--cz-blue); }
163
+ .ut-step.now > .h { display: flex; align-items: center; gap: 10px; }
164
+ .ut-step.now > .h > b { flex: 1; }
165
+ .ut-step .pill { flex: none; }
166
+ .ut-tabs { align-self: flex-start; }
167
+
168
+ /* ── the decision card in the chat (HmDecide) and Return a run in the Viewer ── */
169
+ .ut-dec { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; padding: 16px; max-width: 620px; }
170
+ .ut-dec .ut-acts { flex-wrap: nowrap; }
171
+ .ut-dec .ut-acts .sp { font-size: 12.5px; color: var(--cz-ink3); flex: 1 1 120px; min-width: 0; text-align: right; }
172
+ .ut-dec [role="status"]:empty, .ut-vc [role="status"]:empty { display: none; }
173
+ .hm-chat .hm-icard { margin-top: 2px; }
174
+ .ut-later { position: relative; }
175
+
176
+ /* ── the mic in the composer (HmMic) and the phone's Speak to Claude sheet ── */
177
+ .ut-mic { flex: none; width: 32px; height: 32px; border-radius: 999px; border: 0; padding: 0; background: none; color: var(--cz-blueink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
178
+ .ut-mic svg { width: 18px; height: 18px; }
179
+ .ut-mic.on { background: var(--cz-bluebg); }
180
+ .ut-mic.on svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
181
+ .hm-chat .ut-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--cz-blueink); }
182
+ .hm-chat .hm-box.ut-on, .hm-chat .hm-basic.ut-on { box-shadow: 0 0 0 2px var(--cz-bluebg); }
183
+ .ut-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--cz-card); border-radius: 28px 28px 0 0; box-shadow: var(--cz-sheet); padding: 10px 16px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
184
+ .ut-sheet[hidden] { display: none; }
185
+ .ut-sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--cz-c-c5c9d0); align-self: center; margin-bottom: 4px; }
186
+ .ut-sheet h3 { margin: 0; font-size: 16px; font-weight: 800; }
187
+ .ut-sheet .bar { display: flex; align-items: center; gap: 10px; height: 56px; border-radius: 999px; background: var(--cz-bluebg); color: var(--cz-blueink); padding: 0 6px 0 16px; }
188
+ .ut-sheet .bar .sp { flex: 1; }
189
+
190
+ /* ── a phone: the list is the page (HmPhone); a conversation opens over it with a back bar (HmPhone2) ── */
191
+ @media (max-width: 760px) {
192
+ body.cz-home.hm-plist .hm-top { display: none; }
193
+ body.cz-home.hm-plist .hm-list { display: flex; position: static; width: auto; background: none; padding: 22px 0 96px; border-radius: 0; box-shadow: none; border: 0; }
194
+ body.cz-home.hm-plist .hm-lsc { margin: 0; padding: 0; overflow: visible; }
195
+ body.cz-home.hm-plist .hm-chat, body.cz-home.hm-plist:not(.hm-vw-open) .hm-vw { display: none; }
196
+ body.cz-home.hm-plist .cz-fabw { bottom: 24px; }
197
+ body.cz-home .hm-needs, body.cz-home #hmMoreP { display: none; }
198
+ body.cz-home .hm-top .hm-back { display: grid; }
199
+ body.cz-home .hm-top { background: var(--cz-card); padding: 8px 12px 4px 8px; }
200
+ body.cz-home:not(.hm-plist) { background: var(--cz-card); }
201
+ .hm-flt .dk, .hm-un { display: none; }
202
+ .hm-all { display: flex; }
203
+ body.cz-home .hm-r.lr .hm-rm, body.cz-home .hm-r.lr.kid .hm-rm { min-height: 48px; }
204
+ .hm-tc .ut-btn, .ut-dec .ut-btn, .ut-vc .ut-btn { height: 44px; }
205
+ .hm-tc.eod .ut-acts .ut-btn { flex: 1; justify-content: center; }
206
+ .ut-ib, .hm-tg, .hm-ck, .ut-mic { min-width: 44px; min-height: 44px; }
207
+ .ut-vc .ut-tabs button, .ut-vc .ut-chips .cz-chip { min-height: 44px; }
208
+ .hm-tg { margin-left: 6px; }
209
+ .hm-cap { height: 48px; }
210
+ .hm-cap input { font-size: 16px; }
211
+ .ut-field textarea, .ut-field input { font-size: 16px; }
212
+ .ut-dec { padding: 0; border: 0; box-shadow: none; background: none; }
213
+ .ut-dec .ut-acts .sp { display: none; }
214
+ .ut-dec .ut-acts .ut-btn.pri { flex: 1; justify-content: center; height: 48px; }
215
+ .ut-dec .ut-acts .ut-btn { height: 48px; }
216
+ }
217
+ .hm-top .hm-back { display: none; }
@@ -107,6 +107,7 @@ export function open(it) {
107
107
  el.querySelector('.cz-vw-hd').innerHTML = headHtml(o);
108
108
  const body = el.querySelector('.cz-vw-body');
109
109
  body.innerHTML = ''; body.scrollTop = 0;
110
+ body.className = 'cz-vw-body'; body.onclick = null; body.oninput = null; body.onchange = null; body.onkeydown = null; // what one item's render added to the body does not reach the next
110
111
  if (typeof o.render === 'function') o.render(body); else if (o.html) body.innerHTML = o.html;
111
112
  el.hidden = false;
112
113
  emit();