create-pmos 0.836.0 → 0.838.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 +124 -47
- 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 +123 -2
- package/workspace/guide/cli.md +29 -0
- package/workspace/guide/home.md +1 -0
- package/workspace/guide/initiatives-and-next-steps.md +8 -0
- package/workspace/guide/layout.md +5 -1
- package/workspace/lib/built-vs-design-http.js +81 -0
- package/workspace/lib/built-vs-design.js +454 -0
- package/workspace/lib/deps-cli.js +47 -2
- package/workspace/lib/features.json +2 -0
- package/workspace/lib/hire-draft.js +4 -3
- package/workspace/lib/initiative-rows.js +3 -0
- package/workspace/lib/meeting-stance.js +199 -0
- package/workspace/lib/needs-providers.js +1 -0
- package/workspace/lib/people-cli.js +44 -1
- package/workspace/lib/pmos-verbs.js +7 -1
- package/workspace/lib/prefs-sync.js +1 -0
- package/workspace/lib/review-cli.js +6 -0
- package/workspace/lib/route-modules.js +3 -0
- package/workspace/lib/routes-meeting-stance.js +43 -0
- package/workspace/lib/routes-pop-work.js +4 -1
- package/workspace/lib/routes-segments.js +47 -0
- package/workspace/lib/routes-surface-moments.js +36 -0
- package/workspace/lib/routes-team-waits.js +39 -2
- package/workspace/lib/segments-cli.js +102 -0
- package/workspace/lib/segments.js +214 -0
- package/workspace/lib/surface-moments.js +185 -0
- package/workspace/lib/team-slips.js +160 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/ask-here-ctx.js +20 -2
- package/workspace/public/pm/ask-here.css +6 -1
- package/workspace/public/pm/ask-here.js +38 -25
- package/workspace/public/pm/bd-backlog.js +34 -5
- package/workspace/public/pm/built-vs-design.css +16 -0
- package/workspace/public/pm/built-vs-design.js +95 -0
- package/workspace/public/pm/cozy-board.css +11 -0
- package/workspace/public/pm/cozy-events-view.js +1 -1
- package/workspace/public/pm/cozy-home.css +10 -0
- package/workspace/public/pm/cozy-pop-work.js +11 -6
- package/workspace/public/pm/cozy-today-app.js +42 -1
- package/workspace/public/pm/cozy-today-model.js +70 -3
- package/workspace/public/pm/cozy-today-view.js +10 -1
- package/workspace/public/pm/goals-ds.js +3 -2
- package/workspace/public/pm/home-chat.js +19 -3
- package/workspace/public/pm/ini-tasks.js +2 -2
- package/workspace/public/pm/meeting-stance.js +113 -0
- package/workspace/public/pm/page-chat.js +2 -1
- package/workspace/public/pm/premium-board.js +2 -0
- package/workspace/public/pm/segments.js +113 -0
- package/workspace/public/pm/team-slips.js +48 -0
- package/workspace/public/premium-board.html +2 -0
- package/workspace/test-lists/built-vs-design.json +9 -0
- package/workspace/test-lists/meeting-stance.json +9 -0
- package/workspace/test-lists/segments.json +9 -0
- package/workspace/test-lists/surface-moments.json +9 -0
- package/workspace/test-lists/team-slips.json +9 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* segments-cli.js — `pmos segments`: a product's user groups and the roadmap items that serve each, the same groups the Segments part on
|
|
3
|
+
* Work shows (idea A327, initiative segments). The store is lib/segments.js (segments.jsonl in the product's records folder).
|
|
4
|
+
*
|
|
5
|
+
* pmos segments list [--json] the groups, most users first, each with its roadmap count; the ✦ line
|
|
6
|
+
* pmos segments draft --name "<group>" --users <n> --source "<connector · what>" [--health 0-100] [--uses "<text>"] [--asks "<text>"]
|
|
7
|
+
* PMOS's draft from a usage or revenue read; refused with no --source
|
|
8
|
+
* pmos segments add --name "<group>" --users <n> [--health …] [--uses …] [--asks …] [--source …] the PM's own group, kept at once
|
|
9
|
+
* pmos segments keep <group> keep a draft
|
|
10
|
+
* pmos segments rename <group> --to "<name>" rename a group (keeps a draft)
|
|
11
|
+
* pmos segments drop <group> hide a group
|
|
12
|
+
* pmos segments undo <group> take back the last change to a group
|
|
13
|
+
* pmos segments tag <group> <initiative> · untag <group> <initiative> the roadmap item serves the group (live initiatives only)
|
|
14
|
+
* every command: [--root <dir>] (default: this repository). <group> is its name or its id (sg_…).
|
|
15
|
+
*
|
|
16
|
+
* Exit codes: 0 done, 1 refused, 2 usage. Nothing is sent. */
|
|
17
|
+
const fs = require('fs');
|
|
18
|
+
const path = require('path');
|
|
19
|
+
const SG = require('./segments.js');
|
|
20
|
+
|
|
21
|
+
const COMMANDS = { segments: ['list', 'draft', 'add', 'keep', 'rename', 'drop', 'undo', 'tag', 'untag'] };
|
|
22
|
+
const USAGE = [
|
|
23
|
+
'usage: pmos segments list|draft|add|keep|rename|drop|undo|tag|untag — the product\'s user groups and the roadmap items that serve each',
|
|
24
|
+
' pmos segments list [--json] the groups, most users first, with their roadmap count; ✦ marks a draft',
|
|
25
|
+
' pmos segments draft --name "Small teams" --users 4120 --source "<connector · what you read>" [--health 0-100] [--uses "…"] [--asks "…"]',
|
|
26
|
+
' pmos segments add --name "Small teams" --users 4120 [--health 0-100] [--uses "…"] [--asks "…"] your own group, kept at once',
|
|
27
|
+
' pmos segments keep|drop|undo <group> keep a draft, hide a group, or take back its last change',
|
|
28
|
+
' pmos segments rename <group> --to "<name>" rename a group; a renamed draft is kept',
|
|
29
|
+
' pmos segments tag|untag <group> <initiative> the roadmap item serves the group',
|
|
30
|
+
'At most ' + SG.MAX_GROUPS + ' groups. Run it in the product\'s repository, or pass --root <dir>.',
|
|
31
|
+
];
|
|
32
|
+
const GROUP = ['json', 'root'];
|
|
33
|
+
const FIELDS = ['json', 'root', 'name', 'users', 'health', 'uses', 'asks', 'source'];
|
|
34
|
+
const ALLOWED = { list: GROUP, draft: FIELDS, add: FIELDS, keep: GROUP, rename: [...GROUP, 'to'], drop: GROUP, undo: GROUP, tag: GROUP, untag: GROUP };
|
|
35
|
+
const ARGS = { list: 0, draft: 0, add: 0, keep: 1, rename: 1, drop: 1, undo: 1, tag: 2, untag: 2 };
|
|
36
|
+
const BOOL = new Set(['json']);
|
|
37
|
+
|
|
38
|
+
function parse(args) {
|
|
39
|
+
const pos = [], flags = {};
|
|
40
|
+
for (let i = 0; i < args.length; i++) {
|
|
41
|
+
const a = args[i];
|
|
42
|
+
if (!a.startsWith('--')) { pos.push(a); continue; }
|
|
43
|
+
const k = a.slice(2);
|
|
44
|
+
if (BOOL.has(k)) { flags[k] = true; continue; }
|
|
45
|
+
flags[k] = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
|
|
46
|
+
}
|
|
47
|
+
return { pos, flags };
|
|
48
|
+
}
|
|
49
|
+
function repoRoot(cwd) { // the nearest folder up from cwd that holds .git; cwd itself when none does
|
|
50
|
+
for (let d = path.resolve(cwd); ; d = path.dirname(d)) {
|
|
51
|
+
if (fs.existsSync(path.join(d, '.git'))) return d;
|
|
52
|
+
if (path.dirname(d) === d) return cwd;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function recordsDirOf(root) {
|
|
56
|
+
try { const { repoScript } = require('./repo-script.js'); return require(repoScript('signals/layout-paths.js')).pathsFor(root).recordsDir; } catch { return path.join(root, 'planning', 'records'); }
|
|
57
|
+
}
|
|
58
|
+
/** The live initiative ids of the product (not stopped, not accepted). */
|
|
59
|
+
function liveOf(root) { try { return require('./list-balance.js').roadmapItems(root).map((x) => x.id); } catch { return []; } }
|
|
60
|
+
|
|
61
|
+
async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), now = Date.now() } = {}) {
|
|
62
|
+
const args = argv[0] === 'segments' ? argv.slice(1) : argv.slice();
|
|
63
|
+
const sub = args[0];
|
|
64
|
+
if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 1; }
|
|
65
|
+
if (!COMMANDS.segments.includes(sub)) { say(`unknown segments command "${sub}". Use one of: ${COMMANDS.segments.join(', ')}`); return 2; }
|
|
66
|
+
const { pos, flags } = parse(args.slice(1));
|
|
67
|
+
for (const k of Object.keys(flags)) if (!ALLOWED[sub].includes(k)) { say(`✗ --${k} is not an option of pmos segments ${sub}`); return 2; }
|
|
68
|
+
if (pos.length !== ARGS[sub]) { say(`✗ pmos segments ${sub} takes ${ARGS[sub] === 0 ? 'options only' : ARGS[sub] === 1 ? 'one group' : 'a group and an initiative'} (pmos segments help)`); return 2; }
|
|
69
|
+
const root = path.resolve(flags.root || repoRoot(cwd));
|
|
70
|
+
const dir = recordsDirOf(root);
|
|
71
|
+
const fail = (error, code = 1) => { say(flags.json ? JSON.stringify({ ok: false, error }) : '✗ ' + error); return code; };
|
|
72
|
+
|
|
73
|
+
if (sub === 'list') {
|
|
74
|
+
const v = SG.view(dir, liveOf(root));
|
|
75
|
+
if (flags.json) { say(JSON.stringify({ ok: true, rows: v.rows, total: v.total, line: v.line })); return 0; }
|
|
76
|
+
if (!v.rows.length) { say('No groups yet. Draft them from a usage or revenue read: pmos segments draft --name "<group>" --users <n> --source "<where>".'); return 0; }
|
|
77
|
+
for (const r of v.rows) {
|
|
78
|
+
say(` ${r.draft ? '✦' : ' '} ${r.name} · ${r.users.toLocaleString('en-US')} users${r.health !== null ? ` · health ${r.health}` : ''} · ${r.roadmap ? r.roadmap + ' roadmap item' + (r.roadmap === 1 ? '' : 's') : 'nothing on the roadmap'} (${r.gid})`);
|
|
79
|
+
const more = [r.uses ? 'uses ' + r.uses : '', r.asks ? 'asks for ' + r.asks : '', r.draft && r.source ? 'from ' + r.source : ''].filter(Boolean).join(' · ');
|
|
80
|
+
if (more) say(' ' + more);
|
|
81
|
+
}
|
|
82
|
+
if (v.line) say('\n✦ ' + v.line.text);
|
|
83
|
+
if (v.rows.some((r) => r.draft)) say('\nKeep or rename a draft: pmos segments keep <group> · pmos segments rename <group> --to "<name>"');
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const o = { ...flags };
|
|
88
|
+
if (sub === 'rename') o.to = flags.to;
|
|
89
|
+
if (ARGS[sub] >= 1) o.gid = pos[0];
|
|
90
|
+
if (sub === 'tag' || sub === 'untag') { o.initiative = pos[1]; if (sub === 'tag') o.live = liveOf(root); }
|
|
91
|
+
const r = SG.act(dir, sub, o, now);
|
|
92
|
+
if (!r.ok) return fail(r.error);
|
|
93
|
+
if (flags.json) { say(JSON.stringify({ ok: true, group: r.group })); return 0; }
|
|
94
|
+
const g = r.group;
|
|
95
|
+
const word = { draft: 'Drafted', add: 'Added', keep: 'Kept', rename: 'Renamed', drop: 'Dropped', undo: 'Undone', tag: 'Tagged', untag: 'Untagged' }[sub];
|
|
96
|
+
say(`✓ ${word}: ${g ? g.name + ' (' + g.gid + ')' : pos[0]}${o.initiative ? ' · ' + o.initiative : ''}. Undo: pmos segments undo ${g ? g.gid : pos[0]}`);
|
|
97
|
+
return 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
module.exports = { run, COMMANDS, USAGE };
|
|
101
|
+
|
|
102
|
+
if (require.main === module) run(process.argv.slice(2)).then((c) => process.exit(c), (e) => { console.error(e); process.exit(1); });
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* segments.js — a product's user groups and the roadmap items that serve each (idea A327, initiative segments; done test
|
|
3
|
+
* planning/done-tests/segments.md; board BatchPlanDS panel 6).
|
|
4
|
+
*
|
|
5
|
+
* A few groups (at most MAX_GROUPS) split the product's users by usage and revenue. Each has a size (users), a health from 0 to 100,
|
|
6
|
+
* what the group uses and what it asks for. Roadmap items (the live initiatives) carry a group tag; the Roadmap column counts them.
|
|
7
|
+
* When one large group gets little of the roadmap, one line says so (say it once).
|
|
8
|
+
*
|
|
9
|
+
* THE FILE: segments.jsonl in the product's records folder (lib/records-dir.js: planning/records in the PMOS repo, pmos/state/records in a
|
|
10
|
+
* kit product). Append-only JSON lines, one event each:
|
|
11
|
+
* { v, at, ev: 'draft', gid, name, users, health?, uses?, asks?, source, by: 'pmos' } PMOS's draft, citing the usage or revenue read
|
|
12
|
+
* { v, at, ev: 'add', gid, name, users, health?, uses?, asks?, source?, by: 'pm' } the PM's own group, kept at once
|
|
13
|
+
* { v, at, ev: 'keep', gid } a draft kept
|
|
14
|
+
* { v, at, ev: 'rename', gid, name } a new name; renaming keeps a draft
|
|
15
|
+
* { v, at, ev: 'drop', gid } hidden
|
|
16
|
+
* { v, at, ev: 'tag', gid, initiative } the initiative serves the group
|
|
17
|
+
* { v, at, ev: 'untag', gid, initiative }
|
|
18
|
+
* { v, at, ev: 'undo', gid } takes back the last event of that group that still stands
|
|
19
|
+
* A draft for a name that already has a group updates that group's numbers (a fresh read), and keeps its state.
|
|
20
|
+
*
|
|
21
|
+
* readLines(dir) · append(dir, line, now?)
|
|
22
|
+
* fold(lines) → [group] group: { gid, name, users, health, uses, asks, source, by, state, tags }
|
|
23
|
+
* state ∈ draft · kept · dropped
|
|
24
|
+
* act(dir, act, o, now?) → { ok, group?, error? } act ∈ draft · add · keep · rename · drop · tag · untag · undo
|
|
25
|
+
* rowsOf(groups, liveIds) → { rows, total } rows: the groups not dropped, most users first, each with roadmap: n
|
|
26
|
+
* (live tagged items); total: the live items tagged with any of them
|
|
27
|
+
* imbalanceOf({ rows, total }) → null | { gid, name, pct, n, total, text }
|
|
28
|
+
* view(dir, liveIds) → { groups, rows, total, line }
|
|
29
|
+
* count(dirs) → kept groups (the health number)
|
|
30
|
+
*
|
|
31
|
+
* THE LINE. A group with SHARE_MIN (30%) or more of all users whose share of the tagged roadmap is a third or less of its user share,
|
|
32
|
+
* with MIN_TAGGED (3) or more tagged items. Only the group with the largest gap is named. No group passes: no line (zero is silence).
|
|
33
|
+
*
|
|
34
|
+
* Nothing here is sent anywhere. Works on any product built with PMOS. Every write logs [segments]. */
|
|
35
|
+
const fs = require('fs');
|
|
36
|
+
const path = require('path');
|
|
37
|
+
const crypto = require('crypto');
|
|
38
|
+
|
|
39
|
+
const TAG = '[segments]';
|
|
40
|
+
const FILE = 'segments.jsonl';
|
|
41
|
+
const MAX_GROUPS = 6;
|
|
42
|
+
const MAX_NAME = 40;
|
|
43
|
+
const MAX_TEXT = 80;
|
|
44
|
+
const MAX_SOURCE = 120;
|
|
45
|
+
const SHARE_MIN = 0.3;
|
|
46
|
+
const MIN_TAGGED = 3;
|
|
47
|
+
const ACTS = Object.freeze(['draft', 'add', 'keep', 'rename', 'drop', 'tag', 'untag', 'undo']);
|
|
48
|
+
const say = (s) => { try { console.log(TAG + ' ' + s); } catch { /* no console */ } };
|
|
49
|
+
|
|
50
|
+
const one = (v, max) => { const s = String(v == null ? '' : v).replace(/\s+/g, ' ').trim(); return s.length > max ? s.slice(0, max - 1).trimEnd() + '…' : s; };
|
|
51
|
+
const gidOf = (name) => 'sg_' + crypto.createHash('sha1').update(one(name, MAX_NAME).toLowerCase()).digest('hex').slice(0, 8);
|
|
52
|
+
const fileOf = (dir) => path.join(dir, FILE);
|
|
53
|
+
|
|
54
|
+
function readLines(dir) {
|
|
55
|
+
if (!dir) return [];
|
|
56
|
+
let text = '';
|
|
57
|
+
try { text = fs.readFileSync(fileOf(dir), 'utf8'); } catch { return []; }
|
|
58
|
+
const out = [];
|
|
59
|
+
for (const l of text.split('\n')) { if (!l.trim()) continue; try { const o = JSON.parse(l); if (o && typeof o === 'object' && ACTS.includes(o.ev) && o.gid) out.push(o); } catch { /* a torn line is skipped */ } }
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function append(dir, line, now = Date.now()) {
|
|
64
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
65
|
+
const l = { v: 1, at: new Date(now).toISOString(), ...line };
|
|
66
|
+
fs.appendFileSync(fileOf(dir), JSON.stringify(l) + '\n');
|
|
67
|
+
return l;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Each group's events that still stand: an undo takes back the last one. */
|
|
71
|
+
function standing(lines) {
|
|
72
|
+
const by = new Map();
|
|
73
|
+
for (const l of lines) {
|
|
74
|
+
if (!by.has(l.gid)) by.set(l.gid, []);
|
|
75
|
+
const st = by.get(l.gid);
|
|
76
|
+
if (l.ev === 'undo') st.pop(); else st.push(l);
|
|
77
|
+
}
|
|
78
|
+
return by;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function fold(lines) {
|
|
82
|
+
const out = [];
|
|
83
|
+
for (const [gid, evs] of standing(lines)) {
|
|
84
|
+
let g = null;
|
|
85
|
+
for (const e of evs) {
|
|
86
|
+
if (e.ev === 'draft' || e.ev === 'add') {
|
|
87
|
+
const nums = { users: Number(e.users) || 0, health: Number.isFinite(e.health) ? e.health : null, uses: e.uses || '', asks: e.asks || '', source: e.source || '' };
|
|
88
|
+
if (!g) g = { gid, name: e.name, by: e.by || (e.ev === 'add' ? 'pm' : 'pmos'), state: e.ev === 'add' ? 'kept' : 'draft', tags: new Set(), ...nums };
|
|
89
|
+
else Object.assign(g, nums);
|
|
90
|
+
} else if (!g) continue;
|
|
91
|
+
else if (e.ev === 'keep') g.state = 'kept';
|
|
92
|
+
else if (e.ev === 'rename') { g.name = e.name; g.state = 'kept'; }
|
|
93
|
+
else if (e.ev === 'drop') g.state = 'dropped';
|
|
94
|
+
else if (e.ev === 'tag') g.tags.add(e.initiative);
|
|
95
|
+
else if (e.ev === 'untag') g.tags.delete(e.initiative);
|
|
96
|
+
}
|
|
97
|
+
if (g) out.push({ ...g, tags: [...g.tags] });
|
|
98
|
+
}
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The fields of a draft or add, checked. → { ok, fields } | { ok: false, error } */
|
|
103
|
+
function fieldsOf(o, { needSource }) {
|
|
104
|
+
const name = one(o.name, MAX_NAME);
|
|
105
|
+
if (!name) return { ok: false, error: 'a group needs a name' };
|
|
106
|
+
const users = Number(o.users);
|
|
107
|
+
if (!Number.isInteger(users) || users < 0) return { ok: false, error: 'users is a whole number, 0 or more' };
|
|
108
|
+
let health = null;
|
|
109
|
+
if (o.health !== undefined && o.health !== null && o.health !== '') {
|
|
110
|
+
health = Number(o.health);
|
|
111
|
+
if (!Number.isFinite(health) || health < 0 || health > 100) return { ok: false, error: 'health is a number from 0 to 100' };
|
|
112
|
+
health = Math.round(health);
|
|
113
|
+
}
|
|
114
|
+
const source = one(o.source, MAX_SOURCE);
|
|
115
|
+
if (needSource && !source) return { ok: false, error: 'a PMOS draft names the usage or revenue read it came from (--source "<connector · what>")' };
|
|
116
|
+
const f = { name, users, uses: one(o.uses, MAX_TEXT), asks: one(o.asks, MAX_TEXT) };
|
|
117
|
+
if (health !== null) f.health = health;
|
|
118
|
+
if (source) f.source = source;
|
|
119
|
+
return { ok: true, fields: f };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** One write. o: { gid?, name?, users?, health?, uses?, asks?, source?, initiative?, live? (the live initiative ids, for a tag) }. */
|
|
123
|
+
function act(dir, a, o = {}, now = Date.now()) {
|
|
124
|
+
if (!ACTS.includes(a)) return { ok: false, error: 'act is one of: ' + ACTS.join(', ') };
|
|
125
|
+
const groups = fold(readLines(dir));
|
|
126
|
+
const find = (ref) => { const r = String(ref || '').trim(); if (!r) return null; const low = r.toLowerCase(); return groups.find((g) => g.gid === r) || groups.find((g) => g.name.toLowerCase() === low) || null; };
|
|
127
|
+
if (a === 'draft' || a === 'add') {
|
|
128
|
+
const f = fieldsOf(o, { needSource: a === 'draft' });
|
|
129
|
+
if (!f.ok) return f;
|
|
130
|
+
const had = find(f.fields.name);
|
|
131
|
+
if (had && had.state === 'dropped' && a === 'draft') return { ok: false, error: `"${had.name}" was dropped; undo the drop to bring it back` };
|
|
132
|
+
if (!had && groups.filter((g) => g.state !== 'dropped').length >= MAX_GROUPS) return { ok: false, error: `a product keeps at most ${MAX_GROUPS} groups; drop one first` };
|
|
133
|
+
const gid = had ? had.gid : gidOf(f.fields.name);
|
|
134
|
+
append(dir, { ev: a, gid, ...f.fields, by: a === 'draft' ? 'pmos' : 'pm' }, now);
|
|
135
|
+
say(`${a} ${gid} "${f.fields.name}" users=${f.fields.users}${f.fields.source ? ' source="' + f.fields.source + '"' : ''}`);
|
|
136
|
+
return { ok: true, group: fold(readLines(dir)).find((g) => g.gid === gid) || null };
|
|
137
|
+
}
|
|
138
|
+
const g = find(o.gid || o.name);
|
|
139
|
+
if (!g) return { ok: false, error: `no group "${o.gid || o.name || ''}" on this product` };
|
|
140
|
+
const line = { ev: a, gid: g.gid };
|
|
141
|
+
if (a === 'keep' && g.state !== 'draft') return { ok: false, error: `"${g.name}" is not a draft` };
|
|
142
|
+
if (a === 'rename') { const name = one(o.to !== undefined ? o.to : o.newName, MAX_NAME); if (!name) return { ok: false, error: 'rename needs the new name' }; line.name = name; }
|
|
143
|
+
if (a === 'drop' && g.state === 'dropped') return { ok: false, error: `"${g.name}" is already dropped` };
|
|
144
|
+
if (a === 'tag' || a === 'untag') {
|
|
145
|
+
const ini = String(o.initiative || '').trim();
|
|
146
|
+
if (!ini) return { ok: false, error: a + ' needs the initiative id' };
|
|
147
|
+
if (g.state === 'dropped') return { ok: false, error: `"${g.name}" is dropped` };
|
|
148
|
+
if (a === 'tag' && Array.isArray(o.live) && !o.live.includes(ini)) return { ok: false, error: `${ini} is not a live initiative of this product` };
|
|
149
|
+
if (a === 'tag' && g.tags.includes(ini)) return { ok: true, group: g };
|
|
150
|
+
if (a === 'untag' && !g.tags.includes(ini)) return { ok: false, error: `${ini} is not tagged "${g.name}"` };
|
|
151
|
+
line.initiative = ini;
|
|
152
|
+
}
|
|
153
|
+
append(dir, line, now);
|
|
154
|
+
say(`${a} ${g.gid} "${g.name}"${line.initiative ? ' ' + line.initiative : ''}${line.name ? ' → "' + line.name + '"' : ''}`);
|
|
155
|
+
return { ok: true, group: fold(readLines(dir)).find((x) => x.gid === g.gid) || null };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function rowsOf(groups, liveIds) {
|
|
159
|
+
const live = new Set(liveIds || []);
|
|
160
|
+
const shown = groups.filter((g) => g.state !== 'dropped');
|
|
161
|
+
const all = new Set();
|
|
162
|
+
const rows = shown.map((g) => {
|
|
163
|
+
const items = g.tags.filter((t) => live.has(t));
|
|
164
|
+
items.forEach((t) => all.add(t));
|
|
165
|
+
return { gid: g.gid, name: g.name, users: g.users, health: g.health, uses: g.uses, asks: g.asks, source: g.source, draft: g.state === 'draft', roadmap: items.length, items };
|
|
166
|
+
});
|
|
167
|
+
rows.sort((a, b) => b.users - a.users || a.name.localeCompare(b.name));
|
|
168
|
+
return { rows, total: all.size };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function imbalanceOf({ rows, total }) {
|
|
172
|
+
if (!Array.isArray(rows) || rows.length < 2 || !(total >= MIN_TAGGED)) return null;
|
|
173
|
+
const U = rows.reduce((s, r) => s + (r.users || 0), 0);
|
|
174
|
+
if (U <= 0) return null;
|
|
175
|
+
let best = null;
|
|
176
|
+
for (const r of rows) {
|
|
177
|
+
const us = r.users / U, is = r.roadmap / total;
|
|
178
|
+
if (us < SHARE_MIN || is > us / 3) continue;
|
|
179
|
+
const gap = us - is;
|
|
180
|
+
if (!best || gap > best.gap) best = { r, gap, us };
|
|
181
|
+
}
|
|
182
|
+
if (!best) return null;
|
|
183
|
+
const pct = Math.round(best.us * 100), n = best.r.roadmap;
|
|
184
|
+
return { gid: best.r.gid, name: best.r.name, pct, n, total, text: `${best.r.name} are ${pct}% of users and get ${n === 0 ? 'none' : n} of the ${total} roadmap items.` };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function view(dir, liveIds) {
|
|
188
|
+
const groups = fold(readLines(dir));
|
|
189
|
+
const r = rowsOf(groups, liveIds);
|
|
190
|
+
return { groups, rows: r.rows, total: r.total, line: imbalanceOf(r), offer: offerOf(groups, liveIds) };
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** The ✦ offer on Work when the product has no group yet (LINE.md Rule 12: the part shows by itself, never only on a typed ask): it has
|
|
194
|
+
* MIN_TAGGED live roadmap items or more and no group ever drafted, added or dropped. Fewer items, or any group at all: null (silence). */
|
|
195
|
+
function offerOf(groups, liveIds) {
|
|
196
|
+
const items = new Set((liveIds || []).map(String)).size;
|
|
197
|
+
return !(groups || []).length && items >= MIN_TAGGED ? { items } : null;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function count(dirs) {
|
|
201
|
+
let n = 0;
|
|
202
|
+
for (const d of dirs || []) n += fold(readLines(d)).filter((g) => g.state === 'kept').length;
|
|
203
|
+
return n;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
module.exports = { TAG, FILE, MAX_GROUPS, SHARE_MIN, MIN_TAGGED, ACTS, gidOf, readLines, append, fold, act, rowsOf, imbalanceOf, offerOf, view, count };
|
|
207
|
+
|
|
208
|
+
if (require.main === module) {
|
|
209
|
+
if (process.argv[2] !== 'count') { console.error('usage: node workspace/lib/segments.js count [<product checkout>] (the groups the PM kept)'); process.exit(2); }
|
|
210
|
+
const root = process.argv[3] || process.cwd();
|
|
211
|
+
let dir = null;
|
|
212
|
+
try { const { repoScript } = require('./repo-script.js'); dir = require(repoScript('signals/layout-paths.js')).pathsFor(root).recordsDir; } catch { dir = path.join(root, 'planning', 'records'); }
|
|
213
|
+
console.log(String(count([dir])));
|
|
214
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* surface-moments.js — five features that show by themselves in Your move on Today when the PM's own data says it is time (initiative surface-moments,
|
|
3
|
+
* job #1985; LINE.md Rule 12, board SfA on Exploring 3 page surface). Each was reachable only by a typed ask. The chat and the `pmos` verbs stay
|
|
4
|
+
* as the fallback. lib/routes-surface-moments.js is the HTTP side; pm/cozy-today-model.js finds the calendar and Today-line moments and draws the rows.
|
|
5
|
+
*
|
|
6
|
+
* rowsOf({ ws, today, minutes, away, worth, hire, steer }) PURE → [row] one row per moment whose condition is true; [] when none is
|
|
7
|
+
* row { key, kind, title, why, label, act } label: the ✓ button's words for a screen reader; act: what POST /api/surface-moments takes
|
|
8
|
+
* minutes time-box-pick result for a free gap (lib/time-box-pick.js pick): a row only when something fits (I have N minutes, #1875)
|
|
9
|
+
* away { day, word, set }: leave on the calendar or a Today line within 7 days; no row while already away (away days, #1856)
|
|
10
|
+
* worth worth-it rows (lib/worth-it.js worthOf) and the kinds already off: one row per flagged kind still on (AI worth, #1886)
|
|
11
|
+
* hire { pick, recent }: hire-draft's pick (lib/hire-draft.js gapOf) and the briefs drafted in 14 days (next hire, #1880)
|
|
12
|
+
* steer { program: { id, title }, day, word }: a steering meeting for a program within 2 working days (steering pack, #1847)
|
|
13
|
+
* read(ctx, w, q) → rowsOf over what PMOS holds now. READ-ONLY: it writes nothing and sends nothing.
|
|
14
|
+
* act(ctx, w, body) → { ok, said, file?, undo? } | { ok: false, error } the PM's ✓ (or its Undo); lib/routes-surface-moments.js calls it only
|
|
15
|
+
* after pm-guard requirePagePress. Every press logs [moments] and one momentAct use-log line.
|
|
16
|
+
*
|
|
17
|
+
* WHAT ✓ DOES. minutes: nothing is written; the row opens the item. away: sets the away days and drafts the handover note (Undo: back).
|
|
18
|
+
* worth: pauses that kind of AI run in Settings (Undo: on). hire: drafts the role brief (Undo: the new draft is removed). steer: drafts the
|
|
19
|
+
* one-page steering pack into planning/steering/ (Undo: the new draft is removed). A draft the PM already has is never written over or removed.
|
|
20
|
+
* Nothing here calls a model or sends anything. */
|
|
21
|
+
const fs = require('fs');
|
|
22
|
+
const path = require('path');
|
|
23
|
+
|
|
24
|
+
const TAG = '[moments]';
|
|
25
|
+
const GAP_MIN = 15, GAP_MAX = 90;
|
|
26
|
+
const AWAY_DAYS = 7, HIRE_DAYS = 14;
|
|
27
|
+
const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
28
|
+
const KINDS = ['minutes', 'away', 'worth', 'hire', 'steer'];
|
|
29
|
+
const pct = (r) => Math.round((Number(r) || 0) * 100) + '%';
|
|
30
|
+
const one = (v, n = 120) => { const s = String(v == null ? '' : v).replace(/\s+/g, ' ').trim(); return s.length > n ? s.slice(0, n - 1).trimEnd() + '…' : s; };
|
|
31
|
+
const localDay = (ms = Date.now()) => { const d = new Date(ms); return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0'); };
|
|
32
|
+
const dn = (d) => { const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(d || '')); return m ? Math.round(Date.UTC(+m[1], +m[2] - 1, +m[3]) / 864e5) : null; };
|
|
33
|
+
const log = (s) => { try { console.log(TAG + ' ' + s); } catch { /* no console */ } };
|
|
34
|
+
|
|
35
|
+
/** The rows, one per moment whose condition is true. PURE. */
|
|
36
|
+
function rowsOf({ ws = '', today = '', minutes = null, away = null, worth = null, hire = null, steer = null } = {}) {
|
|
37
|
+
const out = [], k = (s) => 'moment:' + (ws || '') + ':' + s;
|
|
38
|
+
if (minutes && minutes.pick && minutes.minutes >= GAP_MIN && minutes.minutes <= GAP_MAX) {
|
|
39
|
+
const p = minutes.pick;
|
|
40
|
+
out.push({ key: k('minutes:' + today + ':' + minutes.minutes + ':' + (p.key || p.title)), kind: 'minutes', title: minutes.line, why: 'A free ' + minutes.minutes + ' min starts now',
|
|
41
|
+
label: 'Open it: ' + p.title, act: { kind: 'minutes', ini: p.ini || null } });
|
|
42
|
+
}
|
|
43
|
+
if (away && DAY_RE.test(away.day || '') && !away.set) {
|
|
44
|
+
const d = dn(away.day) - dn(today);
|
|
45
|
+
if (d >= 0 && d <= AWAY_DAYS) out.push({ key: k('away:' + away.day), kind: 'away', title: 'You are off ' + (away.word || away.day) + ': set the away days and draft the handover note',
|
|
46
|
+
why: away.from === 'calendar' ? 'Leave is on your calendar' : 'Your Today line says so', label: 'Set me away until ' + (away.word || away.day) + ' and draft the handover note',
|
|
47
|
+
act: { kind: 'away', until: away.day } });
|
|
48
|
+
}
|
|
49
|
+
if (worth && Array.isArray(worth.rows)) {
|
|
50
|
+
const off = new Set(worth.off || []);
|
|
51
|
+
for (const r of worth.rows) {
|
|
52
|
+
if (!r || !r.flag || off.has(r.kind)) continue;
|
|
53
|
+
out.push({ key: k('worth:' + r.kind + ':' + today.slice(0, 7)), kind: 'worth', title: 'Pause ' + r.kind + '? It took ' + pct(r.share) + ' of this month’s AI cost and you kept ' + r.kept + ' of ' + r.decided + ' of its ✦',
|
|
54
|
+
why: 'Costs most, kept least', label: 'Pause ' + r.kind + ' runs', act: { kind: 'worth', job: r.kind } });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (hire && hire.pick && !(hire.recent > 0)) {
|
|
58
|
+
const g = hire.pick, role = g.role;
|
|
59
|
+
out.push({ key: k('hire:' + role + ':' + today), kind: 'hire', title: 'Draft a role brief for ' + role + ': ' + g.load + ' open tasks and asks per person wait',
|
|
60
|
+
why: 'The work that waits most is on one role', label: 'Draft the role brief for ' + role, act: { kind: 'hire' } });
|
|
61
|
+
}
|
|
62
|
+
if (steer && steer.program && steer.program.id) {
|
|
63
|
+
out.push({ key: k('steer:' + steer.program.id + ':' + (steer.day || today)), kind: 'steer', title: 'Steering for ' + steer.program.title + ' ' + (steer.word || steer.day) + ': draft the one-page pack',
|
|
64
|
+
why: 'The meeting is in 2 working days or less', label: 'Draft the steering pack for ' + steer.program.title, act: { kind: 'steer', id: steer.program.id } });
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* ── reading what PMOS holds now ─────────────────────────────────────────────────────────────── */
|
|
70
|
+
function rootsOf(runtimeDir, w) {
|
|
71
|
+
let reg = [];
|
|
72
|
+
try { reg = JSON.parse(fs.readFileSync(path.join(runtimeDir, 'workspaces.json'), 'utf8')); } catch { reg = []; }
|
|
73
|
+
const out = (Array.isArray(reg) ? reg : []).filter((x) => x && typeof x.root === 'string').map((x) => path.resolve(x.root));
|
|
74
|
+
if (w && w.root && !out.includes(path.resolve(w.root))) out.push(path.resolve(w.root));
|
|
75
|
+
return [...new Set(out)];
|
|
76
|
+
}
|
|
77
|
+
function worthNow(runtimeDir, w, now) {
|
|
78
|
+
const W = require('./worth-it.js');
|
|
79
|
+
const since = W.monthStart(now);
|
|
80
|
+
let runs = []; try { runs = require('./run-tokens.js').read(runtimeDir, { sinceMs: since }); } catch { runs = []; }
|
|
81
|
+
let items = []; try { items = require('./orchestrator-keeprate.js').readAll(rootsOf(runtimeDir, w)).items; } catch { items = []; }
|
|
82
|
+
let off = []; try { off = require('./ai-guard.js').status({ stateDir: runtimeDir, settingsDir: runtimeDir }).settingsOff || []; } catch { off = []; }
|
|
83
|
+
return { ...W.worthOf({ runs, items, since }), off };
|
|
84
|
+
}
|
|
85
|
+
function programsOf(w, now) {
|
|
86
|
+
const PL = require('./program-line.js');
|
|
87
|
+
return PL.read(PL.rootsOf([w.root], process.env, true), { now });
|
|
88
|
+
}
|
|
89
|
+
/** The program a steering meeting is for: its title names the program, and "steering". */
|
|
90
|
+
function steerProgram(title, programs) {
|
|
91
|
+
const t = String(title || '').toLowerCase();
|
|
92
|
+
if (!/steer/.test(t)) return null;
|
|
93
|
+
return (programs || []).filter((p) => p && p.title && t.includes(String(p.title).toLowerCase())).sort((a, b) => b.title.length - a.title.length)[0] || null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** rowsOf over the files. q: { free (minutes), away (YYYY-MM-DD), awayWord, awayFrom, steer (meeting title), steerDay, steerWord }. */
|
|
97
|
+
function read(ctx, w, q = {}, { now = Date.now() } = {}) {
|
|
98
|
+
const today = localDay(now), runtimeDir = ctx.runtimeDir;
|
|
99
|
+
const stateDir = ctx.stateDirFor ? ctx.stateDirFor(w) : undefined;
|
|
100
|
+
const parts = { ws: w.id || '', today };
|
|
101
|
+
const free = Number(q.free);
|
|
102
|
+
if (free >= GAP_MIN && free <= GAP_MAX) {
|
|
103
|
+
try {
|
|
104
|
+
let sessions = []; try { sessions = ctx.sessionList ? ctx.sessionList() : []; } catch { sessions = []; }
|
|
105
|
+
parts.minutes = require('./time-box-pick.js').read({ w, stateDir, runtimeDir, sessions, minutes: free });
|
|
106
|
+
} catch { parts.minutes = null; }
|
|
107
|
+
}
|
|
108
|
+
if (DAY_RE.test(q.away || '') && runtimeDir) {
|
|
109
|
+
try { const AH = require('./away-handover.js'); const S = AH.stateOf(AH.readLines(runtimeDir), today); parts.away = { day: q.away, word: one(q.awayWord, 30), from: q.awayFrom === 'calendar' ? 'calendar' : 'line', set: !!S.away }; } catch { parts.away = null; }
|
|
110
|
+
}
|
|
111
|
+
if (runtimeDir) { try { parts.worth = worthNow(runtimeDir, w, now); } catch { parts.worth = null; } }
|
|
112
|
+
try {
|
|
113
|
+
const HD = require('./hire-draft.js');
|
|
114
|
+
const G = HD.gapOf(HD.sourcesOf(w.root, { now, records: [] })); // records: [] keeps the read fast: the contradiction scan takes seconds on a big repository and would hold the page's server
|
|
115
|
+
if (G.pick) parts.hire = { pick: G.pick, recent: HD.count(w.root, { days: HIRE_DAYS, now }) };
|
|
116
|
+
} catch { parts.hire = null; }
|
|
117
|
+
if (q.steer) {
|
|
118
|
+
try { const P = steerProgram(q.steer, programsOf(w, now).programs); if (P) parts.steer = { program: { id: P.id, title: P.title }, day: DAY_RE.test(q.steerDay || '') ? q.steerDay : '', word: one(q.steerWord, 30) }; } catch { parts.steer = null; }
|
|
119
|
+
}
|
|
120
|
+
const rows = rowsOf(parts);
|
|
121
|
+
console.info(TAG + ' ws=' + (w.id || '') + ' rows=' + rows.length + (rows.length ? ' kinds=' + rows.map((r) => r.kind).join(',') : ''));
|
|
122
|
+
return rows;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* ── the PM's ✓ and its Undo ──────────────────────────────────────────────────────────────────── */
|
|
126
|
+
function used(runtimeDir, now) { try { require('./use-log.js').record(runtimeDir, [{ kind: 'use', page: 'today', control: 'momentAct', device: 'desk' }], now); } catch { /* a count, never a reason to fail */ } }
|
|
127
|
+
const rel = (root, f) => path.relative(root, f).split(path.sep).join('/');
|
|
128
|
+
/** A draft this press wrote, removed by its Undo: only a file under the given folder, named for today. */
|
|
129
|
+
function removeDraft(root, dir, file, today) {
|
|
130
|
+
const abs = path.resolve(root, String(file || ''));
|
|
131
|
+
if (path.dirname(abs) !== path.resolve(dir) || !path.basename(abs).includes(today)) return { ok: false, error: 'that is not a draft from this press' };
|
|
132
|
+
try { fs.unlinkSync(abs); } catch { return { ok: false, error: 'the draft is already gone' }; }
|
|
133
|
+
return { ok: true };
|
|
134
|
+
}
|
|
135
|
+
function steerDir(root) { const kit = fs.existsSync(path.join(root, 'pmos', 'state')); return path.join(root, ...(kit ? ['pmos', 'planning'] : ['planning']), 'steering'); }
|
|
136
|
+
function hireDir(root) { const kit = fs.existsSync(path.join(root, 'pmos', 'state')); return path.join(root, ...(kit ? ['pmos', 'planning'] : ['planning']), 'hires'); }
|
|
137
|
+
|
|
138
|
+
function act(ctx, w, body = {}, { now = Date.now() } = {}) {
|
|
139
|
+
const kind = String(body.kind || ''), undo = body.undo === true, runtimeDir = ctx.runtimeDir, root = w.root, today = localDay(now);
|
|
140
|
+
if (!KINDS.includes(kind) || kind === 'minutes') return { ok: false, error: 'kind is away, worth, hire or steer' };
|
|
141
|
+
let r;
|
|
142
|
+
if (kind === 'away') {
|
|
143
|
+
const AH = require('./away-handover.js');
|
|
144
|
+
if (undo) { const b = AH.back(runtimeDir, { now }); r = b.ok ? { ok: true, said: 'You are not set as away.' } : b; }
|
|
145
|
+
else {
|
|
146
|
+
const s = AH.set(runtimeDir, { until: body.until }, { now });
|
|
147
|
+
if (!s.ok) return s;
|
|
148
|
+
const d = AH.draft(root, runtimeDir, { now });
|
|
149
|
+
r = { ok: true, said: 'Away until ' + body.until + '. The handover note is a draft' + (d.ok ? ': ' + rel(root, d.file) : '') + '. Nothing is sent.', file: d.ok ? rel(root, d.file) : null, undo: { kind, undo: true } };
|
|
150
|
+
}
|
|
151
|
+
} else if (kind === 'worth') {
|
|
152
|
+
const job = String(body.job || '');
|
|
153
|
+
const s = require('./ai-guard.js').setOff(runtimeDir, job, !undo);
|
|
154
|
+
if (!s || !s.ok) return { ok: false, error: (s && s.error) || 'not saved' };
|
|
155
|
+
r = { ok: true, said: undo ? job + ' runs are on again.' : job + ' runs are paused. Turn them on again in Settings or with Undo.', undo: undo ? null : { kind, job, undo: true } };
|
|
156
|
+
} else if (kind === 'hire') {
|
|
157
|
+
const HD = require('./hire-draft.js');
|
|
158
|
+
if (undo) r = removeDraft(root, hireDir(root), body.file, today);
|
|
159
|
+
else {
|
|
160
|
+
const d = HD.draft(root, { now });
|
|
161
|
+
if (!d.ok) return { ok: false, error: d.none ? 'no role stands out any more' : d.error || 'not drafted' };
|
|
162
|
+
r = { ok: true, said: (d.kept ? 'The role brief is already there: ' : 'Drafted the role brief: ') + rel(root, d.file) + '. Edit it and share it yourself.', file: rel(root, d.file), undo: d.kept ? null : { kind, file: rel(root, d.file), undo: true } };
|
|
163
|
+
}
|
|
164
|
+
} else {
|
|
165
|
+
if (undo) r = removeDraft(root, steerDir(root), body.file, today);
|
|
166
|
+
else {
|
|
167
|
+
const SP = require('./steering-pack.js');
|
|
168
|
+
const R = require('./program-line.js').read(require('./program-line.js').rootsOf([root], process.env, true), { now, only: String(body.id || '') || null });
|
|
169
|
+
const L = (R.programs || []).find((p) => p.id === body.id);
|
|
170
|
+
if (!L) return { ok: false, error: 'no open program ' + body.id };
|
|
171
|
+
const file = path.join(steerDir(root), today + '-' + String(L.id).replace(/[^a-z0-9-]+/gi, '-').toLowerCase() + '.md');
|
|
172
|
+
const kept = fs.existsSync(file);
|
|
173
|
+
if (!kept) {
|
|
174
|
+
const md = SP.markdown(SP.packOf(L, R.clashes, { now }));
|
|
175
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
176
|
+
fs.writeFileSync(file, `---\ntype: Research\ntitle: ${JSON.stringify('Steering pack: ' + L.title)}\ntimestamp: ${today}\nkind: steering-pack\n---\n\n` + md.trimEnd() + '\n');
|
|
177
|
+
}
|
|
178
|
+
r = { ok: true, said: (kept ? 'The steering pack is already there: ' : 'Drafted the steering pack: ') + rel(root, file) + '. Bring it to the meeting; PMOS sends nothing.', file: rel(root, file), undo: kept ? null : { kind, file: rel(root, file), undo: true } };
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (r.ok) { used(runtimeDir, now); log(kind + (undo ? ' undo' : '') + ' ws=' + (w.id || '')); }
|
|
182
|
+
return r;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
module.exports = { TAG, KINDS, GAP_MIN, GAP_MAX, AWAY_DAYS, HIRE_DAYS, rowsOf, steerProgram, read, act };
|