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,51 +0,0 @@
1
- /* pm/my-work-card.js — Agenda's one card for the items that wait for a brief (initiative my-work, PRD R8).
2
- *
3
- * One record, two lenses (the PM's choice, 2026-10-07): My work owns the assigned backlog and the brief, and Agenda
4
- * shows ONE card, "N items need your brief", when N is 1 or more. Its button opens My work. The card counts once in
5
- * Agenda's count, whichever repositories Agenda shows: the list is the PM's, not a repository's.
6
- *
7
- * Loaded at boot by registry.js loadExtensions. It reads the list once, then again every 30 seconds and whenever the
8
- * window gets the focus back, so the bar's count and this card stay current.
9
- */
10
-
11
- import { registerTodaySource, openDestination } from './registry.js';
12
- import { setState } from './state.js';
13
- import { todayCard } from './today-cards.js';
14
- import { myWork, loadMyWork, onMyWork } from './my-work-data.js';
15
-
16
- export const COPY = Object.freeze({
17
- cause: (n) => (n === 1 ? '1 item needs your brief' : `${n} items need your brief`),
18
- evidence: (titles) => 'Top: ' + titles.join(' · '),
19
- act: 'Open My work',
20
- cli: 'pmos my-work list',
21
- });
22
-
23
- const brief = () => { const d = myWork(); return d && d.ok ? d.counts.brief : 0; };
24
-
25
- registerTodaySource({
26
- id: 'my-work-brief',
27
- kind: 6, // capture: the agent read new assigned work and the PM triages it. It ranks after the gates, sessions and Keep cards
28
- rank: 40,
29
- count: () => (brief() > 0 ? 1 : 0),
30
- cards: () => {
31
- const n = brief();
32
- if (!n) return [];
33
- const top = myWork().items.filter((x) => x.state === 'brief').slice(0, 2).map((x) => x.key + ' ' + x.title);
34
- return [todayCard({
35
- kind: 6, id: 'my-work|brief', cause: COPY.cause(n), evidence: COPY.evidence(top), act: { label: COPY.act, cli: COPY.cli },
36
- onAct: () => openDestination('mywork'), attrs: { 'data-my-work-card': String(n) },
37
- })];
38
- },
39
- });
40
-
41
- if (typeof window !== 'undefined') {
42
- // re-render Agenda only when the card would change: a re-render on every read would take the focus off a card the PM is on
43
- let shown = '';
44
- onMyWork((d) => {
45
- const sig = d && d.ok ? d.counts.brief + '|' + d.items.filter((x) => x.state === 'brief').slice(0, 2).map((x) => x.id).join(',') : '0';
46
- if (sig !== shown) { shown = sig; setState({}); }
47
- });
48
- loadMyWork(true);
49
- setInterval(() => loadMyWork(), 30000);
50
- window.addEventListener('focus', () => loadMyWork());
51
- }
@@ -1,36 +0,0 @@
1
- /* pm/my-work-data.js — the one read of GET /api/my-work that the page shares (initiative my-work, PRD R8, R10).
2
- *
3
- * My work, the Agenda card and the top bar's count all read the same list, once: a second reader inside READ_MS gets
4
- * the answer already held. Every reader is told when a new answer arrives (onMyWork), and the top bar hears it as the
5
- * window event `pmos:mywork` with { brief } (the count of items to brief), so the bar needs no import of this module.
6
- * In fixture mode nothing loads it.
7
- */
8
-
9
- import { pmGet } from './http.js';
10
-
11
- const READ_MS = 30000;
12
- let data = null;
13
- let at = 0;
14
- let loading = null;
15
- const subs = new Set();
16
-
17
- /** The last answer, or null before the first one. */
18
- export const myWork = () => data;
19
-
20
- /** Read the list again when the last answer is older than READ_MS, or always with `force`. Resolves to the answer. */
21
- export function loadMyWork(force) {
22
- if (loading) return loading;
23
- if (!force && data && Date.now() - at < READ_MS) return Promise.resolve(data);
24
- loading = pmGet('/api/my-work').then((j) => {
25
- loading = null;
26
- at = Date.now();
27
- data = j && j.ok ? j : { ok: false, error: (j && j.error) || 'My work could not be read.', items: [], counts: { brief: 0, agents: 0, ready: 0, yours: 0, done: 0, all: 0 }, banner: [] };
28
- for (const fn of subs) { try { fn(data); } catch (e) { console.error('[pm] my-work reader failed:', e); } }
29
- if (typeof window !== 'undefined') window.dispatchEvent(new CustomEvent('pmos:mywork', { detail: { brief: data.ok ? data.counts.brief : 0 } }));
30
- return data;
31
- });
32
- return loading;
33
- }
34
-
35
- /** Call `fn(answer)` on each new answer. Returns the function that stops it. */
36
- export function onMyWork(fn) { subs.add(fn); return () => subs.delete(fn); }
@@ -1,169 +0,0 @@
1
- /* pm/new-initiative-sheet.js — the New-initiative form (pm-os-absorb Run 2, slice 2D; PRD R17, R25).
2
- *
3
- * Title, Lane, Anchor, Add. An initiative with no anchor is refused here, before any request, and again by the server.
4
- * One line of intent can be drafted first (POST /api/intake/draft): it shows the lane guess with its confidence, the anchor
5
- * suggestion (offered, never filled in: null reads 'no anchor yet') and any prior rejection. A refused draft blocks Add until the
6
- * PM ticks the acknowledgement, which re-drafts with acknowledged:true. The stage shown at the start is Discover; it is derived.
7
- * The new initiative starts in Later: only the PM's press moves it into Now. The anchors on offer are the ones the List
8
- * already shows (a KR or a `health:<id>`), plus one typed by hand.
9
- *
10
- * openNewInitiative({ repo, ws, anchors: string[], prefill?: { title, lane, from }, onAdded(id) })
11
- * `prefill` is a triaged capture that still needs an anchor: the title and the lane are filled in, and `from` names the capture.
12
- *
13
- * R4b: the sheet body is the mockup's new-initiative intake (console3.html c3niLine and c3niCard, lines 4786 and 4787): the one-line
14
- * add `.c3add > .form` (the input and the spark button), the suggestion as `section.card.sect` with `.sh2`, then `.case > .sit +
15
- * .chgl` rows (the lane guess, the anchor, the prior rejection as `li.ok` or `li.warn` or `li.bad` with a `.tag`), and the
16
- * fields as `.c3jf` label rows. The sheet itself is the real dialog (primitives sheet), and its Cancel and Add are the sheet's.
17
- * Not lifted: the microphone (nothing transcribes), the "try" example pills (invented lines), the four-step progress list
18
- * (the draft answers at once), the lane options with a slide (Add is a press, as before), the anchor pills (the anchor stays a
19
- * select, since the page and its tests set it by value), and the phone bottom sheet. The anchors on offer are the List's.
20
- */
21
-
22
- import { el } from './dom.js';
23
- import { button, sheet, toast, ensureComponentsCss } from './primitives.js';
24
- import { repoLanes, repoProfile } from './data.js';
25
- import { COPY } from './initiatives-copy.js';
26
- import { createInitiative } from './initiatives-api.js';
27
- import { pmPost } from './http.js';
28
- import { changed } from './initiative-sheet.js';
29
- import { ensureC3Css, c3ic, c3ib } from './pm-work-view.js';
30
- import { renderCase } from './c3-case.js';
31
-
32
- const OTHER = '__other__';
33
-
34
- /** The lanes the engine names for this repository's profile, or null when the server did not say. The server refuses a lane it does not take. */
35
- export function laneNames(repo) {
36
- const set = repoLanes(repo, repoProfile(repo));
37
- const lanes = Array.isArray(set) ? set.map((l) => (typeof l === 'string' ? l : l && l.name)).filter(Boolean) : [];
38
- return lanes.length ? lanes : null;
39
- }
40
-
41
- const row = (label, control) => el('label', null, el('span', { class: 'dim mono', style: 'font-size:var(--fs-2)' }, label), control);
42
-
43
- export function openNewInitiative({ repo, ws, anchors, prefill, onAdded }) {
44
- ensureComponentsCss();
45
- ensureC3Css();
46
- const anchorList = Array.from(new Set((anchors || []).filter(Boolean)));
47
- const t = el('input', { type: 'text', 'aria-label': COPY.newForm.titleLabel, 'data-in-new-title': '', autocomplete: 'off', value: (prefill && prefill.title) || '' });
48
- const lanes = laneNames(repo);
49
- let l;
50
- if (lanes) {
51
- l = el('select', { 'aria-label': COPY.newForm.laneLabel, 'data-in-new-lane': '' }, lanes.map((x) => el('option', { value: x }, x)));
52
- l.value = prefill && lanes.includes(prefill.lane) ? prefill.lane : lanes[0];
53
- } else l = el('input', { type: 'text', 'aria-label': COPY.newForm.laneLabel, 'data-in-new-lane': '', placeholder: COPY.newForm.laneHint, value: (prefill && prefill.lane) || '' });
54
- const a = el('select', { 'aria-label': COPY.newForm.anchorLabel, 'data-in-new-anchor': '' }, [{ value: '', label: COPY.newForm.anchorPick }, ...anchorList.map((x) => ({ value: x, label: x })), { value: OTHER, label: COPY.newForm.anchorOther }].map((o) => el('option', { value: o.value }, o.label)));
55
- a.value = '';
56
- const typed = el('input', { type: 'text', 'aria-label': COPY.newForm.anchorLabel, 'data-in-new-anchor-text': '', placeholder: COPY.newForm.anchorHint, autocomplete: 'off' });
57
- typed.hidden = true;
58
- a.addEventListener('change', () => { typed.hidden = a.value !== OTHER; if (!typed.hidden) typed.focus(); });
59
- // One-line intake draft (planning-flows run 4). It only suggests: the create below is unchanged and still needs a PM-chosen anchor.
60
- const line = el('input', { type: 'text', id: 'c3nit', 'aria-label': 'Describe it in one line', 'data-in-new-line': '', placeholder: 'Start something new: one line is enough (e.g. Cut checkout drop-off, KR2)', autocomplete: 'off' });
61
- const draftBtn = el('button', { type: 'button', class: 'ib pri', title: 'Draft: an agent runs the intake', 'aria-label': 'Draft: an agent runs the intake', 'data-in-draft-go': '' }, c3ic('spark'));
62
- const draftOut = el('div', { 'data-in-draft': '' });
63
- draftOut.hidden = true;
64
- const startNote = el('div', { class: 'fold', 'data-in-start-stage': '' }, c3ic('init', 'sm'), 'Starts in stage: Discover.');
65
- let refused = false;
66
- let ack = false;
67
- const ackInput = el('input', { type: 'checkbox', 'data-in-ack': '' });
68
- const ackBox = el('label', { class: 'chips2' }, ackInput, el('span', { style: 'font-size:var(--fs-3)' }, 'I have read the prior rejection and still want to create this'));
69
- ackBox.hidden = true;
70
- ackInput.addEventListener('change', () => { ack = ackInput.checked; gate(); if (ack) runDraft(true); });
71
- const gate = () => { add.disabled = busy || (refused && !ack); };
72
- /* the intake as the mockup shows it (console3.html c3niCard, line 4787): four steps tick while the draft is made, then "The agent suggests" with the lane, the
73
- * anchor and any prior rejection as a case file, options, and a slide to create. The draft is the real one (POST /api/intake/draft); the steps pace it. */
74
- const STEPS = ['Checking what was rejected before', 'Running the sharpness test', 'Choosing a lane', 'Finding an anchor'];
75
- let last = null; // the last draft, so a change to the anchor or the lane redraws the case
76
- const anchorNow = () => (a.value === OTHER ? typed.value : a.value).trim();
77
- const stepsCard = (text, n) => el('section', { class: 'card sect', id: 'c3ni', 'data-in-draft-run': '' }, el('div', { class: 'sh2' }, el('h2', null, c3ic('spark', 'sm'), text)),
78
- el('ul', { class: 'chgl' }, STEPS.map((st, i) => el('li', { class: i < n ? 'ok' : '' }, i < n ? c3ic('check', 'sm') : i === n ? el('span', { class: 'c3spin' }, c3ic('spark', 'sm')) : el('span', { style: 'width:14px' }), el('span', { class: i > n ? 'dim' : '' }, st)))));
79
- const suggest = (d, acknowledged) => {
80
- last = { d, acknowledged };
81
- const pr = d.prior_rejections || []; const anc = anchorNow() || d.anchor_suggestion || '';
82
- const blocked = !anchorNow() ? 'Pick an anchor below first: unanchored work is not created.' : refused && !ack ? 'A prior rejection is on record. Tick the acknowledgement first.' : '';
83
- const lane = l.value || d.lane || 'feature'; const conf = typeof d.confidence === 'number' ? Math.round(d.confidence * 100) : 0;
84
- const model = { id: 'ni:new', sit: 'The line reads as a ' + (d.lane || 'feature') + '. Nothing is created until you slide, and the anchor is yours to choose.', conf: conf || 60, cta: 'Slide to create', outboxReason: blocked,
85
- chg: [['init', 'Lane guess: ' + (d.lane || 'none') + ' (confidence ' + (typeof d.confidence === 'number' ? d.confidence : 'unknown') + ')', 'Lane'], [d.anchor_suggestion ? 'target' : 'alert', d.anchor_suggestion ? 'Anchor suggestion: ' + d.anchor_suggestion : 'no anchor yet', 'Anchor', d.anchor_suggestion ? 'ok' : 'bad'],
86
- [pr.length ? 'alert' : 'check', pr.length ? 'Prior rejections: ' + pr.map((r) => r.title || r.path || String(r)).join('; ') : 'Prior rejections: none', 'prior rejection', pr.length ? 'warn' : 'ok']],
87
- opts: [{ id: 'mk', l: 'Create it as a ' + lane + ' initiative', rec: 1, outward: !!blocked, fx: [['check', 'Starts in Later; only your press moves it into Now', 'ok'], [anc ? 'target' : 'alert', anc ? 'Anchored to ' + anc : 'No anchor yet', anc ? 'ok' : 'warn']] },
88
- ...(lane !== 'discovery' && (!conf || conf < 70) ? [{ id: 'ds', l: 'Start with discovery first', outward: !!blocked, fx: [['clock', 'A spike brief with a stop rule, no score', '']] }] : []), { id: 'no', l: 'Not now', fx: [] }],
89
- unsure: conf && conf < 70 ? 'A keyword match is not a judgment.' : '' };
90
- const c = renderCase(model, { onConfirm: async ({ option }) => {
91
- if (option.id === 'no') { draftOut.hidden = true; return; }
92
- if (option.id === 'ds' && l.tagName === 'SELECT') l.value = [...l.options].some((o) => o.value === 'discovery') ? 'discovery' : l.value;
93
- add.click();
94
- } });
95
- ['lane', 'anchor', 'prior'].forEach((k, i) => { const li = c.querySelectorAll('.chgl li')[i]; if (li) li.setAttribute('data-in-draft-' + k, ''); });
96
- const kids = [];
97
- if (d.anchor_suggestion) kids.push(el('div', { class: 'chips2' }, el('button', { type: 'button', class: 'chip2 lk', 'data-in-use-anchor': '', onClick: () => {
98
- if (anchorList.includes(d.anchor_suggestion)) a.value = d.anchor_suggestion;
99
- else { a.value = OTHER; typed.hidden = false; typed.value = d.anchor_suggestion; }
100
- suggest(d, acknowledged);
101
- } }, c3ic('target', 'sm'), 'Use ' + d.anchor_suggestion)));
102
- kids.push(c);
103
- if (d.refused) kids.push(el('div', { class: 'fold w', role: 'alert', 'data-in-draft-refused': '' }, c3ic('alert', 'sm'), d.refused_reason || 'Refused: a prior rejection is on record.'));
104
- draftOut.replaceChildren(el('section', { class: 'card sect', id: 'c3ni' }, el('div', { class: 'sh2' }, el('h2', null, c3ic('spark', 'sm'), 'The agent suggests'), el('span', { class: 'r' }, c3ib('Start over', 'x', { 'data-in-draft-reset': '', onClick: () => { draftOut.hidden = true; last = null; line.value = ''; line.focus(); } }, 'sm'))), ...kids));
105
- };
106
- async function runDraft(acknowledged) {
107
- const text = line.value.trim();
108
- if (!text) return;
109
- draftOut.hidden = false;
110
- let n = 0; if (!acknowledged) draftOut.replaceChildren(stepsCard(text, n));
111
- const pace = acknowledged ? null : setInterval(() => { if (n < STEPS.length - 1) { n++; draftOut.replaceChildren(stepsCard(text, n)); } }, 260);
112
- const started = Date.now();
113
- const out = await pmPost('/api/intake/draft', { line: text, ...(acknowledged ? { acknowledged: true } : {}) });
114
- if (!acknowledged) { const wait = Math.max(0, 260 * (STEPS.length - 1) + 160 - (Date.now() - started)); if (wait) await new Promise((r) => setTimeout(r, wait)); }
115
- if (pace) clearInterval(pace);
116
- if (!out || !out.ok || !out.draft) { draftOut.hidden = false; draftOut.replaceChildren(el('div', { class: 'fold w' }, c3ic('alert', 'sm'), (out && out.error) || 'The draft did not answer.')); return; }
117
- const d = out.draft;
118
- if (!t.value.trim() && d.title) t.value = d.title;
119
- if (!prefill && lanes && lanes.includes(d.lane)) l.value = d.lane;
120
- refused = !!d.refused && !acknowledged;
121
- if (!acknowledged) { ack = false; ackInput.checked = false; }
122
- suggest(d, acknowledged);
123
- ackBox.hidden = !d.refused;
124
- gate();
125
- }
126
- const redraw = () => { if (last && !draftOut.hidden) suggest(last.d, last.acknowledged); };
127
- a.addEventListener('change', redraw); typed.addEventListener('input', redraw); l.addEventListener('change', redraw);
128
- line.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); runDraft(false); } });
129
- draftBtn.addEventListener('click', () => runDraft(false));
130
- const err = el('div', { class: 'fold w', role: 'alert', 'data-in-error': '' });
131
- err.hidden = true;
132
- const lands = el('div', { class: 'dim', style: 'font-size:var(--fs-2)' }, COPY.newForm.lands);
133
- const fail = (text) => { err.textContent = text; err.hidden = false; };
134
-
135
- let busy = false;
136
- const add = button({
137
- label: COPY.newForm.add, variant: 'primary', attrs: { 'data-in-new-add': '' },
138
- onClick: async () => {
139
- if (busy || (refused && !ack)) return;
140
- err.hidden = true;
141
- const title = t.value.trim();
142
- const pick = a.value;
143
- const anchor = (pick === OTHER ? typed.value : pick).trim();
144
- if (!title) { fail(COPY.newForm.noTitle); t.focus(); return; }
145
- if (!anchor) { fail(COPY.newForm.noAnchor); return; }
146
- busy = true; gate();
147
- const out = await createInitiative(ws, { title, ...(l.value.trim() ? { lane: l.value.trim() } : {}), anchor, ...(prefill && prefill.from ? { from: prefill.from } : {}) });
148
- busy = false; gate();
149
- if (out && out.ok) {
150
- const id = (out.initiative && out.initiative.id) || out.id || (out.ids && out.ids[0]) || null;
151
- s.close();
152
- toast({ text: COPY.newForm.added(title), timeout: 4000 });
153
- changed();
154
- if (onAdded) onAdded(id);
155
- } else fail(COPY.refused((out && out.error) || 'The server did not answer.'));
156
- },
157
- });
158
- const body = el('div', { class: 'c3 c3e' },
159
- el('div', { class: 'c3add' }, el('div', { class: 'form' }, line, draftBtn)),
160
- draftOut, ackBox,
161
- el('div', { class: 'c3jf' }, row(COPY.newForm.titleLabel, t), row(COPY.newForm.laneLabel, l), row(COPY.newForm.anchorLabel, a), typed),
162
- startNote, lands, err);
163
- const s = sheet({
164
- mode: 'auto', title: COPY.newForm.title, body: [body], attrs: { 'data-in-sheet': 'new' },
165
- actions: [button({ label: COPY.cancel, variant: 'outline', onClick: () => s.close(), attrs: { 'data-in-cancel': '' } }), add],
166
- });
167
- if (prefill && prefill.title && !prefill.lane && !prefill.from) { line.value = prefill.title; runDraft(false); } else t.focus();
168
- return s;
169
- }
@@ -1,190 +0,0 @@
1
- /**
2
- * next-step-ui.js — next-step-actions. What a next-step row can DO, drawn under the row.
3
- *
4
- * The act on each item (`it.act.type`) comes from the server; this module only draws it and carries out the PM's presses:
5
- * open → the file the step names, in a document tab
6
- * session → switch to the running session
7
- * work → PREPARE (a read-only plan), then GO (start exactly that plan)
8
- * gate → words only: acceptance and the contract approval are the PM's own act, so there is no button
9
- * lifecycle → reopen
10
- * After a session started from a step has ended, REVIEW shows what changed and takes the PM's verdict.
11
- *
12
- * Nothing here starts a session except the GO press, and GO sends the hash of the plan the PM was shown, so a prompt that
13
- * changed in the meantime is refused by the server.
14
- */
15
- import { el } from './dom.js';
16
- import { state, setState, FIXTURE } from './state.js';
17
- import { askText } from './dialogs.js';
18
- import { adoptProfileDefault } from './dock.js';
19
-
20
- let dataMod = null;
21
- const dataReady = import('./data.js').then((m) => { dataMod = m; }).catch(() => { dataMod = null; });
22
- let iniMod = null;
23
- import('./panel-initiatives.js').then((m) => { iniMod = m; }).catch(() => { iniMod = null; });
24
-
25
- const LAB = 'font-family:var(--mono);font-size:9.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted-foreground)';
26
- const BTN = 'font-family:var(--mono);font-size:10px;padding:2px 7px;background:var(--secondary);border:1px solid var(--border);color:var(--foreground);cursor:pointer;min-height:24px';
27
- const GO = 'font:11px var(--mono);padding:3px 10px;background:var(--primary);border:1px solid var(--primary);color:var(--primary-foreground);cursor:pointer;min-height:26px';
28
- const iv = (t) => el('span', null, t == null ? '' : String(t));
29
-
30
- /* per-item UI state, keyed by item id: { loading, plan, judgment, profile, note, summary } */
31
- const ui = Object.create(null);
32
- let profileList = null;
33
- const touch = () => setState((s) => ({ nsTick: (s.nsTick || 0) + 1 }));
34
- const slot = (id) => (ui[id] = ui[id] || { judgment: false, profile: undefined });
35
-
36
- async function prepare(slug, it) {
37
- const u = slot(it.id);
38
- u.loading = true; u.note = null; touch();
39
- await dataReady;
40
- // Read every time: the default profile is the server's, and the list can change while the page is open.
41
- const rd = await dataMod.nextStepProfiles(); profileList = (rd && rd.profiles) || [];
42
- // Until the PM picks one here, the step starts under the default Claude profile (Settings). 'none' is a choice, sent as null.
43
- if (u.profile === undefined) u.profile = adoptProfileDefault(rd) || '';
44
- const out = await dataMod.nextStepPost('prepare', { initiative_id: slug, item_id: it.id, agent: 'claude', profile: u.profile || null, judgment: u.judgment });
45
- u.loading = false;
46
- u.plan = out && out.ok ? out : null;
47
- if (!out || out.ok === false) u.note = { tone: 'bad', text: (out && out.error) || 'could not prepare' };
48
- touch();
49
- }
50
- async function go(slug, it) {
51
- const u = slot(it.id); const pl = u.plan;
52
- if (!pl || !pl.prompt_sha) return;
53
- u.loading = true; u.note = null; touch();
54
- const out = await dataMod.nextStepPost('go', { initiative_id: slug, item_id: it.id, agent: 'claude', profile: u.profile || null, judgment: u.judgment, confirm: true, prompt_sha: pl.prompt_sha });
55
- u.loading = false;
56
- if (!out || out.ok === false) { u.note = { tone: 'bad', text: (out && out.error) || 'nothing was started' }; if (out && out.prompt_sha) u.plan = null; touch(); return; }
57
- u.plan = null; u.note = { tone: 'ok', text: 'started — ' + (out.notice || out.plan.why || 'the session is running') };
58
- if (iniMod && out.session) iniMod.openTerm(slug, { id: out.session.id, name: out.session.name, st: 'working' });
59
- await dataMod.refreshInitiative(slug);
60
- touch();
61
- }
62
- async function review(slug, it, verdict) {
63
- const u = slot(it.id);
64
- let note = '';
65
- if (verdict === 'send-back') {
66
- note = await askText({ title: 'Send “' + (it.key || it.text) + '” back', label: 'What should change? One line.', confirmLabel: 'Send back' });
67
- if (note === null || !String(note).trim()) return;
68
- }
69
- const out = await dataMod.nextStepPost('review', { session_id: it.run.session_id, verdict, note: String(note).trim() });
70
- u.note = out && out.ok ? { tone: 'ok', text: verdict === 'accept' ? 'step accepted — the initiative is not accepted by this' : 'sent back with your note' } : { tone: 'bad', text: (out && out.error) || 'not recorded' };
71
- await dataMod.refreshInitiative(slug);
72
- touch();
73
- }
74
- async function loadSummary(it) {
75
- const u = slot(it.id);
76
- u.summary = { loading: true }; touch();
77
- await dataReady;
78
- const out = await dataMod.nextStepSummary(it.run.session_id);
79
- u.summary = out && out.ok ? out : { error: (out && out.error) || 'could not read the session' };
80
- touch();
81
- }
82
-
83
- const row = (kids) => el('div', { style: 'display:flex;gap:5px;flex-wrap:wrap;align-items:center;margin-top:3px' }, kids);
84
- const noteLine = (n) => (n ? el('span', { 'data-r21': 'note', style: 'font-size:11px;color:' + (n.tone === 'bad' ? 'var(--destructive)' : 'var(--muted-foreground)') }, iv(n.text)) : null);
85
-
86
- function planPanel(slug, it) {
87
- const u = slot(it.id); const pl = u.plan;
88
- if (!pl) return null;
89
- if (pl.refused) {
90
- return el('div', { 'data-r21': 'plan-refused', style: 'margin-top:4px;padding:6px 8px;border:1px solid var(--destructive);font-size:11.5px;line-height:1.5;color:var(--foreground)' },
91
- el('span', { style: LAB + ';color:var(--destructive)' }, 'not now'), el('div', null, iv(pl.refused.why)));
92
- }
93
- const prof = (profileList || []);
94
- const opt = (v, t, cur) => el('option', { value: v, selected: v === cur ? 'selected' : null }, t);
95
- const where = pl.plan.plan === 'new-worktree' ? 'creates branch ' + pl.plan.branch + ' in its own folder' : pl.plan.plan === 'reuse-worktree' ? 'reuses the folder for ' + (pl.plan.branch || 'the initiative branch') : pl.plan.why;
96
- const kids = [
97
- el('span', { style: LAB }, 'plan — nothing has been created'),
98
- el('div', { 'data-r21': 'plan-where', style: 'font-size:11.5px;line-height:1.5' }, iv(where + (pl.plan.dir ? ' · ' + pl.plan.dir : ''))),
99
- pl.existing_sessions && pl.existing_sessions.length
100
- ? el('div', { 'data-r21': 'plan-existing', style: 'font-size:11px;color:var(--muted-foreground)' }, iv('already running on this initiative: ' + pl.existing_sessions.map((x) => x.name).join(', ') + ' — go starts another one'))
101
- : null,
102
- pl.sources && pl.sources.length
103
- ? el('div', { 'data-r21': 'plan-sources', style: 'font-size:11px;color:var(--muted-foreground)' }, iv('read-only sources it may name: ' + pl.sources.map((x) => x.label).join(', ')))
104
- : el('div', { 'data-r21': 'plan-sources', style: 'font-size:11px;color:var(--muted-foreground)' }, iv(u.profile ? 'the profile declares no source that suits this step' : 'no profile chosen, so no outside source is named')),
105
- el('div', { style: 'display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:11px' },
106
- el('label', { style: 'display:flex;gap:4px;align-items:center' }, iv('profile'),
107
- el('select', { 'data-r21': 'plan-profile', style: 'font-family:var(--mono);font-size:10.5px;background:var(--secondary);color:var(--foreground);border:1px solid var(--border)',
108
- onChange: (e) => { u.profile = e.target.value; prepare(slug, it); } }, [opt('', 'none', u.profile), ...prof.map((p) => opt(p.id, p.label || p.id, u.profile))])),
109
- el('label', { style: 'display:flex;gap:4px;align-items:center' },
110
- el('input', { type: 'checkbox', 'data-r21': 'plan-judgment', checked: u.judgment ? 'checked' : null, onChange: (e) => { u.judgment = !!e.target.checked; prepare(slug, it); } }),
111
- iv('use the Typesafe skill for categorising, scoring and yes/no'))),
112
- el('div', { 'data-r21': 'plan-judgment-note', style: 'font-size:11px;color:' + (pl.judgment.on ? 'var(--warning)' : 'var(--muted-foreground)') }, iv(pl.judgment.note)),
113
- el('span', { style: LAB + ';padding-top:4px' }, 'the exact first input the session will get'),
114
- el('pre', { 'data-r21': 'plan-prompt', style: 'font-family:var(--mono);font-size:10.5px;line-height:1.5;white-space:pre-wrap;padding:6px 8px;background:var(--secondary);border:1px solid var(--border);margin:0;max-height:240px;overflow:auto' }, iv(pl.prompt)),
115
- el('div', { 'data-r21': 'plan-budget', style: 'font-size:11px;color:' + (pl.budget.allowed ? 'var(--muted-foreground)' : 'var(--destructive)') },
116
- iv(pl.budget.allowed ? `${pl.budget.running} of ${pl.budget.limits.concurrent} prepared sessions running · ${pl.budget.startedToday} of ${pl.budget.limits.perDay} started today` : pl.budget.reason)),
117
- row([
118
- el('button', { 'data-r21': 'go', style: GO + (pl.budget.allowed && !u.loading ? '' : ';opacity:.5'), disabled: pl.budget.allowed && !u.loading ? null : 'disabled', onClick: () => go(slug, it),
119
- title: 'starts a session with exactly the input above. It proposes only: it will not push, send, accept or merge.' }, u.loading ? '…' : 'go — start the session'),
120
- el('button', { 'data-r21': 'cancel', style: BTN, onClick: () => { u.plan = null; touch(); } }, 'cancel'),
121
- ]),
122
- ];
123
- return el('div', { 'data-r21': 'plan', style: 'margin-top:4px;padding:6px 8px;border:1px solid var(--border);display:flex;flex-direction:column;gap:3px' }, kids);
124
- }
125
-
126
- function reviewPanel(slug, it) {
127
- const u = slot(it.id); const s = u.summary; const run = it.run;
128
- if (!run) return null;
129
- const done = run.review;
130
- const head = [];
131
- // The record was read when the initiative was selected; the live session list is newer. A run the record calls live is
132
- // ended as soon as the session list says the session has exited.
133
- const cs = (state.sessions || []).find((x) => x && x.id === run.session_id);
134
- const ended = run.state === 'ended' || !!(cs && cs.shown === 'exited');
135
- if (!ended) {
136
- head.push(el('span', { 'data-r21': 'run-live', style: 'font-size:11px;color:var(--muted-foreground)' }, iv('a session started from this step is running')));
137
- head.push(el('button', { 'data-r21': 'switch', style: BTN, onClick: () => iniMod && iniMod.openTerm(slug, { id: run.session_id, name: it.key + ' · ' + slug }) }, 'switch to it'));
138
- } else {
139
- head.push(el('span', { 'data-r21': 'run-ended', style: 'font-size:11px;color:var(--muted-foreground)' }, iv('the session started from this step has ended')));
140
- head.push(el('button', { 'data-r21': 'review-open', style: BTN, onClick: () => loadSummary(it) }, s ? 'refresh review' : 'review what it did'));
141
- }
142
- if (done) head.push(el('span', { 'data-r21': 'verdict', style: 'font-family:var(--mono);font-size:10px;color:' + (done.verdict === 'accept' ? 'var(--brand)' : 'var(--warning)') }, iv((done.verdict === 'accept' ? 'accepted' : 'sent back') + (done.note ? ' — ' + done.note : ''))));
143
- const kids = [row(head)];
144
- if (s && s.loading) kids.push(el('div', { style: 'font-size:11px;color:var(--muted-foreground)' }, 'reading …'));
145
- if (s && s.error) kids.push(el('div', { 'data-r21': 'review-error', style: 'font-size:11px;color:var(--destructive)' }, iv(s.error)));
146
- if (s && s.ok) {
147
- kids.push(el('span', { style: LAB + ';padding-top:3px' }, 'changed on ' + (s.branch || 'its branch') + ' against trunk · ' + s.files.length));
148
- kids.push(s.files_error ? el('div', { 'data-r21': 'review-files-error', style: 'font-size:11px;color:var(--destructive)' }, iv('could not be read — ' + s.files_error))
149
- : s.files.length ? el('div', { 'data-r21': 'review-files', style: 'display:flex;flex-direction:column' }, s.files.map((f) => el('span', { style: 'font-family:var(--mono);font-size:10.5px;color:var(--muted-foreground)' }, iv(f.status + ' ' + f.path))))
150
- : el('div', { 'data-r21': 'review-files', style: 'font-size:11px;color:var(--muted-foreground);font-style:italic' }, 'no file changed on the branch'));
151
- kids.push(el('span', { style: LAB + ';padding-top:3px' }, 'the end of the conversation'));
152
- kids.push(el('pre', { 'data-r21': 'review-tail', style: 'font-family:var(--mono);font-size:10.5px;white-space:pre-wrap;padding:6px 8px;background:var(--secondary);border:1px solid var(--border);margin:0;max-height:160px;overflow:auto' }, iv(s.tail || '(empty)')));
153
- const j = s.judgments || { valid: [], invalid: [] };
154
- if (j.valid.length || j.invalid.length) {
155
- kids.push(el('span', { style: LAB + ';padding-top:3px' }, 'judgments the session reported'));
156
- for (const v of j.valid) kids.push(el('div', { 'data-r21': 'judgment-ok', style: 'font-size:11px' }, iv(v.kind + ' · ' + v.question + ' → ' + (v.kind === 'yesno' ? (v.answer ? 'yes' : 'no') : v.kind === 'score' ? v.score : v.label))));
157
- for (const v of j.invalid) kids.push(el('div', { 'data-r21': 'judgment-bad', style: 'font-size:11px;color:var(--destructive)' }, iv('rejected (' + v.error + '): ' + v.line)));
158
- }
159
- kids.push(row([
160
- el('button', { 'data-r21': 'verdict-accept', style: GO, onClick: () => review(slug, it, 'accept'), title: 'accepts this step only; the initiative is accepted at the Acceptance Gate' }, 'accept the step'),
161
- el('button', { 'data-r21': 'verdict-back', style: BTN, onClick: () => review(slug, it, 'send-back') }, 'send it back…'),
162
- ]));
163
- }
164
- return el('div', { 'data-r21': 'review', style: 'margin-top:4px;padding:6px 8px;border:1px solid var(--border);display:flex;flex-direction:column;gap:2px' }, kids);
165
- }
166
-
167
- /** The controls and panels for one next-step item; null in fixture mode or when the item has no act. */
168
- export function stepActions(product, slug, it) {
169
- if (FIXTURE || !it || !it.act) return null;
170
- const a = it.act; const u = slot(it.id);
171
- const btns = [];
172
- if (a.type === 'work') {
173
- btns.push(el('button', { 'data-r21': 'prepare', style: BTN, onClick: () => prepare(slug, it), title: 'shows the plan and the exact prompt. Nothing is created or started.' }, u.loading && !u.plan ? '…' : 'prepare'));
174
- } else if (a.type === 'session' && a.sessionId) {
175
- btns.push(el('button', { 'data-r21': 'switch', style: BTN, onClick: () => iniMod && iniMod.openTerm(slug, { id: a.sessionId, name: it.text }) }, 'switch to it'));
176
- } else if (a.type === 'lifecycle') {
177
- btns.push(el('button', { 'data-r21': 'reopen', style: BTN, onClick: async () => { await dataReady; await dataMod.setLifecycle(product, slug, 'active', ''); await dataMod.refreshInitiative(slug); touch(); } }, 'reopen'));
178
- } else if (a.type === 'gate') {
179
- btns.push(el('span', { 'data-r21': 'gate-note', style: 'font-size:11px;color:var(--muted-foreground);font-style:italic' }, iv('yours to do — ' + a.why)));
180
- }
181
- if (a.path && (a.type === 'open' || a.type === 'work')) {
182
- btns.push(el('button', { 'data-r21': 'open', style: BTN, onClick: () => iniMod && iniMod.openDoc(slug, a.path, 'FILE'), title: a.path }, a.type === 'open' ? 'open ' + a.path.split('/').pop() : 'open file'));
183
- }
184
- if (a.type === 'open') btns.push(el('span', { 'data-r21': 'gate-note', style: 'font-size:11px;color:var(--muted-foreground);font-style:italic' }, iv('yours to do — ' + a.why)));
185
- const out = [];
186
- if (btns.length || u.note) out.push(row([...btns, noteLine(u.note)]));
187
- const pp = planPanel(slug, it); if (pp) out.push(pp);
188
- const rp = reviewPanel(slug, it); if (rp) out.push(rp);
189
- return out.length ? el('div', { 'data-r21': 'actions', 'data-act': a.type }, out) : null;
190
- }
@@ -1,125 +0,0 @@
1
- /* pm/outbox-panel.js — the outbox queue view (console3 wave B3), on the console3 mockup's own markup and CSS (R4b).
2
- *
3
- * mountOutbox(host, ctx) draws the queue from GET /api/outbox; ctx is optional: { get, post } (defaults to http.js)
4
- * disposeOutbox(host) removes it and its slides
5
- *
6
- * The markup is the mockup's message queue (console3.html lines 4283 to 4284, r2queue 4338): `section.card.sect > .sh2` with the
7
- * count in `.bdg.g`, `ul.list > li.nrow` with `.ki`, `.nb > .tt + .chips + .xp > .xi`, and the case file `.case > .sit + .qd
8
- * + .chgl + .slt`. Each entry shows its channel, recipient, an editable body (editing voids the hash, and the panel says so),
9
- * the claim check result as `.chgl` rows, a slide bound to the CURRENT hash and, after a slide, the plain result. No channel
10
- * is connected in this wave, so a slide ends in "no channel connected" and the entry stays queued. Nothing is sent.
11
- * Not lifted: the mockup's swipe on a message row (right = send, left = hold): a send here is only the slide; the mockup's
12
- * three states (draft, held, sent) and its "external, you approve" chip, which the entry does not carry. */
13
- import { el } from './dom.js';
14
- import { pmGet, pmPost } from './http.js';
15
- import { mountSlide, disposeSlide } from './slide-confirm.js';
16
- import { ensureC3Css, c3ic } from './pm-work-view.js';
17
-
18
- const live = new WeakMap(); // host → { slideHosts: [], gone }
19
-
20
- export function disposeOutbox(host) {
21
- const s = live.get(host);
22
- if (!s) return;
23
- s.gone = true;
24
- s.slideHosts.forEach(disposeSlide);
25
- live.delete(host);
26
- host.textContent = '';
27
- }
28
-
29
- export async function mountOutbox(host, ctx = {}) {
30
- disposeOutbox(host);
31
- ensureC3Css();
32
- const get = ctx.get || pmGet, post = ctx.post || pmPost;
33
- const st = { slideHosts: [], gone: false };
34
- live.set(host, st);
35
- const results = {}; // id → plain result text, kept across redraws
36
- const voided = {}; // id → true after an edit, until the next press
37
- const open = {}; // id → false when the PM folded the row
38
-
39
- async function draw() {
40
- const r = await get('/api/outbox');
41
- if (st.gone) return;
42
- st.slideHosts.forEach(disposeSlide);
43
- st.slideHosts = [];
44
- const root = el('div', { class: 'c3 c3e', 'data-outbox': '' });
45
- if (!r || r.ok === false) {
46
- root.append(el('div', { class: 'fold w', role: 'alert' }, c3ic('alert', 'sm'), (r && r.error) || 'Could not read the outbox.'));
47
- } else {
48
- const entries = r.entries || [];
49
- root.append(el('section', { class: 'card sect' },
50
- el('div', { class: 'sh2' }, el('h2', null, c3ic('out', 'sm'), 'Outbox ', el('span', { class: 'bdg g' }, String(entries.length))),
51
- el('span', { class: 'dim', style: 'font-size:var(--fs-2)' }, 'Nothing here is sent. No channel is connected.')),
52
- el('ul', { class: 'list' }, entries.length ? entries.map((e) => row(e)) : el('li', { class: 'fold' }, c3ic('check', 'sm'), 'The outbox is empty.'))));
53
- }
54
- host.replaceChildren(root);
55
- }
56
-
57
- function row(e) {
58
- const op = open[e.id] !== false;
59
- const li = el('li', { class: 'nrow', 'data-row': '', 'data-outbox-entry': e.id, tabindex: '0', 'aria-expanded': String(op) });
60
- const xp = el('div', { class: 'xp' + (op ? ' open' : '') });
61
- const toggle = () => { open[e.id] = !(open[e.id] !== false); li.setAttribute('aria-expanded', String(open[e.id])); xp.classList.toggle('open', open[e.id]); };
62
- li.addEventListener('click', (ev) => { if (ev.target.closest('.xi')) return; toggle(); });
63
- li.addEventListener('keydown', (ev) => { if (ev.target === li && (ev.key === 'Enter' || ev.key === ' ')) { ev.preventDefault(); toggle(); } });
64
- const claimTone = e.claims.ok ? 'ok' : 'bad';
65
- xp.append(el('div', { class: 'xi' }, theCase(e)));
66
- li.append(
67
- el('span', { class: 'ki' }, c3ic('out')),
68
- el('div', { class: 'nb' },
69
- el('span', { class: 'tt' }, e.recipient || e.channel),
70
- el('div', { class: 'chips' },
71
- el('span', { class: 'chip2' }, e.state),
72
- el('span', { class: 'chip2' }, c3ic('user', 'sm'), e.recipient || 'no recipient'),
73
- el('span', { class: 'tag' }, e.channel),
74
- el('span', { class: 'tag' }, e.origin),
75
- el('span', { class: 'st ' + claimTone }, c3ic(e.claims.ok ? 'check' : 'alert', 'sm'), e.claims.ok ? 'claims labelled' : 'blocked')),
76
- xp));
77
- return li;
78
- }
79
-
80
- function theCase(e) {
81
- const ta = el('textarea', { 'aria-label': 'Body of the entry for ' + (e.recipient || e.channel), style: 'width:100%;min-height:84px;box-sizing:border-box' });
82
- ta.value = e.body;
83
- const save = el('button', { type: 'button', class: 'pill', disabled: true }, c3ic('check', 'sm'), 'Save edit');
84
- const hashLine = el('span', { class: 'dim mono', style: 'font-size:var(--fs-2)' }, 'hash ' + e.hash.slice(0, 10));
85
- const slideHost = el('div');
86
- ta.addEventListener('input', () => {
87
- const changed = ta.value !== e.body;
88
- save.disabled = !changed;
89
- hashLine.textContent = changed ? 'Editing voids hash ' + e.hash.slice(0, 10) + '. Save, then slide on the new hash.' : 'hash ' + e.hash.slice(0, 10);
90
- slideHost.style.display = changed ? 'none' : '';
91
- });
92
- save.addEventListener('click', async () => {
93
- const r = await post('/api/outbox/edit', { id: e.id, body: ta.value });
94
- if (r && r.ok) { voided[e.id] = true; delete results[e.id]; await draw(); } else hashLine.textContent = (r && r.error) || 'The edit failed.';
95
- });
96
- const chg = el('ul', { class: 'chgl' });
97
- if (!e.claims.ok) {
98
- chg.append(el('li', { class: 'bad' }, c3ic('alert', 'sm'), el('span', null, 'Blocked: these claim lines have no label ([fact], [estimate], [assumption], [reported] or a ticket key).'), el('span', { class: 'tag' }, 'claims check')));
99
- for (const l of e.claims.refused) chg.append(el('li', { class: 'bad' }, c3ic('x', 'sm'), el('span', { class: 'mono' }, l)));
100
- } else chg.append(el('li', { class: 'ok' }, c3ic('check', 'sm'), el('span', null, 'Claim check passed.'), el('span', { class: 'tag' }, 'claims check')));
101
- const c = el('div', { class: 'case', 'data-case': e.id, style: '--tc:var(--acc)' },
102
- el('p', { class: 'sit' }, results[e.id] || e.last_result || 'Nothing has been sent. The slide below sends exactly this text, bound to its hash.'),
103
- ta,
104
- el('div', { class: 'chips2' }, save, hashLine),
105
- voided[e.id] ? el('div', { class: 'fold w' }, c3ic('alert', 'sm'), 'The old hash is void. The slide below is bound to the new content.') : null,
106
- chg,
107
- slideHost);
108
- if (e.claims.ok) {
109
- st.slideHosts.push(slideHost);
110
- mountSlide(slideHost, {
111
- label: 'Slide to confirm', hash: e.hash,
112
- onConfirm: async (hash) => {
113
- const r = await post('/api/outbox/confirm', { id: e.id, hash });
114
- const text = !r ? 'No answer.' : r.ok ? 'Confirmed.' : (r.reason || r.error || 'Refused.');
115
- results[e.id] = text;
116
- delete voided[e.id];
117
- await draw();
118
- },
119
- });
120
- } else slideHost.appendChild(el('div', { class: 'cft' }, el('span', null, c3ic('lock', 'sm'), 'The slide is held until every claim line has a label.')));
121
- return c;
122
- }
123
-
124
- await draw();
125
- }