create-pmos 0.364.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 +35 -30
- 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 +14 -5
- package/workspace/c3-settings-test.js +2 -2
- package/workspace/changelog.json +34 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/data-freshness.md +12 -1
- package/workspace/lib/refresh-run.js +61 -2
- package/workspace/lib/refresh.js +10 -3
- 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/premium-work-depth-test.js +14 -8
- package/workspace/public/pm/premium-board.js +1 -1
- package/workspace/public/pm/premium-shell.js +46 -9
- package/workspace/public/pm/premium-work.js +54 -23
- package/workspace/public/pm/premium.css +27 -4
- package/workspace/public/pm/premium.js +11 -2
- package/workspace/server.js +1 -0
- package/workspace/skills/morning-brief.skill +7 -14
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,40 @@
|
|
|
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
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"v": "0.365.0",
|
|
54
|
+
"at": "2026-10-21T01:17:24.947Z",
|
|
55
|
+
"f": 2,
|
|
56
|
+
"prs": [
|
|
57
|
+
{
|
|
58
|
+
"n": 962,
|
|
59
|
+
"t": "Item fields move out of the chat start into Edit ▾ beside the tabs",
|
|
60
|
+
"s": "Item fields move out of the chat start into Edit ▾ beside the tabs"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"n": 972,
|
|
64
|
+
"t": "The morning brief is built from the saved reads of your tools (briefing-source-flow, slice 2)",
|
|
65
|
+
"s": "The brief is derived content, following the rule Wawan set on 2026-10-21."
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
35
69
|
{
|
|
36
70
|
"v": "0.364.0",
|
|
37
71
|
"at": "2026-10-21T00:58:08.077Z",
|
|
@@ -282,35 +316,6 @@
|
|
|
282
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."
|
|
283
317
|
}
|
|
284
318
|
]
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
"v": "0.346.0",
|
|
288
|
-
"at": "2026-10-20T05:59:24.111Z",
|
|
289
|
-
"f": 2,
|
|
290
|
-
"prs": [
|
|
291
|
-
{
|
|
292
|
-
"n": 942,
|
|
293
|
-
"t": "Artifact, Google Doc and Confluence links in a premium chat panel open beside the conversation",
|
|
294
|
-
"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."
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
"n": 943,
|
|
298
|
-
"t": "Text fields no longer zoom the premium pages on a phone",
|
|
299
|
-
"s": "On a touch screen every premium text field (input, textarea, select) uses 16 px type, so focus does not zoom the page."
|
|
300
|
-
}
|
|
301
|
-
]
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"v": "0.345.0",
|
|
305
|
-
"at": "2026-10-20T05:50:20.786Z",
|
|
306
|
-
"f": 2,
|
|
307
|
-
"prs": [
|
|
308
|
-
{
|
|
309
|
-
"n": 941,
|
|
310
|
-
"t": "Agent results wait in the bell, with deep links to each one",
|
|
311
|
-
"s": "The bell is an inbox of what the agent made that waits on the PM."
|
|
312
|
-
}
|
|
313
|
-
]
|
|
314
319
|
}
|
|
315
320
|
]
|
|
316
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-
|
|
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-
|
|
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-
|
|
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
|
}
|
|
@@ -24,7 +24,9 @@ const showKey = (pg, key) => pg.evaluate((key) => { const has = () => document.q
|
|
|
24
24
|
const results = [];
|
|
25
25
|
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
26
26
|
/* the dialog's fields (premium-simple-ui): a field opens its panel; When holds Today, Not yet, Not before and Someday */
|
|
27
|
-
|
|
27
|
+
/* the fields sit in a sheet behind Edit ▾ in the dialog's switch row, closed by default (PM, 2026-10-20) */
|
|
28
|
+
const sheet = async (pg) => { if (await pg.locator('#iTog[aria-expanded="false"]').count()) await pg.click('#iTog'); };
|
|
29
|
+
const field = async (pg, k) => { await sheet(pg); if (await pg.locator(`#card .ffd[data-k="${k}"][aria-expanded="false"]`).count()) await pg.click(`#card .ffd[data-k="${k}"]`); };
|
|
28
30
|
const more = (pg) => field(pg, 'when');
|
|
29
31
|
let srv = null; let browser = null;
|
|
30
32
|
const finish = async (code) => {
|
|
@@ -155,11 +157,12 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
155
157
|
await openKey('work:item-aaaaaaaaaaa1');
|
|
156
158
|
const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, mod: document.querySelector('#dlg').getAttribute('aria-modal'), ask: !!document.querySelector('#askGo'),
|
|
157
159
|
fields: [...document.querySelectorAll('#card .ffd small')].map((x) => x.textContent).join(), when: document.querySelector('#card .ffd[data-k="when"] b').textContent,
|
|
158
|
-
bar: [...document.querySelectorAll('#card .fbar button')].map((b) => b.textContent.trim()).join(), solid: [...document.querySelectorAll('#card .
|
|
160
|
+
bar: [...document.querySelectorAll('#card .ibrow button, #card .fbar button')].map((b) => b.textContent.trim()).join(), solid: [...document.querySelectorAll('#card .cta')].length,
|
|
161
|
+
shut: document.querySelector('#iSheet').hidden && !document.querySelector('#dBody .ffd'), row: !!document.querySelector('#dTabs #card [data-p="done"]') }));
|
|
159
162
|
await more(p); dlg.opts = await p.evaluate(() => [...document.querySelectorAll('#card .fmenu .fopt > span')].map((x) => x.textContent).join());
|
|
160
163
|
await field(p, 'wait'); dlg.wDis = await p.evaluate(() => document.querySelector('#wBtn').disabled);
|
|
161
|
-
ok('M8 a dialog shows
|
|
162
|
-
&& dlg.fields === 'The agent,When,Waiting on,Who does it,Priority · Due' && /^Inbox/.test(dlg.when) && dlg.bar === 'Drop it
|
|
164
|
+
ok('M8 a dialog shows Edit ▾ and Done in its switch row, the fields closed behind Edit and out of the conversation; the fields are the agent, When, Waiting on, Who does it, Priority · Due; When holds Today, Not yet, Not before and Someday; Waiting needs a name', dlg.title === 'Decide how partial refunds are handled'
|
|
165
|
+
&& dlg.fields === 'The agent,When,Waiting on,Who does it,Priority · Due' && /^Inbox/.test(dlg.when) && dlg.bar === 'EditInbox,Done,Drop it' && dlg.solid === 1 && dlg.shut && dlg.row
|
|
163
166
|
&& dlg.opts === 'Today,Later today,Tomorrow,Next week,Not before a date…,Someday' && dlg.mod === 'true' && dlg.ask && dlg.wDis, JSON.stringify(dlg));
|
|
164
167
|
await more(p);
|
|
165
168
|
await p.locator('#card [data-p="notyet"][data-when="tomorrow"]').click();
|
|
@@ -167,6 +170,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
167
170
|
for (const [sel, route, check] of [['[data-p="flag"]', '/api/pm-items/flag', (b) => b.flagged === true], ['[data-p="xt"][data-k="someday"]', '/api/pm-items/someday', (b) => Object.keys(b).join() === 'id'], ['[data-p="done"]', '/api/pm-items/done', (b) => Object.keys(b).join() === 'id'], ['[data-p="remove"]', '/api/pm-items/remove', (b) => Object.keys(b).join() === 'id']]) {
|
|
168
171
|
await openKey('work:item-aaaaaaaaaaa2'); const n = A.posts.length;
|
|
169
172
|
if (sel.includes('someday') || sel.includes('flag')) await more(p);
|
|
173
|
+
if (sel.includes('remove')) await sheet(p);
|
|
170
174
|
await p.locator('#card ' + sel).click();
|
|
171
175
|
ok(`M8 ${route.split('/').pop()} posts exactly what the Work page's route takes`, await until(() => A.posts.length > n && lastPost().path === route && lastPost().body.id === 'item-aaaaaaaaaaa2' && check(lastPost().body)), JSON.stringify(lastPost()));
|
|
172
176
|
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
@@ -179,7 +183,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
179
183
|
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
180
184
|
await openKey('work:item-ddddddddddd1');
|
|
181
185
|
ok('M7 an item on the review list offers Keep, and Keep posts it', await p.evaluate(() => !!document.querySelector('#card [data-p="keep"]')));
|
|
182
|
-
await p.click('#card [data-p="keep"]');
|
|
186
|
+
await sheet(p); await p.click('#card [data-p="keep"]');
|
|
183
187
|
ok('M7 Keep posts the item id only', await until(() => A.posts.some((x) => x.path === '/api/pm-items/keep' && Object.keys(x.body).join() === 'id' && x.body.id === 'item-ddddddddddd1')));
|
|
184
188
|
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
185
189
|
ok('M8 no press carried a writer field', A.posts.every((x) => !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)));
|
|
@@ -233,6 +237,11 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
233
237
|
const geo = () => q.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth }; });
|
|
234
238
|
const g1 = await geo();
|
|
235
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]));
|
|
236
245
|
await q.click('#dTabs [data-t="chat"]'); await sleep(900);
|
|
237
246
|
const g2 = await geo();
|
|
238
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));
|
|
@@ -119,10 +119,10 @@ async function waitFor(page, fn, arg, ms = 8000) {
|
|
|
119
119
|
ok('R1 Connectors links to Data refresh instead of holding its schedule', await waitFor(page, () => { const a = document.querySelector('[data-c3set-row="conn.cal.refresh"]'); const b = document.querySelector('[data-c3set-row="conn.jira.refresh"]'); return !!a && !!b && !!a.querySelector('button.lk') && /Data refresh/.test(a.textContent) && !a.querySelector('select') && !b.querySelector('select'); }));
|
|
120
120
|
await page.click('[data-c3set-row="conn.cal.refresh"] button.lk');
|
|
121
121
|
ok('R2 the link opens the Data refresh section', await waitFor(page, () => !!document.querySelector('[data-c3set-section="refresh"] [data-c3set-rf-card]')));
|
|
122
|
-
ok('R3 the section draws
|
|
122
|
+
ok('R3 the section draws 14 source rows in three cards', await waitFor(page, () => document.querySelectorAll('[data-c3set-section="refresh"] [data-c3set-rf]').length === 14 && document.querySelectorAll('[data-c3set-rf-card]').length === 3));
|
|
123
123
|
ok('R3b the overview, the rules and the log are there', await page.evaluate(() => !!document.querySelector('[data-c3set-rf-sum]') && !!document.querySelector('[data-c3set-rf-all]') && !!document.querySelector('[data-c3set-rf-rules]') && !!document.querySelector('[data-c3set-rf-log]')));
|
|
124
124
|
ok('R3c a source with its own home says where, and has no editor button', await page.evaluate(() => { const r = document.querySelector('[data-c3set-rf="scan"]'); return !!r && /Set in Initiatives/.test(r.textContent) && !r.querySelector('[data-c3set-rf-open]'); }));
|
|
125
|
-
ok('R3d the filter Off lists the sources that are off', await (async () => { await page.click('[data-c3set-section="refresh"] .seg [data-v="off"]'); const n = await page.evaluate(() => document.querySelectorAll('[data-c3set-rf]').length); await page.click('[data-c3set-section="refresh"] .seg [data-v="all"]'); return n > 0 && n <
|
|
125
|
+
ok('R3d the filter Off lists the sources that are off', await (async () => { await page.click('[data-c3set-section="refresh"] .seg [data-v="off"]'); const n = await page.evaluate(() => document.querySelectorAll('[data-c3set-rf]').length); await page.click('[data-c3set-section="refresh"] .seg [data-v="all"]'); return n > 0 && n < 14; })());
|
|
126
126
|
|
|
127
127
|
// turning on needs no question
|
|
128
128
|
await page.click('[data-c3set-rf-on="calendar"]');
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,38 @@
|
|
|
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
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"v": "0.365.0",
|
|
21
|
+
"at": "2026-10-21T01:17:24.947Z",
|
|
22
|
+
"f": 2,
|
|
23
|
+
"prs": [
|
|
24
|
+
{
|
|
25
|
+
"n": 962,
|
|
26
|
+
"t": "Item fields move out of the chat start into Edit ▾ beside the tabs",
|
|
27
|
+
"s": "Item fields move out of the chat start into Edit ▾ beside the tabs"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"n": 972,
|
|
31
|
+
"t": "The morning brief is built from the saved reads of your tools (briefing-source-flow, slice 2)",
|
|
32
|
+
"s": "The brief is derived content, following the rule Wawan set on 2026-10-21."
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
2
36
|
{
|
|
3
37
|
"v": "0.364.0",
|
|
4
38
|
"at": "2026-10-21T00:58:08.077Z",
|
|
@@ -271,7 +271,7 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
|
|
|
271
271
|
|
|
272
272
|
**Work queue.** One full-width card holds everything you sort, as tabs in one row: **Today**, **Inbox**, **Upcoming**, **Someday**, **Kept** and **Done**. Each tab shows its count, and the card opens on Today (or on the first tab that has something). On a phone the tabs stay in one row: swipe the row sideways to see the rest. Rows sit in two columns, one column on a narrow screen. The left and right arrow keys move between tabs. **Inbox** shows what is new from Jira and Slack first, then what you added. **Kept** gathers items you pressed Keep on, and **Done** shows what you added and marked done in the last 7 days. An item shows in one place tab only. Kept is a mark on an item, not a place, so a kept item also shows where it was placed. The card replaces the earlier On your plate, With agents and tray cards.
|
|
273
273
|
|
|
274
|
-
**The item dialog.** The
|
|
274
|
+
**The item dialog.** The conversation gets the whole body. Two controls sit beside the Detail / Conversation switch, on both tabs: **Edit ▾** and **Done**. On a wide screen the row also shows where the item is. **Edit ▾** opens a sheet with one labelled field for each choice. Each field shows its value from the record and opens when you press it: **When** (Today, Later today, Tomorrow, Next week, Not before a date, Someday), **Waiting on**, **Who does it** (the steps) and **Priority · Due** (the edit panel). **Keep it** and **Drop it** are at the bottom of the sheet. The sheet closes when you press Edit again, press outside it, or press Escape. **Waiting on** is not shown when the item cannot wait and waits on nobody. An agent that only can draft is a field in the sheet. An agent that is working, has a draft, or stopped stays in the conversation, because it needs you. Every action stays reachable.
|
|
275
275
|
|
|
276
276
|
**The agent's draft.** The draft shows as formatted text in the detail panel on the right, labelled as the agent's and not checked, with **Open** and **Copy**. Its heading names the item ("Draft for IDPF-2989", or "Draft for you"), the round and the time of the latest round, and an approved step shows as "Step when you approve". A long draft is cut short, with **Show all**. It appears there as soon as the agent finishes, even while the dialog is open. The left column keeps the conversation (with **View round**) and the decision cards, in the console's words: **Post it to Jira** (marked outward, with exactly the text that goes), **Edit the draft**, **Keep it as a draft** and **Mark it done**. Post asks you to confirm the exact text first, and nothing is posted before that.
|
|
277
277
|
|
|
@@ -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.
|
|
@@ -27,6 +27,7 @@ The workspace holds no password or token, and it never calls these services. An
|
|
|
27
27
|
| Jira status | jira-sync | 06:30 every day | 26 hours |
|
|
28
28
|
| My work | my-work-read | when you press Refresh | 26 hours |
|
|
29
29
|
| Tracker items | tracker-refresh | Friday 15:30 | 8 days |
|
|
30
|
+
| Your tools | sources-read | before the morning briefing, and when you press Refresh | 8 hours |
|
|
30
31
|
|
|
31
32
|
The calendar-sync skill reads today and the next 14 days, read-only, and saves the events with this command:
|
|
32
33
|
|
|
@@ -44,10 +45,20 @@ The record is kept in your own runtime folder on this machine, never in a reposi
|
|
|
44
45
|
|
|
45
46
|
## Your tools: mail, Slack, Wispr Flow, Confluence and the rest
|
|
46
47
|
|
|
47
|
-
The Briefing uses your tools as sources: Mail, Slack, Wispr Flow, Jira mentions, Confluence, GitHub, Drive, Figma and your websites. The **sources-read** skill reads each tool that is on in Settings › Connectors, with your own connections, and saves what each one says. It saves the raw facts only: who, where, what is asked and the link. It does not rank or plan anything. The brief
|
|
48
|
+
The Briefing uses your tools as sources: Mail, Slack, Wispr Flow, Jira mentions, Confluence, GitHub, Drive, Figma and your websites. The **sources-read** skill reads each tool that is on in Settings › Connectors, with your own connections, and saves what each one says. It saves the raw facts only: who, where, what is asked and the link. It does not rank or plan anything. The morning brief is built from these saved reads and never opens those tools itself, so every part of the Briefing uses the same read. Only the calendar is still read by the brief. When the morning briefing is due, **Your tools** is read first if its last read is older than 2 hours, and the brief waits for it. **Your tools** is on whenever the morning briefing is on, until you set it yourself in Settings › Data refresh.
|
|
48
49
|
|
|
49
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.
|
|
50
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
|
+
|
|
51
62
|
The skill saves its reads with this command:
|
|
52
63
|
|
|
53
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());
|
|
@@ -287,14 +293,67 @@ function create(host) {
|
|
|
287
293
|
function ensureOn(id, ws) {
|
|
288
294
|
const set = R.readSettings(dir); const cur = set.sources[id]; if (!cur) return false;
|
|
289
295
|
const was = cur.on; cur.on = true; if (ws && !cur.ws) cur.ws = ws;
|
|
296
|
+
// briefing-source-flow: the brief is built from Your tools, so turning the brief on turns its reader on too
|
|
297
|
+
if (id === 'brief' && set.sources.tools && !set.sources.tools.on) { set.sources.tools.on = true; if (ws && !set.sources.tools.ws) set.sources.tools.ws = ws; }
|
|
290
298
|
set.migrated = true;
|
|
291
299
|
R.writeSettings(dir, set);
|
|
292
300
|
if (!was) { const st = R.readState(dir); st[id] = { ...(st[id] || {}), last_slot: R.lastSlot(cur.s, now(), win()) }; R.writeState(dir, st); }
|
|
293
301
|
return !was;
|
|
294
302
|
}
|
|
295
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
|
+
|
|
296
355
|
/* ── rows ── */
|
|
297
|
-
const FRESH_OF = { 'my-work': 'my-work', calendar: 'calendar', jira: 'jira', tracker: 'tracker', initiatives: 'initiatives' };
|
|
356
|
+
const FRESH_OF = { 'my-work': 'my-work', calendar: 'calendar', jira: 'jira', tracker: 'tracker', tools: 'tools', initiatives: 'initiatives' };
|
|
298
357
|
function rowsFor(ws, set, t) {
|
|
299
358
|
const state = R.readState(dir);
|
|
300
359
|
const view = {};
|
|
@@ -314,7 +373,7 @@ function create(host) {
|
|
|
314
373
|
last_run: l ? l.start_at : null, last_status: l ? (l.result === 'failed' ? 'fail' : l.result === 'done' ? 'ok' : 'started') : st.last_result || null };
|
|
315
374
|
}
|
|
316
375
|
|
|
317
|
-
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 };
|
|
318
377
|
}
|
|
319
378
|
|
|
320
379
|
module.exports = { create };
|
package/workspace/lib/refresh.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/* refresh.js — what PMOS refreshes, when, and what each refresh did (initiative data-refresh-settings).
|
|
3
3
|
*
|
|
4
|
-
* THE SOURCES. One registry of the
|
|
4
|
+
* THE SOURCES. One registry of the 14 places PMOS refreshes data (SOURCES). Each says how it runs (`skill`: a Claude skill this module
|
|
5
5
|
* schedules; `job`: a PMOS job with its own tick, which this module only gates; `change`: a watcher with no schedule), what it USES (its
|
|
6
6
|
* inputs, as read in the code: dependencies.md section 3) and the IMPACT line shown when it fails or is off.
|
|
7
7
|
*
|
|
@@ -52,8 +52,13 @@ const SOURCES = Object.freeze([
|
|
|
52
52
|
what: 'Plan items brought up to date from the tracker files in the workspace.', uses: [],
|
|
53
53
|
impact: 'The bi-weekly report says the tracker was not refreshed.',
|
|
54
54
|
def: { kind: 'weekly', day: 'Fri', times: ['15:30'] } },
|
|
55
|
+
// briefing-source-flow: the brief is derived content, so it reads these saved reads instead of the tools (lib/source-reads.js)
|
|
56
|
+
{ id: 'tools', label: 'Your tools', group: 'tools', ic: 'inbox', run: 'skill', skill: 'sources-read', how: 'tool', fresh: 'tools',
|
|
57
|
+
what: 'Mail, Slack, Wispr Flow, Confluence, GitHub, Drive, Figma and your websites, saved as they are for the Briefing. It runs before the morning briefing.', uses: [],
|
|
58
|
+
impact: 'The Briefing is built from the last saved read of your tools.',
|
|
59
|
+
def: { kind: 'manual' } },
|
|
55
60
|
{ id: 'brief', label: 'Morning briefing', group: 'pmos', ic: 'sun', run: 'skill', skill: 'morning-brief', how: 'bg',
|
|
56
|
-
what: 'Your Briefing for the day, ranked by what needs you first. When it is due, the sources it is built on that are older than 2 hours are refreshed first.', uses: ['calendar', 'jira', 'mywork'],
|
|
61
|
+
what: 'Your Briefing for the day, ranked by what needs you first. When it is due, the sources it is built on that are older than 2 hours are refreshed first.', uses: ['calendar', 'jira', 'mywork', 'tools'],
|
|
57
62
|
impact: 'No new Briefing for the day, and the day check has nothing to update.',
|
|
58
63
|
def: { kind: 'daily', times: ['06:45'] } },
|
|
59
64
|
{ id: 'daycheck', label: 'Day check', group: 'pmos', ic: 'clock', run: 'job', how: 'bg',
|
|
@@ -166,7 +171,9 @@ function withDefaults(raw) {
|
|
|
166
171
|
const sources = {};
|
|
167
172
|
for (const src of SOURCES) {
|
|
168
173
|
const x = (r.sources && r.sources[src.id]) || {};
|
|
169
|
-
|
|
174
|
+
let on = typeof x.on === 'boolean' ? x.on : src.run !== 'skill'; // a job or watcher is on unless the PM turned it off; a skill source starts off
|
|
175
|
+
// briefing-source-flow: Your tools feeds the brief, so until the PM sets it, it is on whenever the brief is
|
|
176
|
+
if (src.id === 'tools' && typeof x.on !== 'boolean') on = !!(r.sources && r.sources.brief && r.sources.brief.on === true);
|
|
170
177
|
const n = src.run === 'skill' && x.s ? normalize(src, x.s) : null;
|
|
171
178
|
sources[src.id] = { on, s: n && n.ok ? n.s : (src.def ? { ...src.def, ...(src.def.times ? { times: src.def.times.slice() } : {}) } : null), ws: typeof x.ws === 'string' ? x.ws : null };
|
|
172
179
|
}
|
|
@@ -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);
|
|
@@ -18,7 +18,9 @@ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for
|
|
|
18
18
|
const results = [];
|
|
19
19
|
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
20
20
|
/* the dialog's fields (premium-simple-ui): a field opens its panel; When holds Today, Not yet, Not before and Someday */
|
|
21
|
-
|
|
21
|
+
/* the fields sit in a sheet behind Edit ▾ in the dialog's switch row, closed by default (PM, 2026-10-20) */
|
|
22
|
+
const sheet = async (pg) => { if (await pg.locator('#iTog[aria-expanded="false"]').count()) await pg.click('#iTog'); };
|
|
23
|
+
const field = async (pg, k) => { await sheet(pg); if (await pg.locator(`#card .ffd[data-k="${k}"][aria-expanded="false"]`).count()) await pg.click(`#card .ffd[data-k="${k}"]`); };
|
|
22
24
|
const more = (pg) => field(pg, 'when');
|
|
23
25
|
let srv = null; let browser = null;
|
|
24
26
|
const finish = async (code) => {
|
|
@@ -69,6 +71,8 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
69
71
|
const dlgOff = (p) => until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
70
72
|
/* the Work queue shows one tab at a time: bring up the tab that holds a row before pressing it (each press redraws the tab row, so the button is found again) */
|
|
71
73
|
const showKey = (p, key) => p.evaluate((key) => { const has = () => document.querySelector(`#qBody .wrow[data-key="${key}"], #waitBody .wrow[data-key="${key}"]`); if (has()) return true; for (const k of [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.dataset.tab)) { document.querySelector(`#qTabs [data-tab="${k}"]`).click(); if (has()) return true; } return false; }, key);
|
|
74
|
+
/* Escape closes the fields sheet first, then the dialog */
|
|
75
|
+
const escAll = async (p) => { await p.keyboard.press('Escape'); if (await p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))) { await sleep(100); await p.keyboard.press('Escape'); } await dlgOff(p); };
|
|
72
76
|
const qTab = (p, k) => p.click(`#qTabs [data-tab="${k}"]`);
|
|
73
77
|
const openKey = async (p, key) => { await showKey(p, key); await p.locator(`.wrow[data-key="${key}"] .wrh`).first().click(); await dlgOn(p); await sleep(700); };
|
|
74
78
|
const undoOf = async (p, direct) => { await until(() => p.evaluate(() => /Undo/.test(document.querySelector('#toast').textContent))); if (direct) { /* the Undo window is 8 s; on a loaded runner the real-server steps before this can outlast it, so press the button itself rather than race the toast's fade */ await p.evaluate(() => document.querySelector('#toast .undo').click()); } else await p.locator('#toast .undo').click(); await sleep(250); };
|
|
@@ -100,7 +104,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
100
104
|
ok('W9 Undo of Add the job posts pm-jobs/delete for that job', A.last().path === '/api/pm-jobs/delete' && A.last().body.id === 'job-new', JSON.stringify(A.last()));
|
|
101
105
|
await p.click('[data-fx="no"]');
|
|
102
106
|
ok('W6 Not today posts focus/dismiss with the key', await wait(() => A.last().path === '/api/pm-items/focus/dismiss' && A.last().body.key === 'job:job-1' && Object.keys(A.last().body).join() === 'key'), JSON.stringify(A.last()));
|
|
103
|
-
await
|
|
107
|
+
await escAll(p);
|
|
104
108
|
{ const m = mk((v) => { v.focus = { suggestions: [], accepted: [{ key: 'job:job-1', title: 'to walk in with a decision ready', why: '1 due today', item_ids: ['item-bbbbbbbbbbb2'], job: 'job-1' }], dismissed: [] }; });
|
|
105
109
|
const R = await open({ model: m }); const t = await R.page.evaluate(() => ({ bar: document.querySelector('#xFocus').textContent, tag: [...document.querySelectorAll('.xfc')].map((x) => x.closest('.wrow').dataset.key) }));
|
|
106
110
|
ok('W6 an accepted group is named on the bar and tags its Today row with Focus', /Your focus today/.test(t.bar) && t.tag.join() === 'work:item-bbbbbbbbbbb2', JSON.stringify(t));
|
|
@@ -144,7 +148,9 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
144
148
|
ok('W3 the dialog stays open and the typed step is cleared', await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#xsIn') && document.querySelector('#xsIn').value === '')));
|
|
145
149
|
const n1 = pc(); await p.click('[data-p="xsadd"]'); await sleep(250);
|
|
146
150
|
ok('W3 Add with no text posts nothing', pc() === n1);
|
|
147
|
-
await p.keyboard.press('Escape');
|
|
151
|
+
await p.keyboard.press('Escape');
|
|
152
|
+
ok('W3 Escape closes the fields sheet first and leaves the dialog open', await until(() => p.evaluate(() => document.querySelector('#iSheet').hidden && document.querySelector('#iTog').getAttribute('aria-expanded') === 'false' && document.querySelector('#dlg').classList.contains('on'))));
|
|
153
|
+
await escAll(p);
|
|
148
154
|
|
|
149
155
|
/* W4 Not before */
|
|
150
156
|
await openKey(p, 'work:item-ccccccccccc1');
|
|
@@ -184,17 +190,17 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
184
190
|
await p.click('[data-p="ag-brief"]');
|
|
185
191
|
ok('W7 Let the agent draft this posts act brief with the item, the PM\'s words and the workspace', await wait(() => A.last().path === '/api/my-work/act' && A.last().body.action === 'brief' && A.last().body.item === 'item-aaaaaaaaaaa1' && A.last().body.instruction === 'Draft your reply: partial refunds, short' && 'ws' in A.last().body && Object.keys(A.last().body).sort().join() === 'action,instruction,item,ws'), JSON.stringify(A.last()));
|
|
186
192
|
ok('W7 the dialog stays open', await p.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
187
|
-
await
|
|
193
|
+
await escAll(p);
|
|
188
194
|
await openKey(p, 'work:item-bbbbbbbbbbb3');
|
|
189
195
|
ok('W7 a working agent shows its state and only Stop', await p.evaluate(() => document.querySelector('.agblk').dataset.state === 'working' && [...document.querySelectorAll('.agblk button')].map((b) => b.textContent.trim()).join() === 'Stop'));
|
|
190
196
|
await p.click('[data-p="ag-stop"]');
|
|
191
197
|
ok('W7 Stop posts the item to stop', await wait(() => A.last().path === '/api/my-work/stop' && A.last().body.item === 'item-bbbbbbbbbbb3' && Object.keys(A.last().body).join() === 'item'), JSON.stringify(A.last()));
|
|
192
|
-
await
|
|
198
|
+
await escAll(p);
|
|
193
199
|
await openKey(p, 'work:item-ccccccccccc2');
|
|
194
200
|
ok('W7 a failed run says why, that nothing was sent, and offers Try again and Stop', await p.evaluate(() => { const b = document.querySelector('.agblk'); return b.dataset.state === 'failed' && /the run ended/.test(b.textContent) && /Nothing was sent/.test(b.textContent) && [...b.querySelectorAll('button')].map((x) => x.textContent.trim()).join() === 'Try again,Stop'; }));
|
|
195
201
|
await p.click('[data-p="ag-retry"]');
|
|
196
202
|
ok('W7 Try again posts decide retry', await wait(() => A.last().path === '/api/my-work/decide' && A.last().body.action === 'retry' && A.last().body.item === 'item-ccccccccccc2' && Object.keys(A.last().body).sort().join() === 'action,item'), JSON.stringify(A.last()));
|
|
197
|
-
await
|
|
203
|
+
await escAll(p);
|
|
198
204
|
|
|
199
205
|
/* W7 a ready draft: nothing is posted before the confirm */
|
|
200
206
|
const RD = await open({ model: mk((v) => { v.work.today[0].origin = 'jira'; v.work.today[0].place = null; }) }), q = RD.page;
|
|
@@ -262,7 +268,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
262
268
|
ok('W8 a Today row whose draft is ready offers Review on the right, not Done', /Right arrow: Review/.test(await p.evaluate(() => document.activeElement.getAttribute('aria-description'))));
|
|
263
269
|
await p.keyboard.press('ArrowRight'); await dlgOn(p);
|
|
264
270
|
ok('W8 …and Review opens the dialog without posting', pc() === n2 + 0 || A.last().path !== '/api/pm-items/done');
|
|
265
|
-
await
|
|
271
|
+
await escAll(p);
|
|
266
272
|
{ const r = await open(); const t = r.page;
|
|
267
273
|
await showKey(t, 'work:item-aaaaaaaaaaa4'); await t.locator('#qBody .wrow[data-key="work:item-aaaaaaaaaaa4"] .wrh').focus(); await t.keyboard.press('ArrowRight');
|
|
268
274
|
ok('W8 the keys work on a row you added too (flag)', await until(() => r.last() && r.last().path === '/api/pm-items/flag' && r.last().body.id === 'item-aaaaaaaaaaa4'), JSON.stringify(r.last()));
|
|
@@ -314,7 +320,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
314
320
|
g[k] = await q2.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1 || document.querySelector('#dlg').scrollWidth > document.querySelector('#dlg').clientWidth + 1, small: [...document.querySelectorAll('#card button, #card input, #card select')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height > 0 && b.getBoundingClientRect().height < 43.5).map((b) => (b.dataset.p || b.id) + ':' + Math.round(b.getBoundingClientRect().height)) }));
|
|
315
321
|
}
|
|
316
322
|
ok(`W12 at 390 px (${theme}) the edit, steps and Not before panels have no sideways scroll and every control is 44 px`, ['edit', 'steps', 'defer'].every((k) => !g[k].over && g[k].small.length === 0), JSON.stringify(g));
|
|
317
|
-
await
|
|
323
|
+
await escAll(q2);
|
|
318
324
|
await showKey(R.page, 'work:wbs:alpha:4.2'); await R.page.locator('#qBody .wrow[data-key="work:wbs:alpha:4.2"] .wrh').click(); await dlgOn(q2); await sleep(500); await q2.click('#dTabs [data-t="chat"]'); await sleep(900);
|
|
319
325
|
const ag = await q2.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1 || document.querySelector('#dlg').scrollWidth > document.querySelector('#dlg').clientWidth + 1, small: [...document.querySelectorAll('.agblk button')].filter((b) => b.getBoundingClientRect().height < 43.5).map((b) => b.textContent.trim()) }));
|
|
320
326
|
ok(`W12 at 390 px (${theme}) the agent block has no sideways scroll and its buttons are 44 px`, !ag.over && ag.small.length === 0, JSON.stringify(ag));
|
|
@@ -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', () => {
|
|
@@ -119,7 +119,7 @@ const WHO = [['you', 'You'], ['agent-drafts', 'Agent drafts'], ['agent-does', 'A
|
|
|
119
119
|
const PRIS = ['P1', 'P2', 'P3', ''];
|
|
120
120
|
let dlgKind = null; // 'item' | 'fjobs': what the open dialog shows
|
|
121
121
|
let ui = {}; // what is typed or opened in the item dialog; kept across a redraw
|
|
122
|
-
const freshUi = () => ({ xp: null, ed: null, dd: '', sn: '', ask: null, body: null, editing: false, confirm: false, back: false, note: '', wo: '', pick: null, round: null, more: false, dpick: null, pane: '' });
|
|
122
|
+
const freshUi = () => ({ xp: null, ed: null, dd: '', sn: '', ask: null, body: null, editing: false, confirm: false, back: false, note: '', wo: '', pick: null, round: null, more: false, dpick: null, pane: '', sheet: false });
|
|
123
123
|
const dlgOpen = () => $('#dlg').classList.contains('on');
|
|
124
124
|
const paras = (t) => String(t || '').split(/\n{2,}/).filter((x) => x.trim()).map((x) => `<p>${esc(x.trim()).replace(/\n/g, '<br>')}</p>`).join('');
|
|
125
125
|
|
|
@@ -193,7 +193,7 @@ function agentInner(r) {
|
|
|
193
193
|
|
|
194
194
|
/* the dialog's fields (initiative premium-simple-ui): one labelled field for each choice, showing its value from the record, with a chevron.
|
|
195
195
|
* A field opens its panel under it, one at a time. When holds Today, Not yet, Not before and Someday; Waiting on, Who does it and Priority · Due
|
|
196
|
-
* hold the Waiting, Steps and Edit panels.
|
|
196
|
+
* hold the Waiting, Steps and Edit panels. Since 2026-10-20 they sit in a sheet behind Edit ▾ (see cardInner). Every press is the same route as before. */
|
|
197
197
|
const CHEV = '<svg class="i chev" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>';
|
|
198
198
|
const PLACE = { today: ['Today', ''], inbox: ['Inbox', 'not placed yet'], tray: ['Not placed yet', 'you added it'], upcoming: ['Upcoming', ''], waiting: ['Waiting', ''], someday: ['Someday', ''] };
|
|
199
199
|
function whenOf(r) {
|
|
@@ -236,27 +236,45 @@ function panelHtml(r, x) {
|
|
|
236
236
|
}
|
|
237
237
|
return '';
|
|
238
238
|
}
|
|
239
|
+
/* the fields live at dialog level (PM, 2026-10-20: "accessible on popup level instead of on the beginning of the chat, and hidden when not needed"):
|
|
240
|
+
* one row beside the Detail / Conversation switch holds Edit ▾ and Done; Edit opens a sheet with the fields and Keep it / Drop it, closed by default,
|
|
241
|
+
* so the conversation gets the whole body. A field with nothing to set for this item (Waiting on when the item cannot wait and waits on nobody) is left out. */
|
|
242
|
+
const SLIDERS = '<svg class="i" viewBox="0 0 24 24"><path d="M4 7h10M18 7h2M4 17h4M12 17h8"/><circle cx="16" cy="7" r="2"/><circle cx="10" cy="17" r="2"/></svg>';
|
|
239
243
|
function cardInner(r) {
|
|
240
244
|
const d = r.dialog, a = d.write.actions, x = ui.xp || '', S = d.steps || [], e = d.edit, ag = d.agent;
|
|
241
245
|
const steps = S.length ? S.length + (S.length === 1 ? ' step' : ' steps') : 'no steps yet';
|
|
242
246
|
const whos = [...new Set(S.map((s) => (WHO.find((w) => w[0] === s.who) || [0, 'You'])[1]))];
|
|
243
247
|
const fld = (k, label, val, sub, open = x === k) => fieldHtml(k, label, val, sub, open) + (open ? panelHtml(r, k) : '');
|
|
244
|
-
const when = whenOf(r);
|
|
245
|
-
let
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
else h += agentHtml(r);
|
|
249
|
-
h += `<div class="ffds">`
|
|
248
|
+
const when = whenOf(r), sum = [when[0], e.waiting_on ? 'waiting on ' + e.waiting_on : '', e.priority || '', e.due ? 'due ' + dayLabel(e.due) : ''].filter(Boolean).join(' · ');
|
|
249
|
+
let f = '';
|
|
250
|
+
if (ag && ag.state === 'suggest') f += fld('agent', 'The agent', 'Can draft this for you', ag.mine ? 'nothing leaves PMOS' : 'you read it first');
|
|
251
|
+
f += `<div class="ffds">`
|
|
250
252
|
+ fieldHtml('when', 'When', when[0], when[1], x === 'when' || x === 'defer') + (x === 'when' || x === 'defer' ? panelHtml(r, x) : '')
|
|
251
|
-
+ fld('wait', 'Waiting on', e.waiting_on || 'Nobody', '')
|
|
253
|
+
+ (a.includes('waiting') || e.waiting_on ? fld('wait', 'Waiting on', e.waiting_on || 'Nobody', '') : '')
|
|
252
254
|
+ fld('steps', 'Who does it', whos.length ? whos.join(', ') : 'You', steps)
|
|
253
255
|
+ fld('edit', 'Priority · Due', e.priority || 'None', e.due ? 'due ' + dayLabel(e.due) : 'no date')
|
|
254
256
|
+ `</div>`;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
f += `<div class="fbar"><div class="fmeta">${a.includes('keep') ? '<button class="flink" data-p="keep">Keep it</button>' : ''}<button class="flink" data-p="remove">Drop it</button></div></div>`;
|
|
258
|
+
return `<div class="ibrow"><button class="ichip" id="iTog" data-p="sheet" aria-expanded="${!!ui.sheet}" aria-controls="iSheet" title="Edit when, who and priority">${SLIDERS}<span>Edit</span><em class="isum">${esc(sum)}</em>${CHEV}</button>`
|
|
259
|
+
+ `<button class="cta fdone" data-p="done">${CHECK}<span>Done</span></button></div>`
|
|
260
|
+
+ `<div class="isheet" id="iSheet" role="group" aria-label="Item fields"${ui.sheet ? ' data-esc-layer' : ' hidden'}>${f}</div>`
|
|
261
|
+
+ '<p class="nodef err" id="cardErr" role="alert" hidden></p>';
|
|
262
|
+
}
|
|
263
|
+
/* an agent that is working, ready, failed or posted needs the PM's eye, so its block stays in the conversation; one that only can draft is a field in the sheet */
|
|
264
|
+
const agCardInner = (r) => (r.dialog.agent && r.dialog.agent.state !== 'suggest' ? agentHtml(r) : '');
|
|
265
|
+
const agCardHtml = (r) => { const h = agCardInner(r); return h ? `<div class="acard" id="agCard">${h}</div>` : ''; };
|
|
266
|
+
/* the bar sits in the switch row (#dTabs), which the dialog shows at every width while an item is open */
|
|
267
|
+
function mountBar(r) {
|
|
268
|
+
unmountBar();
|
|
269
|
+
$('#dTabs').insertAdjacentHTML('beforeend', `<div class="ibar" id="card">${cardInner(r)}</div>`);
|
|
270
|
+
$('#dlg').classList.add('itm');
|
|
271
|
+
}
|
|
272
|
+
function unmountBar() { const c = $('#card'); if (c) c.remove(); $('#dlg').classList.remove('itm'); }
|
|
273
|
+
function placeSheet() {
|
|
274
|
+
const s = $('#iSheet'); if (!s || s.hidden) return;
|
|
275
|
+
const dl = $('#dlg').getBoundingClientRect(), t = $('#dTabs').getBoundingClientRect();
|
|
276
|
+
s.style.maxHeight = Math.max(200, dl.bottom - t.bottom - 20) + 'px';
|
|
258
277
|
}
|
|
259
|
-
const cardHtml = (r) => `<div class="acard" id="card">${cardInner(r)}</div>`;
|
|
260
278
|
function paneHtml(r) {
|
|
261
279
|
const p = r.dialog.pane, ag = r.dialog.agent, dr = ag && ag.draft && (ag.draft.body || ag.draft.summary) ? ag.draft : null;
|
|
262
280
|
let h = '';
|
|
@@ -289,17 +307,19 @@ $('#oMain').addEventListener('click', async (e) => {
|
|
|
289
307
|
function openRow(r) {
|
|
290
308
|
if (!r) return;
|
|
291
309
|
openR = r; dlgKind = 'item'; ui = freshUi(); const d = r.dialog;
|
|
292
|
-
openDlg({ eye: d.eye + ' · real data', title: r.title, sub: r.sub, say: d.say, stream: turnA(logHtml(d)) + turnA(ptx(d.say)) +
|
|
293
|
-
ui.pane = paneSig(r);
|
|
310
|
+
openDlg({ eye: d.eye + ' · real data', title: r.title, sub: r.sub, say: d.say, stream: turnA(logHtml(d)) + turnA(ptx(d.say)) + agCardHtml(r), noteKey: r.key, pane: paneHtml(r), label: paneLabel(r) });
|
|
294
311
|
ui.pane = paneSig(r);
|
|
312
|
+
mountBar(r);
|
|
295
313
|
loadThread(r.key);
|
|
296
314
|
setTimeout(() => { const b = $('#dBody'); b.scrollTop = b.scrollHeight; }, 120);
|
|
297
315
|
}
|
|
298
316
|
/* redraw the card from what the model and the typed state hold; `sel` is the control to focus again */
|
|
299
317
|
function paint(sel) {
|
|
300
318
|
const c = $('#card'); if (!c || !openR) return;
|
|
301
|
-
c.innerHTML = cardInner(openR);
|
|
302
|
-
|
|
319
|
+
c.innerHTML = cardInner(openR); placeSheet();
|
|
320
|
+
const ac = $('#agCard'), ah = agCardInner(openR);
|
|
321
|
+
if (ac && ah) ac.innerHTML = ah; else if (ac) ac.remove(); else if (ah) $('#dBody .stream').insertAdjacentHTML('beforeend', agCardHtml(openR));
|
|
322
|
+
if (sel) { const f = $(sel, c) || $(sel, $('#dBody')); if (f) f.focus(); }
|
|
303
323
|
}
|
|
304
324
|
function showErr(msg) { const e = $('#cardErr'); if (!e) { toast(msg); return; } e.textContent = msg; e.hidden = false; }
|
|
305
325
|
const sigOf = (r) => JSON.stringify([r.dialog.agent, r.dialog.steps, r.dialog.defer, r.dialog.someday, r.dialog.edit, r.dialog.write.actions]);
|
|
@@ -321,7 +341,7 @@ function toastUndo(msg, undo) {
|
|
|
321
341
|
clearTimeout(toastUndo.t); toastUndo.t = setTimeout(() => t.classList.remove('on'), 8000);
|
|
322
342
|
}
|
|
323
343
|
async function commit(o) {
|
|
324
|
-
if (!o.list) $$('#card button').forEach((b) => { b.disabled = true; });
|
|
344
|
+
if (!o.list) $$('#card button, #agCard button').forEach((b) => { b.disabled = true; });
|
|
325
345
|
const res = await o.send();
|
|
326
346
|
if (!res || res.ok !== true) {
|
|
327
347
|
const msg = (res && res.error) || 'The press was not recorded.';
|
|
@@ -381,6 +401,7 @@ function dlgClick(b, r) {
|
|
|
381
401
|
case 'notyet': return commit({ send: () => post('/api/pm-items/notyet', { id, when: b.dataset.when }), say: SAID.notyet });
|
|
382
402
|
case 'waiting': return commit({ send: () => post('/api/pm-items/waiting', { id, on: ($('#wOn').value || '').trim() }), say: SAID.waiting });
|
|
383
403
|
case 'done': return doneP(r);
|
|
404
|
+
case 'sheet': ui.sheet = !ui.sheet; if (!ui.sheet) ui.xp = null; return paint(ui.sheet ? '#iSheet .ffd' : '#iTog');
|
|
384
405
|
case 'remove': return commit({ send: () => post('/api/pm-items/remove', { id }), say: SAID.remove, undo: () => post('/api/pm-items/undo', { id }) });
|
|
385
406
|
case 'flag': return todayP(r);
|
|
386
407
|
case 'keep': return commit({ send: () => post('/api/pm-items/keep', { id }), say: SAID.keep });
|
|
@@ -435,7 +456,7 @@ function dlgClick(b, r) {
|
|
|
435
456
|
}
|
|
436
457
|
}
|
|
437
458
|
const FIELD = { xeT: 'title', xeD: 'due', xeW: 'wo', xeJ: 'job' };
|
|
438
|
-
|
|
459
|
+
const onInput = (e) => {
|
|
439
460
|
const t = e.target, id = t.id;
|
|
440
461
|
if (id === 'wOn') { ui.wo = t.value; const b = $('#wBtn'); if (b) b.disabled = !t.value.trim(); }
|
|
441
462
|
else if (ui.ed && FIELD[id]) ui.ed[FIELD[id]] = t.value;
|
|
@@ -444,15 +465,25 @@ $('#dBody').addEventListener('input', (e) => {
|
|
|
444
465
|
else if (id === 'agAsk') ui.ask = t.value;
|
|
445
466
|
else if (id === 'agBody') ui.body = t.value;
|
|
446
467
|
else if (id === 'agNote') { ui.note = t.value; const g = $('[data-p="ag-sendback"]'); if (g) g.disabled = !t.value.trim(); }
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
468
|
+
};
|
|
469
|
+
const onChange = (e) => { if (ui.ed && e.target.id === 'xeJ') ui.ed.job = e.target.value; };
|
|
470
|
+
const onClick = (e) => {
|
|
450
471
|
const lt = e.target.closest('#logT');
|
|
451
472
|
if (lt) { const c = $('#alog').classList.toggle('col'); lt.setAttribute('aria-expanded', !c); return; }
|
|
452
473
|
const b = e.target.closest('[data-p]');
|
|
453
474
|
if (!b || b.disabled || !openR || dlgKind !== 'item') return;
|
|
454
475
|
dlgClick(b, openR);
|
|
455
|
-
}
|
|
476
|
+
};
|
|
477
|
+
/* the conversation and the bar in the switch row take the same presses */
|
|
478
|
+
for (const host of [$('#dBody'), $('#dTabs')]) { host.addEventListener('input', onInput); host.addEventListener('change', onChange); host.addEventListener('click', onClick); }
|
|
479
|
+
const shutSheet = (focus) => { if (!ui.sheet) return; ui.sheet = false; ui.xp = null; paint(focus ? '#iTog' : null); };
|
|
480
|
+
/* the sheet closes on a press outside it, and Escape closes it before the dialog */
|
|
481
|
+
document.addEventListener('pointerdown', (e) => { if (ui.sheet && dlgKind === 'item' && !e.target.closest('#card')) shutSheet(false); });
|
|
482
|
+
addEventListener('keydown', (e) => { if (e.key === 'Escape' && ui.sheet && dlgKind === 'item' && $('#iSheet')) { e.stopImmediatePropagation(); shutSheet(true); } }, true);
|
|
483
|
+
addEventListener('resize', placeSheet);
|
|
484
|
+
/* the bar belongs to the item dialog: it goes when the dialog closes or another dialog takes its place */
|
|
485
|
+
new MutationObserver(() => { if ($('#card') && (!dlgOpen() || dlgKind !== 'item' || !openR || $('#dTitle').textContent !== openR.title)) unmountBar(); })
|
|
486
|
+
.observe($('#dlg'), { attributes: true, attributeFilter: ['class'], childList: true, subtree: true, characterData: true });
|
|
456
487
|
|
|
457
488
|
/* ── Focus and jobs: the bar under the add line, and its dialog ─────────────────────────────────────────────────────────────── */
|
|
458
489
|
const fBody = (f) => ({ key: f.key, title: f.title, why: f.why, item_ids: f.item_ids, job: f.job || null });
|
|
@@ -2499,14 +2499,37 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2499
2499
|
.askbar .spad-f .cta{width:auto;height:34px;min-height:34px;padding:0 14px;border-radius:var(--r-chip);display:inline-flex;font-size:var(--fs-2);background:var(--card);color:var(--ink)}
|
|
2500
2500
|
.askbar .spad-f .cta:disabled{opacity:.5;cursor:not-allowed}
|
|
2501
2501
|
@media (max-width:700px){.spad-h span{display:none}.askbar .spad textarea{font-size:var(--fs-4)}.padt{min-height:44px}}
|
|
2502
|
-
/*
|
|
2502
|
+
/* Item fields at dialog level (PM, 2026-10-20): Edit ▾ and Done sit in the Detail / Conversation row; Edit opens the fields as a sheet over the body,
|
|
2503
|
+
closed by default, so the conversation keeps the whole body. On a wide dialog the switch is not drawn, so the row holds the bar alone. */
|
|
2504
|
+
.dlg.itm:not(.srl-open) #dTabs{display:flex!important;align-items:center;gap:8px;position:relative}
|
|
2505
|
+
.dlg.itm[data-mode="detail"] #dTabs .seg{display:none}
|
|
2506
|
+
@media (min-width:1000px){.dlg.itm[data-mode="split"] #dTabs .seg,.dlg.itm.full #dTabs .seg{display:none}.dlg.itm #dTabs{margin:4px 0 12px}}
|
|
2507
|
+
.ibar{margin-left:auto;display:grid;gap:6px;min-width:0}
|
|
2508
|
+
.ibrow{display:flex;align-items:center;justify-content:flex-end;gap:8px}
|
|
2509
|
+
.ichip{display:inline-flex;align-items:center;gap:7px;height:44px;padding:0 14px;border-radius:var(--r-chip);background:var(--well);color:var(--ink);font-size:var(--fs-2);font-weight:600;min-width:0;transition:box-shadow .25s}
|
|
2510
|
+
.ichip:hover,.ichip[aria-expanded="true"]{box-shadow:inset 0 0 0 1.5px var(--b3)}
|
|
2511
|
+
.ichip svg{width:17px;height:17px;flex:none}.ichip .isum{font-style:normal;font-weight:400;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px}
|
|
2512
|
+
.ichip .isum:empty{display:none}.ichip .isum::before{content:'· '}
|
|
2513
|
+
.ichip .i:last-child{transition:transform .25s var(--ease)}.ichip[aria-expanded="true"] .i:last-child{transform:rotate(180deg)}
|
|
2514
|
+
.ibar .fdone{width:auto;height:44px;padding:0 18px;font-size:var(--fs-2)}
|
|
2515
|
+
.isheet{position:absolute;z-index:6;right:0;top:calc(100% + 8px);width:min(460px,100%);overflow:auto;display:grid;gap:12px;padding:16px;border-radius:var(--r-in);background:var(--card-solid);box-shadow:inset 0 0 0 1px var(--hair),0 24px 60px -24px rgba(20,24,60,.45);animation:rise .3s var(--ease) both;overscroll-behavior:contain}
|
|
2516
|
+
.isheet[hidden]{display:none}
|
|
2517
|
+
.isheet .fbar{padding-top:10px}
|
|
2518
|
+
.ibar #cardErr{margin:0;text-align:right}
|
|
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 (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) */
|
|
2503
2521
|
@media (max-width:999px){.dlg.cmp #dEye{display:none}
|
|
2504
2522
|
.dlg.cmp .dhead{align-items:center}
|
|
2505
|
-
.dlg.cmp #dTitle{margin-top:0;font-size:var(--fs-4);
|
|
2506
|
-
.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}
|
|
2507
2528
|
.dlg.cmp .dtabs{margin-top:10px}
|
|
2508
2529
|
.dlg.cmp .dgrid{margin-top:8px}
|
|
2509
|
-
.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}
|
|
2510
2533
|
.dlg.cmp.shrunk .dgrid{margin-top:4px}}
|
|
2511
2534
|
|
|
2512
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: morning-brief
|
|
3
3
|
label: "Morning brief"
|
|
4
|
-
description: "Prepare today's brief and plan the PM's goals for the day
|
|
4
|
+
description: "Prepare today's brief and plan the PM's goals for the day from the calendar and the saved reads of the PM's tools (Slack, Jira, Confluence, mail, Wispr Flow, GitHub, Drive, Figma and websites): a plan for each meeting, the priorities and what is worth asking. Read-only on every source; it submits the brief to the workspace and sends nothing."
|
|
5
5
|
run: agent
|
|
6
6
|
agent: claude
|
|
7
7
|
output:
|
|
@@ -17,7 +17,7 @@ output:
|
|
|
17
17
|
|
|
18
18
|
Rules that always hold:
|
|
19
19
|
1. READ-ONLY on every source. Never send, reply, forward, post, react, comment, create, edit, accept, decline, transition, label, archive, mark read or delete anything in mail, Slack, Jira, Confluence, GitHub, Drive, Figma, a website, calendar, Wispr Flow or any other source.
|
|
20
|
-
2.
|
|
20
|
+
2. YOUR TOOLS ARE ALREADY READ. Mail, Slack, Wispr Flow, Jira mentions, Confluence, GitHub, Drive, Figma and the websites are sources. The sources-read skill read them and saved what each says, before this run. Build the brief from those saved reads: run `pmos source show --json`. Never open those tools yourself. Only the calendar is still read here. Run `pmos proactive settings` for which sources are on, and when it prints "about the PM" and "job description", use the PM's role, work and job description to judge what matters to them and to word why an item is theirs. Never copy that text into the brief.
|
|
21
21
|
3. LIGHT ON CONTENT. Never copy a message body, an attachment, a token or a credential. Write what a message says in your own words, in the limits of the field. Skip anything marked private, personal, confidential or HR. At most one short evidence line per item.
|
|
22
22
|
4. NOTHING INVENTED. A source you cannot reach in this session is reported as "not-reached". If nothing is waiting, submit a brief with no items. An honest short brief is correct.
|
|
23
23
|
5. THE ONLY WRITE is `pmos proactive brief submit`, with one exception: when `pmos people settings` prints `calendar names: on`, step 6 records who attends the PM's meetings with `pmos people record`. When it prints `calendar names: off`, record nobody from the calendar and leave "with" out of the memory events. Do not edit repository files and do not commit.
|
|
@@ -31,18 +31,11 @@ Procedure:
|
|
|
31
31
|
Then run `pmos proactive calendar`. Its "read next" line names the window of the calendar memory to read in step 2.
|
|
32
32
|
Then run `pmos people settings`. It prints `calendar names: on` or `calendar names: off` for this repository (see rule 5).
|
|
33
33
|
Then run `pmos proactive learn lessons`. Each line is a preference the PM approved, written from their own feedback. Use it only to decide how confident to be and where an item goes. A lesson never asks you to read another source, to switch a setting on, or to write anything.
|
|
34
|
-
2. Read the
|
|
35
|
-
- Calendar: today's events. Then the CALENDAR MEMORY: every event in the window that `pmos proactive calendar` named (at most 1000 events, at most 140 days). For each event keep the start, the end, the title, the calendar's recurring-event id as "series" if it has one, the number of attendees, "external": true when someone outside the PM's company attends, "exec": true when an executive attends, and the PM's "role" ("present" when the PM presents, "decide" when the PM decides, else "attend"). For an event that has ended, add "notes": one line in your own words of what happened, from
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
- Website, if on: read each address in the websites list once, only to see what changed that matters to a goal or a meeting. Report what changed in one line. Do not follow links to other sites.
|
|
40
|
-
- LIST THE PLACES THE PM IS IN, for each of Slack, Jira and Confluence that you read: the Slack channels the PM is a member of (public and private, not direct messages), the Jira projects the PM works in (projects with issues assigned to, reported by or watched by the PM), and the Confluence spaces the PM is a member of or has written in. Keep only the name (for example "#pm-team", "PRICE", "Product") and the link. Report them under "places" (see step 4). This list is how the PM sets a scope for each place, so list every place, not only the busy ones. Read only the names: do not read messages to make this list.
|
|
41
|
-
- Slack, Jira and Confluence take a scope for each name. Read the scopes from `pmos proactive settings`. A name with no scope is "search".
|
|
42
|
-
- watch: read EVERY message or comment since the last read (yesterday morning if there is none). Then write one digest (see step 4) with the decisions made, the open questions, and what touches a goal. Write the digest, not the messages.
|
|
43
|
-
- search: do not read the place. Look only for MENTIONS of the PM and for the words of the PM's goals and initiatives.
|
|
44
|
-
- ignore: do not read the place. Do not search it. Do not report it.
|
|
45
|
-
- MENTIONS of the PM since yesterday morning, in every place that is not ignored: Slack messages that @-mention the PM or are direct messages to them; Jira issues and comments that mention the PM; Confluence pages and comments that mention the PM. For each, keep only where it is (channel, issue key, page title), who wrote it, the link to the conversation itself, and a short paraphrase of what is asked. Never copy the message itself.
|
|
34
|
+
2. Read the calendar, and take everything else from the saved reads.
|
|
35
|
+
- Calendar: today's events. Then the CALENDAR MEMORY: every event in the window that `pmos proactive calendar` named (at most 1000 events, at most 140 days). For each event keep the start, the end, the title, the calendar's recurring-event id as "series" if it has one, the number of attendees, "external": true when someone outside the PM's company attends, "exec": true when an executive attends, and the PM's "role" ("present" when the PM presents, "decide" when the PM decides, else "attend"). For an event that has ended, add "notes": one line in your own words of what happened, from the saved Wispr Flow read, only when it has notes for that meeting; and "open": up to 3 points still open from it. For a coming event that needs work first, add "prep": up to 6 steps, and "prep_done": how many of them are already done. Read only titles, times and attendee counts. Never copy an invitation's text.
|
|
36
|
+
- THE SAVED READS. Run `pmos source show --json`. It prints one read per tool: its "state" (read, not-reached or off), its "read_at", its "items" (who, where, what is asked, the link, "mention" when it mentions the PM), its "digests" (one per watched Slack channel, Jira project or Confluence space) and its "places". In the brief, give each tool the state of its saved read. A tool with no saved read, or whose read is older than yesterday morning, is "not-reached": say in the evidence of one item that its read is old. Never add an item of a tool whose state is not "read".
|
|
37
|
+
- Turn the saved items into brief items (step 3). Keep their link, where, who, about, ask, mention, reply_needed, due and thread as they are, and give the item the tool as its "source". Copy each saved digest into "digests" with its tool as "source", and each saved place into "places".
|
|
38
|
+
- Jira issues assigned to the PM are not in the saved reads: My work owns them. Run `pmos my-work list --top 5 --json` and add each item it prints as a priority with "source": "jira" (or "github" for a WBS item), "owner": "pm", the item's key in the title, and "how": "Brief it in My work". Never make one of them an agent item: the PM briefs the agent in My work. If the command fails, say so in the evidence of one item and go on. To tie a Jira issue to an initiative, run `pmos jira which <KEY>` (it reads local files only) and use the initiative it names. A status change of a ticket that `pmos jira which` names is not an item: the Jira status check shows it on the initiative's Jira tickets tab.
|
|
46
39
|
3. PLAN EACH OPEN GOAL. For each open goal, find what moves it today in what you read and in `pmos proactive today`: a meeting where it is decided, a mention that blocks it, an issue or page it needs, a step an agent can prepare. Write each as an item with "goal": "<the goal id>". An agent step names the initiative it advances, so the PM can prepare it from Today. A calendar event that belongs to a goal also gets "goal". If you find nothing for a goal, write nothing for it: the workspace shows that goal as needing a plan. Never invent a step.
|
|
47
40
|
Then ANTICIPATE: for each other thing the PM should act on today (a mention waiting on them, a meeting to prepare for, an issue due), write one item with no goal.
|
|
48
41
|
PLAN EACH MEETING. For each calendar event that is a meeting, write what it is for and how to be ready. Use the Wispr Flow notes of the earlier meetings in the series, the related mail (only if mail is on) and the related Jira, Confluence, Drive and Slack items you read. Do not guess: leave a field out when you have no basis for it.
|