create-pmos 0.399.0 → 0.401.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.
- package/package.json +30 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +2 -2
- package/workspace/briefing-premium-board-test.js +3 -3
- package/workspace/briefing-premium-doc-edit-test.js +2 -8
- package/workspace/briefing-premium-sources-test.js +2 -0
- package/workspace/briefing-premium-test.js +6 -2
- package/workspace/briefing-premium-work-test.js +9 -4
- package/workspace/c3-capture-test.js +0 -17
- package/workspace/changelog.json +29 -0
- package/workspace/guide/briefing-premium.md +2 -2
- package/workspace/guide/home.md +24 -3
- package/workspace/guide/layout.md +2 -2
- package/workspace/guide/notes.md +2 -2
- package/workspace/guide/phone-companion.md +1 -1
- package/workspace/lib/core-docs.js +2 -2
- package/workspace/lib/route-modules.js +1 -9
- package/workspace/lib/routes-phone-day.js +18 -9
- package/workspace/lib/routes-slash.js +95 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -2
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-term-test.js +0 -10
- package/workspace/premium-menu-rows-test.js +1 -1
- package/workspace/premium-phone-card-test.js +8 -3
- package/workspace/premium-vw-cal-test.js +4 -1
- package/workspace/premium-vw-doc-test.js +1 -8
- package/workspace/premium-work-depth-test.js +2 -3
- package/workspace/public/capture.html +23 -0
- package/workspace/public/pm/c3-base.js +47 -0
- package/workspace/public/pm/c3-capture.js +1 -1
- package/workspace/public/pm/c3-ini-ui.js +1 -1
- package/workspace/public/pm/c3-sheet.js +1 -1
- package/workspace/public/pm/c3-toast.js +1 -1
- package/workspace/public/pm/console3.css +3 -0
- package/workspace/public/pm/cozy-home.css +21 -6
- package/workspace/public/pm/cozy-today.css +4 -3
- package/workspace/public/pm/cozy-viewer.js +4 -2
- package/workspace/public/pm/cozy.css +9 -0
- package/workspace/public/pm/goal-chat.js +5 -1
- package/workspace/public/pm/home-app.js +65 -33
- package/workspace/public/pm/home-chat.js +34 -29
- package/workspace/public/pm/home-data.js +10 -2
- package/workspace/public/pm/home-dictate.js +7 -4
- package/workspace/public/pm/home-ini.js +13 -3
- package/workspace/public/pm/home-list.js +18 -10
- package/workspace/public/pm/home-more.js +2 -2
- package/workspace/public/pm/home-phone-card.js +9 -4
- package/workspace/public/pm/home-review.js +2 -3
- package/workspace/public/pm/home-today.js +11 -8
- package/workspace/public/pm/home-work.js +13 -8
- package/workspace/public/pm/note-dock.js +1 -2
- package/workspace/public/pm/notes-links.js +1 -2
- package/workspace/public/pm/notes-task.js +3 -4
- package/workspace/public/pm/premium-board.js +1 -1
- package/workspace/public/pm/premium-initiative-head.js +3 -3
- package/workspace/public/pm/premium-vw-doc.css +20 -2
- package/workspace/public/pm/premium-vw-doc.js +22 -7
- package/workspace/public/pm/premium-vw-item.css +6 -0
- package/workspace/public/pm/view-notes.js +2 -2
- package/workspace/replaced-tests.json +435 -0
- package/workspace/run-tests.js +323 -28
- package/workspace/server.js +15 -10
- package/workspace/test-files.json +4 -140
- package/workspace/test-lists/base.json +1 -2
- package/workspace/test-lists/c3-desktop-light-load.json +1 -2
- package/workspace/test-lists/c3-initiative-boards.json +1 -2
- package/workspace/test-lists/c3-meeting-focus.json +2 -12
- package/workspace/test-lists/c3-work-agent.json +1 -2
- package/workspace/test-lists/calendar-tidy-up.json +1 -2
- package/workspace/test-lists/console3-reports.json +1 -2
- package/workspace/test-lists/docs-three-way-sync.json +1 -2
- package/workspace/test-lists/extension-capture.json +5 -0
- package/workspace/test-lists/jira-wbs.json +1 -2
- package/workspace/test-lists/legacy-cleanup-a.json +9 -0
- package/workspace/test-lists/meeting-material.json +1 -2
- package/workspace/test-lists/meeting-notes.json +2 -36
- package/workspace/test-lists/meeting-replay.json +1 -2
- package/workspace/test-lists/mm-capture.json +2 -12
- package/workspace/test-lists/my-work.json +2 -10
- package/workspace/test-lists/onboarding-firstrun.json +2 -12
- package/workspace/test-lists/people-directory.json +1 -2
- package/workspace/test-lists/run2-a.json +1 -2
- package/workspace/test-lists/run2-d.json +2 -19
- package/workspace/test-lists/run3-b.json +1 -2
- package/workspace/test-lists/run3-c.json +2 -12
- package/workspace/test-lists/run4-b.json +1 -2
- package/workspace/test-lists/run4-d.json +1 -5
- package/workspace/test-lists/run5-c.json +1 -11
- package/workspace/test-lists/run6.json +1 -5
- package/workspace/test-lists/workspace-launch-flags.json +2 -12
- package/workspace/test-lists/workspace-profile-detection.json +2 -10
- package/workspace/test-timings.json +242 -123
- package/workspace/c3-briefing-test.js +0 -136
- package/workspace/c3-core-docs-test.js +0 -170
- package/workspace/c3-driver-fixture.js +0 -64
- package/workspace/c3-driver-test.js +0 -169
- package/workspace/c3-foundation-test.js +0 -163
- package/workspace/c3-ib-items-test.js +0 -114
- package/workspace/c3-ib-more-test.js +0 -146
- package/workspace/c3-ib-triage-backlog-test.js +0 -128
- package/workspace/c3-ini-harness.js +0 -66
- package/workspace/c3-ini-life-test.js +0 -167
- package/workspace/c3-initiatives-test.js +0 -186
- package/workspace/c3-light-load-test.js +0 -112
- package/workspace/c3-one-home-test.js +0 -149
- package/workspace/c3-phone-test.js +0 -289
- package/workspace/c3-quiet-test.js +0 -157
- package/workspace/c3-report-design-real-test.js +0 -264
- package/workspace/c3-report-design-test.js +0 -442
- package/workspace/c3-report-setup-test.js +0 -192
- package/workspace/c3-report-structure-real-test.js +0 -248
- package/workspace/c3-report-structure-test.js +0 -397
- package/workspace/c3-reports-test.js +0 -288
- package/workspace/c3-scan-test.js +0 -517
- package/workspace/c3-sessions-panel-test.js +0 -365
- package/workspace/c3-settings-test.js +0 -204
- package/workspace/c3-updates-test.js +0 -131
- package/workspace/c3-work-test.js +0 -260
- package/workspace/cut-stub.js +0 -40
- package/workspace/first-paint-audit.js +0 -160
- package/workspace/lib/c3-full-console.js +0 -15
- package/workspace/lib/engine/derived/trust.js +0 -3
- package/workspace/lib/engine/plan-forecast.js +0 -342
- package/workspace/lib/engine/report-families.js +0 -175
- package/workspace/lib/engine/truth-table.js +0 -57
- package/workspace/lib/routes-c3-init.js +0 -54
- package/workspace/lib/routes-c3-life.js +0 -120
- package/workspace/lib/routes-c3-timeline.js +0 -192
- package/workspace/lib/routes-forecast.js +0 -86
- package/workspace/lib/routes-releases.js +0 -130
- package/workspace/lib/routes-report-facts.js +0 -85
- package/workspace/lib/routes-report-families.js +0 -33
- package/workspace/lib/routes-signals.js +0 -51
- package/workspace/lib/routes-timeline.js +0 -197
- package/workspace/public/c3.html +0 -35
- package/workspace/public/index.html +0 -156
- package/workspace/public/pm/app.js +0 -831
- package/workspace/public/pm/bd-board.js +0 -159
- package/workspace/public/pm/bd-drag.js +0 -59
- package/workspace/public/pm/bd-model.js +0 -152
- package/workspace/public/pm/bd-timeline.js +0 -233
- package/workspace/public/pm/bd-tree.js +0 -244
- package/workspace/public/pm/board-copy.js +0 -59
- package/workspace/public/pm/board-read.js +0 -38
- package/workspace/public/pm/branches-sheet.js +0 -56
- package/workspace/public/pm/breakdown-api.js +0 -58
- package/workspace/public/pm/breakdown-copy.js +0 -138
- package/workspace/public/pm/briefing-deck.js +0 -441
- package/workspace/public/pm/briefing-model.js +0 -251
- package/workspace/public/pm/c3-ambient.js +0 -100
- package/workspace/public/pm/c3-audience-link.js +0 -21
- package/workspace/public/pm/c3-audience.js +0 -46
- package/workspace/public/pm/c3-boot.js +0 -13
- package/workspace/public/pm/c3-breakdown.js +0 -240
- package/workspace/public/pm/c3-brief-data.js +0 -11
- package/workspace/public/pm/c3-brief-mentions.js +0 -137
- package/workspace/public/pm/c3-brief-needs.js +0 -288
- package/workspace/public/pm/c3-brief-pulse.js +0 -112
- package/workspace/public/pm/c3-brief-summary.js +0 -139
- package/workspace/public/pm/c3-brief-today.js +0 -79
- package/workspace/public/pm/c3-brief.js +0 -279
- package/workspace/public/pm/c3-cal-strategy.js +0 -529
- package/workspace/public/pm/c3-calendar.js +0 -965
- package/workspace/public/pm/c3-calpop.js +0 -111
- package/workspace/public/pm/c3-case.js +0 -196
- package/workspace/public/pm/c3-core-docs.css +0 -18
- package/workspace/public/pm/c3-core-docs.js +0 -236
- package/workspace/public/pm/c3-daypart.js +0 -176
- package/workspace/public/pm/c3-demo-boards.js +0 -764
- package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
- package/workspace/public/pm/c3-demo-brief-page.js +0 -70
- package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
- package/workspace/public/pm/c3-demo-cal2.js +0 -66
- package/workspace/public/pm/c3-demo-cal3.js +0 -173
- package/workspace/public/pm/c3-demo-cal4.js +0 -169
- package/workspace/public/pm/c3-demo-cal5.js +0 -52
- package/workspace/public/pm/c3-demo-coredocs.js +0 -221
- package/workspace/public/pm/c3-demo-data.js +0 -552
- package/workspace/public/pm/c3-demo-focus.js +0 -181
- package/workspace/public/pm/c3-demo-init.js +0 -430
- package/workspace/public/pm/c3-demo-life.js +0 -77
- package/workspace/public/pm/c3-demo-material.js +0 -58
- package/workspace/public/pm/c3-demo-misc2.js +0 -34
- package/workspace/public/pm/c3-demo-phone.js +0 -48
- package/workspace/public/pm/c3-demo-plan2.js +0 -30
- package/workspace/public/pm/c3-demo-rd.js +0 -432
- package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
- package/workspace/public/pm/c3-demo-rep2.js +0 -130
- package/workspace/public/pm/c3-demo-rep3.js +0 -138
- package/workspace/public/pm/c3-demo-rs.js +0 -287
- package/workspace/public/pm/c3-demo-term.js +0 -153
- package/workspace/public/pm/c3-demo-time.js +0 -49
- package/workspace/public/pm/c3-demo-work-ix.js +0 -32
- package/workspace/public/pm/c3-demo.js +0 -131
- package/workspace/public/pm/c3-design-studio.js +0 -369
- package/workspace/public/pm/c3-doc-formats.js +0 -153
- package/workspace/public/pm/c3-doc-sheet.js +0 -1230
- package/workspace/public/pm/c3-dock.js +0 -206
- package/workspace/public/pm/c3-docs.js +0 -291
- package/workspace/public/pm/c3-driver-work.js +0 -110
- package/workspace/public/pm/c3-driver.css +0 -18
- package/workspace/public/pm/c3-driver.js +0 -298
- package/workspace/public/pm/c3-focus.css +0 -304
- package/workspace/public/pm/c3-focus.js +0 -983
- package/workspace/public/pm/c3-ib-docs.js +0 -92
- package/workspace/public/pm/c3-ib-initiatives.js +0 -201
- package/workspace/public/pm/c3-ib-items.js +0 -210
- package/workspace/public/pm/c3-ib-releases.js +0 -48
- package/workspace/public/pm/c3-ib-sprints.js +0 -201
- package/workspace/public/pm/c3-ib-triage.js +0 -177
- package/workspace/public/pm/c3-ii-tabs.js +0 -252
- package/workspace/public/pm/c3-ini-life.css +0 -34
- package/workspace/public/pm/c3-ini-life.js +0 -379
- package/workspace/public/pm/c3-ini-records.js +0 -197
- package/workspace/public/pm/c3-ini-timeline.js +0 -278
- package/workspace/public/pm/c3-ini-work.js +0 -139
- package/workspace/public/pm/c3-init-extras.js +0 -170
- package/workspace/public/pm/c3-initiatives.js +0 -852
- package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
- package/workspace/public/pm/c3-look.js +0 -27
- package/workspace/public/pm/c3-material.css +0 -22
- package/workspace/public/pm/c3-material.js +0 -321
- package/workspace/public/pm/c3-md.js +0 -3
- package/workspace/public/pm/c3-misc-panels.js +0 -89
- package/workspace/public/pm/c3-new-session.js +0 -110
- package/workspace/public/pm/c3-notes.js +0 -751
- package/workspace/public/pm/c3-phone-boot.js +0 -47
- package/workspace/public/pm/c3-phone-detail.js +0 -97
- package/workspace/public/pm/c3-phone-model.js +0 -3
- package/workspace/public/pm/c3-phone.css +0 -66
- package/workspace/public/pm/c3-phone.js +0 -444
- package/workspace/public/pm/c3-plan-panels.js +0 -163
- package/workspace/public/pm/c3-plan.js +0 -193
- package/workspace/public/pm/c3-quiet.css +0 -113
- package/workspace/public/pm/c3-quiet.js +0 -177
- package/workspace/public/pm/c3-replay.css +0 -133
- package/workspace/public/pm/c3-replay.js +0 -429
- package/workspace/public/pm/c3-report-deck.css +0 -163
- package/workspace/public/pm/c3-report-deck.js +0 -598
- package/workspace/public/pm/c3-report-frame.css +0 -20
- package/workspace/public/pm/c3-report-print.css +0 -20
- package/workspace/public/pm/c3-report-setup.css +0 -67
- package/workspace/public/pm/c3-report-setup.js +0 -298
- package/workspace/public/pm/c3-report-store.js +0 -244
- package/workspace/public/pm/c3-report-structure.css +0 -44
- package/workspace/public/pm/c3-report-structure.js +0 -473
- package/workspace/public/pm/c3-reports.css +0 -68
- package/workspace/public/pm/c3-reports.js +0 -377
- package/workspace/public/pm/c3-roadmap.js +0 -249
- package/workspace/public/pm/c3-scan-api.js +0 -167
- package/workspace/public/pm/c3-scan-next.js +0 -248
- package/workspace/public/pm/c3-scan-setup.js +0 -313
- package/workspace/public/pm/c3-scan-words.js +0 -41
- package/workspace/public/pm/c3-scan.css +0 -74
- package/workspace/public/pm/c3-scan.js +0 -93
- package/workspace/public/pm/c3-session-chat.js +0 -103
- package/workspace/public/pm/c3-session-conv.js +0 -165
- package/workspace/public/pm/c3-session-term.js +0 -216
- package/workspace/public/pm/c3-settings.css +0 -85
- package/workspace/public/pm/c3-settings.js +0 -1045
- package/workspace/public/pm/c3-shell.js +0 -628
- package/workspace/public/pm/c3-signals.js +0 -196
- package/workspace/public/pm/c3-strategy-panels.js +0 -45
- package/workspace/public/pm/c3-swipe.js +0 -230
- package/workspace/public/pm/c3-terminal-data.js +0 -48
- package/workspace/public/pm/c3-terminal-edge.js +0 -91
- package/workspace/public/pm/c3-terminal-icons.js +0 -40
- package/workspace/public/pm/c3-terminal-results.js +0 -141
- package/workspace/public/pm/c3-terminal.js +0 -52
- package/workspace/public/pm/c3-tickets.js +0 -163
- package/workspace/public/pm/c3-timeline.js +0 -201
- package/workspace/public/pm/calendar-views.js +0 -1049
- package/workspace/public/pm/console3-lift.md +0 -220
- package/workspace/public/pm/cozy-home.js +0 -172
- package/workspace/public/pm/cozy-initiative.css +0 -138
- package/workspace/public/pm/cycle-review.js +0 -125
- package/workspace/public/pm/data.js +0 -1577
- package/workspace/public/pm/dest-board.js +0 -444
- package/workspace/public/pm/dest-docs.js +0 -530
- package/workspace/public/pm/dest-initiatives.js +0 -162
- package/workspace/public/pm/dest-mywork.js +0 -307
- package/workspace/public/pm/dest-notes.js +0 -537
- package/workspace/public/pm/dest-people.js +0 -449
- package/workspace/public/pm/dest-reports.js +0 -383
- package/workspace/public/pm/dest-settings.js +0 -601
- package/workspace/public/pm/dest-today.js +0 -267
- package/workspace/public/pm/display-word.js +0 -56
- package/workspace/public/pm/doc-editor.js +0 -473
- package/workspace/public/pm/doc-graph.js +0 -272
- package/workspace/public/pm/doc-health-panel.js +0 -110
- package/workspace/public/pm/doc-rail.js +0 -167
- package/workspace/public/pm/doc-remote.js +0 -180
- package/workspace/public/pm/dock-sessions.js +0 -472
- package/workspace/public/pm/dock.js +0 -216
- package/workspace/public/pm/fixture.js +0 -821
- package/workspace/public/pm/flag-picker.js +0 -104
- package/workspace/public/pm/frame-copy.js +0 -278
- package/workspace/public/pm/freshness-line.js +0 -149
- package/workspace/public/pm/handoff-box.js +0 -82
- package/workspace/public/pm/initiative-list.js +0 -235
- package/workspace/public/pm/initiative-sheet.js +0 -331
- package/workspace/public/pm/initiatives-api.js +0 -95
- package/workspace/public/pm/initiatives-copy.js +0 -287
- package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
- package/workspace/public/pm/initiatives-timeline.js +0 -410
- package/workspace/public/pm/initiatives-ui.js +0 -291
- package/workspace/public/pm/item-sheet.js +0 -268
- package/workspace/public/pm/keep-card.js +0 -204
- package/workspace/public/pm/lifecycle-lens-model.js +0 -246
- package/workspace/public/pm/lifecycle-lens.js +0 -276
- package/workspace/public/pm/lifecycle.js +0 -111
- package/workspace/public/pm/mobile.css +0 -366
- package/workspace/public/pm/mobile.js +0 -581
- package/workspace/public/pm/modes-live.js +0 -453
- package/workspace/public/pm/modes.js +0 -147
- package/workspace/public/pm/my-work-card.js +0 -51
- package/workspace/public/pm/my-work-data.js +0 -36
- package/workspace/public/pm/new-initiative-sheet.js +0 -169
- package/workspace/public/pm/next-step-ui.js +0 -190
- package/workspace/public/pm/outbox-panel.js +0 -125
- package/workspace/public/pm/palette-copy.js +0 -55
- package/workspace/public/pm/palette.js +0 -343
- package/workspace/public/pm/panel-breakdown.js +0 -702
- package/workspace/public/pm/panel-cockpit.js +0 -425
- package/workspace/public/pm/panel-detail.js +0 -1513
- package/workspace/public/pm/panel-initiatives.js +0 -929
- package/workspace/public/pm/panel-newsess.js +0 -709
- package/workspace/public/pm/panel-repos.js +0 -741
- package/workspace/public/pm/panel-tabs.js +0 -1506
- package/workspace/public/pm/panel-trees.js +0 -204
- package/workspace/public/pm/people-link.js +0 -106
- package/workspace/public/pm/phone-deck.js +0 -167
- package/workspace/public/pm/pm-work-view.js +0 -1533
- package/workspace/public/pm/portfolio-report.js +0 -61
- package/workspace/public/pm/premium-acts.js +0 -280
- package/workspace/public/pm/premium-brief.js +0 -111
- package/workspace/public/pm/premium-chat.js +0 -22
- package/workspace/public/pm/premium-doc-sheet.js +0 -312
- package/workspace/public/pm/premium-initiative.js +0 -324
- package/workspace/public/pm/premium-insights.css +0 -228
- package/workspace/public/pm/premium-metric-tiles.js +0 -68
- package/workspace/public/pm/premium-report-brief.js +0 -132
- package/workspace/public/pm/premium-vw-rec.js +0 -67
- package/workspace/public/pm/premium-wide.css +0 -30
- package/workspace/public/pm/print.css +0 -44
- package/workspace/public/pm/provider-cards.js +0 -136
- package/workspace/public/pm/registry.js +0 -203
- package/workspace/public/pm/release-card.js +0 -110
- package/workspace/public/pm/releases-view.js +0 -248
- package/workspace/public/pm/report-families-view.js +0 -505
- package/workspace/public/pm/report-slides.js +0 -438
- package/workspace/public/pm/report-tab.js +0 -33
- package/workspace/public/pm/report-view.js +0 -337
- package/workspace/public/pm/reports-copy.js +0 -134
- package/workspace/public/pm/roadmap.js +0 -294
- package/workspace/public/pm/run-card.js +0 -260
- package/workspace/public/pm/sessions-panel.js +0 -219
- package/workspace/public/pm/sheet-jira.js +0 -353
- package/workspace/public/pm/shell-bell.js +0 -163
- package/workspace/public/pm/shell-model.js +0 -83
- package/workspace/public/pm/shell-phone.js +0 -124
- package/workspace/public/pm/shell-readaloud.js +0 -53
- package/workspace/public/pm/shell-recording.js +0 -274
- package/workspace/public/pm/shell-ticker.js +0 -90
- package/workspace/public/pm/sig-watch.js +0 -41
- package/workspace/public/pm/slide-confirm.js +0 -163
- package/workspace/public/pm/slides-copy.js +0 -52
- package/workspace/public/pm/status-banner.js +0 -95
- package/workspace/public/pm/tab-doc.js +0 -859
- package/workspace/public/pm/tab-gone.js +0 -21
- package/workspace/public/pm/tab-term.js +0 -1210
- package/workspace/public/pm/tab-web.js +0 -90
- package/workspace/public/pm/timeline-copy.js +0 -48
- package/workspace/public/pm/timeline-forecast-view.js +0 -164
- package/workspace/public/pm/today-agenda.js +0 -331
- package/workspace/public/pm/today-cards.js +0 -244
- package/workspace/public/pm/today-copy.js +0 -506
- package/workspace/public/pm/today-day.js +0 -1371
- package/workspace/public/pm/today-goals.js +0 -297
- package/workspace/public/pm/today-jobs.js +0 -84
- package/workspace/public/pm/today-mentions.js +0 -50
- package/workspace/public/pm/topbar.js +0 -202
- package/workspace/public/pm/triage-card.js +0 -60
- package/workspace/public/pm/undo-hold.js +0 -103
- package/workspace/public/pm/view-addrepo.js +0 -208
- package/workspace/public/pm/view-files.js +0 -197
- package/workspace/public/pm/view-livenotes.js +0 -399
- package/workspace/public/pm/view-today.js +0 -13
- package/workspace/public/pm/view-validate.js +0 -171
- package/workspace/public/pm/welcome.js +0 -391
- package/workspace/public/pm/work-place.js +0 -68
- package/workspace/public/pm/xlsx-read.js +0 -117
- package/workspace/public/welcome.html +0 -22
- package/workspace/test-lists/browser-suites-green.json +0 -5
- package/workspace/test-lists/c3-core-docs.json +0 -9
- package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
- package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
- package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
- package/workspace/test-lists/c3-ib-items.json +0 -9
- package/workspace/test-lists/c3-ib-more.json +0 -9
- package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
- package/workspace/test-lists/c3-ini-life.json +0 -9
- package/workspace/test-lists/c3-meeting-board.json +0 -5
- package/workspace/test-lists/c3-meeting-card.json +0 -5
- package/workspace/test-lists/c3-notes-place.json +0 -5
- package/workspace/test-lists/c3-notes-series.json +0 -5
- package/workspace/test-lists/calendar-time-page.json +0 -5
- package/workspace/test-lists/calpop.json +0 -4
- package/workspace/test-lists/console3-briefing.json +0 -9
- package/workspace/test-lists/console3-foundation.json +0 -9
- package/workspace/test-lists/console3-work-page.json +0 -9
- package/workspace/test-lists/premium-brief-parity.json +0 -9
- package/workspace/test-lists/report-design-studio-ui.json +0 -5
- package/workspace/test-lists/report-structure-ui.json +0 -11
- package/workspace/test-lists/report-workspace-ui.json +0 -5
- package/workspace/test-lists/run3-a.json +0 -5
- package/workspace/test-lists/run3-d.json +0 -6
- package/workspace/test-lists/run4-c.json +0 -13
- package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
- package/workspace/test-lists/today-mentions-cards.json +0 -5
- package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/* pm/c3-terminal-edge.js — the "Edge cases" tab of agent-surfaces.html: each case shows the CLI event that triggers it, what you see, what you can do, and what
|
|
2
|
-
* happens if that fails. The cards are run-card.js cards over folded runs (scripts/card-state.js cardFor over reply lines; the rich results through the
|
|
3
|
-
* contract's own validators). EXAMPLE DATA, in real mode too: no run is attached, so a press answers "this is an example" and records nothing.
|
|
4
|
-
* mountEdge(host) disposeEdge(host)
|
|
5
|
-
* The mockup's twelve cases, plus a group for the agent's reply failing (the mockup's "Next reply" switch: no result, unreadable, crashed, quiet,
|
|
6
|
-
* unlabelled claim, plain text), so every failure state of the contract can be looked at. */
|
|
7
|
-
import { el } from './dom.js';
|
|
8
|
-
import { ic } from './c3-terminal-icons.js';
|
|
9
|
-
import { mountRunCard, disposeRunCard, openBtn } from './run-card.js';
|
|
10
|
-
import { mdNode } from './c3-terminal-results.js';
|
|
11
|
-
import { toast } from './c3-toast.js';
|
|
12
|
-
|
|
13
|
-
const TESTED = 'Logic tested';
|
|
14
|
-
const UNV = 'Logic tested · CLI behaviour unverified';
|
|
15
|
-
const CASES = [
|
|
16
|
-
{ g: 'The CLI asks you', id: 'q', name: 'Its own question', status: UNV, ev: 'PreToolUse on the question tool. The workspace holds the hook open, shows this, then denies the tool with your answer as the reason.', fb: 'If the hold fails, the hook denies at once and tells the agent to use the format; the question then arrives as a normal ask. If both fail: Open the session.' },
|
|
17
|
-
{ g: 'The CLI asks you', id: 'plan', name: 'Plan approval', status: UNV, ev: 'PermissionRequest for the plan-exit tool. The plan text arrives with it; allow or deny goes back.', fb: 'If the workspace is down the CLI shows its own approval in the terminal. Nothing is approved by default.' },
|
|
18
|
-
{ g: 'The CLI cannot continue', id: 'start', name: 'Not started', status: UNV, fail: 'notstarted', ev: 'No SessionStart hook within 10 seconds of launch. Usually a trust-folder or update prompt that only the terminal shows.', fb: 'Prevention: worktrees are made under a folder the CLI already trusts, and its auto-update is switched off for sessions (setting to be confirmed).' },
|
|
19
|
-
{ g: 'The CLI cannot continue', id: 'auth', name: 'Sign-in needed', status: UNV, fail: 'attention', ev: 'A notification of an attention type (dialog, sign-in). Only the terminal can show it.', fb: 'This is the lowest tier on purpose: the interface says what kind of thing it is and opens the real CLI.' },
|
|
20
|
-
{ g: 'The CLI cannot continue', id: 'pause', name: 'Usage limit', status: UNV, fail: 'pause', ev: 'A quota notification (auto-resume fired, stale or disabled). The run is paused, not failed.', fb: 'If the notice never comes, the quiet timer applies after 2 minutes and offers Open the session.' },
|
|
21
|
-
{ g: 'The CLI cannot continue', id: 'api', name: 'API error', status: UNV, fail: 'api', ev: 'The StopFailure hook: the turn ended on an API error.', fb: 'Retry is one tap. Three failures in a row stop retrying and offer Open the session.' },
|
|
22
|
-
{ g: 'The agent\'s reply fails', id: 'noresult', name: 'Ends with no result', status: TESTED, fail: 'noresult', ev: 'The Stop hook told the agent to report, twice. The session still ended with no result, question or reason.', fb: 'The card says so and keeps its content. Retry or Open the session; nothing on the card changed.' },
|
|
23
|
-
{ g: 'The agent\'s reply fails', id: 'rejected', name: 'Unreadable reply', status: TESTED, fail: 'rejected', ev: '`pmos reply result` refused the body (for example: headline is required). The agent is told why and can send it again.', fb: 'If it cannot, the run ends as "ended without a usable result" and the refusal is in the case file.' },
|
|
24
|
-
{ g: 'The agent\'s reply fails', id: 'crashed', name: 'Crashed', status: TESTED, fail: 'crashed', ev: 'SessionEnd with a non-zero exit code and no result.', fb: 'The card says it ended with an error. Retry or Open the session.' },
|
|
25
|
-
{ g: 'The agent\'s reply fails', id: 'quiet', name: 'Goes quiet', status: TESTED, fail: 'quiet', ev: 'No output for 2 minutes and no result. The quiet timer is the interface\'s own.', fb: 'It may be stuck. Open the session to see it.' },
|
|
26
|
-
{ g: 'The agent\'s reply fails', id: 'unlabelled', name: 'Unlabelled claim', status: TESTED, fail: 'unlabelled', ev: 'A claim with no valid label (fact needs a source, estimate needs a range). The strict command refuses it; the interface folds leniently as a second layer.', fb: 'The claim is kept and marked "unlabelled". It cannot back a message, and an unlabelled draft cannot be slid to send.' },
|
|
27
|
-
{ g: 'The agent\'s reply fails', id: 'prose', name: 'Plain text', status: TESTED, fail: 'prose', ev: 'The Stop hook\'s last assistant message, when no result was reported. Tier 2.', fb: 'Shown as unchecked text, never as a result. Ask again in the format, or Open the session.' },
|
|
28
|
-
{ g: 'Richer results', id: 'deck', name: 'Slides', status: TESTED, edge: 'deck', ev: 'A deck result: up to 20 slides, 6 bullets each. Pptx stays available as an export file with no preview.', fb: 'A bullet without a label is counted. The deck cannot be shared until none is left.' },
|
|
29
|
-
{ g: 'Richer results', id: 'tbl', name: 'Table', status: TESTED, edge: 'table', ev: 'A table result: up to 12 columns and 200 rows. More than that becomes a csv file.', fb: 'A row with the wrong number of cells rejects the whole table, and the agent is told why.' },
|
|
30
|
-
{ g: 'Richer results', id: 'dg', name: 'Diagram and image', status: TESTED, edge: 'diagram', ev: 'A diagram result (mermaid or svg) or a png, jpg or svg file. Drawn locally; no network, no scripts.', fb: 'An svg with a script, a handler, an external link or a foreignObject is refused with the reason. The agent gets the error and can resend.' },
|
|
31
|
-
{ g: 'Richer results', id: 'big', name: 'Long answer', status: TESTED, edge: 'file', ev: 'The reply command refuses a result over 8 KB and tells the agent to write a file. The agent fixes it on its own.', fb: 'If the agent cannot, the run ends as plain text (Tier 2) and you see the text.' },
|
|
32
|
-
{ g: 'Runs and history', id: 'sub', name: 'Helpers (subagents)', status: UNV, ev: 'SubagentStart and SubagentStop hooks. Only the helper type and whether it is running are kept.', fb: 'A helper\'s own text is never shown or trusted. Its work reaches you only through the parent\'s result.' },
|
|
33
|
-
{ g: 'Runs and history', id: 'ver', name: 'Resumed or newer format', status: TESTED, fail: 'format', ev: 'Every line carries a format number. A line newer than the workspace reads is ignored and counted. At every start, resume and compact, the CLI is given the reply instructions again.', fb: 'A run that cannot be read says so and offers Open the session. It is never shown half-read.' },
|
|
34
|
-
];
|
|
35
|
-
const stub = { demo: false, canPrompt: false, why: 'This is an example: no run is attached, so nothing is sent.', answer: async () => ({ ok: false, error: 'this is an example, no run is attached' }), correct: async () => ({ ok: false, error: 'this is an example, no run is attached' }), send: async () => ({ ok: false, error: 'this is an example' }) };
|
|
36
|
-
const ctxFor = (fx, id, name, card, extra) => ({ id: 'edge-' + id, name, card, src: stub, origin: 'example', refresh() {}, openSession: () => toast('In the real workspace this opens the CLI session.'), glossary: fx.glossary, fileBody: (p) => fx.edge.fileBody && fx.edge.fileBody[p], ...(extra || {}) });
|
|
37
|
-
|
|
38
|
-
function questionCase(fx, st) {
|
|
39
|
-
const qs = fx.edge.question.questions; const Q = st.q || (st.q = { a: [null, []], sent: false });
|
|
40
|
-
const draw = () => st.redraw();
|
|
41
|
-
const pill = (on, l, f) => el('button', { type: 'button', class: 'pill' + (on ? ' on' : ''), 'aria-pressed': String(on), onclick: f }, l);
|
|
42
|
-
const ready = Q.a[0] !== null && Q.a[1].length;
|
|
43
|
-
return el('div', { class: 'c3t-card' },
|
|
44
|
-
qs.map((q, qi) => el('div', { class: 'ask' }, el('b', null, q.q), q.multi ? dim('Pick any') : null, el('div', { class: 'c3t-tray' }, q.options.map((o, oi) => pill(qi === 0 ? Q.a[0] === oi : Q.a[1].includes(oi), o.label, () => { if (qi === 0) Q.a[0] = oi; else { const k = Q.a[1].indexOf(oi); if (k < 0) Q.a[1].push(oi); else Q.a[1].splice(k, 1); } draw(); }))))),
|
|
45
|
-
Q.sent ? el('div', { class: 'chips2' }, el('span', { class: 'chip2 ok' }, 'Sent to the CLI: ' + qs[0].options[Q.a[0]].label + ' · ' + Q.a[1].map((i) => qs[1].options[i].label).join(', ') + '. It will not ask again.'))
|
|
46
|
-
: el('div', { class: 'c3t-tray' }, dim('Two questions from the CLI'), el('span', { style: 'flex:1' }), el('button', { type: 'button', class: 'pill rec', disabled: !ready, onclick: () => { Q.sent = true; toast('Example: answered. In a run the CLI continues with your choices.'); draw(); } }, 'Answer')));
|
|
47
|
-
}
|
|
48
|
-
const dim = (t) => el('span', { class: 'dim mono', style: 'font-size:var(--fs-2)' }, t);
|
|
49
|
-
function planCase(fx, st) {
|
|
50
|
-
const P = st.p || (st.p = { sub: null, out: null }); const draw = () => st.redraw();
|
|
51
|
-
const set = (decision, note, label) => { P.out = label; toast('Example: counted as a correction would be.'); draw(); };
|
|
52
|
-
return el('div', { class: 'c3t-card' }, el('div', { class: 'top' }, el('span', { class: 'tg', style: '--tc:var(--acc)' }, 'Plan to approve'), dim('read-only run')), el('div', { class: 'c3t-file' }, el('div', { class: 'fb' }, mdNode(fx.edge.plan.plan))),
|
|
53
|
-
P.out ? el('div', { class: 'chips2' }, el('span', { class: 'chip2 ' + (P.out[0] === 'A' ? 'ok' : '') }, P.out))
|
|
54
|
-
: [el('div', { class: 'c3t-tray' }, el('button', { type: 'button', class: 'pill rec', onclick: () => { P.out = 'Approved: allowed in the CLI'; toast('Example: plan approved. The CLI continues.'); draw(); } }, ic('check', 'sm'), 'Approve'),
|
|
55
|
-
el('button', { type: 'button', class: 'pill' + (P.sub === 'r' ? ' on' : ''), onclick: () => { P.sub = P.sub === 'r' ? null : 'r'; draw(); } }, ic('edit', 'sm'), 'Revise'),
|
|
56
|
-
el('button', { type: 'button', class: 'pill' + (P.sub === 'x' ? ' on' : ''), onclick: () => { P.sub = P.sub === 'x' ? null : 'x'; draw(); } }, ic('x', 'sm'), 'Reject')),
|
|
57
|
-
P.sub === 'r' ? el('div', { class: 'c3t-tray' }, fx.moves.revise.map((m) => el('button', { type: 'button', class: 'pill', onclick: () => set('revise', m, 'Revise sent: "' + fx.edge.planReplies.revise.hookSpecificOutput.decision.message.replace('Make it shorter.', m) + '"') }, m))) : null,
|
|
58
|
-
P.sub === 'x' ? el('div', { class: 'c3t-tray' }, dim('Why?'), fx.moves.reject.map((m) => el('button', { type: 'button', class: 'pill', onclick: () => set('reject', m, 'Rejected sent: "The PM rejected the plan: ' + m + '."') }, m))) : null]);
|
|
59
|
-
}
|
|
60
|
-
function subCase() {
|
|
61
|
-
return el('div', { class: 'c3t-card' }, el('div', { class: 'c3t-run' }, el('div', { class: 'line' }, el('span', { class: 'c3spin' }, ic('run', 'sm')), el('span', { class: 't' }, 'Reading the plan with 2 helpers')),
|
|
62
|
-
el('div', { class: 'c3t-tray' }, el('span', { class: 'chip2' }, ic('check', 'sm'), 'Explore · done'), el('span', { class: 'chip2', style: 'color:var(--acc)' }, ic('run', 'sm'), 'Plan · working')), el('div', { class: 'prog' }, el('i', { class: 'd' }), el('i', { class: 'd' }), el('i'))));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function mountEdge(host, fx) {
|
|
66
|
-
disposeEdge(host);
|
|
67
|
-
const st = { cur: 'q', ui: {} };
|
|
68
|
-
const list = el('div', { class: 'elist', 'data-c3t': 'edge-list' }); const detail = el('div', { style: 'min-width:0', 'data-c3t': 'edge-detail' });
|
|
69
|
-
st.redraw = () => draw();
|
|
70
|
-
function draw() {
|
|
71
|
-
let last = '';
|
|
72
|
-
list.replaceChildren(...CASES.map((c) => [c.g !== last ? (last = c.g, el('div', { class: 'eyebrow eh' }, c.g)) : null, el('button', { type: 'button', 'aria-pressed': String(c.id === st.cur), 'data-edge': c.id, onclick: () => { st.cur = c.id; draw(); } }, c.name)]).flat().filter(Boolean));
|
|
73
|
-
const c = CASES.find((x) => x.id === st.cur);
|
|
74
|
-
let body;
|
|
75
|
-
const slot = el('div', { 'data-run-host': 'edge' });
|
|
76
|
-
if (c.id === 'q') body = questionCase(fx, st);
|
|
77
|
-
else if (c.id === 'plan') body = planCase(fx, st);
|
|
78
|
-
else if (c.id === 'sub') body = subCase();
|
|
79
|
-
else {
|
|
80
|
-
const rec = c.fail ? fx.fail[c.fail] : c.id === 'big' ? fx.edge.file : fx.edge[c.edge];
|
|
81
|
-
mountRunCard(slot, ctxFor(fx, c.id, c.name, rec.card, { observed: null }));
|
|
82
|
-
body = slot;
|
|
83
|
-
if (c.id === 'big') body = el('div', { class: 'c3t-bigwrap' }, el('div', { class: 'tm' }, el('div', { class: 'raw' }, 'pmos reply result --type evidence --file big.json'), el('div', { class: 'raw', style: 'color:var(--destructive)' }, 'error: result too large · hint: write it to a file in the run folder and send --type file'), el('div', { class: 'raw' }, 'pmos reply result --type file --media md --file outputs/r12/report.md')), slot, dim('You never saw the failed attempt. It is in the case file.'));
|
|
84
|
-
}
|
|
85
|
-
detail.replaceChildren(el('div', { class: 'node c3t-node' }, el('div', { class: 'top' }, el('b', { style: 'font-size:var(--fs-4)' }, c.name), el('span', { class: 'chip2 ' + (c.status === TESTED ? 'ok' : 'warn'), style: 'margin-left:auto' }, c.status)),
|
|
86
|
-
el('div', { class: 'dim mono' }, el('b', { style: 'color:var(--foreground)' }, 'CLI event'), ' · ' + c.ev), body, el('div', { class: 'dim mono' }, el('b', { style: 'color:var(--foreground)' }, 'If this fails'), ' · ' + c.fb)));
|
|
87
|
-
}
|
|
88
|
-
host.replaceChildren(el('div', { class: 'dim mono', style: 'font-size:var(--fs-2)' }, 'Example data, not from your runs. Each case shows the CLI event that triggers it, what you see, what you can do, and what happens if that fails.'), el('div', { class: 'c3t-edge' }, list, detail));
|
|
89
|
-
draw();
|
|
90
|
-
}
|
|
91
|
-
export function disposeEdge(host) { host.querySelectorAll('[data-run-host]').forEach((h) => { try { disposeRunCard(h); } catch { /* gone */ } }); host.replaceChildren(); }
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/* pm/c3-terminal-icons.js — the icon language of the agent surfaces, and the few glyphs the console3 sprite does not hold.
|
|
2
|
-
*
|
|
3
|
-
* Two glyphs, never swapped (the mockups draw them apart: agent-surfaces.html and terminal-layout.html):
|
|
4
|
-
* AGENT `bolt` (the mockup's i-bolt) the agent surfaces: sessions that need you, results to accept. Header button (with the needs-you badge) and the
|
|
5
|
-
* dock's "Agent surfaces" button. It also means "the agent acts" everywhere else on the page (swipe right, suggested move).
|
|
6
|
-
* TERMINAL `term` (`>_`) a real session's terminal: the dock rail button, a session's "Open the session" link, a session row's mark.
|
|
7
|
-
* AGENT = "the interface that reads sessions for you". TERMINAL = "the raw CLI session". A button shows one or the other, with its own tooltip.
|
|
8
|
-
*
|
|
9
|
-
* The extra symbols are the mockup's own paths (agent-surfaces.html lines 168 to 184), added once under the c3i- ids c3ic() reads. A symbol
|
|
10
|
-
* another module already added is not added again. */
|
|
11
|
-
import { c3ic } from './pm-work-view.js';
|
|
12
|
-
|
|
13
|
-
export const ICON = { agent: 'bolt', terminal: 'term' }; // the mockup's header Sessions pill draws the bolt glyph; the rail draws the terminal glyph
|
|
14
|
-
export const TIPS = {
|
|
15
|
-
agentHeader: (n) => (n ? 'Agent surfaces: ' + n + (n === 1 ? ' session needs you' : ' sessions need you') : 'Agent surfaces: sessions, results to accept, questions for you'),
|
|
16
|
-
agentDock: 'Agent surfaces: the full page of sessions that need you',
|
|
17
|
-
terminalOpen: 'Open the session: its real terminal, on this page',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const NS = 'http://www.w3.org/2000/svg';
|
|
21
|
-
const PATHS = {
|
|
22
|
-
edit: 'M4 20h4L19 9l-4-4L4 16zM13 7l4 4', book: 'M5 4h10a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3zM5 17a3 3 0 0 1 3-3h10', flip: 'M4 8h13l-3-3M20 16H7l3 3',
|
|
23
|
-
run: 'M12 3a9 9 0 1 0 9 9', pulse: 'M3 12h4l3-7 4 14 3-7h4', chev: 'm9 6 6 6-6 6', chevl: 'm15 6-6 6 6 6', chat: 'M4 5h16v11H9l-5 4z',
|
|
24
|
-
};
|
|
25
|
-
let done = false;
|
|
26
|
-
export function ensureTermIcons() {
|
|
27
|
-
if (done || typeof document === 'undefined') return;
|
|
28
|
-
done = true;
|
|
29
|
-
const missing = Object.keys(PATHS).filter((k) => !document.getElementById('c3i-' + k));
|
|
30
|
-
if (!missing.length) return;
|
|
31
|
-
const svg = document.createElementNS(NS, 'svg');
|
|
32
|
-
svg.setAttribute('width', '0'); svg.setAttribute('height', '0'); svg.setAttribute('aria-hidden', 'true'); svg.style.position = 'absolute';
|
|
33
|
-
for (const k of missing) {
|
|
34
|
-
const sym = document.createElementNS(NS, 'symbol'); sym.setAttribute('id', 'c3i-' + k); sym.setAttribute('viewBox', '0 0 24 24');
|
|
35
|
-
const p = document.createElementNS(NS, 'path'); p.setAttribute('d', PATHS[k]); sym.appendChild(p); svg.appendChild(sym);
|
|
36
|
-
}
|
|
37
|
-
document.body.appendChild(svg);
|
|
38
|
-
}
|
|
39
|
-
/** An icon element (the c3 sprite plus the extras above). */
|
|
40
|
-
export function ic(name, cls) { ensureTermIcons(); return c3ic(name, cls); }
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/* pm/c3-terminal-results.js — what a finished run shows, by result type (agent-surfaces.html: claims, hero, fileBox, deck, table, diagram, draft).
|
|
2
|
-
* resultNodes(result, ctx) result = the contract's folded result ({ type, ...value }); returns the nodes under the headline.
|
|
3
|
-
* Everything from a run goes in as a text node (el() never takes HTML). An svg is never inserted: a diagram is drawn from its source.
|
|
4
|
-
* ctx = { ui, redraw, canShare }: ui is the per-run state kept outside the render (the deck slide, the table sort), redraw repaints the card. */
|
|
5
|
-
import { el } from './dom.js';
|
|
6
|
-
import { ic } from './c3-terminal-icons.js';
|
|
7
|
-
import { normalizeCase, slideFor } from './c3-case.js';
|
|
8
|
-
|
|
9
|
-
const NS = 'http://www.w3.org/2000/svg';
|
|
10
|
-
const LAB = { fact: ['l-fact', 'fact'], estimate: ['l-est', 'estimate'], assumption: ['l-ass', 'assumption'], reported: ['l-rep', 'reported'] };
|
|
11
|
-
const NO_CHANNEL = 'No channel is connected, so this stays a draft. Nothing is sent.';
|
|
12
|
-
|
|
13
|
-
/** The label chip of one claim: its basis, or "unlabelled" when the contract marked it not ok. */
|
|
14
|
-
export function labelChip(c) {
|
|
15
|
-
const l = c && c.ok !== false && LAB[c.basis] ? LAB[c.basis] : ['l-unl', 'unlabelled'];
|
|
16
|
-
return el('span', { class: 'lab ' + l[0], title: c && c.ok === false ? 'No valid label. It cannot back a message.' : null }, l[1]);
|
|
17
|
-
}
|
|
18
|
-
export function claimsList(list) {
|
|
19
|
-
return el('ul', { class: 'c3t-claims', role: 'list' }, (list || []).map((c) => el('li', null, labelChip(c), el('span', null, c.text, (c.source || c.range) ? el('span', { class: 'dim mono c3t-src' }, ' ' + (c.source || c.range)) : null))));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** The hero of a card.update (the mockup's three: a promise-versus-forecast line, a quote, a CI strip). Anything else is not drawn. */
|
|
23
|
-
export function heroNode(h) {
|
|
24
|
-
if (!h || typeof h !== 'object') return null;
|
|
25
|
-
if (h.t === 'tl' && Number.isFinite(+h.p) && Number.isFinite(+h.f)) {
|
|
26
|
-
const pos = (v) => ((v - 1) / 29 * 100).toFixed(1) + '%';
|
|
27
|
-
return el('div', { class: 'c3t-tl', role: 'img', 'aria-label': 'Promise ' + h.p + ' Nov, forecast ' + h.f + ' Nov' }, el('div', { class: 'axis' }),
|
|
28
|
-
+h.f > +h.p ? el('div', { class: 'gap', style: 'left:' + pos(+h.p) + ';width:' + (((+h.f - +h.p) / 29) * 100).toFixed(1) + '%' }) : null,
|
|
29
|
-
el('div', { class: 'mk pr', style: 'left:' + pos(+h.p) }, el('span', null, 'promise ' + h.p + ' Nov')), el('div', { class: 'mk fc', style: 'left:' + pos(+h.f) }, el('span', null, 'forecast ' + h.f + ' Nov')));
|
|
30
|
-
}
|
|
31
|
-
if (h.t === 'q') return el('blockquote', { class: 'c3t-q' }, '“' + String(h.x || '') + '”', el('cite', null, String(h.by || '')));
|
|
32
|
-
if (h.t === 'ci' && Array.isArray(h.p)) return el('div', { class: 'c3t-ci' }, ...h.p.map((s) => el('i', { class: ['ok', 'bad', 'run'].includes(s) ? s : '' })), el('span', { class: 'dim mono' }, String(h.l || '')));
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** The mockup's md(): # and ## headings, "- " bullets, **bold**, paragraphs. Built as nodes. */
|
|
37
|
-
export function mdNode(text) {
|
|
38
|
-
const out = []; let ul = null;
|
|
39
|
-
const bold = (s) => String(s).split(/(\*\*[^*]+\*\*)/).map((p) => (/^\*\*[^*]+\*\*$/.test(p) ? el('b', null, p.slice(2, -2)) : p));
|
|
40
|
-
for (const l of String(text || '').split('\n')) {
|
|
41
|
-
if (l.startsWith('- ')) { if (!ul) { ul = el('ul'); out.push(ul); } ul.append(el('li', null, ...bold(l.slice(2)))); continue; }
|
|
42
|
-
ul = null;
|
|
43
|
-
if (l.startsWith('## ') || l.startsWith('# ')) out.push(el('h4', null, ...bold(l.replace(/^#+ /, '')))); else if (l.trim()) out.push(el('p', null, ...bold(l)));
|
|
44
|
-
}
|
|
45
|
-
return el('div', { class: 'c3t-md' }, ...out);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function fileNode(r, ctx) {
|
|
49
|
-
const body = ctx.fileBody && ctx.fileBody(r.path);
|
|
50
|
-
return el('div', { class: 'c3t-file' },
|
|
51
|
-
el('div', { class: 'fh' }, ic('doc', 'sm'), el('b', null, r.title), el('span', { class: 'chip2' }, r.media + ' · ' + (r.render || ''))),
|
|
52
|
-
body ? el('div', { class: 'fb' }, mdNode(body)) : el('div', { class: 'fb dim mono' }, 'The page does not read run files. Open the session to read it.'),
|
|
53
|
-
el('div', { class: 'dim mono ft' }, r.path + (r.sha256 ? ' · checksum ' + r.sha256 : ' · no checksum')));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function draftNode(r) {
|
|
57
|
-
const c = normalizeCase({ id: 'draft', outward: true, outboxReason: NO_CHANNEL, options: [{ id: 'send', l: 'Send to ' + r.to, rec: 1, outward: true }] });
|
|
58
|
-
const s = slideFor(c, 'send', { outbox: false });
|
|
59
|
-
return el('div', { class: 'c3t-draft' },
|
|
60
|
-
el('div', { class: 'draft' }, r.body),
|
|
61
|
-
claimsList(r.claims),
|
|
62
|
-
r.can_send === false ? el('div', { class: 'dim mono', style: 'color:var(--destructive)' }, 'Send is blocked: a claim in this draft has no label. Ask for evidence or retry.')
|
|
63
|
-
: el('div', { class: 'dim mono' }, ic('next', 'sm'), ' Queued for ' + r.to + '. The slide sends exactly this text (hash ' + r.hash + ', computed by the workspace, not the agent). The session cannot send.'),
|
|
64
|
-
el('div', { class: 'slt off', 'aria-disabled': 'true', 'data-draft-slide': '', style: '--tc:var(--muted-foreground)' }, el('span', { class: 'lb' }, s.label + ' ›››'),
|
|
65
|
-
el('button', { type: 'button', class: 'th', disabled: true, 'aria-label': 'Send: not available. ' + s.reason }, ic('lock'))),
|
|
66
|
-
el('div', { class: 'slt-why', role: 'note' }, ic('lock', 'sm'), s.reason));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function optionsNode(r) {
|
|
70
|
-
return el('div', { class: 'c3t-opts' }, (r.options || []).map((o) => el('div', { class: 'opt-r' + (o.rec ? ' rec' : '') }, el('b', null, o.label), el('span', { class: 'dim mono' }, o.when || ''), el('span', { class: 'dim mono' }, (o.cost || '') + (o.rec ? ' · suggested' : '') + (r.close_call ? ' · a close call' : '')))));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function deckNode(r, ctx) {
|
|
74
|
-
const ui = ctx.ui; const sl = r.slides || []; const i = Math.max(0, Math.min(sl.length - 1, ui.slide || 0)); const s = sl[i];
|
|
75
|
-
if (!s) return null;
|
|
76
|
-
const go = (d) => { ui.slide = Math.max(0, Math.min(sl.length - 1, i + d)); ctx.redraw(); };
|
|
77
|
-
const box = el('div', { class: 'c3t-dk', 'data-c3t-deck': '' },
|
|
78
|
-
el('div', { class: 'sl' }, el('h4', null, s.title), ...(s.bullets || []).map((b) => el('div', { class: 'c3t-bul' }, labelChip(b), el('span', null, b.text)))),
|
|
79
|
-
el('div', { class: 'nv' }, el('button', { type: 'button', class: 'ib sm', 'aria-label': 'Previous slide', disabled: i === 0, onclick: () => go(-1) }, ic('chevl', 'sm')), el('span', { class: 'dim mono' }, (i + 1) + ' / ' + sl.length + ' · swipe or press'),
|
|
80
|
-
el('button', { type: 'button', class: 'ib sm', 'aria-label': 'Next slide', disabled: i === sl.length - 1, onclick: () => go(1) }, ic('chev', 'sm'))));
|
|
81
|
-
let x0 = null;
|
|
82
|
-
box.addEventListener('pointerdown', (e) => { if (!e.target.closest('button')) x0 = e.clientX; });
|
|
83
|
-
box.addEventListener('pointerup', (e) => { if (x0 === null) return; const dx = e.clientX - x0; x0 = null; if (Math.abs(dx) > 50) go(dx < 0 ? 1 : -1); });
|
|
84
|
-
return el('div', { class: 'c3t-deck' }, box, el('div', { class: 'foot' },
|
|
85
|
-
r.unlabelled ? el('span', { style: 'color:var(--destructive)' }, r.unlabelled + ' bullet' + (r.unlabelled > 1 ? 's' : '') + ' without a label. Cannot be shared.') : el('span', { class: 'dim mono' }, 'All bullets labelled.'),
|
|
86
|
-
el('button', { type: 'button', class: 'pill', disabled: true, title: 'A pptx export is not built on this page. Nothing leaves the machine.' }, ic('doc', 'sm'), 'Export as pptx')));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function tableNode(r, ctx) {
|
|
90
|
-
const ui = ctx.ui; const cols = r.columns || []; ui.col = ui.col == null ? 1 : ui.col; ui.dir = ui.dir || -1;
|
|
91
|
-
const rows = (r.rows || []).slice().sort((a, b) => { const x = a[ui.col], y = b[ui.col]; return (typeof x === 'number' ? x - y : String(x).localeCompare(String(y))) * ui.dir; });
|
|
92
|
-
const tog = el('div', { class: 'chips2' }, el('button', { type: 'button', class: 'pill', 'aria-pressed': String(!ui.cards), onclick: () => { ui.cards = false; ctx.redraw(); } }, 'Table'), el('button', { type: 'button', class: 'pill', 'aria-pressed': String(!!ui.cards), onclick: () => { ui.cards = true; ctx.redraw(); } }, 'Cards'),
|
|
93
|
-
el('span', { class: 'dim mono' }, 'Showing ' + rows.length + ' of ' + (r.total || rows.length) + ' · tap a heading to sort'));
|
|
94
|
-
if (ui.cards) return el('div', { class: 'c3t-tbl' }, tog, el('div', { class: 'c3t-opts' }, rows.map((row) => el('div', { class: 'opt-r' }, el('b', null, String(row[0])), el('span', { class: 'dim mono' }, row.slice(1, 2).join('') + (cols[1] ? ' ' + cols[1].label : '')), el('span', { class: 'dim mono' }, row.slice(2).join(' · '))))));
|
|
95
|
-
const head = el('tr', null, cols.map((c, i) => el('th', { class: c.type === 'number' ? 'n' : '', 'aria-sort': ui.col === i ? (ui.dir > 0 ? 'ascending' : 'descending') : 'none' },
|
|
96
|
-
el('button', { type: 'button', class: 'c3t-th', onclick: () => { ui.dir = ui.col === i ? -ui.dir : 1; ui.col = i; ctx.redraw(); } }, c.label + (ui.col === i ? (ui.dir > 0 ? ' ▲' : ' ▼') : '')))));
|
|
97
|
-
return el('div', { class: 'c3t-tbl' }, tog, el('div', { class: 'tw' }, el('table', { class: 'tbl' }, head, rows.map((row) => el('tr', null, row.map((v, i) => el('td', { class: cols[i] && cols[i].type === 'number' ? 'n' : '' }, v == null ? '' : String(v))))))));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/** A mermaid "graph LR" of edges, drawn as layers (the longest chain in the accent). Anything it cannot read stays as source text. */
|
|
101
|
-
function diagramNode(r) {
|
|
102
|
-
const src = String(r.source || '');
|
|
103
|
-
const edges = []; const names = [];
|
|
104
|
-
for (const part of src.replace(/^\s*(graph|flowchart)\s+\w+\s*;?/i, '').split(/[;\n]/)) {
|
|
105
|
-
const m = /^\s*([\w-]+)\s*-->\s*([\w-]+)\s*$/.exec(part);
|
|
106
|
-
if (m) { edges.push([m[1], m[2]]); for (const n of [m[1], m[2]]) if (!names.includes(n)) names.push(n); }
|
|
107
|
-
}
|
|
108
|
-
const text = el('details', { class: 'c3t-src' }, el('summary', { class: 'chips2 dim' }, ic('chev', 'sm'), 'Source (' + r.kind + ')'), el('div', { class: 'raw' }, src));
|
|
109
|
-
if (r.kind !== 'mermaid' || !edges.length) return el('div', { class: 'c3t-dg' }, el('div', { class: 'dim mono' }, 'The diagram is shown as its source: this page draws only edge lists.'), text);
|
|
110
|
-
const depth = {}; const longest = {};
|
|
111
|
-
const lay = (n, seen = []) => { if (depth[n] != null) return depth[n]; if (seen.includes(n)) return 0; const ins = edges.filter((e) => e[1] === n).map((e) => e[0]); depth[n] = ins.length ? 1 + Math.max(...ins.map((x) => lay(x, seen.concat(n)))) : 0; return depth[n]; };
|
|
112
|
-
names.forEach((n) => lay(n));
|
|
113
|
-
const maxD = Math.max(...Object.values(depth));
|
|
114
|
-
const end = names.find((n) => depth[n] === maxD); let cur = end; longest[cur] = 1;
|
|
115
|
-
while (cur) { const prev = edges.map((e) => e).filter((e) => e[1] === cur && depth[e[0]] === depth[cur] - 1)[0]; cur = prev && prev[0]; if (cur) longest[cur] = 1; }
|
|
116
|
-
const rowOf = {}; const cnt = {};
|
|
117
|
-
names.forEach((n) => { cnt[depth[n]] = (cnt[depth[n]] || 0); rowOf[n] = longest[n] ? 0 : (cnt[depth[n]] += 1); });
|
|
118
|
-
const W = 120, H = 40, GX = 150, GY = 62; const maxRow = Math.max(...Object.values(rowOf));
|
|
119
|
-
const pt = (n) => ({ x: 10 + depth[n] * GX, y: 10 + rowOf[n] * GY });
|
|
120
|
-
const svg = document.createElementNS(NS, 'svg'); svg.setAttribute('viewBox', '0 0 ' + (20 + maxD * GX + W) + ' ' + (20 + maxRow * GY + H)); svg.setAttribute('role', 'img'); svg.setAttribute('aria-label', r.title || 'Diagram');
|
|
121
|
-
const mk = (tag, a, txt) => { const n = document.createElementNS(NS, tag); for (const k of Object.keys(a)) n.setAttribute(k, a[k]); if (txt) n.textContent = txt; svg.appendChild(n); return n; };
|
|
122
|
-
for (const [a, b] of edges) { const p = pt(a), q = pt(b); const cp = longest[a] && longest[b] && depth[b] === depth[a] + 1; mk('path', { d: 'M' + (p.x + W) + ' ' + (p.y + H / 2) + 'L' + q.x + ' ' + (q.y + H / 2), class: cp ? 'ec' : 'ed' }); }
|
|
123
|
-
for (const n of names) { const p = pt(n); mk('rect', { x: p.x, y: p.y, width: W, height: H, rx: 8, class: 'nd' + (longest[n] ? ' cp' : '') }); mk('text', { x: p.x + W / 2, y: p.y + H / 2 + 4, 'text-anchor': 'middle' }, n); }
|
|
124
|
-
return el('div', { class: 'c3t-dg' }, el('div', { class: 'dg' }, svg), text, el('div', { class: 'dim mono' }, 'The longest chain is blue. Drawn here from its source; the page loads nothing from the network.'));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function resultNodes(r, ctx) {
|
|
128
|
-
if (!r) return [];
|
|
129
|
-
switch (r.type) {
|
|
130
|
-
case 'card.update': return [r.hero ? heroNode(r.hero) : null, claimsList(r.claims), r.chip ? el('div', { class: 'chips2' }, el('span', { class: 'chip2 ok' }, r.chip)) : null];
|
|
131
|
-
case 'evidence': return [claimsList(r.claims)];
|
|
132
|
-
case 'options': return [optionsNode(r)];
|
|
133
|
-
case 'draft': return [draftNode(r)];
|
|
134
|
-
case 'note': return [el('p', { class: 'c3t-note' }, r.note)];
|
|
135
|
-
case 'file': return [fileNode(r, ctx)];
|
|
136
|
-
case 'deck': return [deckNode(r, ctx)];
|
|
137
|
-
case 'table': return [tableNode(r, ctx)];
|
|
138
|
-
case 'diagram': return [diagramNode(r)];
|
|
139
|
-
default: return [el('p', { class: 'dim mono' }, 'A result of type ' + String(r.type) + ' that this page does not draw.')];
|
|
140
|
-
}
|
|
141
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/* pm/c3-terminal.js — the Terminal page: the agent surfaces of agent-surfaces.html, opened by the header's agent button (spark, with the needs-you badge).
|
|
2
|
-
* openTerminalPage({ tab }) closeTerminalPage()
|
|
3
|
-
* One wide sheet (c3-sheet.js: Esc closes, focus is kept inside, a bottom sheet on a phone) with the mockup's two views:
|
|
4
|
-
* Sessions On a card, Started by me, Past (7 days, with the observed / reported / you timeline), Automatic (hidden until switched on): sessions-panel.js,
|
|
5
|
-
* every run a card (run-card.js) with its strip, its questions, its permission cards, its result and next moves.
|
|
6
|
-
* Edge cases the mockup's cases, one card each: c3-terminal-edge.js (example data, also in real mode).
|
|
7
|
-
* The mockup's third view, "Structure", is the design note (how a session is read); it is not drawn on the page.
|
|
8
|
-
* Real mode reads GET /api/runs and records presses; demo mode (the sample content) answers from c3-demo-term.js. Nothing here sends anything outward. */
|
|
9
|
-
import { el } from './dom.js';
|
|
10
|
-
import { openSheet, closeSheet } from './c3-sheet.js';
|
|
11
|
-
import { ic } from './c3-terminal-icons.js';
|
|
12
|
-
import { source, isDemo } from './c3-terminal-data.js';
|
|
13
|
-
import { mountSessions, disposeSessions } from './sessions-panel.js';
|
|
14
|
-
import { mountEdge, disposeEdge } from './c3-terminal-edge.js';
|
|
15
|
-
|
|
16
|
-
const TABS = [['sessions', 'Sessions', 'bolt'], ['edge', 'Edge cases', 'alert']];
|
|
17
|
-
const NEXT = [['', 'replies normally'], ['noresult', 'ends with no result'], ['rejected', 'is unreadable'], ['quiet', 'goes quiet'], ['unlabelled', 'has an unlabelled claim'], ['prose', 'answers in plain text'], ['attention', 'needs a sign-in'], ['crashed', 'crashes']];
|
|
18
|
-
let sheet = null;
|
|
19
|
-
|
|
20
|
-
export function closeTerminalPage() { if (sheet) closeSheet(); }
|
|
21
|
-
|
|
22
|
-
export async function openTerminalPage(o = {}) {
|
|
23
|
-
const src = source();
|
|
24
|
-
const st = { tab: o.tab === 'edge' ? 'edge' : 'sessions' };
|
|
25
|
-
const host = el('div', { class: 'c3t-host', 'data-c3t': 'host' });
|
|
26
|
-
const seg = el('div', { class: 'seg', role: 'group', 'aria-label': 'Agent surfaces view', 'data-c3t': 'tabs' });
|
|
27
|
-
const note = el('div', { class: 'dim mono c3t-note', 'data-c3t': 'note' });
|
|
28
|
-
const demoBar = src.demo ? el('div', { class: 'chips2 c3t-demo', 'data-c3t': 'demo-controls' },
|
|
29
|
-
el('label', { class: 'dim mono', for: 'c3t-next' }, 'Demo: next reply'),
|
|
30
|
-
el('select', { id: 'c3t-next', 'aria-label': 'How the next reply ends', onchange: (e) => src.setNext(e.target.value) }, NEXT.map(([v, l]) => el('option', { value: v }, l))),
|
|
31
|
-
el('button', { type: 'button', class: 'pill', 'data-c3t': 'fire', onclick: () => src.fire() }, ic('bolt', 'sm'), 'Fire a detector')) : null;
|
|
32
|
-
let fx = null;
|
|
33
|
-
const draw = async () => {
|
|
34
|
-
seg.replaceChildren(...TABS.map(([id, label, icon]) => el('button', { type: 'button', 'aria-pressed': String(st.tab === id), 'data-c3t-tab': id, onclick: () => { if (st.tab !== id) { st.tab = id; draw(); } } }, ic(icon, 'sm'), label)));
|
|
35
|
-
disposeSessions(host); disposeEdge(host);
|
|
36
|
-
if (demoBar) demoBar.hidden = st.tab !== 'sessions';
|
|
37
|
-
if (st.tab === 'sessions') {
|
|
38
|
-
note.textContent = isDemo() ? 'Example data. A swipe right accepts a finished result, a swipe left opens the reply tray. Tap the corner icon to flip a card.' : 'Your runs, read from this workspace. A run is a real CLI session; the page reads its replies and records your presses. Nothing is sent outward.';
|
|
39
|
-
mountSessions(host, {});
|
|
40
|
-
} else {
|
|
41
|
-
note.textContent = '';
|
|
42
|
-
if (!fx) { try { fx = (await import('./c3-demo-term.js')).FX; } catch { fx = null; } }
|
|
43
|
-
if (st.tab !== 'edge') return;
|
|
44
|
-
if (fx) mountEdge(host, fx); else host.replaceChildren(el('p', { class: 'dim mono', role: 'status' }, 'The examples could not be loaded.'));
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const body = [el('div', { class: 'c3 c3e c3t c3t-page', 'data-c3t': 'page' }, el('div', { class: 'chips2', style: 'justify-content:space-between' }, seg, demoBar), note, host)];
|
|
48
|
-
const s = openSheet({ title: 'Agent surfaces', icon: 'bolt', dw: true, body, onClose: () => { disposeSessions(host); disposeEdge(host); sheet = null; } });
|
|
49
|
-
sheet = s;
|
|
50
|
-
await draw();
|
|
51
|
-
return s;
|
|
52
|
-
}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
/* pm/c3-tickets.js — the Tickets sub-view of Initiatives on /c3.html (console3.html patch at lines 3764 to 3860 and 4488: tkRow, list20, the
|
|
2
|
-
* "Open points by owner" card, raciCard and the agent-drafts card).
|
|
3
|
-
* Tickets are JIRA ONLY and their status is MIRRORED, read-only: the server never reads Jira (D53). The rows come from the cached Jira
|
|
4
|
-
* read the My work route serves: GET /api/my-work, the items with source 'jira' (id jira:KEY, key, title, status, category todo|doing|done,
|
|
5
|
-
* due, estimate, blocks, open, initiative). Nothing on this view writes.
|
|
6
|
-
* Real: key, title, status, category, due, estimate (XS 1, S 2, M 3, L 5, XL 8 points), blocks, initiative; "late" is an overdue date.
|
|
7
|
-
* Optional fields the real read does not carry (owner, pts, forecast_due, blocker, critical, in_work) and the cards `raci` and `drafts`
|
|
8
|
-
* are drawn only when present: the demo's fixtures carry them, a real read does not, so real mode never shows an invented owner or draft.
|
|
9
|
-
* Late or at risk = a forecast past the due date, an overdue date, or a named blocker. */
|
|
10
|
-
import { el } from './dom.js';
|
|
11
|
-
import { pmGet, pmPost } from './http.js';
|
|
12
|
-
import { c3ic } from './pm-work-view.js';
|
|
13
|
-
import { makeView, frame, hBars, card, listCard, emptyRow, dayLabel, short, rowShell, caseNode, markDone, say } from './c3-init-extras.js';
|
|
14
|
-
|
|
15
|
-
const SIZE_PTS = { XS: 1, S: 2, M: 3, L: 5, XL: 8 };
|
|
16
|
-
const OWN_COL = ['var(--acc)', 'var(--success)', 'var(--purple)', 'var(--warning)', 'var(--muted-foreground)', 'var(--destructive)'];
|
|
17
|
-
const dayNum = (iso) => Math.round(Date.parse(String(iso).slice(0, 10) + 'T00:00:00Z') / 86400000);
|
|
18
|
-
|
|
19
|
-
/** One ticket the view draws: the my-work item plus the derived state (late days, late or at risk). */
|
|
20
|
-
export function ticketOf(it, today) {
|
|
21
|
-
const due = it.due || null; const fc = it.forecast_due || due;
|
|
22
|
-
const slip = due && fc ? Math.max(0, dayNum(fc) - dayNum(due)) : 0;
|
|
23
|
-
const over = !slip && due && today && it.category !== 'done' && dayNum(today) > dayNum(due) ? dayNum(today) - dayNum(due) : 0;
|
|
24
|
-
const risk = it.category !== 'done' && (it.blocker || (it.blocks > 0) || (it.open && it.open.length));
|
|
25
|
-
const bad = it.category !== 'done' && (slip > 0 || over > 0 || !!it.blocker);
|
|
26
|
-
return { ...it, due, fc, slip, over, bad, risk: !!risk, owner: it.owner || null, pts: it.pts != null ? it.pts : (SIZE_PTS[it.estimate] || null) };
|
|
27
|
-
}
|
|
28
|
-
export const jiraTickets = (j) => ((j && j.items) || []).filter((i) => i.source === 'jira').map((i) => ticketOf(i, j.today));
|
|
29
|
-
|
|
30
|
-
const goTab = (V, k) => { const b = V.ctx.links && V.ctx.links.querySelector && V.ctx.links.querySelector('[data-c3-link=' + k + ']'); if (b) b.click(); };
|
|
31
|
-
const mineish = (t) => !t.owner || /^(wawan|you)$/i.test(t.owner);
|
|
32
|
-
|
|
33
|
-
/** The case file of a ticket (console3.html genTk, line 3770). READ-ONLY: Jira owns status, dates and owners; this page never changes them.
|
|
34
|
-
* "Take it into today" is the page's own Work list (a page press); a nudge goes outside, so its slide is disabled until a channel is connected. */
|
|
35
|
-
function caseOf(V, t) {
|
|
36
|
-
const chg = [];
|
|
37
|
-
if (t.blocker) chg.push(['alert', t.blocker, 'Jira', 'bad']);
|
|
38
|
-
if (t.slip > 0) chg.push(['clock', 'Forecast ' + dayLabel(t.fc) + ', ' + t.slip + ' day' + (t.slip === 1 ? '' : 's') + ' after plan', 'timeline', 'warn']);
|
|
39
|
-
else if (t.over > 0) chg.push(['clock', 'Overdue by ' + t.over + ' day' + (t.over === 1 ? '' : 's') + ', due ' + dayLabel(t.due), 'Jira', 'bad']);
|
|
40
|
-
if (t.critical) chg.push(['flag', 'On the critical path: it moves the ship date', 'path']);
|
|
41
|
-
if (t.in_work) chg.push(['check', 'Also in your Work list', 'Work']);
|
|
42
|
-
if (!chg.length) chg.push(['check', t.due ? 'On plan, due ' + dayLabel(t.fc || t.due) : 'No date in Jira', 'timeline', t.due ? 'ok' : '']);
|
|
43
|
-
chg.push(['lock', 'Status, dates and owner are Jira’s: ' + (t.status || 'no status read') + (t.owner ? ', ' + t.owner : ''), 'Jira, read-only']);
|
|
44
|
-
const opts = [];
|
|
45
|
-
if (!t.in_work && t.category !== 'done') opts.push({ id: 'tk', l: 'Take it into today', rec: mineish(t), fx: [['check', 'Appears in your Work list', 'ok']] });
|
|
46
|
-
if (t.category !== 'done' && !mineish(t)) opts.push({ id: 'nd', l: 'Ask ' + t.owner + ' for an update', rec: t.slip > 0 || !!t.blocker, outward: true, fx: [['reply', 'A draft to ' + t.owner, 'ok'], ['out', 'Goes out only by your slide', 'warn']] });
|
|
47
|
-
opts.push({ id: 'ok', l: 'Leave it', fx: [] });
|
|
48
|
-
const model = { sit: t.why || 'Ticket ' + t.key + (t.initiative ? ' in ' + (V.ctx.rows || []).reduce((n, r) => (r.id === t.initiative ? r.title : n), t.initiative) : '') + (t.owner ? ', owned by ' + t.owner : '') + '. Jira owns it: a change here is only ever a proposal.',
|
|
49
|
-
conf: Math.round(72 + (t.slip > 0 ? 6 : 10)), chg, opts, cta: 'Slide to confirm', outboxReason: 'This message goes outside. No channel is connected, so it stays a draft and nothing is sent.' };
|
|
50
|
-
return caseNode(V, 'tk:' + t.key, model, { onConfirm: (o) => decide(V, t, o) });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async function takeIntoToday(V, t) {
|
|
54
|
-
const r = await pmPost('/api/pm-items/add', { line: t.title + ' (' + t.key + ') today' });
|
|
55
|
-
if (!r || !r.ok) { say((r && r.error) || 'Not added to Work.'); return null; }
|
|
56
|
-
const id = r.item && r.item.id;
|
|
57
|
-
return () => (id ? pmPost('/api/pm-items/remove', { id }) : null);
|
|
58
|
-
}
|
|
59
|
-
async function decide(V, t, o) {
|
|
60
|
-
if (o.id === 'tk') {
|
|
61
|
-
const undo = await takeIntoToday(V, t); if (undo === null) return;
|
|
62
|
-
say('In your Work list for today.', undo); markDone(V, 'tk:' + t.key, 'Added to your Work list for today.', undo);
|
|
63
|
-
} else markDone(V, 'tk:' + t.key, 'Left as it is. No change.');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function row(V, t) {
|
|
67
|
-
const col = t.category === 'done' ? 'var(--success)' : t.bad ? 'var(--destructive)' : t.risk ? 'var(--warning)' : 'var(--success)';
|
|
68
|
-
const word = t.category === 'done' ? 'Done' : t.slip ? 'Delayed +' + t.slip + ' d' : t.over ? 'Overdue ' + t.over + ' d' : t.risk ? 'At risk' : 'On time';
|
|
69
|
-
const wcol = t.category === 'done' ? 'var(--success)' : t.slip || t.over ? 'var(--destructive)' : t.risk ? 'var(--warning)' : 'var(--success)';
|
|
70
|
-
const icon = t.category === 'done' ? 'check' : t.bad ? 'clock' : 'check';
|
|
71
|
-
/* the swipe (console3.html line 3879): right takes it into today, left drafts a nudge to the owner. A nudge goes outside: no channel, so nothing is sent. */
|
|
72
|
-
const sw = {
|
|
73
|
-
labelRight: 'take it into today', labelLeft: t.owner && !mineish(t) ? 'draft a nudge to ' + t.owner : 'nothing to nudge', iconRight: 'sun', iconLeft: 'bolt',
|
|
74
|
-
onRight: async () => { if (t.in_work || t.category === 'done') { say('Already in Work'); return; } const undo = await takeIntoToday(V, t); if (undo) { say('In your Work list for today', undo); markDone(V, 'tk:' + t.key, 'Added to your Work list for today.', undo); } },
|
|
75
|
-
onLeft: () => say(t.owner && !mineish(t) ? (window.__c3demo ? 'Nudge drafted for ' + t.owner : 'A nudge to ' + t.owner + ' goes outside. No channel is connected, so nothing was drafted or sent.') : 'Nothing to nudge: the ticket is yours or has no owner.'),
|
|
76
|
-
};
|
|
77
|
-
return rowShell(V, { key: 'tk:' + t.key, attrs: { 'data-in-ticket': t.key, 'data-id': t.key, 'data-tk': '1' }, icon, iconColor: col, sw, xpContent: caseOf(V, t),
|
|
78
|
-
titleNode: el('span', { class: 'tt' }, t.critical ? el('span', { class: 'st bad', title: 'On the critical path', style: 'margin-right:6px' }, c3ic('flag', 'sm')) : null, t.title),
|
|
79
|
-
chips: [el('span', { class: 'chip2 mono' }, t.key),
|
|
80
|
-
el('span', { class: 'chip2', style: 'color:' + wcol }, word),
|
|
81
|
-
t.owner ? el('span', { class: 'chip2' }, el('span', { class: 'av' }, t.owner.slice(0, 1)), t.owner) : null,
|
|
82
|
-
t.fc ? el('span', { class: 'chip2' }, c3ic('cal', 'sm'), dayLabel(t.fc)) : null,
|
|
83
|
-
t.blocker && t.category !== 'done' ? el('span', { class: 'st warn' }, c3ic('alert', 'sm'), t.blocker) : null,
|
|
84
|
-
t.in_work ? el('button', { type: 'button', class: 'chip2 lk', 'data-gowork': t.key, onclick: () => goTab(V, 'work') }, c3ic('check', 'sm'), 'In Work') : null,
|
|
85
|
-
t.status && !t.owner ? el('span', { class: 'chip2' }, t.status) : null,
|
|
86
|
-
el('span', { class: 'tag' }, 'Jira')] });
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function raciCard(R) {
|
|
90
|
-
const cell = (v) => el('span', { class: 'c ' + v }, v);
|
|
91
|
-
return card('org', 'Who does what', 'responsible, accountable, consulted, informed',
|
|
92
|
-
el('div', { class: 'rcg' }, el('span'), ...R.people.map((p) => el('span', { class: 'h' }, p.slice(0, 3))),
|
|
93
|
-
...R.rows.flatMap((r) => [el('span', null, r.title), ...r.cells.map(cell)])),
|
|
94
|
-
el('ul', { class: 'chgl' }, R.notes.map((n) => el('li', { class: n.tone }, c3ic('alert', 'sm'), el('span', null, n.text)))));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function load(V) {
|
|
98
|
-
pmGet('/api/my-work').then((j) => {
|
|
99
|
-
if (V.disposed) return;
|
|
100
|
-
V.data = { j: j && j.ok ? j : null, err: j && j.ok ? null : (j && j.error) || 'The Jira read could not be reached.' };
|
|
101
|
-
V.render();
|
|
102
|
-
}, () => { V.data = { j: null, err: 'The Jira read could not be reached.' }; V.render(); });
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function render(V) {
|
|
106
|
-
const D = V.data;
|
|
107
|
-
const all = D && D.j ? jiraTickets(D.j) : [];
|
|
108
|
-
const T = V.scope ? all.filter((t) => t.initiative === V.scope) : all;
|
|
109
|
-
const bad = T.filter((t) => t.bad || t.risk);
|
|
110
|
-
const sorted = (f) => T.filter(f).sort((a, b) => String(a.fc || '9').localeCompare(String(b.fc || '9')));
|
|
111
|
-
const late = sorted((t) => t.category !== 'done' && (t.bad || t.risk));
|
|
112
|
-
const doing = sorted((t) => t.category === 'doing' && !late.includes(t));
|
|
113
|
-
const todo = sorted((t) => t.category === 'todo' && !late.includes(t));
|
|
114
|
-
const done = sorted((t) => t.category === 'done');
|
|
115
|
-
const reading = !D;
|
|
116
|
-
const none = !reading && !all.length;
|
|
117
|
-
const head = reading ? { icon: 'check', h: 'Reading the Jira tickets', s: 'Tickets live in Jira. The agent proposes, you accept.', ring: [0, 1] }
|
|
118
|
-
: none ? { icon: 'check', h: 'No Jira tickets read yet', s: D.err || 'The agent has not read Jira yet. A read from My work in the classic app (/classic.html) fills this view.', ring: [0, 1] }
|
|
119
|
-
: { icon: 'check', h: T.length + ' Jira ticket' + (T.length === 1 ? '' : 's') + ', ' + bad.length + ' late or at risk', s: 'Tickets live in Jira. The agent proposes, you accept.', ring: [done.length, T.length] };
|
|
120
|
-
|
|
121
|
-
const left = [];
|
|
122
|
-
if (reading) left.push(listCard('check', 'Tickets', null, '', [emptyRow('clock', 'Reading the Jira tickets.', { role: 'status' })]));
|
|
123
|
-
else if (none) left.push(listCard('check', 'Tickets', 0, 'Jira only, read-only', [emptyRow('moon', 'The agent has not read Jira yet, so there are no tickets to show. Nothing here is invented.', { 'data-in-empty': '' })]));
|
|
124
|
-
else if (!T.length) left.push(listCard('check', 'Tickets', 0, 'Jira only, read-only', [emptyRow('check', 'No Jira ticket belongs to this initiative.', { 'data-in-empty': '' })]));
|
|
125
|
-
else {
|
|
126
|
-
if (late.length) left.push(listCard('alert', 'Late or at risk', late.length, '', late.map((t) => row(V, t)), { 'data-in-list': 'late' }));
|
|
127
|
-
if (doing.length) left.push(listCard('clock', 'Doing', doing.length, '', doing.map((t) => row(V, t)), { 'data-in-list': 'doing' }));
|
|
128
|
-
if (todo.length) left.push(listCard('moon', 'To do', todo.length, '', todo.map((t) => row(V, t)), { 'data-in-list': 'todo' }));
|
|
129
|
-
if (done.length) left.push(listCard('check', 'Done', done.length, '', done.map((t) => row(V, t)), { 'data-in-list': 'done' }));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const right = [];
|
|
133
|
-
if (T.length) {
|
|
134
|
-
const by = {};
|
|
135
|
-
T.forEach((t) => { if (t.category !== 'done') { const o = t.owner || 'You'; by[o] = (by[o] || 0) + (t.pts || 0); } });
|
|
136
|
-
const names = Object.keys(by).sort((a, b) => by[b] - by[a]);
|
|
137
|
-
const mx = Math.max(1, ...names.map((n) => by[n]));
|
|
138
|
-
if (names.some((n) => by[n] > 0)) right.push(card('user', 'Open points by owner', '', hBars(names.map((n, i) => [n, by[n] / mx, OWN_COL[i % OWN_COL.length], by[n] + ' pts']))));
|
|
139
|
-
}
|
|
140
|
-
if (D && D.j && D.j.raci) right.push(raciCard(D.j.raci));
|
|
141
|
-
if (D && D.j && Array.isArray(D.j.drafts) && D.j.drafts.length) {
|
|
142
|
-
right.push(card('plus', 'Agent drafts', 'propose only, you accept',
|
|
143
|
-
el('ul', { class: 'chgl' }, D.j.drafts.map((t) => el('li', { class: 'warn' }, c3ic('plus', 'sm'), el('span', null, t.title + ' · ' + t.pts + ' pts')))),
|
|
144
|
-
el('div', { class: 'dim', style: 'font-size:var(--fs-2)' }, 'Nothing reaches Jira until you accept. Slide the card in the deck.')));
|
|
145
|
-
}
|
|
146
|
-
if (!right.length) right.push(card('info', 'Read-only mirror', '', el('ul', { class: 'chgl' },
|
|
147
|
-
el('li', null, c3ic('lock', 'sm'), el('span', null, 'Status, dates and owners are Jira’s. This view never writes to Jira.')),
|
|
148
|
-
el('li', null, c3ic('clock', 'sm'), el('span', null, 'The agent reads Jira with your connection and the server keeps the last read.')))));
|
|
149
|
-
const readAt = D && D.j && D.j.read_at;
|
|
150
|
-
if (readAt) right.push(el('p', { class: 'dim mono', style: 'font-size:var(--fs-2)', 'data-in-readat': '' }, 'Last read of Jira: ' + short(readAt, 25)));
|
|
151
|
-
frame(V, { head, left, right });
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const view = makeView('tickets', { init: load, render });
|
|
155
|
-
export const mount = view.mount;
|
|
156
|
-
export const dispose = view.dispose;
|
|
157
|
-
|
|
158
|
-
/** The count on the Tickets button: the Jira tickets that are late or at risk. */
|
|
159
|
-
export async function badge(ctx) {
|
|
160
|
-
const j = await pmGet('/api/my-work' + (ctx && ctx.ws ? '?ws=' + encodeURIComponent(ctx.ws) : ''));
|
|
161
|
-
if (!j || !j.ok) return null;
|
|
162
|
-
return jiraTickets(j).filter((t) => t.category !== 'done' && (t.bad || t.risk)).length;
|
|
163
|
-
}
|