create-pmos 0.741.0 → 0.743.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.
@@ -9,6 +9,7 @@
9
9
  * pmos decisions check <id> <worked|didnt-work|cant-tell> --evidence "<text>" [--again <date>]
10
10
  * the verdict on a decision; cant-tell --again sets a new date to look again
11
11
  * pmos decisions record [--json] the track record: per quarter, worked, didn't work, can't tell and the hit rate
12
+ * pmos decisions undo <id> [--json] takes a decision out of the journal (one `undo` line), e.g. one logged from a press
12
13
  * every command: [--root <dir>] (default: this repository)
13
14
  *
14
15
  * The agent runs add and check only after the PM said yes in the chat; the line names who wrote it (lib/actor.js). A verdict is the PM's:
@@ -18,7 +19,7 @@ const path = require('path');
18
19
  const { execFileSync } = require('child_process');
19
20
  const J = require('./decision-journal.js');
20
21
 
21
- const COMMANDS = { decisions: ['add', 'list', 'show', 'check', 'record'] };
22
+ const COMMANDS = { decisions: ['add', 'list', 'show', 'check', 'record', 'undo'] };
22
23
  const USAGE = [
23
24
  'usage: pmos decisions add|list|show|check|record — a decision journal: each decision has an expected outcome and a date to check it',
24
25
  ' pmos decisions add "<what was decided>" --expect "<what should happen>" [--check <YYYY-MM-DD|+30d>] [--why "<text>"] [--against "<who disagreed, and why>"] [--initiative <id>]',
@@ -27,10 +28,11 @@ const USAGE = [
27
28
  ' pmos decisions show <id> [--json] one decision and its checks',
28
29
  ' pmos decisions check <id> <worked|didnt-work|cant-tell> --evidence "<text>" [--again <date>] your verdict on a decision',
29
30
  ' pmos decisions record [--json] how your decisions turned out, per quarter',
31
+ ' pmos decisions undo <id> [--json] take a decision out of the journal, for example one logged from a press',
30
32
  'Run it in the product\'s repository, or pass --root <dir>. The check date is 30 days after the decision unless --check says otherwise.',
31
33
  ];
32
34
  const VERDICT = { worked: 'worked', validated: 'worked', 'didnt-work': 'didnt-work', "didn't-work": 'didnt-work', refuted: 'didnt-work', 'cant-tell': 'cant-tell', "can't-tell": 'cant-tell', inconclusive: 'cant-tell' };
33
- const ALLOWED = { add: ['json', 'root', 'expect', 'check', 'why', 'against', 'initiative', 'replaces', 'changed-mind'], list: ['json', 'root', 'all'], show: ['json', 'root'], check: ['json', 'root', 'evidence', 'again'], record: ['json', 'root'] };
35
+ const ALLOWED = { add: ['json', 'root', 'expect', 'check', 'why', 'against', 'initiative', 'replaces', 'changed-mind'], list: ['json', 'root', 'all'], show: ['json', 'root'], check: ['json', 'root', 'evidence', 'again'], record: ['json', 'root'], undo: ['json', 'root'] };
34
36
  const BOOL = new Set(['json', 'all']);
35
37
 
36
38
  function parse(args) {
@@ -56,10 +58,12 @@ function line(e) {
56
58
  const when = e.state === 'due' ? `check due ${e.days > 0 ? 'since ' + short(e.check) : 'today'}`
57
59
  : e.state === 'open' ? `check on ${short(e.check)}`
58
60
  : e.state === 'checked' ? `${J.VERDICT_WORDS[e.verdict.verdict]} (${short(e.verdict.date)})`
61
+ : e.state === 'logged' ? `${FROM_WORDS[e.from] || 'logged'} on ${short(e.date)}`
59
62
  : `reversed by ${e.replacedBy}`;
60
- return ` ${e.id} — ${e.decided}\n expected: ${e.expected} · ${when}`;
63
+ return ` ${e.id} — ${e.decided}\n ${e.expected ? 'expected: ' + e.expected + ' · ' : ''}${when}`;
61
64
  }
62
- const pub = (e) => ({ id: e.id, state: e.state, date: e.date, decided: e.decided, expected: e.expected, check: e.check, why: e.why || null, against: e.against || null,
65
+ const FROM_WORDS = { approval: 'approved', card: 'picked on a card', drop: 'dropped with a reason', park: 'parked with a reason' };
66
+ const pub = (e) => ({ id: e.id, state: e.state, from: e.from || null, ref: e.ref || null, date: e.date, decided: e.decided, expected: e.expected, check: e.check, why: e.why || null, against: e.against || null,
63
67
  initiative: e.initiative || null, replaces: e.replaces || null, changed_mind: e.changed_mind || null, replaced_by: e.replacedBy || null, replaced_why: e.replacedWhy || null,
64
68
  verdict: e.verdict ? { verdict: e.verdict.verdict, evidence: e.verdict.evidence, date: e.verdict.date } : null,
65
69
  checks: e.checks.map((c) => ({ verdict: c.verdict, evidence: c.evidence, date: c.date, ...(c.again ? { again: c.again } : {}) })), days_past: e.state === 'due' ? e.days : 0 });
@@ -88,17 +92,29 @@ async function run(argv, { say = (s) => console.log(s), env = process.env, cwd =
88
92
  return 0;
89
93
  }
90
94
 
95
+ if (sub === 'undo') {
96
+ if (pos.length !== 1) return fail('usage: pmos decisions undo <id>', 2);
97
+ const a = actor();
98
+ const r = J.undo(root, { id: pos[0] }, { now, by: a.by, via: a.via });
99
+ if (!r.ok) return fail(r.error);
100
+ if (flags.json) { say(JSON.stringify({ ok: true, id: r.id, file: r.file })); return 0; }
101
+ say(`✓ ${r.id} is out of the journal (${r.file}). Commit it to keep it.`);
102
+ return 0;
103
+ }
104
+
91
105
  const { entries, file } = J.entriesOf(root, { today });
92
106
 
93
107
  if (sub === 'list') {
94
108
  if (pos.length) return fail('pmos decisions list takes no argument', 2);
95
- const shown = flags.all ? entries : entries.filter((e) => e.state === 'due' || e.state === 'open');
109
+ const shown = flags.all ? entries : entries.filter((e) => e.state === 'due' || e.state === 'open' || e.state === 'logged');
96
110
  if (flags.json) { say(JSON.stringify({ ok: true, file, total: entries.length, decisions: shown.map(pub) })); return 0; }
97
111
  if (!entries.length) { say('No decisions in this journal yet. Add one: pmos decisions add "<what was decided>" --expect "<what should happen>"'); return 0; }
98
- const due = shown.filter((e) => e.state === 'due'), open = shown.filter((e) => e.state === 'open'), rest = shown.filter((e) => e.state === 'checked' || e.state === 'replaced');
99
- say(`${plural(entries.length, 'decision', 'decisions')} · ${due.length} due · ${open.length} open · ${entries.length - due.length - open.length} closed`);
112
+ const due = shown.filter((e) => e.state === 'due'), open = shown.filter((e) => e.state === 'open'), logged = shown.filter((e) => e.state === 'logged'), rest = shown.filter((e) => e.state === 'checked' || e.state === 'replaced');
113
+ const nLogged = entries.filter((e) => e.state === 'logged').length;
114
+ say(`${plural(entries.length, 'decision', 'decisions')} · ${due.length} due · ${open.length} open${nLogged ? ` · ${nLogged} logged` : ''} · ${entries.length - due.length - open.length - nLogged} closed`);
100
115
  if (due.length) say(`\n${plural(due.length, 'check', 'checks')} due:\n` + due.map(line).join('\n'));
101
116
  if (open.length) say('\nOpen:\n' + open.map(line).join('\n'));
117
+ if (logged.length) say('\nLogged from your presses:\n' + logged.map(line).join('\n') + '\n Undo one: pmos decisions undo <id>');
102
118
  if (rest.length) say('\nClosed:\n' + rest.map(line).join('\n'));
103
119
  if (due.length) say('\nRecord a verdict: pmos decisions check <id> worked|didnt-work|cant-tell --evidence "<what shows it>"');
104
120
  return 0;
@@ -109,7 +125,7 @@ async function run(argv, { say = (s) => console.log(s), env = process.env, cwd =
109
125
  const e = entries.find((x) => x.id === pos[0]);
110
126
  if (!e) return fail(`no decision ${pos[0]} in this journal (pmos decisions list shows the ids)`);
111
127
  if (flags.json) { say(JSON.stringify({ ok: true, decision: pub(e) })); return 0; }
112
- say(`${e.id} (${short(e.date)})\n decided: ${e.decided}\n expected: ${e.expected}\n check: ${short(e.check)} · ${e.state}`);
128
+ say(`${e.id} (${short(e.date)})\n decided: ${e.decided}` + (e.expected ? `\n expected: ${e.expected}` : '') + (e.check ? `\n check: ${short(e.check)} · ${e.state}` : `\n ${FROM_WORDS[e.from] || e.state}`));
113
129
  if (e.why) say(' why: ' + e.why);
114
130
  if (e.against) say(' disagreed: ' + e.against);
115
131
  if (e.initiative) say(' initiative: ' + e.initiative);
@@ -25,6 +25,8 @@
25
25
  * Every other kind (evidence, sizing, assumption, stakeholders, follow-up, note) is kept as a decision only: the PM's choice to
26
26
  * rely on it. A follow-up is never sent: the PM sends it from their own session. The driver never moves a stage by itself (D3).
27
27
  * RETURN needs a note and DROP may carry one; each logs one correction (the north star counts it) and a return wakes a run.
28
+ * THE DECISION JOURNAL (decisions-from-approvals): the PM's Keep, and a Drop with a note, also write one line to the product's decision journal
29
+ * (lib/decision-journal.js logFrom, ref `driver:<proposal>`) when ctx.root names the product; Undo takes the line out.
28
30
  */
29
31
  const fs = require('fs');
30
32
  const path = require('path');
@@ -127,7 +129,21 @@ async function decide(verb, { file, proposal, note, actor, ctx = {}, now, auto =
127
129
  } catch { /* the driver ledger already holds the correction */ }
128
130
  }
129
131
  }
130
- return { ok: true, proposal: D.fold(D.readLines(file)).proposals.get(p.id), wrote, warnings };
132
+ const decision = journalOf(verb, p, text, actor, ctx, t, auto);
133
+ return { ok: true, proposal: D.fold(D.readLines(file)).proposals.get(p.id), wrote, warnings, ...(decision ? { decision } : {}) };
134
+ }
135
+
136
+ /* decisions-from-approvals (bet A475): the PM's Keep, and a Drop with a note, write one line to the product's decision journal
137
+ * (lib/decision-journal.js logFrom). An automatic keep and a Return write none. Never fails the decision. → the journal id or null */
138
+ function journalOf(verb, p, note, actor, ctx, now, auto) {
139
+ if (auto || !ctx.root || !actorLib.isPm(actor) || !(verb === 'keep' || (verb === 'drop' && note))) return null;
140
+ const DJ = require('./decision-journal.js');
141
+ const what = String(p.what || 'proposal').replace(/-/g, ' '), why = String(p.why || '').trim();
142
+ const ini = p.target && p.target.kind === 'initiative' ? p.target.id : '';
143
+ const r = DJ.logFrom(ctx.root, verb === 'keep'
144
+ ? { from: 'approval', decided: `Kept the ${what} proposal${ini ? ' on ' + ini : ''}${why ? ': ' + why : ''}`, ref: `driver:${p.id}`, initiative: ini, why }
145
+ : { from: 'drop', decided: `Dropped the ${what} proposal${ini ? ' on ' + ini : ''}`, ref: `driver:${p.id}`, initiative: ini, why: note }, { now, by: actor.by, via: actor.via });
146
+ return r.ok ? r.id : null;
131
147
  }
132
148
 
133
149
  const jobOf = (p) => `driver:${p.what}`;
@@ -202,6 +218,7 @@ async function undo({ file, proposal, actor, ctx = {}, now, stateDir, product =
202
218
  record: { kind: 'correction', run: p.run, reason: 'driver:undo', by: actorLib.isPm(actor) ? 'pm' : actor.by } }) + '\n');
203
219
  } catch { /* the driver ledger already holds the correction */ }
204
220
  }
221
+ if (ctx.root) require('./decision-journal.js').undo(ctx.root, { ref: `driver:${p.id}` }, { now: t, by: actor.by, via: actor.via }); // its journal line goes too (none for an automatic keep)
205
222
  const s = p.auto && stateDir ? require('./autonomy.js').recordSetback(stateDir, { job: jobOf(p), product, ref: p.id, kind: 'undo' }, { now: t }) : { demoted: null };
206
223
  return { ok: true, back, demoted: s.demoted || null };
207
224
  }
@@ -170,8 +170,11 @@ function hold(root, { id, why, back, after } = {}, { now = Date.now(), by, via }
170
170
  if (after === id) return { ok: false, error: 'an initiative cannot wait on itself' };
171
171
  if (!ids.has(after)) return { ok: false, error: `no initiative ${after} here to wait on` };
172
172
  }
173
- return append(root, L, { initiative_id: id, state: 'on-hold', reason, ...(back ? { back: String(back) } : {}), ...(after ? { after } : {}),
173
+ const r = append(root, L, { initiative_id: id, state: 'on-hold', reason, ...(back ? { back: String(back) } : {}), ...(after ? { after } : {}),
174
174
  pm: pmSlug(), by: by || 'agent:unknown', via: via || 'cli', at: new Date(now).toISOString() });
175
+ // decisions-from-approvals: a hold with a reason is one line in the decision journal (lib/decision-journal.js onLifecycle)
176
+ if (r && r.ok && r.line) { try { const d = require('./decision-journal.js').onLifecycle(root, r.line, { now }); if (d && d.ok) r.decision = d.id; } catch { /* the hold stands */ } }
177
+ return r;
175
178
  }
176
179
 
177
180
  /** Bring a parked initiative back. One `active` line marked as brought back through its way back. */
@@ -139,6 +139,9 @@ const VERBS = Object.freeze({
139
139
  // Not a pm-os-absorb verb (run: null): initiative open-questions-register (bet A420) added it through the same table.
140
140
  questions: Object.freeze({ module: 'questions-cli.js', run: null, guide: 'cli.md',
141
141
  help: 'pmos questions [age] — every unanswered question across initiatives, oldest first, with who can answer, its age and its default (pmos questions help)' }),
142
+ // Not a pm-os-absorb verb (run: null): initiative try-what-shipped added it through the same table.
143
+ try: Object.freeze({ module: 'try-it.js', run: null, guide: 'cli.md',
144
+ help: 'pmos try [works|broken|note|undo|later|count] — the changes your recent updates brought, how to try each, and your answer (beta only; pmos try help)' }),
142
145
  // Not a pm-os-absorb verb (run: null): initiative three-line-why (bet A86) added it through the same table.
143
146
  why: Object.freeze({ module: 'why-cli.js', run: null, guide: 'cli.md',
144
147
  help: 'pmos why <initiative or task> | coverage — why the work exists in three lines: goal, problem, evidence, read from its records (pmos why help)' }),
@@ -195,6 +198,9 @@ const VERBS = Object.freeze({
195
198
  // Not a pm-os-absorb verb (run: null): feedback batch 25 item 1 added it through the same table.
196
199
  'git-identity': Object.freeze({ module: 'git-identity-cli.js', run: null, guide: 'cli.md',
197
200
  help: 'pmos git-identity [set --name <n> --email <e> --login <gh>] — which git identity and GitHub login this repository uses; save your choice for it' }),
201
+ // Not a pm-os-absorb verb (run: null): roadmap-signal-verb (bet A157) added it through the same table.
202
+ signal: Object.freeze({ module: 'signal-cli.js', run: null, guide: 'cli.md',
203
+ help: 'pmos signal add|remove|list|count — the customer signals behind each roadmap item; the Board shows the count (pmos signal help)' }),
198
204
  launcher: Object.freeze({ module: 'launcher-cli.js', run: null, guide: 'cli.md',
199
205
  help: 'pmos launcher on|off|status — a PMOS app and a login item, so the workspace starts without a terminal' }),
200
206
  });
@@ -51,6 +51,7 @@ const MODULES = Object.freeze([
51
51
  'routes-doc-health', // console3 B2: the six document health checks, recomputed from text
52
52
  'routes-outbox', // console3 B3: the outbox queue, hash-bound confirm (no channel connected)
53
53
  'routes-waiting', // home-your-move-waiting: Waiting on others, derived from records, with its exit rule
54
+ 'routes-try', // try-what-shipped: the changes to try after an update, and the user's Works / Didn't work / note (beta only; try/answers.jsonl)
54
55
  'routes-glossary', // glossary-hover (A386): the glossary of the products a page shows (read only; pmos glossary writes it)
55
56
  'routes-open-questions', // open-questions-register (A420): one register of every unanswered question, with owner, age and default
56
57
  'routes-calendar-views', // console3 C2: Day/Week/Month/Quarter/Year cells, Gantt and the strategy lens (read-only)
@@ -7,7 +7,8 @@
7
7
  * GET /api/proposals?ws&board&initiative[&grill=all] → { ok, props, found } props: lib/proposals.js viewOf (null: nothing to show); grill=all unfolds every grill finding
8
8
  * POST /api/proposals/keep { ws, board, initiative, ids?: [id] | all: true, choices?: { <from>><to>: 'keep' | 'ignore' } }
9
9
  * → { ok, batch, said, counts, props } ✓ one proposal, or ✓ in the header (all: every one Claude is sure of;
10
- * Check these and a Jira ticket's comment never ride on it). One batch, one toast, one Undo.
10
+ * Check these and a Jira ticket's comment never ride on it). One batch, one toast, one Undo. The PM's ✓ also
11
+ * writes one line to the product's decision journal (`decision`: its id; `card` when choices were picked); Undo takes it out
11
12
  * POST /api/proposals/drop { ws, board, initiative, sig, why? } → { ok } why: the PM's reason (the idle lab asks for one); ✕ on a proposal or on one item of it, for good (rule 7); the line
12
13
  * also keeps its facts (PR.factsOf), so a re-sectioned task or a new day does not bring it back
13
14
  * POST /api/proposals/undo { ws, board, batch } → { ok, back, kept } the whole batch; a task changed since keeps its change
@@ -27,6 +28,16 @@ const PR = require('./proposals.js');
27
28
  const TL = require('./task-links.js');
28
29
  const RB = require('./routes-boards.js');
29
30
  const TLR = require('./routes-task-links.js');
31
+ const DJ = require('./decision-journal.js');
32
+
33
+ /** decisions-from-approvals (bet A475): what the PM's ✓ decided, in one line for the decision journal. PURE.
34
+ * want: the kept proposals; picked: the PM chose among a card's answers (body.choices). → { from, decided, why } */
35
+ function keepText(want, ini, picked) {
36
+ const names = (want || []).map((x) => String((x && (x.title || x.why || x.type || x.group)) || '').replace(/\s+/g, ' ').trim()).filter(Boolean);
37
+ const head = names.slice(0, 3).join('; ') + (names.length > 3 ? ` and ${names.length - 3} more` : '');
38
+ const why = (want || []).map((x) => String((x && x.why) || '').trim()).filter(Boolean)[0] || '';
39
+ return { from: picked ? 'card' : 'approval', decided: `${picked ? 'Picked' : 'Approved'} on ${ini}: ${head || plural((want || []).length, 'proposal', 'proposals')}`, why: why.slice(0, 300) };
40
+ }
30
41
 
31
42
  const isObj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
32
43
  const fail = (ctx, res, status, error, extra = {}) => { ctx.json(res, { ok: false, error, ...extra }, status); return true; };
@@ -138,6 +149,7 @@ function undoCore(ctx, p, g, id) {
138
149
  if (r && r.body && r.body.ok) back++; else kept++;
139
150
  }
140
151
  PR.append(dir, g.actor, { kind: 'undo', batch: id });
152
+ try { DJ.undo(p.w.root, { ref: 'proposals:' + id }, { by: g.actor && g.actor.by, via: g.actor && g.actor.via }); } catch { /* a batch PMOS kept by itself has no journal line */ }
141
153
  // D106: the Undo of a change an agent applied by itself is a setback of its job (lib/autonomy.js), which may demote the job
142
154
  const line = PR.readLines(PR.ledgerFile(dir)).find((l) => l.kind === 'keep' && l.batch === id);
143
155
  let demoted = null;
@@ -528,9 +540,13 @@ const WRITES = {
528
540
  const { batch, wrote, plans, failed } = keepCore(ctx, p, g, f, ini, want, isObj(body.choices) ? body.choices : {});
529
541
  // a draft pull request that could not open (W7): nothing was written, the proposal stays open, and the page says why
530
542
  if (failed.length && !wrote.length) return fail(ctx, res, 409, failed[0].why);
543
+ // the PM's ✓ is a decision: one line in the product's decision journal, undone with this batch (decisions-from-approvals)
544
+ const picked = isObj(body.choices) && Object.keys(body.choices).length > 0;
545
+ const kt = keepText(want, ini, picked);
546
+ const dj = DJ.logFrom(p.w.root, { ...kt, ref: 'proposals:' + batch, initiative: ini }, { by: g.actor && g.actor.by, via: g.actor && g.actor.via });
531
547
  const v2 = view(ctx, p, ini);
532
548
  const left = v2 ? v2.groups.flatMap((x) => x.props).filter((x) => x.section === 'check').length : 0;
533
- ctx.json(res, { ok: true, batch, said: saidOf(wrote, plans, body.all === true ? left : 0), counts: { wrote: wrote.length }, props: v2, found: PR.foundOf(PR.read(dir), ini) });
549
+ ctx.json(res, { ok: true, batch, ...(dj.ok ? { decision: dj.id } : {}), said: saidOf(wrote, plans, body.all === true ? left : 0), counts: { wrote: wrote.length }, props: v2, found: PR.foundOf(PR.read(dir), ini) });
534
550
  },
535
551
  '/api/proposals/drop': (ctx, res, body, g, p) => {
536
552
  const sig = String(body.sig || ''), ini = String(body.initiative || '');
@@ -557,8 +573,11 @@ const WRITES = {
557
573
  try { const AF = require('./artefacts.js'); AF.set(AF.file(dirOf(ctx, p.w)), { scope: 'experiment:' + ini, artefact: 'lessons', field: 'line', text: `✕ dropped "${String(of.title || '').slice(0, 140)}"${why ? ': ' + why : ''}`, sources: [{ label: 'live round' }] }, { by: g.actor && /^(pm|agent):/.test(String(g.actor.by)) ? g.actor.by : 'agent:live-round' }); } catch { /* the drop line holds it */ }
558
574
  }
559
575
  // the reason becomes curated memory by itself, so every later run knows it (lib/corrections-memory.js)
576
+ // a ✕ with a reason is a decision too (decisions-from-approvals): one line in the product's decision journal
577
+ let decision = null;
578
+ if (why) { const r = DJ.logFrom(p.w.root, { from: 'drop', decided: `Dropped on ${ini}: ${String((of && (of.title || of.why)) || 'a proposal').slice(0, 200)}`, ref: `proposals-drop:${ini}:${sig}`, initiative: ini, why }, { by: g.actor && g.actor.by, via: g.actor && g.actor.via }); if (r.ok) decision = r.id; }
560
579
  if (why) require('./corrections-memory.js').remember(p.w.root, { what: `a ${(of && (of.group || of.type)) || ''} proposal on ${ini}`.replace(/ +/g, ' '), why, source: 'proposal:' + (which.id || sig), ini });
561
- ctx.json(res, { ok: true });
580
+ ctx.json(res, { ok: true, ...(decision ? { decision } : {}) });
562
581
  },
563
582
  '/api/proposals/undo': (ctx, res, body, g, p) => {
564
583
  const r = undoCore(ctx, p, g, String(body.batch || ''));
@@ -586,7 +605,7 @@ const WRITES = {
586
605
 
587
606
  module.exports = {
588
607
  prefixes: ['/api/proposals'],
589
- viewFor, saidOf, prdRename, keepCore, undoCore, autoKeep, heldOf, keepDefault,
608
+ viewFor, saidOf, prdRename, keepCore, undoCore, autoKeep, heldOf, keepDefault, keepText,
590
609
  handle: async (req, res, url, ctx) => {
591
610
  const p0 = url.pathname;
592
611
  if (req.method === 'GET') {
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+ /* routes-try.js — try what shipped (initiative try-what-shipped; lib/try-it.js is the store and the list).
3
+ *
4
+ * GET /api/try → { ok, beta, items: [card], total, shown, later, row } the changes to try (beta only)
5
+ * POST /api/try/answer { key, verdict, note? } → { ok, line } works | broken | note | undo, the PM's press
6
+ * POST /api/try/later {} → { ok } hide Home's row until tomorrow
7
+ *
8
+ * Every POST passes pm-guard requirePagePress: the page only (pmos try is the chat's way). Answers stay in <state>/try/answers.jsonl on
9
+ * this computer; nothing is sent. A computer on the GA line gets an empty list. */
10
+ const guard = require('./pm-guard.js');
11
+ const T = require('./try-it.js');
12
+
13
+ module.exports = {
14
+ prefixes: ['/api/try'],
15
+ handle: async (req, res, url, ctx) => {
16
+ const p = url.pathname;
17
+ if (p !== '/api/try' && p !== '/api/try/answer' && p !== '/api/try/later') return false;
18
+ if (!ctx.runtimeDir) { ctx.json(res, { ok: false, error: 'PMOS has no state folder here, so it cannot keep your answers' }, 503); return true; }
19
+ const C = T.ctxOf({ stateDir: ctx.runtimeDir, appDir: ctx.tryAppDir || undefined, beta: ctx.tryBeta });
20
+ if (p === '/api/try') {
21
+ if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
22
+ const F = T.fold(T.readLines(C.stateDir));
23
+ const L = T.listOf({ changes: C.changes, installed: C.installed, answers: F.answers, now: C.now, beta: C.beta });
24
+ ctx.json(res, { ok: true, ...L, later: F.later, row: T.rowOf(L, { later: F.later }) });
25
+ return true;
26
+ }
27
+ if (req.method !== 'POST') { ctx.json(res, { ok: false, error: 'POST only' }, 405); return true; }
28
+ const got = await ctx.readJson(req);
29
+ if (!got.ok) { ctx.json(res, { ok: false, error: 'invalid JSON body' }, 400); return true; }
30
+ const body = got.body || {};
31
+ const g = guard.requirePagePress(req, body);
32
+ if (!g.ok) { ctx.json(res, { ok: false, error: g.error }, g.status); return true; }
33
+ if (!C.beta) { ctx.json(res, { ok: false, error: 'This computer follows the GA line, so there is nothing to try here' }, 409); return true; }
34
+ if (p === '/api/try/later') { T.later(C.stateDir, { now: C.now }); ctx.json(res, { ok: true }); return true; }
35
+ const r = T.answer(C.stateDir, { key: String(body.key || ''), verdict: String(body.verdict || ''), note: body.note }, C);
36
+ ctx.json(res, r, r.ok ? 200 : 400);
37
+ return true;
38
+ },
39
+ };
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+ /* signal-cli.js — `pmos signal`: the customer signals behind each roadmap item (roadmap-signal-verb, bet A157).
3
+ *
4
+ * pmos signal add <initiative> --who "<customer>" [--where ticket|call|email|chat|survey|review|other] [--link <url>] [--note "<one line>"]
5
+ * pmos signal remove <sid>
6
+ * pmos signal list [<initiative>] [--json]
7
+ * pmos signal count [<checkout>]
8
+ *
9
+ * A thin verb over lib/customer-signals.js main(): the same ledger (planning/runs/customer-signals.jsonl) that the Board's
10
+ * count and the item panel read, so a signal a chat adds shows on the roadmap at the next read. Without --root it works on
11
+ * the git root of the current folder. Exit codes: 0 done, 1 refused, 2 usage.
12
+ */
13
+ const { execFileSync } = require('child_process');
14
+ const CS = require('./customer-signals.js');
15
+
16
+ const COMMANDS = { signal: ['add', 'remove', 'list', 'count'] };
17
+ const USAGE = [
18
+ 'usage: pmos signal add <initiative> --who "<customer>" [--where ' + CS.WHERE.join('|') + '] [--link <url>] [--note "<one line>"] [--root <dir>]',
19
+ ' pmos signal remove <sid> [--root <dir>]',
20
+ ' pmos signal list [<initiative>] [--json] [--root <dir>]',
21
+ ' pmos signal count [<checkout>]',
22
+ 'The Board shows the count on each roadmap item, and a press (or a tap on the item on a phone) lists them.',
23
+ ];
24
+
25
+ function gitRoot(cwd = process.cwd()) {
26
+ try { return execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || cwd; }
27
+ catch { return cwd; }
28
+ }
29
+
30
+ function run(argv, { say = console.log } = {}) {
31
+ const rest = argv.slice(1);
32
+ const sub = rest[0];
33
+ if (!sub || sub === 'help' || rest.includes('--help') || !COMMANDS.signal.includes(sub)) { USAGE.forEach((l) => say(l)); return 2; }
34
+ const args = rest.slice();
35
+ const hasRoot = args.includes('--root');
36
+ if (sub === 'count') { if (!hasRoot && !args.slice(1).some((a) => !a.startsWith('--'))) args.push(gitRoot()); }
37
+ else if (!hasRoot) args.push('--root', gitRoot());
38
+ return CS.main(args, say);
39
+ }
40
+
41
+ module.exports = { run, COMMANDS, USAGE };
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* try-it.js — try what shipped (initiative try-what-shipped). After an update, the user tries each change and says if it works.
4
+ * THE ONE WRITER and THE ONE FOLD of <state>/try/answers.jsonl, the list of changes to try, and the `pmos try` command.
5
+ *
6
+ * WHERE THE STEPS COME FROM. Each PR's changelog entry (workspace/changelog.json, written by scripts/kit-changelog.js) may carry
7
+ * try: { steps: [1 to 3], see?, open? }, copied from the PR's Story (Try:, Expect:, Open:). The Builder writes them (factory BUILDER.md).
8
+ * BETA ONLY (Wawan 2026-11-23: "That should only lands on Beta."). A computer on the GA line gets an empty list and no Home row.
9
+ * LOCAL ONLY. The answers stay in the state folder on this computer. Nothing here sends anything. The factory reads the file from the
10
+ * test-bed computer (factory/checker/try-feedback.js; Wawan's card 2026-11-23: "Factory reads it from your computer").
11
+ *
12
+ * THE LEDGER. One line per press, { at, key, v, n, verdict, note?, until? }:
13
+ * key '<version>#<PR number>' (the change) verdict works | broken | note | undo (undo takes the key's answer back)
14
+ * key '*' verdict later, until: 'YYYY-MM-DD' Later hides Today's row until that local day
15
+ *
16
+ * changesOf(appDir) → the installed changelog, raw installedOf(appDir) → the app version
17
+ * listOf({ changes, installed, answers, now, beta }) → { beta, items: [card], total, shown } PURE
18
+ * fold(lines) → { answers: Map key → line, later: 'YYYY-MM-DD' | '' } PURE
19
+ * answer(dir, { key, verdict, note }, list) → { ok, line } | { ok: false, error } refuses a key the list does not hold
20
+ * count(lines, changes, now) → { tried, answered, pct } PURE, the health number
21
+ * rowOf(list, { later, today }) → the Home row or null PURE (public/pm/try-view.js has the same rule for the page)
22
+ * CLI: pmos try [list|works|broken|note|undo|later|count] … (run), and node lib/try-it.js count (the health number on its last line) */
23
+ const fs = require('fs');
24
+ const path = require('path');
25
+
26
+ const TAG = '[try-it]';
27
+ const DAYS = 14;
28
+ const SHOW = 5;
29
+ const VERDICTS = new Set(['works', 'broken', 'note', 'undo']);
30
+ const APP_DIR = path.resolve(__dirname, '..');
31
+
32
+ const ledgerFile = (dir) => path.join(String(dir || ''), 'try', 'answers.jsonl');
33
+ const localDay = (t = Date.now()) => { const d = new Date(t); return new Date(d.getTime() - d.getTimezoneOffset() * 60000).toISOString().slice(0, 10); };
34
+ const vnum = (v) => String(v || '').split('-')[0].split('.').map((x) => Number(x) || 0);
35
+ const vcmp = (a, b) => { const A = vnum(a), B = vnum(b); for (let i = 0; i < 3; i++) if ((A[i] || 0) !== (B[i] || 0)) return (A[i] || 0) - (B[i] || 0); return 0; };
36
+ const str = (x, max) => (typeof x === 'string' ? x.replace(/\s+/g, ' ').trim().slice(0, max) : '');
37
+ const OPEN_RE = /^\/(?!\/)[A-Za-z0-9._~!$&'()*+,;=:@%/?#-]{0,300}$/;
38
+
39
+ function changesOf(appDir = APP_DIR) {
40
+ try { const j = JSON.parse(fs.readFileSync(path.join(appDir, 'changelog.json'), 'utf8')); return Array.isArray(j) ? j : []; } catch { return []; }
41
+ }
42
+ function installedOf(appDir = APP_DIR) {
43
+ try { return JSON.parse(fs.readFileSync(path.join(appDir, 'package.json'), 'utf8')).version || null; } catch { return null; }
44
+ }
45
+ function readLines(dir) {
46
+ try { return fs.readFileSync(ledgerFile(dir), 'utf8').split('\n').filter(Boolean).map((l) => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean); }
47
+ catch { return []; }
48
+ }
49
+
50
+ /** The answers by key (the last press wins; undo removes it) and the Later day. */
51
+ function fold(lines) {
52
+ const answers = new Map(); let later = '';
53
+ for (const l of lines || []) {
54
+ if (!l || typeof l.key !== 'string') continue;
55
+ if (l.key === '*') { if (l.verdict === 'later' && /^\d{4}-\d{2}-\d{2}$/.test(l.until || '')) later = l.until; continue; }
56
+ if (l.verdict === 'undo') answers.delete(l.key); else if (VERDICTS.has(l.verdict)) answers.set(l.key, l);
57
+ }
58
+ return { answers, later };
59
+ }
60
+
61
+ /** One card per change: from versions up to the installed one, in the last DAYS days, with try steps, not a chore, not answered. */
62
+ function cardsOf(changes, installed, now) {
63
+ const out = [];
64
+ for (const e of changes || []) {
65
+ if (!e || typeof e.v !== 'string' || !Array.isArray(e.prs)) continue;
66
+ if (installed && vcmp(e.v, installed) > 0) continue;
67
+ const at = Date.parse(e.at || '');
68
+ if (!Number.isFinite(at) || now - at > DAYS * 864e5) continue;
69
+ for (const p of e.prs) {
70
+ const y = p && p.try;
71
+ if (!y || !Array.isArray(y.steps) || !y.steps.length || p.k === 'x') continue;
72
+ const steps = y.steps.map((s) => str(s, 140)).filter(Boolean).slice(0, 3);
73
+ if (!steps.length) continue;
74
+ const open = typeof y.open === 'string' && OPEN_RE.test(y.open) ? y.open : null;
75
+ out.push({ key: `${e.v}#${p.n == null ? str(p.h || p.t, 40) : p.n}`, v: e.v, n: p.n == null ? null : p.n, at: e.at,
76
+ title: str(p.h || p.t || p.s, 120), kind: p.k || null, steps, see: str(y.see, 200) || null, open });
77
+ }
78
+ }
79
+ return out.sort((a, b) => vcmp(b.v, a.v) || (b.n || 0) - (a.n || 0));
80
+ }
81
+
82
+ function listOf({ changes, installed, answers = new Map(), now = Date.now(), beta = true } = {}) {
83
+ if (!beta) return { beta: false, items: [], total: 0, shown: 0 };
84
+ const open = cardsOf(changes, installed, now).filter((c) => !answers.has(c.key));
85
+ const items = open.slice(0, SHOW);
86
+ return { beta: true, items, total: open.length, shown: items.length };
87
+ }
88
+
89
+ /** Home's one row, or null (zero is silence; Later hides it until its day). */
90
+ function rowOf(list, { later = '', today = localDay() } = {}) {
91
+ if (!list || !list.beta || !list.total) return null;
92
+ if (later && later > today) return null;
93
+ return { key: 'try', go: 'try', title: list.total + (list.total === 1 ? ' new thing to try' : ' new things to try'), sub: 'From your recent updates. Each takes under a minute.' };
94
+ }
95
+
96
+ function append(dir, line) {
97
+ const f = ledgerFile(dir);
98
+ fs.mkdirSync(path.dirname(f), { recursive: true });
99
+ fs.appendFileSync(f, JSON.stringify(line) + '\n');
100
+ }
101
+
102
+ /** A press: works, broken, note (with text), or undo; the key must be a change the list knows (answered ones count for undo). */
103
+ function answer(dir, { key, verdict, note } = {}, { changes = [], installed = null, now = Date.now() } = {}) {
104
+ if (!VERDICTS.has(verdict)) return { ok: false, error: 'verdict is works, broken, note or undo' };
105
+ const known = cardsOf(changes, installed, now).find((c) => c.key === key);
106
+ if (!known) return { ok: false, error: 'no change to try has that key' };
107
+ const text = str(note, 1000);
108
+ if (verdict === 'note' && !text) return { ok: false, error: 'a note needs its text' };
109
+ const line = { at: new Date(now).toISOString(), key, v: known.v, n: known.n, title: known.title, verdict, ...(text ? { note: text } : {}) };
110
+ append(dir, line);
111
+ console.log(`${TAG} ${verdict} ${key}`);
112
+ return { ok: true, line };
113
+ }
114
+ function later(dir, { now = Date.now() } = {}) {
115
+ const until = localDay(now + 864e5);
116
+ const line = { at: new Date(now).toISOString(), key: '*', verdict: 'later', until };
117
+ append(dir, line);
118
+ return { ok: true, line };
119
+ }
120
+
121
+ /** The health number: of the changes with try steps in the last DAYS days, how many got an answer. */
122
+ function count(lines, changes, now = Date.now()) {
123
+ const cards = cardsOf(changes, null, now), { answers } = fold(lines);
124
+ const answered = cards.filter((c) => answers.has(c.key)).length;
125
+ return { tried: cards.length, answered, pct: cards.length ? Math.round((answered / cards.length) * 100) : 0 };
126
+ }
127
+
128
+ /* ── pmos try ─────────────────────────────────────────────────────────────────────────────────────────────── */
129
+ const USAGE = [
130
+ 'usage: pmos try [list|works|broken|note|undo|later|count] — try what shipped in your recent updates (beta only)',
131
+ ' pmos try the changes to try, newest first, each with its steps, what you should see and where to open',
132
+ ' pmos try works <n> it works (n is the number pmos try shows, or the change key 0.738.0#1639)',
133
+ ' pmos try broken <n> [--note "…"] it did not work; the factory takes it first',
134
+ ' pmos try note <n> --note "…" a note on the change',
135
+ ' pmos try undo <n> take your answer back',
136
+ ' pmos try later hide the Today row until tomorrow',
137
+ ' pmos try count answered percent of the last 14 days; the number is on the last line',
138
+ 'Answers stay on this computer. Nothing is sent.',
139
+ ];
140
+ /** The beta line: PMOS_CHANNEL beta/early, else the setting upd.channel=early (the rule lib/kit-update.js channel() states; read here
141
+ * without requiring kit-update, which no other library module may load). */
142
+ function betaOf(env, stateDir) {
143
+ const e = String((env && env.PMOS_CHANNEL) || '').trim().toLowerCase();
144
+ if (e === 'beta' || e === 'early') return true;
145
+ if (e === 'latest' || e === 'ga' || e === 'stable' || !stateDir) return false;
146
+ try { return require('./settings-store.js').get(stateDir, 'upd.channel') === 'early'; } catch { return false; }
147
+ }
148
+
149
+ function ctxOf(o) {
150
+ const stateDir = o.stateDir || require('./state-root.js').defaultRoot({ env: o.env || process.env });
151
+ const appDir = o.appDir || APP_DIR;
152
+ const beta = o.beta != null ? o.beta : betaOf(o.env || process.env, stateDir);
153
+ return { stateDir, changes: changesOf(appDir), installed: installedOf(appDir), beta, now: o.now || Date.now() };
154
+ }
155
+ function run(argv, o = {}) {
156
+ const say = o.say || console.log;
157
+ const args = argv[0] === 'try' ? argv.slice(1) : argv.slice();
158
+ const flag = (k) => { const i = args.indexOf('--' + k); if (i < 0) return null; const v = args[i + 1]; args.splice(i, 2); return v; };
159
+ const note = flag('note');
160
+ const [cmd = 'list', ref] = args;
161
+ if (cmd === 'help' || cmd === '--help') { USAGE.forEach((l) => say(l)); return 0; }
162
+ const C = ctxOf(o), lines = readLines(C.stateDir), F = fold(lines);
163
+ if (cmd === 'count') { const c = count(lines, C.changes, C.now); say(`${TAG} ${c.answered} of ${c.tried} changes answered`); say(String(c.pct)); return 0; }
164
+ if (!C.beta) { say('This computer follows the GA line, so PMOS does not ask you to try changes. Beta computers do.'); return cmd === 'list' ? 0 : 1; }
165
+ const L = listOf({ changes: C.changes, installed: C.installed, answers: F.answers, now: C.now, beta: true });
166
+ if (cmd === 'list') {
167
+ if (!L.total) { say('Nothing new to try.'); return 0; }
168
+ L.items.forEach((c, i) => {
169
+ say(`${i + 1}. ${c.title} (${c.v}) · ${c.key}`);
170
+ c.steps.forEach((s, j) => say(` ${j + 1}) ${s}`));
171
+ if (c.see) say(` You should see: ${c.see}`);
172
+ if (c.open) say(` Open: ${c.open}`);
173
+ });
174
+ if (L.total > L.shown) say(`${L.total - L.shown} more after these.`);
175
+ return 0;
176
+ }
177
+ if (cmd === 'later') { later(C.stateDir, { now: C.now }); say('Hidden from Today until tomorrow.'); return 0; }
178
+ if (!VERDICTS.has(cmd)) { say(`✗ ${cmd} is not a command of pmos try`); USAGE.forEach((l) => say(l)); return 2; }
179
+ if (!ref) { say(`✗ pmos try ${cmd} needs the change: its number in pmos try, or its key`); return 2; }
180
+ const all = cardsOf(C.changes, C.installed, C.now);
181
+ const key = /^\d+$/.test(ref) && Number(ref) <= L.items.length ? L.items[Number(ref) - 1].key : ref;
182
+ const r = answer(C.stateDir, { key: all.some((c) => c.key === key) ? key : ref, verdict: cmd, note }, C);
183
+ if (!r.ok) { say('✗ ' + r.error); return 1; }
184
+ say(cmd === 'works' ? 'Marked as working.' : cmd === 'broken' ? 'Marked as not working. The factory takes it first.' : cmd === 'undo' ? 'Your answer is taken back.' : 'Note kept.');
185
+ return 0;
186
+ }
187
+
188
+ if (require.main === module) {
189
+ const a = process.argv.slice(2);
190
+ if (a[0] === 'count') { const sd = require('./state-root.js').defaultRoot({ env: process.env }); const c = count(readLines(sd), changesOf()); console.log(`${TAG} ${c.answered} of ${c.tried} changes answered`); console.log(String(c.pct)); }
191
+ else process.exitCode = run(a);
192
+ }
193
+
194
+ module.exports = { TAG, DAYS, SHOW, ledgerFile, localDay, vcmp, changesOf, installedOf, readLines, fold, cardsOf, listOf, rowOf, answer, later, count, run, ctxOf, USAGE, COMMANDS: { try: ['list', 'works', 'broken', 'note', 'undo', 'later', 'count'] } };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.741.0",
3
+ "version": "0.743.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.741.0",
9
+ "version": "0.743.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.741.0",
3
+ "version": "0.743.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -542,6 +542,14 @@
542
542
  .ev-st.pm-ds svg.ev-gbar .bg { fill: var(--well); }
543
543
  .ev-st.pm-ds svg.ev-gbar .fg { fill: var(--leaf); }
544
544
 
545
+ /* try-what-shipped (pm/try-view.js): the changes to try, one card each, in Settings › Updates and in the Viewer from Home. Tokens only. */
546
+ .try-list { display: flex; flex-direction: column; gap: var(--space-12); }
547
+ .try-list .try-card { display: flex; flex-direction: column; gap: var(--space-8); }
548
+ .try-list .try-steps { margin: 0; padding-left: var(--space-24); }
549
+ .try-list .try-acts { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; }
550
+ .try-list .try-note { display: block; width: 100%; box-sizing: border-box; margin-top: var(--space-4); font: inherit; }
551
+ @media (max-width: 640px) { .try-list .try-acts .ev-btn { min-height: 44px; flex: 1 1 40%; } }
552
+
545
553
  /* ── the ? list of action keys (pm/action-keys.js, bet A477): a Komorebi sheet over the page; its parts are pm-h-sm, pm-row, pm-kbd, pm-meta, pm-btn.
546
554
  * It takes the width of its rows, never wider than the window less space-16 a side, and its head and list are reached through those parts. ── */
547
555
  .ev-keys.pm-ds { border: 0; border-radius: var(--radius-card); background: var(--card); color: var(--ink); box-shadow: var(--lift); padding: var(--space-24); width: fit-content; max-width: calc(100% - var(--space-32)); }
@@ -397,7 +397,7 @@ function updates() {
397
397
  const acts = T.phase === 'busy' ? '' : `<button type="button" class="ev-btn sm" data-ev-upd="check"${T.busy ? ' disabled' : ''}>Check now</button>${ready() ? `<button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button>` : ''}`;
398
398
  const kits = (T.ws || []).filter((w) => !w.linked).map((w) => { const k = T.st[w.id], kit = k && k.kit; return trow(w.label || w.name || w.id, kit && kit.present ? 'kit ' + (kit.version || 'vendored by hand') : 'no kit in this workspace', k && k.kitBehind && L ? `<span class="pm-badge blue">${esc(L)} ready</span>` : kit && kit.present && (k.lastCheck || k.latest) ? '<span class="pm-badge">Up to date</span>' : ''); }).join('');
399
399
  const last = s.lastCheck ? 'Last checked ' + new Date(s.lastCheck.at).toLocaleString() + '. ' : '';
400
- return `<div class="ev-card ev-upd first">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="pm-meta">${esc(last)}${s.checkDaily ? 'PMOS checks when you open Updates and once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p>${weeks()}`;
400
+ return `<div class="ev-card ev-upd first">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="pm-meta">${esc(last)}${s.checkDaily ? 'PMOS checks when you open Updates and once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p><div data-try-host></div>${weeks()}`;
401
401
  }
402
402
  /** Design E (UpE). A story line: a blue dot for New, an amber dot for Fixed, no dot for Improved; Claude's plain title, then the sentence. */
403
403
  const SPARK = 'M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z';
@@ -582,6 +582,7 @@ function draw() {
582
582
  cardRows(el.querySelector('.ev-st-main')); el.querySelectorAll('.ev-st-main .sc-w').forEach(cardRows);
583
583
  if (disposeClaudeSetup) { disposeClaudeSetup(); disposeClaudeSetup = null; }
584
584
  wfPanel(el);
585
+ tryPanel(el);
585
586
  const setup = el.querySelector('[data-claude-setup]');
586
587
  if (setup) disposeClaudeSetup = mountClaudeSetup(setup, { ws: wsParam() || (T.ws && T.ws[0] && T.ws[0].id) || '', onReady: () => {} });
587
588
  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
@@ -595,6 +596,15 @@ function cardRows(root) {
595
596
  [...root.children].forEach((k) => { if (k.classList.contains('ev-trow')) run.push(k); else flush(); });
596
597
  flush();
597
598
  }
599
+ /** Updates › To try (try-what-shipped): pm/try-view.js draws the changes to try into one node kept across redraws, so an answer in
600
+ * progress is not lost when the status line redraws. Beta only; nothing to try draws nothing. */
601
+ let TRY = null;
602
+ function tryPanel(el) {
603
+ const spot = el.querySelector('[data-try-host]');
604
+ if (!spot) return;
605
+ if (!TRY) { TRY = document.createElement('div'); TRY.className = 'try-host'; import('./try-view.js').then((TV) => TV.mountTry(TRY, { toast, head: true })).catch(() => {}); }
606
+ spot.replaceWith(TRY);
607
+ }
598
608
  /** Workspaces › Workflows (UI grill U1): pm/wf-page.js draws into its host, the same node across redraws; leaving it lets it go. */
599
609
  let WF = null, wfOpts = {};
600
610
  function wfPanel(el) {
@@ -841,7 +851,7 @@ async function load() {
841
851
  T.prods = pk ? pk.products : b && b.ok && b.model && b.model.products ? b.model.products.available || [] : [];
842
852
  if (!w || !Array.isArray(w.workspaces)) T.msg = 'The repositories could not be read.'; else if (!p || !p.ok) T.msg = 'The connectors could not be read.';
843
853
  draw();
844
- await Promise.all(T.ws.map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) T.st[x.id] = r; }));
854
+ await Promise.all((T.ws || []).map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) T.st[x.id] = r; }));
845
855
  draw();
846
856
  openCheck();
847
857
  }