create-pmos 0.399.0 → 0.400.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/package.json +18 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +2 -2
  7. package/workspace/briefing-premium-board-test.js +2 -2
  8. package/workspace/briefing-premium-doc-edit-test.js +2 -8
  9. package/workspace/briefing-premium-test.js +3 -2
  10. package/workspace/briefing-premium-work-test.js +9 -4
  11. package/workspace/c3-capture-test.js +0 -17
  12. package/workspace/changelog.json +17 -0
  13. package/workspace/guide/briefing-premium.md +2 -2
  14. package/workspace/guide/home.md +20 -2
  15. package/workspace/guide/layout.md +2 -2
  16. package/workspace/guide/notes.md +2 -2
  17. package/workspace/guide/phone-companion.md +1 -1
  18. package/workspace/lib/route-modules.js +1 -9
  19. package/workspace/lib/routes-phone-day.js +18 -9
  20. package/workspace/lib/routes-slash.js +95 -0
  21. package/workspace/package-lock.json +2 -2
  22. package/workspace/package.json +1 -2
  23. package/workspace/premium-chat-goal-view-test.js +1 -1
  24. package/workspace/premium-chat-term-test.js +0 -10
  25. package/workspace/premium-menu-rows-test.js +1 -1
  26. package/workspace/premium-phone-card-test.js +2 -2
  27. package/workspace/premium-vw-doc-test.js +1 -8
  28. package/workspace/premium-work-depth-test.js +2 -3
  29. package/workspace/public/capture.html +23 -0
  30. package/workspace/public/pm/c3-base.js +47 -0
  31. package/workspace/public/pm/c3-capture.js +1 -1
  32. package/workspace/public/pm/c3-ini-ui.js +1 -1
  33. package/workspace/public/pm/c3-sheet.js +1 -1
  34. package/workspace/public/pm/c3-toast.js +1 -1
  35. package/workspace/public/pm/console3.css +3 -0
  36. package/workspace/public/pm/cozy-home.css +20 -5
  37. package/workspace/public/pm/cozy-today.css +5 -2
  38. package/workspace/public/pm/cozy-viewer.js +4 -2
  39. package/workspace/public/pm/cozy.css +9 -0
  40. package/workspace/public/pm/goal-chat.js +5 -1
  41. package/workspace/public/pm/home-app.js +47 -26
  42. package/workspace/public/pm/home-chat.js +10 -4
  43. package/workspace/public/pm/home-data.js +3 -1
  44. package/workspace/public/pm/home-dictate.js +7 -4
  45. package/workspace/public/pm/home-ini.js +12 -2
  46. package/workspace/public/pm/home-list.js +20 -7
  47. package/workspace/public/pm/home-more.js +2 -2
  48. package/workspace/public/pm/home-phone-card.js +9 -4
  49. package/workspace/public/pm/home-review.js +2 -3
  50. package/workspace/public/pm/home-today.js +10 -6
  51. package/workspace/public/pm/home-work.js +15 -8
  52. package/workspace/public/pm/note-dock.js +1 -2
  53. package/workspace/public/pm/notes-links.js +1 -2
  54. package/workspace/public/pm/notes-task.js +3 -4
  55. package/workspace/public/pm/premium-board.js +1 -1
  56. package/workspace/public/pm/premium-initiative-head.js +3 -3
  57. package/workspace/public/pm/premium-vw-doc.css +20 -2
  58. package/workspace/public/pm/premium-vw-doc.js +22 -7
  59. package/workspace/public/pm/view-notes.js +2 -2
  60. package/workspace/replaced-tests.json +435 -0
  61. package/workspace/run-tests.js +323 -28
  62. package/workspace/server.js +15 -10
  63. package/workspace/test-files.json +3 -140
  64. package/workspace/test-lists/base.json +1 -2
  65. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  66. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  67. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  68. package/workspace/test-lists/c3-work-agent.json +1 -2
  69. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  70. package/workspace/test-lists/console3-reports.json +1 -2
  71. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  72. package/workspace/test-lists/extension-capture.json +5 -0
  73. package/workspace/test-lists/jira-wbs.json +1 -2
  74. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  75. package/workspace/test-lists/meeting-material.json +1 -2
  76. package/workspace/test-lists/meeting-notes.json +2 -36
  77. package/workspace/test-lists/meeting-replay.json +1 -2
  78. package/workspace/test-lists/mm-capture.json +2 -12
  79. package/workspace/test-lists/my-work.json +2 -10
  80. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  81. package/workspace/test-lists/people-directory.json +1 -2
  82. package/workspace/test-lists/run2-a.json +1 -2
  83. package/workspace/test-lists/run2-d.json +2 -19
  84. package/workspace/test-lists/run3-b.json +1 -2
  85. package/workspace/test-lists/run3-c.json +2 -12
  86. package/workspace/test-lists/run4-b.json +1 -2
  87. package/workspace/test-lists/run4-d.json +1 -5
  88. package/workspace/test-lists/run5-c.json +1 -11
  89. package/workspace/test-lists/run6.json +1 -5
  90. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  91. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  92. package/workspace/test-timings.json +242 -123
  93. package/workspace/c3-briefing-test.js +0 -136
  94. package/workspace/c3-core-docs-test.js +0 -170
  95. package/workspace/c3-driver-fixture.js +0 -64
  96. package/workspace/c3-driver-test.js +0 -169
  97. package/workspace/c3-foundation-test.js +0 -163
  98. package/workspace/c3-ib-items-test.js +0 -114
  99. package/workspace/c3-ib-more-test.js +0 -146
  100. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  101. package/workspace/c3-ini-harness.js +0 -66
  102. package/workspace/c3-ini-life-test.js +0 -167
  103. package/workspace/c3-initiatives-test.js +0 -186
  104. package/workspace/c3-light-load-test.js +0 -112
  105. package/workspace/c3-one-home-test.js +0 -149
  106. package/workspace/c3-phone-test.js +0 -289
  107. package/workspace/c3-quiet-test.js +0 -157
  108. package/workspace/c3-report-design-real-test.js +0 -264
  109. package/workspace/c3-report-design-test.js +0 -442
  110. package/workspace/c3-report-setup-test.js +0 -192
  111. package/workspace/c3-report-structure-real-test.js +0 -248
  112. package/workspace/c3-report-structure-test.js +0 -397
  113. package/workspace/c3-reports-test.js +0 -288
  114. package/workspace/c3-scan-test.js +0 -517
  115. package/workspace/c3-sessions-panel-test.js +0 -365
  116. package/workspace/c3-settings-test.js +0 -204
  117. package/workspace/c3-updates-test.js +0 -131
  118. package/workspace/c3-work-test.js +0 -260
  119. package/workspace/cut-stub.js +0 -40
  120. package/workspace/first-paint-audit.js +0 -160
  121. package/workspace/lib/c3-full-console.js +0 -15
  122. package/workspace/lib/engine/derived/trust.js +0 -3
  123. package/workspace/lib/engine/plan-forecast.js +0 -342
  124. package/workspace/lib/engine/report-families.js +0 -175
  125. package/workspace/lib/engine/truth-table.js +0 -57
  126. package/workspace/lib/routes-c3-init.js +0 -54
  127. package/workspace/lib/routes-c3-life.js +0 -120
  128. package/workspace/lib/routes-c3-timeline.js +0 -192
  129. package/workspace/lib/routes-forecast.js +0 -86
  130. package/workspace/lib/routes-releases.js +0 -130
  131. package/workspace/lib/routes-report-facts.js +0 -85
  132. package/workspace/lib/routes-report-families.js +0 -33
  133. package/workspace/lib/routes-signals.js +0 -51
  134. package/workspace/lib/routes-timeline.js +0 -197
  135. package/workspace/public/c3.html +0 -35
  136. package/workspace/public/index.html +0 -156
  137. package/workspace/public/pm/app.js +0 -831
  138. package/workspace/public/pm/bd-board.js +0 -159
  139. package/workspace/public/pm/bd-drag.js +0 -59
  140. package/workspace/public/pm/bd-model.js +0 -152
  141. package/workspace/public/pm/bd-timeline.js +0 -233
  142. package/workspace/public/pm/bd-tree.js +0 -244
  143. package/workspace/public/pm/board-copy.js +0 -59
  144. package/workspace/public/pm/board-read.js +0 -38
  145. package/workspace/public/pm/branches-sheet.js +0 -56
  146. package/workspace/public/pm/breakdown-api.js +0 -58
  147. package/workspace/public/pm/breakdown-copy.js +0 -138
  148. package/workspace/public/pm/briefing-deck.js +0 -441
  149. package/workspace/public/pm/briefing-model.js +0 -251
  150. package/workspace/public/pm/c3-ambient.js +0 -100
  151. package/workspace/public/pm/c3-audience-link.js +0 -21
  152. package/workspace/public/pm/c3-audience.js +0 -46
  153. package/workspace/public/pm/c3-boot.js +0 -13
  154. package/workspace/public/pm/c3-breakdown.js +0 -240
  155. package/workspace/public/pm/c3-brief-data.js +0 -11
  156. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  157. package/workspace/public/pm/c3-brief-needs.js +0 -288
  158. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  159. package/workspace/public/pm/c3-brief-summary.js +0 -139
  160. package/workspace/public/pm/c3-brief-today.js +0 -79
  161. package/workspace/public/pm/c3-brief.js +0 -279
  162. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  163. package/workspace/public/pm/c3-calendar.js +0 -965
  164. package/workspace/public/pm/c3-calpop.js +0 -111
  165. package/workspace/public/pm/c3-case.js +0 -196
  166. package/workspace/public/pm/c3-core-docs.css +0 -18
  167. package/workspace/public/pm/c3-core-docs.js +0 -236
  168. package/workspace/public/pm/c3-daypart.js +0 -176
  169. package/workspace/public/pm/c3-demo-boards.js +0 -764
  170. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  171. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  172. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  173. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  174. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  175. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  176. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  177. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  178. package/workspace/public/pm/c3-demo-data.js +0 -552
  179. package/workspace/public/pm/c3-demo-focus.js +0 -181
  180. package/workspace/public/pm/c3-demo-init.js +0 -430
  181. package/workspace/public/pm/c3-demo-life.js +0 -77
  182. package/workspace/public/pm/c3-demo-material.js +0 -58
  183. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  184. package/workspace/public/pm/c3-demo-phone.js +0 -48
  185. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  186. package/workspace/public/pm/c3-demo-rd.js +0 -432
  187. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  188. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  189. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  190. package/workspace/public/pm/c3-demo-rs.js +0 -287
  191. package/workspace/public/pm/c3-demo-term.js +0 -153
  192. package/workspace/public/pm/c3-demo-time.js +0 -49
  193. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  194. package/workspace/public/pm/c3-demo.js +0 -131
  195. package/workspace/public/pm/c3-design-studio.js +0 -369
  196. package/workspace/public/pm/c3-doc-formats.js +0 -153
  197. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  198. package/workspace/public/pm/c3-dock.js +0 -206
  199. package/workspace/public/pm/c3-docs.js +0 -291
  200. package/workspace/public/pm/c3-driver-work.js +0 -110
  201. package/workspace/public/pm/c3-driver.css +0 -18
  202. package/workspace/public/pm/c3-driver.js +0 -298
  203. package/workspace/public/pm/c3-focus.css +0 -304
  204. package/workspace/public/pm/c3-focus.js +0 -983
  205. package/workspace/public/pm/c3-ib-docs.js +0 -92
  206. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  207. package/workspace/public/pm/c3-ib-items.js +0 -210
  208. package/workspace/public/pm/c3-ib-releases.js +0 -48
  209. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  210. package/workspace/public/pm/c3-ib-triage.js +0 -177
  211. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  212. package/workspace/public/pm/c3-ini-life.css +0 -34
  213. package/workspace/public/pm/c3-ini-life.js +0 -379
  214. package/workspace/public/pm/c3-ini-records.js +0 -197
  215. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  216. package/workspace/public/pm/c3-ini-work.js +0 -139
  217. package/workspace/public/pm/c3-init-extras.js +0 -170
  218. package/workspace/public/pm/c3-initiatives.js +0 -852
  219. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  220. package/workspace/public/pm/c3-look.js +0 -27
  221. package/workspace/public/pm/c3-material.css +0 -22
  222. package/workspace/public/pm/c3-material.js +0 -321
  223. package/workspace/public/pm/c3-md.js +0 -3
  224. package/workspace/public/pm/c3-misc-panels.js +0 -89
  225. package/workspace/public/pm/c3-new-session.js +0 -110
  226. package/workspace/public/pm/c3-notes.js +0 -751
  227. package/workspace/public/pm/c3-phone-boot.js +0 -47
  228. package/workspace/public/pm/c3-phone-detail.js +0 -97
  229. package/workspace/public/pm/c3-phone-model.js +0 -3
  230. package/workspace/public/pm/c3-phone.css +0 -66
  231. package/workspace/public/pm/c3-phone.js +0 -444
  232. package/workspace/public/pm/c3-plan-panels.js +0 -163
  233. package/workspace/public/pm/c3-plan.js +0 -193
  234. package/workspace/public/pm/c3-quiet.css +0 -113
  235. package/workspace/public/pm/c3-quiet.js +0 -177
  236. package/workspace/public/pm/c3-replay.css +0 -133
  237. package/workspace/public/pm/c3-replay.js +0 -429
  238. package/workspace/public/pm/c3-report-deck.css +0 -163
  239. package/workspace/public/pm/c3-report-deck.js +0 -598
  240. package/workspace/public/pm/c3-report-frame.css +0 -20
  241. package/workspace/public/pm/c3-report-print.css +0 -20
  242. package/workspace/public/pm/c3-report-setup.css +0 -67
  243. package/workspace/public/pm/c3-report-setup.js +0 -298
  244. package/workspace/public/pm/c3-report-store.js +0 -244
  245. package/workspace/public/pm/c3-report-structure.css +0 -44
  246. package/workspace/public/pm/c3-report-structure.js +0 -473
  247. package/workspace/public/pm/c3-reports.css +0 -68
  248. package/workspace/public/pm/c3-reports.js +0 -377
  249. package/workspace/public/pm/c3-roadmap.js +0 -249
  250. package/workspace/public/pm/c3-scan-api.js +0 -167
  251. package/workspace/public/pm/c3-scan-next.js +0 -248
  252. package/workspace/public/pm/c3-scan-setup.js +0 -313
  253. package/workspace/public/pm/c3-scan-words.js +0 -41
  254. package/workspace/public/pm/c3-scan.css +0 -74
  255. package/workspace/public/pm/c3-scan.js +0 -93
  256. package/workspace/public/pm/c3-session-chat.js +0 -103
  257. package/workspace/public/pm/c3-session-conv.js +0 -165
  258. package/workspace/public/pm/c3-session-term.js +0 -216
  259. package/workspace/public/pm/c3-settings.css +0 -85
  260. package/workspace/public/pm/c3-settings.js +0 -1045
  261. package/workspace/public/pm/c3-shell.js +0 -628
  262. package/workspace/public/pm/c3-signals.js +0 -196
  263. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  264. package/workspace/public/pm/c3-swipe.js +0 -230
  265. package/workspace/public/pm/c3-terminal-data.js +0 -48
  266. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  267. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  268. package/workspace/public/pm/c3-terminal-results.js +0 -141
  269. package/workspace/public/pm/c3-terminal.js +0 -52
  270. package/workspace/public/pm/c3-tickets.js +0 -163
  271. package/workspace/public/pm/c3-timeline.js +0 -201
  272. package/workspace/public/pm/calendar-views.js +0 -1049
  273. package/workspace/public/pm/console3-lift.md +0 -220
  274. package/workspace/public/pm/cozy-home.js +0 -172
  275. package/workspace/public/pm/cozy-initiative.css +0 -138
  276. package/workspace/public/pm/cycle-review.js +0 -125
  277. package/workspace/public/pm/data.js +0 -1577
  278. package/workspace/public/pm/dest-board.js +0 -444
  279. package/workspace/public/pm/dest-docs.js +0 -530
  280. package/workspace/public/pm/dest-initiatives.js +0 -162
  281. package/workspace/public/pm/dest-mywork.js +0 -307
  282. package/workspace/public/pm/dest-notes.js +0 -537
  283. package/workspace/public/pm/dest-people.js +0 -449
  284. package/workspace/public/pm/dest-reports.js +0 -383
  285. package/workspace/public/pm/dest-settings.js +0 -601
  286. package/workspace/public/pm/dest-today.js +0 -267
  287. package/workspace/public/pm/display-word.js +0 -56
  288. package/workspace/public/pm/doc-editor.js +0 -473
  289. package/workspace/public/pm/doc-graph.js +0 -272
  290. package/workspace/public/pm/doc-health-panel.js +0 -110
  291. package/workspace/public/pm/doc-rail.js +0 -167
  292. package/workspace/public/pm/doc-remote.js +0 -180
  293. package/workspace/public/pm/dock-sessions.js +0 -472
  294. package/workspace/public/pm/dock.js +0 -216
  295. package/workspace/public/pm/fixture.js +0 -821
  296. package/workspace/public/pm/flag-picker.js +0 -104
  297. package/workspace/public/pm/frame-copy.js +0 -278
  298. package/workspace/public/pm/freshness-line.js +0 -149
  299. package/workspace/public/pm/handoff-box.js +0 -82
  300. package/workspace/public/pm/initiative-list.js +0 -235
  301. package/workspace/public/pm/initiative-sheet.js +0 -331
  302. package/workspace/public/pm/initiatives-api.js +0 -95
  303. package/workspace/public/pm/initiatives-copy.js +0 -287
  304. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  305. package/workspace/public/pm/initiatives-timeline.js +0 -410
  306. package/workspace/public/pm/initiatives-ui.js +0 -291
  307. package/workspace/public/pm/item-sheet.js +0 -268
  308. package/workspace/public/pm/keep-card.js +0 -204
  309. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  310. package/workspace/public/pm/lifecycle-lens.js +0 -276
  311. package/workspace/public/pm/lifecycle.js +0 -111
  312. package/workspace/public/pm/mobile.css +0 -366
  313. package/workspace/public/pm/mobile.js +0 -581
  314. package/workspace/public/pm/modes-live.js +0 -453
  315. package/workspace/public/pm/modes.js +0 -147
  316. package/workspace/public/pm/my-work-card.js +0 -51
  317. package/workspace/public/pm/my-work-data.js +0 -36
  318. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  319. package/workspace/public/pm/next-step-ui.js +0 -190
  320. package/workspace/public/pm/outbox-panel.js +0 -125
  321. package/workspace/public/pm/palette-copy.js +0 -55
  322. package/workspace/public/pm/palette.js +0 -343
  323. package/workspace/public/pm/panel-breakdown.js +0 -702
  324. package/workspace/public/pm/panel-cockpit.js +0 -425
  325. package/workspace/public/pm/panel-detail.js +0 -1513
  326. package/workspace/public/pm/panel-initiatives.js +0 -929
  327. package/workspace/public/pm/panel-newsess.js +0 -709
  328. package/workspace/public/pm/panel-repos.js +0 -741
  329. package/workspace/public/pm/panel-tabs.js +0 -1506
  330. package/workspace/public/pm/panel-trees.js +0 -204
  331. package/workspace/public/pm/people-link.js +0 -106
  332. package/workspace/public/pm/phone-deck.js +0 -167
  333. package/workspace/public/pm/pm-work-view.js +0 -1533
  334. package/workspace/public/pm/portfolio-report.js +0 -61
  335. package/workspace/public/pm/premium-acts.js +0 -280
  336. package/workspace/public/pm/premium-brief.js +0 -111
  337. package/workspace/public/pm/premium-chat.js +0 -22
  338. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  339. package/workspace/public/pm/premium-initiative.js +0 -324
  340. package/workspace/public/pm/premium-insights.css +0 -228
  341. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  342. package/workspace/public/pm/premium-report-brief.js +0 -132
  343. package/workspace/public/pm/premium-vw-rec.js +0 -67
  344. package/workspace/public/pm/premium-wide.css +0 -30
  345. package/workspace/public/pm/print.css +0 -44
  346. package/workspace/public/pm/provider-cards.js +0 -136
  347. package/workspace/public/pm/registry.js +0 -203
  348. package/workspace/public/pm/release-card.js +0 -110
  349. package/workspace/public/pm/releases-view.js +0 -248
  350. package/workspace/public/pm/report-families-view.js +0 -505
  351. package/workspace/public/pm/report-slides.js +0 -438
  352. package/workspace/public/pm/report-tab.js +0 -33
  353. package/workspace/public/pm/report-view.js +0 -337
  354. package/workspace/public/pm/reports-copy.js +0 -134
  355. package/workspace/public/pm/roadmap.js +0 -294
  356. package/workspace/public/pm/run-card.js +0 -260
  357. package/workspace/public/pm/sessions-panel.js +0 -219
  358. package/workspace/public/pm/sheet-jira.js +0 -353
  359. package/workspace/public/pm/shell-bell.js +0 -163
  360. package/workspace/public/pm/shell-model.js +0 -83
  361. package/workspace/public/pm/shell-phone.js +0 -124
  362. package/workspace/public/pm/shell-readaloud.js +0 -53
  363. package/workspace/public/pm/shell-recording.js +0 -274
  364. package/workspace/public/pm/shell-ticker.js +0 -90
  365. package/workspace/public/pm/sig-watch.js +0 -41
  366. package/workspace/public/pm/slide-confirm.js +0 -163
  367. package/workspace/public/pm/slides-copy.js +0 -52
  368. package/workspace/public/pm/status-banner.js +0 -95
  369. package/workspace/public/pm/tab-doc.js +0 -859
  370. package/workspace/public/pm/tab-gone.js +0 -21
  371. package/workspace/public/pm/tab-term.js +0 -1210
  372. package/workspace/public/pm/tab-web.js +0 -90
  373. package/workspace/public/pm/timeline-copy.js +0 -48
  374. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  375. package/workspace/public/pm/today-agenda.js +0 -331
  376. package/workspace/public/pm/today-cards.js +0 -244
  377. package/workspace/public/pm/today-copy.js +0 -506
  378. package/workspace/public/pm/today-day.js +0 -1371
  379. package/workspace/public/pm/today-goals.js +0 -297
  380. package/workspace/public/pm/today-jobs.js +0 -84
  381. package/workspace/public/pm/today-mentions.js +0 -50
  382. package/workspace/public/pm/topbar.js +0 -202
  383. package/workspace/public/pm/triage-card.js +0 -60
  384. package/workspace/public/pm/undo-hold.js +0 -103
  385. package/workspace/public/pm/view-addrepo.js +0 -208
  386. package/workspace/public/pm/view-files.js +0 -197
  387. package/workspace/public/pm/view-livenotes.js +0 -399
  388. package/workspace/public/pm/view-today.js +0 -13
  389. package/workspace/public/pm/view-validate.js +0 -171
  390. package/workspace/public/pm/welcome.js +0 -391
  391. package/workspace/public/pm/work-place.js +0 -68
  392. package/workspace/public/pm/xlsx-read.js +0 -117
  393. package/workspace/public/welcome.html +0 -22
  394. package/workspace/test-lists/browser-suites-green.json +0 -5
  395. package/workspace/test-lists/c3-core-docs.json +0 -9
  396. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  397. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  398. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  399. package/workspace/test-lists/c3-ib-items.json +0 -9
  400. package/workspace/test-lists/c3-ib-more.json +0 -9
  401. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  402. package/workspace/test-lists/c3-ini-life.json +0 -9
  403. package/workspace/test-lists/c3-meeting-board.json +0 -5
  404. package/workspace/test-lists/c3-meeting-card.json +0 -5
  405. package/workspace/test-lists/c3-notes-place.json +0 -5
  406. package/workspace/test-lists/c3-notes-series.json +0 -5
  407. package/workspace/test-lists/calendar-time-page.json +0 -5
  408. package/workspace/test-lists/calpop.json +0 -4
  409. package/workspace/test-lists/console3-briefing.json +0 -9
  410. package/workspace/test-lists/console3-foundation.json +0 -9
  411. package/workspace/test-lists/console3-work-page.json +0 -9
  412. package/workspace/test-lists/premium-brief-parity.json +0 -9
  413. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  414. package/workspace/test-lists/report-structure-ui.json +0 -11
  415. package/workspace/test-lists/report-workspace-ui.json +0 -5
  416. package/workspace/test-lists/run3-a.json +0 -5
  417. package/workspace/test-lists/run3-d.json +0 -6
  418. package/workspace/test-lists/run4-c.json +0 -13
  419. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  420. package/workspace/test-lists/today-mentions-cards.json +0 -5
  421. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,709 +0,0 @@
1
- /* pm/panel-newsess.js — the session pre-flight: the questions asked BEFORE a PTY exists.
2
- *
3
- * ── What this is, and what it is not ────────────────────────────────────────────────────────
4
- * It is NOT a resurrection of `app.js`'s composer. That file's imperative `$()`/`innerHTML` style
5
- * is retired; this is `el()`/`setState()` and design tokens like every other four-panel module.
6
- * What is ported is the composer's INTENT — the five questions it asked and, more importantly, the
7
- * three places it told the truth about what it could not read.
8
- *
9
- * It is also NOT the primary way to start a session. `workspace-repo-first`'s accepted PRD is
10
- * explicit: one click is primary and the composer is *"demoted, not deleted"*. `+ session` keeps
11
- * its one-click behaviour and its co-tenancy chooser; this is the `⋯ options` path beside it, for
12
- * the cases the one-click rule does not cover — a branch off a tag, a colleague's branch, an
13
- * existing worktree, a specific profile for this session only.
14
- *
15
- * ── Why it renders in panel 4 and not panel 3 ───────────────────────────────────────────────
16
- * It occupies the same slot as `startPromptBlock` (panel-tabs.js): above the panes, below the tab
17
- * bar. Two reasons, and the second is the load-bearing one:
18
- * 1. It is about the click that was just made in that bar, so it belongs beside it.
19
- * 2. Every open pane hosts a live xterm, and a terminal that is re-parented by an unrelated
20
- * render silently loses its grid. Rendering here leaves every pane exactly where it was;
21
- * taking over the panes row would move them.
22
- *
23
- * ── The one property everything else exists to serve ────────────────────────────────────────
24
- * A REFUSAL STARTS NOTHING AND SHOWS NOTHING. `onStart` awaits `requestSpawn`, and only a resolved
25
- * `{ok:true}` writes an `extraSess` row or opens a tab. On `{ok:false}` the form stays open with
26
- * the server's own sentence in it — no tab, no pane, no xterm, no row. The defect this replaces
27
- * did the opposite: the click built the tab, the pane's own render asked for the PTY, and the
28
- * refusal was written as a dimmed line INSIDE a terminal belonging to a session that was never
29
- * started.
30
- */
31
-
32
- import { el } from './dom.js';
33
- import { state, setState, FIXTURE } from './state.js';
34
- import * as FX from './fixture.js';
35
- import { openTerm as openTermTab } from './panel-initiatives.js';
36
- import { startHere } from './panel-trees.js';
37
- import { sessionDefaults, setSessionDefaults, adoptProfileDefault } from './dock.js';
38
- import { button } from './primitives.js';
39
- import { flagPicker, flagsLine, flagsMissingValue, flagsWire } from './flag-picker.js';
40
-
41
- /* Both are another module's file, loaded lazily for the reason panel-tabs.js gives: a static import
42
- * of a file that fails to load takes this whole module down with it, and a panel that cannot draw
43
- * is a worse failure than a form that cannot start a session yet. */
44
- let dataMod = null;
45
- import('./data.js').then((m) => { dataMod = m; setState({}); }).catch(() => { dataMod = null; });
46
- let termMod = null;
47
- import('./tab-term.js').then((m) => { termMod = m; }).catch(() => { termMod = null; });
48
-
49
- /** One interpolated value in its own span — the convention every panel module renders values with. */
50
- const iv = (v) => el('span', null, v === null || v === undefined ? '' : String(v));
51
-
52
- /* ── styles: design tokens only, no raw hex (workspace-ci's token-hygiene check) ────────────── */
53
-
54
- /* Drawn from planning/design/cockpit-mockup/ViewNewSession.dc.html (Run 3 of workspace-cockpit-nav):
55
- * a centred dialog card over a dimmed backdrop, option cards with a radio mark for where the session
56
- * works, pill chips and badges, and the two buttons bottom right. The dialog is position:fixed, so it
57
- * takes no room in the panel's flow: the panes below keep their size and their place, which is the
58
- * same promise the inline block made. It is still a DOM child of panel 4, so every reader that looks
59
- * for the form there still finds it. */
60
- const BACKDROP = 'position:fixed;inset:0;z-index:55;display:grid;place-items:center;padding:16px;'
61
- + 'background:oklch(0 0 0 / 45%)';
62
- const WRAP = 'width:640px;max-width:100%;max-height:calc(100vh - 32px);overflow-y:auto;box-sizing:border-box;'
63
- + 'display:flex;flex-direction:column;gap:12px;padding:22px;background:var(--card);color:var(--foreground);'
64
- + 'border:1px solid var(--input);border-radius:12px;box-shadow:0 16px 48px oklch(0 0 0 / 50%);'
65
- + 'font-family:var(--sans);font-size:13px;line-height:1.45';
66
- const HEAD = 'font-family:var(--sans);font-size:18px;font-weight:600;color:var(--foreground)';
67
- const TITLE = 'font-size:12.5px;color:var(--muted-foreground)';
68
- const SUB = 'font-size:12px;color:var(--muted-foreground);line-height:1.5';
69
- const LABEL = 'font-family:var(--mono);font-size:10px;font-weight:500;letter-spacing:.1em;text-transform:uppercase;'
70
- + 'color:var(--muted-foreground);margin-top:2px';
71
- const ROW = 'display:flex;gap:6px;align-items:center;flex-wrap:wrap';
72
- const INPUT = 'font-family:var(--mono);font-size:12px;padding:5px 10px;min-height:32px;box-sizing:border-box;'
73
- + 'background:var(--background);border:1px solid var(--input);border-radius:8px;color:var(--foreground);min-width:240px';
74
- const PILL = 'font-family:var(--mono);font-size:11px;padding:0 10px;min-height:26px;border-radius:999px;';
75
- const CHIP = PILL + 'background:transparent;border:1px solid var(--border);color:var(--foreground)';
76
- /* `var(--accent)` appears in CHIP_ON and in no other chip rule: pm-tabs-test reads a lit chip off it. */
77
- const CHIP_ON = PILL + 'background:var(--accent);border:1px solid var(--brand);color:var(--foreground)';
78
- const CHIP_DEAD = PILL + 'background:transparent;border:1px solid var(--border);color:var(--muted-foreground);opacity:.55';
79
- const CHIP_BAD = PILL + 'background:transparent;border:1px solid var(--destructive);color:var(--destructive);opacity:.75';
80
- const HOVER = 'border-color:var(--ring)';
81
- /* The board's primary button is the inverted one: foreground on background. */
82
- const BTN_BASE = 'font-family:var(--sans);font-size:12.5px;font-weight:500;padding:0 14px;min-height:32px;border-radius:8px;';
83
- const PRIMARY = BTN_BASE + 'background:var(--foreground);border:1px solid var(--foreground);color:var(--background)';
84
- const PRIMARY_OFF = BTN_BASE + 'background:var(--secondary);border:1px solid var(--border);color:var(--muted-foreground)';
85
- const SECONDARY = BTN_BASE + 'background:transparent;border:1px solid var(--input);color:var(--foreground)';
86
- const CLOSE = 'font-size:16px;line-height:1;padding:4px 6px;background:transparent;border:0;color:var(--muted-foreground)';
87
- const ERR = 'font-size:12px;line-height:1.5;color:var(--destructive);border-radius:8px;'
88
- + 'border:1px solid var(--destructive);padding:7px 10px;overflow-wrap:anywhere';
89
- const WARN = 'font-size:12px;line-height:1.5;color:var(--warning);overflow-wrap:anywhere';
90
- const MUTED_MONO = 'font-family:var(--mono);font-size:12px;color:var(--muted-foreground);overflow-wrap:anywhere';
91
- const BADGE = 'font-family:var(--sans);font-size:11px;font-weight:500;border:1px solid var(--border);border-radius:999px;'
92
- + 'padding:0 8px;line-height:18px;white-space:nowrap;color:var(--foreground)';
93
- const BADGE_W = BADGE + ';border-color:transparent;background:color-mix(in oklab, var(--warning) 16%, transparent);color:var(--warning)';
94
- const BADGE_S = BADGE + ';border-color:transparent;background:color-mix(in oklab, var(--success) 16%, transparent);color:var(--success)';
95
- /* An option card: the board's `.opt`, with its radio mark. */
96
- const OPT = 'display:flex;gap:12px;align-items:flex-start;width:100%;box-sizing:border-box;text-align:left;'
97
- + 'padding:12px 14px;border-radius:10px;border:1px solid var(--border);background:transparent;color:var(--foreground);'
98
- + 'font-family:var(--sans);font-size:13px';
99
- const OPT_ON = OPT + ';border-color:var(--brand);background:color-mix(in oklab, var(--brand) 8%, transparent)';
100
- const RADIO = 'flex:none;width:16px;height:16px;margin-top:2px;box-sizing:border-box;border-radius:50%;border:1px solid var(--input)';
101
- const RADIO_ON = RADIO + ';border:5px solid var(--brand)';
102
-
103
- /* ── open / close ──────────────────────────────────────────────────────────────────────────── */
104
-
105
- /**
106
- * Open the pre-flight for `slug`. NOTHING is started and nothing is written to `extraSess` — that
107
- * is the entire difference from `newSession()`, which files the row and opens the tab up front.
108
- *
109
- * The name is seeded rather than imposed: `<slug> <n>` beats `agent <n>` because the tab bar shows
110
- * it and "agent 3" says nothing about which of three initiatives it is on. `n` counts past every
111
- * name the window can see, the same way `nextSessionName` does, so re-opening the form after a
112
- * reload does not propose a name that is already taken.
113
- */
114
- export function openNewSession(slug, seed) {
115
- if (!slug) return;
116
- const s = seed || {};
117
- setState({
118
- newSess: { slug },
119
- startPrompt: null, endConfirm: null,
120
- newSessName: s.name || proposeName(slug),
121
- newSessAgent: s.agent || 'shell',
122
- newSessBranch: '', newSessBranchNew: '', newSessBranchMode: false,
123
- newSessIsolate: null, newSessError: null, newSessBusy: false,
124
- // Cleared so a form opened on a DIFFERENT repository never shows the previous repo's branch
125
- // list while its own read is out — "reading the repository…" is true; a stale list is not.
126
- newSessBranches: null,
127
- // Cleared on the way IN as well as on the way out: a form that opened still showing the profile
128
- // a previous, abandoned question had chosen would be proposing an answer nobody gave.
129
- preflightProfile: s.profile === undefined ? null : s.profile,
130
- // the Settings defaults, for a Claude session (workspace-launch-flags)
131
- newSessFlags: (s.agent || 'shell') === 'claude' ? sessionDefaults().flags.map((x) => ({ ...x })) : [], newSessFlagFilter: '',
132
- });
133
- refreshReads();
134
- }
135
-
136
- /**
137
- * Close it, discarding what was typed. A cancelled question leaves no residue — and `preflightProfile`
138
- * is part of "no residue", not an exception to it.
139
- *
140
- * It used to survive the close, in a slot `+ session` also read, so a profile picked here and then
141
- * cancelled was filed onto the next one-click start and sent to the server as a spawn instruction.
142
- * The server refuses a descriptor it cannot resolve, so the click opened a terminal and wrote a
143
- * refusal into it for a session that was never started. Clearing it here is half the repair; the
144
- * other half is that `+ session` no longer reads this at all (panel-tabs.js).
145
- */
146
- export function closeNewSession() {
147
- setState({ newSess: null, newSessError: null, newSessBusy: false, preflightProfile: null, newSessFlags: [], newSessFlagFilter: '' });
148
- }
149
-
150
- export const isNewSessionOpen = () => !!state.newSess;
151
-
152
- /** The next free `<slug> <n>`, counted against every name this window can see. */
153
- function proposeName(slug) {
154
- const re = new RegExp('^' + slug.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + ' (\\d+)$');
155
- let max = 0;
156
- const bump = (name) => { const m = re.exec(String(name || '')); if (m) max = Math.max(max, Number(m[1])); };
157
- for (const x of (state.sessions || [])) bump(x && x.name);
158
- for (const k in (state.extraSess || {})) for (const x of (state.extraSess[k] || [])) bump(x && x.name);
159
- for (const t of (state.tabs || [])) if (t && t.kind === 'term') bump(t.sess);
160
- return slug + ' ' + (max + 1);
161
- }
162
-
163
- /* ── the two server reads ──────────────────────────────────────────────────────────────────── */
164
-
165
- /* Fired when the form opens, and again when the server says a branch moved. Both reads are
166
- * independent and each writes only its own key, so a repository with no git still gets its profile
167
- * chips and a machine with no profile directory still gets its branch picker.
168
- *
169
- * `readsFor` records WHICH open the reads were actually issued for. The lazy data.js import above
170
- * can land after the form opened — refreshReads then returned early and nothing ever retried, so
171
- * the form sat on "reading the repository…" for ever. The render path re-issues the reads once per
172
- * open (newSessionBlock); the token is what stops it re-fetching on every repaint. */
173
- let readsFor = null;
174
-
175
- function refreshReads() {
176
- if (FIXTURE || !dataMod) return;
177
- readsFor = state.newSess;
178
- const ws = state.wsId || null;
179
- if (typeof dataMod.loadBranches === 'function') {
180
- dataMod.loadBranches(ws).then((r) => setState({ newSessBranches: r || null })).catch(() => {});
181
- }
182
- if (typeof dataMod.loadClaudeFlags === 'function') {
183
- dataMod.loadClaudeFlags().then((r) => setState({ claudeFlags: r || null })).catch(() => {});
184
- }
185
- if (typeof dataMod.loadProfiles === 'function') {
186
- dataMod.loadProfiles().then((r) => {
187
- // the server's Claude default wins over this browser's copy (dock.js adoptProfileDefault)
188
- adoptProfileDefault(r);
189
- setState({ profiles: r || null });
190
- // Preselect from the server's remembered preference — never from a hardcoded name. A
191
- // preference naming a descriptor that no longer reads preselects NOTHING rather than
192
- // substituting another, which is the same rule the server applies to the preference itself.
193
- const live = (r && Array.isArray(r.profiles) ? r.profiles : []).map((p) => p && p.id);
194
- const own = state.newSessAgent === 'claude' ? sessionDefaults().profile : null;
195
- const pref = own && live.includes(own) ? own : (r && r.prefs ? r.prefs[state.newSessAgent] : null);
196
- if (pref && live.includes(pref) && !state.preflightProfile) setState({ preflightProfile: pref });
197
- }).catch(() => {});
198
- }
199
- }
200
-
201
- /* The `{t:'branch'}` broadcast lands in `state.branchInfo` (tab-term.js). When it names the
202
- * workspace this form is asking about, the picker's own read is stale and is taken again — this is
203
- * what stopped the retired composer's picker going stale after a checkout made in a terminal. */
204
- let lastBranchAt = 0;
205
- function absorbBranchBroadcast() {
206
- const b = state.branchInfo;
207
- if (!b || !state.newSess) return;
208
- if (b.at === lastBranchAt) return;
209
- lastBranchAt = b.at;
210
- if (b.ws && state.wsId && b.ws !== state.wsId) return;
211
- // The broadcast carries a full branchInfo payload, so it is usable directly; the re-read is for
212
- // the fields a broadcast may not carry (worktree occupancy).
213
- setState({ newSessBranches: { ok: true, ...b } });
214
- refreshReads();
215
- }
216
-
217
- /* ── the branch picker ─────────────────────────────────────────────────────────────────────── */
218
-
219
- /**
220
- * The picker, or an honest line saying why there is none. Three outcomes, and they are three
221
- * different sentences on purpose — a folder with no git is not the same event as git failing, and
222
- * neither is the same as "the read has not come back yet".
223
- */
224
- function branchSection() {
225
- const info = state.newSessBranches;
226
- const out = [];
227
- // The board calls this "Where it works". The word `branch` stays its own text: suites read it.
228
- out.push(el('div', { style: LABEL, 'data-r29': 'where' }, el('span', null, 'where it works'), el('span', null, ' · '), el('span', null, 'branch')));
229
-
230
- if (FIXTURE) {
231
- out.push(el('div', { style: SUB }, 'fixture mode reads no repository — a session started here applies no branch'));
232
- return out;
233
- }
234
- if (!info) {
235
- out.push(el('div', { style: SUB }, 'reading the repository…'));
236
- return out;
237
- }
238
- if (info.ok === false) {
239
- /* `code` distinguishes the two. A folder that is not a repository is a normal, calm fact and
240
- * the control is simply absent. A git error is NOT calm: it is said in warn colour with git's
241
- * own words, because "no branch control" would otherwise read as "no git here" and the PM would
242
- * never learn their repository is unreadable. */
243
- const notRepo = info.code === 'not-a-repo' || /not a git repository/i.test(info.error || '');
244
- out.push(notRepo
245
- ? el('div', { style: SUB }, 'this repository is not a git working tree — a session starts here with no branch applied')
246
- : el('div', { style: WARN }, iv('the branch list could not be read — ' + (info.error || 'git gave no reason'))));
247
- return out;
248
- }
249
-
250
- const current = info.current || info.branch || null;
251
- const branches = Array.isArray(info.branches) ? info.branches : [];
252
- /* A branch checked out in ANOTHER working tree is a branch git will refuse to check out here.
253
- * Offering it and letting the server say no would be technically honest and practically rude:
254
- * the PM would meet the refusal after the click. It is shown, named with where it is, and
255
- * disabled. */
256
- const elsewhere = new Map();
257
- for (const w of (Array.isArray(info.worktrees) ? info.worktrees : [])) {
258
- if (!w || !w.branch || w.branch === current) continue;
259
- if (!elsewhere.has(w.branch)) elsewhere.set(w.branch, w.dir || 'another working tree');
260
- }
261
-
262
- const pick = (v) => setState({ newSessBranch: v, newSessBranchMode: false, newSessError: null });
263
- /* The sessions already running in this folder, read from the same list isolateNow reads. The
264
- * board's "Shared with 1 running session" is this count; nothing else is claimed about them. */
265
- const sharing = (state.sessions || []).filter((x) => x && x.ws === state.wsId && x.state !== 'exited');
266
- const stayOn = state.newSessBranch === '' && !state.newSessBranchMode;
267
- // ALWAYS first and ALWAYS the default: starting a session must never require a git decision.
268
- out.push(optionCard({
269
- on: stayOn, onClick: () => pick(''), hook: 'opt-current',
270
- title: 'stay on current' + (current ? ' (' + current + ')' : ''),
271
- meta: current ? '⎇ ' + current : null,
272
- sub: sharing.length
273
- ? 'Shared with ' + sharing.length + ' running session' + (sharing.length === 1 ? '' : 's') + ': '
274
- + sharing.map((x) => x.name || x.id).filter(Boolean).slice(0, 3).join(', ') + '.'
275
- : 'No other session runs in this folder now.',
276
- badge: sharing.length ? ['they can overwrite each other', BADGE_W] : null,
277
- }));
278
- const chips = [];
279
- for (const b of branches) {
280
- if (b === current) continue;
281
- const taken = elsewhere.get(b);
282
- /* A branch already open in another working tree cannot be checked out twice, but it CAN be worked
283
- * in: the chip starts a session in that tree. It used to be a disabled chip, so the folder the PM
284
- * already had was the one place they could not start. */
285
- const treeOf = taken && dataMod && typeof dataMod.productTrees === 'function'
286
- ? dataMod.productTrees(state.product).find((t) => t.branch === b && !t.main) : null;
287
- chips.push(taken
288
- ? (treeOf
289
- ? el('button', {
290
- onClick: () => { closeNewSession(); startHere(state.product, treeOf); },
291
- title: 'this branch is already open in ' + taken + ' — start the session there',
292
- style: CHIP, hover: HOVER, 'data-r14': 'open-worktree',
293
- }, iv(b + ' — open that worktree'))
294
- : el('button', {
295
- disabled: true, title: 'git will not check this out twice — it is already in ' + taken,
296
- style: CHIP_DEAD,
297
- }, iv(b + ' — in ' + shortPath(taken))))
298
- : el('button', {
299
- onClick: () => pick(b),
300
- style: state.newSessBranch === b && !state.newSessBranchMode ? CHIP_ON : CHIP, hover: HOVER,
301
- }, iv(b)));
302
- }
303
- if (chips.length) {
304
- out.push(el('div', { style: SUB }, 'Or move this folder to another branch:'));
305
- out.push(el('div', { style: ROW, 'data-r29': 'branches' }, chips));
306
- }
307
- out.push(optionCard({
308
- on: !!state.newSessBranchMode, hook: 'opt-new',
309
- onClick: () => setState({ newSessBranchMode: true, newSessBranch: '', newSessError: null }),
310
- title: '+ new branch…',
311
- sub: 'Creates a branch from the current one. Choose below if it gets its own folder.',
312
- }));
313
-
314
- if (state.newSessBranchMode) {
315
- out.push(el('div', { style: ROW },
316
- el('input', {
317
- value: state.newSessBranchNew, placeholder: 'initiative/my-branch', style: INPUT,
318
- // Written straight onto the state object WITHOUT a render: a repaint between keystrokes
319
- // rebuilds the input and takes the caret with it. Same contract as panel-detail's newField.
320
- onInput: (e) => { state.newSessBranchNew = e.target.value; },
321
- onChange: () => setState({}),
322
- }),
323
- ));
324
- }
325
-
326
- // Isolation is only a question once a branch is actually being changed. Asked about a session
327
- // that is staying put, it would be a checkbox with no meaning.
328
- if (state.newSessBranchMode || state.newSessBranch) {
329
- const on = isolateNow();
330
- out.push(el('div', { style: ROW, 'data-r29': 'isolate' },
331
- el('button', {
332
- onClick: () => setState({ newSessIsolate: !on }),
333
- style: on ? CHIP_ON : CHIP, hover: HOVER,
334
- }, iv((on ? '☑' : '☐') + ' its own folder (worktree)')),
335
- el('span', { style: on ? BADGE_S : BADGE_W }, iv(on ? 'isolated' : 'shared folder')),
336
- el('span', { style: SUB }, iv(on
337
- ? 'the branch is checked out in a new folder — sessions already running are untouched'
338
- : 'this repository is switched to that branch — every session already in it moves too')),
339
- ));
340
- }
341
- return out;
342
- }
343
-
344
- /** The board's option card: a radio mark, a bold title, a mono aside, a muted line and a badge. The
345
- * title is its own span, so a reader of the panel's text still finds it as one item. */
346
- function optionCard({ on, onClick, hook, title, meta, sub, badge }) {
347
- return el('button', { onClick, style: on ? OPT_ON : OPT, hover: on ? null : HOVER, 'data-r29': hook, 'data-on': on ? 'yes' : 'no' },
348
- el('span', { style: on ? RADIO_ON : RADIO }),
349
- el('span', { style: 'display:flex;flex-direction:column;gap:2px;min-width:0' },
350
- el('span', { style: 'display:flex;gap:8px;align-items:baseline;flex-wrap:wrap' },
351
- el('b', { style: 'font-weight:600' }, iv(title)),
352
- meta ? el('span', { style: MUTED_MONO }, iv(meta)) : null),
353
- sub ? el('span', { style: SUB }, iv(sub)) : null,
354
- badge ? el('span', { style: 'margin-top:4px' }, el('span', { style: badge[1] }, iv(badge[0]))) : null));
355
- }
356
-
357
- const shortPath = (p) => { const s = String(p || ''); const i = s.lastIndexOf('/'); return i < 0 ? s : s.slice(i + 1); };
358
-
359
- /** What the isolate checkbox currently reads — the PM's choice if they made one, else the server's
360
- * own rule (protect other sessions when there are other sessions to protect), computed here so the
361
- * box shows what will actually be sent rather than an unchecked default that means something else. */
362
- function isolateNow() {
363
- if (state.newSessIsolate !== null && state.newSessIsolate !== undefined) return state.newSessIsolate;
364
- const ws = state.wsId;
365
- const live = (state.sessions || []).filter((s) => s && s.ws === ws && s.state !== 'exited');
366
- return live.length > 0;
367
- }
368
-
369
- /* ── the model chips (D75) ──────────────────────────────────────────────────────────────────
370
- * · only a Claude session has a model control PMOS has checked, so only it is offered a choice;
371
- * · `auto` sends nothing: the server routes by the policy, or asks for no model at all;
372
- * · the chips say what the PM is choosing (a tier), never a model name that will age. */
373
- function modelSection() {
374
- if (state.newSessAgent !== 'claude') {
375
- return el('div', { 'data-r12': 'model-note', style: SUB }, iv('model: only a Claude session can be given a model by PMOS — a shell, or any other CLI, runs its own default'));
376
- }
377
- const cur = state.newSessTier || 'auto';
378
- return el('div', { 'data-r12': 'model' },
379
- el('div', { style: LABEL }, 'model'),
380
- el('div', { style: ROW },
381
- ['auto', 'fast', 'balanced', 'deep'].map((t) => el('button', {
382
- 'data-r12': 'tier-' + t,
383
- onClick: () => setState({ newSessTier: t, newSessError: null }),
384
- style: cur === t ? CHIP_ON : CHIP, hover: HOVER,
385
- }, iv(t))),
386
- el('span', { style: SUB }, cur === 'auto'
387
- ? 'auto: PMOS asks for no model unless your policy routes this work to one'
388
- : 'a ' + cur + ' tier — the model and effort it maps to are in your models policy')));
389
- }
390
-
391
- /* ── agent change ──────────────────────────────────────────────────────────────────────────────
392
- * The remembered default is per agent, so a different agent preselects its own — but only when the PM has
393
- * not chosen something else since the form opened. Launch flags belong to a claude session; leaving
394
- * claude clears them rather than carrying them silently to a binary that may not know them. */
395
- function defaultFor(agent) {
396
- const p = state.profiles;
397
- const live = (p && Array.isArray(p.profiles) ? p.profiles : []).map((x) => x && x.id);
398
- // Settings holds the Claude default; the server's per-agent memory covers every other agent
399
- const fromSettings = agent === 'claude' ? sessionDefaults().profile : null;
400
- if (fromSettings && live.includes(fromSettings)) return fromSettings;
401
- const pref = p && p.prefs ? p.prefs[agent] : null;
402
- return pref && live.includes(pref) ? pref : null;
403
- }
404
- function pickAgent(a) {
405
- const before = state.newSessAgent;
406
- const untouched = !state.preflightProfile || state.preflightProfile === defaultFor(before);
407
- setState({
408
- newSessAgent: a, newSessError: null,
409
- ...(untouched ? { preflightProfile: defaultFor(a) } : {}),
410
- ...(a !== 'claude' ? { newSessFlags: [] } : (before !== 'claude' && !(state.newSessFlags || []).length ? { newSessFlags: sessionDefaults().flags.map((x) => ({ ...x })) } : {})),
411
- });
412
- }
413
-
414
- /** Remember the chosen profile (or “no profile”) as this agent's default for the next form. */
415
- async function setDefault() {
416
- if (!dataMod || typeof dataMod.preferProfile !== 'function') return;
417
- const r = await dataMod.preferProfile(state.newSessAgent || 'shell', state.preflightProfile === undefined ? null : state.preflightProfile);
418
- if (!r || !r.ok) { setState({ newSessError: (r && r.error) || 'the default could not be saved' }); return; }
419
- // the Claude default is one default: Settings and a dock start read it too, so they follow this choice
420
- if ((state.newSessAgent || 'shell') === 'claude') setSessionDefaults({ profile: state.preflightProfile || null });
421
- setState((s) => ({ newSessError: null, profiles: s.profiles ? { ...s.profiles, prefs: r.prefs || {} } : s.profiles }));
422
- }
423
-
424
- /* ── the launch flags ───────────────────────────────────────────────────────────────────────────
425
- * Every flag `claude --help` lists, from the server's generated file. A flag PMOS answers itself
426
- * (--model, --worktree, --name …) or one that needs --print is shown, greyed, with the reason — never
427
- * silently missing and never sendable. A flag that takes a value gets an input once it is switched on. */
428
- function flagsSection() {
429
- if (state.newSessAgent !== 'claude') {
430
- return el('div', { 'data-flags': 'note', class: 'fr-fp-sub' }, iv('launch flags: only a Claude session takes flags — a shell, or any other CLI, starts as it is'));
431
- }
432
- const chosen = state.newSessFlags || [];
433
- const r = state.claudeFlags;
434
- const missing = r ? flagsMissingValue(r, chosen) : [];
435
- return el('div', { class: 'fr-fp-stack', 'data-flags': 'section' },
436
- el('div', { class: 'fr-fp-label' }, 'launch flags'),
437
- el('div', { class: 'fr-fp-sub', 'data-flags': 'summary' }, iv(chosen.length
438
- ? 'will start with: claude ' + flagsLine(chosen)
439
- : 'none chosen — claude starts with its own defaults' + (r && r.cli_version ? '. From claude ' + r.cli_version + ' --help.' : ''))),
440
- missing.length ? el('div', { class: 'fr-fp-warn', 'data-flags': 'missing' }, iv(missing[0] + ' needs a value before the session can start.')) : null,
441
- flagPicker({ list: r, chosen, filter: state.newSessFlagFilter,
442
- onChange: (next) => setState({ newSessFlags: next, newSessError: null }),
443
- onFilter: (q) => setState({ newSessFlagFilter: q }) }));
444
- }
445
-
446
- /* ── the profile chips ─────────────────────────────────────────────────────────────────────── */
447
-
448
- /**
449
- * Ported from `renderProfileChips` (app.js:1655) for its three honesty branches, which are the
450
- * whole reason this is not just a list:
451
- * · a FAILED read offers only `no profile`, and says why in the server's own words;
452
- * · a BROKEN descriptor is named, marked, and NOT offered — while every good chip beside it
453
- * still is, because one bad file must not turn the surface into a stated absence;
454
- * · `absent` ("the directory does not exist") reads differently from a read that found none.
455
- */
456
- function profileSection() {
457
- const out = [el('div', { style: LABEL }, 'profile')];
458
- const p = state.profiles;
459
-
460
- const chipFor = (id, label) => el('button', {
461
- onClick: () => setState({ preflightProfile: id, newSessError: null }),
462
- style: state.preflightProfile === id ? CHIP_ON : CHIP, hover: HOVER,
463
- }, iv(label || id));
464
-
465
- // `no profile` is a REAL choice, not the absence of one: it is sent as `profile: null`, which the
466
- // server distinguishes from a client that forgot the field.
467
- const none = chipFor(null, 'no profile');
468
-
469
- if (FIXTURE) {
470
- const list = (FX.PROFILES || []).map((x) => x && x.id).filter(Boolean);
471
- out.push(el('div', { style: ROW }, none, list.map((id) => chipFor(id))));
472
- return out;
473
- }
474
- if (!p) { out.push(el('div', { style: SUB }, 'reading the profile descriptors…')); return out; }
475
-
476
- if (p.ok === false || p.error) {
477
- out.push(el('div', { style: ROW }, none));
478
- out.push(el('div', { style: WARN },
479
- iv('the profile descriptors could not be read — ' + (p.error || 'no reason given')
480
- + '. Only “no profile” is offered; PMOS will not name a descriptor it did not read.')));
481
- return out;
482
- }
483
-
484
- const good = Array.isArray(p.profiles) ? p.profiles : [];
485
- const broken = Array.isArray(p.broken) ? p.broken : [];
486
- out.push(el('div', { style: ROW },
487
- none,
488
- good.map((x) => chipFor(x.id, x.id)),
489
- // Shown and withheld in the same breath. An unusable descriptor that simply vanished would
490
- // leave the PM wondering where their profile went.
491
- broken.map((b) => el('button', { disabled: true, style: CHIP_BAD, title: b.error },
492
- iv((b.file || '?').replace(/\.json$/, '') + ' — unusable'))),
493
- ));
494
-
495
- {
496
- const agent = state.newSessAgent || 'shell';
497
- const def = defaultFor(agent);
498
- const chosen = state.preflightProfile || null;
499
- out.push(el('div', { class: 'fr-fp-defrow', 'data-profile': 'default' },
500
- button({
501
- label: chosen === def ? 'default for ' + agent : 'make ' + (chosen || 'no profile') + ' the default for ' + agent,
502
- icon: chosen === def ? 'check' : undefined, size: 'sm', onClick: () => setDefault(), disabled: chosen === def,
503
- attrs: { 'data-profile-default': 'set' },
504
- }),
505
- el('span', { class: 'fr-fp-sub' }, iv(def
506
- ? 'new ' + agent + ' sessions start with “' + def + '” unless you pick another here'
507
- : 'no default is set — new ' + agent + ' sessions start with no profile'))));
508
- }
509
-
510
- if (p.absent && !good.length) {
511
- out.push(el('div', { style: SUB }, iv('no profile directory at ' + (p.dir || '?')
512
- + ' — nothing was read, so nothing is offered but “no profile”')));
513
- } else if (!good.length && !broken.length) {
514
- out.push(el('div', { style: SUB }, iv((p.dir || 'the profile directory') + ' was read and holds no descriptors')));
515
- }
516
- const seen = good.filter((x) => x && x.detected);
517
- if (seen.length) {
518
- out.push(el('div', { class: 'fr-fp-sub', 'data-profile': 'detected' }, iv(seen.map((x) => x.id).join(', ')
519
- + (seen.length === 1 ? ' was' : ' were') + ' found from your shell commands or config folders — a session under '
520
- + (seen.length === 1 ? 'it' : 'one') + ' sets only CLAUDE_CONFIG_DIR')));
521
- }
522
- if (broken.length) {
523
- out.push(el('div', { style: WARN },
524
- iv(broken.length + ' descriptor' + (broken.length === 1 ? '' : 's') + ' could not be parsed and '
525
- + (broken.length === 1 ? 'is' : 'are') + ' not offered: '
526
- + broken.map((b) => b.file + ' (' + b.error + ')').join(' · '))));
527
- }
528
- return out;
529
- }
530
-
531
- /* ── starting ──────────────────────────────────────────────────────────────────────────────── */
532
-
533
- /**
534
- * THE INVERSION. Ask first; open only on an answer that said yes.
535
- *
536
- * Every early exit and every failure path here leaves the surface exactly as it found it. There is
537
- * deliberately no `finally` that opens a tab, no `catch` that assumes success, and no best-effort
538
- * write to `extraSess` before the await — the previous implementation's `try { … } catch {}` around
539
- * the real start, with the tab already open, is the shape being removed.
540
- */
541
- async function onStart() {
542
- if (state.newSessBusy) return; // one request per press; the button also disables
543
- const open = state.newSess;
544
- if (!open) return;
545
- const slug = open.slug;
546
- const name = String(state.newSessName || '').trim() || proposeName(slug);
547
- const createBranch = !!state.newSessBranchMode;
548
- const branch = createBranch ? String(state.newSessBranchNew || '').trim() : (state.newSessBranch || null);
549
-
550
- if (createBranch && !branch) {
551
- setState({ newSessError: 'name the new branch, or choose “stay on current”' });
552
- return;
553
- }
554
-
555
- /* FIXTURE MODE FILES THE ROW AND OPENS THE TAB WITH NO REQUEST AT ALL.
556
- *
557
- * That is not a shortcut around R1, it is R1's premise: in fixture mode there is no server, so
558
- * "did the server accept?" is not a question that exists to be answered honestly. The offline
559
- * demo path must make no network call — it is what lets no-network.test.js and the design
560
- * comparator trust a fixture run — and a form that could never complete there would be a dead
561
- * control in the only mode the comparator ever sees. The refusal contract is a REAL-MODE
562
- * contract and is asserted in real mode (pm-term-test.js).
563
- */
564
- if (FIXTURE) {
565
- const sess = { name, st: 'working', label: 'working', profile: state.preflightProfile || null,
566
- branch: branch || null };
567
- setState((s) => ({
568
- // The question is over, so its answer is discarded with it — see closeNewSession.
569
- newSess: null, newSessBusy: false, newSessError: null, preflightProfile: null,
570
- extraSess: { ...s.extraSess, [slug]: [...(s.extraSess[slug] || []), sess] },
571
- }), () => openTermTab(slug, sess));
572
- return;
573
- }
574
-
575
- if (!termMod || typeof termMod.requestSpawn !== 'function') {
576
- setState({ newSessError: 'the terminal module has not loaded — nothing was started' });
577
- return;
578
- }
579
-
580
- const missingVal = state.newSessAgent === 'claude' && state.claudeFlags ? flagsMissingValue(state.claudeFlags, state.newSessFlags) : [];
581
- if (missingVal.length) { setState({ newSessError: missingVal[0] + ' needs a value, or switch it off — nothing was started' }); return; }
582
-
583
- setState({ newSessBusy: true, newSessError: null });
584
- const res = await termMod.requestSpawn({
585
- name,
586
- agent: state.newSessAgent || 'shell',
587
- ws: state.wsId || null,
588
- initiative: slug || undefined,
589
- branch: branch || null,
590
- createBranch,
591
- // Sent explicitly, ALWAYS, and only when a branch is in play — the server defaults an omitted
592
- // value from liveSessionCount, and its own comment asks the client to state what the PM saw.
593
- isolate: branch ? isolateNow() : null,
594
- profile: state.preflightProfile === undefined ? null : state.preflightProfile,
595
- // D75 — only for a Claude session; 'auto' sends nothing and lets the policy route.
596
- flags: state.newSessAgent === 'claude' ? flagsWire(state.newSessFlags) : undefined,
597
- tier: (state.newSessAgent === 'claude' && state.newSessTier && state.newSessTier !== 'auto') ? state.newSessTier : undefined,
598
- });
599
-
600
- if (!res || !res.ok) {
601
- /* THE REFUSAL PATH. The form stays open, the server's sentence is shown in it, and NOTHING was
602
- * created: no tab, no pane, no xterm, no extraSess row. This is the assertion the rubric makes
603
- * a veto. */
604
- setState({ newSessBusy: false, newSessError: (res && res.error) || 'the workspace server refused, without saying why' });
605
- return;
606
- }
607
-
608
- /* Accepted. Only now does anything appear. The session record carries the SERVER's id, so the tab
609
- * opened from it attaches to precisely this PTY — `bind()` returns at its first line and never
610
- * reaches the fallback spawn, so one press cannot produce two sessions. */
611
- const sess = {
612
- name, st: 'working', label: 'working',
613
- profile: state.preflightProfile || null,
614
- branch: branch || null,
615
- id: res.id,
616
- };
617
- setState((s) => ({
618
- // `sess` above already carries the profile; the slot is cleared with the question it answered,
619
- // so the next `+ session` cannot inherit it. See closeNewSession.
620
- newSess: null, newSessBusy: false, newSessError: null, preflightProfile: null,
621
- extraSess: { ...s.extraSess, [slug]: [...(s.extraSess[slug] || []), sess] },
622
- }), () => {
623
- openTermTab(slug, sess);
624
- // The server's non-fatal truth about what it just did — a worktree's path, "not a git
625
- // repository, so no branch was applied". It travelled with the acceptance and is written into
626
- // the pane it is about, rather than being dropped because the request succeeded.
627
- if (res.notice && termMod && typeof termMod.noteOnTab === 'function') {
628
- termMod.noteOnTab('term:' + slug + ':' + name, 'pmos: ' + res.notice);
629
- }
630
- });
631
- if (dataMod && typeof dataMod.startSession === 'function') {
632
- try { dataMod.startSession(slug, sess); } catch { /* the poll is a refresh, not the start */ }
633
- }
634
- }
635
-
636
- /* ── render ────────────────────────────────────────────────────────────────────────────────── */
637
-
638
- /** The pre-flight block, or null when it is closed. Called from panel-tabs.js's render. */
639
- export function newSessionBlock() {
640
- if (!state.newSess) return null;
641
- // The reads this open still owes — issued here when data.js resolved after openNewSession ran.
642
- if (!FIXTURE && dataMod && readsFor !== state.newSess) refreshReads();
643
- absorbBranchBroadcast();
644
- const slug = state.newSess.slug;
645
- const busy = !!state.newSessBusy;
646
-
647
- const badges = [slug, state.product && state.product !== slug ? state.product : null, state.newSessAgent || 'shell']
648
- .filter(Boolean).map((b) => el('span', { style: BADGE }, iv(b)));
649
-
650
- return el('div', { style: BACKDROP, 'data-r29': 'newsess' },
651
- el('div', { style: WRAP, role: 'dialog', 'aria-label': 'New session', 'data-board': 'new-session' },
652
- el('div', { style: 'display:flex;justify-content:space-between;align-items:center;gap:8px' },
653
- el('span', { style: HEAD, 'data-r29': 'newsess-title' }, 'New session'),
654
- el('button', { onClick: () => closeNewSession(), style: CLOSE, hover: 'color:var(--foreground)', disabled: busy,
655
- 'aria-label': 'close', title: 'close without starting', 'data-r29': 'newsess-close' }, '×'),
656
- ),
657
- el('div', { style: 'display:flex;gap:8px;flex-wrap:wrap', 'data-r29': 'newsess-badges' }, badges),
658
- el('div', { style: 'display:flex;gap:8px;align-items:baseline;flex-wrap:wrap' },
659
- el('span', { style: TITLE }, 'start a session — more options'),
660
- el('span', { style: MUTED_MONO }, iv(slug)),
661
- ),
662
- el('div', { style: SUB },
663
- 'What this session runs, and where. + session does all of this in one click on the rule; '
664
- + 'this is for the times the rule is not what you want.'),
665
-
666
- el('div', { style: LABEL }, 'name'),
667
- el('div', { style: ROW },
668
- el('input', {
669
- value: state.newSessName, placeholder: slug + ' 1', style: INPUT, disabled: busy,
670
- onInput: (e) => { state.newSessName = e.target.value; },
671
- onChange: () => setState({}),
672
- }),
673
- ),
674
-
675
- el('div', { style: LABEL }, 'agent'),
676
- el('div', { style: ROW },
677
- ['shell', 'claude'].map((a) => el('button', {
678
- onClick: () => pickAgent(a),
679
- style: state.newSessAgent === a ? CHIP_ON : CHIP, hover: HOVER,
680
- }, iv(a))),
681
- el('span', { style: SUB }, 'a CLI that is not on PATH is refused by the server, and says so'),
682
- ),
683
-
684
- modelSection(),
685
- el('div', { class: 'fr-fp-stack', 'data-r29': 'newsess-flags' }, flagsSection()),
686
- el('div', { style: 'display:flex;flex-direction:column;gap:8px', 'data-r29': 'newsess-where' }, branchSection()),
687
- el('div', { style: 'display:flex;flex-direction:column;gap:8px', 'data-r29': 'newsess-profile' }, profileSection()),
688
-
689
- // The refusal, where the question was asked. It is rendered ABOVE the button so the PM reads it
690
- // before pressing again, and it survives until something changes.
691
- state.newSessError ? el('div', { style: ERR }, iv(state.newSessError)) : null,
692
-
693
- el('div', { style: SUB, 'data-r29': 'newsess-advice' },
694
- 'Nothing appears until the server says it started. If it refuses — an unreadable profile, a '
695
- + 'branch git will not check out — you will read the reason here and no session, tab or '
696
- + 'terminal will have been created.'),
697
-
698
- el('div', { style: 'display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;padding-top:2px', 'data-r29': 'newsess-actions' },
699
- el('button', { onClick: () => closeNewSession(), style: SECONDARY, hover: HOVER, disabled: busy }, 'cancel'),
700
- el('button', {
701
- onClick: () => { if (!busy) onStart(); },
702
- disabled: busy, style: busy ? PRIMARY_OFF : PRIMARY, hover: busy ? null : 'opacity:.9',
703
- }, busy ? 'starting…' : 'start session'),
704
- ),
705
- ),
706
- );
707
- }
708
-
709
- export default newSessionBlock;