@pennyfarthing/core 11.3.8 → 11.4.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/README.md +1 -1
- package/package.json +4 -1
- package/packages/core/dist/public/css/react.css +1 -1
- package/packages/core/dist/public/js/react/react.js +24 -24
- package/packages/core/src/public/App.tsx +356 -0
- package/packages/core/src/public/components/AgentLoadDialog.tsx +202 -0
- package/packages/core/src/public/components/AgentPopup.tsx +308 -0
- package/packages/core/src/public/components/ApprovalModal/ApprovalModal.css +35 -0
- package/packages/core/src/public/components/ApprovalModal/index.tsx +632 -0
- package/packages/core/src/public/components/BikeRackIndex.tsx +53 -0
- package/packages/core/src/public/components/BikeRackWorkspace.tsx +217 -0
- package/packages/core/src/public/components/CommandPalette.tsx +554 -0
- package/packages/core/src/public/components/ConfirmDialog.tsx +168 -0
- package/packages/core/src/public/components/ContextIndicator/ContextIndicator.css +85 -0
- package/packages/core/src/public/components/ContextIndicator/index.tsx +330 -0
- package/packages/core/src/public/components/ContextSparkline.tsx +56 -0
- package/packages/core/src/public/components/ControlBar.tsx +636 -0
- package/packages/core/src/public/components/DeadCodeDialog.tsx +169 -0
- package/packages/core/src/public/components/DiffViewer.tsx +585 -0
- package/packages/core/src/public/components/DockviewWorkspace.tsx +749 -0
- package/packages/core/src/public/components/Editor.tsx +630 -0
- package/packages/core/src/public/components/ErrorBoundary.tsx +67 -0
- package/packages/core/src/public/components/FileTree.tsx +379 -0
- package/packages/core/src/public/components/FontPicker/FontPicker.css +276 -0
- package/packages/core/src/public/components/FontPicker/index.tsx +430 -0
- package/packages/core/src/public/components/FullFileTree.tsx +237 -0
- package/packages/core/src/public/components/HealthGauge.tsx +181 -0
- package/packages/core/src/public/components/Message.tsx +225 -0
- package/packages/core/src/public/components/MessageList.tsx +98 -0
- package/packages/core/src/public/components/MessageView.tsx +400 -0
- package/packages/core/src/public/components/ModeSwitch/ModeSwitch.css +165 -0
- package/packages/core/src/public/components/ModeSwitch/index.tsx +372 -0
- package/packages/core/src/public/components/PersonaHeader.tsx +242 -0
- package/packages/core/src/public/components/ProjectInfoBar.tsx +45 -0
- package/packages/core/src/public/components/QuickActions.tsx +267 -0
- package/packages/core/src/public/components/SpanTimeline.tsx +352 -0
- package/packages/core/src/public/components/StandalonePanel.tsx +82 -0
- package/packages/core/src/public/components/StatsStrip.tsx +162 -0
- package/packages/core/src/public/components/StreamingContent.tsx +77 -0
- package/packages/core/src/public/components/SubagentSpan.tsx +180 -0
- package/packages/core/src/public/components/TandemPortrait.tsx +72 -0
- package/packages/core/src/public/components/ThemePalette/ThemePalette.css +179 -0
- package/packages/core/src/public/components/ThemePalette/index.tsx +326 -0
- package/packages/core/src/public/components/ToolCallBlock.tsx +252 -0
- package/packages/core/src/public/components/ToolStack.tsx +209 -0
- package/packages/core/src/public/components/ToolStatus.tsx +57 -0
- package/packages/core/src/public/components/dialogs/CodeMarkersDialog.tsx +169 -0
- package/packages/core/src/public/components/dialogs/ComplexityDialog.tsx +163 -0
- package/packages/core/src/public/components/dialogs/DependenciesDialog.tsx +120 -0
- package/packages/core/src/public/components/dialogs/HotspotsDialog.tsx +451 -0
- package/packages/core/src/public/components/dialogs/ToolDialog.tsx +43 -0
- package/packages/core/src/public/components/panel-registry.ts +13 -0
- package/packages/core/src/public/components/panels/ACPanel.tsx +93 -0
- package/packages/core/src/public/components/panels/AcceptanceCriteriaPanel.tsx +104 -0
- package/packages/core/src/public/components/panels/AuditLogPanel.tsx +489 -0
- package/packages/core/src/public/components/panels/BackgroundPanel.tsx +115 -0
- package/packages/core/src/public/components/panels/BikeLanePanel.tsx +214 -0
- package/packages/core/src/public/components/panels/DebugPanel.tsx +344 -0
- package/packages/core/src/public/components/panels/DiffView.tsx +109 -0
- package/packages/core/src/public/components/panels/DiffsPanel.tsx +56 -0
- package/packages/core/src/public/components/panels/GitPanel.tsx +260 -0
- package/packages/core/src/public/components/panels/HotspotsPanel.tsx +365 -0
- package/packages/core/src/public/components/panels/MessageFeed.tsx +39 -0
- package/packages/core/src/public/components/panels/MessagePanel.tsx +497 -0
- package/packages/core/src/public/components/panels/ProgressPanel.tsx +189 -0
- package/packages/core/src/public/components/panels/SettingsPanel.tsx +361 -0
- package/packages/core/src/public/components/panels/SprintPanel.tsx +723 -0
- package/packages/core/src/public/components/panels/TandemPanel.tsx +104 -0
- package/packages/core/src/public/components/panels/TaskTracker.tsx +48 -0
- package/packages/core/src/public/components/panels/TeamPanel.tsx +64 -0
- package/packages/core/src/public/components/panels/TeamRoster.tsx +67 -0
- package/packages/core/src/public/components/panels/TodoPanel.tsx +142 -0
- package/packages/core/src/public/components/panels/WorkflowPanel.tsx +224 -0
- package/packages/core/src/public/components/panels/index.ts +24 -0
- package/packages/core/src/public/components/ui/alert-dialog.tsx +139 -0
- package/packages/core/src/public/components/ui/badge.tsx +36 -0
- package/packages/core/src/public/components/ui/button.tsx +57 -0
- package/packages/core/src/public/components/ui/checkbox.tsx +28 -0
- package/packages/core/src/public/components/ui/collapsible.tsx +9 -0
- package/packages/core/src/public/components/ui/command.tsx +151 -0
- package/packages/core/src/public/components/ui/dialog.tsx +120 -0
- package/packages/core/src/public/components/ui/popover.tsx +31 -0
- package/packages/core/src/public/components/ui/progress.tsx +28 -0
- package/packages/core/src/public/components/ui/scroll-area.tsx +46 -0
- package/packages/core/src/public/components/ui/select.tsx +157 -0
- package/packages/core/src/public/components/ui/separator.tsx +29 -0
- package/packages/core/src/public/components/ui/skeleton.tsx +15 -0
- package/packages/core/src/public/components/ui/switch.tsx +27 -0
- package/packages/core/src/public/components/ui/toggle-group.tsx +59 -0
- package/packages/core/src/public/components/ui/toggle.tsx +43 -0
- package/packages/core/src/public/components/ui/tooltip.tsx +30 -0
- package/packages/core/src/public/contexts/ClaudeContext.tsx +311 -0
- package/packages/core/src/public/contexts/MessageQueueContext.tsx +143 -0
- package/packages/core/src/public/css/theme-browser.css +550 -0
- package/packages/core/src/public/css/theme-system.css +630 -0
- package/packages/core/src/public/hooks/index.ts +49 -0
- package/packages/core/src/public/hooks/useAgentLoad.ts +105 -0
- package/packages/core/src/public/hooks/useBackgroundTasks.ts +131 -0
- package/packages/core/src/public/hooks/useClaude.ts +234 -0
- package/packages/core/src/public/hooks/useCodeMarkers.ts +101 -0
- package/packages/core/src/public/hooks/useColorScheme.ts +42 -0
- package/packages/core/src/public/hooks/useCommandHistory.ts +99 -0
- package/packages/core/src/public/hooks/useComplexity.ts +80 -0
- package/packages/core/src/public/hooks/useDeadCode.ts +99 -0
- package/packages/core/src/public/hooks/useDependencies.ts +82 -0
- package/packages/core/src/public/hooks/useDiffs.ts +143 -0
- package/packages/core/src/public/hooks/useFileBrowser.ts +73 -0
- package/packages/core/src/public/hooks/useFocusPanel.ts +137 -0
- package/packages/core/src/public/hooks/useGitStatus.ts +233 -0
- package/packages/core/src/public/hooks/useHealthScore.ts +71 -0
- package/packages/core/src/public/hooks/useHotspots.ts +123 -0
- package/packages/core/src/public/hooks/useLayoutPersistence.ts +141 -0
- package/packages/core/src/public/hooks/useMarkdownParser.ts +36 -0
- package/packages/core/src/public/hooks/useMarkerActions.ts +234 -0
- package/packages/core/src/public/hooks/useMessageQueue.ts +380 -0
- package/packages/core/src/public/hooks/useMessageStream.ts +131 -0
- package/packages/core/src/public/hooks/usePersona.ts +112 -0
- package/packages/core/src/public/hooks/usePlanModeExit.ts +105 -0
- package/packages/core/src/public/hooks/useResponsiveLayout.ts +173 -0
- package/packages/core/src/public/hooks/useSprint.ts +157 -0
- package/packages/core/src/public/hooks/useStatsStrip.ts +204 -0
- package/packages/core/src/public/hooks/useStory.ts +135 -0
- package/packages/core/src/public/hooks/useSubagentHelper.ts +64 -0
- package/packages/core/src/public/hooks/useSyntaxHighlighter.ts +52 -0
- package/packages/core/src/public/hooks/useTabCompletion.ts +124 -0
- package/packages/core/src/public/hooks/useTandemObservations.ts +165 -0
- package/packages/core/src/public/hooks/useTeamMembers.ts +273 -0
- package/packages/core/src/public/hooks/useTodos.ts +93 -0
- package/packages/core/src/public/hooks/useUserAvatar.ts +54 -0
- package/packages/core/src/public/images/cyclist-dark.png +0 -0
- package/packages/core/src/public/images/cyclist-light.png +0 -0
- package/packages/core/src/public/index.html +14 -0
- package/packages/core/src/public/index.tsx +10 -0
- package/packages/core/src/public/lib/utils.ts +6 -0
- package/packages/core/src/public/styles/dockview-theme.css +376 -0
- package/packages/core/src/public/styles/tailwind.css +4454 -0
- package/packages/core/src/public/types/message.ts +51 -0
- package/packages/core/src/public/utils/avatar-service.ts +73 -0
- package/packages/core/src/public/utils/color-presets.ts +940 -0
- package/packages/core/src/public/utils/font-presets.ts +362 -0
- package/packages/core/src/public/utils/formatDuration.ts +14 -0
- package/packages/core/src/public/utils/markdown.ts +249 -0
- package/packages/core/src/public/utils/messageFilters.ts +128 -0
- package/packages/core/src/public/utils/slash-commands.ts +341 -0
- package/packages/core/src/public/utils/subagent-display.ts +146 -0
- package/packages/core/src/public/utils/syntax.ts +219 -0
- package/packages/core/src/public/utils/toolIntentSummarizer.ts +199 -0
- package/packages/core/src/public/utils/toolStackGrouper.ts +106 -0
- package/packages/core/src/public/utils/toolTypeColors.ts +45 -0
- package/pennyfarthing-dist/pf/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/__pycache__/context.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bc/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bc/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bc/__pycache__/focus.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bc/__pycache__/split.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bc/cli.py +0 -1
- package/pennyfarthing-dist/pf/bc/focus.py +0 -1
- package/pennyfarthing-dist/pf/bikerack/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/__pycache__/base_panel.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/__pycache__/git_panel.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/__pycache__/launcher.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/__pycache__/portrait_resolver.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/__pycache__/sprint_panel.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/__pycache__/story_detail_data.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/__pycache__/story_detail_screen.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/__pycache__/tui.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bikerack/base_panel.py +0 -1
- package/pennyfarthing-dist/pf/bikerack/events.py +1 -7
- package/pennyfarthing-dist/pf/bikerack/git_panel.py +273 -10
- package/pennyfarthing-dist/pf/bikerack/portrait_resolver.py +21 -0
- package/pennyfarthing-dist/pf/bikerack/sprint_panel.py +58 -1
- package/pennyfarthing-dist/pf/bikerack/tui.py +5 -20
- package/pennyfarthing-dist/pf/bmad/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bmad/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bmad/__pycache__/parser.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/bmad/parser.py +15 -9
- package/pennyfarthing-dist/pf/codemarkers/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/codemarkers/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/codemarkers/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/common/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/common/__pycache__/config.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/common/__pycache__/output.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/common/__pycache__/pr_config.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/common/__pycache__/themes.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/common/pr_config.py +27 -2
- package/pennyfarthing-dist/pf/complexity/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/complexity/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/complexity/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/consultation/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/consultation/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/deadcode/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/deadcode/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/deadcode/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/deadcode/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/dependencies/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/dependencies/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/dependencies/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/epic/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/epic/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/git_group/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/git_group/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/handoff/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/handoff/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/handoff/__pycache__/complete_phase.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/handoff/__pycache__/marker.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/handoff/__pycache__/phase_check.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/handoff/__pycache__/resolve_gate.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/healthscore/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/healthscore/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/healthscore/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/healthscore/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/healthscore/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/healthscore/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/bell_mode.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/context_breaker.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/context_warning.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/cyclist_pretooluse.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/pre_edit_check.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/reflector_check.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/schema_validation.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/session_start.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/session_stop.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/sprint_yaml_validation.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hooks/__pycache__/statusline.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hotspots/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hotspots/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hotspots/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/hotspots/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/bidirectional.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/claim.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/client.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/create.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/epic.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/operations.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/reconcile.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/story.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/jira/__pycache__/sync.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/launch/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/launch/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/prime/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/prime/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/prime/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/prime/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/prime/__pycache__/persona.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/prime/__pycache__/session.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/prime/__pycache__/tiers.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/prime/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/session/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/session/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/settings/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/settings/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/settings/__pycache__/settings.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/settings/settings.py +44 -8
- package/pennyfarthing-dist/pf/sprint/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/archive.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/archive_epic.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/epic_add.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/epic_update.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/status.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/story_add.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/story_finish.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/story_update.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/validate_cmd.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/validator.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/work.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/__pycache__/yaml_io.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/sprint/story_finish.py +14 -2
- package/pennyfarthing-dist/pf/sprint/validator.py +7 -7
- package/pennyfarthing-dist/pf/tests/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/tests/__pycache__/conftest.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing-dist/pf/tests/__pycache__/test_sprint_validator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing-dist/pf/tests/test_sprint_validator.py +44 -0
- package/pennyfarthing-dist/pf/theme/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/theme/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/validate/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/validate/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/workflow/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/workflow/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/workflow/__pycache__/helpers.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/workflow/__pycache__/scale.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/pf/workflow/__pycache__/state.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/scripts/lib/find-root.sh +1 -1
- package/pennyfarthing-dist/scripts/misc/migrate_bmad_workflow.py +0 -1
- package/pennyfarthing-dist/scripts/portraits/generate-portraits.py +13 -13
- package/pennyfarthing-dist/scripts/workflow/check.py +4 -6
- package/pennyfarthing-dist/scripts/workflow/complete-step.py +2 -2
- package/pennyfarthing-dist/skills/skill-registry.yaml +19 -0
- package/pennyfarthing-dist/workflows/tdd-tandem.yaml +15 -2
- package/packages/core/dist/workflow/__test_context_watch__/.session/.tandem-turn-counter +0 -1
- package/packages/core/dist/workflow/__test_context_watch__/.session/95-6-session.md +0 -3
- package/packages/core/dist/workflow/__test_context_watch__/.session/95-6-tandem-architect.md +0 -6
- package/packages/core/dist/workflow/__test_file_watch__/.session/95-4-tandem-architect.md +0 -6
- package/packages/core/dist/workflow/__test_file_watch__/workdir/trigger.ts +0 -1
- package/packages/core/dist/workflow/__test_tool_watch__/.session/95-5-tandem-architect.md +0 -6
- package/packages/core/dist/workflow/__test_tool_watch__/.session/95-5-tandem-toolcalls.jsonl +0 -1
- package/pennyfarthing-dist/pf/bikerack/changed_panel.py +0 -201
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Badge } from '@/components/ui/badge';
|
|
3
|
+
import { Button } from '@/components/ui/button';
|
|
4
|
+
import { Skeleton } from '@/components/ui/skeleton';
|
|
5
|
+
import { ToolDialog } from './ToolDialog';
|
|
6
|
+
import { useDependencies } from '../../hooks/useDependencies';
|
|
7
|
+
|
|
8
|
+
export interface DependenciesDialogProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onOpenChange: (open: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function severityVariant(severity: string): 'destructive' | 'outline' | 'secondary' {
|
|
14
|
+
if (severity === 'high' || severity === 'critical') return 'destructive';
|
|
15
|
+
if (severity === 'moderate') return 'outline';
|
|
16
|
+
return 'secondary';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function DependenciesDialog({ open, onOpenChange }: DependenciesDialogProps): React.ReactElement {
|
|
20
|
+
const { data, isLoading, error, refresh } = useDependencies({});
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (open) refresh();
|
|
24
|
+
}, [open, refresh]);
|
|
25
|
+
|
|
26
|
+
const renderContent = () => {
|
|
27
|
+
if (isLoading) {
|
|
28
|
+
return (
|
|
29
|
+
<div className="dependencies-panel loading" data-testid="dependencies-panel">
|
|
30
|
+
<div className="space-y-3 p-2">
|
|
31
|
+
<Skeleton className="h-4 w-40" />
|
|
32
|
+
<Skeleton className="h-3 w-full" />
|
|
33
|
+
<Skeleton className="h-3 w-full" />
|
|
34
|
+
<Skeleton className="h-3 w-3/4" />
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (error) {
|
|
41
|
+
return (
|
|
42
|
+
<div className="dependencies-panel error" data-testid="dependencies-panel">
|
|
43
|
+
<div className="error-message">Error: {error.message}</div>
|
|
44
|
+
<Button variant="outline" size="sm" onClick={refresh}>Retry</Button>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!data) {
|
|
50
|
+
return (
|
|
51
|
+
<div className="dependencies-panel" data-testid="dependencies-panel">
|
|
52
|
+
<p>Click <strong>Analyze</strong> to check dependencies</p>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div className="dependencies-panel" data-testid="dependencies-panel">
|
|
59
|
+
{data.outdated.length > 0 && (
|
|
60
|
+
<div className="outdated-section" style={{ marginBottom: '16px' }}>
|
|
61
|
+
<h4>Outdated Packages ({data.outdated.length})</h4>
|
|
62
|
+
<table role="table" style={{ width: '100%', borderCollapse: 'collapse' }}>
|
|
63
|
+
<thead>
|
|
64
|
+
<tr>
|
|
65
|
+
<th className="text-left" style={{ padding: '4px 8px' }}>Package</th>
|
|
66
|
+
<th className="text-left" style={{ padding: '4px 8px' }}>Current</th>
|
|
67
|
+
<th className="text-left" style={{ padding: '4px 8px' }}>Wanted</th>
|
|
68
|
+
<th className="text-left" style={{ padding: '4px 8px' }}>Latest</th>
|
|
69
|
+
<th className="text-left" style={{ padding: '4px 8px' }}>Type</th>
|
|
70
|
+
</tr>
|
|
71
|
+
</thead>
|
|
72
|
+
<tbody>
|
|
73
|
+
{data.outdated.map((pkg) => (
|
|
74
|
+
<tr key={pkg.name}>
|
|
75
|
+
<td style={{ padding: '4px 8px' }}>{pkg.name}</td>
|
|
76
|
+
<td style={{ padding: '4px 8px' }}>{pkg.current}</td>
|
|
77
|
+
<td style={{ padding: '4px 8px' }}>{pkg.wanted}</td>
|
|
78
|
+
<td style={{ padding: '4px 8px' }}>{pkg.latest}</td>
|
|
79
|
+
<td style={{ padding: '4px 8px' }}>{pkg.type}</td>
|
|
80
|
+
</tr>
|
|
81
|
+
))}
|
|
82
|
+
</tbody>
|
|
83
|
+
</table>
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
|
|
87
|
+
{data.advisories.length > 0 && (
|
|
88
|
+
<div className="security-section">
|
|
89
|
+
<h4>Security Advisories</h4>
|
|
90
|
+
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
91
|
+
{data.advisories.map((adv) => (
|
|
92
|
+
<div key={adv.severity} style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>
|
|
93
|
+
<Badge variant={severityVariant(adv.severity)}>
|
|
94
|
+
{adv.severity}
|
|
95
|
+
</Badge>
|
|
96
|
+
<span>{adv.count}</span>
|
|
97
|
+
</div>
|
|
98
|
+
))}
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{data.outdated.length === 0 && data.advisories.length === 0 && (
|
|
104
|
+
<p>All dependencies are up to date with no known vulnerabilities.</p>
|
|
105
|
+
)}
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<ToolDialog
|
|
112
|
+
open={open}
|
|
113
|
+
onOpenChange={onOpenChange}
|
|
114
|
+
title="Dependencies"
|
|
115
|
+
description="Package staleness and security analysis"
|
|
116
|
+
>
|
|
117
|
+
{renderContent()}
|
|
118
|
+
</ToolDialog>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HotspotsDialog - Git history hotspot detector in a dialog
|
|
3
|
+
*
|
|
4
|
+
* Story: MSSCI-14442 - Migrate HotspotsPanel into HotspotsDialog
|
|
5
|
+
* Epic: epic-79 (Dialog Infrastructure + Hotspot Refactor)
|
|
6
|
+
*
|
|
7
|
+
* Migrated from HotspotsPanel — uses ToolDialog wrapper from 79-1.
|
|
8
|
+
* Shows files and directories with highest change frequency, bug fix
|
|
9
|
+
* concentration, and multi-author churn. Sortable table with time window controls.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import React, { useState, useMemo, useCallback } from 'react';
|
|
13
|
+
import { Button } from '@/components/ui/button';
|
|
14
|
+
import { Badge } from '@/components/ui/badge';
|
|
15
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
|
16
|
+
import { Skeleton } from '@/components/ui/skeleton';
|
|
17
|
+
import { ToolDialog } from './ToolDialog';
|
|
18
|
+
import { useHotspots, FileHotspot, DirectoryHotspot, HotspotRepoResult } from '../../hooks/useHotspots';
|
|
19
|
+
|
|
20
|
+
export interface HotspotsDialogProps {
|
|
21
|
+
open: boolean;
|
|
22
|
+
onOpenChange: (open: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type SortField = 'hotspot_score' | 'change_count' | 'bug_fix_count' | 'author_count' | 'churn' | 'path';
|
|
26
|
+
type SortDirection = 'asc' | 'desc';
|
|
27
|
+
type ViewMode = 'files' | 'dirs';
|
|
28
|
+
|
|
29
|
+
const TIME_WINDOWS = [30, 60, 90] as const;
|
|
30
|
+
|
|
31
|
+
const SOURCE_EXTENSIONS = new Set([
|
|
32
|
+
'.ts', '.tsx', '.js', '.jsx', '.py', '.md', '.css', '.scss', '.html',
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
const CONFIG_EXTENSIONS = new Set([
|
|
36
|
+
'.json', '.yaml', '.yml', '.toml', '.env',
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
function getExtension(path: string): string {
|
|
40
|
+
const basename = path.split('/').pop() || '';
|
|
41
|
+
// Handle dotfiles like .env
|
|
42
|
+
if (basename.startsWith('.') && !basename.includes('.', 1)) {
|
|
43
|
+
return '.' + basename.slice(1);
|
|
44
|
+
}
|
|
45
|
+
const dotIndex = basename.lastIndexOf('.');
|
|
46
|
+
return dotIndex > 0 ? basename.slice(dotIndex) : '';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function matchesFilter(path: string, codeOnly: boolean, includeConfig: boolean): boolean {
|
|
50
|
+
if (!codeOnly) return true;
|
|
51
|
+
const ext = getExtension(path);
|
|
52
|
+
if (SOURCE_EXTENSIONS.has(ext)) return true;
|
|
53
|
+
if (includeConfig && CONFIG_EXTENSIONS.has(ext)) return true;
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function SortableHeader({
|
|
58
|
+
label,
|
|
59
|
+
field,
|
|
60
|
+
currentSort,
|
|
61
|
+
currentDirection,
|
|
62
|
+
onSort,
|
|
63
|
+
align = 'right',
|
|
64
|
+
}: {
|
|
65
|
+
label: string;
|
|
66
|
+
field: SortField;
|
|
67
|
+
currentSort: SortField;
|
|
68
|
+
currentDirection: SortDirection;
|
|
69
|
+
onSort: (field: SortField) => void;
|
|
70
|
+
align?: 'left' | 'right';
|
|
71
|
+
}) {
|
|
72
|
+
const isActive = currentSort === field;
|
|
73
|
+
const arrow = isActive ? (currentDirection === 'desc' ? ' v' : ' ^') : '';
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<th
|
|
77
|
+
className={`text-xs font-medium uppercase tracking-wider text-[var(--text-muted)] pb-2 cursor-pointer select-none ${align === 'left' ? 'text-left' : 'text-right'} ${isActive ? 'text-[var(--text-primary)]' : ''}`}
|
|
78
|
+
onClick={() => onSort(field)}
|
|
79
|
+
role="columnheader"
|
|
80
|
+
aria-sort={isActive ? (currentDirection === 'desc' ? 'descending' : 'ascending') : 'none'}
|
|
81
|
+
>
|
|
82
|
+
{label}{arrow}
|
|
83
|
+
</th>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function FileTable({
|
|
88
|
+
hotspots,
|
|
89
|
+
sortField,
|
|
90
|
+
sortDirection,
|
|
91
|
+
onSort,
|
|
92
|
+
}: {
|
|
93
|
+
hotspots: FileHotspot[];
|
|
94
|
+
sortField: SortField;
|
|
95
|
+
sortDirection: SortDirection;
|
|
96
|
+
onSort: (field: SortField) => void;
|
|
97
|
+
}) {
|
|
98
|
+
const sorted = useMemo(() => {
|
|
99
|
+
const items = [...hotspots];
|
|
100
|
+
items.sort((a, b) => {
|
|
101
|
+
const aVal = a[sortField as keyof FileHotspot];
|
|
102
|
+
const bVal = b[sortField as keyof FileHotspot];
|
|
103
|
+
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
|
104
|
+
return sortDirection === 'desc' ? bVal - aVal : aVal - bVal;
|
|
105
|
+
}
|
|
106
|
+
const aStr = String(aVal);
|
|
107
|
+
const bStr = String(bVal);
|
|
108
|
+
return sortDirection === 'desc' ? bStr.localeCompare(aStr) : aStr.localeCompare(bStr);
|
|
109
|
+
});
|
|
110
|
+
return items;
|
|
111
|
+
}, [hotspots, sortField, sortDirection]);
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<table className="w-full text-sm" role="table">
|
|
115
|
+
<thead>
|
|
116
|
+
<tr className="border-b border-[var(--border)]">
|
|
117
|
+
<SortableHeader label="Score" field="hotspot_score" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
118
|
+
<SortableHeader label="Changes" field="change_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
119
|
+
<SortableHeader label="Fixes" field="bug_fix_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
120
|
+
<SortableHeader label="Authors" field="author_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
121
|
+
<SortableHeader label="Churn" field="churn" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
122
|
+
<SortableHeader label="File" field="path" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} align="left" />
|
|
123
|
+
</tr>
|
|
124
|
+
</thead>
|
|
125
|
+
<tbody>
|
|
126
|
+
{sorted.map((h) => (
|
|
127
|
+
<tr key={h.path} className="text-[var(--text-primary)]">
|
|
128
|
+
<td className="text-right py-1.5">
|
|
129
|
+
<Badge variant={h.hotspot_score >= 50 ? 'destructive' : h.hotspot_score >= 25 ? 'outline' : 'secondary'}>
|
|
130
|
+
{h.hotspot_score.toFixed(1)}
|
|
131
|
+
</Badge>
|
|
132
|
+
</td>
|
|
133
|
+
<td className="text-right py-1.5 tabular-nums font-mono">{h.change_count}</td>
|
|
134
|
+
<td className="text-right py-1.5 tabular-nums font-mono">{h.bug_fix_count}</td>
|
|
135
|
+
<td className="text-right py-1.5 tabular-nums font-mono">{h.author_count}</td>
|
|
136
|
+
<td className="text-right py-1.5 tabular-nums font-mono">{h.churn}</td>
|
|
137
|
+
<td className="text-left py-1.5">
|
|
138
|
+
<Tooltip>
|
|
139
|
+
<TooltipTrigger asChild>
|
|
140
|
+
<span className="truncate max-w-xs inline-block align-bottom font-mono text-xs">{h.path}</span>
|
|
141
|
+
</TooltipTrigger>
|
|
142
|
+
<TooltipContent>{h.path}</TooltipContent>
|
|
143
|
+
</Tooltip>
|
|
144
|
+
</td>
|
|
145
|
+
</tr>
|
|
146
|
+
))}
|
|
147
|
+
</tbody>
|
|
148
|
+
</table>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function DirTable({
|
|
153
|
+
hotspots,
|
|
154
|
+
sortField,
|
|
155
|
+
sortDirection,
|
|
156
|
+
onSort,
|
|
157
|
+
}: {
|
|
158
|
+
hotspots: DirectoryHotspot[];
|
|
159
|
+
sortField: SortField;
|
|
160
|
+
sortDirection: SortDirection;
|
|
161
|
+
onSort: (field: SortField) => void;
|
|
162
|
+
}) {
|
|
163
|
+
const sorted = useMemo(() => {
|
|
164
|
+
const items = [...hotspots];
|
|
165
|
+
items.sort((a, b) => {
|
|
166
|
+
const fieldMap: Record<string, keyof DirectoryHotspot> = {
|
|
167
|
+
change_count: 'total_changes',
|
|
168
|
+
bug_fix_count: 'total_bug_fixes',
|
|
169
|
+
author_count: 'avg_author_count',
|
|
170
|
+
churn: 'file_count',
|
|
171
|
+
};
|
|
172
|
+
const key = (fieldMap[sortField] || sortField) as keyof DirectoryHotspot;
|
|
173
|
+
const aVal = a[key];
|
|
174
|
+
const bVal = b[key];
|
|
175
|
+
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
|
176
|
+
return sortDirection === 'desc' ? bVal - aVal : aVal - bVal;
|
|
177
|
+
}
|
|
178
|
+
return sortDirection === 'desc'
|
|
179
|
+
? String(bVal).localeCompare(String(aVal))
|
|
180
|
+
: String(aVal).localeCompare(String(bVal));
|
|
181
|
+
});
|
|
182
|
+
return items;
|
|
183
|
+
}, [hotspots, sortField, sortDirection]);
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<table className="w-full text-sm" role="table">
|
|
187
|
+
<thead>
|
|
188
|
+
<tr className="border-b border-[var(--border)]">
|
|
189
|
+
<SortableHeader label="Score" field="hotspot_score" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
190
|
+
<SortableHeader label="Changes" field="change_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
191
|
+
<SortableHeader label="Fixes" field="bug_fix_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
192
|
+
<SortableHeader label="Authors" field="author_count" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
193
|
+
<SortableHeader label="Files" field="churn" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} />
|
|
194
|
+
<SortableHeader label="Directory" field="path" currentSort={sortField} currentDirection={sortDirection} onSort={onSort} align="left" />
|
|
195
|
+
</tr>
|
|
196
|
+
</thead>
|
|
197
|
+
<tbody>
|
|
198
|
+
{sorted.map((d) => (
|
|
199
|
+
<tr key={d.path} className="text-[var(--text-primary)]">
|
|
200
|
+
<td className="text-right py-1.5">
|
|
201
|
+
<Badge variant={d.hotspot_score >= 50 ? 'destructive' : d.hotspot_score >= 25 ? 'outline' : 'secondary'}>
|
|
202
|
+
{d.hotspot_score.toFixed(1)}
|
|
203
|
+
</Badge>
|
|
204
|
+
</td>
|
|
205
|
+
<td className="text-right py-1.5 tabular-nums font-mono">{d.total_changes}</td>
|
|
206
|
+
<td className="text-right py-1.5 tabular-nums font-mono">{d.total_bug_fixes}</td>
|
|
207
|
+
<td className="text-right py-1.5 tabular-nums font-mono">{d.avg_author_count.toFixed(1)}</td>
|
|
208
|
+
<td className="text-right py-1.5 tabular-nums font-mono">{d.file_count}</td>
|
|
209
|
+
<td className="text-left py-1.5">
|
|
210
|
+
<Tooltip>
|
|
211
|
+
<TooltipTrigger asChild>
|
|
212
|
+
<span className="truncate max-w-xs inline-block align-bottom font-mono text-xs">{d.path}</span>
|
|
213
|
+
</TooltipTrigger>
|
|
214
|
+
<TooltipContent>{d.path}</TooltipContent>
|
|
215
|
+
</Tooltip>
|
|
216
|
+
</td>
|
|
217
|
+
</tr>
|
|
218
|
+
))}
|
|
219
|
+
</tbody>
|
|
220
|
+
</table>
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function HotspotsDialog({ open, onOpenChange }: HotspotsDialogProps): React.ReactElement {
|
|
225
|
+
const [days, setDays] = useState<number>(90);
|
|
226
|
+
const [viewMode, setViewMode] = useState<ViewMode>('files');
|
|
227
|
+
const [sortField, setSortField] = useState<SortField>('hotspot_score');
|
|
228
|
+
const [sortDirection, setSortDirection] = useState<SortDirection>('desc');
|
|
229
|
+
const [includeOrchestrator, setIncludeOrchestrator] = useState(false);
|
|
230
|
+
const [codeOnly, setCodeOnly] = useState(false);
|
|
231
|
+
const [includeConfig, setIncludeConfig] = useState(false);
|
|
232
|
+
|
|
233
|
+
const { data, isLoading, error, refresh } = useHotspots({ days, includeOrchestrator });
|
|
234
|
+
|
|
235
|
+
const handleSort = useCallback((field: SortField) => {
|
|
236
|
+
setSortField((prev) => {
|
|
237
|
+
if (prev === field) {
|
|
238
|
+
setSortDirection((d) => (d === 'desc' ? 'asc' : 'desc'));
|
|
239
|
+
return prev;
|
|
240
|
+
}
|
|
241
|
+
setSortDirection('desc');
|
|
242
|
+
return field;
|
|
243
|
+
});
|
|
244
|
+
}, []);
|
|
245
|
+
|
|
246
|
+
const repoResults: HotspotRepoResult[] = useMemo(() => {
|
|
247
|
+
if (!data) return [];
|
|
248
|
+
if (data.repo_results) return data.repo_results;
|
|
249
|
+
if (data.file_hotspots) {
|
|
250
|
+
return [{
|
|
251
|
+
success: data.success,
|
|
252
|
+
repo_name: data.repo_name || '',
|
|
253
|
+
repo_path: data.repo_path || '',
|
|
254
|
+
time_window_days: data.time_window_days || days,
|
|
255
|
+
commit_count: data.commit_count || 0,
|
|
256
|
+
file_hotspots: data.file_hotspots || [],
|
|
257
|
+
directory_hotspots: data.directory_hotspots || [],
|
|
258
|
+
}];
|
|
259
|
+
}
|
|
260
|
+
return [];
|
|
261
|
+
}, [data, days]);
|
|
262
|
+
|
|
263
|
+
const allFiles = useMemo(() => {
|
|
264
|
+
const files: FileHotspot[] = [];
|
|
265
|
+
for (const r of repoResults) {
|
|
266
|
+
if (r.success) files.push(...r.file_hotspots);
|
|
267
|
+
}
|
|
268
|
+
return files;
|
|
269
|
+
}, [repoResults]);
|
|
270
|
+
|
|
271
|
+
const allDirs = useMemo(() => {
|
|
272
|
+
const dirs: DirectoryHotspot[] = [];
|
|
273
|
+
for (const r of repoResults) {
|
|
274
|
+
if (r.success) dirs.push(...r.directory_hotspots);
|
|
275
|
+
}
|
|
276
|
+
return dirs;
|
|
277
|
+
}, [repoResults]);
|
|
278
|
+
|
|
279
|
+
const filteredFiles = useMemo(
|
|
280
|
+
() => allFiles.filter((f) => matchesFilter(f.path, codeOnly, includeConfig)),
|
|
281
|
+
[allFiles, codeOnly, includeConfig],
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
const filteredDirs = useMemo(
|
|
285
|
+
() => allDirs.filter((d) => matchesFilter(d.path, codeOnly, includeConfig)),
|
|
286
|
+
[allDirs, codeOnly, includeConfig],
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
const totalCommits = repoResults.reduce((sum, r) => sum + (r.commit_count || 0), 0);
|
|
290
|
+
|
|
291
|
+
const renderContent = () => {
|
|
292
|
+
if (isLoading) {
|
|
293
|
+
return (
|
|
294
|
+
<div className="hotspots-panel loading" data-testid="hotspots-panel">
|
|
295
|
+
<div className="space-y-3 p-2">
|
|
296
|
+
<Skeleton className="h-4 w-40" />
|
|
297
|
+
<Skeleton className="h-3 w-full" />
|
|
298
|
+
<Skeleton className="h-3 w-full" />
|
|
299
|
+
<Skeleton className="h-3 w-3/4" />
|
|
300
|
+
<Skeleton className="h-3 w-full" />
|
|
301
|
+
<Skeleton className="h-3 w-5/6" />
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (error) {
|
|
308
|
+
return (
|
|
309
|
+
<div className="hotspots-panel error" data-testid="hotspots-panel">
|
|
310
|
+
<div className="error-message">{error.message}</div>
|
|
311
|
+
<Button variant="outline" size="sm" onClick={refresh}>Retry</Button>
|
|
312
|
+
</div>
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return (
|
|
317
|
+
<TooltipProvider delayDuration={300}>
|
|
318
|
+
<div className="hotspots-panel" data-testid="hotspots-panel">
|
|
319
|
+
<div className="space-y-3">
|
|
320
|
+
<div className="flex flex-wrap items-center gap-x-4 gap-y-2">
|
|
321
|
+
<div className="flex gap-1">
|
|
322
|
+
{TIME_WINDOWS.map((w) => (
|
|
323
|
+
<Button
|
|
324
|
+
key={w}
|
|
325
|
+
variant={days === w ? 'default' : 'outline'}
|
|
326
|
+
size="sm"
|
|
327
|
+
onClick={() => setDays(w)}
|
|
328
|
+
>
|
|
329
|
+
{w}d
|
|
330
|
+
</Button>
|
|
331
|
+
))}
|
|
332
|
+
</div>
|
|
333
|
+
|
|
334
|
+
<div className="flex gap-1">
|
|
335
|
+
<Button
|
|
336
|
+
variant={viewMode === 'files' ? 'default' : 'outline'}
|
|
337
|
+
size="sm"
|
|
338
|
+
onClick={() => setViewMode('files')}
|
|
339
|
+
>
|
|
340
|
+
Files
|
|
341
|
+
</Button>
|
|
342
|
+
<Button
|
|
343
|
+
variant={viewMode === 'dirs' ? 'default' : 'outline'}
|
|
344
|
+
size="sm"
|
|
345
|
+
onClick={() => setViewMode('dirs')}
|
|
346
|
+
>
|
|
347
|
+
Dirs
|
|
348
|
+
</Button>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<div className="ml-auto">
|
|
352
|
+
<Tooltip>
|
|
353
|
+
<TooltipTrigger asChild>
|
|
354
|
+
<Button variant="outline" size="sm" onClick={refresh}>
|
|
355
|
+
Analyze
|
|
356
|
+
</Button>
|
|
357
|
+
</TooltipTrigger>
|
|
358
|
+
<TooltipContent>Run hotspot analysis</TooltipContent>
|
|
359
|
+
</Tooltip>
|
|
360
|
+
</div>
|
|
361
|
+
</div>
|
|
362
|
+
|
|
363
|
+
<div className="flex flex-wrap items-center gap-x-6 gap-y-2">
|
|
364
|
+
<label className="flex items-center gap-2 text-sm text-[var(--text-secondary)] cursor-pointer">
|
|
365
|
+
<input
|
|
366
|
+
type="checkbox"
|
|
367
|
+
checked={includeOrchestrator}
|
|
368
|
+
onChange={(e) => setIncludeOrchestrator(e.target.checked)}
|
|
369
|
+
/>
|
|
370
|
+
Include orchestrator
|
|
371
|
+
</label>
|
|
372
|
+
|
|
373
|
+
<label className="flex items-center gap-2 text-sm text-[var(--text-secondary)] cursor-pointer">
|
|
374
|
+
<input
|
|
375
|
+
type="checkbox"
|
|
376
|
+
aria-label="Code only"
|
|
377
|
+
checked={codeOnly}
|
|
378
|
+
onChange={(e) => setCodeOnly(e.target.checked)}
|
|
379
|
+
/>
|
|
380
|
+
Code only
|
|
381
|
+
</label>
|
|
382
|
+
|
|
383
|
+
<label className="flex items-center gap-2 text-sm text-[var(--text-secondary)] cursor-pointer">
|
|
384
|
+
<input
|
|
385
|
+
type="checkbox"
|
|
386
|
+
aria-label="Include config"
|
|
387
|
+
checked={includeConfig}
|
|
388
|
+
disabled={!codeOnly}
|
|
389
|
+
onChange={(e) => setIncludeConfig(e.target.checked)}
|
|
390
|
+
className="disabled:opacity-40"
|
|
391
|
+
/>
|
|
392
|
+
<span className={!codeOnly ? 'opacity-40' : ''}>Include config</span>
|
|
393
|
+
</label>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
|
|
397
|
+
{data && (
|
|
398
|
+
<div className="flex gap-4 text-xs text-[var(--text-muted)]">
|
|
399
|
+
<span>{totalCommits} commits</span>
|
|
400
|
+
<span>{filteredFiles.length} files</span>
|
|
401
|
+
<span>{filteredDirs.length} dirs</span>
|
|
402
|
+
</div>
|
|
403
|
+
)}
|
|
404
|
+
|
|
405
|
+
{!data && (
|
|
406
|
+
<div className="text-center py-12 text-[var(--text-muted)]">
|
|
407
|
+
Click <strong>Analyze</strong> to detect code hotspots
|
|
408
|
+
</div>
|
|
409
|
+
)}
|
|
410
|
+
|
|
411
|
+
{data && viewMode === 'files' && (
|
|
412
|
+
filteredFiles.length > 0 ? (
|
|
413
|
+
<FileTable
|
|
414
|
+
hotspots={filteredFiles.slice(0, 50)}
|
|
415
|
+
sortField={sortField}
|
|
416
|
+
sortDirection={sortDirection}
|
|
417
|
+
onSort={handleSort}
|
|
418
|
+
/>
|
|
419
|
+
) : (
|
|
420
|
+
<div className="text-center py-12 text-[var(--text-muted)]">No file hotspots found</div>
|
|
421
|
+
)
|
|
422
|
+
)}
|
|
423
|
+
|
|
424
|
+
{data && viewMode === 'dirs' && (
|
|
425
|
+
filteredDirs.length > 0 ? (
|
|
426
|
+
<DirTable
|
|
427
|
+
hotspots={filteredDirs.slice(0, 50)}
|
|
428
|
+
sortField={sortField}
|
|
429
|
+
sortDirection={sortDirection}
|
|
430
|
+
onSort={handleSort}
|
|
431
|
+
/>
|
|
432
|
+
) : (
|
|
433
|
+
<div className="text-center py-12 text-[var(--text-muted)]">No directory hotspots found</div>
|
|
434
|
+
)
|
|
435
|
+
)}
|
|
436
|
+
</div>
|
|
437
|
+
</TooltipProvider>
|
|
438
|
+
);
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
return (
|
|
442
|
+
<ToolDialog
|
|
443
|
+
open={open}
|
|
444
|
+
onOpenChange={onOpenChange}
|
|
445
|
+
title="Hotspots"
|
|
446
|
+
description="Files and directories ranked by change frequency and complexity"
|
|
447
|
+
>
|
|
448
|
+
{renderContent()}
|
|
449
|
+
</ToolDialog>
|
|
450
|
+
);
|
|
451
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogContent,
|
|
5
|
+
DialogHeader,
|
|
6
|
+
DialogFooter,
|
|
7
|
+
DialogTitle,
|
|
8
|
+
DialogDescription,
|
|
9
|
+
} from '@/components/ui/dialog';
|
|
10
|
+
import { cn } from '@/lib/utils';
|
|
11
|
+
|
|
12
|
+
export interface ToolDialogProps {
|
|
13
|
+
open: boolean;
|
|
14
|
+
onOpenChange: (open: boolean) => void;
|
|
15
|
+
title: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
footer?: React.ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function ToolDialog({
|
|
23
|
+
open,
|
|
24
|
+
onOpenChange,
|
|
25
|
+
title,
|
|
26
|
+
description,
|
|
27
|
+
footer,
|
|
28
|
+
className,
|
|
29
|
+
children,
|
|
30
|
+
}: ToolDialogProps): React.ReactElement {
|
|
31
|
+
return (
|
|
32
|
+
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
33
|
+
<DialogContent className={cn('max-w-5xl max-h-[80vh] overflow-y-auto', className)}>
|
|
34
|
+
<DialogHeader>
|
|
35
|
+
<DialogTitle>{title}</DialogTitle>
|
|
36
|
+
{description && <DialogDescription>{description}</DialogDescription>}
|
|
37
|
+
</DialogHeader>
|
|
38
|
+
{children}
|
|
39
|
+
{footer && <DialogFooter>{footer}</DialogFooter>}
|
|
40
|
+
</DialogContent>
|
|
41
|
+
</Dialog>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared panel component registry
|
|
3
|
+
*
|
|
4
|
+
* Used by both DockviewWorkspace and BikeRackWorkspace to look up
|
|
5
|
+
* registered panel components by ID. Extracted to avoid importing
|
|
6
|
+
* DockviewWorkspace (which has shadcn/ui deps) from BikeRackWorkspace.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { ComponentType } from 'react';
|
|
10
|
+
|
|
11
|
+
export type PanelComponent = ComponentType;
|
|
12
|
+
|
|
13
|
+
export const panelRegistry: Map<string, PanelComponent> = new Map();
|