create-pmos 0.299.0 → 0.300.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/briefing-premium-metrics-test.js +1 -1
- package/workspace/guide/briefing-premium.md +4 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-briefing-depth-test.js +16 -0
- package/workspace/premium-studio-report-test.js +13 -0
- package/workspace/premium-studio-test.js +6 -2
- package/workspace/public/pm/premium-studio-design.js +31 -4
- package/workspace/public/pm/premium-studio.js +3 -2
- package/workspace/public/pm/premium.css +7 -0
- package/workspace/public/pm/premium.js +24 -3
- package/workspace/public/premium.html +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.300.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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T07:00:37Z"}
|
|
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-19T07:00:37Z"}
|
|
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-19T07:00:37Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -78,7 +78,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
78
78
|
{
|
|
79
79
|
const gap = metrics({ runs: null, commits: null, inits: null });
|
|
80
80
|
const R = await open({ answers: () => ready(gap) });
|
|
81
|
-
const t = await until(() => R.page.evaluate(() => [...document.querySelectorAll('#metBody .mt1')].map((x) => x.querySelector('.mval').textContent + '/' + x.querySelector('.mwk').textContent)));
|
|
81
|
+
const t = await until(async () => { const a = await R.page.evaluate(() => [...document.querySelectorAll('#metBody .mt1')].map((x) => x.querySelector('.mval').textContent + '/' + x.querySelector('.mwk').textContent)); return a.length ? a : null; }) || [];
|
|
82
82
|
ok('C2 a source that cannot be read says Not read and why, with no number and no chart', t.length === 4 && t.every((x) => x.startsWith('Not read/')) && /agent-runs\.jsonl could not be read in idpf/.test(t[0]) && !(await R.page.evaluate(() => document.querySelector('#metBody svg'))), JSON.stringify(t));
|
|
83
83
|
await R.ctx.close();
|
|
84
84
|
}
|
|
@@ -93,6 +93,8 @@ The pin on a row keeps it at the top for this session.
|
|
|
93
93
|
|
|
94
94
|
Today lists the day in time order: what is ahead, a marker for the time the data was read, and what came earlier. It has three sources: the calendar PMOS holds, merges to `main`, and agent runs. The filter button turns a source on or off. Press an item to read it.
|
|
95
95
|
|
|
96
|
+
Above the list, on the **Today** view, a ring shows how many of the meetings still ahead are prepped. A meeting is prepped when no open item is linked to it as "Before you go". The line names the meeting that is on now or next. The ring reads the same day as the console's. With no meeting left, or on **This week**, it is not shown.
|
|
97
|
+
|
|
96
98
|
### This week
|
|
97
99
|
|
|
98
100
|
The Today card has a **Today / This week** switch. **This week** lists the meetings of the current week from the calendar PMOS holds, grouped by day. It reads the week once when you press it; while it reads, the list says so. If the calendar cannot be read, the card says "Calendar not read" and gives the reason, and does not guess. A meeting in the past is shown dimmer. The switch changes only what the card shows and records nothing.
|
|
@@ -122,7 +124,7 @@ Under Today, the **Around you** card holds what the agents and the outside world
|
|
|
122
124
|
- **Agent proposals.** Every open draft of the Initiative Driver, for initiatives and for Work items, when the agent mode for that kind is Approve. **Keep** records that you accept it and applies it (a problem statement, a stage move, a next step). **Send back** needs a note and starts a new run. **Drop** counts as a correction. None of the three can be undone. A decided proposal stays in the list and says what was recorded.
|
|
123
125
|
- **Mentions.** The people who named you in Slack, Jira, Confluence or mail, from today's morning brief. The row names who waits on a reply. **Make it a task** adds one Work item. **Mark read** hides the mention, and **Mark unread** brings it back. **Open in Slack** (or Jira, Confluence, mail) opens the original in a new tab. Nothing here replies, reacts or posts. The Mentions dialog has no question box, because a mention has no agent thread.
|
|
124
126
|
- **Portfolio pulse.** How many initiatives are late or at risk, by the Calendar's own status: the promised date against the forecast, or the Jira read. It is read only and it is not a forecast of its own. **Open the initiative** goes to its page.
|
|
125
|
-
- **Horizon scan.** When the scan last ran, when it runs next, its reports and their proposals. Each proposal says what **Approve** does before you press it. **Dismiss** asks for a reason and counts as a correction, and **Undo** takes a dismissal back. **Scan now** starts an agent that reads the public web and the repository, and says how many manual scans are left. A scan that is switched off says so and the button stays off.
|
|
127
|
+
- **Horizon scan.** When the scan last ran, when it runs next, its reports and their proposals. Each proposal says what **Approve** does before you press it. **Dismiss** asks for a reason and counts as a correction, and **Undo** takes a dismissal back. **Scan now** starts an agent that reads the public web and the repository, and says how many manual scans are left. The row on the card says it too, before you open the dialog. A scan that is switched off says so and the button stays off.
|
|
126
128
|
- **Report found.** What the report finder found in your calendar, Slack and the subjects of mail you sent: each finding with its name, why, its evidence lines and how sure it is (Likely or Not sure). **Set up** creates the recurring report and drafts its first cycle on this machine. **Not a report** tells the finder not to raise it again. PMOS drafts only and nothing is sent. **Change first** and the finder settings stay in Insights and the console. A finder that is off says so.
|
|
127
129
|
- **Data freshness.** When each source was last read and its schedule. **Refresh** reads one source again. **Refresh all** reads every source except the repository. A source outside the machine is read by a skill, in an agent session, with your own connection. The page never says "up to date".
|
|
128
130
|
|
|
@@ -264,6 +266,7 @@ Insights is the fourth place on the rail, at `/premium-insights.html`. It reads
|
|
|
264
266
|
- **Change the size of the Studio.** On a wide window, **Normal**, **Half**, **3/4** and **Whole** sit beside **Library**. Whole is the full screen. At Half, the conversation and the Studio are two tabs. The Studio opens on Whole, and PMOS remembers your choice on this browser.
|
|
265
267
|
- **Shape a report's sections.** On a report drawn from your work, **Shape it in the Studio** opens Report mode on it. Tell PMOS how to shape the sections in your own words; PMOS proposes the next version and says what it changed. **Leave out** on a section makes the next version without it; the headline, Needs your call and Sources are always in. **Undo** goes back one version. **Use this structure** saves the version shown, and the next cycle follows it.
|
|
266
268
|
- **Design how a report looks.** A set-up report in the Studio has two tabs: **1 Structure** (what it says) and **2 Design** (how it looks). The Design tab shows the versions D1 to Dn, the slides of the one shown (a large preview, previous and next, and thumbnails), and the samples the look follows. **Add a file** (PDF, PowerPoint, Word or an image) or **Add the link** (Google or Confluence) adds a sample, and PMOS says what it took from it. Say how it should look, for example "use the theme of my picture", and PMOS makes the next version. Pick a version to look at it. **Undo** goes back one version. **This is it** saves the version shown as the design, and each new cycle is drawn to it. When you open a report again, both tabs show what was said before.
|
|
269
|
+
- **Choose a deck or a document, and read the design brief.** On the Design tab, the **Format** chip offers **Deck** and **Document** for the next version. Versions you already made keep their form. Once a design is saved, a **Design brief** chip shows what PMOS reads each cycle: your description, your samples, the reference version, and what stays the same, what changes and what PMOS learned. The cycles drafted to match it are checked on the report itself.
|
|
267
270
|
- **What stands out.** Up to three plain sentences taken from the series: behind its line for three readings in a row, behind and still moving away from the target, closing in, slipped, reached its target, or a large one-step move. There is no forecast and no cause.
|
|
268
271
|
- **No series recorded.** A KR metric with one reading or none is listed with the reason and is not drawn.
|
|
269
272
|
- **Ask PMOS to set up a report.** Type what the report is for and press **Ask**. A background run proposes a report and does nothing else. The request is listed as Working, then Ready to review. A ready request opens with its proposal: **Set it up**, **Change it** (say what to change; the run revises it), or **Cancel**.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.300.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.300.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -311,6 +311,22 @@ const GANTT = [
|
|
|
311
311
|
ok('W2 no POST carries a field the route was not told', extra.length === 0, JSON.stringify(extra));
|
|
312
312
|
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);
|
|
313
313
|
|
|
314
|
+
/* the Scan now status on the scan row, from the server's own manual count */
|
|
315
|
+
ok('RS1 the scan row says how many manual scans are left', / · (Scan now: \d+ of \d+ left today|Scan now is off here)$/.test(R0.scan.s), JSON.stringify(R0.scan));
|
|
316
|
+
|
|
317
|
+
/* P: the prep ring over Today, counted from the meetings the brief page holds */
|
|
318
|
+
const tm = (id, m, state, before) => ({ id, title: 'Meeting ' + id, start: iso(m), end: iso(m + 30), minutes: 30, people: [], initiative: null, prepared: false, before, state });
|
|
319
|
+
const TODAY = [tm('a', -90, 'past', []), tm('b', 20, 'next', []), tm('c', 120, 'later', [{ id: 'x1', title: 'Send the deck', due: null }]), tm('d', 200, 'later', [])];
|
|
320
|
+
await p.route('**/api/brief-page*', async (r) => { const res = await r.fetch(); const b = await res.json(); json(r, { ...b, today: TODAY }); });
|
|
321
|
+
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
322
|
+
await until(() => p.evaluate(() => { const c = document.querySelector('#prep'); return c && !c.hidden && /prepped/.test(c.textContent); }), 30000);
|
|
323
|
+
const prep = await p.evaluate(() => { const c = document.querySelector('#prep'); return { t: c.textContent, ring: !!c.querySelector('circle.rg'), l: c.querySelector('svg').getAttribute('aria-label') }; });
|
|
324
|
+
ok('PR1 the ring counts the meetings left and those with nothing to do before them', /Meeting b at \d\d:\d\d is next/.test(prep.t) && /3 meetings left today\. 2 of 3 prepped\./.test(prep.t) && prep.ring && prep.l === '2 of 3 prepped', JSON.stringify(prep));
|
|
325
|
+
await p.click('#rng [data-r="week"]');
|
|
326
|
+
await until(() => p.evaluate(() => document.querySelector('#prep').hidden));
|
|
327
|
+
ok('PR2 the ring is not shown on This week', await p.evaluate(() => document.querySelector('#prep').hidden));
|
|
328
|
+
await p.unroute('**/api/brief-page*');
|
|
329
|
+
|
|
314
330
|
/* L: floors */
|
|
315
331
|
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
|
|
316
332
|
await until(() => p.evaluate(() => document.querySelector('#aroundCap') && !/Reading…/.test(document.querySelector('#aroundBody').textContent)), 30000);
|
|
@@ -198,6 +198,12 @@ const model = async () => (await (await fetch(BASE + '/api/insights-premium')).j
|
|
|
198
198
|
await p.click('#oMain [data-st="rtab|design"]');
|
|
199
199
|
await until(() => chipv('dsv').then((v) => v === 'None yet'));
|
|
200
200
|
ok('D1 the Design tab opens with no version yet, and the tab is pressed', await chipv('dsv') === 'None yet' && await p.evaluate(() => (document.querySelector('#oMain .stsub [aria-pressed="true"]') || {}).textContent) === '2 Design' && await cta() === 'This is it:off', await chipv('dsv'));
|
|
201
|
+
await tap('#oMain [data-st="chip|dfmt"]'); await sleep(100);
|
|
202
|
+
const fmtBtns = () => p.evaluate(() => [...document.querySelectorAll('#stTr [data-st^="dzfmt|"]')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join());
|
|
203
|
+
ok('F5 the Format chip offers Deck and Document, on Deck, and no first description is posted', await chipv('dfmt') === 'Deck' && await fmtBtns() === 'Deck*,Document' && !posts.includes('/api/report-design/describe'), await fmtBtns());
|
|
204
|
+
await tap('#stTr [data-st="dzfmt|doc"]'); await sleep(200);
|
|
205
|
+
ok('F6 Document is chosen for the next version before any description exists, without a post', await chipv('dfmt') === 'Document' && !posts.includes('/api/report-design/describe'), await chipv('dfmt'));
|
|
206
|
+
await tap('#stTr [data-st="dzfmt|deck"]'); await sleep(200);
|
|
201
207
|
await tap('#oMain [data-st="chip|dsmp"]'); await sleep(100);
|
|
202
208
|
await p.setInputFiles('#dzFile', { name: 'sample.png', mimeType: 'image/png', buffer: Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', 'base64') });
|
|
203
209
|
ok('D2 a sample file is added and listed', await until(() => p.evaluate(() => /sample\.png/.test((document.querySelector('#stTr') || {}).textContent || '') || /Added "sample\.png"/.test(document.body.textContent)), 8000) && posts.includes('/api/report-design/sample'), posts.join());
|
|
@@ -208,6 +214,13 @@ const model = async () => (await (await fetch(BASE + '/api/insights-premium')).j
|
|
|
208
214
|
await tap('#oMain [data-st="save"]');
|
|
209
215
|
await until(() => chipv('dsv').then((v) => v === 'D1, saved'));
|
|
210
216
|
ok('D5 This is it saves D1 as the design, and is then not offered', await chipv('dsv') === 'D1, saved' && await cta() === 'This is it:off' && posts.includes('/api/report-design/accept'), await chipv('dsv'));
|
|
217
|
+
ok('B3 the Design brief chip appears once a design is saved, and not before', await chipv('dbr') === 'D1');
|
|
218
|
+
await tap('#oMain [data-st="chip|dbr"]'); await sleep(150);
|
|
219
|
+
const brTxt = await p.evaluate(() => (document.querySelector('#stTr') || {}).textContent || '');
|
|
220
|
+
ok('B4 the brief shows the description, the sample and the reference version', /make it clean and light/.test(brTxt) && /sample\.png/.test(brTxt) && /Reference version · D1/.test(brTxt), brTxt.slice(0, 300));
|
|
221
|
+
const nDesc = posts.filter((x) => x === '/api/report-design/describe').length;
|
|
222
|
+
await tap('#oMain [data-st="chip|dfmt"]'); await sleep(100); await tap('#stTr [data-st="dzfmt|doc"]'); await sleep(600);
|
|
223
|
+
ok('F7 with a description saved, choosing Document posts it with the format', posts.filter((x) => x === '/api/report-design/describe').length === nDesc + 1 && await chipv('dfmt') === 'Document', posts.join());
|
|
211
224
|
await shot('report-design-1280');
|
|
212
225
|
await p.click('#oMain [data-st="rtab|structure"]');
|
|
213
226
|
await until(() => chipv('ver').then((v) => /^S/.test(v)));
|
|
@@ -85,9 +85,13 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
|
|
|
85
85
|
ok('Z5 Normal is the dialog\'s own size', z.on === 'Normal' && z.w > 1000 && z.w < 1270 && !z.full, JSON.stringify(z));
|
|
86
86
|
await tap('#dExpand'); await sleep(300); z = await sz();
|
|
87
87
|
ok('Z6 the full-screen button of the dialog moves the size to Whole', z.on === 'Whole' && z.full, JSON.stringify(z));
|
|
88
|
-
await tap('#stSz [data-st="size|
|
|
88
|
+
await tap('#stSz [data-st="size|three-quarters"]'); await sleep(300);
|
|
89
89
|
await shut(); await open('#pdNew'); z = await sz();
|
|
90
|
-
ok('Z7 the size is kept for the next time', z.on === '
|
|
90
|
+
ok('Z7 the size is kept for the next time', z.on === '3/4' && !z.full, JSON.stringify(z));
|
|
91
|
+
await tap('#stSz [data-st="size|half"]'); await sleep(500);
|
|
92
|
+
ok('Z8 the Detail / Conversation switch shows its pill at Half', await p.evaluate(() => { const b = document.querySelector('#dTabs .pill'); return !!b && b.getBoundingClientRect().width > 20; }));
|
|
93
|
+
await shut(); await open('#pdNew'); z = await sz();
|
|
94
|
+
ok('Z9 Half is not kept: the Studio opens on Whole, with its conversation beside it', z.on === 'Whole' && z.full, JSON.stringify(z));
|
|
91
95
|
await tap('#stSz [data-st="size|whole"]'); await sleep(300);
|
|
92
96
|
|
|
93
97
|
/* C: the conversation */
|
|
@@ -22,7 +22,9 @@ export function useStudio(x) { X = x; }
|
|
|
22
22
|
const hand = () => X.P.design;
|
|
23
23
|
|
|
24
24
|
/* ── the state of one report's design, kept on its draft: d.D = { design, err, loading, shown, ver: Map, i } ── */
|
|
25
|
-
export function fresh() { return { design: null, err: '', loading: false, shown: null, ver: new Map(), i: 0, working: false, link: '' }; }
|
|
25
|
+
export function fresh() { return { fmt: null, design: null, err: '', loading: false, shown: null, ver: new Map(), i: 0, working: false, link: '' }; }
|
|
26
|
+
const FMTN = { deck: 'Deck', doc: 'Document' };
|
|
27
|
+
const fmtOf = (z) => z.fmt || (z.design && z.design.format) || 'deck';
|
|
26
28
|
const saved = (z) => (z.design && z.design.saved ? z.design.saved.version : null);
|
|
27
29
|
const versions = (z) => (z.design && z.design.versions) || [];
|
|
28
30
|
const slidesOf = (z) => { const r = z.ver.get(z.shown); return r ? r.slides.map((s) => ({ k: 'frame', h: s.h, html: s.html, css: r.style })) : []; };
|
|
@@ -34,6 +36,7 @@ export async function load(d) {
|
|
|
34
36
|
z.loading = false;
|
|
35
37
|
if (!res || res.ok !== true) { z.err = (res && res.error) || 'The design of this report could not be read.'; X.draw(); return; }
|
|
36
38
|
z.design = res.design; z.err = '';
|
|
39
|
+
if (!z.fmt || !versions(z).length) z.fmt = z.design.format || 'deck';
|
|
37
40
|
const cur = z.design.current != null ? z.design.current : saved(z);
|
|
38
41
|
if (z.shown == null) z.shown = cur;
|
|
39
42
|
if (z.shown != null) await read(z, z.shown);
|
|
@@ -72,11 +75,12 @@ export async function openTab(d, tab) {
|
|
|
72
75
|
/* ── the brief, tray, preview, checks, footer ── */
|
|
73
76
|
export function brief(d) {
|
|
74
77
|
const z = d.Z, c = X.chip, n = saved(z), v = versions(z);
|
|
75
|
-
return `<div class="stbr" role="group" aria-label="Brief">${tabs(d)}${c('dfmt', 'Format', z.loading ? 'Reading' :
|
|
78
|
+
return `<div class="stbr" role="group" aria-label="Brief">${tabs(d)}${c('dfmt', 'Format', z.loading ? 'Reading' : FMTN[fmtOf(z)])}${c('dsmp', 'Samples', z.loading ? 'Reading' : String(((z.design || {}).samples || []).length))}${n != null ? c('dbr', 'Design brief', 'D' + n) : ''}${c('dsv', 'Design', z.loading ? 'Reading' : n == null ? (v.length ? 'D' + (z.shown || v[v.length - 1].n) + ', not saved' : 'None yet') : 'D' + n + ', saved')}</div>`;
|
|
76
79
|
}
|
|
77
80
|
export function tray(d, p) {
|
|
78
81
|
const z = d.Z, S = (z.design || {}).samples || [];
|
|
79
|
-
if (p === 'dfmt') return
|
|
82
|
+
if (p === 'dfmt') return `<div class="stmd" role="group" aria-label="Report type">${['deck', 'doc'].map((f) => `<button type="button" data-st="dzfmt|${f}" aria-pressed="${fmtOf(z) === f}"${z.working || z.loading ? ' disabled' : ''}>${FMTN[f]}</button>`).join('')}</div><p class="note">The next version is ${fmtOf(z) === 'deck' ? 'a slide deck' : 'a document'}. Versions you already made keep their form.</p>`;
|
|
83
|
+
if (p === 'dbr') return briefHtml(z);
|
|
80
84
|
if (p === 'dsmp') {
|
|
81
85
|
return (S.length ? `<ul class="sul">${S.map((s) => `<li><span>${esc(s.name)}<small>${esc(s.line || SWORD[s.kind] || s.kind)}${s.hint ? '. ' + esc(s.hint) : ''}</small>${s.took ? `<small>PMOS took: ${esc(s.took)}</small>` : s.readable === false ? '<small>PMOS could not read it with your tools. It is kept, but it does not shape the design.</small>' : '<small>PMOS reads it on the next version.</small>'}</span></li>`).join('')}</ul>` : '<p class="note">No sample yet. A sample is a deck, a document or a picture of how you want it to look.</p>')
|
|
82
86
|
+ `<div class="sor"><button type="button" class="dmcta alt" data-st="dzpick"${z.working ? ' disabled' : ''}>${PLUS}Add a file</button><input type="file" id="dzFile" hidden accept=".pdf,.pptx,.docx,.png,.jpg,.jpeg"></div>`
|
|
@@ -88,6 +92,18 @@ export function tray(d, p) {
|
|
|
88
92
|
}
|
|
89
93
|
return '';
|
|
90
94
|
}
|
|
95
|
+
/* The saved design as a brief, not a template: what PMOS reads each cycle (the console's Design brief). Every line is a field of the saved design. */
|
|
96
|
+
function briefHtml(z) {
|
|
97
|
+
const g = z.design || {}, n = saved(z); if (n == null) return '';
|
|
98
|
+
const rules = g.rules || {}, S = g.samples || [];
|
|
99
|
+
const rule = (h, xs) => (xs && xs.length ? `<p class="note"><b>${h}</b></p><ul class="sul">${xs.map((x) => `<li><span>${esc(x)}</span></li>`).join('')}</ul>` : '');
|
|
100
|
+
return `<p class="note">Written by PMOS from your Studio session. It is not a template: PMOS reads it each cycle and drafts to match it. Saved ${esc(String(g.saved.at || '').slice(0, 10))}, version D${n}.</p>`
|
|
101
|
+
+ `<p class="note"><b>Your description</b></p><blockquote class="note">${esc(g.description || 'No description.')}</blockquote>`
|
|
102
|
+
+ `<p class="note"><b>Your samples</b></p>${S.length ? `<ul class="sul">${S.map((x) => `<li><span>${esc(x.name)}<small>${esc(x.line || SWORD[x.kind] || x.kind)}</small>${x.took ? `<small>PMOS took: ${esc(x.took)}</small>` : ''}</span></li>`).join('')}</ul>` : '<p class="note">No sample.</p>'}`
|
|
103
|
+
+ `<p class="note"><b>Reference version · D${n}</b></p><div class="sor"><button type="button" class="dmcta alt" data-st="dzver|${n}"${z.working ? ' disabled' : ''}>Show D${n}</button></div>`
|
|
104
|
+
+ (rule('Keeps the same each cycle', rules.same) + rule('Changes each cycle', rules.changes) + rule('Learned from your turns', rules.learned) || '<p class="note">PMOS has not written down what it learned yet.</p>')
|
|
105
|
+
+ '<p class="note">Cycles drafted to match it are checked on the report itself. Nothing is sent.</p>';
|
|
106
|
+
}
|
|
91
107
|
export function preview(d) {
|
|
92
108
|
const z = d.Z;
|
|
93
109
|
if (z.loading) return '<div class="stpvw"><p class="note">Reading the design of this report.</p></div>';
|
|
@@ -123,10 +139,21 @@ export async function press(d, a) {
|
|
|
123
139
|
const [k, v] = a, z = d.Z;
|
|
124
140
|
if (k === 'dzgo') { z.i = +v; X.draw(['pv']); afterDraw(); const s = $('#dzSlide'); if (s) s.focus(); return; }
|
|
125
141
|
if (k === 'dzver') { await show(d, +v, true); return; }
|
|
142
|
+
if (k === 'dzfmt') { await setFmt(d, v); return; }
|
|
126
143
|
if (k === 'dzkeep') { await keep(d); return; }
|
|
127
144
|
if (k === 'dzpick') { const f = $('#dzFile'); if (f) f.click(); return; }
|
|
128
145
|
if (k === 'dzlink') { const i = $('#dzLink'); const link = i ? i.value.trim() : ''; if (!link) { X.st.msg = 'Paste a link first.'; X.draw(['ft']); return; } await sample(d, { link }); }
|
|
129
146
|
}
|
|
147
|
+
async function setFmt(d, f) {
|
|
148
|
+
const z = d.Z, g = z.design; if (z.working || z.fmt === f) return;
|
|
149
|
+
z.fmt = f;
|
|
150
|
+
if (g && g.description && g.format !== f) {
|
|
151
|
+
const r = await hand().post('describe', d.id, { text: g.description, format: f });
|
|
152
|
+
if (!r || r.ok !== true) { X.st.msg = 'The format was not changed: ' + ((r && r.error) || 'the press did not go through.'); X.draw(['br', 'tr', 'ft']); return; }
|
|
153
|
+
}
|
|
154
|
+
X.draw(['br', 'tr']);
|
|
155
|
+
X.say('The next version is ' + (f === 'deck' ? 'a slide deck' : 'a document') + '. Tell me what to change, and I make it.');
|
|
156
|
+
}
|
|
130
157
|
async function show(d, n, pick) {
|
|
131
158
|
const z = d.Z;
|
|
132
159
|
if (pick && z.design && z.design.current !== n) {
|
|
@@ -177,7 +204,7 @@ export async function turn(d, t, low) {
|
|
|
177
204
|
if (z.loading) return 'Reading the design. Try again in a moment.';
|
|
178
205
|
z.working = true; X.draw();
|
|
179
206
|
if (z.design && !z.design.description && !(z.design.versions || []).length) {
|
|
180
|
-
const r0 = await hand().post('describe', d.id, { text: t });
|
|
207
|
+
const r0 = await hand().post('describe', d.id, { text: t, format: fmtOf(z) });
|
|
181
208
|
if (!r0 || r0.ok !== true) { z.working = false; X.draw(); return 'The description was not saved: ' + ((r0 && r0.error) || 'the press did not go through.'); }
|
|
182
209
|
}
|
|
183
210
|
const before = ((z.design && z.design.log) || []).length;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* report to shape, or null), tile (the page's chart tile), derive (a measure's chart and a draft → the draft's chart), save (dashboard
|
|
11
11
|
* body → answer), saveChart (chart body → answer), setup (report-setups route, body → answer), structure ({ get(id), post(route, id,
|
|
12
12
|
* body) } → answer), reportsChanged (), done (saved dashboard id | null) } */
|
|
13
|
-
import { $, esc, openDlg, closeDlg, toast, turnA, turnU, ptx, setFull } from './premium-shell.js';
|
|
13
|
+
import { $, esc, openDlg, closeDlg, toast, turnA, turnU, ptx, setFull, setTab } from './premium-shell.js';
|
|
14
14
|
import * as REP from './premium-studio-report.js';
|
|
15
15
|
|
|
16
16
|
const ICO = (p) => `<svg class="i" viewBox="0 0 24 24">${p}</svg>`;
|
|
@@ -22,7 +22,7 @@ const MAX_UNDO = 30;
|
|
|
22
22
|
const SIZE_KEY = 'pmos.premium.studio-size';
|
|
23
23
|
const SIZES = [['normal', 'Normal', 'The usual size'], ['half', 'Half', 'Half of the window'], ['three-quarters', '3/4', 'Three-quarters of the window'], ['whole', 'Whole', 'The whole window']];
|
|
24
24
|
const sizeOk = (v) => SIZES.some((x) => x[0] === v);
|
|
25
|
-
const sizeGet = () => { try { const v = localStorage.getItem(SIZE_KEY); return sizeOk(v) ? v : 'whole'; } catch { return 'whole'; } };
|
|
25
|
+
const sizeGet = () => { try { const v = localStorage.getItem(SIZE_KEY); return sizeOk(v) && v !== 'half' ? v : 'whole'; } catch { return 'whole'; } }; // Half puts the conversation behind a tab, so it is never the size the Studio opens at
|
|
26
26
|
const sizeSet = (v) => { try { localStorage.setItem(SIZE_KEY, v); } catch { /* no storage */ } };
|
|
27
27
|
const sizeNow = () => { const d = $('#dlg'); return d.classList.contains('full') ? 'whole' : d.classList.contains('sz-half') ? 'half' : d.classList.contains('sz-three-quarters') ? 'three-quarters' : 'normal'; };
|
|
28
28
|
const sizeHtml = () => `<span class="stsz" role="group" aria-label="Size of the Studio">${SIZES.map(([k, l, t]) => `<button type="button" class="lk" data-st="size|${k}" aria-pressed="${sizeNow() === k}" title="${t}" aria-label="${t}">${l}</button>`).join('')}</span>`;
|
|
@@ -31,6 +31,7 @@ function setSize(k) {
|
|
|
31
31
|
setFull(k === 'whole');
|
|
32
32
|
if (k === 'half' || k === 'three-quarters') d.classList.add('sz-' + k);
|
|
33
33
|
sizeSet(k); syncSize();
|
|
34
|
+
requestAnimationFrame(() => setTab($('#dGrid').dataset.tab || 'out')); // the Detail / Conversation switch is measured once it shows
|
|
34
35
|
}
|
|
35
36
|
function syncSize() { const e = $('#stSz'); if (e) e.innerHTML = sizeHtml(); }
|
|
36
37
|
const MODES = { chart: 'Chart', dash: 'Dashboard', rep: 'Report' };
|
|
@@ -1936,6 +1936,13 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
1936
1936
|
.dscr>div:first-child{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
|
|
1937
1937
|
.dscr small{font:12px var(--mono);color:var(--ink-3);overflow-wrap:anywhere}
|
|
1938
1938
|
.dscr .lk{justify-self:start;min-height:44px;display:inline-flex;align-items:center}
|
|
1939
|
+
|
|
1940
|
+
.prep{display:flex;align-items:center;gap:14px;margin:10px 0 2px;padding:10px 14px;border-radius:var(--r-in);background:var(--well)}
|
|
1941
|
+
.prep[hidden]{display:none}
|
|
1942
|
+
.prep svg{flex:none}.prep .rt{fill:var(--ink);font:700 11px var(--mono);text-anchor:middle}
|
|
1943
|
+
.prep .rb{stroke:var(--hair)}.prep .rg{stroke:var(--ember);transition:stroke-dasharray .6s var(--ease)}
|
|
1944
|
+
.prep b{display:block;font-size:var(--t-small);font-weight:650}.prep span{display:block;font-size:var(--t-small);color:var(--ink-3)}
|
|
1945
|
+
|
|
1939
1946
|
.lgdf{margin-top:6px;white-space:pre-wrap;overflow-wrap:anywhere}.lgdf del{color:var(--bad);text-decoration:line-through}
|
|
1940
1947
|
.evl .hsr .lk{grid-column:2;justify-self:start;min-height:44px;display:inline-flex;align-items:center}.evl .hsr .dsdf{grid-column:2}
|
|
1941
1948
|
|
|
@@ -79,8 +79,20 @@ const ALL = () => M.today.ahead.concat(M.today.earlier);
|
|
|
79
79
|
function drawChips() {
|
|
80
80
|
$('#srcChips').innerHTML = Object.entries(SRC).filter(([k]) => k !== 'digest' || M.today.counts.digest).map(([k, n]) => `<button class="fchip" data-k="${k}" aria-pressed="${on.has(k)}">${n}<em>${M.today.counts[k] || 0}</em></button>`).join('');
|
|
81
81
|
}
|
|
82
|
+
/** The prep ring: of the meetings still ahead today, how many have nothing left to do before them. Counts from /api/brief-page rows (`before` is the open items linked to a meeting). */
|
|
83
|
+
let PREP = null;
|
|
84
|
+
function drawPrep() {
|
|
85
|
+
const c = $('#prep'); if (!c) return;
|
|
86
|
+
const p = PREP, t = p && p.ok ? p.today || [] : [], left = t.filter((m) => m.state !== 'past'), ok = left.filter((m) => !(m.before || []).length).length;
|
|
87
|
+
if (!left.length || document.querySelector('#todayCard.wkm')) { c.hidden = true; return; }
|
|
88
|
+
const cur = t.find((m) => m.state === 'now'), nxt = cur || t.find((m) => m.state === 'next'), R = 17, C = 2 * Math.PI * R;
|
|
89
|
+
c.innerHTML = `<svg width="44" height="44" viewBox="0 0 44 44" role="img" aria-label="${ok} of ${left.length} prepped"><circle class="rb" cx="22" cy="22" r="${R}" fill="none" stroke-width="6"/><circle class="rg" cx="22" cy="22" r="${R}" fill="none" stroke-width="6" stroke-linecap="round" stroke-dasharray="${(C * ok / left.length).toFixed(2)} ${C.toFixed(2)}" transform="rotate(-90 22 22)"/><text class="rt" x="22" y="26">${ok}/${left.length}</text></svg><div>${nxt ? `<b>${esc(nxt.title)}${cur ? ' is on now' : ' at ' + pHm(nxt.start) + ' is next'}</b>` : ''}<span>${pl(left.length, 'meeting', 'meetings')} left today. ${ok} of ${left.length} prepped.</span></div>`;
|
|
90
|
+
c.hidden = false;
|
|
91
|
+
}
|
|
92
|
+
async function readPrep() { PREP = await briefPage(); drawPrep(); }
|
|
82
93
|
function drawTl() {
|
|
83
|
-
if (week.draw()) return;
|
|
94
|
+
if (week.draw()) { drawPrep(); return; }
|
|
95
|
+
drawPrep();
|
|
84
96
|
const T = M.today, all = ALL(), ahead = T.ahead.filter((e) => on.has(e.kind)), early = T.earlier.filter((e) => on.has(e.kind));
|
|
85
97
|
$('#todayCap').textContent = `${early.length} earlier · ${ahead.length} ahead`;
|
|
86
98
|
$('#tl').innerHTML = `<div class="grp">Ahead</div>${ahead.length ? ahead.map((e) => evHtml(e, all.indexOf(e))).join('') : '<div class="empty">Nothing ahead in these sources.</div>'}<div class="nowl">${esc(T.now.t)} · ${esc(T.now.label)}</div><div class="grp" style="padding-top:6px">Earlier today</div><div class="early">${early.length ? early.map((e) => evHtml(e, all.indexOf(e))).join('') : `<div class="empty">${esc(T.note || 'Nothing yet in these sources.')}</div>`}</div>`;
|
|
@@ -442,6 +454,15 @@ const behindSrc = () => {
|
|
|
442
454
|
};
|
|
443
455
|
const joinN = (a) => (a.length < 2 ? a.join('') : a.slice(0, -1).join(', ') + ' and ' + a[a.length - 1]);
|
|
444
456
|
|
|
457
|
+
/** What Scan now may do right now, in the server's own words: the manual scans left today, or why it cannot start. Empty when the server says neither. */
|
|
458
|
+
function scanNowLine(S) {
|
|
459
|
+
if (S.length && S.every((x) => x.switched_off)) return ' · Scan now is off here';
|
|
460
|
+
const M = S.map((x) => x.manual).filter((m) => m && m.limit);
|
|
461
|
+
if (!M.length) { const no = S.map((x) => x.manual).find((m) => m && m.ok === false && m.error); return no ? ' · ' + no.error : ''; }
|
|
462
|
+
const left = M.reduce((n, m) => n + (m.left || 0), 0), lim = M.reduce((n, m) => n + m.limit, 0);
|
|
463
|
+
return M.every((m) => m.ok === false) ? ' · Scan now: ' + (M[0].error || 'not now') : ' · Scan now: ' + left + ' of ' + lim + ' left today';
|
|
464
|
+
}
|
|
465
|
+
|
|
445
466
|
/** The six rows of the card: { k, ic, t, s, m (count html), bar, wait }. Pure of the DOM; every word comes from A. */
|
|
446
467
|
function aroundRows() {
|
|
447
468
|
const R = [], rd = 'Reading…';
|
|
@@ -469,7 +490,7 @@ function aroundRows() {
|
|
|
469
490
|
const a = A.scan, S = a && a.ok ? a.scans : [], w = scanOpen(), run = S.some((x) => x.open), last = S.map((x) => x.last && x.last.at).filter(Boolean).sort().pop(), nrep = S.reduce((n, x) => n + x.reports.filter((r) => r.written && !r.parent).length, 0);
|
|
470
491
|
R.push({ k: 'scan', ic: BDI.scan, wait: w > 0,
|
|
471
492
|
t: !a ? rd : !a.ok ? 'Horizon scan ' + said(a) : run ? 'Horizon scan: scanning now' : w ? 'Horizon scan: ' + pl(w, 'proposal waits', 'proposals wait') + ' for you' : S.every((x) => x.switched_off) ? 'Horizon scan: switched off' : last ? 'Horizon scan: nothing waits' : 'Horizon scan: no scan has run yet',
|
|
472
|
-
s: !a || !a.ok ? '' : run ? 'Reading the web and the repository' : last ? 'Ran ' + dayWord(last).toLowerCase() + (nrep ? ' · ' + pl(nrep, 'report', 'reports') : '') : 'Start one from here', m: w ? `<span class="due">${w}</span>` : '' });
|
|
493
|
+
s: !a || !a.ok ? '' : run ? 'Reading the web and the repository' : (last ? 'Ran ' + dayWord(last).toLowerCase() + (nrep ? ' · ' + pl(nrep, 'report', 'reports') : '') : 'Start one from here') + scanNowLine(S), m: w ? `<span class="due">${w}</span>` : '' });
|
|
473
494
|
}
|
|
474
495
|
{ // report found
|
|
475
496
|
const a = A.rep, L = repFound(), n = L.length, fd = a && a.ok ? a.prods.map((q) => q.finder).filter(Boolean) : [], off = fd.length > 0 && fd.every((x) => x.cadence === 'off'), nx = fd.map((x) => x.next_run).filter(Boolean).sort()[0];
|
|
@@ -876,7 +897,7 @@ async function load() {
|
|
|
876
897
|
$('#brief').textContent = 'The Briefing could not read the repository, so it shows nothing rather than guess.' + (r && r.error ? ' The reason: ' + r.error : status ? ' (the server answered ' + status + ')' : ' The server did not answer.');
|
|
877
898
|
return;
|
|
878
899
|
}
|
|
879
|
-
M = r.model; drawHero(); drawRows(); drawChips(); drawTl(); drawDock(); drawPick(); onScroll();
|
|
900
|
+
M = r.model; drawHero(); drawRows(); drawChips(); drawTl(); readPrep(); drawDock(); drawPick(); onScroll();
|
|
880
901
|
if (!AROUND) { AROUND = true; readAll(); setInterval(() => { if (!document.hidden && !$('#dlg').classList.contains('on')) readAll(); }, 300000); }
|
|
881
902
|
const age = Date.now() - r.as_of;
|
|
882
903
|
if (age > 5 * 60000) $('#snap').textContent += ' · read ' + ago(age) + (r.refreshing ? ', refreshing' : '');
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
<section class="card rise" id="todayCard" style="--d:7" aria-labelledby="hToday">
|
|
70
70
|
<div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg></span><h2 id="hToday">Today</h2><div class="seg" id="rng" role="group" aria-label="Range"><button type="button" data-r="today" aria-pressed="true">Today</button><button type="button" data-r="week" aria-pressed="false">This week</button></div><small id="todayCap"></small><button class="fbtn" data-opts="todayOpts" aria-expanded="false" aria-controls="todayOpts" aria-label="Filter sources"><svg class="i" viewBox="0 0 24 24"><path d="M4 7h9M17 7h3M4 17h3M11 17h9"/><circle cx="15" cy="7" r="2"/><circle cx="9" cy="17" r="2"/></svg></button></div>
|
|
71
71
|
<p class="rcap" id="rcap" hidden></p>
|
|
72
|
+
<div class="prep" id="prep" hidden></div>
|
|
72
73
|
<div class="opts" id="todayOpts" inert><div><div class="chips" id="srcChips" role="group" aria-label="Sources"></div></div></div>
|
|
73
74
|
<div class="tl" id="tl" role="group" aria-label="Today. Use the up and down arrow keys to move between rows."></div>
|
|
74
75
|
</section>
|