create-pmos 0.807.0 → 0.808.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 +9 -3
- 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 +8 -2
- package/workspace/guide/layout.md +1 -1
- package/workspace/lib/today-log.js +124 -5
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-today-app.js +9 -0
- package/workspace/public/pm/cozy-today-model.js +3 -1
- package/workspace/public/pm/cozy-today-page.css +5 -0
- package/workspace/public/pm/cozy-today-view.js +20 -1
- package/workspace/test-lists/capture-words-to-fields.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.808.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": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
36
|
{
|
|
37
|
-
"v": "0.
|
|
38
|
-
"at": "2026-11-25T05:
|
|
37
|
+
"v": "0.808.0",
|
|
38
|
+
"at": "2026-11-25T05:36:18.903Z",
|
|
39
39
|
"f": 4,
|
|
40
40
|
"prs": [
|
|
41
41
|
{
|
|
@@ -58,6 +58,12 @@
|
|
|
58
58
|
"t": "Rows no longer show below Today's capture box on a phone",
|
|
59
59
|
"s": "Rows no longer show below Today's capture box on a phone",
|
|
60
60
|
"k": "fix"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"n": 1851,
|
|
64
|
+
"t": "The capture line reads the words — kind, date, time and owner as chips with Undo (job #1845, A535, A538)",
|
|
65
|
+
"s": "The capture line reads the words — kind, date, time and owner as chips with Undo (job #1845, A535, A538)",
|
|
66
|
+
"k": "new"
|
|
61
67
|
}
|
|
62
68
|
]
|
|
63
69
|
},
|
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-25T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T05:36:15Z"}
|
|
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-25T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T05:36:15Z"}
|
|
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-25T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T05:36:15Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"v": "0.
|
|
4
|
-
"at": "2026-11-25T05:
|
|
3
|
+
"v": "0.808.0",
|
|
4
|
+
"at": "2026-11-25T05:36:18.903Z",
|
|
5
5
|
"f": 4,
|
|
6
6
|
"prs": [
|
|
7
7
|
{
|
|
@@ -24,6 +24,12 @@
|
|
|
24
24
|
"t": "Rows no longer show below Today's capture box on a phone",
|
|
25
25
|
"s": "Rows no longer show below Today's capture box on a phone",
|
|
26
26
|
"k": "fix"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"n": 1851,
|
|
30
|
+
"t": "The capture line reads the words — kind, date, time and owner as chips with Undo (job #1845, A535, A538)",
|
|
31
|
+
"s": "The capture line reads the words — kind, date, time and owner as chips with Undo (job #1845, A535, A538)",
|
|
32
|
+
"k": "new"
|
|
27
33
|
}
|
|
28
34
|
]
|
|
29
35
|
},
|
|
@@ -72,7 +72,7 @@ Each row has two lines:
|
|
|
72
72
|
|
|
73
73
|
To use the log:
|
|
74
74
|
|
|
75
|
-
1. Type a task, an event or a note in the first line and press Enter. Start with **o** for an event (add a time, such as 14:00, to put it on the agenda), with **-** for a note, and with **!** for what comes first. Enter only adds the row. It opens nothing and starts no session.
|
|
75
|
+
1. Type a task, an event or a note in the first line and press Enter. Start with **o** for an event (add a time, such as 14:00, to put it on the agenda), with **-** for a note, and with **!** for what comes first. Enter only adds the row. It opens nothing and starts no session. PMOS reads the words of the line. A time or a meeting word makes it an event ("call Ana Friday 3pm"); **note:** in front makes it a note. Day words give it a day — today, tonight, tomorrow, a weekday, next week, "in 3 days", "25 Nov", "Nov 25" or 2026-12-01 — and the day and time words leave the title. A named person the line gives the work to ("Ana to send the deck", "ask Bob to review", "waiting on Priya") becomes its owner, and the row waits on them. What PMOS read shows on the row as chips; the Undo beside them takes the whole reading off and leaves the line as you typed it. A bullet you type (**o**, **-**) wins over the reading. A line for a later day stays on today's log the day you write it, so you can see what PMOS read, and comes back on its day.
|
|
76
76
|
2. Point at a row to see its icons. The first is its job: **Reply**, **Decide** or **Send** opens the item where you do it, and **Done** marks it done. Then come **Move to tomorrow** and **Set a date**. A done row turns grey. Each change shows Undo for a moment. Before the log draws again, the row shows a short cue for about half a second, so you see which row changed: a done row turns green and slides out, a row you move to another day slides out to the side, and a dropped row fades. Today's check does the same. When your system asks for reduced motion, nothing moves: the row only keeps its colour for a moment.
|
|
77
77
|
3. Press a row, or an event in the agenda, to open that one item in the popup. An ask opens that one mention, not the list of mentions. A task opens its initiative at that task, with the task's row lit, and the task itself in a small popup on top; Esc closes only the small popup. A check ("did it work?") opens its initiative. With the popup open, press **j** or **k** (or **↓** and **↑** in an ask) to open the next or the previous row in its place.
|
|
78
78
|
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* log's own line, so the row keeps its × for the rest of the day.
|
|
13
13
|
*
|
|
14
14
|
* parseEntry(text) → { bullet: 'task' | 'event' | 'note', text, first, time } | null PURE
|
|
15
|
+
* readWords(text, { day }) → { bullet, text, first, time, for, owner, waiting, read: [field] } | null PURE, rules only
|
|
16
|
+
* (capture-words-to-fields): the kind, the date, the time and the owner the words name
|
|
15
17
|
* fold(lines, day) → { entries, marks } PURE. entries: open own entries of `day` and of the days before it
|
|
16
18
|
* (carried), and the ones done on `day`; marks: { [key]: { done?, until?, dropped?, kept? } }
|
|
17
19
|
* addEvent(body, day, id) → { event } | { error } PURE: the line POST /api/today-log/add appends
|
|
@@ -30,12 +32,122 @@ const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
|
30
32
|
const KEY_RE = /^[A-Za-z0-9][A-Za-z0-9._:@/+-]{0,199}$/;
|
|
31
33
|
const ID_RE = /^tl-[0-9a-z]{6,20}$/;
|
|
32
34
|
const BULLETS = ['task', 'event', 'note'];
|
|
33
|
-
const ACTS = ['done', 'undone', 'later', 'now', 'drop', 'undrop', 'keep'];
|
|
35
|
+
const ACTS = ['done', 'undone', 'later', 'now', 'drop', 'undrop', 'keep', 'plain']; // plain: take the rules' reading off an own entry (capture-words-to-fields)
|
|
34
36
|
const MAX_TEXT = 240;
|
|
35
37
|
const SNAP = ['title', 'work', 'job'];
|
|
38
|
+
const READ = ['kind', 'date', 'time', 'owner']; // the fields the rules may read from the words (capture-words-to-fields)
|
|
36
39
|
const FIX_MAX = 3; // quiet-rows: at most 3 line rows a day per product
|
|
37
40
|
const WS_RE = /^[A-Za-z0-9._:@/+-]{0,120}$/;
|
|
38
41
|
|
|
42
|
+
/* ── capture-words-to-fields (job #1845, ideas A535, A538): the words decide the fields ──
|
|
43
|
+
* A typed line is read by RULES ONLY — no model call, nothing sent. The reading is shown as chips the PM can take off (the mark `plain`),
|
|
44
|
+
* so a wrong reading costs one press. What the rules read:
|
|
45
|
+
* kind a time or a meeting word makes it an event ("call Ana Friday 3pm"); "note" or "idea" in front makes it a note; else a task
|
|
46
|
+
* date today · tonight · tomorrow · a weekday ("Friday", "next Monday") · "in 3 days" · "next week" · "25 Nov" · "Nov 25" · 2026-12-01
|
|
47
|
+
* time "3pm", "3.30pm", "15:00", "9.15", "at 9"
|
|
48
|
+
* owner a named person the line gives the work to: "Ana to send the deck", "ask Ana to …", "waiting on Ana", "Ana will …", "chase Ana"
|
|
49
|
+
* → owner Ana and `waiting: true`, the waiting-on row
|
|
50
|
+
* The date and time words are taken out of the text (the chips hold them); the owner's words stay, because the line reads as written. */
|
|
51
|
+
const WEEK = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
|
|
52
|
+
const MEET = /\b(meeting|meet|call|lunch|coffee|sync|standup|stand-up|1:1|one-on-one|interview|demo|review with|catch ?up|dinner|breakfast)\b/i;
|
|
53
|
+
const NOTE_RE = /^(?:note|idea|thought)s?\s*[:\-–]\s*/i;
|
|
54
|
+
/* The words that are never a person's name, however they are capitalized: the line starts with them often enough that without this list
|
|
55
|
+
* "Call Ana" would read Call as the owner. */
|
|
56
|
+
const NOT_NAME = new Set(['the', 'a', 'an', 'i', 'we', 'ask', 'call', 'email', 'send', 'write', 'draft', 'check', 'chase', 'review', 'read', 'fix', 'plan', 'book', 'buy', 'pay', 'tell', 'talk', 'move', 'start',
|
|
57
|
+
'finish', 'ship', 'note', 'idea', 'today', 'tonight', 'tomorrow', 'next', 'this', 'waiting', 'wait', 'need', 'needs', 'let', 'make', 'get', 'go', 'do', 'it', 'they', 'he', 'she', 'everyone', 'team', 'all', ...WEEK]);
|
|
58
|
+
const NAME = '([A-Z][a-z]+(?:\\s[A-Z][a-z]+)?)';
|
|
59
|
+
const OWNER_RES = [
|
|
60
|
+
new RegExp('^(?:ask|chase|remind|ping|nudge)\\s+' + NAME + '\\s+(?:to|for|about)\\b', ''),
|
|
61
|
+
new RegExp('^' + NAME + '\\s+(?:to|will|owes|is sending|is to)\\b', ''),
|
|
62
|
+
new RegExp('\\bwaiting (?:on|for)\\s+' + NAME, ''),
|
|
63
|
+
new RegExp('\\b(?:from|with)\\s+' + NAME + '\\s+(?:by|before|on)\\b', ''),
|
|
64
|
+
];
|
|
65
|
+
const addDays = (day, n) => { const d = new Date(day + 'T00:00:00Z'); d.setUTCDate(d.getUTCDate() + n); return d.toISOString().slice(0, 10); };
|
|
66
|
+
const MONTHS = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
|
67
|
+
|
|
68
|
+
/** The date the words name, and the words to take out. day = the PM's local day. PURE → { date, cut } | null */
|
|
69
|
+
function dateWords(t, day) {
|
|
70
|
+
if (!DAY_RE.test(String(day || ''))) return null;
|
|
71
|
+
const take = (re, to) => { const m = re.exec(t); return m ? { date: to(m), cut: m[0] } : null; };
|
|
72
|
+
const iso = take(/(?:^|\s)(\d{4}-\d{2}-\d{2})(?=\s|$)/, (m) => m[1]);
|
|
73
|
+
if (iso && DAY_RE.test(iso.date)) return iso;
|
|
74
|
+
const dm = take(new RegExp('(?:^|\\s)(?:on\\s+)?(\\d{1,2})\\s*(' + MONTHS.join('|') + ')[a-z]*(?=\\s|$)', 'i'), (m) => ({ d: +m[1], mo: MONTHS.indexOf(m[2].toLowerCase()) }))
|
|
75
|
+
|| take(new RegExp('(?:^|\\s)(?:on\\s+)?(' + MONTHS.join('|') + ')[a-z]*\\s+(\\d{1,2})(?=\\s|$)', 'i'), (m) => ({ d: +m[2], mo: MONTHS.indexOf(m[1].toLowerCase()) }));
|
|
76
|
+
if (dm) {
|
|
77
|
+
const y = +day.slice(0, 4), mo = dm.date.mo, d = dm.date.d;
|
|
78
|
+
if (mo >= 0 && d >= 1 && d <= 31) {
|
|
79
|
+
let iso2 = y + '-' + String(mo + 1).padStart(2, '0') + '-' + String(d).padStart(2, '0');
|
|
80
|
+
if (iso2 < day) iso2 = (y + 1) + iso2.slice(4); // a month already gone means next year
|
|
81
|
+
return { date: iso2, cut: dm.cut };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const soon = take(/(?:^|\s)(today|tonight|tomorrow|tmr|next week)(?=\s|$)/i, (m) => m[1].toLowerCase());
|
|
85
|
+
if (soon) return { date: soon.date === 'next week' ? addDays(day, 7) : soon.date === 'tomorrow' || soon.date === 'tmr' ? addDays(day, 1) : day, cut: soon.cut };
|
|
86
|
+
const inn = take(/(?:^|\s)in\s+(\d{1,2})\s+days?(?=\s|$)/i, (m) => +m[1]);
|
|
87
|
+
if (inn && inn.date >= 1 && inn.date <= 60) return { date: addDays(day, inn.date), cut: inn.cut };
|
|
88
|
+
const wd = take(new RegExp('(?:^|\\s)(?:(next)\\s+)?(?:on\\s+)?(' + WEEK.join('|') + '|mon|tue|tues|wed|thu|thur|thurs|fri|sat|sun)(?=\\s|$)', 'i'), (m) => m);
|
|
89
|
+
if (wd) {
|
|
90
|
+
const w = wd.date[2].toLowerCase(), i = WEEK.findIndex((x) => x.startsWith(w.slice(0, 3)));
|
|
91
|
+
const from = new Date(day + 'T00:00:00Z').getUTCDay();
|
|
92
|
+
let ahead = (i - from + 7) % 7 || 7; // "Friday" on a Friday means the next one
|
|
93
|
+
if (wd.date[1]) ahead += ahead <= 6 && i !== from ? 0 : 0; // "next Friday" is the same Friday when this week's has gone
|
|
94
|
+
return { date: addDays(day, ahead), cut: wd.cut };
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** The time the words name, and the words to take out. PURE → { time, cut } | null */
|
|
100
|
+
function timeWords(t) {
|
|
101
|
+
let m = /(?:^|\s)(?:at\s+)?(1[0-2]|0?[1-9])(?:[:.]([0-5]\d))?\s*([ap])\.?m\.?(?=\s|$)/i.exec(t);
|
|
102
|
+
if (m) { let h = +m[1] % 12; if (/p/i.test(m[3])) h += 12; return { time: String(h).padStart(2, '0') + ':' + (m[2] || '00'), cut: m[0] }; }
|
|
103
|
+
m = /(?:^|\s)(?:at\s+)?([01]?\d|2[0-3])[:.]([0-5]\d)(?=\s|$)/.exec(t);
|
|
104
|
+
if (m) return { time: String(m[1]).padStart(2, '0') + ':' + m[2], cut: m[0] };
|
|
105
|
+
m = /(?:^|\s)at\s+([01]?\d|2[0-3])(?=\s|$)/.exec(t);
|
|
106
|
+
if (m) return { time: String(m[1]).padStart(2, '0') + ':00', cut: m[0] };
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** The person the line gives the work to. PURE → name | '' */
|
|
111
|
+
function ownerWords(t) {
|
|
112
|
+
for (const re of OWNER_RES) {
|
|
113
|
+
const m = re.exec(t);
|
|
114
|
+
if (!m) continue;
|
|
115
|
+
const name = m[1].trim();
|
|
116
|
+
if (!NOT_NAME.has(name.split(' ')[0].toLowerCase())) return name.slice(0, 60);
|
|
117
|
+
}
|
|
118
|
+
return '';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Take the words out, with the preposition that only led to them ("by Friday", "due 25 Nov"). PURE */
|
|
122
|
+
function cutOut(t, cut) {
|
|
123
|
+
const at = t.indexOf(cut);
|
|
124
|
+
if (at < 0) return t;
|
|
125
|
+
const before = t.slice(0, at).replace(/\s+(by|on|due|before|from|until|till)\s*$/i, ' ');
|
|
126
|
+
return (before + ' ' + t.slice(at + cut.length)).replace(/\s+/g, ' ').trim();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** The whole reading of one typed line. PURE → { bullet, text, first, time, for, owner, waiting, read: [field] } | null
|
|
130
|
+
* `for` is the day the line is for when the words name a later day ('' otherwise); `read` names the fields the words gave, for the chips. */
|
|
131
|
+
function readWords(text, { day } = {}) {
|
|
132
|
+
const e = parseEntry(text);
|
|
133
|
+
if (!e) return null;
|
|
134
|
+
let t = e.text, bullet = e.bullet, time = e.time, read = [];
|
|
135
|
+
const typed = /^\s*!?\s*[o○•\-–—]\s/.test(String(text == null ? '' : text)); // a typed bullet is the PM's word, not the rules'
|
|
136
|
+
if (!typed && NOTE_RE.test(t)) { bullet = 'note'; t = t.replace(NOTE_RE, '').trim(); read.push('kind'); }
|
|
137
|
+
const D = dateWords(t, day);
|
|
138
|
+
if (D) t = cutOut(t, D.cut);
|
|
139
|
+
const T = time ? null : timeWords(t);
|
|
140
|
+
if (T) { t = cutOut(t, T.cut); time = T.time; }
|
|
141
|
+
if (!typed && bullet !== 'note' && (time || (D && MEET.test(t)))) { if (bullet !== 'event') read.push('kind'); bullet = 'event'; }
|
|
142
|
+
const owner = ownerWords(t);
|
|
143
|
+
if (!t) return e; // the words were only a date: the line as typed stands
|
|
144
|
+
if (D) read.push('date');
|
|
145
|
+
if (T) read.push('time');
|
|
146
|
+
if (owner) read.push('owner');
|
|
147
|
+
const forDay = D && DAY_RE.test(String(day || '')) && D.date > day ? D.date : '';
|
|
148
|
+
return { bullet, text: t.slice(0, MAX_TEXT), first: e.first, time: bullet === 'event' ? time : null, for: forDay, owner, waiting: !!owner, read };
|
|
149
|
+
}
|
|
150
|
+
|
|
39
151
|
/** One line the PM typed. A leading "!" marks it first; "o " or "○ " makes it an event, "- " or "– " a note, "• " or nothing a task.
|
|
40
152
|
* An event's time ("10:30", "9.15", "14:00") is read from its words and kept apart. */
|
|
41
153
|
function parseEntry(text) {
|
|
@@ -60,11 +172,13 @@ function parseEntry(text) {
|
|
|
60
172
|
function addEvent(body, day, id) {
|
|
61
173
|
if (!DAY_RE.test(String(day || ''))) return { error: 'day is YYYY-MM-DD' };
|
|
62
174
|
if (!ID_RE.test(String(id || ''))) return { error: 'bad id' };
|
|
63
|
-
const e =
|
|
175
|
+
const e = readWords(body && body.text, { day });
|
|
64
176
|
if (!e) return { error: 'write the task, the event or the note first' };
|
|
65
177
|
if (body.bullet != null && !BULLETS.includes(body.bullet)) return { error: 'bullet is task, event or note' };
|
|
66
178
|
const bullet = body.bullet || e.bullet;
|
|
67
|
-
|
|
179
|
+
const read = body.bullet ? (e.read || []).filter((f) => f !== 'kind') : (e.read || []); // a bullet the page sent wins over the rules
|
|
180
|
+
return { event: { event: 'added', id, day, bullet, text: e.text, first: !!(body.first || e.first), time: bullet === 'event' ? e.time : null,
|
|
181
|
+
...(e.for ? { for: e.for } : {}), ...(e.owner ? { owner: e.owner, waiting: !!e.waiting } : {}), ...(read.length ? { read } : {}) } };
|
|
68
182
|
}
|
|
69
183
|
|
|
70
184
|
/** The line POST /api/today-log/mark appends. body: { key, act, day, until? (later), snap? { title, work, job } (done: what the row
|
|
@@ -111,7 +225,8 @@ function fold(lines, day) {
|
|
|
111
225
|
// quiet-rows: the day's line rows per product; only the day asked for, the latest line of a product wins
|
|
112
226
|
if (ev.event === 'fix') { if (ev.day === d && Array.isArray(ev.keys) && WS_RE.test(String(ev.ws == null ? '' : ev.ws))) fixed[String(ev.ws || '')] = ev.keys.filter((k) => KEY_RE.test(String(k))).slice(0, FIX_MAX); continue; }
|
|
113
227
|
if (ev.event === 'added' && ID_RE.test(String(ev.id || '')) && BULLETS.includes(ev.bullet)) {
|
|
114
|
-
own.set(ev.id, { id: ev.id, key: 'own:' + ev.id, bullet: ev.bullet, text: String(ev.text || ''), first: !!ev.first, time: ev.time || null, day: ev.day, at: ev.at || null
|
|
228
|
+
own.set(ev.id, { id: ev.id, key: 'own:' + ev.id, bullet: ev.bullet, text: String(ev.text || ''), first: !!ev.first, time: ev.time || null, day: ev.day, at: ev.at || null,
|
|
229
|
+
for: DAY_RE.test(String(ev.for || '')) ? ev.for : '', owner: String(ev.owner || '').slice(0, 60), waiting: !!ev.waiting, read: Array.isArray(ev.read) ? ev.read.filter((f) => READ.includes(f)) : [] });
|
|
115
230
|
continue;
|
|
116
231
|
}
|
|
117
232
|
if (ev.event !== 'mark' || !KEY_RE.test(String(ev.key || '')) || !ACTS.includes(ev.act)) continue;
|
|
@@ -123,6 +238,7 @@ function fold(lines, day) {
|
|
|
123
238
|
else if (ev.act === 'drop') m.dropped = ev.day;
|
|
124
239
|
else if (ev.act === 'undrop') delete m.dropped;
|
|
125
240
|
else if (ev.act === 'keep') m.kept = ev.day;
|
|
241
|
+
else if (ev.act === 'plain') m.plain = ev.day;
|
|
126
242
|
}
|
|
127
243
|
// a done mark of an earlier day is history: the row is gone from today's log (an own entry), or it is back as its source says
|
|
128
244
|
for (const k of Object.keys(marks)) { const m = marks[k]; if (m.done && m.done !== d) { m.doneBefore = m.done; delete m.done; delete m.snap; } if (!Object.keys(m).length) delete marks[k]; }
|
|
@@ -131,6 +247,9 @@ function fold(lines, day) {
|
|
|
131
247
|
const m = marks[e.key] || {};
|
|
132
248
|
if (m.dropped) continue;
|
|
133
249
|
if (m.doneBefore && !m.done) continue;
|
|
250
|
+
if (m.plain) { entries.push({ ...e, bullet: e.bullet === 'note' ? 'note' : 'task', time: null, for: '', owner: '', waiting: false, read: [], done: !!m.done }); continue; }
|
|
251
|
+
// the words named a later day: the line shows on the day it was typed (its chips and the Undo) and from that day on, not in between
|
|
252
|
+
if (e.for && e.for > d && e.day !== d) continue;
|
|
134
253
|
entries.push({ ...e, done: !!m.done });
|
|
135
254
|
}
|
|
136
255
|
return { entries, marks, fixed };
|
|
@@ -146,4 +265,4 @@ function appendLine(file, line, now = new Date()) {
|
|
|
146
265
|
fs.appendFileSync(file, JSON.stringify({ ...line, at: now.toISOString() }) + '\n');
|
|
147
266
|
}
|
|
148
267
|
|
|
149
|
-
module.exports = { DAY_RE, KEY_RE, BULLETS, ACTS, FIX_MAX, parseEntry, addEvent, markEvent, fixEvent, fold, readLines, appendLine };
|
|
268
|
+
module.exports = { DAY_RE, KEY_RE, BULLETS, ACTS, FIX_MAX, READ, parseEntry, readWords, dateWords, timeWords, ownerWords, addEvent, markEvent, fixEvent, fold, readLines, appendLine };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.808.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.808.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -385,6 +385,14 @@ export function mountToday(ctx) {
|
|
|
385
385
|
ctx.toast('Kept. PMOS will not suggest it again for a month.');
|
|
386
386
|
return after(false);
|
|
387
387
|
}
|
|
388
|
+
/** capture-words-to-fields: take PMOS's reading off this line. The line keeps the words the PM typed; the kind, the date, the time and
|
|
389
|
+
* the owner go. One press, and nothing else changes. */
|
|
390
|
+
async function plain(r) {
|
|
391
|
+
const m = await mark(r.key, 'plain');
|
|
392
|
+
if (!m.ok) return ctx.toast('The reading stayed: ' + m.error + '.');
|
|
393
|
+
ctx.toast('PMOS’s reading is off. The line is as you typed it.');
|
|
394
|
+
return after(true);
|
|
395
|
+
}
|
|
388
396
|
async function lab(r, yes) {
|
|
389
397
|
const f = r.ref || {};
|
|
390
398
|
const res = await ctx.pmPost(yes ? '/api/lab/keep' : '/api/lab/drop', { ws: f.ws || undefined, id: f.id }).catch(() => null);
|
|
@@ -557,6 +565,7 @@ export function mountToday(ctx) {
|
|
|
557
565
|
else if (act === 'tomorrow') await later(r, TM.addDays(day(), 1));
|
|
558
566
|
else if (act === 'drop') await drop(r);
|
|
559
567
|
else if (act === 'keep') await keep(r);
|
|
568
|
+
else if (act === 'plain') await plain(r);
|
|
560
569
|
else if (act === 'lab-keep' || act === 'lab-drop') await lab(r, act === 'lab-keep');
|
|
561
570
|
else if (act === 'lk-yes' || act === 'lk-no') await looks(r, act === 'lk-yes');
|
|
562
571
|
else if (act === 'same-yes' || act === 'same-no') await same(r, act === 'same-yes');
|
|
@@ -245,8 +245,10 @@ export function logModel(o = {}) {
|
|
|
245
245
|
for (const e of o.own || []) {
|
|
246
246
|
if (!e || !e.key) continue;
|
|
247
247
|
const carried = e.day && e.day < today && !e.done ? between(e.day, today) : 0;
|
|
248
|
+
// capture-words-to-fields: the fields the words gave ride along as chips (read), with the owner the line waits on
|
|
248
249
|
put({ key: e.key, src: 'own', bullet: e.bullet, first: !!e.first, title: e.text, job: e.bullet === 'task' ? 'Do' : '', carried, late: carried >= LATE_DAYS,
|
|
249
|
-
when: whenWord({ carried, time: e.bullet === 'event' && !carried ? e.time : '' }, today)
|
|
250
|
+
when: whenWord({ carried, time: e.bullet === 'event' && !carried ? e.time : '' }, today) || (e.for && e.for > today ? (e.for === addDays(today, 1) ? 'Tomorrow' : dm(e.for, today)) : ''),
|
|
251
|
+
owner: e.owner || '', waiting: !!e.waiting, read: Array.isArray(e.read) ? e.read : [], forDay: e.for || '', done: !!e.done, ref: e });
|
|
250
252
|
}
|
|
251
253
|
for (const f of o.lab || []) if (f && f.id) put({ key: 'lab:' + (f.ws || '') + ':' + f.id, src: 'lab', bullet: 'lab', title: f.title, work: '', job: 'Decide', why: f.why || '', ref: f });
|
|
252
254
|
// open-questions-today (A420): the register (GET /api/open-questions) is the Decide tab's two groups; a line waiting on the PM whose
|
|
@@ -48,6 +48,11 @@ button.td-t:focus-visible, .td-ln:focus-visible, .td-evl:focus-visible { outline
|
|
|
48
48
|
.td-li.hd .acts { display: flex; } /* Undo on every handled row */
|
|
49
49
|
.td-did { display: inline-flex; align-items: center; gap: 2px; margin-right: var(--space-8); color: var(--blue); font-weight: var(--fw-strong); }
|
|
50
50
|
.td-did b { font-weight: var(--fw-regular); }
|
|
51
|
+
/* capture-words-to-fields: the chips of what PMOS read from the words, with the Undo that takes the reading off */
|
|
52
|
+
.td-rd { display: inline-flex; align-items: center; gap: var(--space-4); margin-left: var(--space-4); }
|
|
53
|
+
.td-rd .pm-badge { color: var(--muted); }
|
|
54
|
+
.td-rd .td-ib { opacity: 0; }
|
|
55
|
+
.td-li:hover .td-rd .td-ib, .td-li:focus-within .td-rd .td-ib { opacity: 1; }
|
|
51
56
|
.rows .td-sg { margin: 2px var(--space-8) var(--space-8) 42px; } /* a Suggestion under its row lines up with the title */
|
|
52
57
|
.td-fold { width: calc(100% - 32px); margin: 0 var(--space-16); }
|
|
53
58
|
.td-fold:last-child { margin-bottom: var(--space-8); }
|
|
@@ -27,6 +27,7 @@ export const I = {
|
|
|
27
27
|
yes: 'M5 12.5l4.5 4.5L19 7.5', no: 'M6 6l12 12M18 6L6 18', cal: 'M4 5.5h16v14H4zM4 10h16M8.5 3.5v4M15.5 3.5v4', more: 'M8 10l4 4 4-4', play: 'M8 5v14l11-7z',
|
|
28
28
|
reply: 'M5 5h14v10H9l-4 4z', decide: 'M12 4l8 8-8 8-8-8z', send: 'M4 12l16-8-6 16-3-7z',
|
|
29
29
|
spark: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z',
|
|
30
|
+
undo: 'M9 14L4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3',
|
|
30
31
|
sun: 'M12 3v2M12 19v2M5 5l1.4 1.4M17.6 17.6L19 19M3 12h2M19 12h2M5 19l1.4-1.4M17.6 6.4L19 5M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8z',
|
|
31
32
|
};
|
|
32
33
|
/** The small sign of each type (one stroke icon). */
|
|
@@ -79,13 +80,15 @@ export function rowHtml(r, o = {}) {
|
|
|
79
80
|
const opens = !r.done && r.src !== 'own' && r.src !== 'gone' && r.src !== 'note';
|
|
80
81
|
const title = opens ? `<button type="button" class="t td-t" data-td="open" data-key="${esc(r.key)}"${r.members ? ` aria-expanded="${!!o.sopen}"` : ''}>${esc(t)}${r.members ? ic(I.more, 14) : ''}</button>` : `<span class="t td-t">${esc(t)}</span>`;
|
|
81
82
|
const first = r.first && !r.done && r.src === 'own' ? '<span class="pm-badge blue">First</span>' : '';
|
|
83
|
+
// capture-words-to-fields: what the words gave, as chips, with the one press that takes the reading off
|
|
84
|
+
const chips = readChips(r);
|
|
82
85
|
// what PMOS did on it, from records (round 3 point 13): a small ✦ with the count; its words on hover and for a screen reader
|
|
83
86
|
const did = r.did && r.did.length && !r.done ? `<span class="td-did" title="${esc('PMOS did: ' + r.did.join('; '))}" aria-label="${esc('PMOS did: ' + r.did.join('; '))}"><b aria-hidden="true">✦</b>${r.did.length}</span>` : '';
|
|
84
87
|
const why = r.member ? '' : whyLine(r);
|
|
85
88
|
const w = why || did ? `<span class="w td-rs">${did}${esc(why)}</span>` : '';
|
|
86
89
|
const late = lateOf(r);
|
|
87
90
|
const row = `<div class="${cls}" data-key="${esc(r.key)}"><span class="td-kind" role="img" aria-label="${esc(kl)}">${ic(kd)}</span><span class="txt">${title}${w}</span>`
|
|
88
|
-
+ `${first}${late ? `<span class="pm-badge alert">${esc(late)}</span>` : ''}${acts ? `<span class="acts td-a">${acts}</span>` : ''}</div>`;
|
|
91
|
+
+ `${first}${chips}${late ? `<span class="pm-badge alert">${esc(late)}</span>` : ''}${acts ? `<span class="acts td-a">${acts}</span>` : ''}</div>`;
|
|
89
92
|
const sug = r.drop ? sugHtml('PMOS suggests: drop it from your log.', ['drop', 'Drop it'], ['keep', 'Keep it'], r.key) : '';
|
|
90
93
|
const lk = r.looks && !r.done ? sugHtml('Looks answered: ' + (r.looks.who ? r.looks.who + ' replied' : 'someone replied') + ' “' + r.looks.text + '”. Close it?', ['lk-yes', 'Yes, close it: it is answered'], ['lk-no', 'No, it still waits on me'], r.key) : '';
|
|
91
94
|
// the same step for N initiatives: PMOS drafts them, he approves once (audit round 2)
|
|
@@ -94,6 +97,22 @@ export function rowHtml(r, o = {}) {
|
|
|
94
97
|
return row + sug + sj + lk + lab;
|
|
95
98
|
}
|
|
96
99
|
|
|
100
|
+
/** The chips of a line PMOS read from the words (capture-words-to-fields): the kind, the date and time, and the person it waits on, each
|
|
101
|
+
* one word; then the Undo that takes the whole reading off and leaves the line as it was typed. '' when the words gave nothing. */
|
|
102
|
+
function readChips(r) {
|
|
103
|
+
if (!r || r.src !== 'own' || r.done || !(r.read || []).length) return '';
|
|
104
|
+
const got = new Set(r.read);
|
|
105
|
+
const ch = [];
|
|
106
|
+
if (got.has('kind')) ch.push(r.bullet === 'event' ? 'Event' : r.bullet === 'note' ? 'Note' : 'Task');
|
|
107
|
+
if (got.has('date') && r.when) ch.push(r.when);
|
|
108
|
+
if (got.has('time') && r.ref && r.ref.time && !(got.has('date') && r.when === r.ref.time)) ch.push(r.ref.time);
|
|
109
|
+
if (got.has('owner') && r.owner) ch.push((r.waiting ? 'Waiting on ' : '') + r.owner);
|
|
110
|
+
if (!ch.length) return '';
|
|
111
|
+
return `<span class="td-rd" role="group" aria-label="${esc('PMOS read: ' + ch.join(', '))}">`
|
|
112
|
+
+ ch.map((c) => `<span class="pm-badge">${esc(c)}</span>`).join('')
|
|
113
|
+
+ ib('plain', 'Undo what PMOS read: keep the line as you typed it', I.undo, r.key, '', 'outline') + '</span>';
|
|
114
|
+
}
|
|
115
|
+
|
|
97
116
|
/** A tracker sync Suggestion (tracker-sync-on-today, board TrackerSyncDesk): ✓ takes Jira's value on all, ✕ keeps PMOS's, the arrow opens
|
|
98
117
|
* the differences, each with its own ✓. x: cozy-today-model.js syncSuggest()[i]. */
|
|
99
118
|
function syncHtml(x) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "capture-words-to-fields (job #1845, A535, A538): Today's capture line reads the kind, the date, the time and the owner from the words, with chips and an Undo. No browser, no network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"capture-words.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"capture-words.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|