create-pmos 0.235.0 → 0.236.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.235.0",
3
+ "version": "0.236.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": {
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@a744ae0
1
+ kernel-source: pmos@d874247
2
2
  assembled: 2026-10-14
3
3
  mode: vendor
@@ -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-14T09:56:46Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-14T10:47:28Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-10-14T09:56:46Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-14T10:47:28Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-10-14T09:56:46Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-14T10:47:28Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -138,16 +138,33 @@ const DOC = 'planning/reports/rs1/2026-10-21.md';
138
138
  await page.click('[data-rd-act="mksave"]');
139
139
  ok('the marker is numbered on the preview and listed under Point and say', !!(await until(() => page.$('[data-rd-mk]'))) && (await page.$$('[data-rd-mkrow]')).length === 1 && /Make this title smaller/.test(await text('[data-rd-point]')));
140
140
  await shot(page, 'design-point-1440');
141
+ /* the slide and its thumbnails are not rebuilt by a paint: a frame put back in the page loads again, and that was the flicker */
142
+ const tagFrames = () => page.$$eval('[data-rd-preview] iframe', (fs) => fs.forEach((f) => { f.__kept = 1; }));
143
+ const framesKept = () => page.$$eval('[data-rd-preview] iframe', (fs) => fs.length > 2 && fs.every((f) => f.__kept === 1));
144
+ await tagFrames();
141
145
  await page.fill('[data-rd-in]', 'Make it dense');
142
146
  await page.click('[data-rd-act="send"]');
143
147
  const turn = await until(() => sent('/api/report-design/turn')[0]);
144
148
  ok('a turn posts the words and the markers as points', !!turn && turn.body.text === 'Make it dense' && Array.isArray(turn.body.points) && turn.body.points.length === 1 && turn.body.points[0].text === 'Make this title smaller' && turn.body.points[0].n === 1 && typeof turn.body.points[0].slide === 'string', JSON.stringify(turn && turn.body));
145
149
  ok('while the job runs the conversation shows PMOS working', !!(await until(() => page.$('[data-rd-running]'), 3000)));
146
- ok('the job lands D4 as the current version, with its PMOS line', !!(await until(async () => await page.getAttribute('[data-rd-v="4"]', 'aria-pressed') === 'true', 8000)) && /D4:/.test(await text('[data-rd-chat]')));
150
+ await page.$eval('[data-rd-in]', (t) => { t.__kept = 1; });
151
+ await page.type('[data-rd-in]', 'next');
152
+ await sleep(3200);
153
+ ok('while the job runs the slide and its thumbnails stay in place: the reads of the design rebuild no frame', await framesKept());
154
+ ok('while the job runs the box you type in is not rebuilt and keeps your words', await page.$eval('[data-rd-in]', (t) => t.__kept === 1 && t.value === 'next'));
155
+ await page.fill('[data-rd-in]', '');
156
+ ok('the job lands D4 as the current version, with its PMOS line', !!(await until(async () => await page.getAttribute('[data-rd-v="4"]', 'aria-pressed') === 'true', 15000)) && /D4:/.test(await text('[data-rd-chat]')));
147
157
  ok('the markers are cleared after the turn', (await page.$$('[data-rd-mkrow]')).length === 0);
158
+ await until(() => page.$('[data-rd-sstrip] [data-rd-sgo="1"]'));
159
+ await tagFrames();
160
+ const bigBefore = await page.getAttribute('[data-rd-sbig]', 'data-rd-sbig');
161
+ await page.click('[data-rd-sstrip] [data-rd-sgo="1"]');
162
+ ok('picking a thumbnail changes the slide and keeps the thumbnails as they were', !!(await until(async () => (await page.getAttribute('[data-rd-sbig]', 'data-rd-sbig')) !== bigBefore))
163
+ && await page.getAttribute('[data-rd-sgo="1"]', 'aria-current') === 'true' && await page.$$eval('[data-rd-sstrip] iframe', (fs) => fs.length > 1 && fs.every((f) => f.__kept === 1)));
164
+ await page.click('[data-rd-sstrip] [data-rd-sgo="0"]');
148
165
  await page.fill('[data-rd-in]', 'This turn should fail');
149
166
  await page.click('[data-rd-act="send"]');
150
- ok('a failed job shows an error line and makes no version', !!(await until(() => page.$('[data-rd-log="error"]'), 8000)) && (await page.$$('[data-rd-v]')).length === 4);
167
+ ok('a failed job shows an error line and makes no version', !!(await until(() => page.$('[data-rd-log="error"]'), 15000)) && (await page.$$('[data-rd-v]')).length === 4);
151
168
 
152
169
  /* compare (#design-compare) */
153
170
  await page.click('[data-rd-act="cmp"]');
@@ -185,7 +202,7 @@ const DOC = 'planning/reports/rs1/2026-10-21.md';
185
202
  await page.click('[data-rd-act="send"]');
186
203
  const desc = await until(() => sent('/api/report-design/describe')[0]);
187
204
  ok('the first words are posted as the description with the format, then a turn', !!desc && desc.body.id === 'rg0' && /decisions first/.test(desc.body.text) && desc.body.format === 'deck' && !!(await until(() => sent('/api/report-design/turn').some((t) => t.body.id === 'rg0'))));
188
- ok('D1 arrives', !!(await until(() => page.$('[data-rd-v="1"]'), 8000)));
205
+ ok('D1 arrives', !!(await until(() => page.$('[data-rd-v="1"]'), 15000)));
189
206
  await closeAll(page);
190
207
 
191
208
  /* a document design (#design-doc), then This is it */
@@ -23,7 +23,7 @@ Use one of these two buttons:
23
23
  1. Select **Deck** or **Document** at the top of the studio.
24
24
  2. Write what the report is for and who reads it. For example: "This goes to the progress session every other Thursday. The decisions must stand out."
25
25
  3. Press **Add a sample** to give PMOS a report that people liked. You can upload a file, paste a link, add a page from Chrome (see below), or pick a report document that PMOS has. Each sample shows what PMOS took from it. PMOS reads a link from Google Slides, Docs or Sheets, or from Confluence, through your own connectors. It saves the words and the structure (slide titles, order, sections and tables), and it changes nothing in the file. It does not get the look. To match the look, also add the file as a PDF or a screenshot. For Google Slides, choose **File**, **Download**, **PDF document (.pdf)** in Slides, then add that file. If your connectors cannot read the link, the sample says so. Any other link is kept by its address, and PMOS cannot open it. PMOS sees the pages of a PDF or an image, so it can follow their look. From a .pptx or a .docx, PMOS gets only the words.
26
- 4. Press **Make the next version**. PMOS makes a version from your words and this cycle's data. This takes a short time. You can leave the studio. The studio shows when the version is ready.
26
+ 4. Press **Make the next version**. PMOS makes a version from your words and this cycle's data. This takes a short time. You can leave the studio. The studio shows when the version is ready. While PMOS works, the version on screen and its slides stay as they are, and you can keep reading it or write your next turn.
27
27
  5. Read the version in the preview. Write what to change and press **Make the next version** again. Each turn makes a new version: D1, D2, D3 and so on.
28
28
 
29
29
  To set the width of the studio, use **Half**, **3/4** or **Whole** at the top right. PMOS keeps your choice on this computer.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.235.0",
3
+ "version": "0.236.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.235.0",
9
+ "version": "0.236.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.235.0",
3
+ "version": "0.236.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -7,7 +7,7 @@
7
7
  * The data is the mockup's: the MySPH & Identity Platform biweekly update (set-up rs1) has a saved deck design, versions D1 to D3 made from
8
8
  * the Wed 21 Oct draft, two samples, a conversation, two designed cycles (Wed 21 Oct differs: Usage-based billing got its own slide; Wed 7 Oct
9
9
  * matches), speaker notes carried forward from 7 Oct and four notes on the slides. The Monthly OOH x Digital review (rs3) has a document
10
- * design in progress (D1, D2, not saved). Any other set-up starts with no design. A turn runs 1.5 seconds and lands the next version; a turn
10
+ * design in progress (D1, D2, not saved). Any other set-up starts with no design. A turn runs 4 seconds and lands the next version; a turn
11
11
  * whose words say "fail" lands an error line instead. The renders follow the HTML contract (one <style>, pmos-slide or pmos-sec sections, the
12
12
  * data attributes); their colours are the slide tokens the frame links. Nothing is saved anywhere and nothing is sent. */
13
13
 
@@ -249,9 +249,9 @@ function versionHtml(id, D, v) {
249
249
  const s = ctx.setups().find((x) => x.id === id) || { name: id }; const d = curDoc(id);
250
250
  return genericHtml(v.format, s.name, sectionsOf(d ? ctx.docText(d.path) : ''), v.step || 1);
251
251
  }
252
- /* a job lands when its 1.5 seconds are up (read on each GET) */
252
+ /* a job lands when its 4 seconds are up (read on each GET): the studio reads the design more than once while it runs, as with a real job */
253
253
  function settle(id) {
254
- const D = DESIGNS[id]; if (!D || !D.running || performance.now() - D.running.t0 < 1500) return;
254
+ const D = DESIGNS[id]; if (!D || !D.running || performance.now() - D.running.t0 < 4000) return;
255
255
  const t = D.running.turn; const pts = D.running.points || []; D.running = null;
256
256
  if (/\bfail\b/i.test(t)) { D.log.push({ at: nowIso(), who: 'pmos', kind: 'error', text: 'The job ended before it made a version: the render did not pass the check (a slide had no data-slide-id). Nothing changed. Try the turn again.' }); return; }
257
257
  const base = D.versions.find((x) => x.n === D.current) || null; const n = (D.versions.length ? Math.max(...D.versions.map((x) => x.n)) : 0) + 1;
@@ -43,6 +43,16 @@ function sampleChip(s) {
43
43
  : el('p', null, el('span', { class: 'dim' }, 'PMOS took: '), s.took || 'PMOS reads it on the next turn.')));
44
44
  }
45
45
 
46
+ /* put() that leaves a node in place when it stays: only the nodes that go are taken out, so a kept frame does not load again */
47
+ function keep(host, ...kids) {
48
+ const want = kids.flat(Infinity).filter((k) => k != null && k !== false && k !== true).map((k) => (typeof k === 'string' ? document.createTextNode(k) : k));
49
+ const set = new Set(want);
50
+ for (const c of [...host.childNodes]) if (!set.has(c)) c.remove();
51
+ let ref = host.firstChild;
52
+ for (const n of want) { if (n === ref) ref = ref.nextSibling; else host.insertBefore(n, ref); }
53
+ return host;
54
+ }
55
+
46
56
  /* ── the studio ── */
47
57
  export function openStudio({ ws, id, name, view, onClose } = {}) {
48
58
  ensureDeckCss();
@@ -59,16 +69,21 @@ export function openStudio({ ws, id, name, view, onClose } = {}) {
59
69
  sizeBtns.forEach((b) => b.setAttribute('aria-pressed', String(b.dataset.rdSize === size)));
60
70
  }
61
71
 
62
- async function load(keepView) {
72
+ /* follow: show the current version when it changed (a job landed). A read that changed nothing paints nothing: the poll reads the design
73
+ * every 1.5 seconds while a job runs, and a repaint rebuilt the conversation and the box the PM types in. */
74
+ async function load(keepView, follow) {
63
75
  const r = await RD.design(ws, id);
64
- if (!r || r.ok === false) { S.err = (r && r.error) || 'The design could not be read.'; paint(); return; }
76
+ if (!r || r.ok === false) { S.err = (r && r.error) || 'The design could not be read.'; S.shown = null; paint(); return; }
77
+ const prev = S.D ? S.D.current : null;
65
78
  S.D = r.design; S.setup = r.setup || { id, name };
66
79
  if (!K.fmt || !S.D.versions.length) K.fmt = S.D.format || 'deck';
67
- if (!keepView || K.view == null || !S.D.versions.some((v) => v.n === K.view)) K.view = S.D.current;
80
+ if (!keepView || K.view == null || !S.D.versions.some((v) => v.n === K.view) || (follow && S.D.current !== prev)) K.view = S.D.current;
68
81
  if (S.D.running || (S.D.samples || []).some((x) => x.fetching)) poll(); else clearTimeout(S.timer);
69
82
  if (K.view != null) await render(K.view);
70
83
  if (K.cmp) await render(cmpA());
71
- paint();
84
+ const shown = JSON.stringify([r.design, r.setup, K.view, K.cmp, K.cmp ? cmpA() : null, Object.keys(S.cache)]);
85
+ if (shown === S.shown) return;
86
+ S.shown = shown; paint();
72
87
  }
73
88
  async function render(n) {
74
89
  if (n == null || S.cache[n]) return;
@@ -84,7 +99,11 @@ export function openStudio({ ws, id, name, view, onClose } = {}) {
84
99
  }
85
100
  S.watch = setInterval(checkNew, 4000);
86
101
  window.addEventListener('focus', checkNew);
87
- function poll() { clearTimeout(S.timer); S.timer = setTimeout(async () => { if (S.closed) return; const was = S.D && S.D.current; await load(false); if (S.D && !S.D.running && S.D.current !== was) { K.markers = []; K.draft = null; scrollLog(); } }, 1500); }
102
+ function poll() { clearTimeout(S.timer); S.timer = setTimeout(async () => { if (S.closed) return; const was = S.D && S.D.current; await load(true, true); if (S.D && !S.D.running && S.D.current !== was) { K.markers = []; K.draft = null; scrollLog(); } }, 1500); }
103
+ /* The preview's frames are kept from one paint to the next: a frame that is taken out of the page and put back loads again, and every
104
+ * paint rebuilt the slide and its thumbnails, so they flickered on each read while a job ran and on each click. */
105
+ const KEPT = {};
106
+ const reuse = (slot, key, make) => { const k = KEPT[slot]; if (k && k.key === key) return k.node; const node = make(); KEPT[slot] = { key, node }; return node; };
88
107
  const ver = (n) => (S.D.versions || []).find((v) => v.n === n);
89
108
  const cmpA = () => { const b = S.D.current; const a = K.cmpA != null && K.cmpA !== b && ver(K.cmpA) ? K.cmpA : (S.D.versions.filter((v) => v.n < b).pop() || S.D.versions.find((v) => v.n !== b) || {}).n; return a; };
90
109
  const scrollLog = () => requestAnimationFrame(() => { const l = body.querySelector('.rd-dks-log'); if (l) l.scrollTop = l.scrollHeight; });
@@ -216,19 +235,26 @@ export function openStudio({ ws, id, name, view, onClose } = {}) {
216
235
  if (!R) return [strip(), capline, el('div', { class: 'fold', role: 'status' }, icon('clock', 'sm'), ' Reading D' + v.n + '.')];
217
236
  if (R.err) return [strip(), capline, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), ' D' + v.n + ' could not be read: ' + R.err + '.')];
218
237
  if (R.format === 'doc') {
219
- const card = el('div', { class: 'rd-docf rd-dks-doc' + (K.point ? ' placing' : ''), 'data-rd-sbig': 'doc' }); const layer = el('div', { class: 'rd-doclayer' });
220
- const box = (e) => { const sec = e.target.closest && e.target.closest('section.pmos-sec'); if (!sec) return null; const r = sec.getBoundingClientRect(); return { id: sec.getAttribute('data-sec-id'), x: (e.clientX - r.left) / r.width * 100, y: (e.clientY - r.top) / r.height * 100 }; };
221
- card.append(frame(R.style, R.body, { title: 'D' + v.n + ', the document', cls: 'pmos-doc', focusable: true, onLoad: (doc, fr) => {
222
- const fit = () => { fr.style.setProperty('--rp-h', Math.max(200, doc.documentElement.scrollHeight) + 'px'); const L = []; for (const s of R.secs) { const n = doc.querySelector('section.pmos-sec[data-sec-id="' + s.id.replace(/"/g, '') + '"]'); if (n) L.push(...markers(s.id, n.getBoundingClientRect())); } put(layer, ...L); };
223
- fit(); setTimeout(fit, 120); wireFrame(doc, { ...pointHands(box), more: fit });
224
- } }), layer);
238
+ const card = reuse('doc', v.n, () => {
239
+ const c = el('div', { class: 'rd-docf rd-dks-doc', 'data-rd-sbig': 'doc' }); const layer = el('div', { class: 'rd-doclayer' });
240
+ const box = (e) => { const sec = e.target.closest && e.target.closest('section.pmos-sec'); if (!sec) return null; const r = sec.getBoundingClientRect(); return { id: sec.getAttribute('data-sec-id'), x: (e.clientX - r.left) / r.width * 100, y: (e.clientY - r.top) / r.height * 100 }; };
241
+ c.append(frame(R.style, R.body, { title: 'D' + v.n + ', the document', cls: 'pmos-doc', focusable: true, onLoad: (doc, fr) => {
242
+ const fit = () => { if (!doc.documentElement) return; fr.style.setProperty('--rp-h', Math.max(200, doc.documentElement.scrollHeight) + 'px'); const L = []; for (const s of R.secs) { const n = doc.querySelector('section.pmos-sec[data-sec-id="' + s.id.replace(/"/g, '') + '"]'); if (n) L.push(...markers(s.id, n.getBoundingClientRect())); } put(layer, ...L); };
243
+ c.fit = fit; fit(); setTimeout(fit, 120); wireFrame(doc, { ...pointHands(box), more: fit });
244
+ } }), layer);
245
+ return c;
246
+ });
247
+ card.classList.toggle('placing', !!K.point); if (card.fit) card.fit();
225
248
  const key = K.draft ? K.draft.slide : (K.markers[0] || {}).slide || (R.secs[0] || {}).id || 'doc';
226
249
  return [strip(), capline, run, card, pointSect(key)];
227
250
  }
228
251
  if (!R.slides.length) return [strip(), capline, el('div', { class: 'fold w' }, icon('alert', 'sm'), ' D' + v.n + ' has no slide.')];
229
252
  K.sidx = Math.min(K.sidx, R.slides.length - 1); const s = R.slides[K.sidx];
230
- const big = slideCard(R, s, { cls: 'rd-big' + (K.point ? ' placing' : ''), attrs: { 'data-rd-sbig': s.id }, focusable: true, over: markers(s.id), wire: (doc) => wireFrame(doc, pointHands((e) => ({ id: s.id, x: e.clientX / 1280 * 100, y: e.clientY / 720 * 100 }))) });
231
- return [strip(), capline, run, thumbStrip(R, K.sidx, (i) => { K.sidx = i; K.draft = null; paint(); }),
253
+ const big = reuse('big', v.n + '/' + s.id, () => slideCard(R, s, { cls: 'rd-big', attrs: { 'data-rd-sbig': s.id }, focusable: true, wire: (doc) => wireFrame(doc, pointHands((e) => ({ id: s.id, x: e.clientX / 1280 * 100, y: e.clientY / 720 * 100 }))) }));
254
+ big.classList.toggle('placing', !!K.point); [...big.children].forEach((c) => { if (c.tagName !== 'IFRAME') c.remove(); }); big.append(...markers(s.id));
255
+ const thumbs = reuse('thumbs', v.n, () => thumbStrip(R, K.sidx, (i) => { K.sidx = i; K.draft = null; paint(); }));
256
+ thumbs.querySelectorAll('[data-rd-sgo]').forEach((b) => b.setAttribute('aria-current', String(Number(b.getAttribute('data-rd-sgo')) === K.sidx)));
257
+ return [strip(), capline, run, thumbs,
232
258
  el('div', { class: 'rd-dk-cap' }, el('b', { 'data-rd-scap': '' }, 'Slide ' + s.n + ' of ' + R.slides.length + ': ' + s.title), el('span', { class: 'dim rd-small' }, hint(s.kind))), big, pointSect(s.id)];
233
259
  }
234
260
  function thumbStrip(R, cur, pick) {
@@ -277,13 +303,15 @@ export function openStudio({ ws, id, name, view, onClose } = {}) {
277
303
  const D = S.D; const nm = (S.setup && S.setup.name) || name || 'Report';
278
304
  const sb = body.closest('.sb'); const y = sb ? sb.scrollTop : 0; const log = body.querySelector('.rd-dks-log'); const ly = log ? log.scrollTop : null;
279
305
  const focus = document.activeElement && body.contains(document.activeElement) && document.activeElement.matches('[data-rd-in],[data-rd-link]') ? document.activeElement.getAttribute('data-rd-in') != null ? '[data-rd-in]' : '[data-rd-link]' : null;
280
- put(body, el('div', { class: 'rd-dk-bar' }, el('div', { class: 'chips2 rd-wrap' }, el('div', { class: 'seg', role: 'group', 'aria-label': 'Report type' },
306
+ S.dks = S.dks || el('div', { class: 'rd-dks' }); S.out = S.out || el('div', { class: 'rd-dks-out', 'data-rd-preview': '' });
307
+ keep(body, el('div', { class: 'rd-dk-bar' }, el('div', { class: 'chips2 rd-wrap' }, el('div', { class: 'seg', role: 'group', 'aria-label': 'Report type' },
281
308
  btn({ 'data-rd-fmt': 'deck', 'aria-pressed': String(K.fmt === 'deck'), onclick: () => setFmt('deck') }, icon('img', 'sm'), 'Deck'), btn({ 'data-rd-fmt': 'doc', 'aria-pressed': String(K.fmt === 'doc'), onclick: () => setFmt('doc') }, icon('doc', 'sm'), 'Document')),
282
309
  el('b', null, nm), D.saved ? el('span', { class: 'chip2 ds-good', 'data-rd-saved': String(D.saved.version) }, icon('check', 'sm'), 'Saved design: D' + D.saved.version) : el('span', { class: 'chip2', 'data-rd-saved': '' }, 'Not saved yet')),
283
310
  el('div', { class: 'chips2' }, pbtn('primary', 'This is it', 'check', { 'data-rd-act': 'accept', disabled: !D.versions.length, onclick: () => accept() }),
284
311
  D.saved ? pbtn('ghost', 'Design brief', 'doc', { 'data-rd-act': 'brief', onclick: () => openBrief({ ws, id, name: nm }) }) : null)),
285
312
  el('div', { class: 'fold' }, icon('info', 'sm'), ' No template to fill in. Describe the report, add samples, then refine until it looks right. PMOS keeps what you settle on and drafts every cycle to match it. Nothing is sent.'),
286
- el('div', { class: 'rd-dks' }, chat(), el('div', { class: 'rd-dks-out', 'data-rd-preview': '' }, ...[].concat(preview()))));
313
+ S.dks);
314
+ keep(S.dks, chat(), S.out); keep(S.out, preview());
287
315
  if (sb) sb.scrollTop = y; const l2 = body.querySelector('.rd-dks-log'); if (l2) l2.scrollTop = ly == null ? l2.scrollHeight : ly;
288
316
  if (focus) { const n = body.querySelector(focus); if (n) n.focus(); }
289
317
  }
@@ -199,21 +199,25 @@ export function createDeck(o) {
199
199
  const root = el('div', { class: 'rd-dk', 'data-rd-deck': path });
200
200
  const redraw = () => { if (S.api && S.api.redraw) S.api.redraw(); };
201
201
 
202
+ /* A read that changed nothing draws nothing: while the cycle is redrawn the deck is read every 2 seconds, and a redraw loads every frame
203
+ * again, so the slides flickered. */
202
204
  async function load() {
203
205
  const c = await RD.cycle(ws, path);
204
- if (!c || c.ok === false) { S.loaded = true; S.cyc = null; S.err = (c && c.error) || ''; redraw(); return; }
205
- S.cyc = c;
206
+ if (!c || c.ok === false) { S.loaded = true; S.cyc = null; S.err = (c && c.error) || ''; S.seen = null; redraw(); return; }
207
+ S.cyc = c; const seen = [c];
206
208
  if (c.designed) {
207
- try { S.R = splitRender(await RD.cycleHtml(ws, path)); } catch (e) { S.err = (e && e.message) || 'the render could not be read'; S.R = null; }
208
- const n = await RD.notes(ws, path); if (n && n.ok !== false) S.notes = { speaker: n.speaker || {}, suggestions: n.suggestions || {}, pins: n.pins || [] };
209
+ try { const h = await RD.cycleHtml(ws, path); seen.push(h); S.R = splitRender(h); } catch (e) { S.err = (e && e.message) || 'the render could not be read'; S.R = null; }
210
+ const n = await RD.notes(ws, path); seen.push(n); if (n && n.ok !== false) S.notes = { speaker: n.speaker || {}, suggestions: n.suggestions || {}, pins: n.pins || [] };
209
211
  if (c.previous && c.previous.path) {
210
- const pc = await RD.cycle(ws, c.previous.path);
211
- if (pc && pc.ok !== false && pc.designed) { S.prev = { ...pc, ...c.previous }; try { S.prevR = splitRender(await RD.cycleHtml(ws, c.previous.path)); } catch { S.prevR = null; } }
212
+ const pc = await RD.cycle(ws, c.previous.path); seen.push(pc);
213
+ if (pc && pc.ok !== false && pc.designed) { S.prev = { ...pc, ...c.previous }; try { const h = await RD.cycleHtml(ws, c.previous.path); seen.push(h); S.prevR = splitRender(h); } catch { S.prevR = null; } }
212
214
  }
213
215
  }
214
216
  S.loaded = true; S.cur = Math.min(S.cur, Math.max(0, count() - 1));
215
217
  if (c.rendering) poll();
216
- redraw();
218
+ const sig = JSON.stringify(seen) + S.err;
219
+ if (sig === S.seen) return;
220
+ S.seen = sig; redraw();
217
221
  }
218
222
  function poll() { clearTimeout(S.timer); S.timer = setTimeout(async () => { if (!root.isConnected && !OV) return; await load(); }, 2000); }
219
223
  const count = () => (S.R ? (S.R.format === 'deck' ? S.R.slides.length : S.R.secs.length) : 0);