create-pmos 0.307.0 → 0.309.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 +1 -1
- 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/guide/briefing-premium.md +7 -1
- package/workspace/lib/briefing-premium-products.js +13 -1
- package/workspace/lib/briefing-premium-sources.js +12 -1
- package/workspace/lib/briefing-premium.js +36 -2
- package/workspace/lib/routes-briefing-premium.js +8 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-studio-test.js +7 -0
- package/workspace/public/pm/premium-insights.js +2 -2
- package/workspace/public/pm/premium-shell.js +1 -1
- package/workspace/public/pm/premium-work.js +1 -10
- package/workspace/public/pm/premium.css +4 -4
- package/workspace/public/pm/premium.js +28 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.309.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": {
|
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-19T12:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T12:42:22Z"}
|
|
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-19T12:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T12:42:22Z"}
|
|
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-19T12:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T12:42:22Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -68,6 +68,11 @@ Two reads feed the page. The quick read takes the kill conditions, the failed-re
|
|
|
68
68
|
|
|
69
69
|
The pill at the top right says when the data was read and which source could not be read. A source that cannot be read adds nothing. The page does not guess.
|
|
70
70
|
|
|
71
|
+
Two buttons sit beside the pill:
|
|
72
|
+
|
|
73
|
+
- **Refresh** reads every included repository again now, without waiting for the 5-minute age. If a read is already running, Refresh does not start a second one. A read that failed is tried again at once. Mail, Jira and the calendar are read by skills, not by Refresh. To refresh them, use **Around you → Data freshness**.
|
|
74
|
+
- **Sources** lists each source that the pill names, with its state: **Read**, **Not read**, **Not included** or **Off**. For each source, it also gives the reason. Examples: `planning/runs/agent-runs.jsonl` is missing in that repository; the product is not chosen under **Products**; the source is switched off under **Settings → Connectors**; the morning brief could not reach it.
|
|
75
|
+
|
|
71
76
|
## The hero sentence
|
|
72
77
|
|
|
73
78
|
The hero is one short paragraph. Each part of it comes from one record:
|
|
@@ -189,7 +194,7 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
|
|
|
189
194
|
|
|
190
195
|
**This week.** A card at the top of the right column shows Monday to Friday. Each day has a grey bar for its meeting time, from your calendar, with black blocks for items done that day and orange hatched blocks for items due, from your list (at most three of each; they count items, not hours). A legend names the three. If PMOS cannot read the calendar, the card says so and draws no meeting bar. The mockup's hours done, hours free, warning line and Move to Friday need an estimate per item and working hours, which PMOS does not hold, so they are not drawn. It makes no "will not fit" note, because no item has a size and PMOS holds no working hours.
|
|
191
196
|
|
|
192
|
-
**Row suggestions and buttons.** A row shows a suggestion line only when a record backs it: an agent's offer on the item, a draft that is ready, or a date. A row
|
|
197
|
+
**Row suggestions and buttons.** A row shows a suggestion line only when a record backs it: an agent's offer on the item, a draft that is ready, or a date. A row has no button of its own. Press the row to open the item, where you review a draft, start the agent, or give the item a day. To act without opening it, swipe the row or press the right or left arrow key. A row in Today goes to Done (or opens its draft when one is ready) on the right and to Tomorrow on the left. Any other row goes to Today on the right and to Someday on the left. A row from Jira shows its Jira key.
|
|
193
198
|
|
|
194
199
|
**Weekly review.** A card lists five steps: sort the inbox, place your tray, check who owes you, review agent drafts, and look at what sat untouched. Each step shows a count from your list and opens its first item. **Start the review** opens the first step that has something. On a Friday the card reads Friday review. PMOS keeps no review schedule and no timing, so the card shows none. The tray's tabs are drawn from your own items (see below). Answers, ideas and reports an agent files by itself are not shown, because PMOS holds no records for them.
|
|
195
200
|
|
|
@@ -262,6 +267,7 @@ Insights is the fourth place on the rail, at `/premium-insights.html`. It reads
|
|
|
262
267
|
|
|
263
268
|
- **Charts.** One chart for each KR metric that holds at least two readings. The line runs through the readings at their dates, so a month with no reading is a gap and not a zero. The dashed line is the metric's target. The chip is the record's own line status: on its line, behind it, or well behind it. Pressing a chart, or its Details link, opens the metric's record in the dialog with the read-only agent beside it.
|
|
264
269
|
- **Dashboards.** The switch lists All measures first, then your saved dashboards (the main one first, marked Main), then the pillars the metrics name. A saved dashboard draws its charts in the order you saved them. A chart whose record is gone, or that has fewer than two readings, is listed in its place with the reason and is not drawn.
|
|
270
|
+
- **Open the Studio from the top.** The dark **Studio** pill beside the board name opens the Insight Studio: on the saved dashboard you are looking at, otherwise on a new dashboard, or in Report mode when no measure has a series yet.
|
|
265
271
|
- **Make or edit a dashboard.** **New dashboard**, or **Edit** on a saved one, opens the **Insight Studio**, a wide dialog. On the right, the brief shows the Name, Purpose, Charts and Main dashboard; press a chip to change it. **Library** lists the board's measures and saved dashboards to add. The preview draws the dashboard as the page will, and lists a measure with no series as not drawn. The checks (a name, a purpose, a chart, six or fewer, no repeat, a main dashboard on the board) say what fails, with a one-press fix. On the left you can say it instead: "add Partner activation", "remove …", "move … first", "call it …", "it is for …", "make it the main dashboard", "undo" or "start a new one". A turn changes the draft only. **Undo** steps back one change. **Save the dashboard** records it; **Remove the dashboard** asks once more and then removes it. In a chart's dialog, **On your dashboards** has a switch for each saved dashboard, which adds the chart to it or takes it off.
|
|
266
272
|
- **Make your own chart.** **New chart**, or **Edit** on one of your charts, opens the Insight Studio in **Chart** mode; the switch at the top moves between Chart and Dashboard, and each keeps its own draft. The brief shows the Question, Measure, Form (line, bars, number or meter), Range (all readings or the last few) and Target; **More** adds the Title, Better when, Note and Add to (a dashboard). The Studio suggests a form from the question and says why. The checks (a question, a target, enough readings, a form that fits the question, one scale) say what fails, with a one-press fix. You can say it instead: "show it as bars", "last 4 readings", "target 35", "lower is better", "call it …", "note: …", "add it to Weekly", or a question. A pie is declined, with the reason. **Save the chart** records it in the workspace's state folder, and adds it to the dashboard you named. Your charts are listed under **All measures**, and a dashboard can hold them beside the measures. **Remove the chart** asks once more; a dashboard that held it then says it was removed.
|
|
267
273
|
- **Set up a report in the Studio.** **New report** on the Reports card opens the Insight Studio in **Report** mode. The brief shows the Title, What it answers, Audience, Format, Schedule, Draw from (your work, or the board's dashboard) and the Sections. A new report always has the same sections, in the same order, so they are listed, not edited. The checks (what it answers, an audience, a format that fits the audience, a new title, the answer first) say what fails, with a one-press fix. You can say it instead: "it answers: …", "for leadership", "slides", "monthly", "every two weeks on Thursday", "call it …". **Set it up** records the report and writes its first draft as a file.
|
|
@@ -103,6 +103,18 @@ async function modelOfMany({ available, engine, runtimeDir, sources, agent }) {
|
|
|
103
103
|
return { state: 'ready', model, as_of: asOf || now, refreshing, pending: model.pending, ...(error ? { error } : {}) };
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
/** The PM's Refresh: read every included workspace again now, without waiting for the 5-minute age. A read already running is not doubled; a failed one is tried again at once. Returns the names it started and the names already being read. */
|
|
107
|
+
function refreshNow({ available, engine, runtimeDir }) {
|
|
108
|
+
const started = [], already = [];
|
|
109
|
+
for (const p of (available || []).filter((a) => a.on)) {
|
|
110
|
+
const s = stateOf(p.root);
|
|
111
|
+
if (s.inflight) { already.push(p.name); continue; }
|
|
112
|
+
s.lastError = null; s.lastErrorAt = 0;
|
|
113
|
+
start(p, engine, runtimeDir); started.push(p.name);
|
|
114
|
+
}
|
|
115
|
+
return { started, already };
|
|
116
|
+
}
|
|
117
|
+
|
|
106
118
|
/** After a write: the quick facts of one workspace again (the PM's decision or a returned run changed its records). */
|
|
107
119
|
async function rebuildOne({ root, runtimeDir }) {
|
|
108
120
|
const s = stateOf(root);
|
|
@@ -118,4 +130,4 @@ const peekModel = () => last;
|
|
|
118
130
|
const settle = () => Promise.all([...states.values()].map((s) => s.inflight).filter(Boolean));
|
|
119
131
|
const forget = () => { states.clear(); last = null; };
|
|
120
132
|
|
|
121
|
-
module.exports = { choose, splitKey, modelOfMany, rebuildOne, peekModel, settle, forget, refreshOne, STALE_MS };
|
|
133
|
+
module.exports = { choose, splitKey, modelOfMany, refreshNow, rebuildOne, peekModel, settle, forget, refreshOne, STALE_MS };
|
|
@@ -108,8 +108,18 @@ function notReadOf(brief) {
|
|
|
108
108
|
.map((k) => SOURCE_WORD[k].toLowerCase() + (st[k] === 'off' ? ' (switched off)' : ' (the brief says it was not reached)'));
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
/** One line per source the morning brief names, for the Sources list: { name, state: 'read'|'not-read'|'off', reason }. Only what the brief's own `sources` field says. */
|
|
112
|
+
function statusOf(brief) {
|
|
113
|
+
const st = brief.sources && typeof brief.sources === 'object' ? brief.sources : {};
|
|
114
|
+
return ['mail', 'jira', 'confluence', 'slack'].filter((k) => k in st).map((k) => st[k] === 'off'
|
|
115
|
+
? { name: SOURCE_WORD[k], state: 'off', reason: 'Switched off under Settings, Connectors.' }
|
|
116
|
+
: st[k] === 'not-reached'
|
|
117
|
+
? { name: SOURCE_WORD[k], state: 'not-read', reason: 'The morning brief says it could not reach ' + SOURCE_WORD[k] + '. Your Claude session reaches it through its own connector, so check that connector there.' }
|
|
118
|
+
: { name: SOURCE_WORD[k], state: 'read', reason: 'Read by the morning brief of ' + brief.date + '.' });
|
|
119
|
+
}
|
|
120
|
+
|
|
111
121
|
function build({ brief, myWork, itemLines, today, products } = {}) {
|
|
112
|
-
const out = { rows: [], digests: [], state: 'absent', notRead: [], from: [] };
|
|
122
|
+
const out = { rows: [], digests: [], state: 'absent', notRead: [], status: [], from: [] };
|
|
113
123
|
const b = brief && brief.state === 'ok' && brief.brief && brief.brief.date === today ? brief.brief : null;
|
|
114
124
|
out.state = b ? 'ok' : brief && brief.state === 'ok' ? 'stale' : (brief && brief.state) || 'absent';
|
|
115
125
|
const tickets = (Real.build({ brief: null, myWork, itemLines, today }).needs || []).filter((n) => n.origin === 'jira' && n.itemId)
|
|
@@ -119,6 +129,7 @@ function build({ brief, myWork, itemLines, today, products } = {}) {
|
|
|
119
129
|
out.rows.push(...rowItems(b).map(({ x, ask }) => itemRow(x, ask, b, products)));
|
|
120
130
|
out.digests = list(b.digests).map((d) => digestItem(d, b)).filter(Boolean);
|
|
121
131
|
out.notRead = notReadOf(b);
|
|
132
|
+
out.status = statusOf(b);
|
|
122
133
|
}
|
|
123
134
|
return out;
|
|
124
135
|
}
|
|
@@ -365,6 +365,33 @@ function build(f) {
|
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
|
|
368
|
+
/** Why a quick read came back empty: only what the read itself does, named by the file or command it uses. */
|
|
369
|
+
const MISSING_WHY = {
|
|
370
|
+
runs: 'planning/runs/agent-runs.jsonl is missing or cannot be read. The repository has logged no agent run yet.',
|
|
371
|
+
evals: 'planning/runs/evals.jsonl is missing or cannot be read. The repository has logged no review verdict yet.',
|
|
372
|
+
merges: 'git log failed in this repository.',
|
|
373
|
+
workflow: 'The initiative state could not be read: scripts/workflow-state.js gave no answer.',
|
|
374
|
+
tripwires: 'planning/okrs/kill-conditions.md is missing or cannot be read.',
|
|
375
|
+
};
|
|
376
|
+
/** The Sources list behind the Real data line: one entry per thing the line names, with the state and the reason. [{ name, state: 'read'|'not-read'|'not-included'|'off', reason }] */
|
|
377
|
+
function sourceList({ meetings, parts, available, sx, sxState }) {
|
|
378
|
+
const out = [];
|
|
379
|
+
out.push(meetings === null ? { name: 'Calendar', state: 'not-read', reason: 'The calendar file PMOS holds could not be read. Refresh it under Around you, Data freshness.' } : { name: 'Calendar', state: 'read', reason: 'Read from the calendar PMOS holds.' });
|
|
380
|
+
for (const p of parts) {
|
|
381
|
+
if (p.state === 'error') { out.push({ name: p.product.name, state: 'not-read', reason: 'The read failed: ' + String(p.error || 'no reason was given').slice(0, 200) }); continue; }
|
|
382
|
+
if (!p.f) { out.push({ name: p.product.name, state: 'not-read', reason: 'It is still being read for the first time.' }); continue; }
|
|
383
|
+
const miss = p.f.missing || [];
|
|
384
|
+
for (const k of ['runs', 'evals', 'merges', 'workflow', 'tripwires']) {
|
|
385
|
+
if (k === 'tripwires' && p.f.tripwires === null && !miss.includes(k)) { out.push({ name: SOURCE_NAME[k] + ' of ' + p.product.name, state: 'not-read', reason: MISSING_WHY[k] }); continue; }
|
|
386
|
+
out.push({ name: SOURCE_NAME[k] + ' of ' + p.product.name, state: miss.includes(k) ? 'not-read' : 'read', reason: miss.includes(k) ? MISSING_WHY[k] : 'Read from the repository.' });
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
for (const a of available.filter((x) => !x.on)) out.push({ name: a.name, state: 'not-included', reason: a.home ? 'PMOS itself is left out unless you choose it under Products.' : 'Not chosen under Products, so no file of it is opened.' });
|
|
390
|
+
if (sx) out.push(...sx.status);
|
|
391
|
+
if (sxState && sxState !== 'ok') out.push({ name: 'Morning brief', state: 'not-read', reason: sxState === 'bad' ? 'Today\'s brief file could not be parsed.' : 'No morning brief file exists for today. The morning brief skill writes it.' });
|
|
392
|
+
return out;
|
|
393
|
+
}
|
|
394
|
+
|
|
368
395
|
/* ── several products (initiative briefing-premium-products) ──────────────────────────────────────────────── */
|
|
369
396
|
const KIND_RANK = { blocked: 0, decision: 1, waited: 2 };
|
|
370
397
|
const longest = (r) => { const d = (r.detail && r.detail.days) || []; return d.length ? d[d.length - 1] : 0; };
|
|
@@ -417,7 +444,7 @@ function buildMany(g) {
|
|
|
417
444
|
return {
|
|
418
445
|
date: dateLine(now),
|
|
419
446
|
pending,
|
|
420
|
-
header: { text: 'Real data · as of ' + hhmm(asOf) + ' · ' + (none ? 'no product included' : joinNames(inc.map((a) => a.name))) + (out.length ? ' · ' + joinNames(out.map((a) => a.name)) + ' not included' : '') + (missText.length ? ' · not read: ' + missText.join(', ') : '') + sxNote + (waiting.length ? ' · reading ' + joinNames(waiting.map((p) => p.product.name)) : '') + (skipped.n ? ' · ' + skipped.n + (skipped.n === 1 ? ' record' : ' records') + ' could not be read and ' + (skipped.n === 1 ? 'was' : 'were') + ' left out' : ''), missing },
|
|
447
|
+
header: { text: 'Real data · as of ' + hhmm(asOf) + ' · ' + (none ? 'no product included' : joinNames(inc.map((a) => a.name))) + (out.length ? ' · ' + joinNames(out.map((a) => a.name)) + ' not included' : '') + (missText.length ? ' · not read: ' + missText.join(', ') : '') + sxNote + (waiting.length ? ' · reading ' + joinNames(waiting.map((p) => p.product.name)) : '') + (skipped.n ? ' · ' + skipped.n + (skipped.n === 1 ? ' record' : ' records') + ' could not be read and ' + (skipped.n === 1 ? 'was' : 'were') + ' left out' : ''), missing, sources: sourceList({ meetings, parts, available, sx, sxState: sx ? sx.state : null }) },
|
|
421
448
|
hero: hero.length ? hero : [{ parts: [{ t: pending ? 'Reading the initiative state. What needs you is not known yet.' : 'Nothing needs you and nothing moved today that the records show.', s: false }], from: [] }],
|
|
422
449
|
list: { title: 'What you need to do', rows, more, count: rows.length + more, pendingNote: pending ? 'Blocked work, prototypes waiting for you and failed reviews appear when the initiative state has been read.' : null, putOff: putOff.map((x) => ({ key: x.key, title: x.title, ...(x.product ? { product: x.product } : {}), until: x.until, text: (x.product ? x.product + ': ' : '') + x.title + ' · back ' + backAt(x.until, now) })), order: 'In this order: blocked work first, then decisions only you can make, then what has waited longest.' },
|
|
423
450
|
today: todayOf(cf),
|
|
@@ -579,6 +606,13 @@ function modelOf({ root, engine, runtimeDir }) {
|
|
|
579
606
|
if (lastError && !inflight) return Promise.resolve({ state: 'error', error: lastError });
|
|
580
607
|
return Promise.resolve({ state: 'reading', elapsed_ms: Date.now() - startedAt });
|
|
581
608
|
}
|
|
609
|
+
/** The PM's Refresh for the one-workspace page: read again now. A read already running is not doubled. true when one started. */
|
|
610
|
+
function refreshNow({ root, engine, runtimeDir }) {
|
|
611
|
+
if (inflight) return false;
|
|
612
|
+
lastError = null; lastErrorAt = 0; startedAt = Date.now();
|
|
613
|
+
inflight = refresh({ root, engine, runtimeDir }).catch((e) => { lastError = String((e && e.stack) || e).split('\n').slice(0, 3).join(' | ').slice(0, 300); lastErrorAt = Date.now(); }).finally(() => { inflight = null; });
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
582
616
|
/** After a write: rebuild the kept answer from fresh records without the slow read. A caller waits for a read in progress first. */
|
|
583
617
|
async function rebuild({ root, runtimeDir }) {
|
|
584
618
|
await settle();
|
|
@@ -594,4 +628,4 @@ const peekModel = (root) => (kept && kept.root === root ? kept.model : partial &
|
|
|
594
628
|
const settle = () => inflight || Promise.resolve();
|
|
595
629
|
const forget = () => { kept = null; partial = null; inflight = null; lastError = null; startedAt = 0; };
|
|
596
630
|
|
|
597
|
-
module.exports = { build, buildMany, allRowsOf, readMeetings, hooks, refresh, readSources, readFast, readInitiatives, repoKey, readFm, readTripwires, modelOf, settle, forget, rebuild, peekModel, rowsOf, heroOf, todayOf, failedReviews, num };
|
|
631
|
+
module.exports = { build, buildMany, allRowsOf, readMeetings, hooks, refresh, readSources, readFast, readInitiatives, repoKey, readFm, readTripwires, modelOf, refreshNow, settle, forget, rebuild, peekModel, rowsOf, heroOf, todayOf, failedReviews, num };
|
|
@@ -42,7 +42,7 @@ function ownerOf(ctx, ws) {
|
|
|
42
42
|
|
|
43
43
|
const enginePath = () => ENGINE_PATHS.find((p) => fs.existsSync(p)) || null;
|
|
44
44
|
|
|
45
|
-
const POSTS = ['decide', 'put-off', 'return', 'ask'];
|
|
45
|
+
const POSTS = ['decide', 'put-off', 'return', 'ask', 'refresh'];
|
|
46
46
|
const rootOf = (url, ctx) => {
|
|
47
47
|
let root; try { const w = ctx.getWs && ctx.getWs(url.searchParams.get('ws') || null); root = w && w.root; } catch { root = null; }
|
|
48
48
|
return root || path.resolve(__dirname, '..', '..');
|
|
@@ -66,6 +66,13 @@ async function post(req, res, url, ctx) {
|
|
|
66
66
|
if (o.error) { ctx.json(res, { ok: false, error: o.error }, 400); return true; }
|
|
67
67
|
root = o.root; merged = true;
|
|
68
68
|
}
|
|
69
|
+
if (act === 'refresh') {
|
|
70
|
+
// the PM's Refresh: read the included repositories again now. Mail, Jira and the calendar are read by skills (Around you, Data freshness), not here.
|
|
71
|
+
if (url.searchParams.get('ws')) { const started = BP.refreshNow({ root, engine: enginePath(), runtimeDir }); ctx.json(res, { ok: true, started: started ? ['this repository'] : [], already: started ? [] : ['this repository'] }); return true; }
|
|
72
|
+
const r = Prod.refreshNow({ available: products(ctx).available, engine: enginePath(), runtimeDir });
|
|
73
|
+
ctx.json(res, { ok: true, ...r });
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
69
76
|
if (act === 'ask') {
|
|
70
77
|
let wsId; try { const w = merged && sk ? { id: sk.ws } : ctx.getWs && ctx.getWs(url.searchParams.get('ws') || null); wsId = w && w.id; } catch { wsId = undefined; }
|
|
71
78
|
const a = Ag.ask({ runtimeDir, key: b.key, text: b.text, model: /^work:/.test(String(b.key || '')) ? WP.peekModel() : /^board:/.test(String(b.key || '')) ? BoardP.peekModel() : /^ins:/.test(String(b.key || '')) ? InsP.peekModel() : /^(init|doc):/.test(String(b.key || '')) ? InitP.peekModel() : sk || /^src:/.test(String(b.key || '')) ? Prod.peekModel() : BP.peekModel(root), spawnSession: ctx.spawnSession, wsId });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.309.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.309.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -63,6 +63,11 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
|
|
|
63
63
|
const open = async (sel) => { await p.click(sel); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .stu'))); await sleep(300); };
|
|
64
64
|
const shut = async () => { for (let i = 0; i < 2 && await p.evaluate(() => document.querySelector('#dlg').classList.contains('on')); i++) { await p.keyboard.press('Escape'); await sleep(150); } };
|
|
65
65
|
|
|
66
|
+
/* O0: the crumb's Studio pill, as the mockup has it, opens the Studio on the dashboard shown */
|
|
67
|
+
ok('O0 the crumb has a Studio pill with the sparkle', await p.evaluate(() => { const b = document.querySelector('#crAsk'); return !!b && b.textContent.trim() === 'Studio' && !!b.querySelector('svg') && b.getAttribute('aria-label') === 'Open the Insight Studio'; }));
|
|
68
|
+
await open('#crAsk');
|
|
69
|
+
ok('O0b the Studio pill opens the Studio', await p.evaluate(() => /^Insight Studio · /.test(document.querySelector('#dEye').textContent)));
|
|
70
|
+
await shut();
|
|
66
71
|
/* O: New dashboard opens the Studio */
|
|
67
72
|
await open('#pdNew');
|
|
68
73
|
const o = await p.evaluate(() => ({ eye: document.querySelector('#dEye').textContent, full: document.querySelector('#dlg').classList.contains('full'), lib: [...document.querySelectorAll('#stLb .stli b')].map((b) => b.textContent), agent: getComputedStyle(document.querySelector('#askF')).display === 'none', own: !!document.querySelector('#stF') }));
|
|
@@ -162,6 +167,8 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
|
|
|
162
167
|
const c2 = await browser.newContext({ viewport: { width: 390, height: 844 }, colorScheme: theme }), q = await c2.newPage();
|
|
163
168
|
await q.goto(BASE + '/premium-insights.html');
|
|
164
169
|
await until(() => q.evaluate(() => !!document.querySelector('#pdNew')));
|
|
170
|
+
const pill = await q.evaluate(() => { const b = document.querySelector('#crAsk'), r = b.getBoundingClientRect(); return { txt: b.textContent.trim(), w: r.width, h: r.height, right: r.right, vw: innerWidth, vis: !!b.offsetParent }; });
|
|
171
|
+
ok(`F0 at 390 px (${theme}) the Studio pill shows its label, fits the width and is as tall as the crumb's other buttons`, pill.txt === 'Studio' && pill.vis && pill.right <= pill.vw && Math.round(pill.h) >= 34, JSON.stringify(pill));
|
|
165
172
|
await q.click('#pdNew'); await until(() => q.evaluate(() => !!document.querySelector('#oMain .stu'))); await sleep(400);
|
|
166
173
|
// measured once the dialog has finished opening: its rise animation scales the targets while it runs
|
|
167
174
|
const measure = () => q.evaluate(() => {
|
|
@@ -27,8 +27,8 @@ function drawHead() {
|
|
|
27
27
|
if (!crumbed) {
|
|
28
28
|
crumbed = true;
|
|
29
29
|
const boards = M.board.switcher || [];
|
|
30
|
-
$('#crumbHost').innerHTML = crumbHtml({ board: M.board.name || 'Insights', boards, ask: '
|
|
31
|
-
wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-insights.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)), ask: () => { const
|
|
30
|
+
$('#crumbHost').innerHTML = crumbHtml({ board: M.board.name || 'Insights', boards, ask: 'Open the Insight Studio', label: 'Studio' });
|
|
31
|
+
wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-insights.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)), ask: () => { const D = curDash(); if (D && D.saved) openDashEdit(D); else if (M.charts.length) openDashEdit(null); else openReportEdit(null); } }); // the mockup's Studio pill: the saved dashboard shown, else a new dashboard, else a report when no measure has a series
|
|
32
32
|
}
|
|
33
33
|
$('#snap').textContent = M.header.text;
|
|
34
34
|
$('#snap').title = 'Every figure on this page comes from a KR metric record. A measure with fewer than two readings is listed, not drawn.';
|
|
@@ -191,7 +191,7 @@ export function wireRail(here) {
|
|
|
191
191
|
/* ── the crumb: where you are, a menu to switch board or initiative, and the sparkle that opens the read-only agent ──────────────────── */
|
|
192
192
|
export function crumbHtml(o) {
|
|
193
193
|
const chev = (id, label, show) => `<button id="${id}" class="cri" aria-haspopup="menu" aria-expanded="false" aria-label="${esc(label)}"${show ? '' : ' hidden'}>${CHEV}</button>`;
|
|
194
|
-
return `<nav class="crumb" aria-label="Where you are"><button id="crBoard"${o.ini ? '' : ' aria-current="page" disabled'}>${esc(o.board)}</button>${chev('crSw', 'Switch board', o.boards && o.boards.length > 1)}${o.ini ? `<span aria-hidden="true">›</span><span id="crIni" aria-current="page">${esc(o.ini)}</span>${chev('crSw2', 'Switch initiative', o.siblings && o.siblings.length > 1)}` : ''}<button id="crAsk" class="cri crask" aria-label="${esc(o.ask)}">${AI}</button><div id="crMenu" class="crmenu" role="menu" hidden></div></nav>`;
|
|
194
|
+
return `<nav class="crumb" aria-label="Where you are"><button id="crBoard"${o.ini ? '' : ' aria-current="page" disabled'}>${esc(o.board)}</button>${chev('crSw', 'Switch board', o.boards && o.boards.length > 1)}${o.ini ? `<span aria-hidden="true">›</span><span id="crIni" aria-current="page">${esc(o.ini)}</span>${chev('crSw2', 'Switch initiative', o.siblings && o.siblings.length > 1)}` : ''}<button id="crAsk" class="cri crask${o.label ? ' crst' : ''}" aria-label="${esc(o.ask)}">${AI}${o.label ? esc(o.label) : ''}</button><div id="crMenu" class="crmenu" role="menu" hidden></div></nav>`;
|
|
195
195
|
}
|
|
196
196
|
/** o: { boards: [{ws,id,name}], board: id, siblings: [{id,title}], ini: id, goBoard(ws, id), goIni(id), ask() }. Escape and a click outside close the menu; the arrows move in it. */
|
|
197
197
|
export function wireCrumb(o) {
|
|
@@ -52,8 +52,7 @@ function rowHtml(r, o = {}) {
|
|
|
52
52
|
const meta = r.chip ? `<span class="wm"><span class="due${r.overdue ? ' od' : ''}">${esc(r.chip)}</span></span>` : '';
|
|
53
53
|
const state = sm === 'ag' ? ' · ' + ({ ready: 'draft ready to review', failed: 'the run failed', queued: 'queued', working: 'working', sending: 'sending' }[r.agent] || '') : '';
|
|
54
54
|
const sug = !sm && r.sug ? `<span class="wsg">${ICO('<path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/>')}<span><b>${esc(r.sug.b)}</b> ${esc(r.sug.t)}</span></span>` : '';
|
|
55
|
-
|
|
56
|
-
return `<div class="wrw"><div class="wrow${sm ? ' sm' : ''}${cta ? ' hc' : ''}${inbox ? ' inb' : ''}${o.first ? ' first' : ''}" data-key="${esc(r.key)}">${lead}<button class="wrh" aria-haspopup="dialog"${desc}><span class="wtx"><span class="wtit">${esc(r.title)}${o.first ? '<em class="tgf">Do this first</em>' : ''}${r.focus ? '<em class="xfc">Focus</em>' : ''}</span><span class="ws">${esc(r.sub)}${esc(state)}</span>${sug}</span>${meta}</button>${cta}</div></div>`;
|
|
55
|
+
return `<div class="wrw"><div class="wrow${sm ? ' sm' : ''}${inbox ? ' inb' : ''}${o.first ? ' first' : ''}" data-key="${esc(r.key)}">${lead}<button class="wrh" aria-haspopup="dialog"${desc}><span class="wtx"><span class="wtit">${esc(r.title)}${o.first ? '<em class="tgf">Do this first</em>' : ''}${r.focus ? '<em class="xfc">Focus</em>' : ''}</span><span class="ws">${esc(r.sub)}${esc(state)}</span>${sug}</span>${meta}</button></div></div>`;
|
|
57
56
|
}
|
|
58
57
|
function drawPlate() {
|
|
59
58
|
const P = M.plate;
|
|
@@ -514,14 +513,6 @@ $('#agl').addEventListener('click', (e) => { listClick(e); });
|
|
|
514
513
|
$('#waitBody').addEventListener('click', (e) => { listClick(e); });
|
|
515
514
|
$('#trayBody').addEventListener('click', (e) => { listClick(e); });
|
|
516
515
|
async function listClick(e) {
|
|
517
|
-
const cta = e.target.closest('.wcta');
|
|
518
|
-
if (cta) {
|
|
519
|
-
const r = rowOf(cta.dataset.key); if (!r) return;
|
|
520
|
-
const o = { list: true };
|
|
521
|
-
refocus = null;
|
|
522
|
-
if (cta.dataset.act === 'open') openRow(r); else if (cta.dataset.act === 'tomorrow') deferP(r, addIso(M.today, 1), o); else if (cta.dataset.act === 'done') doneP(r, o); else if (cta.dataset.act === 'letgo') commit({ ...o, send: () => post('/api/pm-items/remove', { id: r.id }), say: SAID.remove, undo: () => post('/api/pm-items/undo', { id: r.id }) }); else todayP(r, o);
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
516
|
const ck = e.target.closest('.wck');
|
|
526
517
|
if (ck && ck.dataset.open) { openRow(rowOf(ck.dataset.open)); return; }
|
|
527
518
|
if (ck) {
|
|
@@ -1417,7 +1417,7 @@ button.dsn:hover{box-shadow:inset 0 0 0 1.5px rgb(79,109,245)}
|
|
|
1417
1417
|
@media (max-width:700px){
|
|
1418
1418
|
#vIns .crumb,#vInit .crumb{overflow:visible}
|
|
1419
1419
|
}
|
|
1420
|
-
.crumb .crst{display:inline-flex;align-items:center;gap:7px;padding:0 14px 0 12px;margin-left:4px}
|
|
1420
|
+
.crumb .crst,.crumb .cri.crst{width:auto;display:inline-flex;align-items:center;gap:7px;padding:0 14px 0 12px;margin-left:4px;color:var(--on-solid)}
|
|
1421
1421
|
.crst svg{width:15px;height:15px}
|
|
1422
1422
|
.crmenu{position:absolute;top:calc(100% + 8px);left:0;min-width:220px;padding:6px;border-radius:18px;background:var(--card-solid);border:1px solid var(--hair);box-shadow:0 24px 50px -20px rgba(30,32,60,.4);z-index:30;display:grid;gap:2px}
|
|
1423
1423
|
.crmenu[hidden]{display:none}
|
|
@@ -1809,9 +1809,7 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
1809
1809
|
.tkkb .dlink{margin-top:6px}
|
|
1810
1810
|
.dabt{margin:0;padding-left:18px;display:grid;gap:6px;color:var(--ink-2)}
|
|
1811
1811
|
|
|
1812
|
-
/* My work:
|
|
1813
|
-
.wrow.hc .wcta{grid-column:2;justify-self:start;margin-bottom:10px}
|
|
1814
|
-
.wcta{min-height:44px;padding:0 16px;border-radius:999px;background:var(--solid);color:var(--on-solid);font-size:13px;font-weight:650;white-space:nowrap}
|
|
1812
|
+
/* My work: the This week card. A row has no button of its own: the whole row opens the item, where every choice is made. */
|
|
1815
1813
|
.wkd{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
|
|
1816
1814
|
.wkc{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px 8px;border-radius:18px;border:1.5px solid transparent;font-size:12px;color:var(--ink-3)}
|
|
1817
1815
|
.wkc.now{border-color:var(--ink)}.wkc.past{opacity:.75}
|
|
@@ -1974,6 +1972,8 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
1974
1972
|
.dzcg{display:grid;grid-template-columns:1fr 1fr;gap:12px}
|
|
1975
1973
|
@media (max-width:700px){.dzcg{grid-template-columns:1fr}}
|
|
1976
1974
|
.dzch{margin-bottom:6px}
|
|
1975
|
+
|
|
1976
|
+
.rdbtns{display:inline-flex;gap:6px;align-items:center}
|
|
1977
1977
|
.wkd .wkc{font:400 12px var(--sans);letter-spacing:0;text-transform:none;padding:12px 4px 10px}
|
|
1978
1978
|
.wkc .wkl{font:500 11px var(--mono);letter-spacing:.08em}
|
|
1979
1979
|
.wkc .wkb{flex-direction:column-reverse;gap:3px;width:36px;height:100px;border-radius:12px;padding:0}.wkb i{flex:none;border-radius:4px}
|
|
@@ -906,6 +906,34 @@ async function load() {
|
|
|
906
906
|
else if (r.pending) setTimeout(load, 3000);
|
|
907
907
|
else if (r.refreshing) setTimeout(load, 10000);
|
|
908
908
|
}
|
|
909
|
+
/* ── Refresh and Sources, beside the Real data line: read the repositories again now, and see which source was read, which was not, and why ── */
|
|
910
|
+
const RDST = { read: ['fresh', 'Read'], 'not-read': ['failed', 'Not read'], 'not-included': ['off', 'Not included'], off: ['off', 'Off'] };
|
|
911
|
+
function sourcesHtml() {
|
|
912
|
+
const L = (M && M.header && M.header.sources) || [];
|
|
913
|
+
if (!L.length) return '<p class="note">The Briefing has not read anything yet.</p>';
|
|
914
|
+
const bad = L.filter((x) => x.state === 'not-read').length;
|
|
915
|
+
return `<div class="bd-top"><p>${bad ? bad + (bad === 1 ? ' source was' : ' sources were') + ' not read. Each reason is below.' : 'Every source was read.'}</p></div>`
|
|
916
|
+
+ L.map((x) => { const [c, w] = RDST[x.state] || ['off', x.state]; return `<div class="bd-src"><span><b>${esc(x.name)}</b><small><span class="bd-st ${c}">${w}</span></small><small>${esc(x.reason)}</small></span></div>`; }).join('')
|
|
917
|
+
+ '<p class="note">Refresh reads the included repositories again. Mail, Jira and the calendar are read by skills: refresh them under Around you, Data freshness.</p>';
|
|
918
|
+
}
|
|
919
|
+
async function pressRefresh(btn) {
|
|
920
|
+
if (btn.disabled) return;
|
|
921
|
+
btn.disabled = true; btn.textContent = 'Refreshing';
|
|
922
|
+
const ws = new URLSearchParams(location.search).get('ws');
|
|
923
|
+
const r = await pmPost('/api/briefing-premium/refresh' + (ws ? '?ws=' + encodeURIComponent(ws) : ''), {});
|
|
924
|
+
if (!r || !r.ok) { btn.disabled = false; btn.textContent = 'Refresh'; toast('Refresh did not start: ' + ((r && r.error) || 'the server did not answer') + '.'); return; }
|
|
925
|
+
toast(r.started && r.started.length ? 'Reading again: ' + r.started.join(', ') + '.' : r.already && r.already.length ? 'Already reading ' + r.already.join(', ') + '.' : 'No repository is included, so there is nothing to read.');
|
|
926
|
+
clearTimeout(RTIMER); RTIMER = setTimeout(async () => { await load(); btn.disabled = false; btn.textContent = 'Refresh'; }, 4000);
|
|
927
|
+
}
|
|
928
|
+
let RTIMER = null;
|
|
929
|
+
(function mountReal() {
|
|
930
|
+
const snap = $('#snap'); if (!snap) return;
|
|
931
|
+
const w = document.createElement('span'); w.className = 'rdbtns';
|
|
932
|
+
w.innerHTML = '<button type="button" class="fchip" id="rdRefresh" title="Read the included repositories again now">Refresh</button><button type="button" class="fchip" id="rdSources" aria-haspopup="dialog" title="Which source was read, which was not, and why">Sources</button>';
|
|
933
|
+
snap.insertAdjacentElement('afterend', w);
|
|
934
|
+
$('#rdRefresh').addEventListener('click', (e) => pressRefresh(e.currentTarget));
|
|
935
|
+
$('#rdSources').addEventListener('click', () => bdDlg('rd', 'Sources · real data', 'What the Briefing read', 'Which source was read, which was not, and why', M ? 'Each source below says whether it was read and, when it was not, the reason.' : 'The Briefing has not read anything yet.', sourcesHtml, () => {}));
|
|
936
|
+
})();
|
|
909
937
|
$('#brief').textContent = 'Reading the repository.';
|
|
910
938
|
load();
|
|
911
939
|
mountFirst(); // the "Your first Briefing" card, only when the page was opened with first=<import id> (initiative premium-welcome)
|