create-pmos 0.342.0 → 0.344.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.342.0",
3
+ "version": "0.344.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,30 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.344.0",
37
+ "at": "2026-10-20T05:29:13.194Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 940,
42
+ "t": "Replay takes the rich layout from the prototype",
43
+ "s": "Replay follows the rich layout from prototype PR 901."
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "v": "0.343.0",
49
+ "at": "2026-10-20T05:20:19.894Z",
50
+ "f": 2,
51
+ "prs": [
52
+ {
53
+ "n": 938,
54
+ "t": "A file Claude names in a premium chat panel opens beside the conversation",
55
+ "s": "A file path in Claude's words is underlined, and pressing it opens the file read-only as a viewer tab beside the conversation."
56
+ }
57
+ ]
58
+ },
35
59
  {
36
60
  "v": "0.342.0",
37
61
  "at": "2026-10-20T04:02:58.586Z",
@@ -277,35 +301,6 @@
277
301
  "s": "The Briefing's Calendar card has a Notes button (in the header on a wide screen; under the day on a phone, where the header has no room beside the full-calendar and fold buttons)."
278
302
  }
279
303
  ]
280
- },
281
- {
282
- "v": "0.324.0",
283
- "at": "2026-10-19T22:31:07.298Z",
284
- "f": 2,
285
- "prs": [
286
- {
287
- "n": 914,
288
- "t": "Slide editor in the premium viewer",
289
- "s": "Read > Edit the slides (also on the report's document page) opens the same file as a Slides tab in the viewer."
290
- },
291
- {
292
- "n": 918,
293
- "t": "Presenter mode for the slide editor",
294
- "s": "Present opens the presenter view from the prototype's conversation shell."
295
- }
296
- ]
297
- },
298
- {
299
- "v": "0.323.0",
300
- "at": "2026-10-19T16:13:33.275Z",
301
- "f": 2,
302
- "prs": [
303
- {
304
- "n": 907,
305
- "t": "The full calendar in the premium viewer, Day, Week and Month",
306
- "s": "A button in the Calendar card's title row opens the calendar in the dialog, with Day, Week and Month, the arrows and Today."
307
- }
308
- ]
309
304
  }
310
305
  ]
311
306
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@9fb64190
1
+ kernel-source: pmos@9547ca75
2
2
  assembled: 2026-10-20
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-10-20T04:02:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-20T05:29:11Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-10-20T04:02:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-20T05:29:11Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-10-20T04:02:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-20T05:29:11Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -125,6 +125,8 @@ const RECORDER = () => {
125
125
  await page.route('**/api/meeting-focus/topic', (r) => { S.topicPosts.push(JSON.parse(r.request().postData() || '{}')); return json(r, { ok: true }); });
126
126
  await page.route(/\/api\/meeting-focus(\?|$)/, (r) => { if (/[?&]brief=1(&|$)/.test(r.request().url())) S.briefGets++; else S.focusGets++; const a = typeof focus === 'function' ? focus() : focus; return json(r, a, a.ok === false ? 404 : 200); });
127
127
  await page.route('**/api/calendar-links', (r) => json(r, { ok: true }));
128
+ S.planPosts = [];
129
+ await page.route('**/api/plan-items*', (r) => { const req = r.request(); if (req.method() === 'POST') { S.planPosts.push(JSON.parse(req.postData() || '{}')); return json(r, { ok: true, written: [{ item: 'i' + S.planPosts.length }] }); } return json(r, { ok: true, stages: [{ id: 's1', label: 'Now' }] }); });
128
130
  if (stub) await page.addInitScript(RECORDER);
129
131
  await page.addInitScript(() => {
130
132
  const f = window.fetch;
@@ -312,6 +314,40 @@ const RECORDER = () => {
312
314
  ok('R7 at the end it stops by itself', await until(() => Ra.page.evaluate(() => document.querySelector('#rpPlay').textContent === 'Play' && /^0:04/.test(document.querySelector('#rpPos').textContent)), 8000), await Ra.page.evaluate(() => document.querySelector('#rpPos').textContent));
313
315
  await Ra.ctx.close();
314
316
 
317
+ /* R12 the rich Replay layout (prototype PR 901): a wide window, the time of day, marker lanes, PMOS notes, filters, key-point columns and Confirm all */
318
+ const RICH = { ...REPLAY, start_ms: new Date(2026, 9, 20, 10, 0, 0).getTime(), note: { id: 'n1', title: 'Live review notes', initiative: { id: 'premium-viewer', ws: 'w1', title: 'Premium viewer' } },
319
+ lines: REPLAY.lines.map((l) => (l.i === 1 ? { ...l, key: { k: 'decision', id: 'd1' } } : l)),
320
+ keys: [{ id: 'd1', k: 'decision', text: 'Plan with eight people', t: 61000, by: 'Priya', state: 'draft' }, { id: 'a1', k: 'action', text: 'Priya confirms the owner', t: 140000, owner: 'Priya', due: '2026-10-24', state: 'draft' }, { id: 'q1', k: 'question', text: 'Who signs off?', t: 200000, state: 'open' }],
321
+ notes: [{ t: 90000, cat: 'insight', body: 'The plan leans on one hire' }], gaps: [{ from_ms: 240000, to_ms: 260000 }] };
322
+ const Rw = await open({ replay: RICH });
323
+ await press(Rw.page, 'replay');
324
+ await until(() => Rw.page.evaluate(() => !!document.querySelector('#rpKeys')));
325
+ ok('R12 Replay opens full width with the conversation panel hidden', await Rw.page.evaluate(() => { const g = document.getElementById('dlg'); return g.classList.contains('full') && g.classList.contains('rpw') && g.dataset.mode === 'detail'; }));
326
+ ok('R12 the header shows the time of day from the recording start', await Rw.page.evaluate(() => document.querySelector('#rpClk').textContent.trim() === '10:00'), await Rw.page.evaluate(() => document.querySelector('#rpClk').textContent));
327
+ ok('R12 the marker lane has one marker per timed key point and PMOS note, and an open question carries the needs-you ring', await Rw.page.evaluate(() => document.querySelectorAll('#oMain .rp-mk').length === 4 && !!document.querySelector('#oMain .rp-mk.question.need') && !!document.querySelector('#oMain .rp-mk.pm') && !!document.querySelector('#oMain .rp-gap')));
328
+ ok('R12 a key-point line is tagged in the conversation', await Rw.page.evaluate(() => !!document.querySelector('#rl1 .rp-kt')));
329
+ ok('R12 the key points sit in three columns with counts', await Rw.page.evaluate(() => { const c = [...document.querySelectorAll('#rpKeys .rp-col')]; return c.length === 3 && c.every((x) => /1/.test(x.querySelector('h4').textContent)); }));
330
+ await Rw.page.click('#oMain .rp-mk.pm');
331
+ ok('R12 a PMOS marker seeks to its note', await until(() => Rw.page.evaluate(() => /^1:30 \/ 5:00/.test(document.querySelector('#rpPos').textContent))), await Rw.page.evaluate(() => document.querySelector('#rpPos').textContent));
332
+ await Rw.page.click('#oMain [data-rp="tab"][data-v="p"]');
333
+ ok('R12 the PMOS tab lists only PMOS notes', await Rw.page.evaluate(() => { const l = document.querySelector('#rpLines'); return /The plan leans on one hire/.test(l.textContent) && !/Welcome everyone/.test(l.textContent); }));
334
+ await Rw.page.click('#oMain [data-rp="tab"][data-v="k"]');
335
+ ok('R12 the Key points tab lists only key-point lines', await Rw.page.evaluate(() => { const l = document.querySelector('#rpLines'); return /We plan eight people/.test(l.textContent) && !/Welcome everyone/.test(l.textContent); }));
336
+ await Rw.page.click('#oMain [data-rp="tab"][data-v="a"]');
337
+ await Rw.page.fill('#rpQ', 'risks');
338
+ ok('R12 the search narrows the conversation', await until(() => Rw.page.evaluate(() => { const l = document.querySelector('#rpLines'); return /Next the risks/.test(l.textContent) && !/Welcome everyone/.test(l.textContent); })));
339
+ await Rw.page.click('#rpKeys [data-rp="confirm"]');
340
+ ok('R12 Confirm all adds each next step to the note\'s initiative and marks it', await until(() => Rw.page.evaluate(() => /task made/.test(document.querySelector('#rpKeys').textContent))) && Rw.planPosts.length === 1 && Rw.planPosts[0].events[0].initiative === 'premium-viewer' && Rw.planPosts[0].events[0].title === 'Priya confirms the owner' && Rw.planPosts[0].events[0].stage === 's1' && Rw.planPosts[0].events[0].due === '2026-10-24', JSON.stringify(Rw.planPosts));
341
+ await press(Rw.page, 'unreplay');
342
+ ok('R12 Back restores the dialog size and the conversation panel', await until(() => Rw.page.evaluate(() => { const g = document.getElementById('dlg'); return !g.classList.contains('full') && !g.classList.contains('rpw') && g.dataset.mode === 'split'; })));
343
+ await Rw.ctx.close();
344
+ const Rn = await open();
345
+ await press(Rn.page, 'replay');
346
+ await until(() => Rn.page.evaluate(() => !!document.querySelector('#rpKeys')));
347
+ await Rn.page.click('#rpKeys [data-rp="confirm"]');
348
+ ok('R12 with no initiative linked, Confirm all says so and writes nothing', await until(() => Rn.page.evaluate(() => /Link the note to an initiative first/.test(document.body.textContent))) && Rn.planPosts.length === 0);
349
+ await Rn.ctx.close();
350
+
315
351
  /* R8 Topic on material */
316
352
  const Tp = await open({ topics: ['Capacity', 'Risks'] });
317
353
  await reveal(Tp.page, '#mmAdd'); await Tp.page.click('#mmAdd'); await until(() => Tp.page.evaluate(() => /Roadmap/.test(document.querySelector('#mmSug').textContent)));
@@ -1,4 +1,28 @@
1
1
  [
2
+ {
3
+ "v": "0.344.0",
4
+ "at": "2026-10-20T05:29:13.194Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 940,
9
+ "t": "Replay takes the rich layout from the prototype",
10
+ "s": "Replay follows the rich layout from prototype PR 901."
11
+ }
12
+ ]
13
+ },
14
+ {
15
+ "v": "0.343.0",
16
+ "at": "2026-10-20T05:20:19.894Z",
17
+ "f": 2,
18
+ "prs": [
19
+ {
20
+ "n": 938,
21
+ "t": "A file Claude names in a premium chat panel opens beside the conversation",
22
+ "s": "A file path in Claude's words is underlined, and pressing it opens the file read-only as a viewer tab beside the conversation."
23
+ }
24
+ ]
25
+ },
2
26
  {
3
27
  "v": "0.342.0",
4
28
  "at": "2026-10-20T04:02:58.586Z",
@@ -141,7 +141,7 @@ In **Notes**, each next step has **Make task** when the note is linked to an ini
141
141
 
142
142
  **Focus.** The dialog has a **Focus** press. Focus shows the meeting as it is now: the state (starts in, recording, paused, ended), a bar of the stretches by topic, the topic now (or the first topic before the start), the last lines of the talk with who said them, the topics, the material and the counts of decisions, next steps and questions. It reads the meeting every 3 seconds while it is open and stops when you leave it. While the note records, PMOS's companion, a read-only Claude run that sends nothing, may read the last minutes of the talk at most every 40 seconds and writes its own notes. The dialog says this before the first read. **Change** lists the topics. A press records one correction on the meeting through the console's route. If the companion is off, has not answered or has failed, Focus says so and shows only the talk. It shows no topic, line or count that the record does not hold.
143
143
 
144
- **Replay.** When a recording is kept, the Replay part has a **Replay** press. The player plays the note's audio, with Back 10 s and 1x, 1.5x or 2x. It shows a bar of the stretches by topic with a mark for each decision, next step and question, the topic being talked about, the key points and the transcript. A press on a stretch, a key point or a line plays from there, and the current line is marked. A key point with no time has no play press. If no audio was kept, the playhead keeps its own clock. A screen shot is shown only when the recording holds one for that time.
144
+ **Replay.** When a recording is kept, the Replay part has a **Replay** press. Replay opens wide and hides the conversation panel; **Back to the meeting** puts both back. The header shows the meeting's day, start and end, length, the number of people, and the position as m:ss and as the time of day. The player plays the note's audio, with Back 10 s and 1x, 1.5x or 2x. Under it is a bar of the stretches by topic and, above the bar, one marker for each decision, next step, question and PMOS note that has a time. A ring marks a point that needs you (a question still open, or a next step with no owner). A shaded part of the bar is a gap where the recording was off. The line under the bar shows the topic being talked about and the key points near the playhead. Below are two panels: **On screen**, with the screen shot kept for that time and a strip of all shots, and **Conversation**, with the transcript and PMOS's notes. Its tabs show all lines, only the key-point lines or only PMOS's notes, and a search box narrows the lines. The key points sit in three columns: decisions, questions and next steps. **Confirm all** makes a task of each next step in the note's initiative, under its first stage; when the note has no initiative, it says to link one first. A press on a marker, stretch, key point, line or shot plays from there, and the current line is marked. A key point with no time has no play press. If no audio was kept, the playhead keeps its own clock.
145
145
 
146
146
  In the **Add material** sheet, a **Topic** choice ties the item to one of the meeting's topics, so Focus can bring it up. It appears only when the meeting has topics.
147
147
 
@@ -375,6 +375,7 @@ The conversation beside every premium dialog is a real Claude Code session. Anyt
375
375
  - **What it may do** is set by your own Claude Code settings. Claude can change files and run commands. When your settings say to ask first, the question shows in the panel with its options; press one to answer.
376
376
  - **Stop** shows while Claude works. It presses Esc in the session.
377
377
  - **The conversation** is Claude Code's own record, word for word. Claude's answers are formatted as Claude Code formats them: headings, bold, lists, code, tables, quotes and links (links open in a new tab). Your messages keep their line breaks, and a paste shows without the tags Claude Code wraps around it. A run of tool calls shows as one small grey line, for example "Used Read ×2, slack_read_thread". A connector tool shows its short name.
378
+ - **A file Claude names** (a path such as `briefs/drafts/plan.md`, or a link to one) is underlined. Press it to read the file beside the conversation, as a tab in the viewer; on a phone, the Detail side shows it. Markdown shows as a page and other text files as code. It is read-only. While the tab is open it shows the newest version, so a file Claude is still writing stays current. A file outside the workspaces PMOS serves says "Not in a workspace" and is not read.
378
379
  - **The session** is also listed in **Agent sessions** and in the console, where you can open its terminal. When it has ended, your next message starts a new one.
379
380
  - Answers from the older read-only agent stay above the session, marked "Earlier read-only answer".
380
381
 
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+ /* chat-file-locate.js — which served workspace holds a file path Claude wrote in a premium chat panel (PM, 2026-10-20: "Why can't I click the file
3
+ * and see it on the right panel?"). The panel shows the file read-only in the viewer through GET /api/doc, which already guards every read to one
4
+ * workspace's root. This module only answers "which workspace, and which path inside it", so the guard stays the one /api/doc applies.
5
+ *
6
+ * locate({ path, roots, base, home }) -> { ok: true, ws, rel, abs, size, mtime } | { ok: false, reason, why }
7
+ * path what Claude wrote: absolute, ~/…, or relative to the session's folder. A trailing :line or :line:col is dropped.
8
+ * roots [{ id, root }] the workspaces the server serves. Nothing outside them is read.
9
+ * base the session's own workspace id: a relative path resolves against its root.
10
+ * home the user's home folder, for ~/.
11
+ * reason: 'outside' (no served workspace holds the path), 'missing' (no such file), 'not-file' (a folder), 'bad' (no path).
12
+ * Both the path and each root are resolved to their real paths, so a symlink inside a workspace cannot lead out of it. */
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+
16
+ const inside = (root, p) => p === root || p.startsWith(root.endsWith(path.sep) ? root : root + path.sep);
17
+ const real = (p) => { try { return fs.realpathSync(p); } catch { return null; } };
18
+
19
+ /** What Claude wrote, as a path: quotes, a trailing :12 or :12:3 and surrounding punctuation dropped. Pure. */
20
+ function cleanPath(p) {
21
+ let s = String(p == null ? '' : p).trim().replace(/^['"`<(]+|['"`>),.;]+$/g, '');
22
+ s = s.replace(/:(\d+)(:\d+)?$/, '');
23
+ return s;
24
+ }
25
+
26
+ function locate({ path: raw, roots = [], base = null, home = null } = {}) {
27
+ const p = cleanPath(raw);
28
+ if (!p || p.length > 4096 || p.includes('\0')) return { ok: false, reason: 'bad', why: 'There is no file path to open.' };
29
+ const list = roots.filter((r) => r && r.id && r.root).map((r) => ({ id: r.id, root: path.resolve(r.root), real: real(r.root) || path.resolve(r.root) }));
30
+ let abs;
31
+ if (p === '~' || p.startsWith('~/')) abs = home ? path.join(home, p.slice(2)) : null;
32
+ else if (path.isAbsolute(p)) abs = path.resolve(p);
33
+ else { const b = list.find((r) => r.id === base) || list[0]; abs = b ? path.resolve(b.root, p) : null; }
34
+ const outside = { ok: false, reason: 'outside', why: 'This file is not in a workspace PMOS serves, so it is not shown here.' };
35
+ if (!abs) return outside;
36
+ // the deepest workspace that holds the path as written (a worktree inside its repository wins over the repository)
37
+ const holders = list.filter((r) => inside(r.root, abs) || inside(r.real, abs)).sort((a, b) => b.root.length - a.root.length);
38
+ if (!holders.length) return outside;
39
+ const r = real(abs);
40
+ if (!r) return { ok: false, reason: 'missing', why: 'There is no such file. It may have been moved or not written yet.' };
41
+ const w = holders.find((h) => inside(h.real, r));
42
+ if (!w) return outside; // a symlink that leads out of the workspace
43
+ let st; try { st = fs.statSync(r); } catch { return { ok: false, reason: 'missing', why: 'The file could not be read.' }; }
44
+ if (!st.isFile()) return { ok: false, reason: 'not-file', why: 'This is a folder, not a file.' };
45
+ const rel = path.relative(w.real, r).split(path.sep).join('/');
46
+ return { ok: true, ws: w.id, rel, abs: path.join(w.root, rel), name: path.basename(r), size: st.size, mtime: st.mtimeMs };
47
+ }
48
+
49
+ module.exports = { locate, cleanPath };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.342.0",
3
+ "version": "0.344.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.342.0",
9
+ "version": "0.344.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.342.0",
3
+ "version": "0.344.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",
@@ -4,13 +4,30 @@
4
4
  * http(s). The PM's own turns lose the <pasted_content> wrapper Claude Code puts around a paste, and keep their line breaks. */
5
5
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
6
6
 
7
- /** One line's inline marks, on text that is already escaped: `code`, [links](https://…), bare URLs, **bold**, *italic*, ~~struck~~. */
7
+ /* A file path Claude wrote (PM, 2026-10-20: "Why can't I click the file and see it on the right panel?"): a `code` span, a [name](path) link or a bare
8
+ * /abs, ~/ or ./ path that names a file becomes a press that opens it read-only in the viewer beside the conversation. The server decides whether the
9
+ * file is in a served workspace (GET /api/doc/locate); here it only has to look like a file. A path with a folder needs an extension; a bare name needs
10
+ * a document's extension, so `res.json` and `a.b` stay code. */
11
+ const DOC_EXT = /\.(md|markdown|mdx|txt|csv|ya?ml|toml|skill)$/i;
12
+ /** True when the (escaped) text reads as a file path. Pure. */
13
+ export function looksFile(t) {
14
+ const s = String(t || '').replace(/:\d+(:\d+)?$/, '');
15
+ if (!s || s.length > 1024 || /^[a-z][\w+.-]*:/i.test(s) || /[\s<>"`*]|&(?!amp;)/.test(s)) return false;
16
+ if (!/^(~\/|\.{1,2}\/|\/)?[\w.@+-]+(\/[\w.@+-]+)*$/.test(s)) return false;
17
+ if (!/\.[A-Za-z0-9]{1,10}$/.test(s)) return false;
18
+ return s.includes('/') || DOC_EXT.test(s);
19
+ }
20
+ const fileBtn = (p, label) => `<button type="button" class="fpath" data-file="${p}" title="Open ${p} beside the conversation">${label}</button>`;
21
+
22
+ /** One line's inline marks, on text that is already escaped: `code`, [links](https://…), bare URLs, file paths, **bold**, *italic*, ~~struck~~. */
8
23
  function inline(t) {
9
24
  const keep = [];
10
25
  const hold = (h) => '\u0000' + (keep.push(h) - 1) + '\u0000';
11
- let s = t.replace(/`([^`]+)`/g, (_, c) => hold(`<code>${c}</code>`));
26
+ let s = t.replace(/`([^`]+)`/g, (_, c) => hold(looksFile(c.trim()) ? fileBtn(c.trim(), `<code>${c}</code>`) : `<code>${c}</code>`));
12
27
  s = s.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, (_, txt, u) => hold(`<a href="${u}" target="_blank" rel="noopener noreferrer">${txt}</a>`));
28
+ s = s.replace(/\[([^\]]+)\]\(([^\s)]+)\)/g, (m, txt, u) => (looksFile(u) ? hold(fileBtn(u, txt)) : m));
13
29
  s = s.replace(/(^|[\s(])(https?:\/\/[^\s<]+[^\s<.,;:!?)])/g, (_, pre, u) => pre + hold(`<a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a>`));
30
+ s = s.replace(/(^|[\s(])((?:~|\.{1,2})?\/[^\s<()]*[^\s<().,;:!?])/g, (m, pre, u) => (looksFile(u) ? pre + hold(fileBtn(u, u)) : m));
14
31
  s = s.replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, '<strong>$2</strong>')
15
32
  .replace(/(^|[^*\w])\*(?=\S)([^*]*?\S)\*(?!\*)/g, '$1<em>$2</em>')
16
33
  .replace(/~~(?=\S)([\s\S]*?\S)~~/g, '<del>$1</del>');
@@ -313,10 +313,22 @@ export function replayModel(rep) {
313
313
  if (!len && lines.length) len = lines[lines.length - 1].t;
314
314
  if (!(len > 0)) return null;
315
315
  const stretches = (Array.isArray(rep.runs) ? rep.runs : []).filter((x) => Number.isFinite(x.from_ms) && Number.isFinite(x.to_ms) && x.to_ms > x.from_ms).map((x) => { const t = topics.find((y) => y.id === x.topic); return { n: x.n || (t && t.n) || 0, text: t ? t.text : '', from: Math.max(0, x.from_ms), to: Math.min(len, x.to_ms) }; }).filter((x) => x.to > x.from);
316
- const keys = (Array.isArray(rep.keys) ? rep.keys : []).filter((k) => k && ['decision', 'action', 'question'].includes(k.k)).map((k) => ({ k: k.k, text: clip(k.text, 240), t: Number.isFinite(k.t) ? k.t : null, owner: k.owner || '', due: k.due || '' }));
316
+ const keys = (Array.isArray(rep.keys) ? rep.keys : []).filter((k) => k && ['decision', 'action', 'question'].includes(k.k)).map((k, i) => ({ id: k.id || 'k' + i, k: k.k, text: clip(k.text, 240), t: Number.isFinite(k.t) ? k.t : null, owner: clip(k.owner, 60), due: k.due || '', by: clip(k.by, 60), state: k.state || '',
317
+ need: !!k.warn || k.state === 'owner' || k.state === 'open' }));
317
318
  const shots = (Array.isArray(rep.shots) ? rep.shots : []).filter((x) => Number.isFinite(x.t)).map((x) => ({ t: x.t, why: clip(x.why, 120) })).sort((a, b) => a.t - b.t);
318
- return { len, audio: rep.audio && rep.audio.url ? { url: String(rep.audio.url) } : null, lines, keys, stretches, topics, shots, noteId: rep.note && rep.note.id ? rep.note.id : '', title: clip((rep.meeting && rep.meeting.title) || (rep.note && rep.note.title) || '', 120) };
319
+ /* PMOS's notes (the meeting companion's, from the Focus file), the gaps where the recording was off, and the line each key point was caught from */
320
+ const pmos = (Array.isArray(rep.notes) ? rep.notes : []).filter((x) => x && Number.isFinite(x.t) && String(x.body || '').trim()).map((x) => ({ t: Math.max(0, Math.min(len, x.t)), cat: clip(x.cat, 30), body: clip(x.body, 400) })).sort((a, b) => a.t - b.t);
321
+ const gaps = (Array.isArray(rep.gaps) ? rep.gaps : []).filter((g) => Number.isFinite(g.from_ms) && Number.isFinite(g.to_ms) && g.to_ms > g.from_ms).map((g) => ({ from: g.from_ms, to: Math.min(len, g.to_ms) }));
322
+ const keyOfLine = new Map((Array.isArray(rep.lines) ? rep.lines : []).filter((l) => l && l.key && l.key.k).map((l) => [l.t, l.key.k]));
323
+ lines.forEach((l) => { l.key = keyOfLine.get(l.t) || ''; });
324
+ const n = rep.note || {}, ini = n.initiative && n.initiative.id ? n.initiative : null, mt = rep.meeting || {};
325
+ return { len, audio: rep.audio && rep.audio.url ? { url: String(rep.audio.url) } : null, lines, keys, stretches, topics, shots, pmos, gaps,
326
+ start: Number.isFinite(rep.start_ms) ? rep.start_ms : null, at: mt.at || null, people: Array.isArray(mt.attendees) ? mt.attendees.length : 0, aside: Number(rep.aside_count) || 0,
327
+ noteId: n.id || '', title: clip(mt.title || n.title || '', 120),
328
+ note: n.id ? { id: n.id, title: clip(n.title, 120), initiative: ini ? { id: ini.id, ws: ini.ws || n.ws || '', name: clip(ini.name || ini.title || ini.id, 80) } : null } : null };
319
329
  }
330
+ /** The time of day at meeting time `ms` (10:05), or m:ss from the start when the recording's start is not known. */
331
+ export const wallOf = (m, ms) => { if (!m || m.start == null) return mmss(ms); const t = new Date(m.start + ms); return pad(t.getHours()) + ':' + pad(t.getMinutes()); };
320
332
  /** Where the playhead is: the current line, the stretch (topic) and the key points within 30 s. */
321
333
  export function replayAt(m, pos) {
322
334
  let line = -1; for (const l of m.lines) { if (l.t <= pos) line = l.i; else break; }
@@ -495,7 +507,10 @@ export function mountMeeting(d) {
495
507
 
496
508
  /* the dialog */
497
509
  const sec = (label, body) => `<div class="mtg-sec"><span class="label">${esc(label)}</span>${body}</div>`;
498
- const IC = { spark: '<path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/>', clock: '<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>', scale: '<path d="M12 4v16M6 20h12M5 8h14M5 8l-2 6a3 3 0 0 0 4 0zM19 8l-2 6a3 3 0 0 0 4 0z"/>', doc: '<path d="M7 3h7l4 4v14H7zM14 3v4h4"/>', user: '<circle cx="12" cy="8" r="4"/><path d="M4 21c1-4 4-6 8-6s7 2 8 6"/>', link: '<path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/>', mic: '<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/>', plus: '<path d="M12 5v14M5 12h14"/>', x: '<path d="M6 6l12 12M18 6 6 18"/>', check: '<path d="M5 12.5l4.5 4.5L19 7.5"/>' };
510
+ const IC = { spark: '<path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/>', clock: '<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>', scale: '<path d="M12 4v16M6 20h12M5 8h14M5 8l-2 6a3 3 0 0 0 4 0zM19 8l-2 6a3 3 0 0 0 4 0z"/>', doc: '<path d="M7 3h7l4 4v14H7zM14 3v4h4"/>', user: '<circle cx="12" cy="8" r="4"/><path d="M4 21c1-4 4-6 8-6s7 2 8 6"/>', link: '<path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/>', mic: '<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/>',
511
+ dec: '<path d="M6 4v8a4 4 0 0 0 4 4h9"/><path d="M15 12l4 4-4 4"/>', task: '<rect x="3" y="4" width="7" height="7" rx="1.5"/><path d="M4.8 7.6l1.4 1.3 2.3-2.6M14 7.5h7M14 17.5h7"/><rect x="3" y="14" width="7" height="7" rx="1.5"/>',
512
+ undo: '<path d="M9 14L4 9l5-5"/><path d="M4 9h11a5 5 0 0 1 0 10h-3"/>', play: '<path d="M7 5l12 7-12 7z"/>', pause: '<path d="M9 5v14M15 5v14"/>', lock: '<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',
513
+ xp: '<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 10l3 3 3-3"/>', search: '<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>', back: '<path d="M15 6l-6 6 6 6"/>', plus: '<path d="M12 5v14M5 12h14"/>', x: '<path d="M6 6l12 12M18 6 6 18"/>', check: '<path d="M5 12.5l4.5 4.5L19 7.5"/>' };
499
514
  const ic = (n) => `<svg class="i" viewBox="0 0 24 24">${IC[n]}</svg>`;
500
515
  const secH = (t, tag, extra) => `<h4 class="sh">${esc(t)}${tag ? ` <small>${esc(tag)}</small>` : ''}${extra || ''}</h4>`;
501
516
  const pickLi = (it, key, on) => `<li class="mtg-pick"><span>${esc(clip(it.title, 120))}<em>${esc([it.kind, it.meta].filter(Boolean).join(' · '))}</em></span>${on ? '<span class="mtg-on">Picked</span>' : `<button class="mtg-b" data-pick="${esc(key)}">Pick</button>`}</li>`;
@@ -556,6 +571,7 @@ export function mountMeeting(d) {
556
571
 
557
572
  async function openRow(row, via) {
558
573
  delete $('#oMain').dataset.ready;
574
+ { const g = document.getElementById('dlg'); if (g) g.classList.remove('rpw'); } // a Replay left open when the dialog closed
559
575
  let replay = null, material = null, extra = { prev: [], topics: [] }, boards = W ? W.boards : [], inis = W ? W.initiatives : [], saved = '';
560
576
  const ui = { view: 'detail', status: null, tasked: new Set(), phase: 'before', picked: false }, SH = { sug: null, found: [], pick: null, scope: 'meeting', q: '', link: '', token: 0, topics: [], topic: null };
561
577
  let stT = null, findT = null, undoFn = null;
@@ -608,34 +624,86 @@ export function mountMeeting(d) {
608
624
  }
609
625
 
610
626
  /* Replay: the note's audio, the transcript and the key points on one track (GET /api/meeting-replay, GET /api/notes/recording) */
627
+ /* Replay, laid out as the prototype's replay (prototype/premium-conversation-shell, PR 901) and the console's (c3-replay.js), from GET /api/meeting-replay:
628
+ * the head with the player and the time of day, the topic track with a mark for each key point (ringed when it needs you) and each PMOS note,
629
+ * what was on screen beside the conversation (All, Key points, PMOS, search), and the key points in three columns with Confirm all. */
630
+ const RPK = { decision: ['dec', 'Decision', 'Decisions'], action: ['task', 'Next step', 'Next steps'], question: ['undo', 'Question', 'Questions'] };
611
631
  function replayHtml() {
612
- const head = `<div class="m3-fh"><button class="mtg-b" data-m3="unreplay">Back to the meeting</button><div class="m3-fti"><b>${esc(row.title)}</b><span class="note">Replay · ${esc(row.time)}</span></div></div>`;
613
- if (repM === undefined) return `<article class="paper doc mtg">${head}<p class="note" role="status">${esc(RP && RP.error ? 'Replay could not be read: ' + RP.error : 'Reading the recording.')}</p></article>`;
614
- if (!repM) return `<article class="paper doc mtg">${head}<p class="note">Reading the recording.</p></article>`;
615
- const m = repM, pct = (t) => Math.min(100, Math.max(0, t / m.len * 100)).toFixed(2);
616
- const track = m.stretches.length ? m.stretches.map((x) => `<button class="m3-stc" style="flex:${x.to - x.from}" data-m3="seek" data-t="${x.from}" data-from="${x.from}" data-to="${x.to}" aria-label="${esc(x.text || 'Topic ' + x.n)}">${x.n}</button>`).join('') : '';
617
- const marks = m.keys.filter((k) => k.t != null).map((k) => `<i class="m3-mk ${k.k}" style="left:${pct(k.t)}%" title="${k.k === 'action' ? 'Next step' : k.k === 'decision' ? 'Decision' : 'Question'}"></i>`).join('');
618
- let h = head + `<div class="m3-rctl"><button class="mtg-b" data-m3="back10" aria-label="Back 10 seconds">Back 10 s</button><button class="mtg-b cta" data-m3="play" id="rpPlay">Play</button><div class="seg2" role="group" aria-label="Speed">${[1, 1.5, 2].map((v) => `<button class="mtg-b" data-m3="spd" data-v="${v}" aria-pressed="${RP.spd === v}">${v}x</button>`).join('')}</div><span class="note m3-pos" id="rpPos"></span></div>`;
619
- h += `<div class="m3-trk" role="group" aria-label="The meeting by topic">${track}${marks}<b class="m3-ph" id="rpPh"></b></div>`;
620
- h += '<div class="m3-lgd"><span><i class="decision"></i>Decision</span><span><i class="action"></i>Next step</span><span><i class="question"></i>Question</span></div>';
621
- h += `<div class="m3-now"><span class="label">Topic</span><b id="rpTopic"></b><span class="note" id="rpNear"></span></div><div id="rpShot"></div>`;
622
- h += '<span class="label">Key points</span>' + (m.keys.length ? `<div class="m3-kps">${m.keys.map((k) => k.t != null ? `<button data-m3="seek" data-t="${k.t}"><span class="kd">${k.k === 'action' ? 'Next step' : k.k === 'decision' ? 'Decision' : 'Question'}</span><span>${esc(k.text)}</span><time>${mmss(k.t)}</time></button>` : `<div class="m3-kp0"><span class="kd">${k.k === 'action' ? 'Next step' : k.k === 'decision' ? 'Decision' : 'Question'}</span><span>${esc(k.text)}</span><em>No time</em></div>`).join('')}</div>` : '<p class="note">The note holds no decisions, next steps or questions.</p>');
623
- h += '<span class="label">Conversation</span>' + (m.lines.length ? `<div class="m3-ftr all" id="rpLines">${m.lines.map((l) => `<button class="m3-ln" id="rl${l.i}" data-m3="seek" data-t="${l.t}"><time>${mmss(l.t)}</time><b>${esc(l.who)}</b><span>${esc(l.text)}</span></button>`).join('')}</div>` : '<p class="note">The recording holds no transcript.</p>');
632
+ const back = `<button class="mtg-b" data-m3="unreplay">${ic('back')}Back to the meeting</button>`;
633
+ const head0 = `<div class="m3-fh">${back}<div class="m3-fti"><b>${esc(row.title)}</b><span class="note">Replay · ${esc(row.time)}</span></div></div>`;
634
+ if (repM === undefined) return `<article class="paper doc mtg">${head0}<p class="note" role="status">${esc(RP && RP.error ? 'Replay could not be read: ' + RP.error : 'Reading the recording.')}</p></article>`;
635
+ if (!repM) return `<article class="paper doc mtg">${head0}<p class="note">Reading the recording.</p></article>`;
636
+ const m = repM, pct = (t) => Math.min(100, Math.max(0, t / m.len * 100)).toFixed(2), w = (t) => wallOf(m, t);
637
+ const day = m.at && Number.isFinite(Date.parse(m.at)) ? new Date(m.at).toLocaleDateString(undefined, { weekday: 'short', day: 'numeric', month: 'short' }) : row.day;
638
+ const chips = [day, m.start != null ? w(0) + ' to ' + w(m.len) : '', Math.max(1, Math.round(m.len / 60000)) + ' min', m.people ? m.people + (m.people === 1 ? ' person' : ' people') : ''].filter(Boolean).join(' · ');
639
+ const kept = (m.audio ? 'audio' : 'no audio') + (m.shots.length ? ' and ' + m.shots.length + (m.shots.length === 1 ? ' screen shot' : ' screen shots') : '');
640
+ const need = m.keys.filter((k) => k.need).length;
641
+ let h = `<section class="rp-hd"><div class="m3-fh">${back}<div class="m3-fti"><b>${esc(m.title || row.title)}</b><span class="note">${esc(chips)} · ${ic('lock')}${esc(kept)}</span></div>
642
+ <div class="rp-clk"><b id="rpPos">${mmss(0)} / ${mmss(m.len)}</b><small id="rpClk">${esc(w(0))}</small></div></div>`;
643
+ h += `<div class="m3-rctl"><button class="mtg-b" data-m3="back10" aria-label="Back 10 seconds">${ic('undo')}Back 10 s</button><button class="mtg-b cta" data-m3="play" id="rpPlay">Play</button><div class="seg2" role="group" aria-label="Speed">${[1, 1.5, 2].map((v) => `<button class="mtg-b" data-m3="spd" data-v="${v}" aria-pressed="${RP.spd === v}">${v}x</button>`).join('')}</div></div>`;
644
+ const marks = m.keys.filter((k) => k.t != null).map((k) => `<button class="rp-mk ${k.k}${k.need ? ' need' : ''}" style="left:${pct(k.t)}%" data-rp="seek" data-t="${k.t}" aria-label="${RPK[k.k][1]} at ${esc(w(k.t))}: ${esc(k.text)}" title="${esc(RPK[k.k][1] + ' · ' + k.text)}"><span>${ic(RPK[k.k][0])}</span></button>`)
645
+ .concat(m.pmos.map((x) => `<button class="rp-mk pm" style="left:${pct(x.t)}%" data-rp="seek" data-t="${x.t}" aria-label="PMOS note at ${esc(w(x.t))}: ${esc(x.body)}" title="${esc('PMOS · ' + x.body)}"><span>${ic('spark')}</span></button>`)).join('');
646
+ const track = m.stretches.map((x) => `<button class="m3-stc" style="flex:${x.to - x.from}" data-m3="seek" data-t="${x.from}" data-from="${x.from}" data-to="${x.to}" aria-label="${esc((x.text || 'Topic ' + x.n) + ' from ' + w(x.from))}">${x.n}</button>`).join('');
647
+ const dots = m.keys.filter((k) => k.t != null).map((k) => `<i class="m3-mk ${k.k}" style="left:${pct(k.t)}%"></i>`).join('');
648
+ const gaps = m.gaps.map((g) => `<i class="rp-gap" style="left:${pct(g.from)}%;width:${(Math.max(0.6, (g.to - g.from) / m.len * 100)).toFixed(2)}%" title="Not recorded ${esc(w(g.from))} to ${esc(w(g.to))}"></i>`).join('');
649
+ const ticks = [0, 0.25, 0.5, 0.75, 1].map((f) => `<span>${esc(w(m.len * f))}</span>`).join('');
650
+ h += `<div class="rp-tl"><div class="rp-mks">${marks}</div><div class="m3-trk${track ? '' : ' none'}" role="group" aria-label="The meeting by topic">${track || `<button class="m3-stc" style="flex:1" data-m3="seek" data-t="0" aria-label="From the start">${m.topics.length ? '' : 'No topics were kept'}</button>`}${dots}${gaps}<b class="m3-ph" id="rpPh"></b></div><div class="rp-sc">${ticks}</div></div>`;
651
+ h += `<div class="m3-lgd"><span>${ic('dec')}Decisions</span><span>${ic('undo')}Questions</span><span>${ic('task')}Next steps</span><span>${ic('spark')}PMOS notes</span><span><i class="ring"></i>needs you</span></div></section>`;
652
+ h += `<div class="m3-now"><span class="label">Topic</span><b id="rpTopic"></b><span class="note" id="rpNear"></span>${m.shots.length ? `<span class="chp sm" id="rpShK">${ic('xp')}<span></span></span>` : ''}${m.keys.length ? `<button class="mtg-b" data-rp="keys">${ic('check')}${m.keys.length} key ${m.keys.length === 1 ? 'point' : 'points'}${need ? ' · ' + need + ' need you' : ''}</button>` : ''}</div>`;
653
+ const strip = m.shots.map((x) => `<button class="mtg-b" data-m3="seek" data-t="${x.t}" data-shot="${x.t}" title="${esc(x.why || 'The shared screen at ' + w(x.t))}">${esc(w(x.t))}</button>`).join('');
654
+ h += `<div class="rp-g"><section class="rp-box rp-st"><div class="rp-cap">${ic('xp')}<b>On screen</b><span class="note">Kept when the screen changed${m.aside ? ' · ' + m.aside + ' set aside' : ''}</span></div><div id="rpShot"></div>${strip ? `<div class="rp-ts" role="group" aria-label="Screen shots kept, by time">${strip}</div>` : ''}</section>
655
+ <section class="rp-box rp-cv"><div class="rp-cvh"><b>Conversation</b><div class="seg2" role="group" aria-label="Show">${[['a', 'All'], ['k', 'Key points'], ['p', 'PMOS']].map(([k, l]) => `<button class="mtg-b" data-rp="tab" data-v="${k}" aria-pressed="${RP.tab === k}">${l}</button>`).join('')}</div></div>
656
+ <div class="m3-ftr all" id="rpLines">${convHtml()}</div><label class="rp-q">${ic('search')}<input id="rpQ" type="search" placeholder="Search what was said" aria-label="Search what was said" value="${esc(RP.q)}" autocomplete="off"></label></section></div>`;
657
+ h += `<section class="rp-box" id="rpKeys"><div class="rp-cvh"><div class="rp-cap">${ic('check')}<b>Key points</b></div>${m.keys.some((k) => k.k === 'action') ? `<button class="mtg-b cta" data-rp="confirm" title="Make a task of each next step on the note’s initiative">${ic('check')}Confirm all</button>` : ''}</div>`
658
+ + (m.keys.length ? `<div class="m3-kps rp-kc">${['decision', 'action', 'question'].map((k) => { const l = m.keys.filter((x) => x.k === k); return `<div class="rp-col"><h4>${ic(RPK[k][0])}${RPK[k][2]}<small>${l.length}</small></h4>${l.length ? l.map(keyHtml).join('') : '<p class="note">None caught.</p>'}</div>`; }).join('')}</div><p class="note">Each one plays from the moment it was said. Confirm all makes a task of each next step on the note’s initiative.</p>` : '<p class="note">The note holds no decisions, next steps or questions.</p>') + '</section>';
624
659
  h += `<p class="note">${m.audio && !RP.noAudio ? 'Plays the note’s audio, kept on this machine.' : 'No audio is kept for this meeting, so the playhead keeps its own clock.'}</p>`;
625
- return `<article class="paper doc mtg">${h}</article>`;
660
+ return `<article class="paper doc mtg rpv">${h}</article>`;
661
+ }
662
+ function keyHtml(k) {
663
+ const meta = k.k === 'decision' ? (k.by || 'the group') : k.k === 'action' ? (k.owner ? [k.owner, k.due && 'due ' + k.due].filter(Boolean).join(' · ') : 'no owner') : k.state === 'answered' ? 'answered' : 'still open';
664
+ const tags = `<span class="rp-tg"><span class="${k.need ? 'warn' : ''}">${esc(meta)}</span>${k.k === 'question' ? '' : `<span>${RP.done.has(k.id) ? 'task made' : 'draft'}</span>`}</span>`;
665
+ const kind = `<span class="kd">${esc(RPK[k.k][1])}</span>`;
666
+ return k.t != null ? `<button data-m3="seek" data-t="${k.t}" class="${k.need ? 'need' : ''}">${kind}<span>${esc(k.text)}${tags}</span><time>${esc(wallOf(repM, k.t))}</time></button>`
667
+ : `<div class="m3-kp0${k.need ? ' need' : ''}">${kind}<span>${esc(k.text)}${tags}</span><em>No time</em></div>`;
668
+ }
669
+ function convHtml() {
670
+ const m = repM, q = RP.q.trim().toLowerCase();
671
+ const all = [...m.lines.map((l) => ({ t: l.t, l })), ...m.pmos.map((p) => ({ t: p.t, p }))].sort((a, b) => a.t - b.t || (a.p ? 1 : 0) - (b.p ? 1 : 0))
672
+ .filter((x) => RP.tab === 'a' || (RP.tab === 'k' ? x.l && x.l.key : x.p)).filter((x) => !q || (x.l ? x.l.who + ' ' + x.l.text : x.p.body).toLowerCase().includes(q));
673
+ if (!all.length) return `<p class="note">${q ? 'Nothing said matches “' + esc(RP.q) + '”.' : RP.tab === 'p' ? 'PMOS made no notes during this meeting.' : RP.tab === 'k' ? 'No line was caught as a key point.' : 'The recording holds no transcript.'}</p>`;
674
+ return all.map((x) => x.p ? `<button class="m3-ln pm" data-m3="seek" data-t="${x.t}"><time>${esc(wallOf(m, x.t))}</time><b>PMOS</b><span>${esc(x.p.body)}</span></button>`
675
+ : `<button class="m3-ln" id="rl${x.l.i}" data-m3="seek" data-t="${x.l.t}"><time>${esc(wallOf(m, x.l.t))}</time><b>${esc(x.l.who || 'You')}</b><span>${x.l.key && RPK[x.l.key] ? `<em class="rp-kt">${esc(RPK[x.l.key][1])}</em>` : ''}${esc(x.l.text)}</span></button>`).join('');
626
676
  }
627
677
  function replayPaint() {
628
678
  const m = repM; if (!m || !alive('replay')) return;
629
679
  const pos = RP.pos, at = replayAt(m, pos), $q = (id) => document.getElementById(id);
630
680
  if ($q('rpPos')) $q('rpPos').textContent = mmss(pos) + ' / ' + mmss(m.len);
681
+ if ($q('rpClk')) $q('rpClk').textContent = wallOf(m, pos);
631
682
  if ($q('rpPh')) $q('rpPh').style.left = Math.min(100, pos / m.len * 100).toFixed(2) + '%';
632
683
  if ($q('rpTopic')) $q('rpTopic').textContent = at.stretch ? (at.stretch.text || 'Topic ' + at.stretch.n) : m.stretches.length ? 'Between topics' : 'No topics were kept';
633
684
  if ($q('rpNear')) $q('rpNear').textContent = at.near ? at.near + (at.near === 1 ? ' key point near' : ' key points near') : '';
634
685
  if ($q('rpPlay')) $q('rpPlay').textContent = RP.play ? 'Pause' : 'Play';
635
686
  $$('#oMain .m3-stc[data-from]').forEach((b) => b.classList.toggle('on', pos >= +b.dataset.from && pos < +b.dataset.to));
636
687
  const prev = RP.line; RP.line = at.line;
637
- if (prev !== at.line) { if (prev >= 0 && $q('rl' + prev)) $q('rl' + prev).classList.remove('cur'); const c = at.line >= 0 ? $q('rl' + at.line) : null; if (c) { c.classList.add('cur'); if (RP.play) c.scrollIntoView({ block: 'nearest' }); } }
638
- const sh = $q('rpShot'); if (sh) { const want = at.shot >= 0 ? m.shots[at.shot] : null, have = sh.dataset.t || ''; if ((want ? String(want.t) : '') !== have) { sh.dataset.t = want ? want.t : ''; sh.innerHTML = want && m.noteId ? `<figure class="m3-shot"><img src="/api/notes/screen?id=${encodeURIComponent(m.noteId)}&t=${want.t}" alt="${esc(want.why || 'The shared screen at ' + mmss(want.t))}" loading="lazy"><figcaption class="note">${esc(want.why || 'The shared screen at ' + mmss(want.t))}</figcaption></figure>` : ''; } }
688
+ if (prev !== at.line) { if (prev >= 0 && $q('rl' + prev)) $q('rl' + prev).classList.remove('cur'); const c = at.line >= 0 ? $q('rl' + at.line) : null; if (c) { c.classList.add('cur'); if (RP.play) { const L = $q('rpLines'); if (L) L.scrollTop = Math.max(0, c.offsetTop - L.offsetTop - L.clientHeight / 3); } } }
689
+ $$('#oMain .m3-ln.pm').forEach((b) => b.classList.toggle('fut', +b.dataset.t > pos));
690
+ const want = at.shot >= 0 ? m.shots[at.shot] : null;
691
+ if ($q('rpShK')) $q('rpShK').lastChild.textContent = want ? 'Screen shot from ' + wallOf(m, want.t) : 'Nothing shared yet';
692
+ $$('#oMain [data-shot]').forEach((b) => b.setAttribute('aria-pressed', String(!!want && +b.dataset.shot === want.t)));
693
+ const sh = $q('rpShot'); if (sh) { const have = sh.dataset.t, key = want ? String(want.t) : 'none'; if (key !== have) { sh.dataset.t = key; sh.innerHTML = want && m.noteId ? `<figure class="m3-shot"><img src="/api/notes/screen?id=${encodeURIComponent(m.noteId)}&t=${want.t}" alt="${esc(want.why || 'The shared screen at ' + mmss(want.t))}" loading="lazy"><figcaption class="note">${esc(want.why || 'The shared screen at ' + mmss(want.t))} · ${esc(wallOf(m, want.t))}</figcaption></figure>` : `<p class="note rp-none">${m.shots.length ? 'Nothing was shared yet. The first screen shot is at ' + esc(wallOf(m, m.shots[0].t)) + '.' : 'No screen shots were kept for this meeting.'}</p>`; } }
694
+ }
695
+ /* Confirm all: each next step not yet made becomes a task of the note's initiative, as Make task does (POST /api/plan-items) */
696
+ async function confirmAll(btn) {
697
+ const m = repM, todo = m.keys.filter((k) => k.k === 'action' && !RP.done.has(k.id));
698
+ if (!todo.length) return say('Every next step is already a task.');
699
+ if (!m.note || !m.note.initiative) return say('Link the note to an initiative first. Confirm all adds each next step to its breakdown.');
700
+ if (btn) btn.disabled = true;
701
+ let made = 0, last = '';
702
+ for (const k of todo) { const res = await planTask(m.note, { text: k.text, owner: k.owner, due: k.due }); if (!res.ok) { last = res.text; break; } RP.done.add(k.id); made++; }
703
+ if (!alive('replay')) return;
704
+ const L = $('#rpKeys'); if (L) { const fresh = document.createElement('div'); fresh.innerHTML = replayHtml(); const k2 = fresh.querySelector('#rpKeys'); if (k2) L.replaceWith(k2); }
705
+ say(made ? `${made} next ${made === 1 ? 'step is' : 'steps are'} now ${made === 1 ? 'a task' : 'tasks'} in ${m.note.initiative.name}.${last ? ' ' + last : ''}` : last);
706
+ replayPaint();
639
707
  }
640
708
  function replayStop() { clearInterval(RP && RP.tm); if (RP && RP.aud) { try { RP.aud.pause(); } catch { /* gone */ } } if (RP) RP.play = false; }
641
709
  function replaySeek(ms, play) {
@@ -659,7 +727,8 @@ export function mountMeeting(d) {
659
727
  replayPaint();
660
728
  }
661
729
  async function openReplay() {
662
- ui.view = 'replay'; repM = null; RP = { pos: 0, play: false, spd: 1, aud: null, tm: null, line: -2, noAudio: false }; paint();
730
+ ui.view = 'replay'; repM = null; RP = { pos: 0, play: false, spd: 1, aud: null, tm: null, line: -2, noAudio: false, tab: 'a', q: '', done: new Set() };
731
+ wide(true); paint();
663
732
  const r = await d.pmGet('/api/meeting-replay?event=' + encodeURIComponent(row.id) + '&date=' + row.day);
664
733
  if (!alive('replay')) return;
665
734
  repM = replayModel(r);
@@ -667,7 +736,14 @@ export function mountMeeting(d) {
667
736
  if (repM.audio) { RP.aud = new Audio(repM.audio.url); RP.aud.preload = 'metadata'; RP.aud.addEventListener('error', () => { RP.aud = null; RP.noAudio = true; }); }
668
737
  paint(); $('#rpPlay') && $('#rpPlay').focus(); replayPaint();
669
738
  }
670
- const leave = (to) => { clearTimeout(fT); if (ui.view === 'replay') replayStop(); ui.view = to; ui.change = false; paint(); const b = $('#oMain [data-m3="' + (to === 'detail' ? (RP && repM ? 'replay' : 'focus') : '') + '"]'); if (b) b.focus(); };
739
+ /* Replay takes the whole window with the conversation hidden, as the prototype's replay does; leaving it puts the dialog back as it was */
740
+ let wasDlg = null;
741
+ function wide(on) {
742
+ const g = document.getElementById('dlg'); if (!g || !d.setFull || !d.setMode) return;
743
+ if (on) { if (!wasDlg) wasDlg = { full: g.classList.contains('full'), mode: g.dataset.mode || 'split' }; d.setFull(true); d.setMode('detail'); g.classList.add('rpw'); return; }
744
+ g.classList.remove('rpw'); if (wasDlg) { d.setFull(wasDlg.full); d.setMode(wasDlg.mode); wasDlg = null; }
745
+ }
746
+ const leave = (to) => { clearTimeout(fT); if (ui.view === 'replay') { replayStop(); wide(false); } ui.view = to; ui.change = false; paint(); const b = $('#oMain [data-m3="' + (to === 'detail' ? (RP && repM ? 'replay' : 'focus') : '') + '"]'); if (b) b.focus(); };
671
747
 
672
748
  /* the presses of the Record row, Focus and Replay */
673
749
  async function m3Press(act, t) {
@@ -700,7 +776,7 @@ export function mountMeeting(d) {
700
776
  if (res && res.ok === true) await readFocus(); paint(); if (ui.recMsg) d.toast(ui.recMsg); return;
701
777
  }
702
778
  case 'replay': return openReplay();
703
- case 'unreplay': replayStop(); ui.view = 'detail'; paint(); { const b = $('#oMain [data-m3="replay"]'); if (b) b.focus(); } return;
779
+ case 'unreplay': replayStop(); wide(false); ui.view = 'detail'; paint(); { const b = $('#oMain [data-m3="replay"]'); if (b) b.focus(); } return;
704
780
  case 'play': if (repM && RP) replayToggle(); return;
705
781
  case 'back10': if (repM && RP) replaySeek(RP.pos - 10000, false); return;
706
782
  case 'spd': if (RP) { RP.spd = +t.dataset.v; if (RP.aud) RP.aud.playbackRate = RP.spd; $$('#oMain [data-m3="spd"]').forEach((b) => b.setAttribute('aria-pressed', +b.dataset.v === RP.spd)); } return;
@@ -793,6 +869,7 @@ export function mountMeeting(d) {
793
869
  const pickOf = (key) => { const [k, i] = key.split(':'); return (k === 'sug' ? SH.sug : k === 'found' ? SH.found : [pasteOf(SH.link)])[+i] || null; };
794
870
 
795
871
  $('#oMain').oninput = (e) => {
872
+ if (e.target.id === 'rpQ' && repM && RP) { RP.q = e.target.value; $('#rpLines').innerHTML = convHtml(); RP.line = -2; replayPaint(); return; }
796
873
  if (e.target.id === 'mmLinkIn') { SH.link = e.target.value.trim(); const p = pasteOf(SH.link); if (p) SH.pick = p; else if (SH.pick && !SH.pick.ref) SH.pick = null; paintSheet(); }
797
874
  if (e.target.id === 'mmFind') {
798
875
  SH.q = e.target.value.trim(); SH.found = []; SH.foundBusy = SH.q.length >= 2; paintSheet(); clearTimeout(findT);
@@ -806,6 +883,14 @@ export function mountMeeting(d) {
806
883
  $('#oMain').onclick = async (e) => {
807
884
  const t = e.target.closest('button'); if (!t) return;
808
885
  if (t.dataset.m3) return m3Press(t.dataset.m3, t);
886
+ if (t.dataset.rp && repM && RP) { // the Replay's own presses: a mark on the track, the conversation tabs, the key points link and Confirm all
887
+ const k = t.dataset.rp;
888
+ if (k === 'seek') return replaySeek(+t.dataset.t, true);
889
+ if (k === 'tab') { RP.tab = t.dataset.v; $$('#oMain [data-rp="tab"]').forEach((b) => b.setAttribute('aria-pressed', String(b === t))); $('#rpLines').innerHTML = convHtml(); RP.line = -2; replayPaint(); return; }
890
+ if (k === 'keys') { const n = $('#rpKeys'); if (n) n.scrollIntoView({ behavior: 'smooth', block: 'start' }); return; }
891
+ if (k === 'confirm') return confirmAll(t);
892
+ return;
893
+ }
809
894
  if (t.dataset.ph) {
810
895
  ui.phase = t.dataset.ph; ui.picked = true;
811
896
  $$('#oMain .vm-ph [data-ph]').forEach((b) => b.setAttribute('aria-pressed', String(b === t)));
@@ -2,6 +2,7 @@
2
2
  import { pmGet, pmPost } from './http.js';
3
3
  import { recChipView, STOP_LINE } from './premium-meeting.js';
4
4
  import { vwReset } from './premium-viewer.js';
5
+ import { openChatFile } from './premium-vw-file.js';
5
6
  import { chipActs, openLive, openFocus, mountRecord, HL_LINE } from './premium-vw-rec.js';
6
7
  import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words.js';
7
8
  import { splitGoal, shownUser, goalBlockHtml, goalProgressHtml, slashMatches } from './goal-chat.js';
@@ -269,7 +270,7 @@ export function drawThread(th, key, conv) {
269
270
  let t = $('#thr', box); if (!t) { box.insertAdjacentHTML('beforeend', '<div id="thr"></div>'); t = $('#thr', box); }
270
271
  const b = $('#dBody'), atEnd = b.scrollHeight - b.scrollTop - b.clientHeight < 80;
271
272
  t.innerHTML = threadHtml(th) + sessionHtml(conv, th.goal);
272
- S.goal = th.goal || null; S.draft = readyDraft(conv);
273
+ S.goal = th.goal || null; S.draft = readyDraft(conv); S.session = th.session || null;
273
274
  const go = $('#askGo'); if (go) go.disabled = !!th.working; // an earlier read-only run still answering
274
275
  const n = $('#askNote'); if (n) n.textContent = th.working ? 'The agent is answering. You can write again when it has.' : conv && conv.ask ? 'Claude is waiting for your answer above.' : CHAT_NOTE;
275
276
  if (atEnd) b.scrollTop = b.scrollHeight;
@@ -299,6 +300,13 @@ $('#dBody').addEventListener('click', async (e) => {
299
300
  if (!r || !r.ok) $('#askNote').textContent = (r && r.error) || 'The key did not reach the session.';
300
301
  setTimeout(() => loadThread(S.key), 500);
301
302
  });
303
+ /* a file path in Claude's words opens the file read-only as a viewer tab beside the conversation; on a phone the Detail side shows it */
304
+ $('#dBody').addEventListener('click', (e) => {
305
+ const f = e.target.closest('[data-file]'); if (!f) return;
306
+ e.preventDefault();
307
+ openChatFile(f.dataset.file, { session: S.session || null, ws: new URLSearchParams(location.search).get('ws') });
308
+ if (innerWidth < 1000) setTab('out');
309
+ });
302
310
  /* /goal (slice 2): a chip sends its answer; Start and Cancel are the PM's presses on the goal card; Change something hands the box back. */
303
311
  async function sendText(key, text) {
304
312
  const go = $('#askGo'); if (go) go.disabled = true; $('#askNote').textContent = 'Sending.';
@@ -8,6 +8,9 @@
8
8
  .vwdoc .gap{flex:1}
9
9
  .vwmut{color:var(--ink-3);font-size:var(--fs-2);margin:0}
10
10
  .vwline{margin:0 0 10px}
11
+ .vwfnone{margin:8px 0;padding:22px 20px;border:1px dashed var(--hair);border-radius:8px;display:grid;gap:6px;color:var(--ink-2);font-size:var(--fs-3)}
12
+ .vwfnone b{font-weight:500;color:var(--ink)}
13
+ .vwfnone code{font:400 var(--fs-1) var(--mono);color:var(--ink-3);overflow-wrap:anywhere}
11
14
  .vwempty{color:var(--ink-3);font-size:var(--fs-3);padding:24px 4px}
12
15
  .vwrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
13
16
  .vwrow .vwmut{flex:1;min-width:160px}
@@ -0,0 +1,72 @@
1
+ /* pm/premium-vw-file.js — a file Claude named in a chat panel, read-only in the viewer beside the conversation (PM, 2026-10-20: "Why can't I click the file
2
+ * and see it on the right panel?"). A press on a path in Claude's words (chat-md.js draws it as button.fpath) opens the file as a tab: markdown as a page,
3
+ * any other text file as code. GET /api/doc/locate says which served workspace holds the path and GET /api/doc reads it there, so a path outside every
4
+ * workspace PMOS serves is never read: its tab says so quietly. While the tab is open the file is checked every few seconds and drawn again when it
5
+ * changed, so a file Claude is still writing stays current. Nothing here writes.
6
+ * openChatFile(path, { session, ws }) -> the tab's pane */
7
+ import { vwOpen, vwStyle } from './premium-viewer.js';
8
+ import { bodyHtml, pageHead, splitDoc, readMinutes } from './premium-vw-doc-model.js';
9
+
10
+ const CHECK_MS = 2500;
11
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
12
+ const base = (p) => String(p || '').replace(/:\d+(:\d+)?$/, '').split('/').filter(Boolean).pop() || 'File';
13
+ const OPEN = new Map(); // tab id -> state
14
+ async function getJson(url) { try { const r = await fetch(url, { credentials: 'same-origin' }); return await r.json(); } catch { return null; } }
15
+ async function getText(url) { try { const r = await fetch(url, { credentials: 'same-origin' }); return { ok: r.ok, text: await r.text(), kind: r.headers.get('X-Doc-Kind') || 'text' }; } catch { return { ok: false, text: 'The workspace server did not answer.' }; } }
16
+
17
+ /** The page for one file as HTML. Pure, for Node: f is { name, rel, abs, kind, text, err, why, reason }. */
18
+ export function fileHtml(f) {
19
+ if (!f || f.loading) return '<div class="vwdoc"><p class="vwempty" role="status">Reading the file.</p></div>';
20
+ if (f.reason) {
21
+ const head = f.reason === 'outside' ? 'Not in a workspace' : f.reason === 'missing' ? 'No such file' : 'Not opened here';
22
+ return `<div class="vwdoc"><div class="vwfnone" role="status"><b>${esc(head)}</b><p class="vwmut">${esc(f.why || '')}</p><code>${esc(f.path)}</code></div></div>`;
23
+ }
24
+ if (f.err) return `<div class="vwdoc"><div class="vwfnone" role="status"><b>The file could not be shown</b><p class="vwmut">${esc(f.err)}</p><code>${esc(f.abs || f.path)}</code></div></div>`;
25
+ const foot = `<footer class="cff"><span>Read-only · ${readMinutes(f.text)} min read</span><span class="gap"></span><code>${esc(f.abs || f.rel)}</code></footer>`;
26
+ if (f.kind === 'markdown') {
27
+ const h = pageHead(f.text), sd = splitDoc(f.text);
28
+ const body = bodyHtml([sd.pre, ...sd.sections.map((s, n) => (n === 0 && h.h1 ? s.body : s.head + '\n' + s.body))].join('\n')).html;
29
+ return `<div class="vwdoc"><article class="cf vwfile"><header class="cfh"><h1 class="cft">${esc(h.title || f.name)}</h1>`
30
+ + (h.labels.length ? `<div class="cflb">${h.labels.map((l) => `<span>${esc(l)}</span>`).join('')}</div>` : '')
31
+ + `</header><div class="cfb">${body || '<p class="vwmut">The file has no text yet.</p>'}</div>${foot}</article></div>`;
32
+ }
33
+ const ext = (/\.([A-Za-z0-9]+)$/.exec(f.name || '') || [])[1] || 'text';
34
+ return `<div class="vwdoc"><article class="cf vwfile"><header class="cfh"><h1 class="cft">${esc(f.name)}</h1></header>`
35
+ + `<div class="cfb"><div class="cb" data-lang="${esc(ext)}"><div class="cbh"><span>${esc(ext)}</span></div><pre>${esc(f.text)}</pre></div></div>${foot}</article></div>`;
36
+ }
37
+
38
+ export function openChatFile(p, ctx = {}) {
39
+ vwStyle('doc');
40
+ const q = (o) => Object.entries(o).filter(([, v]) => v).map(([k, v]) => k + '=' + encodeURIComponent(v)).join('&');
41
+ const where = () => '/api/doc/locate?' + q({ path: p, session: ctx.session, ws: ctx.ws });
42
+ const id = 'file:' + p;
43
+ let st = OPEN.get(id);
44
+ if (!st) { st = { f: { loading: true, path: p }, sig: '', timer: null }; OPEN.set(id, st); }
45
+ const pane = vwOpen({ id, title: base(p), icon: 'doc', render: (el) => { el.innerHTML = fileHtml(st.f); } });
46
+ const draw = () => {
47
+ const el = document.querySelector(`#dOut .obody.vw[data-vw="${CSS.escape(id)}"]`);
48
+ if (!el) return false;
49
+ const y = el.scrollTop; el.innerHTML = fileHtml(st.f); el.scrollTop = y;
50
+ return true;
51
+ };
52
+ async function read() {
53
+ const loc = await getJson(where());
54
+ if (!loc) { if (st.f.loading) { st.f = { path: p, err: 'The workspace server did not answer.' }; return true; } return false; } // a missed check keeps what is drawn
55
+ if (!loc.ok) { const sig = 'x:' + loc.reason; if (sig === st.sig) return false; st.sig = sig; st.f = { path: p, reason: loc.reason, why: loc.why }; return true; }
56
+ const sig = loc.ws + '/' + loc.rel + '@' + loc.mtime + ':' + loc.size;
57
+ if (sig === st.sig) return false;
58
+ const got = await getText('/api/doc?' + q({ ws: loc.ws, path: loc.rel }));
59
+ st.sig = sig;
60
+ st.f = got.ok ? { path: p, name: loc.name, rel: loc.rel, abs: loc.abs, kind: got.kind, text: got.text } : { path: p, abs: loc.abs, err: got.text };
61
+ return true;
62
+ }
63
+ clearTimeout(st.timer);
64
+ const tick = async () => {
65
+ const changed = await read();
66
+ if (!document.querySelector(`#dOut .obody.vw[data-vw="${CSS.escape(id)}"]`)) { OPEN.delete(id); return; } // the tab or the dialog closed: stop checking
67
+ if (changed) draw();
68
+ st.timer = setTimeout(tick, CHECK_MS);
69
+ };
70
+ st.sig = ''; st.f = { loading: true, path: p }; tick();
71
+ return pane;
72
+ }
@@ -356,6 +356,10 @@ a.round{color:inherit;text-decoration:none}
356
356
  .p-out{background:transparent;border-radius:0}
357
357
  .otop{padding:0 0 6px;background:transparent}
358
358
  .otop .ol{display:none}
359
+ /* a phone: the dialog's panes scroll under its title with no edge of their own, so text slid up to the subtitle and read as overlapping it (PM, 2026-10-20).
360
+ The top of each scrolling pane now fades, and the viewer's tab strip, which stays at the top, carries the dialog's own surface. */
361
+ .dlg .dgrid .pane{padding-top:12px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,var(--ink) 14px);mask-image:linear-gradient(to bottom,transparent 0,var(--ink) 14px)}
362
+ .otop:has(.vtabs:not([hidden])){top:0;padding-top:12px;margin-top:-12px;background:var(--card-solid)}
359
363
  .obody{padding:0}
360
364
  .paper.doc{padding:2px 0 28px;border:0;box-shadow:none;background:transparent;border-radius:0}
361
365
  .doc .dpath{display:none}}
@@ -1664,6 +1668,45 @@ button.m3-stc{min-height:44px;margin:-7px 0}button.m3-stc:hover{background:var(-
1664
1668
  .m3-kps button:hover{background:var(--well)}.m3-kps time,.m3-kp0 em{font:500 var(--t-small) var(--mono);color:var(--ink-3);font-style:normal}.m3-kps .kd{font-size:var(--t-small);color:var(--ink-3)}
1665
1669
  .m3-ln{display:grid;grid-template-columns:44px 56px minmax(0,1fr);gap:10px;text-align:left;padding:8px 10px;border-radius:14px;font-size:var(--t-body);color:var(--ink-2);line-height:1.45;min-height:44px}.m3-ln time{font:500 var(--t-small) var(--mono);color:var(--ink-3)}.m3-ln b{color:var(--ink)}.m3-ln:hover{background:var(--well)}.m3-ln.cur{background:var(--well);color:var(--ink)}
1666
1670
  .m3-shot{margin:8px 0;display:grid;gap:6px}.m3-shot img{max-width:100%;border-radius:14px;border:1px solid var(--hair)}.m3-shot figcaption{margin:0}
1671
+ /* Replay, as the prototype's replay (prototype/premium-conversation-shell): the whole window, the conversation hidden, the player in the head */
1672
+ #dlg.rpw .dhead .dht,#dlg.rpw #dPane,#dlg.rpw #dExpand{display:none}#dlg.rpw .dhead{justify-content:flex-end}
1673
+ .rpv{max-width:1280px;margin:0 auto}
1674
+ .rpv .m3-fh .i,.rpv .m3-rctl .i,.rpv .m3-now .i,.rpv .m3-lgd .i,.rp-cap .i,.rp-col h4 .i,.rp-q .i{width:14px;height:14px;vertical-align:-2px;margin-right:5px;fill:none;stroke:currentColor;stroke-width:1.8}
1675
+ .rp-hd{padding:16px 18px;border-radius:14px;box-shadow:inset 0 0 0 1.5px var(--b3);margin-bottom:10px}
1676
+ .rp-hd .m3-fh{margin-bottom:10px}.rp-hd .m3-fti .note .i{margin:0 4px 0 2px}
1677
+ .rp-clk{display:grid;justify-items:end;font-family:var(--mono)}.rp-clk b{font-size:var(--t-title)}.rp-clk small{font-size:var(--t-small);color:var(--ink-3)}
1678
+ .rp-hd .m3-rctl{margin-bottom:4px}
1679
+ .rp-tl{position:relative;padding-top:46px}
1680
+ .rp-mks{position:absolute;left:0;right:0;top:0;height:44px}
1681
+ .rp-mk{position:absolute;top:0;width:44px;height:44px;margin-left:-22px;display:grid;place-items:center;border-radius:50%}
1682
+ .rp-mk>span{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--card-solid);box-shadow:inset 0 0 0 1.5px var(--ink-2);color:var(--ink-2)}
1683
+ .rp-mk .i{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2}
1684
+ .rp-mk.action>span,.rp-mk.question>span{box-shadow:inset 0 0 0 1.5px var(--ember-ink);color:var(--ember-ink)}.rp-mk.pm>span{box-shadow:inset 0 0 0 1.5px var(--ink-3);color:var(--ink-3)}
1685
+ .rp-mk.need>span{outline:3px solid color-mix(in oklab,var(--ember) 35%,transparent)}
1686
+ .rp-mk:focus-visible{outline:2px solid var(--ink);outline-offset:-4px}
1687
+ .rp-tl .m3-trk{margin:0}.rp-tl .m3-trk.none .m3-stc{color:var(--ink-3);font-family:var(--sans)}
1688
+ .rp-gap{position:absolute;top:0;bottom:0;background:repeating-linear-gradient(135deg,var(--b3) 0 4px,transparent 4px 8px);border-radius:8px;pointer-events:none}
1689
+ .rp-sc{display:flex;justify-content:space-between;font:500 var(--t-micro) var(--mono);color:var(--ink-3);margin-top:6px}
1690
+ .rpv .m3-lgd .ring{width:11px;height:11px;border-radius:50%;background:none;box-shadow:inset 0 0 0 1.5px var(--ember-ink);vertical-align:-1px}
1691
+ .rpv .m3-now{margin:0 0 10px}.rpv .m3-now .chp{margin-left:auto}.rpv .m3-now .chp~.mtg-b{margin-left:0}
1692
+ .rp-g{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:10px;align-items:start;margin-bottom:10px}
1693
+ .rp-box{padding:14px 16px;border-radius:14px;box-shadow:inset 0 0 0 1.5px var(--b3);margin-bottom:10px;min-width:0}.rp-g .rp-box{margin-bottom:0}
1694
+ .rp-cap{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:8px}.rp-cap .note{margin:0 0 0 auto}
1695
+ .rp-none{padding:36px 12px;text-align:center;border-radius:14px;background:var(--well)}
1696
+ .rp-ts{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}.rp-ts .mtg-b{font-family:var(--mono)}.rp-ts .mtg-b[aria-pressed="true"]{box-shadow:inset 0 0 0 1.5px var(--ink);color:var(--ink)}
1697
+ .rp-cv{display:flex;flex-direction:column;max-height:620px}
1698
+ .rp-cvh .seg2 .mtg-b{min-width:44px;justify-content:center}.rp-cvh{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding-bottom:8px;border-bottom:1px solid var(--hair)}.rp-cvh .rp-cap{margin:0}
1699
+ .rp-cv .m3-ftr{flex:1;overflow:auto;min-height:160px;margin:6px 0}
1700
+ .rp-cv .m3-ln{grid-template-columns:48px 64px minmax(0,1fr)}.m3-ln.pm b{color:var(--ink-2)}.m3-ln.pm.fut,.rp-cv .m3-ln.fut{opacity:.55}
1701
+ .rp-kt{font-style:normal;font-size:var(--t-micro);font-weight:600;color:var(--ember-ink);margin-right:6px;text-transform:uppercase;letter-spacing:.04em}
1702
+ .rp-q{display:flex;align-items:center;gap:6px;min-height:44px;padding:0 12px;border-radius:12px;background:var(--well);color:var(--ink-3)}.rp-q input{flex:1;min-width:0;min-height:44px;border:0;background:none;color:var(--ink);font:inherit}.rp-q input:focus-visible{outline:none}.rp-q:focus-within{box-shadow:inset 0 0 0 2px var(--ink)}
1703
+ .rp-kc{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:10px}
1704
+ .rp-col{display:grid;align-content:start}.rp-col h4{display:flex;align-items:center;gap:2px;margin:0 0 6px;font-size:var(--t-small);color:var(--ink-2)}.rp-col h4 small{margin-left:6px;font-family:var(--mono);color:var(--ink-3)}
1705
+ .rp-kc button,.rp-kc .m3-kp0{grid-template-columns:minmax(0,1fr) auto}.rp-kc .kd{display:none}
1706
+ .rp-kc .need{box-shadow:inset 3px 0 0 var(--ember)}
1707
+ .rp-tg{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px;font-size:var(--t-small);color:var(--ink-3)}.rp-tg .warn{color:var(--ember-ink)}
1708
+ @media (hover:hover){.rp-mk:hover>span{background:var(--well)}}
1709
+ @media (max-width:1000px){.rp-g,.rp-kc{grid-template-columns:minmax(0,1fr)}.rp-cv{max-height:none}.rp-cv .m3-ftr{max-height:420px}.rp-clk{justify-items:start}}
1667
1710
  @media (max-width:1000px){.m3-cap{grid-template-columns:1fr}.m3-kps button,.m3-kp0{grid-template-columns:70px minmax(0,1fr)}.m3-kps time,.m3-kp0 em{display:none}.m3-ln{grid-template-columns:40px 48px minmax(0,1fr)}}
1668
1711
 
1669
1712
  /* ---- the premium Welcome page and the first-Briefing card (initiative premium-welcome): the approved mockup's rules (prototype/premium-welcome) ---- */
@@ -2183,6 +2226,10 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
2183
2226
  .md pre{margin:0 0 12px;background:var(--well);border-radius:12px;padding:12px 14px;overflow-x:auto;max-width:100%}
2184
2227
  .md pre code{display:block;background:none;padding:0;font-size:var(--fs-2);line-height:1.6;white-space:pre;overflow-wrap:normal}
2185
2228
  .md a{color:var(--ember-ink);text-decoration:underline;text-underline-offset:2px}
2229
+ .md .fpath{display:inline;padding:0;margin:0;border:0;background:none;font:inherit;color:var(--ember-ink);text-align:left;cursor:pointer;text-decoration:underline;text-underline-offset:2px;text-decoration-color:color-mix(in oklab,var(--ember-ink) 45%,transparent);overflow-wrap:anywhere}
2230
+ .md .fpath code{color:inherit;overflow-wrap:anywhere}
2231
+ .md .fpath:focus-visible{outline:2px solid var(--ember);outline-offset:2px;border-radius:4px}
2232
+ @media (hover:hover){.md .fpath:hover{text-decoration-color:currentColor}}
2186
2233
  .md blockquote{margin:0 0 10px;padding:2px 0 2px 12px;border-left:2px solid var(--hair);color:var(--ink-2)}
2187
2234
  .md hr{border:0;border-top:1px solid var(--hair);margin:14px 0}
2188
2235
  .mdtab{margin:0 0 12px;overflow-x:auto;border:1px solid var(--hair);border-radius:12px}
@@ -12,7 +12,7 @@ import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words
12
12
  import { consoleReads, briefOf, needsListOf } from './premium-brief.js';
13
13
  import { mountDocSheet } from './premium-doc-sheet.js';
14
14
  import { momentOf, inText } from './c3-phone-model.js';
15
- import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail, pvFeed, setPageGaps, sourcesHook, onPageChat, openPageChat } from './premium-shell.js';
15
+ import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, setFull, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail, pvFeed, setPageGaps, sourcesHook, onPageChat, openPageChat } from './premium-shell.js';
16
16
  const ICON = {
17
17
  meeting: '<rect x="4" y="5" width="16" height="15" rx="3"/><path d="M4 10h16M9 3v4M15 3v4"/>',
18
18
  merge: '<circle cx="6" cy="6" r="2"/><circle cx="6" cy="18" r="2"/><circle cx="18" cy="9" r="2"/><path d="M6 8v8M18 11c0 4-6 3-12 5"/>',
@@ -25,7 +25,7 @@ const on = new Set(Object.keys(SRC));
25
25
  const pinned = new Set();
26
26
 
27
27
  wireRail('brief');
28
- const week = mountMeeting({ $, $$, esc, openDlg, toast, pmGet, pmPost, turnA, ptx, kv, H, ws: () => new URLSearchParams(location.search).get('ws'), redraw: () => { if (M) drawTl(); } });
28
+ const week = mountMeeting({ $, $$, esc, openDlg, toast, pmGet, pmPost, turnA, ptx, kv, H, setMode, setFull, ws: () => new URLSearchParams(location.search).get('ws'), redraw: () => { if (M) drawTl(); } });
29
29
  mountCalEntry($('#todayCard'), { $, esc, openDlg, setMode, turnA, ptx, pmGet, ws: () => new URLSearchParams(location.search).get('ws'), openRow: week.openRow }); // the full calendar: Day, Week and Month in the viewer
30
30
  mountNotes({ $, esc, openDlg, toast, pmGet, pmPost, task: week.task });
31
31
 
@@ -31,6 +31,7 @@ if (SET_GIT_OPTIONAL_LOCKS) process.env.GIT_OPTIONAL_LOCKS = '0';
31
31
  const http = require('http');
32
32
  const fs = require('fs');
33
33
  const os = require('os');
34
+ const chatFileLocate = require('./lib/chat-file-locate.js');
34
35
  const path = require('path');
35
36
  const crypto = require('crypto');
36
37
  const { execFile, spawnSync, spawn } = require('child_process');
@@ -7329,6 +7330,15 @@ async function handleRequest(req, res) {
7329
7330
  });
7330
7331
  return json(res, { ok: true, pages });
7331
7332
  }
7333
+ if (p === '/api/doc/locate' && req.method === 'GET') {
7334
+ // A file path Claude wrote in a premium chat panel: which served workspace holds it (lib/chat-file-locate.js). The panel then reads it read-only
7335
+ // through GET /api/doc. A path in no served workspace answers `outside`, and nothing is read.
7336
+ // a relative path is the session's own: it resolves against the folder the chat's session runs in, else the page's workspace
7337
+ const sess = sessions.get(url.searchParams.get('session') || '');
7338
+ const base = (sess && workspaces.get(sess.ws)) || getWs(url.searchParams.get('ws'));
7339
+ const r = chatFileLocate.locate({ path: url.searchParams.get('path') || '', roots: [...workspaces.values()].map((w) => ({ id: w.id, root: w.root })), base: base ? base.id : null, home: os.homedir() });
7340
+ return json(res, r);
7341
+ }
7332
7342
  if (p === '/api/doc') {
7333
7343
  const w = getWs(url.searchParams.get('ws'));
7334
7344
  // `ref` — a file that exists only on an initiative's own branch (status-clarity R5). Read through git, never the
@@ -40,6 +40,7 @@
40
40
  "briefing-premium-agent.test.js",
41
41
  "goal-chat.test.js",
42
42
  "chat-md.test.js",
43
+ "chat-file-locate.test.js",
43
44
  "briefing-premium-work.test.js",
44
45
  "briefing-premium-board.test.js",
45
46
  "briefing-premium-insights.test.js",
@@ -214,6 +215,7 @@
214
215
  "briefing-premium-agent.test.js": 1,
215
216
  "goal-chat.test.js": 1,
216
217
  "chat-md.test.js": 1,
218
+ "chat-file-locate.test.js": 1,
217
219
  "briefing-premium-work.test.js": 1,
218
220
  "briefing-premium-board.test.js": 1,
219
221
  "briefing-premium-insights.test.js": 1,