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
@@ -1,365 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
- /* c3-sessions-panel-test.js — the console3 Sessions panel (Agent surfaces): ending a session and opening one (initiative sessions-panel-end-and-open).
4
- *
5
- * Starts a real server with its own state directory. Before it starts, a session record is written whose process does not exist and
6
- * whose file still says it runs: the server restores it as exited, and GET /api/runs must say it ended (it read "starting · 4 d" before).
7
- * Then one live shell is started, and the page checks: the live row reads the server's state, not "starting"; Open the session draws the
8
- * session's real terminal in a sheet on /console.html and the address does not change; the message box types into the session and presses Enter;
9
- * End asks first, Keep it keeps it, End ends it.
10
- */
11
- const fs = require('fs');
12
- const path = require('path');
13
- const { spawn } = require('child_process');
14
- const { WebSocket } = require('ws');
15
- const { findBrowser } = require('./lib/find-browser');
16
- const T = require('./test-run').configure({ name: 'c3-sessions-panel' });
17
-
18
- const BASE = T.BASE;
19
- const results = [];
20
- const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
21
- let srv = null; let browser = null;
22
- const finish = async (code) => {
23
- if (browser) await browser.close().catch(() => {});
24
- if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
25
- T.killTmux();
26
- const bad = results.filter((x) => !x.cond).length;
27
- console.log(`\n${results.length - bad}/${results.length} c3-sessions-panel assertions passed`);
28
- process.exit(code !== undefined ? code : (bad ? 1 : 0));
29
- };
30
- process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
31
- const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
32
- async function until(fn, ms = 8000) { const end = Date.now() + ms; while (Date.now() < end) { const v = await fn(); if (v) return v; await sleep(150); } return null; }
33
- /* the Sessions panel: the Sessions button opens a running last session's terminal, whose "All sessions" opens the panel */
34
- async function openPanel(page) {
35
- await page.click('[data-c3pg="agent-button"]');
36
- const got = await page.waitForSelector('[data-c3t="host"], [data-c3-all-sessions]', { timeout: 15000 }).catch(() => null);
37
- if (got && await page.$('[data-c3-all-sessions]')) await page.click('[data-c3-all-sessions]');
38
- }
39
- async function waitFor(page, fn, arg, ms = 15000) { try { await page.waitForFunction(fn, arg, { timeout: ms }); return true; } catch { return false; } }
40
- /* the session sheet opens on the conversation (c3-session-conv.js); Terminal shows the live terminal */
41
- const sheetOf = (i) => `[data-c3-session="${i}"]`;
42
- async function toTerm(page, i) {
43
- if (!await waitFor(page, (s) => !!document.querySelector(s), sheetOf(i))) return false;
44
- await page.click('[data-c3-view="term"]');
45
- return waitFor(page, (x) => !!document.querySelector(`[data-c3-session-term="${x}"] .xterm`), i);
46
- }
47
- async function openTerm(page, i) {
48
- await page.evaluate((x) => window.dispatchEvent(new CustomEvent('pmos:open-session', { detail: { id: x } })), i);
49
- return toTerm(page, i);
50
- }
51
- const get = (p) => fetch(BASE + p).then((r) => r.json());
52
- // the agent CLI's home for this run: the conversation test writes a session record and a transcript here, as claude would
53
- const CLAUDE_HOME = path.join(T.STATE_DIR, 'claude-home');
54
-
55
- function startShell(name) {
56
- return new Promise((resolve) => {
57
- const ws = new WebSocket(`ws://${T.HOST}:${T.PORT}`); const inbox = [];
58
- ws.on('message', (raw) => { try { inbox.push(JSON.parse(raw)); } catch { /* ignore */ } });
59
- ws.on('error', () => resolve(null));
60
- ws.on('open', async () => {
61
- ws.send(JSON.stringify({ t: 'new', agent: 'shell', name }));
62
- const m = await until(() => inbox.find((x) => x.t === 'created' || x.t === 'error'), 8000);
63
- ws.close(); resolve(m && m.t === 'created' ? m.id : null);
64
- });
65
- });
66
- }
67
-
68
- (async () => {
69
- const exe = findBrowser();
70
- if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the c3-sessions-panel suite cannot run'); return finish(1); }
71
- let chromium;
72
- try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the c3-sessions-panel suite cannot run'); return finish(1); }
73
-
74
- /* a record left by a server that stopped: the file says it runs, its process is gone (no tmux session by that name) */
75
- const sessDir = path.join(T.STATE_DIR, 'sessions');
76
- fs.mkdirSync(sessDir, { recursive: true });
77
- const created = new Date(Date.now() - 4 * 864e5).toISOString();
78
- fs.writeFileSync(path.join(sessDir, 'sess-900.json'), JSON.stringify({ id: 'sess-900', name: 'stale claude', agent: 'shell', state: 'working', created, tmux: 'pmos-gone-900', origin: 'manual', cwd: path.resolve(__dirname, '..'), root: path.resolve(__dirname, '..') }));
79
- fs.writeFileSync(path.join(sessDir, 'sess-900.scrollback'), '');
80
-
81
- srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_CLAUDE_HOME: CLAUDE_HOME }) });
82
- await T.waitForServer(BASE);
83
- /* an ended session the server does not hold: only its record on disk (written after the server read the folder) */
84
- fs.writeFileSync(path.join(sessDir, 'sess-9901.json'), JSON.stringify({ id: 'sess-9901', name: 'old ended claude', agent: 'shell', state: 'exited', created, exitedAt: new Date(Date.now() - 864e5).toISOString(), origin: 'manual', cwd: path.resolve(__dirname, '..'), root: path.resolve(__dirname, '..') }));
85
-
86
- /* ── A: /api/runs believes the server, not a stale file ── */
87
- const r0 = await get('/api/runs');
88
- const inGroup = (r, g, id) => ((r.groups && r.groups[g]) || []).some((s) => s.id === id);
89
- ok('A1 a session whose process is gone is not listed as started by me', r0.ok && !inGroup(r0, 'startedByMe', 'sess-900'), JSON.stringify(r0.groups && r0.groups.startedByMe));
90
- ok('A2 it is listed in Past', inGroup(r0, 'past', 'sess-900'));
91
-
92
- const id = await startShell('panel shell');
93
- ok('A3 a live shell starts', !!id);
94
- const r1 = await until(async () => { const r = await get('/api/runs'); return inGroup(r, 'startedByMe', id) ? r : null; });
95
- const row = r1 && r1.groups.startedByMe.find((s) => s.id === id);
96
- ok('A4 the live shell is started by me and carries the server state', !!row && typeof row.label === 'string' && row.label.length > 0, JSON.stringify(row));
97
-
98
- browser = await chromium.launch({ executablePath: exe });
99
- const page = await (await browser.newContext({ viewport: { width: 1440, height: 1000 } })).newPage();
100
- const errors = [];
101
- page.on('pageerror', (e) => errors.push(String(e && e.message || e)));
102
-
103
- /* ── B: the panel ── */
104
- await page.goto(BASE + '/console.html');
105
- ok('B1 the header has the Sessions button', await waitFor(page, () => !!document.querySelector('[data-c3pg="agent-button"]'), null, 45000));
106
- await page.click('[data-c3pg="agent-button"]');
107
- const sel = `[data-c3t="mine"] [data-run="${id}"]`;
108
- ok('B2 the live shell has a row under Started by me', await waitFor(page, (s) => !!document.querySelector(s), sel));
109
- const sub = await page.evaluate((s) => (document.querySelector(s + ' .chips') || {}).textContent || '', sel);
110
- ok('B3 the row does not say starting', !!sub && !/^starting/.test(sub.trim()), sub);
111
- await page.click(sel + ' .nb');
112
- ok('B3b a plain session draws no empty "Starting" card', await page.evaluate((s) => !document.querySelector(s + ' [data-run-host]'), sel));
113
- ok('B4 the open row has End the session', await waitFor(page, (i) => !!document.querySelector(`[data-end-session="${i}"]`), id));
114
-
115
- /* ── C: Open the session stays on this page ── */
116
- const url0 = page.url();
117
- await page.click(`[data-blank-panel="${id}"] [data-open-session]`);
118
- ok('C1 the session opens in a sheet, on its conversation', await waitFor(page, (i) => { const c = document.querySelector(`[data-c3-session="${i}"] [data-c3-conv]`); return !!c && !c.hidden && !document.querySelector('.xterm'); }, id));
119
- ok('C1b a shell with no Claude in it says so and offers Start Claude here', await waitFor(page, () => /No Claude in this shell yet/.test((document.querySelector('[data-cv="none"]') || {}).textContent || '') && !!document.querySelector('[data-cv="start-claude"]')));
120
- ok('C1c the view control has Conversation and Terminal, Conversation pressed', await page.evaluate(() => [...document.querySelectorAll('[data-c3-view]')].map((b) => b.dataset.c3View + ':' + b.getAttribute('aria-pressed')).join() === 'conv:true,term:false'));
121
- ok('C1d Terminal shows the live terminal in the same sheet', await toTerm(page, id) && await page.evaluate(() => document.querySelector('[data-c3-conv]').hidden === true));
122
- ok('C2 the page stays on console3', page.url() === url0, page.url());
123
- await sleep(800);
124
- await page.click(`[data-c3-session-term="${id}"] .xterm`);
125
- // a claude that only echoes, so Start Claude here can be checked without a real agent
126
- await page.keyboard.type('claude() { echo c3-start-$((3*3)); }; echo c3-typed-$((40+2))\n');
127
- ok('C2b what is typed in the sheet reaches the shell', !!(await until(async () => /c3-typed-42/.test((await get('/api/sessions/transcript?id=' + id + '&max=4000')).text || ''), 8000)));
128
- await page.keyboard.press('Escape');
129
- await sleep(300);
130
- ok('C3 Esc in the terminal goes to the shell, not the sheet', await page.evaluate((i) => !!document.querySelector(`[data-c3-session-term="${i}"]`), id));
131
- await page.keyboard.press('Control+u'); // the shell read that Esc as a Meta prefix: this key takes it, so the next line starts clean
132
- await page.click('[data-c3-view="conv"]');
133
- ok('C3b Conversation comes back, the terminal stays mounted but hidden', await waitFor(page, (i) => { const c = document.querySelector('[data-c3-conv]'); const t = document.querySelector(`[data-c3-session-term="${i}"]`); return !!c && !c.hidden && !!t && !!t.querySelector('.xterm') && t.closest('[data-c3-view-pane]').hidden; }, id));
134
- await page.click('[data-cv="start-claude"]');
135
- ok('C3c Start Claude here types claude into the shell', !!(await until(async () => /c3-start-9/.test((await get('/api/sessions/transcript?id=' + id + '&max=4000')).text || ''), 8000)));
136
- await page.click('[data-shell="sheet"] [aria-label="Close"]');
137
- ok('C4 the close button closes the terminal sheet', await waitFor(page, () => !document.querySelector('[data-c3-session-term]')));
138
- ok('C5 closing the sheet leaves the session running', await until(async () => ((await get('/api/sessions')).sessions || []).some((s) => s.id === id && s.state !== 'exited')));
139
-
140
- /* ── G: the scratchpad and the size control on the terminal sheet (c3-term-pad-size) ── */
141
- const g0 = await openTerm(page, id);
142
- ok('G0 the terminal sheet opens for the pad checks', g0 || !!(await page.$('[data-c3-size-seg]')));
143
- const sizes = await page.$$eval('[data-c3-size-seg] [data-c3-size]', (b) => b.map((x) => x.dataset.c3Size));
144
- ok('G1 the size control has 4 options', sizes.join() === 'normal,half,two-thirds,whole', sizes.join());
145
- const vw = await page.evaluate(() => window.innerWidth);
146
- const wid = () => page.evaluate(() => document.querySelector('[data-shell="sheet"] .sheet').getBoundingClientRect().width);
147
- ok('G2 Normal is the 600px sheet', Math.abs((await wid()) - 600) < 2, String(await wid()));
148
- await page.click('[data-c3-size="half"]');
149
- await sleep(200);
150
- ok('G3 Half makes the sheet half of the window', Math.abs((await wid()) - vw / 2) < 3, (await wid()) + ' of ' + vw);
151
- ok('G3b Half is shown as pressed', await page.evaluate(() => document.querySelector('[data-c3-size="half"]').getAttribute('aria-pressed') === 'true'));
152
- await page.click('[data-c3-size="whole"]');
153
- await sleep(200);
154
- ok('G3c Whole fills the window minus the margins', Math.abs((await wid()) - (vw - 24)) < 3, String(await wid()));
155
- await page.click('[data-c3-size="half"]');
156
- await page.click('[data-shell="sheet"] [aria-label="Close"]');
157
- await waitFor(page, () => !document.querySelector('[data-c3-session-term]'));
158
- await openTerm(page, id);
159
- await sleep(200);
160
- ok('G4 the size choice is kept after closing and opening again', Math.abs((await wid()) - vw / 2) < 3, String(await wid()));
161
- ok('G4b it is kept in localStorage', await page.evaluate(() => localStorage.getItem('pmos.workspace.c3.term-size') === 'half'));
162
- const termH = await page.evaluate(() => document.querySelector('[data-c3-session-term]').getBoundingClientRect().height);
163
- ok('G5 the terminal has room above the scratchpad', termH > 120 && await page.evaluate(() => { const t = document.querySelector('[data-c3-session-term]').getBoundingClientRect(); const p = document.querySelector('[data-c3-pad="box"]').getBoundingClientRect(); return t.bottom <= p.top + 1; }));
164
- await page.fill('[data-c3-pad="text"]', 'echo from-the-pad-7');
165
- ok('G6 typing in the pad saves it for the session', !!(await until(async () => (await get('/api/scratchpad?session=' + id)).text === 'echo from-the-pad-7', 4000)));
166
- await page.click(`[data-c3-session-term="${id}"] .xterm`);
167
- await page.keyboard.press('Backspace'); // the Esc in C3 left the shell's readline waiting for a meta key: this key answers it
168
- await page.fill('[data-c3-pad="text"]', 'echo from-the-pad-7');
169
- await page.click('[data-c3-pad="send"]');
170
- await sleep(800);
171
- const noEnter = !/^from-the-pad-7/m.test((await get('/api/sessions/transcript?id=' + id + '&max=4000')).text || '');
172
- await page.click(`[data-c3-session-term="${id}"] .xterm`);
173
- await page.keyboard.press('Enter');
174
- ok('G7 Send to terminal types the text into the session, without pressing Enter', noEnter && !!(await until(async () => /^from-the-pad-7/m.test((await get('/api/sessions/transcript?id=' + id + '&max=4000')).text || ''), 8000)));
175
- await page.fill('[data-c3-pad="text"]', 'flushed-on-close');
176
- await page.click('[data-shell="sheet"] [aria-label="Close"]');
177
- ok('G8 closing the sheet saves a pad edit at once', !!(await until(async () => (await get('/api/scratchpad?session=' + id)).text === 'flushed-on-close', 2000)));
178
- await openTerm(page, id);
179
- await waitFor(page, () => !!document.querySelector('[data-c3-pad="text"]'));
180
- ok('G9 the pad loads its text when the terminal opens again', await waitFor(page, () => document.querySelector('[data-c3-pad="text"]').value === 'flushed-on-close'));
181
- /* the grip above the pad resizes it: a drag up makes the pad taller and the terminal shorter; the height is kept */
182
- const geo = () => page.evaluate(() => ({ pad: document.querySelector('[data-c3-pad="text"]').getBoundingClientRect().height, term: document.querySelector('[data-c3-session-term]').getBoundingClientRect().height }));
183
- const g0h = await geo();
184
- const gb = await (await page.$('[data-c3-pad="grip"]')).boundingBox();
185
- await page.mouse.move(gb.x + gb.width / 2, gb.y + gb.height / 2); await page.mouse.down();
186
- await page.mouse.move(gb.x + gb.width / 2, gb.y + gb.height / 2 - 120, { steps: 6 }); await page.mouse.up();
187
- const g1h = await geo();
188
- ok('G11 dragging the grip up makes the pad taller and the terminal shorter', g1h.pad > g0h.pad + 80 && g1h.term < g0h.term - 80, JSON.stringify([g0h, g1h]));
189
- ok('G11b the height is kept in localStorage', await page.evaluate(() => Number(localStorage.getItem('pmos.workspace.c3.term-pad-h')) > 4));
190
- await page.focus('[data-c3-pad="grip"]'); await page.keyboard.press('ArrowDown');
191
- ok('G12 the down arrow on the grip makes the pad shorter', (await geo()).pad < g1h.pad - 8);
192
- await page.dblclick('[data-c3-pad="grip"]');
193
- ok('G13 double-click gives back the default size', Math.abs((await geo()).pad - g0h.pad) < 3 && await page.evaluate(() => !localStorage.getItem('pmos.workspace.c3.term-pad-h')));
194
- await page.click('[data-c3-pad="toggle"]');
195
- ok('G10 the toggle hides the pad and the terminal gets the room', await page.evaluate(() => document.querySelector('[data-c3-pad="text"]').hidden === true && localStorage.getItem('pmos.workspace.c3.term-pad') === 'closed'));
196
- await page.click('[data-c3-pad="toggle"]');
197
- await page.click('[data-shell="sheet"] [aria-label="Close"]');
198
- await waitFor(page, () => !document.querySelector('[data-c3-session-term]'));
199
-
200
- /* ── D: End asks first, then ends ── */
201
- // Sessions opens the terminal of the session opened last while it runs (PM, 2026-10-13); its "All sessions" opens the panel
202
- await page.click('[data-c3pg="agent-button"]');
203
- ok('D0 Sessions opens the session opened last', await waitFor(page, (s) => !!document.querySelector(s + ' [data-c3-conv]'), sheetOf(id)));
204
- await page.click('[data-c3-all-sessions]');
205
- ok('D0a All sessions in the session sheet opens the panel', await waitFor(page, (s) => !!document.querySelector(s), sel) && !(await page.$('[data-c3-session]')));
206
- ok('D0b it opens on the session opened last: its row is open and marked', await waitFor(page, (i) => { const li = document.querySelector(`[data-c3t="mine"] [data-run="${i}"]`); const end = document.querySelector(`[data-end-session="${i}"]`); return !!li && li.hasAttribute('data-last-open') && !!end && end.offsetParent !== null; }, id)
207
- && await page.evaluate((i) => localStorage.getItem('pmos.workspace.c3.last-session') === i, id));
208
- if (!(await page.isVisible(`[data-end-session="${id}"]`).catch(() => false))) await page.click(sel + ' .nb');
209
- await page.click(`[data-end-session="${id}"]`);
210
- ok('D1 End asks first', await waitFor(page, (i) => !!document.querySelector(`[data-end-confirm="${i}"]`), id));
211
- await page.click(`[data-end-confirm="${id}"] button:not([data-end-yes])`);
212
- ok('D2 Keep it keeps the session', await waitFor(page, (i) => !document.querySelector(`[data-end-confirm="${i}"]`), id) && ((await get('/api/sessions')).sessions || []).some((s) => s.id === id));
213
-
214
- /* ── M: the message box types into the session and presses Enter ── */
215
- const box = `[data-blank-panel="${id}"] [data-run-chat]`;
216
- ok('M0 the message box is enabled', await page.isEnabled(box).catch(() => false));
217
- const pidFile = path.join(T.STATE_DIR, 'c3-shell.pid');
218
- await page.fill(box, 'echo $$ > ' + pidFile + '; echo c3-msg-$((6*7))');
219
- await page.press(box, 'Enter');
220
- ok('M2 the message shows in the panel as it is sent', await waitFor(page, (i) => /c3-msg/.test((document.querySelector(`[data-blank-panel="${i}"] [data-chat-feed] [data-chat="me"]`) || {}).textContent || ''), id, 5000));
221
- const m1 = await until(async () => /c3-msg-42/.test((await get('/api/sessions/transcript?id=' + id + '&max=4000')).text || ''), 8000);
222
- if (!m1) console.log(' transcript:', JSON.stringify(((await get('/api/sessions/transcript?id=' + id + '&max=4000')).text || '').slice(-300)));
223
- ok('M1 the message reaches the session and Enter runs it', !!m1);
224
- /* the conversation: a transcript for this shell, as claude writes one, shows in the panel as messages */
225
- const shellPid = (() => { try { return fs.readFileSync(pidFile, 'utf8').trim(); } catch { return ''; } })();
226
- const sessRow = ((await get('/api/sessions')).sessions || []).find((x) => x.id === id) || {};
227
- const root = sessRow.root || sessRow.cwd || path.resolve(__dirname, '..');
228
- fs.mkdirSync(path.join(CLAUDE_HOME, 'sessions'), { recursive: true });
229
- fs.writeFileSync(path.join(CLAUDE_HOME, 'sessions', shellPid + '.json'), JSON.stringify({ pid: +shellPid, sessionId: 'conv-test-1', cwd: root, version: 'test' }));
230
- const proj = path.join(CLAUDE_HOME, 'projects', root.replace(/\//g, '-'));
231
- fs.mkdirSync(proj, { recursive: true });
232
- const rec = (o) => JSON.stringify({ isSidechain: false, timestamp: new Date().toISOString(), ...o });
233
- fs.writeFileSync(path.join(proj, 'conv-test-1.jsonl'), [
234
- rec({ type: 'user', isMeta: true, message: { role: 'user', content: '<system-reminder>not shown</system-reminder>' } }),
235
- rec({ type: 'user', message: { role: 'user', content: 'What changed today?' } }),
236
- rec({ type: 'assistant', message: { id: 'msg_1', model: 'claude-test', role: 'assistant', content: [{ type: 'tool_use', id: 't1', name: 'Bash', input: { command: 'git log' } }] } }),
237
- rec({ type: 'user', message: { role: 'user', content: [{ type: 'tool_result', tool_use_id: 't1', content: 'ok' }] } }),
238
- rec({ type: 'assistant', message: { id: 'msg_2', model: 'claude-test', role: 'assistant', content: [{ type: 'text', text: 'Two things changed:\n- the **panel** reads the transcript\n- `send` works' }] } }),
239
- ].join('\n') + '\n');
240
- const feedSel = `[data-blank-panel="${id}"] [data-chat-feed]`;
241
- // the server re-resolves a session's transcript at most every 2 s
242
- const conv = (await until(async () => { const c = await get('/api/sessions/conversation?id=' + id); return c.messages && c.messages.length ? c : null; }, 8000)) || {};
243
- ok('M3 the server reads the conversation from the transcript', conv.ok && (conv.messages || []).map((m) => m.role).join(',') === 'user,tool,assistant', JSON.stringify(conv).slice(0, 300));
244
- ok('M4 the panel shows the prompt, the tool line and the reply', await waitFor(page, (sel) => {
245
- const f = document.querySelector(sel); if (!f) return false;
246
- const me = [...f.querySelectorAll('[data-chat="me"]')].some((n) => n.textContent === 'What changed today?');
247
- const tool = [...f.querySelectorAll('[data-chat="tool"]')].some((n) => /Used Bash/.test(n.textContent));
248
- const bot = f.querySelector('[data-chat="bot"]');
249
- return me && tool && !!bot && !!bot.querySelector('li b') && !!bot.querySelector('li code') && !/not shown/.test(f.textContent);
250
- }, feedSel, 10000));
251
-
252
- /* ── S: the session sheet's conversation, from the same transcript ── */
253
- await page.evaluate((i) => window.dispatchEvent(new CustomEvent('pmos:open-session', { detail: { id: i } })), id);
254
- const cvSel = sheetOf(id) + ' [data-c3-conv]';
255
- ok('S1 the sheet shows the prompt, a folded tool line and the reply', await waitFor(page, (s) => {
256
- const f = document.querySelector(s); if (!f) return false;
257
- const me = [...f.querySelectorAll('[data-chat="me"]')].some((n) => n.textContent === 'What changed today?');
258
- const tool = f.querySelector('details[data-chat="tool"]');
259
- const bot = f.querySelector('[data-chat="bot"]');
260
- return me && !!tool && !tool.open && /Used Bash/.test(tool.textContent) && !!bot && !!bot.querySelector('li b') && !/not shown/.test(f.textContent);
261
- }, cvSel, 10000));
262
- ok('S2 the tool line lists each call with its target', await page.evaluate((s) => [...document.querySelectorAll(s + ' details[data-chat="tool"] li')].map((li) => li.querySelector('b').textContent + ' ' + ((li.querySelector('span') || {}).textContent || '')).join() === 'Bash git log', cvSel));
263
- ok('S3 the status reads Your turn and the meta names the model', await page.evaluate(() => (document.querySelector('[data-cv="status"]') || {}).textContent === 'Your turn' && /claude-test/.test((document.querySelector('[data-cv="meta"]') || {}).textContent || '')));
264
- // at Whole the list of sessions shows: each row's title sits above its subtitle, both at the row's left, and rows don't overlap
265
- await page.click('[data-c3-size="whole"]');
266
- await sleep(250);
267
- const lay = await page.evaluate((s) => {
268
- const rows = [...document.querySelectorAll('[data-c3-sess-list] [data-c3-sess-pick]')].map((b) => {
269
- const r = b.getBoundingClientRect(), n = b.querySelector('.nm').getBoundingClientRect(), u = b.querySelector('.sub').getBoundingClientRect();
270
- return { top: r.top, bottom: r.bottom, left: r.left, nl: n.left, nb: n.bottom, ul: u.left, ut: u.top, ub: u.bottom };
271
- });
272
- const f = document.querySelector(s + ' [data-cv="feed"]').getBoundingClientRect();
273
- const m = document.querySelector(s + ' [data-chat="me"],' + s + ' [data-chat="bot"]');
274
- const w = document.querySelector(s + ' [data-cv="feed"] > .wrap').getBoundingClientRect();
275
- return { rows, gap: w.left - f.left, shown: !!m && m.getBoundingClientRect().height > 0 };
276
- }, cvSel);
277
- ok('S3b the list rows are laid out cleanly (title over subtitle, left aligned, no overlap)', lay.rows.length > 0 && lay.rows.every((r, i) =>
278
- r.nb <= r.ut + 1 && r.ub <= r.bottom && Math.abs(r.nl - r.ul) < 1 && r.nl - r.left < 14 && (i === 0 || r.top >= lay.rows[i - 1].bottom - 1)), JSON.stringify(lay.rows));
279
- ok('S3c at Whole the conversation starts at the left of its pane, next to the list', lay.shown && lay.gap < 16, String(lay.gap));
280
- await page.click('[data-c3-size="half"]');
281
- await sleep(150);
282
- await page.fill('[data-cv="msg"]', 'echo c3-conv-$((5*5))');
283
- await page.press('[data-cv="msg"]', 'Enter');
284
- ok('S4 a sent message shows at once', await waitFor(page, () => [...document.querySelectorAll('[data-c3-conv] [data-chat="me"]')].some((n) => /c3-conv-/.test(n.textContent)), null, 3000));
285
- ok('S4b the send box types into the session and presses Enter', !!(await until(async () => /^c3-conv-25/m.test((await get('/api/sessions/transcript?id=' + id + '&max=4000')).text || ''), 8000)));
286
- // Claude asks before a tool: the transcript holds an open call and the pane shows Claude Code's prompt
287
- fs.appendFileSync(path.join(proj, 'conv-test-1.jsonl'), rec({ type: 'assistant', message: { id: 'msg_3', model: 'claude-test', role: 'assistant', content: [{ type: 'tool_use', id: 't2', name: 'Bash', input: { command: 'rm notes.txt' } }] } }) + '\n');
288
- await page.fill('[data-cv="msg"]', "clear; printf 'Do you want to proceed?\\n> 1. Yes\\n 2. No, and tell Claude what to do differently\\n'");
289
- await page.press('[data-cv="msg"]', 'Enter');
290
- ok('S5 the allow prompt shows as a card with its options', await waitFor(page, () => {
291
- const c = document.querySelector('[data-c3-conv] [data-cv="ask"]'); if (!c) return false;
292
- const o = [...c.querySelectorAll('[data-cv-opt]')].map((b) => b.dataset.cvOpt + ':' + b.textContent).join('|');
293
- return /Do you want to proceed\?/.test(c.textContent) && o === '1:Yes|2:No, and tell Claude what to do differently' && !!c.querySelector('[data-cv="ask-term"]');
294
- }, null, 20000));
295
- if (!results[results.length - 1].cond) { const c = await get('/api/sessions/conversation?id=' + id); console.log(' conversation:', JSON.stringify({ state: c.state, turn: c.turn, openCall: c.openCall, ask: c.ask }), JSON.stringify(((await get('/api/sessions/transcript?id=' + id + '&max=600')).text || '').slice(-300))); }
296
- ok('S5b the status reads Needs you', await page.evaluate(() => (document.querySelector('[data-cv="status"]') || {}).textContent === 'Needs you'));
297
- await page.click('[data-cv-opt="2"]', { timeout: 3000 }).catch(() => {});
298
- await sleep(500);
299
- await page.fill('[data-cv="msg"]', '; echo c3-opt-$((2*4))');
300
- await page.press('[data-cv="msg"]', 'Enter');
301
- ok('S5c an option button types its number into the session', !!(await until(async () => /2; echo c3-opt/.test((await get('/api/sessions/transcript?id=' + id + '&max=6000')).text || ''), 8000)));
302
- await page.click('[data-cv="ask-term"]').catch(() => {});
303
- ok('S6 Answer in the terminal switches to the terminal', await waitFor(page, (i) => !!document.querySelector(`[data-c3-session-term="${i}"] .xterm`) && document.querySelector('[data-c3-view="term"]').getAttribute('aria-pressed') === 'true', id));
304
- await page.click('[data-shell="sheet"] [aria-label="Close"]');
305
- await waitFor(page, () => !document.querySelector('[data-c3-session]'));
306
- // the panel row was open before the sheet: open it again for End
307
- // (it opens on the session opened last, with its row open)
308
- await openPanel(page);
309
- if (!await waitFor(page, (i) => { const b = document.querySelector(`[data-end-session="${i}"]`); return !!b && b.offsetParent !== null; }, id, 5000)) await page.click(sel + ' .nb');
310
-
311
- await page.click(`[data-end-session="${id}"]`);
312
- await page.click(`[data-end-yes="${id}"]`);
313
- const gone = async () => !((await get('/api/sessions')).sessions || []).some((s) => s.id === id);
314
- if (!(await until(gone, 6000)) && await page.$(`[data-end-session="${id}"]`)) { await page.click(`[data-end-session="${id}"]`); await page.click(`[data-end-yes="${id}"]`); } // "asked it to end": the second press removes it
315
- ok('D3 End ends the session', !!(await until(gone, 8000)));
316
- ok('D4 its row leaves Started by me', await waitFor(page, (s) => !document.querySelector(s), sel));
317
-
318
- /* ── F: New session starts on console3 and opens its terminal here (c3-new-session; it went to the classic app before) ── */
319
- const before = new Set(((await get('/api/sessions')).sessions || []).map((s) => s.id));
320
- if (!(await page.isVisible('[data-c3t="new"]').catch(() => false))) await openPanel(page);
321
- ok('F1 Started by me has a New button', await waitFor(page, () => !!document.querySelector('[data-c3t="new"]')));
322
- await page.click('[data-c3t="new"]');
323
- ok('F2 New opens the new-session sheet on this page', await waitFor(page, () => !!document.querySelector('[data-c3ns="form"]')) && page.url() === url0, page.url());
324
- const boards = (await get('/api/workspaces')).workspaces || [];
325
- const opts = await page.evaluate(() => [...document.querySelectorAll('[data-c3ns="board"] option')].map((o) => ({ v: o.value, on: o.selected })));
326
- ok('F2b the sheet has a Board select with the workspace\'s repositories', opts.length === boards.length && boards.every((w) => opts.some((o) => o.v === w.id)), JSON.stringify(opts));
327
- ok('F2c the dock\'s repository is chosen', opts.filter((o) => o.on).length === 1, JSON.stringify(opts));
328
- await page.fill('[data-c3ns="name"]', 'c3 new shell');
329
- await page.selectOption('[data-c3ns="agent"]', 'shell');
330
- await page.click('[data-c3ns="start"]');
331
- const made = await until(async () => ((await get('/api/sessions')).sessions || []).find((s) => !before.has(s.id) && s.name === 'c3 new shell'), 10000);
332
- ok('F3 Start starts the session on the server', !!made);
333
- ok('F3b it starts on the board chosen in the sheet', !!made && made.ws === opts.find((o) => o.on).v, JSON.stringify(made && made.ws));
334
- ok('F4 it opens in a sheet on console3', !!made && await waitFor(page, (s) => !!document.querySelector(s + ' [data-c3-conv]'), sheetOf(made.id)) && page.url() === url0, page.url());
335
- await page.click('[data-shell="sheet"] [aria-label="Close"]');
336
- await waitFor(page, () => !document.querySelector('[data-c3-session]'));
337
- await page.evaluate(() => window.dispatchEvent(new CustomEvent('pmos:open-session', { detail: {} })));
338
- ok('F5 an open-session request with no session opens the new-session sheet, not the classic app', await waitFor(page, () => !!document.querySelector('[data-c3ns="form"]')) && page.url() === url0, page.url());
339
- await page.click('[data-shell="sheet"] [aria-label="Close"]');
340
- await waitFor(page, () => !document.querySelector('[data-c3ns="form"]'));
341
- if (await page.isVisible('[data-c3pg="dock-new"]').catch(() => false)) {
342
- await page.click('[data-c3pg="dock-new"]');
343
- ok('F6 the dock\'s + opens the new-session sheet on this page', await waitFor(page, () => !!document.querySelector('[data-c3ns="form"]')) && page.url() === url0, page.url());
344
- await page.click('[data-shell="sheet"] [aria-label="Close"]');
345
- }
346
-
347
- /* ── P: a past session can be removed, also one the server knows only from its record on disk ── */
348
- if (await page.isVisible('[data-shell="sheet"] [aria-label="Close"]').catch(() => false)) await page.click('[data-shell="sheet"] [aria-label="Close"]');
349
- if (!(await page.isVisible('[data-c3t="past"]').catch(() => false))) await openPanel(page);
350
- const pastSel = '[data-c3t="past"] [data-run="sess-9901"]';
351
- ok('P1 the ended session is listed in Past', await waitFor(page, (s) => !!document.querySelector(s), pastSel));
352
- if (!(await page.isVisible('[data-end-session="sess-9901"]').catch(() => false))) await page.click(pastSel + ' .nb');
353
- ok('P2 its open row has Remove', await waitFor(page, () => /Remove/.test((document.querySelector('[data-end-session="sess-9901"]') || {}).textContent || '')));
354
- ok('P3 it has no line about routes', !/GET \/api/.test(await page.evaluate((s) => document.querySelector(s).textContent, pastSel)));
355
- await page.click('[data-end-session="sess-9901"]');
356
- ok('P4 Remove asks first', await waitFor(page, () => !!document.querySelector('[data-end-confirm="sess-9901"]')));
357
- await page.click('[data-end-yes="sess-9901"]');
358
- ok('P5 the record is deleted', !!(await until(async () => !fs.existsSync(path.join(sessDir, 'sess-9901.json')), 6000)));
359
- ok('P6 the row leaves Past', await waitFor(page, (s) => !document.querySelector(s), pastSel));
360
- const bad = await fetch(BASE + '/api/session/remove', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: '../x' }) }).then((r) => r.status).catch(() => 0);
361
- ok('P7 an id that is not a session id is refused', bad === 404 || bad === 403, String(bad));
362
-
363
- ok('E1 the page threw no error', errors.length === 0, errors.join(' | '));
364
- return finish();
365
- })().catch((e) => { console.error(e); finish(1); });
@@ -1,204 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
- /* c3-settings-test.js — the console3 Settings page (initiative console3-settings).
4
- *
5
- * Loads /console.html against a real server with its own state directory and checks: the gear, the More menu item and
6
- * ?tab=settings open Settings; every section draws; search finds a setting across sections; a change to a store setting
7
- * is saved through POST /api/settings and read back; the theme switch sets the page theme; the start page and the
8
- * time-of-day switches take effect on the next load; Set up Laya opens its terminal; and the page throws no error.
9
- */
10
- const path = require('path');
11
- const { spawn } = require('child_process');
12
- const { findBrowser } = require('./lib/find-browser');
13
- const T = require('./test-run').configure({ name: 'c3-settings' });
14
-
15
- const BASE = T.BASE;
16
- const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
17
- const results = [];
18
- const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
19
- let srv = null; let browser = null;
20
- const finish = async (code) => {
21
- if (browser) await browser.close().catch(() => {});
22
- if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
23
- T.killTmux();
24
- const bad = results.filter((x) => !x.cond).length;
25
- console.log(`\n${results.length - bad}/${results.length} c3-settings assertions passed`);
26
- process.exit(code !== undefined ? code : (bad ? 1 : 0));
27
- };
28
- process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
29
-
30
- const SECTIONS = ['about', 'workspaces', 'boards', 'connectors', 'refresh', 'recording', 'time', 'sharing', 'access', 'sessions', 'privacy', 'appearance', 'updates'];
31
-
32
- async function waitFor(page, fn, arg, ms = 8000) {
33
- try { await page.waitForFunction(fn, arg, { timeout: ms }); return true; } catch { return false; }
34
- }
35
-
36
- (async () => {
37
- const exe = findBrowser();
38
- if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the c3-settings suite cannot run'); return finish(1); }
39
- let chromium;
40
- try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the c3-settings suite cannot run'); return finish(1); }
41
-
42
- srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
43
- await T.waitForServer(BASE);
44
- browser = await chromium.launch({ executablePath: exe });
45
- const ctx = await browser.newContext({ viewport: { width: 1440, height: 1000 } });
46
- const page = await ctx.newPage();
47
- const errors = [];
48
- page.on('pageerror', (e) => errors.push(String(e && e.message || e)));
49
- page.on('dialog', (d) => d.dismiss().catch(() => {}));
50
-
51
- /* ── A: the ways in ── */
52
- await page.goto(BASE + '/console.html');
53
- ok('A1 the header has a Settings gear', await waitFor(page, () => !!document.querySelector('[data-c3pg="settings"]')));
54
- await page.click('[data-c3pg="settings"]');
55
- ok('A2 the gear opens Settings', await waitFor(page, () => { const p = document.querySelector('[data-c3-pane="settings"]'); return p && !p.hidden && !!p.querySelector('[data-c3set]'); }));
56
- ok('A3 the title says Settings', (await page.textContent('[data-c3pg="title"]')).trim() === 'Settings');
57
- ok('A4 the address names the page', new URL(page.url()).searchParams.get('tab') === 'settings');
58
- ok('A5 no tab is selected while Settings shows', await page.evaluate(() => ![...document.querySelectorAll('[role="tab"]')].some((b) => b.getAttribute('aria-selected') === 'true')));
59
- await page.click('[data-c3-tab="work"]');
60
- ok('A6 a tab press leaves Settings', await waitFor(page, () => document.querySelector('[data-c3-pane="settings"]').hidden && !document.querySelector('[data-c3-pane="work"]').hidden));
61
- await page.click('[data-c3pg="more"]');
62
- ok('A7 the More menu has Settings', await waitFor(page, () => !!document.querySelector('.c3pg-menu [data-a="settings"]')));
63
- ok('A7b the More menu opens the premium pages', await page.evaluate(() => { const a = document.querySelector('.c3pg-menu [data-a="premium"]'); return !!a && a.getAttribute('href') === '/premium.html' && a.textContent.trim() === 'Open premium'; }));
64
- await page.click('.c3pg-menu [data-a="settings"]');
65
- ok('A8 the More menu item opens Settings', await waitFor(page, () => !document.querySelector('[data-c3-pane="settings"]').hidden));
66
-
67
- /* ── B: every section draws ── */
68
- await waitFor(page, () => !!document.querySelector('[data-c3set-section] .st-row'));
69
- ok('B0 Settings opens on About you, drawn as console3 section cards', await waitFor(page, () => !!document.querySelector('[data-c3set-section="about"] .card.sect .list .nrow.st-row #c3set-you-name')));
70
- ok('B1 the nav lists every section', (await page.$$eval('[data-c3set-nav] [data-c3set-sec]', (b) => b.length)) === SECTIONS.length);
71
- for (const id of SECTIONS) {
72
- await page.click(`[data-c3set-nav] [data-c3set-sec="${id}"]`);
73
- const drew = await waitFor(page, (s) => { const x = document.querySelector('[data-c3set-section="' + s + '"]'); return x && x.querySelectorAll('.st-row, .sect, .fold').length > 0; }, id, 4000);
74
- ok(`B2 section ${id} draws`, drew);
75
- }
76
-
77
- await page.click('[data-c3set-nav] [data-c3set-sec="sessions"]');
78
- ok('B3 Claude sessions has the PMOS own-login row with Set up', await waitFor(page, () => { const r = document.querySelector('[data-c3set-section="sessions"] [data-c3set-own]'); const b = r && r.querySelector('[data-c3set-own-signin]'); return !!b && /Set up/.test(b.textContent) && !r.querySelector('[data-c3set-own-use]'); }, null, 4000));
79
-
80
- /* ── C: search ── */
81
- await page.fill('[data-c3set-search]', 'language');
82
- ok('C1 search finds the recording language', await waitFor(page, () => !!document.querySelector('[data-c3set-body] [data-c3set-row="notes.language"]')));
83
- await page.fill('[data-c3set-search]', 'zzqx');
84
- ok('C2 search with no match says so', await waitFor(page, () => !!document.querySelector('[data-c3set-none]')));
85
- await page.fill('[data-c3set-search]', '');
86
-
87
- /* ── D: a store setting is saved and read back ── */
88
- await page.click('[data-c3set-nav] [data-c3set-sec="time"]');
89
- await waitFor(page, () => !!document.querySelector('#c3set-time\\.workStart'));
90
- await page.selectOption('#c3set-time\\.workStart', '8');
91
- const saved = await waitFor(page, async () => { const r = await fetch('/api/settings'); const j = await r.json(); const s = j.settings.find((x) => x.key === 'time.workStart'); return s && s.value === 8 && s.changed; });
92
- ok('D1 a change is saved through the settings API', saved);
93
- ok('D1b the save says so in a toast with Undo', await waitFor(page, () => { const t = document.querySelector('[data-c3-toast]'); return !!t && /Saved: Working hours start/.test(t.textContent) && !!t.querySelector('[data-c3-toast-action]'); }));
94
- ok('D2 the section shows the change', await waitFor(page, () => !!document.querySelector('[data-c3set-row="time.workStart"] .st-dot')));
95
- ok('D3 the nav counts the change', await waitFor(page, () => { const b = document.querySelector('[data-c3set-sec="time"] .bdg'); return b && b.textContent === '1'; }));
96
- ok('D3b the section offers Reset section', await waitFor(page, () => !!document.querySelector('[data-c3set-reset-sec="time"]')));
97
- const rs = await page.$('[data-c3set-row="time.workStart"] [data-c3set-reset]');
98
- if (rs) await rs.click();
99
- ok('D4 Reset puts the default back', await waitFor(page, async () => { const j = await (await fetch('/api/settings')).json(); const s = j.settings.find((x) => x.key === 'time.workStart'); return s && s.value === 9 && !s.changed; }));
100
- const refused = await page.evaluate(async () => { const { pmPost } = await import('/pm/http.js'); return pmPost('/api/settings', { key: 'time.workStart', value: 99 }); });
101
- ok('D5 a value out of range is refused', refused && refused.ok === false && !/page only/.test(refused.error || ''), JSON.stringify(refused));
102
-
103
- /* ── D6: About you saves to the proactive settings the Welcome page uses ── */
104
- await page.click('[data-c3set-nav] [data-c3set-sec="about"]');
105
- await waitFor(page, () => !!document.querySelector('#c3set-you-role'));
106
- await page.fill('#c3set-you-role', 'Senior PM, Payments');
107
- await page.press('#c3set-you-role', 'Tab');
108
- ok('D6 About you saves the role', await waitFor(page, async () => { const j = await (await fetch('/api/proactive/settings')).json(); return j.settings && j.settings.about && j.settings.about.role === 'Senior PM, Payments'; }));
109
-
110
- /* ── D7: a feature PMOS does not have yet shows as a row with its control off (decision 9) ── */
111
- await page.click('[data-c3set-nav] [data-c3set-sec="access"]');
112
- ok('D7 phone pairing shows, turned off, with the reason', await waitFor(page, () => { const r = document.querySelector('[data-c3set-row="access.pair"]'); return !!r && !!r.querySelector('button:disabled') && !!r.querySelector('.fold'); }));
113
-
114
-
115
- /* ── R: Data refresh (data-refresh-settings R9) ── */
116
- await page.goto(BASE + '/console.html?tab=settings');
117
- await waitFor(page, () => !!document.querySelector('[data-c3set-nav] [data-c3set-sec="connectors"]'));
118
- await page.click('[data-c3set-nav] [data-c3set-sec="connectors"]');
119
- ok('R1 Connectors links to Data refresh instead of holding its schedule', await waitFor(page, () => { const a = document.querySelector('[data-c3set-row="conn.cal.refresh"]'); const b = document.querySelector('[data-c3set-row="conn.jira.refresh"]'); return !!a && !!b && !!a.querySelector('button.lk') && /Data refresh/.test(a.textContent) && !a.querySelector('select') && !b.querySelector('select'); }));
120
- await page.click('[data-c3set-row="conn.cal.refresh"] button.lk');
121
- ok('R2 the link opens the Data refresh section', await waitFor(page, () => !!document.querySelector('[data-c3set-section="refresh"] [data-c3set-rf-card]')));
122
- ok('R3 the section draws 15 source rows in three cards', await waitFor(page, () => document.querySelectorAll('[data-c3set-section="refresh"] [data-c3set-rf]').length === 15 && document.querySelectorAll('[data-c3set-rf-card]').length === 3));
123
- ok('R3b the overview, the rules and the log are there', await page.evaluate(() => !!document.querySelector('[data-c3set-rf-sum]') && !!document.querySelector('[data-c3set-rf-all]') && !!document.querySelector('[data-c3set-rf-rules]') && !!document.querySelector('[data-c3set-rf-log]')));
124
- ok('R3c a source with its own home says where, and has no editor button', await page.evaluate(() => { const r = document.querySelector('[data-c3set-rf="scan"]'); return !!r && /Set in Initiatives/.test(r.textContent) && !r.querySelector('[data-c3set-rf-open]'); }));
125
- ok('R3d the filter Off lists the sources that are off', await (async () => { await page.click('[data-c3set-section="refresh"] .seg [data-v="off"]'); const n = await page.evaluate(() => document.querySelectorAll('[data-c3set-rf]').length); await page.click('[data-c3set-section="refresh"] .seg [data-v="all"]'); return n > 0 && n < 14; })());
126
-
127
- // turning on needs no question
128
- await page.click('[data-c3set-rf-on="calendar"]');
129
- ok('R4 turning a source on posts on:true and shows a toast with Undo', await waitFor(page, () => { const t = document.querySelector('[data-c3-toast]'); return !!t && /Turned on: Calendar/.test(t.textContent) && !!t.querySelector('[data-c3-toast-action]'); }));
130
- ok('R4b the server has it on', await waitFor(page, async () => { const j = await (await fetch('/api/refresh')).json(); return j.rows.find((x) => x.id === 'calendar').on === true; }));
131
-
132
- // the schedule editor posts the schedule
133
- await page.click('[data-c3set-rf-open="calendar"]');
134
- ok('R5 Schedule opens the editor under the row', await waitFor(page, () => !!document.querySelector('[data-c3set-rf="calendar"] [data-c3set-rf-editor]')));
135
- await page.selectOption('#c3set-rf-time-0', '07:00');
136
- const posted = page.waitForRequest((q) => q.url().endsWith('/api/refresh/source') && q.method() === 'POST' && /schedule/.test(q.postData() || ''), { timeout: 8000 }).catch(() => null);
137
- await page.click('[data-c3set-rf-save="calendar"]');
138
- const req = await posted; const body = req ? JSON.parse(req.postData()) : null;
139
- ok('R6 Save posts {id, schedule} with the new time', body && body.id === 'calendar' && body.schedule.kind === 'daily' && body.schedule.times[0] === '07:00', JSON.stringify(body));
140
- ok('R6b the save says so in a toast with Undo', await waitFor(page, () => { const t = document.querySelector('[data-c3-toast]'); return !!t && /Saved: Calendar/.test(t.textContent) && /07:00/.test(t.textContent) && !!t.querySelector('[data-c3-toast-action]'); }));
141
- ok('R6c the row shows the new schedule', await waitFor(page, () => /07:00/.test((document.querySelector('[data-c3set-rf="calendar"] .chips') || {}).textContent || '')));
142
-
143
- // turning a source off asks first and names what it affects
144
- await page.click('[data-c3set-rf-on="jira"]');
145
- await waitFor(page, async () => (await (await fetch('/api/refresh')).json()).rows.find((x) => x.id === 'jira').on === true);
146
- await page.click('[data-c3set-rf-on="jira"]');
147
- ok('R7 turning off asks first and names the impact and what uses it', await waitFor(page, () => { const a = document.querySelector('[data-c3set-rf-ask="jira"]'); return !!a && /Sprint summaries stop/.test(a.textContent) && /Core documents/.test(a.textContent) && /Initiative driver/.test(a.textContent); }));
148
- ok('R7b nothing changed yet', await page.evaluate(async () => (await (await fetch('/api/refresh')).json()).rows.find((x) => x.id === 'jira').on === true));
149
- await page.click('[data-c3set-rf-off-go="jira"]');
150
- ok('R7c confirming posts off and shows a toast with Undo', await waitFor(page, async () => { const j = await (await fetch('/api/refresh')).json(); const t = document.querySelector('[data-c3-toast]'); return j.rows.find((x) => x.id === 'jira').on === false && !!t && /Turned off: Jira/.test(t.textContent) && !!t.querySelector('[data-c3-toast-action]'); }));
151
-
152
- // the rules
153
- await page.selectOption('#c3set-rf-max', '2');
154
- ok('R8 a rule is saved through POST /api/refresh/rules', await waitFor(page, async () => (await (await fetch('/api/refresh')).json()).rules.max === '2'));
155
- ok('R8b the rules card shows quiet and working hours read-only', await page.evaluate(() => { const r = document.querySelector('[data-c3set-row="rf.quiet"]'); const w = document.querySelector('[data-c3set-row="rf.window"]'); return !!r && !!w && !r.querySelector('select, input') && /09:00 to 18:00/.test(w.textContent); }));
156
-
157
- // the log
158
- const ran = await page.evaluate(async () => { const { pmPost } = await import('/pm/http.js'); const w = (await (await fetch('/api/refresh')).json()).ws; return pmPost('/api/refresh/run', { id: 'signals', ws: w }); });
159
- ok('R9 a refresh can be pressed', ran && ran.ok, JSON.stringify(ran));
160
- ok('R9b the log view lists the run, newest first, with Export', await waitFor(page, () => { const l = document.querySelector('[data-c3set-rf-log]'); return !!l && l.querySelectorAll('[data-c3set-rfrun]').length > 0 && /Signals/.test(l.textContent) && /\/api\/refresh\/log\.csv/.test((l.querySelector('[data-c3set-rf-export]') || {}).href || ''); }, null, 20000));
161
- await page.selectOption('#c3set-rf-log-result', 'failed');
162
- ok('R9c filtering by result puts it in the Export link', await waitFor(page, () => /result=failed/.test((document.querySelector('[data-c3set-rf-export]') || {}).href || '')));
163
- await page.selectOption('#c3set-rf-log-result', '');
164
-
165
- /* ── E: theme ── */
166
- await page.click('[data-c3set-nav] [data-c3set-sec="appearance"]');
167
- await waitFor(page, () => !!document.querySelector('[data-c3set-row="look.theme"] [data-v="dark"]'));
168
- await page.click('[data-c3set-row="look.theme"] [data-v="dark"]');
169
- ok('E1 the theme switch sets the page theme', await waitFor(page, () => document.documentElement.getAttribute('data-pm-page-theme') === 'dark'));
170
- await page.click('[data-c3set-row="look.theme"] [data-v="light"]');
171
-
172
- /* ── F: start page and time of day take effect on the next load ── */
173
- const post = (key, value) => page.evaluate(async ([k, v]) => { const { pmPost } = await import('/pm/http.js'); return pmPost('/api/settings', { key: k, value: v }); }, [key, value]);
174
- const f0 = [await post('look.start', 'cal'), await post('time.tint', false), await post('time.strip', false)];
175
- ok('F0 the start page and switches save', f0.every((r) => r && r.ok), JSON.stringify(f0));
176
- await page.goto(BASE + '/console.html');
177
- ok('F1 the saved start page opens', await waitFor(page, () => { const p = document.querySelector('[data-c3-pane="cal"]'); return p && !p.hidden; }));
178
- ok('F2 the tint switch reaches the page', await waitFor(page, () => document.getElementById('c3-root').getAttribute('data-c3-tint') === 'off'));
179
- ok('F3 the daylight strip is hidden', await waitFor(page, () => { const s = document.querySelector('.c3pg-daylight'); return !s || getComputedStyle(s).display === 'none'; })); // the stylesheet loads after the attribute is set
180
- await page.goto(BASE + '/console.html?tab=settings');
181
- ok('F4 ?tab=settings opens Settings directly', await waitFor(page, () => { const p = document.querySelector('[data-c3-pane="settings"]'); return p && !p.hidden && !!p.querySelector('[data-c3set]'); }));
182
- await post('look.start', 'brief'); await post('time.tint', true); await post('time.strip', true);
183
-
184
- /* ── G: the palette ── */
185
- await page.goto(BASE + '/console.html');
186
- await waitFor(page, () => !!document.querySelector('[data-c3pg="search"]'));
187
- await page.click('[data-c3pg="search"]');
188
- await sleep(200);
189
- await page.keyboard.type('Settings');
190
- ok('G1 the palette lists Settings', await waitFor(page, () => [...document.querySelectorAll('[role="option"], .pal li, .pal button, [data-pal-item]')].some((x) => /Settings/.test(x.textContent)), null, 3000));
191
-
192
- /* ── I: Set up Laya opens its terminal on the page, not only on the server (jev-local-fallback R9) ── */
193
- await page.goto(BASE + '/console.html?tab=settings');
194
- await waitFor(page, () => !!document.querySelector('[data-c3set-nav] [data-c3set-sec="privacy"]'));
195
- await page.click('[data-c3set-nav] [data-c3set-sec="privacy"]');
196
- ok('I1 Privacy shows the Set up Laya button', await waitFor(page, () => !!document.querySelector('[data-c3set-laya-setup]')));
197
- await page.click('[data-c3set-laya-setup]');
198
- ok('I2 the press opens the Set up Laya terminal', await waitFor(page, () => !!document.querySelector('[data-c3-session-term]'), null, 10000));
199
- ok('I3 the row says what to do next', await waitFor(page, () => /Press Enter there/.test((document.querySelector('[data-c3set-row="typesafe.local"]') || {}).textContent || '')));
200
- await page.keyboard.press('Escape').catch(() => {});
201
-
202
- ok('H1 the page throws no error', errors.length === 0, errors.slice(0, 3).join(' | '));
203
- finish();
204
- })();