create-pmos 0.365.0 → 0.366.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 +18 -18
- 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-adddoc-test.js +1 -0
- package/workspace/briefing-premium-work-test.js +5 -0
- package/workspace/changelog.json +17 -0
- package/workspace/guide/briefing-premium.md +2 -0
- package/workspace/guide/data-freshness.md +10 -0
- package/workspace/lib/refresh-run.js +58 -1
- package/workspace/lib/routes-sources.js +17 -4
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-briefing-depth-test.js +6 -5
- package/workspace/public/pm/premium-board.js +1 -1
- package/workspace/public/pm/premium-shell.js +46 -9
- package/workspace/public/pm/premium.css +9 -4
- package/workspace/public/pm/premium.js +11 -2
- package/workspace/server.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.366.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,23 @@
|
|
|
32
32
|
"audit"
|
|
33
33
|
],
|
|
34
34
|
"pmosChanges": [
|
|
35
|
+
{
|
|
36
|
+
"v": "0.366.0",
|
|
37
|
+
"at": "2026-10-21T01:38:19.286Z",
|
|
38
|
+
"f": 2,
|
|
39
|
+
"prs": [
|
|
40
|
+
{
|
|
41
|
+
"n": 971,
|
|
42
|
+
"t": "Every premium dialog has the short head on a phone",
|
|
43
|
+
"s": "Every premium dialog has the short head on a phone"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"n": 973,
|
|
47
|
+
"t": "Refresh all reads the sources first, then writes the Briefing (briefing-source-flow, slice 3)",
|
|
48
|
+
"s": "Refresh all is one ordered run on the server, following Wawan's rule (2026-10-21): derived content is rebuilt only after its sources are fresh."
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
35
52
|
{
|
|
36
53
|
"v": "0.365.0",
|
|
37
54
|
"at": "2026-10-21T01:17:24.947Z",
|
|
@@ -299,23 +316,6 @@
|
|
|
299
316
|
"s": "A chat or /goal session that is working counts toward the governor's parallel cap (3 while working, 8 while away), so background runs wait for it."
|
|
300
317
|
}
|
|
301
318
|
]
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"v": "0.346.0",
|
|
305
|
-
"at": "2026-10-20T05:59:24.111Z",
|
|
306
|
-
"f": 2,
|
|
307
|
-
"prs": [
|
|
308
|
-
{
|
|
309
|
-
"n": 942,
|
|
310
|
-
"t": "Artifact, Google Doc and Confluence links in a premium chat panel open beside the conversation",
|
|
311
|
-
"s": "A Google Doc or Confluence link, in Claude's words or in a page the viewer shows, opens as a tab beside the conversation."
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
"n": 943,
|
|
315
|
-
"t": "Text fields no longer zoom the premium pages on a phone",
|
|
316
|
-
"s": "On a touch screen every premium text field (input, textarea, select) uses 16 px type, so focus does not zoom the page."
|
|
317
|
-
}
|
|
318
|
-
]
|
|
319
319
|
}
|
|
320
320
|
]
|
|
321
321
|
}
|
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-21T01:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-21T01:38:16Z"}
|
|
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-21T01:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-21T01:38:16Z"}
|
|
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-21T01:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-21T01:38:16Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -161,6 +161,7 @@ const PAGES = {
|
|
|
161
161
|
if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
|
|
162
162
|
for (const k of Object.keys(a[n])) {
|
|
163
163
|
if (k === 'cw' || k === 'sh' || ((n === 'ttl' || n === 'pane' || n === 'paper') && (k === 'width' || k === 'height'))) continue; // the dialog's columns size to the conversation beside the form, which differs
|
|
164
|
+
if (w < 1000 && n === 'ttl' && (k === 'fontSize' || k === 'letterSpacing' || k === 'lineHeight')) continue; // on a phone every dialog has the compact head's smaller title (Wawan, 2026-10-20), which the mockup predates
|
|
164
165
|
const geom = k === 'width' || k === 'height';
|
|
165
166
|
if (geom ? Math.abs(a[n][k] - c[n][k]) > 14 : a[n][k] !== c[n][k]) diffs.push(`${n}.${k} ${a[n][k]} | ${c[n][k]}`);
|
|
166
167
|
}
|
|
@@ -237,6 +237,11 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
237
237
|
const geo = () => q.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth }; });
|
|
238
238
|
const g1 = await geo();
|
|
239
239
|
ok(`M12 at 390 px (${theme}) the dialog opens on Detail at the full width of the screen`, g1.l === 0 && g1.w === g1.vw, JSON.stringify(g1));
|
|
240
|
+
/* the compact head (Wawan's phone, 2026-10-20): every dialog opens with a short head, so the detail gets most of the screen; a press on the title shows it whole */
|
|
241
|
+
const hd = () => q.evaluate(() => { const t = document.querySelector('#dTitle'), lh = parseFloat(getComputedStyle(t).lineHeight); return { cmp: document.querySelector('#dlg').classList.contains('cmp'), eye: getComputedStyle(document.querySelector('#dEye')).display, lines: Math.round(t.getBoundingClientRect().height / lh), top: Math.round(document.querySelector('#dOut').getBoundingClientRect().top), full: document.querySelector('#dlg').classList.contains('tfull') }; });
|
|
242
|
+
const h1 = await hd(); await q.click('#dTitle'); const h2 = await hd(); await q.click('#dTitle'); const h3 = await hd();
|
|
243
|
+
ok(`M12 at 390 px (${theme}) the item dialog has the compact head: no eyebrow, a title of two lines at most, the detail starting in the top third`, h1.cmp && h1.eye === 'none' && h1.lines <= 2 && h1.top < 844 / 3, JSON.stringify(h1));
|
|
244
|
+
ok(`M12 at 390 px (${theme}) a press on the title shows the whole head, and a second press clamps it again`, h2.full && h2.eye !== 'none' && !h3.full && h3.eye === 'none', JSON.stringify([h2, h3]));
|
|
240
245
|
await q.click('#dTabs [data-t="chat"]'); await sleep(900);
|
|
241
246
|
const g2 = await geo();
|
|
242
247
|
ok(`M12 at 390 px (${theme}) with the conversation brought in it is still full width`, g2.l === 0 && g2.w === g2.vw && await q.evaluate(() => document.querySelector('#dTabs [data-t="chat"]').getAttribute('aria-pressed') === 'true' && getComputedStyle(document.querySelector('#dBody')).display !== 'none' && getComputedStyle(document.querySelector('#dOut')).display === 'none'), JSON.stringify(g2));
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.366.0",
|
|
4
|
+
"at": "2026-10-21T01:38:19.286Z",
|
|
5
|
+
"f": 2,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 971,
|
|
9
|
+
"t": "Every premium dialog has the short head on a phone",
|
|
10
|
+
"s": "Every premium dialog has the short head on a phone"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"n": 973,
|
|
14
|
+
"t": "Refresh all reads the sources first, then writes the Briefing (briefing-source-flow, slice 3)",
|
|
15
|
+
"s": "Refresh all is one ordered run on the server, following Wawan's rule (2026-10-21): derived content is rebuilt only after its sources are fresh."
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
2
19
|
{
|
|
3
20
|
"v": "0.365.0",
|
|
4
21
|
"at": "2026-10-21T01:17:24.947Z",
|
|
@@ -378,6 +378,8 @@ The premium Briefing is the default page: `/` and `/index.html` open it. The con
|
|
|
378
378
|
|
|
379
379
|
## The dialog on a phone and the document sheet's views
|
|
380
380
|
|
|
381
|
+
**The short head.** On a phone or tablet every dialog has a short head: no category line, a title of two lines at most and a sub line of one line. The **Sessions** chip shows only its dot and count. Press the title to see the whole title, the category line and the whole sub line; press it again to make the head short. When you scroll the detail, the head keeps only the title and the tools, so the detail gets most of the screen. Scroll back to the top to see the sub line and the Detail and Conversation switch again.
|
|
382
|
+
|
|
381
383
|
On a phone or tablet (under 1000 px) every dialog opens on **Detail**. On a touch screen every text field, the reply box included, uses 16 px type, so typing in one does not zoom the page. A card's label and value rows (for example **Blocked at** and **Initiative** in "The way through") stay as two columns, one row per label. A **Detail / Conversation** switch sits under the title, and **Open it** at the foot of Detail brings the conversation when an action waits there. The header holds only **Close**. A document sheet picks its view (**Read**, **Edit**, **Proposals**, **Edit log**, **Health**, **Relations**) from one button with a menu.
|
|
382
384
|
|
|
383
385
|
**ⓘ explanations.** The text that says what a page or card reads and records sits behind one ⓘ button, with the same words. Each premium page (Briefing, My work, Board, Initiative, Insights) ends with **ⓘ About this page**. The Board's **Metrics** card and the Insights **Board measures** card show only their need-a-look count, for example "2 of 4 need a look.", with an ⓘ next to the heading. If the measures cannot be read, the reason stays in view. On Insights, the Ask line and the chart count have their own ⓘ. Press ⓘ again to fold the text away.
|
|
@@ -49,6 +49,16 @@ The Briefing uses your tools as sources: Mail, Slack, Wispr Flow, Jira mentions,
|
|
|
49
49
|
|
|
50
50
|
The Sources list shows them as one row, **Your tools**. Its time is the oldest read among the tools that are on, so the row is never fresher than its oldest tool. The row is old after 8 hours. A tool that is on and was never read keeps the row at **not read yet**, and the row names the tools that were not reached and why. **Refresh** on the row starts the skill.
|
|
51
51
|
|
|
52
|
+
## Refresh all: the sources first, then the Briefing
|
|
53
|
+
|
|
54
|
+
**Refresh all** in Sources is one run, in a fixed order:
|
|
55
|
+
|
|
56
|
+
1. It reads every source that is on in Settings › Data refresh: Calendar, Jira, work assigned to you, tracker files and Your tools. It also rebuilds the repository and initiative facts on this machine.
|
|
57
|
+
2. When all of them have ended, it writes the Briefing again from those reads. A source that failed keeps its last read, and the Briefing uses that read. The Briefing waits at most 30 minutes for a source.
|
|
58
|
+
3. When the Briefing is saved, the Briefing page reads it again.
|
|
59
|
+
|
|
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
|
+
|
|
52
62
|
The skill saves its reads with this command:
|
|
53
63
|
|
|
54
64
|
- `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.
|
|
@@ -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.refreshAll(ws) · run.allState() Refresh all (briefing-source-flow, slice 3): read every source that is on, then write the
|
|
12
|
+
* Briefing from those reads. One run at a time: a second press joins the run that is going.
|
|
11
13
|
* run.rows(ws) · run.setSource(id, patch) · run.setRules(patch) · run.ensureOn(id, ws) · run.settings() · run.log()
|
|
12
14
|
*
|
|
13
15
|
* lib/refresh.js decides; this file holds the state between minutes and calls the host. The host is server.js:
|
|
@@ -17,10 +19,14 @@
|
|
|
17
19
|
* setDayCheckEvery(every), setRepoWatch(on), warn(what, e) }
|
|
18
20
|
* Nothing here calls out of this machine: a skill source's run is the PM's own agent session, with the PM's connections.
|
|
19
21
|
*/
|
|
22
|
+
const fs = require('fs');
|
|
23
|
+
const path = require('path');
|
|
20
24
|
const R = require('./refresh.js');
|
|
21
25
|
|
|
22
26
|
const PRUNE_EVERY_MS = 24 * 3600 * 1000;
|
|
23
27
|
const LOST_MS = 6 * 3600 * 1000; // a run with no live session and no end after this long is written as interrupted
|
|
28
|
+
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
|
+
const DERIVED = Object.freeze(['brief']); // what Refresh all writes again after the sources, in this order
|
|
24
30
|
|
|
25
31
|
function create(host) {
|
|
26
32
|
const now = () => (host.now ? host.now() : Date.now());
|
|
@@ -295,6 +301,57 @@ function create(host) {
|
|
|
295
301
|
return !was;
|
|
296
302
|
}
|
|
297
303
|
|
|
304
|
+
/* ── Refresh all (briefing-source-flow, slice 3) ──
|
|
305
|
+
* The PM's rule (2026-10-21): derived content reads only stored source reads, and is rebuilt after they are fresh. So Refresh all
|
|
306
|
+
* starts every source that is on (the step "read"), then marks the Briefing pressed: the tick starts it once none of its inputs runs
|
|
307
|
+
* or waits (decide → gateInputs, at most WAIT_MS). The run is kept in refresh-all.json, so a second press, a second tab and a
|
|
308
|
+
* restarted page see the same run. */
|
|
309
|
+
const allFile = () => path.join(dir, 'refresh-all.json');
|
|
310
|
+
const readAll = () => { try { const x = JSON.parse(fs.readFileSync(allFile(), 'utf8')); return x && typeof x === 'object' && Number.isFinite(x.started_at) ? x : null; } catch { return null; } };
|
|
311
|
+
function writeAll(x) { fs.mkdirSync(dir, { recursive: true }); const tmp = `${allFile()}.${process.pid}.tmp`; fs.writeFileSync(tmp, JSON.stringify(x) + '\n'); fs.renameSync(tmp, allFile()); }
|
|
312
|
+
/** The last Refresh all and where it is: { started_at, reads, derived, steps: [{ id, label, step, state }], phase, done } | null. */
|
|
313
|
+
function allState(t = now()) {
|
|
314
|
+
const a = readAll(); if (!a) return null;
|
|
315
|
+
const set = settings(); const f = log(); const rws = new Map(rowsFor(a.ws, set, t).map((r) => [r.id, r]));
|
|
316
|
+
const since = a.started_at - 1000;
|
|
317
|
+
const stateOf = (id) => {
|
|
318
|
+
const r = rws.get(id); if (r && (r.state === 'running' || r.state === 'waiting')) return r.state;
|
|
319
|
+
const l = f.lastRun(id);
|
|
320
|
+
const at = l ? Date.parse(l.end_at || l.start_at) || 0 : 0;
|
|
321
|
+
if (!l || at < since) return 'not-run';
|
|
322
|
+
if (!l.end_at) return 'running';
|
|
323
|
+
return l.result === 'done' ? 'done' : 'failed';
|
|
324
|
+
};
|
|
325
|
+
const steps = [...a.reads.map((id) => ({ id, step: 'read' })), ...a.derived.map((id) => ({ id, step: 'derived' }))]
|
|
326
|
+
.map((x) => ({ ...x, label: (R.BY_ID.get(x.id) || { label: x.id }).label, state: stateOf(x.id) }));
|
|
327
|
+
const busy = (x) => x.state === 'running' || x.state === 'waiting';
|
|
328
|
+
const over = t - a.started_at > ALL_MS;
|
|
329
|
+
const phase = over ? 'done' : steps.some((x) => x.step === 'read' && busy(x)) ? 'read' : steps.some((x) => x.step === 'derived' && busy(x)) ? 'derived' : 'done';
|
|
330
|
+
return { started_at: new Date(a.started_at).toISOString(), reads: a.reads.slice(), derived: a.derived.slice(), steps, phase, done: phase === 'done', ...(over ? { note: 'stopped waiting after 3 hours' } : {}) };
|
|
331
|
+
}
|
|
332
|
+
function refreshAll(ws) {
|
|
333
|
+
const t = now();
|
|
334
|
+
const cur = allState(t);
|
|
335
|
+
if (cur && !cur.done) return { ok: true, joined: true, all: cur };
|
|
336
|
+
const set = settings();
|
|
337
|
+
const reads = R.SOURCES.filter((x) => x.run === 'skill' && x.group === 'tools' && set.sources[x.id] && set.sources[x.id].on).map((x) => x.id);
|
|
338
|
+
writeAll({ started_at: t, ws: ws || null, reads, derived: DERIVED.slice() });
|
|
339
|
+
const started = []; const already = []; const failed = [];
|
|
340
|
+
for (const id of reads) {
|
|
341
|
+
if (running(R.readState(dir)[id])) { already.push(id); continue; }
|
|
342
|
+
const r = start(R.BY_ID.get(id), (set.sources[id] && set.sources[id].ws) || ws || host.homeWs(), { trigger: 'pressed', note: 'Refresh all' });
|
|
343
|
+
(r.ok ? started : failed).push(id);
|
|
344
|
+
}
|
|
345
|
+
for (const id of DERIVED) {
|
|
346
|
+
const st = R.readState(dir);
|
|
347
|
+
// A Briefing that is being written now read the sources before this press: it is written once more after them.
|
|
348
|
+
if (running(st[id])) { st[id] = { ...st[id], pending: { trigger: 'pressed', at: t, ws: ws || null } }; R.writeState(dir, st); continue; }
|
|
349
|
+
const r = runNow(id, { ws });
|
|
350
|
+
if (!r.ok) failed.push(id);
|
|
351
|
+
}
|
|
352
|
+
return { ok: true, joined: false, started, already, failed, all: allState(now()) };
|
|
353
|
+
}
|
|
354
|
+
|
|
298
355
|
/* ── rows ── */
|
|
299
356
|
const FRESH_OF = { 'my-work': 'my-work', calendar: 'calendar', jira: 'jira', tracker: 'tracker', tools: 'tools', initiatives: 'initiatives' };
|
|
300
357
|
function rowsFor(ws, set, t) {
|
|
@@ -316,7 +373,7 @@ function create(host) {
|
|
|
316
373
|
last_run: l ? l.start_at : null, last_status: l ? (l.result === 'failed' ? 'fail' : l.result === 'done' ? 'ok' : 'started') : st.last_result || null };
|
|
317
374
|
}
|
|
318
375
|
|
|
319
|
-
return { tick, started, ended, briefDone, codeRun, jobGate, runNow, setSource, setRules, ensureOn, rows, settings, log, scheduleOfSkill, managedSkill: (skill) => R.SKILL_OF.get(skill) || null };
|
|
376
|
+
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 };
|
|
320
377
|
}
|
|
321
378
|
|
|
322
379
|
module.exports = { create };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/* routes-sources.js — how old each source of a workspace is, and Refresh now (workspace-data-freshness R6, R7).
|
|
3
3
|
*
|
|
4
|
-
* GET /api/sources?ws=<id> → { ok, ws, version, sources: [row], health } lib/freshness.js sources(); health is
|
|
5
|
-
* lib/harness-health.js of(): { level, line, issues } or null
|
|
4
|
+
* GET /api/sources?ws=<id> → { ok, ws, version, sources: [row], health, all } lib/freshness.js sources(); health is
|
|
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
7
|
* POST /api/sources/refresh { ws, source } → { ok, source, started: 'rebuild'|'session', session? }
|
|
8
|
+
* POST /api/sources/refresh-all { ws } → { ok, joined, started, already, failed, all } every source that is on, then the
|
|
9
|
+
* Briefing from those reads (briefing-source-flow, slice 3); a press while one runs joins it
|
|
7
10
|
* POST /api/sources/watch { ws, on } → { ok, watch } the change detector on or off for this repository
|
|
8
11
|
*
|
|
9
12
|
* Both POSTs pass pm-guard requirePagePress: the PM's press from the page. An agent session cannot start a refresh or
|
|
@@ -30,10 +33,11 @@ async function handle(req, res, url, ctx) {
|
|
|
30
33
|
if (!w) { ctx.json(res, { ok: false, error: 'no such workspace' }, 404); return true; }
|
|
31
34
|
const sources = F.sources({ id: w.id, root: w.root, repoStateDir: repoStateDir(ctx, w) });
|
|
32
35
|
let health = null; try { health = ctx.health ? ctx.health() : null; } catch { health = null; }
|
|
33
|
-
|
|
36
|
+
let all = null; try { all = ctx.refreshAllState ? ctx.refreshAllState() : null; } catch { all = null; }
|
|
37
|
+
ctx.json(res, { ok: true, ws: w.id, version: F.versions()[w.id] || 0, sources, health, all });
|
|
34
38
|
return true;
|
|
35
39
|
}
|
|
36
|
-
if (p !== '/api/sources/refresh' && p !== '/api/sources/watch') return false;
|
|
40
|
+
if (p !== '/api/sources/refresh' && p !== '/api/sources/watch' && p !== '/api/sources/refresh-all') return false;
|
|
37
41
|
if (req.method !== 'POST') { ctx.json(res, { ok: false, error: 'POST only' }, 405); return true; }
|
|
38
42
|
const got = await ctx.readJson(req);
|
|
39
43
|
if (!got.ok) { ctx.json(res, { ok: false, error: 'the body is not JSON' }, 400); return true; }
|
|
@@ -50,6 +54,15 @@ async function handle(req, res, url, ctx) {
|
|
|
50
54
|
return true;
|
|
51
55
|
}
|
|
52
56
|
|
|
57
|
+
if (p === '/api/sources/refresh-all') {
|
|
58
|
+
if (!ctx.refreshAll) { ctx.json(res, { ok: false, error: 'Refresh all is not available on this server' }, 409); return true; }
|
|
59
|
+
let r;
|
|
60
|
+
try { r = ctx.refreshAll(w.id); } catch (e) { r = { ok: false, error: String((e && e.message) || e).slice(0, 200) }; }
|
|
61
|
+
if (r && r.ok && !r.joined) ctx.factsRefresh(w.root); // the repository and initiatives are rebuilt on this machine, as their Refresh does
|
|
62
|
+
ctx.json(res, r && r.ok ? r : { ok: false, error: (r && r.error) || 'Refresh all could not start' }, r && r.ok ? 200 : 500);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
|
|
53
66
|
const src = freshness.SOURCES.find((s) => s.id === body.source);
|
|
54
67
|
if (!src) { ctx.json(res, { ok: false, error: 'source must be one of ' + freshness.SOURCES.map((s) => s.id).join(', ') }, 400); return true; }
|
|
55
68
|
if (!src.skill) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.366.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.366.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -89,6 +89,7 @@ const GANTT = [
|
|
|
89
89
|
});
|
|
90
90
|
await p.route('**/api/scan/now', (r) => json(r, { ok: true, scan: 'scan-00000000ff' }));
|
|
91
91
|
await p.route('**/api/sources/refresh', (r) => json(r, { ok: true, started: 'session' }));
|
|
92
|
+
await p.route('**/api/sources/refresh-all', (r) => json(r, { ok: true, joined: false, started: ['calendar'], already: [], failed: [], all: { started_at: new Date().toISOString(), reads: ['calendar'], derived: ['brief'], phase: 'read', done: false, steps: [{ id: 'calendar', label: 'Calendar', step: 'read', state: 'running' }, { id: 'brief', label: 'Morning briefing', step: 'derived', state: 'waiting' }] } }));
|
|
92
93
|
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
93
94
|
await until(() => p.evaluate(() => !!document.querySelector('#aroundCard')));
|
|
94
95
|
const rows = () => p.evaluate(() => Object.fromEntries([...document.querySelectorAll('#aroundBody [data-bd]')].map((b) => [b.dataset.bd, { t: b.querySelector('.wtit').textContent, s: (b.querySelector('.ws') || {}).textContent || '', m: (b.querySelector('.wm') || {}).textContent || '' }])));
|
|
@@ -251,9 +252,9 @@ const GANTT = [
|
|
|
251
252
|
if (all === false) {
|
|
252
253
|
const n1 = posts.filter((x) => x.path === '/api/sources/refresh').length;
|
|
253
254
|
await click('#oMain [data-bda="sfall"]');
|
|
254
|
-
await until(() => posts.
|
|
255
|
-
const made = posts.filter((x) => x.path === '/api/sources/refresh')
|
|
256
|
-
ok('F4 Refresh all posts one
|
|
255
|
+
await until(() => posts.some((x) => x.path === '/api/sources/refresh-all'));
|
|
256
|
+
const made = posts.filter((x) => x.path === '/api/sources/refresh-all');
|
|
257
|
+
ok('F4 Refresh all posts one ordered run (the sources, then the Briefing), and no refresh of each source', made.length === 1 && made[0].body.ws === ws && posts.filter((x) => x.path === '/api/sources/refresh').length === n1, JSON.stringify(made));
|
|
257
258
|
} else ok('F4 Refresh all is off when there is nothing to read', true);
|
|
258
259
|
await close();
|
|
259
260
|
|
|
@@ -313,10 +314,10 @@ const GANTT = [
|
|
|
313
314
|
repReply = null;
|
|
314
315
|
|
|
315
316
|
/* W: the POST allow-list */
|
|
316
|
-
const allowed = new Set(['/api/mentions/read', '/api/pm-items/add', '/api/driver/keep', '/api/driver/return', '/api/driver/drop', '/api/scan/proposal', '/api/scan/now', '/api/scan/stop', '/api/sources/refresh', '/api/report-setups/setup', '/api/report-setups/dismiss']);
|
|
317
|
+
const allowed = new Set(['/api/mentions/read', '/api/pm-items/add', '/api/driver/keep', '/api/driver/return', '/api/driver/drop', '/api/scan/proposal', '/api/scan/now', '/api/scan/stop', '/api/sources/refresh', '/api/sources/refresh-all', '/api/report-setups/setup', '/api/report-setups/dismiss']);
|
|
317
318
|
const strays = posts.filter((x) => !allowed.has(x.path));
|
|
318
319
|
ok('W1 every POST is one of the existing routes in the PRD', posts.length > 0 && strays.length === 0, JSON.stringify(strays));
|
|
319
|
-
const fields = { '/api/driver/keep': ['ws', 'proposal'], '/api/driver/return': ['ws', 'proposal', 'note'], '/api/driver/drop': ['ws', 'proposal'], '/api/mentions/read': ['id', 'read'], '/api/pm-items/add': ['line'], '/api/scan/proposal': ['ws', 'id', 'action', 'why'], '/api/scan/now': ['ws'], '/api/sources/refresh': ['ws', 'source'], '/api/report-setups/setup': ['ws', 'finding'], '/api/report-setups/dismiss': ['ws', 'finding', 'name'] };
|
|
320
|
+
const fields = { '/api/driver/keep': ['ws', 'proposal'], '/api/driver/return': ['ws', 'proposal', 'note'], '/api/driver/drop': ['ws', 'proposal'], '/api/mentions/read': ['id', 'read'], '/api/pm-items/add': ['line'], '/api/scan/proposal': ['ws', 'id', 'action', 'why'], '/api/scan/now': ['ws'], '/api/sources/refresh': ['ws', 'source'], '/api/sources/refresh-all': ['ws'], '/api/report-setups/setup': ['ws', 'finding'], '/api/report-setups/dismiss': ['ws', 'finding', 'name'] };
|
|
320
321
|
const extra = posts.filter((x) => fields[x.path] && Object.keys(x.body || {}).some((k) => !fields[x.path].includes(k)));
|
|
321
322
|
ok('W2 no POST carries a field the route was not told', extra.length === 0, JSON.stringify(extra));
|
|
322
323
|
ok('W3 every GET the card made is a console route in the PRD', gets.filter((g) => !['/api/briefing-premium', '/api/brief-page', '/api/driver/open', '/api/calendar-views', '/api/scan/portfolio', '/api/report-setups', '/api/sources', '/api/pm-items', '/api/workspaces', '/api/products', '/api/state'].includes(g) && /around|depth|bd-/.test(g)).length === 0);
|
|
@@ -200,7 +200,7 @@ function paneHtml(r) {
|
|
|
200
200
|
function openRow(r) {
|
|
201
201
|
if (!r) return;
|
|
202
202
|
const d = r.dialog;
|
|
203
|
-
openDlg({ eye: d.eye + ' · real data', title: r.title, sub: r.sub + (r.statusLabel ? ' · ' + r.statusLabel : ''), say: d.say, stream: turnA(logHtml(d)) + turnA(ptx(d.say)) + cardHtml(r), noteKey: r.key, pane: paneHtml(r), label: d.pane.label
|
|
203
|
+
openDlg({ eye: d.eye + ' · real data', title: r.title, sub: r.sub + (r.statusLabel ? ' · ' + r.statusLabel : ''), say: d.say, stream: turnA(logHtml(d)) + turnA(ptx(d.say)) + cardHtml(r), noteKey: r.key, pane: paneHtml(r), label: d.pane.label }); // every dialog has the short phone head (premium-shell openDlg), so the sprint board gets the height
|
|
204
204
|
const vb = $('#oMain [data-vwopen]'); if (vb) vb.onclick = () => openWorkItem({ kind: 'initiative', id: r.id, title: r.title, ws: M.board.ws, board: M.board.id }); // its record, checks, tasks and links as a viewer tab (premium-viewer S7)
|
|
205
205
|
loadThread(r.key);
|
|
206
206
|
if (r.key === 'board:sprint') openSprint({ ws: M.board.ws, board: M.board.id, name: r.title }); // the sprint as a board by status, beside its facts (premium-viewer S5)
|
|
@@ -4,7 +4,7 @@ import { recChipView, STOP_LINE } from './premium-meeting.js';
|
|
|
4
4
|
import { vwReset } from './premium-viewer.js';
|
|
5
5
|
import { openChatFile, openWebLink } from './premium-vw-file.js';
|
|
6
6
|
import { chipActs, openLive, openFocus, mountRecord, HL_LINE } from './premium-vw-rec.js';
|
|
7
|
-
import { lineItems, behindOf,
|
|
7
|
+
import { lineItems, behindOf, whenRead } from './freshness-words.js';
|
|
8
8
|
import { splitGoal, shownUser, goalBlockHtml, goalProgressHtml, slashMatches } from './goal-chat.js';
|
|
9
9
|
import { mdHtml, userHtml, toolLine, webKind } from './chat-md.js';
|
|
10
10
|
import { padMarkup, padChipMarkup, mountPad, flushPad } from './premium-pad.js';
|
|
@@ -92,10 +92,33 @@ const SSTATE = { fresh: 'Recent', stale: 'Old', never: 'Never read', building: '
|
|
|
92
92
|
const wsQ = () => { const w = new URLSearchParams(location.search).get('ws'); return w ? '?ws=' + encodeURIComponent(w) : ''; };
|
|
93
93
|
async function tbReadSrc() {
|
|
94
94
|
const r = await pmGet('/api/sources' + wsQ());
|
|
95
|
+
const was = TB.src && TB.src.all;
|
|
95
96
|
TB.src = r && r.ok && Array.isArray(r.sources) ? r : { ok: false, sources: [] };
|
|
96
|
-
tbDot();
|
|
97
|
+
tbDot(); allWatch(was);
|
|
97
98
|
return TB.src;
|
|
98
99
|
}
|
|
100
|
+
/* ── Refresh all (briefing-source-flow, slice 3): one run, in order. The server reads every source that is on, then writes the Briefing
|
|
101
|
+
* 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
|
+
let AWATCH = null;
|
|
103
|
+
const allOn = () => !!(TB.src && TB.src.ok && TB.src.all && !TB.src.all.done);
|
|
104
|
+
export function allText(a) {
|
|
105
|
+
if (!a) return '';
|
|
106
|
+
const S = a.steps || [], reads = S.filter((x) => x.step === 'read'), der = S.filter((x) => x.step === 'derived');
|
|
107
|
+
const left = reads.filter((x) => x.state === 'running' || x.state === 'waiting');
|
|
108
|
+
const bad = S.filter((x) => x.state === 'failed').map((x) => x.label);
|
|
109
|
+
if (a.phase === 'read') return 'Step 1 of 2: reading ' + left.map((x) => x.label).join(', ') + '. The Briefing is written after them.';
|
|
110
|
+
if (a.phase === 'derived') return 'Step 2 of 2: writing the Briefing from the reads' + (bad.length ? ' (' + bad.join(', ') + ' failed, so its last read is used)' : '') + '.';
|
|
111
|
+
const t = new Date(a.started_at);
|
|
112
|
+
const briefOk = der.length && der.every((x) => x.state === 'done');
|
|
113
|
+
return 'Refresh all from ' + String(t.getHours()).padStart(2, '0') + ':' + String(t.getMinutes()).padStart(2, '0') + ' ended: ' + (briefOk ? 'the sources were read and the Briefing was written again' : 'the Briefing was not written again') + '.' + (bad.length ? ' Failed: ' + bad.join(', ') + '.' : '') + (a.note ? ' It ' + a.note + '.' : '');
|
|
114
|
+
}
|
|
115
|
+
function allWatch(was) {
|
|
116
|
+
clearTimeout(AWATCH);
|
|
117
|
+
if (allOn()) { AWATCH = setTimeout(() => { if (!document.hidden) tbReadSrc().then(() => { if ($('#srcRows')) srcDraw(); }); else allWatch(TB.src.all); }, 15000); return; }
|
|
118
|
+
// it ended since the last read: the page reads its own data again
|
|
119
|
+
if (was && !was.done && TB.src && TB.src.all && TB.src.all.done) { TB.msg = allText(TB.src.all); window.dispatchEvent(new CustomEvent('pm:refreshed', { detail: TB.src.all })); }
|
|
120
|
+
}
|
|
121
|
+
let srcDraw = () => {};
|
|
99
122
|
function tbDot() {
|
|
100
123
|
const d = $('#srcDot'), c = $('#srcChip'); if (!d || !c) return;
|
|
101
124
|
const behind = TB.src && TB.src.ok ? behindOf(lineItems(TB.src.sources)) : [];
|
|
@@ -127,31 +150,43 @@ export async function openSources() {
|
|
|
127
150
|
// 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
|
|
128
151
|
const rowsHtml = () => { const s = TB.src; return !s ? '<p class="note">Reading the sources.</p>' : !s.ok ? '<p class="note err" role="alert">The sources could not be read.</p>' : s.sources.map(srcRow).join(''); };
|
|
129
152
|
const draw = () => {
|
|
130
|
-
if (
|
|
153
|
+
if (allOn()) TB.msg = allText(TB.src.all);
|
|
154
|
+
const allLabel = allOn() ? 'Refreshing' : 'Refresh all';
|
|
155
|
+
if ($('#srcRows')) { $('#srcRows').innerHTML = rowsHtml(); $('#srcHealth').innerHTML = healthHtml(); $('#srcAll').disabled = TB.busy || allOn(); $('#srcAll').textContent = allLabel; $('#srcM').textContent = TB.msg; return; }
|
|
131
156
|
park();
|
|
132
157
|
$('#oMain').innerHTML = `<article class="paper doc"><div class="addf">
|
|
133
158
|
<div id="srcHealth">${healthHtml()}</div>
|
|
134
|
-
<div class="srctop"><p class="note" style="margin:0">Each source is read on its own schedule, not live.
|
|
159
|
+
<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>
|
|
135
160
|
<div>${TB.extra ? '<span class="label">Sources</span>' : ''}<div id="srcRows">${rowsHtml()}</div></div>
|
|
136
161
|
${TB.extra ? TB.extra.html() : ''}
|
|
137
162
|
<p class="note" id="srcM" role="status" style="margin:0;min-height:1.2em">${esc(TB.msg)}</p></div></article>`;
|
|
138
163
|
if (TB.extra && TB.extra.mount) TB.extra.mount();
|
|
139
164
|
};
|
|
140
165
|
const say = 'When each source was last read. Each one is read on its own schedule, so the rows say their own times.';
|
|
141
|
-
TB.msg = '';
|
|
166
|
+
TB.msg = ''; srcDraw = draw;
|
|
142
167
|
openDlg({ eye: 'Sources', title: 'Sources', say, stream: turnA(ptx(say)), noteKey: null, pane: '<article class="paper doc"></article>', label: 'Sources' });
|
|
143
168
|
$('#askF').hidden = true; setMode('detail');
|
|
144
169
|
const poll = (n) => { clearTimeout(SPOLL); if (!n || !TB.src || !TB.src.ok || !TB.src.sources.some((x) => x.state === 'building')) return; SPOLL = setTimeout(async () => { if ($('#dTitle').textContent !== 'Sources' || !$('#dlg').classList.contains('on')) return; await tbReadSrc(); draw(); poll(n - 1); }, 3000); };
|
|
145
170
|
$('#oMain').onclick = async (e) => {
|
|
146
171
|
const one = e.target.closest('[data-sref]'), all = e.target.closest('#srcAll');
|
|
147
172
|
if ((!one && !all) || TB.busy || !TB.src || !TB.src.ok) return;
|
|
148
|
-
|
|
173
|
+
if (all) {
|
|
174
|
+
// one ordered run on the server: the sources, then the Briefing from them (a press while it runs joins it)
|
|
175
|
+
TB.busy = true; TB.msg = 'Starting.'; draw();
|
|
176
|
+
const r = await pmPost('/api/sources/refresh-all', { ws: TB.src.ws || '' }).catch(() => null);
|
|
177
|
+
let extra = null; if (r && r.ok && !r.joined && TB.extra && TB.extra.refresh) extra = await TB.extra.refresh();
|
|
178
|
+
TB.busy = false;
|
|
179
|
+
TB.msg = !r || !r.ok ? 'Refresh all did not start: ' + ((r && r.error) || 'the server did not answer') + '.'
|
|
180
|
+
: (r.failed && r.failed.length ? r.failed.length + ' did not start. ' : '') + allText(r.all) + (extra ? ' ' + extra : '');
|
|
181
|
+
await tbReadSrc(); draw(); poll(8);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const ids = [one.dataset.sref];
|
|
149
185
|
TB.busy = true; TB.msg = 'Starting.'; draw();
|
|
150
186
|
const got = await Promise.all(ids.map((id) => pmPost('/api/sources/refresh', { ws: TB.src.ws || '', source: id }).catch(() => null)));
|
|
151
|
-
let extra = null; if (all && TB.extra && TB.extra.refresh) extra = await TB.extra.refresh();
|
|
152
187
|
const bad = got.filter((r) => !r || !r.ok).length;
|
|
153
188
|
TB.busy = false;
|
|
154
|
-
TB.msg =
|
|
189
|
+
TB.msg = bad ? 'It did not start.' : 'Reading it again.';
|
|
155
190
|
await tbReadSrc(); draw(); poll(8);
|
|
156
191
|
};
|
|
157
192
|
draw();
|
|
@@ -210,13 +245,15 @@ export function openDlg(o) {
|
|
|
210
245
|
$('#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
|
|
211
246
|
$('#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>`;
|
|
212
247
|
mountPad({ key: S.key, ws: new URLSearchParams(location.search).get('ws'), input: $('#askIn') });
|
|
213
|
-
$('#dlg').classList.toggle('cmp',
|
|
248
|
+
$('#dlg').classList.toggle('cmp', o.compact !== false); $('#dlg').classList.remove('shrunk', 'tfull'); // compact (every dialog unless it says compact: false): a short head on a phone that shrinks as the detail scrolls
|
|
214
249
|
$('#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
|
|
215
250
|
$('#veil').classList.add('on'); $('#dlg').classList.add('on');
|
|
216
251
|
$$('#dGrid .pane').forEach((p) => { p.scrollTop = 0; });
|
|
217
252
|
railOnOpen(o);
|
|
218
253
|
setTimeout(() => $('#dlg').focus(), 60);
|
|
219
254
|
}
|
|
255
|
+
/* The compact head clamps a long title; a press on it shows the whole title and sub line, a second press clamps them again. */
|
|
256
|
+
$('#dTitle').addEventListener('click', () => { const g = $('#dlg'); if (g.classList.contains('cmp') && innerWidth < 1000) g.classList.toggle('tfull'); });
|
|
220
257
|
/* A compact dialog on a phone: once the detail scrolls, the head keeps only the title and the tools, so the detail gets the screen.
|
|
221
258
|
* It shrinks only when the detail is much taller than its pane, so the smaller head cannot end the scroll and grow back. */
|
|
222
259
|
$('#dOut').addEventListener('scroll', () => {
|
|
@@ -2517,14 +2517,19 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2517
2517
|
.isheet .fbar{padding-top:10px}
|
|
2518
2518
|
.ibar #cardErr{margin:0;text-align:right}
|
|
2519
2519
|
@media (max-width:699px){.ichip .isum{display:none}.ichip{padding:0 12px}.ibar .fdone{padding:0 14px}.dlg.itm #dTabs .seg button{padding:0 11px}.isheet{left:0;width:auto}}
|
|
2520
|
-
/* a compact dialog (
|
|
2520
|
+
/* a compact dialog (every dialog unless it opts out) on a phone: a short head (title up to two lines, sub on one), and once the detail scrolls only the title and the tools stay (PM, 2026-10-20) */
|
|
2521
2521
|
@media (max-width:999px){.dlg.cmp #dEye{display:none}
|
|
2522
2522
|
.dlg.cmp .dhead{align-items:center}
|
|
2523
|
-
.dlg.cmp #dTitle{margin-top:0;font-size:var(--fs-4);
|
|
2524
|
-
.dlg.cmp .dsub{margin-top:2px;font-size:var(--fs-2);line-height:1.35}
|
|
2523
|
+
.dlg.cmp #dTitle{margin-top:0;font-size:var(--fs-4);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;text-wrap:pretty}
|
|
2524
|
+
.dlg.cmp .dsub{margin-top:2px;font-size:var(--fs-2);line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
2525
|
+
.dlg.cmp.tfull #dTitle{-webkit-line-clamp:unset;line-clamp:none}
|
|
2526
|
+
.dlg.cmp.tfull .dsub{white-space:normal}
|
|
2527
|
+
.dlg.cmp.tfull #dEye{display:block}
|
|
2525
2528
|
.dlg.cmp .dtabs{margin-top:10px}
|
|
2526
2529
|
.dlg.cmp .dgrid{margin-top:8px}
|
|
2527
|
-
.dlg.cmp.shrunk
|
|
2530
|
+
.dlg.cmp.shrunk #dTitle{-webkit-line-clamp:1;line-clamp:1}
|
|
2531
|
+
.dlg.cmp.shrunk .dsub,.dlg.cmp.shrunk:not(.itm) .dtabs{display:none}
|
|
2532
|
+
.dlg.cmp .stease>span{display:none}.dlg.cmp .stease{padding:0 12px}
|
|
2528
2533
|
.dlg.cmp.shrunk .dgrid{margin-top:4px}}
|
|
2529
2534
|
|
|
2530
2535
|
/* ── premium-chat-rail: Chat is the rail's middle place, a solid round button bigger than the others. On a phone it rises above the bar. ── */
|
|
@@ -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, 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, 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"/>',
|
|
@@ -913,7 +913,7 @@ function srcHtml() {
|
|
|
913
913
|
const sch = s.schedule ? [s.schedule.cadence, s.schedule.day, s.schedule.time].filter(Boolean).join(' ') : s.skill ? 'no schedule' : 'on every change';
|
|
914
914
|
return `<div class="bd-src"><span><b>${esc(s.label)}</b><small><span class="bd-st ${esc(s.state)}">${esc(SSTATE[s.state] || s.state)}</span> · ${esc(when)} · ${esc(sch)}${s.stale_after_ms ? ' · old after ' + esc(limitWord(s.stale_after_ms)) : ''}</small><small>${s.skill ? 'Refresh starts the ' + esc(s.skill) + ' skill in an agent session, with your own connection.' : 'Refresh rebuilds the facts on this machine.'}</small>${SNOTE[s.id] ? `<small role="status">${esc(SNOTE[s.id])}</small>` : ''}</span>${bdBtn('Refresh', 'sfone', s.id, true, (s.state === 'off' || s.state === 'building' ? ' disabled' : '') + ` aria-label="Refresh ${esc(s.label)}"`)}</div>`;
|
|
915
915
|
};
|
|
916
|
-
return `<div class="bd-top"><p>Sources are read on a schedule, not live. ${b.length ? pl(b.length, 'source needs', 'sources need') + ' a new read.' : 'None is old.'}</p>${bdBtn('Refresh all', 'sfall', '', false, many.length ? '' : ' disabled')}</div>${a.sources.map(row).join('')}<p class="note">Refresh all reads every source
|
|
916
|
+
return `<div class="bd-top"><p>Sources are read on a schedule, not live. ${b.length ? pl(b.length, 'source needs', 'sources need') + ' a new read.' : 'None is old.'}</p>${bdBtn('Refresh all', 'sfall', '', false, many.length ? '' : ' disabled')}</div>${a.sources.map(row).join('')}<p class="note">Refresh all reads every source, then writes the Briefing from those reads. The server calls nothing outside this machine: an outside source is read by a skill, with your own connection.</p>`;
|
|
917
917
|
}
|
|
918
918
|
let FPOLL = null;
|
|
919
919
|
function srcPoll(redraw, n) {
|
|
@@ -925,6 +925,14 @@ async function srcPress(e, redraw) {
|
|
|
925
925
|
const b = e.target.closest('[data-bda]'); if (!b || BUSY) return;
|
|
926
926
|
const act = b.dataset.bda, ids = act === 'sfall' ? refreshTargets(A.src.sources) : [b.dataset.id];
|
|
927
927
|
BUSY = 'src'; b.disabled = true;
|
|
928
|
+
if (act === 'sfall') {
|
|
929
|
+
// briefing-source-flow slice 3: the same ordered run as the Sources popup: every source, then the Briefing from those reads
|
|
930
|
+
const r = await pmPost('/api/sources/refresh-all', { ws: A.src.ws || wsParam() || '' });
|
|
931
|
+
BUSY = '';
|
|
932
|
+
toast(!r || !r.ok ? 'Refresh all did not start: ' + ((r && r.error) || 'the server did not answer') + '.' : r.joined ? 'Refresh all is already running. ' + allText(r.all) : allText(r.all));
|
|
933
|
+
await readAll(['src']); redraw('[data-bda="sfall"]'); srcPoll(redraw, 8);
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
928
936
|
const got = await Promise.all(ids.map(async (id) => [id, await pmPost('/api/sources/refresh', { ws: A.src.ws || wsParam() || '', source: id })]));
|
|
929
937
|
BUSY = '';
|
|
930
938
|
let bad = 0;
|
|
@@ -1091,6 +1099,7 @@ async function refreshRepos() {
|
|
|
1091
1099
|
let RTIMER = null;
|
|
1092
1100
|
$('#pkw').dataset.park = 'pkPark';
|
|
1093
1101
|
sourcesHook({ html: sourcesHtml, mount: () => { const slot = $('#pkSlot'), w = $('#pkw'); if (slot && w) slot.appendChild(w); }, refresh: refreshRepos });
|
|
1102
|
+
window.addEventListener('pm:refreshed', () => load()); // Refresh all ended: the Briefing it wrote is read again (briefing-source-flow, slice 3)
|
|
1094
1103
|
chatAbout('src:this-page', 'the Briefing');
|
|
1095
1104
|
$('#brief').textContent = 'Reading the repository.';
|
|
1096
1105
|
load();
|
package/workspace/server.js
CHANGED
|
@@ -9699,6 +9699,7 @@ async function handleRequest(req, res) {
|
|
|
9699
9699
|
},
|
|
9700
9700
|
// workspace-data-freshness: the source table, the facts rebuild and Refresh now's skill sessions
|
|
9701
9701
|
freshness, factsRefresh: (root) => factsAsync.refresh(root, { force: true }), startSkill: startSkillSession, health: () => harnessHealth(),
|
|
9702
|
+
refreshAll: (wsId) => refreshRun.refreshAll(wsId), refreshAllState: () => refreshRun.allState(),
|
|
9702
9703
|
// c3-initiative-boards: the PMOS checkout this server is embedded in, whose default board keeps its derived ladder
|
|
9703
9704
|
selfRoot: EMBEDDED_SELF ? SELF_ROOT : null,
|
|
9704
9705
|
// 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
|