create-pmos 0.415.0 → 0.416.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 +13 -13
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +3 -3
- package/workspace/briefing-premium-board-test.js +72 -43
- package/workspace/briefing-premium-doc-edit-test.js +2 -2
- package/workspace/briefing-premium-initiative-test.js +19 -22
- package/workspace/briefing-premium-insights-test.js +28 -17
- package/workspace/changelog.json +12 -0
- package/workspace/core-docs-workflow-test.js +1 -1
- package/workspace/guide/workflows.md +2 -1
- package/workspace/ini-workflow-test.js +11 -11
- package/workspace/lib/board-premium.js +7 -2
- package/workspace/lib/board-trail.js +6 -1
- package/workspace/lib/engine/boards.js +8 -2
- package/workspace/lib/initiative-chat.js +4 -3
- package/workspace/lib/insights-premium.js +9 -1
- package/workspace/lib/pmos-verbs.js +1 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +32 -4
- package/workspace/lib/routes-live.js +53 -0
- package/workspace/lib/task-cli.js +88 -24
- package/workspace/lib/task-items.js +3 -1
- package/workspace/lib/workflow-cli.js +1 -1
- package/workspace/milestone-suggest-test.js +2 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +3 -3
- package/workspace/premium-chat-report-tab-test.js +13 -5
- package/workspace/premium-core-doc-issue-test.js +1 -1
- package/workspace/premium-report-read-test.js +66 -51
- package/workspace/premium-vw-backlog-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +3 -3
- package/workspace/premium-vw-item-test.js +4 -4
- package/workspace/premium-vw-jira-test.js +14 -13
- package/workspace/premium-vw-slides-test.js +7 -5
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-ini-panel.js +68 -230
- package/workspace/public/pm/cozy-insights.css +15 -0
- package/workspace/public/pm/cozy-live-pill.css +48 -0
- package/workspace/public/pm/cozy-live-pill.js +141 -0
- package/workspace/public/pm/cozy-viewer.js +4 -3
- package/workspace/public/pm/cozy-vw-rp.css +48 -0
- package/workspace/public/pm/home-app.js +45 -8
- package/workspace/public/pm/home-chat.js +5 -2
- package/workspace/public/pm/home-ini.js +57 -22
- package/workspace/public/pm/home-task.js +16 -5
- package/workspace/public/pm/ini-view-model.js +277 -0
- package/workspace/public/pm/ini-view.css +122 -0
- package/workspace/public/pm/ini-view.js +180 -0
- package/workspace/public/pm/live-model.js +104 -0
- package/workspace/public/pm/ov-view.css +44 -0
- package/workspace/public/pm/premium-board.js +14 -15
- package/workspace/public/pm/premium-insights.js +61 -35
- package/workspace/public/pm/premium-report-read.js +74 -50
- package/workspace/public/pm/premium-report-tab.js +36 -15
- package/workspace/public/pm/premium-shell.js +1 -1
- package/workspace/public/pm/premium-vw-item-model.js +6 -3
- package/workspace/public/pm/premium-vw-item.js +25 -6
- package/workspace/public/pm/premium-vw-jira.js +17 -15
- package/workspace/public/pm/rp-parts.js +75 -12
- package/workspace/public/pm/task-card.css +24 -49
- package/workspace/public/pm/task-card.js +90 -64
- package/workspace/public/pm/tk-view.css +21 -0
- package/workspace/public/pm/tk-view.js +216 -0
- package/workspace/public/pm/wf-page.js +2 -0
- package/workspace/server.js +24 -1
- package/workspace/stage-card-test.js +49 -41
- package/workspace/task-card-test.js +83 -38
- package/workspace/test-files.json +3 -1
- package/workspace/test-lists/bd-ini-panel.json +3 -3
- package/workspace/tk-tasks-test.js +3 -3
- package/workspace/public/pm/bd-ini-model.js +0 -81
- package/workspace/public/pm/cozy-rec-pill.css +0 -12
- package/workspace/public/pm/cozy-rec-pill.js +0 -46
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
/* task-cli.js — `pmos task …`: an initiative's tasks from a terminal, so an agent the PM asks can add, close or move them (Wawan,
|
|
3
3
|
* 2026-10-25: "I made instruction to move, but agent still ask to move myself from Board"; feedback batch 5: one kind of task).
|
|
4
4
|
*
|
|
5
|
-
* pmos task add <initiative> "<title>" [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]
|
|
5
|
+
* pmos task add <initiative> "<title>" [--stage <stage>] [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]
|
|
6
6
|
* a new task, by the same function as the page's Add a task (lib/routes-boards.js taskAdd, POST /api/boards/tasks/add)
|
|
7
|
+
* pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start …|none] [--owner <who>] [--notes <text>]
|
|
8
|
+
* place tasks under a workflow stage of their initiative, or change their dates, owner or notes, by the same function as the Viewer's
|
|
9
|
+
* edit (lib/routes-boards.js taskEdit, POST /api/boards/tasks/edit). The Tasks section groups tasks by stage (feedback batch 6:
|
|
10
|
+
* an agent asked to group tasks by stage had no command for it).
|
|
7
11
|
* pmos task list <initiative> [--all] its open tasks (To do, In progress); --all adds Done, Won't do and Archived
|
|
8
12
|
* pmos task state <task> [<task> …] --to <state> [--why <text>]
|
|
9
13
|
* set each task's state: To do, In progress, Done, Won't do or Archived, by the same function as the Board's press
|
|
@@ -11,7 +15,8 @@
|
|
|
11
15
|
*
|
|
12
16
|
* ONE KIND OF TASK. The list holds the initiative's Board tasks, its breakdown items (the plan-items ledger, lib/task-items.js) and its
|
|
13
17
|
* current stage's To finish entries, which become tasks the first time they are read (routes-boards stageTasks). `state` closes any of
|
|
14
|
-
* them. A task
|
|
18
|
+
* them. A task's stage (--stage) is its place in the breakdown, never its state, and it never moves the initiative: the initiative's
|
|
19
|
+
* workflow stage is `pmos workflow of|move`. Who wrote a
|
|
15
20
|
* line is the call path (lib/actor.js), never an argument. Exit codes: 0 done, 1 refused, 2 usage. Nothing is sent. */
|
|
16
21
|
const path = require('path');
|
|
17
22
|
const { execFileSync } = require('child_process');
|
|
@@ -22,22 +27,25 @@ const B = require(repoScript('boards.js'));
|
|
|
22
27
|
const TI = require('./task-items.js');
|
|
23
28
|
const rowsLib = require('./initiative-rows.js');
|
|
24
29
|
|
|
25
|
-
const COMMANDS = { task: ['add', 'list', 'state'] };
|
|
30
|
+
const COMMANDS = { task: ['add', 'list', 'state', 'set'] };
|
|
26
31
|
const USAGE = [
|
|
27
|
-
'usage: pmos task add|list|state — an initiative\'s tasks, the ones the PM sees in its Tasks section',
|
|
28
|
-
' pmos task add <initiative> "<title>" [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]',
|
|
32
|
+
'usage: pmos task add|list|state|set — an initiative\'s tasks, the ones the PM sees in its Tasks section',
|
|
33
|
+
' pmos task add <initiative> "<title>" [--stage <stage>] [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]',
|
|
29
34
|
' Add a task. Every new task goes here; pmos item add is the older breakdown record.',
|
|
35
|
+
' pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start YYYY-MM-DD|none] [--owner <who>] [--notes <text>]',
|
|
36
|
+
' Group tasks under a stage of the initiative\'s workflow (key or name; none takes it out), or change dates, owner or notes.',
|
|
30
37
|
' pmos task list <initiative> [--all] its open tasks; --all adds Done, Won\'t do and Archived',
|
|
31
38
|
' pmos task state <task> [<task> …] --to <state> [--why <text>]',
|
|
32
39
|
' Set each task\'s state when the PM asks: To do, In progress, Done, Won\'t do or Archived. The page shows it at once.',
|
|
33
40
|
' Give --why with Done: it is the evidence the PM reads.',
|
|
34
41
|
' There is one kind of task: Board tasks, breakdown items and the current stage\'s To finish tasks all list and close here.',
|
|
35
|
-
'
|
|
42
|
+
' The Tasks section groups tasks by the workflow\'s stages: --stage places a task there. It never changes the task\'s state or',
|
|
43
|
+
' moves the initiative. Move the initiative with pmos workflow move.',
|
|
36
44
|
' every command: [--json] [--root <dir>]. Nothing is sent.',
|
|
37
45
|
];
|
|
38
46
|
const BOOL = new Set(['json', 'help', 'all']);
|
|
39
|
-
const VALUE = new Set(['to', 'why', 'root', 'due', 'start', 'owner', 'notes']);
|
|
40
|
-
const ONLY = { add: ['due', 'start', 'owner', 'notes'], list: ['all'], state: ['to', 'why'] };
|
|
47
|
+
const VALUE = new Set(['to', 'why', 'root', 'due', 'start', 'owner', 'notes', 'stage']);
|
|
48
|
+
const ONLY = { add: ['due', 'start', 'owner', 'notes', 'stage'], list: ['all'], state: ['to', 'why'], set: ['due', 'start', 'owner', 'notes', 'stage'] };
|
|
41
49
|
const OPEN = new Set(['To do', 'In progress']);
|
|
42
50
|
/** The PM's words for a state: any case, with or without the apostrophe or the space. */
|
|
43
51
|
function stateOf(s) {
|
|
@@ -45,6 +53,15 @@ function stateOf(s) {
|
|
|
45
53
|
return { todo: 'To do', inprogress: 'In progress', doing: 'In progress', done: 'Done', wontdo: "Won't do", archived: 'Archived', archive: 'Archived' }[k] || null;
|
|
46
54
|
}
|
|
47
55
|
|
|
56
|
+
/** A stage the PM or agent names (its key or its name, any case) → its key in the initiative's workflow, '' for none, or null. */
|
|
57
|
+
function stageKey(stages, s) {
|
|
58
|
+
const k = String(s || '').trim().toLowerCase();
|
|
59
|
+
if (k === 'none' || k === '-') return '';
|
|
60
|
+
const n = (x) => String(x || '').toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
61
|
+
const hit = (stages || []).find((x) => String(x.key).toLowerCase() === k || n(x.name) === n(k) || n(x.key) === n(k));
|
|
62
|
+
return hit ? hit.key : null;
|
|
63
|
+
}
|
|
64
|
+
|
|
48
65
|
function parse(argv) {
|
|
49
66
|
const pos = []; const flags = {};
|
|
50
67
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -70,7 +87,7 @@ function boardsCtx(root, stateDir) {
|
|
|
70
87
|
const w = { id: driver.wsIdOf(root), name: path.basename(root), root };
|
|
71
88
|
return { w, ctx: { getWs: () => w, workspaceList: () => [w], stateDirFor: () => stateDir, selfRoot: path.resolve(__dirname, '..', '..') } };
|
|
72
89
|
}
|
|
73
|
-
const line = (t) => `${t.id} · ${t.state} · ${t.title}${t.kind === 'Epic' ? ' (epic)' : ''}${t.due ? ' · due ' + t.due : ''}`;
|
|
90
|
+
const line = (t) => `${t.id} · ${t.state} · ${t.title}${t.kind === 'Epic' ? ' (epic)' : ''}${t.stage ? ' · under ' + t.stage : ''}${t.due ? ' · due ' + t.due : ''}`;
|
|
74
91
|
/** The workflow row of an initiative, deriving the rows when they are still being read. */
|
|
75
92
|
function rowOf(boards, ctx, w, id) {
|
|
76
93
|
let r = boards.initiativeWorkflow(ctx, w, id);
|
|
@@ -85,7 +102,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
85
102
|
const json = !!flags.json;
|
|
86
103
|
if (!verb || verb === 'help' || verb === '--help' || verb === '-h' || flags.help) { for (const l of USAGE) say(l); return verb ? 0 : 1; }
|
|
87
104
|
if (!COMMANDS.task.includes(verb)) { say(`unknown task command "${verb}" — one of ${COMMANDS.task.join(', ')}`); return 2; }
|
|
88
|
-
if (verb === 'add' && pos.length > 2) { say('usage: pmos task add <initiative> "<title>" [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]'); return 2; }
|
|
105
|
+
if (verb === 'add' && pos.length > 2) { say('usage: pmos task add <initiative> "<title>" [--stage <stage>] [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]'); return 2; }
|
|
89
106
|
if ('by' in flags || 'via' in flags) { say(`attribution is set from the call path; --${'by' in flags ? 'by' : 'via'} is not accepted`); return 2; }
|
|
90
107
|
for (const k of Object.keys(flags)) {
|
|
91
108
|
if (!BOOL.has(k) && !VALUE.has(k)) { say(`unknown option --${k}`); return 2; }
|
|
@@ -106,23 +123,32 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
106
123
|
const tasksOf = (id) => {
|
|
107
124
|
const r = rowOf(boards, ctx, w, id);
|
|
108
125
|
const board = r.ok ? r.board.id : null;
|
|
109
|
-
const
|
|
110
|
-
const
|
|
126
|
+
const F = boards.foldOf(ctx, w), S = F.sections || new Map();
|
|
127
|
+
const stageOf = (tid, from) => (S.has(tid) ? S.get(tid) : (from && from.stage) || ''); // the group the Tasks section shows it under
|
|
128
|
+
const own = [...(F.tasks || new Map()).values()].filter((t) => t.initiative === id).map((t) => ({ ...t, stage: stageOf(t.id, t.from) }));
|
|
129
|
+
const items = TI.rowsOf(root, new Set([id]), board).map((x) => ({ id: x.uid, board, kind: 'Task', title: x.title, state: x.status, owner: x.owner, due: x.end, store: 'item', stage: stageOf(x.uid) }));
|
|
111
130
|
return own.concat(items);
|
|
112
131
|
};
|
|
113
132
|
|
|
114
133
|
if (verb === 'add') {
|
|
115
134
|
const [id, title] = pos;
|
|
116
|
-
if (!id || title === undefined) { say('usage: pmos task add <initiative> "<title>" [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]'); return 2; }
|
|
135
|
+
if (!id || title === undefined) { say('usage: pmos task add <initiative> "<title>" [--stage <stage>] [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]'); return 2; }
|
|
117
136
|
const r = rowOf(boards, ctx, w, id);
|
|
118
137
|
if (!r.ok) return fail(r.error);
|
|
138
|
+
const stages = r.row.wfStages || [];
|
|
139
|
+
const sec = flags.stage !== undefined ? stageKey(stages, flags.stage) : null;
|
|
140
|
+
if (flags.stage !== undefined && sec == null) return fail(`"${flags.stage}" is not a stage of ${id}'s workflow: one of ${stages.map((x) => x.key).join(', ')}, or none`, 2);
|
|
119
141
|
const body = { ws: w.id, board: r.board.id, initiative: id, title };
|
|
120
142
|
for (const k of ['due', 'start', 'owner', 'notes']) if (flags[k] !== undefined) body[k] = flags[k];
|
|
121
143
|
const a = boards.taskAdd(ctx, body, g);
|
|
122
144
|
if (!a.body || a.body.ok !== true) return fail((a.body && a.body.error) || 'the write was refused');
|
|
123
145
|
const t = a.body.item;
|
|
124
|
-
if (
|
|
125
|
-
|
|
146
|
+
if (sec) {
|
|
147
|
+
const e = boards.taskEdit(ctx, { ws: w.id, board: r.board.id, task: t.uid, section: sec }, g);
|
|
148
|
+
if (!e.body || e.body.ok !== true) return fail(`added ${t.uid}, but it was not placed under ${sec}: ${(e.body && e.body.error) || 'the write was refused'}`);
|
|
149
|
+
}
|
|
150
|
+
if (json) say(JSON.stringify({ ok: true, task: { id: t.uid, board: t.board, title: t.title, state: t.status, owner: t.owner, start: t.start, due: t.end, ...(sec ? { stage: sec } : {}) } }));
|
|
151
|
+
else say(`✓ added ${t.uid} · ${t.status} · ${t.title}${sec ? ' · under ' + sec : ''}${t.end ? ' · due ' + t.end : ''}. The initiative's Tasks section shows it. Nothing was sent.`);
|
|
126
152
|
return 0;
|
|
127
153
|
}
|
|
128
154
|
|
|
@@ -131,11 +157,55 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
131
157
|
try { boards.seedInitiative(ctx, w, id); } catch { /* the To finish tasks are made on the next read */ }
|
|
132
158
|
const all = tasksOf(id);
|
|
133
159
|
const shown = flags.all ? all : all.filter((t) => OPEN.has(t.state));
|
|
134
|
-
if (json) { say(JSON.stringify({ ok: true, tasks: shown.map((t) => ({ id: t.id, board: t.board, kind: t.kind, title: t.title, state: t.state, owner: t.owner, due: t.due, ...(t.from ? { from: t.from } : {}) })) })); return 0; }
|
|
160
|
+
if (json) { say(JSON.stringify({ ok: true, tasks: shown.map((t) => ({ id: t.id, board: t.board, kind: t.kind, title: t.title, state: t.state, owner: t.owner, due: t.due, stage: t.stage || '', ...(t.from ? { from: t.from } : {}) })) })); return 0; }
|
|
135
161
|
if (!shown.length) { say(all.length ? `No open task on ${id}. --all lists the ${all.length} closed.` : `No task on ${id}.`); return 0; }
|
|
136
162
|
for (const t of shown) say(line(t));
|
|
137
163
|
return 0;
|
|
138
164
|
}
|
|
165
|
+
/** A task by its id: a Board task, or a breakdown item with the board its initiative is on. */
|
|
166
|
+
const findTask = (folded, id) => {
|
|
167
|
+
let t = B.taskOf(folded, id);
|
|
168
|
+
if (!t && TI.isItemId(id)) {
|
|
169
|
+
// a breakdown item: the Board's press writes it to the plan-items ledger (lib/task-items.js)
|
|
170
|
+
const it = TI.itemOf(root, id);
|
|
171
|
+
const r = it ? rowOf(boards, ctx, w, it.initiative) : null;
|
|
172
|
+
if (it && r && r.ok) t = { id, board: r.board.id, initiative: it.initiative, title: it.title, state: TI.STATE_OF[it.state] };
|
|
173
|
+
}
|
|
174
|
+
return t;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
if (verb === 'set') {
|
|
178
|
+
const keys = ['stage', 'due', 'start', 'owner', 'notes'].filter((k) => flags[k] !== undefined);
|
|
179
|
+
if (!pos.length || !keys.length) { say('usage: pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start YYYY-MM-DD|none] [--owner <who>] [--notes <text>]'); return 2; }
|
|
180
|
+
const folded = boards.foldOf(ctx, w);
|
|
181
|
+
const done = [], refused = [];
|
|
182
|
+
for (const id of pos) {
|
|
183
|
+
const t = findTask(folded, id);
|
|
184
|
+
if (!t) { refused.push({ task: id, error: `no task ${id}; pmos task list <initiative> names them` }); continue; }
|
|
185
|
+
const body = { ws: w.id, board: t.board, task: id };
|
|
186
|
+
if (flags.stage !== undefined) {
|
|
187
|
+
const r = rowOf(boards, ctx, w, t.initiative);
|
|
188
|
+
const stages = r.ok ? r.row.wfStages || [] : [];
|
|
189
|
+
const sec = stageKey(stages, flags.stage);
|
|
190
|
+
if (sec == null) { refused.push({ task: id, error: `"${flags.stage}" is not a stage of ${t.initiative}'s workflow: one of ${stages.map((x) => x.key).join(', ')}, or none` }); continue; }
|
|
191
|
+
body.section = sec;
|
|
192
|
+
}
|
|
193
|
+
for (const k of ['due', 'start']) if (flags[k] !== undefined) body[k] = String(flags[k]).toLowerCase() === 'none' ? '' : flags[k];
|
|
194
|
+
for (const k of ['owner', 'notes']) if (flags[k] !== undefined) body[k] = flags[k];
|
|
195
|
+
const e = boards.taskEdit(ctx, body, g);
|
|
196
|
+
if (!e.body || e.body.ok !== true) refused.push({ task: id, error: (e.body && e.body.error) || 'the write was refused' });
|
|
197
|
+
else done.push({ task: id, title: t.title, set: Object.fromEntries(keys.map((k) => [k, k === 'stage' ? body.section : body[k]])) });
|
|
198
|
+
}
|
|
199
|
+
const what = (x) => Object.entries(x).map(([k, v]) => (k === 'stage' ? (v ? 'under ' + v : 'under no stage') : v === '' ? 'no ' + k : k + ' ' + v)).join(', ');
|
|
200
|
+
if (json) say(JSON.stringify({ ok: !refused.length, done, refused }));
|
|
201
|
+
else {
|
|
202
|
+
for (const d of done) say(`✓ ${d.task} ${what(d.set)}: ${d.title}`);
|
|
203
|
+
for (const x of refused) say(`✗ ${x.task}: ${x.error}`);
|
|
204
|
+
if (done.length) say(' The page shows it. Nothing was sent.');
|
|
205
|
+
}
|
|
206
|
+
return refused.length ? 1 : 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
139
209
|
// state
|
|
140
210
|
if (!pos.length || !flags.to) { say('usage: pmos task state <task> [<task> …] --to <state> [--why <text>]'); return 2; }
|
|
141
211
|
const to = stateOf(flags.to);
|
|
@@ -143,13 +213,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
143
213
|
const folded = boards.foldOf(ctx, w);
|
|
144
214
|
const done = [], refused = [];
|
|
145
215
|
for (const id of pos) {
|
|
146
|
-
|
|
147
|
-
if (!t && TI.isItemId(id)) {
|
|
148
|
-
// a breakdown item: the Board's press writes it to the plan-items ledger (lib/task-items.js)
|
|
149
|
-
const it = TI.itemOf(root, id);
|
|
150
|
-
const r = it ? rowOf(boards, ctx, w, it.initiative) : null;
|
|
151
|
-
if (it && r && r.ok) t = { id, board: r.board.id, title: it.title, state: TI.STATE_OF[it.state] };
|
|
152
|
-
}
|
|
216
|
+
const t = findTask(folded, id);
|
|
153
217
|
if (!t) { refused.push({ task: id, error: `no task ${id}; pmos task list <initiative> names them` }); continue; }
|
|
154
218
|
if (t.state === to) { done.push({ task: id, title: t.title, state: to, same: true }); continue; }
|
|
155
219
|
const r = boards.taskState(ctx, { ws: w.id, board: t.board, task: id, state: to, ...(flags.why ? { why: flags.why } : {}) }, g);
|
|
@@ -165,4 +229,4 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
|
|
|
165
229
|
return refused.length ? 1 : 0;
|
|
166
230
|
}
|
|
167
231
|
|
|
168
|
-
module.exports = { run, COMMANDS, USAGE, stateOf };
|
|
232
|
+
module.exports = { run, COMMANDS, USAGE, stateOf, stageKey };
|
|
@@ -50,7 +50,9 @@ function rowsOf(root, ids, board) {
|
|
|
50
50
|
const it = f.items[id];
|
|
51
51
|
if (!it || it.proposed || !ids.has(it.initiative)) continue;
|
|
52
52
|
out.push({ uid: it.id, key: '', kind: 'Task', src: 'pmos', store: 'item', title: it.title, status: STATE_OF[it.state] || 'To do', blocked: !!it.blocked, owner: ownerName(it.owner),
|
|
53
|
-
notes: it.note || '', ini: it.initiative, epic: null, start: it.start || null, end: it.due || null, ref: it.id, board
|
|
53
|
+
notes: it.note || '', ini: it.initiative, epic: null, start: it.start || null, end: it.due || null, ref: it.id, board,
|
|
54
|
+
// the breakdown's own stage (plan-tree) and order: the one view places the item in the workflow stage of the same name
|
|
55
|
+
...(it.stage ? { itemStage: it.stage } : {}), ...(Number.isFinite(it.order) ? { order: it.order } : {}) });
|
|
54
56
|
}
|
|
55
57
|
return out;
|
|
56
58
|
}
|
|
@@ -179,7 +179,7 @@ function ofLines(r) {
|
|
|
179
179
|
const out = [`${row.title} (${row.id}) runs ${row.wf.name} (${row.wf.id}) on the board ${r.board.name}.`];
|
|
180
180
|
out.push(row.ended ? `It ended: ${row.ended.as === 'wontdo' ? "Won't do" : 'Archived'}.` : `Stage ${st.n} of ${st.of}: ${st.name} [${st.key}]`);
|
|
181
181
|
(row.wfStages || []).forEach((s, i) => out.push(` ${MARK[s.status] || ' '} ${String(i + 1).padStart(2)}. ${s.milestone ? '◆ ' : ''}${s.name} [${s.key}]${s.status === 'current' ? ' · current' : s.status === 'skipped' ? ' · skipped' : ''}`));
|
|
182
|
-
out.push(`Move it: pmos workflow move ${row.id} --stage <key>.
|
|
182
|
+
out.push(`Move it: pmos workflow move ${row.id} --stage <key>. Moving the initiative changes no task; a task's group (pmos task set --stage) is its place in the breakdown, not its state.`);
|
|
183
183
|
return out;
|
|
184
184
|
}
|
|
185
185
|
const ofJson = (r) => ({ initiative: { id: r.row.id, title: r.row.title }, board: { id: r.board.id, name: r.board.name }, wf: r.row.wf, stage: r.row.wfStage, stages: r.row.wfStages, ended: r.row.ended });
|
|
@@ -33,7 +33,8 @@ const finish = async (code) => {
|
|
|
33
33
|
};
|
|
34
34
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
/* three hours ago, but never before today's midnight: the line says "today" at any hour */
|
|
37
|
+
const CHECKED = new Date(Math.max(Date.now() - 3 * 3600e3, new Date().setHours(0, 0, 0, 0))).toISOString();
|
|
37
38
|
const CHANGES = [
|
|
38
39
|
{ key: 'k-move', op: 'move', milestone: 'pilot-live', date: '2026-12-02', why: 'Was Nov 18. Jira moved epic DSC-41 to sprint 24, which ends Dec 1.', src: { kind: 'jira', label: 'Jira, read 2h ago' } },
|
|
39
40
|
{ key: 'k-add', op: 'add', name: 'Partner SSO cut-over', date: '2027-03-15', waits: ['microsite-signin'], why: 'Partner SSO joined the program yesterday. Its ◆ Deliver is Mar 15, 2027.', src: { kind: 'member', label: 'Partner SSO' } },
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.416.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.416.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -188,9 +188,9 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
|
|
|
188
188
|
const I = await open('/premium-initiative.html?id=pa-one&ws=' + encodeURIComponent(B.ws) + '&board=' + encodeURIComponent(B.id));
|
|
189
189
|
const ip = I.page;
|
|
190
190
|
const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
|
|
191
|
-
const landed = await until(() => ip.evaluate(() => { const q = new URLSearchParams(location.search); return location.pathname === '/premium.html' && q.get('ini') === 'pa-one' && !!q.get('ws') && !!q.get('board') && !!document.querySelector('
|
|
191
|
+
const landed = await until(() => ip.evaluate(() => { const q = new URLSearchParams(location.search); return location.pathname === '/premium.html' && q.get('ini') === 'pa-one' && !!q.get('ws') && !!q.get('board') && !!document.querySelector('#czViewer .iv-sc'); }), 60000);
|
|
192
192
|
ok('I0 the expand link lands on Home with the initiative selected, ws and board kept', !!landed, await ip.evaluate(() => location.href));
|
|
193
|
-
await ip.click('#czViewer .
|
|
193
|
+
await ip.click('#czViewer [data-cz-vw="more"]').then(() => ip.click('.cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("All tasks"))')); // the initiative's page (canvas HbC): its + drills into Tasks
|
|
194
194
|
await until(() => ip.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 60000);
|
|
195
195
|
await (async (pg) => { if (await pg.$('#czViewer [data-hi-view="stage"]')) await pg.click('#czViewer [data-hi-view="stage"]'); else await viaMore(pg, 'Stage'); })(ip);
|
|
196
196
|
const bar = await until(() => ip.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); if (!v || !v.querySelector('[data-ov-move]')) return null; const cur = v.querySelector('[data-ov-move][aria-pressed="true"]'); return { moves: [...v.querySelectorAll('[data-ov-move]')].map((x) => x.dataset.ovMove), cur: cur ? cur.dataset.ovMove : '', life: [...v.querySelectorAll('[data-ov-life]')].map((x) => x.dataset.ovLife) }; }), 60000);
|
|
@@ -208,7 +208,7 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
|
|
|
208
208
|
await ip.click('#czViewer [data-cz-vw="back"]'); // ← from Stage: the initiative's page again (canvas HbCDrill)
|
|
209
209
|
// the card (stage card D): its last node, the next stage, opens the move popover with Move now and Back; Back always asks for a reason,
|
|
210
210
|
// and the move line carries it (InStage)
|
|
211
|
-
const openNext = async () => { await until(() => ip.evaluate(() => !!document.querySelector('.
|
|
211
|
+
const openNext = async () => { await until(() => ip.evaluate(() => !!document.querySelector('.iv-sc [data-iv-next]')), 30000); await ip.click('.iv-sc [data-iv-next]'); return until(() => ip.evaluate(() => !!document.querySelector('.hi-pop [data-hi-goback]'))); };
|
|
212
212
|
const back = await openNext();
|
|
213
213
|
ok('I4 the card\'s next stage opens Move to the next stage now and Back', back && await ip.evaluate(() => /^Move to .+ now$/.test(((document.querySelector('.hi-pop [data-hi-go]') || {}).textContent || '').trim())));
|
|
214
214
|
if (back) {
|
|
@@ -48,7 +48,8 @@ const look = () => {
|
|
|
48
48
|
tabs: pane ? [(vw.querySelector('.cz-vw-kind') || {}).textContent || ''] : [], pane: pane ? pane.textContent.replace(/\s+/g, ' ').trim() : null,
|
|
49
49
|
secs: pane ? (pane.querySelector('.vz-dkt') ? pane.querySelectorAll('.vz-dkt button').length - 1 : pane.querySelectorAll('.vz-secs li').length) : 0,
|
|
50
50
|
slide: pane && pane.querySelector('.vz-dkn > span') ? pane.querySelector('.vz-dkn > span').textContent : null,
|
|
51
|
-
sched: pane && pane.querySelector('[data-rt="sched"] b') ? pane.querySelector('[data-rt="sched"] b').textContent : null,
|
|
51
|
+
sched: pane && pane.querySelector('[data-rt="sched"] b') ? pane.querySelector('[data-rt="sched"] b').textContent : pane && pane.querySelector('.rp-mc[data-rt="sched"]') ? pane.querySelector('.rp-mc[data-rt="sched"]').textContent : null,
|
|
52
|
+
sum: pane && pane.querySelector('.rp-sum') ? { line: pane.querySelector('.rp-sum .czs-line').textContent, chips: [...pane.querySelectorAll('.rp-sum .rp-mc')].map((c) => c.textContent).join(), pri: (pane.querySelector('.rp-sum .rp-pri') || {}).getAttribute?.('aria-label') || '', seg: [...pane.querySelectorAll('.rp-seg button')].map((b) => b.textContent).join(), folds: [...pane.querySelectorAll('.czs-row')].map((r) => r.textContent).join('|') } : null,
|
|
52
53
|
wide: document.documentElement.scrollWidth > innerWidth + 1 };
|
|
53
54
|
};
|
|
54
55
|
|
|
@@ -80,15 +81,22 @@ const look = () => {
|
|
|
80
81
|
ok('R1 opening the chat opens no tab by itself', s0.tabs.length === 0, JSON.stringify(s0));
|
|
81
82
|
await p.click('#hmLog [data-report-open]');
|
|
82
83
|
const s1 = await until(async () => { const v = await p.evaluate(look); return v.pane ? v : null; }) || await p.evaluate(look);
|
|
83
|
-
ok('R3 the new report
|
|
84
|
-
&& s1.
|
|
84
|
+
ok('R3 the new report opens the one report Viewer in its first state (OvReport): New · from your chat, Not set up yet, Set it up as an icon, the chips Once and the format, Slides | Document, a title slide and seven section slides, the folds At a glance and Structure and look', /Report · Growth leads/.test(s1.tabs.join(' ')) && /Social login weekly/.test(s1.pane || '') && !/Waiting for design/.test(s1.pane || '')
|
|
85
|
+
&& s1.sum && s1.sum.line === 'New · from your chatNot set up yet' && s1.sum.pri === 'Set it up' && s1.sum.chips === 'Once,Google Slides' && s1.sum.seg === 'Slides,Document' && s1.sum.folds === 'At a glanceFor, read by, goes out|Structure and looknew'
|
|
86
|
+
&& /One slide per section: Headline, Timeline/.test(s1.pane || '') && s1.secs === 7 && s1.slide === 'Slide 1 of 8' && s1.sched === 'Once' && !(await p.$('#czViewer .rt, #czViewer .obody, #dlg:not([hidden])')), JSON.stringify(s1));
|
|
87
|
+
await p.click('#czViewer .czs-row[data-czs-fold="glance"]');
|
|
88
|
+
ok('R3 At a glance opens with For, Read by, Goes out and Format', await until(() => p.evaluate(() => /Read byGrowth leads/.test(document.querySelector('#czViewer .czs-sec.on').textContent) && /FormatGoogle Slides/.test(document.querySelector('#czViewer .czs-sec.on').textContent) && /Goes outOff · runs once/.test(document.querySelector('#czViewer .czs-sec.on').textContent))));
|
|
89
|
+
await p.click('#czViewer .czs-row[data-czs-fold="glance"]');
|
|
90
|
+
await p.click('#czViewer [data-rt="view|doc"]');
|
|
91
|
+
ok('R3 Document shows the outline as a page, and Slides brings the deck back', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vz-dkp .vz-secs li').length === 7 && !document.querySelector('#czViewer .vz-dks'))));
|
|
92
|
+
await p.click('#czViewer [data-rt="view|deck"]');
|
|
85
93
|
await p.click('#czViewer [data-rt="sl|1"]');
|
|
86
94
|
ok('R3 next shows the second slide, a section of the report', /Slide 2 of 8/.test((await p.evaluate(look)).slide || '') && /Headline/.test(await p.textContent('#czViewer .vz-dks')));
|
|
87
95
|
if (shots) await p.screenshot({ path: `${shots}/new-1280-light.png` });
|
|
88
96
|
await p.click('#czViewer [data-rt="sched"]');
|
|
89
97
|
await p.click('#czViewer [data-rt="pick|2"]');
|
|
90
|
-
const s2 = await until(async () => { const v = await p.evaluate(look); return v.sched && /
|
|
91
|
-
ok('R3 a pick changes the chip only: nothing is written',
|
|
98
|
+
const s2 = await until(async () => { const v = await p.evaluate(look); return v.sched && /Every week/.test(v.sched) ? v : null; }) || await p.evaluate(look);
|
|
99
|
+
ok('R3 a pick changes the chip only: nothing is written', s2.sched === 'Every week' && !ledger().some((l) => l.ev === 'setup'), JSON.stringify(s2));
|
|
92
100
|
await p.click('#czViewer [data-rt="sched"]'); await p.click('#czViewer [data-rt="pick|0"]');
|
|
93
101
|
await p.click('#czViewer [data-rt="setup"]');
|
|
94
102
|
const s3 = await until(async () => { const v = await p.evaluate(look); return v.pane && /Report template/.test(v.tabs.join()) && /Draft/.test(v.pane) ? v : null; }, 15000) || await p.evaluate(look);
|
|
@@ -118,7 +118,7 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
118
118
|
// the initiative's page (canvas HbC): its list row opens it again when the Viewer shows something else
|
|
119
119
|
const ovOpen = async (p) => { await until(() => p.evaluate(() => !!document.querySelector('#hmList [data-hm-sel^="i:"][aria-current="true"]')), 60000);
|
|
120
120
|
if (!(await p.$('#czViewer:not([hidden]) [data-hi-v="page"]'))) await p.click('#hmList [data-hm-sel^="i:"][aria-current="true"]');
|
|
121
|
-
await until(() => p.evaluate(() => !!document.querySelector('#czViewer
|
|
121
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-hi-v="page"] .iv')), 60000); await p.click('#czViewer [data-cz-vw="more"]').then(() => p.click('.cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("All tasks"))')); // the initiative's page (canvas HbC): its + drills into Tasks
|
|
122
122
|
// the Overview opens on Tasks; the core documents are its Documents view (premium-uncovered-features, canvas InDocs)
|
|
123
123
|
if (await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 30000)) await (async (pg) => { if (await pg.$('#czViewer [data-hi-view="docs"]')) await pg.click('#czViewer [data-hi-view="docs"]'); else await viaMore(pg, 'Documents'); })(p); };
|
|
124
124
|
const I = await open('/premium-initiative.html' + iq), ip = I.page;
|