create-pmos 0.398.0 → 0.400.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +19 -15
- package/workspace/briefing-premium-board-test.js +82 -50
- package/workspace/briefing-premium-calendar-2-test.js +36 -36
- package/workspace/briefing-premium-calendar-3-test.js +39 -39
- package/workspace/briefing-premium-calendar-test.js +23 -24
- package/workspace/briefing-premium-doc-edit-test.js +8 -10
- package/workspace/briefing-premium-initiative-test.js +38 -16
- package/workspace/briefing-premium-insights-test.js +114 -37
- package/workspace/briefing-premium-metrics-test.js +6 -4
- package/workspace/briefing-premium-products-test.js +10 -7
- package/workspace/briefing-premium-sources-test.js +25 -22
- package/workspace/briefing-premium-test.js +48 -43
- package/workspace/briefing-premium-work-test.js +16 -11
- package/workspace/c3-capture-test.js +0 -17
- package/workspace/changelog.json +29 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
- package/workspace/guide/briefing-premium.md +2 -2
- package/workspace/guide/home.md +58 -19
- package/workspace/guide/index.md +1 -1
- 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/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +36 -5
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-premium.js +3 -2
- package/workspace/lib/insights-records.js +21 -7
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +9 -9
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +4 -1
- package/workspace/lib/routes-insights-records.js +8 -4
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +2 -1
- package/workspace/lib/routes-phone-day.js +18 -9
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/routes-slash.js +95 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -2
- package/workspace/premium-board-actions-test.js +86 -50
- package/workspace/premium-briefing-depth-test.js +55 -54
- package/workspace/premium-chat-chart-tab-test.js +4 -2
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-report-tab-test.js +16 -2
- package/workspace/premium-chat-term-test.js +0 -10
- package/workspace/premium-core-doc-issue-test.js +15 -13
- package/workspace/premium-menu-rows-test.js +1 -1
- package/workspace/premium-phone-card-test.js +7 -5
- package/workspace/premium-report-read-test.js +55 -18
- package/workspace/premium-vw-backlog-test.js +2 -2
- package/workspace/premium-vw-cal-test.js +50 -35
- package/workspace/premium-vw-doc-test.js +10 -11
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-vw-jira-test.js +2 -2
- package/workspace/premium-vw-meet-test.js +37 -40
- package/workspace/premium-vw-notes-test.js +21 -19
- package/workspace/premium-vw-rec-test.js +11 -12
- package/workspace/premium-welcome-test.js +3 -3
- package/workspace/premium-work-depth-test.js +5 -6
- package/workspace/public/capture.html +23 -0
- package/workspace/public/pm/bd-acts.js +303 -225
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +49 -13
- package/workspace/public/pm/bd-views.js +169 -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-board.css +301 -0
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-home.css +20 -5
- package/workspace/public/pm/cozy-insights.css +148 -10
- package/workspace/public/pm/cozy-nav.js +103 -39
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +220 -0
- package/workspace/public/pm/cozy-viewer.js +5 -2
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/cozy.css +9 -0
- package/workspace/public/pm/goal-chat.js +5 -1
- package/workspace/public/pm/home-adddoc.js +5 -5
- package/workspace/public/pm/home-app.js +365 -70
- package/workspace/public/pm/home-around.js +24 -126
- package/workspace/public/pm/home-chat.js +77 -18
- package/workspace/public/pm/home-data.js +9 -7
- package/workspace/public/pm/home-dictate.js +57 -0
- package/workspace/public/pm/home-draft.js +6 -6
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +466 -0
- package/workspace/public/pm/home-list.js +289 -0
- package/workspace/public/pm/home-more.js +18 -135
- package/workspace/public/pm/home-phone-card.js +13 -8
- package/workspace/public/pm/home-review.js +103 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +148 -0
- package/workspace/public/pm/home-work.js +63 -28
- 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 +164 -40
- package/workspace/public/pm/premium-chart-tab.js +4 -5
- package/workspace/public/pm/premium-first.js +5 -7
- package/workspace/public/pm/premium-initiative-head.js +3 -3
- package/workspace/public/pm/premium-insights.js +499 -202
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- package/workspace/public/pm/premium-report-read.js +216 -52
- package/workspace/public/pm/premium-report-tab.js +44 -19
- package/workspace/public/pm/premium-shell.js +7 -7
- package/workspace/public/pm/premium-vw-cal.js +150 -60
- 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-mtg.js +488 -261
- package/workspace/public/pm/premium-vw-notes.js +61 -0
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/pm/view-notes.js +2 -2
- package/workspace/public/premium-board.html +4 -3
- package/workspace/public/premium-insights.html +10 -10
- package/workspace/public/premium.html +3 -1
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- 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 +3 -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/initiative-layout.json +9 -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/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- 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/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
- 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
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
* POST /api/insights-records/describe { ws, text } → { ok, name, question, goals, range, said } reads the goals; writes nothing
|
|
12
12
|
* POST /api/insights-records/verdict { ws, board, ini, verdict, learned, goal } → { ok, verdict } one verdict line; the Board is not changed
|
|
13
13
|
* POST /api/insights-records/target { ws, key: late | scope, target } → { ok, targets }
|
|
14
|
+
* POST /api/insights-records/tile { ws, key, dir: at least | at most | none, from, chip } → { ok, tiles } how a Delivery trends target is
|
|
15
|
+
* read (premium-uncovered-features, IsTarget): its direction, the day it counts from and whether the Board chip shows it
|
|
14
16
|
* GET /api/insights-records/export?ws=&board= → text/csv of the goals the page shows
|
|
15
17
|
*
|
|
16
18
|
* WHO WRITES. As routes-premium-dashboards.js: an agent session header is refused (403), and pm-guard requirePagePress checks the launch nonce and the
|
|
@@ -50,7 +52,7 @@ async function handle(req, res, url, ctx) {
|
|
|
50
52
|
res.end(IG.exportCsv(m.goals || []));
|
|
51
53
|
return true;
|
|
52
54
|
}
|
|
53
|
-
if (!['goal', 'steps', 'dashboard', 'chart', 'describe', 'verdict', 'target'].includes(what)) return send(bad(404, 'no such insights-records route'));
|
|
55
|
+
if (!['goal', 'steps', 'dashboard', 'chart', 'describe', 'verdict', 'target', 'tile'].includes(what)) return send(bad(404, 'no such insights-records route'));
|
|
54
56
|
if (req.method !== 'POST') return send(bad(405, 'POST only'));
|
|
55
57
|
const read = await ctx.readJson(req);
|
|
56
58
|
if (!read.ok) return send(bad(400, 'the body is not JSON'));
|
|
@@ -85,9 +87,11 @@ async function handle(req, res, url, ctx) {
|
|
|
85
87
|
const r = records().addReading(root, cur.rid, { at: today(), value: n }, UI(), 'Steps done, from Insights');
|
|
86
88
|
return send(r.ok ? { status: 200, body: { ok: true, done: n } } : bad(400, r.reasons.join('; ')));
|
|
87
89
|
}
|
|
88
|
-
if (what === 'target') {
|
|
89
|
-
const r = IR.append(w.root,
|
|
90
|
-
|
|
90
|
+
if (what === 'target' || what === 'tile') {
|
|
91
|
+
const r = IR.append(w.root, what, body, g.actor, { now });
|
|
92
|
+
if (!r.ok) return send(bad(r.status, r.error));
|
|
93
|
+
const R = IR.read(w.root);
|
|
94
|
+
return send({ status: 200, body: what === 'target' ? { ok: true, targets: R.targets } : { ok: true, tiles: R.tiles } });
|
|
91
95
|
}
|
|
92
96
|
const ids = dashRoutes.boardIds(ctx, w);
|
|
93
97
|
if (!ids) return send(bad(503, 'The boards could not be read. Try again in a moment.'));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* routes-meeting-points.js — the Replay's Confirm and Not right (initiative premium-uncovered-features, area meetings; lib/route-modules.js).
|
|
3
|
+
* The data is kept by lib/meeting-points.js.
|
|
4
|
+
*
|
|
5
|
+
* GET /api/meeting-points?note=<id> → { ok, points: { [pointId]: 'confirmed' | 'wrong' } }
|
|
6
|
+
* POST /api/meeting-points { note, ids: [pointId], verdict } → { ok, points } verdict confirmed | wrong | null (Undo)
|
|
7
|
+
* The POST is a page press (lib/pm-guard.js requirePagePress). Handlers are pure over (q | body, ctx) so a test needs no server. */
|
|
8
|
+
const MP = require('./meeting-points.js');
|
|
9
|
+
const guard = require('./pm-guard.js');
|
|
10
|
+
|
|
11
|
+
const fail = (status, error) => ({ status, body: { ok: false, error } });
|
|
12
|
+
|
|
13
|
+
function read(q, ctx) {
|
|
14
|
+
if (!/^[A-Za-z0-9_-]{1,80}$/.test(String(q.note || ''))) return fail(400, 'note is the id of a meeting note');
|
|
15
|
+
return { status: 200, body: { ok: true, points: MP.pointsOf(ctx.runtimeDir, String(q.note)) } };
|
|
16
|
+
}
|
|
17
|
+
function write(req, body, ctx) {
|
|
18
|
+
const g = guard.requirePagePress(req, body);
|
|
19
|
+
if (!g.ok) return fail(g.status, g.error);
|
|
20
|
+
const r = MP.setPoints(ctx.runtimeDir, body);
|
|
21
|
+
return r.ok ? { status: 200, body: { ok: true, points: r.points } } : fail(r.status || 400, r.error);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const respond = (ctx, res, r) => { ctx.json(res, r.body, r.status); return true; };
|
|
25
|
+
|
|
26
|
+
module.exports = {
|
|
27
|
+
prefixes: ['/api/meeting-points'],
|
|
28
|
+
read, write,
|
|
29
|
+
handle: async (req, res, url, ctx) => {
|
|
30
|
+
if (url.pathname !== '/api/meeting-points') return false;
|
|
31
|
+
if (req.method === 'GET') return respond(ctx, res, read(Object.fromEntries(url.searchParams), ctx));
|
|
32
|
+
if (req.method !== 'POST') return respond(ctx, res, fail(405, 'GET or POST'));
|
|
33
|
+
const got = await ctx.readJson(req);
|
|
34
|
+
if (!got.ok || !got.body || typeof got.body !== 'object' || Array.isArray(got.body)) return respond(ctx, res, fail(400, 'the body must be a JSON object'));
|
|
35
|
+
return respond(ctx, res, write(req, got.body, ctx));
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* routes-news.js — New for you (initiative premium-uncovered-features, E2; lib/news-for-you.js).
|
|
3
|
+
*
|
|
4
|
+
* GET /api/news-for-you → { ok, count, groups, read } the FYI items not seen yet: mentions, tasks given to you, finished work
|
|
5
|
+
* POST /api/news-for-you/seen { ids } → { ok } one line in <runtime>/news-seen.jsonl; the agent inbox's own ids also go to its seen file,
|
|
6
|
+
* so its count agrees. A page press only (pm-guard requirePagePress).
|
|
7
|
+
*
|
|
8
|
+
* The read asks the routes the pages already read, answered by their own handlers: GET /api/inbox, GET /api/brief-page (its mentions) and
|
|
9
|
+
* GET /api/pm-items (the Work lists). A route that cannot be read gives no items and says so in `read`. Nothing here sends anything. */
|
|
10
|
+
const guard = require('./pm-guard.js');
|
|
11
|
+
const News = require('./news-for-you.js');
|
|
12
|
+
|
|
13
|
+
/** One GET answered by a route module's own handler, as routes-my-work-premium.js listView does. null when it did not answer. */
|
|
14
|
+
async function ask(mod, req, ctx, p) {
|
|
15
|
+
let body = null;
|
|
16
|
+
const c = Object.assign({}, ctx, { json: (res, obj) => { body = obj; } });
|
|
17
|
+
try { await require(mod).handle({ method: 'GET', headers: (req && req.headers) || {} }, {}, new URL('http://local' + p), c); } catch { body = null; }
|
|
18
|
+
return body;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = {
|
|
22
|
+
prefixes: ['/api/news-for-you'],
|
|
23
|
+
handle: async (req, res, url, ctx) => {
|
|
24
|
+
const p = url.pathname;
|
|
25
|
+
if (p === '/api/news-for-you/seen') {
|
|
26
|
+
if (req.method !== 'POST') { ctx.json(res, { ok: false, error: 'POST only' }, 405); return true; }
|
|
27
|
+
const got = await ctx.readJson(req);
|
|
28
|
+
if (!got.ok) { ctx.json(res, { ok: false, error: 'invalid JSON body' }, 400); return true; }
|
|
29
|
+
const b = got.body || {};
|
|
30
|
+
const g = guard.requirePagePress(req, b);
|
|
31
|
+
if (!g.ok) { ctx.json(res, { ok: false, error: g.error }, g.status); return true; }
|
|
32
|
+
const err = News.badSeen(b);
|
|
33
|
+
if (err) { ctx.json(res, { ok: false, error: err }, 400); return true; }
|
|
34
|
+
if (!ctx.runtimeDir) { ctx.json(res, { ok: false, error: 'no runtime folder' }, 500); return true; }
|
|
35
|
+
News.appendSeen(ctx.runtimeDir, b.ids);
|
|
36
|
+
const ib = News.inboxIds(b.ids);
|
|
37
|
+
for (let i = 0; i < ib.length; i += 100) require('./agent-inbox.js').appendSeen(ctx.runtimeDir, { ids: ib.slice(i, i + 100) });
|
|
38
|
+
ctx.json(res, { ok: true });
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
if (p !== '/api/news-for-you') return false;
|
|
42
|
+
if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
|
|
43
|
+
const ws = url.searchParams.get('ws');
|
|
44
|
+
const [inbox, brief, work] = await Promise.all([
|
|
45
|
+
ask('./routes-inbox.js', req, ctx, '/api/inbox'),
|
|
46
|
+
ask('./routes-brief-page.js', req, ctx, '/api/brief-page' + (ws ? '?ws=' + encodeURIComponent(ws) : '')),
|
|
47
|
+
ask('./routes-pm-items.js', req, ctx, '/api/pm-items'),
|
|
48
|
+
]);
|
|
49
|
+
const out = News.build({
|
|
50
|
+
inbox, mentions: brief && brief.ok !== false ? brief.mentions : null, work: work && work.ok !== false ? work : null,
|
|
51
|
+
seen: ctx.runtimeDir ? News.readSeen(ctx.runtimeDir) : new Set(),
|
|
52
|
+
});
|
|
53
|
+
out.read.mentions = !!(brief && brief.ok !== false); // no brief for today is read too: it has no mentions
|
|
54
|
+
ctx.json(res, { ok: true, ...out });
|
|
55
|
+
return true;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -70,7 +70,8 @@
|
|
|
70
70
|
* POST /api/notes/final-edit { id, sec: 'overview'|'decision'|'action'|'question', i?, text, field?: 'owner'|'due'|'why' } → { ok, final_notes } the PM's correction
|
|
71
71
|
* GET /api/notes also answers `series_open`: { <series key>: { open, carried } }, the actions each meeting series carries open.
|
|
72
72
|
* GET /api/notes/series?key= → { ok, series } one regular meeting's notes together (lib/notes-series.js thread)
|
|
73
|
-
* GET /api/notes/search?q= → { ok, ids }
|
|
73
|
+
* GET /api/notes/search?q= → { ok, ids, hits: [{ id, snip, open }] } the notes whose title, notes or transcript hold every word (a private
|
|
74
|
+
* note: its title); each hit with the passage that holds a word, and whether it is an open step or question
|
|
74
75
|
* POST /api/notes/series-done { key, text, kind: 'action'|'question', done? } → { ok } the PM marks a carried action done, a question answered
|
|
75
76
|
* POST /api/notes/series-bring { key, text } → { ok, line } · POST /api/notes/series-unbring { key, id } → { ok } lines to bring up next time
|
|
76
77
|
* POST /api/notes/series-member { id, key: '<series key>'|'off'|null } → { ok, series } put a note in a series, take it out, or back to automatic
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* finished working hours, "Finished for you": the agent's tasks of today's day run (goals/<date>.run.json, lib/day-run.js) that have a
|
|
8
8
|
* draft. { id, title, summary, body, at, status, link, source }; body keeps its lines (markdown, at most 8000 characters); status 'review' (waits for the PM's approval at the desk),
|
|
9
9
|
* 'done' (an auto task) or 'sent'. Newest first, at most 5.
|
|
10
|
-
* recap evening: how the day went. meetings = today's meetings that have ended; decided = the decisions
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* recap evening: how the day went. meetings = today's meetings that have ended; decided = the decisions of today's meetings that
|
|
11
|
+
* the PM CONFIRMED in the meeting's Replay (lib/meeting-points.js); to_confirm = the decisions caught in today's notes that
|
|
12
|
+
* the PM has not confirmed yet (a caught decision is a guess until then, so it never counts as moved); done = the PM's own
|
|
13
|
+
* items marked done today; finished = the agent's drafts of today. moved = at most 5 rows of { kind: 'decision'|'done'|'agent',
|
|
14
|
+
* text, sub }: the confirmed decisions first, then the items done, then the drafts.
|
|
13
15
|
* tomorrow end of the day: the next working day (Monday to Friday) and its meetings, in the shape of GET /api/brief-page today[] rows
|
|
14
16
|
* (routes-brief-page.js todayAgenda), so the companion opens their briefs the same way.
|
|
15
17
|
* A private note is never read. A file that is missing or unreadable counts as empty. */
|
|
@@ -17,6 +19,8 @@ const fs = require('fs');
|
|
|
17
19
|
const path = require('path');
|
|
18
20
|
const pmItems = require('./pm-items.js');
|
|
19
21
|
const { todayAgenda, notesAdapter } = require('./routes-brief-page.js');
|
|
22
|
+
const { caughtOf } = require('./meeting-replay.js');
|
|
23
|
+
const meetingPoints = require('./meeting-points.js');
|
|
20
24
|
|
|
21
25
|
const pad = (n) => String(n).padStart(2, '0');
|
|
22
26
|
const localDate = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
@@ -42,7 +46,8 @@ function finishedOf(run) {
|
|
|
42
46
|
.sort((a, b) => String(b.at || '').localeCompare(String(a.at || '')));
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
/** deps: { events, items, run, notes: [note with final_notes], adapter
|
|
49
|
+
/** deps: { events, items, run, notes: [note with final_notes], adapter, points: (noteId) → { [pointId]: 'confirmed' | 'wrong' } }
|
|
50
|
+
* notes are today's non-private notes, read in full. A decision's point id is the Replay's (lib/meeting-replay.js): d1, d2, … in caughtOf order. */
|
|
46
51
|
function build(query, deps = {}) {
|
|
47
52
|
const q = query || {};
|
|
48
53
|
let now = q.now ? new Date(q.now) : (deps.now ? new Date(deps.now) : new Date());
|
|
@@ -51,11 +56,15 @@ function build(query, deps = {}) {
|
|
|
51
56
|
const events = deps.events || []; const items = deps.items || [];
|
|
52
57
|
const agenda = todayAgenda(events, items, now, deps.adapter || {});
|
|
53
58
|
const finished = finishedOf(deps.run);
|
|
54
|
-
const decisions = [];
|
|
59
|
+
const decisions = []; let toConfirm = 0;
|
|
55
60
|
for (const n of deps.notes || []) {
|
|
56
61
|
if (!n || n.private) continue;
|
|
57
|
-
const
|
|
58
|
-
(
|
|
62
|
+
const pts = (deps.points && deps.points(n.id)) || {};
|
|
63
|
+
caughtOf(n).decision.forEach((x, i) => {
|
|
64
|
+
const v = pts['d' + (i + 1)];
|
|
65
|
+
if (v === 'confirmed') decisions.push({ kind: 'decision', text: clip(x.text, 200), sub: clip(n.title || (n.meeting && n.meeting.title) || 'A meeting', 80) });
|
|
66
|
+
else if (v !== 'wrong') toConfirm += 1;
|
|
67
|
+
});
|
|
59
68
|
}
|
|
60
69
|
const done = items.filter((i) => i && i.done && i.done_at && localDate(new Date(i.done_at)) === today);
|
|
61
70
|
const moved = [...decisions, ...done.map((i) => ({ kind: 'done', text: clip(i.title, 200), sub: 'Done by you' })),
|
|
@@ -63,7 +72,7 @@ function build(query, deps = {}) {
|
|
|
63
72
|
const tm = nextWorkday(now);
|
|
64
73
|
return { status: 200, body: {
|
|
65
74
|
ok: true, date: today, finished,
|
|
66
|
-
recap: { meetings: agenda.filter((m) => Date.parse(m.end || m.start) <= now.getTime()).length, decided: decisions.length, done: done.length, finished: finished.length, moved },
|
|
75
|
+
recap: { meetings: agenda.filter((m) => Date.parse(m.end || m.start) <= now.getTime()).length, decided: decisions.length, to_confirm: toConfirm, done: done.length, finished: finished.length, moved },
|
|
67
76
|
tomorrow: { date: localDate(tm), label: WD[tm.getDay()] + ' ' + tm.getDate() + ' ' + MO[tm.getMonth()], meetings: todayAgenda(events, items, tm, deps.adapter || {}) },
|
|
68
77
|
} };
|
|
69
78
|
}
|
|
@@ -95,7 +104,7 @@ module.exports = {
|
|
|
95
104
|
const today = localDate(now);
|
|
96
105
|
const events = dir ? require('./calendar-events.js').readAll(dir, { now: now.getTime() }) : [];
|
|
97
106
|
const items = dir ? pmItems.fold(pmItems.readLines(path.join(dir, 'pm-items', 'items.jsonl'))) : [];
|
|
98
|
-
const out = build({ now: now.toISOString() }, { events, items, run: dir ? readRun(dir, today) : null, notes: dir ? todaysNotes(dir, today) : [], adapter: dir ? notesAdapter(dir) : {} });
|
|
107
|
+
const out = build({ now: now.toISOString() }, { events, items, run: dir ? readRun(dir, today) : null, notes: dir ? todaysNotes(dir, today) : [], adapter: dir ? notesAdapter(dir) : {}, points: (id) => meetingPoints.pointsOf(dir, id) });
|
|
99
108
|
ctx.json(res, out.body, out.status);
|
|
100
109
|
} catch (e) {
|
|
101
110
|
ctx.json(res, { ok: false, error: 'your day could not be read: ' + (e && e.message ? e.message : String(e)) }, 500);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* routes-report-confirm.js — the Brief tab's Confirm and Use it (initiative premium-uncovered-features, workstream reports; lib/route-modules.js).
|
|
3
|
+
*
|
|
4
|
+
* GET /api/report-confirm?path=<report file> → { ok, keys: [key] }
|
|
5
|
+
* POST /api/report-confirm { path, key, act } → { ok } act: confirm | use | undo; a page press (lib/pm-guard.js requirePagePress)
|
|
6
|
+
* The records are lib/report-confirm.js, in the runtime folder. Handlers are pure over (q | body, ctx) so a test needs no server. */
|
|
7
|
+
const RC = require('./report-confirm.js');
|
|
8
|
+
const guard = require('./pm-guard.js');
|
|
9
|
+
|
|
10
|
+
const fail = (status, error) => ({ status, body: { ok: false, error } });
|
|
11
|
+
function read(q, ctx) { return { status: 200, body: { ok: true, keys: RC.confirmsOf(ctx.runtimeDir, String(q.path || '')) } }; }
|
|
12
|
+
function post(req, body, ctx) {
|
|
13
|
+
const g = guard.requirePagePress(req, body);
|
|
14
|
+
if (!g.ok) return fail(g.status, g.error);
|
|
15
|
+
const r = RC.confirm(ctx.runtimeDir, body);
|
|
16
|
+
return r.ok ? { status: 200, body: { ok: true } } : fail(r.status || 400, r.error);
|
|
17
|
+
}
|
|
18
|
+
const respond = (ctx, res, r) => { ctx.json(res, r.body, r.status); return true; };
|
|
19
|
+
|
|
20
|
+
module.exports = {
|
|
21
|
+
prefixes: ['/api/report-confirm'],
|
|
22
|
+
read, post,
|
|
23
|
+
handle: async (req, res, url, ctx) => {
|
|
24
|
+
if (url.pathname !== '/api/report-confirm') return false;
|
|
25
|
+
if (req.method === 'GET') return respond(ctx, res, read(Object.fromEntries(url.searchParams), ctx));
|
|
26
|
+
if (req.method !== 'POST') return respond(ctx, res, fail(405, 'GET or POST only'));
|
|
27
|
+
const got = await ctx.readJson(req);
|
|
28
|
+
if (!got.ok || !got.body || typeof got.body !== 'object' || Array.isArray(got.body)) return respond(ctx, res, fail(400, 'the body must be a JSON object'));
|
|
29
|
+
return respond(ctx, res, post(req, got.body, ctx));
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* routes-search.js — Search across the repository and every worktree (initiative premium-uncovered-features, E1; lib/search-index.js).
|
|
3
|
+
*
|
|
4
|
+
* GET /api/find?q=<words>&ws=<id>&wt=<id,id> → { ok, q, worktrees, counts, results, more } wt: the worktrees to search (none: all)
|
|
5
|
+
* GET /api/find/file?ws=<id>&wt=<id>&path=<p> → { ok, wt, branch, main, path, text, mtime } one file of a listed worktree, for the Viewer
|
|
6
|
+
*
|
|
7
|
+
* Read-only: nothing here writes or calls anything outside this machine. The repository is the workspace's own (ws, else the home one). */
|
|
8
|
+
const Search = require('./search-index.js');
|
|
9
|
+
|
|
10
|
+
function wsOf(ctx, id) {
|
|
11
|
+
const w = typeof ctx.getWs === 'function' ? ctx.getWs(id || '') : null;
|
|
12
|
+
return w && (!id || w.id === id) ? w : null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
prefixes: ['/api/find'],
|
|
17
|
+
handle: async (req, res, url, ctx) => {
|
|
18
|
+
const p = url.pathname;
|
|
19
|
+
if (p !== '/api/find' && p !== '/api/find/file') return false;
|
|
20
|
+
if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
|
|
21
|
+
const w = wsOf(ctx, url.searchParams.get('ws'));
|
|
22
|
+
if (!w || !w.root) { ctx.json(res, { ok: false, error: 'no such workspace' }, 404); return true; }
|
|
23
|
+
if (p === '/api/find/file') {
|
|
24
|
+
const r = Search.readFile({ root: w.root, wt: url.searchParams.get('wt') || 'main', path: url.searchParams.get('path') || '' });
|
|
25
|
+
ctx.json(res, r.ok ? r : { ok: false, error: r.error }, r.ok ? 200 : r.status || 400);
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
let notes = [];
|
|
29
|
+
try { const l = ctx.runtimeDir ? require('./notes.js').list(ctx.runtimeDir) : null; notes = l && l.ok ? l.notes : []; } catch { notes = []; }
|
|
30
|
+
const only = (url.searchParams.get('wt') || '').split(',').map((x) => x.trim()).filter(Boolean);
|
|
31
|
+
try {
|
|
32
|
+
ctx.json(res, { ws: w.id, ...Search.search({ root: w.root, q: url.searchParams.get('q') || '', only, notes }) });
|
|
33
|
+
} catch (e) {
|
|
34
|
+
ctx.json(res, { ok: false, error: 'the search could not run: ' + String((e && e.message) || e).slice(0, 160) }, 500);
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* routes-slash.js — the chat box's / menu (testing fixes: the menu listed 3 commands; it lists every command Claude Code takes).
|
|
3
|
+
*
|
|
4
|
+
* GET /api/slash-commands[?ws=<id>] → { ok, commands: [{ cmd, name, say, src }] } src 'pmos' | 'claude' | 'project' | 'yours'
|
|
5
|
+
*
|
|
6
|
+
* READ ONLY. The commands are, in this order:
|
|
7
|
+
* pmos /goal, which PMOS answers itself (goal-chat.js)
|
|
8
|
+
* claude the commands built into Claude Code
|
|
9
|
+
* project the workspace's own: .claude/commands/<name>.md and .claude/skills/<name>/SKILL.md under the workspace root
|
|
10
|
+
* yours the PM's own: the same two folders under ~/.claude
|
|
11
|
+
* A custom command's `say` is its frontmatter `description`, else its first line of text. A file that cannot be read is left out. */
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const os = require('os');
|
|
14
|
+
const path = require('path');
|
|
15
|
+
|
|
16
|
+
const PMOS = [{ cmd: '/goal', name: 'Give Claude a goal', say: 'It asks a few questions to make the goal SMART, then works on it after you press Start.' }];
|
|
17
|
+
const CLAUDE = [
|
|
18
|
+
['/compact', 'Compact the conversation', 'Claude Code summarises the conversation so far to free room.'],
|
|
19
|
+
['/clear', 'Clear the conversation', 'Claude Code starts again with an empty context in the same session.'],
|
|
20
|
+
['/context', 'Show the context', 'How full the context window is, and what fills it.'],
|
|
21
|
+
['/cost', 'Show the cost', 'The tokens and cost of this session so far.'],
|
|
22
|
+
['/model', 'Change the model', 'Pick the model the session uses from now on.'],
|
|
23
|
+
['/review', 'Review a pull request', 'Claude Code reviews a pull request.'],
|
|
24
|
+
['/security-review', 'Security review', 'Claude Code checks the pending changes for security issues.'],
|
|
25
|
+
['/pr-comments', 'Pull request comments', 'Claude Code reads the comments on a pull request.'],
|
|
26
|
+
['/init', 'Write CLAUDE.md', 'Claude Code writes a CLAUDE.md that describes this repository.'],
|
|
27
|
+
['/memory', 'Edit memory', 'Open the CLAUDE.md memory files.'],
|
|
28
|
+
['/add-dir', 'Add a folder', 'Let the session read and work in another folder.'],
|
|
29
|
+
['/agents', 'Subagents', 'List and manage the subagents.'],
|
|
30
|
+
['/mcp', 'MCP servers', 'The MCP servers and their state.'],
|
|
31
|
+
['/permissions', 'Permissions', 'What the session may do without asking.'],
|
|
32
|
+
['/hooks', 'Hooks', 'The hooks that run on tool calls.'],
|
|
33
|
+
['/todos', 'To-dos', 'The session’s current to-do list.'],
|
|
34
|
+
['/export', 'Export the conversation', 'Save the conversation to a file or the clipboard.'],
|
|
35
|
+
['/status', 'Status', 'The version, the model, the account and the connections.'],
|
|
36
|
+
['/doctor', 'Check the install', 'Claude Code checks its own installation.'],
|
|
37
|
+
['/help', 'Help', 'The commands Claude Code takes.'],
|
|
38
|
+
].map(([cmd, name, say]) => ({ cmd, name, say }));
|
|
39
|
+
|
|
40
|
+
const NAME = /^[A-Za-z0-9][A-Za-z0-9_:.-]{0,63}$/;
|
|
41
|
+
function read(file) { try { return fs.readFileSync(file, 'utf8').slice(0, 8000); } catch { return null; } }
|
|
42
|
+
/** The description of a command or skill file: frontmatter `description`, else the first line of text. */
|
|
43
|
+
function sayOf(text) {
|
|
44
|
+
const t = String(text || '');
|
|
45
|
+
const fm = /^---\r?\n([\s\S]*?)\r?\n---/.exec(t);
|
|
46
|
+
const d = fm && /^description:\s*(.+)$/m.exec(fm[1]);
|
|
47
|
+
if (d) return d[1].trim().replace(/^["']|["']$/g, '').slice(0, 200);
|
|
48
|
+
const body = fm ? t.slice(fm[0].length) : t;
|
|
49
|
+
const line = body.split('\n').map((l) => l.replace(/^#+\s*/, '').trim()).find(Boolean);
|
|
50
|
+
return (line || '').slice(0, 200);
|
|
51
|
+
}
|
|
52
|
+
/** The commands and skills under one .claude folder. */
|
|
53
|
+
function customOf(dir, src) {
|
|
54
|
+
const out = [];
|
|
55
|
+
let names = [];
|
|
56
|
+
try { names = fs.readdirSync(path.join(dir, 'commands')); } catch { names = []; }
|
|
57
|
+
for (const f of names) {
|
|
58
|
+
const n = f.replace(/\.md$/, '');
|
|
59
|
+
if (!f.endsWith('.md') || !NAME.test(n)) continue;
|
|
60
|
+
const t = read(path.join(dir, 'commands', f)); if (t == null) continue;
|
|
61
|
+
out.push({ cmd: '/' + n, name: n, say: sayOf(t), src });
|
|
62
|
+
}
|
|
63
|
+
try { names = fs.readdirSync(path.join(dir, 'skills')); } catch { names = []; }
|
|
64
|
+
for (const n of names) {
|
|
65
|
+
if (!NAME.test(n)) continue;
|
|
66
|
+
const t = read(path.join(dir, 'skills', n, 'SKILL.md')); if (t == null) continue;
|
|
67
|
+
out.push({ cmd: '/' + n, name: n, say: sayOf(t), src });
|
|
68
|
+
}
|
|
69
|
+
return out.sort((a, b) => a.cmd.localeCompare(b.cmd));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** deps: { root (the workspace's folder), home (the PM's home folder) } */
|
|
73
|
+
function list(deps = {}) {
|
|
74
|
+
const seen = new Set(), out = [];
|
|
75
|
+
const add = (x, src) => { if (seen.has(x.cmd)) return; seen.add(x.cmd); out.push({ ...x, src: x.src || src }); };
|
|
76
|
+
PMOS.forEach((x) => add(x, 'pmos'));
|
|
77
|
+
CLAUDE.forEach((x) => add(x, 'claude'));
|
|
78
|
+
if (deps.root) customOf(path.join(deps.root, '.claude'), 'project').forEach((x) => add(x));
|
|
79
|
+
if (deps.home) customOf(path.join(deps.home, '.claude'), 'yours').forEach((x) => add(x));
|
|
80
|
+
return { status: 200, body: { ok: true, commands: out } };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
module.exports = {
|
|
84
|
+
prefixes: ['/api/slash-commands'],
|
|
85
|
+
list, sayOf, CLAUDE,
|
|
86
|
+
handle: async (req, res, url, ctx) => {
|
|
87
|
+
if (url.pathname !== '/api/slash-commands') return false;
|
|
88
|
+
if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
|
|
89
|
+
const ws = url.searchParams.get('ws');
|
|
90
|
+
const w = ws && ctx.getWs ? ctx.getWs(ws) : null;
|
|
91
|
+
const r = list({ root: w ? w.root : ctx.root || null, home: os.homedir() });
|
|
92
|
+
ctx.json(res, r.body, r.status);
|
|
93
|
+
return true;
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* search-index.js — Search across the repository and every worktree (initiative premium-uncovered-features, E1; canvas EvSearch, EvPhone).
|
|
3
|
+
*
|
|
4
|
+
* worktrees(root) → [{ id, name, path, branch, head, main }] `git worktree list --porcelain`; the first is the main one
|
|
5
|
+
* kindOf(relPath) → 'initiative' | 'document' | 'slides' | 'report' | 'artifact' | 'file' | null PURE
|
|
6
|
+
* titleOf(text, relPath) → the frontmatter title, else the first "# " heading, else the file name PURE
|
|
7
|
+
* search({ root, q, only, notes, now }) → { ok, q, worktrees, counts, results, more } READ-ONLY
|
|
8
|
+
* readFile({ root, wt, path }) → { ok, text, path, wt } | { ok: false, status, error } one file of a listed worktree, read-only
|
|
9
|
+
*
|
|
10
|
+
* What is searched. Every file git knows in the main worktree (tracked, plus untracked files that are not ignored), and in each other worktree
|
|
11
|
+
* only the files that differ from the main worktree's HEAD (changed, committed on its branch, or new). So a file shows once, from main, unless
|
|
12
|
+
* a worktree holds another version of it: then that version shows too, marked with the worktree, so a draft that is not merged can be found.
|
|
13
|
+
* A file matches by its path or name, or by its text (git grep, case-insensitive, fixed string). Meetings are the note titles (lib/notes.js).
|
|
14
|
+
* Nothing here writes. Every git call has a time limit and a size limit; a worktree that cannot be read is listed with its error. */
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
const { execFileSync } = require('child_process');
|
|
18
|
+
|
|
19
|
+
const KINDS = ['initiative', 'document', 'slides', 'report', 'artifact', 'meeting'];
|
|
20
|
+
const MAX_FILES = 40000;
|
|
21
|
+
const MAX_PER_KIND = 30;
|
|
22
|
+
const SKIP = /(^|\/)(node_modules|\.git|vendor|dist|build|coverage|\.next|\.claude\/worktrees)(\/|$)/;
|
|
23
|
+
const BINARY = /\.(png|jpe?g|gif|webp|ico|woff2?|ttf|otf|mp3|mp4|wav|webm|zip|gz|tgz|lock)$/i;
|
|
24
|
+
const DESIGN = /\.(html?|svg|pdf|fig|sketch)$/i;
|
|
25
|
+
const SLIDES = /\.(pptx|key|odp)$/i;
|
|
26
|
+
const CODE = /\.(m?js|cjs|ts|tsx|jsx|css|py|sh|json|jsonl|ya?ml|go|rb|rs|java|kt|swift|sql)$/i;
|
|
27
|
+
|
|
28
|
+
function git(cwd, args, { timeout = 8000, max = 32 * 1024 * 1024 } = {}) {
|
|
29
|
+
return execFileSync('git', args, { cwd, encoding: 'utf8', timeout, maxBuffer: max, stdio: ['ignore', 'pipe', 'ignore'] });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The worktrees of the repository at root, the main one first. Each id is stable and safe in a URL: 'main' or the folder name. */
|
|
33
|
+
function worktrees(root) {
|
|
34
|
+
let out = '';
|
|
35
|
+
try { out = git(root, ['worktree', 'list', '--porcelain']); } catch { return [{ id: 'main', name: 'main', path: path.resolve(root), branch: '', head: '', main: true }]; }
|
|
36
|
+
const list = [];
|
|
37
|
+
let cur = null;
|
|
38
|
+
for (const line of out.split('\n')) {
|
|
39
|
+
if (line.startsWith('worktree ')) { cur = { path: line.slice(9).trim(), branch: '', head: '', bare: false }; list.push(cur); }
|
|
40
|
+
else if (!cur) continue;
|
|
41
|
+
else if (line.startsWith('HEAD ')) cur.head = line.slice(5).trim();
|
|
42
|
+
else if (line.startsWith('branch ')) cur.branch = line.slice(7).trim().replace(/^refs\/heads\//, '');
|
|
43
|
+
else if (line === 'bare') cur.bare = true;
|
|
44
|
+
}
|
|
45
|
+
const used = new Set();
|
|
46
|
+
return list.filter((w) => !w.bare).map((w, i) => {
|
|
47
|
+
let id = i === 0 ? 'main' : path.basename(w.path).replace(/[^A-Za-z0-9._-]/g, '-').slice(0, 80) || 'wt' + i;
|
|
48
|
+
while (used.has(id)) id += '-' + i;
|
|
49
|
+
used.add(id);
|
|
50
|
+
return { id, name: i === 0 ? (w.branch || 'main') : (w.branch || path.basename(w.path)), path: w.path, branch: w.branch, head: w.head, main: i === 0 };
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The kind of a file, from its path alone. null: not something Search lists. Pure. */
|
|
55
|
+
function kindOf(rel) {
|
|
56
|
+
const p = String(rel || '').replace(/\\/g, '/');
|
|
57
|
+
if (!p || SKIP.test(p) || BINARY.test(p)) return null;
|
|
58
|
+
const base = p.split('/').pop();
|
|
59
|
+
if (/^planning\/initiatives\/[^/]+\.md$/.test(p)) return 'initiative';
|
|
60
|
+
if (SLIDES.test(p) || /(^|[-_.])(deck|slides)([-_.]|$)/i.test(base)) return 'slides';
|
|
61
|
+
if (/(^|\/)reports\//.test(p) && /\.(md|html?|pdf)$/i.test(p)) return 'report';
|
|
62
|
+
if (/\.(md|mdx|txt|docx?)$/i.test(p)) return 'document';
|
|
63
|
+
if (DESIGN.test(p)) return 'artifact';
|
|
64
|
+
if (CODE.test(p)) return 'file';
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
/** The group a kind is counted in: a code file is counted with the artifacts (EvSearch "Artifacts and designs"). */
|
|
68
|
+
const groupOf = (kind) => (kind === 'file' ? 'artifact' : kind);
|
|
69
|
+
|
|
70
|
+
/** A document's title: its frontmatter title, else its first "# " heading, else its file name without the extension. Pure. */
|
|
71
|
+
function titleOf(text, rel) {
|
|
72
|
+
const t = String(text || '');
|
|
73
|
+
const fm = /^---\r?\n([\s\S]*?)\r?\n---/.exec(t);
|
|
74
|
+
if (fm) { const m = /^title:\s*["']?(.+?)["']?\s*$/m.exec(fm[1]); if (m && m[1].trim()) return m[1].trim().slice(0, 160); }
|
|
75
|
+
const h = /^#\s+(.+)$/m.exec(t);
|
|
76
|
+
if (h) return h[1].trim().slice(0, 160);
|
|
77
|
+
const base = String(rel || '').split('/').pop() || '';
|
|
78
|
+
return base.replace(/\.[^.]+$/, '') || base;
|
|
79
|
+
}
|
|
80
|
+
const fmField = (text, key) => { const fm = /^---\r?\n([\s\S]*?)\r?\n---/.exec(String(text || '')); if (!fm) return ''; const m = new RegExp('^' + key + ':\\s*["\']?(.+?)["\']?\\s*$', 'm').exec(fm[1]); return m ? m[1].trim().slice(0, 80) : ''; };
|
|
81
|
+
|
|
82
|
+
/** The files of one worktree that Search reads. Main: every file git knows. Another: the files that differ from main's HEAD. */
|
|
83
|
+
function filesOf(wt, mainHead) {
|
|
84
|
+
const lines = (s) => s.split('\n').map((x) => x.trim()).filter(Boolean);
|
|
85
|
+
if (wt.main) return lines(git(wt.path, ['ls-files', '-co', '--exclude-standard'])).slice(0, MAX_FILES);
|
|
86
|
+
// since the branch left main (its merge base), so a file main changed later is not shown as this worktree's draft
|
|
87
|
+
let base = '';
|
|
88
|
+
if (mainHead) { try { base = git(wt.path, ['merge-base', 'HEAD', mainHead]).trim(); } catch { base = mainHead; } }
|
|
89
|
+
const changed = base ? lines(git(wt.path, ['diff', '--name-only', '--diff-filter=ACMR', base])) : [];
|
|
90
|
+
const fresh = lines(git(wt.path, ['ls-files', '-o', '--exclude-standard']));
|
|
91
|
+
return [...new Set(changed.concat(fresh))].slice(0, MAX_FILES);
|
|
92
|
+
}
|
|
93
|
+
/** The files whose text holds q (case-insensitive, fixed string), among `among`. */
|
|
94
|
+
function textHits(wt, q, among) {
|
|
95
|
+
if (!among.length) return new Set();
|
|
96
|
+
const args = ['grep', '-I', '-l', '-i', '-F', '--untracked', '-e', q, '--'];
|
|
97
|
+
const out = new Set();
|
|
98
|
+
for (let i = 0; i < among.length; i += 400) { // a long list goes in parts, so the command line stays short
|
|
99
|
+
try { for (const l of git(wt.path, args.concat(among.slice(i, i + 400)), { timeout: 10000 }).split('\n')) if (l.trim()) out.add(l.trim()); }
|
|
100
|
+
catch (e) { if (!(e && e.status === 1)) throw e; } // 1: no match
|
|
101
|
+
}
|
|
102
|
+
return out;
|
|
103
|
+
}
|
|
104
|
+
/** The first line of text that holds q, shortened around it. */
|
|
105
|
+
function lineOf(text, q) {
|
|
106
|
+
const low = q.toLowerCase();
|
|
107
|
+
const l = String(text || '').split('\n').find((x) => x.toLowerCase().includes(low));
|
|
108
|
+
if (!l) return '';
|
|
109
|
+
const s = l.replace(/^[#>*\-\s]+/, '').trim(), at = s.toLowerCase().indexOf(low);
|
|
110
|
+
return (at > 60 ? '…' + s.slice(at - 40) : s).slice(0, 120);
|
|
111
|
+
}
|
|
112
|
+
const readText = (abs, max = 256 * 1024) => { try { const st = fs.statSync(abs); if (!st.isFile() || st.size > max) return { text: '', mtime: st.mtimeMs }; return { text: fs.readFileSync(abs, 'utf8'), mtime: st.mtimeMs }; } catch { return { text: '', mtime: 0 }; } };
|
|
113
|
+
|
|
114
|
+
/** Search one query. only: worktree ids to search ([] or null: all). notes: lib/notes.js list rows, for meetings. */
|
|
115
|
+
function search({ root, q, only = null, notes = [], now = Date.now() } = {}) {
|
|
116
|
+
const query = String(q || '').trim().slice(0, 120);
|
|
117
|
+
const all = worktrees(root);
|
|
118
|
+
const pick = Array.isArray(only) && only.length ? all.filter((w) => w.main || only.includes(w.id)) : all;
|
|
119
|
+
const counts = Object.fromEntries(KINDS.map((k) => [k, 0]));
|
|
120
|
+
const shownWt = all.map((w) => ({ id: w.id, name: w.name, branch: w.branch, main: w.main, on: pick.includes(w) }));
|
|
121
|
+
if (query.length < 2) return { ok: true, q: query, worktrees: shownWt, counts, results: [], more: 0 };
|
|
122
|
+
const mainHead = (all[0] && all[0].head) || '';
|
|
123
|
+
const low = query.toLowerCase();
|
|
124
|
+
const results = [];
|
|
125
|
+
const errors = [];
|
|
126
|
+
const day = new Date(now).toDateString();
|
|
127
|
+
for (const wt of pick) {
|
|
128
|
+
let files;
|
|
129
|
+
try { files = filesOf(wt, mainHead); } catch (e) { errors.push({ wt: wt.id, error: 'could not be read' }); const s = shownWt.find((x) => x.id === wt.id); if (s) s.error = 'could not be read'; continue; }
|
|
130
|
+
const kinds = new Map();
|
|
131
|
+
for (const f of files) { const k = kindOf(f); if (k) kinds.set(f, k); }
|
|
132
|
+
const byName = [...kinds.keys()].filter((f) => f.toLowerCase().includes(low));
|
|
133
|
+
let byText = new Set();
|
|
134
|
+
try { byText = textHits(wt, query, [...kinds.keys()].filter((f) => /\.(md|mdx|txt|html?)$/i.test(f))); } catch { byText = new Set(); }
|
|
135
|
+
for (const f of new Set(byName.concat([...byText]))) {
|
|
136
|
+
const kind = kinds.get(f); if (!kind) continue;
|
|
137
|
+
const abs = path.join(wt.path, f);
|
|
138
|
+
const { text, mtime } = /\.(md|mdx|txt|html?)$/i.test(f) ? readText(abs) : { text: '', mtime: (() => { try { return fs.statSync(abs).mtimeMs; } catch { return 0; } })() };
|
|
139
|
+
const title = /\.(md|mdx|txt)$/i.test(f) ? titleOf(text, f) : f.split('/').pop();
|
|
140
|
+
const named = f.toLowerCase().includes(low) || title.toLowerCase().includes(low);
|
|
141
|
+
const r = { kind, group: groupOf(kind), title, path: f, dir: path.posix.dirname(f), wt: wt.id, branch: wt.branch || '', main: wt.main, why: named ? 'name' : 'text' };
|
|
142
|
+
if (!named) r.line = lineOf(text, query);
|
|
143
|
+
if (kind === 'initiative') { r.id = path.posix.basename(f, '.md'); r.lane = fmField(text, 'lane'); }
|
|
144
|
+
if (!wt.main) r.draft = true;
|
|
145
|
+
if (mtime && new Date(mtime).toDateString() === day) r.today = true;
|
|
146
|
+
results.push(r);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
for (const n of notes || []) {
|
|
150
|
+
const t = String((n && n.title) || '');
|
|
151
|
+
if (!n || !n.id || !t.toLowerCase().includes(low)) continue;
|
|
152
|
+
results.push({ kind: 'meeting', group: 'meeting', title: t, id: n.id, at: (n.meeting && n.meeting.start) || n.created_at || null, summary: !!n.summary, private: !!n.private, why: 'name' });
|
|
153
|
+
}
|
|
154
|
+
// the order: a name match before a text match, main before a worktree, then the shorter path (the nearer file)
|
|
155
|
+
results.sort((a, b) => (a.why === b.why ? 0 : a.why === 'name' ? -1 : 1) || (a.main === b.main ? 0 : a.main === false ? 1 : -1) || String(a.path || '').length - String(b.path || '').length);
|
|
156
|
+
const shown = [];
|
|
157
|
+
let more = 0;
|
|
158
|
+
for (const r of results) { counts[r.group] = (counts[r.group] || 0) + 1; if (shown.filter((x) => x.group === r.group).length < MAX_PER_KIND) shown.push(r); else more++; }
|
|
159
|
+
return { ok: true, q: query, worktrees: shownWt, counts, results: shown, more, errors };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** One file of a listed worktree, for the Viewer. The path must be a relative path inside the worktree; nothing outside it is read. */
|
|
163
|
+
function readFile({ root, wt, path: rel } = {}) {
|
|
164
|
+
const w = worktrees(root).find((x) => x.id === (wt || 'main'));
|
|
165
|
+
if (!w) return { ok: false, status: 404, error: 'no such worktree' };
|
|
166
|
+
const p = String(rel || '').replace(/\\/g, '/');
|
|
167
|
+
if (!p || p.startsWith('/') || p.split('/').includes('..') || SKIP.test(p)) return { ok: false, status: 400, error: 'path must be a relative path inside the worktree' };
|
|
168
|
+
const abs = path.resolve(w.path, p);
|
|
169
|
+
if (!abs.startsWith(path.resolve(w.path) + path.sep)) return { ok: false, status: 400, error: 'path must be a relative path inside the worktree' };
|
|
170
|
+
let st; try { st = fs.statSync(abs); } catch { return { ok: false, status: 404, error: 'The file moved or was renamed after it was found.' }; }
|
|
171
|
+
if (!st.isFile()) return { ok: false, status: 404, error: 'not a file' };
|
|
172
|
+
if (st.size > 1024 * 1024 || BINARY.test(p)) return { ok: false, status: 413, error: 'This file is too large or not text, so it is not shown here.' };
|
|
173
|
+
return { ok: true, wt: w.id, branch: w.branch, main: w.main, path: p, text: fs.readFileSync(abs, 'utf8'), mtime: new Date(st.mtimeMs).toISOString() };
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
module.exports = { KINDS, worktrees, kindOf, groupOf, titleOf, lineOf, search, readFile };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.400.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.400.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.400.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"start": "node server.js",
|
|
12
12
|
"test": "node run-tests.js unit",
|
|
13
13
|
"test:modules": "node run-tests.js modules",
|
|
14
|
-
"test:ui": "node ui-test.js",
|
|
15
14
|
"test:all": "node run-tests.js all && npm run test:offline",
|
|
16
15
|
"doctor": "node doctor.js",
|
|
17
16
|
"test:panels": "node run-tests.js panels",
|