@atercates/claude-deck 0.2.1

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.
Files changed (293) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +123 -0
  3. package/app/api/claude/hidden/route.ts +66 -0
  4. package/app/api/claude/projects/[name]/sessions/route.ts +71 -0
  5. package/app/api/claude/projects/route.ts +44 -0
  6. package/app/api/code-search/available/route.ts +12 -0
  7. package/app/api/code-search/route.ts +47 -0
  8. package/app/api/dev-servers/[id]/logs/route.ts +23 -0
  9. package/app/api/dev-servers/[id]/restart/route.ts +20 -0
  10. package/app/api/dev-servers/[id]/route.ts +51 -0
  11. package/app/api/dev-servers/[id]/stop/route.ts +20 -0
  12. package/app/api/dev-servers/detect/route.ts +39 -0
  13. package/app/api/dev-servers/route.ts +48 -0
  14. package/app/api/exec/route.ts +60 -0
  15. package/app/api/files/content/route.ts +76 -0
  16. package/app/api/files/route.ts +37 -0
  17. package/app/api/files/upload-temp/route.ts +41 -0
  18. package/app/api/git/check/route.ts +54 -0
  19. package/app/api/git/clone/route.ts +99 -0
  20. package/app/api/git/commit/route.ts +75 -0
  21. package/app/api/git/discard/route.ts +38 -0
  22. package/app/api/git/file-content/route.ts +64 -0
  23. package/app/api/git/history/[hash]/diff/route.ts +38 -0
  24. package/app/api/git/history/[hash]/route.ts +34 -0
  25. package/app/api/git/history/route.ts +27 -0
  26. package/app/api/git/multi-status/route.ts +46 -0
  27. package/app/api/git/pr/route.ts +164 -0
  28. package/app/api/git/push/route.ts +64 -0
  29. package/app/api/git/stage/route.ts +40 -0
  30. package/app/api/git/status/route.ts +51 -0
  31. package/app/api/git/unstage/route.ts +46 -0
  32. package/app/api/groups/[...path]/route.ts +136 -0
  33. package/app/api/groups/route.ts +93 -0
  34. package/app/api/orchestrate/spawn/route.ts +45 -0
  35. package/app/api/orchestrate/workers/[id]/route.ts +89 -0
  36. package/app/api/orchestrate/workers/route.ts +31 -0
  37. package/app/api/projects/[id]/detect/route.ts +27 -0
  38. package/app/api/projects/[id]/dev-servers/[dsId]/route.ts +66 -0
  39. package/app/api/projects/[id]/dev-servers/route.ts +51 -0
  40. package/app/api/projects/[id]/repositories/[repoId]/route.ts +67 -0
  41. package/app/api/projects/[id]/repositories/route.ts +74 -0
  42. package/app/api/projects/[id]/route.ts +108 -0
  43. package/app/api/projects/detect/route.ts +33 -0
  44. package/app/api/projects/route.ts +59 -0
  45. package/app/api/sessions/[id]/claude-session/route.ts +42 -0
  46. package/app/api/sessions/[id]/fork/route.ts +74 -0
  47. package/app/api/sessions/[id]/mcp-config/route.ts +34 -0
  48. package/app/api/sessions/[id]/messages/route.ts +60 -0
  49. package/app/api/sessions/[id]/pr/route.ts +188 -0
  50. package/app/api/sessions/[id]/preview/route.ts +42 -0
  51. package/app/api/sessions/[id]/route.ts +229 -0
  52. package/app/api/sessions/[id]/send-keys/route.ts +119 -0
  53. package/app/api/sessions/[id]/summarize/route.ts +331 -0
  54. package/app/api/sessions/init-script/route.ts +84 -0
  55. package/app/api/sessions/route.ts +209 -0
  56. package/app/api/sessions/status/route.ts +237 -0
  57. package/app/api/system/route.ts +9 -0
  58. package/app/api/tmux/kill-all/route.ts +57 -0
  59. package/app/api/tmux/rename/route.ts +30 -0
  60. package/app/globals.css +174 -0
  61. package/app/icon.svg +11 -0
  62. package/app/layout.tsx +122 -0
  63. package/app/page.tsx +629 -0
  64. package/components/ChatMessage.tsx +65 -0
  65. package/components/ChatView.tsx +276 -0
  66. package/components/ClaudeProjects/ClaudeProjectCard.tsx +195 -0
  67. package/components/ClaudeProjects/ClaudeProjectsSection.tsx +89 -0
  68. package/components/ClaudeProjects/ClaudeSessionCard.tsx +100 -0
  69. package/components/ClaudeProjects/index.ts +1 -0
  70. package/components/CodeSearch/CodeSearchResults.tsx +177 -0
  71. package/components/ConductorPanel.tsx +256 -0
  72. package/components/DevServers/DevServerCard.tsx +311 -0
  73. package/components/DevServers/DevServersSection.tsx +91 -0
  74. package/components/DevServers/ServerLogsModal.tsx +151 -0
  75. package/components/DevServers/StartServerDialog.tsx +359 -0
  76. package/components/DevServers/index.ts +4 -0
  77. package/components/DiffViewer/DiffModal.tsx +151 -0
  78. package/components/DiffViewer/UnifiedDiff.tsx +185 -0
  79. package/components/DiffViewer/index.tsx +2 -0
  80. package/components/DirectoryPicker.tsx +355 -0
  81. package/components/FileExplorer/FileEditor.tsx +276 -0
  82. package/components/FileExplorer/FileTabs.tsx +118 -0
  83. package/components/FileExplorer/FileTree.tsx +214 -0
  84. package/components/FileExplorer/HtmlRenderer.tsx +16 -0
  85. package/components/FileExplorer/MarkdownRenderer.tsx +18 -0
  86. package/components/FileExplorer/index.tsx +520 -0
  87. package/components/FilePicker.tsx +339 -0
  88. package/components/FolderPicker.tsx +201 -0
  89. package/components/GitDrawer/FileEditDialog.tsx +400 -0
  90. package/components/GitDrawer/index.tsx +464 -0
  91. package/components/GitPanel/CommitForm.tsx +205 -0
  92. package/components/GitPanel/CommitHistory.tsx +174 -0
  93. package/components/GitPanel/CommitItem.tsx +196 -0
  94. package/components/GitPanel/FileChanges.tsx +414 -0
  95. package/components/GitPanel/GitPanelTabs.tsx +39 -0
  96. package/components/GitPanel/index.tsx +817 -0
  97. package/components/MessageInput.tsx +82 -0
  98. package/components/NewClaudeSessionDialog.tsx +166 -0
  99. package/components/NewSessionDialog/AdvancedSettings.tsx +78 -0
  100. package/components/NewSessionDialog/AgentSelector.tsx +37 -0
  101. package/components/NewSessionDialog/CreatingOverlay.tsx +94 -0
  102. package/components/NewSessionDialog/NewSessionDialog.types.ts +136 -0
  103. package/components/NewSessionDialog/ProjectSelector.tsx +146 -0
  104. package/components/NewSessionDialog/WorkingDirectoryInput.tsx +55 -0
  105. package/components/NewSessionDialog/WorktreeSection.tsx +92 -0
  106. package/components/NewSessionDialog/hooks/useNewSessionForm.ts +370 -0
  107. package/components/NewSessionDialog/index.tsx +106 -0
  108. package/components/NotificationSettings.tsx +127 -0
  109. package/components/PRCreationModal.tsx +272 -0
  110. package/components/Pane/DesktopTabBar.tsx +353 -0
  111. package/components/Pane/MobileTabBar.tsx +210 -0
  112. package/components/Pane/OpenInVSCode.tsx +69 -0
  113. package/components/Pane/PaneSkeletons.tsx +57 -0
  114. package/components/Pane/index.tsx +558 -0
  115. package/components/PaneLayout.tsx +60 -0
  116. package/components/Projects/DevServersSection.tsx +140 -0
  117. package/components/Projects/DirectoryField.tsx +92 -0
  118. package/components/Projects/NewProjectDialog.tsx +188 -0
  119. package/components/Projects/NewProjectDialog.types.ts +46 -0
  120. package/components/Projects/ProjectCard.tsx +276 -0
  121. package/components/Projects/ProjectSettingsDialog.tsx +811 -0
  122. package/components/Projects/hooks/useNewProjectForm.ts +249 -0
  123. package/components/Projects/index.ts +3 -0
  124. package/components/Providers.tsx +49 -0
  125. package/components/QuickSwitcher.tsx +306 -0
  126. package/components/SessionList/KillAllConfirm.tsx +46 -0
  127. package/components/SessionList/SelectionToolbar.tsx +164 -0
  128. package/components/SessionList/SessionList.types.ts +37 -0
  129. package/components/SessionList/SessionListHeader.tsx +71 -0
  130. package/components/SessionList/hooks/useSessionListMutations.ts +269 -0
  131. package/components/SessionList/index.tsx +189 -0
  132. package/components/ShellDrawer/index.tsx +106 -0
  133. package/components/SidebarFooter.tsx +55 -0
  134. package/components/Terminal/KeybarToggleButton.tsx +45 -0
  135. package/components/Terminal/ScrollToBottomButton.tsx +32 -0
  136. package/components/Terminal/SearchBar.tsx +71 -0
  137. package/components/Terminal/TerminalToolbar.tsx +551 -0
  138. package/components/Terminal/VirtualKeyboard.tsx +711 -0
  139. package/components/Terminal/constants.ts +20 -0
  140. package/components/Terminal/hooks/index.ts +5 -0
  141. package/components/Terminal/hooks/resize-handlers.ts +140 -0
  142. package/components/Terminal/hooks/terminal-init.ts +151 -0
  143. package/components/Terminal/hooks/touch-scroll.ts +155 -0
  144. package/components/Terminal/hooks/useTerminalConnection.ts +282 -0
  145. package/components/Terminal/hooks/useTerminalConnection.types.ts +39 -0
  146. package/components/Terminal/hooks/useTerminalSearch.ts +103 -0
  147. package/components/Terminal/hooks/websocket-connection.ts +274 -0
  148. package/components/Terminal/index.tsx +320 -0
  149. package/components/ThemeToggle.tsx +168 -0
  150. package/components/TmuxSessions.tsx +132 -0
  151. package/components/ToolCallDisplay.tsx +71 -0
  152. package/components/WorkerCard.tsx +245 -0
  153. package/components/a/ABadge.tsx +115 -0
  154. package/components/a/AButton.tsx +163 -0
  155. package/components/a/ADialog.tsx +93 -0
  156. package/components/a/ADropdownMenu.tsx +279 -0
  157. package/components/a/AIconButton.tsx +190 -0
  158. package/components/a/ASheet.tsx +150 -0
  159. package/components/a/ATooltip.tsx +77 -0
  160. package/components/a/index.ts +64 -0
  161. package/components/mobile/SwipeSidebar.tsx +122 -0
  162. package/components/ui/badge.tsx +41 -0
  163. package/components/ui/button.tsx +60 -0
  164. package/components/ui/context-menu.tsx +197 -0
  165. package/components/ui/dialog.tsx +143 -0
  166. package/components/ui/dropdown-menu.tsx +257 -0
  167. package/components/ui/input.tsx +21 -0
  168. package/components/ui/scroll-area.tsx +52 -0
  169. package/components/ui/select.tsx +159 -0
  170. package/components/ui/skeleton.tsx +111 -0
  171. package/components/ui/switch.tsx +31 -0
  172. package/components/ui/textarea.tsx +21 -0
  173. package/components/ui/tooltip.tsx +32 -0
  174. package/components/views/DesktopView.tsx +244 -0
  175. package/components/views/MobileView.tsx +110 -0
  176. package/components/views/types.ts +75 -0
  177. package/contexts/PaneContext.tsx +336 -0
  178. package/data/claude/index.ts +9 -0
  179. package/data/claude/keys.ts +6 -0
  180. package/data/claude/queries.ts +120 -0
  181. package/data/claude/useClaudeUpdates.ts +37 -0
  182. package/data/code-search/index.ts +2 -0
  183. package/data/code-search/keys.ts +7 -0
  184. package/data/code-search/queries.ts +61 -0
  185. package/data/dev-servers/index.ts +8 -0
  186. package/data/dev-servers/keys.ts +4 -0
  187. package/data/dev-servers/queries.ts +104 -0
  188. package/data/files/index.ts +3 -0
  189. package/data/files/keys.ts +4 -0
  190. package/data/files/queries.ts +25 -0
  191. package/data/git/keys.ts +15 -0
  192. package/data/git/queries.ts +395 -0
  193. package/data/groups/index.ts +1 -0
  194. package/data/groups/mutations.ts +95 -0
  195. package/data/projects/index.ts +10 -0
  196. package/data/projects/keys.ts +4 -0
  197. package/data/projects/queries.ts +193 -0
  198. package/data/repositories/index.ts +7 -0
  199. package/data/repositories/keys.ts +5 -0
  200. package/data/repositories/queries.ts +122 -0
  201. package/data/sessions/index.ts +12 -0
  202. package/data/sessions/keys.ts +8 -0
  203. package/data/sessions/queries.ts +218 -0
  204. package/data/statuses/index.ts +1 -0
  205. package/data/statuses/queries.ts +69 -0
  206. package/hooks/useCopyToClipboard.ts +48 -0
  207. package/hooks/useDevServersManager.ts +73 -0
  208. package/hooks/useDirectoryBrowser.ts +90 -0
  209. package/hooks/useDrawerAnimation.ts +27 -0
  210. package/hooks/useFileDrop.ts +87 -0
  211. package/hooks/useFileEditor.ts +184 -0
  212. package/hooks/useGroups.ts +37 -0
  213. package/hooks/useHomePath.ts +34 -0
  214. package/hooks/useKeyRepeat.ts +55 -0
  215. package/hooks/useKeybarVisibility.ts +42 -0
  216. package/hooks/useNotifications.ts +257 -0
  217. package/hooks/useProjects.ts +53 -0
  218. package/hooks/useSessionStatuses.ts +30 -0
  219. package/hooks/useSessions.ts +86 -0
  220. package/hooks/useSpeechRecognition.ts +124 -0
  221. package/hooks/useViewport.ts +32 -0
  222. package/hooks/useViewportHeight.ts +50 -0
  223. package/lib/async-operations.ts +35 -0
  224. package/lib/banner.ts +81 -0
  225. package/lib/claude/jsonl-cache.ts +86 -0
  226. package/lib/claude/jsonl-reader.ts +271 -0
  227. package/lib/claude/process-manager.ts +278 -0
  228. package/lib/claude/stream-parser.ts +173 -0
  229. package/lib/claude/types.ts +154 -0
  230. package/lib/claude/watcher.ts +71 -0
  231. package/lib/client/session-registry.ts +111 -0
  232. package/lib/code-search.ts +121 -0
  233. package/lib/db/index.ts +48 -0
  234. package/lib/db/migrations.ts +45 -0
  235. package/lib/db/queries.ts +460 -0
  236. package/lib/db/schema.ts +114 -0
  237. package/lib/db/types.ts +92 -0
  238. package/lib/db.ts +2 -0
  239. package/lib/dev-servers.ts +509 -0
  240. package/lib/diff-parser.ts +221 -0
  241. package/lib/env-setup.ts +285 -0
  242. package/lib/file-upload.ts +34 -0
  243. package/lib/file-utils.ts +50 -0
  244. package/lib/files.ts +207 -0
  245. package/lib/git-history.ts +294 -0
  246. package/lib/git-status.ts +391 -0
  247. package/lib/git.ts +257 -0
  248. package/lib/mcp-config.ts +81 -0
  249. package/lib/multi-repo-git.ts +179 -0
  250. package/lib/notifications.ts +219 -0
  251. package/lib/orchestration.ts +448 -0
  252. package/lib/panes.ts +232 -0
  253. package/lib/ports.ts +97 -0
  254. package/lib/pr-generation.ts +307 -0
  255. package/lib/pr.ts +234 -0
  256. package/lib/projects.ts +578 -0
  257. package/lib/providers/registry.ts +70 -0
  258. package/lib/providers.ts +121 -0
  259. package/lib/query-client.ts +14 -0
  260. package/lib/rangeSelectionUtils.ts +65 -0
  261. package/lib/status-detector.ts +375 -0
  262. package/lib/terminal-themes.ts +265 -0
  263. package/lib/theme-config.ts +327 -0
  264. package/lib/utils.ts +6 -0
  265. package/lib/worktrees.ts +262 -0
  266. package/mcp/orchestration-server.ts +438 -0
  267. package/package.json +139 -0
  268. package/postcss.config.mjs +7 -0
  269. package/public/icon.svg +10 -0
  270. package/public/icons/icon-128x128.png +0 -0
  271. package/public/icons/icon-144x144.png +0 -0
  272. package/public/icons/icon-152x152.png +0 -0
  273. package/public/icons/icon-192x192.png +0 -0
  274. package/public/icons/icon-384x384.png +0 -0
  275. package/public/icons/icon-512x512.png +0 -0
  276. package/public/icons/icon-72x72.png +0 -0
  277. package/public/icons/icon-96x96.png +0 -0
  278. package/public/manifest.json +61 -0
  279. package/public/sw.js +64 -0
  280. package/scripts/agent-os +91 -0
  281. package/scripts/install.sh +48 -0
  282. package/scripts/lib/ai-clis.sh +132 -0
  283. package/scripts/lib/commands.sh +487 -0
  284. package/scripts/lib/common.sh +89 -0
  285. package/scripts/lib/prerequisites.sh +462 -0
  286. package/scripts/setup.sh +134 -0
  287. package/server.ts +155 -0
  288. package/stores/fileOpen.ts +26 -0
  289. package/stores/index.ts +1 -0
  290. package/stores/initialPrompt.ts +24 -0
  291. package/stores/sessionSelection.ts +48 -0
  292. package/styles/themes.css +603 -0
  293. package/tsconfig.json +33 -0
@@ -0,0 +1,265 @@
1
+ /**
2
+ * Terminal theme definitions for xterm.js
3
+ * Maps UI themes to terminal color palettes
4
+ */
5
+
6
+ export interface TerminalTheme {
7
+ background: string;
8
+ foreground: string;
9
+ cursor: string;
10
+ cursorAccent: string;
11
+ selectionBackground: string;
12
+ black: string;
13
+ red: string;
14
+ green: string;
15
+ yellow: string;
16
+ blue: string;
17
+ magenta: string;
18
+ cyan: string;
19
+ white: string;
20
+ brightBlack: string;
21
+ brightRed: string;
22
+ brightGreen: string;
23
+ brightYellow: string;
24
+ brightBlue: string;
25
+ brightMagenta: string;
26
+ brightCyan: string;
27
+ brightWhite: string;
28
+ }
29
+
30
+ // Base ANSI colors for dark themes
31
+ const DARK_ANSI = {
32
+ black: "#1a1a1a",
33
+ red: "#ff5555",
34
+ green: "#50fa7b",
35
+ yellow: "#f1fa8c",
36
+ blue: "#6272a4",
37
+ magenta: "#ff79c6",
38
+ cyan: "#8be9fd",
39
+ white: "#f8f8f2",
40
+ brightBlack: "#6272a4",
41
+ brightRed: "#ff6e6e",
42
+ brightGreen: "#69ff94",
43
+ brightYellow: "#ffffa5",
44
+ brightBlue: "#d6acff",
45
+ brightMagenta: "#ff92df",
46
+ brightCyan: "#a4ffff",
47
+ brightWhite: "#ffffff",
48
+ };
49
+
50
+ // Base ANSI colors for light themes
51
+ const LIGHT_ANSI = {
52
+ black: "#000000",
53
+ red: "#c91b00",
54
+ green: "#00c200",
55
+ yellow: "#c7c400",
56
+ blue: "#0225c7",
57
+ magenta: "#c930c7",
58
+ cyan: "#00c5c7",
59
+ white: "#c7c7c7",
60
+ brightBlack: "#686868",
61
+ brightRed: "#ff6e67",
62
+ brightGreen: "#5ffa68",
63
+ brightYellow: "#fffc67",
64
+ brightBlue: "#6871ff",
65
+ brightMagenta: "#ff76ff",
66
+ brightCyan: "#5ffdff",
67
+ brightWhite: "#ffffff",
68
+ };
69
+
70
+ // Dark theme terminal configurations
71
+ const DARK_TERMINALS: Record<string, Partial<TerminalTheme>> = {
72
+ deep: {
73
+ background: "#0A0A0A",
74
+ foreground: "#EBEBEB",
75
+ cursor: "#3B82F6",
76
+ cursorAccent: "#0A0A0A",
77
+ selectionBackground: "#3B82F640",
78
+ },
79
+ charcoal: {
80
+ background: "#161A1D",
81
+ foreground: "#E8EAEB",
82
+ cursor: "#5B9BD5",
83
+ cursorAccent: "#161A1D",
84
+ selectionBackground: "#5B9BD540",
85
+ },
86
+ warm: {
87
+ background: "#1A1612",
88
+ foreground: "#E8DCC8",
89
+ cursor: "#F59E0B",
90
+ cursorAccent: "#1A1612",
91
+ selectionBackground: "#F59E0B40",
92
+ yellow: "#F59E0B",
93
+ brightYellow: "#FBBF24",
94
+ },
95
+ cool: {
96
+ background: "#0D1117",
97
+ foreground: "#E6EDF3",
98
+ cursor: "#58A6FF",
99
+ cursorAccent: "#0D1117",
100
+ selectionBackground: "#58A6FF40",
101
+ blue: "#58A6FF",
102
+ brightBlue: "#79C0FF",
103
+ },
104
+ gray: {
105
+ background: "#191919",
106
+ foreground: "#DEDEDE",
107
+ cursor: "#2383E2",
108
+ cursorAccent: "#191919",
109
+ selectionBackground: "#2383E240",
110
+ },
111
+ midnight: {
112
+ background: "#0A0E1A",
113
+ foreground: "#E5E9F0",
114
+ cursor: "#88C0D0",
115
+ cursorAccent: "#0A0E1A",
116
+ selectionBackground: "#88C0D040",
117
+ cyan: "#88C0D0",
118
+ blue: "#5E81AC",
119
+ brightCyan: "#8FBCBB",
120
+ brightBlue: "#81A1C1",
121
+ },
122
+ forest: {
123
+ background: "#0C1410",
124
+ foreground: "#E8F0ED",
125
+ cursor: "#50C878",
126
+ cursorAccent: "#0C1410",
127
+ selectionBackground: "#50C87840",
128
+ green: "#50C878",
129
+ brightGreen: "#6EE7A0",
130
+ },
131
+ purple: {
132
+ background: "#0F0A1A",
133
+ foreground: "#E8E5F0",
134
+ cursor: "#A855F7",
135
+ cursorAccent: "#0F0A1A",
136
+ selectionBackground: "#A855F740",
137
+ magenta: "#A855F7",
138
+ brightMagenta: "#C084FC",
139
+ },
140
+ ocean: {
141
+ background: "#0A1419",
142
+ foreground: "#E5EBF0",
143
+ cursor: "#14B8A6",
144
+ cursorAccent: "#0A1419",
145
+ selectionBackground: "#14B8A640",
146
+ cyan: "#14B8A6",
147
+ brightCyan: "#2DD4BF",
148
+ },
149
+ mocha: {
150
+ background: "#1C1612",
151
+ foreground: "#E6DDD4",
152
+ cursor: "#D4844A",
153
+ cursorAccent: "#1C1612",
154
+ selectionBackground: "#D4844A40",
155
+ yellow: "#D4844A",
156
+ brightYellow: "#E8A76A",
157
+ },
158
+ };
159
+
160
+ // Light theme terminal configurations
161
+ const LIGHT_TERMINALS: Record<string, Partial<TerminalTheme>> = {
162
+ default: {
163
+ background: "#FFFFFF",
164
+ foreground: "#1a1a1a",
165
+ cursor: "#3B82F6",
166
+ cursorAccent: "#FFFFFF",
167
+ selectionBackground: "#3B82F630",
168
+ },
169
+ warm: {
170
+ background: "#F5F1E8",
171
+ foreground: "#2D2519",
172
+ cursor: "#D97706",
173
+ cursorAccent: "#F5F1E8",
174
+ selectionBackground: "#D9770630",
175
+ },
176
+ cool: {
177
+ background: "#F0F4F8",
178
+ foreground: "#1E293B",
179
+ cursor: "#0EA5E9",
180
+ cursorAccent: "#F0F4F8",
181
+ selectionBackground: "#0EA5E930",
182
+ },
183
+ soft: {
184
+ background: "#F8F9FA",
185
+ foreground: "#212529",
186
+ cursor: "#6366F1",
187
+ cursorAccent: "#F8F9FA",
188
+ selectionBackground: "#6366F130",
189
+ },
190
+ rose: {
191
+ background: "#FAF5F7",
192
+ foreground: "#2D1A22",
193
+ cursor: "#E74C8C",
194
+ cursorAccent: "#FAF5F7",
195
+ selectionBackground: "#E74C8C30",
196
+ },
197
+ lavender: {
198
+ background: "#F7F5FA",
199
+ foreground: "#1F1A2D",
200
+ cursor: "#9F7AEA",
201
+ cursorAccent: "#F7F5FA",
202
+ selectionBackground: "#9F7AEA30",
203
+ },
204
+ mint: {
205
+ background: "#F0F9F6",
206
+ foreground: "#14291F",
207
+ cursor: "#28B88B",
208
+ cursorAccent: "#F0F9F6",
209
+ selectionBackground: "#28B88B30",
210
+ },
211
+ peach: {
212
+ background: "#F9F4F0",
213
+ foreground: "#2D1F19",
214
+ cursor: "#FA8B6C",
215
+ cursorAccent: "#F9F4F0",
216
+ selectionBackground: "#FA8B6C30",
217
+ },
218
+ };
219
+
220
+ /**
221
+ * Get terminal theme for a given app theme string
222
+ * @param theme - Theme string like "dark", "dark-purple", "light-warm", etc.
223
+ */
224
+ export function getTerminalTheme(theme: string): TerminalTheme {
225
+ // Handle system theme - default to dark
226
+ if (theme === "system") {
227
+ return buildTerminalTheme("dark", "deep");
228
+ }
229
+
230
+ // Parse theme string
231
+ const parts = theme.split("-");
232
+ const mode = parts[0] as "light" | "dark";
233
+ const variant = parts[1] || (mode === "dark" ? "deep" : "default");
234
+
235
+ return buildTerminalTheme(mode, variant);
236
+ }
237
+
238
+ function buildTerminalTheme(
239
+ mode: "light" | "dark",
240
+ variant: string
241
+ ): TerminalTheme {
242
+ if (mode === "light") {
243
+ const config = LIGHT_TERMINALS[variant] || LIGHT_TERMINALS.default;
244
+ return {
245
+ ...LIGHT_ANSI,
246
+ background: config.background!,
247
+ foreground: config.foreground!,
248
+ cursor: config.cursor!,
249
+ cursorAccent: config.cursorAccent!,
250
+ selectionBackground: config.selectionBackground!,
251
+ ...config,
252
+ } as TerminalTheme;
253
+ }
254
+
255
+ const config = DARK_TERMINALS[variant] || DARK_TERMINALS.deep;
256
+ return {
257
+ ...DARK_ANSI,
258
+ background: config.background!,
259
+ foreground: config.foreground!,
260
+ cursor: config.cursor!,
261
+ cursorAccent: config.cursorAccent!,
262
+ selectionBackground: config.selectionBackground!,
263
+ ...config,
264
+ } as TerminalTheme;
265
+ }
@@ -0,0 +1,327 @@
1
+ /**
2
+ * Theme configuration for ClaudeDeck
3
+ * UI theme definitions and helper functions
4
+ */
5
+
6
+ import {
7
+ Moon,
8
+ Sun,
9
+ Monitor,
10
+ Flame,
11
+ Zap,
12
+ CloudMoon,
13
+ Trees,
14
+ Sparkles,
15
+ Waves,
16
+ Coffee,
17
+ type LucideIcon,
18
+ } from "lucide-react";
19
+
20
+ export type ThemeMode = "light" | "dark" | "system";
21
+ export type DarkThemeVariant =
22
+ | "deep"
23
+ | "charcoal"
24
+ | "warm"
25
+ | "cool"
26
+ | "gray"
27
+ | "midnight"
28
+ | "forest"
29
+ | "purple"
30
+ | "ocean"
31
+ | "mocha";
32
+ export type LightThemeVariant =
33
+ | "default"
34
+ | "warm"
35
+ | "cool"
36
+ | "soft"
37
+ | "rose"
38
+ | "lavender"
39
+ | "mint"
40
+ | "peach";
41
+ export type Theme =
42
+ | "light"
43
+ | `light-${LightThemeVariant}`
44
+ | "dark"
45
+ | `dark-${DarkThemeVariant}`
46
+ | "system";
47
+
48
+ export interface ThemeOption {
49
+ id: DarkThemeVariant | LightThemeVariant;
50
+ label: string;
51
+ description: string;
52
+ icon: LucideIcon;
53
+ preview: {
54
+ background: string;
55
+ foreground: string;
56
+ accent: string;
57
+ };
58
+ }
59
+
60
+ export const DARK_THEMES: ThemeOption[] = [
61
+ {
62
+ id: "deep",
63
+ label: "Deep Black",
64
+ description: "Premium true black",
65
+ icon: Moon,
66
+ preview: {
67
+ background: "#0A0A0A",
68
+ foreground: "#EBEBEB",
69
+ accent: "#3B82F6",
70
+ },
71
+ },
72
+ {
73
+ id: "charcoal",
74
+ label: "Charcoal",
75
+ description: "Soft dark, easy on eyes",
76
+ icon: Moon,
77
+ preview: {
78
+ background: "#161A1D",
79
+ foreground: "#E8EAEB",
80
+ accent: "#5B9BD5",
81
+ },
82
+ },
83
+ {
84
+ id: "warm",
85
+ label: "Warm",
86
+ description: "Cozy browns with amber",
87
+ icon: Flame,
88
+ preview: {
89
+ background: "#1A1612",
90
+ foreground: "#E8DCC8",
91
+ accent: "#F59E0B",
92
+ },
93
+ },
94
+ {
95
+ id: "cool",
96
+ label: "Cool",
97
+ description: "VS Code / GitHub style",
98
+ icon: Zap,
99
+ preview: {
100
+ background: "#0D1117",
101
+ foreground: "#E6EDF3",
102
+ accent: "#58A6FF",
103
+ },
104
+ },
105
+ {
106
+ id: "gray",
107
+ label: "Gray",
108
+ description: "Balanced medium gray",
109
+ icon: Monitor,
110
+ preview: {
111
+ background: "#191919",
112
+ foreground: "#DEDEDE",
113
+ accent: "#2383E2",
114
+ },
115
+ },
116
+ {
117
+ id: "midnight",
118
+ label: "Midnight",
119
+ description: "Deep blue, nordic style",
120
+ icon: CloudMoon,
121
+ preview: {
122
+ background: "#0A0E1A",
123
+ foreground: "#E5E9F0",
124
+ accent: "#88C0D0",
125
+ },
126
+ },
127
+ {
128
+ id: "forest",
129
+ label: "Forest",
130
+ description: "Dark green with emerald",
131
+ icon: Trees,
132
+ preview: {
133
+ background: "#0C1410",
134
+ foreground: "#E8F0ED",
135
+ accent: "#50C878",
136
+ },
137
+ },
138
+ {
139
+ id: "purple",
140
+ label: "Purple",
141
+ description: "Deep purple, creative",
142
+ icon: Sparkles,
143
+ preview: {
144
+ background: "#0F0A1A",
145
+ foreground: "#E8E5F0",
146
+ accent: "#A855F7",
147
+ },
148
+ },
149
+ {
150
+ id: "ocean",
151
+ label: "Ocean",
152
+ description: "Deep teal, serene",
153
+ icon: Waves,
154
+ preview: {
155
+ background: "#0A1419",
156
+ foreground: "#E5EBF0",
157
+ accent: "#14B8A6",
158
+ },
159
+ },
160
+ {
161
+ id: "mocha",
162
+ label: "Mocha",
163
+ description: "Rich brown, sophisticated",
164
+ icon: Coffee,
165
+ preview: {
166
+ background: "#1C1612",
167
+ foreground: "#E6DDD4",
168
+ accent: "#D4844A",
169
+ },
170
+ },
171
+ ];
172
+
173
+ export const LIGHT_THEMES: ThemeOption[] = [
174
+ {
175
+ id: "default",
176
+ label: "Default",
177
+ description: "Clean white",
178
+ icon: Sun,
179
+ preview: {
180
+ background: "#FFFFFF",
181
+ foreground: "#111111",
182
+ accent: "#3B82F6",
183
+ },
184
+ },
185
+ {
186
+ id: "warm",
187
+ label: "Warm",
188
+ description: "Soft beige tones",
189
+ icon: Flame,
190
+ preview: {
191
+ background: "#F5F1E8",
192
+ foreground: "#2D2519",
193
+ accent: "#D97706",
194
+ },
195
+ },
196
+ {
197
+ id: "cool",
198
+ label: "Cool",
199
+ description: "Blue-tinted white",
200
+ icon: Zap,
201
+ preview: {
202
+ background: "#F0F4F8",
203
+ foreground: "#1E293B",
204
+ accent: "#0EA5E9",
205
+ },
206
+ },
207
+ {
208
+ id: "soft",
209
+ label: "Soft",
210
+ description: "Gentle gray-white",
211
+ icon: CloudMoon,
212
+ preview: {
213
+ background: "#F8F9FA",
214
+ foreground: "#212529",
215
+ accent: "#6366F1",
216
+ },
217
+ },
218
+ {
219
+ id: "rose",
220
+ label: "Rose",
221
+ description: "Soft pink tones",
222
+ icon: Sparkles,
223
+ preview: {
224
+ background: "#FAF5F7",
225
+ foreground: "#2D1A22",
226
+ accent: "#E74C8C",
227
+ },
228
+ },
229
+ {
230
+ id: "lavender",
231
+ label: "Lavender",
232
+ description: "Gentle purple",
233
+ icon: Sparkles,
234
+ preview: {
235
+ background: "#F7F5FA",
236
+ foreground: "#1F1A2D",
237
+ accent: "#9F7AEA",
238
+ },
239
+ },
240
+ {
241
+ id: "mint",
242
+ label: "Mint",
243
+ description: "Fresh green",
244
+ icon: Trees,
245
+ preview: {
246
+ background: "#F0F9F6",
247
+ foreground: "#14291F",
248
+ accent: "#28B88B",
249
+ },
250
+ },
251
+ {
252
+ id: "peach",
253
+ label: "Peach",
254
+ description: "Warm coral tones",
255
+ icon: Sun,
256
+ preview: {
257
+ background: "#F9F4F0",
258
+ foreground: "#2D1F19",
259
+ accent: "#FA8B6C",
260
+ },
261
+ },
262
+ ];
263
+
264
+ /**
265
+ * Parse a theme string into mode and variant
266
+ */
267
+ export function parseTheme(theme: string): {
268
+ mode: ThemeMode;
269
+ variant: DarkThemeVariant | LightThemeVariant | null;
270
+ } {
271
+ if (theme === "system") {
272
+ return { mode: "system", variant: null };
273
+ }
274
+
275
+ if (theme === "light") {
276
+ return { mode: "light", variant: "default" };
277
+ }
278
+
279
+ if (theme === "dark") {
280
+ return { mode: "dark", variant: "deep" };
281
+ }
282
+
283
+ const [mode, variant] = theme.split("-") as [ThemeMode, string];
284
+
285
+ if (mode === "dark") {
286
+ return { mode, variant: (variant as DarkThemeVariant) || "deep" };
287
+ }
288
+
289
+ if (mode === "light") {
290
+ return { mode, variant: (variant as LightThemeVariant) || "default" };
291
+ }
292
+
293
+ return { mode: "dark", variant: "deep" };
294
+ }
295
+
296
+ /**
297
+ * Build a theme string from mode and variant
298
+ */
299
+ export function buildTheme(
300
+ mode: ThemeMode,
301
+ variant: DarkThemeVariant | LightThemeVariant | null
302
+ ): Theme {
303
+ if (mode === "system") return "system";
304
+ if (!variant || variant === "default" || variant === "deep") return mode;
305
+ return `${mode}-${variant}` as Theme;
306
+ }
307
+
308
+ /**
309
+ * Get all available theme strings for next-themes
310
+ */
311
+ export function getAllThemes(): Theme[] {
312
+ const themes: Theme[] = ["system", "light", "dark"];
313
+
314
+ for (const lt of LIGHT_THEMES) {
315
+ if (lt.id !== "default") {
316
+ themes.push(`light-${lt.id}` as Theme);
317
+ }
318
+ }
319
+
320
+ for (const dt of DARK_THEMES) {
321
+ if (dt.id !== "deep") {
322
+ themes.push(`dark-${dt.id}` as Theme);
323
+ }
324
+ }
325
+
326
+ return themes;
327
+ }
package/lib/utils.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { type ClassValue, clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }