create-pmos 0.398.0 → 0.400.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.
Files changed (515) hide show
  1. package/package.json +30 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +19 -15
  7. package/workspace/briefing-premium-board-test.js +82 -50
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +8 -10
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +48 -43
  18. package/workspace/briefing-premium-work-test.js +16 -11
  19. package/workspace/c3-capture-test.js +0 -17
  20. package/workspace/changelog.json +29 -0
  21. package/workspace/ev-everywhere-test.js +210 -0
  22. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  23. package/workspace/guide/briefing-premium.md +2 -2
  24. package/workspace/guide/home.md +58 -19
  25. package/workspace/guide/index.md +1 -1
  26. package/workspace/guide/layout.md +2 -2
  27. package/workspace/guide/notes.md +2 -2
  28. package/workspace/guide/phone-companion.md +1 -1
  29. package/workspace/lib/board-grill.js +63 -0
  30. package/workspace/lib/board-premium.js +36 -5
  31. package/workspace/lib/initiative-layout.js +77 -0
  32. package/workspace/lib/insights-premium.js +3 -2
  33. package/workspace/lib/insights-records.js +21 -7
  34. package/workspace/lib/meeting-points.js +52 -0
  35. package/workspace/lib/news-for-you.js +88 -0
  36. package/workspace/lib/notes-series.js +29 -6
  37. package/workspace/lib/report-confirm.js +48 -0
  38. package/workspace/lib/route-modules.js +9 -9
  39. package/workspace/lib/routes-board-docs.js +46 -0
  40. package/workspace/lib/routes-board-grill.js +90 -0
  41. package/workspace/lib/routes-home-review.js +108 -0
  42. package/workspace/lib/routes-initiative-layout.js +57 -0
  43. package/workspace/lib/routes-insights-premium.js +4 -1
  44. package/workspace/lib/routes-insights-records.js +8 -4
  45. package/workspace/lib/routes-meeting-points.js +37 -0
  46. package/workspace/lib/routes-news.js +57 -0
  47. package/workspace/lib/routes-notes.js +2 -1
  48. package/workspace/lib/routes-phone-day.js +18 -9
  49. package/workspace/lib/routes-report-confirm.js +31 -0
  50. package/workspace/lib/routes-search.js +38 -0
  51. package/workspace/lib/routes-slash.js +95 -0
  52. package/workspace/lib/search-index.js +176 -0
  53. package/workspace/package-lock.json +2 -2
  54. package/workspace/package.json +1 -2
  55. package/workspace/premium-board-actions-test.js +86 -50
  56. package/workspace/premium-briefing-depth-test.js +55 -54
  57. package/workspace/premium-chat-chart-tab-test.js +4 -2
  58. package/workspace/premium-chat-goal-view-test.js +1 -1
  59. package/workspace/premium-chat-report-tab-test.js +16 -2
  60. package/workspace/premium-chat-term-test.js +0 -10
  61. package/workspace/premium-core-doc-issue-test.js +15 -13
  62. package/workspace/premium-menu-rows-test.js +1 -1
  63. package/workspace/premium-phone-card-test.js +7 -5
  64. package/workspace/premium-report-read-test.js +55 -18
  65. package/workspace/premium-vw-backlog-test.js +2 -2
  66. package/workspace/premium-vw-cal-test.js +50 -35
  67. package/workspace/premium-vw-doc-test.js +10 -11
  68. package/workspace/premium-vw-item-test.js +1 -1
  69. package/workspace/premium-vw-jira-test.js +2 -2
  70. package/workspace/premium-vw-meet-test.js +37 -40
  71. package/workspace/premium-vw-notes-test.js +21 -19
  72. package/workspace/premium-vw-rec-test.js +11 -12
  73. package/workspace/premium-welcome-test.js +3 -3
  74. package/workspace/premium-work-depth-test.js +5 -6
  75. package/workspace/public/capture.html +23 -0
  76. package/workspace/public/pm/bd-acts.js +303 -225
  77. package/workspace/public/pm/bd-asks.js +261 -0
  78. package/workspace/public/pm/bd-pop.js +59 -0
  79. package/workspace/public/pm/bd-span.js +49 -13
  80. package/workspace/public/pm/bd-views.js +169 -0
  81. package/workspace/public/pm/c3-base.js +47 -0
  82. package/workspace/public/pm/c3-capture.js +1 -1
  83. package/workspace/public/pm/c3-ini-ui.js +1 -1
  84. package/workspace/public/pm/c3-sheet.js +1 -1
  85. package/workspace/public/pm/c3-toast.js +1 -1
  86. package/workspace/public/pm/console3.css +3 -0
  87. package/workspace/public/pm/cozy-board.css +301 -0
  88. package/workspace/public/pm/cozy-ev.css +228 -0
  89. package/workspace/public/pm/cozy-evmodel.js +106 -0
  90. package/workspace/public/pm/cozy-evui.js +47 -0
  91. package/workspace/public/pm/cozy-home.css +20 -5
  92. package/workspace/public/pm/cozy-insights.css +148 -10
  93. package/workspace/public/pm/cozy-nav.js +103 -39
  94. package/workspace/public/pm/cozy-news.js +140 -0
  95. package/workspace/public/pm/cozy-search.js +203 -0
  96. package/workspace/public/pm/cozy-settings.js +198 -0
  97. package/workspace/public/pm/cozy-sources.js +89 -0
  98. package/workspace/public/pm/cozy-today.css +220 -0
  99. package/workspace/public/pm/cozy-viewer.js +5 -2
  100. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  101. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  102. package/workspace/public/pm/cozy.css +9 -0
  103. package/workspace/public/pm/goal-chat.js +5 -1
  104. package/workspace/public/pm/home-adddoc.js +5 -5
  105. package/workspace/public/pm/home-app.js +365 -70
  106. package/workspace/public/pm/home-around.js +24 -126
  107. package/workspace/public/pm/home-chat.js +77 -18
  108. package/workspace/public/pm/home-data.js +9 -7
  109. package/workspace/public/pm/home-dictate.js +57 -0
  110. package/workspace/public/pm/home-draft.js +6 -6
  111. package/workspace/public/pm/home-ini-model.js +190 -0
  112. package/workspace/public/pm/home-ini.css +171 -0
  113. package/workspace/public/pm/home-ini.js +466 -0
  114. package/workspace/public/pm/home-list.js +289 -0
  115. package/workspace/public/pm/home-more.js +18 -135
  116. package/workspace/public/pm/home-phone-card.js +13 -8
  117. package/workspace/public/pm/home-review.js +103 -0
  118. package/workspace/public/pm/home-task.js +67 -0
  119. package/workspace/public/pm/home-today.js +148 -0
  120. package/workspace/public/pm/home-work.js +63 -28
  121. package/workspace/public/pm/note-dock.js +1 -2
  122. package/workspace/public/pm/notes-links.js +1 -2
  123. package/workspace/public/pm/notes-task.js +3 -4
  124. package/workspace/public/pm/premium-board.js +164 -40
  125. package/workspace/public/pm/premium-chart-tab.js +4 -5
  126. package/workspace/public/pm/premium-first.js +5 -7
  127. package/workspace/public/pm/premium-initiative-head.js +3 -3
  128. package/workspace/public/pm/premium-insights.js +499 -202
  129. package/workspace/public/pm/premium-mtg-present.js +138 -0
  130. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  131. package/workspace/public/pm/premium-report-read.js +216 -52
  132. package/workspace/public/pm/premium-report-tab.js +44 -19
  133. package/workspace/public/pm/premium-shell.js +7 -7
  134. package/workspace/public/pm/premium-vw-cal.js +150 -60
  135. package/workspace/public/pm/premium-vw-doc.css +20 -2
  136. package/workspace/public/pm/premium-vw-doc.js +22 -7
  137. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  138. package/workspace/public/pm/premium-vw-notes.js +61 -0
  139. package/workspace/public/pm/rp-parts.js +269 -0
  140. package/workspace/public/pm/view-notes.js +2 -2
  141. package/workspace/public/premium-board.html +4 -3
  142. package/workspace/public/premium-insights.html +10 -10
  143. package/workspace/public/premium.html +3 -1
  144. package/workspace/r/m1.png +0 -0
  145. package/workspace/r/m2.png +0 -0
  146. package/workspace/r/m3.png +0 -0
  147. package/workspace/r/nl.png +0 -0
  148. package/workspace/replaced-tests.json +435 -0
  149. package/workspace/run-tests.js +323 -28
  150. package/workspace/server.js +15 -10
  151. package/workspace/test-files.json +3 -140
  152. package/workspace/test-lists/base.json +1 -2
  153. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  154. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  155. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  156. package/workspace/test-lists/c3-work-agent.json +1 -2
  157. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  158. package/workspace/test-lists/console3-reports.json +1 -2
  159. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  160. package/workspace/test-lists/extension-capture.json +5 -0
  161. package/workspace/test-lists/initiative-layout.json +9 -0
  162. package/workspace/test-lists/jira-wbs.json +1 -2
  163. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  164. package/workspace/test-lists/meeting-material.json +1 -2
  165. package/workspace/test-lists/meeting-notes.json +2 -36
  166. package/workspace/test-lists/meeting-replay.json +1 -2
  167. package/workspace/test-lists/mm-capture.json +2 -12
  168. package/workspace/test-lists/my-work.json +2 -10
  169. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  170. package/workspace/test-lists/people-directory.json +1 -2
  171. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  172. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  173. package/workspace/test-lists/run2-a.json +1 -2
  174. package/workspace/test-lists/run2-d.json +2 -19
  175. package/workspace/test-lists/run3-b.json +1 -2
  176. package/workspace/test-lists/run3-c.json +2 -12
  177. package/workspace/test-lists/run4-b.json +1 -2
  178. package/workspace/test-lists/run4-d.json +1 -5
  179. package/workspace/test-lists/run5-c.json +1 -11
  180. package/workspace/test-lists/run6.json +1 -5
  181. package/workspace/test-lists/uf-everywhere.json +15 -0
  182. package/workspace/test-lists/uf-home.json +9 -0
  183. package/workspace/test-lists/uncovered-board.json +9 -0
  184. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  185. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  186. package/workspace/test-timings.json +242 -123
  187. package/workspace/c3-briefing-test.js +0 -136
  188. package/workspace/c3-core-docs-test.js +0 -170
  189. package/workspace/c3-driver-fixture.js +0 -64
  190. package/workspace/c3-driver-test.js +0 -169
  191. package/workspace/c3-foundation-test.js +0 -163
  192. package/workspace/c3-ib-items-test.js +0 -114
  193. package/workspace/c3-ib-more-test.js +0 -146
  194. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  195. package/workspace/c3-ini-harness.js +0 -66
  196. package/workspace/c3-ini-life-test.js +0 -167
  197. package/workspace/c3-initiatives-test.js +0 -186
  198. package/workspace/c3-light-load-test.js +0 -112
  199. package/workspace/c3-one-home-test.js +0 -149
  200. package/workspace/c3-phone-test.js +0 -289
  201. package/workspace/c3-quiet-test.js +0 -157
  202. package/workspace/c3-report-design-real-test.js +0 -264
  203. package/workspace/c3-report-design-test.js +0 -442
  204. package/workspace/c3-report-setup-test.js +0 -192
  205. package/workspace/c3-report-structure-real-test.js +0 -248
  206. package/workspace/c3-report-structure-test.js +0 -397
  207. package/workspace/c3-reports-test.js +0 -288
  208. package/workspace/c3-scan-test.js +0 -517
  209. package/workspace/c3-sessions-panel-test.js +0 -365
  210. package/workspace/c3-settings-test.js +0 -204
  211. package/workspace/c3-updates-test.js +0 -131
  212. package/workspace/c3-work-test.js +0 -260
  213. package/workspace/cut-stub.js +0 -40
  214. package/workspace/first-paint-audit.js +0 -160
  215. package/workspace/lib/c3-full-console.js +0 -15
  216. package/workspace/lib/engine/derived/trust.js +0 -3
  217. package/workspace/lib/engine/plan-forecast.js +0 -342
  218. package/workspace/lib/engine/report-families.js +0 -175
  219. package/workspace/lib/engine/truth-table.js +0 -57
  220. package/workspace/lib/routes-c3-init.js +0 -54
  221. package/workspace/lib/routes-c3-life.js +0 -120
  222. package/workspace/lib/routes-c3-timeline.js +0 -192
  223. package/workspace/lib/routes-forecast.js +0 -86
  224. package/workspace/lib/routes-releases.js +0 -130
  225. package/workspace/lib/routes-report-facts.js +0 -85
  226. package/workspace/lib/routes-report-families.js +0 -33
  227. package/workspace/lib/routes-signals.js +0 -51
  228. package/workspace/lib/routes-timeline.js +0 -197
  229. package/workspace/public/c3.html +0 -35
  230. package/workspace/public/index.html +0 -156
  231. package/workspace/public/pm/app.js +0 -831
  232. package/workspace/public/pm/bd-board.js +0 -159
  233. package/workspace/public/pm/bd-drag.js +0 -59
  234. package/workspace/public/pm/bd-model.js +0 -152
  235. package/workspace/public/pm/bd-timeline.js +0 -233
  236. package/workspace/public/pm/bd-tree.js +0 -244
  237. package/workspace/public/pm/board-copy.js +0 -59
  238. package/workspace/public/pm/board-read.js +0 -38
  239. package/workspace/public/pm/branches-sheet.js +0 -56
  240. package/workspace/public/pm/breakdown-api.js +0 -58
  241. package/workspace/public/pm/breakdown-copy.js +0 -138
  242. package/workspace/public/pm/briefing-deck.js +0 -441
  243. package/workspace/public/pm/briefing-model.js +0 -251
  244. package/workspace/public/pm/c3-ambient.js +0 -100
  245. package/workspace/public/pm/c3-audience-link.js +0 -21
  246. package/workspace/public/pm/c3-audience.js +0 -46
  247. package/workspace/public/pm/c3-boot.js +0 -13
  248. package/workspace/public/pm/c3-breakdown.js +0 -240
  249. package/workspace/public/pm/c3-brief-data.js +0 -11
  250. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  251. package/workspace/public/pm/c3-brief-needs.js +0 -288
  252. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  253. package/workspace/public/pm/c3-brief-summary.js +0 -139
  254. package/workspace/public/pm/c3-brief-today.js +0 -79
  255. package/workspace/public/pm/c3-brief.js +0 -279
  256. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  257. package/workspace/public/pm/c3-calendar.js +0 -965
  258. package/workspace/public/pm/c3-calpop.js +0 -111
  259. package/workspace/public/pm/c3-case.js +0 -196
  260. package/workspace/public/pm/c3-core-docs.css +0 -18
  261. package/workspace/public/pm/c3-core-docs.js +0 -236
  262. package/workspace/public/pm/c3-daypart.js +0 -176
  263. package/workspace/public/pm/c3-demo-boards.js +0 -764
  264. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  265. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  266. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  267. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  268. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  269. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  270. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  271. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  272. package/workspace/public/pm/c3-demo-data.js +0 -552
  273. package/workspace/public/pm/c3-demo-focus.js +0 -181
  274. package/workspace/public/pm/c3-demo-init.js +0 -430
  275. package/workspace/public/pm/c3-demo-life.js +0 -77
  276. package/workspace/public/pm/c3-demo-material.js +0 -58
  277. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  278. package/workspace/public/pm/c3-demo-phone.js +0 -48
  279. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  280. package/workspace/public/pm/c3-demo-rd.js +0 -432
  281. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  282. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  283. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  284. package/workspace/public/pm/c3-demo-rs.js +0 -287
  285. package/workspace/public/pm/c3-demo-term.js +0 -153
  286. package/workspace/public/pm/c3-demo-time.js +0 -49
  287. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  288. package/workspace/public/pm/c3-demo.js +0 -131
  289. package/workspace/public/pm/c3-design-studio.js +0 -369
  290. package/workspace/public/pm/c3-doc-formats.js +0 -153
  291. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  292. package/workspace/public/pm/c3-dock.js +0 -206
  293. package/workspace/public/pm/c3-docs.js +0 -291
  294. package/workspace/public/pm/c3-driver-work.js +0 -110
  295. package/workspace/public/pm/c3-driver.css +0 -18
  296. package/workspace/public/pm/c3-driver.js +0 -298
  297. package/workspace/public/pm/c3-focus.css +0 -304
  298. package/workspace/public/pm/c3-focus.js +0 -983
  299. package/workspace/public/pm/c3-ib-docs.js +0 -92
  300. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  301. package/workspace/public/pm/c3-ib-items.js +0 -210
  302. package/workspace/public/pm/c3-ib-releases.js +0 -48
  303. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  304. package/workspace/public/pm/c3-ib-triage.js +0 -177
  305. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  306. package/workspace/public/pm/c3-ini-life.css +0 -34
  307. package/workspace/public/pm/c3-ini-life.js +0 -379
  308. package/workspace/public/pm/c3-ini-records.js +0 -197
  309. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  310. package/workspace/public/pm/c3-ini-work.js +0 -139
  311. package/workspace/public/pm/c3-init-extras.js +0 -170
  312. package/workspace/public/pm/c3-initiatives.js +0 -852
  313. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  314. package/workspace/public/pm/c3-look.js +0 -27
  315. package/workspace/public/pm/c3-material.css +0 -22
  316. package/workspace/public/pm/c3-material.js +0 -321
  317. package/workspace/public/pm/c3-md.js +0 -3
  318. package/workspace/public/pm/c3-misc-panels.js +0 -89
  319. package/workspace/public/pm/c3-new-session.js +0 -110
  320. package/workspace/public/pm/c3-notes.js +0 -751
  321. package/workspace/public/pm/c3-phone-boot.js +0 -47
  322. package/workspace/public/pm/c3-phone-detail.js +0 -97
  323. package/workspace/public/pm/c3-phone-model.js +0 -3
  324. package/workspace/public/pm/c3-phone.css +0 -66
  325. package/workspace/public/pm/c3-phone.js +0 -444
  326. package/workspace/public/pm/c3-plan-panels.js +0 -163
  327. package/workspace/public/pm/c3-plan.js +0 -193
  328. package/workspace/public/pm/c3-quiet.css +0 -113
  329. package/workspace/public/pm/c3-quiet.js +0 -177
  330. package/workspace/public/pm/c3-replay.css +0 -133
  331. package/workspace/public/pm/c3-replay.js +0 -429
  332. package/workspace/public/pm/c3-report-deck.css +0 -163
  333. package/workspace/public/pm/c3-report-deck.js +0 -598
  334. package/workspace/public/pm/c3-report-frame.css +0 -20
  335. package/workspace/public/pm/c3-report-print.css +0 -20
  336. package/workspace/public/pm/c3-report-setup.css +0 -67
  337. package/workspace/public/pm/c3-report-setup.js +0 -298
  338. package/workspace/public/pm/c3-report-store.js +0 -244
  339. package/workspace/public/pm/c3-report-structure.css +0 -44
  340. package/workspace/public/pm/c3-report-structure.js +0 -473
  341. package/workspace/public/pm/c3-reports.css +0 -68
  342. package/workspace/public/pm/c3-reports.js +0 -377
  343. package/workspace/public/pm/c3-roadmap.js +0 -249
  344. package/workspace/public/pm/c3-scan-api.js +0 -167
  345. package/workspace/public/pm/c3-scan-next.js +0 -248
  346. package/workspace/public/pm/c3-scan-setup.js +0 -313
  347. package/workspace/public/pm/c3-scan-words.js +0 -41
  348. package/workspace/public/pm/c3-scan.css +0 -74
  349. package/workspace/public/pm/c3-scan.js +0 -93
  350. package/workspace/public/pm/c3-session-chat.js +0 -103
  351. package/workspace/public/pm/c3-session-conv.js +0 -165
  352. package/workspace/public/pm/c3-session-term.js +0 -216
  353. package/workspace/public/pm/c3-settings.css +0 -85
  354. package/workspace/public/pm/c3-settings.js +0 -1045
  355. package/workspace/public/pm/c3-shell.js +0 -628
  356. package/workspace/public/pm/c3-signals.js +0 -196
  357. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  358. package/workspace/public/pm/c3-swipe.js +0 -230
  359. package/workspace/public/pm/c3-terminal-data.js +0 -48
  360. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  361. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  362. package/workspace/public/pm/c3-terminal-results.js +0 -141
  363. package/workspace/public/pm/c3-terminal.js +0 -52
  364. package/workspace/public/pm/c3-tickets.js +0 -163
  365. package/workspace/public/pm/c3-timeline.js +0 -201
  366. package/workspace/public/pm/calendar-views.js +0 -1049
  367. package/workspace/public/pm/console3-lift.md +0 -220
  368. package/workspace/public/pm/cozy-home.js +0 -172
  369. package/workspace/public/pm/cozy-initiative.css +0 -138
  370. package/workspace/public/pm/cycle-review.js +0 -125
  371. package/workspace/public/pm/data.js +0 -1577
  372. package/workspace/public/pm/dest-board.js +0 -444
  373. package/workspace/public/pm/dest-docs.js +0 -530
  374. package/workspace/public/pm/dest-initiatives.js +0 -162
  375. package/workspace/public/pm/dest-mywork.js +0 -307
  376. package/workspace/public/pm/dest-notes.js +0 -537
  377. package/workspace/public/pm/dest-people.js +0 -449
  378. package/workspace/public/pm/dest-reports.js +0 -383
  379. package/workspace/public/pm/dest-settings.js +0 -601
  380. package/workspace/public/pm/dest-today.js +0 -267
  381. package/workspace/public/pm/display-word.js +0 -56
  382. package/workspace/public/pm/doc-editor.js +0 -473
  383. package/workspace/public/pm/doc-graph.js +0 -272
  384. package/workspace/public/pm/doc-health-panel.js +0 -110
  385. package/workspace/public/pm/doc-rail.js +0 -167
  386. package/workspace/public/pm/doc-remote.js +0 -180
  387. package/workspace/public/pm/dock-sessions.js +0 -472
  388. package/workspace/public/pm/dock.js +0 -216
  389. package/workspace/public/pm/fixture.js +0 -821
  390. package/workspace/public/pm/flag-picker.js +0 -104
  391. package/workspace/public/pm/frame-copy.js +0 -278
  392. package/workspace/public/pm/freshness-line.js +0 -149
  393. package/workspace/public/pm/handoff-box.js +0 -82
  394. package/workspace/public/pm/initiative-list.js +0 -235
  395. package/workspace/public/pm/initiative-sheet.js +0 -331
  396. package/workspace/public/pm/initiatives-api.js +0 -95
  397. package/workspace/public/pm/initiatives-copy.js +0 -287
  398. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  399. package/workspace/public/pm/initiatives-timeline.js +0 -410
  400. package/workspace/public/pm/initiatives-ui.js +0 -291
  401. package/workspace/public/pm/item-sheet.js +0 -268
  402. package/workspace/public/pm/keep-card.js +0 -204
  403. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  404. package/workspace/public/pm/lifecycle-lens.js +0 -276
  405. package/workspace/public/pm/lifecycle.js +0 -111
  406. package/workspace/public/pm/mobile.css +0 -366
  407. package/workspace/public/pm/mobile.js +0 -581
  408. package/workspace/public/pm/modes-live.js +0 -453
  409. package/workspace/public/pm/modes.js +0 -147
  410. package/workspace/public/pm/my-work-card.js +0 -51
  411. package/workspace/public/pm/my-work-data.js +0 -36
  412. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  413. package/workspace/public/pm/next-step-ui.js +0 -190
  414. package/workspace/public/pm/outbox-panel.js +0 -125
  415. package/workspace/public/pm/palette-copy.js +0 -55
  416. package/workspace/public/pm/palette.js +0 -343
  417. package/workspace/public/pm/panel-breakdown.js +0 -702
  418. package/workspace/public/pm/panel-cockpit.js +0 -425
  419. package/workspace/public/pm/panel-detail.js +0 -1513
  420. package/workspace/public/pm/panel-initiatives.js +0 -929
  421. package/workspace/public/pm/panel-newsess.js +0 -709
  422. package/workspace/public/pm/panel-repos.js +0 -741
  423. package/workspace/public/pm/panel-tabs.js +0 -1506
  424. package/workspace/public/pm/panel-trees.js +0 -204
  425. package/workspace/public/pm/people-link.js +0 -106
  426. package/workspace/public/pm/phone-deck.js +0 -167
  427. package/workspace/public/pm/pm-work-view.js +0 -1533
  428. package/workspace/public/pm/portfolio-report.js +0 -61
  429. package/workspace/public/pm/premium-acts.js +0 -280
  430. package/workspace/public/pm/premium-brief.js +0 -111
  431. package/workspace/public/pm/premium-chat.js +0 -22
  432. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  433. package/workspace/public/pm/premium-initiative.js +0 -324
  434. package/workspace/public/pm/premium-insights.css +0 -228
  435. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  436. package/workspace/public/pm/premium-report-brief.js +0 -132
  437. package/workspace/public/pm/premium-vw-rec.js +0 -67
  438. package/workspace/public/pm/premium-wide.css +0 -30
  439. package/workspace/public/pm/print.css +0 -44
  440. package/workspace/public/pm/provider-cards.js +0 -136
  441. package/workspace/public/pm/registry.js +0 -203
  442. package/workspace/public/pm/release-card.js +0 -110
  443. package/workspace/public/pm/releases-view.js +0 -248
  444. package/workspace/public/pm/report-families-view.js +0 -505
  445. package/workspace/public/pm/report-slides.js +0 -438
  446. package/workspace/public/pm/report-tab.js +0 -33
  447. package/workspace/public/pm/report-view.js +0 -337
  448. package/workspace/public/pm/reports-copy.js +0 -134
  449. package/workspace/public/pm/roadmap.js +0 -294
  450. package/workspace/public/pm/run-card.js +0 -260
  451. package/workspace/public/pm/sessions-panel.js +0 -219
  452. package/workspace/public/pm/sheet-jira.js +0 -353
  453. package/workspace/public/pm/shell-bell.js +0 -163
  454. package/workspace/public/pm/shell-model.js +0 -83
  455. package/workspace/public/pm/shell-phone.js +0 -124
  456. package/workspace/public/pm/shell-readaloud.js +0 -53
  457. package/workspace/public/pm/shell-recording.js +0 -274
  458. package/workspace/public/pm/shell-ticker.js +0 -90
  459. package/workspace/public/pm/sig-watch.js +0 -41
  460. package/workspace/public/pm/slide-confirm.js +0 -163
  461. package/workspace/public/pm/slides-copy.js +0 -52
  462. package/workspace/public/pm/status-banner.js +0 -95
  463. package/workspace/public/pm/tab-doc.js +0 -859
  464. package/workspace/public/pm/tab-gone.js +0 -21
  465. package/workspace/public/pm/tab-term.js +0 -1210
  466. package/workspace/public/pm/tab-web.js +0 -90
  467. package/workspace/public/pm/timeline-copy.js +0 -48
  468. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  469. package/workspace/public/pm/today-agenda.js +0 -331
  470. package/workspace/public/pm/today-cards.js +0 -244
  471. package/workspace/public/pm/today-copy.js +0 -506
  472. package/workspace/public/pm/today-day.js +0 -1371
  473. package/workspace/public/pm/today-goals.js +0 -297
  474. package/workspace/public/pm/today-jobs.js +0 -84
  475. package/workspace/public/pm/today-mentions.js +0 -50
  476. package/workspace/public/pm/topbar.js +0 -202
  477. package/workspace/public/pm/triage-card.js +0 -60
  478. package/workspace/public/pm/undo-hold.js +0 -103
  479. package/workspace/public/pm/view-addrepo.js +0 -208
  480. package/workspace/public/pm/view-files.js +0 -197
  481. package/workspace/public/pm/view-livenotes.js +0 -399
  482. package/workspace/public/pm/view-today.js +0 -13
  483. package/workspace/public/pm/view-validate.js +0 -171
  484. package/workspace/public/pm/welcome.js +0 -391
  485. package/workspace/public/pm/work-place.js +0 -68
  486. package/workspace/public/pm/xlsx-read.js +0 -117
  487. package/workspace/public/welcome.html +0 -22
  488. package/workspace/test-lists/browser-suites-green.json +0 -5
  489. package/workspace/test-lists/c3-core-docs.json +0 -9
  490. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  491. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  492. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  493. package/workspace/test-lists/c3-ib-items.json +0 -9
  494. package/workspace/test-lists/c3-ib-more.json +0 -9
  495. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  496. package/workspace/test-lists/c3-ini-life.json +0 -9
  497. package/workspace/test-lists/c3-meeting-board.json +0 -5
  498. package/workspace/test-lists/c3-meeting-card.json +0 -5
  499. package/workspace/test-lists/c3-notes-place.json +0 -5
  500. package/workspace/test-lists/c3-notes-series.json +0 -5
  501. package/workspace/test-lists/calendar-time-page.json +0 -5
  502. package/workspace/test-lists/calpop.json +0 -4
  503. package/workspace/test-lists/console3-briefing.json +0 -9
  504. package/workspace/test-lists/console3-foundation.json +0 -9
  505. package/workspace/test-lists/console3-work-page.json +0 -9
  506. package/workspace/test-lists/premium-brief-parity.json +0 -9
  507. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  508. package/workspace/test-lists/report-structure-ui.json +0 -11
  509. package/workspace/test-lists/report-workspace-ui.json +0 -5
  510. package/workspace/test-lists/run3-a.json +0 -5
  511. package/workspace/test-lists/run3-d.json +0 -6
  512. package/workspace/test-lists/run4-c.json +0 -13
  513. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  514. package/workspace/test-lists/today-mentions-cards.json +0 -5
  515. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+ /* meeting-points.js — what the PM said about the key points of a meeting's Replay (initiative premium-uncovered-features, area meetings;
3
+ * MtReplay.dc.html: the bulk bar's Confirm and Not right). The Replay keeps the points that were agreed, owned or left open; the PM ticks
4
+ * some and confirms them, or marks them not right. A point marked not right leaves the kept list and goes to "Left out".
5
+ *
6
+ * pointsOf(dir, note) → { [pointId]: 'confirmed' | 'wrong' } a later line wins; verdict null forgets the point
7
+ * setPoints(dir, { note, ids, verdict }) → { ok, points } | { ok: false, status, error }
8
+ *
9
+ * A point's id is the id lib/meeting-replay.js gives it (d1, a2, q1). One line of <runtime>/meeting-points.jsonl per press, file mode,
10
+ * in the per-user runtime folder beside the notes. Nothing here sends anything. */
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+
14
+ const FILE = 'meeting-points.jsonl';
15
+ const NOTE_ID = /^[A-Za-z0-9_-]{1,80}$/;
16
+ const POINT_ID = /^[A-Za-z0-9_-]{1,40}$/;
17
+ const VERDICTS = ['confirmed', 'wrong'];
18
+
19
+ function readLines(file) {
20
+ let text = '';
21
+ try { text = fs.readFileSync(file, 'utf8'); } catch { return []; }
22
+ const out = [];
23
+ for (const l of text.split('\n')) { if (!l.trim()) continue; try { const o = JSON.parse(l); if (o && typeof o === 'object') out.push(o); } catch { /* a torn line is skipped */ } }
24
+ return out;
25
+ }
26
+
27
+ /** The verdict on each point of one note. */
28
+ function pointsOf(dir, note) {
29
+ const out = {};
30
+ if (!dir || !NOTE_ID.test(String(note || ''))) return out;
31
+ for (const l of readLines(path.join(dir, FILE))) {
32
+ if (l.note !== note || !Array.isArray(l.ids)) continue;
33
+ for (const id of l.ids) { if (VERDICTS.includes(l.verdict)) out[id] = l.verdict; else delete out[id]; }
34
+ }
35
+ return out;
36
+ }
37
+
38
+ /** One press: the verdict on the points ticked. verdict null takes the verdict back (Undo). */
39
+ function setPoints(dir, body = {}) {
40
+ if (!dir) return { ok: false, status: 500, error: 'no runtime folder' };
41
+ const note = String(body.note || '');
42
+ if (!NOTE_ID.test(note)) return { ok: false, status: 400, error: 'note is the id of a meeting note' };
43
+ const ids = Array.isArray(body.ids) ? [...new Set(body.ids.map(String))] : [];
44
+ if (!ids.length || ids.length > 200 || !ids.every((x) => POINT_ID.test(x))) return { ok: false, status: 400, error: 'ids are the key points to mark, 1 to 200 of them' };
45
+ const verdict = body.verdict == null ? null : String(body.verdict);
46
+ if (verdict !== null && !VERDICTS.includes(verdict)) return { ok: false, status: 400, error: 'verdict is confirmed, wrong or null' };
47
+ fs.mkdirSync(dir, { recursive: true });
48
+ fs.appendFileSync(path.join(dir, FILE), JSON.stringify({ v: 1, note, ids, verdict, at: new Date().toISOString() }) + '\n');
49
+ return { ok: true, points: pointsOf(dir, note) };
50
+ }
51
+
52
+ module.exports = { pointsOf, setPoints, FILE };
@@ -0,0 +1,88 @@
1
+ 'use strict';
2
+ /* news-for-you.js — New for you, which replaces the Inbox (initiative premium-uncovered-features, E2; canvas EvInbox, HmAround).
3
+ *
4
+ * build({ inbox, mentions, work, seen }) → { count, groups: [{ key, label, items }] } PURE
5
+ * readSeen(runtimeDir) → Set of ids · appendSeen(runtimeDir, ids, now) · badSeen(body) → null | the reason
6
+ *
7
+ * New for you holds items for the PM's information only, in three groups (EvInbox):
8
+ * mentions someone named the PM (today's brief, GET /api/brief-page mentions): unread, and not already a next step (in_needs)
9
+ * given a task given to the PM: an open Work item that came from a source (Jira, the work breakdown), not one the PM typed
10
+ * finished what the agents finished while the PM was away: the new items of the agent inbox (GET /api/inbox items)
11
+ * An item leaves once it is seen: its id is in <runtime>/news-seen.jsonl. A mention that asks something, a passed review or a proposal is
12
+ * its initiative's next step, so it is never only here: the inbox item is the news that it finished, and the next step stays on Home.
13
+ * Every word comes from the record. Nothing here decides, replies or sends anything. */
14
+ const fs = require('fs');
15
+ const path = require('path');
16
+
17
+ const SEEN = 'news-seen.jsonl';
18
+ const ID_RE = /^(men|task|prop|goal|work):[^\s]{1,200}$/;
19
+ const clip = (s, n) => { s = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return s.length > n ? s.slice(0, n - 1).trimEnd() + '…' : s; };
20
+ const SRC = { slack: 'Slack', jira: 'Jira', confluence: 'Confluence', mail: 'Mail', wbs: 'Work breakdown', gmail: 'Gmail', figma: 'Figma' };
21
+ const srcName = (s) => SRC[s] || (s ? String(s)[0].toUpperCase() + String(s).slice(1) : '');
22
+ const FIN = { 'work-draft': 'Draft ready', 'work-stopped': 'Agent stopped', proposal: 'Proposal ready', draft: 'Draft ready', 'goal-waiting': 'Goal needs you', 'goal-done': 'Goal finished', 'goal-stopped': 'Goal stopped' };
23
+ const at = (x) => { const t = Date.parse(x || ''); return Number.isFinite(t) ? t : null; };
24
+
25
+ function mentionItems(list, seen) {
26
+ return (Array.isArray(list) ? list : []).filter((m) => m && m.id && !m.read && !m.in_needs && !seen.has('men:' + m.id)).map((m) => ({
27
+ id: 'men:' + m.id, kind: 'mention', mid: m.id, who: clip(m.who || srcName(m.source) || 'Someone', 80), source: m.source || '', where: clip(m.where || '', 80),
28
+ title: clip((m.who || srcName(m.source) || 'Someone') + ' mentioned you' + (m.where ? ' in ' + m.where : ''), 160), text: clip(m.text, 280),
29
+ at: at(m.at), link: m.link || null, initiative: m.initiative || null, asks: !!m.reply,
30
+ }));
31
+ }
32
+ /** The open Work items that came from a source, from GET /api/pm-items' answer (its five lists). */
33
+ function givenItems(v, seen) {
34
+ const w = (v && v.work) || {}, out = [], had = new Set();
35
+ for (const k of ['inbox', 'today', 'upcoming', 'waiting', 'someday']) for (const it of w[k] || []) {
36
+ if (!it || !it.id || it.done || had.has(it.id)) continue;
37
+ const src = it.origin || it.source || 'local';
38
+ if (!(it.assigned === true || (src !== 'local' && src !== 'brief' && src !== 'work'))) continue;
39
+ had.add(it.id);
40
+ if (seen.has('task:' + it.id)) continue;
41
+ out.push({ id: 'task:' + it.id, kind: 'task', tid: it.id, title: clip('New task: ' + (it.title || it.key || it.id), 160), from: srcName(src), key: it.key || '',
42
+ due: it.due || null, initiative: it.initiative || null, link: it.url || it.link || null, at: at(it.created_at) });
43
+ }
44
+ return out;
45
+ }
46
+ function finishedItems(inbox, seen) {
47
+ const items = inbox && inbox.ok !== false && Array.isArray(inbox.items) ? inbox.items : [];
48
+ return items.filter((x) => x && x.id && !seen.has(x.id)).map((x) => ({
49
+ id: x.id, kind: 'finished', what: FIN[x.kind] || 'Finished', title: clip(x.title, 160), product: x.product || '', target: x.target && x.target.title ? x.target.title : '',
50
+ at: Number.isFinite(x.at) ? x.at : null, open: x.open || '', pws: x.pws || '', session: x.session || '', agentKind: x.kind || '',
51
+ }));
52
+ }
53
+
54
+ /** The groups, newest first in each; an empty group is left out. inbox: GET /api/inbox; mentions: the brief page's list (null: no brief today). */
55
+ function build({ inbox = null, mentions = null, work = null, seen = new Set() } = {}) {
56
+ const by = (a, b) => (b.at || 0) - (a.at || 0);
57
+ const groups = [
58
+ { key: 'mentions', label: 'Mentions', items: mentionItems(mentions, seen).sort(by) },
59
+ { key: 'given', label: 'Given to you', items: givenItems(work, seen).sort(by) },
60
+ { key: 'finished', label: 'Finished while you were away', items: finishedItems(inbox, seen).sort(by) },
61
+ ].filter((g) => g.items.length);
62
+ return { count: groups.reduce((n, g) => n + g.items.length, 0), groups, read: { mentions: mentions !== null, inbox: !!(inbox && inbox.ok !== false), work: !!(work && work.ok !== false) } };
63
+ }
64
+
65
+ function readSeen(runtimeDir) {
66
+ const ids = new Set();
67
+ let t; try { t = fs.readFileSync(path.join(runtimeDir, SEEN), 'utf8'); } catch { return ids; }
68
+ for (const l of t.split('\n')) {
69
+ if (!l.trim()) continue;
70
+ let e; try { e = JSON.parse(l); } catch { continue; }
71
+ if (e && Array.isArray(e.ids)) for (const id of e.ids) if (typeof id === 'string') ids.add(id);
72
+ }
73
+ return ids;
74
+ }
75
+ /** The check of a seen body: 1 to 300 item ids. null when it is good, else the reason. Pure. */
76
+ function badSeen(b) {
77
+ if (!b || typeof b !== 'object') return 'a body is required';
78
+ if (!Array.isArray(b.ids) || !b.ids.length || b.ids.length > 300 || !b.ids.every((x) => typeof x === 'string' && ID_RE.test(x))) return 'ids must be 1 to 300 item ids';
79
+ return null;
80
+ }
81
+ function appendSeen(runtimeDir, ids, now = new Date()) {
82
+ fs.mkdirSync(runtimeDir, { recursive: true });
83
+ fs.appendFileSync(path.join(runtimeDir, SEEN), JSON.stringify({ ids, at: now.toISOString() }) + '\n');
84
+ }
85
+ /** The ids the agent inbox knows (its own seen file takes them too, so the inbox's count agrees with New for you). */
86
+ const inboxIds = (ids) => ids.filter((x) => /^(prop|goal|work):/.test(x));
87
+
88
+ module.exports = { SEEN, build, readSeen, badSeen, appendSeen, inboxIds, srcName };
@@ -331,14 +331,16 @@ function openCounts(dir, rows) {
331
331
  * notes, typed notes, summary and transcript. */
332
332
  function search(dir, q) {
333
333
  const ws = norm(q).split(' ').filter(Boolean);
334
- if (!ws.length || norm(q).length < 2) return { ok: true, ids: [] };
334
+ if (!ws.length || norm(q).length < 2) return { ok: true, ids: [], hits: [] };
335
335
  let names = [];
336
- try { names = fs.readdirSync(notes.notesDir(dir)).filter((f) => f.endsWith('.json')); } catch { return { ok: true, ids: [] }; }
337
- const ids = [];
336
+ try { names = fs.readdirSync(notes.notesDir(dir)).filter((f) => f.endsWith('.json')); } catch { return { ok: true, ids: [], hits: [] }; }
337
+ const ids = [], hits = [];
338
338
  for (const f of names) {
339
339
  const n = notes.loadCached(dir, f.slice(0, -5));
340
340
  if (!n || !n.id) continue;
341
341
  let hay = n.title || '';
342
+ /* where the words were said, for the snippet (premium-uncovered-features, MtNotes): an open next step or question first, then what was said */
343
+ const parts = [];
342
344
  if (!n.private) {
343
345
  const fin = n.final_notes || {};
344
346
  const items = (xs) => (Array.isArray(xs) ? xs.map((x) => (x && x.text) || '').join(' ') : '');
@@ -346,12 +348,33 @@ function search(dir, q) {
346
348
  hay += ' ' + [n.overview_pm, fin.overview, fin.purpose, fin.discussion, items(fin.decisions), items(fin.actions), items(fin.questions), n.body,
347
349
  items(sec.overview), items(sec.decisions), items(sec.actions), items(sec.questions), items(n.bullets), items(n.transcript),
348
350
  n.meeting && n.meeting.title].filter(Boolean).join(' ');
351
+ const each = (xs, open) => { for (const x of Array.isArray(xs) ? xs : []) if (x && x.text) parts.push({ text: String(x.text), open }); };
352
+ each(fin.actions, true); each(fin.questions, true); each(sec.actions, true); each(sec.questions, true);
353
+ each(n.transcript, false); each(fin.decisions, false); each(n.bullets, false);
354
+ for (const t of [fin.overview, n.overview_pm, n.body]) if (t) parts.push({ text: String(t), open: false });
349
355
  }
350
356
  const h = ' ' + norm(hay) + ' ';
351
- if (ws.every((w) => h.includes(w))) ids.push(n.id);
357
+ if (!ws.every((w) => h.includes(w))) continue;
358
+ ids.push(n.id);
359
+ hits.push({ id: n.id, ...snipOf(parts, ws) });
352
360
  }
353
- return { ok: true, ids };
361
+ return { ok: true, ids, hits };
362
+ }
363
+ /** The first passage that holds a searched word, about 80 characters around it: { snip, open } (open: it is an open next step or question). */
364
+ function snipOf(parts, ws) {
365
+ for (const p of parts) {
366
+ const low = p.text.toLowerCase();
367
+ let at = -1;
368
+ for (const w of ws) { const i = low.indexOf(w); if (i >= 0 && (at < 0 || i < at)) at = i; }
369
+ if (at < 0) continue;
370
+ let from = Math.max(0, at - 30), to = Math.min(p.text.length, at + 60);
371
+ if (from) { const sp = p.text.indexOf(' ', from); if (sp >= 0 && sp < at) from = sp + 1; } // whole words only
372
+ if (to < p.text.length) { const sp = p.text.lastIndexOf(' ', to); if (sp > at) to = sp; }
373
+ const snip = (from ? '…' : '') + p.text.slice(from, to).replace(/\s+/g, ' ').trim() + (to < p.text.length ? '…' : '');
374
+ return { snip, open: p.open };
375
+ }
376
+ return { snip: '', open: false };
354
377
  }
355
378
 
356
- module.exports = { assign, openCounts, thread, placeOf, search, markDone, bring, unbring, partsOf, topicsOf, carriedOf, nextOf, norm, storeFile,
379
+ module.exports = { assign, openCounts, thread, placeOf, search, snipOf, markDone, bring, unbring, partsOf, topicsOf, carriedOf, nextOf, norm, storeFile,
357
380
  OPEN_WINDOW, TOPIC_WINDOW, TOPIC_MIN, CARRY_WARN };
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+ /* report-confirm.js — what the PM confirmed on a report's Brief tab (initiative premium-uncovered-features, workstream reports; canvas RpBrief
3
+ * "Please confirm": Confirm, Use it). File mode, one line per press of <runtime>/report-confirms.jsonl, beside the Viewer's other runtime records
4
+ * (lib/viewer-meeting.js).
5
+ *
6
+ * confirmsOf(dir, path) → [key] the keys confirmed for one report file; a later 'undo' line takes one back
7
+ * confirm(dir, { path, key, act }) → { ok } | { ok: false, status, error } act: confirm | use | undo
8
+ *
9
+ * A key is the check and a hash of its words (public/pm/rp-parts.js confirmKey), so a check that says something new asks again. Nothing here
10
+ * changes the report file: a Confirm is the PM's word that the figure stands, kept for the Brief. */
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+
14
+ const FILE = 'report-confirms.jsonl';
15
+ const ACTS = ['confirm', 'use', 'undo'];
16
+ const str = (v, n) => String(v == null ? '' : v).trim().slice(0, n);
17
+ const REL = /^(?!\/)(?!.*\.\.)[^\0]{1,400}\.md$/;
18
+
19
+ function readLines(file) {
20
+ let text = '';
21
+ try { text = fs.readFileSync(file, 'utf8'); } catch { return []; }
22
+ const out = [];
23
+ for (const l of text.split('\n')) { if (!l.trim()) continue; try { const o = JSON.parse(l); if (o && typeof o === 'object') out.push(o); } catch { /* a torn line is skipped */ } }
24
+ return out;
25
+ }
26
+
27
+ function confirmsOf(dir, rel) {
28
+ if (!dir || !REL.test(String(rel || ''))) return [];
29
+ const on = new Set();
30
+ for (const l of readLines(path.join(dir, FILE))) {
31
+ if (l.path !== rel || typeof l.key !== 'string') continue;
32
+ if (l.act === 'undo') on.delete(l.key); else on.add(l.key);
33
+ }
34
+ return [...on];
35
+ }
36
+
37
+ function confirm(dir, { path: rel, key, act } = {}) {
38
+ if (!dir) return { ok: false, status: 409, error: 'this server has no runtime folder, so a confirm cannot be kept' };
39
+ if (!REL.test(String(rel || ''))) return { ok: false, status: 400, error: 'path is a report file (.md) inside the workspace' };
40
+ const k = str(key, 120);
41
+ if (!/^[a-z0-9-]+:[a-z0-9]+$/.test(k)) return { ok: false, status: 400, error: 'key is a check id and a hash, like check-figures:1x2y3z' };
42
+ const a = ACTS.includes(act) ? act : 'confirm';
43
+ fs.mkdirSync(dir, { recursive: true });
44
+ fs.appendFileSync(path.join(dir, FILE), JSON.stringify({ v: 1, path: String(rel), key: k, act: a, at: new Date().toISOString() }) + '\n');
45
+ return { ok: true };
46
+ }
47
+
48
+ module.exports = { confirmsOf, confirm, FILE };
@@ -34,7 +34,6 @@ const MODULES = Object.freeze([
34
34
  'routes-initiatives', // Run 2 (2C): Roadmap, List, placements, new initiative, measurements
35
35
  'routes-today', // Run 3 (3B): GET /api/today
36
36
  'routes-capture', // Run 3 (3C): ⌘K capture
37
- 'routes-timeline', // Run 4 (4C): GET /api/timeline
38
37
  'routes-board', // Run 4 (4D): the cross-initiative Board, Release
39
38
  'routes-reports', // Run 5 (5C): drafts, Issue, notes
40
39
  'routes-notes', // meeting-notes Run 1: the Notes view (typed notes, dictation, transcripts, summaries)
@@ -42,33 +41,32 @@ const MODULES = Object.freeze([
42
41
  'routes-intake', // planning-flows run 4: one-line intake draft (drafts only)
43
42
  'routes-pm-items', // planning-flows runs 1-2: the PM's own items and jobs to be done (add, edit, remove, undo)
44
43
  'routes-runs', // console3 agent surfaces: runs grouped for the sessions panel, PM answers, corrections
45
- 'routes-releases', // console3 A4: releases ledger, read side
46
44
  'routes-doc-health', // console3 B2: the six document health checks, recomputed from text
47
45
  'routes-outbox', // console3 B3: the outbox queue, hash-bound confirm (no channel connected)
48
- 'routes-report-families', // console3 B4: the four report families and the claims check (read-only)
49
- 'routes-forecast', // console3 B5: forecast, critical path, time machine and capacity (read-only)
50
46
  'routes-calendar-views', // console3 C2: Day/Week/Month/Quarter/Year cells, Gantt and the strategy lens (read-only)
51
47
  'routes-briefing', // console3 C1: the day-part Briefing cards from the signal engine (read-only)
52
48
  'routes-briefing-premium', // briefing-premium: the premium Briefing's page model from repository state (read-only)
53
49
  'routes-my-work-premium', // briefing-premium-work: the premium My work page's model from the Work page's own list (read-only)
54
50
  'routes-board-premium', // briefing-premium-board: the premium Board page's model from the Initiatives page's own routes (read-only)
55
51
  'routes-board-trail', // premium-agreed-design: what the Agreed Board draws beside each initiative, derived from the repository (read-only)
52
+ 'routes-board-docs', // premium-uncovered-features (Board): when each document of the Documents tab changed and by whom, from git (read-only)
53
+ 'routes-board-grill', // premium-uncovered-features (Board): a new initiative's Why, material and first questions (page press; file mode)
56
54
  'routes-insights-premium', // briefing-premium-insights: the premium Insights page's model from the KR metric records and report files (read-only)
57
55
  'routes-home-desk', // premium-agreed-design (Home): seen marks, queued messages, the weekly update's recipients and sends, stakeholders (page press; file mode)
56
+ 'routes-home-review', // premium-uncovered-features (Home): the weekly review's four steps and the untouched work looked at (page press; file mode)
58
57
  'routes-initiative-premium', // briefing-premium-initiative: the premium initiative page's model from the Initiatives sheet's own routes (read-only)
58
+ 'routes-initiative-layout', // premium-uncovered-features (Initiative): Moves on by itself, held stages, task groups and saved group sets (page press; file mode)
59
59
  'routes-brief-page', // console3 Briefing as the brief: Today agenda, Needs you and Mentions (read-only; writes go through routes-pm-items)
60
60
  'routes-mentions', // console3 Briefing Mentions: the PM's read marks (page press only)
61
61
  'routes-inbox', // premium-agent-inbox: the bell's agent results and the PM's seen marks (page press only)
62
+ 'routes-search', // premium-uncovered-features (E1): Search across the repository and every worktree (read-only)
63
+ 'routes-news', // premium-uncovered-features (E2): New for you, the FYI items, and their seen marks (page press only)
64
+ 'routes-slash', // testing fixes: the chat box's / menu, every command Claude Code takes plus the workspace's and the PM's own (read-only)
62
65
  'routes-phone-day', // phone companion: the agent's finished drafts, the evening recap and tomorrow at a glance (read-only)
63
- 'routes-report-facts', // console3 D: GET /api/report-families/facts (read-only, real data only)
64
66
  'routes-records', // console3 E1a: ideas, hypotheses, decisions, KR metrics, bets (GET list; page-press add/edit/reading)
65
67
  'routes-doc-sheet', // console3 E1c: document sheet: revisions, edit with why, propose and accept by hash
66
68
  'routes-calendar-import', // console3 E2a: cached calendar events (page-press import; metadata only, sensitivity required)
67
69
  'routes-roadmap-ops', // console3 E1b: bets (add, move with swap proposal, take off, anchor suggestions), breakdown, people
68
- 'routes-signals', // console3 E2a: signal rules, readings and trips
69
- 'routes-c3-init', // console3 Initiatives sub-views of /c3.html: Roadmap and Breakdown reads (read-only)
70
- 'routes-c3-timeline', // console3 Initiatives Timeline of /c3.html: every check of the plan as a whole frame, three sources in one Gantt (read-only)
71
- 'routes-c3-life', // console3 Lifecycle lens panels: newest evaluation per initiative, corrections per run, evidence sources (read-only)
72
70
  'routes-c3-strategy', // console3 Calendar Quarter and Year panes: outcomes, north star, signals, synergy, bets (read-only)
73
71
  'routes-c3-reports', // console3 Reports dashboards: library, per-scope data, page-press layouts (layouts are the only write)
74
72
  'routes-onboarding', // onboarding-scan-and-map slice 2: first run (scan read-only, structure, import into the overlay, undo, first Briefing)
@@ -79,7 +77,9 @@ const MODULES = Object.freeze([
79
77
  'routes-meeting-focus', // console3 Meeting focus: the meeting, its note's talk, the companion's notes (GET); topic corrections and Ask PMOS quietly (page press)
80
78
  'routes-meeting-replay', // meeting-material-replay: the note, the Focus state and the shots joined for the Replay page (GET, read-only)
81
79
  'routes-meeting-material', // meeting-material-replay: the material the PM links to a meeting (GET list and suggest; page-press POST add and remove; meeting-material.jsonl)
80
+ 'routes-meeting-points', // premium-uncovered-features (meetings): the Replay's Confirm and Not right on a meeting's key points (meeting-points.jsonl)
82
81
  'routes-viewer', // premium-agreed-design (viewer): agenda minutes, what recording listens to, a next step made a drafted ticket, the report's Issue checks
82
+ 'routes-report-confirm', // premium-uncovered-features (reports): the Brief tab's Confirm and Use it (report-confirms.jsonl in the runtime folder)
83
83
  'routes-stage-tools', // stage-tools-records: the records the PM edits per stage, what PMOS holds per stage, the sprint burndown
84
84
  'routes-orchestrator', // agent-orchestrator: the status of the capacity governor and the PM's stop switch (orchestrator-stop.json)
85
85
  'routes-driver', // initiative-driver: the Agent strip's data, Keep, Send back, Drop, Pause and the board mode (driver.jsonl)
@@ -0,0 +1,46 @@
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
+ };
@@ -0,0 +1,90 @@
1
+ 'use strict';
2
+ /* routes-board-grill.js — the first questions of a new initiative on the Board (initiative premium-uncovered-features, Board: BdNew, BdGrill).
3
+ *
4
+ * GET /api/board-grill?ws=<id>&id=<initiative> → { ok, id, why, material, questions, summary }
5
+ * GET /api/board-grill?ws=<id>&ids=<id,id,…> → { ok, items: { [id]: summary } } only the initiatives with a line in the file
6
+ * POST /api/board-grill/start { ws, id, why?, links?: [{ url, label? }] } the New initiative panel's Why and links
7
+ * POST /api/board-grill/file { ws, id, name, type?, data } one file (base64, at most 4 MB) kept under <state>/material/<id>/
8
+ * POST /api/board-grill/answer { ws, id, q, answer } one answer; an empty answer clears it
9
+ * POST /api/board-grill/later { ws, id } keep the open questions as the next step
10
+ * lib/board-grill.js holds the rules. FILE MODE ONLY: <state>/triage-answers.jsonl, append-only. Every POST is a page press
11
+ * (pm-guard requirePagePress). Nothing is sent anywhere. */
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+ const guard = require('./pm-guard.js');
15
+ const pmItems = require('./pm-items.js');
16
+ const G = require('./board-grill.js');
17
+
18
+ const ID_RE = /^[a-z0-9][\w.-]{0,80}$/i;
19
+ const MAX_FILE = 4 * 1024 * 1024;
20
+ const str = (v, n) => String(v == null ? '' : v).replace(/[\u0000-\u001f]+/g, ' ').trim().slice(0, n);
21
+ function stateDir(ctx, w) {
22
+ let d = null;
23
+ try { d = ctx.stateDirFor ? ctx.stateDirFor(w, { create: true }) : null; } catch { d = null; }
24
+ return d || (w && w.root ? path.join(w.root, 'pmos', 'state') : null);
25
+ }
26
+ const fileOf = (sd) => path.join(sd, 'triage-answers.jsonl');
27
+ const read = (f) => { try { return pmItems.readLines(f).filter(Boolean); } catch { return []; } };
28
+ const linkOk = (u) => /^https?:\/\/[^\s]{3,}$/i.test(String(u || ''));
29
+ const one = (lines, id) => { const st = G.fold(lines, id); return { ok: true, id, why: st.why, material: st.material, questions: G.questionsOf(st), summary: G.summaryOf(st) }; };
30
+
31
+ module.exports = {
32
+ prefixes: ['/api/board-grill'],
33
+ handle: async (req, res, url, ctx) => {
34
+ const p = url.pathname;
35
+ if (!p.startsWith('/api/board-grill')) return false;
36
+ const bad = (error, code) => { ctx.json(res, { ok: false, error }, code || 400); return true; };
37
+ if (p === '/api/board-grill') {
38
+ if (req.method !== 'GET') return bad('GET only', 405);
39
+ const w = ctx.getWs ? ctx.getWs(url.searchParams.get('ws') || null) : null;
40
+ if (!w || !w.root) return bad('that workspace is not registered', 404);
41
+ const sd = stateDir(ctx, w), lines = sd ? read(fileOf(sd)) : [];
42
+ const ids = String(url.searchParams.get('ids') || '').split(',').map((s) => s.trim()).filter(Boolean).slice(0, 150);
43
+ if (ids.length) {
44
+ if (!ids.every((x) => ID_RE.test(x))) return bad('a bad initiative id');
45
+ const items = {};
46
+ for (const id of ids) if (lines.some((l) => l && l.initiative === id)) items[id] = G.summaryOf(G.fold(lines, id));
47
+ ctx.json(res, { ok: true, items });
48
+ return true;
49
+ }
50
+ const id = url.searchParams.get('id') || '';
51
+ if (!ID_RE.test(id)) return bad('name the initiative: id=<id>');
52
+ ctx.json(res, one(lines, id));
53
+ return true;
54
+ }
55
+ if (req.method !== 'POST') return bad('POST only', 405);
56
+ const got = await ctx.readJson(req);
57
+ if (!got.ok) return bad('invalid JSON body');
58
+ const b = got.body || {};
59
+ const g = guard.requirePagePress(req, b);
60
+ if (!g.ok) { ctx.json(res, { ok: false, error: g.error }, g.status); return true; }
61
+ const w = ctx.getWs ? ctx.getWs(b.ws || null) : null;
62
+ if (!w || !w.root) return bad('that workspace is not registered', 404);
63
+ if (!ID_RE.test(String(b.id || ''))) return bad('id must name the initiative');
64
+ const sd = stateDir(ctx, w);
65
+ if (!sd) return bad('this workspace has no state folder', 409);
66
+ const f = fileOf(sd), now = new Date();
67
+ if (p === '/api/board-grill/start') {
68
+ const links = (Array.isArray(b.links) ? b.links : []).slice(0, 20).map((k) => ({ url: str(k && k.url, 600), label: str(k && (k.label || k.url), 160) }));
69
+ if (links.some((k) => !linkOk(k.url))) return bad('a link must start with http:// or https://');
70
+ pmItems.appendEvent(f, { kind: 'start', initiative: b.id, why: str(b.why, 400), links }, now);
71
+ } else if (p === '/api/board-grill/file') {
72
+ const name = path.basename(str(b.name, 120)).replace(/[^\w .()-]+/g, '_');
73
+ if (!name || name.startsWith('.')) return bad('name the file');
74
+ const buf = Buffer.from(String(b.data || ''), 'base64');
75
+ if (!buf.length) return bad('the file is empty');
76
+ if (buf.length > MAX_FILE) return bad('a file can be at most 4 MB');
77
+ const dir = path.join(sd, 'material', b.id);
78
+ fs.mkdirSync(dir, { recursive: true });
79
+ fs.writeFileSync(path.join(dir, name), buf);
80
+ pmItems.appendEvent(f, { kind: 'file', initiative: b.id, name, type: str(b.type, 80), size: buf.length, path: path.relative(w.root, path.join(dir, name)).split(path.sep).join('/') }, now);
81
+ } else if (p === '/api/board-grill/answer') {
82
+ if (!G.QUESTIONS.some((x) => x.key === b.q)) return bad('q must name a question');
83
+ pmItems.appendEvent(f, { kind: 'answer', initiative: b.id, q: b.q, answer: str(b.answer, 500) }, now);
84
+ } else if (p === '/api/board-grill/later') {
85
+ pmItems.appendEvent(f, { kind: 'later', initiative: b.id }, now);
86
+ } else return bad('no such route', 404);
87
+ ctx.json(res, one(read(f), b.id));
88
+ return true;
89
+ },
90
+ };
@@ -0,0 +1,108 @@
1
+ 'use strict';
2
+ /* routes-home-review.js — the PM's weekly review on Home (initiative premium-uncovered-features, H1; canvas HmReview).
3
+ *
4
+ * GET /api/home-review?ws=<id>
5
+ * → { ok, week, steps: { [step]: { note, at } }, kept: { [initiative]: { how, at } }, last: { week, at, minutes } | null }
6
+ * POST /api/home-review/step { ws, week, step, note? } one of the four steps is done this week ("4 sorted · 1 kept")
7
+ * POST /api/home-review/keep { ws, week, initiative, how } an untouched initiative was looked at: kept going, or asked in chat
8
+ *
9
+ * The review has four steps: sort (what came in), wait (what the PM waits on), untouched (work with no change for 14 days or more) and
10
+ * pick (next week's three). A week is named by its Monday (YYYY-MM-DD). "last" is the newest earlier week with all four steps done, and how
11
+ * long it took from its first step to its last.
12
+ *
13
+ * FILE MODE ONLY, append-only JSONL (D64/D66): <state>/weekly-review.jsonl in the workspace's state folder (stateDirFor). Nothing is
14
+ * rewritten; the last line for a step or an initiative in a week wins when read back. Every POST is a page press (pm-guard
15
+ * requirePagePress): an agent session cannot write the review. Nothing here sends anything to anyone. */
16
+ const path = require('path');
17
+ const guard = require('./pm-guard.js');
18
+ const pmItems = require('./pm-items.js');
19
+
20
+ const STEPS = ['sort', 'wait', 'untouched', 'pick'];
21
+ const HOWS = ['kept', 'asked', 'held'];
22
+ const WEEK_RE = /^\d{4}-\d{2}-\d{2}$/;
23
+ const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,80}$/;
24
+ const str = (v, n) => String(v == null ? '' : v).replace(/[\u0000-\u001f]+/g, ' ').trim().slice(0, n);
25
+ const pad = (n) => String(n).padStart(2, '0');
26
+
27
+ /** The Monday of the week that holds `now`, as YYYY-MM-DD in local time. */
28
+ function weekOf(now) {
29
+ const d = new Date(now); d.setHours(0, 0, 0, 0);
30
+ d.setDate(d.getDate() - ((d.getDay() + 6) % 7));
31
+ return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate());
32
+ }
33
+ const fileOf = (sd) => path.join(sd, 'weekly-review.jsonl');
34
+ function stateDir(ctx, w) {
35
+ let d = null;
36
+ try { d = ctx.stateDirFor ? ctx.stateDirFor(w, { create: true }) : null; } catch { d = null; }
37
+ return d || (w && w.root ? path.join(w.root, 'pmos', 'state') : null);
38
+ }
39
+ const read = (f) => { try { return pmItems.readLines(f).filter(Boolean); } catch { return []; } };
40
+
41
+ /** This week's review and the last full one before it. Pure over the lines. */
42
+ function foldReview(lines, week) {
43
+ const weeks = new Map();
44
+ const of = (w) => weeks.get(w) || weeks.set(w, { steps: {}, kept: {} }).get(w);
45
+ for (const l of lines) {
46
+ if (!l || !WEEK_RE.test(String(l.week || ''))) continue;
47
+ const W = of(l.week);
48
+ if (l.kind === 'step' && STEPS.includes(l.step)) W.steps[l.step] = { note: l.note || '', at: l.at };
49
+ if (l.kind === 'keep' && ID_RE.test(String(l.initiative || '')) && HOWS.includes(l.how)) W.kept[l.initiative] = { how: l.how, at: l.at };
50
+ }
51
+ const cur = weeks.get(week) || { steps: {}, kept: {} };
52
+ let last = null;
53
+ for (const [w, W] of weeks) {
54
+ if (w >= week || !STEPS.every((s) => W.steps[s])) continue;
55
+ const at = STEPS.map((s) => Date.parse(W.steps[s].at)).filter((x) => !Number.isNaN(x));
56
+ if (!last || w > last.week) last = { week: w, at: at.length ? new Date(Math.max(...at)).toISOString() : null, minutes: at.length ? Math.max(1, Math.round((Math.max(...at) - Math.min(...at)) / 60000)) : null };
57
+ }
58
+ return { week, steps: cur.steps, kept: cur.kept, last };
59
+ }
60
+
61
+ async function body(req, ctx, res) {
62
+ const got = await ctx.readJson(req);
63
+ if (!got.ok) { ctx.json(res, { ok: false, error: 'invalid JSON body' }, 400); return null; }
64
+ const b = got.body || {};
65
+ const g = guard.requirePagePress(req, b);
66
+ if (!g.ok) { ctx.json(res, { ok: false, error: g.error }, g.status); return null; }
67
+ return b;
68
+ }
69
+
70
+ module.exports = {
71
+ prefixes: ['/api/home-review'],
72
+ STEPS, HOWS, weekOf, foldReview,
73
+ handle: async (req, res, url, ctx) => {
74
+ const p = url.pathname;
75
+ if (p !== '/api/home-review' && !p.startsWith('/api/home-review/')) return false;
76
+ const bad = (error, code) => { ctx.json(res, { ok: false, error }, code || 400); return true; };
77
+ const now = ctx.now ? ctx.now() : Date.now();
78
+ if (p === '/api/home-review') {
79
+ if (req.method !== 'GET') return bad('GET only', 405);
80
+ const w = ctx.getWs ? ctx.getWs(url.searchParams.get('ws') || null) : null;
81
+ const sd = w ? stateDir(ctx, w) : null;
82
+ const week = weekOf(now);
83
+ ctx.json(res, { ok: true, ws: w ? w.id : null, ...foldReview(sd ? read(fileOf(sd)) : [], week) });
84
+ return true;
85
+ }
86
+ if (p !== '/api/home-review/step' && p !== '/api/home-review/keep') return bad('no such route', 404);
87
+ if (req.method !== 'POST') return bad('POST only', 405);
88
+ const b = await body(req, ctx, res);
89
+ if (!b) return true;
90
+ const week = b.week == null || b.week === '' ? weekOf(now) : String(b.week);
91
+ if (!WEEK_RE.test(week)) return bad('week must be a date (YYYY-MM-DD)');
92
+ const w = ctx.getWs ? ctx.getWs(b.ws || null) : null;
93
+ if (!w) return bad('that workspace is not registered', 404);
94
+ const sd = stateDir(ctx, w);
95
+ if (!sd) return bad('this workspace has no state folder', 409);
96
+ const at = new Date(now);
97
+ if (p === '/api/home-review/step') {
98
+ if (!STEPS.includes(b.step)) return bad('step must be one of: ' + STEPS.join(', '));
99
+ pmItems.appendEvent(fileOf(sd), { kind: 'step', week, step: b.step, note: str(b.note, 200) }, at);
100
+ } else {
101
+ if (!ID_RE.test(String(b.initiative || ''))) return bad('initiative must name an initiative');
102
+ if (!HOWS.includes(b.how)) return bad('how must be one of: ' + HOWS.join(', '));
103
+ pmItems.appendEvent(fileOf(sd), { kind: 'keep', week, initiative: b.initiative, how: b.how }, at);
104
+ }
105
+ ctx.json(res, { ok: true, ...foldReview(read(fileOf(sd)), week) });
106
+ return true;
107
+ },
108
+ };
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+ /* routes-initiative-layout.js — the PM's layout choices for one initiative inside Home (initiative premium-uncovered-features, Initiative).
3
+ *
4
+ * GET /api/initiative-layout?ws=<id>&initiative=<id>
5
+ * → { ok, initiative, auto, held, by, names, of, stage, sets: [{ name, names }] }
6
+ * POST /api/initiative-layout { ws, kind, initiative?, ... } one press (lib/initiative-layout.js eventOf):
7
+ * auto { on } · hold { stage } · by { by } · groups { names } · rename { from, to } · place { task, group } · stage { task, stage }
8
+ * set { name, names } · unset { name }
9
+ * → the same answer as GET, after the line is written
10
+ *
11
+ * FILE MODE ONLY, append-only JSONL (D64/D66): <state>/initiative-layout.jsonl in the workspace's state folder (stateDirFor).
12
+ * Every POST is a page press (pm-guard requirePagePress): an agent session cannot write it. */
13
+ const path = require('path');
14
+ const guard = require('./pm-guard.js');
15
+ const pmItems = require('./pm-items.js');
16
+ const L = require('./initiative-layout.js');
17
+
18
+ const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,80}$/;
19
+ function stateDir(ctx, w) {
20
+ let d = null;
21
+ try { d = ctx.stateDirFor ? ctx.stateDirFor(w, { create: true }) : null; } catch { d = null; }
22
+ return d || (w && w.root ? path.join(w.root, 'pmos', 'state') : null);
23
+ }
24
+ const fileOf = (sd) => path.join(sd, 'initiative-layout.jsonl');
25
+ const read = (f) => { try { return pmItems.readLines(f).filter(Boolean); } catch { return []; } };
26
+ const answer = (lines, ini) => ({ ok: true, initiative: ini || null, ...(ini ? L.fold(lines, ini) : {}), sets: L.foldSets(lines) });
27
+
28
+ module.exports = {
29
+ prefixes: ['/api/initiative-layout'],
30
+ handle: async (req, res, url, ctx) => {
31
+ if (url.pathname !== '/api/initiative-layout') { if (url.pathname.startsWith('/api/initiative-layout')) { ctx.json(res, { ok: false, error: 'no such route' }, 404); return true; } return false; }
32
+ const bad = (error, code) => { ctx.json(res, { ok: false, error }, code || 400); return true; };
33
+ if (req.method === 'GET') {
34
+ const ini = url.searchParams.get('initiative') || '';
35
+ if (ini && !ID_RE.test(ini)) return bad('initiative must name an initiative');
36
+ const w = ctx.getWs ? ctx.getWs(url.searchParams.get('ws') || null) : null;
37
+ const sd = w ? stateDir(ctx, w) : null;
38
+ ctx.json(res, answer(sd ? read(fileOf(sd)) : [], ini));
39
+ return true;
40
+ }
41
+ if (req.method !== 'POST') return bad('GET or POST only', 405);
42
+ const got = await ctx.readJson(req);
43
+ if (!got.ok) return bad('invalid JSON body');
44
+ const b = got.body || {};
45
+ const g = guard.requirePagePress(req, b);
46
+ if (!g.ok) return bad(g.error, g.status);
47
+ const ev = L.eventOf(b);
48
+ if (!ev.ok) return bad(ev.error);
49
+ const w = ctx.getWs ? ctx.getWs(b.ws || null) : null;
50
+ if (!w) return bad('that workspace is not registered', 404);
51
+ const sd = stateDir(ctx, w);
52
+ if (!sd) return bad('this workspace has no state folder', 409);
53
+ pmItems.appendEvent(fileOf(sd), ev.event, new Date());
54
+ ctx.json(res, answer(read(fileOf(sd)), ev.event.initiative || (ID_RE.test(String(b.initiative || '')) ? b.initiative : '')));
55
+ return true;
56
+ },
57
+ };
@@ -88,8 +88,11 @@ module.exports = {
88
88
  try { ins = require('./insights-records.js').read(root); } catch { missing.push('insights records'); }
89
89
  try { budgets = require('./insights-goals.js').parseBudgets(require('fs').readFileSync(require('path').join(root, 'planning', 'okrs', 'health-budgets.md'), 'utf8')); } catch { budgets = null; }
90
90
  }
91
+ // premium-uncovered-features (IsMenus): the product picker says how many goals each product's workspace records; a workspace that cannot be read says none
92
+ const counts = new Map();
93
+ const goalsIn = (w) => { if (!counts.has(w)) { let n = null; try { n = w === ws ? outcomes.length : require(repoScript('records/index.js')).list(recordsDirFor(ctx, w), 'kr-metrics').length; } catch { n = null; } counts.set(w, n); } return counts.get(w) === null ? {} : { goals: counts.get(w) }; };
91
94
  const model = Insights.build({
92
- now: Date.now(), board: pick ? { ws: pick.ws, id: pick.id, name: pick.name } : { ws, id: null, name: 'Insights' }, boards: all.map((x) => ({ ws: x.ws, id: x.id, name: x.name })),
95
+ now: Date.now(), board: pick ? { ws: pick.ws, id: pick.id, name: pick.name } : { ws, id: null, name: 'Insights' }, boards: all.map((x) => Object.assign({ ws: x.ws, id: x.id, name: x.name }, goalsIn(x.ws))),
93
96
  outcomes, reports: reportsOk ? rp.body.reports || [] : [], reportsOk, missing, saved, mine,
94
97
  setups: setupsOk ? su.body : null, pinned, leads, archived, initiatives, goalMeta, ins, budgets,
95
98
  });