create-pmos 0.539.0 → 0.541.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.
Files changed (89) hide show
  1. package/package.json +39 -27
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/README.md +1 -1
  7. package/workspace/changelog.json +38 -0
  8. package/workspace/fixtures/doc-category-labelled.json +1 -1
  9. package/workspace/guide/agent-capabilities.md +238 -28
  10. package/workspace/guide/breakdown.md +5 -20
  11. package/workspace/guide/claude-proposes.md +269 -37
  12. package/workspace/guide/cli.md +603 -0
  13. package/workspace/guide/home.md +160 -12
  14. package/workspace/guide/index.md +23 -59
  15. package/workspace/guide/initiatives-and-next-steps.md +235 -5
  16. package/workspace/guide/intelligence-okr-goals.md +121 -4
  17. package/workspace/guide/jira.md +2 -15
  18. package/workspace/guide/knowledge-graph.md +143 -18
  19. package/workspace/guide/layout.md +209 -4
  20. package/workspace/guide/notes.md +74 -6
  21. package/workspace/guide/proactive-engine.md +3 -14
  22. package/workspace/guide/programs.md +199 -4
  23. package/workspace/guide/reports.md +405 -41
  24. package/workspace/guide/scheduled-tasks-and-cli.md +6 -28
  25. package/workspace/guide/settings-and-switches.md +396 -0
  26. package/workspace/guide/statuses.md +141 -4
  27. package/workspace/ini-workflow-test.js +1 -1
  28. package/workspace/lib/ai-cli.js +12 -1
  29. package/workspace/lib/headless.js +75 -1
  30. package/workspace/lib/job-graph.js +2 -0
  31. package/workspace/lib/pmos-verbs.js +41 -40
  32. package/workspace/lib/run-tokens.js +70 -0
  33. package/workspace/lib/today-cli.js +57 -4
  34. package/workspace/lib/verify-work-cli.js +1 -1
  35. package/workspace/package-lock.json +2 -2
  36. package/workspace/package.json +1 -1
  37. package/workspace/public/pm/cozy-news.js +1 -1
  38. package/workspace/public/pm/cozy-onboard.js +2 -2
  39. package/workspace/public/pm/cozy-settings.js +42 -11
  40. package/workspace/public/pm/home-app.js +10 -1
  41. package/workspace/public/pm/ini-wf.js +3 -3
  42. package/workspace/public/pm/wf-page.css +26 -15
  43. package/workspace/public/pm/wf-page.js +96 -72
  44. package/workspace/public/premium-workflows.html +8 -23
  45. package/workspace/replaced-tests.json +19 -1
  46. package/workspace/server.js +7 -2
  47. package/workspace/workflows-setup-test.js +50 -50
  48. package/workspace/guide/adler.md +0 -71
  49. package/workspace/guide/agents-act.md +0 -68
  50. package/workspace/guide/ask-the-past.md +0 -46
  51. package/workspace/guide/board.md +0 -58
  52. package/workspace/guide/briefing-premium.md +0 -14
  53. package/workspace/guide/console-calendar.md +0 -24
  54. package/workspace/guide/core-documents.md +0 -58
  55. package/workspace/guide/data-freshness.md +0 -164
  56. package/workspace/guide/descriptions.md +0 -43
  57. package/workspace/guide/docs.md +0 -39
  58. package/workspace/guide/forecast.md +0 -66
  59. package/workspace/guide/horizon-scan.md +0 -82
  60. package/workspace/guide/idle-lab.md +0 -46
  61. package/workspace/guide/initiative-driver.md +0 -102
  62. package/workspace/guide/initiatives-roadmap.md +0 -131
  63. package/workspace/guide/integrated-work.md +0 -93
  64. package/workspace/guide/launcher.md +0 -39
  65. package/workspace/guide/lifecycle.md +0 -64
  66. package/workspace/guide/metric-drafts.md +0 -75
  67. package/workspace/guide/moments.md +0 -43
  68. package/workspace/guide/my-work.md +0 -40
  69. package/workspace/guide/next-prompt.md +0 -64
  70. package/workspace/guide/outcomes.md +0 -39
  71. package/workspace/guide/people.md +0 -48
  72. package/workspace/guide/pm-only-acts.md +0 -88
  73. package/workspace/guide/pm-only-lines.md +0 -61
  74. package/workspace/guide/present-in-a-meeting.md +0 -57
  75. package/workspace/guide/published-board.md +0 -116
  76. package/workspace/guide/ready-made-dashboards.md +0 -62
  77. package/workspace/guide/rehearse.md +0 -52
  78. package/workspace/guide/report-design.md +0 -126
  79. package/workspace/guide/report-slides.md +0 -43
  80. package/workspace/guide/report-structure.md +0 -91
  81. package/workspace/guide/reports-needs-you.md +0 -34
  82. package/workspace/guide/reports-set-up.md +0 -68
  83. package/workspace/guide/settings.md +0 -67
  84. package/workspace/guide/today.md +0 -40
  85. package/workspace/guide/validate-with-typesafe.md +0 -144
  86. package/workspace/guide/welcome.md +0 -90
  87. package/workspace/guide/what-you-missed.md +0 -42
  88. package/workspace/guide/workflows.md +0 -105
  89. package/workspace/guide/your-impact.md +0 -57
@@ -22,7 +22,9 @@
22
22
  * (what PMOS reads on its own, the connectors your sessions have; GET and POST /api/proactive/settings) fold into one row.
23
23
  * Workspaces the repositories PMOS works in (GET and POST /api/workspaces, POST /api/workspaces/forget; the folder is never touched),
24
24
  * then the row "Workflows ›" (U4; it was a section of its own that linked out): the stages each kind of initiative goes
25
- * through (pm/wf-page.js, D99). It opens WF_HREF.
25
+ * through (pm/wf-page.js, D99). It opens as a sub-panel here, the Settings dialog widened to the window (UI grill U1: the
26
+ * page /premium-workflows.html went; its address redirects to Home with ?settings=workflows). A stage opens in the Viewer,
27
+ * docked inside this dialog while the panel shows; + New workflow starts Home's own chat.
26
28
  * Updates the versions and Check now, Update, Restart to update (GET /api/kit/status, POST /api/kit/check | update | upgrade-app); opening it
27
29
  * asks for the latest kit. Under it, what's new (design E, UpE): this week's summary lines, the newest kit at version level,
28
30
  * then "Earlier this week" as one flat list of Claude's plain-language stories (a blue dot New, an amber dot Fixed, no dot
@@ -34,7 +36,8 @@
34
36
  * it with its one action and what Claude tried, and the place menu opens Settings at Connectors. Every write is the PM's press (pmPost carries the launch nonce).
35
37
  * PMOS reads the sources and never posts to them.
36
38
  * openSettings(section?): general, claude, connectors, workspaces, updates; the old section names still land where their controls are now
37
- * (checks → Claude, scrolled to Checks; adler and jl → General's sub-panel; dress → Adler › Dress for the day; workflows → Workspaces). */
39
+ * (checks → Claude, scrolled to Checks; adler and jl → General's sub-panel; dress → Adler › Dress for the day; workflows → Workspaces › Workflows).
40
+ * openSettings('workflows', { wf, stage }) picks that workflow there and opens that stage once. */
38
41
  import { mountClaudeSetup } from './cozy-claude-setup.js';
39
42
  import * as JL from './cozy-jl.js';
40
43
  import { pmGet, pmPost, pressFetch } from './http.js';
@@ -50,8 +53,7 @@ async function pmSend(method, path, body) {
50
53
  catch (e) { return { ok: false, error: 'could not reach the workspace server — ' + ((e && e.message) || String(e)) }; }
51
54
  }
52
55
  const SECTIONS = [['general', 'General'], ['claude', 'Claude'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['updates', 'Updates']];
53
- const SUBS = { adler: 'Adler', jl: 'Jev and Laya' }; // General › Extras: each opens as a sub-panel of General (U4)
54
- const WF_HREF = '/premium-workflows.html'; // Workspaces › Workflows: the Workflows panel's address
56
+ const SUBS = { adler: 'Adler', jl: 'Jev and Laya', workflows: 'Workflows' }; // General › Extras and Workspaces › Workflows: each opens as a sub-panel of its section (U4, U1)
55
57
  const SRC = { calendar: 'Calendar', wispr: 'Wispr Flow', mail: 'Mail', slack: 'Slack', jira: 'Jira', confluence: 'Confluence', github: 'GitHub', drive: 'Google Drive', figma: 'Figma', website: 'Your websites' };
56
58
  const VIEWER_KEY = 'pmos.cz.viewer';
57
59
  const T = { el: null, sec: 'general', sub: '', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null, fresh: null, reading: '', note: {}, info: false, fold: false, dress: false, more: false, bday: false, dset: {}, wkOpen: new Set(), wkMore: new Set(), arc: false };
@@ -103,7 +105,7 @@ function general() {
103
105
  }
104
106
  /* General › Extras (U4): the row's › opens the sub-panel; its ‹ comes back to General */
105
107
  const subBtn = (k) => `<button type="button" class="ev-ib" data-ev-sub="${k}" aria-label="${esc(SUBS[k])}" title="${esc(SUBS[k])}">${svg(CHEV, 18)}</button>`;
106
- const subHead = (k) => `<div class="ev-dr-hd"><button type="button" class="ev-ib" data-ev-sub="" aria-label="Back to General" title="Back">${svg(BACK, 18)}</button><h4 class="ev-grow">${esc(SUBS[k])}</h4></div>`;
108
+ const subHead = (k) => `<div class="ev-dr-hd"><button type="button" class="ev-ib" data-ev-sub="" aria-label="Back to ${esc((SECTIONS.find((x) => x[0] === T.sec) || SECTIONS[0])[1])}" title="Back">${svg(BACK, 18)}</button><h4 class="ev-grow">${esc(SUBS[k])}</h4></div>`;
107
109
  /* Your impact (GmP1Switch): on by default; off hides every impact surface and stops Claude's daily read */
108
110
  function impactOn() { const x = T.set && Array.isArray(T.set.settings) ? T.set.settings.find((y) => y.key === 'impact.on') : null; return x ? x.value !== false : true; }
109
111
  /** One Dress for the day press: POST /api/settings, keep the row, and tell the page (the event adler:dress) so Adler changes at once. */
@@ -227,11 +229,12 @@ function connectors() {
227
229
  return info + readsHtml() + fold + (T.fold ? `<div class="ev-con-more" id="evConMore">${all.map((x) => x[1]).join('')}</div>` : '');
228
230
  }
229
231
  function workspaces() {
232
+ if (T.sub === 'workflows') return subHead('workflows') + '<div class="ev-wfh" data-ev-wfhost></div>'; // pm/wf-page.js draws into it (UI grill U1)
230
233
  if (T.ws === null) return '<p class="ev-small ev-mut">Reading the repositories.</p>';
231
234
  return '<p class="ev-small ev-mut">A workspace is one repository PMOS works in. Removing one forgets the address only; the folder is not deleted.</p>'
232
235
  + T.ws.filter((x) => !x.linked).map((x) => trow(x.label || x.name || x.id, (x.root || '') + (x.home ? ' · home' : ''), x.home ? '<span class="ev-pill">Home</span>' : `<button type="button" class="ev-btn sm" data-ev-rm="${esc(x.id)}">Remove</button>`)).join('')
233
236
  + '<div class="ev-add"><label class="ev-vh" for="evRoot">Folder path of a repository</label><input id="evRoot" class="ev-inp" placeholder="Folder path of a repository"><button type="button" class="ev-btn pri" data-ev-add>Add</button></div>'
234
- + trow('Workflows', 'The stages each kind of initiative goes through', `<a class="ev-ib" href="${WF_HREF}" data-ev-wf aria-label="Workflows" title="Workflows">${svg(CHEV, 18)}</a>`);
237
+ + trow('Workflows', 'The stages each kind of initiative goes through', subBtn('workflows'));
235
238
  }
236
239
  function updates() {
237
240
  const s = home();
@@ -345,7 +348,7 @@ function checksSec() {
345
348
  }
346
349
  const BODY = { general, claude: claudeSec, connectors, workspaces, updates };
347
350
  // the old section names (deep links, other pages' calls): where their controls are now (U4)
348
- const MOVED = { checks: ['claude', ''], adler: ['general', 'adler'], jl: ['general', 'jl'], dress: ['general', 'adler'], workflows: ['workspaces', ''] };
351
+ const MOVED = { checks: ['claude', ''], adler: ['general', 'adler'], jl: ['general', 'jl'], dress: ['general', 'adler'], workflows: ['workspaces', 'workflows'] };
349
352
  let disposeClaudeSetup = null;
350
353
  function draw() {
351
354
  const el = T.el; if (!el || el.hidden) return;
@@ -361,21 +364,47 @@ function draw() {
361
364
  el.querySelector('.ev-st-main').innerHTML = (T.sec === 'connectors' ? '' : staleHtml()) + `<div class="ev-top"><h3 class="ev-h2" id="evStTitle">${esc(label)}</h3>${all}<button type="button" class="ev-ib" data-ev-close aria-label="Close settings" title="Close settings">${svg(ICON.close, 18)}</button></div>`
362
365
  + BODY[T.sec]() + `<p role="status"${T.msg && AD.moodOfText(T.msg) === 'honest' ? ' class="ev-say honest"' : ''}>${T.msg && AD.moodOfText(T.msg) === 'honest' ? AD.adler('honest', 24, { label: false }) : ''}${esc(T.msg)}</p>`;
363
366
  if (disposeClaudeSetup) { disposeClaudeSetup(); disposeClaudeSetup = null; }
367
+ wfPanel(el);
364
368
  const setup = el.querySelector('[data-claude-setup]');
365
369
  if (setup) disposeClaudeSetup = mountClaudeSetup(setup, { ws: wsParam() || (T.ws && T.ws[0] && T.ws[0].id) || '', onReady: () => {} });
366
370
  const cur = el.querySelector('.ev-st-nav [aria-current="page"]'); if (cur && cur.scrollIntoView) cur.scrollIntoView({ block: 'nearest', inline: 'nearest' }); // on a phone the section row scrolls: keep the open one in view
367
371
  if (had && !ae.isConnected) { const f = (key && el.querySelector(`[${key.name}="${CSS.escape(key.value)}"]`)) || el.querySelector('[aria-current="page"]'); if (f) f.focus(); }
368
372
  }
373
+ /** Workspaces › Workflows (UI grill U1): pm/wf-page.js draws into its host, the same node across redraws; leaving it lets it go. */
374
+ let WF = null, wfOpts = {};
375
+ function wfPanel(el) {
376
+ const host = el.querySelector('[data-ev-wfhost]');
377
+ el.classList.toggle('ev-wide', !!host);
378
+ if (!host) { if (WF) WF.release(); return; }
379
+ // the picked workflow and stage wait until a mount uses them: a redraw while the module loads replaces this host
380
+ const go = (M) => { WF = M; if (!host.isConnected) return; const o = { ...wfOpts, close: closeSettings }; wfOpts = {}; M.mount(host, o); };
381
+ if (WF) go(WF); else import('./wf-page.js').then(go).catch(() => { host.textContent = 'The workflows could not open.'; });
382
+ }
383
+ /** Workflows' stage in the Viewer docked in this dialog: Escape closes it first, then Settings. true when it closed it. */
384
+ function vwFirst() {
385
+ const v = WF && T.el.querySelector('#czViewer');
386
+ if (!v || v.hidden) return false;
387
+ import('./cozy-viewer.js').then((V) => V.close());
388
+ return true;
389
+ }
369
390
  function mount() {
370
391
  if (T.el && T.el.isConnected) return T.el;
371
392
  const d = document.createElement('div');
372
393
  d.innerHTML = '<div class="ev-st-scrim" id="evStScrim" hidden></div><div class="ev-st" id="evSettings" role="dialog" aria-modal="true" aria-label="Settings" hidden><nav class="ev-st-nav" aria-label="Settings sections"></nav><div class="ev-st-main"></div></div>';
373
- document.body.append(...d.childNodes);
394
+ // first in the body: while Workflows shows, the Viewer's host inside the dialog is the first data-cz-viewer-host (pm/cozy-viewer.js place)
395
+ document.body.prepend(...d.childNodes);
374
396
  T.el = document.getElementById('evSettings');
375
397
  document.getElementById('evStScrim').addEventListener('click', closeSettings);
376
- T.el.addEventListener('keydown', (e) => { if (e.target.closest('.cs-term')) return; if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); closeSettings(); } });
398
+ T.el.addEventListener('keydown', (e) => {
399
+ if (e.target.closest('.cs-term')) return;
400
+ if (e.key !== 'Escape') return;
401
+ e.preventDefault(); e.stopPropagation();
402
+ // inside Workflows, Escape closes the layer it is in first: the stage in the Viewer, a menu or the remove pop, then Settings
403
+ if (e.target.closest('.wf-pop, .cz-vw-ren')) return;
404
+ if (!vwFirst()) closeSettings();
405
+ });
377
406
  // the dialog is modal: Escape closes it even when focus is outside it (a click on the scrim's edge, a redraw)
378
- document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && T.el && !T.el.hidden && !T.el.contains(e.target)) { e.preventDefault(); e.stopPropagation(); closeSettings(); } }, true);
407
+ document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && T.el && !T.el.hidden && !T.el.contains(e.target) && !(e.target.closest && e.target.closest('.wf-menu'))) { e.preventDefault(); e.stopPropagation(); if (!vwFirst()) closeSettings(); } }, true);
379
408
  T.el.addEventListener('change', async (e) => {
380
409
  const x = e.target;
381
410
  if (x.matches('[data-ev-prof]')) {
@@ -553,8 +582,9 @@ async function load() {
553
582
  draw();
554
583
  openCheck();
555
584
  }
556
- export function openSettings(section) {
585
+ export function openSettings(section, o = {}) {
557
586
  const el = mount();
587
+ if (section === 'workflows') wfOpts = { wf: o.wf || null, stage: o.stage || null };
558
588
  const m = MOVED[section];
559
589
  if (m) { T.sec = m[0]; T.sub = m[1]; T.dress = section === 'dress'; } else if (section && BODY[section]) { T.sec = section; T.sub = ''; T.dress = false; }
560
590
  else if (el.hidden) { T.sec = 'general'; T.sub = ''; T.dress = false; } // a fresh open with no section opens on General (R2), not on the section of the last visit
@@ -569,6 +599,7 @@ export function openSettings(section) {
569
599
  export function closeSettings() {
570
600
  if (!T.el || T.el.hidden) return;
571
601
  if (disposeClaudeSetup) { disposeClaudeSetup(); disposeClaudeSetup = null; }
602
+ if (WF) WF.release();
572
603
  T.el.hidden = true; document.getElementById('evStScrim').hidden = true; T.el.removeAttribute('data-esc-layer');
573
604
  const b = T.back; T.back = null; if (b && b.isConnected) { try { b.focus(); } catch { /* gone */ } }
574
605
  }
@@ -1838,7 +1838,8 @@ function menCtx() {
1838
1838
  * stays beside it (on a phone the chat takes the page). Another page hands it over through sessionStorage with ?about=<its key>. */
1839
1839
  function chatAbout(t) {
1840
1840
  S.phoneChat = isPhone(); if (isPhone()) VW.close();
1841
- openTarget({ ...homeTarget(), key: t.key, title: t.title, scope: { text: 'Report · ' + t.title, icon: I.chat }, intro: t.intro ? { role: CLAUDE, text: t.intro } : undefined,
1841
+ S.sel = null; // the conversation is about its own item, not the row picked in the list (its header named that row)
1842
+ openTarget({ ...homeTarget(), key: t.key, title: t.title, scope: t.scope && t.scope.text ? { text: String(t.scope.text), icon: t.scope.icon || I.chat } : { text: 'Report · ' + t.title, icon: I.chat }, intro: t.intro ? { role: CLAUDE, text: t.intro } : undefined,
1842
1843
  placeholder: t.placeholder || 'Message Claude', context: t.context });
1843
1844
  drawList(); chat.focus();
1844
1845
  }
@@ -2238,6 +2239,14 @@ load().then(() => {
2238
2239
  }
2239
2240
  if (say) setTimeout(() => { const ta = $('#hmIn'); if (ta) { ta.value = say; ta.dispatchEvent(new Event('input', { bubbles: true })); ta.focus(); ta.setSelectionRange(say.length, say.length); } }, 0);
2240
2241
  if (mt) openMeeting({ note: mt });
2242
+ // ?settings=<section> (UI grill U1: the old /premium-workflows.html lands here with ?settings=workflows, keeping ?wf= and ?stage=):
2243
+ // Settings opens on that section; ?new=1 with it starts the New workflow conversation in this chat instead
2244
+ const sset = P.get('settings');
2245
+ if (sset && /^[a-z]{2,20}$/.test(sset)) {
2246
+ if (sset === 'workflows' && P.get('new') === '1') import('./wf-page.js').then((M) => M.newWorkflowChat()).catch(() => {});
2247
+ else import('./cozy-settings.js').then((M) => M.openSettings(sset, { wf: P.get('wf'), stage: P.get('stage') })).catch(() => {});
2248
+ const u = new URL(location.href); ['settings', 'new', 'wf', 'stage'].forEach((k) => u.searchParams.delete(k)); history.replaceState(history.state, '', u.pathname + u.search + u.hash);
2249
+ }
2241
2250
  if (/^(prop|men|pulse|scan|rep|src)$/.test(P.get('around') || '')) MORE.openAround(P.get('around')); // ?around=<row>: that Around you view (home-around.js)
2242
2251
  // the Viewer opens now or not at all: the held column goes either way, and the next open holds it only if it opened (SpJ)
2243
2252
  setTimeout(() => { if (!isPhone()) store.set(VW_HELD, VW.isOpen() ? '1' : null); LS.holdViewer($('.hm-vw'), false); }, 0);
@@ -77,12 +77,12 @@ export async function openPicker(anchor, ui, id) {
77
77
  openSwitch(anchor, ui, id, k);
78
78
  }, { menu: true, label: 'Pick a workflow', role: 'listbox' });
79
79
  }
80
- /** New workflow…: the PM describes it in the chat and PMOS drafts it in the Viewer (wfRules), on the Workflows page (premium-workflows.html ?new=1). */
80
+ /** New workflow…: the PM describes it in Home's chat, scoped "New workflow", and PMOS drafts it (wfRules); the draft waits in Settings ›
81
+ * Workspaces › Workflows (UI grill U1: no Workflows page, no second chat). */
81
82
  function newWorkflow(ui, id) {
82
83
  const ev = new CustomEvent('pmos:wf-new', { cancelable: true, detail: { initiative: id } });
83
84
  if (!window.dispatchEvent(ev)) return;
84
- const ws = new URLSearchParams(location.search).get('ws');
85
- location.href = '/premium-workflows.html?new=1' + (ws ? '&ws=' + encodeURIComponent(ws) : '');
85
+ import('./wf-page.js').then((M) => M.newWorkflowChat()).catch(() => {});
86
86
  }
87
87
 
88
88
  /* ── switch to another workflow (WfAChange; A's bridge, WmB) ── */
@@ -1,6 +1,23 @@
1
1
  /* pm/wf-page.css — Settings › Workflows (canvas WfAModel, WfAStage, WfACond, WfARemove, WfANew, WfADraft). Token vars only (cozy.css).
2
- * The desk is Home's (cozy-home.css .hm-desk): the list well, the main column (the workflow or the New workflow chat), the Viewer. */
3
- body.wf-page { min-height: 100vh; overflow: hidden; font-family: var(--cz-sans); color: var(--cz-ink); background: var(--cz-well2); }
2
+ * A sub-panel of the Settings dialog (UI grill U1): the list well, the main column (the workflow, or the New workflow draft), the Viewer
3
+ * docked beside it. pm/wf-page.js loads this sheet when the panel first mounts. */
4
+ .wf-in { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; font-family: var(--cz-sans); color: var(--cz-ink); }
5
+ .wf-desk { flex: 1; min-width: 0; min-height: 0; display: flex; gap: 18px; position: relative; }
6
+ .wf-list { box-sizing: border-box; flex: 0 0 248px; width: 248px; background: var(--cz-well); border-radius: 22px; padding: 12px 10px 16px; min-height: 0; display: flex; flex-direction: column; }
7
+ .wf-vw { flex: none; display: flex; min-height: 0; }
8
+ .wf-vw:empty { display: none; }
9
+ /* narrow: the Viewer lies over the workflow and the list stays (cozy-viewer.js body.cz-vw-over) */
10
+ body.cz-vw-over .wf-in .wf-vw { position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; }
11
+ body.cz-vw-over .wf-in .wf-vw .cz-vw { box-shadow: var(--cz-vlift); }
12
+ /* Settings on Workflows takes the window: the list, three columns and a stage beside them do not fit 920 px */
13
+ .ev-st.ev-wide { width: calc(100vw - 32px); height: calc(100vh - 32px); }
14
+ .ev-st.ev-wide .ev-st-main { padding-bottom: 18px; }
15
+ /* the sections give way to the workflow and its stage (‹ goes back to Workspaces, the title says where); on a phone they stay a row */
16
+ @media (min-width: 761px) { .ev-st.ev-wide .ev-st-nav { display: none; } }
17
+ .ev-st .ev-wfh { flex: 1; min-width: 0; min-height: 0; display: flex; }
18
+ .wf-in .wf-list .lhead h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* the sub-panel's head names it once */
19
+ .wf-in .wf-list .lhead { justify-content: flex-end; padding-bottom: 4px; }
20
+ .wf-newb { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
4
21
  .wf-page button { font-family: var(--cz-sans); }
5
22
  .wf-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
6
23
  .wf-small { font-size: var(--fs-meta); line-height: 1.45; }
@@ -131,12 +148,7 @@ body.wf-page { min-height: 100vh; overflow: hidden; font-family: var(--cz-sans);
131
148
  .wf-trow .wf-pill { margin-top: 3px; }
132
149
  .wf-dacts { margin-top: auto; padding-top: 12px; }
133
150
 
134
- /* ── the chat of New workflow (Home's chat, cozy-home.css) ── */
135
- .wf-chatw { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
136
- .wf-chatw[hidden] { display: none; }
137
- .wf-chatw .hm-chat { flex: 1; }
138
- .wf-chatw .hm-chip { flex: none; } /* "In: New workflow" stays whole; the Enter hint gives way first */
139
- .wf-hint { text-align: center; padding: 6px 0 0; }
151
+ .wf-hint { padding: 12px 10px 0; margin-top: auto; }
140
152
 
141
153
  /* ── remove a stage in use (WfARemove), the menu, the toast ── */
142
154
  .wf-scrim { position: fixed; inset: 0; background: rgba(20,22,26,.28); z-index: 80; }
@@ -145,7 +157,7 @@ body.wf-page { min-height: 100vh; overflow: hidden; font-family: var(--cz-sans);
145
157
  .wf-mv { display: flex; align-items: center; gap: 10px; }
146
158
  .wf-mv b { flex: 1; }
147
159
  .wf-mvl { display: flex; flex-direction: column; gap: 8px; }
148
- .wf-menu { position: fixed; z-index: 90; min-width: 180px; background: var(--cz-card); border-radius: 14px; box-shadow: var(--cz-sheet); padding: 6px; display: flex; flex-direction: column; }
160
+ .wf-menu { position: fixed; z-index: 96; min-width: 180px; background: var(--cz-card); border-radius: 14px; box-shadow: var(--cz-sheet); padding: 6px; display: flex; flex-direction: column; }
149
161
  .wf-menu button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 10px; font: var(--fw-strong) var(--fs-row)/var(--lh-row) var(--cz-sans); color: var(--cz-ink); cursor: pointer; }
150
162
  .wf-menu button:hover, .wf-menu button:focus { background: var(--cz-well); outline: none; }
151
163
  .wf-menu button.danger { color: var(--cz-red); }
@@ -155,11 +167,11 @@ body.wf-page { min-height: 100vh; overflow: hidden; font-family: var(--cz-sans);
155
167
 
156
168
  /* ── a phone: the list is the page; a workflow opens over it with ← (the columns stack) ── */
157
169
  @media (max-width: 760px) {
158
- body.wf-page { overflow: auto; background: var(--cz-card); }
159
- .wf-page .hm-desk { position: static; display: block; padding: 12px 16px 96px; background: none; box-shadow: none; border-radius: 0; }
160
- .wf-page .hm-list { display: flex; width: auto; padding: 12px 10px; }
161
- .wf-page.wf-open .hm-list { display: none; }
162
- .wf-page:not(.wf-open) .wf-main, .wf-page:not(.wf-open) .wf-chatw { display: none; }
170
+ .ev-st.ev-wide { width: 100vw; height: 100%; }
171
+ .wf-desk { display: block; }
172
+ .wf-list { width: auto; padding: 12px 10px; }
173
+ .wf-in.wf-open .wf-list { display: none; }
174
+ .wf-in:not(.wf-open) .wf-main { display: none; }
163
175
  .wf-main { padding: 0; overflow: visible; }
164
176
  .wf-cols { flex-direction: column; min-height: 0; }
165
177
  .wf-col.wf-end { flex: none; }
@@ -167,7 +179,6 @@ body.wf-page { min-height: 100vh; overflow: hidden; font-family: var(--cz-sans);
167
179
  .wf-head { flex-wrap: wrap; }
168
180
  .wf-head > .wf-small { flex-basis: 100%; order: 3; padding-left: 40px; }
169
181
  .wf-ren input { min-width: 0; width: 100%; }
170
- .wf-chatw { height: calc(100vh - 120px); }
171
182
  .wf-card, .wfl { min-height: 44px; }
172
183
  .wf-pill { max-width: 46%; }
173
184
  .wf-stage .wf-row { flex-wrap: wrap; }
@@ -1,23 +1,22 @@
1
1
  /* pm/wf-page.js — Settings › Workflows (initiative workflows per initiative, D99; canvas WfAModel, WfAStage, WfACond, WfARemove, WfANew,
2
- * WfADraft). One page, reached from Settings:
2
+ * WfADraft). A sub-panel of Settings › Workspaces (UI grill U1): pm/cozy-settings.js mounts it with mount(host) and lets it go with
3
+ * release(). The old page /premium-workflows.html redirects to Home with ?settings=workflows, which opens it there.
3
4
  * the list every workflow with its count of initiatives and +; Product feature first, archived ones last and quiet. The star on a row
4
5
  * (batch 24 item 3, canvas DfA) makes that workflow the default a new initiative starts on (POST /api/workflows/default)
5
6
  * the picked workflow one numbered list across the To do, In progress and Done columns; drag a stage to reorder it or to move it to
6
7
  * another column; Add a stage per column; the dashed Won't do · Archived column (in every workflow); ⋯ = Copy, Archive.
7
8
  * The name is the rename press (RnA*: tap it, one field with a check).
8
9
  * a stage opens in the Viewer (the docked, resizable side panel): pm/wf-stage.js
9
- * + New workflow: the normal chat, scoped "New workflow". The PM describes the work; PMOS drafts it (skill workflow-setup,
10
- * `pmos workflow draft`) and the draft shows in the Viewer with Create workflow and Edit by hand. "Start blank" and
11
- * "from a copy" sit under the box.
10
+ * + New workflow: Home's own chat, scoped "New workflow" (newWorkflowChat(); no second chat column). The PM describes the
11
+ * work; PMOS drafts it (skill workflow-setup, `pmos workflow draft`). The draft waits here as the "New workflow · draft"
12
+ * row: it shows in the Viewer with Create workflow and Edit by hand. "Start blank" and "from a copy" sit under the list.
12
13
  * the bridge (batch 20 item 3, canvas WmB right) a workflow that replaces another (its saved bridge, or it began as a copy) shows
13
14
  * "Replaces <name>": each old stage with a picker of this workflow's stages, Claude's proposal until the PM changes one. A change
14
15
  * saves at once (POST /api/workflows/bridge); every later switch from the old workflow uses it.
15
16
  * Reads GET /api/workflows and GET /api/workflows/draft. Every write is the PM's press: POST /api/workflows/save | copy | archive | draft.
16
17
  * Product feature ships with PMOS and is read-only here: Copy makes an editable one. */
17
- import { pmGet, pmPost, pmHeaders } from './http.js';
18
+ import { pmGet, pmPost } from './http.js';
18
19
  import { esc, svg, ICON, wsParam, wsQ } from './cozy-evui.js';
19
- import { mountNav } from './cozy-nav.js';
20
- import { mountLivePill } from './cozy-live-pill.js';
21
20
  import * as VW from './cozy-viewer.js';
22
21
  import { CATS, wfIcon, PRODUCT_FEATURE_ID } from './wf-model.js';
23
22
  import * as E from './wf-edit.js';
@@ -33,7 +32,7 @@ const store = { get(k) { try { return localStorage.getItem(k); } catch { return
33
32
  const DRAG = 'M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01', PLUS = 'M12 5v14M5 12h14', BRANCH = ICON.branch, OK = 'M5 12l5 5 9-10';
34
33
 
35
34
  /* S.list: [wf + { count }] | null while reading; S.sel: the picked id, 'new' for New workflow; S.edit: a draft opened by hand (not saved yet) */
36
- const S = { list: null, sel: null, draft: null, edit: null, err: '', msg: '', renaming: false, renErr: '', busy: false, pop: null, chat: null, poll: 0, phoneOpen: false };
35
+ const S = { list: null, sel: null, draft: null, edit: null, err: '', msg: '', renaming: false, renErr: '', busy: false, pop: null, poll: 0, phoneOpen: false, want: null };
37
36
  const wfOf = (id) => (S.edit && id === S.edit.id ? S.edit : (S.list || []).find((w) => w.id === id) || null);
38
37
  const cur = () => (S.sel && S.sel !== 'new' ? wfOf(S.sel) : null);
39
38
  /** A New workflow chat is still going (its key is kept until Create), or PMOS has drafted one. */
@@ -53,12 +52,13 @@ async function load() {
53
52
  const r = await pmGet('/api/workflows' + wsQ());
54
53
  if (r && r.ok && Array.isArray(r.workflows)) { S.list = r.workflows; S.err = ''; }
55
54
  else { S.list = S.list || []; S.err = (r && r.error) || 'The workflows could not be read.'; }
56
- const want = new URLSearchParams(location.search).get('wf');
57
- if (!S.sel || (S.sel !== 'new' && !wfOf(S.sel))) S.sel = want && wfOf(want) ? want : (S.list[0] && S.list[0].id) || null;
55
+ // mount(host, { wf, stage }) or the address (?wf=, ?stage=): that workflow is picked, and that stage opens once, on the first read
56
+ const W = S.want || {}, want = W.wf;
57
+ if (want && wfOf(want)) S.sel = want;
58
+ else if (!S.sel || (S.sel !== 'new' && !wfOf(S.sel))) S.sel = (S.list[0] && S.list[0].id) || null;
58
59
  draw();
59
- // ?stage=<key> (the Board's "Add an exit step", XipB): that stage opens once, on the first read
60
- const stage = new URLSearchParams(location.search).get('stage');
61
- if (stage && !S.stageOpened && S.sel === want) { S.stageOpened = true; openKey(stage); }
60
+ S.want = null;
61
+ if (W.stage && S.sel === want) openKey(W.stage); // the Board's "Add an exit step" (XipB)
62
62
  }
63
63
  async function readDraft() {
64
64
  const r = await pmGet('/api/workflows/draft' + wsQ());
@@ -66,7 +66,7 @@ async function readDraft() {
66
66
  const was = JSON.stringify(S.draft), now = JSON.stringify(d);
67
67
  S.draft = d;
68
68
  if (was !== now && S.sel !== 'new') drawList(); // the draft row's name follows the draft
69
- if (was !== now && S.sel === 'new') { drawList(); if (d) showDraft(); else if (VW.current() && VW.current().id === 'wf-draft') VW.close(); }
69
+ if (was !== now && S.sel === 'new') { draw(); if (d) showDraft(); else if (VW.current() && VW.current().id === 'wf-draft') VW.close(); }
70
70
  }
71
71
 
72
72
  /* ── the list (WfAModel's left column) ── */
@@ -91,7 +91,9 @@ function drawList() {
91
91
  const newRow = onNew || draftLive() ? `<button type="button" class="wfl${onNew ? ' sel' : ''}" data-wf="new"${onNew ? ' aria-current="true"' : ''}><span class="wfi new" aria-hidden="true">${svg(PLUS, 14)}</span><span class="t">${esc((S.draft && S.draft.name) || 'New workflow')}</span><span class="n">draft</span></button>` : '';
92
92
  el.innerHTML = `<div class="lhead"><h2>Workflows</h2><button type="button" class="ib sm" data-wf-new aria-label="New workflow: describe it and PMOS drafts it" title="New workflow: describe it and PMOS drafts it">${svg(PLUS, 16)}</button></div>`
93
93
  + (L === null ? '<p class="wf-mut wf-small wf-pad">Reading the workflows.</p>' : on.map(rowHtml).join('') + newRow
94
- + (off.length ? `<p class="wf-sub">Archived</p>${off.map(rowHtml).join('')}` : ''));
94
+ + (off.length ? `<p class="wf-sub">Archived</p>${off.map(rowHtml).join('')}` : '')
95
+ // + describes it to Claude in the chat; these two start one without a conversation (WfANew's "start blank or from a copy")
96
+ + '<p class="wf-hint wf-small wf-mut">Or start one <button type="button" class="wf-link" data-wf-blank>blank</button> or <button type="button" class="wf-link" data-wf-fromcopy aria-haspopup="menu">from a copy</button>.</p>');
95
97
  }
96
98
 
97
99
  /* ── the picked workflow (WfAModel) ── */
@@ -154,14 +156,9 @@ async function saveBridge(wf, key, to) {
154
156
  await load();
155
157
  }
156
158
  function drawMain() {
157
- const m = $('#wfMain'), c = $('#wfChat'); if (!m) return;
158
- const isNew = S.sel === 'new';
159
- m.hidden = isNew; c.hidden = !isNew;
160
- // the draft sits beside the chat (WfADraft); a stage's panel lies over the columns and the list stays (WfAStage)
161
- // beside the chat, a narrow desk folds the list to a rail rather than laying the draft over the chat (bug 2026-10-25: the chat was a sliver)
162
- const host = $('#wfVwHost'); if (host) { host.toggleAttribute('data-cz-viewer-host', isNew); host.toggleAttribute('data-cz-vw-overlay', !isNew); }
163
- document.body.classList.toggle('wf-open', !!S.sel && (S.phoneOpen || !isPhone()));
164
- if (isNew) return;
159
+ const m = $('#wfMain'); if (!m) return;
160
+ const R = $('#wfRoot'); if (R) R.classList.toggle('wf-open', !!S.sel && (S.phoneOpen || !isPhone()));
161
+ if (S.sel === 'new') { m.innerHTML = newHtml(); return; }
165
162
  const wf = cur();
166
163
  if (S.list === null) { m.innerHTML = '<p class="wf-mut">Reading the workflows.</p>'; return; }
167
164
  if (!wf) { m.innerHTML = `<div class="wf-box">${S.err ? `<p class="wf-err">${esc(S.err)}</p>` : ''}<p>No workflow yet. Press + to describe one, and PMOS drafts it.</p><button type="button" class="wf-btn dark sm" data-wf-new>New workflow</button></div>`; return; }
@@ -282,42 +279,45 @@ function stageCtx() {
282
279
  }
283
280
  function openKey(key, o = {}) { const wf = cur(); if (wf) openStage(wf, key, o); }
284
281
 
285
- /* ── New workflow (WfANew, WfADraft) ── */
286
- async function startNew() {
287
- S.sel = 'new'; S.edit = null; S.phoneOpen = true; VW.close();
288
- draw();
282
+ /* ── New workflow (WfANew, WfADraft): Home's own chat, scoped "New workflow" (UI grill U1: no second chat column) ── */
283
+ const NEW_ICON = 'M6 3v12M18 9a3 3 0 1 0 0-6a3 3 0 1 0 0 6M6 21a3 3 0 1 0 0-6a3 3 0 1 0 0 6M18 9a9 9 0 0 1-9 9';
284
+ /** What Home's chat opens on: the conversation's key (kept until Create, so the PM comes back to the same one), its scope and context. */
285
+ export function newWorkflowTopic() {
289
286
  let key = store.get(CHAT_KEY);
290
287
  if (!key) { key = 'pop:workflow:new-' + Date.now().toString(36); store.set(CHAT_KEY, key); }
291
- const chat = await mountWfChat();
292
- chat.open({
293
- key, title: 'New workflow', scope: { text: 'New workflow', icon: 'flow' }, role: { name: 'Claude', initial: 'C' },
294
- context: { title: 'New workflow', subject: 'Settings › Workflows', say: 'The PM is describing a new workflow. Follow the workflow-setup skill: draft it with pmos workflow draft, and explain each choice in the chat.' },
295
- intro: { role: { name: 'Claude', initial: 'C' }, text: 'Tell me how this work goes, in your own words: who does what, in what order, and what has to be true before each step. Add a policy or an old checklist if you have one. I will draft the stages and show them beside the chat.' },
296
- });
297
- hint();
298
- await readDraft();
299
- if (S.draft) showDraft();
300
- clearInterval(S.poll); S.poll = setInterval(() => { if (S.sel === 'new' && !document.hidden) readDraft(); }, 3000);
301
- }
302
- /** "You can also start blank or from a copy." under the box (WfANew). */
303
- function hint() {
304
- const c = $('#wfChat'); if (!c) return;
305
- let h = c.querySelector('.wf-hint');
306
- if (!h) { h = document.createElement('p'); h.className = 'wf-hint wf-small wf-mut'; c.appendChild(h); }
307
- h.innerHTML = 'You can also start <button type="button" class="wf-link" data-wf-blank>blank</button> or <button type="button" class="wf-link" data-wf-fromcopy aria-haspopup="menu">from a copy</button>.';
308
- }
309
- let chatMod = null;
310
- async function mountWfChat() {
311
- if (S.chat) return S.chat;
312
- chatMod = chatMod || await import('./home-chat.js');
313
- const noop = () => {};
314
- S.chat = chatMod.mountChat($('#wfChatIn'), {
315
- esc, toast: (t) => toast(t), pmGet, pmPost, pressHeaders: () => { const h = pmHeaders(); delete h['Content-Type']; return h; },
316
- roles: () => [], seen: () => null, markSeen: noop, session: () => null, queued: () => [], queue: noop, unqueue: noop,
317
- onScope: noop, suggestLink: () => null, linkTo: noop, dismissLink: noop, onLink: noop, onTo: noop, workItem: noop, openTerminal: noop,
318
- viewerClosed: () => !VW.isOpen() && !isPhone(), desk: () => !isPhone(), reopenViewer: () => { if (S.draft) showDraft(); }, head: () => '',
319
- });
320
- return S.chat;
288
+ return {
289
+ key, title: 'New workflow', scope: { text: 'New workflow', icon: NEW_ICON },
290
+ context: 'The PM is describing a new workflow (Settings › Workflows' + (wsParam() ? ', workspace ' + wsParam() : '') + '). Follow the workflow-setup skill: draft it with pmos workflow draft, and explain each choice in the chat. '
291
+ + 'The draft waits in Settings › Workspaces › Workflows as the "New workflow · draft" row, with Create workflow and Edit by hand: say so once it is written. Never create the workflow yourself: the PM does.',
292
+ intro: 'Tell me how this work goes, in your own words: who does what, in what order, and what has to be true before each step. Add a policy or an old checklist if you have one. I will draft the stages and it waits in Settings › Workflows for you to create.',
293
+ placeholder: 'How does this work go?',
294
+ };
295
+ }
296
+ /** + : Home's chat opens on the New workflow conversation. On Home it opens in place (pmos-chat-about); another page goes to Home, and
297
+ * the conversation's context waits in sessionStorage for Home to read (the report chat's way, premium-report-read.js openChat). */
298
+ export function newWorkflowChat(o = {}) {
299
+ const t = newWorkflowTopic();
300
+ if (o.close) o.close();
301
+ if (!dispatchEvent(new CustomEvent('pmos-chat-about', { detail: t, cancelable: true }))) return t; // Home took it
302
+ try { sessionStorage.setItem('pmos-chat-about', JSON.stringify(t)); } catch { /* Home opens the chat with no context */ }
303
+ const q = new URLSearchParams({ about: t.key, label: t.title }); if (wsParam()) q.set('ws', wsParam());
304
+ location.href = '/premium.html?' + q.toString();
305
+ return t;
306
+ }
307
+ let HOST = { close: null };
308
+ function startNew() { S.edit = null; clearInterval(S.poll); newWorkflowChat({ close: HOST.close }); }
309
+ /** The draft row picked: the draft in the Viewer, and here the way back to its chat, or a start without one. */
310
+ function openNew() {
311
+ S.sel = 'new'; S.edit = null; S.phoneOpen = true; S.renaming = false; S.msg = '';
312
+ draw();
313
+ readDraft().then(() => { if (S.draft) showDraft(); });
314
+ clearInterval(S.poll); S.poll = setInterval(() => { if (S.sel === 'new' && !document.hidden && $('#wfMain')) readDraft(); }, 3000);
315
+ }
316
+ function newHtml() {
317
+ const d = S.draft, n = d && d.stages ? d.stages.length : 0;
318
+ const head = `<div class="wf-head">${isPhone() ? `<button type="button" class="ib sm" data-wf-back aria-label="All workflows" title="All workflows">${svg(ICON.back, 18)}</button>` : ''}<h1 class="wf-h1">${esc((d && d.name) || 'New workflow')}</h1>${d ? `<span class="wf-small wf-mut">${n} stage${n === 1 ? '' : 's'} · a draft</span>` : ''}</div>`;
319
+ return head + `<div class="wf-box wf-small wf-newb"><p>${d ? 'Claude drafted it in the chat. It shows in the Viewer: Create workflow, or Edit by hand.' : 'Claude drafts it in the chat while you describe it. The draft shows here.'}</p>`
320
+ + '<div class="wf-acts"><button type="button" class="wf-btn dark sm" data-wf-new>Continue in the chat</button></div></div>';
321
321
  }
322
322
  function draftHtml(d) {
323
323
  const st = d.stages || [];
@@ -389,7 +389,6 @@ function select(id) {
389
389
  S.sel = id; S.renaming = false; S.msg = ''; S.phoneOpen = true;
390
390
  if (S.edit && id !== S.edit.id) S.edit = null;
391
391
  VW.close();
392
- const u = new URL(location.href); if (id && id !== 'new') u.searchParams.set('wf', id); else u.searchParams.delete('wf'); VW.replaceUrl(u.pathname + u.search);
393
392
  draw();
394
393
  }
395
394
 
@@ -414,10 +413,12 @@ function bindDrag(main) {
414
413
  function bind() {
415
414
  $('#wfList').addEventListener('click', (e) => {
416
415
  if (e.target.closest('[data-wf-new]')) { startNew(); return; }
416
+ if (e.target.closest('[data-wf-blank]')) { startBlank(); return; }
417
+ const fc = e.target.closest('[data-wf-fromcopy]'); if (fc) { menu(fc, (S.list || []).filter((w) => !w.archived).map((w) => ({ label: w.name, go: () => copy(w) }))); return; }
417
418
  const star = e.target.closest('[data-wf-star]'); if (star) { makeDefault(star.dataset.wfStar); return; }
418
419
  const row = e.target.closest('.wfl');
419
420
  const b = e.target.closest('[data-wf]') || (row && row.querySelector('[data-wf]')); if (!b) return;
420
- if (b.dataset.wf === 'new') { if (S.sel !== 'new') startNew(); return; } // back to the live draft: its chat and draft viewer
421
+ if (b.dataset.wf === 'new') { if (S.sel !== 'new') openNew(); return; } // the live draft: in the Viewer, and the way back to its chat
421
422
  select(b.dataset.wf);
422
423
  });
423
424
  const main = $('#wfMain');
@@ -439,25 +440,48 @@ function bind() {
439
440
  main.addEventListener('change', (e) => { const k = e.target.dataset && e.target.dataset.wfBr; const wf = cur(); if (k && wf) saveBridge(wf, k, e.target.value); });
440
441
  main.addEventListener('submit', (e) => { if (e.target.closest('[data-wf-ren]')) { e.preventDefault(); const i = $('#wfName'); const wf = cur(); if (wf && i) rename(wf, i.value); } });
441
442
  main.addEventListener('keydown', (e) => { if (e.key === 'Escape' && e.target.closest('[data-wf-ren]')) { e.preventDefault(); e.stopPropagation(); S.renaming = false; S.renErr = ''; drawMain(); const b = main.querySelector('[data-wf-rn]'); if (b) b.focus(); } });
442
- $('#wfChat').addEventListener('click', (e) => {
443
- if (e.target.closest('[data-wf-blank]')) { startBlank(); return; }
444
- const c = e.target.closest('[data-wf-fromcopy]');
445
- if (c) menu(c, (S.list || []).filter((w) => !w.archived).map((w) => ({ label: w.name, go: () => copy(w) })));
446
- });
447
443
  $('#wfPop').addEventListener('click', (e) => { if (e.target.closest('[data-wf-moverm]')) moveAndRemove(); else if (e.target.closest('[data-wf-popx]')) { S.pop = null; drawPop(); } });
448
444
  $('#wfPop').addEventListener('keydown', (e) => { if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); S.pop = null; drawPop(); } });
449
445
  $('#wfScrim').addEventListener('click', () => { S.pop = null; drawPop(); });
450
- addEventListener('resize', () => drawMain());
446
+ addEventListener('resize', () => { if ($('#wfMain')) drawMain(); });
451
447
  }
452
448
 
453
- export function boot() {
454
- mountNav('settings');
455
- mountLivePill();
449
+ /* ── the panel: Settings mounts it in its own dialog ── */
450
+ const SKELETON = '<div class="wf-desk" id="wfDesk"><aside class="wf-list" id="wfList" aria-label="Workflows"></aside><section class="wf-main" id="wfMain" aria-label="Workflow"></section><div class="wf-vw" id="wfVwHost"></div></div>'
451
+ + '<div class="wf-scrim" id="wfScrim" hidden></div><div class="wf-pop" id="wfPop" role="dialog" aria-modal="true" hidden></div><div class="wf-toast" id="wfToast" role="status" aria-live="polite" hidden></div>';
452
+ let ROOT = null;
453
+ const CSS_HREF = new URL('./wf-page.css', import.meta.url).href;
454
+ /** Draws Settings › Workflows into host (the same node each time, so a redraw of Settings keeps what is open).
455
+ * o: { close() closes Settings (New workflow goes to the chat), wf, stage: pick that workflow and open that stage once }.
456
+ * While it shows, the Viewer docks inside it (data-cz-viewer-host), so a stage opens over Settings, not under it. */
457
+ export function mount(host, o = {}) {
458
+ if (!document.querySelector(`link[href="${CSS_HREF}"]`)) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS_HREF; document.head.appendChild(l); }
459
+ HOST = { close: o.close || null };
460
+ if (o.wf || o.stage) S.want = { wf: o.wf || null, stage: o.stage || null };
461
+ // a redraw of Settings while the panel shows: the same node goes back in, and reads again only when asked for a workflow
462
+ if (S.live && ROOT) { if (ROOT.parentNode !== host) host.appendChild(ROOT); if (S.want) load(); return ROOT; }
463
+ S.live = true;
464
+ const fresh = !ROOT;
465
+ if (fresh) { ROOT = document.createElement('div'); ROOT.className = 'wf-page wf-in'; ROOT.id = 'wfRoot'; ROOT.innerHTML = SKELETON; }
466
+ if (ROOT.parentNode !== host) host.appendChild(ROOT);
467
+ const vh = ROOT.querySelector('#wfVwHost'); vh.setAttribute('data-cz-viewer-host', ''); vh.setAttribute('data-cz-vw-overlay', '');
468
+ ROOT.querySelector('#wfList').setAttribute('data-cz-vw-list', '');
456
469
  setStageHost(stageCtx());
457
- bind();
470
+ if (fresh) bind();
458
471
  draw();
459
472
  load();
460
- if (new URLSearchParams(location.search).get('new') === '1') startNew();
461
- else if (store.get(CHAT_KEY)) readDraft(); // a draft from before shows as its row, by name
473
+ readDraft(); // a draft PMOS wrote (in this chat or another) shows as its row, by name
474
+ return ROOT;
475
+ }
476
+ /** Settings leaves the panel (another section, or closed): the Viewer leaves the dialog, and nothing keeps reading. */
477
+ export function release() {
478
+ if (!S.live) return;
479
+ S.live = false; clearInterval(S.poll); closeMenu();
480
+ if (S.pop) { S.pop = null; drawPop(); }
481
+ const c = VW.current();
482
+ if (c && /^wf-/.test(String(c.id || ''))) VW.close();
483
+ if (!ROOT) return;
484
+ const vh = ROOT.querySelector('#wfVwHost'); vh.removeAttribute('data-cz-viewer-host'); vh.removeAttribute('data-cz-vw-overlay');
485
+ ROOT.querySelector('#wfList').removeAttribute('data-cz-vw-list');
486
+ const v = ROOT.querySelector('#czViewer'); if (v) { VW.close(); document.body.appendChild(v); } // the Viewer goes back to the page
462
487
  }
463
- if (typeof document !== 'undefined' && document.getElementById('wfMain')) boot();
@@ -3,30 +3,15 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <meta name="pmos-nonce" content="" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
7
  <title>PMOS · Workflows</title>
8
- <!-- Settings › Workflows (initiative workflows per initiative, D99; canvas WfAModel, WfAStage, WfACond, WfARemove, WfANew, WfADraft). The list of
9
- workflows on the left; the picked one as one numbered list across To do, In progress and Done; a stage opens in the Viewer. + opens the normal
10
- chat, scoped "New workflow", and PMOS drafts the workflow into the Viewer. pm/wf-page.js draws it; pm/wf-stage.js is the stage panel. -->
11
- <link rel="preload" href="/vendor/plus-jakarta-sans-var.woff2" as="font" type="font/woff2" crossorigin />
12
- <link rel="stylesheet" href="/pm/cozy.css" />
13
- <link rel="stylesheet" href="/pm/cozy-home.css" />
14
- <link rel="stylesheet" href="/pm/cozy-today.css" />
15
- <link rel="stylesheet" href="/pm/wf-page.css" />
8
+ <!-- UI grill U1: Workflows is a sub-panel of Settings (Workspaces › Workflows), not a page. This address opens Home with Settings on it;
9
+ the query goes along (?wf=, ?stage=, ?new=1, ?ws=), and pm/home-app.js reads it. -->
10
+ <script>
11
+ (function () { var q = new URLSearchParams(location.search); q.set('settings', 'workflows'); location.replace('/premium.html?' + q.toString() + location.hash); })();
12
+ </script>
16
13
  </head>
17
- <body class="cz wf-page">
18
- <h1 class="wf-vh">Workflows</h1>
19
- <main class="hm-desk wf-desk" id="wfDesk">
20
- <aside class="hm-list wf-list" id="wfList" aria-label="Workflows" data-cz-vw-list></aside>
21
- <section class="wf-main" id="wfMain" aria-label="Workflow"></section>
22
- <section class="wf-chatw" id="wfChat" aria-label="New workflow" hidden><div class="hm-chat" id="wfChatIn"></div></section>
23
- <div class="hm-vw" id="wfVwHost" data-cz-vw-overlay></div>
24
- </main>
25
- <div class="wf-scrim" id="wfScrim" hidden></div>
26
- <div class="wf-pop" id="wfPop" role="dialog" aria-modal="true" hidden></div>
27
- <div class="wf-toast" id="wfToast" role="status" aria-live="polite" hidden></div>
28
- <div class="hm-toast" id="toast" role="status" aria-live="polite"></div>
29
- <noscript>This page needs JavaScript.</noscript>
30
- <script type="module" src="/pm/wf-page.js"></script>
14
+ <body>
15
+ <p>Workflows moved to <a href="/premium.html?settings=workflows">Settings › Workspaces › Workflows</a>.</p>
31
16
  </body>
32
17
  </html>
@@ -2138,7 +2138,7 @@
2138
2138
  "slice": "3B",
2139
2139
  "prefix": "G16 ",
2140
2140
  "reason": "The morning brief is cut (R29).",
2141
- "replacement": "The eight Today card kinds are named in guide/today.md.",
2141
+ "replacement": "The eight Today card kinds are named in guide/cli.md.",
2142
2142
  "pm_approval": {
2143
2143
  "by": "wawan",
2144
2144
  "at": "2026-10-05T21:26:13Z",
@@ -3656,6 +3656,24 @@
3656
3656
  "E3b: an acceptance recorded ONLY in planning/runs/ settles its run",
3657
3657
  "E3b: doc resolves from the LEGACY `rubric` key, not only `rubric_path`"
3658
3658
  ]
3659
+ },
3660
+ {
3661
+ "id": "E83",
3662
+ "group": "E",
3663
+ "file": "workspace/guide.test.js",
3664
+ "section": "G1, G6, G13, G17, G23 command pages",
3665
+ "change": "replaced",
3666
+ "slice": "guide-trim",
3667
+ "reason": "Guide fold (OS evaluation consolidation and UI grill item 9): every pmos command section moved from its feature page into one Command reference page, guide/cli.md.",
3668
+ "replacement": "G1 (rewritten) also requires cli; G6, G13, G17 and G23 assert the same command lists against cli.md.",
3669
+ "pm_approval": null,
3670
+ "names": [
3671
+ "G1 the guide has an index and the three feature pages",
3672
+ "G13 every pmos proactive command is in proactive-engine.md",
3673
+ "G17 every pmos kg command is in knowledge-graph.md",
3674
+ "G23 every pmos item command is in breakdown.md",
3675
+ "G6 every pmos schedule and pmos skill command is in scheduled-tasks-and-cli.md"
3676
+ ]
3659
3677
  }
3660
3678
  ]
3661
3679
  }