create-pmos 0.277.0 → 0.278.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 +1 -1
- 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/briefing-premium-work-test.js +5 -3
- package/workspace/fixtures/my-work-premium-facts.js +4 -4
- package/workspace/guide/briefing-premium.md +9 -2
- package/workspace/lib/my-work-premium.js +38 -8
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-work-depth-test.js +375 -0
- package/workspace/public/pm/premium-work.js +386 -37
- package/workspace/public/pm/premium.css +45 -0
- package/workspace/test-lists/premium-work-depth.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.278.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": {
|
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-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-18T18:12:46Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-18T18:12:46Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-18T18:12:46Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -98,7 +98,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
98
98
|
/* M5 */
|
|
99
99
|
const ag = await p.evaluate(() => ({ tiles: [...document.querySelectorAll('#pipe .pst')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), hot: document.querySelectorAll('#pipe .pst.hot').length, rows: [...document.querySelectorAll('#agl .ws')].map((x) => x.textContent), cap: document.querySelector('#agCap').textContent, hold: document.querySelector('#agHold').textContent, buttons: [...document.querySelectorAll('button')].map((b) => b.textContent).join('|') }));
|
|
100
100
|
ok('M5 three counts from the agent field and the rows that are running or ready', ag.tiles.join() === '1Running,1Failed,1To review' && ag.hot === 1 && ag.rows.length === 3 && /draft ready to review/.test(ag.rows[0]) && /the run failed/.test(ag.rows.join()) && ag.cap === 'one to review', JSON.stringify(ag));
|
|
101
|
-
ok('M5
|
|
101
|
+
ok('M5 the With agents card offers no press of its own, and says nothing is posted before a confirm', !/\b(Give to agent|Approve|Revise|Retry)\b/i.test(ag.buttons) && /Nothing is posted until you confirm it/.test(ag.hold));
|
|
102
102
|
|
|
103
103
|
/* M6 */
|
|
104
104
|
const wt = await p.evaluate(() => ({ cap: document.querySelector('#waitCap').textContent, rows: [...document.querySelectorAll('#waitBody .wtit')].map((x) => x.textContent), subs: [...document.querySelectorAll('#waitBody .ws')].map((x) => x.textContent), nudge: /Nudge/.test(document.querySelector('#waitCard').textContent) }));
|
|
@@ -139,10 +139,10 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
139
139
|
ok('M8 Undo posts Reopen for that item', await until(() => A.posts.some((x) => x.path === '/api/pm-items/reopen' && x.body.id === 'item-bbbbbbbbbbb2')));
|
|
140
140
|
await openKey('work:item-aaaaaaaaaaa1');
|
|
141
141
|
const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, btn: [...document.querySelectorAll('#card button')].map((b) => b.textContent.trim()), mod: document.querySelector('#dlg').getAttribute('aria-modal'), ask: !!document.querySelector('#askGo'), wDis: document.querySelector('#wBtn').disabled }));
|
|
142
|
-
ok('M8 a dialog offers Done, Not yet, Move to, Waiting and Drop, and the agent box; Keep only where the review list holds the item', dlg.title === 'Decide how partial refunds are handled' && dlg.btn.join() === 'Done,Later today,Tomorrow,Next week,Do today,
|
|
142
|
+
ok('M8 a dialog offers the agent, Done, Not yet, Move to, the tool row, Waiting and Drop, and the agent box; Keep only where the review list holds the item', dlg.title === 'Decide how partial refunds are handled' && dlg.btn.join() === 'Let the agent draft this,Done,Later today,Tomorrow,Next week,Do today,Edit,Who does each step,Not before…,Someday,Wait for them,Drop it' && dlg.mod === 'true' && dlg.ask && dlg.wDis, JSON.stringify(dlg));
|
|
143
143
|
await p.locator('#card [data-p="notyet"][data-when="tomorrow"]').click();
|
|
144
144
|
ok('M8 Not yet posts the item and the day, and closes the dialog', await until(() => A.posts.some((x) => x.path === '/api/pm-items/notyet' && x.body.id === 'item-aaaaaaaaaaa1' && x.body.when === 'tomorrow' && Object.keys(x.body).sort().join() === 'id,when')) && await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))));
|
|
145
|
-
for (const [sel, route, check] of [['[data-p="flag"]', '/api/pm-items/flag', (b) => b.flagged === true], ['[data-p="
|
|
145
|
+
for (const [sel, route, check] of [['[data-p="flag"]', '/api/pm-items/flag', (b) => b.flagged === true], ['[data-p="xt"][data-k="someday"]', '/api/pm-items/someday', (b) => Object.keys(b).join() === 'id'], ['[data-p="done"]', '/api/pm-items/done', (b) => Object.keys(b).join() === 'id'], ['[data-p="remove"]', '/api/pm-items/remove', (b) => Object.keys(b).join() === 'id']]) {
|
|
146
146
|
await openKey('work:item-aaaaaaaaaaa2'); const n = A.posts.length;
|
|
147
147
|
await p.locator('#card ' + sel).click();
|
|
148
148
|
ok(`M8 ${route.split('/').pop()} posts exactly what the Work page's route takes`, await until(() => A.posts.length > n && lastPost().path === route && lastPost().body.id === 'item-aaaaaaaaaaa2' && check(lastPost().body)), JSON.stringify(lastPost()));
|
|
@@ -265,6 +265,8 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
265
265
|
await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="work"]').click(); }, th);
|
|
266
266
|
await until(() => m.evaluate(() => document.querySelectorAll('#plateBody .wrow').length > 0)); await sleep(900);
|
|
267
267
|
const R = await open({ w, h, theme: th }); await sleep(500);
|
|
268
|
+
/* a theme change starts a .3 s box-shadow transition; on a slow runner it can still be running, so let every animation finish before reading styles */
|
|
269
|
+
for (const pg of [m, R.page]) await pg.evaluate(() => Promise.all(document.getAnimations().filter((a) => a.effect && a.effect.getComputedTiming().iterations !== Infinity).map((a) => a.finished.catch(() => null)))).catch(() => null);
|
|
268
270
|
const a = await grab(m, PAIRS), c = await grab(R.page, PAIRS), diffs = [];
|
|
269
271
|
for (const [n] of PAIRS) {
|
|
270
272
|
if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
|
|
@@ -6,18 +6,18 @@ const A = (state, extra) => ({ state, suggest: null, instruction: null, draft: n
|
|
|
6
6
|
const it = (id, title, o = {}) => ({ id, title, due: null, priority: null, waiting_on: null, job: null, source: 'local', created_at: '2026-10-14T09:00:00.000Z', touched_at: '2026-10-14T09:00:00.000Z', steps: [], agent: A('suggest'), ...o });
|
|
7
7
|
function view() {
|
|
8
8
|
const inbox = [
|
|
9
|
-
it('item-aaaaaaaaaaa1', 'Decide how partial refunds are handled', { source: 'jira', created_at: '2026-10-16T08:00:00.000Z', touched_at: '2026-10-16T08:00:00.000Z' }),
|
|
9
|
+
it('item-aaaaaaaaaaa1', 'Decide how partial refunds are handled', { source: 'jira', origin: 'jira', agent: A('suggest', { suggest: 'Draft your reply: partial refunds' }), created_at: '2026-10-16T08:00:00.000Z', touched_at: '2026-10-16T08:00:00.000Z' }),
|
|
10
10
|
it('item-aaaaaaaaaaa2', 'Write acceptance criteria for partner rate limits', { source: 'jira', created_at: '2026-10-16T09:30:00.000Z', touched_at: '2026-10-16T09:30:00.000Z' }),
|
|
11
11
|
it('item-aaaaaaaaaaa3', 'Rina asks if the SSO beta can move to November', { source: 'slack', created_at: '2026-10-16T17:20:00.000Z', touched_at: '2026-10-16T17:20:00.000Z' }),
|
|
12
12
|
it('item-aaaaaaaaaaa4', 'Is the payment-step experiment worth another week?', { created_at: '2026-10-16T17:50:00.000Z', touched_at: '2026-10-16T17:50:00.000Z' }),
|
|
13
13
|
];
|
|
14
14
|
const today = [
|
|
15
15
|
it('wbs:alpha:4.2', 'Sign off the fit-out contractor shortlist', { source: 'wbs', due: '2026-10-15', priority: 'P1', agent: A('ready', { draft: { summary: 'Shortlist sign-off', body: 'Two of the three quotes meet the brief. I would sign off A and B.' } }) }),
|
|
16
|
-
it('item-bbbbbbbbbbb2', 'Prepare for the Design review', { due: '2026-10-16' }),
|
|
16
|
+
it('item-bbbbbbbbbbb2', 'Prepare for the Design review', { due: '2026-10-16', job: 'job-1', steps: [{ id: 'step-1', text: 'List the open questions', who: 'you' }, { id: 'step-2', text: 'Send the agenda to the team', who: 'agent-drafts' }] }),
|
|
17
17
|
it('item-bbbbbbbbbbb3', 'Send the revised roadmap to Finance', { flagged: true, agent: A('working') }),
|
|
18
18
|
];
|
|
19
19
|
const upcoming = [
|
|
20
|
-
it('item-ccccccccccc1', 'Choose the win-back email subject line', { due: '2026-10-19' }),
|
|
20
|
+
it('item-ccccccccccc1', 'Choose the win-back email subject line', { due: '2026-10-19', defer: '2026-10-18' }),
|
|
21
21
|
it('item-ccccccccccc2', 'Outline the weekly partner digest', { due: '2026-11-02', agent: A('failed', { error: 'the run ended' }) }),
|
|
22
22
|
];
|
|
23
23
|
const waiting = [
|
|
@@ -26,6 +26,6 @@ function view() {
|
|
|
26
26
|
];
|
|
27
27
|
const someday = [it('item-eeeeeeeeeee1', 'Rework the onboarding checklist', { parked: true })];
|
|
28
28
|
const review = [waiting[0], someday[0]].map((x) => ({ id: x.id }));
|
|
29
|
-
return { ok: true, today: '2026-10-16', lists: {}, jobs: [], items: [], work: { inbox, today, upcoming, waiting, someday }, review, review_days: 7, focus: {}, counts: { inbox: 4, today: 3, upcoming: 2, waiting: 2, someday: 1, review: 2 } };
|
|
29
|
+
return { ok: true, today: '2026-10-16', lists: {}, jobs: [{ id: 'job-1', when: 'a design review is on the calendar', want: 'to walk in with a decision ready', so: 'the review ends with a disposition', done: 0, total: 1 }], items: [], work: { inbox, today, upcoming, waiting, someday }, review, review_days: 7, focus: { suggestions: [{ key: 'job:job-1', title: 'to walk in with a decision ready', why: '1 due today', item_ids: ['item-bbbbbbbbbbb2'], job: 'job-1' }], accepted: [], dismissed: [] }, counts: { inbox: 4, today: 3, upcoming: 2, waiting: 2, someday: 1, review: 2 } };
|
|
30
30
|
}
|
|
31
31
|
module.exports = { NOW, view, it, A };
|
|
@@ -180,9 +180,16 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
|
|
|
180
180
|
- **Add** takes one line, read by the Work page's own parser (`Reply to Rina about SSO by Friday !p1`). A new item with no date waits in **Your tray** and its dialog opens at once, so you can place it. An item with a date goes where its date says.
|
|
181
181
|
- **Your tray** holds what you threw in and have not placed. It is not counted to clear until you place it (Do today, Later, Not yet, Waiting, Done or Drop).
|
|
182
182
|
- **On your plate** has Inbox, Today, Upcoming and Someday. A row shows where it came from (Yours, Jira, Slack, Board) and a due chip only when a date was set. The round check marks it done, with Undo for a few seconds. "Do this first" appears only on an overdue item.
|
|
183
|
-
- **With agents** counts running, failed and to-review drafts from each item's agent field. A draft is labelled "Agent draft, not checked" and is never counted as done.
|
|
183
|
+
- **With agents** counts running, failed and to-review drafts from each item's agent field. A draft is labelled "Agent draft, not checked" and is never counted as done. The agent itself is started, stopped, edited, sent back or approved in the item's dialog (see below).
|
|
184
184
|
- **Waiting on others** lists who you wait for and for how long. There is no nudge.
|
|
185
|
-
- **An item's dialog** offers Done, Not yet (later today, tomorrow, next week), Do today,
|
|
185
|
+
- **An item's dialog** offers Done, Not yet (later today, tomorrow, next week), Do today, Waiting on a name, Drop (with Undo), and Keep for an item untouched for seven days. The read-only agent from "Asking the agent" is beside it. Below those is a tool row with four more presses, each through the Work page's own route:
|
|
186
|
+
- **Edit** changes the title, due day, priority, who you wait on and the job. A title that Jira, the breakdown or the morning brief owns is read-only, and the panel says so. Only the fields you changed are saved, and Undo writes the old values back.
|
|
187
|
+
- **Who does each step** lists the item's steps. Each step is done by You, the Agent drafts it, or the Agent does it. A step that sends something to a person is only ever drafted by the agent, and the page says when it set that for you. **Add** adds a step.
|
|
188
|
+
- **Not before** hides the item until a day: Tomorrow, Monday, In a week, or a date you pick. **Clear the date** brings it back.
|
|
189
|
+
- **Someday** sends the item to Someday. On an item already there, the same button brings it back.
|
|
190
|
+
- **The agent on an item** appears at the top of the dialog when the item has one. A *suggestion* shows what the agent will do (you can change the words) and **Let the agent draft this**. A *queued or working* agent shows its state and **Stop**. A *ready* draft is labelled the agent's and unchecked. **Post it to Jira** (or Slack, email and so on, from where the item came) first asks, names the place, shows exactly the text and posts nothing until you press **Post it now**. **Edit the draft** lets you change the text, and the post sends your text. **Send it back with a note** needs a note. **Mark it done** posts nothing. A failed run says why and offers **Try again** and **Stop**. An item you added has no place to post to, so it has no Post.
|
|
191
|
+
- **Focus** sits under the add line. It shows the first of the (at most three) things PMOS suggests for today, grouped by the job they serve, with **Accept**. **See all** lists them with Accept, Not today and Clear, and your jobs with their open counts, and **Add a job** takes one line (`when …, I want …, so …`). An accepted group tags its Today rows with Focus. Focus starts empty each day. Editing and deleting a job stay in the console.
|
|
192
|
+
- **Keys and swipe** work on the rows of the plate and the tray. J and K move between rows. The right arrow, or a drag to the right past 90 px, does Done on a Today row and In Today elsewhere; the left arrow, or a drag to the left, does Tomorrow on a Today row and Someday elsewhere. A Today row whose draft is ready offers Review on the right. A row in Waiting has none. Each one offers Undo, and under reduced motion the row does not slide.
|
|
186
193
|
|
|
187
194
|
Not drawn, because no record backs them: the tray's lifecycle states, the shelf, "fold the laundry", the week bars and the capacity figure, and the mockup's suggested place on an inbox item.
|
|
188
195
|
|
|
@@ -27,7 +27,10 @@ const clip = (s, n) => { s = String(s == null ? '' : s).replace(/\s+/g, ' ').tri
|
|
|
27
27
|
const MAX_PER = 8;
|
|
28
28
|
const SECTIONS = [['inbox', 'Inbox'], ['today', 'Today'], ['upcoming', 'Upcoming'], ['someday', 'Someday']];
|
|
29
29
|
const RUNNING = ['queued', 'working', 'sending'];
|
|
30
|
-
const HOLD = { agent: '
|
|
30
|
+
const HOLD = { agent: 'An agent writes a draft and nothing else. Nothing is posted until you confirm it, and what is posted is the text you see.' };
|
|
31
|
+
const PLACE = { mail: 'email', slack: 'Slack', jira: 'Jira', confluence: 'Confluence', github: 'GitHub', drive: 'Drive', figma: 'Figma', calendar: 'the calendar', wispr: 'Wispr' };
|
|
32
|
+
const READONLY = { jira: 'Jira', wbs: 'the breakdown', brief: 'the morning brief' };
|
|
33
|
+
const isUrl = (s) => /^https?:\/\//i.test(String(s || ''));
|
|
31
34
|
|
|
32
35
|
let last = null;
|
|
33
36
|
const peekModel = () => last;
|
|
@@ -44,6 +47,22 @@ const agentOf = (it) => (it && it.agent && it.agent.state) || null;
|
|
|
44
47
|
const isReady = (it) => agentOf(it) === 'ready';
|
|
45
48
|
const isRunning = (it) => RUNNING.includes(agentOf(it));
|
|
46
49
|
|
|
50
|
+
/** The agent on an item, as its dialog draws it. Only fields of it.agent; where a post goes is the place the item came from (as the Work page says). */
|
|
51
|
+
function agentDetail(it) {
|
|
52
|
+
const a = it && it.agent;
|
|
53
|
+
if (!a || !a.state) return null;
|
|
54
|
+
if (a.state === 'suggest' && !(a.instruction || a.suggest)) return null; // an offer with no words behind it is not drawn
|
|
55
|
+
const mine = isLocal(it) && !it.origin;
|
|
56
|
+
const d = a.draft || null;
|
|
57
|
+
return {
|
|
58
|
+
state: a.state, ask: clip(a.instruction || a.suggest || '', 500),
|
|
59
|
+
draft: d ? { summary: clip(d.summary || '', 300), body: String(d.body || '').slice(0, 4000), step: d.step ? clip(d.step, 200) : null } : null,
|
|
60
|
+
error: a.error ? clip(a.error, 300) : null, asks: !!a.asks, session: a.session || null,
|
|
61
|
+
mine, where: mine ? null : it.origin === 'jira' ? 'Jira' : PLACE[it.place] || 'its source',
|
|
62
|
+
started_at: a.started_at || null, sent_at: a.sent && a.sent.at ? a.sent.at : null, link: a.sent && isUrl(a.sent.link) ? a.sent.link : null,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
47
66
|
function dueChip(it, today) {
|
|
48
67
|
if (!it.due) return { chip: null, overdue: false };
|
|
49
68
|
const d = daysBetween(today, it.due);
|
|
@@ -53,7 +72,7 @@ function dueChip(it, today) {
|
|
|
53
72
|
return { chip: shortDate(it.due), overdue: false };
|
|
54
73
|
}
|
|
55
74
|
|
|
56
|
-
function rowOf(it, list, v, inReview) {
|
|
75
|
+
function rowOf(it, list, v, inReview, focusIds) {
|
|
57
76
|
const today = v.today, { chip, overdue } = dueChip(it, today);
|
|
58
77
|
const sub = [srcLabel(it), it.priority, it.waiting_on ? 'waiting on ' + it.waiting_on : null].filter(Boolean).join(' · ');
|
|
59
78
|
const days = it.waiting_since ? daysBetween(String(it.waiting_since).slice(0, 10), today) : null;
|
|
@@ -65,7 +84,6 @@ function rowOf(it, list, v, inReview) {
|
|
|
65
84
|
const draft = it.agent && it.agent.draft && (it.agent.draft.body || it.agent.draft.summary);
|
|
66
85
|
const actions = ['done', 'notyet'];
|
|
67
86
|
if (list !== 'today') actions.push('flag');
|
|
68
|
-
if (list !== 'someday') actions.push('park');
|
|
69
87
|
if (list !== 'waiting') actions.push('waiting');
|
|
70
88
|
actions.push('remove');
|
|
71
89
|
if (inReview) actions.push('keep');
|
|
@@ -73,12 +91,18 @@ function rowOf(it, list, v, inReview) {
|
|
|
73
91
|
return {
|
|
74
92
|
key: 'work:' + it.id, id: it.id, list, title: clip(it.title, 140), sub, chip, overdue, src: srcLabel(it),
|
|
75
93
|
agent: agentOf(it) && agentOf(it) !== 'suggest' ? agentOf(it) : null,
|
|
94
|
+
focus: list === 'today' && focusIds.has(it.id),
|
|
76
95
|
dialog: {
|
|
77
96
|
eye: 'Your item', logTitle: 'Read from your list',
|
|
78
97
|
log: ['Read the item (' + srcLabel(it) + ')', 'Placed it from its date, its flag and who it waits on: ' + list, inReview ? 'Found it untouched for ' + v.review_days + ' days' : 'Checked it against the seven-day review'],
|
|
79
98
|
say, head: 'Where it stands', facts,
|
|
80
99
|
write: { kind: 'work', id: it.id, actions },
|
|
81
100
|
hold: HOLD.agent,
|
|
101
|
+
agent: agentDetail(it),
|
|
102
|
+
edit: { title: it.title || '', due: it.due || '', priority: it.priority || '', waiting_on: it.waiting_on || '', job: it.job || '', title_ro: READONLY[it.origin || it.source] ? 'The title comes from ' + READONLY[it.origin || it.source] + '. It is read-only here.' : '' },
|
|
103
|
+
steps: (it.steps || []).map((x) => ({ id: x.id, text: clip(x.text, 200), who: x.who })),
|
|
104
|
+
defer: it.defer || null,
|
|
105
|
+
someday: list === 'someday',
|
|
82
106
|
pane: { label: 'Item record', file: 'pm-items · ' + it.id, h: clip(it.title, 120), intro: sub, rows: facts, paras: draft ? [clip(draft, 1500)] : [], parasTitle: draft ? 'Agent draft, not checked' : '' },
|
|
83
107
|
},
|
|
84
108
|
};
|
|
@@ -91,6 +115,11 @@ function build({ v, now }) {
|
|
|
91
115
|
v = Object.assign({ work: {}, review: [], review_days: 7 }, v, { today });
|
|
92
116
|
const work = Object.assign({ inbox: [], today: [], upcoming: [], waiting: [], someday: [] }, v.work);
|
|
93
117
|
const reviewIds = new Set((v.review || []).map((x) => x.id));
|
|
118
|
+
const fo = v.focus || {};
|
|
119
|
+
const cleanF = (x) => ({ key: String(x.key), title: clip(x.title, 140), why: clip(x.why || '', 160), item_ids: (x.item_ids || []).map(String), job: x.job || null });
|
|
120
|
+
const focus = { suggestions: (fo.suggestions || []).slice(0, 3).map(cleanF), accepted: (fo.accepted || []).map(cleanF), dismissed: (fo.dismissed || []).map(String) };
|
|
121
|
+
const focusIds = new Set([].concat(...focus.accepted.map((a) => a.item_ids)));
|
|
122
|
+
const jobs = (v.jobs || []).map((j) => ({ id: j.id, name: clip(j.want || j.when || j.so || 'A standing job', 120), when: j.when || '', want: j.want || '', so: j.so || '', open: Math.max(0, (j.total || 0) - (j.done || 0)) }));
|
|
94
123
|
const tray = (work.inbox || []).filter(isLocal), arrivals = (work.inbox || []).filter((i) => !isLocal(i));
|
|
95
124
|
work.inbox = arrivals;
|
|
96
125
|
const all = [];
|
|
@@ -124,15 +153,15 @@ function build({ v, now }) {
|
|
|
124
153
|
|
|
125
154
|
const sections = SECTIONS.map(([k, label]) => {
|
|
126
155
|
const items = work[k] || [];
|
|
127
|
-
return { key: k, label, n: items.length, more: Math.max(0, items.length - MAX_PER), rows: items.slice(0, MAX_PER).map((it) => rowOf(it, k, v, reviewIds.has(it.id))) };
|
|
156
|
+
return { key: k, label, n: items.length, more: Math.max(0, items.length - MAX_PER), rows: items.slice(0, MAX_PER).map((it) => rowOf(it, k, v, reviewIds.has(it.id), focusIds)) };
|
|
128
157
|
});
|
|
129
|
-
const waitingRows = (work.waiting || []).slice(0, MAX_PER).map((it) => rowOf(it, 'waiting', v, reviewIds.has(it.id)));
|
|
130
|
-
const agentRows = ready.concat(running, failed.filter((x) => !ready.includes(x))).slice(0, MAX_PER).map((x) => rowOf(x.it, x.list, v, reviewIds.has(x.it.id)));
|
|
131
|
-
const trayRows = tray.slice(0, MAX_PER).map((it) => rowOf(it, 'tray', v, reviewIds.has(it.id)));
|
|
158
|
+
const waitingRows = (work.waiting || []).slice(0, MAX_PER).map((it) => rowOf(it, 'waiting', v, reviewIds.has(it.id), focusIds));
|
|
159
|
+
const agentRows = ready.concat(running, failed.filter((x) => !ready.includes(x))).slice(0, MAX_PER).map((x) => rowOf(x.it, x.list, v, reviewIds.has(x.it.id), focusIds));
|
|
160
|
+
const trayRows = tray.slice(0, MAX_PER).map((it) => rowOf(it, 'tray', v, reviewIds.has(it.id), focusIds));
|
|
132
161
|
const rowsAll = [].concat(...sections.map((s) => s.rows), waitingRows, agentRows, trayRows);
|
|
133
162
|
const firstToday = sections[1].rows[0];
|
|
134
163
|
const model = {
|
|
135
|
-
date: dateLine(now), pending: false,
|
|
164
|
+
date: dateLine(now), today, pending: false,
|
|
136
165
|
header: { text: 'Real data · as of ' + hhmm(now) + ' · Jira and Slack appear only when an agent session has read them', missing: [] },
|
|
137
166
|
hero, empty,
|
|
138
167
|
capture: { placeholder: 'Add anything: "Reply to Rina about SSO by Friday"', hint: 'One line. The date and priority are read from it.' },
|
|
@@ -142,6 +171,7 @@ function build({ v, now }) {
|
|
|
142
171
|
waiting: { title: 'Waiting on others', cap: longest != null ? 'longest ' + longest + ' ' + plural(longest, 'day', 'days') : (work.waiting || []).length ? num(work.waiting.length) + ' waiting' : '', n: (work.waiting || []).length, more: Math.max(0, (work.waiting || []).length - MAX_PER), rows: waitingRows },
|
|
143
172
|
review: { n: (v.review || []).length, days: v.review_days, ids: (v.review || []).map((i) => i.id) },
|
|
144
173
|
dock: { needs: clear, label: 'to clear', next: firstToday ? firstToday.title : (sections[0].rows[0] ? sections[0].rows[0].title : null) },
|
|
174
|
+
focus, jobs,
|
|
145
175
|
rows: rowsAll,
|
|
146
176
|
};
|
|
147
177
|
last = model;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.278.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.278.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED