create-pmos 0.534.0 → 0.535.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 +14 -14
- 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-sources-test.js +14 -16
- package/workspace/changelog.json +13 -0
- package/workspace/ev-everywhere-test.js +2 -2
- package/workspace/guide/data-freshness.md +10 -4
- package/workspace/lib/refresh-run.js +7 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-briefing-depth-test.js +4 -1
- package/workspace/public/pm/cozy-ev.css +11 -2
- package/workspace/public/pm/cozy-evmodel.js +77 -0
- package/workspace/public/pm/cozy-settings.js +42 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.535.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -32,6 +32,19 @@
|
|
|
32
32
|
"audit"
|
|
33
33
|
],
|
|
34
34
|
"pmosChanges": [
|
|
35
|
+
{
|
|
36
|
+
"v": "0.535.0",
|
|
37
|
+
"at": "2026-11-05T09:07:13.086Z",
|
|
38
|
+
"f": 4,
|
|
39
|
+
"prs": [
|
|
40
|
+
{
|
|
41
|
+
"n": 1251,
|
|
42
|
+
"t": "Calmer Settings › Connectors, one list with trouble first",
|
|
43
|
+
"s": "Calmer Settings › Connectors, one list with trouble first",
|
|
44
|
+
"k": "new"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
35
48
|
{
|
|
36
49
|
"v": "0.534.0",
|
|
37
50
|
"at": "2026-11-05T00:29:39.663Z",
|
|
@@ -406,19 +419,6 @@
|
|
|
406
419
|
"k": "new"
|
|
407
420
|
}
|
|
408
421
|
]
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
"v": "0.515.0",
|
|
412
|
-
"at": "2026-11-03T23:11:51.264Z",
|
|
413
|
-
"f": 4,
|
|
414
|
-
"prs": [
|
|
415
|
-
{
|
|
416
|
-
"n": 1206,
|
|
417
|
-
"t": "Intelligence reads the OKR file as its goal list (redesign A)",
|
|
418
|
-
"s": "Intelligence reads the OKR file as its goal list (redesign A)",
|
|
419
|
-
"k": "new"
|
|
420
|
-
}
|
|
421
|
-
]
|
|
422
422
|
}
|
|
423
423
|
]
|
|
424
424
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-05T09:07:09Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-05T09:07:09Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-05T09:07:09Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -148,25 +148,23 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
|
|
|
148
148
|
const { ctx, page, errors } = await open({ theme, w: theme === 'dark' ? 390 : 1280, h: 844 });
|
|
149
149
|
// premium-agreed-design (shared foundation): the design draws no Sources chip, so there is no dot on the page; the level is still read (GET /api/sources)
|
|
150
150
|
const dot = await page.evaluate(() => (document.querySelector('#srcDot, #srcChip') ? 'drawn' : 'none'));
|
|
151
|
-
await moreItem(page, 'Sources', '
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (shot) await page.screenshot({ path: path.join(shot, 'cards-reads-light.png'), fullPage: true });
|
|
157
|
-
}
|
|
158
|
-
// the panel rises into place: measure the line once it has a width, not while it is still animating in (H4 read 0 px)
|
|
159
|
-
await page.waitForFunction(() => { const e = document.querySelector('#evSettings #srcHealth'); return !!e && e.getBoundingClientRect().width > 0; }, null, { timeout: 15000 });
|
|
160
|
-
// Home may draw the panel again after it opens (batch 22: the line read 0 px between two draws), so read it until it has its width
|
|
161
|
-
let line = null;
|
|
162
|
-
for (let k = 0; k < 25 && !(line && line.w > 0); k++) {
|
|
151
|
+
await moreItem(page, 'Sources', '.ev-reads');
|
|
152
|
+
// batch 28 item 1 (canvas CnA): one list, trouble first. The background issues are rows of the list (trouble rows, the amber dot);
|
|
153
|
+
// all well is silence: no background line, no Today/Needs you footer, no count on the Connectors tab
|
|
154
|
+
let list = null;
|
|
155
|
+
for (let k = 0; k < 25 && !(list && list.w > 0); k++) {
|
|
163
156
|
if (k) await page.waitForTimeout(200);
|
|
164
|
-
|
|
157
|
+
list = await page.evaluate(() => { const r = document.querySelector('#evSettings .ev-reads'); const rows = [...document.querySelectorAll('#evSettings .ev-reads .ev-fr')];
|
|
158
|
+
return r ? { w: Math.round(r.getBoundingClientRect().width), sw: document.documentElement.scrollWidth, rows: rows.length, trouble: rows.filter((x) => x.classList.contains('ev-fr-t')).length,
|
|
159
|
+
firstQuiet: rows.findIndex((x) => !x.classList.contains('ev-fr-t')), lastTrouble: rows.map((x) => x.classList.contains('ev-fr-t')).lastIndexOf(true),
|
|
160
|
+
line: !!document.querySelector('#evSettings #srcHealth'), footer: !!document.querySelector('#evSettings [data-reads]'), count: !!document.querySelector('#evSettings [data-ev-sec="connectors"] .ev-k') } : null; });
|
|
165
161
|
}
|
|
166
162
|
if (theme === 'light') {
|
|
167
|
-
ok('H2 Settings › Connectors
|
|
168
|
-
ok('
|
|
169
|
-
|
|
163
|
+
ok('H2 Settings › Connectors: background issues are trouble rows, before every quiet row; all well draws no background line', list && !list.line && (h.level === 'ok' ? true : list.trouble >= 1) && (list.lastTrouble < 0 || list.firstQuiet < 0 || list.lastTrouble < list.firstQuiet), JSON.stringify(list));
|
|
164
|
+
ok('H5 the Today/Needs you footer and the tab count are gone (CnA)', list && !list.footer && !list.count, JSON.stringify(list));
|
|
165
|
+
ok('H3 no Sources chip and no dot are drawn on the page (premium-agreed-design)', dot === 'none', dot);
|
|
166
|
+
if (shot) await page.screenshot({ path: path.join(shot, 'cards-reads-light.png'), fullPage: true });
|
|
167
|
+
} else ok('H4 on a phone the list fits: no sideways scroll', list && list.sw <= 390 && list.w > 0, JSON.stringify(list));
|
|
170
168
|
if (shot) { await sleep(1200); await page.screenshot({ path: path.join(shot, 'sources-health-' + theme + '.png') }); }
|
|
171
169
|
ok('H no page error (' + theme + ')', errors.length === 0, errors.join(' | '));
|
|
172
170
|
await ctx.close();
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.535.0",
|
|
4
|
+
"at": "2026-11-05T09:07:13.086Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1251,
|
|
9
|
+
"t": "Calmer Settings › Connectors, one list with trouble first",
|
|
10
|
+
"s": "Calmer Settings › Connectors, one list with trouble first",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.534.0",
|
|
4
17
|
"at": "2026-11-05T00:29:39.663Z",
|
|
@@ -131,8 +131,8 @@ const put = (root, rel, text) => { fs.mkdirSync(path.dirname(path.join(root, rel
|
|
|
131
131
|
const stale = await pg.evaluate(() => !!document.querySelector('#czFdRisk:not([hidden]), #czMenu .ev-md.risk'));
|
|
132
132
|
await pg.waitForSelector('#evSettings:not([hidden])');
|
|
133
133
|
if (!stale) await pg.click('#evSettings [data-ev-sec="connectors"]');
|
|
134
|
-
const src = await until(() => pg.evaluate(() => { const d = document.querySelector('#evSettings:not([hidden])'); const r = d ? [...d.querySelectorAll('.ev-fr[data-src]')] : []; return r.length
|
|
135
|
-
ok('R1 Settings › Connectors lists each source with when it was last read,
|
|
134
|
+
const src = await until(() => pg.evaluate(() => { const d = document.querySelector('#evSettings:not([hidden])'); const r = d ? [...d.querySelectorAll('.ev-fr[data-src]')] : []; return r.length ? { n: r.length, h: (d.querySelector('#evStTitle') || {}).textContent, all: !!d.querySelector('.ev-top [data-ev-readall]'), info: !!d.querySelector('.ev-top [data-ev-info]'), t: d.textContent } : null; }), 20000);
|
|
135
|
+
ok('R1 Settings › Connectors lists each source with when it was last read, ↻ in its header reads all, and (i) says it never posts', !!src && src.h === 'Connectors' && src.n >= 3 && src.all && src.info, JSON.stringify(src).slice(0, 300)); // batch 28 item 1 (CnA): "never posts" moved into the (i) button
|
|
136
136
|
await snap(pg, 'connectors-1440-light');
|
|
137
137
|
await pg.keyboard.press('Escape');
|
|
138
138
|
await until(() => pg.evaluate(() => !document.querySelector('#evSettings:not([hidden])')));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Data freshness: how the workspace keeps up to date, and how old each source is"
|
|
4
|
-
timestamp: 2026-11-
|
|
4
|
+
timestamp: 2026-11-05
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Data freshness
|
|
@@ -55,7 +55,13 @@ The Sources list shows them as one row, **Your tools**. Its time is the oldest r
|
|
|
55
55
|
|
|
56
56
|
## Refresh all: the sources first, then the Briefing
|
|
57
57
|
|
|
58
|
-
On Home, the Board and Intelligence, the sources list is in **Settings › Connectors**. There is no Sources card in the place menu.
|
|
58
|
+
On Home, the Board and Intelligence, the sources list is in **Settings › Connectors**. There is no Sources card in the place menu. Settings › Connectors is one list, and the rows that need a look come first. Each source says its status one time, on its own row:
|
|
59
|
+
|
|
60
|
+
- A row that needs a look has an amber dot, one reason and one icon action. For example: **Jira** · Not read for 4 days. Claude read it again 5 times since 08:48. The action is ↻ (read it again) or a link to the place where you fix it.
|
|
61
|
+
- A row that is well shows its name and when PMOS last read it, for example **Initiatives** · 3 h ago. A source that is old shows ↻ too, while Claude reads it again by itself. When a read found nothing new, the row says **Checked 10:42 · same since 09:15**.
|
|
62
|
+
- Claude's background work that failed, and Git sync when it fails, are rows of the same list. A failed read of a source is the reason on that source's row.
|
|
63
|
+
|
|
64
|
+
When all is well, there is no other line. ↻ in the Connectors header is **Refresh all**. The (i) button says what PMOS reads and that it never posts. The switches for what PMOS reads on its own, and the other connectors of your Claude session, are folded into one row: open it to see them. When a source needs you, the Connectors tab has an amber dot, an amber box at the top of the other Settings sections names it, and the place menu opens Settings at Connectors. Claude repairs the other problems by itself, so you do not see a box for them (see below).
|
|
59
65
|
|
|
60
66
|
## When a source cannot be read: Claude repairs it first
|
|
61
67
|
|
|
@@ -65,9 +71,9 @@ You do not need to watch the sources. When a source that is on is past its limit
|
|
|
65
71
|
2. After each try, Claude finds why the read failed: the sign-in of the connector expired, the connector is not connected or did not start, the network or the proxy did not answer, the tool asked to slow down (rate limit), Claude is signed out on this computer, or the skill stopped with an error. A read that ends but saves nothing new also counts as a failure.
|
|
66
72
|
3. Each try is a line in the refresh log, with the trigger **repair** and a note such as "Repair 2 of 5: the last read failed because the network or the proxy did not answer".
|
|
67
73
|
|
|
68
|
-
While Claude repairs a source, the source row says **Reading again
|
|
74
|
+
While Claude repairs a source, the source row says **Reading again**. It has no amber dot, because you do not need to do anything, and there is no amber box. When a read proves that the source is up to date, the row shows its new time. PMOS says a source is up to date only when a read proved it.
|
|
69
75
|
|
|
70
|
-
The amber box
|
|
76
|
+
The amber row on Settings › Connectors, and the amber box on the other sections, show only when you must act. It names the one action, links to the place where you do it, and says what Claude already tried. For example: **Reconnect Jira.** Jira was last read 3 days ago because its sign-in has expired. Board and the Jira-linked initiatives may be out of date. Claude read it again 2 times since 07:02.
|
|
71
77
|
|
|
72
78
|
| Why | When the box shows | The action |
|
|
73
79
|
|---|---|---|
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
*
|
|
28
28
|
* SMART REFRESH (steps 1 and 2). Each done read of a stored source gets a fingerprint of its facts (lib/read-fingerprint.js); the end
|
|
29
29
|
* line says whether it brought anything new (`change`) and whether it was a full read or only asked the tool first (`how`). The
|
|
30
|
-
* fingerprint and the time of the last full read are kept in the source's state (`fp`, `full_at`)
|
|
30
|
+
* fingerprint and the time of the last full read are kept in the source's state (`fp`, `full_at`), and `seen` { at, since }: when the
|
|
31
|
+
* last read was measured and since when its facts are the same; scheduleOfSkill hands both to Settings › Connectors (checked_at, same_since). When two or more tool sources are
|
|
31
32
|
* due at the same minute, one shared session reads them one after another (startSkill with a list), instead of one session each. A source of a
|
|
32
33
|
* shared session is done when its stored read is newer than the session's start, and failed when it is not.
|
|
33
34
|
* Nothing here calls out of this machine: a skill source's run is the PM's own agent session, with the PM's connections.
|
|
@@ -214,6 +215,8 @@ function create(host) {
|
|
|
214
215
|
const change = FP.compare(st.fp, fp);
|
|
215
216
|
const asked = P.askedSince(dirs.runtime || dir, id, o.at);
|
|
216
217
|
if (fp) { next.fp = FP.keep(fp); measured = { change, how: asked ? 'asked' : 'full', fp: fp.hash }; }
|
|
218
|
+
// "Checked 10:42 · same since 09:15" (canvas SrSee R3, CnA): when this read was measured, and since when its facts are the same
|
|
219
|
+
if (fp) next.seen = { at: t, since: change === 'same' ? (st.seen && st.seen.since) || null : t };
|
|
217
220
|
else measured = { how: asked ? 'asked' : 'full' };
|
|
218
221
|
if (!asked) next.full_at = t;
|
|
219
222
|
} catch (e) { warn('read fingerprint', e); }
|
|
@@ -584,7 +587,9 @@ function create(host) {
|
|
|
584
587
|
const l = log().lastRun(id);
|
|
585
588
|
const next = x.on ? R.nextSlot(x.s, now(), win()) : null;
|
|
586
589
|
return { cadence: x.on ? R.textOf(x.s) : 'off', time: null, day: null, next_run: next ? new Date(next).toISOString() : null,
|
|
587
|
-
last_run: l ? l.start_at : null, last_status: l ? (l.result === 'failed' ? 'fail' : l.result === 'done' ? 'ok' : 'started') : st.last_result || null
|
|
590
|
+
last_run: l ? l.start_at : null, last_status: l ? (l.result === 'failed' ? 'fail' : l.result === 'done' ? 'ok' : 'started') : st.last_result || null,
|
|
591
|
+
checked_at: st.seen && st.seen.at ? new Date(st.seen.at).toISOString() : null,
|
|
592
|
+
same_since: st.seen && st.seen.since && st.seen.at > st.seen.since ? new Date(st.seen.since).toISOString() : null };
|
|
588
593
|
}
|
|
589
594
|
|
|
590
595
|
return { heal: healView, tick, started, ended, briefDone, codeRun, jobGate, runNow, refreshAll, allState, derived, setSource, setRules, ensureOn, rows, settings, log, scheduleOfSkill, managedSkill: (skill) => R.SKILL_OF.get(skill) || null };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.535.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.535.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -254,7 +254,10 @@ const GANTT = [
|
|
|
254
254
|
await until(() => p.evaluate(() => document.querySelectorAll('#evSettings:not([hidden]) .ev-fr[data-src]').length > 0), 20000);
|
|
255
255
|
const ft = await p.evaluate(() => document.querySelector('#evSettings .ev-st-main').textContent);
|
|
256
256
|
const srcRows = await p.evaluate(() => document.querySelectorAll('#evSettings .ev-fr[data-src]').length);
|
|
257
|
-
|
|
257
|
+
// batch 28 item 1 (CnA): "never posts" is the (i) button's note; press it and the note says so
|
|
258
|
+
await p.click('#evSettings [data-ev-info]');
|
|
259
|
+
const note = await until(() => p.evaluate(() => (document.querySelector('#evSettings #evConInfo') || {}).textContent || ''), 5000);
|
|
260
|
+
ok('F1 Settings › Connectors lists the workspace\'s sources with when each was last read, and (i) says it never posts', srcRows >= 3 && /read/.test(ft) && /never posts/.test(note || '') && !/up to date/i.test(ft), ft + ' | ' + note);
|
|
258
261
|
await shot('src-1280-light');
|
|
259
262
|
const one = await p.evaluate(() => { const b = document.querySelector('#evSettings .ev-fr [data-ev-read]'); return b ? b.dataset.evRead : null; });
|
|
260
263
|
if (one) {
|
|
@@ -292,12 +292,21 @@
|
|
|
292
292
|
/* Settings › Connectors: each source's last read (feedback batch 16 item 5, FmA3Settings; was the Sources card), and the amber box on top */
|
|
293
293
|
.ev-st-main > .ev-st-warn { margin-bottom: 12px; color: var(--cz-ink); }
|
|
294
294
|
.ev-st-warn .ev-ib-card { background: var(--cz-card); }
|
|
295
|
-
.ev-st .ev-reads { margin-bottom:
|
|
295
|
+
.ev-st .ev-reads { margin-bottom: 0; }
|
|
296
296
|
.ev-st .ev-fr { align-items: center; gap: 10px; }
|
|
297
297
|
.ev-st .ev-fr .ev-late { color: var(--cz-risk); font-weight: var(--fw-strong); }
|
|
298
298
|
.ev-st .ev-ib-sp { width: 32px; flex: none; }
|
|
299
299
|
.ev-st-nav .ev-mi .ev-dot.risk { margin-left: 6px; }
|
|
300
|
-
|
|
300
|
+
/* design A (batch 28 item 1, canvas CnA): one list, trouble first; the dot sits in a gutter so every name lines up */
|
|
301
|
+
.ev-st .ev-fr { min-height: 60px; box-sizing: border-box; padding: 10px 0; }
|
|
302
|
+
.ev-st .ev-fr .ev-gut { width: 8px; flex: none; display: flex; justify-content: center; }
|
|
303
|
+
.ev-st .ev-fr .ev-why { margin-top: 2px; overflow-wrap: anywhere; }
|
|
304
|
+
.ev-st .ev-fr .ev-why.ev-late { font-weight: inherit; }
|
|
305
|
+
.ev-st .ev-fr .ev-tx > span { overflow-wrap: anywhere; }
|
|
306
|
+
.ev-st .ev-info { margin: 0 0 8px; }
|
|
307
|
+
.ev-st .ev-fold { border-top: 1px solid var(--cz-hair); border-bottom: 0; }
|
|
308
|
+
.ev-st .ev-con-more { padding-left: 16px; border-left: 2px solid var(--cz-hair); margin-bottom: 12px; }
|
|
309
|
+
@media (max-width: 760px) { .ev-st .ev-fr .ev-ib, .ev-st .ev-fr .ev-ib-sp { width: 44px; height: 44px; } }
|
|
301
310
|
|
|
302
311
|
/* New for you's item Viewers (batch 18 items 2 and 2b, canvas OvA5Overlap, OvA6Given): the summary, then the two initiatives, the pick and ONE primary */
|
|
303
312
|
.nv { display: flex; flex-direction: column; gap: 10px; }
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
* bannerOf(sources, now) → { id, name, title: 'Reconnect Jira.', body, text, action } | null the one source the PM must act on
|
|
8
8
|
* (self-heal, feedback batch 26 item 7): null while Claude repairs a source by itself, or after it did
|
|
9
9
|
* sourceRows(sources, now) → [{ id, name, sub, when, risk, act: 'read' | 'connect' | '' }] the Sources table (EvSources)
|
|
10
|
+
* connectorRows(sources, health, now) → [{ id, name, trouble, why, when, act }] Settings › Connectors, design A (CnA): trouble first
|
|
11
|
+
* issueRow(issue) → { src, name, why } a harness-health issue split into a row's name and reason
|
|
12
|
+
* clockOf(iso, now) → '09:15' today · 'yesterday' · '3 Nov'
|
|
10
13
|
* partsOf(id) → what may be out of date when that source is old ('Board and the Jira-linked initiatives')
|
|
11
14
|
* fabLabel(here, open, stale, news) → 'Open the menu. You are in Home. 3 new for you. Jira 5 days old' (the button says both dots, FmGrill 13)
|
|
12
15
|
* SEARCH_KINDS · searchGroups(results, { phone }) → [{ key, label, rows }] EvSearch's groups, in its order
|
|
@@ -71,6 +74,80 @@ export function sourceRows(sources, now = Date.now()) {
|
|
|
71
74
|
});
|
|
72
75
|
}
|
|
73
76
|
|
|
77
|
+
/* Settings › Connectors, design A (batch 28 item 1, canvas CnA): one list, trouble first. Each source says its status once, on its own
|
|
78
|
+
* row. A trouble row has the amber dot, one reason and one action; a quiet row has its name and its time. Claude's failed background
|
|
79
|
+
* work and the repository's Git sync failure are rows too: an issue about a source (harness-health `src`) is that source's reason,
|
|
80
|
+
* and any other issue is a row of its own. */
|
|
81
|
+
const HEALTH_SRC = { calendar: 'calendar', jira: 'jira', mywork: 'my-work', tracker: 'tracker', tools: 'tools', sync: 'repository' };
|
|
82
|
+
// lib/harness-health.js words each issue as one sentence that starts with the work's label (refresh SOURCES); a row splits it into
|
|
83
|
+
// its name and its reason here, so the server's sentence stays as the bell and the logs know it
|
|
84
|
+
const HEALTH_NAME = { calendar: 'Calendar', jira: 'Jira tickets and sprints', mywork: 'Work assigned to you', tracker: 'Tracker files', tools: 'Your tools', brief: 'Morning briefing' };
|
|
85
|
+
const cap = (t) => t.replace(/^./, (c) => c.toUpperCase());
|
|
86
|
+
/** { src, name, why } of a harness-health issue ({ key, text }). */
|
|
87
|
+
export function issueRow(i) {
|
|
88
|
+
const key = String((i && i.key) || ''), text = String((i && i.text) || '');
|
|
89
|
+
const m = /^(failed|missed):(.+)$/.exec(key);
|
|
90
|
+
if (m) { const name = HEALTH_NAME[m[2]] || m[2], why = text.startsWith(name + ' ') ? cap(text.slice(name.length + 1)) : text; return { src: m[2], name, why }; }
|
|
91
|
+
if (key === 'sync') { const g = /^Git sync is failing: (.+?) was not found\./.exec(text); return { src: 'sync', name: 'Repository', why: g ? 'Git cannot find ' + g[1] + '. Check the address or your access.' : text }; }
|
|
92
|
+
if (key === 'brief') return { src: 'brief', name: 'Morning brief', why: cap(text.replace(/^Morning brief /, '')) };
|
|
93
|
+
if (key === 'tick') return { src: '', name: 'Background checks', why: text.replace(/^Background checks /, '').replace(/^./, (c) => c.toUpperCase()) };
|
|
94
|
+
if (key === 'signedout') return { src: '', name: 'Claude', why: text.replace(/^Claude /, '').replace(/^./, (c) => c.toUpperCase()) };
|
|
95
|
+
if (key.startsWith('unsent:')) { const k = text.indexOf(' is idle: '); return k > 0 ? { src: '', name: text.slice(0, k), why: 'Idle: ' + text.slice(k + 10) } : { src: '', name: 'A session', why: text }; }
|
|
96
|
+
return { src: '', name: 'Background work', why: text };
|
|
97
|
+
}
|
|
98
|
+
const two_ = (n) => String(n).padStart(2, '0');
|
|
99
|
+
/** A clock time today ("09:15"), else the day ("yesterday", "3 Nov"). */
|
|
100
|
+
export function clockOf(iso, now = Date.now()) {
|
|
101
|
+
const d = new Date(iso || ''); if (Number.isNaN(d.getTime())) return '';
|
|
102
|
+
const n = new Date(now), day = (x) => new Date(x.getFullYear(), x.getMonth(), x.getDate()).getTime();
|
|
103
|
+
const diff = Math.round((day(n) - day(d)) / 86400000);
|
|
104
|
+
if (diff <= 0) return two_(d.getHours()) + ':' + two_(d.getMinutes());
|
|
105
|
+
if (diff === 1) return 'yesterday';
|
|
106
|
+
return d.getDate() + ' ' + ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][d.getMonth()];
|
|
107
|
+
}
|
|
108
|
+
const short = (a) => a.replace(/ hours? ago$/, ' h ago');
|
|
109
|
+
/**
|
|
110
|
+
* connectorRows(sources, health, now) → [{ id, name, trouble, why, when, act }] trouble rows first (needs you, then failed, then
|
|
111
|
+
* the other issues), then the quiet rows in the server's order.
|
|
112
|
+
* why the one reason (trouble), or "Checked 10:42 · same since 09:15" on a quiet row a measured read applies to, else ''
|
|
113
|
+
* when the time on a quiet row ('3 h ago', 'Watching', 'Not connected', 'Reading now'); '' when `why` carries the time
|
|
114
|
+
* act { kind: 'read' | 'open' | 'sec', label, href?, sec? } | null the one icon action
|
|
115
|
+
*/
|
|
116
|
+
export function connectorRows(sources, health, now = Date.now()) {
|
|
117
|
+
const issues = (health && (health.level === 'warn' || health.level === 'bad') && health.issues) || [];
|
|
118
|
+
const bySrc = new Map(), alone = [];
|
|
119
|
+
for (const x of issues) { const i = { key: x.key, ...issueRow(x) }, id = HEALTH_SRC[i.src]; if (id && !bySrc.has(id)) bySrc.set(id, i); else if (!id) alone.push(i); }
|
|
120
|
+
const out = [];
|
|
121
|
+
for (const s of (sources || []).filter(Boolean)) {
|
|
122
|
+
const name = sourceName(s), h = s.heal, iss = bySrc.get(s.id);
|
|
123
|
+
const read = { kind: 'read', label: 'Read ' + name + ' again' };
|
|
124
|
+
if (h && h.state === 'needs-you' && h.action) {
|
|
125
|
+
const a = h.action, dur = s.as_of ? ago(s.as_of, now).replace(/ ago$/, '') : '';
|
|
126
|
+
const why = [s.as_of ? 'Not read for ' + dur + '.' : 'Never read.', h.tried || (h.why ? 'The read ' + h.why + '.' : ''), a.read ? '' : a.how].filter(Boolean).join(' ');
|
|
127
|
+
out.push({ id: s.id, name, trouble: 1, why, when: '', act: a.read ? { ...read, label: a.label } : a.href ? { kind: 'open', label: a.label, href: a.href } : { kind: 'sec', label: a.label, sec: a.sec || 'claude' } });
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (s.state === 'failed' || iss) {
|
|
131
|
+
const why = iss ? iss.why : 'Could not be read.';
|
|
132
|
+
const act = s.id === 'repository' ? (iss ? { kind: 'sec', label: 'Check the repository address', sec: 'workspaces' } : null) : read;
|
|
133
|
+
out.push({ id: s.id, name, trouble: 2, why, when: '', act });
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const mend = h && h.state === 'repairing' && (s.state === 'stale' || s.state === 'never');
|
|
137
|
+
const sch = s.schedule || {};
|
|
138
|
+
if (s.state === 'fresh' && sch.same_since && sch.checked_at) {
|
|
139
|
+
out.push({ id: s.id, name, trouble: 0, why: 'Checked ' + clockOf(sch.checked_at, now) + ' · same since ' + clockOf(sch.same_since, now), when: '', act: null });
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
const when = s.state === 'off' ? 'Not connected' : s.state === 'building' ? 'Reading now' : mend ? 'Reading again' : s.state === 'never' ? 'Never read'
|
|
143
|
+
: s.id === 'repository' && s.state === 'fresh' ? 'Watching' : short(ago(s.as_of, now)) || 'Never read';
|
|
144
|
+
const behind = (s.state === 'stale' || s.state === 'never') && s.id !== 'repository' && !mend;
|
|
145
|
+
out.push({ id: s.id, name, trouble: 0, why: '', when, act: behind ? read : null });
|
|
146
|
+
}
|
|
147
|
+
for (const i of alone) out.push({ id: 'issue:' + i.key, name: i.name || 'Background work', trouble: 3, why: i.why, when: '', act: i.key === 'signedout' ? { kind: 'sec', label: 'Open Settings › Claude', sec: 'claude' } : null });
|
|
148
|
+
return out.map((r, k) => ({ r, k })).sort((a, b) => (a.r.trouble || 9) - (b.r.trouble || 9) || a.k - b.k).map((x) => x.r);
|
|
149
|
+
}
|
|
150
|
+
|
|
74
151
|
export function fabLabel(here, open, stale, news) {
|
|
75
152
|
if (open) return 'Close the menu';
|
|
76
153
|
return 'Open the menu. You are in ' + (PLACE[here] || 'PMOS') + (news > 0 ? '. ' + news + ' new for you' : '') + (stale ? '. ' + (stale.text || 'A source is stale') : '');
|
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
* › Dress for the day (adler.dress.*, canvas AsSet1, batch 18 item 8): the master switch, where you are, one switch per group,
|
|
13
13
|
* "More festivals" with one switch per day, big sports and your colours, exam season, your days, Wear now (pm/cozy-seasons.js).
|
|
14
14
|
* openSettings('dress') opens it straight away (the › in Adler's tap popover, AsSet2Tap).
|
|
15
|
-
* Connectors
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* Connectors design A (batch 28 item 1, canvas CnA): one list, trouble first (GET /api/sources, pm/cozy-evmodel.js connectorRows). Each
|
|
16
|
+
* source says its status once, on its own row: a trouble row has the amber dot, one reason and one icon action (↻ POST
|
|
17
|
+
* /api/sources/refresh, or the place to fix it); a quiet row has its name and time, and "Checked 10:42 · same since 09:15"
|
|
18
|
+
* where a measured read applies (SrSee R3). Claude's failed background work and the Git sync failure are rows too. ↻ in the
|
|
19
|
+
* header reads every source (POST /api/sources/refresh-all); (i) says what PMOS reads and that it never posts. The switches
|
|
20
|
+
* (what PMOS reads on its own, the connectors your sessions have; GET and POST /api/proactive/settings) fold into one row.
|
|
19
21
|
* Workspaces the repositories PMOS works in (GET and POST /api/workspaces, POST /api/workspaces/forget; the folder is never touched)
|
|
20
22
|
* Workflows a link to its own page, /premium-workflows.html (pm/wf-page.js, D99): the stages each kind of initiative goes through
|
|
21
23
|
* Updates the versions and Check now, Update, Restart to update (GET /api/kit/status, POST /api/kit/check | update | upgrade-app); opening it
|
|
@@ -25,7 +27,7 @@
|
|
|
25
27
|
* Adler's moments (batch 17 item 4-B, AdM4): one face per section, where Claude speaks. Updates: glasses while it checks or installs,
|
|
26
28
|
* holding the card when a version is ready, calm when up to date. General: holding the update card, else the Jira promise (only after
|
|
27
29
|
* Commit). A failure in the status line takes the honest face, and then the section's face steps back (one Adler per screen).
|
|
28
|
-
* The card at the bottom of General says when an update is ready. While a source needs you (lib/source-heal.js), an amber box at the top of every section names
|
|
30
|
+
* The card at the bottom of General says when an update is ready. While a source needs you (lib/source-heal.js), an amber box at the top of every other section names
|
|
29
31
|
* it with its one action and what Claude tried, and the place menu opens Settings at Connectors. Every write is the PM's press (pmPost carries the launch nonce).
|
|
30
32
|
* PMOS reads the sources and never posts to them.
|
|
31
33
|
* openSettings(section?) */
|
|
@@ -33,7 +35,7 @@ import { mountClaudeSetup } from './cozy-claude-setup.js';
|
|
|
33
35
|
import * as JL from './cozy-jl.js';
|
|
34
36
|
import { pmGet, pmPost, pressFetch } from './http.js';
|
|
35
37
|
import { esc, svg, ICON, toast, wsParam, wsQ } from './cozy-evui.js';
|
|
36
|
-
import {
|
|
38
|
+
import { connectorRows, bannerOf } from './cozy-evmodel.js';
|
|
37
39
|
import * as AD from './cozy-adler.js';
|
|
38
40
|
import * as SE from './cozy-seasons.js';
|
|
39
41
|
import { weeksOf, lineOf, storiesOf } from './upd-weeks.js';
|
|
@@ -47,7 +49,7 @@ const SECTIONS = [['general', 'General'], ['claude', 'Claude'], ['checks', 'Clau
|
|
|
47
49
|
const PAGE_LINKS = { workflows: '/premium-workflows.html' }; // a section that is a page of its own: the row goes there
|
|
48
50
|
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' };
|
|
49
51
|
const VIEWER_KEY = 'pmos.cz.viewer';
|
|
50
|
-
const T = { el: null, sec: 'general', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null, fresh: null, reading: '', note: {},
|
|
52
|
+
const T = { el: null, sec: 'general', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null, fresh: null, reading: '', note: {}, info: false, fold: false, dress: false, more: false, bday: false, dset: {}, wkOpen: new Set(), wkMore: new Set(), arc: false };
|
|
51
53
|
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; };
|
|
52
54
|
const home = () => (T.ws && T.ws[0] ? T.st[T.ws[0].id] : null);
|
|
53
55
|
const latest = () => { const s = home(); return (s && (s.latest || (s.lastCheck && s.lastCheck.latest))) || null; };
|
|
@@ -168,22 +170,24 @@ function dressSec() {
|
|
|
168
170
|
const firstLine = () => { const c = changes().find((e) => e.v === latest()); const p = c && c.prs && c.prs[0]; return p ? (p.t || p.s || '') : ''; };
|
|
169
171
|
/* each source's last read (FmA3Settings): the name, "read 09:41", the amber dot and ↻ on a stale or failed one */
|
|
170
172
|
const RD = 'M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5';
|
|
173
|
+
const INFO_I = 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M12 11v5M12 8h.01';
|
|
171
174
|
const readBtn = (id, label, cls = 'ev-ib') => `<button type="button" class="${cls}" data-ev-read="${esc(id)}" aria-label="${esc(label)}" title="${esc(label)}"${T.reading ? ' disabled' : ''}>${svg(RD, 18)}</button>`;
|
|
172
175
|
function readsHtml() {
|
|
173
176
|
const s = T.fresh;
|
|
174
177
|
if (!s) return '<p class="ev-small ev-mut">Reading when each source was last read.</p>';
|
|
175
178
|
if (!s.ok) return `<p class="ev-small ev-mut">When each source was last read could not be read${s.error ? ': ' + esc(s.error) : ''}.</p>`;
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
179
|
+
const act = (x) => {
|
|
180
|
+
const a = x.act;
|
|
181
|
+
if (!a) return '<span class="ev-ib-sp" aria-hidden="true"></span>';
|
|
182
|
+
if (a.kind === 'read') return readBtn(x.id, a.label);
|
|
183
|
+
const at = a.kind === 'open' ? `href="${esc(a.href)}" target="_blank" rel="noopener"` : `href="#${esc(a.sec)}" data-ev-sec="${esc(a.sec)}"`;
|
|
184
|
+
return `<a class="ev-ib" ${at} aria-label="${esc(a.label)}" title="${esc(a.label)}">${svg(ICON.open, 18)}</a>`;
|
|
185
|
+
};
|
|
186
|
+
// one list, trouble first (CnA): the amber dot, the one reason and the one action on a trouble row; the name and the time on a quiet one
|
|
187
|
+
const rows = connectorRows(s.sources, s.health).map((x) => `<div class="ev-trow ev-fr${x.trouble ? ' ev-fr-t' : ''}" data-src="${esc(x.id)}"><span class="ev-gut">${x.trouble ? '<i class="ev-dot risk" aria-hidden="true"></i>' : ''}</span>`
|
|
188
|
+
+ `<div class="ev-tx ev-grow">${x.trouble ? `<b>${esc(x.name)}</b>` : `<span>${esc(x.name)}</span>`}${x.why ? `<p class="ev-small ev-why ${x.trouble ? 'ev-late' : 'ev-mut'}">${x.trouble ? '<span class="ev-vh">Needs a look: </span>' : ''}${esc(x.why)}</p>` : ''}${T.note[x.id] ? `<p class="ev-small" role="status">${esc(T.note[x.id])}</p>` : ''}</div>`
|
|
189
|
+
+ `${x.when ? `<span class="ev-small ev-mut">${esc(x.when)}</span>` : ''}${act(x)}</div>`).join('');
|
|
190
|
+
return `<div class="ev-reads">${rows}</div>`;
|
|
187
191
|
}
|
|
188
192
|
/** The amber box at the top of Settings, only when the PM must act on a source (self-heal, feedback batch 26 item 7). While Claude
|
|
189
193
|
* reads a source again by itself, or after it did, there is no box. The box names the one action and links to the exact place:
|
|
@@ -196,11 +200,19 @@ function staleHtml() {
|
|
|
196
200
|
: `<a class="ev-ib ev-ib-card" href="${esc(a.href || '#' + a.sec)}"${a.href ? ' target="_blank" rel="noopener"' : ` data-ev-sec="${esc(a.sec)}"`} aria-label="${esc(a.label)}" title="${esc(a.label)}">${svg(ICON.open, 18)}</a>`;
|
|
197
201
|
return `<div class="ev-warn ev-line ev-st-warn" id="srcWarn" data-cause="${esc(b.cause || '')}"><i class="ev-dot risk" aria-hidden="true"></i><p class="ev-grow"><b>${esc(b.title)}</b> ${esc(b.body)}${a.read ? '' : ' ' + esc(a.how)}</p>${act}</div>`;
|
|
198
202
|
}
|
|
203
|
+
const INFO = 'PMOS reads these sources and never posts to them. A switch chooses only what PMOS reads on its own; your Claude sessions can use every connector.';
|
|
199
204
|
function connectors() {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const
|
|
203
|
-
|
|
205
|
+
const info = T.info ? `<p class="ev-small ev-mut ev-info" id="evConInfo">${esc(INFO)}</p>` : '';
|
|
206
|
+
if (T.src === null) return info + readsHtml() + '<p class="ev-small ev-mut">Reading the connectors.</p>';
|
|
207
|
+
const brief = Object.keys(SRC).filter((k) => k in T.src).map((k) => [SRC[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]))]);
|
|
208
|
+
const more = T.conn.filter((c) => !c.source).map((c) => [c.label, 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))]);
|
|
209
|
+
const all = [...brief, ...more];
|
|
210
|
+
if (!all.length) return info + readsHtml();
|
|
211
|
+
// the other connectors fold to one row (CnA): how many, and the first three names
|
|
212
|
+
const names = all.map((x) => x[0]), sub = names.length > 3 ? names.slice(0, 3).join(', ') + ' and ' + (names.length - 3) + (names.length - 3 === 1 ? ' other' : ' others') : names.join(', ');
|
|
213
|
+
const fold = `<div class="ev-trow ev-fr ev-fold"><span class="ev-gut"></span><div class="ev-tx ev-grow"><span>${all.length} more in your Claude session</span><p class="ev-small ev-mut">${esc(sub)}</p></div>`
|
|
214
|
+
+ `<button type="button" class="ev-ib" data-ev-fold aria-expanded="${!!T.fold}" aria-controls="evConMore" aria-label="${T.fold ? 'Hide the other connectors' : 'Open the other connectors'}" title="${T.fold ? 'Hide the other connectors' : 'Open the other connectors'}">${svg(T.fold ? ICON.down : CHEV, 18)}</button></div>`;
|
|
215
|
+
return info + readsHtml() + fold + (T.fold ? `<div class="ev-con-more" id="evConMore">${all.map((x) => x[1]).join('')}</div>` : '');
|
|
204
216
|
}
|
|
205
217
|
function workspaces() {
|
|
206
218
|
if (T.ws === null) return '<p class="ev-small ev-mut">Reading the repositories.</p>';
|
|
@@ -323,12 +335,14 @@ function draw() {
|
|
|
323
335
|
const el = T.el; if (!el || el.hidden) return;
|
|
324
336
|
// 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
|
|
325
337
|
const ae = document.activeElement, had = ae && el.contains(ae), key = had ? [...ae.attributes].find((a) => a.name.startsWith('data-ev-')) : null;
|
|
326
|
-
const n = {
|
|
338
|
+
const n = { workspaces: T.ws ? T.ws.filter((x) => !x.linked).length : '', updates: ready() ? '<span class="ev-pill y">1</span>' : '' };
|
|
327
339
|
const stale = T.fresh && T.fresh.ok ? bannerOf(T.fresh.sources) : null;
|
|
328
340
|
el.querySelector('.ev-st-nav').innerHTML = '<h2 class="ev-h2">Settings</h2>' + SECTIONS.map(([k, l]) => PAGE_LINKS[k] ? `<a href="${PAGE_LINKS[k]}" class="ev-mi">${esc(l)}</a>` : `<a href="#${k}" class="ev-mi" data-ev-sec="${k}"${T.sec === k ? ' aria-current="page"' : ''}>${esc(l)}${k === 'connectors' && stale ? '<i class="ev-dot risk" aria-label="A source needs you" role="img"></i>' : ''}${n[k] !== undefined && n[k] !== '' ? `<span class="ev-k">${typeof n[k] === 'number' ? n[k] : n[k]}</span>` : ''}</a>`).join('');
|
|
329
341
|
const label = (SECTIONS.find((x) => x[0] === T.sec) || SECTIONS[0])[1];
|
|
330
|
-
const all = T.sec === 'connectors' ? `<button type="button" class="ev-ib" data-ev-
|
|
331
|
-
|
|
342
|
+
const all = T.sec === 'connectors' ? `<button type="button" class="ev-ib" data-ev-info aria-expanded="${!!T.info}" aria-controls="evConInfo" aria-label="What PMOS reads and what it never does" title="What PMOS reads and what it never does">${svg(INFO_I, 18)}</button>`
|
|
343
|
+
+ `<button type="button" class="ev-ib" data-ev-readall aria-label="Read every source again" title="Read all again"${T.reading ? ' disabled' : ''}>${svg(RD, 18)}</button>` : '';
|
|
344
|
+
// the amber box sits on top of the other sections only: on Connectors the trouble row says it (say it once, CnA)
|
|
345
|
+
el.querySelector('.ev-st-main').innerHTML = (T.sec === 'connectors' ? '' : staleHtml()) + `<div class="ev-top"><h3 class="ev-h2" id="evStTitle">${esc(label)}</h3>${all}<button type="button" class="ev-ib" data-ev-close aria-label="Close settings" title="Close settings">${svg(ICON.close, 18)}</button></div>`
|
|
332
346
|
+ BODY[T.sec]() + `<p role="status"${T.msg && AD.moodOfText(T.msg) === 'honest' ? ' class="ev-say honest"' : ''}>${T.msg && AD.moodOfText(T.msg) === 'honest' ? AD.adler('honest', 24, { label: false }) : ''}${esc(T.msg)}</p>`;
|
|
333
347
|
if (disposeClaudeSetup) { disposeClaudeSetup(); disposeClaudeSetup = null; }
|
|
334
348
|
const setup = el.querySelector('[data-claude-setup]');
|
|
@@ -372,6 +386,8 @@ async function press(e) {
|
|
|
372
386
|
if ('evClose' in t.dataset) { closeSettings(); return; }
|
|
373
387
|
if (t.dataset.evWk) { const k = t.dataset.evWk; if (T.wkOpen.has(k)) T.wkOpen.delete(k); else T.wkOpen.add(k); draw(); return; }
|
|
374
388
|
if ('evArc' in t.dataset) { T.arc = !T.arc; draw(); return; }
|
|
389
|
+
if ('evInfo' in t.dataset) { T.info = !T.info; draw(); return; }
|
|
390
|
+
if ('evFold' in t.dataset) { T.fold = !T.fold; draw(); return; }
|
|
375
391
|
if (t.dataset.evMore) { T.wkMore.add(t.dataset.evMore); draw(); return; }
|
|
376
392
|
if (t.dataset.evGo) { T.sec = t.dataset.evGo; draw(); return; }
|
|
377
393
|
if (t.dataset.evSeg === 'theme') { const M = await import('./cozy-nav.js'); M.setTheme(t.dataset.v); draw(); return; }
|
|
@@ -480,7 +496,6 @@ async function waitRestart(from, log) {
|
|
|
480
496
|
}
|
|
481
497
|
/** GET /api/sources: when each source was last read. The place menu's amber dot follows (the event pm:sources). */
|
|
482
498
|
async function readFresh() {
|
|
483
|
-
if (!T.lines) T.lines = await import('./home-more.js').catch(() => null);
|
|
484
499
|
const r = await pmGet('/api/sources' + wsQ());
|
|
485
500
|
T.fresh = r && r.ok !== false ? r : { ok: false, error: (r && r.error) || 'the server did not answer' };
|
|
486
501
|
if (T.fresh.ok) window.dispatchEvent(new CustomEvent('pm:sources', { detail: T.fresh }));
|
|
@@ -525,7 +540,7 @@ export function openSettings(section) {
|
|
|
525
540
|
const el = mount();
|
|
526
541
|
if (section === 'dress') { T.sec = 'adler'; T.dress = true; } else if (section && BODY[section]) { T.sec = section; T.dress = false; }
|
|
527
542
|
else if (el.hidden) { T.sec = 'general'; T.dress = false; } // a fresh open with no section opens on General (R2), not on the section of the last visit
|
|
528
|
-
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 = ''; T.auto = false; T.wkOpen = new Set(); T.wkMore = new Set(); T.arc = false; T.fresh = null; T.note = {}; T.dset = {}; T.cl = null; T.gr = null; T.np = null; JL.reset(); }
|
|
543
|
+
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 = ''; T.auto = false; T.wkOpen = new Set(); T.wkMore = new Set(); T.arc = false; T.fresh = null; T.note = {}; T.info = false; T.fold = false; T.dset = {}; T.cl = null; T.gr = null; T.np = null; JL.reset(); }
|
|
529
544
|
el.hidden = false; document.getElementById('evStScrim').hidden = false; el.setAttribute('data-esc-layer', '');
|
|
530
545
|
draw();
|
|
531
546
|
const f = el.querySelector('[aria-current="page"]'); if (f) f.focus();
|