create-pmos 0.557.0 → 0.559.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +27 -81
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +8 -6
- package/workspace/changelog.json +26 -0
- package/workspace/fixtures/board-premium-facts.js +2 -12
- package/workspace/guide/initiatives-and-next-steps.md +18 -2
- package/workspace/guide/programs.md +2 -2
- package/workspace/lib/board-premium.js +5 -23
- package/workspace/lib/core-docs-needs.js +12 -16
- package/workspace/lib/core-docs.js +27 -214
- package/workspace/lib/coredoc-cli.js +6 -6
- package/workspace/lib/custom-docs.js +3 -1
- package/workspace/lib/initiative-cli.js +4 -4
- package/workspace/lib/initiative-premium.js +1 -1
- package/workspace/lib/initiative-writer.js +28 -4
- package/workspace/lib/job-graph.js +2 -2
- package/workspace/lib/refresh.js +2 -2
- package/workspace/lib/route-modules.js +0 -1
- package/workspace/lib/routes-board-premium.js +5 -11
- package/workspace/lib/routes-boards.js +5 -4
- package/workspace/lib/routes-core-docs.js +23 -113
- package/workspace/lib/routes-custom-docs.js +8 -6
- package/workspace/lib/routes-initiatives.js +12 -0
- package/workspace/lib/routes-intake.js +6 -2
- package/workspace/lib/work-kind.js +48 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-core-doc-issue-test.js +11 -18
- package/workspace/public/pm/bd-acts.js +5 -77
- package/workspace/public/pm/bd-asks.js +16 -10
- package/workspace/public/pm/bd-ini-panel.js +11 -1
- package/workspace/public/pm/bd-next.js +14 -4
- package/workspace/public/pm/bd-prog.js +4 -5
- package/workspace/public/pm/bd-views.js +7 -58
- package/workspace/public/pm/cozy-board.css +12 -24
- package/workspace/public/pm/cozy-viewer.js +11 -5
- package/workspace/public/pm/home-app.js +2 -3
- package/workspace/public/pm/home-ini.js +10 -1
- package/workspace/public/pm/ini-agent.js +40 -8
- package/workspace/public/pm/ini-view-model.js +1 -1
- package/workspace/public/pm/premium-board.js +9 -26
- package/workspace/public/pm/premium-shell.js +3 -33
- package/workspace/public/pm/prog-page.js +1 -1
- package/workspace/public/pm/work-kind.js +82 -0
- package/workspace/ready-dash-ui-test.js +1 -1
- package/workspace/server.js +3 -12
- package/workspace/test-files.json +1 -1
- package/workspace/test-lists/uncovered-board.json +1 -1
- package/workspace/lib/routes-board-docs.js +0 -46
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
/* routes-board-docs.js — GET /api/board-docs?ws=<id>&paths=<path,path,…> (initiative premium-uncovered-features, Board: BdDocs).
|
|
3
|
-
*
|
|
4
|
-
* 200 { ok, docs: { [path]: { changed, at, by, log: [{ at, by, subject }] } } } when each document last changed, by whom, and its last five commits
|
|
5
|
-
* 400 { ok: false, error } — no path, or a path outside the repository · 404 — the workspace is not registered
|
|
6
|
-
* Read-only: `git log` on the workspace's repository. A path git has no history for (a new file, no repository) is left out, so the
|
|
7
|
-
* Documents tab shows "—" for it rather than a guess. At most 40 paths per call. */
|
|
8
|
-
const path = require('path');
|
|
9
|
-
const { execFileSync } = require('child_process');
|
|
10
|
-
|
|
11
|
-
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
12
|
-
const day = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? Number(m[3]) + ' ' + MON[Number(m[2]) - 1] : ''; };
|
|
13
|
-
const PATH_RE = /^[\w@][\w@ .()/-]{0,300}$/;
|
|
14
|
-
|
|
15
|
-
/** The last commits of one file, newest first. → [{ at, by, subject }] (empty when git knows none). */
|
|
16
|
-
function logOf(root, rel) {
|
|
17
|
-
let out = '';
|
|
18
|
-
try { out = execFileSync('git', ['log', '-n', '5', '--format=%cI%x09%an%x09%s', '--', rel], { cwd: root, encoding: 'utf8', timeout: 4000, stdio: ['ignore', 'pipe', 'ignore'] }); } catch { return []; }
|
|
19
|
-
return out.split('\n').filter(Boolean).map((l) => { const [at, by, ...s] = l.split('\t'); return { at, by, subject: s.join('\t').slice(0, 160) }; });
|
|
20
|
-
}
|
|
21
|
-
/** The answer for a list of paths. Pure over `log` (a stand-in in the unit test). */
|
|
22
|
-
function docsOf(root, paths, log = logOf) {
|
|
23
|
-
const docs = {};
|
|
24
|
-
for (const p of paths) {
|
|
25
|
-
const L = log(root, p);
|
|
26
|
-
if (!L.length) continue;
|
|
27
|
-
docs[p] = { changed: day(L[0].at), at: L[0].at, by: L[0].by, log: L.map((x) => ({ at: day(x.at), by: x.by, subject: x.subject })) };
|
|
28
|
-
}
|
|
29
|
-
return docs;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = {
|
|
33
|
-
prefixes: ['/api/board-docs'],
|
|
34
|
-
docsOf,
|
|
35
|
-
handle: async (req, res, url, ctx) => {
|
|
36
|
-
if (url.pathname !== '/api/board-docs') return false;
|
|
37
|
-
if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
|
|
38
|
-
const paths = String(url.searchParams.get('paths') || '').split(',').map((s) => s.trim()).filter(Boolean).slice(0, 40);
|
|
39
|
-
if (!paths.length) { ctx.json(res, { ok: false, error: 'name the documents: paths=<path,path,…>' }, 400); return true; }
|
|
40
|
-
if (!paths.every((p) => PATH_RE.test(p) && !p.split('/').includes('..') && !path.isAbsolute(p))) { ctx.json(res, { ok: false, error: 'a path must stay inside the repository' }, 400); return true; }
|
|
41
|
-
const w = ctx.getWs ? ctx.getWs(url.searchParams.get('ws') || null) : null;
|
|
42
|
-
if (!w || !w.root) { ctx.json(res, { ok: false, error: 'that workspace is not registered' }, 404); return true; }
|
|
43
|
-
ctx.json(res, { ok: true, docs: docsOf(w.root, paths) });
|
|
44
|
-
return true;
|
|
45
|
-
},
|
|
46
|
-
};
|