@pennyfarthing/core 11.3.7 → 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 +17 -16
- 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/hooks/cyclist-pretooluse-hook.sh +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/core/agent-session.sh +0 -0
- package/pennyfarthing-dist/scripts/core/check-context.sh +0 -0
- package/pennyfarthing-dist/scripts/core/dialogue-manager.sh +0 -0
- package/pennyfarthing-dist/scripts/core/pf.sh +0 -0
- package/pennyfarthing-dist/scripts/core/phase-check-start.sh +0 -0
- package/pennyfarthing-dist/scripts/core/prime.sh +0 -0
- package/pennyfarthing-dist/scripts/cyclist/is-cyclist.sh +0 -0
- package/pennyfarthing-dist/scripts/git/create-feature-branches.sh +0 -0
- package/pennyfarthing-dist/scripts/git/git-status-all.sh +0 -0
- package/pennyfarthing-dist/scripts/git/install-git-hooks.sh +0 -0
- package/pennyfarthing-dist/scripts/git/release.sh +0 -0
- package/pennyfarthing-dist/scripts/git/worktree-manager.sh +0 -0
- package/pennyfarthing-dist/scripts/health/drift-detection.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/bell-mode-hook.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/context-circuit-breaker.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/context-warning.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/cyclist-pretooluse-hook.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/dispatcher-template.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/otel-auto-config.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/post-merge.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/pre-commit.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/pre-edit-check.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/pre-push.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/question-reflector-check.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/question_reflector_check.py +0 -0
- package/pennyfarthing-dist/scripts/hooks/schema-validation.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/session-start.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/session-stop.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/sprint-yaml-validation.sh +0 -0
- package/pennyfarthing-dist/scripts/hooks/welcome-hook.sh +0 -0
- package/pennyfarthing-dist/scripts/jira/create-jira-epic.sh +0 -0
- package/pennyfarthing-dist/scripts/jira/create-jira-story.sh +0 -0
- package/pennyfarthing-dist/scripts/jira/jira-claim-story.sh +0 -0
- package/pennyfarthing-dist/scripts/jira/jira-reconcile.sh +0 -0
- package/pennyfarthing-dist/scripts/jira/jira-sync-story.sh +0 -0
- package/pennyfarthing-dist/scripts/jira/sync-epic-jira.sh +0 -0
- package/pennyfarthing-dist/scripts/lib/background-tasks.sh +0 -0
- package/pennyfarthing-dist/scripts/lib/checkpoint.sh +0 -0
- package/pennyfarthing-dist/scripts/lib/common.sh +0 -0
- package/pennyfarthing-dist/scripts/lib/env.sh +0 -0
- package/pennyfarthing-dist/scripts/lib/file-lock.sh +0 -0
- package/pennyfarthing-dist/scripts/lib/find-root.sh +1 -1
- package/pennyfarthing-dist/scripts/lib/logging.sh +0 -0
- package/pennyfarthing-dist/scripts/lib/retry.sh +0 -0
- package/pennyfarthing-dist/scripts/lib/run-pf.sh +0 -0
- package/pennyfarthing-dist/scripts/maintenance/migrate-theme-schema.mjs +0 -0
- package/pennyfarthing-dist/scripts/maintenance/sidecar-health.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/add-short-names.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/add_short_names.py +0 -0
- package/pennyfarthing-dist/scripts/misc/backlog.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/check-status.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/find-related-work.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/generate-skill-docs.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/log-skill-usage.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/migrate-bmad-workflow.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/migrate_bmad_workflow.py +0 -1
- package/pennyfarthing-dist/scripts/misc/repo-scan.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/repo-utils.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/run-ci.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/run-timestamp.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/session-cleanup.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/skill-usage-report.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/statusline.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/uninstall.sh +0 -0
- package/pennyfarthing-dist/scripts/misc/validate-subagent-frontmatter.sh +0 -0
- package/pennyfarthing-dist/scripts/portraits/generate-portraits.py +13 -13
- package/pennyfarthing-dist/scripts/portraits/generate-portraits.sh +0 -0
- package/pennyfarthing-dist/scripts/portraits/generate-tandem-portraits.sh +0 -0
- package/pennyfarthing-dist/scripts/story/create-story.sh +0 -0
- package/pennyfarthing-dist/scripts/story/size-story.sh +0 -0
- package/pennyfarthing-dist/scripts/story/story-template.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/check.test.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/dev-story-workflow-import.test.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/epics-and-stories-workflow-import.test.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/handoff-phase-update.test.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/implementation-readiness-workflow-import.test.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/migrate-bmad-workflow.test.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/prd-workflow-import.test.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/project-context-workflow-import.test.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/test-character-voice.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/test-drift-detection.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/test-post-merge-hook.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/test-session-checkpoint.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/test-solo-command.sh +0 -0
- package/pennyfarthing-dist/scripts/tests/ux-design-workflow-import.test.sh +0 -0
- package/pennyfarthing-dist/scripts/theme/list-themes.sh +0 -0
- package/pennyfarthing-dist/scripts/validation/validate-agent-schema.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/check.py +4 -6
- package/pennyfarthing-dist/scripts/workflow/check.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/complete-step.py +2 -2
- package/pennyfarthing-dist/scripts/workflow/finish-story.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/fix-session-phase.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/get-workflow-type.py +0 -0
- package/pennyfarthing-dist/scripts/workflow/get-workflow-type.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/list-workflows.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/phase-owner.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/resume-workflow.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/show-workflow.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/start-workflow.sh +0 -0
- package/pennyfarthing-dist/scripts/workflow/workflow-status.sh +0 -0
- package/pennyfarthing-dist/skills/pf-story/scripts/create-story.sh +0 -0
- package/pennyfarthing-dist/skills/pf-story/scripts/size-story.sh +0 -0
- package/pennyfarthing-dist/skills/pf-story/scripts/story-template.sh +0 -0
- package/pennyfarthing-dist/skills/skill-registry.yaml +19 -0
- package/pennyfarthing-dist/workflows/release/steps/step-10-publish.md +41 -9
- 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
- package/scripts/README.md +0 -41
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ThemePalette Component
|
|
3
|
+
*
|
|
4
|
+
* A dropdown component for quick theme switching between color presets.
|
|
5
|
+
* Story MSSCI-12768 - Color Palette System
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Popover menu with presets grouped by variant (dark/light)
|
|
9
|
+
* - Searchable preset list via Command input
|
|
10
|
+
* - 4-swatch visual preview (bg, bgSecondary, text, accent)
|
|
11
|
+
* - Keyboard navigation (handled by Popover + Command primitives)
|
|
12
|
+
* - ARIA attributes for accessibility
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import React, { useMemo, useState } from 'react';
|
|
16
|
+
import { Check, ChevronsUpDown } from 'lucide-react';
|
|
17
|
+
import { getPresetIds, getPreset } from '../../utils/color-presets';
|
|
18
|
+
import { cn } from '@/lib/utils';
|
|
19
|
+
import { Button } from '@/components/ui/button';
|
|
20
|
+
import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover';
|
|
21
|
+
import {
|
|
22
|
+
Command,
|
|
23
|
+
CommandInput,
|
|
24
|
+
CommandList,
|
|
25
|
+
CommandGroup,
|
|
26
|
+
CommandItem,
|
|
27
|
+
CommandEmpty,
|
|
28
|
+
} from '@/components/ui/command';
|
|
29
|
+
import './ThemePalette.css';
|
|
30
|
+
|
|
31
|
+
// =============================================================================
|
|
32
|
+
// Types
|
|
33
|
+
// =============================================================================
|
|
34
|
+
|
|
35
|
+
export interface ThemePaletteProps {
|
|
36
|
+
currentPreset: string;
|
|
37
|
+
onSelect?: (presetId: string) => void;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface RenderThemePaletteOptions {
|
|
42
|
+
currentPreset: string;
|
|
43
|
+
onSelect?: (presetId: string) => void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// =============================================================================
|
|
47
|
+
// Helpers
|
|
48
|
+
// =============================================================================
|
|
49
|
+
|
|
50
|
+
interface GroupedPresets {
|
|
51
|
+
dark: string[];
|
|
52
|
+
light: string[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function groupPresetsByVariant(): GroupedPresets {
|
|
56
|
+
const ids = getPresetIds();
|
|
57
|
+
const dark: string[] = [];
|
|
58
|
+
const light: string[] = [];
|
|
59
|
+
|
|
60
|
+
for (const id of ids) {
|
|
61
|
+
const preset = getPreset(id);
|
|
62
|
+
if (!preset) continue;
|
|
63
|
+
if (preset.variant === 'light') {
|
|
64
|
+
light.push(id);
|
|
65
|
+
} else {
|
|
66
|
+
dark.push(id);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
dark.sort((a, b) => (getPreset(a)?.name || '').localeCompare(getPreset(b)?.name || ''));
|
|
71
|
+
light.sort((a, b) => (getPreset(a)?.name || '').localeCompare(getPreset(b)?.name || ''));
|
|
72
|
+
|
|
73
|
+
return { dark, light };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// =============================================================================
|
|
77
|
+
// Swatch rendering
|
|
78
|
+
// =============================================================================
|
|
79
|
+
|
|
80
|
+
function PresetSwatches({ presetId }: { presetId: string }) {
|
|
81
|
+
const preset = getPreset(presetId);
|
|
82
|
+
if (!preset) return null;
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div className="preset-swatches">
|
|
86
|
+
<span
|
|
87
|
+
className="preset-swatch"
|
|
88
|
+
style={{ backgroundColor: preset.colors.bgPrimary }}
|
|
89
|
+
title="Background"
|
|
90
|
+
/>
|
|
91
|
+
<span
|
|
92
|
+
className="preset-swatch"
|
|
93
|
+
style={{ backgroundColor: preset.colors.bgSecondary }}
|
|
94
|
+
title="Surface"
|
|
95
|
+
/>
|
|
96
|
+
<span
|
|
97
|
+
className="preset-swatch"
|
|
98
|
+
style={{ backgroundColor: preset.colors.textPrimary }}
|
|
99
|
+
title="Text"
|
|
100
|
+
/>
|
|
101
|
+
<span
|
|
102
|
+
className="preset-swatch"
|
|
103
|
+
style={{ backgroundColor: preset.colors.accent }}
|
|
104
|
+
title="Accent"
|
|
105
|
+
/>
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// =============================================================================
|
|
111
|
+
// ThemePalette Component
|
|
112
|
+
// =============================================================================
|
|
113
|
+
|
|
114
|
+
export function ThemePalette({ currentPreset, onSelect, className = '' }: ThemePaletteProps) {
|
|
115
|
+
const [open, setOpen] = useState(false);
|
|
116
|
+
const grouped = useMemo(() => groupPresetsByVariant(), []);
|
|
117
|
+
const currentPresetData = getPreset(currentPreset);
|
|
118
|
+
|
|
119
|
+
const handleSelect = (presetId: string) => {
|
|
120
|
+
onSelect?.(presetId);
|
|
121
|
+
setOpen(false);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
126
|
+
<PopoverTrigger asChild>
|
|
127
|
+
<Button
|
|
128
|
+
variant="outline"
|
|
129
|
+
className={cn('theme-palette-button', className)}
|
|
130
|
+
aria-label={`Select theme, current: ${currentPresetData?.name || currentPreset}`}
|
|
131
|
+
>
|
|
132
|
+
<span className="theme-palette-current">
|
|
133
|
+
{currentPresetData && (
|
|
134
|
+
<span
|
|
135
|
+
className="preset-swatch"
|
|
136
|
+
style={{ backgroundColor: currentPresetData.colors.bgPrimary }}
|
|
137
|
+
/>
|
|
138
|
+
)}
|
|
139
|
+
<span className="theme-palette-name">
|
|
140
|
+
{currentPresetData?.name || currentPreset}
|
|
141
|
+
</span>
|
|
142
|
+
</span>
|
|
143
|
+
<ChevronsUpDown className="theme-palette-chevron" />
|
|
144
|
+
</Button>
|
|
145
|
+
</PopoverTrigger>
|
|
146
|
+
<PopoverContent className="theme-palette-popover p-0" align="start">
|
|
147
|
+
<Command>
|
|
148
|
+
<CommandInput placeholder="Search themes..." />
|
|
149
|
+
<CommandList>
|
|
150
|
+
<CommandEmpty>No theme found.</CommandEmpty>
|
|
151
|
+
<CommandGroup heading={`Dark (${grouped.dark.length})`}>
|
|
152
|
+
{grouped.dark.map((id) => {
|
|
153
|
+
const preset = getPreset(id);
|
|
154
|
+
if (!preset) return null;
|
|
155
|
+
const isActive = id === currentPreset;
|
|
156
|
+
return (
|
|
157
|
+
<CommandItem
|
|
158
|
+
key={id}
|
|
159
|
+
value={preset.name}
|
|
160
|
+
onSelect={() => handleSelect(id)}
|
|
161
|
+
data-preset-id={id}
|
|
162
|
+
>
|
|
163
|
+
<PresetSwatches presetId={id} />
|
|
164
|
+
<span className="preset-name">{preset.name}</span>
|
|
165
|
+
<Check
|
|
166
|
+
className={cn(
|
|
167
|
+
'preset-check-icon ml-auto',
|
|
168
|
+
isActive ? 'opacity-100' : 'opacity-0'
|
|
169
|
+
)}
|
|
170
|
+
/>
|
|
171
|
+
</CommandItem>
|
|
172
|
+
);
|
|
173
|
+
})}
|
|
174
|
+
</CommandGroup>
|
|
175
|
+
<CommandGroup heading={`Light (${grouped.light.length})`}>
|
|
176
|
+
{grouped.light.map((id) => {
|
|
177
|
+
const preset = getPreset(id);
|
|
178
|
+
if (!preset) return null;
|
|
179
|
+
const isActive = id === currentPreset;
|
|
180
|
+
return (
|
|
181
|
+
<CommandItem
|
|
182
|
+
key={id}
|
|
183
|
+
value={preset.name}
|
|
184
|
+
onSelect={() => handleSelect(id)}
|
|
185
|
+
data-preset-id={id}
|
|
186
|
+
>
|
|
187
|
+
<PresetSwatches presetId={id} />
|
|
188
|
+
<span className="preset-name">{preset.name}</span>
|
|
189
|
+
<Check
|
|
190
|
+
className={cn(
|
|
191
|
+
'preset-check-icon ml-auto',
|
|
192
|
+
isActive ? 'opacity-100' : 'opacity-0'
|
|
193
|
+
)}
|
|
194
|
+
/>
|
|
195
|
+
</CommandItem>
|
|
196
|
+
);
|
|
197
|
+
})}
|
|
198
|
+
</CommandGroup>
|
|
199
|
+
</CommandList>
|
|
200
|
+
</Command>
|
|
201
|
+
</PopoverContent>
|
|
202
|
+
</Popover>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// =============================================================================
|
|
207
|
+
// Render Function (for vanilla JS usage)
|
|
208
|
+
// =============================================================================
|
|
209
|
+
|
|
210
|
+
export function renderThemePalette(
|
|
211
|
+
container: HTMLElement,
|
|
212
|
+
options: RenderThemePaletteOptions
|
|
213
|
+
): void {
|
|
214
|
+
const { currentPreset, onSelect } = options;
|
|
215
|
+
|
|
216
|
+
const wrapper = document.createElement('div');
|
|
217
|
+
wrapper.className = 'theme-palette';
|
|
218
|
+
|
|
219
|
+
const button = document.createElement('button');
|
|
220
|
+
button.className = 'theme-palette-button';
|
|
221
|
+
const preset = getPreset(currentPreset);
|
|
222
|
+
button.setAttribute('aria-label', `Select theme, current: ${preset?.name || currentPreset}`);
|
|
223
|
+
button.setAttribute('aria-expanded', 'false');
|
|
224
|
+
button.setAttribute('aria-haspopup', 'listbox');
|
|
225
|
+
|
|
226
|
+
button.innerHTML = `
|
|
227
|
+
<span class="theme-palette-current">
|
|
228
|
+
${preset ? `<span class="preset-swatch" style="background-color: ${preset.colors.bgPrimary}"></span>` : ''}
|
|
229
|
+
<span class="theme-palette-name">${preset?.name || currentPreset}</span>
|
|
230
|
+
</span>
|
|
231
|
+
<span class="theme-palette-chevron" aria-hidden="true">▼</span>
|
|
232
|
+
`;
|
|
233
|
+
|
|
234
|
+
const menu = document.createElement('div');
|
|
235
|
+
menu.className = 'theme-palette-menu';
|
|
236
|
+
menu.setAttribute('role', 'listbox');
|
|
237
|
+
menu.setAttribute('aria-label', 'Available themes');
|
|
238
|
+
|
|
239
|
+
const grouped = groupPresetsByVariant();
|
|
240
|
+
|
|
241
|
+
const renderGroup = (ids: string[], label: string) => {
|
|
242
|
+
const header = document.createElement('div');
|
|
243
|
+
header.className = 'preset-group-header';
|
|
244
|
+
header.setAttribute('role', 'presentation');
|
|
245
|
+
header.textContent = `${label} (${ids.length})`;
|
|
246
|
+
menu.appendChild(header);
|
|
247
|
+
|
|
248
|
+
ids.forEach((id) => {
|
|
249
|
+
const p = getPreset(id);
|
|
250
|
+
if (!p) return;
|
|
251
|
+
|
|
252
|
+
const option = document.createElement('button');
|
|
253
|
+
option.className = `theme-palette-option ${id === currentPreset ? 'active' : ''}`;
|
|
254
|
+
option.setAttribute('role', 'option');
|
|
255
|
+
option.setAttribute('aria-selected', id === currentPreset ? 'true' : 'false');
|
|
256
|
+
option.setAttribute('data-preset-id', id);
|
|
257
|
+
option.tabIndex = -1;
|
|
258
|
+
|
|
259
|
+
option.innerHTML = `
|
|
260
|
+
<div class="preset-swatches">
|
|
261
|
+
<span class="preset-swatch" style="background-color: ${p.colors.bgPrimary}" title="Background"></span>
|
|
262
|
+
<span class="preset-swatch" style="background-color: ${p.colors.bgSecondary}" title="Surface"></span>
|
|
263
|
+
<span class="preset-swatch" style="background-color: ${p.colors.textPrimary}" title="Text"></span>
|
|
264
|
+
<span class="preset-swatch" style="background-color: ${p.colors.accent}" title="Accent"></span>
|
|
265
|
+
</div>
|
|
266
|
+
<span class="preset-name">${p.name}</span>
|
|
267
|
+
${id === currentPreset ? '<span class="preset-check" aria-hidden="true">✓</span>' : ''}
|
|
268
|
+
`;
|
|
269
|
+
|
|
270
|
+
option.addEventListener('click', () => {
|
|
271
|
+
onSelect?.(id);
|
|
272
|
+
menu.classList.remove('open');
|
|
273
|
+
button.setAttribute('aria-expanded', 'false');
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
menu.appendChild(option);
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
renderGroup(grouped.dark, 'Dark');
|
|
281
|
+
renderGroup(grouped.light, 'Light');
|
|
282
|
+
|
|
283
|
+
// Toggle menu
|
|
284
|
+
button.addEventListener('click', () => {
|
|
285
|
+
const isOpen = menu.classList.toggle('open');
|
|
286
|
+
button.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
// Close on click outside
|
|
290
|
+
document.addEventListener('click', (e) => {
|
|
291
|
+
if (!wrapper.contains(e.target as Node)) {
|
|
292
|
+
menu.classList.remove('open');
|
|
293
|
+
button.setAttribute('aria-expanded', 'false');
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// Close on escape
|
|
298
|
+
document.addEventListener('keydown', (e) => {
|
|
299
|
+
if (e.key === 'Escape' && menu.classList.contains('open')) {
|
|
300
|
+
menu.classList.remove('open');
|
|
301
|
+
button.setAttribute('aria-expanded', 'false');
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// Keyboard navigation
|
|
306
|
+
menu.addEventListener('keydown', (e) => {
|
|
307
|
+
const options = Array.from(menu.querySelectorAll('.theme-palette-option'));
|
|
308
|
+
const focusedIdx = options.findIndex((el) => el === document.activeElement);
|
|
309
|
+
|
|
310
|
+
if (e.key === 'ArrowDown') {
|
|
311
|
+
e.preventDefault();
|
|
312
|
+
const nextIndex = (focusedIdx + 1) % options.length;
|
|
313
|
+
(options[nextIndex] as HTMLElement).focus();
|
|
314
|
+
} else if (e.key === 'ArrowUp') {
|
|
315
|
+
e.preventDefault();
|
|
316
|
+
const prevIndex = (focusedIdx - 1 + options.length) % options.length;
|
|
317
|
+
(options[prevIndex] as HTMLElement).focus();
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
wrapper.appendChild(button);
|
|
322
|
+
wrapper.appendChild(menu);
|
|
323
|
+
container.appendChild(wrapper);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export default ThemePalette;
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolCallBlock Component
|
|
3
|
+
*
|
|
4
|
+
* Displays tool use and result in a distinct block.
|
|
5
|
+
* Story MSSCI-12698 - MessageView Component with Streaming
|
|
6
|
+
* Story MSSCI-13398 - Collapsible tool result display
|
|
7
|
+
* Story MSSCI-13402 - Tool use visual design polish
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import React, { useState, useMemo } from 'react';
|
|
11
|
+
import { Button } from '@/components/ui/button';
|
|
12
|
+
import { Badge } from '@/components/ui/badge';
|
|
13
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
|
14
|
+
import { getToolTypeClass } from '../utils/toolTypeColors.js';
|
|
15
|
+
import { formatDuration } from '../utils/formatDuration.js';
|
|
16
|
+
import { generateToolIntentSummary } from '../utils/toolIntentSummarizer.js';
|
|
17
|
+
|
|
18
|
+
interface ToolUseMessage {
|
|
19
|
+
type: 'tool_use';
|
|
20
|
+
tool_name: string;
|
|
21
|
+
tool_id: string;
|
|
22
|
+
input: Record<string, unknown>;
|
|
23
|
+
timestamp: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface ToolResultMessage {
|
|
27
|
+
type: 'tool_result';
|
|
28
|
+
tool_id: string;
|
|
29
|
+
content: string;
|
|
30
|
+
timestamp: number;
|
|
31
|
+
/** Whether this result represents an error */
|
|
32
|
+
is_error?: boolean;
|
|
33
|
+
/** Duration in milliseconds */
|
|
34
|
+
durationMs?: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ToolCallBlockProps {
|
|
38
|
+
toolUse: ToolUseMessage;
|
|
39
|
+
result?: ToolResultMessage;
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const TRUNCATION_THRESHOLD = 50;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Count lines in content, handling both Unix and Windows line endings
|
|
47
|
+
*/
|
|
48
|
+
function countLines(content: string): number {
|
|
49
|
+
if (!content) return 0;
|
|
50
|
+
// Normalize CRLF to LF, then count
|
|
51
|
+
const normalized = content.replace(/\r\n/g, '\n');
|
|
52
|
+
return normalized.split('\n').length;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get truncated content (first N lines)
|
|
57
|
+
*/
|
|
58
|
+
function getTruncatedContent(content: string, maxLines: number): string {
|
|
59
|
+
const normalized = content.replace(/\r\n/g, '\n');
|
|
60
|
+
const lines = normalized.split('\n');
|
|
61
|
+
return lines.slice(0, maxLines).join('\n');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function formatToolInput(toolName: string, input: Record<string, unknown>): string {
|
|
65
|
+
// Display the most relevant input field based on tool type
|
|
66
|
+
if (toolName === 'Read' && input.file_path) {
|
|
67
|
+
return String(input.file_path);
|
|
68
|
+
}
|
|
69
|
+
if (toolName === 'Bash' && input.command) {
|
|
70
|
+
return String(input.command);
|
|
71
|
+
}
|
|
72
|
+
if (toolName === 'Glob' && input.pattern) {
|
|
73
|
+
return String(input.pattern);
|
|
74
|
+
}
|
|
75
|
+
if (toolName === 'Grep' && input.pattern) {
|
|
76
|
+
return String(input.pattern);
|
|
77
|
+
}
|
|
78
|
+
if (toolName === 'Write' && input.file_path) {
|
|
79
|
+
return String(input.file_path);
|
|
80
|
+
}
|
|
81
|
+
// Default: show JSON
|
|
82
|
+
return JSON.stringify(input, null, 2);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Get single-letter badge label for tool type
|
|
87
|
+
*/
|
|
88
|
+
export function getToolBadgeLabel(toolName: string): string {
|
|
89
|
+
const labels: Record<string, string> = {
|
|
90
|
+
Read: 'R',
|
|
91
|
+
Write: 'W',
|
|
92
|
+
Bash: 'B',
|
|
93
|
+
Glob: 'G',
|
|
94
|
+
Grep: 'S', // S for Search
|
|
95
|
+
Edit: 'E',
|
|
96
|
+
Task: 'T',
|
|
97
|
+
WebFetch: 'F',
|
|
98
|
+
WebSearch: 'W',
|
|
99
|
+
TodoWrite: 'D', // D for Do/Tasks
|
|
100
|
+
};
|
|
101
|
+
return labels[toolName] || toolName.charAt(0).toUpperCase();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export default function ToolCallBlock({ toolUse, result, className }: ToolCallBlockProps): React.ReactElement {
|
|
105
|
+
// AC1: Start collapsed by default
|
|
106
|
+
const [isCollapsed, setIsCollapsed] = useState(true);
|
|
107
|
+
const [isPromptCollapsed, setIsPromptCollapsed] = useState(true);
|
|
108
|
+
// AC3: Track whether showing full content or truncated
|
|
109
|
+
const [showFullContent, setShowFullContent] = useState(false);
|
|
110
|
+
// AC4: Track copy state
|
|
111
|
+
const [copyState, setCopyState] = useState<'idle' | 'copied' | 'error'>('idle');
|
|
112
|
+
|
|
113
|
+
// MSSCI-13402: Determine error state for styling
|
|
114
|
+
const isError = result?.is_error === true;
|
|
115
|
+
const inputDisplay = formatToolInput(toolUse.tool_name, toolUse.input);
|
|
116
|
+
const paramCount = Object.keys(toolUse.input).length;
|
|
117
|
+
|
|
118
|
+
// MSSCI-13402: Get tool type CSS class
|
|
119
|
+
const toolTypeClass = getToolTypeClass(toolUse.tool_name);
|
|
120
|
+
|
|
121
|
+
// Generate human-readable intent summary (Story 74-1)
|
|
122
|
+
const intentSummary = useMemo(() => {
|
|
123
|
+
return generateToolIntentSummary(toolUse.tool_name, toolUse.input);
|
|
124
|
+
}, [toolUse.tool_name, toolUse.input]);
|
|
125
|
+
|
|
126
|
+
// AC2: Memoize line count for performance
|
|
127
|
+
const lineCount = useMemo(() => {
|
|
128
|
+
return result ? countLines(result.content) : 0;
|
|
129
|
+
}, [result?.content]);
|
|
130
|
+
|
|
131
|
+
// AC3: Determine if truncation applies
|
|
132
|
+
const shouldTruncate = lineCount > TRUNCATION_THRESHOLD;
|
|
133
|
+
const isTruncated = shouldTruncate && !showFullContent;
|
|
134
|
+
|
|
135
|
+
// AC3: Get display content (truncated or full)
|
|
136
|
+
const displayContent = useMemo(() => {
|
|
137
|
+
if (!result) return '';
|
|
138
|
+
if (isTruncated) {
|
|
139
|
+
return getTruncatedContent(result.content, TRUNCATION_THRESHOLD);
|
|
140
|
+
}
|
|
141
|
+
return result.content;
|
|
142
|
+
}, [result?.content, isTruncated]);
|
|
143
|
+
|
|
144
|
+
// AC4: Handle copy to clipboard
|
|
145
|
+
const handleCopy = async () => {
|
|
146
|
+
if (!result) return;
|
|
147
|
+
try {
|
|
148
|
+
await navigator.clipboard.writeText(result.content);
|
|
149
|
+
setCopyState('copied');
|
|
150
|
+
setTimeout(() => setCopyState('idle'), 2000);
|
|
151
|
+
} catch {
|
|
152
|
+
setCopyState('error');
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// AC2: Format line count text
|
|
157
|
+
const lineCountText = lineCount === 1 ? '1 line' : `${lineCount} lines`;
|
|
158
|
+
|
|
159
|
+
// MSSCI-13402: Build class list with tool type and error state
|
|
160
|
+
const blockClasses = [
|
|
161
|
+
'tool-call-block',
|
|
162
|
+
toolTypeClass,
|
|
163
|
+
isError ? 'tool-error' : '',
|
|
164
|
+
className || '',
|
|
165
|
+
].filter(Boolean).join(' ');
|
|
166
|
+
|
|
167
|
+
// Get badge label for tool type
|
|
168
|
+
const badgeLabel = getToolBadgeLabel(toolUse.tool_name);
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<TooltipProvider delayDuration={300}>
|
|
172
|
+
<div data-testid="tool-call-block" className={blockClasses}>
|
|
173
|
+
<div className="tool-header">
|
|
174
|
+
{/* Tool type badge - colored pill for instant recognition */}
|
|
175
|
+
<Tooltip>
|
|
176
|
+
<TooltipTrigger asChild>
|
|
177
|
+
<Badge variant="default" className="tool-type-badge">
|
|
178
|
+
{badgeLabel}
|
|
179
|
+
</Badge>
|
|
180
|
+
</TooltipTrigger>
|
|
181
|
+
<TooltipContent>{toolUse.tool_name}</TooltipContent>
|
|
182
|
+
</Tooltip>
|
|
183
|
+
<span className="tool-name">{intentSummary}</span>
|
|
184
|
+
{/* MSSCI-13402: Duration display */}
|
|
185
|
+
<span data-testid="tool-duration" className="tool-duration">
|
|
186
|
+
{result?.durationMs !== undefined ? formatDuration(result.durationMs) : ''}
|
|
187
|
+
</span>
|
|
188
|
+
</div>
|
|
189
|
+
{/* Prompt section - collapsible tool input display */}
|
|
190
|
+
<div className="tool-result-header">
|
|
191
|
+
<Button
|
|
192
|
+
variant="ghost"
|
|
193
|
+
size="sm"
|
|
194
|
+
data-testid="tool-prompt-toggle"
|
|
195
|
+
className="tool-result-toggle"
|
|
196
|
+
onClick={() => setIsPromptCollapsed(!isPromptCollapsed)}
|
|
197
|
+
>
|
|
198
|
+
{isPromptCollapsed ? '▶' : '▼'} Prompt ({paramCount} {paramCount === 1 ? 'param' : 'params'})
|
|
199
|
+
</Button>
|
|
200
|
+
</div>
|
|
201
|
+
<div
|
|
202
|
+
data-testid="tool-prompt-content"
|
|
203
|
+
className={`tool-result-content ${isPromptCollapsed ? 'collapsed' : ''}`}
|
|
204
|
+
>
|
|
205
|
+
<pre>{inputDisplay}</pre>
|
|
206
|
+
</div>
|
|
207
|
+
{result && (
|
|
208
|
+
<>
|
|
209
|
+
<div className="tool-result-header">
|
|
210
|
+
<Button
|
|
211
|
+
variant="ghost"
|
|
212
|
+
size="sm"
|
|
213
|
+
data-testid="tool-result-toggle"
|
|
214
|
+
className="tool-result-toggle"
|
|
215
|
+
onClick={() => setIsCollapsed(!isCollapsed)}
|
|
216
|
+
>
|
|
217
|
+
{isCollapsed ? '▶' : '▼'} Result ({lineCountText})
|
|
218
|
+
</Button>
|
|
219
|
+
<Button
|
|
220
|
+
variant="ghost"
|
|
221
|
+
size="icon"
|
|
222
|
+
data-testid="tool-result-copy"
|
|
223
|
+
className={`tool-result-copy ${copyState === 'copied' ? 'copied' : ''} ${copyState === 'error' ? 'copy-error' : ''}`}
|
|
224
|
+
onClick={handleCopy}
|
|
225
|
+
aria-label="Copy result to clipboard"
|
|
226
|
+
>
|
|
227
|
+
{copyState === 'copied' ? '✓' : '📋'}
|
|
228
|
+
</Button>
|
|
229
|
+
</div>
|
|
230
|
+
<div
|
|
231
|
+
data-testid="tool-result-content"
|
|
232
|
+
className={`tool-result-content ${isCollapsed ? 'collapsed' : ''} ${isTruncated && !isCollapsed ? 'truncated' : ''} ${isError ? 'error-content' : ''}`}
|
|
233
|
+
>
|
|
234
|
+
<pre>{displayContent}</pre>
|
|
235
|
+
{shouldTruncate && !isCollapsed && isTruncated && (
|
|
236
|
+
<Button
|
|
237
|
+
variant="link"
|
|
238
|
+
size="sm"
|
|
239
|
+
data-testid="tool-result-expand"
|
|
240
|
+
className="tool-result-expand"
|
|
241
|
+
onClick={() => setShowFullContent(true)}
|
|
242
|
+
>
|
|
243
|
+
Show all ({lineCount} lines)
|
|
244
|
+
</Button>
|
|
245
|
+
)}
|
|
246
|
+
</div>
|
|
247
|
+
</>
|
|
248
|
+
)}
|
|
249
|
+
</div>
|
|
250
|
+
</TooltipProvider>
|
|
251
|
+
);
|
|
252
|
+
}
|