create-pmos 0.588.0 → 0.590.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 +27 -27
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +26 -0
- package/workspace/guide/home.md +2 -4
- package/workspace/lib/jira-status.js +10 -3
- package/workspace/lib/outbox-store.js +9 -2
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-outbox.js +17 -2
- package/workspace/lib/routes-waiting.js +24 -0
- package/workspace/lib/waiting-on.js +252 -0
- package/workspace/live-pill-round-test.js +2 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/panels-test.js +1 -1
- package/workspace/program-order-test.js +3 -1
- package/workspace/public/pm/cozy-today.css +28 -0
- package/workspace/public/pm/good-morning.js +6 -2
- package/workspace/public/pm/home-app.js +62 -5
- package/workspace/public/pm/home-day.js +4 -1
- package/workspace/public/pm/home-list.js +3 -1
- package/workspace/public/pm/home-today.js +6 -3
- package/workspace/public/pm/home-top.js +102 -0
- package/workspace/public/pm/ini-tasks.js +6 -2
- package/workspace/public/pm/move-rank.js +12 -3
- package/workspace/public/pm/outbox-view.js +54 -1
- package/workspace/sort-order-test.js +3 -1
- package/workspace/stage-card-tasks-test.js +2 -0
- package/workspace/test-lists/home-your-move-waiting.json +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.590.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": {
|
|
@@ -33,6 +33,32 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.590.0",
|
|
38
|
+
"at": "2026-11-17T13:19:36.782Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1326,
|
|
43
|
+
"t": "Take Your move and Waiting on others back out of Home's list",
|
|
44
|
+
"s": "Take Your move and Waiting on others back out of Home's list",
|
|
45
|
+
"k": "imp"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"v": "0.589.0",
|
|
51
|
+
"at": "2026-11-17T11:57:51.177Z",
|
|
52
|
+
"f": 4,
|
|
53
|
+
"prs": [
|
|
54
|
+
{
|
|
55
|
+
"n": 1323,
|
|
56
|
+
"t": "A calmer Home — Your move and Waiting on others above today's list",
|
|
57
|
+
"s": "A calmer Home — Your move and Waiting on others above today's list",
|
|
58
|
+
"k": "new"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
36
62
|
{
|
|
37
63
|
"v": "0.588.0",
|
|
38
64
|
"at": "2026-11-17T10:44:25.596Z",
|
|
@@ -272,32 +298,6 @@
|
|
|
272
298
|
"k": "new"
|
|
273
299
|
}
|
|
274
300
|
]
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"v": "0.570.0",
|
|
278
|
-
"at": "2026-11-15T17:32:20.370Z",
|
|
279
|
-
"f": 4,
|
|
280
|
-
"prs": [
|
|
281
|
-
{
|
|
282
|
-
"n": 1302,
|
|
283
|
-
"t": "The real build engine for Full SDLC (launch simulation W7)",
|
|
284
|
-
"s": "The real build engine for Full SDLC (launch simulation W7)",
|
|
285
|
-
"k": "new"
|
|
286
|
-
}
|
|
287
|
-
]
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
"v": "0.569.0",
|
|
291
|
-
"at": "2026-11-15T17:07:37.237Z",
|
|
292
|
-
"f": 4,
|
|
293
|
-
"prs": [
|
|
294
|
-
{
|
|
295
|
-
"n": 1301,
|
|
296
|
-
"t": "Close the five gaps the launch rerun found (launch simulation W6)",
|
|
297
|
-
"s": "Close the five gaps the launch rerun found (launch simulation W6)",
|
|
298
|
-
"k": "new"
|
|
299
|
-
}
|
|
300
|
-
]
|
|
301
301
|
}
|
|
302
302
|
]
|
|
303
303
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -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-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-17T13:19:33Z"}
|
|
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-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-17T13:19:33Z"}
|
|
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-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-17T13:19:33Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.590.0",
|
|
4
|
+
"at": "2026-11-17T13:19:36.782Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1326,
|
|
9
|
+
"t": "Take Your move and Waiting on others back out of Home's list",
|
|
10
|
+
"s": "Take Your move and Waiting on others back out of Home's list",
|
|
11
|
+
"k": "imp"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"v": "0.589.0",
|
|
17
|
+
"at": "2026-11-17T11:57:51.177Z",
|
|
18
|
+
"f": 4,
|
|
19
|
+
"prs": [
|
|
20
|
+
{
|
|
21
|
+
"n": 1323,
|
|
22
|
+
"t": "A calmer Home — Your move and Waiting on others above today's list",
|
|
23
|
+
"s": "A calmer Home — Your move and Waiting on others above today's list",
|
|
24
|
+
"k": "new"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
2
28
|
{
|
|
3
29
|
"v": "0.588.0",
|
|
4
30
|
"at": "2026-11-17T10:44:25.596Z",
|
package/workspace/guide/home.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Home: your list, the chat, the Viewer, My work, documents and people"
|
|
4
4
|
description: "Home's list, Mentions, Your day, the chat and the Viewer; My work; documents and their copies; People; and the suggested next prompt."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-17
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Home
|
|
@@ -36,7 +36,7 @@ Home, the Board, Insights and the Viewer use one typeface, Plus Jakarta Sans, wi
|
|
|
36
36
|
- Then the list is grouped by **product**. A product header shows a tile with the product's short name, the product name, one dot for each goal (green on track, amber off track) and a chevron. When the product has chats of its own (the product's chat and its new sessions), the header has the same pill as an initiative row: press it to see them, and **+** starts a new session in the product. These chats are not under **Not in an initiative**. A program header has the same pill for the program's own chats, and **+** starts a new session in the program. The chat then shows the program or the product as its scope, not **Loose**. You set the short name in Settings. Press the product's name to open the product in the Viewer, with its goals and this week's update and metrics review. The chat then talks about the product. This is the same for every product in the list: Home stays on the workspace you opened it on. For another product, the weekly update and the metrics review open that product's own Home in a new tab. An initiative of another product opens from that product's own board, and its chat works in that product's workspace. This is also true for a new initiative that an agent made with `pmos initiative new` and that is not on the board's Now list yet: it opens with its title, stage and tasks.
|
|
37
37
|
- Each row is one line. A dot is a session: blue when it waits on you, a ring while it runs. A check box is a task: amber when it is late. The stage track on the right shows where the initiative is. A session that runs under an initiative shows indented under it. An initiative shows its 3 most urgent tasks, and **N more** shows the rest.
|
|
38
38
|
- **Not in an initiative** is one line at the end, with a blue dot, an amber square and a count. Press it to open the items that have no initiative.
|
|
39
|
-
- **Kept** and **Done** are in the filter icon's menu, on a desktop only.
|
|
39
|
+
- **Mine**, **Kept** and **Done** are in the filter icon's menu, on a desktop only. **Mine** shows only what waits on you, under the heading **Waiting on you**.
|
|
40
40
|
- Every group stays open or closed after you reload the page.
|
|
41
41
|
- On a desktop, the chat has a header line with the open item's name and where it sits (its initiative, product or program).
|
|
42
42
|
- The microphone in the chat box turns what you say into text. Nothing is sent until you press send.
|
|
@@ -44,8 +44,6 @@ Home, the Board, Insights and the Viewer use one typeface, Plus Jakarta Sans, wi
|
|
|
44
44
|
|
|
45
45
|
## Your move
|
|
46
46
|
|
|
47
|
-
Your move is the one inbox. Every ask that needs you waits here, in PMOS's order: an outcome check past its date, grill findings, changes from your meetings and programs, a reply you owe in Mentions, a draft in the outbox, a key result with no reading, Lab findings that fit no initiative, and what PMOS proposes on each initiative.
|
|
48
|
-
|
|
49
47
|
- **At most 5 show.** The rest are under **Can wait**, in the same order. Nothing is dropped.
|
|
50
48
|
- **One press per initiative.** An initiative's proposals are one row, for example "Checkout: 6 changes to keep" with "3 dates, 2 names, 1 link" under it. Press it to see them grouped as Dates, Names, Done and Links. ✓ keeps all of them, with one Undo for the batch. ✕ drops them, then offers three reasons and **Say why**. A proposal that needs your own check keeps its own ✓ and ✕. **See every change** opens the full list on the initiative.
|
|
51
49
|
- **An ask expires after 14 days with no answer.** PMOS leaves it as it was and writes why in the initiative's History. Your move says it once: "2 asks expired after 14 days with no answer." Dates computed from your tasks never expire: PMOS reads them again each time.
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
* completed?, goal? } | null, subtasks: { done, total }, fixVersion: [names], points: number | null, resolved: YYYY-MM-DD | null,
|
|
26
26
|
* flagged, reason, url }. The sprint's dates, `points` and `resolved` feed the sprint burndown (lib/stage-tools.js); a
|
|
27
27
|
* reading saved before they were carried has none of them, and the burndown says it cannot be drawn. A ticket the search did not return keeps its last reading, marked
|
|
28
|
-
* stale. Titles and statuses only: never a description
|
|
28
|
+
* stale. Titles and statuses only: never a description or a comment. The one person a reading carries is the assignee's display name, with
|
|
29
|
+
* the time of the last update (`assignee`, `updated`): Waiting on others names who a stale ticket waits on (home-your-move-waiting).
|
|
29
30
|
*
|
|
30
31
|
* BOUNDARY (J15). No network module, no child process. The only write is the snapshot file.
|
|
31
32
|
*/
|
|
@@ -190,6 +191,12 @@ function typeParent(t, p) {
|
|
|
190
191
|
if (KEY_RE.test(pk)) out.parent = pk;
|
|
191
192
|
return out;
|
|
192
193
|
}
|
|
194
|
+
/** The assignee's display name and the last update time, when the read has them (Waiting on others); {} when it has neither. */
|
|
195
|
+
function whoWhen(a, up) {
|
|
196
|
+
const name = clip(oneLine(typeof a === 'string' ? a : a && typeof a === 'object' ? a.displayName || a.name || '' : ''), 80);
|
|
197
|
+
const t = Date.parse(isStr(up) ? up : '');
|
|
198
|
+
return { ...(name ? { assignee: name } : {}), ...(Number.isFinite(t) ? { updated: new Date(t).toISOString() } : {}) };
|
|
199
|
+
}
|
|
193
200
|
function normalizeIssue(x) {
|
|
194
201
|
if (!x || typeof x !== 'object') return null;
|
|
195
202
|
const key = oneLine(x.key).toUpperCase();
|
|
@@ -204,7 +211,7 @@ function normalizeIssue(x) {
|
|
|
204
211
|
return { key, summary, status, category: categoryOf(status, st.statusCategory), sprint: sprintIn(f), subtasks: subtasksOf(f.subtasks), fixVersion: fixVersionsOf(f.fixVersions),
|
|
205
212
|
points: pointsIn(f), resolved: dayOf(f.resolutiondate || f.resolved),
|
|
206
213
|
flagged, reason: flagged ? (flaggedIn(f) ? 'Flagged in Jira' : `Status: ${status}`) : null, url: urlOf(x, key),
|
|
207
|
-
...typeParent(f.issuetype, f.parent) };
|
|
214
|
+
...typeParent(f.issuetype, f.parent), ...whoWhen(f.assignee, f.updated) };
|
|
208
215
|
}
|
|
209
216
|
// The flat shape: what the skill tells the agent to write when it is unsure of the connector's shape.
|
|
210
217
|
const summary = clip(oneLine(x.summary || x.title), 250);
|
|
@@ -214,7 +221,7 @@ function normalizeIssue(x) {
|
|
|
214
221
|
return { key, summary, status, category: categoryOf(status, x.category), sprint: sprintOf(x.sprint), subtasks: subtasksOf(x.subtasks), fixVersion: fixVersionsOf(x.fixVersions != null ? x.fixVersions : x.fixVersion),
|
|
215
222
|
points: pointsIn(x), resolved: dayOf(x.resolved || x.resolutiondate),
|
|
216
223
|
flagged, reason: flagged ? clip(oneLine(x.reason || x.flag_reason || (x.flagged === true ? 'Flagged in Jira' : `Status: ${status}`)), 160) : null,
|
|
217
|
-
url: urlOf(x, key), ...typeParent(x.type != null ? x.type : x.issuetype, x.parent) };
|
|
224
|
+
url: urlOf(x, key), ...typeParent(x.type != null ? x.type : x.issuetype, x.parent), ...whoWhen(x.assignee, x.updated) };
|
|
218
225
|
}
|
|
219
226
|
function normalize(raw) {
|
|
220
227
|
const list = issuesList(raw);
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* <runtime>/outbox/sent.jsonl the trust ledger of sends (one 'send' line per send, with the override flag)
|
|
7
7
|
* <runtime>/outbox/promises.jsonl the promise ledger, through scripts/promises.js (scripts/trust/ledger.js)
|
|
8
8
|
*
|
|
9
|
+
* A 'snoozed' line (Not now on a nudge in the Viewer, home-your-move-waiting) sets snoozed_until; the entry stays queued.
|
|
10
|
+
* An entry may carry `about`: the Waiting on others row a nudge is for (lib/waiting-on.js).
|
|
11
|
+
*
|
|
9
12
|
* foldOutbox(lines) is pure: the latest version per id. A queued or edited line carries the state scripts/outbox.js
|
|
10
13
|
* computed from the trust claim rules: 'queued' or 'blocked'. A 'pressed' line (a PM press with no channel connected)
|
|
11
14
|
* leaves the state and records last_result. A 'pressed' or 'sent' line counts only for the hash it names, so an edit
|
|
@@ -45,11 +48,15 @@ function foldOutbox(lines = []) {
|
|
|
45
48
|
if (ev.event === 'restored') { gone.delete(ev.id); continue; }
|
|
46
49
|
if (ev.event === 'queued' || ev.event === 'edited') {
|
|
47
50
|
const { event, ...entry } = ev;
|
|
48
|
-
|
|
51
|
+
const was = byId.get(ev.id) || {};
|
|
52
|
+
byId.set(ev.id, { ...entry, ...(was.about && !entry.about ? { about: was.about } : {}), state: ev.state === 'blocked' ? 'blocked' : 'queued', last_result: null, refused: null, created_at: was.created_at || ev.at });
|
|
53
|
+
} else if (ev.event === 'snoozed') {
|
|
54
|
+
const cur = byId.get(ev.id);
|
|
55
|
+
if (cur) byId.set(ev.id, { ...cur, snoozed_until: ev.until || null });
|
|
49
56
|
} else if (ev.event === 'pressed' || ev.event === 'sent') {
|
|
50
57
|
const cur = byId.get(ev.id);
|
|
51
58
|
if (!cur || cur.hash !== ev.hash) continue;
|
|
52
|
-
if (ev.event === 'sent') byId.set(ev.id, { ...cur, state: 'sent', last_result: 'sent' });
|
|
59
|
+
if (ev.event === 'sent') byId.set(ev.id, { ...cur, state: 'sent', last_result: 'sent', sent_at: ev.at || null });
|
|
53
60
|
else byId.set(ev.id, { ...cur, last_result: ev.reason || null });
|
|
54
61
|
}
|
|
55
62
|
}
|
|
@@ -48,6 +48,7 @@ const MODULES = Object.freeze([
|
|
|
48
48
|
'routes-runs', // console3 agent surfaces: runs grouped for the sessions panel, PM answers, corrections
|
|
49
49
|
'routes-doc-health', // console3 B2: the six document health checks, recomputed from text
|
|
50
50
|
'routes-outbox', // console3 B3: the outbox queue, hash-bound confirm (no channel connected)
|
|
51
|
+
'routes-waiting', // home-your-move-waiting: Waiting on others, derived from records, with its exit rule
|
|
51
52
|
'routes-calendar-views', // console3 C2: Day/Week/Month/Quarter/Year cells, Gantt and the strategy lens (read-only)
|
|
52
53
|
'routes-briefing', // console3 C1: the day-part Briefing cards from the signal engine (read-only)
|
|
53
54
|
'routes-briefing-premium', // briefing-premium: the premium Briefing's page model from repository state (read-only)
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* POST /api/outbox/draft { channel, recipient, subject?, body } → { ok, entry } origin is 'pm' (a page press)
|
|
7
7
|
* POST /api/outbox/edit { id, body } → { ok, entry } a new hash; the old hash is void
|
|
8
8
|
* POST /api/outbox/discard { id, undo? } → { ok } hides a draft (undo: true brings it back); a sent entry is refused
|
|
9
|
+
* POST /api/outbox/snooze { id, until? } → { ok, until } Not now on a nudge (home-your-move-waiting): recorded, the
|
|
10
|
+
* entry stays queued; until defaults to 09:00 the next morning
|
|
9
11
|
* POST /api/outbox/confirm { id, hash, reason? } → { ok:false, reason:'no channel connected' } entry stays queued
|
|
10
12
|
* → 422 { ok:false, state:'blocked', refused } when a claim fails the trust rules
|
|
11
13
|
* and no written reason is given; with a reason it is an override (recorded)
|
|
@@ -77,6 +79,19 @@ function discard(req, body, runtimeDir, now = new Date()) {
|
|
|
77
79
|
return { status: 200, body: { ok: true, id, discarded: true } };
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
/* Not now on a drafted nudge: one 'snoozed' line, so the PM's choice is on record and the Home row hides its nudge line until then. */
|
|
83
|
+
function snooze(req, body, runtimeDir, now = new Date()) {
|
|
84
|
+
const bad = guarded(req, body); if (bad) return bad;
|
|
85
|
+
const cur = store.readOutbox(runtimeDir).find((e) => e.id === String(body.id || ''));
|
|
86
|
+
if (!cur) return fail(404, 'no such outbox entry');
|
|
87
|
+
if (cur.state === 'sent') return fail(409, 'a sent entry is a record and is not snoozed');
|
|
88
|
+
let until = Date.parse(body.until || '');
|
|
89
|
+
if (!Number.isFinite(until) || until <= now.getTime()) { const d = new Date(now); d.setDate(d.getDate() + 1); d.setHours(9, 0, 0, 0); until = d.getTime(); }
|
|
90
|
+
const iso = new Date(until).toISOString();
|
|
91
|
+
store.appendEvent(runtimeDir, { event: 'snoozed', id: cur.id, until: iso }, now);
|
|
92
|
+
return { status: 200, body: { ok: true, id: cur.id, until: iso } };
|
|
93
|
+
}
|
|
94
|
+
|
|
80
95
|
function confirm(req, body, runtimeDir, now = new Date(), senders) {
|
|
81
96
|
const bad = guarded(req, body); if (bad) return bad;
|
|
82
97
|
const cur = store.readOutbox(runtimeDir).find((e) => e.id === body.id);
|
|
@@ -98,11 +113,11 @@ function confirm(req, body, runtimeDir, now = new Date(), senders) {
|
|
|
98
113
|
return { status: 200, body: { ok: true, hash: r.hash, override: r.override, state: 'sent' } };
|
|
99
114
|
}
|
|
100
115
|
|
|
101
|
-
const ROUTES = { 'POST /api/outbox/draft': draft, 'POST /api/outbox/edit': edit, 'POST /api/outbox/discard': discard, 'POST /api/outbox/confirm': confirm };
|
|
116
|
+
const ROUTES = { 'POST /api/outbox/draft': draft, 'POST /api/outbox/edit': edit, 'POST /api/outbox/discard': discard, 'POST /api/outbox/snooze': snooze, 'POST /api/outbox/confirm': confirm };
|
|
102
117
|
|
|
103
118
|
module.exports = {
|
|
104
119
|
prefixes: ['/api/outbox'],
|
|
105
|
-
claimCheck, list, draft, edit, discard, confirm, ROUTES,
|
|
120
|
+
claimCheck, list, draft, edit, discard, snooze, confirm, ROUTES,
|
|
106
121
|
handle: async (req, res, url, ctx) => {
|
|
107
122
|
const p = url.pathname;
|
|
108
123
|
if (p === '/api/outbox' && req.method === 'GET') { const r = list(ctx.runtimeDir); ctx.json(res, r.body, r.status); return true; }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* routes-waiting.js — Waiting on others for Home (initiative home-your-move-waiting; lib/waiting-on.js).
|
|
3
|
+
*
|
|
4
|
+
* GET /api/waiting → { ok, rows: [{ key, source, title, who, since, days, age, where, ws, ini, link?, nudge }], gaps, closed, as_of }
|
|
5
|
+
*
|
|
6
|
+
* The read writes two things, both PMOS's own: the state file the exit rule compares with, and a drafted nudge for a row that waited
|
|
7
|
+
* long enough (lib/waiting-on.js NUDGE_DAYS). A nudge is an outbox draft: it leaves only when the PM sends it from the Viewer. */
|
|
8
|
+
const W = require('./waiting-on.js');
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
prefixes: ['/api/waiting'],
|
|
12
|
+
handle: async (req, res, url, ctx) => {
|
|
13
|
+
if (url.pathname !== '/api/waiting') return false;
|
|
14
|
+
if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
|
|
15
|
+
if (!ctx.runtimeDir) { ctx.json(res, { ok: false, error: 'no runtime folder' }, 500); return true; }
|
|
16
|
+
let me = [];
|
|
17
|
+
try { const M = require('./routes-mentions.js'); const ws = typeof ctx.workspaceList === 'function' ? ctx.workspaceList() : []; me = M.myNames(ctx.runtimeDir, (ws[0] && ws[0].root) || process.cwd()); } catch { me = []; }
|
|
18
|
+
try {
|
|
19
|
+
const r = W.view(ctx.runtimeDir, { now: Date.now(), me, workspaces: typeof ctx.workspaceList === 'function' ? ctx.workspaceList() : [] });
|
|
20
|
+
ctx.json(res, r);
|
|
21
|
+
} catch (e) { ctx.json(res, { ok: false, error: String((e && e.message) || e) }, 500); }
|
|
22
|
+
return true;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* waiting-on.js — Waiting on others: what the PM waits on a named person for, derived from records (initiative home-your-move-waiting,
|
|
3
|
+
* batch 30; design A′, board HmA2 on the main canvas). Nobody types a row: it is rebuilt from what PMOS already holds.
|
|
4
|
+
*
|
|
5
|
+
* derive(src, o) → { rows, gaps, ended } pure. src: { notes, jira, sent, mentions }; o: { me, now }
|
|
6
|
+
* track(state, d, now) → { state, closed } pure. The exit rule: a row that leaves gets one line that says why
|
|
7
|
+
* nudgeOf(row, entries) → the outbox entry PMOS drafted for the row, or null pure
|
|
8
|
+
* nudgesToDraft(rows, lines, now) → [entry] pure. The nudges to put in the outbox (drafted, never sent)
|
|
9
|
+
* view(rt, o) → { ok, rows, gaps, closed } the files: reads the records, writes <rt>/waiting/state.json and the drafts
|
|
10
|
+
* channelWord(channel) → 'Jira comment' · 'team note' · …
|
|
11
|
+
*
|
|
12
|
+
* THE SOURCES (the brief, item 2). A row exists only with a real who: a name or a Jira assignee.
|
|
13
|
+
* note a meeting note's action item whose owner is not the PM (the final notes' actions when they exist, else the local summary's).
|
|
14
|
+
* Only notes of the last WINDOW_DAYS. An agreed action with NO owner is not waiting on anyone: it is a gap, the PM's call
|
|
15
|
+
* ("… needs an owner"), and Your move shows it (pm/move-rank.js kind 'owner').
|
|
16
|
+
* jira a ticket assigned to someone else, not done, with no update for STALE_DAYS or more, on an initiative in Build
|
|
17
|
+
* (lib/jira-status.js readings, which carry the assignee's display name and the update time).
|
|
18
|
+
* message a message the PM sent from the outbox with no reply seen. A sent nudge is not a row of its own: its row says "Nudged".
|
|
19
|
+
*
|
|
20
|
+
* THE EXIT RULE. A reply seen closes a row: a mention from the row's person after the row's since (lib/mention-store.js entries), a Jira
|
|
21
|
+
* update after it, a ticket done, an action that became the PM's. The row leaves and the done line says so ("Faye replied on MSD-4388").
|
|
22
|
+
* A row never leaves in silence: when PMOS cannot say why, the line says it no longer sees the row in its source. Closed lines are kept
|
|
23
|
+
* CLOSED_DAYS.
|
|
24
|
+
*
|
|
25
|
+
* NUDGES. A row waiting NUDGE_DAYS or more gets one nudge drafted into the outbox (lib/outbox-store.js), origin 'agent', with `about` (the
|
|
26
|
+
* row's key) and its channel named. It is drafted once per row: a discarded nudge is not drafted again. It leaves PMOS only when the PM
|
|
27
|
+
* sends it from the Viewer (D106 class C, D107); with no sender registered nothing can leave.
|
|
28
|
+
*/
|
|
29
|
+
const fs = require('fs');
|
|
30
|
+
const path = require('path');
|
|
31
|
+
const crypto = require('crypto');
|
|
32
|
+
|
|
33
|
+
const DAY = 864e5;
|
|
34
|
+
const WINDOW_DAYS = 30; // a meeting note's actions are followed this long
|
|
35
|
+
const STALE_DAYS = 5; // a Jira ticket with no update this long waits on its assignee
|
|
36
|
+
const NUDGE_DAYS = 3; // a row this old gets a drafted nudge
|
|
37
|
+
const CLOSED_DAYS = 7; // a closed line is said this long
|
|
38
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
39
|
+
const NOBODY = /^(?:null|none|n\/a|tbd|tbc|nobody|no one|someone|somebody|anyone|everyone|everybody|all|team|the team|we|us|unassigned|unknown|\?+|-+)$/i;
|
|
40
|
+
const BUILD = /\b(build|execute|pull requests?|ci|merge|in development)\b/i;
|
|
41
|
+
const CHANNEL_WORD = { 'jira-write': 'Jira comment', 'team-note': 'team note', 'customer-note': 'customer note', 'calendar-hold': 'calendar hold' };
|
|
42
|
+
|
|
43
|
+
const str = (v) => (typeof v === 'string' ? v.replace(/\s+/g, ' ').trim() : '');
|
|
44
|
+
const T = (v) => { const t = typeof v === 'number' ? v : Date.parse(v || ''); return Number.isFinite(t) ? t : 0; };
|
|
45
|
+
const hash = (s) => crypto.createHash('sha1').update(String(s)).digest('hex').slice(0, 10);
|
|
46
|
+
const first = (who) => str(who).split(/\s+/)[0].toLowerCase();
|
|
47
|
+
const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
|
|
48
|
+
const dm = (t, now) => { const d = new Date(t); return d.getDate() + ' ' + MON[d.getMonth()] + (d.getFullYear() !== new Date(now).getFullYear() ? ' ' + d.getFullYear() : ''); };
|
|
49
|
+
const ageWord = (d) => (d == null ? '' : d === 0 ? 'today' : plural(d, 'day', 'days'));
|
|
50
|
+
const channelWord = (c) => CHANNEL_WORD[c] || 'message';
|
|
51
|
+
|
|
52
|
+
/** A real who: a person's name or a Jira assignee. Empty, "team", "TBD", "we" and the like are nobody. */
|
|
53
|
+
function realWho(who) {
|
|
54
|
+
const w = str(who);
|
|
55
|
+
return !!w && w.length <= 80 && !NOBODY.test(w) && /\p{L}/u.test(w);
|
|
56
|
+
}
|
|
57
|
+
/** True when the name is the PM's: the whole name or its first word (lower case names from the Settings and git, as Mentions reads them). */
|
|
58
|
+
function isMe(who, me) {
|
|
59
|
+
const w = str(who).toLowerCase(); if (!w) return false;
|
|
60
|
+
if (w === 'me' || w === 'you' || w === 'pm') return true;
|
|
61
|
+
return (me || []).some((n) => n && (w === n || first(w) === n || w.split(/\s+and\s+/).every((p) => p.trim() === n)));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* ── the sources ── */
|
|
65
|
+
function fromNotes(notes, me, now) {
|
|
66
|
+
const rows = [], gaps = [], ended = new Map();
|
|
67
|
+
for (const n of notes || []) {
|
|
68
|
+
if (!n || !n.id || n.private) continue;
|
|
69
|
+
const at = T(n.at);
|
|
70
|
+
if (!at || now - at > WINDOW_DAYS * DAY) continue;
|
|
71
|
+
for (const a of n.actions || []) {
|
|
72
|
+
const text = str(a && a.text); if (!text) continue;
|
|
73
|
+
const key = 'nt:' + n.id + ':' + hash(text.toLowerCase());
|
|
74
|
+
const base = { key, title: text, since: new Date(at).toISOString(), where: str(n.title) || 'a meeting note', ws: n.ws || '', ini: n.ini || '', note: n.id };
|
|
75
|
+
const owner = str(a.owner);
|
|
76
|
+
if (!owner) { if (a.confirmed !== false) gaps.push({ ...base, key: 'gap:' + key.slice(3) }); continue; }
|
|
77
|
+
if (isMe(owner, me)) { ended.set(key, base.title + ' is yours now'); continue; }
|
|
78
|
+
if (!realWho(owner)) continue;
|
|
79
|
+
rows.push({ ...base, source: 'note', who: owner });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return { rows, gaps, ended };
|
|
83
|
+
}
|
|
84
|
+
function fromJira(readings, me, now) {
|
|
85
|
+
const rows = [], ended = new Map();
|
|
86
|
+
for (const r of readings || []) {
|
|
87
|
+
if (!r || !r.key) continue;
|
|
88
|
+
const key = 'jr:' + r.key, who = str(r.assignee), up = T(r.updated);
|
|
89
|
+
if (r.category === 'done') { ended.set(key, r.key + ' is done'); continue; }
|
|
90
|
+
if (!realWho(who) || isMe(who, me)) { if (isMe(who, me)) ended.set(key, r.key + ' is assigned to you now'); continue; }
|
|
91
|
+
if (!BUILD.test(str(r.stage))) continue;
|
|
92
|
+
if (!up) continue; // no update time read: PMOS cannot say how long it waits, so it says nothing
|
|
93
|
+
if (now - up < STALE_DAYS * DAY) { ended.set(key, first(who).replace(/^./, (c) => c.toUpperCase()) + ' updated ' + r.key); continue; }
|
|
94
|
+
rows.push({ key, source: 'jira', who, title: (str(r.summary) || r.key) + ': Jira ' + r.key, since: new Date(up).toISOString(), where: r.key, ws: r.ws || '', ini: r.initiative || '', link: r.url || '', ticket: r.key });
|
|
95
|
+
}
|
|
96
|
+
return { rows, ended };
|
|
97
|
+
}
|
|
98
|
+
function fromSent(sent) {
|
|
99
|
+
const rows = [];
|
|
100
|
+
for (const e of sent || []) {
|
|
101
|
+
if (!e || !e.id || e.state !== 'sent' || e.about) continue; // a sent nudge is said on its own row ("Nudged"), not as a new one
|
|
102
|
+
const who = str(e.recipient); if (!realWho(who)) continue;
|
|
103
|
+
rows.push({ key: 'ms:' + e.id, source: 'message', who, title: str(e.subject) || str(e.body).split('\n')[0].slice(0, 100) || 'Your message', since: e.sent_at || e.at || e.created_at || '', where: channelWord(e.channel), outbox: e.id });
|
|
104
|
+
}
|
|
105
|
+
return rows;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** A reply seen from the row's person after its since: a mention by the same first name; on a Jira row, a mention on that ticket. */
|
|
109
|
+
function replyOf(row, mentions) {
|
|
110
|
+
const who = first(row.who), since = T(row.since);
|
|
111
|
+
for (const m of mentions || []) {
|
|
112
|
+
if (!m || T(m.at) <= since) continue;
|
|
113
|
+
const by = first(m.who);
|
|
114
|
+
const onTicket = row.ticket && String(m.link || '').toUpperCase().includes(row.ticket.toUpperCase());
|
|
115
|
+
if (by && by === who && (!row.ticket || onTicket || m.source !== 'jira')) return m;
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const Cap = (s) => String(s || '').replace(/^./, (c) => c.toUpperCase());
|
|
120
|
+
|
|
121
|
+
/** The derived list. src: { notes: [{ id, ws, ini, title, at, private, actions: [{ text, owner, confirmed }] }], jira: [{ key, summary,
|
|
122
|
+
* assignee, updated, category, stage, initiative, ws, url }], sent: outbox entries, mentions: [{ who, at, source, link }] }. Pure. */
|
|
123
|
+
function derive(src = {}, o = {}) {
|
|
124
|
+
const now = o.now || Date.now(), me = (o.me || []).map((x) => String(x).toLowerCase());
|
|
125
|
+
const N = fromNotes(src.notes, me, now), J = fromJira(src.jira, me, now);
|
|
126
|
+
const ended = new Map([...N.ended, ...J.ended]);
|
|
127
|
+
const rows = [];
|
|
128
|
+
for (const r of [...N.rows, ...J.rows, ...fromSent(src.sent)]) {
|
|
129
|
+
const m = replyOf(r, src.mentions);
|
|
130
|
+
if (m) { ended.set(r.key, Cap(first(r.who)) + ' replied' + (r.ticket ? ' on ' + r.ticket : r.source === 'note' ? ' about ' + r.title : '')); continue; }
|
|
131
|
+
const d = Math.max(0, Math.floor((now - T(r.since)) / DAY));
|
|
132
|
+
rows.push({ ...r, days: d, age: ageWord(d) });
|
|
133
|
+
}
|
|
134
|
+
rows.sort((a, b) => b.days - a.days || a.key.localeCompare(b.key));
|
|
135
|
+
return { rows, gaps: N.gaps, ended };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** The exit rule. state: { open: { key: { title, who, source } }, closed: [{ key, title, who, why, at }] }. A key that was open and is not a
|
|
139
|
+
* row now is closed with the reason derive found, else the plain one; it is said CLOSED_DAYS. Pure. */
|
|
140
|
+
function track(state, d, now = Date.now()) {
|
|
141
|
+
const prev = (state && state.open) || {}, keep = ((state && state.closed) || []).filter((c) => c && now - T(c.at) < CLOSED_DAYS * DAY);
|
|
142
|
+
const open = {}, closed = [];
|
|
143
|
+
for (const r of d.rows) open[r.key] = { title: r.title, who: r.who, source: r.source };
|
|
144
|
+
for (const [key, p] of Object.entries(prev)) {
|
|
145
|
+
if (open[key]) continue;
|
|
146
|
+
const why = (d.ended && d.ended.get(key)) || (p.source === 'note' ? p.title + ': PMOS no longer sees it in the meeting note' : p.source === 'jira' ? p.title + ': PMOS no longer sees it in the Jira read' : p.title + ': PMOS no longer sees it waiting');
|
|
147
|
+
closed.push({ key, title: p.title, who: p.who, why, at: new Date(now).toISOString() });
|
|
148
|
+
}
|
|
149
|
+
const all = closed.concat(keep.filter((c) => !open[c.key] && !closed.some((x) => x.key === c.key)));
|
|
150
|
+
return { state: { v: 1, open, closed: all }, closed: all };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** The nudge PMOS drafted for a row (outbox entries with about === row.key), not yet sent; null when none. Pure. */
|
|
154
|
+
function nudgeOf(row, entries, now = Date.now()) {
|
|
155
|
+
const e = (entries || []).filter((x) => x && x.about === row.key).sort((a, b) => T(b.created_at) - T(a.created_at))[0];
|
|
156
|
+
if (!e) return null;
|
|
157
|
+
return { id: e.id, channel: e.channel, word: channelWord(e.channel), state: e.state, sent: e.state === 'sent', snoozed: T(e.snoozed_until) > now, until: e.snoozed_until || null };
|
|
158
|
+
}
|
|
159
|
+
/** The words of a nudge: short, kind, no claim PMOS cannot back. */
|
|
160
|
+
function nudgeBody(r, now) {
|
|
161
|
+
const hi = 'Hi ' + Cap(first(r.who)) + ', ';
|
|
162
|
+
if (r.source === 'jira') return hi + 'a quick check on ' + r.ticket + ': how is it going? I have not seen an update since ' + dm(T(r.since), now) + '. Thank you!';
|
|
163
|
+
if (r.source === 'note') return hi + 'from ' + r.where + ' on ' + dm(T(r.since), now) + ': ' + r.title.replace(/[.!]?$/, '.') + ' How is it going? Thank you!';
|
|
164
|
+
return hi + 'a gentle follow-up on my message from ' + dm(T(r.since), now) + ' (' + r.title + '). Thank you!';
|
|
165
|
+
}
|
|
166
|
+
/** The nudges to draft: a row waiting NUDGE_DAYS or more with no outbox line about it ever (a discarded one counts: drafted once). Pure.
|
|
167
|
+
* lines: the raw outbox log. → [{ channel, recipient, subject, body, about }] */
|
|
168
|
+
function nudgesToDraft(rows, lines, now = Date.now()) {
|
|
169
|
+
const had = new Set((lines || []).filter((l) => l && l.about).map((l) => l.about));
|
|
170
|
+
return (rows || []).filter((r) => r.days >= NUDGE_DAYS && !had.has(r.key)).map((r) => ({
|
|
171
|
+
channel: r.source === 'jira' ? 'jira-write' : 'team-note', recipient: r.source === 'jira' ? r.ticket : r.who,
|
|
172
|
+
subject: 'Nudge: ' + r.title.slice(0, 80), body: nudgeBody(r, now), about: r.key,
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* ── the files ── */
|
|
177
|
+
function readJson(f) { try { return JSON.parse(fs.readFileSync(f, 'utf8')); } catch { return null; } }
|
|
178
|
+
const stateFile = (rt) => path.join(rt, 'waiting', 'state.json');
|
|
179
|
+
|
|
180
|
+
/** The notes as derive reads them: the final notes' actions (the agent's, the PM can correct the owner), else the local summary's. */
|
|
181
|
+
function notesOf(rt, now) {
|
|
182
|
+
let files = []; try { files = fs.readdirSync(path.join(rt, 'notes')).filter((f) => f.endsWith('.json')); } catch { return []; }
|
|
183
|
+
let N = null; try { N = require('./notes.js'); } catch { N = null; }
|
|
184
|
+
const out = [];
|
|
185
|
+
for (const f of files) {
|
|
186
|
+
const n = readJson(path.join(rt, 'notes', f));
|
|
187
|
+
if (!n || !n.id || n.private) continue;
|
|
188
|
+
const at = n.recorded_from || (n.meeting && n.meeting.start) || n.created_at;
|
|
189
|
+
if (!T(at) || now - T(at) > WINDOW_DAYS * DAY) continue;
|
|
190
|
+
let actions = n.final_notes && Array.isArray(n.final_notes.actions) ? n.final_notes.actions : null;
|
|
191
|
+
if (!actions && N) { try { actions = (N.summarize(n).sections || {}).actions || []; } catch { actions = []; } }
|
|
192
|
+
const ini = n.initiative && typeof n.initiative === 'object' ? n.initiative.id : typeof n.initiative === 'string' ? n.initiative : '';
|
|
193
|
+
out.push({ id: n.id, ws: n.ws || '', ini: ini || '', title: n.title || (n.meeting && n.meeting.title) || '', at, private: !!n.private, actions: actions || [] });
|
|
194
|
+
}
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
/** The Jira readings of every workspace's linked initiatives, each with its initiative's one stage (lib/stage-read.js). */
|
|
198
|
+
function jiraOf(workspaces) {
|
|
199
|
+
const out = [];
|
|
200
|
+
let JS = null; try { JS = require('./jira-status.js'); } catch { return out; }
|
|
201
|
+
for (const w of workspaces || []) {
|
|
202
|
+
if (!w || !w.root) continue;
|
|
203
|
+
let linked = []; try { linked = JS.linkedInitiatives(w.root); } catch { linked = []; }
|
|
204
|
+
if (!linked.length) continue;
|
|
205
|
+
let label = () => ''; try { label = require('./stage-read.js').labelReader(w.root); } catch { /* no stage: no Jira row */ }
|
|
206
|
+
for (const q of linked) {
|
|
207
|
+
const s = JS.readSnapshot(w.root, q.initiative); if (!s) continue;
|
|
208
|
+
let stage = ''; try { stage = label(q.initiative) || ''; } catch { stage = ''; }
|
|
209
|
+
for (const r of s.tickets.values()) if (!r.stale) out.push({ ...r, initiative: q.initiative, ws: w.id, stage });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return out;
|
|
213
|
+
}
|
|
214
|
+
function mentionsOf(rt) {
|
|
215
|
+
const j = readJson(path.join(rt, 'mentions', 'store.json'));
|
|
216
|
+
const items = j && j.items && typeof j.items === 'object' ? Object.values(j.items) : [];
|
|
217
|
+
const out = [];
|
|
218
|
+
for (const e of items) {
|
|
219
|
+
if (!e) continue;
|
|
220
|
+
out.push({ who: e.who, at: e.at, source: e.source, link: e.link || '' });
|
|
221
|
+
for (const m of e.thread || []) out.push({ who: m.who, at: m.at, source: e.source, link: e.link || '' });
|
|
222
|
+
}
|
|
223
|
+
return out;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** GET /api/waiting: the rows, the gaps (Your move's "needs an owner"), the closed lines. Writes the state file and the drafted nudges.
|
|
227
|
+
* o: { now, me, workspaces } */
|
|
228
|
+
function view(rt, o = {}) {
|
|
229
|
+
const now = o.now || Date.now();
|
|
230
|
+
const store = require('./outbox-store.js');
|
|
231
|
+
const outbox = require('./repo-script.js');
|
|
232
|
+
const entries = store.readOutbox(rt);
|
|
233
|
+
const d = derive({ notes: notesOf(rt, now), jira: jiraOf(o.workspaces), sent: entries, mentions: mentionsOf(rt) }, { me: o.me, now });
|
|
234
|
+
// the nudges: drafted once per row, never sent here
|
|
235
|
+
const lines = store.readLines(store.outboxFile(rt));
|
|
236
|
+
const O = require(outbox.repoScript('outbox.js'));
|
|
237
|
+
let drafted = 0;
|
|
238
|
+
for (const n of nudgesToDraft(d.rows, lines, now)) {
|
|
239
|
+
try {
|
|
240
|
+
const e = O.draftOutbox({ channel: n.channel, recipient: n.recipient, subject: n.subject, body: n.body, origin: 'agent' });
|
|
241
|
+
store.appendEvent(rt, { event: 'queued', id: 'out-' + crypto.randomBytes(6).toString('hex'), ...e, about: n.about }, new Date(now));
|
|
242
|
+
drafted++;
|
|
243
|
+
} catch { /* a nudge that cannot be drafted leaves the row as it is */ }
|
|
244
|
+
}
|
|
245
|
+
const all = drafted ? store.readOutbox(rt) : entries;
|
|
246
|
+
const rows = d.rows.map((r) => ({ ...r, nudge: nudgeOf(r, all, now) }));
|
|
247
|
+
const t = track(readJson(stateFile(rt)), d, now);
|
|
248
|
+
try { fs.mkdirSync(path.dirname(stateFile(rt)), { recursive: true }); fs.writeFileSync(stateFile(rt), JSON.stringify(t.state) + '\n'); } catch { /* said next time */ }
|
|
249
|
+
return { ok: true, rows, gaps: d.gaps, closed: t.closed, as_of: new Date(now).toISOString() };
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
module.exports = { WINDOW_DAYS, STALE_DAYS, NUDGE_DAYS, CLOSED_DAYS, realWho, isMe, derive, track, nudgeOf, nudgesToDraft, nudgeBody, channelWord, view, stateFile };
|
|
@@ -77,9 +77,9 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
|
|
|
77
77
|
ok('L2 its name still says what it holds and its key', l2 && /^What you work on now: 2 running\. Open \(Ctrl J\)$/.test(l2.label), l2 && l2.label);
|
|
78
78
|
await shot(page, 'pill-running');
|
|
79
79
|
|
|
80
|
-
/* L3 */
|
|
80
|
+
/* L3 (the pill's background eases over 0.2 s, so wait for it to settle before reading it) */
|
|
81
81
|
live = ASKS(); await kick();
|
|
82
|
-
const l3 = await until(() => page.evaluate(() => { const l = document.getElementById('czLive'); return l && l.classList.contains('asks') ? { text: l.textContent.trim(), bg: getComputedStyle(l).backgroundColor, card: getComputedStyle(document.body).getPropertyValue('--cz-card') } : null; }));
|
|
82
|
+
const l3 = await until(() => page.evaluate(() => { const l = document.getElementById('czLive'); return l && l.classList.contains('asks') && !/255, 255, 255/.test(getComputedStyle(l).backgroundColor) ? { text: l.textContent.trim(), bg: getComputedStyle(l).backgroundColor, card: getComputedStyle(document.body).getPropertyValue('--cz-card') } : null; }));
|
|
83
83
|
ok('L3 PMOS asks: the pill turns blue, with the count', l3 && l3.text === '3' && !/255, 255, 255/.test(l3.bg), JSON.stringify(l3));
|
|
84
84
|
await shot(page, 'pill-asks');
|
|
85
85
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.590.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.590.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
package/workspace/panels-test.js
CHANGED
|
@@ -93,7 +93,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
93
93
|
const rows = (page) => page.evaluate(() => [...document.querySelectorAll('#hmList .hv-r.ini .hm-rm[data-hm-sel]')].map((b) => b.dataset.hmSel));
|
|
94
94
|
/** drag from the centre of a selector's element to (x, y) in steps, as a mouse does */
|
|
95
95
|
const drag = async (page, from, x, y, { hold } = {}) => {
|
|
96
|
-
const r = typeof from === 'string' ? await page.evaluate((s) => { const
|
|
96
|
+
const r = typeof from === 'string' ? await page.evaluate((s) => { const e = document.querySelector(s); e.scrollIntoView({ block: 'nearest' }); const b = e.getBoundingClientRect(); return { x: b.left + b.width / 2, y: b.top + b.height / 2 }; }, from) : from;
|
|
97
97
|
await page.mouse.move(r.x, r.y); await page.mouse.down();
|
|
98
98
|
for (let i = 1; i <= 12; i++) { await page.mouse.move(r.x + (x - r.x) * i / 12, r.y + (y - r.y) * i / 12); await sleep(16); }
|
|
99
99
|
if (hold) await hold();
|