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,289 @@
1
+ /* pm/home-list.js — Home's one list, pure (initiative premium-uncovered-features, H1 and H2; canvas HmMyWork, HmReview, HmProducts, HmDay,
2
+ * HmDecide, HmMic, HmPhone, HmPhone2).
3
+ *
4
+ * There is no Needs you group and no Your list (PM, canvas review 2026-10-22/23): every next step sits under its initiative, and the list is
5
+ * grouped by product. This file turns what the routes answer into what the list draws, and touches no page, so a node test imports it:
6
+ * productsOf(D) the products the list shows: the board's own first, then every product Home reads (GET /api/briefing-premium products)
7
+ * and every product a next step names; each with its goals line ("2 of 4 goals on track")
8
+ * homeList(D, o) { greet, yours, filters, groups, untouched, focus, filter } for the list column
9
+ * todayCard(D, o) the Today card through the day: day (greeting and the day's load), soon (a meeting in 15 minutes or less), live
10
+ * (a meeting on now), rec (a recording that is no calendar meeting), eod (the end of a day with something open), clear
11
+ * staleInis(D, now, days) open initiatives with no change for `days` days or more, the longest first
12
+ * reviewModel(D, now) the weekly review's four steps, from the My work model, the stale initiatives and the review log (GET /api/home-review)
13
+ * fileUnder(text, inis) the initiative a typed task names (its title or id in the text), or null: the task then goes on the PM's own list
14
+ * D is home-data.js's D plus { work (GET /api/my-work-premium model), items (GET /api/boards/items), others ([{ ws, name, model }], the boards of
15
+ * the other products), phoneDay (GET /api/phone-day), review (GET /api/home-review) }. A part that did not answer is left out, never guessed. */
16
+ import { needsOf, boardRows, productCard, productName, sessionRow, iniOfSession, todayOf, live, OPEN, hm } from './home-data.js';
17
+
18
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
19
+ const DOW = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
20
+ const RANK = { needs: 4, blocked: 3, working: 2, quiet: 1 };
21
+ const pad = (n) => String(n).padStart(2, '0');
22
+ const cap1 = (s) => (s ? String(s).charAt(0).toUpperCase() + String(s).slice(1) : '');
23
+ const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
24
+ const isoDay = (ms) => { const d = new Date(ms); return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()); };
25
+ const dayDiff = (iso, now) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); if (!m) return null; const a = new Date(+m[1], +m[2] - 1, +m[3]); const t = new Date(now); t.setHours(0, 0, 0, 0); return Math.round((a - t) / 86400000); };
26
+ const shortDay = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] : ''; };
27
+ export const REVIEW_DAY = 5; // Friday
28
+ export const STALE_DAYS = 14;
29
+
30
+ /* ── the greeting ── */
31
+ export function greetWord(now = Date.now()) { const h = new Date(now).getHours(); return h < 12 ? 'Good morning' : h < 18 ? 'Good afternoon' : 'Good evening'; }
32
+ /** "Good morning. 2 next steps are yours today." */
33
+ export function greeting(n, now = Date.now()) {
34
+ return greetWord(now) + '. ' + (n ? plural(n, 'next step is', 'next steps are') + ' yours today.' : 'No next step is yours today.');
35
+ }
36
+
37
+ /* ── products ── */
38
+ const initialsOf = (name) => { const w = String(name || '').trim().split(/[\s_-]+/).filter(Boolean); return (w.length > 1 ? w[0][0] + w[1][0] : String(name || '?').slice(0, 2)).toUpperCase(); };
39
+ function goalsOf(model) {
40
+ const C = productCard({ board: model });
41
+ const n = C.items.length, ok = C.items.filter((x) => x.kind === 'ok').length;
42
+ return { ok, n, text: n ? ok + ' of ' + n + ' goals on track' : 'No goal anchored yet' };
43
+ }
44
+ /* A row the brief tags "Across products" names no product: it is not a group of its own, it sits with the rows that name none. */
45
+ const ACROSS = 'Across products';
46
+ const prodOf = (x) => (x && x.product && x.product !== ACROSS ? x.product : '');
47
+ /** The products the list shows, the board's own product first. Each: { key, ws, name, initials, primary, model, goals, on }. */
48
+ export function productsOf(D) {
49
+ const out = [];
50
+ const add = (p) => { const k = p.ws || 'n:' + String(p.name).toLowerCase(); if (out.some((x) => x.key === k || x.name.toLowerCase() === String(p.name).toLowerCase())) return; out.push({ ...p, key: k, initials: initialsOf(p.name) }); };
51
+ const b = D.board && D.board.board;
52
+ const av = (D.brief && D.brief.products && D.brief.products.available) || [];
53
+ const named = (ws) => ((ws && av.find((a) => a.ws === ws)) || {}).name || '';
54
+ if (D.board) add({ ws: (b && b.ws) || '', name: (b && b.product) || named(b && b.ws) || productName(D), primary: true, model: D.board, goals: goalsOf(D.board) });
55
+ for (const o of D.others || []) if (o && o.model) add({ ws: o.ws, name: o.name || productName({ board: o.model }), primary: false, model: o.model, goals: goalsOf(o.model) });
56
+ for (const a of av) if (a.on) add({ ws: a.ws, name: a.name, primary: false, model: null, goals: null });
57
+ for (const r of needsOf(D)) if (prodOf(r)) add({ ws: '', name: r.product, primary: false, model: null, goals: null });
58
+ return out;
59
+ }
60
+
61
+ /* ── rows ── */
62
+ export const TASKS_SHOWN = 3;
63
+ function taskHint(t, now, mine) {
64
+ const d = t.end ? dayDiff(t.end, now) : null;
65
+ const when = d == null ? '' : d === 0 ? 'due today' : d === 1 ? 'due tomorrow' : d < 0 ? plural(-d, 'day', 'days') + ' late' : 'due ' + shortDay(t.end);
66
+ if (!mine) return ['Waiting on ' + (/^agent:/.test(String(t.owner)) ? 'an agent' : t.owner), when].filter(Boolean).join(' · ');
67
+ return ['Task', t.status && t.status !== 'To do' ? t.status : '', when].filter(Boolean).join(' · ');
68
+ }
69
+ /** How soon a task wants the PM, lower first: due today, a few days late, due this week, long late, later or no day.
70
+ * A task 100 days late is usually a plan that moved, not the thing to do tonight, so it never outranks today's. */
71
+ function urgency(t, now) {
72
+ if (!t.end) return [4, 0];
73
+ const d = dayDiff(t.end, now);
74
+ return d === 0 ? [0, 0] : d < 0 && d >= -7 ? [1, -d] : d > 0 && d <= 7 ? [2, d] : d < 0 ? [3, -d] : [4, d];
75
+ }
76
+ /** The PMOS tasks of an initiative that are not done: the PM's first, by urgency(), then the ones that wait on someone else. */
77
+ export function tasksOf(D, ini, now = Date.now()) {
78
+ const me = String((D.today && D.today.me) || '').toLowerCase();
79
+ const items = ((D.items && D.items.items) || []).filter((t) => t && t.src === 'pmos' && t.kind !== 'Epic' && t.ini === ini && t.status !== 'Done');
80
+ return items.map((t) => {
81
+ const ow = String(t.owner || '').toLowerCase();
82
+ const mine = !ow || /^(pm|you)(:|$)/.test(ow) || (!!me && (ow === me || ow.startsWith(me + ' ')));
83
+ return { id: 't:' + t.uid, kind: 'task', ini, name: t.title, hint: taskHint(t, now, mine), state: mine ? 'quiet' : 'wait', mine, due: t.end || '', late: !!(t.end && dayDiff(t.end, now) < 0), task: t };
84
+ }).map((r) => ({ ...r, rank: urgency(r.task, now) }))
85
+ .sort((a, b) => (b.mine - a.mine) || (a.rank[0] - b.rank[0]) || (a.rank[1] - b.rank[1]));
86
+ }
87
+ function meetRow(m, ini) {
88
+ return { id: 'm:' + (m.id || m.title), kind: 'meeting', ini: ini || null, name: m.title, hint: (m.state === 'now' ? 'Now' : hm(m.start)) + (ini ? ' meeting' : ' · not linked'), state: m.state === 'now' ? 'working' : 'quiet', icon: 'clock', meeting: m };
89
+ }
90
+ /** Today's unread mentions of the PM (GET /api/brief-page mentions). One that names an initiative is that initiative's next step. */
91
+ const mentionsOf = (D) => (D.today && Array.isArray(D.today.mentions) ? D.today.mentions : []).filter((m) => m && !m.read && !m.done);
92
+ function mentionRow(m, ini) {
93
+ return { id: 'men:' + (m.id || m.at), kind: 'mention', ini: ini || null, name: (m.who ? m.who + ' ' : '') + (m.text ? 'asks: ' + m.text : 'named you'),
94
+ hint: (ini ? 'Next step · ' : '') + 'Mention' + (m.where ? ' · ' + m.where : m.source ? ' · ' + cap1(m.source) : ''), state: 'needs', mention: m, link: m.link || '', step: !!ini };
95
+ }
96
+ const meetIni = (m) => (m && (m.initiative || (m.level && m.level.kind === 'initiative' && m.level.id) || (m.about && m.about.kind === 'initiative' && m.about.id))) || null;
97
+ /** A next step's hint without its product's name: the product is the group's header. */
98
+ const bareHint = (x) => { const h = String(x.hint || ''), p = prodOf(x); return p && h.startsWith(p + ' · ') ? h.slice(p.length + 3) : p && h === p ? '' : h; }; // the group names the product; "Across products" stays
99
+ function iniRowOf(D, r, needs, now) {
100
+ const steps = needs.filter((x) => x.ini === r.id && !x.needSession).map((x) => ({ ...x, step: true, hint: 'Next step' + (bareHint(x) ? ' · ' + bareHint(x) : '') }))
101
+ .concat(mentionsOf(D).filter((m) => m.initiative === r.id).map((m) => mentionRow(m, r.id)));
102
+ const ses = (D.sessions || []).filter((s) => live(s) && iniOfSession(s) === r.id).map((s) => sessionRow(s, D.desk && D.desk.roles));
103
+ const tasks = tasksOf(D, r.id, now);
104
+ const meet = todayOf(D).filter((m) => meetIni(m) === r.id && m.state !== 'past').map((m) => meetRow(m, r.id));
105
+ const turn = steps.length > 0 || ses.some((s) => s.state === 'needs' || s.state === 'blocked');
106
+ const mine = tasks.filter((t) => t.mine).length;
107
+ const run = ses.filter((s) => s.state === 'working').length;
108
+ const right = turn ? 'your turn' + (mine ? ' · ' + plural(mine, 'task', 'tasks') : '') : mine ? plural(mine, 'task', 'tasks') : run ? run + ' running' : 'Nothing today';
109
+ // next steps, sessions and today's meetings always show; tasks show the TASKS_SHOWN most urgent, the rest behind "Show N more tasks"
110
+ const kids = [...steps, ...ses.sort((a, b) => (RANK[b.state] || 0) - (RANK[a.state] || 0)), ...tasks.map((t, i) => (i < TASKS_SHOWN ? t : { ...t, extra: true })), ...meet];
111
+ const hint = r.made ? [cap1(r.lane), r.stage].filter(Boolean).join(' · ') : [cap1(r.lane || 'feature'), r.stage].filter(Boolean).join(' · ');
112
+ return { id: 'i:' + r.id, kind: 'ini', ini: r.id, name: r.title, hint, right, turn, busy: kids.length > 0, state: turn ? 'needs' : run ? 'working' : 'quiet', kids, board: r, updated: r.updated || '' };
113
+ }
114
+
115
+ /* ── the list ── */
116
+ const sameName = (a, b) => String(a || '').toLowerCase() === String(b || '').toLowerCase();
117
+ /** o: { filter ('today' | 'waiting' | 'kept' | 'done'), product (a product key, or null for all), now } */
118
+ export function homeList(D, o = {}) {
119
+ const now = o.now || D.now || Date.now();
120
+ const needs = needsOf(D);
121
+ const products = productsOf(D);
122
+ const primary = products.find((p) => p.primary) || null;
123
+ const used = new Set();
124
+ const W = D.work || null;
125
+ const tab = (k) => ((W && W.queue && W.queue.tabs) || []).find((t) => t.key === k) || null;
126
+ const tabRows = (k) => { const t = tab(k); return t ? t.groups.flatMap((g) => g.rows || []) : []; };
127
+ const filters = [
128
+ { key: 'today', label: 'Today' },
129
+ { key: 'waiting', label: 'Waiting', n: W && W.waiting ? W.waiting.rows.length : 0 },
130
+ { key: 'kept', label: 'Kept', n: (tab('kept') || {}).n || 0 },
131
+ { key: 'done', label: 'Done' },
132
+ ];
133
+ const groups = [];
134
+ for (const p of products) {
135
+ if (o.product && o.product !== p.key) continue;
136
+ const rows = (p.model && p.model.initiatives && p.model.initiatives.list && p.model.initiatives.list.rows) || (p.primary ? boardRows(D) : []);
137
+ const open = rows.filter(OPEN);
138
+ const ids = new Set(open.map((r) => r.id));
139
+ const mineNeeds = needs.filter((x) => (x.ini && ids.has(x.ini)) || (p.primary ? x.ini === 'product' || (!x.ini && !prodOf(x) && !x.needSession) || (prodOf(x) && sameName(prodOf(x), p.name)) : prodOf(x) && sameName(prodOf(x), p.name)));
140
+ mineNeeds.forEach((x) => used.add(x.id));
141
+ // a next step whose initiative is not an open row of the board (a prototype, a record the board does not list) still sits under that
142
+ // initiative, never loose under the product (canvas HmMyWork): the initiative's row is made from the step's own subject
143
+ const extra = new Map();
144
+ for (const x of mineNeeds) if (x.ini && x.ini !== 'product' && !ids.has(x.ini) && !x.needSession && !extra.has(x.ini)) extra.set(x.ini, { id: x.ini, title: (x.row && x.row.subject) || x.ini, lane: (x.row && x.row.lane) || '', stage: (x.row && x.row.stage) || '', made: true });
145
+ for (const id of extra.keys()) ids.add(id);
146
+ const inis = open.concat([...extra.values()]).map((r) => iniRowOf(D, r, mineNeeds, now));
147
+ inis.sort((a, b) => (b.turn - a.turn) || (b.busy - a.busy) || (RANK[b.state] || 0) - (RANK[a.state] || 0));
148
+ // the product's own next steps (its weekly update, a decision with no initiative) sit under its header, before the initiatives
149
+ const flat = mineNeeds.filter((x) => !x.ini || !ids.has(x.ini)).filter((x) => !x.needSession).map((x) => ({ ...x, flat: true, hint: bareHint(x) }));
150
+ const turnN = inis.filter((x) => x.turn).length + flat.length;
151
+ const shown = inis.filter((x) => x.turn || x.busy);
152
+ groups.push({ key: 'p:' + p.key, kind: 'product', product: p, name: p.name, primary: !!p.primary, goals: p.goals, flat, inis: shown, rest: inis.filter((x) => !shown.includes(x)),
153
+ count: inis.length, turnN, closedLine: [inis.length ? plural(inis.length, 'initiative', 'initiatives') : '', turnN ? turnN + ' your turn' : ''].filter(Boolean).join(' · ') || 'Nothing open' });
154
+ }
155
+ // sessions that wait on the PM and belong to no initiative of a product: they are next steps too, under "Not in an initiative"
156
+ const looseNeeds = needs.filter((x) => !used.has(x.id) && !(x.ini && groups.some((g) => g.inis.concat(g.rest).some((i) => i.ini === x.ini))));
157
+ const loose = [];
158
+ for (const x of looseNeeds) loose.push({ ...x, flat: true });
159
+ for (const r of tabRows('today')) loose.push({ id: 'w:' + r.key, kind: 'item', key: r.key, name: r.title, hint: [r.overdue ? 'late' : '', r.sub ? r.sub.replace(/^Yours\b/, 'your own note') : 'your own note'].filter(Boolean).join(' · '), check: true, item: r });
160
+ const inIni = new Set(groups.flatMap((g) => g.inis.concat(g.rest)).map((i) => i.ini));
161
+ for (const m of mentionsOf(D).filter((x) => !(x.initiative && inIni.has(x.initiative)))) loose.push(mentionRow(m, null));
162
+ for (const m of todayOf(D).filter((x) => !meetIni(x) && x.state !== 'past')) loose.push(meetRow(m, null));
163
+ for (const s of (D.sessions || []).filter((s) => live(s) && !iniOfSession(s) && s.shown !== 'needs' && s.shown !== 'blocked')) loose.push({ ...sessionRow(s, D.desk && D.desk.roles), loose: true });
164
+ if (!o.product || o.product === 'loose') groups.push({ key: 'loose', kind: 'loose', name: 'Not in an initiative', rows: loose, n: loose.length });
165
+ const stale = staleInis(D, now);
166
+ const untouched = { n: stale.length + ((W && W.review && W.review.n) || 0), inis: stale.length, items: (W && W.review && W.review.n) || 0, day: new Date(now).getDay() === REVIEW_DAY ? 'today' : 'Fri' };
167
+ // a filter other than Today shows one plain list from the PM's own list (the items carry no initiative)
168
+ let list = null;
169
+ if (o.filter === 'waiting') list = { title: 'Waiting on others', rows: (W && W.waiting ? W.waiting.rows : []).map((r) => ({ id: 'w:' + r.key, kind: 'item', key: r.key, name: r.title, hint: r.sub || '', state: 'wait', item: r })), empty: 'Nobody owes you anything.' };
170
+ if (o.filter === 'kept') list = { title: 'Kept for later', rows: tabRows('kept').map((r) => ({ id: 'w:' + r.key, kind: 'item', key: r.key, name: r.title, hint: r.sub || '', check: true, item: r })), empty: 'Nothing is kept for later.' };
171
+ if (o.filter === 'done') {
172
+ const done = tabRows('done').map((r) => ({ id: 'w:' + r.key, kind: 'item', key: r.key, name: r.title, hint: r.sub || 'Done', done: true, item: r }));
173
+ const fin = (D.phoneDay && D.phoneDay.finished) || [];
174
+ for (const f of fin) done.push({ id: 'fin:' + (f.id || f.title), kind: 'finished', name: f.title, hint: f.status === 'review' ? 'Finished · waits for your review' : 'Finished', done: true, finished: f });
175
+ list = { title: 'Done today', rows: done, empty: 'Nothing is done yet today.' };
176
+ }
177
+ const yours = needs.length + mentionsOf(D).filter((m) => m.initiative && groups.some((g) => g.inis.concat(g.rest || []).some((i) => i.ini === m.initiative))).length;
178
+ const nIni = groups.filter((g) => g.kind === 'product').reduce((n, g) => n + g.count, 0);
179
+ // Focus (my-work-premium's focus): the suggestions left for today, else what the PM accepted; null when there is neither
180
+ const F = W && W.focus, sug = (F && F.suggestions) || [], acc = (F && F.accepted) || [];
181
+ const focus = sug.length || acc.length ? { suggested: sug.length, accepted: acc.length, title: sug.length ? sug[0].title + (sug[0].why ? ' · ' + sug[0].why : '') : acc.map((x) => x.title).join(' · ') } : null;
182
+ return { yours, greet: greeting(yours, now), products, primary, filters, filter: o.filter || 'today', groups, list, untouched, focus,
183
+ counts: { products: products.length, initiatives: nIni } };
184
+ }
185
+
186
+ /* ── the Today card through the day ── */
187
+ const DAY_FROM = 9, DAY_TO = 18;
188
+ /** The day's load bar from 09 to 18: free and meeting stretches, the meeting on now marked. { segs: [{ flex, m, now }], sub } */
189
+ export function dayLoad(today, now = Date.now()) {
190
+ const L = (Array.isArray(today) ? today : []).filter((m) => m && m.start).map((m) => ({ m, a: Date.parse(m.start), b: m.end ? Date.parse(m.end) : Date.parse(m.start) + (m.minutes || 30) * 60000 })).filter((x) => !Number.isNaN(x.a)).sort((x, y) => x.a - y.a);
191
+ const d0 = new Date(now); d0.setHours(DAY_FROM, 0, 0, 0); const d1 = new Date(now); d1.setHours(DAY_TO, 0, 0, 0);
192
+ const segs = []; let at = d0.getTime();
193
+ for (const x of L) {
194
+ const a = Math.max(x.a, at), b = Math.min(x.b, d1.getTime());
195
+ if (b <= a) continue;
196
+ if (a > at) segs.push({ flex: Math.round((a - at) / 60000), m: false });
197
+ segs.push({ flex: Math.round((b - a) / 60000), m: true, now: x.m.state === 'now' });
198
+ at = b;
199
+ }
200
+ if (at < d1.getTime()) segs.push({ flex: Math.round((d1.getTime() - at) / 60000), m: false });
201
+ const mins = L.reduce((n, x) => n + Math.max(0, Math.round((x.b - x.a) / 60000)), 0);
202
+ const dur = mins >= 60 ? (Math.round(mins / 30) / 2).toString().replace(/\.0$/, '') + ' h' : mins + ' min';
203
+ const sub = L.length ? plural(L.length, 'meeting', 'meetings') + ' · ' + dur + ' · first at ' + hm(L[0].m.start) : 'No meeting today';
204
+ return { segs: L.length ? segs : [], sub, n: L.length };
205
+ }
206
+ const listWords = (a) => (a.length <= 1 ? a.join('') : a.slice(0, -1).join(', ') + ' and ' + a[a.length - 1]);
207
+ /** The card's mode and words. o: { now, rec: { id, title, at, paused, meeting } | null, hidden (the end-of-day card was closed today), titleOf(ini) } */
208
+ export function todayCard(D, o = {}) {
209
+ const now = o.now || D.now || Date.now();
210
+ const t = todayOf(D);
211
+ const needs = needsOf(D);
212
+ const titleOf = o.titleOf || ((id) => id);
213
+ if (o.rec && !o.rec.meeting) {
214
+ const s = o.rec.at ? Math.max(0, Math.round((now - Date.parse(o.rec.at)) / 1000)) : null;
215
+ return { mode: 'rec', id: o.rec.id, paused: !!o.rec.paused, clock: s == null ? '' : Math.floor(s / 60) + ':' + pad(s % 60), title: o.rec.title || 'A recording', sub: (o.rec.title ? o.rec.title : 'A recording') + ' · not on the calendar' };
216
+ }
217
+ const nowM = t.find((m) => m.state === 'now');
218
+ if (nowM) {
219
+ const mins = Math.max(0, Math.round((now - Date.parse(nowM.start)) / 60000));
220
+ const done = (nowM.before || []).filter((x) => x && x.done).length, all = (nowM.before || []).length;
221
+ return { mode: 'live', meeting: nowM, title: nowM.title, rec: !!(o.rec && o.rec.meeting), mins: mins + ' min', sub: all ? 'To do before: ' + done + ' of ' + all + ' done' : nowM.people && nowM.people.length ? 'With ' + listWords(nowM.people.slice(0, 3)) : 'On now' };
222
+ }
223
+ const soon = t.find((m) => m.state !== 'past' && Date.parse(m.start) > now && Date.parse(m.start) - now <= 15 * 60000);
224
+ if (soon) {
225
+ const inMin = Math.max(1, Math.round((Date.parse(soon.start) - now) / 60000));
226
+ const ini = meetIni(soon);
227
+ const todo = (soon.before || []).filter((x) => x && !x.done).length;
228
+ const parts = [soon.people && soon.people.length ? 'With ' + listWords(soon.people.slice(0, 3)) : '', ini ? titleOf(ini) : '', todo ? plural(todo, 'thing', 'things') + ' to do before' : '', soon.minutes ? soon.minutes + ' min' : ''].filter(Boolean);
229
+ const link = [soon.join, soon.link, soon.url].find((u) => /^https:\/\//.test(String(u || ''))) || '';
230
+ return { mode: 'soon', meeting: soon, time: hm(soon.start), title: soon.title, in: 'in ' + inMin + ' min', sub: parts.join(' · '), link, prep: (soon.prepared || []).length > 0 || todo > 0 };
231
+ }
232
+ const h = new Date(now).getHours();
233
+ if (h >= 17 && !o.hidden) {
234
+ const P = D.phoneDay && D.phoneDay.ok !== false ? D.phoneDay : null;
235
+ const block = needs.find((x) => x.row && /decision|blocked/.test(x.row.kind)) || needs[0] || null;
236
+ const rec = P && P.recap ? P.recap : null;
237
+ // Done is counts, never a meeting's decision text: a decision is not a thing done, and only the ones the PM confirmed count (testing fixes)
238
+ const doneLine = rec ? [rec.done ? plural(rec.done, 'task', 'tasks') + ' done' : '', rec.decided ? plural(rec.decided, 'decision', 'decisions') + ' confirmed' : '', rec.finished ? plural(rec.finished, 'draft', 'drafts') + ' finished' : '', rec.to_confirm ? rec.to_confirm + ' from notes to confirm' : ''].filter(Boolean).join(' · ') : '';
239
+ const runs = (D.sessions || []).filter((s) => s.shown === 'working');
240
+ const over = runs.length ? (runs.length === 1 ? ((runs[0].hx && runs[0].hx.title) || runs[0].name) + ' runs.' : runs.length + ' sessions run.') + ' Results are in New for you by morning.' : '';
241
+ const tm = P && P.tomorrow ? P.tomorrow : null;
242
+ const first = tm && (tm.meetings || []).length ? tm.meetings.slice().sort((a, b) => Date.parse(a.start) - Date.parse(b.start))[0] : null;
243
+ const tomorrow = tm ? (first ? 'First meeting ' + hm(first.start) : 'No meeting') + (needs.length ? ' · ' + needs.length + ' on your list' : '') : '';
244
+ if (!block) return { mode: 'clear', time: hm(new Date(now).toISOString()), line: 'All clear.' + (tomorrow ? ' Tomorrow: ' + tomorrow.charAt(0).toLowerCase() + tomorrow.slice(1) + '.' : '') };
245
+ const waits = block.ini && block.ini !== 'product' ? titleOf(block.ini) : '';
246
+ return { mode: 'eod', time: hm(new Date(now).toISOString()), block, blockLine: block.name + ' still waits on you.', why: waits && waits !== block.name ? waits + ' cannot move on without it.' : block.hint || '', later: !!(block.row && block.row.kind !== 'source'),
247
+ lines: [['Done', doneLine], ['Overnight', over], ['Tomorrow', tomorrow]].filter((x) => x[1]) };
248
+ }
249
+ const load = dayLoad(t, now);
250
+ return { mode: 'day', load };
251
+ }
252
+
253
+ /* ── the weekly review ── */
254
+ /** Open initiatives with no change for `days` days or more, the longest first: { id, title, stage, days, owner }. */
255
+ export function staleInis(D, now = Date.now(), days = STALE_DAYS) {
256
+ return boardRows(D).filter(OPEN).filter((r) => !/^(Deliver|Monitor|Evaluate)$/.test(String(r.stage || '')) && r.updated && !Number.isNaN(Date.parse(r.updated)))
257
+ .map((r) => ({ id: r.id, title: r.title, stage: r.stage || '', days: Math.floor((now - Date.parse(r.updated)) / 86400000), owner: r.owner || null, life: (r.acts && r.acts.life) || null }))
258
+ .filter((r) => r.days >= days && r.life !== 'on-hold').sort((a, b) => b.days - a.days);
259
+ }
260
+ export const REVIEW_STEPS = [['sort', 'Sort what came in'], ['wait', 'Check what you wait on'], ['untouched', 'Look at untouched work'], ['pick', "Pick next week's three"]];
261
+ /** The review of this week: { week, label, steps: [{ key, label, done, now, note, n }], at (the step on now), last, kept } */
262
+ export function reviewModel(D, now = Date.now()) {
263
+ const R = (D.review && D.review.ok) ? D.review : { steps: {}, kept: {}, last: null };
264
+ const W = D.work || null;
265
+ const tab = (k) => ((W && W.queue && W.queue.tabs) || []).find((t) => t.key === k) || { n: 0, groups: [] };
266
+ const n = { sort: tab('inbox').n || 0, wait: W && W.waiting ? W.waiting.rows.length : 0, untouched: staleInis(D, now).length + ((W && W.review && W.review.n) || 0), pick: 3 };
267
+ const steps = REVIEW_STEPS.map(([key, label]) => ({ key, label, done: !!(R.steps && R.steps[key]), note: (R.steps && R.steps[key] && R.steps[key].note) || '', n: n[key] }));
268
+ const at = steps.findIndex((s) => !s.done);
269
+ steps.forEach((s, i) => { s.now = i === at; });
270
+ const d = new Date(now);
271
+ return { week: R.week || '', label: d.getDate() + ' ' + MON[d.getMonth()], steps, at, done: at < 0, last: R.last || null, kept: R.kept || {}, open: d.getDay() === REVIEW_DAY && at >= 0, started: steps.some((s) => s.done) };
272
+ }
273
+
274
+ /* ── filing a typed task ── */
275
+ const words = (s) => String(s || '').toLowerCase().replace(/[^a-z0-9 ]+/g, ' ').split(/\s+/).filter((w) => w.length > 2);
276
+ /** The open initiative a typed line names: its id, or every word of its title (the longest title that matches), else null. */
277
+ export function fileUnder(text, inis) {
278
+ const t = String(text || '').toLowerCase(), tw = new Set(words(t));
279
+ let best = null, bestN = 0;
280
+ for (const r of inis || []) {
281
+ if (!r || !r.id) continue;
282
+ if (t.includes(String(r.id).toLowerCase())) return r.id;
283
+ const w = words(r.title);
284
+ if (w.length && w.length <= 6 && w.every((x) => tw.has(x)) && w.length > bestN) { best = r.id; bestN = w.length; }
285
+ }
286
+ return best;
287
+ }
288
+ export const dayOf = (now = Date.now()) => isoDay(now);
289
+ export const dowOf = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? DOW[new Date(+m[1], +m[2] - 1, +m[3]).getDay()] : ''; };
@@ -2,19 +2,18 @@
2
2
  * (initiative premium-agreed-design, Home: "keep every uncovered feature usable, in the cozy style, with a small Waiting for design marker").
3
3
  *
4
4
  * Each opens in the Viewer card (cozy-viewer.js), never the old dialog, and reads and writes through the routes the old pages used:
5
- * openSettings() Updates (GET /api/kit/status, POST /api/kit/check|update|upgrade-app), Workspaces (GET|POST /api/workspaces, /forget),
6
- * Connectors (GET|POST /api/proactive/settings)
7
- * openSources() GET /api/sources, POST /api/sources/refresh and /refresh-all
8
- * openMyWork(tab) home-work.js: Your list, Waiting on others, Weekly review, Untouched; an item's fields and agent; Focus and jobs;
5
+ * openSettings() the designed Settings (pm/cozy-settings.js, premium-uncovered-features E3)
6
+ * openSources() the designed Sources (pm/cozy-sources.js, E3); readLine below gives its read lines
7
+ * openMyWork(tab) home-work.js: the old My work page. Home no longer opens it (Home's list is the list); an item and Focus open alone;
9
8
  * keys and swipe on the rows (GET /api/my-work-premium; the /api/pm-items, /api/pm-jobs and /api/my-work presses)
10
- * openAround(key?) home-around.js: the agents' proposals, mentions, portfolio pulse, horizon scan, report found, data freshness, the prep
11
- * line and today's digests (the old Briefing card's reads and presses)
9
+ * openAround(key?) home-around.js: Around you is gone (premium-uncovered-features, HmAround); its views stay, opened from New for you
12
10
  * openEndOfDay() GET /api/phone-day: what finished today, the recap and tomorrow's meetings
13
11
  * openProducts() which products Home reads (GET /api/briefing-premium products, POST /api/settings ws.briefing.include)
14
- * openSearch() initiatives, core documents and sessions by name (GET /api/board-premium, /api/core-docs, /api/sessions)
15
- * openInbox() the agents' results that wait on you (GET /api/inbox, POST /api/inbox/seen)
12
+ * openSearch(go) the designed Search (pm/cozy-search.js, E1): the repository and every worktree
13
+ * openInbox(go) New for you (pm/cozy-news.js, E2), which replaces the agents' results
16
14
  * openRecorder() a note recorded now with no calendar event (the Viewer's newNote, else POST /api/notes/new)
17
- * moreItems the ⋯ menu's rows, [key, label, icon]
15
+ * moreItems the ⋯ menu's rows, [key, label, icon]: the features the place menu does not hold (Search, New for you, Sources and
16
+ * Settings are in the place menu, cozy-nav.js)
18
17
  * Every write is the PM's press (pmPost carries the launch nonce). Nothing here sends anything outside PMOS. */
19
18
  import { pmGet, pmPost } from './http.js';
20
19
  import { open as vwOpen } from './cozy-viewer.js';
@@ -33,9 +32,7 @@ function card(o, draw) {
33
32
  }
34
33
 
35
34
  export const moreItems = [
36
- ['work', 'My work', 'list'], ['around', 'Around you', 'info'], ['inbox', 'Agent results', 'list'], ['eod', 'End of the day', 'cal'],
37
- ['cal', 'Calendar', 'cal'], ['rec', 'Record a note', 'mic'], ['search', 'Search', 'doc'], ['products', 'Products', 'chart'],
38
- ['sources', 'Sources', 'source'], ['settings', 'Settings', 'gear'],
35
+ ['eod', 'End of the day', 'cal'], ['cal', 'Calendar', 'cal'], ['rec', 'Record a note', 'mic'], ['products', 'Products', 'chart'],
39
36
  ];
40
37
 
41
38
  /** The ⋯ list itself in the Viewer, for a page with no menu of its own: items are [label, open]. */
@@ -46,56 +43,8 @@ export function listCard(items) {
46
43
  });
47
44
  }
48
45
 
49
- /* ── Settings ── */
50
- const SRC = { calendar: 'Calendar', wispr: 'Wispr Flow', mail: 'Mail', slack: 'Slack', jira: 'Jira', confluence: 'Confluence', github: 'GitHub', drive: 'Google Drive', figma: 'Figma', website: 'Your websites' };
51
- export function openSettings() {
52
- const M = { ws: null, st: {}, src: null, con: {}, conn: [], msg: '', busy: false };
53
- const draw = (b) => {
54
- const home = M.ws && M.ws[0] ? M.st[M.ws[0].id] : null;
55
- const latest = home && (home.latest || (home.lastCheck && home.lastCheck.latest));
56
- const behind = M.ws ? M.ws.filter((w) => M.st[w.id] && M.st[w.id].kitBehind) : [];
57
- const appBehind = !!(home && home.appBehind && !(home.app && home.app.fromCheckout));
58
- const upd = !home ? '<p class="hx-n">Reading the versions.</p>'
59
- : row('PMOS ' + ((home.app && home.app.version) || '?'), latest ? (appBehind || behind.length ? latest + ' is ready' : 'Up to date · the newest kit is ' + latest) : 'Press Check now to ask for the latest version',
60
- btn('Check now', 'data-x="check"') + (appBehind || behind.length ? btn('Update', 'data-x="update"', true) : ''));
61
- const ws = M.ws === null ? '<p class="hx-n">Reading the repositories.</p>' : M.ws.map((x) => row(x.label || x.name || x.id, (x.root || '') + (x.home ? ' · home' : ''), x.home ? '' : btn('Remove', `data-rm="${esc(x.id)}"`))).join('')
62
- + '<div class="hx-add"><input id="hxRoot" placeholder="Folder path of a repository" aria-label="Folder path of a repository"><button type="button" class="hx-b pri" data-x="add">Add</button></div>';
63
- const con = M.src === null ? '<p class="hx-n">Reading the connectors.</p>' : Object.keys(SRC).filter((k) => k in M.src).map((k) => row(SRC[k], M.src[k] ? 'Home reads it' : 'Home does not read it', `<button type="button" class="hx-sw" role="switch" aria-checked="${!!M.src[k]}" data-src="${k}">${M.src[k] ? 'On' : 'Off'}</button>`)).join('')
64
- + M.conn.filter((c) => !c.source).map((c) => row(c.label, M.con[c.name] ? 'On' : 'Your sessions can use it', `<button type="button" class="hx-sw" role="switch" aria-checked="${!!M.con[c.name]}" data-conn="${esc(c.name)}">${M.con[c.name] ? 'On' : 'Off'}</button>`)).join('');
65
- b.innerHTML = WAIT + sec('Updates', upd) + sec('Workspaces', ws) + sec('Connectors', con) + `<p class="hx-n" role="status">${esc(M.msg)}</p>`;
66
- };
67
- const body = card({ id: 'settings', kind: 'Settings', title: 'Settings', icon: 'gear' }, draw);
68
- const load = async () => {
69
- const [w, p] = await Promise.all([pmGet('/api/workspaces'), pmGet('/api/proactive/settings')]);
70
- M.ws = w && Array.isArray(w.workspaces) ? w.workspaces : [];
71
- await Promise.all(M.ws.map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) M.st[x.id] = r; }));
72
- M.src = p && p.ok && p.settings ? { ...p.settings.briefSources } : {}; M.con = p && p.ok && p.settings ? { ...p.settings.connectors } : {};
73
- M.conn = p && p.connectors && Array.isArray(p.connectors.list) ? p.connectors.list : [];
74
- if (body.isConnected) draw(body);
75
- };
76
- body.onclick = async (e) => {
77
- const t = e.target.closest('button'); if (!t || M.busy) return;
78
- M.busy = true; M.msg = '';
79
- try {
80
- if (t.dataset.x === 'check') { for (const w of M.ws) { const r = await pmPost('/api/kit/check', { ws: w.id }); if (r && r.ok) M.st[w.id] = { ...M.st[w.id], ...r }; else M.msg = (r && r.error) || 'The check failed.'; } }
81
- else if (t.dataset.x === 'update') {
82
- const home = M.st[M.ws[0].id], v = home.latest || (home.lastCheck && home.lastCheck.latest);
83
- for (const w of M.ws.filter((x) => M.st[x.id] && M.st[x.id].kitBehind)) { const r = await pmPost('/api/kit/update', { ws: w.id, version: v }); if (!(r && r.ok)) { M.msg = (r && r.error) || 'The kit was not updated.'; break; } M.st[w.id].kitBehind = false; }
84
- if (!M.msg && home.appBehind) { const r = await pmPost('/api/kit/upgrade-app', { ws: M.ws[0].id, version: v }); M.msg = r && r.ok !== false ? 'Installing PMOS ' + v + '. Reload this page when it starts again.' : (r && r.error) || 'The update did not start.'; }
85
- else if (!M.msg) M.msg = 'Updated the kits to ' + v + '.';
86
- } else if (t.dataset.x === 'add') {
87
- const root = (body.querySelector('#hxRoot').value || '').trim();
88
- if (!root) M.msg = 'Paste the folder path of a repository.';
89
- else { const r = await pmPost('/api/workspaces', { root, focus: false }); if (r && r.ok) M.ws = [...M.ws.filter((y) => y.id !== r.workspace.id), r.workspace]; else M.msg = (r && r.error) || 'Not added.'; }
90
- } else if (t.dataset.rm) { const r = await pmPost('/api/workspaces/forget', { id: t.dataset.rm }); if (r && r.ok) { M.ws = M.ws.filter((y) => y.id !== t.dataset.rm); toast('Removed. The folder is untouched.'); } else M.msg = (r && (r.error || r.reason)) || 'Not removed.'; }
91
- else if (t.dataset.src) { const k = t.dataset.src, on = !M.src[k]; const r = await pmPost('/api/proactive/settings', { briefSources: { [k]: on } }); if (r && r.ok) M.src[k] = on; else M.msg = (r && r.error) || 'Not saved.'; }
92
- else if (t.dataset.conn) { const k = t.dataset.conn, on = !M.con[k]; const r = await pmPost('/api/proactive/settings', { connectors: { [k]: on } }); if (r && r.ok) M.con[k] = on; else M.msg = (r && r.error) || 'Not saved.'; }
93
- } finally { M.busy = false; }
94
- draw(body);
95
- };
96
- load();
97
- return body;
98
- }
46
+ /* ── Settings ── the designed dialog (pm/cozy-settings.js) */
47
+ export function openSettings(section) { return import('./cozy-settings.js').then((M) => M.openSettings(section)); }
99
48
 
100
49
  /* ── Sources ── */
101
50
  /** A read line: "<source> read HH:MM" for each id, from one GET /api/sources answer. ids name freshness rows ('initiatives', 'calendar', …)
@@ -110,39 +59,14 @@ export function readLine(s, ids) {
110
59
  return (der ? ({ brief: 'Brief' })[x.id] || x.label : x.label) + ' ' + w;
111
60
  }).filter(Boolean).join(' · ');
112
61
  }
113
- const SST = { fresh: 'Recent', stale: 'Old', never: 'Never read', building: 'Reading now', failed: 'Failed', off: 'Off' };
114
- export function openSources() {
115
- const M = { r: null, msg: '', busy: false };
116
- const draw = (b) => {
117
- const s = M.r;
118
- const rows = !s ? '<p class="hx-n">Reading the sources.</p>' : !s.ok ? '<p class="hx-n">The sources could not be read.</p>'
119
- : s.sources.map((x) => row(x.label, (SST[x.state] || x.state) + (x.as_of ? ' · read ' + when(x.as_of) : ''), x.id === 'repository' ? '' : btn('Refresh', `data-sref="${esc(x.id)}"${x.state === 'off' || x.state === 'building' || M.busy ? ' disabled' : ''}`))).join('');
120
- const h = s && s.ok && s.health ? s.health : null, lv = h ? (h.level === 'bad' ? 'bad' : h.level === 'warn' ? 'warn' : 'ok') : '';
121
- const health = h ? `<div id="srcHealth" class="hx-h ${esc(h.level)}" role="status"><p class="hx-n"><i class="sdot ${lv}" aria-hidden="true"></i>${esc(h.line)}</p>${(h.issues || []).slice(1, 4).map((i) => `<p class="hx-n">${esc(i.text)}</p>`).join('')}</div>` : '';
122
- // which reads each part of Home shows, and when they were read (briefing-source-flow slice 5), from this same read
123
- const shows = s && s.ok ? [['Today', readLine(s, ['calendar'])], ['Needs you', readLine(s, ['initiatives', 'my-work', 'd:brief'])]].filter((x) => x[1]) : [];
124
- b.innerHTML = WAIT + health + (shows.length ? sec('What Home shows', shows.map(([k, v]) => `<p class="hx-n hx-reads" data-reads="${esc(k)}"><b>${esc(k)}:</b> ${esc(v)}</p>`).join('')) : '') + `<div class="hx-top"><p class="hx-n">Each source is read on its own schedule, not live. Refresh all reads every source, then writes Home's list from those reads.</p>${btn(s && s.all && !s.all.done ? 'Refreshing' : 'Refresh all', 'data-x="all"' + (M.busy ? ' disabled' : ''), true)}</div>`
125
- + sec('Sources', rows) + `<p class="hx-n" role="status">${esc(M.msg)}</p>`;
126
- };
127
- const body = card({ id: 'sources', kind: 'Sources', title: 'Sources', icon: 'source' }, draw);
128
- const read = async () => { M.r = await pmGet('/api/sources' + wsQ()); if (body.isConnected) draw(body); };
129
- body.onclick = async (e) => {
130
- const t = e.target.closest('button'); if (!t || M.busy || !M.r || !M.r.ok) return;
131
- M.busy = true; draw(body);
132
- const r = t.dataset.x === 'all' ? await pmPost('/api/sources/refresh-all', { ws: M.r.ws || '' }) : t.dataset.sref ? await pmPost('/api/sources/refresh', { ws: M.r.ws || '', source: t.dataset.sref }) : null;
133
- M.busy = false; M.msg = r && r.ok ? 'Reading again.' : (r && r.error) || 'It did not start.';
134
- await read(); setTimeout(read, 4000);
135
- };
136
- read();
137
- return body;
138
- }
62
+ /** Sources: the designed card in the Viewer (pm/cozy-sources.js). */
63
+ export function openSources() { return import('./cozy-sources.js').then((M) => M.openSources()); }
139
64
 
140
65
  /* ── My work ── */
141
66
  /* ── My work ── the four tabs, the item with its fields and its agent, Focus and jobs, and the keys and swipe on the rows, in home-work.js */
142
67
  export function openMyWork(tab = 'yours') { return import('./home-work.js').then((M) => M.openMyWork(tab)); }
143
68
 
144
- /* ── Around you ── the six rows of the old Briefing card (agent proposals, mentions, portfolio pulse, horizon scan, report found, data freshness),
145
- * the prep line and today's digests, in home-around.js. key opens one row's view at once. */
69
+ /* ── Around you ── gone (HmAround): its parts have one home each, and New for you names them. key opens one of its views (home-around.js). */
146
70
  export function openAround(key) { return import('./home-around.js').then((M) => M.openAround(key)); }
147
71
 
148
72
  /* ── End of the day ── */
@@ -192,52 +116,11 @@ export function openProducts() {
192
116
  return body;
193
117
  }
194
118
 
195
- /* ── Search ── */
196
- export function openSearch(go) {
197
- const M = { q: '', inis: [], docs: [], ses: [] };
198
- const hit = (s) => String(s || '').toLowerCase().includes(M.q.toLowerCase());
199
- const drawList = (b) => {
200
- const L = b.querySelector('#hxRes'); if (!L) return;
201
- if (M.q.length < 2) { L.innerHTML = '<p class="hx-n">Type two letters or more.</p>'; return; }
202
- const a = M.inis.filter((r) => hit(r.title) || hit(r.id)).slice(0, 8).map((r) => `<button type="button" class="hx-hit" data-ini="${esc(r.id)}"><b>${esc(r.title)}</b><em>Initiative · ${esc(r.stage || '')}</em></button>`);
203
- const d = M.docs.filter((x) => hit(x.title) || hit(x.path)).slice(0, 8).map((x) => `<button type="button" class="hx-hit" data-doc="${esc(x.path)}"><b>${esc(x.title)}</b><em>Document · ${esc(x.path)}</em></button>`);
204
- const s = M.ses.filter((x) => hit(x.name) || hit(x.hx && x.hx.title)).slice(0, 8).map((x) => `<button type="button" class="hx-hit" data-ses="${esc(x.id)}"><b>${esc((x.hx && x.hx.title) || x.name)}</b><em>Session · ${esc(x.label || '')}</em></button>`);
205
- L.innerHTML = [...a, ...d, ...s].join('') || '<p class="hx-n">Nothing matches.</p>';
206
- };
207
- const draw = (b) => { b.innerHTML = WAIT + '<label class="hx-q"><input type="search" id="hxQ" placeholder="Search initiatives, documents and sessions" aria-label="Search" autocomplete="off"></label><div id="hxRes"></div>'; drawList(b); const q = b.querySelector('#hxQ'); q.value = M.q; setTimeout(() => q.focus(), 0); };
208
- const body = card({ id: 'search', kind: 'Search', title: 'Find anything', icon: 'doc' }, draw);
209
- body.oninput = (e) => { if (e.target.id === 'hxQ') { M.q = e.target.value.trim(); drawList(body); } };
210
- body.onclick = (e) => { const t = e.target.closest('.hx-hit'); if (!t || !go) return; go(t.dataset); };
211
- Promise.all([pmGet('/api/board-premium' + wsQ()), pmGet('/api/core-docs?level=product' + wsQ('&')), pmGet('/api/sessions')]).then(([b, d, s]) => {
212
- M.inis = b && b.ok && b.model ? ((b.model.initiatives && b.model.initiatives.list && b.model.initiatives.list.rows) || []) : [];
213
- M.docs = d && d.ok ? (d.rows || d.docs || []).filter((x) => x.path) : [];
214
- M.ses = s && Array.isArray(s.sessions) ? s.sessions.filter((x) => x.shown !== 'exited') : [];
215
- if (body.isConnected) drawList(body);
216
- });
217
- return body;
218
- }
119
+ /* ── Search ── the designed palette (pm/cozy-search.js); go is the page's own opener for an initiative ({ ini }), a session ({ ses }) or a file ({ doc }) */
120
+ export function openSearch(go) { return import('./cozy-search.js').then((M) => M.openSearch({ go })); }
219
121
 
220
- /* ── the agents' results (the bell) ── */
221
- export function openInbox(go) {
222
- const M = { r: null };
223
- const draw = (b) => {
224
- const r = M.r;
225
- b.innerHTML = WAIT + (!r ? '<p class="hx-n">Reading the agents\' results.</p>' : !r.ok ? '<p class="hx-n">The results could not be read.</p>'
226
- : (r.items || []).length ? sec(r.count + ' wait on you', r.items.map((x) => row(x.title || x.text, [x.who, x.where, x.at ? when(x.at) : ''].filter(Boolean).join(' · '), (x.link ? btn('Open', `data-open="${esc(x.link)}"`) : '') + btn('Seen', `data-seen="${esc(x.id)}"`))).join('')) + btn('Mark all seen', 'data-all="1"')
227
- : '<p class="hx-n">Nothing from the agents waits on you.</p>');
228
- };
229
- const body = card({ id: 'inbox', kind: 'Agent results', title: 'What the agents finished', icon: 'list' }, draw);
230
- const read = async () => { M.r = await pmGet('/api/inbox'); if (body.isConnected) draw(body); };
231
- body.onclick = async (e) => {
232
- const t = e.target.closest('button'); if (!t) return;
233
- if (t.dataset.open) { if (go) go({ link: t.dataset.open }); return; }
234
- if (t.dataset.seen) await pmPost('/api/inbox/seen', { ids: [t.dataset.seen] });
235
- if (t.dataset.all) await pmPost('/api/inbox/seen', { all: true });
236
- read();
237
- };
238
- read();
239
- return body;
240
- }
122
+ /* ── New for you ── it replaces the agents' results (the bell) and Around you (pm/cozy-news.js) */
123
+ export function openInbox(go) { return import('./cozy-news.js').then((M) => M.openNews({ go })); }
241
124
 
242
125
  /* ── record a note now ── */
243
126
  export async function openRecorder() {
@@ -1,9 +1,9 @@
1
1
  /* pm/home-phone-card.js — the phone moment card, moved onto Home (initiative premium-agreed-design; the card itself is premium-phone-card,
2
- * planning/prd/premium-phone-card-prd.md R1 to R5). The Agreed design has no place for it, so it stays usable at the top of the phone's
3
- * "N need you" sheet with a "Waiting for design" marker. At 640 px and narrower only; a desktop never reads /api/phone-day.
2
+ * planning/prd/premium-phone-card-prd.md R1 to R5). On a phone it is the Today card at the top of the list (canvas HmPhone and HmPhone2):
3
+ * the moment of the day, in the card's shape. At 640 px and narrower only; a desktop never reads /api/phone-day.
4
4
  * The moment comes from momentOf (c3-phone-model.js) over the /api/brief-page day and the clock; every line comes from /api/brief-page or
5
5
  * /api/phone-day. Done and Undo press /api/pm-items/done and /reopen on the PM's own item; nothing is written on load.
6
- * mountPhoneCard({ pmGet, pmPost, toast, ws, openMeeting, wait }) → { el, read } */
6
+ * mountPhoneCard({ pmGet, pmPost, toast, ws, openMeeting }) → { el, read } */
7
7
  import { momentOf, inText } from './phone-moment.js';
8
8
 
9
9
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
@@ -54,10 +54,15 @@ export function mountPhoneCard(o) {
54
54
  return `<span class="label">Your morning</span>${big(top.length ? ['', 'One thing', 'Two things', 'Three things'][top.length] + ' this morning' : 'Nothing pressing this morning')}${items(top)}${S(waits)}${nx}`;
55
55
  }
56
56
  if (mo.kind === 'work') return `<span class="label">${mo.next ? 'Next: ' + esc(mo.next.title) + ' at ' + hm(mo.next.start) : 'No more meetings today'}</span>${big(fin.length ? 'Finished for you' : 'Nothing new from the agent')}${fin.length ? finRows(2) + S('Approving a draft waits for your computer.') : dayErr() || S('When the agent finishes a draft today, it shows here.')}${mo.fits.length ? fits(mo.fits) : ''}${mo.next ? `<div class="phacts">${open(mo.next)}</div>` : ''}`;
57
- if (mo.kind === 'recap') {
58
- const r = day && day.recap, one = mine[0];
59
- const stats = r ? `<div class="phstats"><div><b>${r.meetings || 0}</b><span>meetings</span></div><div><b>${r.decided || 0}</b><span>decided in meetings</span></div><div><b>${r.done || 0}</b><span>done by you</span></div></div>${(r.moved || []).length ? `<div class="phfit"><b class="phtt">What moved</b>${r.moved.map((x) => `<p class="phs">${esc(x.text)}${x.sub ? ' · ' + esc(x.sub) : ''}</p>`).join('')}</div>` : ''}` : dayErr();
60
- return `<span class="label">Evening recap</span>${big('How today went')}${stats}<div class="phfit"><b class="phtt">Still open · ${mine.length}</b>${mine.slice(0, 3).map((x) => S(x.headline)).join('')}${S(mine.length ? 'They come first on Home tomorrow.' : 'Nothing of yours is still open.')}</div>${one ? `<div class="phfit"><span class="label">One thing tonight, if you have a minute</span>${items([one])}</div>` : ''}`;
57
+ if (mo.kind === 'recap') { // canvas HmPhone2's End of day: plain lines, one soft well for the one thing to do
58
+ const r = day && day.recap, one = mine[0], rest = mine.length - (one ? 1 : 0);
59
+ const KIND = { decision: 'Decided', done: 'Done', agent: 'Agent' };
60
+ const sum = r ? L([num(r.meetings, 'meeting', 'meetings'), num(r.decided, 'decision confirmed', 'decisions confirmed'), num(r.done, 'item done', 'items done')].join(' · ')) : dayErr();
61
+ const moved = r && (r.moved || []).length ? `<div class="phmv"><span class="label">What moved</span>${r.moved.map((x) => `<p><b>${esc(KIND[x.kind] || '')}</b><span>${esc(x.text)}</span>${x.sub ? `<em>${esc(x.sub)}</em>` : ''}</p>`).join('')}</div>` : '';
62
+ const conf = r && r.to_confirm ? `<p class="phs phq">${esc(num(r.to_confirm, 'decision', 'decisions'))} from today's notes ${r.to_confirm === 1 ? 'is' : 'are'} not confirmed yet, so ${r.to_confirm === 1 ? 'it does' : 'they do'} not count. Confirm them in the meeting's Replay.</p>` : '';
63
+ const open = one ? `<div class="phfit" data-id="${esc(one.id)}"><span class="label">One thing tonight · ${esc(one.label)}</span><b class="phtt">${esc(one.headline)}</b>${P.dec.has(one.id) ? `<p class="phok" role="status">${CHECK}<span>Done.</span></p><div class="phacts">${btn('Undo', 'phundo', one.id, true)}</div>` : `<div class="phacts">${btn(one.looks ? 'Confirm done' : 'Done', 'phdone', one.id)}</div>`}${P.err[one.id] ? `<p class="pherr" role="alert">${esc(P.err[one.id])}</p>` : ''}${rest ? S(num(rest, 'more is', 'more are') + ' still open. ' + (rest === 1 ? 'It comes' : 'They come') + ' first on Home tomorrow.') : ''}</div>`
64
+ : S('Nothing of yours is still open.');
65
+ return `<span class="label">Evening recap</span>${big('How today went')}${sum}${moved}${conf}${open}`;
61
66
  }
62
67
  const r = day && day.recap, tm = day && day.tomorrow;
63
68
  return `<span class="label">End of day</span>${big(tm ? 'Tomorrow, ' + tm.label : 'Tomorrow, at a glance')}${r ? L('Today: ' + [num(r.meetings, 'meeting', 'meetings'), num(r.decided, 'decision', 'decisions'), num(r.done, 'item done', 'items done')].join(', ') + '.') : ''}${tm ? `<div class="phfit"><b class="phtt">${tm.meetings.length ? num(tm.meetings.length, 'meeting', 'meetings') : 'No meetings'}</b>${tm.meetings.slice(0, 5).map((x) => `<p class="phs">${hm(x.start)} · ${esc(x.title)}${who(x) ? ' · ' + esc(who(x)) : ''}</p>`).join('')}</div>` : dayErr()}${S(mine.length ? num(mine.length, 'item carries', 'items carry') + ' over. They open first on Home tomorrow.' : 'Nothing carries over.')}`;
@@ -69,7 +74,7 @@ export function mountPhoneCard(o) {
69
74
  if (!P.page) h = '<span class="label">Now</span><p class="phl">Reading your day.</p>';
70
75
  else if (!P.page.ok) h = `<span class="label">Now</span><p class="pherr" role="alert">Your day could not be read: ${esc(P.page.error || 'the workspace server did not answer')}.</p>`;
71
76
  else { const mo = momentNow(); el.dataset.moment = mo.kind; h = moment(mo); }
72
- el.innerHTML = (o.wait || '') + h;
77
+ el.innerHTML = h;
73
78
  if (focus) { const f = el.querySelector(focus); if (f) f.focus(); }
74
79
  }
75
80
  async function read(force) {