create-pmos 0.369.0 → 0.371.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 +35 -25
- 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 +7 -0
- package/workspace/briefing-premium-test.js +4 -0
- package/workspace/changelog.json +34 -0
- package/workspace/guide/briefing-premium.md +5 -3
- package/workspace/guide/data-freshness.md +2 -0
- package/workspace/lib/freshness.js +8 -8
- package/workspace/lib/refresh-run.js +19 -1
- package/workspace/lib/routes-sources.js +5 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/premium-shell.js +53 -2
- package/workspace/public/pm/premium.css +10 -0
- package/workspace/public/pm/premium.js +12 -2
- package/workspace/public/premium.html +2 -1
- package/workspace/server.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.371.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,40 @@
|
|
|
32
32
|
"audit"
|
|
33
33
|
],
|
|
34
34
|
"pmosChanges": [
|
|
35
|
+
{
|
|
36
|
+
"v": "0.371.0",
|
|
37
|
+
"at": "2026-10-21T02:38:31.758Z",
|
|
38
|
+
"f": 2,
|
|
39
|
+
"prs": [
|
|
40
|
+
{
|
|
41
|
+
"n": 979,
|
|
42
|
+
"t": "Each Briefing card names the reads it shows and when (briefing-source-flow, slice 5)",
|
|
43
|
+
"s": "Each card says which reads it shows and when they were read, as in the approved mockup."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"n": 978,
|
|
47
|
+
"t": "Quiet the standing chat note until the box has focus (calmer first screen 3/5)",
|
|
48
|
+
"s": "Quiet the standing chat note until the box has focus (calmer first screen 3/5)"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"v": "0.370.0",
|
|
54
|
+
"at": "2026-10-21T02:31:23.574Z",
|
|
55
|
+
"f": 2,
|
|
56
|
+
"prs": [
|
|
57
|
+
{
|
|
58
|
+
"n": 975,
|
|
59
|
+
"t": "Sources is one list: sources by where they are read, then derived content (briefing-source-flow, slice 4)",
|
|
60
|
+
"s": "One list in the shape of the approved mockup, following Wawan's split (2026-10-21) into main sources (raw) and derived content."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"n": 977,
|
|
64
|
+
"t": "The Chat button draws cleanly on the Chat page",
|
|
65
|
+
"s": "The Chat button draws cleanly on the Chat page"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
35
69
|
{
|
|
36
70
|
"v": "0.369.0",
|
|
37
71
|
"at": "2026-10-21T02:18:50.229Z",
|
|
@@ -292,30 +326,6 @@
|
|
|
292
326
|
"s": "The tab draws the page itself, with its toggles and charts working."
|
|
293
327
|
}
|
|
294
328
|
]
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
"v": "0.351.0",
|
|
298
|
-
"at": "2026-10-20T07:13:35.370Z",
|
|
299
|
-
"f": 2,
|
|
300
|
-
"prs": [
|
|
301
|
-
{
|
|
302
|
-
"n": 946,
|
|
303
|
-
"t": "Insights asks for a report through one rounded input",
|
|
304
|
-
"s": "One rounded input (\"Ask PMOS to set up a report\") with a + on the left (opens the same New menu: Dashboard or Report) and a round send button inside it on the right."
|
|
305
|
-
}
|
|
306
|
-
]
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"v": "0.350.0",
|
|
310
|
-
"at": "2026-10-20T06:51:36.341Z",
|
|
311
|
-
"f": 2,
|
|
312
|
-
"prs": [
|
|
313
|
-
{
|
|
314
|
-
"n": 949,
|
|
315
|
-
"t": "The My work item dialog as labelled fields and one Done bar",
|
|
316
|
-
"s": "Each choice is one labelled field with its value from the record and a chevron, like a simple ordering app."
|
|
317
|
-
}
|
|
318
|
-
]
|
|
319
329
|
}
|
|
320
330
|
]
|
|
321
331
|
}
|
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-10-21T02:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-21T02:38:28Z"}
|
|
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-10-21T02:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-21T02:38:28Z"}
|
|
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-10-21T02:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-21T02:38:28Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -125,6 +125,13 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
|
|
|
125
125
|
const { ctx, page, errors } = await open({ theme, w: theme === 'dark' ? 390 : 1280, h: 844 });
|
|
126
126
|
await page.waitForFunction(() => /sdot (ok|warn|bad)/.test((document.querySelector('#srcDot') || {}).className || ''), null, { timeout: 15000 }).catch(() => {});
|
|
127
127
|
const dot = await page.$eval('#srcDot', (e) => e.className);
|
|
128
|
+
if (theme === 'light') {
|
|
129
|
+
// briefing-source-flow, slice 5: each card says which reads it shows and when, from the same Sources read
|
|
130
|
+
await page.waitForSelector('#todayCard > .cread:not([hidden])', { timeout: 15000 }).catch(() => {});
|
|
131
|
+
const rd = await page.evaluate(() => ({ cal: (document.querySelector('#todayCard > .cread') || {}).textContent || '', moves: (document.querySelector('#movesCard > .cread') || {}).textContent || '' }));
|
|
132
|
+
ok('H5 the Calendar card names its read, and What you need to do names the initiatives, My work and the brief', /^Calendar (read|not read yet|failed)/.test(rd.cal) && /Initiatives/.test(rd.moves) && /My work/.test(rd.moves) && /Brief (built|not built yet|off)/.test(rd.moves), JSON.stringify(rd));
|
|
133
|
+
if (shot) await page.screenshot({ path: path.join(shot, 'cards-reads-light.png'), fullPage: true });
|
|
134
|
+
}
|
|
128
135
|
if (theme === 'light') await page.click('#srcChip'); else { await page.click('#moreBtn'); await page.click('#srcItem'); }
|
|
129
136
|
await page.waitForSelector('#srcHealth .hline', { timeout: 15000 }).catch(() => {});
|
|
130
137
|
const line = await page.$eval('#srcHealth', (e) => ({ text: e.textContent.trim(), dot: (e.querySelector('.sdot') || {}).className || '', w: Math.round(e.getBoundingClientRect().width), sw: document.documentElement.scrollWidth }));
|
|
@@ -176,6 +176,8 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
176
176
|
ok('X1 the rail\'s Chat is a round button of at least 44 px', bt && bt.w >= 44 && bt.h >= 44, JSON.stringify(bt));
|
|
177
177
|
await xp.click('.rail [data-go="chat"]'); await until(() => xp.evaluate(() => /premium-chat\.html/.test(location.pathname) && document.querySelector('#dlg').classList.contains('on')), 10000);
|
|
178
178
|
ok('X1b Chat goes to the Chat page and carries the Briefing as the conversation it opens', /about=src%3Athis-page/.test(xp.url()) && /label=the(\+|%20)Briefing/.test(xp.url()), xp.url());
|
|
179
|
+
const draw = await xp.evaluate(() => { const i = document.querySelector('.rail .ind'), r = document.querySelector('.rail'), d = document.querySelector('#dlg'); return { ind: getComputedStyle(i).display, rail: +getComputedStyle(r).zIndex, dlg: +getComputedStyle(d).zIndex }; });
|
|
180
|
+
ok('X1c on the Chat page no grey indicator sits under the Chat button, and the rail is above the dialog so its shadow does not grey the button', draw.ind === 'none' && draw.rail > draw.dlg, JSON.stringify(draw));
|
|
179
181
|
const lay = await until(() => xp.evaluate(() => { const d = document.querySelector('#dlg'), r = document.querySelector('#sRail'); if (!d.classList.contains('full') || !r || !r.offsetWidth || !document.querySelector('#srlList .srl-r')) return null; const o = { rail: Math.round(r.getBoundingClientRect().width), work: Math.round(document.querySelector('#dBody').getBoundingClientRect().width), out: Math.round(document.querySelector('#dOut').getBoundingClientRect().width) }; return o.out > 300 ? o : null; }), 8000) || (await xp.evaluate(() => ({ rail: document.querySelector('#sRail').getBoundingClientRect().width, work: document.querySelector('#dBody').getBoundingClientRect().width, out: document.querySelector('#dOut').getBoundingClientRect().width, cls: document.querySelector('#dlg').className, mode: document.querySelector('#dlg').dataset.mode, w: document.querySelector('#dlg').getBoundingClientRect().width })));
|
|
180
182
|
ok('X2 the Chat page opens the Briefing\'s conversation with three panels: list, conversation, viewer', /Ask about the Briefing/.test(await xp.evaluate(() => document.querySelector('#dTitle').textContent)) && lay && lay.out > 300 && lay.rail > 150 && lay.work > 300 && lay.out > 300, JSON.stringify(lay));
|
|
181
183
|
const grpOf = () => xp.evaluate(() => [...document.querySelectorAll('#srlList .srl-g')].map((g) => g.querySelector('.srl-gh span').textContent + ':' + g.querySelectorAll('.srl-r').length + (g.querySelector('.srl-more') ? '+' + g.querySelector('.srl-more').textContent : '')));
|
|
@@ -312,6 +314,8 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
312
314
|
await p.click('#dPane');
|
|
313
315
|
ok('R4 pressing it again shows the conversation', await p.evaluate(() => document.querySelector('#dlg').dataset.mode === 'split' && getComputedStyle(document.querySelector('#dBody')).display !== 'none'));
|
|
314
316
|
ok('D12 the reply box talks to a Claude Code session, and says what it can do', !d.input && await p.evaluate(() => !document.querySelector('#askIn').disabled && /Claude Code session/.test(document.querySelector('#askNote').textContent)));
|
|
317
|
+
{ const nq = await p.evaluate(() => { const n = document.querySelector('#askNote'); document.activeElement && document.activeElement.blur(); const off = getComputedStyle(n).display; document.querySelector('#askIn').focus(); return { quiet: n.classList.contains('quiet'), off, on: getComputedStyle(n).display }; });
|
|
318
|
+
ok('D12 the standing note under the message box shows while you write there (premium-calmer-first-screen)', nq.quiet && nq.off === 'none' && nq.on !== 'none', JSON.stringify(nq)); }
|
|
315
319
|
let startBody = null;
|
|
316
320
|
await p.route('**/api/agent/start', (r) => { startBody = JSON.parse(r.request().postData()); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, session: { id: 'sx', name: 'draft' } }) }); });
|
|
317
321
|
ok('W8 the start button of a blocked row is live and says what starting does', await p.evaluate(() => { const b = document.querySelector('#startBtn'); const h = document.querySelector('#holdWhy'); return !!b && !b.disabled && /^Start:/.test(b.textContent.trim()) && !!h && /sends nothing outside PMOS/.test(h.textContent); }));
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.371.0",
|
|
4
|
+
"at": "2026-10-21T02:38:31.758Z",
|
|
5
|
+
"f": 2,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 979,
|
|
9
|
+
"t": "Each Briefing card names the reads it shows and when (briefing-source-flow, slice 5)",
|
|
10
|
+
"s": "Each card says which reads it shows and when they were read, as in the approved mockup."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"n": 978,
|
|
14
|
+
"t": "Quiet the standing chat note until the box has focus (calmer first screen 3/5)",
|
|
15
|
+
"s": "Quiet the standing chat note until the box has focus (calmer first screen 3/5)"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"v": "0.370.0",
|
|
21
|
+
"at": "2026-10-21T02:31:23.574Z",
|
|
22
|
+
"f": 2,
|
|
23
|
+
"prs": [
|
|
24
|
+
{
|
|
25
|
+
"n": 975,
|
|
26
|
+
"t": "Sources is one list: sources by where they are read, then derived content (briefing-source-flow, slice 4)",
|
|
27
|
+
"s": "One list in the shape of the approved mockup, following Wawan's split (2026-10-21) into main sources (raw) and derived content."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"n": 977,
|
|
31
|
+
"t": "The Chat button draws cleanly on the Chat page",
|
|
32
|
+
"s": "The Chat button draws cleanly on the Chat page"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
2
36
|
{
|
|
3
37
|
"v": "0.369.0",
|
|
4
38
|
"at": "2026-10-21T02:18:50.229Z",
|
|
@@ -11,7 +11,7 @@ The premium Briefing is a page of its own at `/premium.html`. The console at `/`
|
|
|
11
11
|
|
|
12
12
|
Every premium page uses the console's type: Space Grotesk for text, IBM Plex Mono for times and labels, and the same sizes and weights as the console. A premium page and the console at the same place read at the same size.
|
|
13
13
|
|
|
14
|
-
A rail on the left has five places: Briefing, My work, **Chat**, Board and Insights. Chat is in the middle, a large round button, because the chat is the main place to work. Each place is a page; Chat is at `/premium-chat.html`. On a phone the rail is a bar at the bottom of the screen, and Chat rises above it. It stays at the bottom after you type in a field and the keyboard closes.
|
|
14
|
+
A rail on the left has five places: Briefing, My work, **Chat**, Board and Insights. Chat is in the middle, a large round button, because the chat is the main place to work. Each place is a page; Chat is at `/premium-chat.html`. On a phone the rail is a bar at the bottom of the screen, and Chat rises above it. A grey band marks the page you are on; on the Chat page the solid Chat button is that mark, so no band is drawn under it. It stays at the bottom after you type in a field and the keyboard closes.
|
|
15
15
|
|
|
16
16
|
Every premium page has the same top bar. On the left is where you are. On the right are the **Sources** chip, the bell and one **⋯** menu.
|
|
17
17
|
|
|
@@ -28,7 +28,7 @@ Every premium page has the same top bar. On the left is where you are. On the ri
|
|
|
28
28
|
|
|
29
29
|
The first line of **Sources** says whether PMOS's background work is running. When everything is on time it reads like "Background on · brief 06:52 · sources 06:49": the time today's morning brief was saved and the time of the last source read. It turns orange when something is late, such as a source that missed its scheduled read by more than an hour, or Git sync that keeps failing. It turns red when something stopped: no morning brief 45 minutes after its time, a source whose last run failed, a session whose prompt was typed but not sent, or background checks that stopped. The line gives the reason in plain words, and other problems are listed under it. The Sources dot takes the same colour, and a stop is also added to the bell, once a day. When the morning brief is due, it first refreshes Calendar, Jira and My work if they are more than 2 hours old, then builds from them. It waits for them for at most 30 minutes.
|
|
30
30
|
|
|
31
|
-
**The Chat page** is the chat as a page of its own. On a desktop it has three panels: the session list, the conversation and the viewer. It has no close button; the rail takes you to another place. On a phone it fills the screen above the bar and opens on the conversation; the **Sessions** chip opens the list. A chat dialog elsewhere (a row's Conversation tab) still shows the list when it is full screen.
|
|
31
|
+
**The Chat page** is the chat as a page of its own. On a desktop it has three panels: the session list, the conversation and the viewer. It has no close button; the rail takes you to another place. On a phone it fills the screen above the bar and opens on the conversation; the **Sessions** chip opens the list. A chat dialog elsewhere (a row's Conversation tab) still shows the list when it is full screen. The standing note under the message box ("This is a Claude Code session…") shows only while you write in the box; any other note there, such as Sent, an error or Claude is waiting, always shows.
|
|
32
32
|
|
|
33
33
|
- **Groups.** **Goals** holds a chat whose goal is started or waiting on you. **Yours** holds the other sessions you started. **Started by PMOS** holds schedules, the day run, the Driver, the Checker, notes, document syncs and other background runs. A PMOS session shows only when it needs you. The rest fold into one line, "N more working on their own · Show".
|
|
34
34
|
- **Dots.** An orange dot means **Ready**: the session finished its turn and waits for you. A green dot means **Running**. An orange ring means **Maybe blocked**: a call is open and nothing moves, often a permission question. No dot means idle. Ready sessions come first and are bold. Hold the pointer over a row to see its state in words.
|
|
@@ -103,7 +103,9 @@ Two reads feed the page. The quick read takes the kill conditions, the failed-re
|
|
|
103
103
|
|
|
104
104
|
## The header
|
|
105
105
|
|
|
106
|
-
The Briefing's **Sources** dialog
|
|
106
|
+
The Briefing's **Sources** dialog is one list in three groups. **Sources · read on this machine** and **Sources · read through your connectors** are the raw sources, each with its last read. **Derived content** is what PMOS builds from those stored reads, never from a tool: the morning brief, core documents and the horizon scan. Each derived row says when it was built and from which reads, with their times. Under it, **This Briefing was built from** lists each source the page reads, with its state: **Read**, **Not read**, **Not included** or **Off**, and the reason. Examples: `planning/runs/agent-runs.jsonl` is missing in that repository; the product is not chosen under **Products**; the source is switched off under **Settings → Connectors**; the morning brief could not reach it. A source that cannot be read adds nothing. The page does not guess. **Products** is the product picker (see "Products").
|
|
107
|
+
|
|
108
|
+
Each card ends with a read line: the sources it shows and when each was read, from the same read as Sources. **What you need to do** names Initiatives, My work and the brief. **Calendar** names Calendar. An orange dot means one of them is old, failed or not read yet. While **Refresh all** runs, a line under the headline says which step it is on: reading the sources, or writing the brief from them.
|
|
107
109
|
|
|
108
110
|
On the Briefing, **Refresh all** also reads every included repository again now, without waiting for the 5-minute age. If a read is already running, it does not start a second one. A read that failed is tried again at once.
|
|
109
111
|
|
|
@@ -59,6 +59,8 @@ The Sources list shows them as one row, **Your tools**. Its time is the oldest r
|
|
|
59
59
|
|
|
60
60
|
Sources says which step the run is on. Only one run goes at a time: a second press, or a press in another tab, joins the run that is going. If the Briefing is being written when you press, it is written once more after the new reads. A run that has not ended after 3 hours is over, and the next press starts a new one. **Refresh** on one row still reads only that source.
|
|
61
61
|
|
|
62
|
+
Sources is one list. The raw sources come first, grouped as **read on this machine** (the repository, initiatives and tracker files) and **read through your connectors** (Calendar, Jira, My work and Your tools). Then **Derived content**: the morning brief, core documents and the horizon scan. Each derived row says when it was last built and the reads it was built from, with their times. A derived row has no Refresh of its own: Refresh all rebuilds it after its sources.
|
|
63
|
+
|
|
62
64
|
The skill saves its reads with this command:
|
|
63
65
|
|
|
64
66
|
- `pmos source save --file <reads.json>` saves one record per tool. A record that is off or not reached says so. A field past its limit refuses the whole file, and nothing is saved.
|
|
@@ -34,14 +34,14 @@ const sourceReads = require('./source-reads.js');
|
|
|
34
34
|
|
|
35
35
|
const H = 3600 * 1000;
|
|
36
36
|
const SOURCES = Object.freeze([
|
|
37
|
-
{ id: 'repository', label: 'Repository', skill: null, stale_after_ms: null },
|
|
38
|
-
{ id: 'initiatives', label: 'Initiatives', skill: null, stale_after_ms: null },
|
|
39
|
-
{ id: 'calendar', label: 'Calendar', skill: 'calendar-sync', stale_after_ms: 8 * H },
|
|
40
|
-
{ id: 'jira', label: 'Jira status', skill: 'jira-sync', stale_after_ms: 26 * H },
|
|
41
|
-
{ id: 'my-work', label: 'My work', skill: 'my-work-read', stale_after_ms: 26 * H },
|
|
42
|
-
{ id: 'tracker', label: 'Tracker items', skill: 'tracker-refresh', stale_after_ms: 8 * 24 * H },
|
|
37
|
+
{ id: 'repository', group: 'machine', label: 'Repository', skill: null, stale_after_ms: null },
|
|
38
|
+
{ id: 'initiatives', group: 'machine', label: 'Initiatives', skill: null, stale_after_ms: null },
|
|
39
|
+
{ id: 'calendar', group: 'connector', label: 'Calendar', skill: 'calendar-sync', stale_after_ms: 8 * H },
|
|
40
|
+
{ id: 'jira', group: 'connector', label: 'Jira status', skill: 'jira-sync', stale_after_ms: 26 * H },
|
|
41
|
+
{ id: 'my-work', group: 'connector', label: 'My work', skill: 'my-work-read', stale_after_ms: 26 * H },
|
|
42
|
+
{ id: 'tracker', group: 'machine', label: 'Tracker items', skill: 'tracker-refresh', stale_after_ms: 8 * 24 * H },
|
|
43
43
|
// briefing-source-flow: Mail, Slack, Wispr, Confluence and the other tools the Briefing uses, read by one session and stored (lib/source-reads.js)
|
|
44
|
-
{ id: 'tools', label: 'Your tools', skill: 'sources-read', stale_after_ms: 8 * H },
|
|
44
|
+
{ id: 'tools', group: 'connector', label: 'Your tools', skill: 'sources-read', stale_after_ms: 8 * H },
|
|
45
45
|
]);
|
|
46
46
|
|
|
47
47
|
const iso = (ms) => (ms ? new Date(ms).toISOString() : null);
|
|
@@ -133,7 +133,7 @@ function create(o) {
|
|
|
133
133
|
if (asOfMs && src.stale_after_ms && t - asOfMs > src.stale_after_ms) state = 'stale';
|
|
134
134
|
const schedule = scheduleOf(src.skill);
|
|
135
135
|
if (schedule && schedule.last_status === 'fail' && state !== 'never') state = 'failed';
|
|
136
|
-
return { id: src.id, label: src.label, as_of: iso(asOfMs), state, detail: null, stale_after_ms: src.stale_after_ms, skill: src.skill, schedule, ...extra };
|
|
136
|
+
return { id: src.id, label: src.label, group: src.group, as_of: iso(asOfMs), state, detail: null, stale_after_ms: src.stale_after_ms, skill: src.skill, schedule, ...extra };
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
/** One row per source for workspace `w` ({ id, root, repoStateDir }). Reads memory, small files and file times only. */
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* run.codeRun(id, { result, got, error, took_ms, trigger }) one line pair for a run with no session (signals, repository, Git sync)
|
|
9
9
|
* run.jobGate(id, now) may job `id` run its tick now (off, or an input still running)
|
|
10
10
|
* run.runNow(id, { ws, withInputs }) Refresh now; with inputs, the old ones first and this one once they end
|
|
11
|
+
* run.derived(ws) the derived content (briefing-source-flow, slice 4): each one, when it was last built, and the
|
|
12
|
+
* reads it was built from
|
|
11
13
|
* run.refreshAll(ws) · run.allState() Refresh all (briefing-source-flow, slice 3): read every source that is on, then write the
|
|
12
14
|
* Briefing from those reads. One run at a time: a second press joins the run that is going.
|
|
13
15
|
* run.rows(ws) · run.setSource(id, patch) · run.setRules(patch) · run.ensureOn(id, ws) · run.settings() · run.log()
|
|
@@ -27,6 +29,7 @@ const PRUNE_EVERY_MS = 24 * 3600 * 1000;
|
|
|
27
29
|
const LOST_MS = 6 * 3600 * 1000; // a run with no live session and no end after this long is written as interrupted
|
|
28
30
|
const ALL_MS = 3 * 3600 * 1000; // a Refresh all that has not ended after this long is over: a new press starts a new one
|
|
29
31
|
const DERIVED = Object.freeze(['brief']); // what Refresh all writes again after the sources, in this order
|
|
32
|
+
const DERIVED_LIST = Object.freeze(['scan', 'coredocs', 'brief']); // what Sources lists as derived content: built from stored reads, never a tool
|
|
30
33
|
const AUTH_RETRY_MS = 2 * 60 * 1000; // a run that failed on Claude's sign-in is tried once more after this (the token is usually refreshed by then)
|
|
31
34
|
|
|
32
35
|
function create(host) {
|
|
@@ -359,6 +362,21 @@ function create(host) {
|
|
|
359
362
|
return { ok: true, joined: false, started, already, failed, all: allState(now()) };
|
|
360
363
|
}
|
|
361
364
|
|
|
365
|
+
/** Derived content for Sources (slice 4): { id, label, state, at, from: [{ id, label, at, state }] }. The brief names the reads its last
|
|
366
|
+
* run started on (the start line's inputs); the others name their inputs as they are now. */
|
|
367
|
+
function derived(ws) {
|
|
368
|
+
const t = now(); const set = settings(); const rws = new Map(rowsFor(ws, set, t).map((r) => [r.id, r]));
|
|
369
|
+
const f = log();
|
|
370
|
+
return DERIVED_LIST.map((id) => {
|
|
371
|
+
const r = rws.get(id); if (!r) return null;
|
|
372
|
+
const l = f.lastRun(id);
|
|
373
|
+
const snap = id === 'brief' && l && Array.isArray(l.inputs) && l.inputs.length ? l.inputs : null;
|
|
374
|
+
const from = snap ? snap.map((i) => ({ id: i.id, label: (R.BY_ID.get(i.id) || { label: i.id }).label, at: i.at || null, state: i.result === 'failed' ? 'failed' : i.at ? 'read' : 'never' }))
|
|
375
|
+
: r.inputs.map((i) => ({ id: i.id, label: i.label, at: i.at || null, state: i.state === 'failed' ? 'failed' : i.at ? 'read' : 'never' }));
|
|
376
|
+
return { id, label: r.label, state: r.state, at: r.last ? r.last.at || null : null, from };
|
|
377
|
+
}).filter(Boolean);
|
|
378
|
+
}
|
|
379
|
+
|
|
362
380
|
/* ── rows ── */
|
|
363
381
|
const FRESH_OF = { 'my-work': 'my-work', calendar: 'calendar', jira: 'jira', tracker: 'tracker', tools: 'tools', initiatives: 'initiatives' };
|
|
364
382
|
function rowsFor(ws, set, t) {
|
|
@@ -380,7 +398,7 @@ function create(host) {
|
|
|
380
398
|
last_run: l ? l.start_at : null, last_status: l ? (l.result === 'failed' ? 'fail' : l.result === 'done' ? 'ok' : 'started') : st.last_result || null };
|
|
381
399
|
}
|
|
382
400
|
|
|
383
|
-
return { tick, started, ended, briefDone, codeRun, jobGate, runNow, refreshAll, allState, setSource, setRules, ensureOn, rows, settings, log, scheduleOfSkill, managedSkill: (skill) => R.SKILL_OF.get(skill) || null };
|
|
401
|
+
return { 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 };
|
|
384
402
|
}
|
|
385
403
|
|
|
386
404
|
module.exports = { create };
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* GET /api/sources?ws=<id> → { ok, ws, version, sources: [row], health, all } lib/freshness.js sources(); health is
|
|
5
5
|
* lib/harness-health.js of(): { level, line, issues } or null; all is the last Refresh all
|
|
6
|
-
* (lib/refresh-run.js allState) or null
|
|
6
|
+
* (lib/refresh-run.js allState) or null; derived is the content built from stored reads
|
|
7
|
+
* (refresh-run derived: the brief, core documents, the scan, and the reads each was built from).
|
|
8
|
+
* Each source row has a group: 'machine' (read on this machine) or 'connector'
|
|
7
9
|
* POST /api/sources/refresh { ws, source } → { ok, source, started: 'rebuild'|'session', session? }
|
|
8
10
|
* POST /api/sources/refresh-all { ws } → { ok, joined, started, already, failed, all } every source that is on, then the
|
|
9
11
|
* Briefing from those reads (briefing-source-flow, slice 3); a press while one runs joins it
|
|
@@ -34,7 +36,8 @@ async function handle(req, res, url, ctx) {
|
|
|
34
36
|
const sources = F.sources({ id: w.id, root: w.root, repoStateDir: repoStateDir(ctx, w) });
|
|
35
37
|
let health = null; try { health = ctx.health ? ctx.health() : null; } catch { health = null; }
|
|
36
38
|
let all = null; try { all = ctx.refreshAllState ? ctx.refreshAllState() : null; } catch { all = null; }
|
|
37
|
-
|
|
39
|
+
let derived = []; try { derived = ctx.refreshDerived ? ctx.refreshDerived(w.id) : []; } catch { derived = []; }
|
|
40
|
+
ctx.json(res, { ok: true, ws: w.id, version: F.versions()[w.id] || 0, sources, health, all, derived });
|
|
38
41
|
return true;
|
|
39
42
|
}
|
|
40
43
|
if (p !== '/api/sources/refresh' && p !== '/api/sources/watch' && p !== '/api/sources/refresh-all') return false;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.371.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.371.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -95,8 +95,27 @@ async function tbReadSrc() {
|
|
|
95
95
|
const was = TB.src && TB.src.all;
|
|
96
96
|
TB.src = r && r.ok && Array.isArray(r.sources) ? r : { ok: false, sources: [] };
|
|
97
97
|
tbDot(); allWatch(was);
|
|
98
|
+
window.dispatchEvent(new CustomEvent('pm:sources', { detail: TB.src })); // a card's read line (slice 5) redraws from the same read
|
|
98
99
|
return TB.src;
|
|
99
100
|
}
|
|
101
|
+
/** The last read of Sources: { ok, sources, derived, all } (the cards' read lines take their times from it). */
|
|
102
|
+
export const sourcesNow = () => TB.src;
|
|
103
|
+
/** A card's read line (briefing-source-flow, slice 5): a dot and "<source> read HH:MM" for each id, from the same Sources read. ids name
|
|
104
|
+
* freshness rows ('initiatives', 'calendar', …) or derived content ('d:brief'). A source never read or failed says so. */
|
|
105
|
+
export function readLine(ids) {
|
|
106
|
+
const s = TB.src; if (!s || !s.ok) return '';
|
|
107
|
+
const bits = ids.map((id) => {
|
|
108
|
+
const der = id.startsWith('d:'), x = der ? (s.derived || []).find((d) => d.id === id.slice(2)) : s.sources.find((r) => r.id === id);
|
|
109
|
+
if (!x) return null;
|
|
110
|
+
const bad = der ? ['old', 'failed', 'never'].includes(x.state) : ['stale', 'failed', 'never'].includes(x.state);
|
|
111
|
+
const at = der ? x.at : x.as_of;
|
|
112
|
+
const w = x.state === 'failed' ? 'failed' : at ? (der ? 'built ' : 'read ') + whenRead(at) : x.state === 'off' ? 'off' : der ? 'not built yet' : 'not read yet';
|
|
113
|
+
return { bad, t: (der ? ({ brief: 'Brief' })[x.id] || x.label : x.label) + ' ' + w };
|
|
114
|
+
}).filter(Boolean);
|
|
115
|
+
if (!bits.length) return '';
|
|
116
|
+
const bad = bits.some((b) => b.bad);
|
|
117
|
+
return `<i class="sdot ${bad ? 'warn' : 'ok'}" aria-hidden="true"></i>${esc(bits.map((b) => b.t).join(' · '))}`;
|
|
118
|
+
}
|
|
100
119
|
/* ── Refresh all (briefing-source-flow, slice 3): one run, in order. The server reads every source that is on, then writes the Briefing
|
|
101
120
|
* from those reads; this side says which step it is on, re-reads while it runs, and tells the page when it ended (event pm:refreshed). ── */
|
|
102
121
|
let AWATCH = null;
|
|
@@ -145,10 +164,35 @@ const srcRow = (s) => {
|
|
|
145
164
|
const off = s.state === 'off' || s.state === 'building' || TB.busy;
|
|
146
165
|
return `<div class="sr"><span class="sn"><b><i class="sdot ${cls}" aria-hidden="true"></i>${esc(s.label)}</b><em>${esc(SSTATE[s.state] || s.state)}${s.as_of || s.id === 'repository' && s.state === 'fresh' ? ' · ' + esc(when) : ''}</em></span>${s.id === 'repository' ? '' : `<button type="button" class="cta alt" data-sref="${esc(s.id)}" aria-label="Refresh ${esc(s.label)}"${off ? ' disabled' : ''}>Refresh</button>`}</div>`;
|
|
147
166
|
};
|
|
167
|
+
const DSTATE = { recent: 'Built', old: 'Old', running: 'Building now', waiting: 'Waits for its sources', failed: 'Failed', never: 'Not built yet', off: 'Off' };
|
|
168
|
+
/** A derived row: when it was last built, and the reads it was built from with their times. It has no Refresh: Refresh all rebuilds it. */
|
|
169
|
+
const derRow = (d) => {
|
|
170
|
+
const cls = d.state === 'recent' ? 'ok' : d.state === 'old' || d.state === 'failed' || d.state === 'never' ? 'warn' : '';
|
|
171
|
+
const from = (d.from || []).map((f) => f.label + ' ' + (f.state === 'failed' ? 'failed' : f.at ? whenRead(f.at) : 'never read')).join(', ');
|
|
172
|
+
return `<div class="sr" data-der="${esc(d.id)}"><span class="sn"><b><i class="sdot ${cls}" aria-hidden="true"></i>${esc(d.label)}</b><em>${esc(DSTATE[d.state] || d.state)}${d.at ? ' · ' + esc(whenRead(d.at)) : ''}${from ? ' · from ' + esc(from) : ''}</em></span></div>`;
|
|
173
|
+
};
|
|
174
|
+
/** The steps of a Refresh all that is going: read the sources, then write the brief. */
|
|
175
|
+
const STW = { done: 'done', running: 'running', waiting: 'next', failed: 'failed', 'not-run': 'next' };
|
|
176
|
+
function stepsHtml() {
|
|
177
|
+
if (!allOn()) return '';
|
|
178
|
+
const S = TB.src.all.steps || [];
|
|
179
|
+
const st = (L) => (L.some((x) => x.state === 'running') ? 'running' : L.some((x) => x.state === 'waiting' || x.state === 'not-run') ? 'next' : L.some((x) => x.state === 'failed') ? 'failed' : 'done');
|
|
180
|
+
const reads = S.filter((x) => x.step === 'read'), der = S.filter((x) => x.step === 'derived');
|
|
181
|
+
const one = TB.src.all.phase === 'read' ? 'running' : st(reads);
|
|
182
|
+
return `<ol class="srsteps" aria-label="Refresh all"><li><b>1</b> Read the sources <em>${esc(one)}</em></li><li><b>2</b> Write the brief from them <em>${esc(TB.src.all.phase === 'derived' ? 'running' : STW[st(der)] || 'next')}</em></li></ol>`;
|
|
183
|
+
}
|
|
148
184
|
let SPOLL = null;
|
|
149
185
|
export async function openSources() {
|
|
150
186
|
// the frame is drawn once; a re-read redraws only the rows, the button and the message, so the page's own part (the Briefing's picker) is left alone
|
|
151
|
-
|
|
187
|
+
// one list (briefing-source-flow, slice 4): the sources, by where they are read, then the derived content built from their stored reads
|
|
188
|
+
const rowsHtml = () => {
|
|
189
|
+
const s = TB.src; if (!s) return '<p class="note">Reading the sources.</p>'; if (!s.ok) return '<p class="note err" role="alert">The sources could not be read.</p>';
|
|
190
|
+
const grp = (label, L) => (L.length ? `<div class="srgrp"><span class="label">${esc(label)}</span>${L.map(srcRow).join('')}</div>` : '');
|
|
191
|
+
const D = Array.isArray(s.derived) ? s.derived : [];
|
|
192
|
+
return stepsHtml() + grp('Sources · read on this machine', s.sources.filter((x) => x.group === 'machine'))
|
|
193
|
+
+ grp('Sources · read through your connectors', s.sources.filter((x) => x.group !== 'machine'))
|
|
194
|
+
+ (D.length ? `<div class="srgrp"><span class="label">Derived content · built from stored reads, never from a tool</span>${D.map(derRow).join('')}</div>` : '');
|
|
195
|
+
};
|
|
152
196
|
const draw = () => {
|
|
153
197
|
if (allOn()) TB.msg = allText(TB.src.all);
|
|
154
198
|
const allLabel = allOn() ? 'Refreshing' : 'Refresh all';
|
|
@@ -157,7 +201,7 @@ export async function openSources() {
|
|
|
157
201
|
$('#oMain').innerHTML = `<article class="paper doc"><div class="addf">
|
|
158
202
|
<div id="srcHealth">${healthHtml()}</div>
|
|
159
203
|
<div class="srctop"><p class="note" style="margin:0">Each source is read on its own schedule, not live. Refresh all reads every source, then writes the Briefing from those reads.</p><button type="button" class="cta" id="srcAll"${TB.busy || allOn() ? ' disabled' : ''}>${allLabel}</button></div>
|
|
160
|
-
<div
|
|
204
|
+
<div id="srcRows">${rowsHtml()}</div>
|
|
161
205
|
${TB.extra ? TB.extra.html() : ''}
|
|
162
206
|
<p class="note" id="srcM" role="status" style="margin:0;min-height:1.2em">${esc(TB.msg)}</p></div></article>`;
|
|
163
207
|
if (TB.extra && TB.extra.mount) TB.extra.mount();
|
|
@@ -245,6 +289,7 @@ export function openDlg(o) {
|
|
|
245
289
|
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail'; vwReset(); // extra viewer tabs belong to the dialog that opened them
|
|
246
290
|
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div>${padMarkup()}<textarea id="askIn" rows="1" placeholder="Message Claude, or type /" maxlength="8000" autocomplete="off" enterkeyhint="send" aria-label="A message for Claude" aria-controls="slashM"></textarea><button type="submit" data-act="ask" id="askGo" aria-label="Send to Claude" title="Send to Claude"><svg class="i" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></form><div class="askfoot"><p class="fine2" id="askNote">${CHAT_NOTE}</p>${padChipMarkup()}</div>`;
|
|
247
291
|
mountPad({ key: S.key, ws: new URLSearchParams(location.search).get('ws'), input: $('#askIn') });
|
|
292
|
+
quietNote();
|
|
248
293
|
$('#dlg').classList.toggle('cmp', o.compact !== false); $('#dlg').classList.remove('shrunk', 'tfull'); document.body.classList.remove('railoff'); // compact (every dialog unless it says compact: false): a short head on a phone that shrinks as the detail scrolls
|
|
249
294
|
$('#dlg').classList.remove('full'); setMode('split'); setTab('out'); // on a phone the dialog opens on the Detail tab and the Detail / Conversation switch brings the conversation, as the mockup draws it
|
|
250
295
|
$('#veil').classList.add('on'); $('#dlg').classList.add('on');
|
|
@@ -333,6 +378,12 @@ export const turnU = (t) => `<div class="turn u"><div class="ub">${esc(t)}</div>
|
|
|
333
378
|
* The first message on a row starts one interactive session for it; later messages go to the same session. The words come from Claude Code's
|
|
334
379
|
* own transcript (GET /api/sessions/conversation), as the console's session conversation reads them. Earlier read-only answers stay above. */
|
|
335
380
|
const CHAT_NOTE = 'This is a Claude Code session. It can change files and run commands, and asks first where your Claude Code settings say so.';
|
|
381
|
+
/* the standing note under the message box shows while you write there; any other note (Sent, an error, Claude is waiting) always shows (premium-calmer-first-screen) */
|
|
382
|
+
function quietNote() {
|
|
383
|
+
const n = $('#askNote'); if (!n) return;
|
|
384
|
+
const set = () => n.classList.toggle('quiet', n.textContent === CHAT_NOTE);
|
|
385
|
+
set(); new MutationObserver(set).observe(n, { childList: true, characterData: true, subtree: true });
|
|
386
|
+
}
|
|
336
387
|
const turnAgent = (h) => `<div class="turn a"><i class="av">${AI}</i><div class="tc">${h}</div></div>`;
|
|
337
388
|
const turnUser = (t) => `<div class="turn u"><div class="ub">${userHtml(t)}</div></div>`; // the PM's words, paste tags gone, line breaks kept
|
|
338
389
|
export function threadHtml(th) {
|
|
@@ -633,6 +633,7 @@ button.pst{border:0;font:inherit;color:inherit;text-align:left;cursor:pointer}bu
|
|
|
633
633
|
.cta.quiet:hover{background:var(--solid);color:var(--on-solid)}
|
|
634
634
|
.tx{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:12px}
|
|
635
635
|
.tx .hint{font-size:var(--fs-2);color:var(--ink-2);margin-left:6px}
|
|
636
|
+
.askbar:not(:focus-within)+.askfoot .fine2.quiet{display:none} /* premium-calmer-first-screen: the standing chat note shows while you write */
|
|
636
637
|
.why.one{min-height:0;height:46px;padding:0 14px;resize:none;flex:1;min-width:0}
|
|
637
638
|
.toast .undo{margin-left:10px;height:44px;padding:0 14px;border-radius:999px;background:var(--solid);color:var(--on-solid);font-weight:600;font-size:var(--fs-3)}
|
|
638
639
|
|
|
@@ -2161,6 +2162,10 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2161
2162
|
.hline:empty,#srcHealth:empty{display:none}
|
|
2162
2163
|
.sr .sn b{display:inline-flex;align-items:center;gap:8px}
|
|
2163
2164
|
.srctop{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
|
|
2165
|
+
.cread{display:flex;align-items:center;gap:8px;margin:14px 0 0;font-size:var(--fs-2);color:var(--ink-3)}
|
|
2166
|
+
.rfline{margin:10px 0 0;font-size:var(--fs-2);color:var(--ink-3)}
|
|
2167
|
+
.srgrp{display:grid;margin-top:12px}.srgrp:first-child{margin-top:0}
|
|
2168
|
+
.srsteps{list-style:none;margin:0 0 4px;padding:0;display:grid;gap:4px}.srsteps li{display:flex;align-items:center;gap:8px;font-size:var(--fs-2)}.srsteps li b{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;border:1px solid var(--hair)}.srsteps li em{font-style:normal;color:var(--ink-3)}
|
|
2164
2169
|
.mwrap{position:relative;display:inline-flex}
|
|
2165
2170
|
.mdot{position:absolute;top:2px;right:2px;width:10px;height:10px;border-radius:50%;background:var(--ember);border:2px solid var(--card-solid)}
|
|
2166
2171
|
.mdot[hidden]{display:none}
|
|
@@ -2586,6 +2591,11 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2586
2591
|
@media (min-width:1000px){.chatpg .dlg.on{left:128px;top:16px;transform:none;width:calc(100% - 144px);height:calc(100% - 32px);max-height:none!important;border-radius:28px;padding:26px 34px 18px}}
|
|
2587
2592
|
@media (max-width:999px){.chatpg .dlg.on{left:0;top:0;transform:none;width:100%;height:calc(100% - 118px - env(safe-area-inset-bottom,0px));max-height:none!important;border-radius:0 0 28px 28px;padding:16px 18px 14px}}
|
|
2588
2593
|
|
|
2594
|
+
/* ── premium-chat-rail, the Chat page: the solid Chat button is the "you are here" mark, so the rail's grey indicator does not also sit under it
|
|
2595
|
+
(it peeked out below the raised button on a phone). The rail sits above the page's dialog, so the dialog's shadow does not grey the button and its ring. ── */
|
|
2596
|
+
.chatpg .rail{z-index:42}
|
|
2597
|
+
.chatpg .rail .ind{display:none}
|
|
2598
|
+
|
|
2589
2599
|
/* ── premium-phone-room: on a phone the Chat page gives the conversation the screen. Scrolling the conversation down, or typing, moves the rail
|
|
2590
2600
|
off the bottom and the page grows into its place; scrolling up brings the rail back. The page is as tall as what the keyboard leaves (--vvh). ── */
|
|
2591
2601
|
@media (max-width:999px){
|
|
@@ -12,7 +12,7 @@ import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words
|
|
|
12
12
|
import { consoleReads, briefOf, needsListOf } from './premium-brief.js';
|
|
13
13
|
import { mountDocSheet } from './premium-doc-sheet.js';
|
|
14
14
|
import { momentOf, inText } from './c3-phone-model.js';
|
|
15
|
-
import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, setFull, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail, pvFeed, setPageGaps, sourcesHook, allText, chatAbout, pvOpenBell, ibState } from './premium-shell.js';
|
|
15
|
+
import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, setFull, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail, pvFeed, setPageGaps, sourcesHook, allText, sourcesNow, readLine, chatAbout, pvOpenBell, ibState } from './premium-shell.js';
|
|
16
16
|
const ICON = {
|
|
17
17
|
meeting: '<rect x="4" y="5" width="16" height="15" rx="3"/><path d="M4 10h16M9 3v4M15 3v4"/>',
|
|
18
18
|
merge: '<circle cx="6" cy="6" r="2"/><circle cx="6" cy="18" r="2"/><circle cx="18" cy="9" r="2"/><path d="M6 8v8M18 11c0 4-6 3-12 5"/>',
|
|
@@ -1087,7 +1087,7 @@ function sourcesHtml() {
|
|
|
1087
1087
|
const L = (M && M.header && M.header.sources) || [];
|
|
1088
1088
|
const rows = !L.length ? '<p class="note">The Briefing has not read anything yet.</p>'
|
|
1089
1089
|
: L.map((x) => { const [c, w] = RDST[x.state] || ['', x.state]; return `<div class="sr"><span class="sn"><b><i class="sdot ${c}" aria-hidden="true"></i>${esc(x.name)}</b><em>${esc(w)}${x.reason ? ' · ' + esc(x.reason) : ''}</em></span></div>`; }).join('');
|
|
1090
|
-
return `<div
|
|
1090
|
+
return `<div class="srgrp"><span class="label">This Briefing was built from</span>${rows}</div><div id="pkSlot"></div>`;
|
|
1091
1091
|
}
|
|
1092
1092
|
async function refreshRepos() {
|
|
1093
1093
|
const ws = new URLSearchParams(location.search).get('ws');
|
|
@@ -1100,6 +1100,16 @@ let RTIMER = null;
|
|
|
1100
1100
|
$('#pkw').dataset.park = 'pkPark';
|
|
1101
1101
|
sourcesHook({ html: sourcesHtml, mount: () => { const slot = $('#pkSlot'), w = $('#pkw'); if (slot && w) slot.appendChild(w); }, refresh: refreshRepos });
|
|
1102
1102
|
window.addEventListener('pm:refreshed', () => load()); // Refresh all ended: the Briefing it wrote is read again (briefing-source-flow, slice 3)
|
|
1103
|
+
/* briefing-source-flow, slice 5: each card says which reads it shows and when they were read, and the hero says the step of a Refresh all
|
|
1104
|
+
* that is going. Both come from the one Sources read (premium-shell.js), so a card and Sources cannot disagree. */
|
|
1105
|
+
function drawReads() {
|
|
1106
|
+
const put = (sel, ids) => { const c = $(sel); if (!c) return; let p = c.querySelector(':scope > .cread'); if (!p) { p = document.createElement('p'); p.className = 'cread'; c.appendChild(p); } p.innerHTML = readLine(ids); p.hidden = !p.innerHTML; };
|
|
1107
|
+
put('#movesCard', ['initiatives', 'my-work', 'd:brief']);
|
|
1108
|
+
put('#todayCard', ['calendar']);
|
|
1109
|
+
const s = sourcesNow(), a = s && s.ok ? s.all : null, line = $('#rfLine');
|
|
1110
|
+
if (line) { const on = !!(a && !a.done); line.hidden = !on; line.textContent = on ? allText(a) : ''; }
|
|
1111
|
+
}
|
|
1112
|
+
window.addEventListener('pm:sources', drawReads);
|
|
1103
1113
|
chatAbout('src:this-page', 'the Briefing');
|
|
1104
1114
|
$('#brief').textContent = 'Reading the repository.';
|
|
1105
1115
|
load();
|
|
@@ -50,10 +50,11 @@
|
|
|
50
50
|
<section class="hero">
|
|
51
51
|
<p class="date rise" style="--d:1" id="date"></p>
|
|
52
52
|
<p class="brief rise" style="--d:2" id="brief" aria-live="polite"></p>
|
|
53
|
+
<p class="rfline" id="rfLine" role="status" hidden></p>
|
|
53
54
|
</section>
|
|
54
55
|
<div class="cols2">
|
|
55
56
|
<div>
|
|
56
|
-
<section class="card rise" style="--d:6" aria-labelledby="hMoves">
|
|
57
|
+
<section class="card rise" id="movesCard" style="--d:6" aria-labelledby="hMoves">
|
|
57
58
|
<div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><path d="M5 12l4.5 4.5L19 7"/></svg></span><h2 id="hMoves">What you need to do</h2><small id="movesCap"></small></div>
|
|
58
59
|
<div class="mprog" id="mprog" role="progressbar" aria-label="Done today" aria-valuemin="0" hidden><b></b></div>
|
|
59
60
|
<div class="rank" id="rank"></div>
|
package/workspace/server.js
CHANGED
|
@@ -9716,7 +9716,7 @@ async function handleRequest(req, res) {
|
|
|
9716
9716
|
},
|
|
9717
9717
|
// workspace-data-freshness: the source table, the facts rebuild and Refresh now's skill sessions
|
|
9718
9718
|
freshness, factsRefresh: (root) => factsAsync.refresh(root, { force: true }), startSkill: startSkillSession, health: () => harnessHealth(),
|
|
9719
|
-
refreshAll: (wsId) => refreshRun.refreshAll(wsId), refreshAllState: () => refreshRun.allState(),
|
|
9719
|
+
refreshAll: (wsId) => refreshRun.refreshAll(wsId), refreshAllState: () => refreshRun.allState(), refreshDerived: (wsId) => refreshRun.derived(wsId),
|
|
9720
9720
|
// c3-initiative-boards: the PMOS checkout this server is embedded in, whose default board keeps its derived ladder
|
|
9721
9721
|
selfRoot: EMBEDDED_SELF ? SELF_ROOT : null,
|
|
9722
9722
|
// horizon-scan-portfolio: Scan now, Stop and an approved research proposal start and end runs in the scanner; scanClock fixes its clock in the suites
|