create-pmos 0.553.0 → 0.555.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 +33 -27
- package/payload/KIT-VERSION +2 -2
- 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/payload/state/log.md +1 -1
- package/workspace/briefing-premium-board-test.js +4 -4
- package/workspace/briefing-premium-initiative-test.js +2 -2
- package/workspace/briefing-premium-test.js +1 -1
- package/workspace/changelog.json +32 -0
- package/workspace/chat-asks-test.js +5 -5
- package/workspace/ev-everywhere-test.js +2 -2
- package/workspace/goals-clear-ui-test.js +1 -1
- package/workspace/guide/agent-capabilities.md +33 -31
- package/workspace/guide/claude-proposes.md +68 -68
- package/workspace/guide/cli.md +23 -22
- package/workspace/guide/cloud.md +3 -3
- package/workspace/guide/home.md +38 -38
- package/workspace/guide/index.md +5 -5
- package/workspace/guide/intelligence-okr-goals.md +4 -4
- package/workspace/guide/layout.md +23 -23
- package/workspace/guide/notes.md +8 -8
- package/workspace/guide/programs.md +17 -17
- package/workspace/guide/reports.md +16 -16
- package/workspace/guide/settings-and-switches.md +40 -37
- package/workspace/guide/statuses.md +3 -3
- package/workspace/home-other-product-test.js +8 -8
- package/workspace/home-pill-test.js +3 -3
- package/workspace/home-rows-test.js +7 -7
- package/workspace/intel-report-ui-test.js +1 -1
- package/workspace/intelligence-gaps-ui-test.js +2 -2
- package/workspace/lib/agent-roles.js +1 -1
- package/workspace/lib/autonomy-cli.js +16 -2
- package/workspace/lib/autonomy.js +84 -11
- package/workspace/lib/bg-queue.js +1 -1
- package/workspace/lib/briefing-premium-agent.js +2 -2
- package/workspace/lib/decision-memory.js +2 -2
- package/workspace/lib/driver-decide.js +6 -3
- package/workspace/lib/driver.js +6 -2
- package/workspace/lib/folder-needs.js +1 -1
- package/workspace/lib/goal-chat.js +5 -5
- package/workspace/lib/goal-watch.js +1 -1
- package/workspace/lib/grill-runs.js +5 -5
- package/workspace/lib/headless.js +5 -2
- package/workspace/lib/idle-lab.js +5 -5
- package/workspace/lib/impact-runs.js +2 -2
- package/workspace/lib/job-graph.js +6 -3
- package/workspace/lib/metric-draft-runs.js +4 -4
- package/workspace/lib/metric-read-runs.js +5 -5
- package/workspace/lib/news-for-you.js +1 -1
- package/workspace/lib/proposal-runs.js +6 -6
- package/workspace/lib/refresh.js +1 -1
- package/workspace/lib/routes-artefacts.js +10 -4
- package/workspace/lib/routes-autonomy.js +1 -1
- package/workspace/lib/routes-board-premium.js +1 -1
- package/workspace/lib/routes-goal-status.js +4 -4
- package/workspace/lib/routes-impact.js +1 -1
- package/workspace/lib/routes-insight-moves.js +1 -1
- package/workspace/lib/routes-loose.js +2 -2
- package/workspace/lib/routes-mentions.js +1 -1
- package/workspace/lib/routes-metric-drafts.js +9 -9
- package/workspace/lib/routes-proposals.js +9 -9
- package/workspace/lib/routes-ready-reports.js +1 -1
- package/workspace/lib/routes-slash.js +1 -1
- package/workspace/lib/source-heal.js +3 -3
- package/workspace/lib/state-root.js +22 -1
- package/workspace/lib/story-seed.js +95 -0
- package/workspace/lib/task-items.js +1 -1
- package/workspace/lib/task-links.js +2 -2
- package/workspace/lib/team-cli.js +1 -1
- package/workspace/lib/today.js +2 -2
- package/workspace/lib/verify-runs.js +87 -3
- package/workspace/live-pill-round-test.js +1 -1
- package/workspace/metric-drafts-ui-test.js +1 -1
- package/workspace/milestone-suggest-test.js +5 -5
- package/workspace/news-viewers-test.js +3 -3
- package/workspace/okr-goals-ui-test.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-chat-chart-tab-test.js +1 -1
- package/workspace/premium-chat-context-test.js +4 -4
- package/workspace/premium-chat-goal-setup-test.js +3 -3
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-line-test.js +6 -6
- package/workspace/premium-chat-notes-test.js +4 -4
- package/workspace/premium-chat-report-tab-test.js +4 -4
- package/workspace/premium-rec-now-test.js +2 -2
- package/workspace/public/pm/batch-press.js +4 -4
- package/workspace/public/pm/bd-fc-card.js +1 -1
- package/workspace/public/pm/bd-next.js +10 -10
- package/workspace/public/pm/bd-prog-panel.js +5 -5
- package/workspace/public/pm/chat-ask.js +1 -1
- package/workspace/public/pm/chat-context.js +3 -3
- package/workspace/public/pm/cozy-evmodel.js +1 -1
- package/workspace/public/pm/cozy-home.css +1 -1
- package/workspace/public/pm/cozy-lab-ins.js +4 -4
- package/workspace/public/pm/cozy-lab.js +1 -1
- package/workspace/public/pm/cozy-news.js +2 -2
- package/workspace/public/pm/cozy-onboard.js +2 -2
- package/workspace/public/pm/cozy-rec-now.js +5 -5
- package/workspace/public/pm/cozy-rec-present.js +1 -1
- package/workspace/public/pm/cozy-reveal.js +2 -2
- package/workspace/public/pm/cozy-settings.js +19 -19
- package/workspace/public/pm/cozy-steps.js +2 -2
- package/workspace/public/pm/cozy-viewer.js +1 -1
- package/workspace/public/pm/ctx-wedge.js +1 -1
- package/workspace/public/pm/dash-view.js +1 -1
- package/workspace/public/pm/goal-chat.js +6 -6
- package/workspace/public/pm/good-morning.js +2 -2
- package/workspace/public/pm/grill-words.js +1 -1
- package/workspace/public/pm/home-app.js +19 -19
- package/workspace/public/pm/home-ask.js +1 -1
- package/workspace/public/pm/home-chat.js +6 -6
- package/workspace/public/pm/home-data.js +2 -2
- package/workspace/public/pm/home-day.js +3 -3
- package/workspace/public/pm/home-drift.js +1 -1
- package/workspace/public/pm/home-goal.js +1 -1
- package/workspace/public/pm/home-impact.js +1 -1
- package/workspace/public/pm/home-ini.js +1 -1
- package/workspace/public/pm/home-line.js +5 -5
- package/workspace/public/pm/home-mentions.js +4 -4
- package/workspace/public/pm/home-moment.js +1 -1
- package/workspace/public/pm/home-need.js +1 -1
- package/workspace/public/pm/home-phone-card.js +1 -1
- package/workspace/public/pm/home-stage-card.js +2 -2
- package/workspace/public/pm/home-sweep.js +1 -1
- package/workspace/public/pm/home-today.js +2 -2
- package/workspace/public/pm/ini-about.js +2 -2
- package/workspace/public/pm/ini-agent.js +5 -5
- package/workspace/public/pm/ini-links.js +5 -5
- package/workspace/public/pm/ini-props.js +11 -11
- package/workspace/public/pm/ini-view-model.js +1 -1
- package/workspace/public/pm/ini-view.js +2 -2
- package/workspace/public/pm/intent.js +3 -3
- package/workspace/public/pm/loose-props.js +5 -5
- package/workspace/public/pm/metric-drafts.js +1 -1
- package/workspace/public/pm/ms-suggest.js +3 -3
- package/workspace/public/pm/next-prompt-ui.js +2 -2
- package/workspace/public/pm/okr-list.js +1 -1
- package/workspace/public/pm/page-chat.js +2 -2
- package/workspace/public/pm/premium-attach.js +1 -1
- package/workspace/public/pm/premium-initiative-head.js +1 -1
- package/workspace/public/pm/premium-insights.js +3 -3
- package/workspace/public/pm/premium-meeting.js +1 -1
- package/workspace/public/pm/premium-mtg-replay.js +1 -1
- package/workspace/public/pm/premium-notes.js +2 -2
- package/workspace/public/pm/premium-report-read.js +6 -6
- package/workspace/public/pm/premium-report-tab.js +7 -7
- package/workspace/public/pm/premium-shell.js +18 -18
- package/workspace/public/pm/premium-vw-ctx.js +3 -3
- package/workspace/public/pm/premium-vw-jira.js +1 -1
- package/workspace/public/pm/premium-welcome.js +1 -1
- package/workspace/public/pm/prog-order.js +2 -2
- package/workspace/public/pm/program-charter.js +3 -3
- package/workspace/public/pm/program-model.js +1 -1
- package/workspace/public/pm/ready-lib.js +4 -4
- package/workspace/public/pm/report-flow.js +7 -7
- package/workspace/public/pm/report-orders-ui.js +2 -2
- package/workspace/public/pm/split-merge.js +5 -5
- package/workspace/public/pm/story.js +1 -1
- package/workspace/public/pm/task-card.js +1 -1
- package/workspace/public/pm/tk-draft.js +1 -1
- package/workspace/public/pm/tk-send.js +2 -2
- package/workspace/public/pm/wf-page.js +2 -2
- package/workspace/ready-dash-ui-test.js +1 -1
- package/workspace/rec-present-test.js +2 -2
- package/workspace/server.js +14 -8
- package/workspace/session-names-test.js +3 -3
- package/workspace/skills/doc-check.skill +2 -0
- package/workspace/skills/idle-lab-prototype.skill +2 -0
- package/workspace/skills/measure.skill +2 -0
- package/workspace/skills/metric-read.skill +2 -0
- package/workspace/skills/milestone-review.skill +2 -0
- package/workspace/skills/report-biweekly.skill +2 -0
- package/workspace/skills/report-daily.skill +2 -0
- package/workspace/skills/report-design.skill +2 -0
- package/workspace/skills/report-monthly.skill +2 -0
- package/workspace/skills/report-weekly.skill +2 -0
- package/workspace/skills/story-first.skill +23 -0
- package/workspace/split-merge-ui-test.js +3 -3
- package/workspace/stage-card-test.js +4 -4
- package/workspace/task-links-test.js +1 -1
- package/workspace/task-views-test.js +7 -7
- package/workspace/tk-tasks-test.js +2 -2
|
@@ -354,7 +354,7 @@ function setupHtml(t) {
|
|
|
354
354
|
if (!t.loaded) return '<p class="vz-empty" role="status">Reading the report.</p>';
|
|
355
355
|
if (t.gone) return `<p class="vz-msg">This template (${esc(t.block.id)}) is deleted, or it is not set up in this workspace. Its issued reports are kept.</p>${cyclesHtml(t)}`;
|
|
356
356
|
const cur = s.status === 'paused' ? 'off' : s.schedule;
|
|
357
|
-
const want = t.block.schedule && !sameSched(t.block.schedule, cur) ? `<div class="vz-ask"><p>
|
|
357
|
+
const want = t.block.schedule && !sameSched(t.block.schedule, cur) ? `<div class="vz-ask"><p>PMOS proposes: <b>${esc(schedWords(t.block.schedule))}</b></p><div>${btn('sched-use', 'Change the schedule', { off: t.busy })}</div></div>` : '';
|
|
358
358
|
return `<div class="rp-brief"><p class="rp-lbl">At a glance</p>${glance(s.purpose, s.audience, schedHtml(t, cur) + (s.next_draft ? ` <span class="vz-note">next draft ${esc(s.next_draft.slice(0, 10))}</span>` : ''), OUT[s.output] || s.output)}</div>${want}`
|
|
359
359
|
+ `<div class="vz-sg" role="group" aria-label="Step"><button type="button" data-rt="view|structure" aria-pressed="${t.view === 'structure'}">Structure</button><button type="button" data-rt="view|design" aria-pressed="${t.view === 'design'}">Design</button></div>`
|
|
360
360
|
+ (t.view === 'design' ? designHtml(t) : structureHtml(t)) + cyclesHtml(t)
|
|
@@ -374,7 +374,7 @@ function structureHtml(t) {
|
|
|
374
374
|
const L = plan && plan.outline ? plan.outline.map((x) => [x.title, x.notes || '']) : FRAME;
|
|
375
375
|
const want = shapeOf(t.block);
|
|
376
376
|
const ask = want && !(S && S.running) ? `<div class="vz-ask"><p>Your change: <b>“${esc(want)}”</b></p><div>${btn('s-turn', 'Make the next version', { off: t.busy })}</div></div>` : '';
|
|
377
|
-
const working = S && S.running ? '<p class="vz-msg rp-wait" role="status">
|
|
377
|
+
const working = S && S.running ? '<p class="vz-msg rp-wait" role="status">PMOS is reshaping the sections to your change. It takes a minute or two; Use this shows here when it is ready.</p>' : '';
|
|
378
378
|
const held = t.busy || !!(S && S.running); // a running job holds only these two; Discard and Delete template stay free
|
|
379
379
|
const save = shown != null && S && shown !== S.saved ? btn('s-accept', 'Use this', { off: held }) : '';
|
|
380
380
|
const undo = V.some((v) => v.n < (S ? S.current : 0)) ? btn('s-undo', 'Undo', { sec: true, off: held }) : '';
|
|
@@ -387,7 +387,7 @@ function designHtml(t) {
|
|
|
387
387
|
if (Z.err) return `<p class="vz-msg">${esc(Z.err)}</p>`;
|
|
388
388
|
const V = Z.versions || [], saved = Z.saved ? Z.saved.version : null, s = t.setup || {};
|
|
389
389
|
const ask = t.block.design && !Z.running ? `<div class="vz-ask"><p>Your change: <b>“${esc(t.block.design)}”</b></p><div>${btn('d-turn', 'Make the next version', { off: t.busy })}</div></div>` : '';
|
|
390
|
-
const working = Z.running ? '<p class="vz-msg rp-wait" role="status">
|
|
390
|
+
const working = Z.running ? '<p class="vz-msg rp-wait" role="status">PMOS is making the look. It takes a minute or two; Use it shows here when it is ready.</p>' : '';
|
|
391
391
|
const preview = t.dv != null && t.dv !== saved;
|
|
392
392
|
const head = `<div class="vz-r1"><div class="rp-grow"><h2 class="rp-h2">${esc(s.name || t.block.id)}</h2><p class="vz-note">${esc([s.audience, OUT[s.output] || s.output, s.status === 'paused' ? 'not scheduled' : 'goes out ' + schedWords(s.schedule).replace(/^./, (c) => c.toLowerCase())].filter(Boolean).join(' · '))}</p></div>`
|
|
393
393
|
+ (preview ? '<span class="cz-pill you">Previewing new look</span>' : t.dv != null ? '<span class="cz-pill ok">Saved look</span>' : '') + '</div>';
|
|
@@ -483,7 +483,7 @@ async function press(t, e) {
|
|
|
483
483
|
if (a === 's-accept') { await act(t, async () => { const r = await post('/api/report-structure/accept', { id, n: t.sv }); if (!r || !r.ok) return why(r, 'The structure was not saved.'); t.S = r.structure;
|
|
484
484
|
// the open draft is written again with these sections, so the PM reads the report they asked for now, not next cycle (batch 22 item 13)
|
|
485
485
|
const d = await post('/api/report-setups/draft', { id });
|
|
486
|
-
return 'S' + t.sv + ' is saved. ' + (d && d.ok ? '
|
|
486
|
+
return 'S' + t.sv + ' is saved. ' + (d && d.ok ? 'PMOS is writing the draft again with these sections. It opens under Reports when it lands.' : 'The next cycle follows it. The draft was not written again: ' + why(d, 'no answer') + '.'); }); return; }
|
|
487
487
|
if (a === 's-undo') { const V = t.S.versions.filter((x) => x.n < t.S.current); const to = V[V.length - 1].n; await act(t, async () => { const r = await post('/api/report-structure/revert', { id, n: to }); if (!r || !r.ok) return why(r, 'Undo did not go through.'); t.S = r.structure; t.sv = t.S.current; return 'Back to S' + to + '.'; }); return; }
|
|
488
488
|
if (a === 'd-accept') { await act(t, async () => { const r = await post('/api/report-design/accept', { id, n: t.dv }); if (!r || !r.ok) return why(r, 'The design was not saved.'); t.Z = r.design; return 'Using the new look (D' + t.dv + '). The next cycle follows it, and every section and figure stays.'; }); return; }
|
|
489
489
|
if (a === 'd-keep') {
|
|
@@ -535,7 +535,7 @@ async function startLook(t, id, look) {
|
|
|
535
535
|
const d = await post('/api/report-design/turn', { id, text, points: [] });
|
|
536
536
|
if (!d || !d.ok) { t.block = Object.assign({}, t.block, { design: text }); return ' The look did not start: ' + why(d, 'no answer') + '. Press Make the next version to try again.'; }
|
|
537
537
|
t.Z = Object.assign({}, t.Z, { running: true }); poll(t, 'design');
|
|
538
|
-
return '
|
|
538
|
+
return ' PMOS is making the look' + (added ? ' from ' + added : '') + ' now.';
|
|
539
539
|
}
|
|
540
540
|
/** Draft it (RfH4, RfH7): the answers set the report up, T1 and the conversation are recorded, and its current state opens (RfH1). */
|
|
541
541
|
async function setUp(t) {
|
|
@@ -555,11 +555,11 @@ async function setUp(t) {
|
|
|
555
555
|
let shaping = '';
|
|
556
556
|
if (shape) {
|
|
557
557
|
const s2 = await post('/api/report-structure/turn', { id: r.setup.id, text: shape });
|
|
558
|
-
shaping = s2 && s2.ok ? '
|
|
558
|
+
shaping = s2 && s2.ok ? ' PMOS is reshaping the sections to your change.' : ' The change to its sections did not start: ' + why(s2, 'no answer') + '.';
|
|
559
559
|
}
|
|
560
560
|
// the look Claude proposed with it (batch 22 item 13): the PM's words, and the file to follow
|
|
561
561
|
if (look.text || look.sample) shaping += await startLook(t, r.setup.id, look);
|
|
562
562
|
const d = r.drafted || {};
|
|
563
|
-
const first = d.drafting ? "The report's own session is drafting it." : d.path ? 'The first draft is written.
|
|
563
|
+
const first = d.drafting ? "The report's own session is drafting it." : d.path ? 'The first draft is written. PMOS reads it as your readers would.' : 'The first draft was not written' + (d.error ? ': ' + d.error : '') + '.';
|
|
564
564
|
return current(t, first + (once ? ' It goes out once.' : '') + shaping);
|
|
565
565
|
}
|
|
@@ -275,14 +275,14 @@ export async function openSources() {
|
|
|
275
275
|
* opens the list. Nothing here writes: a message goes through the same ask route as every other conversation. */
|
|
276
276
|
export function openChatPage(key, label) {
|
|
277
277
|
const say = label
|
|
278
|
-
? 'Talk to
|
|
279
|
-
: 'Talk to
|
|
280
|
-
openDlg({ eye: label ? 'Chat · ' + label : 'Chat', title: label ? 'Ask about ' + label : 'Chat', say, stream: turnA(ptx(say)), noteKey: key, pane: `<article class="paper doc"><p class="note">${esc(label ? 'This conversation is about ' + label + '. Files
|
|
278
|
+
? 'Talk to PMOS about ' + label + '. It works in a real Claude Code session: it can read, change files, run commands and take slash commands.'
|
|
279
|
+
: 'Talk to PMOS. It works in a real Claude Code session: it can read, change files, run commands and take slash commands. Pick another session from the list.';
|
|
280
|
+
openDlg({ eye: label ? 'Chat · ' + label : 'Chat', title: label ? 'Ask about ' + label : 'Chat', say, stream: turnA(ptx(say)), noteKey: key, pane: `<article class="paper doc"><p class="note">${esc(label ? 'This conversation is about ' + label + '. Files PMOS opens show here.' : 'Files PMOS opens show here.')}</p></article>`, paneEmpty: true, label: label || 'Chat', sessions: true });
|
|
281
281
|
if (chatPage()) { // the held-open chat (desktop Home) leaves the page live; on a phone Home's chat is a popup and keeps openDlg's veil and inert page
|
|
282
282
|
document.documentElement.style.overflow = '';
|
|
283
283
|
$('#veil').classList.remove('on');
|
|
284
284
|
}
|
|
285
|
-
$('#askIn').placeholder = label ? 'Message
|
|
285
|
+
$('#askIn').placeholder = label ? 'Message PMOS about ' + label : 'Message PMOS, or type /';
|
|
286
286
|
if (desk()) setFull(true); else setTab('chat');
|
|
287
287
|
vwShutPane(); // premium-chat-viewer V1: the conversation has the room until something opens in the viewer
|
|
288
288
|
loadThread(key);
|
|
@@ -341,7 +341,7 @@ export function openDlg(o) {
|
|
|
341
341
|
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail';
|
|
342
342
|
if (o.paneEmpty) $('#oMain').dataset.empty = '1'; else delete $('#oMain').dataset.empty; // a placeholder note is not a tab (premium-chat-viewer V2)
|
|
343
343
|
vwReset(); // extra viewer tabs belong to the dialog that opened them
|
|
344
|
-
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div>${attachRowMarkup()}${attachMarkup()}<textarea id="askIn" rows="1" placeholder="Message
|
|
344
|
+
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div>${attachRowMarkup()}${attachMarkup()}<textarea id="askIn" rows="1" placeholder="Message PMOS, or type /" maxlength="8000" autocomplete="off" enterkeyhint="send" aria-label="A message for PMOS" aria-controls="slashM"></textarea><button type="submit" data-act="ask" id="askGo" aria-label="Send to PMOS" title="Send to PMOS"><svg class="i" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></form><div class="askfoot"><p class="fine2" id="askNote">${CHAT_NOTE}</p></div>`;
|
|
345
345
|
mountNotes({ getKey: () => S.key, ws: new URLSearchParams(location.search).get('ws'), input: $('#askIn'), note: $('#askNote'), show: () => { if (!desk()) setTab('out'); }, toChat: () => { if (!desk()) setTab('chat'); } });
|
|
346
346
|
mountAttach({ getKey: () => S.key, input: $('#askIn'), note: $('#askNote'), onSlash: () => { const i = $('#askIn'); if (!i.value.startsWith('/')) i.value = '/' + i.value; i.focus(); drawSlash(); growAsk(); }, onPad: () => openNotes() });
|
|
347
347
|
quietNote();
|
|
@@ -485,7 +485,7 @@ const INTERRUPT = /^\[Request interrupted by user/;
|
|
|
485
485
|
export function sessionHtml(c, goal = null, { answer = false } = {}) {
|
|
486
486
|
if (!c) return '';
|
|
487
487
|
if (c.state === 'ended' && !(c.messages || []).length) return turnAgent('<p class="tt" role="status">This session has ended. Your next message starts a new one.</p>');
|
|
488
|
-
if (c.state !== 'conv' && c.state !== 'ended') return turnAgent(`<p class="tt" role="status">${esc(c.missing || '
|
|
488
|
+
if (c.state !== 'conv' && c.state !== 'ended') return turnAgent(`<p class="tt" role="status">${esc(c.missing || 'PMOS is starting.')}</p>`);
|
|
489
489
|
const msgs = c.messages || [], last = msgs.length - 1;
|
|
490
490
|
const waiting = !c.ask && c.turn !== 'agent' && c.turn !== 'tool';
|
|
491
491
|
const ctx = new Map(turnsOf(msgs, waiting || c.state === 'ended').filter((t) => t.done).map((t) => [t.at, t.items])); // premium-chat-viewer slice 2
|
|
@@ -500,13 +500,13 @@ export function sessionHtml(c, goal = null, { answer = false } = {}) {
|
|
|
500
500
|
}
|
|
501
501
|
const g = splitGoal(m.text), rp = splitReport(g.text); // premium-reports-from-chat: a pmos-report block becomes a chip that opens the Report tab
|
|
502
502
|
const live = i === last && waiting && !!goal && goal.state === 'grilling';
|
|
503
|
-
return turnAgent(`<p class="agtag">
|
|
503
|
+
return turnAgent(`<p class="agtag">PMOS</p>${rp.text ? mdHtml(rp.text) : ''}${goalBlockHtml(g.block, { live, state: goal && goal.state })}${reportChipHtml(rp.block, i)}${chipsHtml(ctx.get(i))}`);
|
|
504
504
|
});
|
|
505
505
|
if (goalProgressHtml(goal)) out.push(goalChipHtml(goal)); // the goal itself is in the viewer's Goal tab (goalView below)
|
|
506
506
|
// item-chat-history: an ended session keeps its conversation on the item; the next message picks it up
|
|
507
507
|
if (c.state === 'ended') out.push(turnAgent('<p class="tt" role="status">This session has ended. Your conversation is kept here, and your next message picks it up.</p>'));
|
|
508
|
-
else if (c.ask) out.push(turnAgent(`<p class="agtag">
|
|
509
|
-
else if (c.turn === 'agent' || c.turn === 'tool') out.push(turnAgent(`<p class="tt" role="status">${c.turn === 'tool' && c.openCall ? 'Running ' + esc(c.openCall) + '.' : '
|
|
508
|
+
else if (c.ask) out.push(turnAgent(`<p class="agtag">PMOS asks before it goes on</p><p class="tt">${esc(c.ask.question)}</p><div class="chatopts">${(c.ask.options || []).map((o) => `<button type="button" class="cta alt" data-chat-press="${esc(o.n)}">${esc(o.label)}</button>`).join('')}</div>`));
|
|
509
|
+
else if (c.turn === 'agent' || c.turn === 'tool') out.push(turnAgent(`<p class="tt" role="status">${c.turn === 'tool' && c.openCall ? 'Running ' + esc(c.openCall) + '.' : 'PMOS is working.'} <button type="button" class="cta alt" data-chat-press="esc">Stop</button></p>`));
|
|
510
510
|
return out.join('');
|
|
511
511
|
}
|
|
512
512
|
let threadTimer = null;
|
|
@@ -588,7 +588,7 @@ export function drawThread(th, key, conv) {
|
|
|
588
588
|
goalView(key, conv);
|
|
589
589
|
reportAuto(key, conv);
|
|
590
590
|
const go = $('#askGo'); if (go) go.disabled = !!th.working; // an earlier read-only run still answering
|
|
591
|
-
const n = $('#askNote'); if (n) n.textContent = th.working ? 'The agent is answering. You can write again when it has.' : conv && conv.ask ? '
|
|
591
|
+
const n = $('#askNote'); if (n) n.textContent = th.working ? 'The agent is answering. You can write again when it has.' : conv && conv.ask ? 'PMOS is waiting for your answer above.' : CHAT_NOTE;
|
|
592
592
|
if (atEnd) b.scrollTop = b.scrollHeight;
|
|
593
593
|
}
|
|
594
594
|
export async function loadThread(key) {
|
|
@@ -739,7 +739,7 @@ async function sendText(key, text, files) {
|
|
|
739
739
|
const res = await chatPost('ask', files && files.length ? { key, text, files, ...ctx } : { key, text, ...ctx });
|
|
740
740
|
if (go) go.disabled = false;
|
|
741
741
|
if (!res || res.ok !== true) { $('#askNote').textContent = (res && res.error) || 'The message was not sent.'; return false; }
|
|
742
|
-
$('#askNote').textContent = res.started ? '
|
|
742
|
+
$('#askNote').textContent = res.started ? 'PMOS is starting a session for this.' : 'Sent.';
|
|
743
743
|
const b = $('#dBody'); b.scrollTop = b.scrollHeight;
|
|
744
744
|
loadThread(key);
|
|
745
745
|
return true;
|
|
@@ -771,11 +771,11 @@ async function onGoalPress(e) {
|
|
|
771
771
|
if (!S.key || (!say && !gb)) return;
|
|
772
772
|
if (say) { say.disabled = true; await sendText(S.key, say.dataset.chatSay); return; }
|
|
773
773
|
const act = gb.dataset.goal;
|
|
774
|
-
if (act === 'change') { const inp = $('#askIn'); inp.placeholder = 'Tell
|
|
774
|
+
if (act === 'change') { const inp = $('#askIn'); inp.placeholder = 'Tell PMOS what to change'; inp.focus(); return; }
|
|
775
775
|
if (!S.goal) return;
|
|
776
776
|
gb.disabled = true;
|
|
777
777
|
const r = await chatPost('goal', { key: S.key, id: S.goal.id, act, draft: S.draft });
|
|
778
|
-
$('#askNote').textContent = r && r.ok ? ({ start: '
|
|
778
|
+
$('#askNote').textContent = r && r.ok ? ({ start: 'PMOS is starting on the goal.', cancel: 'The goal is cancelled.', stop: 'The goal is stopped.' }[act]) : (r && r.error) || 'The press did not reach the session.';
|
|
779
779
|
loadThread(S.key);
|
|
780
780
|
}
|
|
781
781
|
$('#dBody').addEventListener('click', onGoalPress);
|
|
@@ -809,7 +809,7 @@ $('#dBody').addEventListener('submit', async (e) => {
|
|
|
809
809
|
e.preventDefault();
|
|
810
810
|
const inp = $('#askIn'), text = inp.value.trim(), key = S.key;
|
|
811
811
|
if (!key && S.sid) { // premium-session-list: a session the list opened that has no row of its own
|
|
812
|
-
if (!text) { $('#askNote').textContent = 'Write a message for
|
|
812
|
+
if (!text) { $('#askNote').textContent = 'Write a message for PMOS.'; return; }
|
|
813
813
|
const id = S.sid, pk = 'sid:' + id, p = pendAdd(pk, text);
|
|
814
814
|
inp.value = ''; drawSlash(); growAsk(); pendDraw(pk); // the turn shows at once (batch 24 item 2)
|
|
815
815
|
const r = await pmPost('/api/session/say', { id, text }).catch(() => null);
|
|
@@ -824,11 +824,11 @@ $('#dBody').addEventListener('submit', async (e) => {
|
|
|
824
824
|
if (!key) { $('#askNote').textContent = 'This row has no conversation, so the message was not sent.'; return; }
|
|
825
825
|
const files = attachNames();
|
|
826
826
|
if (files === null) { $('#askNote').textContent = 'A file is still saving. Send when its chip shows its size.'; return; }
|
|
827
|
-
if (!text && !files.length) { $('#askNote').textContent = 'Write a message for
|
|
827
|
+
if (!text && !files.length) { $('#askNote').textContent = 'Write a message for PMOS.'; return; }
|
|
828
828
|
// the turn shows and the box empties at once (batch 24 item 2); a send that fails takes the turn away and puts the words back
|
|
829
829
|
const p = pendAdd(key, text, files);
|
|
830
830
|
inp.value = ''; drawSlash(); growAsk(); pendDraw(key);
|
|
831
|
-
if (await sendText(key, text, files)) { p.sent = true; inp.placeholder = 'Message
|
|
831
|
+
if (await sendText(key, text, files)) { p.sent = true; inp.placeholder = 'Message PMOS, or type /'; clearAttach(); pendDraw(key); }
|
|
832
832
|
else {
|
|
833
833
|
PEND.list = pendOf(key).filter((x) => x !== p); pendDraw(key);
|
|
834
834
|
if (S.key === key && !inp.value) { inp.value = text; growAsk(); }
|
|
@@ -1459,7 +1459,7 @@ function pickSession(id) {
|
|
|
1459
1459
|
$('#dlg').classList.remove('srl-open');
|
|
1460
1460
|
$('#dEye').textContent = r.group === 'pmos' ? 'Started by PMOS' : r.goal ? 'Goal' : 'Session'; $('#dTitle').textContent = r.name; $('#dSub').hidden = true;
|
|
1461
1461
|
const st = $('#dBody .stream'); if (st) clearHtml(st);
|
|
1462
|
-
$('#askF').hidden = !!r.headless; $('#askIn').value = ''; $('#askIn').placeholder = r.key ? 'Message
|
|
1462
|
+
$('#askF').hidden = !!r.headless; $('#askIn').value = ''; $('#askIn').placeholder = r.key ? 'Message PMOS, or type /' : 'Message this session';
|
|
1463
1463
|
if (r.key) { S.sid = null; S.key = r.key; loadThread(r.key); } else { S.key = null; S.sid = id; loadSid(id); }
|
|
1464
1464
|
syncAttach(); syncNotes();
|
|
1465
1465
|
sessionCard(r); railDraw();
|
|
@@ -1477,7 +1477,7 @@ async function loadSid(id) {
|
|
|
1477
1477
|
const b = $('#dBody'), atEnd = b.scrollHeight - b.scrollTop - b.clientHeight < 80;
|
|
1478
1478
|
if (c && c.ok) PEND.sidConv = c;
|
|
1479
1479
|
putHtml(box, c && c.ok ? sessionHtml(c) + pendHtml('sid:' + id, c) : turnA(ptx('The conversation of this session could not be read.')));
|
|
1480
|
-
$('#askNote').textContent = c && c.ask ? '
|
|
1480
|
+
$('#askNote').textContent = c && c.ask ? 'PMOS is waiting for your answer above.' : 'Your message goes to this session.';
|
|
1481
1481
|
if (atEnd) b.scrollTop = b.scrollHeight;
|
|
1482
1482
|
if (c && c.ok && c.state !== 'ended' && $('#dlg').classList.contains('on')) R.sidTimer = setTimeout(() => loadSid(id), 2000);
|
|
1483
1483
|
}
|
|
@@ -34,8 +34,8 @@ export function chipsHtml(items) {
|
|
|
34
34
|
fold = items.filter((it) => !shown.includes(it));
|
|
35
35
|
}
|
|
36
36
|
const id = fold.length ? foldId(fold) : '';
|
|
37
|
-
const more = fold.length ? `<details class="ctxmore" role="listitem" data-ctx-fold="${esc(id)}"${OPEN.has(id) ? ' open' : ''}><summary aria-label="${fold.length} more files and pages
|
|
38
|
-
return `<div class="ctxc" role="list" aria-label="What
|
|
37
|
+
const more = fold.length ? `<details class="ctxmore" role="listitem" data-ctx-fold="${esc(id)}"${OPEN.has(id) ? ' open' : ''}><summary aria-label="${fold.length} more files and pages PMOS read">+${fold.length} read</summary><div class="ctxc">${fold.map((it) => chipHtml(it, false)).join('')}</div></details>` : '';
|
|
38
|
+
return `<div class="ctxc" role="list" aria-label="What PMOS worked with">${shown.map((it, i) => chipHtml(it, i === 0)).join('')}${more}</div>`;
|
|
39
39
|
}
|
|
40
40
|
if (typeof document !== 'undefined') document.addEventListener('toggle', (e) => { const d = e.target; if (!d || !d.dataset || d.dataset.ctxFold == null) return; if (d.open) OPEN.add(d.dataset.ctxFold); else OPEN.delete(d.dataset.ctxFold); }, true);
|
|
41
41
|
/** An item from a chip's data attributes. */
|
|
@@ -61,7 +61,7 @@ export function ticketHtml(key, t) {
|
|
|
61
61
|
/** The Slack tab as HTML. Pure. */
|
|
62
62
|
export function slackHtml(it) {
|
|
63
63
|
const what = it.url ? 'A Slack message' : it.ts ? 'A message in a Slack channel' : 'A Slack channel';
|
|
64
|
-
return `<div class="vwdoc"><div class="vwfnone" role="status"><b>${esc(what)}</b><p class="vwmut">
|
|
64
|
+
return `<div class="vwdoc"><div class="vwfnone" role="status"><b>${esc(what)}</b><p class="vwmut">PMOS worked with this in Slack. PMOS keeps no copy of Slack messages, so it opens in Slack.</p>`
|
|
65
65
|
+ `<div class="vwrow"><a class="vwbtn pri" href="${esc(slackUrl(it))}" target="_blank" rel="noopener noreferrer">Open in Slack</a></div><code>${esc(it.url || it.channel + (it.ts ? ' · ' + it.ts : ''))}</code></div></div>`;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -76,7 +76,7 @@ export async function openTicket(o) {
|
|
|
76
76
|
const R = await TV.readTicket({ ws, board, ini: initiative, ref });
|
|
77
77
|
if (!R.model.ok) {
|
|
78
78
|
el.innerHTML = ticketHtml(R.model);
|
|
79
|
-
const rd = el.querySelector('[data-jread]'); if (rd) rd.onclick = async () => { rd.disabled = true; toast(await askHere(readAsk(ref)) ? '
|
|
79
|
+
const rd = el.querySelector('[data-jread]'); if (rd) rd.onclick = async () => { rd.disabled = true; toast(await askHere(readAsk(ref)) ? 'PMOS is reading ' + ref + ' in this popup\'s chat.' : 'Open the ticket from its popup to read it.'); };
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
// the header names the ticket by its key and its title, not the key alone (batch 14 item 12: "MSD-4329" alone said nothing)
|
|
@@ -175,7 +175,7 @@ function viewFound() {
|
|
|
175
175
|
}
|
|
176
176
|
if (S.review !== 'sources' && (S.item || S.setup.item)) {
|
|
177
177
|
const item = S.item || S.setup.item;
|
|
178
|
-
return `<h1 id="wlH" tabindex="-1">Your first task is ready</h1><p class="wl-lede">${esc(item.title)}</p><p>${item.due ? 'Due ' + esc(item.due) : 'Added to Today'}</p><p>Open it on Home to set a date, mark it done, or brief
|
|
178
|
+
return `<h1 id="wlH" tabindex="-1">Your first task is ready</h1><p class="wl-lede">${esc(item.title)}</p><p>${item.due ? 'Due ' + esc(item.due) : 'Added to Today'}</p><p>Open it on Home to set a date, mark it done, or brief PMOS when connected.</p>${err()}${foot(btn('back', 'Add more work', { alt: true }), btn('finish', 'Open Home'))}`;
|
|
179
179
|
}
|
|
180
180
|
return `<h1 id="wlH" tabindex="-1">Here’s what PMOS found</h1>${readSummary()}${S.readItems.length ? '<ul class="wl-list">' + S.readItems.map(i => '<li>' + esc(i.title || i.key || 'Work item') + '</li>').join('') + '</ul>' : '<p>A completed read may contain no open items in this scope. Review your sources on Home or add a task.</p>'}${err()}${foot(btn('back', 'Add or change work', { alt: true }), btn('finish', 'Use these reads and open Home'))}`;
|
|
181
181
|
}
|
|
@@ -37,7 +37,7 @@ export function sugHtml(p, st) {
|
|
|
37
37
|
const S = suggestOrder(st, p);
|
|
38
38
|
if (!S.differs) return '';
|
|
39
39
|
const dot = notNow()[p.id] !== S.sig;
|
|
40
|
-
return `<button type="button" class="po-sug" data-po-sug="${esc(p.id)}" aria-haspopup="dialog" aria-label="
|
|
40
|
+
return `<button type="button" class="po-sug" data-po-sug="${esc(p.id)}" aria-haspopup="dialog" aria-label="PMOS suggests an order from the dates${dot ? '. The dates disagree with the order' : ''}" title="PMOS suggests an order from the dates">${SV(SPARK, 1.8)}${dot ? '<span class="po-nd" aria-hidden="true"></span>' : ''}</button>`;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
let O = null;
|
|
@@ -115,7 +115,7 @@ function openPop(btn) {
|
|
|
115
115
|
+ S.rows.map((r) => `<div class="po-so${r.moved ? ' mv' : ''}${r.none ? ' nod' : ''}"><span class="n">${r.n}</span><b>${esc(r.title)}</b>`
|
|
116
116
|
+ (r.none ? `<button type="button" class="po-adb" data-po-dates="${esc(r.id)}" aria-label="Add dates to ${esc(r.title)}" title="Add dates">${SV(CAL, 1.8)}</button>` : `<span class="dt">${esc(r.range)}</span>`)
|
|
117
117
|
+ `<span class="r">${esc(r.reason)}</span></div>`).join('')
|
|
118
|
-
+ `<div class="po-acts"><button type="button" class="po-ib soft" data-po-no aria-label="Not now.
|
|
118
|
+
+ `<div class="po-acts"><button type="button" class="po-ib soft" data-po-no aria-label="Not now. PMOS asks again only when a date changes" title="Not now">${SV(X, 1.8)}</button>`
|
|
119
119
|
+ `<button type="button" class="po-ib ok" data-po-use aria-label="Use this order" title="Use this order">${SV(OK, 2)}</button></div>`;
|
|
120
120
|
document.body.appendChild(el);
|
|
121
121
|
const b = btn.getBoundingClientRect(), w = Math.min(420, window.innerWidth - 24);
|
|
@@ -198,7 +198,7 @@ function rowHtml(m, P) {
|
|
|
198
198
|
: `<button type="button" class="pc-ib del" data-pc="del" data-m="${esc(m.id)}" aria-label="${esc('Delete ' + (m.name || 'this milestone'))}" title="Delete">${SV(I.del, 15)}</button>`;
|
|
199
199
|
const late = !gone.length && lateOf(m, C.st.inis);
|
|
200
200
|
// Claude's change, filled in from the pencil (canvas XmsgB): what it was, and what Save does
|
|
201
|
-
const chg = m.sug ? `<p class="msg-chg">${SV(I.spark, 13)}<span>
|
|
201
|
+
const chg = m.sug ? `<p class="msg-chg">${SV(I.spark, 13)}<span>PMOS's change${m.was ? ', was ' + esc(m.was) : ''}, ready to save. Edit it, then Save.</span></p>` : '';
|
|
202
202
|
const risk = m.risk && !m.done && !m.fixed ? `<p class="msg-risk"><i class="pc-wdot" aria-hidden="true"></i><span>At risk: ${esc(m.risk)}</span><button type="button" class="pc-ib" data-pc="unrisk" data-m="${esc(m.id)}" aria-label="${esc('No longer at risk: ' + (m.name || 'this milestone'))}" title="No longer at risk">${SV(I.x, 14)}</button></p>` : '';
|
|
203
203
|
const warn = gone.length ? `${esc(C.o.nameOf(gone[0].ini) || gone[0].ini)} left the program. Pick another initiative, or tick it yourself.`
|
|
204
204
|
: late ? `${esc(late.title)} is set to ${late.label === 'Deliver' ? 'deliver' : 'pass ' + esc(late.label)} on ${esc(shortDay(late.date))}, after this date.` : '';
|
|
@@ -222,14 +222,14 @@ function msHtml(D, P) {
|
|
|
222
222
|
}
|
|
223
223
|
h += open.map((m) => rowHtml(m, P)).join('');
|
|
224
224
|
if (!full) h += `<button type="button" class="pc-ln addl" data-pc="add">${SV(I.plus, 15, 2)}Add a milestone</button>`;
|
|
225
|
-
return `<section class="pc-ms" id="pcMs" aria-label="Milestones"><div class="pc-lbl">Milestones${lim}</div>${checkedHtml()}${C.dropped ? `<p class="msg-chg">${SV(I.spark, 13)}<span>
|
|
225
|
+
return `<section class="pc-ms" id="pcMs" aria-label="Milestones"><div class="pc-lbl">Milestones${lim}</div>${checkedHtml()}${C.dropped ? `<p class="msg-chg">${SV(I.spark, 13)}<span>PMOS's change: ${esc(C.dropped)} is dropped. Save to keep the change, or Discard.</span></p>` : ''}<div class="pc-ml" role="list">${h}</div></section>`;
|
|
226
226
|
}
|
|
227
227
|
/** When Claude last checked the milestones, and Check now (canvas XmsgB): the line lives here, so the PM can see the checks run. */
|
|
228
228
|
function checkedHtml() {
|
|
229
229
|
if (!C.o.review) return '';
|
|
230
230
|
const R = C.o.review() || {}, run = !!(R.running || C.checking);
|
|
231
231
|
const when = R.checked ? lastWhen(R.checked) : '';
|
|
232
|
-
const line = run ? '
|
|
232
|
+
const line = run ? 'PMOS is checking the milestones now.' : 'PMOS checks every Monday and when a date, Jira or a meeting changes.' + (when ? ' Last checked ' + when + '.' : '');
|
|
233
233
|
return `<div class="msg-chk">${faceOr(run ? 'thinking' : 'handled', 's', SV('M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0', 14), { label: false })}<span>${esc(line)}</span>${C.o.checkNow ? `<button type="button" class="msg-ib${run ? ' on' : ''}" data-pc="checknow" aria-label="Check now" title="Check now"${run ? ' disabled' : ''}>${SV('M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7', 15)}</button>` : ''}</div>`;
|
|
234
234
|
}
|
|
235
235
|
/** "today, 09:12", "yesterday, 17:40" or "Oct 21". */
|
|
@@ -305,7 +305,7 @@ export function suggestOrder(st, p) {
|
|
|
305
305
|
const { d } = x, prev = k ? seq[k - 1].i.title : '';
|
|
306
306
|
const range = d.start && d.end ? shortDay(d.start) + ' – ' + shortDay(d.end) : d.start ? 'from ' + shortDay(d.start) : d.end ? 'to ' + shortDay(d.end) : d.ms ? '◆ ' + shortDay(d.ms.date) : '';
|
|
307
307
|
let reason;
|
|
308
|
-
if (!x.key) reason = 'No dates yet, so it goes last. Add dates and
|
|
308
|
+
if (!x.key) reason = 'No dates yet, so it goes last. Add dates and PMOS checks again.';
|
|
309
309
|
else if (d.start) reason = k === 0 ? 'Starts first, on ' + shortDay(d.start) + '.' : seq[k - 1].d.start === d.start ? 'Starts the same day as ' + prev + ' and finishes later.' : 'Starts ' + shortDay(d.start) + ', after ' + prev + '.';
|
|
310
310
|
else if (d.ms) reason = 'No start date. Its ◆ ' + d.ms.name + ' is ' + shortDay(d.ms.date) + '.';
|
|
311
311
|
else reason = 'No start date. It finishes ' + shortDay(d.end) + '.';
|
|
@@ -27,14 +27,14 @@ export async function readLib(ws) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const sw = (scope, r) => `<button type="button" class="rl-sw${r.on ? ' on' : ''}" role="switch" aria-checked="${!!r.on}" aria-label="${esc((r.on ? 'Stop drafting ' : 'Draft ') + r.name)}" data-rl="switch" data-scope="${esc(scope)}" data-kind="${esc(r.kind)}"><i></i></button>`;
|
|
30
|
-
const row = (scope, r) => `<div class="rl-row"><span class="rl-t"><b>${r.pick ? '<span class="rl-pk" aria-label="
|
|
30
|
+
const row = (scope, r) => `<div class="rl-row"><span class="rl-t"><b>${r.pick ? '<span class="rl-pk" aria-label="PMOS\'s pick">✦</span> ' : ''}${esc(r.name)}</b>${r.sub ? `<small>${esc(r.sub)}</small>` : ''}</span>${sw(scope, r)}</div>`;
|
|
31
31
|
|
|
32
32
|
/** The library's ready-made part, as html. Zero is silence: no group draws nothing. */
|
|
33
33
|
export function libHtml(L, o = {}) {
|
|
34
34
|
if (!L || !(L.groups || []).length) return '';
|
|
35
35
|
const open = o.open || new Set();
|
|
36
36
|
const lead = L.lead && L.lead.text ? `<div class="rl-lead"><span class="rl-sp">${SV(I.spark, 16)}</span><p><b>${esc(L.lead.text)}</b>${L.lead.rest ? ' ' + esc(L.lead.rest) : ''}</p>`
|
|
37
|
-
+ `<button type="button" class="rl-ok" data-rl="picks" aria-label="Keep
|
|
37
|
+
+ `<button type="button" class="rl-ok" data-rl="picks" aria-label="Keep PMOS's picks" title="Keep PMOS's picks">${SV(I.chk, 18, 2.4)}</button></div>` : '';
|
|
38
38
|
const ov = L.overlap && L.overlap.lead ? `<div class="rl-lead"><span class="rl-sp">${SV(I.spark, 16)}</span><p><b>${esc(L.overlap.lead)}</b>${L.overlap.rest ? ' ' + esc(L.overlap.rest) : ''}</p>`
|
|
39
39
|
+ `<button type="button" class="rl-ok" data-rl="overlap" aria-label="Send one update that carries the others" title="Send one update that carries the others">${SV(I.merge, 18, 2.2)}</button></div>`
|
|
40
40
|
+ ((L.overlap.people || []).length ? `<h4 class="rl-h">${esc(L.overlap.title || 'Who gets what')}</h4><div class="rl-card">${L.overlap.people.map((p) => `<div class="rl-row"><span class="rl-av">${SV(I.people, 16)}</span><span class="rl-t"><b>${esc(p.who)}</b>${p.sub ? `<small>${esc(p.sub)}</small>` : ''}</span></div>`).join('')}</div>` : '') : '';
|
|
@@ -54,8 +54,8 @@ export function wireLib(el, h) {
|
|
|
54
54
|
if (a === 'fold') { const k = b.dataset.k; if (h.open.has(k)) h.open.delete(k); else h.open.add(k); h.redraw(); return; }
|
|
55
55
|
b.disabled = true;
|
|
56
56
|
const done = async (r, ok) => { if (!r || r.ok === false) { b.disabled = false; h.toast((r && r.error) || 'Nothing was changed. The server did not say why.'); return; } h.toast(ok); await h.reload(); };
|
|
57
|
-
if (a === 'switch') { const on = b.getAttribute('aria-checked') !== 'true'; return done(await Promise.resolve(pmPost('/api/ready-reports/switch', { ws: h.ws || undefined, scope: b.dataset.scope, kind: b.dataset.kind, on })).catch(() => null), on ? 'On.
|
|
58
|
-
if (a === 'picks') return done(await Promise.resolve(pmPost('/api/ready-reports/picks', { ws: h.ws || undefined })).catch(() => null), 'Kept. Only
|
|
57
|
+
if (a === 'switch') { const on = b.getAttribute('aria-checked') !== 'true'; return done(await Promise.resolve(pmPost('/api/ready-reports/switch', { ws: h.ws || undefined, scope: b.dataset.scope, kind: b.dataset.kind, on })).catch(() => null), on ? 'On. PMOS drafts it at its moment; nothing goes out until you approve it.' : 'Off. PMOS no longer drafts it.'); }
|
|
58
|
+
if (a === 'picks') return done(await Promise.resolve(pmPost('/api/ready-reports/picks', { ws: h.ws || undefined })).catch(() => null), 'Kept. Only PMOS\'s picks are scheduled; the rest draft at their moment.');
|
|
59
59
|
if (a === 'overlap') return done(await Promise.resolve(pmPost('/api/ready-reports/overlap', { ws: h.ws || undefined })).catch(() => null), 'One update each. The wider one carries the others as sections.');
|
|
60
60
|
b.disabled = false;
|
|
61
61
|
});
|
|
@@ -128,10 +128,10 @@ function goesHtml(q, ch, a) {
|
|
|
128
128
|
+ (q.cadence === 'monthly' ? sel('dom', Array.from({ length: 28 }, (_, i) => [i + 1, 'Day ' + (i + 1)]), q.dayOfMonth, 'Day of the month') : '')
|
|
129
129
|
+ sel('time', TIMES.concat(TIMES.includes(q.time) ? [] : [q.time]).sort().map((t) => [t, t]), q.time, 'Time') + '</div>' : '';
|
|
130
130
|
return `<fieldset class="rf-q"><legend>Goes out${ch.includes('schedule') ? ' ' + tag('changed', 'ch') : ''}</legend><div class="rf-row" role="radiogroup" aria-label="Goes out">${opt(false, 'Once')}${opt(true, 'Repeats')}</div>${more}`
|
|
131
|
-
+ `<p class="vz-note">${q.repeat ? '
|
|
131
|
+
+ `<p class="vz-note">${q.repeat ? 'PMOS drafts each cycle on its day. ' : ''}You approve each issue; nothing goes out by itself.</p></fieldset>`;
|
|
132
132
|
}
|
|
133
133
|
function lookHtml(o) {
|
|
134
|
-
const words = o.look ? `<p class="vz-note">Your words: “${esc(o.look)}”.
|
|
134
|
+
const words = o.look ? `<p class="vz-note">Your words: “${esc(o.look)}”. PMOS makes this look after the first draft; until then it uses the standard look.</p>` : '';
|
|
135
135
|
return `<fieldset class="rf-q"><legend>Look</legend><p class="rf-fix"><b>Standard PMOS look</b><span>Nunito, navy title slides, 16:9</span></p>${words}</fieldset>`;
|
|
136
136
|
}
|
|
137
137
|
/* ── the template's sections and look (canvas TplA) ── */
|
|
@@ -154,7 +154,7 @@ function tplLookHtml(T, name, o) {
|
|
|
154
154
|
const words = next ? next.words : L.words;
|
|
155
155
|
const std = next ? next.n == null : L.saved == null;
|
|
156
156
|
const fol = !std && (L.follows || []).length ? `<small>Follows ${esc(L.follows.join(', '))}</small>` : std ? '<small>Nunito, navy title slides, 16:9</small>' : '';
|
|
157
|
-
const making = o && o.making ? `<p class="vz-note" role="status">
|
|
157
|
+
const making = o && o.making ? `<p class="vz-note" role="status">PMOS is making the look you asked for: “${esc(o.making)}”. It shows here to approve when it is ready.</p>` : '';
|
|
158
158
|
return `<fieldset class="rf-q"><legend>Look${next ? ' ' + tag('changed', 'ch') : ''}</legend><div class="rf-lk"><span class="rf-mini" data-k="${std ? 'std' : 'own'}" aria-hidden="true"><b>${esc(name || '')}</b></span>`
|
|
159
159
|
+ `<p class="rf-fix"><b>${esc(words || 'Standard PMOS look')}</b>${fol}</p></div>${making}</fieldset>`;
|
|
160
160
|
}
|
|
@@ -186,7 +186,7 @@ function proposalHtml(T, words, a, o) {
|
|
|
186
186
|
function sourcesHtml(o) {
|
|
187
187
|
const L = (o.sources || []).filter(Boolean);
|
|
188
188
|
if (!L.length) return '';
|
|
189
|
-
return `<fieldset class="rf-q"><legend>Sources</legend><ul class="rf-src">${L.map((x) => `<li>${esc(x)}</li>`).join('')}</ul><p class="vz-note">
|
|
189
|
+
return `<fieldset class="rf-q"><legend>Sources</legend><ul class="rf-src">${L.map((x) => `<li>${esc(x)}</li>`).join('')}</ul><p class="vz-note">PMOS reads these for the draft. Each slide names what it read, and what it could not reach.</p></fieldset>`;
|
|
190
190
|
}
|
|
191
191
|
/** Template history (RfH3): newest first; each one that is not the current one has Go back. */
|
|
192
192
|
export function historyHtml(versions = [], a = 'data-rt', o = {}) {
|
|
@@ -218,7 +218,7 @@ export function questionsHtml(q, o = {}, a = 'data-rt') {
|
|
|
218
218
|
const words = all;
|
|
219
219
|
const fx = proposalHtml(T, words, a, o);
|
|
220
220
|
const note = words.length && !fx ? `<p class="rf-chg">${tag('changed', 'ch')} ${esc(words.join('; '))}. This makes a different template. The current one keeps its draft and its cycles.</p>` : '';
|
|
221
|
-
const ask = tpl && !fx ? `<p class="vz-note">To change the look or the sections, ask in the chat.
|
|
221
|
+
const ask = tpl && !fx ? `<p class="vz-note">To change the look or the sections, ask in the chat. PMOS proposes; you approve.</p>` : '';
|
|
222
222
|
return `<div class="rf-qs">${head}${body}${fx}${note}${ask}${historyHtml(T.versions, a, { pending: words.length ? words.join('; ') : '', busy: o.busy })}${msg}`
|
|
223
223
|
+ `<div class="rf-foot"><button type="button" class="rf-ib vz-hv" ${a}="keep" aria-label="Keep the current template" title="Keep the current template">${SV(ICON.back)}</button>`
|
|
224
224
|
+ `<button type="button" class="rf-ib pri vz-hv" ${a}="maketpl" aria-label="Make a different template" title="Make a different template"${o.busy || !words.length || !q.audience.trim() ? ' disabled' : ''}>${SV(ICON.check, 18)}</button></div></div>`;
|
|
@@ -229,7 +229,7 @@ export function waitHtml(F = {}, face = '') {
|
|
|
229
229
|
const d = F.drafting;
|
|
230
230
|
if (d && d.state === 'held') return `<div class="rf-wait">${face}<p><b>The draft waits for a check of ${esc((d.sources || []).join(', '))}.</b><span>It starts by itself when the check passes.</span></p></div>`;
|
|
231
231
|
if (d && d.state === 'ended') return `<div class="rf-wait" data-k="bad">${face}<p><b>The drafting session ended before a draft was written.</b><span>${esc(d.reason || '')}</span></p><button type="button" class="rf-ib pri vz-hv" data-rt="redraft" aria-label="Draft it again" title="Draft it again">${SV(ICON.go)}</button></div>`;
|
|
232
|
-
if (d && d.state === 'drafting') return `<div class="rf-wait" role="status">${face}<p><b>The report's own session is drafting it.</b><span>It opens here when it lands. Keep talking to
|
|
232
|
+
if (d && d.state === 'drafting') return `<div class="rf-wait" role="status">${face}<p><b>The report's own session is drafting it.</b><span>It opens here when it lands. Keep talking to PMOS in the chat.</span></p></div>`;
|
|
233
233
|
// an open session is not a draft being written (Wawan, 2026-11-04: "drafting it" stayed after the session declined): say what it is doing
|
|
234
234
|
if (F.asking) return `<div class="rf-wait" role="status">${face}<p><b>Your change is with the report's session.</b><span>Its answer shows here when it is done.</span></p></div>`;
|
|
235
235
|
if (F.answer) return `<div class="rf-wait">${face}<p><b>${esc(F.answer.text)}</b><span>No draft is open. Draft it now, or it drafts on its day.</span></p><button type="button" class="rf-ib pri vz-hv" data-rt="redraft" aria-label="Draft it now" title="Draft it now">${SV(ICON.go)}</button></div>`;
|
|
@@ -252,5 +252,5 @@ export function reviewHtml(rv, o = {}, a = 'data-r') {
|
|
|
252
252
|
: `<button type="button" class="rf-ib vz-hv" ${a}="rv-no|${esc(f.id)}" aria-label="Not now" title="Not now">${SV(ICON.x)}</button><button type="button" class="rf-ib pri vz-hv" ${a}="rv-do|${esc(f.id)}" aria-label="Do it" title="Do it"${o.busy ? ' disabled' : ''}>${SV(ICON.go)}</button>`) + '</div>').join('');
|
|
253
253
|
const P = rv.passed || [];
|
|
254
254
|
const pass = P.length ? `<p class="rf-pass"><b>${P.length} other ${P.length === 1 ? 'check' : 'checks'} found nothing</b><span>${esc(P.join(' · '))}</span></p>` : '';
|
|
255
|
-
return `<section class="rf-rv" aria-label="
|
|
255
|
+
return `<section class="rf-rv" aria-label="PMOS's review"><div class="rf-rvh">${o.face || ''}<b>${esc(line)}</b>${all}</div>${rows}${pass}</section>`;
|
|
256
256
|
}
|
|
@@ -51,7 +51,7 @@ export function assHtml(S, o) {
|
|
|
51
51
|
if (S.pick && !h.has(keyOf(S, 'pick'))) {
|
|
52
52
|
const ord = (S.orders || []).find((x) => x.id === S.pick.id);
|
|
53
53
|
if (!ord) return '';
|
|
54
|
-
return `<div class="ro-ass" role="group" aria-label="
|
|
54
|
+
return `<div class="ro-ass" role="group" aria-label="PMOS's pick"><p><b class="ro-st" aria-hidden="true">✦</b> The ${e(ord.name)} order fits this report's question.</p>`
|
|
55
55
|
+ `<p class="ro-pts">${parts(o, ord.parts, S.pick.adds)}${(S.pick.drops || []).map((x) => `<span class="ro-pt cut">${e(x)}</span>`).join('')}</p>`
|
|
56
56
|
+ `<p class="ro-note">Blue is added${(S.pick.drops || []).length ? ', struck through is dropped' : ''}. Every reading stays.</p>`
|
|
57
57
|
+ `<div class="ro-acts">${btn(o, 'ord|hide|pick', 'x', 'Not now')}${btn(o, 'ord|open|' + ord.id, 'grid', 'See it with the other orders')}${btn(o, 'ord|apply|' + ord.id, 'check', 'Redraft in this order', ' rp-pri')}</div></div>`;
|
|
@@ -73,7 +73,7 @@ function pics(o, L, n = 4) {
|
|
|
73
73
|
}
|
|
74
74
|
const more = (n) => n + (n === 1 ? ' slide' : ' slides') + (n > 4 ? ' · +' + (n - 4) + ' more' : '');
|
|
75
75
|
function cardHtml(S, o, c) {
|
|
76
|
-
const e = o.esc, mark = c.now ? '<span class="ro-tag">Now</span>' : c.mine ? '<span class="ro-tag">Mine</span>' : S.pick && S.pick.id === c.id ? '<span class="ro-tag ro-star" aria-label="
|
|
76
|
+
const e = o.esc, mark = c.now ? '<span class="ro-tag">Now</span>' : c.mine ? '<span class="ro-tag">Mine</span>' : S.pick && S.pick.id === c.id ? '<span class="ro-tag ro-star" aria-label="PMOS\'s pick">✦</span>' : '';
|
|
77
77
|
return `<button type="button" class="ro-card${c.now ? ' now' : ''}" data-r="ord|open|${e(c.id)}"${c.now ? ' aria-current="true"' : ''}>${pics(o, c.now ? o.now : o.pics(c.id))}`
|
|
78
78
|
+ `<span class="ro-cn">${mark}<b>${e(c.name)}</b></span><small>${more(c.n)}</small></button>`;
|
|
79
79
|
}
|
|
@@ -45,7 +45,7 @@ const md = (iso) => (/^\d{4}-\d{2}-\d{2}/.test(String(iso || '')) ? MON[+iso.sli
|
|
|
45
45
|
/* ── the dot and the card ── */
|
|
46
46
|
export function dotHtml(r) {
|
|
47
47
|
const sg = r && r.suggest; if (!sg) return '';
|
|
48
|
-
return `<i class="sm-dot" role="img" aria-label="${esc('
|
|
48
|
+
return `<i class="sm-dot" role="img" aria-label="${esc('PMOS suggests: ' + sg.title)}" title="${esc('PMOS suggests: ' + sg.title)}"></i>`;
|
|
49
49
|
}
|
|
50
50
|
/** The row's name with the dot: the name clips and the dot stays in view. Without a suggestion, the name alone. */
|
|
51
51
|
export function nameHtml(r, title) {
|
|
@@ -59,7 +59,7 @@ export function cardHtml(sg, title) {
|
|
|
59
59
|
? [[ICON.scissors, sg.name, countText(sg.counts || {})], [ICON.stay, 'Stays here', sg.stays || '']]
|
|
60
60
|
: [[ICON.stay, sg.intoTitle + ' stays', sg.reason ? 'Because ' + sg.reason : ''], [ICON.merge, (title || 'This one') + ' closes', 'Its work moves; its chats, run log and history stay']];
|
|
61
61
|
const ok = split ? 'Split as suggested' : 'Merge as suggested';
|
|
62
|
-
return `<section class="sm-card" role="region" aria-label="${esc('
|
|
62
|
+
return `<section class="sm-card" role="region" aria-label="${esc('PMOS suggests: ' + sg.title)}"><div class="sm-h">${adler('needs-you', 36, { label: false })}<b>${esc(sg.title)}</b></div>`
|
|
63
63
|
+ (sg.why ? `<p class="sm-why">${esc(sg.why)}</p>` : '')
|
|
64
64
|
+ lines.map(([d, b, t]) => `<div class="sm-pl">${SVG(d, 15)}<span><b>${esc(b)}</b>${t ? ' · ' + esc(t) : ''}</span></div>`).join('')
|
|
65
65
|
+ `<div class="sm-acts"><button type="button" class="sm-ib" data-sm="no" aria-label="Not now" title="Not now">${SVG(ICON.x, 16)}</button>`
|
|
@@ -101,7 +101,7 @@ export async function press(c, act) {
|
|
|
101
101
|
const facts = sg.kind === 'merge' ? { into: sg.into } : { moves: [...(sg.tasks || []), ...(sg.tickets || [])] };
|
|
102
102
|
const x = await c.pmPost('/api/initiatives/suggest', { ws: c.ws, id: r.id, of: sg.kind, fp: sg.fp, ...facts }).catch(() => null);
|
|
103
103
|
if (!x || !x.ok) { c.say((x && x.error) || 'It is still shown. The server did not say why.'); return; }
|
|
104
|
-
c.say(sg.kind === 'merge' ? 'Not now.
|
|
104
|
+
c.say(sg.kind === 'merge' ? 'Not now. PMOS will not suggest this merge again.' : 'Not now. PMOS will not suggest this split again.');
|
|
105
105
|
await c.reload();
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
@@ -175,7 +175,7 @@ export function splitHtml(c, S) {
|
|
|
175
175
|
const can = !!(S.name.trim() && (k.tasks || k.tickets || k.docs));
|
|
176
176
|
const stageSel = S.stages.length ? `<label class="sm-st">starts at <select data-sm-stage aria-label="The stage it starts at">${S.stages.map((s) => `<option value="${esc(s.key)}"${st && st.key === s.key ? ' selected' : ''}>${esc(s.name)}</option>`).join('')}</select>${SVG(ICON.down, 13)}</label>` : '';
|
|
177
177
|
return `<div class="sm-v" data-sm-v="split"><div class="sm-nf">${SVG(ICON.scissors, 17)}<input id="smName" type="text" maxlength="120" aria-label="Name of the new initiative" placeholder="Name the new initiative" value="${esc(S.name)}">`
|
|
178
|
-
+ (S.claude && S.name ? `<span class="sm-sg" title="
|
|
178
|
+
+ (S.claude && S.name ? `<span class="sm-sg" title="PMOS named it from the picked tasks">${SVG(ICON.spark, 15)}</span>` : '') + '</div>'
|
|
179
179
|
+ `<p class="sm-keep">${keep.length ? 'Keeps ' + keep.map(esc).join(' · ') + (stageSel ? ' · ' : '') : ''}${stageSel}</p>`
|
|
180
180
|
+ `<div class="sm-list">${groupHtml('Tasks', S.tasks, S, null)}${groupHtml('Jira tickets', S.tickets, S, ICON.jira)}${S.docs == null ? '<p class="sm-q">Reading the documents…</p>' : groupHtml('Documents', S.docs, S, ICON.doc)}`
|
|
181
181
|
+ (!S.tasks.length && !S.tickets.length && S.docs && !S.docs.length ? '<p class="sm-q">It has no tasks, tickets or documents to move yet.</p>' : '') + '</div>'
|
|
@@ -233,7 +233,7 @@ export function mergeHtml(c, S) {
|
|
|
233
233
|
const lbl = (r) => (r.kr && r.kr.label) || r.anchor || 'No anchor';
|
|
234
234
|
const diffs = [];
|
|
235
235
|
if ((a.anchor || '') !== (b.anchor || '') && a.anchor) {
|
|
236
|
-
const opt = (r) => `<button type="button" role="radio" aria-checked="${S.anchor === (r.anchor || '')}" data-sm-anchor="${esc(r.anchor || '')}">${esc(lbl(r))}${r === b ? `<span class="sm-sg2" title="
|
|
236
|
+
const opt = (r) => `<button type="button" role="radio" aria-checked="${S.anchor === (r.anchor || '')}" data-sm-anchor="${esc(r.anchor || '')}">${esc(lbl(r))}${r === b ? `<span class="sm-sg2" title="PMOS’s pick">${SVG(ICON.spark, 12)}</span>` : ''}</button>`;
|
|
237
237
|
diffs.push(`<div class="sm-df"><span class="sm-dl">Anchor</span><div class="sm-seg" role="radiogroup" aria-label="Anchor">${opt(a)}${opt(b)}</div></div>`);
|
|
238
238
|
}
|
|
239
239
|
const prd = hasPrd(a) && hasPrd(b) ? `<p class="sm-dn">${SVG(ICON.doc, 15)}Both have a PRD. ${esc(b.title)}’s stays the PRD; the other joins its documents.</p>`
|
|
@@ -29,7 +29,7 @@ export function storyHtml(story, o = {}) {
|
|
|
29
29
|
const L = lines(story); if (!L.length) return '';
|
|
30
30
|
const chip = (x) => `<span class="st-src" title="${esc(x.ref || x.label)}">${esc(x.label)}</span>`;
|
|
31
31
|
const p = L.map((l) => `<p>${bold(l.text)}${o.sources && Array.isArray(l.sources) ? l.sources.filter((x) => x && x.label).map(chip).join('') : ''}</p>`).join('');
|
|
32
|
-
const sub = o.sub != null ? o.sub : ['
|
|
32
|
+
const sub = o.sub != null ? o.sub : ['PMOS keeps it current', when(story.at)].filter(Boolean).join(' · ');
|
|
33
33
|
return `<section class="${o.cls || 'pv-card'} st-story" aria-label="The story so far"><div class="st-h"><h4>${esc(o.label || 'The story so far')}</h4>${sub ? `<small>${esc(sub)}</small>` : ''}</div>${p}</section>`;
|
|
34
34
|
}
|
|
35
35
|
export function storyText(story) { return lines(story).map((l) => plain(l.text)).join('\n\n'); }
|
|
@@ -203,7 +203,7 @@ export function historyHtml(hist, open, now = Date.now()) {
|
|
|
203
203
|
const rows = L.map((x) => {
|
|
204
204
|
const recent = now - (Date.parse(x.at) || 0) < 7 * 864e5;
|
|
205
205
|
const what = x.field === 'add' ? 'Added from ' + (x.source || 'your sources') : (FIELD[x.field] || x.field) + ': ' + valOf(x.field, x.from) + ' → ' + valOf(x.field, x.to);
|
|
206
|
-
return `<li><span class="w"><b>${esc(what)}</b><small>${esc(['
|
|
206
|
+
return `<li><span class="w"><b>${esc(what)}</b><small>${esc(['PMOS, kept by you ' + short(String(x.at).slice(0, 10)), x.why, x.field !== 'add' && x.source ? x.source : ''].filter(Boolean).join(' · '))}</small></span>`
|
|
207
207
|
+ (recent && x.batch ? `<button type="button" class="tkc-hu" data-tkc-hundo="${esc(x.batch)}" aria-label="Undo this change" title="Undo">${ico('<path d="M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3"/>', 15)}</button>` : '') + '</li>';
|
|
208
208
|
}).join('');
|
|
209
209
|
return `<div class="ovb tkc-h"><button type="button" class="tkc-hh" data-tkc-hist aria-expanded="${!!open}"><b>History</b><span class="n">${L.length}</span>${ico(open ? '<path d="M6 9l6 6 6-6"/>' : I.chev, 14)}</button>${open ? `<ul>${rows}</ul>` : ''}</div>`;
|
|
@@ -71,7 +71,7 @@ export async function openDraft(o) {
|
|
|
71
71
|
const d0 = D();
|
|
72
72
|
const more = [
|
|
73
73
|
{ label: 'Edit the title', on: (b) => o.ui.ask(b, 'Title', (D() || d0 || {}).title || '', (v) => save({ summary: v }, 'Title changed.'), { max: 250 }) },
|
|
74
|
-
{ label: 'Edit with
|
|
74
|
+
{ label: 'Edit with PMOS', on: () => {
|
|
75
75
|
const ta = document.getElementById('hmIn'); if (!ta) { if (o.toast) o.toast('The chat is not on this page.'); return; }
|
|
76
76
|
ta.value = `Edit the drafted Jira ticket ${o.id} of the initiative ${o.initiative} (pmos jira show ${o.initiative}). Change: `;
|
|
77
77
|
ta.dispatchEvent(new Event('input', { bubbles: true })); ta.focus(); ta.setSelectionRange(ta.value.length, ta.value.length);
|
|
@@ -33,7 +33,7 @@ export function closeSend() {
|
|
|
33
33
|
function sheetHtml(M, st) {
|
|
34
34
|
const where = `<div class="tk-wr"><span class="tk-wl">Project</span>${st.projects.length > 1 && M.projectFrom !== 'epic'
|
|
35
35
|
? `<select class="tk-sel" data-tk-project aria-label="Jira project">${st.projects.map((p) => `<option${p === st.project ? ' selected' : ''}>${esc(p)}</option>`).join('')}</select>`
|
|
36
|
-
: M.project ? `<span class="tk-wv">${esc(M.project)}</span>` : '<span class="tk-wv mut">
|
|
36
|
+
: M.project ? `<span class="tk-wv">${esc(M.project)}</span>` : '<span class="tk-wv mut">PMOS asks you before it creates anything</span>'}</div>`;
|
|
37
37
|
const sec = M.sections.map((s) => {
|
|
38
38
|
const ch = st.change === s.id;
|
|
39
39
|
const epic = `<div class="tk-wr"><span class="tk-wl">Epic</span><span class="tk-wv">${esc(s.epic.label)}</span>`
|
|
@@ -110,7 +110,7 @@ export async function openSend(o = {}) {
|
|
|
110
110
|
st.busy = false;
|
|
111
111
|
if (!r || r.ok === false) { st.msg = (r && r.error) || 'Nothing was sent.'; draw(); return; }
|
|
112
112
|
closeSend();
|
|
113
|
-
if (o.toast) o.toast(`Sending ${ids.length === 1 ? 'the ticket' : ids.length + ' tickets'} to Jira.
|
|
113
|
+
if (o.toast) o.toast(`Sending ${ids.length === 1 ? 'the ticket' : ids.length + ' tickets'} to Jira. PMOS creates ${ids.length === 1 ? 'it' : 'them'} with your Atlassian connection, then reads ${ids.length === 1 ? 'it' : 'them'} back.`);
|
|
114
114
|
if (o.onDone) o.onDone(r);
|
|
115
115
|
}
|
|
116
116
|
});
|
|
@@ -141,7 +141,7 @@ function bridgeHtml(wf, ro) {
|
|
|
141
141
|
if (!wf.bridge && from.stages.every((x) => keys.has(x.key))) return '';
|
|
142
142
|
const map = mapOf(from, wf);
|
|
143
143
|
const rows = from.stages.map((st) => `<label class="wf-brr"><span>${esc(st.name)}</span>${svg('M5 12h14M13 6l6 6-6 6', 18)}<select data-wf-br="${esc(st.key)}" aria-label="${esc('Where ' + st.name + ' goes')}"${S.busy ? ' disabled' : ''}>${wf.stages.map((t) => `<option value="${esc(t.key)}"${t.key === map[st.key] ? ' selected' : ''}>${esc(t.name)}</option>`).join('')}</select></label>`).join('');
|
|
144
|
-
return `<section class="wf-box wf-br" aria-label="${esc('Replaces ' + from.name)}"><div class="wf-brh"><b>Replaces ${esc(from.name)}</b><span class="wf-small wf-mut">${wf.bridge && wf.bridge.from === from.id ? 'saved once, used every time' : '
|
|
144
|
+
return `<section class="wf-box wf-br" aria-label="${esc('Replaces ' + from.name)}"><div class="wf-brh"><b>Replaces ${esc(from.name)}</b><span class="wf-small wf-mut">${wf.bridge && wf.bridge.from === from.id ? 'saved once, used every time' : 'PMOS’s proposal'}</span></div>${rows}`
|
|
145
145
|
+ `<p class="wf-small wf-mut">Any initiative that switches from ${esc(from.name)} to ${esc(wf.name)} uses this bridge. Its stage and tasks move together. New initiatives start in ${esc(wf.stages[0].name)} as usual.</p></section>`;
|
|
146
146
|
}
|
|
147
147
|
async function saveBridge(wf, key, to) {
|
|
@@ -316,7 +316,7 @@ function openNew() {
|
|
|
316
316
|
function newHtml() {
|
|
317
317
|
const d = S.draft, n = d && d.stages ? d.stages.length : 0;
|
|
318
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 ? '
|
|
319
|
+
return head + `<div class="wf-box wf-small wf-newb"><p>${d ? 'PMOS drafted it in the chat. It shows in the Viewer: Create workflow, or Edit by hand.' : 'PMOS drafts it in the chat while you describe it. The draft shows here.'}</p>`
|
|
320
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) {
|
|
@@ -120,7 +120,7 @@ const SPONSORS = '# Inline login slips to early December unless passkeys move to
|
|
|
120
120
|
await p.click('#czViewer [data-pv="props"]');
|
|
121
121
|
await p.click('#czViewer .db-need [data-db="needs"][data-k="keep"]');
|
|
122
122
|
const kp = await until(() => X.posts.find((x) => x.path === '/api/proposals/keep'));
|
|
123
|
-
ok('N ✓ keeps
|
|
123
|
+
ok('N ✓ keeps PMOS\'s pick: POST /api/proposals/keep with the proposal ids and the initiative', !!kp && kp.body.ids.join() === 'p-dates-1' && kp.body.initiative === 'descope-parity' && kp.body.ws === 'idpf', JSON.stringify(kp));
|
|
124
124
|
ok('N the dashboard is read again after the press', (await until(() => X.gets.filter((g) => g.scope === 'program:project-ascent').length >= 2, 3000)));
|
|
125
125
|
|
|
126
126
|
/* ── R: the Reports tab: a report row, and its two cuts ── */
|