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,321 +0,0 @@
1
- /* pm/c3-material.js — the material of a meeting (initiative meeting-material-replay, part 1; the mockup the PM approved on 2026-10-14, hashes #material, #material-add, #focus-material).
2
- *
3
- * materialSection({ event, date, ws, level, brief, back }) → Node the Material part of the meeting card: each linked item with its kind, topic and source,
4
- * Present or Open, remove, and Add material
5
- * openAddMaterial({ event, date, ws, level, brief, back }) the Add material sheet: Suggested from the meeting's level, Find in PMOS, Or paste a link; For,
6
- * Topic and You (Present it / Only read it)
7
- * openItem(item) · presentItem(item) · audienceItem(item) Open in PMOS or in a new tab; Present (a PMOS deck in the presenter view, Google Slides in present
8
- * mode); the audience view of a PMOS deck
9
- * classifyLink(url) · KIND · pmosUrl(item)
10
- * window.C3Material = { open(event, opts), section, openItem, presentItem, audienceItem } for any page that wants to add or show material
11
- *
12
- * It reads and writes GET and POST /api/meeting-material (lib/routes-meeting-material.js). PMOS keeps the link on its own record of the meeting; the calendar invite is not
13
- * changed. A change fires `c3-material-changed` on window, so the card and Focus read again. Nothing is sent anywhere. */
14
- import { el } from './dom.js';
15
- import { pmGet, pmPost } from './http.js';
16
- import { ensureC3Css } from './pm-work-view.js';
17
- import { ensureComponentsCss } from './primitives.js';
18
- import { icon, pbtn, sect, put, lk, ib, list, empty } from './c3-ini-ui.js';
19
- import { openSheet, closeSheet } from './c3-sheet.js';
20
- import { toast } from './c3-toast.js';
21
- import { openAudienceWindow } from './c3-audience-link.js';
22
-
23
- /** What each kind of item is called, and which icon it takes. `deck`: PMOS presents it itself. `present`: it can be presented at all. */
24
- export const KIND = {
25
- 'pmos-deck': { tag: 'PMOS deck', ic: 'report', deck: true, present: true },
26
- 'pmos-doc': { tag: 'PMOS document', ic: 'doc' },
27
- report: { tag: 'PMOS report', ic: 'report' },
28
- slides: { tag: 'Google Slides', ic: 'out', present: true },
29
- gdoc: { tag: 'Google Docs', ic: 'out' },
30
- conf: { tag: 'Confluence', ic: 'out' },
31
- link: { tag: 'Link', ic: 'out' },
32
- };
33
- const BY = { invite: 'from the invite', brief: 'found by today’s brief', you: 'added by you' };
34
- const isPmos = (k) => k === 'pmos-deck' || k === 'pmos-doc' || k === 'report';
35
-
36
- function ensureCss() {
37
- ensureC3Css(); ensureComponentsCss();
38
- if (typeof document === 'undefined' || document.querySelector('link[data-c3-material]')) return;
39
- const l = document.createElement('link');
40
- l.rel = 'stylesheet'; l.href = new URL('./c3-material.css', import.meta.url).href; l.setAttribute('data-c3-material', '');
41
- document.head.appendChild(l);
42
- }
43
- const wsParam = () => { try { return new URLSearchParams(location.search).get('ws') || ''; } catch { return ''; } };
44
- const pad = (n) => String(n).padStart(2, '0');
45
- const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
46
- const dateText = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? (+m[3]) + ' ' + MON[+m[2] - 1] : ''; };
47
- const timeText = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? pad(d.getHours()) + ':' + pad(d.getMinutes()) : ''; };
48
-
49
- /** What an address is, as the server decides it (lib/meeting-material.js classifyUrl). null for anything that is not an https address. */
50
- export function classifyLink(raw) {
51
- const s = String(raw || '').trim();
52
- if (!s || /\s/.test(s)) return null;
53
- let u; try { u = new URL(/^[a-z][a-z0-9+.-]*:/i.test(s) ? s : 'https://' + s); } catch { return null; }
54
- if (u.protocol !== 'https:' || !u.hostname.includes('.')) return null;
55
- if (u.hostname === 'docs.google.com' && /^\/presentation\/d\//.test(u.pathname)) return { kind: 'slides', url: u.href, title: 'Google Slides deck', meta: 'read through your Google Drive connection' };
56
- if (u.hostname === 'docs.google.com' && /^\/document\/d\//.test(u.pathname)) return { kind: 'gdoc', url: u.href, title: 'Google Docs page', meta: 'read through your Google Drive connection' };
57
- if (/\.atlassian\.net$/.test(u.hostname) && u.pathname.startsWith('/wiki')) return { kind: 'conf', url: u.href, title: 'Confluence page', meta: 'read through your Atlassian connection' };
58
- return { kind: 'link', url: u.href, title: u.hostname, meta: 'opens in a new tab · PMOS does not read it' };
59
- }
60
- /** The pseudo address Focus gives a PMOS item, so its link list can hold it beside web links (c3-focus.js classify). */
61
- export const pmosUrl = (item) => 'pmos:' + item.kind + ':' + (item.ws || '') + ':' + item.ref;
62
-
63
- /* ── what is stored ───────────────────────────────────────────────────────────────────────────────────────────────── */
64
-
65
- const evParams = (event, extra) => {
66
- const e = event || {};
67
- const p = new URLSearchParams({ title: String(e.title || e.id || '') });
68
- if (e.id) p.set('event', String(e.id));
69
- if (e.series) p.set('series', String(e.series));
70
- const date = (extra && extra.date) || String(e.at || e.start || '').slice(0, 10);
71
- if (date) p.set('date', date);
72
- const ws = (extra && extra.ws) || wsParam(); if (ws) p.set('ws', ws);
73
- if (extra && extra.topics) p.set('topics', '1');
74
- return p;
75
- };
76
- const evKey = (e) => (e && (e.id || e.title)) + '|' + ((e && e.series) || '');
77
- const CACHE = new Map(); // event key → { items, at }
78
- const FRESH_MS = 4000;
79
-
80
- async function readItems(event, extra) {
81
- const r = await pmGet('/api/meeting-material?' + evParams(event, extra).toString()).catch(() => null);
82
- if (r && r.ok && Array.isArray(r.items)) { CACHE.set(evKey(event), { items: r.items, at: Date.now() }); return r; }
83
- return null;
84
- }
85
- const changed = (event) => { try { window.dispatchEvent(new CustomEvent('c3-material-changed', { detail: { key: evKey(event) } })); } catch { /* no window */ } };
86
-
87
- async function save(event, body) {
88
- const e = event || {};
89
- const r = await pmPost('/api/meeting-material', { event: { id: e.id || undefined, title: e.title || e.id, series: e.series || undefined }, ...body }).catch((err) => ({ ok: false, error: String((err && err.message) || err) }));
90
- if (!r || !r.ok) { toast({ text: 'The material was not saved: ' + ((r && (r.error || r.reason)) || 'no answer') + '.', tone: 'error', timeout: 6000 }); return null; }
91
- CACHE.set(evKey(event), { items: r.items || [], at: Date.now() });
92
- changed(event);
93
- return r;
94
- }
95
-
96
- /* ── open and present ─────────────────────────────────────────────────────────────────────────────────────────────── */
97
-
98
- function openWeb(url) { try { window.open(url, '_blank', 'noopener,noreferrer'); } catch { /* a blocked pop-up */ } }
99
- const slidesPresentUrl = (url) => { const m = /^(https:\/\/docs\.google\.com\/presentation\/d\/[A-Za-z0-9_-]+)/.exec(String(url || '')); return m ? m[1] + '/present' : url; };
100
-
101
- async function openDocument(item) {
102
- try {
103
- const { openDocSheet } = await import('./c3-doc-sheet.js');
104
- const ws = item.ws || wsParam();
105
- openDocSheet({ ws, doc: { path: item.ref, name: item.title || item.ref, ty: 'Document', v: '', st: 'current', ini: '', iniName: '' },
106
- library: () => Promise.resolve(pmGet('/api/docs/library' + (ws ? '?ws=' + encodeURIComponent(ws) : ''))).catch(() => ({ ok: true, files: [], edges: [], kinds: [], categories: [], initiatives: {} })) });
107
- } catch { toast('The document sheet could not open. The file is ' + item.ref + '.'); }
108
- }
109
- async function openReport(item) {
110
- try {
111
- const store = await import('./c3-report-store.js');
112
- const setup = await import('./c3-report-setup.js');
113
- await store.loadReports(item.ws || wsParam(), true);
114
- const d = store.RS.docs.find((x) => x.path === item.ref);
115
- if (d) { setup.openReportDoc(d); return; }
116
- } catch { /* fall back to the plain document */ }
117
- openDocument(item);
118
- }
119
- /** Open an item: a PMOS item in PMOS (the document sheet), a link in a new tab. */
120
- export function openItem(item) {
121
- if (!item) return;
122
- if (item.kind === 'pmos-doc') return openDocument(item);
123
- if (isPmos(item.kind)) return openReport(item);
124
- if (item.url) openWeb(item.url);
125
- }
126
-
127
- /** The presenter view (or the audience view) of a PMOS deck: the report deck's own (c3-report-deck.js), with your speaker notes. */
128
- async function showDeck(item, mode) {
129
- let deck = null;
130
- try {
131
- const { createDeck } = await import('./c3-report-deck.js');
132
- deck = createDeck({ ws: item.ws || wsParam(), path: item.ref, name: item.title || 'Deck', cycle: '' });
133
- const t0 = Date.now();
134
- while (!deck.state.loaded && Date.now() - t0 < 10000) await new Promise((r) => setTimeout(r, 60));
135
- } catch { deck = null; }
136
- const S = deck && deck.state;
137
- if (!S || !S.loaded || !S.cyc || !S.cyc.designed || !S.R || S.R.format !== 'deck') {
138
- toast('This report has no designed deck yet, so it opens as a document.');
139
- return openItem(item);
140
- }
141
- deck.present(mode);
142
- }
143
- export function presentItem(item) {
144
- if (!item) return;
145
- if (item.kind === 'slides') return openWeb(slidesPresentUrl(item.url));
146
- if (item.kind === 'pmos-deck') return showDeck(item, 'pres');
147
- return openItem(item);
148
- }
149
- /** Audience view: a PMOS deck opens in a window of its own, slides only (initiative meeting-material-replay-gaps). The window opens at once, on the press, because a browser
150
- * blocks a window that opens after a wait. When it is blocked a notice says so and offers the full-screen view in this window. */
151
- export function audienceItem(item) {
152
- if (item && item.kind === 'pmos-deck') {
153
- if (openAudienceWindow({ ws: item.ws || wsParam(), path: item.ref, name: item.title || 'Deck' })) return;
154
- toast({ text: 'The audience window was blocked. Allow pop-ups for this page, or use the full-screen view here.', actionLabel: 'Full-screen view here', timeout: 10000, onAction: () => showDeck(item, 'aud') });
155
- return;
156
- }
157
- return openItem(item);
158
- }
159
-
160
- /* ── the Material part of the meeting card ────────────────────────────────────────────────────────────────────────── */
161
-
162
- /** The links the invite and today's brief already carry, as read-only rows. */
163
- function givenRows(event, brief) {
164
- const seen = new Set(); const rows = [];
165
- const add = (label, url, from) => {
166
- const c = classifyLink(url); if (!c || seen.has(c.url)) return;
167
- seen.add(c.url); rows.push({ id: from + ':' + c.url, kind: c.kind, url: c.url, title: label || c.title, topic: null, present: false, scope: null, from });
168
- };
169
- for (const l of (event && Array.isArray(event.links) ? event.links : [])) add(l && l.label, l && l.url, 'invite');
170
- for (const l of (brief && Array.isArray(brief.links) ? brief.links : [])) add(l && l.label, l && l.url, 'brief');
171
- for (const r of (brief && Array.isArray(brief.refs) ? brief.refs : [])) if (r && r.link) add(r.label, r.link, 'brief');
172
- return rows;
173
- }
174
-
175
- function rowOf(item, o) {
176
- const k = KIND[item.kind] || KIND.link;
177
- const canPresent = !!item.present && k.present;
178
- const where = item.scope === 'series' ? 'every meeting in the series' : item.scope === 'meeting' ? 'this meeting' : '';
179
- const meta = [item.topic ? 'for ' + item.topic : null, BY[item.from] || BY.you, where || null, canPresent ? 'you present it' : null].filter(Boolean).join(' · ');
180
- const act = canPresent
181
- ? lk({ 'data-mm-act': 'present', title: item.kind === 'slides' ? 'Opens it in Google Slides in present mode. Share that tab in the call.' : 'Opens the presenter view in PMOS. Press Audience view before you share the screen.', onclick: () => presentItem(item) }, icon('play', 'sm'), 'Present')
182
- : lk({ 'data-mm-act': 'open', title: isPmos(item.kind) ? 'Opens it in PMOS' : 'Opens it in a new tab', onclick: () => openItem(item) }, icon('out', 'sm'), 'Open');
183
- const rm = item.from === 'you' ? ib('Remove ' + item.title, 'x', { 'data-mm-act': 'remove', title: 'Remove from this meeting. The document itself is not changed.',
184
- onclick: async () => {
185
- const r = await save(o.event, { op: 'remove', scope: item.scope, item: isPmos(item.kind) ? { kind: item.kind, ref: item.ref, ws: item.ws || undefined } : { url: item.url } });
186
- if (r) toast('Removed from the meeting. The document itself is not changed.');
187
- } }) : null;
188
- return el('li', { class: 'cal3-ci mm-row', 'data-mm-item': item.kind, 'data-mm-from': item.from, ...(item.topic ? { 'data-mm-topic': item.topic } : {}) },
189
- el('span', { class: 'tag' }, k.tag), el('span', { class: 'cal3-ct' }, item.title, el('span', { class: 'dim mm-meta' }, meta)), act, rm);
190
- }
191
-
192
- function sectionBody(o, items) {
193
- const rows = [...givenRows(o.event, o.brief), ...(items || [])];
194
- return [
195
- el('h4', null, icon('doc', 'sm'), 'Material ', el('span', { class: 'bdg g', 'data-mm': 'count' }, String(rows.length))),
196
- rows.length ? el('ul', { class: 'cal3-cl', role: 'list' }, ...rows.map((r) => rowOf(r, o))) : el('div', { class: 'fold', 'data-mm': 'none' }, icon('info', 'sm'), items ? 'Nothing is linked to this meeting yet.' : 'Reading the material of this meeting.'),
197
- el('div', { class: 'chips2 mm-foot' }, pbtn('outline', 'Add material', 'plus', { 'data-mm': 'add', onclick: () => openAddMaterial(o) }), el('span', { class: 'dim cal3-note' }, 'Shows in Focus, by topic. Your calendar invite is not changed.')),
198
- ];
199
- }
200
-
201
- /** The Material part of the meeting card (before the meeting). It draws what it holds at once and reads again when it is older than a few seconds. */
202
- export function materialSection(o) {
203
- ensureCss();
204
- const box = el('div', { class: 'cal3-ctx mm', 'data-mm': 'section', 'data-cal3-ctx': 'material' });
205
- const key = evKey(o.event);
206
- const draw = () => { const c = CACHE.get(key); put(box, ...sectionBody(o, c ? c.items : null)); };
207
- draw();
208
- const heard = () => { if (!box.isConnected) return; draw(); };
209
- const onChanged = (ev) => { if (!box.isConnected) { window.removeEventListener('c3-material-changed', onChanged); return; } if (!ev.detail || ev.detail.key === key) draw(); };
210
- window.addEventListener('c3-material-changed', onChanged);
211
- const c = CACHE.get(key);
212
- if (!c || Date.now() - c.at > FRESH_MS) readItems(o.event, { date: o.date, ws: o.ws }).then((r) => { if (r) heard(); });
213
- return box;
214
- }
215
-
216
- /* ── the Add material sheet ───────────────────────────────────────────────────────────────────────────────────────── */
217
-
218
- const levelIni = (o) => {
219
- const lv = o.level; const b = o.brief; const e = o.event || {};
220
- if (lv && lv.kind === 'initiative' && lv.id) return lv.id;
221
- if (lv && lv.kind) return '';
222
- return (b && b.initiative && b.initiative.id) || (typeof e.initiative === 'string' ? e.initiative : '') || '';
223
- };
224
-
225
- function pickRow(it, on, onPick) {
226
- const k = KIND[it.kind] || KIND.link;
227
- return el('li', { class: 'nrow mm-opt' + (on ? ' on' : ''), 'data-mm-opt': it.kind },
228
- el('span', { class: 'ki' }, icon(k.ic)),
229
- el('div', { class: 'nb' }, el('span', { class: 'tt' }, it.title),
230
- el('div', { class: 'chips' }, el('span', { class: 'chip2' }, icon(k.ic, 'sm'), k.tag), it.meta ? el('span', { class: 'tag' }, it.meta) : null,
231
- it.why ? el('span', { class: 'tag mm-why' }, icon('spark', 'sm'), it.why) : null)),
232
- el('div', { class: 'acts' }, on ? el('span', { class: 'tag mm-sel' }, icon('check', 'sm'), 'Picked') : pbtn('ghost', 'Pick', null, { 'data-mm-pick': '', onclick: () => onPick(it) })));
233
- }
234
-
235
- /** Add material: Suggested from the meeting's level, Find in PMOS, Or paste a link; then For, Topic and You. */
236
- export function openAddMaterial(o) {
237
- ensureCss();
238
- const event = o.event || {};
239
- const S = { pick: null, scope: 'meeting', topic: null, present: true, q: '', link: '', sug: null, found: [], topics: [], busy: false, token: 0 };
240
- const root = el('div', { class: 'mm-sheet', 'data-mm': 'sheet' });
241
- const sugBox = el('div', { 'data-mm': 'suggested' });
242
- const foundBox = el('div', { 'data-mm': 'found' });
243
- const pasteBox = el('div', { 'data-mm': 'pasted' });
244
- const optsBox = el('div', { 'data-mm': 'options' });
245
- const findIn = el('input', { class: 'mm-in', type: 'search', 'data-mm': 'find', placeholder: 'A document, report or deck', 'aria-label': 'Find a document, report or deck in PMOS', autocomplete: 'off' });
246
- const linkIn = el('input', { class: 'mm-in', type: 'url', 'data-mm': 'link', placeholder: 'Google Slides, Google Docs, Confluence or any web page', 'aria-label': 'Paste a link', autocomplete: 'off' });
247
- let timer = null;
248
-
249
- const pasted = () => { const c = classifyLink(S.link); return c ? { kind: c.kind, url: c.url, title: c.title, meta: c.meta, present: c.kind === 'slides' } : null; };
250
- const same = (a, b) => !!a && !!b && a.kind === b.kind && (a.ref || a.url) === (b.ref || b.url);
251
- const choose = (it) => { S.pick = it; S.present = !!(KIND[it.kind] && KIND[it.kind].present) && it.present !== false; paint(); };
252
-
253
- function paint() {
254
- put(sugBox, S.sug == null ? el('div', { class: 'fold' }, icon('info', 'sm'), 'Looking in PMOS.') : S.sug.length ? list(S.sug.map((it) => pickRow(it, same(it, S.pick), choose)), { role: 'list' }) : empty('Nothing to suggest yet. Search below, or paste a link.'));
255
- put(foundBox, S.q.length >= 2 ? (S.found.length ? list(S.found.map((it) => pickRow(it, same(it, S.pick), choose)), { role: 'list' }) : el('div', { class: 'fold' }, icon('info', 'sm'), S.busy ? 'Searching.' : 'Nothing in PMOS matches that.')) : null);
256
- const p = pasted();
257
- put(pasteBox, p ? list([pickRow(p, same(p, S.pick), choose)], { role: 'list' }) : el('p', { class: 'dim cal3-note' }, S.link ? 'Paste an https address.' : 'Google Slides gets Present. A web page opens in a new tab and PMOS does not read it.'));
258
- put(optsBox, S.pick ? settings() : null);
259
- }
260
- const seg = (label, rows, cur, key) => el('div', { class: 'seg mm-wrap', role: 'group', 'aria-label': label }, ...rows.map(([v, l]) => pbtn('ghost', l, null, { 'aria-pressed': String(cur === v), [key]: String(v), onclick: () => { S[key === 'data-mm-scope' ? 'scope' : key === 'data-mm-topic' ? 'topic' : 'present'] = v; paint(); } })));
261
- function settings() {
262
- const pick = S.pick; const k = KIND[pick.kind] || KIND.link;
263
- const canPresent = !!k.present;
264
- const topicName = S.topic;
265
- const where = event.series ? 'Every meeting in the series' : 'Every meeting with this title';
266
- const note = canPresent
267
- ? (pick.kind === 'slides' ? 'Present opens it in Google Slides in present mode. You share that tab in the call. ' : 'Present opens the presenter view in PMOS with your speaker notes. The presenter view and the audience view are one switch: press Audience view, then share the screen in the call. ')
268
- : '';
269
- const focusNote = topicName ? 'Focus brings it up when the room gets to ' + topicName + '.' : 'Focus keeps it under Material for the whole meeting.';
270
- return sect({ ic: 'settings', title: 'How it shows', attrs: { class: 'mm-set', 'data-mm': 'settings' } },
271
- el('div', { class: 'mm-f' }, el('span', { class: 'mk-lbl dim mono' }, 'For'),
272
- seg('For', [['meeting', 'This meeting · ' + [dateText(String(event.at || event.start || o.date || '')), timeText(event.at || event.start)].filter(Boolean).join(' ')], ['series', where]], S.scope, 'data-mm-scope')),
273
- S.topics.length ? el('div', { class: 'mm-f' }, el('span', { class: 'mk-lbl dim mono' }, 'Topic'),
274
- el('div', { class: 'seg mm-wrap', role: 'group', 'aria-label': 'Topic' },
275
- ...S.topics.map((t, i) => pbtn('ghost', (i + 1) + '. ' + t.text, null, { 'aria-pressed': String(S.topic === t.text), 'data-mm-topic': t.id, onclick: () => { S.topic = t.text; paint(); } })),
276
- pbtn('ghost', 'Whole meeting', null, { 'aria-pressed': String(S.topic == null), 'data-mm-topic': 'none', onclick: () => { S.topic = null; paint(); } }))) : null,
277
- canPresent ? el('div', { class: 'mm-f' }, el('span', { class: 'mk-lbl dim mono' }, 'You'), seg('Do you present it', [[true, 'Present it'], [false, 'Only read it']], S.present, 'data-mm-pres')) : null,
278
- el('p', { class: 'dim cal3-note' }, note + focusNote),
279
- el('div', { class: 'iacts' }, pbtn('primary', 'Add to the meeting', 'plus', { 'data-mm': 'do', onclick: add }), pbtn('ghost', 'Cancel', null, { 'data-mm': 'cancel', onclick: () => { S.pick = null; paint(); } })));
280
- }
281
- async function add() {
282
- const pick = S.pick; if (!pick) return;
283
- const item = isPmos(pick.kind) ? { kind: pick.kind, ref: pick.ref, title: pick.title, ws: pick.ws || undefined } : { url: pick.url, title: pick.title };
284
- const r = await save(event, { op: 'add', scope: S.scope, item, topic: S.topic || undefined, present: S.present && !!(KIND[pick.kind] || {}).present });
285
- if (!r) return;
286
- closeSheet();
287
- toast('Added to ' + (S.scope === 'series' ? 'every meeting in the series' : 'this meeting') + '. Focus shows it' + (S.topic ? ' at ' + S.topic : '') + '.');
288
- }
289
-
290
- findIn.addEventListener('input', () => {
291
- S.q = findIn.value.trim(); S.busy = S.q.length >= 2; S.found = []; paint();
292
- clearTimeout(timer);
293
- if (!S.busy) return;
294
- const my = ++S.token;
295
- timer = setTimeout(async () => {
296
- const p = new URLSearchParams({ q: S.q }); const ws = o.ws || wsParam(); if (ws) p.set('ws', ws);
297
- const r = await pmGet('/api/meeting-material/suggest?' + p.toString()).catch(() => null);
298
- if (my !== S.token) return;
299
- S.busy = false; S.found = r && r.ok && Array.isArray(r.found) ? r.found : []; paint();
300
- }, 220);
301
- });
302
- linkIn.addEventListener('input', () => { S.link = linkIn.value.trim(); const p = pasted(); if (p) S.pick = p; else if (S.pick && !S.pick.ref && S.pick.url) S.pick = null; paint(); });
303
-
304
- put(root,
305
- el('p', { class: 'dim cal3-note' }, (event.title || 'This meeting') + (event.at || event.start ? ' · ' + dateText(event.at || event.start) + ' ' + timeText(event.at || event.start) : '') + '. PMOS keeps the link on its record of this meeting. The invite in your calendar is not changed.'),
306
- sect({ ic: 'spark', title: 'Suggested for this meeting', attrs: { 'data-mm': 'suggest-sect' } }, sugBox),
307
- sect({ ic: 'search', title: 'Find in PMOS' }, findIn, foundBox),
308
- sect({ ic: 'out', title: 'Or paste a link' }, linkIn, pasteBox),
309
- optsBox);
310
- paint();
311
- openSheet({ title: 'Add material', icon: 'doc', wide: true, body: [el('div', { class: 'c3x' }, root)], onClose: () => { clearTimeout(timer); if (typeof o.back === 'function') { try { o.back(); } catch { /* the page is gone */ } } } });
312
-
313
- const ini = levelIni(o);
314
- const p = new URLSearchParams(); const ws = o.ws || wsParam(); if (ws) p.set('ws', ws); if (ini) p.set('initiative', ini);
315
- pmGet('/api/meeting-material/suggest?' + p.toString()).then((r) => { S.sug = r && r.ok && Array.isArray(r.suggested) ? r.suggested : []; paint(); }).catch(() => { S.sug = []; paint(); });
316
- readItems(event, { date: o.date, ws: o.ws, topics: true }).then((r) => { S.topics = r && Array.isArray(r.topics) ? r.topics : []; paint(); });
317
- }
318
-
319
- if (typeof window !== 'undefined') {
320
- window.C3Material = { open: (event, opts) => openAddMaterial({ event, ...(opts || {}) }), section: materialSection, openItem, presentItem, audienceItem, KIND };
321
- }
@@ -1,3 +0,0 @@
1
- /* pm/c3-md.js — moved to pm/cozy-md.js (premium-agreed-design: no c3-* module loads on a premium page). The console keeps importing
2
- * this name, so it re-exports the one copy. */
3
- export * from './cozy-md.js';
@@ -1,89 +0,0 @@
1
- /* pm/c3-misc-panels.js — three panels of the console3 mockup that the Briefing, Work and Reports views lacked (content audit, planning/research/console3-content-parity.md).
2
- * stopCard(rows) Briefing, Reflect lens: "What I could stop" (console3.html vBrief, line 1475): the agent's proposals, an icon and a line each.
3
- * It is a read-only list, as in the mockup: nothing here acts, so nothing outward can be sent from it.
4
- * forecastChecksCard(opts) Reports, Project family: "Forecast at each check, <initiative>" with the chart "Forecast date at each check against the promise"
5
- * (console3.html driftSVG, line 3964). The points are the CHECKS of the plan from GET /api/c3-timeline?initiative=<id>
6
- * (workspace/lib/routes-c3-timeline.js, which folds the plan ledger with scripts/plan-forecast.js checkFrames): per check the forecast end
7
- * and the promised date. opts = { id, title }. With no id, the initiative with the largest slip among the Calendar's quarter rows is used.
8
- * With fewer than two checks that carry a forecast, the card says so and draws nothing.
9
- * Nothing here writes or sends. Built with el(): data never goes through innerHTML. */
10
- import { el } from './dom.js';
11
- import { pmGet } from './http.js';
12
- import { c3ic } from './pm-work-view.js';
13
- import { readQuarter } from './c3-plan.js';
14
-
15
- /* ── What I could stop ── */
16
- export function stopCard(rows) {
17
- const list = (Array.isArray(rows) ? rows : []).filter((r) => r && r.text);
18
- if (!list.length) return null;
19
- return el('section', { class: 'card sect', 'data-c3pg': 'stop', 'aria-label': 'What I could stop' },
20
- el('div', { class: 'sh2' }, el('h2', null, c3ic('moon', 'sm'), 'What I could stop')),
21
- el('ul', { class: 'list', role: 'list' }, ...list.map((r) => el('li', { class: 'nrow', style: 'grid-template-columns:auto minmax(0,1fr)', 'data-stop-row': '' },
22
- el('span', { class: 'ki' }, c3ic(r.icon || 'check')), el('div', { class: 'nb' }, r.text)))));
23
- }
24
-
25
- /* ── Forecast at each check ── */
26
- const NSV = 'http://www.w3.org/2000/svg';
27
- const sv = (tag, attrs, ...kids) => { const n = document.createElementNS(NSV, tag); for (const k of Object.keys(attrs || {})) n.setAttribute(k, attrs[k]); for (const c of kids) if (c) n.appendChild(c); return n; };
28
- const svt = (x, y, t, a) => { const n = sv('text', { x, y, ...(a || {}) }); n.textContent = t; return n; };
29
- const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
30
- const dayNum = (iso) => Math.round(Date.parse(iso + 'T00:00:00Z') / 864e5);
31
- const dlab = (n) => { const d = new Date(n * 864e5); return d.getUTCDate() + ' ' + MON[d.getUTCMonth()]; };
32
-
33
- /** The chart, from [{ date: 'YYYY-MM-DD', forecast_end, promised }] (the frames that carry a forecast). */
34
- export function forecastChart(frames) {
35
- const W = 560; const H = 160; const x0 = 58; const x1 = W - 20; const y0 = 16; const y1 = H - 30;
36
- const vals = frames.map((f) => dayNum(f.forecast_end)); const pr = dayNum(frames[0].promised || frames[0].forecast_end);
37
- const mn = Math.min(pr, ...vals) - 2; const mx = Math.max(pr, ...vals) + 2; const n = frames.length;
38
- const X = (i) => x0 + i * (x1 - x0) / (n - 1); const Y = (v) => y1 - (v - mn) / (mx - mn) * (y1 - y0);
39
- const s = sv('svg', { class: 'mat', viewBox: `0 0 ${W} ${H}`, role: 'img', 'aria-label': 'Forecast date at each check against the promise', 'data-rp-chart': 'forecast-checks' });
40
- [pr, Math.round((mn + mx) / 2), mx - 1].forEach((v) => s.append(sv('line', { x1: x0, x2: x1, y1: Y(v), y2: Y(v), stroke: 'var(--border)' }), svt(x0 - 5, Y(v) + 4, dlab(v), { 'text-anchor': 'end' })));
41
- s.append(sv('line', { x1: x0, x2: x1, y1: Y(pr), y2: Y(pr), stroke: 'var(--success)', 'stroke-dasharray': '5 4', 'stroke-width': 2 }),
42
- sv('polyline', { points: vals.map((v, i) => X(i).toFixed(1) + ',' + Y(v).toFixed(1)).join(' '), fill: 'none', stroke: 'var(--destructive)', 'stroke-width': 2.5, 'stroke-linejoin': 'round' }));
43
- vals.forEach((v, i) => {
44
- const c = sv('circle', { cx: X(i), cy: Y(v), r: i === n - 1 ? 6 : 4, fill: v > pr ? 'var(--destructive)' : 'var(--success)', stroke: 'var(--card)', 'stroke-width': 2 });
45
- const t = sv('title', {}); t.textContent = dlab(dayNum(frames[i].date)) + ': forecast ' + dlab(v) + (v > pr ? ', ' + (v - pr) + ' days after the promise' : ', on the promise');
46
- c.appendChild(t); s.append(c, svt(X(i), H - 12, dlab(dayNum(frames[i].date)), { 'text-anchor': 'middle' }));
47
- });
48
- s.append(svt(x1, Y(pr) - 6, 'promised ' + dlab(pr), { 'text-anchor': 'end', fill: 'var(--success)' }));
49
- return s;
50
- }
51
-
52
- const done = new Map(); // initiative id → the frames that carry a forecast, or { error }
53
- const pending = new Map();
54
- function readChecks(id) {
55
- if (done.has(id)) return Promise.resolve(done.get(id));
56
- if (!pending.has(id)) {
57
- pending.set(id, pmGet('/api/c3-timeline?initiative=' + encodeURIComponent(id)).then((j) => {
58
- const r = j && j.ok !== false && Array.isArray(j.frames) ? j.frames.filter((f) => f.forecast_end && f.date) : { error: (j && j.error) || 'unreadable' };
59
- done.set(id, r); pending.delete(id); return r;
60
- }, (e) => { pending.delete(id); return { error: String((e && e.message) || e) }; }));
61
- }
62
- return pending.get(id);
63
- }
64
- /** With no initiative named: the one with the largest slip among the quarter rows that have a promise. */
65
- async function pickInitiative() {
66
- const j = await readQuarter().catch(() => null);
67
- const rows = ((j && j.gantt) || []).filter((g) => g.status !== 'no plan' && g.promised);
68
- rows.sort((a, b) => (b.slip_days || 0) - (a.slip_days || 0));
69
- return rows[0] ? { id: rows[0].id, title: rows[0].title || rows[0].id } : null;
70
- }
71
-
72
- export function forecastChecksCard(opts = {}) {
73
- const head = (t) => el('h3', null, c3ic('clock'), 'Forecast at each check' + (t ? ', ' + t : ''));
74
- const box = el('section', { class: 'card', 'data-rp-section': 'forecast-checks' });
75
- const paint = (t, r) => {
76
- if (r && r.error) box.replaceChildren(head(t), el('p', { class: 'dim mono', style: 'font-size:var(--fs-2)', role: 'status' }, 'The checks could not be read: ' + r.error));
77
- else if (!r || r.length < 2) box.replaceChildren(head(t), el('p', { class: 'dim mono', style: 'font-size:var(--fs-2)', role: 'status', 'data-rp-empty': '' }, 'Fewer than two checks have a forecast date yet, so there is no history to draw.'));
78
- else box.replaceChildren(head(t), forecastChart(r));
79
- };
80
- const run = async () => {
81
- const who = opts.id ? { id: opts.id, title: opts.title } : await pickInitiative();
82
- if (!who) { box.replaceChildren(head(''), el('p', { class: 'dim mono', style: 'font-size:var(--fs-2)', role: 'status', 'data-rp-empty': '' }, 'No initiative has a promised date yet, so there is nothing to check a forecast against.')); return; }
83
- if (done.has(who.id)) { paint(who.title, done.get(who.id)); return; }
84
- box.replaceChildren(head(who.title), el('p', { class: 'dim mono', style: 'font-size:var(--fs-2)', role: 'status' }, 'Reading the checks.'));
85
- paint(who.title, await readChecks(who.id));
86
- };
87
- run();
88
- return box;
89
- }
@@ -1,110 +0,0 @@
1
- /* pm/c3-new-session.js — start a session from console3, in a sheet, and open its terminal in the console (c3-new-session).
2
- * openNewSession({ ws, boards, trees, initiative, on, onStarted }) on: 'auto' (default), 'ws:<id>' (that tree) or 'new'
3
- * boards: the workspace's repositories ({ id, name }); the sheet's Board select picks one, and Runs on then lists that repository's trees.
4
- * onStarted(id, ws): the new session's id and the board it started on
5
- * Before this, every "start a session" press on console3 went to the classic app (/classic.html), because the page had no way
6
- * to start one. A session starts over the terminal connection, so this uses the same request as the classic dock's new-session
7
- * sheet (tab-term.js requestSpawn) and then opens the terminal with c3-session-term.js. Nothing opens unless the server says the
8
- * session started; a refusal stays in the sheet as the server's sentence.
9
- * Fields: name (empty: Shell or Claude, numbered when taken), agent (the Settings default first), the board (repository), and where it runs:
10
- * Automatic the server's start policy picks the tree (the initiative's own working copy, or the main tree)
11
- * a listed tree that working tree as it is
12
- * New branch a new branch in its own working copy
13
- * A Claude session takes the server's default profile and the Settings launch flags and tier, as the classic dock does. */
14
- import { el } from './dom.js';
15
- import { openSheet } from './c3-sheet.js';
16
- import { button } from './primitives.js';
17
- import { toast } from './c3-toast.js';
18
- import { pmGet } from './http.js';
19
- import { sessionDefaults, adoptProfileDefault, CLIS } from './dock.js';
20
-
21
- const AGENT = { shell: 'Shell', claude: 'Claude' };
22
-
23
- /** A free name: `base`, else `base 2`, `base 3`, … among the sessions that have not ended. Pure, for Node. */
24
- export function freeName(base, sessions) {
25
- const taken = new Set((sessions || []).filter((s) => s && s.state !== 'exited' && s.shown !== 'exited').map((s) => s.name));
26
- if (!taken.has(base)) return base;
27
- for (let i = 2; ; i += 1) if (!taken.has(base + ' ' + i)) return base + ' ' + i;
28
- }
29
-
30
- /** What requestSpawn is sent, from the form. Pure, for Node. Returns { error } when the form is not complete. */
31
- export function spawnOpts(f, d) {
32
- const claude = f.agent === 'claude';
33
- const common = {
34
- name: f.name, agent: f.agent, initiative: f.initiative || null,
35
- profile: claude ? (f.profile === undefined ? null : f.profile) : null,
36
- flags: claude && d && Array.isArray(d.flags) && d.flags.length ? d.flags.map((x) => ({ flag: x.flag, ...(x.value ? { value: x.value } : {}) })) : undefined,
37
- tier: claude && d && d.tier && d.tier !== 'auto' ? d.tier : null,
38
- workType: 'general',
39
- };
40
- if (f.on === 'new') {
41
- const b = String(f.branch || '').trim();
42
- if (!b) return { error: 'Type a name for the new branch.' };
43
- return { ...common, ws: f.ws, branch: b, createBranch: true, isolate: true };
44
- }
45
- if (f.on && f.on.startsWith('ws:')) return { ...common, ws: f.on.slice(3), branch: null, createBranch: false, isolate: null };
46
- return { ...common, ws: f.ws, start: true };
47
- }
48
-
49
- export function openNewSession(opts) {
50
- const o = opts || {};
51
- const d = sessionDefaults();
52
- let trees = (o.trees || []).filter((t) => t && !t.missing && t.ws);
53
- const F = { ws: o.ws, agent: CLIS.includes(d.cli) ? d.cli : 'shell', on: o.on && (o.on === 'new' || trees.some((t) => 'ws:' + t.ws === o.on)) ? o.on : 'auto', busy: false };
54
- const boards = (o.boards || []).filter((w) => w && w.id);
55
- if (o.ws && !boards.some((w) => w.id === o.ws)) boards.unshift({ id: o.ws, name: o.ws });
56
-
57
- const name = el('input', { type: 'text', 'aria-label': 'Name', placeholder: 'Empty: Shell or Claude', 'data-c3ns': 'name' });
58
- const agent = el('select', { 'aria-label': 'Agent', 'data-c3ns': 'agent', onchange: (e) => { F.agent = e.target.value; } },
59
- ...CLIS.map((c) => el('option', { value: c, selected: c === F.agent }, AGENT[c] || c)));
60
- const branch = el('input', { type: 'text', 'aria-label': 'New branch', placeholder: 'feature/…', 'data-c3ns': 'branch' });
61
- const branchRow = el('label', { class: 'c3ns-f', hidden: F.on !== 'new' }, el('span', { class: 'dim mono' }, 'New branch'), branch);
62
- const where = el('select', { 'aria-label': 'Runs on', 'data-c3ns': 'on', onchange: (e) => { F.on = e.target.value; branchRow.hidden = F.on !== 'new'; } });
63
- const fillWhere = () => where.replaceChildren(
64
- el('option', { value: 'auto', selected: F.on === 'auto' }, o.initiative ? 'Automatic: the working copy of initiative/' + o.initiative : 'Automatic: the main working tree'),
65
- ...trees.map((t) => el('option', { value: 'ws:' + t.ws, selected: F.on === 'ws:' + t.ws }, (t.main ? 'Main tree' : '⑂') + ' ' + (t.branch || 'detached'))),
66
- el('option', { value: 'new', selected: F.on === 'new' }, 'New branch'));
67
- fillWhere();
68
- // another board: its own working trees, read from the server; Runs on goes back to Automatic
69
- const board = el('select', { 'aria-label': 'Board', 'data-c3ns': 'board', onchange: async (e) => {
70
- F.ws = e.target.value; F.on = 'auto'; branchRow.hidden = true; trees = []; fillWhere();
71
- const ws = F.ws;
72
- const r = await pmGet('/api/git/worktrees?ws=' + encodeURIComponent(ws)).catch(() => null);
73
- if (ws !== F.ws) return;
74
- trees = (r && r.ok && Array.isArray(r.worktrees) ? r.worktrees : []).filter((t) => t && !t.missing && t.ws && (t.ws === ws || t.main));
75
- fillWhere();
76
- } }, ...boards.map((w) => el('option', { value: w.id, selected: w.id === F.ws }, w.name || w.id)));
77
- const err = el('p', { class: 'c3ns-err', role: 'alert', 'data-c3ns': 'error' });
78
- const go = button({ label: 'Start', variant: 'primary', size: 'sm', onClick: () => start(), attrs: { 'data-c3ns': 'start' } });
79
- const body = el('div', { class: 'c3ns', 'data-c3ns': 'form' },
80
- el('label', { class: 'c3ns-f' }, el('span', { class: 'dim mono' }, 'Name'), name),
81
- el('label', { class: 'c3ns-f' }, el('span', { class: 'dim mono' }, 'Agent'), agent),
82
- boards.length ? el('label', { class: 'c3ns-f' }, el('span', { class: 'dim mono' }, 'Board'), board) : null,
83
- el('label', { class: 'c3ns-f' }, el('span', { class: 'dim mono' }, 'Runs on'), where),
84
- branchRow, err, el('div', { class: 'c3ns-go' }, go));
85
- const sheet = openSheet({ title: o.initiative ? 'New session for ' + o.initiative : 'New session', icon: 'term', body });
86
- requestAnimationFrame(() => name.focus());
87
-
88
- async function start() {
89
- if (F.busy) return;
90
- if (!F.ws) { err.textContent = 'Pick a board first.'; return; }
91
- F.busy = true; go.disabled = true; err.textContent = '';
92
- const sessions = await pmGet('/api/sessions').then((r) => (r && Array.isArray(r.sessions) ? r.sessions : []), () => []);
93
- const base = (AGENT[F.agent] || 'Shell') + (o.initiative ? ' · ' + o.initiative : '');
94
- // the default profile is the server's; this browser's copy can be old, so a Claude start reads it first
95
- const profile = F.agent === 'claude' ? adoptProfileDefault(await pmGet('/api/profiles').catch(() => null)) : null;
96
- const req = spawnOpts({ name: name.value.trim() || freeName(base, sessions), agent: F.agent, initiative: o.initiative, profile, on: F.on, branch: branch.value, ws: F.ws }, d);
97
- if (req.error) { err.textContent = req.error; F.busy = false; go.disabled = false; return; }
98
- const term = await import('./tab-term.js').catch(() => null);
99
- const res = term ? await term.requestSpawn(req) : { ok: false, error: 'The terminal connection could not be loaded on this page.' };
100
- F.busy = false; go.disabled = false;
101
- if (!res || !res.ok) { err.textContent = (res && res.error) || 'The session was not started.'; return; }
102
- sheet.close();
103
- if (o.onStarted) o.onStarted(res.id, F.ws);
104
- const m = await import('./c3-session-term.js');
105
- m.openSessionTerm({ id: res.id, name: req.name });
106
- // a session that shares its working tree with a running one is told so: their edits land in the same files
107
- if (res.notice && /already running/.test(res.notice)) toast({ text: res.notice, timeout: 12000 });
108
- }
109
- return sheet;
110
- }