@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,940 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color Presets - MSSCI-12768
|
|
3
|
+
*
|
|
4
|
+
* 8 built-in color presets for the Cyclist theme system.
|
|
5
|
+
* Each preset includes UI colors, terminal colors, and WCAG contrast validation.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// Types
|
|
10
|
+
// =============================================================================
|
|
11
|
+
|
|
12
|
+
export interface ColorPreset {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
variant: 'dark' | 'light';
|
|
16
|
+
colors: {
|
|
17
|
+
bgPrimary: string;
|
|
18
|
+
bgSecondary: string;
|
|
19
|
+
bgTertiary: string;
|
|
20
|
+
textPrimary: string;
|
|
21
|
+
textSecondary: string;
|
|
22
|
+
textMuted: string;
|
|
23
|
+
accent: string;
|
|
24
|
+
accentHover: string;
|
|
25
|
+
border: string;
|
|
26
|
+
borderFocus: string;
|
|
27
|
+
};
|
|
28
|
+
terminalColors: {
|
|
29
|
+
background: string;
|
|
30
|
+
foreground: string;
|
|
31
|
+
black: string;
|
|
32
|
+
red: string;
|
|
33
|
+
green: string;
|
|
34
|
+
yellow: string;
|
|
35
|
+
blue: string;
|
|
36
|
+
magenta: string;
|
|
37
|
+
cyan: string;
|
|
38
|
+
white: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ContrastResult {
|
|
43
|
+
ratio: number;
|
|
44
|
+
passesAA: boolean;
|
|
45
|
+
passesAAA: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface PresetContrastValidation {
|
|
49
|
+
textOnBgPrimary: ContrastResult;
|
|
50
|
+
accentOnBgPrimary: ContrastResult;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ContrastReport {
|
|
54
|
+
presetId: string;
|
|
55
|
+
checks: PresetContrastValidation;
|
|
56
|
+
allPass: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// =============================================================================
|
|
60
|
+
// Color Presets
|
|
61
|
+
// =============================================================================
|
|
62
|
+
|
|
63
|
+
export const DEFAULT_PRESET = 'midnight';
|
|
64
|
+
|
|
65
|
+
export const COLOR_PRESETS: Record<string, ColorPreset> = {
|
|
66
|
+
midnight: {
|
|
67
|
+
id: 'midnight',
|
|
68
|
+
name: 'Midnight',
|
|
69
|
+
variant: 'dark',
|
|
70
|
+
colors: {
|
|
71
|
+
bgPrimary: '#1a1a2e',
|
|
72
|
+
bgSecondary: '#16213e',
|
|
73
|
+
bgTertiary: '#0f0f1a',
|
|
74
|
+
textPrimary: '#e4e4e7',
|
|
75
|
+
textSecondary: '#a1a1aa',
|
|
76
|
+
textMuted: '#71717a',
|
|
77
|
+
accent: '#818cf8',
|
|
78
|
+
accentHover: '#a5b4fc',
|
|
79
|
+
border: '#27272a',
|
|
80
|
+
borderFocus: '#818cf8',
|
|
81
|
+
},
|
|
82
|
+
terminalColors: {
|
|
83
|
+
background: '#0f0f1a',
|
|
84
|
+
foreground: '#e4e4e7',
|
|
85
|
+
black: '#1a1a2e',
|
|
86
|
+
red: '#ff6b6b',
|
|
87
|
+
green: '#69db7c',
|
|
88
|
+
yellow: '#ffd43b',
|
|
89
|
+
blue: '#818cf8',
|
|
90
|
+
magenta: '#cc5de8',
|
|
91
|
+
cyan: '#22b8cf',
|
|
92
|
+
white: '#e4e4e7',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
daylight: {
|
|
97
|
+
id: 'daylight',
|
|
98
|
+
name: 'Daylight',
|
|
99
|
+
variant: 'light',
|
|
100
|
+
colors: {
|
|
101
|
+
bgPrimary: '#ffffff',
|
|
102
|
+
bgSecondary: '#f4f4f5',
|
|
103
|
+
bgTertiary: '#e4e4e7',
|
|
104
|
+
textPrimary: '#18181b',
|
|
105
|
+
textSecondary: '#3f3f46',
|
|
106
|
+
textMuted: '#71717a',
|
|
107
|
+
accent: '#4f46e5',
|
|
108
|
+
accentHover: '#4338ca',
|
|
109
|
+
border: '#d4d4d8',
|
|
110
|
+
borderFocus: '#4f46e5',
|
|
111
|
+
},
|
|
112
|
+
terminalColors: {
|
|
113
|
+
background: '#ffffff',
|
|
114
|
+
foreground: '#18181b',
|
|
115
|
+
black: '#18181b',
|
|
116
|
+
red: '#dc2626',
|
|
117
|
+
green: '#16a34a',
|
|
118
|
+
yellow: '#ca8a04',
|
|
119
|
+
blue: '#2563eb',
|
|
120
|
+
magenta: '#9333ea',
|
|
121
|
+
cyan: '#0891b2',
|
|
122
|
+
white: '#f4f4f5',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
'high-contrast': {
|
|
127
|
+
id: 'high-contrast',
|
|
128
|
+
name: 'High Contrast',
|
|
129
|
+
variant: 'dark',
|
|
130
|
+
colors: {
|
|
131
|
+
bgPrimary: '#000000',
|
|
132
|
+
bgSecondary: '#0a0a0a',
|
|
133
|
+
bgTertiary: '#141414',
|
|
134
|
+
textPrimary: '#ffffff',
|
|
135
|
+
textSecondary: '#e5e5e5',
|
|
136
|
+
textMuted: '#a3a3a3',
|
|
137
|
+
accent: '#ffff00',
|
|
138
|
+
accentHover: '#ffff66',
|
|
139
|
+
border: '#404040',
|
|
140
|
+
borderFocus: '#ffff00',
|
|
141
|
+
},
|
|
142
|
+
terminalColors: {
|
|
143
|
+
background: '#000000',
|
|
144
|
+
foreground: '#ffffff',
|
|
145
|
+
black: '#000000',
|
|
146
|
+
red: '#ff0000',
|
|
147
|
+
green: '#00ff00',
|
|
148
|
+
yellow: '#ffff00',
|
|
149
|
+
blue: '#0080ff',
|
|
150
|
+
magenta: '#ff00ff',
|
|
151
|
+
cyan: '#00ffff',
|
|
152
|
+
white: '#ffffff',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
dracula: {
|
|
157
|
+
id: 'dracula',
|
|
158
|
+
name: 'Dracula',
|
|
159
|
+
variant: 'dark',
|
|
160
|
+
colors: {
|
|
161
|
+
bgPrimary: '#282A36',
|
|
162
|
+
bgSecondary: '#21222C',
|
|
163
|
+
bgTertiary: '#191A21',
|
|
164
|
+
textPrimary: '#F8F8F2',
|
|
165
|
+
textSecondary: '#BFBFBF',
|
|
166
|
+
textMuted: '#6272A4',
|
|
167
|
+
accent: '#BD93F9',
|
|
168
|
+
accentHover: '#CAA9FA',
|
|
169
|
+
border: '#44475A',
|
|
170
|
+
borderFocus: '#BD93F9',
|
|
171
|
+
},
|
|
172
|
+
terminalColors: {
|
|
173
|
+
background: '#282A36',
|
|
174
|
+
foreground: '#F8F8F2',
|
|
175
|
+
black: '#21222C',
|
|
176
|
+
red: '#FF5555',
|
|
177
|
+
green: '#50FA7B',
|
|
178
|
+
yellow: '#F1FA8C',
|
|
179
|
+
blue: '#BD93F9',
|
|
180
|
+
magenta: '#FF79C6',
|
|
181
|
+
cyan: '#8BE9FD',
|
|
182
|
+
white: '#F8F8F2',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
nord: {
|
|
187
|
+
id: 'nord',
|
|
188
|
+
name: 'Nord',
|
|
189
|
+
variant: 'dark',
|
|
190
|
+
colors: {
|
|
191
|
+
bgPrimary: '#2E3440',
|
|
192
|
+
bgSecondary: '#3B4252',
|
|
193
|
+
bgTertiary: '#434C5E',
|
|
194
|
+
textPrimary: '#ECEFF4',
|
|
195
|
+
textSecondary: '#D8DEE9',
|
|
196
|
+
textMuted: '#4C566A',
|
|
197
|
+
accent: '#88C0D0',
|
|
198
|
+
accentHover: '#8FBCBB',
|
|
199
|
+
border: '#4C566A',
|
|
200
|
+
borderFocus: '#88C0D0',
|
|
201
|
+
},
|
|
202
|
+
terminalColors: {
|
|
203
|
+
background: '#2E3440',
|
|
204
|
+
foreground: '#ECEFF4',
|
|
205
|
+
black: '#3B4252',
|
|
206
|
+
red: '#BF616A',
|
|
207
|
+
green: '#A3BE8C',
|
|
208
|
+
yellow: '#EBCB8B',
|
|
209
|
+
blue: '#81A1C1',
|
|
210
|
+
magenta: '#B48EAD',
|
|
211
|
+
cyan: '#88C0D0',
|
|
212
|
+
white: '#ECEFF4',
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
gruvbox: {
|
|
217
|
+
id: 'gruvbox',
|
|
218
|
+
name: 'Gruvbox',
|
|
219
|
+
variant: 'dark',
|
|
220
|
+
colors: {
|
|
221
|
+
bgPrimary: '#1D2021',
|
|
222
|
+
bgSecondary: '#282828',
|
|
223
|
+
bgTertiary: '#3C3836',
|
|
224
|
+
textPrimary: '#EBDBB2',
|
|
225
|
+
textSecondary: '#D5C4A1',
|
|
226
|
+
textMuted: '#928374',
|
|
227
|
+
accent: '#8EC07C',
|
|
228
|
+
accentHover: '#B8BB26',
|
|
229
|
+
border: '#504945',
|
|
230
|
+
borderFocus: '#8EC07C',
|
|
231
|
+
},
|
|
232
|
+
terminalColors: {
|
|
233
|
+
background: '#1D2021',
|
|
234
|
+
foreground: '#EBDBB2',
|
|
235
|
+
black: '#282828',
|
|
236
|
+
red: '#CC241D',
|
|
237
|
+
green: '#98971A',
|
|
238
|
+
yellow: '#D79921',
|
|
239
|
+
blue: '#458588',
|
|
240
|
+
magenta: '#B16286',
|
|
241
|
+
cyan: '#689D6A',
|
|
242
|
+
white: '#EBDBB2',
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
catppuccin: {
|
|
247
|
+
id: 'catppuccin',
|
|
248
|
+
name: 'Catppuccin',
|
|
249
|
+
variant: 'dark',
|
|
250
|
+
colors: {
|
|
251
|
+
bgPrimary: '#1E1E2E',
|
|
252
|
+
bgSecondary: '#181825',
|
|
253
|
+
bgTertiary: '#11111B',
|
|
254
|
+
textPrimary: '#CDD6F4',
|
|
255
|
+
textSecondary: '#BAC2DE',
|
|
256
|
+
textMuted: '#6C7086',
|
|
257
|
+
accent: '#89B4FA',
|
|
258
|
+
accentHover: '#74C7EC',
|
|
259
|
+
border: '#45475A',
|
|
260
|
+
borderFocus: '#89B4FA',
|
|
261
|
+
},
|
|
262
|
+
terminalColors: {
|
|
263
|
+
background: '#1E1E2E',
|
|
264
|
+
foreground: '#CDD6F4',
|
|
265
|
+
black: '#45475A',
|
|
266
|
+
red: '#F38BA8',
|
|
267
|
+
green: '#A6E3A1',
|
|
268
|
+
yellow: '#F9E2AF',
|
|
269
|
+
blue: '#89B4FA',
|
|
270
|
+
magenta: '#F5C2E7',
|
|
271
|
+
cyan: '#94E2D5',
|
|
272
|
+
white: '#CDD6F4',
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
'tokyo-night': {
|
|
277
|
+
id: 'tokyo-night',
|
|
278
|
+
name: 'Tokyo Night',
|
|
279
|
+
variant: 'dark',
|
|
280
|
+
colors: {
|
|
281
|
+
bgPrimary: '#1A1B26',
|
|
282
|
+
bgSecondary: '#16161E',
|
|
283
|
+
bgTertiary: '#13131A',
|
|
284
|
+
textPrimary: '#A9B1D6',
|
|
285
|
+
textSecondary: '#9AA5CE',
|
|
286
|
+
textMuted: '#565F89',
|
|
287
|
+
accent: '#7AA2F7',
|
|
288
|
+
accentHover: '#7DCFFF',
|
|
289
|
+
border: '#292E42',
|
|
290
|
+
borderFocus: '#7AA2F7',
|
|
291
|
+
},
|
|
292
|
+
terminalColors: {
|
|
293
|
+
background: '#1A1B26',
|
|
294
|
+
foreground: '#A9B1D6',
|
|
295
|
+
black: '#32344A',
|
|
296
|
+
red: '#F7768E',
|
|
297
|
+
green: '#9ECE6A',
|
|
298
|
+
yellow: '#E0AF68',
|
|
299
|
+
blue: '#7AA2F7',
|
|
300
|
+
magenta: '#BB9AF7',
|
|
301
|
+
cyan: '#7DCFFF',
|
|
302
|
+
white: '#A9B1D6',
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
'solarized-dark': {
|
|
307
|
+
id: 'solarized-dark',
|
|
308
|
+
name: 'Solarized Dark',
|
|
309
|
+
variant: 'dark',
|
|
310
|
+
colors: {
|
|
311
|
+
bgPrimary: '#002B36',
|
|
312
|
+
bgSecondary: '#073642',
|
|
313
|
+
bgTertiary: '#001E27',
|
|
314
|
+
textPrimary: '#839496',
|
|
315
|
+
textSecondary: '#657B83',
|
|
316
|
+
textMuted: '#586E75',
|
|
317
|
+
accent: '#2B9ED8',
|
|
318
|
+
accentHover: '#2AA198',
|
|
319
|
+
border: '#094959',
|
|
320
|
+
borderFocus: '#2B9ED8',
|
|
321
|
+
},
|
|
322
|
+
terminalColors: {
|
|
323
|
+
background: '#002B36',
|
|
324
|
+
foreground: '#839496',
|
|
325
|
+
black: '#073642',
|
|
326
|
+
red: '#DC322F',
|
|
327
|
+
green: '#859900',
|
|
328
|
+
yellow: '#B58900',
|
|
329
|
+
blue: '#268BD2',
|
|
330
|
+
magenta: '#D33682',
|
|
331
|
+
cyan: '#2AA198',
|
|
332
|
+
white: '#EEE8D5',
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
|
|
336
|
+
'solarized-light': {
|
|
337
|
+
id: 'solarized-light',
|
|
338
|
+
name: 'Solarized Light',
|
|
339
|
+
variant: 'light',
|
|
340
|
+
colors: {
|
|
341
|
+
bgPrimary: '#FDF6E3',
|
|
342
|
+
bgSecondary: '#EEE8D5',
|
|
343
|
+
bgTertiary: '#DDD6C1',
|
|
344
|
+
textPrimary: '#475B62',
|
|
345
|
+
textSecondary: '#586E75',
|
|
346
|
+
textMuted: '#93A1A1',
|
|
347
|
+
accent: '#0B69AD',
|
|
348
|
+
accentHover: '#2AA198',
|
|
349
|
+
border: '#D3CBB8',
|
|
350
|
+
borderFocus: '#0B69AD',
|
|
351
|
+
},
|
|
352
|
+
terminalColors: {
|
|
353
|
+
background: '#FDF6E3',
|
|
354
|
+
foreground: '#657B83',
|
|
355
|
+
black: '#073642',
|
|
356
|
+
red: '#DC322F',
|
|
357
|
+
green: '#859900',
|
|
358
|
+
yellow: '#B58900',
|
|
359
|
+
blue: '#268BD2',
|
|
360
|
+
magenta: '#D33682',
|
|
361
|
+
cyan: '#2AA198',
|
|
362
|
+
white: '#FDF6E3',
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
|
|
366
|
+
monokai: {
|
|
367
|
+
id: 'monokai',
|
|
368
|
+
name: 'Monokai',
|
|
369
|
+
variant: 'dark',
|
|
370
|
+
colors: {
|
|
371
|
+
bgPrimary: '#272822',
|
|
372
|
+
bgSecondary: '#1E1F1C',
|
|
373
|
+
bgTertiary: '#171813',
|
|
374
|
+
textPrimary: '#F8F8F2',
|
|
375
|
+
textSecondary: '#CFCFC2',
|
|
376
|
+
textMuted: '#75715E',
|
|
377
|
+
accent: '#A6E22E',
|
|
378
|
+
accentHover: '#E6DB74',
|
|
379
|
+
border: '#3E3D32',
|
|
380
|
+
borderFocus: '#A6E22E',
|
|
381
|
+
},
|
|
382
|
+
terminalColors: {
|
|
383
|
+
background: '#272822',
|
|
384
|
+
foreground: '#F8F8F2',
|
|
385
|
+
black: '#272822',
|
|
386
|
+
red: '#F92672',
|
|
387
|
+
green: '#A6E22E',
|
|
388
|
+
yellow: '#F4BF75',
|
|
389
|
+
blue: '#66D9EF',
|
|
390
|
+
magenta: '#AE81FF',
|
|
391
|
+
cyan: '#A1EFE4',
|
|
392
|
+
white: '#F8F8F2',
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
|
|
396
|
+
'one-dark': {
|
|
397
|
+
id: 'one-dark',
|
|
398
|
+
name: 'One Dark',
|
|
399
|
+
variant: 'dark',
|
|
400
|
+
colors: {
|
|
401
|
+
bgPrimary: '#282C34',
|
|
402
|
+
bgSecondary: '#21252B',
|
|
403
|
+
bgTertiary: '#1B1D23',
|
|
404
|
+
textPrimary: '#ABB2BF',
|
|
405
|
+
textSecondary: '#9DA5B4',
|
|
406
|
+
textMuted: '#636D83',
|
|
407
|
+
accent: '#61AFEF',
|
|
408
|
+
accentHover: '#528BFF',
|
|
409
|
+
border: '#3E4451',
|
|
410
|
+
borderFocus: '#61AFEF',
|
|
411
|
+
},
|
|
412
|
+
terminalColors: {
|
|
413
|
+
background: '#282C34',
|
|
414
|
+
foreground: '#ABB2BF',
|
|
415
|
+
black: '#3F4451',
|
|
416
|
+
red: '#E06C75',
|
|
417
|
+
green: '#98C379',
|
|
418
|
+
yellow: '#E5C07B',
|
|
419
|
+
blue: '#61AFEF',
|
|
420
|
+
magenta: '#C678DD',
|
|
421
|
+
cyan: '#56B6C2',
|
|
422
|
+
white: '#ABB2BF',
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
|
|
426
|
+
'one-light': {
|
|
427
|
+
id: 'one-light',
|
|
428
|
+
name: 'One Light',
|
|
429
|
+
variant: 'light',
|
|
430
|
+
colors: {
|
|
431
|
+
bgPrimary: '#FAFAFA',
|
|
432
|
+
bgSecondary: '#F0F0F0',
|
|
433
|
+
bgTertiary: '#E5E5E6',
|
|
434
|
+
textPrimary: '#383A42',
|
|
435
|
+
textSecondary: '#4F525D',
|
|
436
|
+
textMuted: '#A0A1A7',
|
|
437
|
+
accent: '#3367D6',
|
|
438
|
+
accentHover: '#526FFF',
|
|
439
|
+
border: '#D3D3D4',
|
|
440
|
+
borderFocus: '#3367D6',
|
|
441
|
+
},
|
|
442
|
+
terminalColors: {
|
|
443
|
+
background: '#FAFAFA',
|
|
444
|
+
foreground: '#383A42',
|
|
445
|
+
black: '#383A42',
|
|
446
|
+
red: '#E45649',
|
|
447
|
+
green: '#50A14F',
|
|
448
|
+
yellow: '#C18401',
|
|
449
|
+
blue: '#4078F2',
|
|
450
|
+
magenta: '#A626A4',
|
|
451
|
+
cyan: '#0184BC',
|
|
452
|
+
white: '#FAFAFA',
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
|
|
456
|
+
'github-dark': {
|
|
457
|
+
id: 'github-dark',
|
|
458
|
+
name: 'GitHub Dark',
|
|
459
|
+
variant: 'dark',
|
|
460
|
+
colors: {
|
|
461
|
+
bgPrimary: '#0D1117',
|
|
462
|
+
bgSecondary: '#161B22',
|
|
463
|
+
bgTertiary: '#010409',
|
|
464
|
+
textPrimary: '#C9D1D9',
|
|
465
|
+
textSecondary: '#8B949E',
|
|
466
|
+
textMuted: '#6E7681',
|
|
467
|
+
accent: '#58A6FF',
|
|
468
|
+
accentHover: '#79C0FF',
|
|
469
|
+
border: '#30363D',
|
|
470
|
+
borderFocus: '#58A6FF',
|
|
471
|
+
},
|
|
472
|
+
terminalColors: {
|
|
473
|
+
background: '#0D1117',
|
|
474
|
+
foreground: '#C9D1D9',
|
|
475
|
+
black: '#484F58',
|
|
476
|
+
red: '#FF7B72',
|
|
477
|
+
green: '#7EE787',
|
|
478
|
+
yellow: '#D29922',
|
|
479
|
+
blue: '#58A6FF',
|
|
480
|
+
magenta: '#BC8CFF',
|
|
481
|
+
cyan: '#39C5CF',
|
|
482
|
+
white: '#C9D1D9',
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
|
|
486
|
+
'github-light': {
|
|
487
|
+
id: 'github-light',
|
|
488
|
+
name: 'GitHub Light',
|
|
489
|
+
variant: 'light',
|
|
490
|
+
colors: {
|
|
491
|
+
bgPrimary: '#FFFFFF',
|
|
492
|
+
bgSecondary: '#F6F8FA',
|
|
493
|
+
bgTertiary: '#EAEEF2',
|
|
494
|
+
textPrimary: '#1F2328',
|
|
495
|
+
textSecondary: '#656D76',
|
|
496
|
+
textMuted: '#8C959F',
|
|
497
|
+
accent: '#0969DA',
|
|
498
|
+
accentHover: '#0550AE',
|
|
499
|
+
border: '#D0D7DE',
|
|
500
|
+
borderFocus: '#0969DA',
|
|
501
|
+
},
|
|
502
|
+
terminalColors: {
|
|
503
|
+
background: '#FFFFFF',
|
|
504
|
+
foreground: '#1F2328',
|
|
505
|
+
black: '#24292F',
|
|
506
|
+
red: '#CF222E',
|
|
507
|
+
green: '#1A7F37',
|
|
508
|
+
yellow: '#9A6700',
|
|
509
|
+
blue: '#0969DA',
|
|
510
|
+
magenta: '#8250DF',
|
|
511
|
+
cyan: '#1B7C83',
|
|
512
|
+
white: '#FFFFFF',
|
|
513
|
+
},
|
|
514
|
+
},
|
|
515
|
+
|
|
516
|
+
'rose-pine': {
|
|
517
|
+
id: 'rose-pine',
|
|
518
|
+
name: 'Rosé Pine',
|
|
519
|
+
variant: 'dark',
|
|
520
|
+
colors: {
|
|
521
|
+
bgPrimary: '#191724',
|
|
522
|
+
bgSecondary: '#1F1D2E',
|
|
523
|
+
bgTertiary: '#26233A',
|
|
524
|
+
textPrimary: '#E0DEF4',
|
|
525
|
+
textSecondary: '#908CAA',
|
|
526
|
+
textMuted: '#6E6A86',
|
|
527
|
+
accent: '#C4A7E7',
|
|
528
|
+
accentHover: '#EB6F92',
|
|
529
|
+
border: '#403D52',
|
|
530
|
+
borderFocus: '#C4A7E7',
|
|
531
|
+
},
|
|
532
|
+
terminalColors: {
|
|
533
|
+
background: '#191724',
|
|
534
|
+
foreground: '#E0DEF4',
|
|
535
|
+
black: '#26233A',
|
|
536
|
+
red: '#EB6F92',
|
|
537
|
+
green: '#31748F',
|
|
538
|
+
yellow: '#F6C177',
|
|
539
|
+
blue: '#9CCFD8',
|
|
540
|
+
magenta: '#C4A7E7',
|
|
541
|
+
cyan: '#EBBCBA',
|
|
542
|
+
white: '#E0DEF4',
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
|
|
546
|
+
'rose-pine-dawn': {
|
|
547
|
+
id: 'rose-pine-dawn',
|
|
548
|
+
name: 'Rosé Pine Dawn',
|
|
549
|
+
variant: 'light',
|
|
550
|
+
colors: {
|
|
551
|
+
bgPrimary: '#FAF4ED',
|
|
552
|
+
bgSecondary: '#FFFAF3',
|
|
553
|
+
bgTertiary: '#F2E9E1',
|
|
554
|
+
textPrimary: '#575279',
|
|
555
|
+
textSecondary: '#797593',
|
|
556
|
+
textMuted: '#9893A5',
|
|
557
|
+
accent: '#735E8C',
|
|
558
|
+
accentHover: '#B4637A',
|
|
559
|
+
border: '#DFDAD9',
|
|
560
|
+
borderFocus: '#735E8C',
|
|
561
|
+
},
|
|
562
|
+
terminalColors: {
|
|
563
|
+
background: '#FAF4ED',
|
|
564
|
+
foreground: '#575279',
|
|
565
|
+
black: '#575279',
|
|
566
|
+
red: '#B4637A',
|
|
567
|
+
green: '#286983',
|
|
568
|
+
yellow: '#EA9D34',
|
|
569
|
+
blue: '#56949F',
|
|
570
|
+
magenta: '#907AA9',
|
|
571
|
+
cyan: '#D7827E',
|
|
572
|
+
white: '#FAF4ED',
|
|
573
|
+
},
|
|
574
|
+
},
|
|
575
|
+
|
|
576
|
+
kanagawa: {
|
|
577
|
+
id: 'kanagawa',
|
|
578
|
+
name: 'Kanagawa',
|
|
579
|
+
variant: 'dark',
|
|
580
|
+
colors: {
|
|
581
|
+
bgPrimary: '#1F1F28',
|
|
582
|
+
bgSecondary: '#2A2A37',
|
|
583
|
+
bgTertiary: '#16161D',
|
|
584
|
+
textPrimary: '#DCD7BA',
|
|
585
|
+
textSecondary: '#C8C093',
|
|
586
|
+
textMuted: '#727169',
|
|
587
|
+
accent: '#7E9CD8',
|
|
588
|
+
accentHover: '#7FB4CA',
|
|
589
|
+
border: '#363646',
|
|
590
|
+
borderFocus: '#7E9CD8',
|
|
591
|
+
},
|
|
592
|
+
terminalColors: {
|
|
593
|
+
background: '#1F1F28',
|
|
594
|
+
foreground: '#DCD7BA',
|
|
595
|
+
black: '#16161D',
|
|
596
|
+
red: '#C34043',
|
|
597
|
+
green: '#76946A',
|
|
598
|
+
yellow: '#C0A36E',
|
|
599
|
+
blue: '#7E9CD8',
|
|
600
|
+
magenta: '#957FB8',
|
|
601
|
+
cyan: '#6A9589',
|
|
602
|
+
white: '#DCD7BA',
|
|
603
|
+
},
|
|
604
|
+
},
|
|
605
|
+
|
|
606
|
+
'ayu-dark': {
|
|
607
|
+
id: 'ayu-dark',
|
|
608
|
+
name: 'Ayu Dark',
|
|
609
|
+
variant: 'dark',
|
|
610
|
+
colors: {
|
|
611
|
+
bgPrimary: '#0B0E14',
|
|
612
|
+
bgSecondary: '#0D1017',
|
|
613
|
+
bgTertiary: '#060810',
|
|
614
|
+
textPrimary: '#BFBDB6',
|
|
615
|
+
textSecondary: '#9B9B9B',
|
|
616
|
+
textMuted: '#636A72',
|
|
617
|
+
accent: '#E6B450',
|
|
618
|
+
accentHover: '#FFB454',
|
|
619
|
+
border: '#1C1F27',
|
|
620
|
+
borderFocus: '#E6B450',
|
|
621
|
+
},
|
|
622
|
+
terminalColors: {
|
|
623
|
+
background: '#0B0E14',
|
|
624
|
+
foreground: '#BFBDB6',
|
|
625
|
+
black: '#01060E',
|
|
626
|
+
red: '#EA6C73',
|
|
627
|
+
green: '#91B362',
|
|
628
|
+
yellow: '#F9AF4F',
|
|
629
|
+
blue: '#53BDFA',
|
|
630
|
+
magenta: '#D2A6FF',
|
|
631
|
+
cyan: '#90E1C6',
|
|
632
|
+
white: '#C7C7C7',
|
|
633
|
+
},
|
|
634
|
+
},
|
|
635
|
+
|
|
636
|
+
'ayu-light': {
|
|
637
|
+
id: 'ayu-light',
|
|
638
|
+
name: 'Ayu Light',
|
|
639
|
+
variant: 'light',
|
|
640
|
+
colors: {
|
|
641
|
+
bgPrimary: '#FCFCFC',
|
|
642
|
+
bgSecondary: '#F3F4F5',
|
|
643
|
+
bgTertiary: '#E7E8E9',
|
|
644
|
+
textPrimary: '#5C6166',
|
|
645
|
+
textSecondary: '#787B80',
|
|
646
|
+
textMuted: '#ABB0B6',
|
|
647
|
+
accent: '#9E5E08',
|
|
648
|
+
accentHover: '#F2AE49',
|
|
649
|
+
border: '#D8D8D8',
|
|
650
|
+
borderFocus: '#9E5E08',
|
|
651
|
+
},
|
|
652
|
+
terminalColors: {
|
|
653
|
+
background: '#FCFCFC',
|
|
654
|
+
foreground: '#5C6166',
|
|
655
|
+
black: '#1A1F29',
|
|
656
|
+
red: '#F07171',
|
|
657
|
+
green: '#86B300',
|
|
658
|
+
yellow: '#F2AE49',
|
|
659
|
+
blue: '#399EE6',
|
|
660
|
+
magenta: '#A37ACC',
|
|
661
|
+
cyan: '#4CBF99',
|
|
662
|
+
white: '#FCFCFC',
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
// =============================================================================
|
|
668
|
+
// Preset Access Functions
|
|
669
|
+
// =============================================================================
|
|
670
|
+
|
|
671
|
+
export function getPreset(id: string): ColorPreset | undefined {
|
|
672
|
+
return COLOR_PRESETS[id];
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
export function getPresetIds(): string[] {
|
|
676
|
+
return Object.keys(COLOR_PRESETS);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// =============================================================================
|
|
680
|
+
// WCAG Contrast Functions
|
|
681
|
+
// =============================================================================
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Parse hex color to RGB values
|
|
685
|
+
*/
|
|
686
|
+
function hexToRgb(hex: string): { r: number; g: number; b: number } {
|
|
687
|
+
const cleanHex = hex.replace('#', '');
|
|
688
|
+
return {
|
|
689
|
+
r: parseInt(cleanHex.substring(0, 2), 16),
|
|
690
|
+
g: parseInt(cleanHex.substring(2, 4), 16),
|
|
691
|
+
b: parseInt(cleanHex.substring(4, 6), 16),
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Calculate relative luminance per WCAG 2.0
|
|
697
|
+
*/
|
|
698
|
+
function getLuminance(hex: string): number {
|
|
699
|
+
const { r, g, b } = hexToRgb(hex);
|
|
700
|
+
|
|
701
|
+
const [rs, gs, bs] = [r, g, b].map((c) => {
|
|
702
|
+
const sRGB = c / 255;
|
|
703
|
+
return sRGB <= 0.03928
|
|
704
|
+
? sRGB / 12.92
|
|
705
|
+
: Math.pow((sRGB + 0.055) / 1.055, 2.4);
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Check contrast ratio between two colors
|
|
713
|
+
*/
|
|
714
|
+
export function checkContrast(foreground: string, background: string): ContrastResult {
|
|
715
|
+
const l1 = getLuminance(foreground);
|
|
716
|
+
const l2 = getLuminance(background);
|
|
717
|
+
|
|
718
|
+
const lighter = Math.max(l1, l2);
|
|
719
|
+
const darker = Math.min(l1, l2);
|
|
720
|
+
const ratio = (lighter + 0.05) / (darker + 0.05);
|
|
721
|
+
|
|
722
|
+
return {
|
|
723
|
+
ratio,
|
|
724
|
+
passesAA: ratio >= 4.5,
|
|
725
|
+
passesAAA: ratio >= 7,
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Validate contrast ratios for a preset
|
|
731
|
+
*/
|
|
732
|
+
export function validatePresetContrast(preset: ColorPreset): PresetContrastValidation {
|
|
733
|
+
return {
|
|
734
|
+
textOnBgPrimary: checkContrast(preset.colors.textPrimary, preset.colors.bgPrimary),
|
|
735
|
+
accentOnBgPrimary: checkContrast(preset.colors.accent, preset.colors.bgPrimary),
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Get full contrast report for a preset
|
|
741
|
+
*/
|
|
742
|
+
export function getContrastReport(preset: ColorPreset): ContrastReport {
|
|
743
|
+
const checks = validatePresetContrast(preset);
|
|
744
|
+
return {
|
|
745
|
+
presetId: preset.id,
|
|
746
|
+
checks,
|
|
747
|
+
allPass: checks.textOnBgPrimary.passesAA && checks.accentOnBgPrimary.passesAA,
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
// =============================================================================
|
|
752
|
+
// Preset Application
|
|
753
|
+
// =============================================================================
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Apply a preset to the document
|
|
757
|
+
*/
|
|
758
|
+
export function applyPreset(presetId: string): void {
|
|
759
|
+
const preset = getPreset(presetId);
|
|
760
|
+
if (!preset) {
|
|
761
|
+
console.error(`[color-presets] Unknown preset: ${presetId}`);
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
const root = document.documentElement;
|
|
766
|
+
|
|
767
|
+
// Add transition class
|
|
768
|
+
root.classList.add('theme-transition');
|
|
769
|
+
|
|
770
|
+
// Set data attributes
|
|
771
|
+
root.setAttribute('data-preset', preset.id);
|
|
772
|
+
root.setAttribute('data-variant', preset.variant);
|
|
773
|
+
|
|
774
|
+
// Apply UI colors
|
|
775
|
+
root.style.setProperty('--bg-primary', preset.colors.bgPrimary);
|
|
776
|
+
root.style.setProperty('--bg-secondary', preset.colors.bgSecondary);
|
|
777
|
+
root.style.setProperty('--bg-tertiary', preset.colors.bgTertiary);
|
|
778
|
+
root.style.setProperty('--text-primary', preset.colors.textPrimary);
|
|
779
|
+
root.style.setProperty('--text-secondary', preset.colors.textSecondary);
|
|
780
|
+
root.style.setProperty('--text-muted', preset.colors.textMuted);
|
|
781
|
+
root.style.setProperty('--accent', preset.colors.accent);
|
|
782
|
+
root.style.setProperty('--accent-hover', preset.colors.accentHover);
|
|
783
|
+
root.style.setProperty('--border', preset.colors.border);
|
|
784
|
+
root.style.setProperty('--border-focus', preset.colors.borderFocus);
|
|
785
|
+
|
|
786
|
+
// Apply terminal colors
|
|
787
|
+
root.style.setProperty('--terminal-background', preset.terminalColors.background);
|
|
788
|
+
root.style.setProperty('--terminal-foreground', preset.terminalColors.foreground);
|
|
789
|
+
root.style.setProperty('--terminal-black', preset.terminalColors.black);
|
|
790
|
+
root.style.setProperty('--terminal-red', preset.terminalColors.red);
|
|
791
|
+
root.style.setProperty('--terminal-green', preset.terminalColors.green);
|
|
792
|
+
root.style.setProperty('--terminal-yellow', preset.terminalColors.yellow);
|
|
793
|
+
root.style.setProperty('--terminal-blue', preset.terminalColors.blue);
|
|
794
|
+
root.style.setProperty('--terminal-magenta', preset.terminalColors.magenta);
|
|
795
|
+
root.style.setProperty('--terminal-cyan', preset.terminalColors.cyan);
|
|
796
|
+
root.style.setProperty('--terminal-white', preset.terminalColors.white);
|
|
797
|
+
|
|
798
|
+
// Dispatch event
|
|
799
|
+
window.dispatchEvent(new CustomEvent('presetChange', { detail: { presetId } }));
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
// =============================================================================
|
|
803
|
+
// Preset Cycling
|
|
804
|
+
// =============================================================================
|
|
805
|
+
|
|
806
|
+
export function cyclePreset(currentId: string, direction: 'forward' | 'backward'): string {
|
|
807
|
+
const ids = getPresetIds();
|
|
808
|
+
const currentIndex = ids.indexOf(currentId);
|
|
809
|
+
|
|
810
|
+
if (currentIndex === -1) {
|
|
811
|
+
return ids[0];
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
if (direction === 'forward') {
|
|
815
|
+
return ids[(currentIndex + 1) % ids.length];
|
|
816
|
+
} else {
|
|
817
|
+
return ids[(currentIndex - 1 + ids.length) % ids.length];
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
// =============================================================================
|
|
822
|
+
// Keyboard Shortcut
|
|
823
|
+
// =============================================================================
|
|
824
|
+
|
|
825
|
+
let shortcutHandler: ((e: KeyboardEvent) => void) | null = null;
|
|
826
|
+
|
|
827
|
+
export function registerThemeShortcut(
|
|
828
|
+
onCycle: (direction: 'forward' | 'backward') => void
|
|
829
|
+
): () => void {
|
|
830
|
+
shortcutHandler = (e: KeyboardEvent) => {
|
|
831
|
+
// Cmd/Ctrl+Shift+T
|
|
832
|
+
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key === 'T') {
|
|
833
|
+
e.preventDefault();
|
|
834
|
+
if (e.altKey) {
|
|
835
|
+
onCycle('backward');
|
|
836
|
+
} else {
|
|
837
|
+
onCycle('forward');
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
document.addEventListener('keydown', shortcutHandler);
|
|
843
|
+
|
|
844
|
+
return () => {
|
|
845
|
+
if (shortcutHandler) {
|
|
846
|
+
document.removeEventListener('keydown', shortcutHandler);
|
|
847
|
+
shortcutHandler = null;
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
// =============================================================================
|
|
853
|
+
// Project Persistence (IPC)
|
|
854
|
+
// =============================================================================
|
|
855
|
+
|
|
856
|
+
declare global {
|
|
857
|
+
interface Window {
|
|
858
|
+
electronAPI?: {
|
|
859
|
+
config?: {
|
|
860
|
+
saveProjectConfig: (key: string, value: string) => Promise<boolean>;
|
|
861
|
+
loadProjectConfig: (key: string) => Promise<string | null>;
|
|
862
|
+
};
|
|
863
|
+
theme?: {
|
|
864
|
+
onPresetChanged: (callback: (presetId: string) => void) => () => void;
|
|
865
|
+
broadcastPreset: (presetId: string) => void;
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
export async function savePresetToProject(presetId: string): Promise<boolean> {
|
|
872
|
+
if (!getPreset(presetId)) {
|
|
873
|
+
throw new Error(`Invalid preset id: ${presetId}`);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
try {
|
|
877
|
+
// Use REST API to save color preset to settings
|
|
878
|
+
const response = await fetch('/api/settings', {
|
|
879
|
+
method: 'PATCH',
|
|
880
|
+
headers: { 'Content-Type': 'application/json' },
|
|
881
|
+
body: JSON.stringify({ display: { colorPreset: presetId } }),
|
|
882
|
+
});
|
|
883
|
+
return response.ok;
|
|
884
|
+
} catch (err) {
|
|
885
|
+
console.error('[color-presets] Failed to save preset:', err);
|
|
886
|
+
return false;
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
export async function loadPresetFromProject(): Promise<string> {
|
|
891
|
+
try {
|
|
892
|
+
// Use REST API to load color preset from settings
|
|
893
|
+
const response = await fetch('/api/settings');
|
|
894
|
+
if (response.ok) {
|
|
895
|
+
const settings = await response.json();
|
|
896
|
+
const presetId = settings?.display?.colorPreset;
|
|
897
|
+
return presetId && getPreset(presetId) ? presetId : DEFAULT_PRESET;
|
|
898
|
+
}
|
|
899
|
+
return DEFAULT_PRESET;
|
|
900
|
+
} catch (err) {
|
|
901
|
+
console.error('[color-presets] Failed to load preset:', err);
|
|
902
|
+
return DEFAULT_PRESET;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// =============================================================================
|
|
907
|
+
// Window Sync (WebSocket)
|
|
908
|
+
// =============================================================================
|
|
909
|
+
|
|
910
|
+
export function subscribeToPresetChanges(
|
|
911
|
+
callback: (presetId: string) => void
|
|
912
|
+
): () => void {
|
|
913
|
+
// Connect to settings WebSocket for real-time sync
|
|
914
|
+
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
915
|
+
const ws = new WebSocket(`${protocol}//${window.location.host}/ws/settings`);
|
|
916
|
+
|
|
917
|
+
ws.onmessage = (event) => {
|
|
918
|
+
try {
|
|
919
|
+
const data = JSON.parse(event.data);
|
|
920
|
+
if ((data.type === 'init' || data.type === 'update') && data.settings?.display?.colorPreset) {
|
|
921
|
+
callback(data.settings.display.colorPreset);
|
|
922
|
+
}
|
|
923
|
+
} catch {
|
|
924
|
+
// Ignore parse errors
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
return () => ws.close();
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
export function broadcastPresetChange(presetId: string): void {
|
|
932
|
+
// Broadcast is handled by the settings API - when we PATCH, it broadcasts via WebSocket
|
|
933
|
+
console.log('[color-presets] Preset changed:', presetId);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
export function initPresetSync(): void {
|
|
937
|
+
subscribeToPresetChanges((presetId) => {
|
|
938
|
+
applyPreset(presetId);
|
|
939
|
+
});
|
|
940
|
+
}
|