create-pmos 0.399.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 (421) hide show
  1. package/package.json +18 -13
  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 +2 -2
  7. package/workspace/briefing-premium-board-test.js +2 -2
  8. package/workspace/briefing-premium-doc-edit-test.js +2 -8
  9. package/workspace/briefing-premium-test.js +3 -2
  10. package/workspace/briefing-premium-work-test.js +9 -4
  11. package/workspace/c3-capture-test.js +0 -17
  12. package/workspace/changelog.json +17 -0
  13. package/workspace/guide/briefing-premium.md +2 -2
  14. package/workspace/guide/home.md +20 -2
  15. package/workspace/guide/layout.md +2 -2
  16. package/workspace/guide/notes.md +2 -2
  17. package/workspace/guide/phone-companion.md +1 -1
  18. package/workspace/lib/route-modules.js +1 -9
  19. package/workspace/lib/routes-phone-day.js +18 -9
  20. package/workspace/lib/routes-slash.js +95 -0
  21. package/workspace/package-lock.json +2 -2
  22. package/workspace/package.json +1 -2
  23. package/workspace/premium-chat-goal-view-test.js +1 -1
  24. package/workspace/premium-chat-term-test.js +0 -10
  25. package/workspace/premium-menu-rows-test.js +1 -1
  26. package/workspace/premium-phone-card-test.js +2 -2
  27. package/workspace/premium-vw-doc-test.js +1 -8
  28. package/workspace/premium-work-depth-test.js +2 -3
  29. package/workspace/public/capture.html +23 -0
  30. package/workspace/public/pm/c3-base.js +47 -0
  31. package/workspace/public/pm/c3-capture.js +1 -1
  32. package/workspace/public/pm/c3-ini-ui.js +1 -1
  33. package/workspace/public/pm/c3-sheet.js +1 -1
  34. package/workspace/public/pm/c3-toast.js +1 -1
  35. package/workspace/public/pm/console3.css +3 -0
  36. package/workspace/public/pm/cozy-home.css +20 -5
  37. package/workspace/public/pm/cozy-today.css +5 -2
  38. package/workspace/public/pm/cozy-viewer.js +4 -2
  39. package/workspace/public/pm/cozy.css +9 -0
  40. package/workspace/public/pm/goal-chat.js +5 -1
  41. package/workspace/public/pm/home-app.js +47 -26
  42. package/workspace/public/pm/home-chat.js +10 -4
  43. package/workspace/public/pm/home-data.js +3 -1
  44. package/workspace/public/pm/home-dictate.js +7 -4
  45. package/workspace/public/pm/home-ini.js +12 -2
  46. package/workspace/public/pm/home-list.js +20 -7
  47. package/workspace/public/pm/home-more.js +2 -2
  48. package/workspace/public/pm/home-phone-card.js +9 -4
  49. package/workspace/public/pm/home-review.js +2 -3
  50. package/workspace/public/pm/home-today.js +10 -6
  51. package/workspace/public/pm/home-work.js +15 -8
  52. package/workspace/public/pm/note-dock.js +1 -2
  53. package/workspace/public/pm/notes-links.js +1 -2
  54. package/workspace/public/pm/notes-task.js +3 -4
  55. package/workspace/public/pm/premium-board.js +1 -1
  56. package/workspace/public/pm/premium-initiative-head.js +3 -3
  57. package/workspace/public/pm/premium-vw-doc.css +20 -2
  58. package/workspace/public/pm/premium-vw-doc.js +22 -7
  59. package/workspace/public/pm/view-notes.js +2 -2
  60. package/workspace/replaced-tests.json +435 -0
  61. package/workspace/run-tests.js +323 -28
  62. package/workspace/server.js +15 -10
  63. package/workspace/test-files.json +3 -140
  64. package/workspace/test-lists/base.json +1 -2
  65. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  66. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  67. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  68. package/workspace/test-lists/c3-work-agent.json +1 -2
  69. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  70. package/workspace/test-lists/console3-reports.json +1 -2
  71. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  72. package/workspace/test-lists/extension-capture.json +5 -0
  73. package/workspace/test-lists/jira-wbs.json +1 -2
  74. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  75. package/workspace/test-lists/meeting-material.json +1 -2
  76. package/workspace/test-lists/meeting-notes.json +2 -36
  77. package/workspace/test-lists/meeting-replay.json +1 -2
  78. package/workspace/test-lists/mm-capture.json +2 -12
  79. package/workspace/test-lists/my-work.json +2 -10
  80. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  81. package/workspace/test-lists/people-directory.json +1 -2
  82. package/workspace/test-lists/run2-a.json +1 -2
  83. package/workspace/test-lists/run2-d.json +2 -19
  84. package/workspace/test-lists/run3-b.json +1 -2
  85. package/workspace/test-lists/run3-c.json +2 -12
  86. package/workspace/test-lists/run4-b.json +1 -2
  87. package/workspace/test-lists/run4-d.json +1 -5
  88. package/workspace/test-lists/run5-c.json +1 -11
  89. package/workspace/test-lists/run6.json +1 -5
  90. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  91. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  92. package/workspace/test-timings.json +242 -123
  93. package/workspace/c3-briefing-test.js +0 -136
  94. package/workspace/c3-core-docs-test.js +0 -170
  95. package/workspace/c3-driver-fixture.js +0 -64
  96. package/workspace/c3-driver-test.js +0 -169
  97. package/workspace/c3-foundation-test.js +0 -163
  98. package/workspace/c3-ib-items-test.js +0 -114
  99. package/workspace/c3-ib-more-test.js +0 -146
  100. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  101. package/workspace/c3-ini-harness.js +0 -66
  102. package/workspace/c3-ini-life-test.js +0 -167
  103. package/workspace/c3-initiatives-test.js +0 -186
  104. package/workspace/c3-light-load-test.js +0 -112
  105. package/workspace/c3-one-home-test.js +0 -149
  106. package/workspace/c3-phone-test.js +0 -289
  107. package/workspace/c3-quiet-test.js +0 -157
  108. package/workspace/c3-report-design-real-test.js +0 -264
  109. package/workspace/c3-report-design-test.js +0 -442
  110. package/workspace/c3-report-setup-test.js +0 -192
  111. package/workspace/c3-report-structure-real-test.js +0 -248
  112. package/workspace/c3-report-structure-test.js +0 -397
  113. package/workspace/c3-reports-test.js +0 -288
  114. package/workspace/c3-scan-test.js +0 -517
  115. package/workspace/c3-sessions-panel-test.js +0 -365
  116. package/workspace/c3-settings-test.js +0 -204
  117. package/workspace/c3-updates-test.js +0 -131
  118. package/workspace/c3-work-test.js +0 -260
  119. package/workspace/cut-stub.js +0 -40
  120. package/workspace/first-paint-audit.js +0 -160
  121. package/workspace/lib/c3-full-console.js +0 -15
  122. package/workspace/lib/engine/derived/trust.js +0 -3
  123. package/workspace/lib/engine/plan-forecast.js +0 -342
  124. package/workspace/lib/engine/report-families.js +0 -175
  125. package/workspace/lib/engine/truth-table.js +0 -57
  126. package/workspace/lib/routes-c3-init.js +0 -54
  127. package/workspace/lib/routes-c3-life.js +0 -120
  128. package/workspace/lib/routes-c3-timeline.js +0 -192
  129. package/workspace/lib/routes-forecast.js +0 -86
  130. package/workspace/lib/routes-releases.js +0 -130
  131. package/workspace/lib/routes-report-facts.js +0 -85
  132. package/workspace/lib/routes-report-families.js +0 -33
  133. package/workspace/lib/routes-signals.js +0 -51
  134. package/workspace/lib/routes-timeline.js +0 -197
  135. package/workspace/public/c3.html +0 -35
  136. package/workspace/public/index.html +0 -156
  137. package/workspace/public/pm/app.js +0 -831
  138. package/workspace/public/pm/bd-board.js +0 -159
  139. package/workspace/public/pm/bd-drag.js +0 -59
  140. package/workspace/public/pm/bd-model.js +0 -152
  141. package/workspace/public/pm/bd-timeline.js +0 -233
  142. package/workspace/public/pm/bd-tree.js +0 -244
  143. package/workspace/public/pm/board-copy.js +0 -59
  144. package/workspace/public/pm/board-read.js +0 -38
  145. package/workspace/public/pm/branches-sheet.js +0 -56
  146. package/workspace/public/pm/breakdown-api.js +0 -58
  147. package/workspace/public/pm/breakdown-copy.js +0 -138
  148. package/workspace/public/pm/briefing-deck.js +0 -441
  149. package/workspace/public/pm/briefing-model.js +0 -251
  150. package/workspace/public/pm/c3-ambient.js +0 -100
  151. package/workspace/public/pm/c3-audience-link.js +0 -21
  152. package/workspace/public/pm/c3-audience.js +0 -46
  153. package/workspace/public/pm/c3-boot.js +0 -13
  154. package/workspace/public/pm/c3-breakdown.js +0 -240
  155. package/workspace/public/pm/c3-brief-data.js +0 -11
  156. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  157. package/workspace/public/pm/c3-brief-needs.js +0 -288
  158. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  159. package/workspace/public/pm/c3-brief-summary.js +0 -139
  160. package/workspace/public/pm/c3-brief-today.js +0 -79
  161. package/workspace/public/pm/c3-brief.js +0 -279
  162. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  163. package/workspace/public/pm/c3-calendar.js +0 -965
  164. package/workspace/public/pm/c3-calpop.js +0 -111
  165. package/workspace/public/pm/c3-case.js +0 -196
  166. package/workspace/public/pm/c3-core-docs.css +0 -18
  167. package/workspace/public/pm/c3-core-docs.js +0 -236
  168. package/workspace/public/pm/c3-daypart.js +0 -176
  169. package/workspace/public/pm/c3-demo-boards.js +0 -764
  170. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  171. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  172. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  173. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  174. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  175. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  176. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  177. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  178. package/workspace/public/pm/c3-demo-data.js +0 -552
  179. package/workspace/public/pm/c3-demo-focus.js +0 -181
  180. package/workspace/public/pm/c3-demo-init.js +0 -430
  181. package/workspace/public/pm/c3-demo-life.js +0 -77
  182. package/workspace/public/pm/c3-demo-material.js +0 -58
  183. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  184. package/workspace/public/pm/c3-demo-phone.js +0 -48
  185. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  186. package/workspace/public/pm/c3-demo-rd.js +0 -432
  187. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  188. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  189. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  190. package/workspace/public/pm/c3-demo-rs.js +0 -287
  191. package/workspace/public/pm/c3-demo-term.js +0 -153
  192. package/workspace/public/pm/c3-demo-time.js +0 -49
  193. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  194. package/workspace/public/pm/c3-demo.js +0 -131
  195. package/workspace/public/pm/c3-design-studio.js +0 -369
  196. package/workspace/public/pm/c3-doc-formats.js +0 -153
  197. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  198. package/workspace/public/pm/c3-dock.js +0 -206
  199. package/workspace/public/pm/c3-docs.js +0 -291
  200. package/workspace/public/pm/c3-driver-work.js +0 -110
  201. package/workspace/public/pm/c3-driver.css +0 -18
  202. package/workspace/public/pm/c3-driver.js +0 -298
  203. package/workspace/public/pm/c3-focus.css +0 -304
  204. package/workspace/public/pm/c3-focus.js +0 -983
  205. package/workspace/public/pm/c3-ib-docs.js +0 -92
  206. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  207. package/workspace/public/pm/c3-ib-items.js +0 -210
  208. package/workspace/public/pm/c3-ib-releases.js +0 -48
  209. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  210. package/workspace/public/pm/c3-ib-triage.js +0 -177
  211. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  212. package/workspace/public/pm/c3-ini-life.css +0 -34
  213. package/workspace/public/pm/c3-ini-life.js +0 -379
  214. package/workspace/public/pm/c3-ini-records.js +0 -197
  215. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  216. package/workspace/public/pm/c3-ini-work.js +0 -139
  217. package/workspace/public/pm/c3-init-extras.js +0 -170
  218. package/workspace/public/pm/c3-initiatives.js +0 -852
  219. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  220. package/workspace/public/pm/c3-look.js +0 -27
  221. package/workspace/public/pm/c3-material.css +0 -22
  222. package/workspace/public/pm/c3-material.js +0 -321
  223. package/workspace/public/pm/c3-md.js +0 -3
  224. package/workspace/public/pm/c3-misc-panels.js +0 -89
  225. package/workspace/public/pm/c3-new-session.js +0 -110
  226. package/workspace/public/pm/c3-notes.js +0 -751
  227. package/workspace/public/pm/c3-phone-boot.js +0 -47
  228. package/workspace/public/pm/c3-phone-detail.js +0 -97
  229. package/workspace/public/pm/c3-phone-model.js +0 -3
  230. package/workspace/public/pm/c3-phone.css +0 -66
  231. package/workspace/public/pm/c3-phone.js +0 -444
  232. package/workspace/public/pm/c3-plan-panels.js +0 -163
  233. package/workspace/public/pm/c3-plan.js +0 -193
  234. package/workspace/public/pm/c3-quiet.css +0 -113
  235. package/workspace/public/pm/c3-quiet.js +0 -177
  236. package/workspace/public/pm/c3-replay.css +0 -133
  237. package/workspace/public/pm/c3-replay.js +0 -429
  238. package/workspace/public/pm/c3-report-deck.css +0 -163
  239. package/workspace/public/pm/c3-report-deck.js +0 -598
  240. package/workspace/public/pm/c3-report-frame.css +0 -20
  241. package/workspace/public/pm/c3-report-print.css +0 -20
  242. package/workspace/public/pm/c3-report-setup.css +0 -67
  243. package/workspace/public/pm/c3-report-setup.js +0 -298
  244. package/workspace/public/pm/c3-report-store.js +0 -244
  245. package/workspace/public/pm/c3-report-structure.css +0 -44
  246. package/workspace/public/pm/c3-report-structure.js +0 -473
  247. package/workspace/public/pm/c3-reports.css +0 -68
  248. package/workspace/public/pm/c3-reports.js +0 -377
  249. package/workspace/public/pm/c3-roadmap.js +0 -249
  250. package/workspace/public/pm/c3-scan-api.js +0 -167
  251. package/workspace/public/pm/c3-scan-next.js +0 -248
  252. package/workspace/public/pm/c3-scan-setup.js +0 -313
  253. package/workspace/public/pm/c3-scan-words.js +0 -41
  254. package/workspace/public/pm/c3-scan.css +0 -74
  255. package/workspace/public/pm/c3-scan.js +0 -93
  256. package/workspace/public/pm/c3-session-chat.js +0 -103
  257. package/workspace/public/pm/c3-session-conv.js +0 -165
  258. package/workspace/public/pm/c3-session-term.js +0 -216
  259. package/workspace/public/pm/c3-settings.css +0 -85
  260. package/workspace/public/pm/c3-settings.js +0 -1045
  261. package/workspace/public/pm/c3-shell.js +0 -628
  262. package/workspace/public/pm/c3-signals.js +0 -196
  263. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  264. package/workspace/public/pm/c3-swipe.js +0 -230
  265. package/workspace/public/pm/c3-terminal-data.js +0 -48
  266. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  267. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  268. package/workspace/public/pm/c3-terminal-results.js +0 -141
  269. package/workspace/public/pm/c3-terminal.js +0 -52
  270. package/workspace/public/pm/c3-tickets.js +0 -163
  271. package/workspace/public/pm/c3-timeline.js +0 -201
  272. package/workspace/public/pm/calendar-views.js +0 -1049
  273. package/workspace/public/pm/console3-lift.md +0 -220
  274. package/workspace/public/pm/cozy-home.js +0 -172
  275. package/workspace/public/pm/cozy-initiative.css +0 -138
  276. package/workspace/public/pm/cycle-review.js +0 -125
  277. package/workspace/public/pm/data.js +0 -1577
  278. package/workspace/public/pm/dest-board.js +0 -444
  279. package/workspace/public/pm/dest-docs.js +0 -530
  280. package/workspace/public/pm/dest-initiatives.js +0 -162
  281. package/workspace/public/pm/dest-mywork.js +0 -307
  282. package/workspace/public/pm/dest-notes.js +0 -537
  283. package/workspace/public/pm/dest-people.js +0 -449
  284. package/workspace/public/pm/dest-reports.js +0 -383
  285. package/workspace/public/pm/dest-settings.js +0 -601
  286. package/workspace/public/pm/dest-today.js +0 -267
  287. package/workspace/public/pm/display-word.js +0 -56
  288. package/workspace/public/pm/doc-editor.js +0 -473
  289. package/workspace/public/pm/doc-graph.js +0 -272
  290. package/workspace/public/pm/doc-health-panel.js +0 -110
  291. package/workspace/public/pm/doc-rail.js +0 -167
  292. package/workspace/public/pm/doc-remote.js +0 -180
  293. package/workspace/public/pm/dock-sessions.js +0 -472
  294. package/workspace/public/pm/dock.js +0 -216
  295. package/workspace/public/pm/fixture.js +0 -821
  296. package/workspace/public/pm/flag-picker.js +0 -104
  297. package/workspace/public/pm/frame-copy.js +0 -278
  298. package/workspace/public/pm/freshness-line.js +0 -149
  299. package/workspace/public/pm/handoff-box.js +0 -82
  300. package/workspace/public/pm/initiative-list.js +0 -235
  301. package/workspace/public/pm/initiative-sheet.js +0 -331
  302. package/workspace/public/pm/initiatives-api.js +0 -95
  303. package/workspace/public/pm/initiatives-copy.js +0 -287
  304. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  305. package/workspace/public/pm/initiatives-timeline.js +0 -410
  306. package/workspace/public/pm/initiatives-ui.js +0 -291
  307. package/workspace/public/pm/item-sheet.js +0 -268
  308. package/workspace/public/pm/keep-card.js +0 -204
  309. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  310. package/workspace/public/pm/lifecycle-lens.js +0 -276
  311. package/workspace/public/pm/lifecycle.js +0 -111
  312. package/workspace/public/pm/mobile.css +0 -366
  313. package/workspace/public/pm/mobile.js +0 -581
  314. package/workspace/public/pm/modes-live.js +0 -453
  315. package/workspace/public/pm/modes.js +0 -147
  316. package/workspace/public/pm/my-work-card.js +0 -51
  317. package/workspace/public/pm/my-work-data.js +0 -36
  318. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  319. package/workspace/public/pm/next-step-ui.js +0 -190
  320. package/workspace/public/pm/outbox-panel.js +0 -125
  321. package/workspace/public/pm/palette-copy.js +0 -55
  322. package/workspace/public/pm/palette.js +0 -343
  323. package/workspace/public/pm/panel-breakdown.js +0 -702
  324. package/workspace/public/pm/panel-cockpit.js +0 -425
  325. package/workspace/public/pm/panel-detail.js +0 -1513
  326. package/workspace/public/pm/panel-initiatives.js +0 -929
  327. package/workspace/public/pm/panel-newsess.js +0 -709
  328. package/workspace/public/pm/panel-repos.js +0 -741
  329. package/workspace/public/pm/panel-tabs.js +0 -1506
  330. package/workspace/public/pm/panel-trees.js +0 -204
  331. package/workspace/public/pm/people-link.js +0 -106
  332. package/workspace/public/pm/phone-deck.js +0 -167
  333. package/workspace/public/pm/pm-work-view.js +0 -1533
  334. package/workspace/public/pm/portfolio-report.js +0 -61
  335. package/workspace/public/pm/premium-acts.js +0 -280
  336. package/workspace/public/pm/premium-brief.js +0 -111
  337. package/workspace/public/pm/premium-chat.js +0 -22
  338. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  339. package/workspace/public/pm/premium-initiative.js +0 -324
  340. package/workspace/public/pm/premium-insights.css +0 -228
  341. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  342. package/workspace/public/pm/premium-report-brief.js +0 -132
  343. package/workspace/public/pm/premium-vw-rec.js +0 -67
  344. package/workspace/public/pm/premium-wide.css +0 -30
  345. package/workspace/public/pm/print.css +0 -44
  346. package/workspace/public/pm/provider-cards.js +0 -136
  347. package/workspace/public/pm/registry.js +0 -203
  348. package/workspace/public/pm/release-card.js +0 -110
  349. package/workspace/public/pm/releases-view.js +0 -248
  350. package/workspace/public/pm/report-families-view.js +0 -505
  351. package/workspace/public/pm/report-slides.js +0 -438
  352. package/workspace/public/pm/report-tab.js +0 -33
  353. package/workspace/public/pm/report-view.js +0 -337
  354. package/workspace/public/pm/reports-copy.js +0 -134
  355. package/workspace/public/pm/roadmap.js +0 -294
  356. package/workspace/public/pm/run-card.js +0 -260
  357. package/workspace/public/pm/sessions-panel.js +0 -219
  358. package/workspace/public/pm/sheet-jira.js +0 -353
  359. package/workspace/public/pm/shell-bell.js +0 -163
  360. package/workspace/public/pm/shell-model.js +0 -83
  361. package/workspace/public/pm/shell-phone.js +0 -124
  362. package/workspace/public/pm/shell-readaloud.js +0 -53
  363. package/workspace/public/pm/shell-recording.js +0 -274
  364. package/workspace/public/pm/shell-ticker.js +0 -90
  365. package/workspace/public/pm/sig-watch.js +0 -41
  366. package/workspace/public/pm/slide-confirm.js +0 -163
  367. package/workspace/public/pm/slides-copy.js +0 -52
  368. package/workspace/public/pm/status-banner.js +0 -95
  369. package/workspace/public/pm/tab-doc.js +0 -859
  370. package/workspace/public/pm/tab-gone.js +0 -21
  371. package/workspace/public/pm/tab-term.js +0 -1210
  372. package/workspace/public/pm/tab-web.js +0 -90
  373. package/workspace/public/pm/timeline-copy.js +0 -48
  374. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  375. package/workspace/public/pm/today-agenda.js +0 -331
  376. package/workspace/public/pm/today-cards.js +0 -244
  377. package/workspace/public/pm/today-copy.js +0 -506
  378. package/workspace/public/pm/today-day.js +0 -1371
  379. package/workspace/public/pm/today-goals.js +0 -297
  380. package/workspace/public/pm/today-jobs.js +0 -84
  381. package/workspace/public/pm/today-mentions.js +0 -50
  382. package/workspace/public/pm/topbar.js +0 -202
  383. package/workspace/public/pm/triage-card.js +0 -60
  384. package/workspace/public/pm/undo-hold.js +0 -103
  385. package/workspace/public/pm/view-addrepo.js +0 -208
  386. package/workspace/public/pm/view-files.js +0 -197
  387. package/workspace/public/pm/view-livenotes.js +0 -399
  388. package/workspace/public/pm/view-today.js +0 -13
  389. package/workspace/public/pm/view-validate.js +0 -171
  390. package/workspace/public/pm/welcome.js +0 -391
  391. package/workspace/public/pm/work-place.js +0 -68
  392. package/workspace/public/pm/xlsx-read.js +0 -117
  393. package/workspace/public/welcome.html +0 -22
  394. package/workspace/test-lists/browser-suites-green.json +0 -5
  395. package/workspace/test-lists/c3-core-docs.json +0 -9
  396. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  397. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  398. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  399. package/workspace/test-lists/c3-ib-items.json +0 -9
  400. package/workspace/test-lists/c3-ib-more.json +0 -9
  401. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  402. package/workspace/test-lists/c3-ini-life.json +0 -9
  403. package/workspace/test-lists/c3-meeting-board.json +0 -5
  404. package/workspace/test-lists/c3-meeting-card.json +0 -5
  405. package/workspace/test-lists/c3-notes-place.json +0 -5
  406. package/workspace/test-lists/c3-notes-series.json +0 -5
  407. package/workspace/test-lists/calendar-time-page.json +0 -5
  408. package/workspace/test-lists/calpop.json +0 -4
  409. package/workspace/test-lists/console3-briefing.json +0 -9
  410. package/workspace/test-lists/console3-foundation.json +0 -9
  411. package/workspace/test-lists/console3-work-page.json +0 -9
  412. package/workspace/test-lists/premium-brief-parity.json +0 -9
  413. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  414. package/workspace/test-lists/report-structure-ui.json +0 -11
  415. package/workspace/test-lists/report-workspace-ui.json +0 -5
  416. package/workspace/test-lists/run3-a.json +0 -5
  417. package/workspace/test-lists/run3-d.json +0 -6
  418. package/workspace/test-lists/run4-c.json +0 -13
  419. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  420. package/workspace/test-lists/today-mentions-cards.json +0 -5
  421. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,473 +0,0 @@
1
- /* pm/c3-report-structure.js — the STRUCTURE STEP of the report studio and the saved STRUCTURE in the report setup sheet (initiative report-structure;
2
- * PRD planning/prd/report-structure-prd.md; API contract planning/prd/report-structure-contract.md; mockup 43-reportstructure.js).
3
- *
4
- * openStructure({ ws, id, name, view, onClose }) the wide sheet: the conversation on the left (answer chips, the PMOS lines that name each version),
5
- * the live report plan on the right (the version strip S1..Sn and three views: Plan, Other
6
- * structures, Try it with real data); Use this structure saves the version on screen
7
- * structureSection({ ws, id, name }) the saved structure as a section of the report setup sheet (c3-design-studio.js openBrief):
8
- * what it answers, sources, charts, outline, Refine the structure, Try it with real data
9
- * Entry points: "Shape it with PMOS" on an Ask PMOS answer and "Shape the report" on a set-up row (c3-report-setup.js), the step bar of the Design studio
10
- * (c3-design-studio.js) and ?structure=<id> on the address (c3-shell.js).
11
- * A turn starts ONE report-structure job (POST /api/report-structure/turn); the page shows it running and reads GET /api/report-structure until the
12
- * version lands. The page can be left: the job goes on. Sources are read only. Nothing here sends anything outside the workspace. */
13
- import { el } from './dom.js';
14
- import { icon, pbtn, btn, chip, sect, put, lk, kv } from './c3-ini-ui.js';
15
- import { openSheet, closeSheet } from './c3-sheet.js';
16
- import { toast } from './c3-toast.js';
17
- import { pmGet, pmPost } from './http.js';
18
- import { goTo } from './c3-report-store.js';
19
- import { ensureDeckCss } from './c3-report-deck.js';
20
-
21
- const q = (o) => Object.entries(o).filter(([, v]) => v != null && v !== '').map(([k, v]) => k + '=' + encodeURIComponent(v)).join('&');
22
- const post = (p, body) => Promise.resolve(pmPost('/api/' + p, body)).catch((e) => ({ ok: false, error: String((e && e.message) || e) }));
23
- const get = (p) => Promise.resolve(pmGet(p)).catch(() => null);
24
- /** The routes of the API contract (report-structure-contract.md section 2). */
25
- export const RSX = {
26
- structure: (ws, id) => get('/api/report-structure?' + q({ ws, id })),
27
- version: (ws, id, n) => get('/api/report-structure/version?' + q({ ws, id, n })),
28
- dry: (ws, id, run) => get('/api/report-structure/dry?' + q({ ws, id, run })),
29
- charts: (ws) => get('/api/charts?' + q({ ws })),
30
- turn: (b) => post('report-structure/turn', b),
31
- accept: (b) => post('report-structure/accept', b),
32
- revert: (b) => post('report-structure/revert', b),
33
- source: (b) => post('report-structure/source', b),
34
- remove: (b) => post('report-structure/remove', b),
35
- check: (b) => post('report-structure/check', b),
36
- runDry: (b) => post('report-structure/dry', b),
37
- pull: (b) => post('report-structure/pull', b),
38
- };
39
- const failed = (r, what) => toast({ text: what + ': ' + ((r && (r.error || r.reason)) || 'the workspace did not answer') + '.', tone: 'error', timeout: 6000 });
40
-
41
- /** Link c3-report-structure.css once. */
42
- export function ensureStructureCss() {
43
- if (typeof document === 'undefined' || document.querySelector('link[data-c3-report-structure]')) return;
44
- const l = document.createElement('link');
45
- l.rel = 'stylesheet'; l.href = new URL('./c3-report-structure.css', import.meta.url).href; l.setAttribute('data-c3-report-structure', '');
46
- document.head.appendChild(l);
47
- }
48
-
49
- const hhmm = (iso) => { const m = /T(\d{2}):(\d{2})/.exec(String(iso || '')); return m ? m[1] + ':' + m[2] : ''; };
50
- const short = (t, n = 60) => { const s = String(t || '').replace(/\s+/g, ' ').trim(); return s.length > n ? s.slice(0, n - 1) + '…' : s; };
51
- const slug = (t) => String(t || '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 32) || 'source';
52
- const KIND_IC = { 'pmos-level': 'init', dashboard: 'report', chart: 'report', document: 'doc', 'past-report': 'cal', connector: 'report', link: 'sheet', upload: 'drop', person: 'user', chrome: 'out', computer: 'term' };
53
- const STATE_TAG = { reached: ['ok', 'Reached'], 'not-connected': ['', 'Not connected'], later: ['', 'First cycle: nothing to read'], 'needs-you': ['bad', 'Needs you'], off: ['', 'Not connected'] };
54
- const STEP_TAG = { works: ['check', 'ok', 'Works'], 'needs-you': ['alert', 'bad', 'Needs you'], waiting: ['clock', '', 'Waiting'] };
55
-
56
- /* the options of Add a source: [kind, icon, label, what it does, form fields]; a field is [key, label, placeholder, required] */
57
- const PMOS_OPTS = [
58
- ['pmos-level', 'init', 'A portfolio, board or initiative', 'Sets what the report covers: its initiatives, releases, key results and risks', [['name', 'Which one?', 'Its name, for example the MySPH board', true]]],
59
- ['dashboard', 'report', 'A dashboard', 'Brings in its charts, so a number is defined once', [['name', 'Which dashboard?', 'Its name, for example MySPH health', true]]],
60
- ['chart', 'report', 'A chart', 'One chart from Reports, Charts', [['name', 'Which chart?', 'Its name, for example Release frequency', true]]],
61
- ['document', 'doc', 'A document', 'Context for the notes, like the strategy or the decision log. Not numbers', [['name', 'Which document?', 'Its name, for example MySPH strategy 2026', true]]],
62
- ['past-report', 'cal', 'A past report', 'Last cycle\'s numbers, and what it said that needs a follow-up', []],
63
- ];
64
- const OUT_OPTS = [
65
- ['connector', 'report', 'A connector you have', 'For example Google Analytics through Supermetrics, Google Drive or Jira. Read only, through your own Claude connectors', [['name', 'Which service?', 'For example Google Analytics 4: MySPH news site', true], ['via', 'Through which connector?', 'For example Supermetrics', false], ['ref', 'Which account, property or board?', 'Optional', false]]],
66
- ['link', 'sheet', 'A link', 'A Google Sheet or a Confluence page. PMOS reads it through your connectors', [['name', 'What is it?', 'For example Subscription revenue 2026', true], ['ref', 'Link', 'https://…', true]]],
67
- ['upload', 'drop', 'A file you upload each cycle', 'CSV or .xlsx. PMOS asks for it in Work when the draft is due', [['name', 'What is the file?', 'For example Partner payouts', true]]],
68
- ['person', 'user', 'A person who gives a number each cycle', 'It shows in their Work, for example: Lina Kusuma gives the NPS score by the 3rd', [['name', 'Who?', 'Their name', true], ['use', 'Which number?', 'For example the NPS score', false]]],
69
- ['chrome', 'out', 'A page you open in Chrome', 'For a site with no connector, like Looker Studio or an admin page. Claude in Chrome reads it on your Mac, signed in as you', [['name', 'Which page?', 'For example Looker Studio: Paid acquisition', true], ['ref', 'Link', 'https://…', true]]],
70
- ['computer', 'term', 'An app on your Mac', 'Computer use, when no connector and no web page has the numbers', [['name', 'Which app and screen?', 'For example Finance Desk, Monthly revenue', true]]],
71
- ];
72
-
73
- /* one studio session per report setup: what the PM is looking at waits here between openings */
74
- const LOCAL = {};
75
- const local = (id) => LOCAL[id] || (LOCAL[id] = { view: 'plan', ver: null, open: null, panel: false, form: null, text: '', check: null });
76
-
77
- /* ── the studio ── */
78
- export function openStructure({ ws, id, name, view, onClose } = {}) {
79
- ensureDeckCss(); ensureStructureCss();
80
- const K = local(id); if (view) K.view = view;
81
- const S = { D: null, setup: null, cache: {}, dry: null, charts: null, err: '', timer: null, closed: false, busy: false, shown: '' };
82
- const body = el('div', { class: 'brief rs rd-dk rd-dks-wrap rs-st', 'data-st-studio': id });
83
- const ui = openSheet({ title: 'Report studio', icon: 'spark', wide: true, dw: true, cls: 'rd-wide', body, onClose: () => { S.closed = true; clearTimeout(S.timer); if (onClose) onClose(); } });
84
-
85
- const ver = (n) => ((S.D && S.D.versions) || []).find((v) => v.n === n);
86
- const cur = () => (S.D ? S.D.current : null);
87
- const planOf = (n) => (n == null ? null : n === cur() ? S.D.plan : (S.cache[n] || null));
88
- const planShown = () => planOf(K.ver);
89
- const vlabel = (v) => (v ? (v.turn ? short(v.turn, 48) : v.n === 1 ? 'From your description' : 'Your turn') : '');
90
- const running = () => !!(S.D && S.D.running);
91
- const dryRunning = () => running() && /dry/.test(JSON.stringify(S.D.job || ''));
92
- const checksRunning = () => Object.values((S.D && S.D.checks) || {}).some((c) => c && c.running);
93
- const pulling = (sid) => !!(S.D && Array.isArray(S.D.pulling) && S.D.pulling.includes(sid));
94
- const pullsRunning = () => !!(S.D && Array.isArray(S.D.pulling) && S.D.pulling.length);
95
- const pullOf = (sid) => (S.D && S.D.pulls && S.D.pulls[sid]) || null;
96
- const localHm = (iso) => { const t = new Date(iso); return Number.isNaN(t.getTime()) ? '' : String(t.getHours()).padStart(2, '0') + ':' + String(t.getMinutes()).padStart(2, '0'); };
97
- const scrollLog = () => requestAnimationFrame(() => { const l = body.querySelector('.rd-dks-log'); if (l) l.scrollTop = l.scrollHeight; });
98
-
99
- /* follow: show the current version when it changed (a job landed). A read that changed nothing paints nothing: the poll reads the structure
100
- * every 1.5 seconds while a job runs, and a repaint would rebuild the conversation and the box the PM types in. */
101
- async function load(follow) {
102
- const r = await RSX.structure(ws, id);
103
- if (!r || r.ok === false) { S.err = (r && (r.error || r.reason)) || 'The structure could not be read.'; S.D = null; paint(true); return; }
104
- S.err = '';
105
- const prev = S.D ? S.D.current : null;
106
- S.D = r.structure; S.setup = r.setup || { id, name };
107
- if (K.ver == null || (S.D.current != null && !ver(K.ver)) || (follow && S.D.current !== prev && S.D.current != null)) K.ver = S.D.current;
108
- if (running() || checksRunning() || pullsRunning()) poll(); else clearTimeout(S.timer);
109
- await Promise.all([need(K.ver), need(K.ver > 1 ? K.ver - 1 : null), readDry(), readCharts()]);
110
- paint(false);
111
- }
112
- async function need(n) {
113
- if (n == null || !S.D || n === cur() || S.cache[n]) return;
114
- const r = await RSX.version(ws, id, n);
115
- if (r && r.ok && r.plan) S.cache[n] = r.plan;
116
- }
117
- async function readDry() {
118
- const d = S.D && S.D.dry;
119
- if (!d || !d.run) { S.dry = null; return; }
120
- if (S.dry && S.dry.run === d.run) return;
121
- const r = await RSX.dry(ws, id, d.run);
122
- S.dry = r && r.ok && r.dry ? { run: d.run, ...r.dry } : null;
123
- }
124
- async function readCharts() {
125
- const p = planShown();
126
- if (S.charts || !p || !(p.charts || []).some((c) => c.chart)) return;
127
- const r = await RSX.charts(ws);
128
- if (r && r.ok) S.charts = r.charts || [];
129
- }
130
- function poll() {
131
- clearTimeout(S.timer);
132
- S.timer = setTimeout(async () => { if (S.closed) return; const was = cur(); await load(true); if (S.D && !running() && cur() !== was) scrollLog(); }, 1500);
133
- }
134
-
135
- /* ── the conversation ── */
136
- function msg(l) {
137
- const you = l.who === 'pm';
138
- const v = l.n != null ? ver(l.n) : null;
139
- const qs = (l.questions || []).map((x) => el('div', { class: 'rs-st-q', 'data-st-question': '' }, el('b', null, x.q),
140
- el('div', { class: 'chips' }, (x.chips || []).map((c) => lk({ 'data-st-act': 'chip', 'data-v': c, onclick: () => pick(c) }, c)))));
141
- const opts = (l.options || []).length ? lk({ 'data-st-act': 'options', onclick: () => { K.view = 'options'; if (l.n != null) K.ver = l.n; need(K.ver).then(() => paint(true)); } }, icon('cols', 'sm'), 'See the three structures side by side') : null;
142
- return el('li', { class: 'rd-dks-msg ' + (you ? 'you' : 'pmos'), 'data-st-log': you ? 'you' : 'pmos' },
143
- el('span', { class: 'ds-av ' + (you ? 'h' : 'a') }, you ? icon('user', 'sm') : icon('spark', 'sm')),
144
- el('div', { class: 'bub' }, el('div', { class: 'who' }, you ? 'You' : 'PMOS'), l.text ? el('p', null, l.text) : null, qs, opts,
145
- v ? lk({ class: 'rd-dks-ver', 'data-st-act': 'ver', 'data-v': String(v.n), 'aria-pressed': String(K.ver === v.n && K.view !== 'options'), onclick: () => look(v.n) }, icon('todo', 'sm'), 'S' + v.n + ': ' + vlabel(v)) : null));
146
- }
147
- function runningMsg() {
148
- const n = (S.D.versions.length ? Math.max(...S.D.versions.map((v) => v.n)) : 0) + 1;
149
- return el('li', { class: 'rd-dks-msg pmos', 'data-st-running': '' }, el('span', { class: 'ds-av a' }, icon('spark', 'sm')),
150
- el('div', { class: 'bub' }, el('div', { class: 'who' }, 'PMOS'), el('p', null, dryRunning() ? 'Running the plan on the last complete period. This takes a minute or two. You can close the studio; the result shows here when the job ends.'
151
- : 'Working on S' + n + '. This takes a minute or two. You can close the studio; the version lands here when the job ends.')));
152
- }
153
- function errorMsg() {
154
- const lastAt = ((S.D.log || [])[(S.D.log || []).length - 1] || {}).at || '';
155
- const e = (S.D.errors || []).filter((x) => String(x.at || '') >= lastAt).pop();
156
- if (!e || running()) return null;
157
- return el('li', { class: 'rd-dks-msg pmos err', 'data-st-error': '' }, el('span', { class: 'ds-av w' }, icon('alert', 'sm')), el('div', { class: 'bub' }, el('div', { class: 'who' }, 'PMOS'), el('p', null, 'That did not work: ' + e.text + ' Nothing changed. Try the turn again.')));
158
- }
159
- function pick(c) { K.text = (K.text.trim() ? K.text.trim() + ' ' : '') + c + '.'; paint(true); const i = body.querySelector('[data-st-in]'); if (i) { i.focus(); i.setSelectionRange(i.value.length, i.value.length); } }
160
- function panel() {
161
- if (!K.panel) return null;
162
- const opt = ([kind, ic, label, desc, fields]) => btn({ class: 'rd-dks-opt', 'data-st-act': 'opt', 'data-v': kind, 'aria-expanded': String(K.form === kind), onclick: () => { if (!fields.length) { addSource(kind, label, {}, desc); return; } K.form = K.form === kind ? null : kind; paint(true); } },
163
- icon(ic, 'sm'), el('span', null, label, el('br'), el('span', { class: 'dim rs-st-small' }, desc)));
164
- const form = (o) => {
165
- const [kind, , label, desc, fields] = o; const inputs = fields.map(([k, lab, ph, req]) => el('label', { class: 'rs-st-field' }, el('span', { class: 'dim' }, lab + (req ? '' : ' (optional)')),
166
- el('input', { type: 'text', 'data-st-field': k, placeholder: ph, autocomplete: 'off', onKeyDown: (e) => { if (e.key === 'Enter') submit(); } })));
167
- const submit = () => {
168
- const v = {}; let bad = null;
169
- for (const [k, , , req] of fields) { const i = form_.querySelector('[data-st-field="' + k + '"]'); v[k] = i ? i.value.trim() : ''; if (req && !v[k] && !bad) bad = i; }
170
- if (bad) { bad.focus(); return; }
171
- if ((kind === 'link' || kind === 'chrome') && !/^https?:\/\//i.test(v.ref)) { toast({ text: 'A link starts with https://', tone: 'error' }); return; }
172
- if (['pmos-level', 'dashboard', 'chart', 'document'].includes(kind)) v.ref = v.name;
173
- addSource(kind, label, v, desc);
174
- };
175
- const form_ = el('div', { class: 'rs-st-form', 'data-st-form': kind }, ...inputs, el('div', { class: 'ds-acts' }, pbtn('primary', 'Add', 'plus', { 'data-st-act': 'add', onclick: submit }), pbtn('ghost', 'Cancel', 'x', { onclick: () => { K.form = null; paint(true); } })));
176
- return form_;
177
- };
178
- const group = (opts) => opts.flatMap((o) => [opt(o), K.form === o[0] ? form(o) : null]);
179
- return el('div', { class: 'rd-dks-panel', 'data-st-panel': '' }, el('h3', { class: 'ds-h' }, 'From PMOS'), ...group(PMOS_OPTS),
180
- el('h3', { class: 'ds-h' }, 'Outside PMOS'), ...group(OUT_OPTS),
181
- el('div', { class: 'dim rs-st-small' }, 'PMOS only reads. It never writes to a source, and a connector you have not allowed stays closed.'));
182
- }
183
- function chat() {
184
- const D = S.D; const p = planOf(cur());
185
- const reached = ((p && p.sources) || []).filter((s) => s.state === 'reached');
186
- const first = !D.log.length;
187
- const ta = el('textarea', { 'data-st-in': '', 'aria-label': 'Tell PMOS what to change', placeholder: first ? 'Say what the report is for, who reads it and what they decide with it.' : 'Talk it through, for example: split new users by campaign, or what would leadership miss here?',
188
- onInput: (e) => { K.text = e.target.value; }, onKeyDown: (e) => { if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') { e.preventDefault(); send(); } } });
189
- ta.value = K.text;
190
- return el('div', { class: 'rd-dks-chat' }, el('div', { class: 'rd-dks-desc' }, el('span', { class: 'dim mono' }, 'WHAT IT ANSWERS, WHERE THE NUMBERS COME FROM, HOW'),
191
- reached.length ? el('div', { class: 'chips' }, reached.map((s) => chip(icon(KIND_IC[s.kind] || 'doc', 'sm'), s.name))) : null),
192
- el('ul', { class: 'rd-dks-log', 'data-st-chat': '' }, (D.log || []).map(msg), D.running ? runningMsg() : null, errorMsg(),
193
- first && !D.running ? el('li', { class: 'fold' }, icon('info', 'sm'), ' Start with what the report is for and who reads it. PMOS asks what it needs, then proposes a structure.') : null),
194
- panel(),
195
- el('div', { class: 'rd-dks-in' }, ta,
196
- el('div', { class: 'ds-acts rd-between' }, btn({ class: 'ds-btn', 'data-st-act': 'panel', 'aria-expanded': String(K.panel), onclick: () => { K.panel = !K.panel; if (!K.panel) K.form = null; paint(true); } }, icon('plus', 'sm'), 'Add a source'),
197
- btn({ class: 'ds-btn ag', 'data-st-act': 'send', disabled: !!D.running || S.busy, onclick: () => send() }, icon('spark', 'sm'), first ? 'Make the first version' : 'Make the next version')),
198
- el('div', { class: 'dim rs-st-small' }, 'Ask anything: which chart fits, what a number means, what is missing. A turn that changes the plan makes a new version.')));
199
- }
200
- async function send(textIn) {
201
- const i = body.querySelector('[data-st-in]');
202
- const text = String(textIn != null ? textIn : (i ? i.value : K.text) || '').trim();
203
- if (!text) { if (i) i.focus(); return false; }
204
- if (running()) { toast('A version is being made. Wait for it to land.'); return false; }
205
- S.busy = true; paint(true);
206
- const r = await RSX.turn({ ws, id, text });
207
- S.busy = false;
208
- if (!r || !r.ok) { paint(true); if (r && (r.status === 409 || /running|already/i.test(String(r.error || '')))) toast('A version is being made. Wait for it to land.'); else failed(r, 'PMOS did not start'); return false; }
209
- K.text = ''; K.view = 'plan';
210
- await load(true); scrollLog();
211
- return true;
212
- }
213
- async function addSource(kind, label, v, desc) {
214
- const p = planOf(cur()); const base = slug(v.name || label); const have = new Set(((p && p.sources) || []).map((s) => s.id));
215
- let sid = base; for (let k = 2; have.has(sid); k++) sid = base + '-' + k;
216
- const source = { id: sid, kind, name: String(v.name || label).slice(0, 200), use: String(v.use || desc).slice(0, 600) };
217
- if (v.via) source.via = v.via; if (v.ref) source.ref = v.ref;
218
- S.busy = true;
219
- const r = await RSX.source({ ws, id, source });
220
- S.busy = false;
221
- if (!r || !r.ok) { failed(r, 'The source was not added'); paint(true); return; }
222
- K.panel = false; K.form = null; K.view = 'plan';
223
- if (kind === 'chrome' || kind === 'computer') K.check = sid;
224
- S.charts = null; await load(true); scrollLog();
225
- toast(kind === 'chrome' || kind === 'computer' ? 'Added. PMOS is checking it step by step.' : 'Added as a source. It is in the next version.');
226
- }
227
-
228
- /* ── the result ── */
229
- function look(n) { K.ver = n; K.view = 'plan'; K.open = null; need(n).then(() => need(n > 1 ? n - 1 : null)).then(() => paint(true)); }
230
- async function revert(n) {
231
- const r = await RSX.revert({ ws, id, n }); if (!r || !r.ok) { failed(r, 'It did not go back'); return; }
232
- await load(true); toast('Back to S' + n + '. The next turn builds on it. The later versions stay in the strip.');
233
- }
234
- async function accept() {
235
- const n = K.ver != null ? K.ver : cur(); if (n == null) { toast('Make a version first.'); return; }
236
- S.busy = true; paint(true);
237
- const r = await RSX.accept({ ws, id, n }); S.busy = false;
238
- if (!r || !r.ok) { paint(true); failed(r, 'The structure was not saved'); return; }
239
- const made = (r.charts || []).length;
240
- await load(true);
241
- toast('Saved S' + n + ' as the structure of this report.' + (made ? ' ' + made + (made === 1 ? ' new chart is' : ' new charts are') + ' in Reports, Charts.' : '') + ' Next: Design how it looks. Nothing is sent.');
242
- const m = await import('./c3-design-studio.js');
243
- m.openBrief({ ws, id, name: (S.setup && S.setup.name) || name });
244
- }
245
- async function drop(kind, ref, what) {
246
- const r = await RSX.remove({ ws, id, kind, ref }); if (!r || !r.ok) { failed(r, 'It was not removed'); return; }
247
- K.open = null; S.charts = null; await load(true); scrollLog(); toast('Removed ' + what + '. That makes the next version; the old one stays in the strip.');
248
- }
249
- function discuss(c) {
250
- K.text = 'About ' + c.name + ': '; paint(true);
251
- const i = body.querySelector('[data-st-in]'); if (i) { i.focus(); i.setSelectionRange(i.value.length, i.value.length); }
252
- }
253
- async function check(sid) {
254
- K.check = sid; const r = await RSX.check({ ws, id, source: sid});
255
- if (!r || !r.ok) { failed(r, 'The check did not start'); paint(true); return; }
256
- await load(true);
257
- }
258
- async function dryRun() {
259
- const r = await RSX.runDry({ ws, id, n: K.ver }); if (!r || !r.ok) { failed(r, 'The test did not start'); return; }
260
- S.dry = null; await load(true);
261
- }
262
- async function testPull(s) {
263
- // Test pull reads the one source into its row. It is not a turn: no line in the conversation, no new version (report-structure-gaps).
264
- const r = await RSX.pull({ ws, id, source: s.id });
265
- if (!r || !r.ok) { failed(r, 'The test pull did not start'); return; }
266
- toast('PMOS is reading ' + s.name + '. The answer shows in its row.'); await load(true);
267
- }
268
- function openIt(s) {
269
- closeSheet();
270
- if (s.kind === 'dashboard') goTo({ tab: 'rep', view: 'dash' }); else if (s.kind === 'chart') goTo({ tab: 'rep', view: 'charts' }); else if (s.kind === 'past-report') goTo({ tab: 'rep', view: 'reports' }); else goTo({ tab: 'init' });
271
- }
272
-
273
- function purposeSect(p) {
274
- const u = p.purpose || {};
275
- return sect({ ic: 'target', title: 'What it answers', attrs: { 'data-st-purpose': '' } }, kv([['Readers', u.readers || ''], ['Decision', u.decision || ''], ['Scope', u.scope || ''], ['Every', u.cadence || '']]),
276
- (u.questions || []).length ? el('ul', { class: 'chgl' }, u.questions.map((t) => el('li', null, icon('target', 'sm'), el('span', null, t), el('span')))) : null);
277
- }
278
- function srcRow(s, p) {
279
- const uses = (p.charts || []).filter((c) => c.source === s.id).length; const pm = s.group === 'pmos';
280
- const [tone, word] = STATE_TAG[s.state] || ['', s.state];
281
- const eye = s.kind === 'chrome' || s.kind === 'computer';
282
- const pl = !pm && !eye ? pullOf(s.id) : null; const plNow = pl && pl.n === K.ver ? pl : null; const busyPull = pulling(s.id);
283
- const act = pm ? pbtn('ghost', 'Open', 'out', { 'data-st-act': 'openpm', 'data-v': s.id, onclick: () => openIt(s) })
284
- : eye ? pbtn('ghost', 'Check it works', 'shield', { 'data-st-act': 'chkopen', 'data-v': s.id, onclick: () => check(s.id) })
285
- : s.state === 'reached' ? pbtn('ghost', busyPull ? 'Reading…' : pl ? 'Test pull again' : 'Test pull', 'play', { 'data-st-act': 'test', 'data-v': s.id, disabled: busyPull, onclick: () => testPull(s) })
286
- : pbtn('ghost', 'How to connect', 'info', { 'data-st-act': 'connect', 'data-v': s.id, onclick: () => toast('Connect ' + s.name + ' in your Claude connectors (Settings, Connectors), then come back and press Test pull. PMOS reads it read only.') });
287
- const li = el('li', { class: 'nrow', 'data-st-src': s.id }, el('span', { class: 'ki' }, icon(KIND_IC[s.kind] || 'doc')),
288
- el('div', { class: 'nb' }, el('span', { class: 'tt' }, s.name),
289
- el('div', { class: 'chips' }, el('span', { class: 'tag' + (tone ? ' ' + tone : ''), 'data-st-state': s.state }, word), s.via ? chip(icon(s.state === 'reached' ? 'lock' : 'info', 'sm'), s.via) : null,
290
- busyPull ? el('span', { class: 'tag acc', 'data-st-pulling': '' }, el('span', { class: 'rs-dot', 'aria-hidden': 'true' }), 'Reading…') : null,
291
- plNow && !busyPull ? el('span', { class: 'tag ' + (plNow.ok ? 'ok' : 'bad'), 'data-st-pulled': plNow.ok ? 'ok' : 'none' }, icon(plNow.ok ? 'check' : 'alert', 'sm'), plNow.ok ? 'Pulled ' + localHm(plNow.at) : 'Returned nothing') : null,
292
- plNow && !busyPull && plNow.ok ? chip(icon('cal', 'sm'), plNow.period) : null, plNow && !busyPull && !plNow.ok ? chip(icon('clock', 'sm'), 'Tried ' + localHm(plNow.at)) : null,
293
- plNow && !busyPull && plNow.ok ? chip(icon('report', 'sm'), plNow.got + ' of ' + plNow.charts + (plNow.charts === 1 ? ' chart returned a number' : ' charts returned a number')) : null,
294
- uses ? chip(icon('report', 'sm'), uses + (uses === 1 ? ' chart' : ' charts')) : null, eye ? chip(icon('clock', 'sm'), 'Re-checked 1 hour before each draft') : null),
295
- busyPull ? el('div', { class: 'dim rs-st-small', 'data-st-pullnote': '' }, 'Reading the last complete period for the ' + (uses === 1 ? 'chart' : uses + ' charts') + ' that use it. Read only.')
296
- : plNow && !plNow.ok ? el('div', { class: 'dim rs-st-small', 'data-st-pullnote': '' }, plNow.reason || 'The source returned nothing.')
297
- : !pm && !eye && s.state === 'reached' && !plNow ? el('div', { class: 'dim rs-st-small', 'data-st-pullnote': '' }, 'Not tried on this version.')
298
- : s.use ? el('div', { class: 'dim rs-st-small' }, s.use) : null),
299
- el('div', { class: 'acts' }, act, pbtn('ghost', 'Remove', 'trash', { 'data-st-act': 'dropsrc', 'data-v': s.id, onclick: () => drop('source', s.id, s.name) })));
300
- return li;
301
- }
302
- function srcSect(p) {
303
- const all = p.sources || []; const grp = (g) => all.filter((s) => s.group === g);
304
- const list = (xs) => (xs.length ? el('ul', { class: 'list' }, xs.map((s) => srcRow(s, p))) : el('div', { class: 'fold' }, icon('info', 'sm'), ' Nothing here yet.'));
305
- return sect({ ic: 'drop', title: 'Sources', count: all.length, attrs: { 'data-st-sources': '' } }, el('h3', { class: 'ds-h', 'data-st-group': 'pmos' }, 'From PMOS'), list(grp('pmos')),
306
- el('h3', { class: 'ds-h', 'data-st-group': 'outside' }, 'Outside PMOS'), list(grp('outside')),
307
- el('div', { class: 'ds-acts' }, pbtn('outline', 'Add a source', 'plus', { 'data-st-act': 'panel', onclick: () => { K.panel = true; paint(true); const pn = body.querySelector('[data-st-panel]'); if (pn) pn.scrollIntoView({ block: 'nearest' }); } })));
308
- }
309
- function usersOf(c) {
310
- const m = (S.charts || []).find((x) => x.id === c.chart); const us = (m && m.users) || [];
311
- return c.chart ? (us.length ? 'Charts, also used in ' + us.map((u) => (u.kind === 'dashboard' ? 'dashboard ' : 'report ') + u.name).join(', ') + ', and this report' : 'Charts, and this report') : 'This report. Saved in Charts when you use this structure';
312
- }
313
- function chartDetail(c, p) {
314
- const dv = S.dry && S.dry.n === K.ver ? (S.dry.values || []).find((v) => v.chart === c.id) : null;
315
- const sp = pullOf(c.source); const pv = sp && sp.n === K.ver ? (sp.values || []).find((v) => v.chart === c.id) : null;
316
- const srcName = ((planShown() || {}).sources || []).find((x) => x.id === c.source);
317
- const val = (v) => [el('b', null, v.value), ' ', el('span', { class: 'dim' }, v.was ? 'was ' + v.was : ''), ' ', v.delta ? el('span', { class: 'chip2 mono' }, v.delta) : null, ' ', v.flag ? el('span', { class: 'tag warn' }, 'Flagged') : null];
318
- const tp = pv ? [...val(pv), el('br'), el('span', { class: 'dim rs-st-small', 'data-st-pulled-from': '' }, 'Pulled from ' + (srcName ? srcName.name : 'the source') + ' at ' + localHm(sp.at) + ', ' + sp.period + '. Not saved in the report.')]
319
- : dv ? val(dv)
320
- : ['Not tried on this version. Press Test pull on its source, or Try it with real data.'];
321
- const f = (lab, ...c2) => el('div', null, el('span', { class: 'dim mono' }, lab), ...c2);
322
- return el('tr', { class: 'rs-st-det', 'data-st-detail': c.id }, el('td', { colspan: '5' }, el('div', { class: 'rs-st-detb' },
323
- f('QUESTION IT ANSWERS', el('p', { 'data-st-q': '' }, c.question || '')), f('USED IN', el('p', { 'data-st-used': '' }, usersOf(c))),
324
- f('EXACTLY WHAT PMOS READS', el('p', { class: 'mono rs-st-code', 'data-st-query': '' }, c.query || '')), f('WHY PMOS PROPOSED IT', el('p', { 'data-st-why': '' }, c.why || '')),
325
- f('TEST PULL', el('p', { 'data-st-testpull': '' }, ...tp)),
326
- el('div', { class: 'ds-acts' }, pbtn('outline', 'Discuss this chart', 'mail', { 'data-st-act': 'discuss', 'data-v': c.id, onclick: () => discuss(c) }),
327
- c.chart ? pbtn('ghost', 'Open in Charts', 'out', { 'data-st-act': 'opencharts', onclick: () => { closeSheet(); goTo({ tab: 'rep', view: 'charts' }); } }) : null,
328
- pbtn('ghost', 'Remove it', 'trash', { 'data-st-act': 'drop', 'data-v': c.id, onclick: () => drop('chart', c.id, c.name) })))));
329
- }
330
- function chartsSect(p) {
331
- const cs = p.charts || []; const nm = (id) => { const s = (p.sources || []).find((x) => x.id === id); return s ? s.name.split(':')[0] : ''; };
332
- const rows = cs.flatMap((c) => [el('tr', { class: 'rs-st-row' + (K.open === c.id ? ' on' : ''), 'data-st-chart': c.id },
333
- el('td', null, btn({ class: 'tt', 'data-st-act': 'chart', 'data-v': c.id, 'aria-expanded': String(K.open === c.id), onclick: () => { K.open = K.open === c.id ? null : c.id; paint(true); } }, c.name),
334
- el('div', null, c.chart ? el('span', { class: 'tag', 'data-st-tag': 'from' }, 'From Charts') : el('span', { class: 'tag acc', 'data-st-tag': 'new' }, 'New chart'))),
335
- el('td', null, c.from || '', el('div', { class: 'dim rs-st-tiny' }, nm(c.source))), el('td', null, c.how || ''), el('td', null, c.compare || ''), el('td', null, c.flag || '')),
336
- K.open === c.id ? chartDetail(c, p) : null]);
337
- const nNew = cs.filter((c) => !c.chart).length;
338
- return sect({ ic: 'report', title: 'Charts', count: cs.length, attrs: { 'data-st-metrics': '' }, right: el('span', { class: 'dim mono rs-st-tiny' }, nNew + ' new, ' + (cs.length - nNew) + ' from Charts') },
339
- cs.length ? el('div', { class: 'rs-st-tw' }, el('table', { class: 'tbl rs-st-tbl' }, el('thead', null, el('tr', null, ['Chart', 'From', 'How it is worked out', 'Compared with', 'Flag when'].map((h) => el('th', null, h)))), el('tbody', null, rows)))
340
- : el('div', { class: 'fold' }, icon('info', 'sm'), ' No chart yet. Tell PMOS what the report must answer.'),
341
- el('div', { class: 'dim rs-st-small' }, 'Each number is a chart: one question, its data and its logic. "Use this structure" saves the new ones in Reports, Charts, where any report or dashboard can use them. A chart from Charts is defined there once; changing it changes it everywhere it is used. Open one to see exactly what PMOS reads.'));
342
- }
343
- function outlineSect(p) {
344
- const os = p.outline || []; const prev = K.ver > 1 ? planOf(K.ver - 1) : null; const prevIds = prev ? new Set((prev.outline || []).map((o) => o.id)) : null;
345
- const nm = (id) => { const c = (p.charts || []).find((x) => x.id === id); return c ? c.name : id; };
346
- return sect({ ic: 'todo', title: 'Outline', count: os.length, attrs: { 'data-st-outline': '' } }, el('ol', { class: 'rs-st-ol' }, os.map((o, i) => el('li', { 'data-st-section': o.id },
347
- el('span', { class: 'rs-st-n mono' }, String(i + 1)), el('div', null, el('b', null, o.title), o.fixed ? [' ', el('span', { class: 'tag' }, 'In every report')] : null, prevIds && !prevIds.has(o.id) ? [' ', el('span', { class: 'tag acc' }, 'New in S' + K.ver)] : null,
348
- o.notes ? el('div', { class: 'dim rs-st-small' }, o.notes) : null,
349
- el('div', { class: 'chips' }, (o.charts || []).map((cid) => chip(icon('report', 'sm'), nm(cid))), o.fixed ? null : chip(icon('spark', 'sm'), 'PMOS notes'), o.show ? chip(icon('img', 'sm'), o.show) : null))))),
350
- el('div', { class: 'dim rs-st-small' }, 'Each section places charts and the notes PMOS writes about them. Headline, Needs your call and Sources stay in every report; everything between them is yours. How each part looks is the Design step.'));
351
- }
352
- function checkSect(sid, p) {
353
- const s = ((p && p.sources) || []).find((x) => x.id === sid); const c = (S.D.checks || {})[sid];
354
- const kind = (c && c.kind) || (s && s.kind) || 'chrome'; const chrome = kind === 'chrome'; const nm = s ? s.name : sid;
355
- const steps = (c && c.steps) || []; const bad = steps.filter((x) => x.state === 'needs-you').length;
356
- const rows = steps.map((x) => { const [ic, , word] = STEP_TAG[x.state] || STEP_TAG.waiting; const tone = (STEP_TAG[x.state] || STEP_TAG.waiting)[1];
357
- return el('li', { 'data-st-step': x.id, 'data-st-step-state': x.state }, icon(ic, 'sm'), el('span', null, el('b', null, x.label), el('br'), el('span', { class: 'dim rs-st-small' }, x.reason || '')), el('span', { class: 'tag' + (tone ? ' ' + tone : '') }, word)); });
358
- const right = !c ? el('span', { class: 'tag' }, 'Not checked') : c.running ? el('span', { class: 'tag', 'data-st-check-state': 'running' }, 'Checking') : c.ok ? el('span', { class: 'tag ok', 'data-st-check-state': 'ok' }, 'All steps work') : el('span', { class: 'tag bad', 'data-st-check-state': 'fail' }, bad + (bad === 1 ? ' step needs you' : ' steps need you'));
359
- return sect({ ic: 'shield', title: 'Check: ' + nm, right, attrs: { 'data-st-check': sid } },
360
- rows.length ? el('ul', { class: 'chgl rs-st-chk' }, rows) : el('div', { class: 'fold', role: 'status' }, icon('clock', 'sm'), c && c.running ? ' Starting the check.' : ' Not checked yet. Press Check again to go through each step.'),
361
- el('h3', { class: 'ds-h' }, 'What the session may do'),
362
- el('ul', { class: 'chgl' }, el('li', null, icon('lock', 'sm'), el('span', null, chrome ? 'Only the browser tools: open the page, read it, scroll, set the date range. It cannot submit a form or change a setting, and it closes the tab when it is done.'
363
- : 'Open the app, read the screen, and nothing else. It takes over the mouse while it reads, so PMOS runs it only when you have been away for 15 minutes, or asks you first. It is used only when your own Claude Code settings allow computer use.'), el('span'))),
364
- el('h3', { class: 'ds-h' }, 'When a cycle runs'),
365
- el('ul', { class: 'chgl' }, el('li', null, icon('clock', 'sm'), el('span', null, 'PMOS runs this check again 1 hour before the draft.'), el('span')),
366
- el('li', null, icon('alert', 'sm'), el('span', null, 'If your Mac is asleep, ' + (chrome ? 'Chrome is closed or the sign-in has expired' : 'the app is closed or macOS blocks it') + ', Work shows what to do. The draft waits up to 4 hours, then goes ahead without this source and says so under Sources. It never guesses a number.'), el('span'))),
367
- el('div', { class: 'ds-acts' }, pbtn(c && c.ok ? 'outline' : 'primary', 'Check again', 'undo', { 'data-st-act': 'chkagain', 'data-v': sid, disabled: !!(c && c.running), onclick: () => check(sid) })));
368
- }
369
- function planView() {
370
- const p = planShown(); const v = ver(K.ver);
371
- if (!p) return [el('div', { class: 'fold', role: 'status' }, icon('clock', 'sm'), ' ' + (running() ? 'PMOS is making the first version.' : S.D.versions.length ? 'Reading S' + K.ver + '.' : 'No version yet. Tell PMOS what the report is for on the left, then press Make the first version.'), ' ')];
372
- const ids = [...new Set([K.check, ...Object.entries(S.D.checks || {}).filter(([, c]) => c && c.running).map(([k]) => k)].filter(Boolean))].filter((sid) => (p.sources || []).some((s) => s.id === sid));
373
- return [el('div', { class: 'dim rs-st-small', 'data-st-vcap': String(K.ver) }, el('b', { class: 'rs-st-fg' }, 'S' + K.ver), ' · ' + vlabel(v) + (v && v.at ? ' · made ' + hhmm(v.at) : '') + '.' + (K.ver !== cur() ? ' You are looking at an older version.' : '')),
374
- purposeSect(p), ...ids.map((sid) => checkSect(sid, p)), srcSect(p), chartsSect(p), outlineSect(p)];
375
- }
376
- function optionsView() {
377
- let os = (planShown() || {}).options || [];
378
- if (!os.length) { const l = [...(S.D.log || [])].reverse().find((x) => (x.options || []).length); os = l ? l.options : []; }
379
- os = [...os].sort((a, b) => (b.recommended ? 1 : 0) - (a.recommended ? 1 : 0));
380
- if (!os.length) return [el('div', { class: 'fold', 'data-st-nooptions': '' }, icon('info', 'sm'), ' PMOS has not proposed other structures yet. Ask for another angle in the chat.')];
381
- return [el('div', { class: 'rs-st-opts', 'data-st-options': '' }, os.map((o) => el('section', { class: 'card sect rs-st-opt', 'data-st-option': o.name },
382
- el('div', { class: 'sh2' }, el('h2', null, icon('todo', 'sm'), o.name), o.recommended ? el('span', { class: 'tag acc' }, 'Recommended') : null),
383
- el('ol', { class: 'rs-st-mini' }, (o.sections || []).map((s) => el('li', null, s))),
384
- el('div', null, el('span', { class: 'dim mono' }, 'GOOD FOR'), el('p', null, o.good || '')), el('div', null, el('span', { class: 'dim mono' }, 'MISSES'), el('p', null, o.misses || '')),
385
- el('div', { class: 'ds-acts' }, pbtn(o.recommended ? 'primary' : 'outline', 'Use this instead', 'next', { 'data-st-act': 'choose', 'data-v': o.name, onclick: () => { K.text = 'Use the "' + o.name + '" structure instead.'; K.view = 'plan'; paint(true); const i = body.querySelector('[data-st-in]'); if (i) i.focus(); } }))))),
386
- el('div', { class: 'dim rs-st-small' }, 'PMOS shaped these from your answers: readers, the decision, and what must be in it. Ask for another angle in the chat.')];
387
- }
388
- function dryView() {
389
- const p = planShown() || {}; const d = S.dry; const isNow = d && d.n === K.ver;
390
- const run = pbtn(d ? 'outline' : 'primary', d ? 'Run it again' : 'Try it on the last complete period', 'play', { 'data-st-act': 'dryrun', disabled: running() || !planShown(), onclick: () => dryRun() });
391
- if (dryRunning()) return [el('div', { class: 'fold a', role: 'status', 'data-st-dryrunning': '' }, icon('clock', 'sm'), ' PMOS is running the plan on the last complete period. Nothing is saved.')];
392
- if (!d) return [el('div', { class: 'fold', 'data-st-nodry': '' }, icon('info', 'sm'), ' Run the plan on the last complete period before any design: the headline PMOS would write, each chart\'s value, the flags, and what it could not get. It reads only and saves nothing in the report.'), el('div', { class: 'ds-acts' }, run)];
393
- if (S.D.dry && S.D.dry.ok === false) return [el('div', { class: 'fold w', role: 'alert', 'data-st-dryfail': '' }, icon('alert', 'sm'), ' The test did not finish. Nothing was saved. Try it again.'), el('div', { class: 'ds-acts' }, run)];
394
- const nm = (cid) => { const c = (p.charts || []).find((x) => x.id === cid); return c ? c.name : cid; };
395
- const vs = d.values || []; const flags = vs.filter((x) => x.flag); const miss = d.missing || [];
396
- const line = (x) => el('li', null, icon(x.flag ? 'flag' : 'check', 'sm'), el('span', null, el('b', null, nm(x.chart)), ': ' + (x.value || ''), ' ', el('span', { class: 'dim' }, x.was || ''), ' ', x.delta ? el('span', { class: 'chip2 mono' }, x.delta) : null), el('span', null, x.flag ? el('span', { class: 'tag warn' }, 'Flagged') : null));
397
- const srcNm = (sid) => { const s = (p.sources || []).find((x) => x.id === sid); return s ? s.name : sid; };
398
- return [el('div', { class: 'fold', 'data-st-dry': '' }, icon('info', 'sm'), ' The plan run on ' + (d.period || 'the last complete period') + ', before any design' + (isNow ? '' : ', for S' + d.n + ' (you are looking at S' + K.ver + ')') + '. Plain content only: this is what the draft would say. Read ' + hhmm(S.D.dry.at) + '; nothing was saved or sent.'),
399
- sect({ ic: 'doc', title: 'Headline, as PMOS would write it', attrs: { 'data-st-dry-headline': '' } }, el('p', { class: 'rs-st-p' }, d.headline || '')),
400
- sect({ ic: 'scale', title: 'Numbers', count: vs.length, attrs: { 'data-st-dry-values': '' } }, el('ul', { class: 'chgl' }, vs.map(line))),
401
- sect({ ic: 'flag', title: 'Flags this period', count: flags.length, attrs: { 'data-st-dry-flags': '' } }, flags.length ? el('ul', { class: 'chgl' }, flags.map((x) => el('li', null, icon('flag', 'sm'), el('span', null, nm(x.chart) + ': ' + (x.note || 'flagged by its rule') + '.'), el('span', null, el('span', { class: 'tag warn' }, 'Flagged'))))) : el('div', { class: 'fold' }, icon('check', 'sm'), ' Nothing is flagged.')),
402
- sect({ ic: 'alert', title: 'Could not get', count: miss.length, attrs: { 'data-st-dry-missing': '' } }, miss.length ? el('ul', { class: 'chgl' }, miss.map((x) => el('li', null, icon('alert', 'sm'), el('span', null, srcNm(x.source) + ': ' + (x.reason || '')), el('span')))) : el('div', { class: 'fold' }, icon('check', 'sm'), ' Every chart returned a number.')),
403
- (d.options || []).length ? sect({ ic: 'spark', title: 'Options PMOS would propose', count: d.options.length, attrs: { 'data-st-dry-options': '' } }, el('ul', { class: 'chgl' }, d.options.map((t) => el('li', null, icon('spark', 'sm'), el('span', null, t), el('span')))), el('div', { class: 'dim rs-st-small' }, 'You pick or rewrite these before you issue. PMOS never decides them.')) : null,
404
- el('div', { class: 'ds-acts' }, run)];
405
- }
406
- function outHTML() {
407
- const D = S.D;
408
- const strip = el('div', { class: 'rd-dks-vers' }, el('div', { class: 'seg', role: 'group', 'aria-label': 'Versions', 'data-st-versions': '' }, D.versions.map((v) => btn({ 'data-st-v': String(v.n), 'aria-pressed': String(K.view === 'plan' && K.ver === v.n), title: vlabel(v), onclick: () => look(v.n) }, 'S' + v.n, D.saved === v.n ? icon('check', 'sm') : null))),
409
- el('div', { class: 'seg', role: 'group', 'aria-label': 'View' }, [['plan', 'todo', 'Plan'], ['options', 'cols', 'Other structures'], ['dry', 'play', 'Try it with real data']].map(([k, ic, l]) => btn({ 'data-st-view': k, 'aria-pressed': String(K.view === k), onclick: () => { K.view = k; paint(true); } }, icon(ic, 'sm'), l))),
410
- K.ver != null && K.ver !== D.current ? pbtn('outline', 'Go back to S' + K.ver, 'undo', { 'data-st-act': 'revert', onclick: () => revert(K.ver) }) : null);
411
- return [strip, ...(K.view === 'options' ? optionsView() : K.view === 'dry' ? dryView() : planView())];
412
- }
413
-
414
- /* ── painting ── */
415
- function paint(force) {
416
- if (S.closed) return;
417
- if (!S.D) { put(body, S.err ? el('div', { class: 'fold w', role: 'alert', 'data-st-err': '' }, icon('alert', 'sm'), ' ' + S.err) : el('div', { class: 'fold', role: 'status' }, icon('clock', 'sm'), ' Reading the structure.')); return; }
418
- const sig = JSON.stringify([S.D, S.setup, S.dry, S.charts, K.view, K.ver, K.open, K.panel, K.form, K.check, S.busy, Object.keys(S.cache), Object.keys(S.cache).map((k) => S.cache[k] && 1)]);
419
- if (!force && sig === S.shown) return;
420
- S.shown = sig;
421
- const D = S.D; const nm = (S.setup && S.setup.name) || name || 'Report';
422
- const sb = body.closest('.sb'); const y = sb ? sb.scrollTop : 0; const log = body.querySelector('.rd-dks-log'); const ly = log ? log.scrollTop : null;
423
- const focused = document.activeElement && body.contains(document.activeElement) && document.activeElement.matches('[data-st-in],[data-st-field]') ? (document.activeElement.hasAttribute('data-st-in') ? '[data-st-in]' : '[data-st-field="' + document.activeElement.getAttribute('data-st-field') + '"]') : null;
424
- const fvals = {}; body.querySelectorAll('[data-st-field]').forEach((i) => { fvals[i.getAttribute('data-st-field')] = i.value; });
425
- put(body,
426
- el('div', { class: 'rs-st-bar' }, el('div', { class: 'chips2 rd-wrap' },
427
- el('div', { class: 'seg', role: 'group', 'aria-label': 'Studio step', 'data-st-steps': '' }, btn({ 'data-st-step-btn': 'structure', 'aria-pressed': 'true' }, icon('todo', 'sm'), '1 Structure'),
428
- btn({ 'data-st-step-btn': 'design', 'aria-pressed': 'false', onclick: () => toDesign() }, icon('img', 'sm'), '2 Design')),
429
- el('b', null, nm), D.saved != null ? el('span', { class: 'chip2 ds-good', 'data-st-saved': String(D.saved) }, icon('check', 'sm'), 'Saved structure: S' + D.saved) : el('span', { class: 'chip2', 'data-st-saved': '' }, 'Not saved yet')),
430
- el('div', { class: 'chips2' }, pbtn('primary', 'Use this structure', 'check', { 'data-st-act': 'save', disabled: !D.versions.length || S.busy, onclick: () => accept() }))),
431
- el('div', { class: 'fold' }, icon('info', 'sm'), ' Decide what the report answers, where each number comes from and how it is worked out. PMOS proposes, you refine by talking it through, then Design makes it look right. Sources are read only. Nothing is sent.'),
432
- el('div', { class: 'rd-dks' }, chat(), el('div', { class: 'rd-dks-out', 'data-st-preview': '' }, ...outHTML())));
433
- if (sb) sb.scrollTop = y; const l2 = body.querySelector('.rd-dks-log'); if (l2) l2.scrollTop = ly == null ? l2.scrollHeight : ly;
434
- for (const [k, v] of Object.entries(fvals)) { const i = body.querySelector('[data-st-field="' + k + '"]'); if (i) i.value = v; }
435
- if (focused) { const n = body.querySelector(focused); if (n) n.focus(); }
436
- }
437
- async function toDesign() {
438
- const m = await import('./c3-design-studio.js');
439
- m.openStudio({ ws, id, name: (S.setup && S.setup.name) || name });
440
- }
441
- paint(true); load(false).then(scrollLog);
442
- return { close: () => ui.close(), reload: () => load(true) };
443
- }
444
-
445
- /* ── the saved structure: a section of the report setup sheet ── */
446
- export async function structureSection({ ws, id, name } = {}) {
447
- ensureStructureCss();
448
- const r = await RSX.structure(ws, id);
449
- const open = (view) => () => openStructure({ ws, id, name, view });
450
- const none = (why) => sect({ ic: 'todo', title: 'Structure', attrs: { 'data-st-brief': '' } }, el('div', { class: 'fold', 'data-st-nosaved': '' }, icon('info', 'sm'), ' ' + why),
451
- el('div', { class: 'ds-acts' }, pbtn('primary', 'Shape the report', 'todo', { 'data-st-act': 'open', onclick: open() })));
452
- if (!r || r.ok === false || !r.structure) return none('The structure could not be read.');
453
- const D = r.structure;
454
- if (D.saved == null) return none('No saved structure yet. Decide what the report answers, where each number comes from and how it is worked out, then press Use this structure. Until then PMOS drafts it with the standard frame.');
455
- let p = D.saved === D.current ? D.plan : null;
456
- if (!p) { const v = await RSX.version(ws, id, D.saved); p = v && v.ok ? v.plan : null; }
457
- if (!p) return none('The saved version S' + D.saved + ' could not be read.');
458
- const u = p.purpose || {}; const nNew = (p.charts || []).filter((c) => !c.chart).length; const fromCharts = (p.charts || []).length - nNew;
459
- const eye = (p.sources || []).filter((s) => s.kind === 'chrome' || s.kind === 'computer');
460
- return el('div', { class: 'rs-st-saved', 'data-st-saved-wrap': '' },
461
- sect({ ic: 'todo', title: 'Structure', right: el('span', { class: 'tag acc', 'data-st-saved-tag': '' }, 'Structure S' + D.saved), attrs: { 'data-st-brief': '' } },
462
- el('div', { class: 'dim rs-st-small' }, 'Written by PMOS from your studio conversation, version S' + D.saved + '. Each cycle PMOS reads the sources with this logic, works out the numbers and writes the notes. If a source cannot be read, the draft says so under Sources and never guesses the number.'
463
- + (D.current !== D.saved ? ' A newer version, S' + D.current + ', is not saved.' : '')),
464
- el('h3', { class: 'ds-h' }, 'What it answers'), el('blockquote', { class: 'rd-dks-q', 'data-st-answers': '' }, [u.readers, u.decision, u.scope].filter(Boolean).join('. ') + '.'),
465
- el('h3', { class: 'ds-h' }, 'Sources'), el('div', { class: 'chips' }, (p.sources || []).map((s) => chip(icon(KIND_IC[s.kind] || 'doc', 'sm'), s.name))),
466
- el('h3', { class: 'ds-h' }, 'Charts'), el('div', { class: 'chips' }, (p.charts || []).map((c) => chip(icon('report', 'sm'), c.name + (c.chart ? '' : ' · new')))),
467
- el('div', { class: 'dim rs-st-tiny' }, nNew + (nNew === 1 ? ' new chart' : ' new charts') + ' saved in Reports, Charts. ' + fromCharts + (fromCharts === 1 ? ' comes' : ' come') + ' from Charts.'),
468
- el('h3', { class: 'ds-h' }, 'Outline'), el('ol', { class: 'rs-st-mini' }, (p.outline || []).map((o) => el('li', null, o.title))),
469
- el('div', { class: 'ds-acts' }, pbtn('primary', 'Refine the structure', 'spark', { 'data-st-act': 'open', onclick: open() }), pbtn('outline', 'Try it with real data', 'play', { 'data-st-act': 'opendry', onclick: open('dry') }))),
470
- sect({ ic: 'info', title: 'When the structure changes' }, el('ul', { class: 'chgl' }, el('li', null, icon('clock', 'sm'), el('span', null, 'A change applies from the next cycle. Issued cycles keep the structure they were drafted with.'), el('span')),
471
- eye.length ? el('li', null, icon('out', 'sm'), el('span', null, eye.map((s) => s.name).join(', ') + (eye.length === 1 ? ' is' : ' are') + ' read on your Mac. PMOS checks it 1 hour before each draft; if the check fails, Work asks you to open Chrome or sign in, and the draft waits up to 4 hours.'), el('span')) : null,
472
- el('li', null, icon('alert', 'sm'), el('span', null, 'When a source stops answering, or an event is renamed, the draft names the chart it could not get and PMOS asks you in the studio.'), el('span')))));
473
- }
@@ -1,68 +0,0 @@
1
- /* pm/c3-reports.css — the Reports dashboards of the console3 page (c3-reports.js links it once, as ensureC3Css links console3.css).
2
- * Tokens only. Corners: 6px on a control, 8px on a container, else 0 (R27 as amended 2026-10-07). The console3 primitives (.card.sect, .calbar, .lh,
3
- * .seg, .pill, .fold, .nrow, .xp, .chips, .chip2, .hero, .chgl) come from console3.css; this file adds the page's own layout under .rp3.
4
- * The tile grid, the head row and the headline-deck clip are the mockup's 33-reports.css under real class names (.mk-reports is .rp3). */
5
- .rp3{display:grid;gap:var(--sp-4);min-width:0;align-content:start}
6
- .rp3>*{min-width:0}
7
- .rp3>[data-rp3-deck]{overflow:hidden}
8
- .rp3-pane{display:grid;gap:var(--sp-4);min-width:0;align-content:start}
9
- .rp3-pane[hidden]{display:none}
10
- .rp3 .calbody,.rp3 .calbody>*{min-width:0}
11
- .rp3 .calbar{align-items:center}
12
- .rp3 .rp3-tabs{flex-wrap:wrap;max-width:100%}
13
- .rp3 .rp3-tabs .bdg{margin-left:2px}
14
- .rp3 .rp3-scope{justify-content:flex-end}
15
- .rp3 .rp3-scope[hidden]{display:none}
16
- /* the dashboard head: icon, title and dim line, then Share and Edit; 3 columns from 700px, the buttons on their own row below that */
17
- .rp3 .lh{grid-template-columns:auto minmax(0,1fr)}
18
- .rp3 .lh>.chips2{grid-column:1 / -1}
19
- @media (min-width:700px){.rp3 .lh{grid-template-columns:auto minmax(0,1fr) auto}.rp3 .lh>.chips2{grid-column:auto}}
20
- .rp3-pick{display:inline-flex;gap:8px;align-items:center;min-width:0;max-width:100%;font-size:var(--fs-2);margin-top:4px}
21
- .rp3-select{min-width:0;max-width:100%;min-height:32px;border:1px solid var(--border);border-radius:6px;background:var(--background);color:var(--foreground);font:var(--fs-2) var(--mono);padding:4px 8px}
22
- .rp3-select:disabled{opacity:.6;cursor:not-allowed}
23
- .rp3-btn:focus-visible,.rp3-select:focus-visible,.rp3-about:focus-visible,.rp3-librow:focus-visible{outline:2px solid color-mix(in oklab, var(--ring) 50%, var(--foreground));outline-offset:2px}
24
- @media (hover:hover){.rp3-about:hover{color:var(--foreground)}}
25
- @media (pointer:coarse){.rp3-select{min-height:44px}.rp3-about{min-height:44px}.rp3-librow{min-height:48px}}
26
- .rp3-rot .ic{transform:rotate(90deg)}
27
- .rp3-note{margin:0}
28
- .rp3-status{margin:0;font-size:var(--fs-2)}
29
- /* the tiles: section cards in a grid (the mockup's .tiles). The real builders draw inside; their own head keeps only its question line. */
30
- .rp3 .tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,440px),1fr));gap:var(--sp-4);align-items:start;min-width:0}
31
- .rp3 .tiles>.card{min-width:0}
32
- .rp3 .tiles.editing>.card{border-style:dashed;border-color:var(--ring)}
33
- .rp3-w{display:grid;gap:var(--sp-3);min-width:0;align-content:start}
34
- .rp3-w>.sh2{grid-column:auto}
35
- .rp3-w svg{max-width:100%}
36
- .rp3-w>.card{min-width:0;border:0;box-shadow:none;background:transparent;padding:0;border-radius:0}
37
- .rp3-w>.card>h3{margin:0}
38
- .rp3-w>.card>h3 .dim{font-size:var(--fs-2);text-transform:none;letter-spacing:0;font-family:var(--sans)}
39
- .rp3-w>.card>h3 .dim::first-letter{text-transform:uppercase}
40
- .rp3-about{display:flex;gap:6px;align-items:center;color:var(--muted-foreground);font:var(--fs-2) var(--mono);cursor:pointer;padding:4px 2px;border-radius:6px}
41
- .rp3-case{display:grid;gap:6px;padding:8px 2px 4px;font-size:var(--fs-3)}
42
- .rp3-case p{margin:0}
43
- .rp3-librow .tt{font-size:var(--fs-4)}
44
- .rp3-libcard{padding-top:10px;min-width:0}
45
- .rp3-share,.rp3-frame{display:grid;gap:var(--sp-4);min-width:0}
46
- .rp3-hl{overflow-wrap:anywhere}
47
- .rp3-nums{margin:4px 0 0;padding-left:18px;color:var(--muted-foreground);font-size:var(--fs-2);font-weight:400}
48
- .rp3-why{margin:0}
49
- /* a row with buttons keeps them on its right (console3 sets two columns for every .brief row); under 560px they drop under the text */
50
- .rp3 .brief .nrow:has(>.acts){grid-template-columns:auto minmax(0,1fr) auto;align-items:center}
51
- .rp3 .brief .nrow>.acts{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
52
- @media (max-width:560px){.rp3 .brief .nrow:has(>.acts){grid-template-columns:auto minmax(0,1fr)}.rp3 .brief .nrow>.acts{grid-column:2;justify-content:flex-start}}
53
- .rp3-draft-text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font:var(--fs-2)/1.5 var(--mono)}
54
- .rp3 .seg button:disabled,.rp3-share .seg button:disabled{opacity:.6;cursor:not-allowed}
55
- .rp3-min0{min-width:0}
56
- .rp3-sub{font-size:var(--fs-2)}
57
- .rp3-flat{margin:0}
58
- .rp3-stack{display:grid;gap:var(--sp-3)}
59
- .rp3-stack4{display:grid;gap:var(--sp-4)}
60
- .ph .tiles,.rp3.ph .tiles{grid-template-columns:minmax(0,1fr)}
61
- .rp3 button.ib.ib{width:28px;padding:0;justify-content:center;color:var(--foreground)}
62
- .rp3 button.ib.ib:disabled{opacity:.35}
63
-
64
- /* the rule line under the tabs: how Reports is organised (Live, Sent, Building blocks) */
65
- .rp3 .rp3-rule { margin: 0 0 var(--sp-3); align-items: center; }
66
- .rp3 .rp3-rulelbl { font-size: var(--fs-1); }
67
- .rp3-libcard .dim.mono{font-size:var(--fs-1)}
68
- .rp3-dp{margin:2px 0 10px;font-size:var(--fs-3);line-height:1.5;overflow-wrap:anywhere}