brainrot-cli 0.1.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.
Files changed (162) hide show
  1. package/README.md +372 -0
  2. package/dist/AchievementNotification.d.ts +28 -0
  3. package/dist/AchievementNotification.d.ts.map +1 -0
  4. package/dist/AchievementNotification.js +74 -0
  5. package/dist/AchievementNotification.js.map +1 -0
  6. package/dist/GameSelector.d.ts +25 -0
  7. package/dist/GameSelector.d.ts.map +1 -0
  8. package/dist/GameSelector.js +105 -0
  9. package/dist/GameSelector.js.map +1 -0
  10. package/dist/HelpOverlay.d.ts +15 -0
  11. package/dist/HelpOverlay.d.ts.map +1 -0
  12. package/dist/HelpOverlay.js +134 -0
  13. package/dist/HelpOverlay.js.map +1 -0
  14. package/dist/Layout.d.ts +49 -0
  15. package/dist/Layout.d.ts.map +1 -0
  16. package/dist/Layout.js +83 -0
  17. package/dist/Layout.js.map +1 -0
  18. package/dist/Leaderboard.d.ts +46 -0
  19. package/dist/Leaderboard.d.ts.map +1 -0
  20. package/dist/Leaderboard.js +68 -0
  21. package/dist/Leaderboard.js.map +1 -0
  22. package/dist/LogViewer.d.ts +33 -0
  23. package/dist/LogViewer.d.ts.map +1 -0
  24. package/dist/LogViewer.js +179 -0
  25. package/dist/LogViewer.js.map +1 -0
  26. package/dist/LoopAlertOverlay.d.ts +15 -0
  27. package/dist/LoopAlertOverlay.d.ts.map +1 -0
  28. package/dist/LoopAlertOverlay.js +17 -0
  29. package/dist/LoopAlertOverlay.js.map +1 -0
  30. package/dist/LoopManagementPanel.d.ts +44 -0
  31. package/dist/LoopManagementPanel.d.ts.map +1 -0
  32. package/dist/LoopManagementPanel.js +220 -0
  33. package/dist/LoopManagementPanel.js.map +1 -0
  34. package/dist/SettingsMenu.d.ts +22 -0
  35. package/dist/SettingsMenu.d.ts.map +1 -0
  36. package/dist/SettingsMenu.js +367 -0
  37. package/dist/SettingsMenu.js.map +1 -0
  38. package/dist/SplitPane.d.ts +63 -0
  39. package/dist/SplitPane.d.ts.map +1 -0
  40. package/dist/SplitPane.js +104 -0
  41. package/dist/SplitPane.js.map +1 -0
  42. package/dist/StatsMenu.d.ts +15 -0
  43. package/dist/StatsMenu.d.ts.map +1 -0
  44. package/dist/StatsMenu.js +230 -0
  45. package/dist/StatsMenu.js.map +1 -0
  46. package/dist/StatusBar.d.ts +58 -0
  47. package/dist/StatusBar.d.ts.map +1 -0
  48. package/dist/StatusBar.js +106 -0
  49. package/dist/StatusBar.js.map +1 -0
  50. package/dist/__tests__/ralph-loop-parser.test.d.ts +2 -0
  51. package/dist/__tests__/ralph-loop-parser.test.d.ts.map +1 -0
  52. package/dist/__tests__/ralph-loop-parser.test.js +143 -0
  53. package/dist/__tests__/ralph-loop-parser.test.js.map +1 -0
  54. package/dist/claude-code-process.d.ts +76 -0
  55. package/dist/claude-code-process.d.ts.map +1 -0
  56. package/dist/claude-code-process.js +221 -0
  57. package/dist/claude-code-process.js.map +1 -0
  58. package/dist/cli.d.ts +42 -0
  59. package/dist/cli.d.ts.map +1 -0
  60. package/dist/cli.js +265 -0
  61. package/dist/cli.js.map +1 -0
  62. package/dist/config.d.ts +206 -0
  63. package/dist/config.d.ts.map +1 -0
  64. package/dist/config.js +270 -0
  65. package/dist/config.js.map +1 -0
  66. package/dist/game-types.d.ts +177 -0
  67. package/dist/game-types.d.ts.map +1 -0
  68. package/dist/game-types.js +55 -0
  69. package/dist/game-types.js.map +1 -0
  70. package/dist/games/MinesweeperGame.d.ts +15 -0
  71. package/dist/games/MinesweeperGame.d.ts.map +1 -0
  72. package/dist/games/MinesweeperGame.js +555 -0
  73. package/dist/games/MinesweeperGame.js.map +1 -0
  74. package/dist/games/PongGame.d.ts +15 -0
  75. package/dist/games/PongGame.d.ts.map +1 -0
  76. package/dist/games/PongGame.js +379 -0
  77. package/dist/games/PongGame.js.map +1 -0
  78. package/dist/games/SnakeGame.d.ts +15 -0
  79. package/dist/games/SnakeGame.d.ts.map +1 -0
  80. package/dist/games/SnakeGame.js +333 -0
  81. package/dist/games/SnakeGame.js.map +1 -0
  82. package/dist/games/TetrisGame.d.ts +15 -0
  83. package/dist/games/TetrisGame.d.ts.map +1 -0
  84. package/dist/games/TetrisGame.js +654 -0
  85. package/dist/games/TetrisGame.js.map +1 -0
  86. package/dist/games/index.d.ts +23 -0
  87. package/dist/games/index.d.ts.map +1 -0
  88. package/dist/games/index.js +47 -0
  89. package/dist/games/index.js.map +1 -0
  90. package/dist/high-scores.d.ts +57 -0
  91. package/dist/high-scores.d.ts.map +1 -0
  92. package/dist/high-scores.js +230 -0
  93. package/dist/high-scores.js.map +1 -0
  94. package/dist/index.d.ts +3 -0
  95. package/dist/index.d.ts.map +1 -0
  96. package/dist/index.js +264 -0
  97. package/dist/index.js.map +1 -0
  98. package/dist/ralph-loop-parser.d.ts +58 -0
  99. package/dist/ralph-loop-parser.d.ts.map +1 -0
  100. package/dist/ralph-loop-parser.js +315 -0
  101. package/dist/ralph-loop-parser.js.map +1 -0
  102. package/dist/stats.d.ts +142 -0
  103. package/dist/stats.d.ts.map +1 -0
  104. package/dist/stats.js +521 -0
  105. package/dist/stats.js.map +1 -0
  106. package/dist/styled-components.d.ts +231 -0
  107. package/dist/styled-components.d.ts.map +1 -0
  108. package/dist/styled-components.js +192 -0
  109. package/dist/styled-components.js.map +1 -0
  110. package/dist/theme.d.ts +301 -0
  111. package/dist/theme.d.ts.map +1 -0
  112. package/dist/theme.js +372 -0
  113. package/dist/theme.js.map +1 -0
  114. package/dist/themes.d.ts +117 -0
  115. package/dist/themes.d.ts.map +1 -0
  116. package/dist/themes.js +296 -0
  117. package/dist/themes.js.map +1 -0
  118. package/dist/ui/index.d.ts +13 -0
  119. package/dist/ui/index.d.ts.map +1 -0
  120. package/dist/ui/index.js +29 -0
  121. package/dist/ui/index.js.map +1 -0
  122. package/dist/use-claude-code.d.ts +30 -0
  123. package/dist/use-claude-code.d.ts.map +1 -0
  124. package/dist/use-claude-code.js +84 -0
  125. package/dist/use-claude-code.js.map +1 -0
  126. package/dist/use-config.d.ts +58 -0
  127. package/dist/use-config.d.ts.map +1 -0
  128. package/dist/use-config.js +113 -0
  129. package/dist/use-config.js.map +1 -0
  130. package/dist/use-game-loop.d.ts +47 -0
  131. package/dist/use-game-loop.d.ts.map +1 -0
  132. package/dist/use-game-loop.js +136 -0
  133. package/dist/use-game-loop.js.map +1 -0
  134. package/dist/use-high-scores.d.ts +41 -0
  135. package/dist/use-high-scores.d.ts.map +1 -0
  136. package/dist/use-high-scores.js +94 -0
  137. package/dist/use-high-scores.js.map +1 -0
  138. package/dist/use-layout-state.d.ts +77 -0
  139. package/dist/use-layout-state.d.ts.map +1 -0
  140. package/dist/use-layout-state.js +160 -0
  141. package/dist/use-layout-state.js.map +1 -0
  142. package/dist/use-ralph-loop.d.ts +41 -0
  143. package/dist/use-ralph-loop.d.ts.map +1 -0
  144. package/dist/use-ralph-loop.js +106 -0
  145. package/dist/use-ralph-loop.js.map +1 -0
  146. package/dist/use-spinner.d.ts +46 -0
  147. package/dist/use-spinner.d.ts.map +1 -0
  148. package/dist/use-spinner.js +71 -0
  149. package/dist/use-spinner.js.map +1 -0
  150. package/dist/use-stats.d.ts +59 -0
  151. package/dist/use-stats.d.ts.map +1 -0
  152. package/dist/use-stats.js +150 -0
  153. package/dist/use-stats.js.map +1 -0
  154. package/dist/use-terminal-size.d.ts +29 -0
  155. package/dist/use-terminal-size.d.ts.map +1 -0
  156. package/dist/use-terminal-size.js +48 -0
  157. package/dist/use-terminal-size.js.map +1 -0
  158. package/dist/useTheme.d.ts +76 -0
  159. package/dist/useTheme.d.ts.map +1 -0
  160. package/dist/useTheme.js +136 -0
  161. package/dist/useTheme.js.map +1 -0
  162. package/package.json +58 -0
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Theme Definitions
3
+ *
4
+ * Multiple visual themes for the terminal UI.
5
+ * Each theme provides a complete color palette that maps to semantic colors.
6
+ */
7
+ /**
8
+ * Theme color scheme identifier
9
+ */
10
+ export type ThemeId = "default" | "dark" | "light" | "retro";
11
+ /**
12
+ * Complete color palette for a theme
13
+ */
14
+ export interface ThemeColors {
15
+ primary: string;
16
+ secondary: string;
17
+ accent: string;
18
+ success: string;
19
+ warning: string;
20
+ error: string;
21
+ info: string;
22
+ text: string;
23
+ textMuted: string;
24
+ textDim: string;
25
+ border: string;
26
+ borderFocus: string;
27
+ borderActive: string;
28
+ bgHighlight: string;
29
+ bgWarning: string;
30
+ bgError: string;
31
+ bgSuccess: string;
32
+ }
33
+ /**
34
+ * Status colors for loop/process states
35
+ */
36
+ export interface ThemeStatusColors {
37
+ idle: string;
38
+ running: string;
39
+ paused: string;
40
+ completed: string;
41
+ errored: string;
42
+ waiting_for_input: string;
43
+ starting: string;
44
+ stopping: string;
45
+ stopped: string;
46
+ crashed: string;
47
+ }
48
+ /**
49
+ * Alert type colors
50
+ */
51
+ export interface ThemeAlertColors {
52
+ question: string;
53
+ confirmation: string;
54
+ error: string;
55
+ permission: string;
56
+ info: string;
57
+ success: string;
58
+ }
59
+ /**
60
+ * Game-specific colors
61
+ */
62
+ export interface ThemeGameColors {
63
+ player: string;
64
+ opponent: string;
65
+ item: string;
66
+ obstacle: string;
67
+ bonus: string;
68
+ neutral: string;
69
+ }
70
+ /**
71
+ * Position ranking colors (for leaderboards)
72
+ */
73
+ export interface ThemeRankColors {
74
+ first: string;
75
+ second: string;
76
+ third: string;
77
+ top3: string;
78
+ highlighted: string;
79
+ normal: string | undefined;
80
+ }
81
+ /**
82
+ * Complete theme definition
83
+ */
84
+ export interface Theme {
85
+ id: ThemeId;
86
+ name: string;
87
+ description: string;
88
+ colors: ThemeColors;
89
+ statusColors: ThemeStatusColors;
90
+ alertColors: ThemeAlertColors;
91
+ gameColors: ThemeGameColors;
92
+ rankColors: ThemeRankColors;
93
+ }
94
+ /**
95
+ * All available themes
96
+ */
97
+ export declare const themes: Record<ThemeId, Theme>;
98
+ /**
99
+ * Get a theme by ID
100
+ */
101
+ export declare function getTheme(id: ThemeId): Theme;
102
+ /**
103
+ * Get all available theme IDs
104
+ */
105
+ export declare function getThemeIds(): ThemeId[];
106
+ /**
107
+ * Get theme info for display (name and description)
108
+ */
109
+ export declare function getThemeInfo(id: ThemeId): {
110
+ name: string;
111
+ description: string;
112
+ };
113
+ /**
114
+ * Check if a string is a valid theme ID
115
+ */
116
+ export declare function isValidThemeId(id: string): id is ThemeId;
117
+ //# sourceMappingURL=themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,WAAW;IAE1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IAGrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CA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AAE,OAAO,GAAG,KAAK,CAE3C;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,OAAO,EAAE,CAEvC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAG/E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,OAAO,CAExD"}
package/dist/themes.js ADDED
@@ -0,0 +1,296 @@
1
+ /**
2
+ * Theme Definitions
3
+ *
4
+ * Multiple visual themes for the terminal UI.
5
+ * Each theme provides a complete color palette that maps to semantic colors.
6
+ */
7
+ // ============================================================================
8
+ // DEFAULT THEME (Cyan/Magenta/Yellow - Modern Terminal)
9
+ // ============================================================================
10
+ const defaultTheme = {
11
+ id: "default",
12
+ name: "Default",
13
+ description: "Modern terminal aesthetic with cyan, magenta, and yellow accents",
14
+ colors: {
15
+ primary: "cyan",
16
+ secondary: "magenta",
17
+ accent: "yellow",
18
+ success: "green",
19
+ warning: "yellow",
20
+ error: "red",
21
+ info: "cyan",
22
+ text: "white",
23
+ textMuted: "gray",
24
+ textDim: "gray",
25
+ border: "gray",
26
+ borderFocus: "cyan",
27
+ borderActive: "yellow",
28
+ bgHighlight: "cyan",
29
+ bgWarning: "yellow",
30
+ bgError: "red",
31
+ bgSuccess: "green",
32
+ },
33
+ statusColors: {
34
+ idle: "gray",
35
+ running: "green",
36
+ paused: "yellow",
37
+ completed: "cyan",
38
+ errored: "red",
39
+ waiting_for_input: "magenta",
40
+ starting: "yellow",
41
+ stopping: "yellow",
42
+ stopped: "gray",
43
+ crashed: "red",
44
+ },
45
+ alertColors: {
46
+ question: "cyan",
47
+ confirmation: "yellow",
48
+ error: "red",
49
+ permission: "magenta",
50
+ info: "cyan",
51
+ success: "green",
52
+ },
53
+ gameColors: {
54
+ player: "cyan",
55
+ opponent: "magenta",
56
+ item: "yellow",
57
+ obstacle: "red",
58
+ bonus: "green",
59
+ neutral: "gray",
60
+ },
61
+ rankColors: {
62
+ first: "yellow",
63
+ second: "white",
64
+ third: "white",
65
+ top3: "yellow",
66
+ highlighted: "green",
67
+ normal: undefined,
68
+ },
69
+ };
70
+ // ============================================================================
71
+ // DARK THEME (Muted colors optimized for dark backgrounds)
72
+ // ============================================================================
73
+ const darkTheme = {
74
+ id: "dark",
75
+ name: "Dark",
76
+ description: "Muted, eye-friendly colors for extended sessions",
77
+ colors: {
78
+ primary: "blueBright",
79
+ secondary: "magentaBright",
80
+ accent: "yellowBright",
81
+ success: "greenBright",
82
+ warning: "yellowBright",
83
+ error: "redBright",
84
+ info: "blueBright",
85
+ text: "white",
86
+ textMuted: "gray",
87
+ textDim: "gray",
88
+ border: "gray",
89
+ borderFocus: "blueBright",
90
+ borderActive: "yellowBright",
91
+ bgHighlight: "blueBright",
92
+ bgWarning: "yellowBright",
93
+ bgError: "redBright",
94
+ bgSuccess: "greenBright",
95
+ },
96
+ statusColors: {
97
+ idle: "gray",
98
+ running: "greenBright",
99
+ paused: "yellowBright",
100
+ completed: "blueBright",
101
+ errored: "redBright",
102
+ waiting_for_input: "magentaBright",
103
+ starting: "yellowBright",
104
+ stopping: "yellowBright",
105
+ stopped: "gray",
106
+ crashed: "redBright",
107
+ },
108
+ alertColors: {
109
+ question: "blueBright",
110
+ confirmation: "yellowBright",
111
+ error: "redBright",
112
+ permission: "magentaBright",
113
+ info: "blueBright",
114
+ success: "greenBright",
115
+ },
116
+ gameColors: {
117
+ player: "blueBright",
118
+ opponent: "magentaBright",
119
+ item: "yellowBright",
120
+ obstacle: "redBright",
121
+ bonus: "greenBright",
122
+ neutral: "gray",
123
+ },
124
+ rankColors: {
125
+ first: "yellowBright",
126
+ second: "white",
127
+ third: "white",
128
+ top3: "yellowBright",
129
+ highlighted: "greenBright",
130
+ normal: undefined,
131
+ },
132
+ };
133
+ // ============================================================================
134
+ // LIGHT THEME (High contrast for light terminal backgrounds)
135
+ // ============================================================================
136
+ const lightTheme = {
137
+ id: "light",
138
+ name: "Light",
139
+ description: "High contrast colors for light terminal backgrounds",
140
+ colors: {
141
+ primary: "blue",
142
+ secondary: "magenta",
143
+ accent: "yellow",
144
+ success: "green",
145
+ warning: "yellow",
146
+ error: "red",
147
+ info: "blue",
148
+ text: "black",
149
+ textMuted: "gray",
150
+ textDim: "gray",
151
+ border: "gray",
152
+ borderFocus: "blue",
153
+ borderActive: "yellow",
154
+ bgHighlight: "blue",
155
+ bgWarning: "yellow",
156
+ bgError: "red",
157
+ bgSuccess: "green",
158
+ },
159
+ statusColors: {
160
+ idle: "gray",
161
+ running: "green",
162
+ paused: "yellow",
163
+ completed: "blue",
164
+ errored: "red",
165
+ waiting_for_input: "magenta",
166
+ starting: "yellow",
167
+ stopping: "yellow",
168
+ stopped: "gray",
169
+ crashed: "red",
170
+ },
171
+ alertColors: {
172
+ question: "blue",
173
+ confirmation: "yellow",
174
+ error: "red",
175
+ permission: "magenta",
176
+ info: "blue",
177
+ success: "green",
178
+ },
179
+ gameColors: {
180
+ player: "blue",
181
+ opponent: "magenta",
182
+ item: "yellow",
183
+ obstacle: "red",
184
+ bonus: "green",
185
+ neutral: "gray",
186
+ },
187
+ rankColors: {
188
+ first: "yellow",
189
+ second: "black",
190
+ third: "black",
191
+ top3: "yellow",
192
+ highlighted: "green",
193
+ normal: undefined,
194
+ },
195
+ };
196
+ // ============================================================================
197
+ // RETRO THEME (Classic green phosphor terminal / Amber CRT)
198
+ // ============================================================================
199
+ const retroTheme = {
200
+ id: "retro",
201
+ name: "Retro",
202
+ description: "Classic green phosphor terminal aesthetic",
203
+ colors: {
204
+ primary: "green",
205
+ secondary: "greenBright",
206
+ accent: "yellow",
207
+ success: "greenBright",
208
+ warning: "yellow",
209
+ error: "red",
210
+ info: "green",
211
+ text: "greenBright",
212
+ textMuted: "green",
213
+ textDim: "green",
214
+ border: "green",
215
+ borderFocus: "greenBright",
216
+ borderActive: "yellow",
217
+ bgHighlight: "green",
218
+ bgWarning: "yellow",
219
+ bgError: "red",
220
+ bgSuccess: "greenBright",
221
+ },
222
+ statusColors: {
223
+ idle: "green",
224
+ running: "greenBright",
225
+ paused: "yellow",
226
+ completed: "greenBright",
227
+ errored: "red",
228
+ waiting_for_input: "yellow",
229
+ starting: "yellow",
230
+ stopping: "yellow",
231
+ stopped: "green",
232
+ crashed: "red",
233
+ },
234
+ alertColors: {
235
+ question: "greenBright",
236
+ confirmation: "yellow",
237
+ error: "red",
238
+ permission: "yellow",
239
+ info: "green",
240
+ success: "greenBright",
241
+ },
242
+ gameColors: {
243
+ player: "greenBright",
244
+ opponent: "yellow",
245
+ item: "yellow",
246
+ obstacle: "red",
247
+ bonus: "greenBright",
248
+ neutral: "green",
249
+ },
250
+ rankColors: {
251
+ first: "yellow",
252
+ second: "greenBright",
253
+ third: "greenBright",
254
+ top3: "yellow",
255
+ highlighted: "greenBright",
256
+ normal: undefined,
257
+ },
258
+ };
259
+ // ============================================================================
260
+ // THEME REGISTRY
261
+ // ============================================================================
262
+ /**
263
+ * All available themes
264
+ */
265
+ export const themes = {
266
+ default: defaultTheme,
267
+ dark: darkTheme,
268
+ light: lightTheme,
269
+ retro: retroTheme,
270
+ };
271
+ /**
272
+ * Get a theme by ID
273
+ */
274
+ export function getTheme(id) {
275
+ return themes[id] ?? themes.default;
276
+ }
277
+ /**
278
+ * Get all available theme IDs
279
+ */
280
+ export function getThemeIds() {
281
+ return Object.keys(themes);
282
+ }
283
+ /**
284
+ * Get theme info for display (name and description)
285
+ */
286
+ export function getThemeInfo(id) {
287
+ const theme = getTheme(id);
288
+ return { name: theme.name, description: theme.description };
289
+ }
290
+ /**
291
+ * Check if a string is a valid theme ID
292
+ */
293
+ export function isValidThemeId(id) {
294
+ return id in themes;
295
+ }
296
+ //# sourceMappingURL=themes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.js","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;A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AAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * UI Module Exports
3
+ *
4
+ * Central export point for all UI-related utilities, components,
5
+ * and theme constants.
6
+ */
7
+ export { colors, statusColors, alertColors, gameColors, rankColors, boxChars, statusIcons, alertIcons, navIcons, progressChars, gameChars, decorChars, borderStyles, spacing, getSpinnerFrame, createProgressBar, createDivider, createBoxLine, getStatusColor, getStatusIcon, getAlertColor, getAlertIcon, getRankColor, truncate, centerText, type ColorKey, type StatusColorKey, type AlertColorKey, type BoxStyle, type BorderStyle, } from "../theme.js";
8
+ export { Panel, Card, Badge, StatusIndicator, ProgressBar, Spinner, Divider, AlertBox, KeyHint, KeyHintsRow, Header, SectionHeader, EmptyState, ScoreDisplay, Countdown, ListItem, type PanelProps, type CardProps, type BadgeProps, type StatusIndicatorProps, type ProgressBarProps, type SpinnerProps, type DividerProps, type AlertBoxProps, type KeyHintProps, type KeyHintsRowProps, type HeaderProps, type SectionHeaderProps, type EmptyStateProps, type ScoreDisplayProps, type CountdownProps, type ListItemProps, } from "../styled-components.js";
9
+ export { useSpinner, useSpinnerFrame, type UseSpinnerOptions, type UseSpinnerResult, type SpinnerStyle, } from "../use-spinner.js";
10
+ export { ThemeProvider, useTheme, useThemeColors, useStatusColors, useAlertColors, useGameColors, useRankColors, getThemedStatusColor, getThemedAlertColor, getThemedRankColor, type Theme, type ThemeId, } from "../useTheme.js";
11
+ export { themes, getTheme, getThemeIds, getThemeInfo, isValidThemeId, type ThemeColors, type ThemeStatusColors, type ThemeAlertColors, type ThemeGameColors, type ThemeRankColors, } from "../themes.js";
12
+ export { StatusBar, GameStatusProvider, useGameStatus, type StatusBarProps, type CurrentGameState, } from "../StatusBar.js";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAEL,MAAM,EACN,YAAY,EACZ,WAAW,EAC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WAAW,EACX,YAAY,EACZ,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * UI Module Exports
3
+ *
4
+ * Central export point for all UI-related utilities, components,
5
+ * and theme constants.
6
+ */
7
+ // Theme system - colors, icons, characters, utilities
8
+ export {
9
+ // Color palettes
10
+ colors, statusColors, alertColors, gameColors, rankColors,
11
+ // Unicode characters
12
+ boxChars, statusIcons, alertIcons, navIcons, progressChars, gameChars, decorChars,
13
+ // Border styles
14
+ borderStyles,
15
+ // Spacing
16
+ spacing,
17
+ // Utility functions
18
+ getSpinnerFrame, createProgressBar, createDivider, createBoxLine, getStatusColor, getStatusIcon, getAlertColor, getAlertIcon, getRankColor, truncate, centerText, } from "../theme.js";
19
+ // Styled components
20
+ export { Panel, Card, Badge, StatusIndicator, ProgressBar, Spinner, Divider, AlertBox, KeyHint, KeyHintsRow, Header, SectionHeader, EmptyState, ScoreDisplay, Countdown, ListItem, } from "../styled-components.js";
21
+ // Hooks
22
+ export { useSpinner, useSpinnerFrame, } from "../use-spinner.js";
23
+ // Theme context and hooks
24
+ export { ThemeProvider, useTheme, useThemeColors, useStatusColors, useAlertColors, useGameColors, useRankColors, getThemedStatusColor, getThemedAlertColor, getThemedRankColor, } from "../useTheme.js";
25
+ // Theme definitions
26
+ export { themes, getTheme, getThemeIds, getThemeInfo, isValidThemeId, } from "../themes.js";
27
+ // Status bar component
28
+ export { StatusBar, GameStatusProvider, useGameStatus, } from "../StatusBar.js";
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sDAAsD;AACtD,OAAO;AACL,iBAAiB;AACjB,MAAM,EACN,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU;AACV,qBAAqB;AACrB,QAAQ,EACR,WAAW,EACX,UAAU,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU;AACV,gBAAgB;AAChB,YAAY;AACZ,UAAU;AACV,OAAO;AACP,oBAAoB;AACpB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,UAAU,GAOX,MAAM,aAAa,CAAC;AAErB,oBAAoB;AACpB,OAAO,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,eAAe,EACf,WAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,WAAW,EACX,MAAM,EACN,aAAa,EACb,UAAU,EACV,YAAY,EACZ,SAAS,EACT,QAAQ,GAkBT,MAAM,yBAAyB,CAAC;AAEjC,QAAQ;AACR,OAAO,EACL,UAAU,EACV,eAAe,GAIhB,MAAM,mBAAmB,CAAC;AAE3B,0BAA0B;AAC1B,OAAO,EACL,aAAa,EACb,QAAQ,EACR,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GAGnB,MAAM,gBAAgB,CAAC;AAExB,oBAAoB;AACpB,OAAO,EACL,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,cAAc,GAMf,MAAM,cAAc,CAAC;AAEtB,uBAAuB;AACvB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,aAAa,GAGd,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type ProcessStatus, type ProcessError } from "./claude-code-process.js";
2
+ export interface ClaudeCodeOutput {
3
+ type: "stdout" | "stderr";
4
+ content: string;
5
+ timestamp: Date;
6
+ }
7
+ export interface UseClaudeCodeOptions {
8
+ /** Path to Claude Code executable */
9
+ executablePath?: string;
10
+ /** Default arguments to pass to Claude Code */
11
+ defaultArgs?: string[];
12
+ /** Default working directory */
13
+ workingDirectory?: string;
14
+ /** Environment variables to pass */
15
+ environment?: Record<string, string>;
16
+ /** Timeout for graceful shutdown */
17
+ shutdownTimeout?: number;
18
+ }
19
+ export interface UseClaudeCodeResult {
20
+ status: ProcessStatus;
21
+ output: ClaudeCodeOutput[];
22
+ error: ProcessError | null;
23
+ spawn: (args?: string[], cwd?: string) => void;
24
+ stop: () => Promise<void>;
25
+ write: (input: string) => void;
26
+ writeLine: (input: string) => void;
27
+ clearOutput: () => void;
28
+ }
29
+ export declare function useClaudeCode(options?: UseClaudeCodeOptions): UseClaudeCodeResult;
30
+ //# sourceMappingURL=use-claude-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-claude-code.d.ts","sourceRoot":"","sources":["../src/use-claude-code.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,YAAY,EAGlB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,mBAAmB,CAmGrF"}
@@ -0,0 +1,84 @@
1
+ import { useState, useEffect, useCallback, useRef } from "react";
2
+ import { ClaudeCodeProcess, setupProcessCleanup, } from "./claude-code-process.js";
3
+ export function useClaudeCode(options = {}) {
4
+ const { executablePath, defaultArgs = [], workingDirectory, environment, shutdownTimeout, } = options;
5
+ const processRef = useRef(null);
6
+ const [status, setStatus] = useState("idle");
7
+ const [output, setOutput] = useState([]);
8
+ const [error, setError] = useState(null);
9
+ // Initialize process on mount
10
+ useEffect(() => {
11
+ const claudeProcess = new ClaudeCodeProcess();
12
+ processRef.current = claudeProcess;
13
+ // Setup cleanup handlers
14
+ setupProcessCleanup(claudeProcess);
15
+ // Subscribe to events using type-safe methods
16
+ claudeProcess.onStatus((newStatus) => {
17
+ setStatus(newStatus);
18
+ });
19
+ claudeProcess.onStdout((content) => {
20
+ setOutput((prev) => [
21
+ ...prev,
22
+ { type: "stdout", content, timestamp: new Date() },
23
+ ]);
24
+ });
25
+ claudeProcess.onStderr((content) => {
26
+ setOutput((prev) => [
27
+ ...prev,
28
+ { type: "stderr", content, timestamp: new Date() },
29
+ ]);
30
+ });
31
+ claudeProcess.onError((err) => {
32
+ setError(err);
33
+ });
34
+ // Cleanup on unmount
35
+ return () => {
36
+ if (claudeProcess.isRunning()) {
37
+ claudeProcess.kill();
38
+ }
39
+ };
40
+ }, []);
41
+ const spawn = useCallback((args = [], cwd) => {
42
+ if (processRef.current) {
43
+ setError(null);
44
+ const spawnOptions = {
45
+ executablePath,
46
+ args: [...defaultArgs, ...args],
47
+ cwd: cwd ?? workingDirectory,
48
+ env: environment,
49
+ shutdownTimeout,
50
+ };
51
+ processRef.current.spawn(spawnOptions);
52
+ }
53
+ }, [executablePath, defaultArgs, workingDirectory, environment, shutdownTimeout]);
54
+ const stop = useCallback(async () => {
55
+ if (processRef.current) {
56
+ await processRef.current.stop();
57
+ }
58
+ }, []);
59
+ const write = useCallback((input) => {
60
+ if (processRef.current) {
61
+ processRef.current.write(input);
62
+ }
63
+ }, []);
64
+ const writeLine = useCallback((input) => {
65
+ if (processRef.current) {
66
+ processRef.current.writeLine(input);
67
+ }
68
+ }, []);
69
+ const clearOutput = useCallback(() => {
70
+ setOutput([]);
71
+ setError(null);
72
+ }, []);
73
+ return {
74
+ status,
75
+ output,
76
+ error,
77
+ spawn,
78
+ stop,
79
+ write,
80
+ writeLine,
81
+ clearOutput,
82
+ };
83
+ }
84
+ //# sourceMappingURL=use-claude-code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-claude-code.js","sourceRoot":"","sources":["../src/use-claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EACL,iBAAiB,EAIjB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAgClC,MAAM,UAAU,aAAa,CAAC,UAAgC,EAAE;IAC9D,MAAM,EACJ,cAAc,EACd,WAAW,GAAG,EAAE,EAChB,gBAAgB,EAChB,WAAW,EACX,eAAe,GAChB,GAAG,OAAO,CAAC;IACZ,MAAM,UAAU,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,MAAM,EAA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AE,EAAE,CAAC,CAAC;IAEP,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,SAAS,CAAC,EAAE,CAAC,CAAC;QACd,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,MAAM;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,IAAI;QACJ,KAAK;QACL,SAAS;QACT,WAAW;KACZ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * React Hook for Configuration Management
3
+ *
4
+ * Provides access to the application configuration in React components.
5
+ * Handles async loading with proper state management.
6
+ */
7
+ import { type BrainrotConfig, getLayoutOptions, getClaudeCodeOptions, getAppSettings } from "./config.js";
8
+ export interface UseConfigResult {
9
+ /** Current configuration (defaults while loading) */
10
+ config: BrainrotConfig;
11
+ /** Whether config is still loading */
12
+ isLoading: boolean;
13
+ /** Error if config failed to load */
14
+ error: Error | null;
15
+ /** Reload configuration from disk */
16
+ reload: () => Promise<void>;
17
+ /** Update configuration */
18
+ update: (updates: Partial<Omit<BrainrotConfig, "version">>) => Promise<void>;
19
+ /** Reset configuration to defaults */
20
+ reset: () => Promise<void>;
21
+ /** Save entire configuration */
22
+ save: (config: BrainrotConfig) => Promise<void>;
23
+ }
24
+ /**
25
+ * React hook for accessing and managing application configuration.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * const { config, isLoading } = useConfig();
30
+ *
31
+ * if (isLoading) return <Text>Loading config...</Text>;
32
+ *
33
+ * return <Text>Split ratio: {config.layout?.splitRatio}</Text>;
34
+ * ```
35
+ */
36
+ export declare function useConfig(): UseConfigResult;
37
+ /**
38
+ * Hook to get layout options from config, ready for useLayoutState
39
+ */
40
+ export declare function useLayoutConfig(): {
41
+ options: ReturnType<typeof getLayoutOptions>;
42
+ isLoading: boolean;
43
+ };
44
+ /**
45
+ * Hook to get Claude Code options from config
46
+ */
47
+ export declare function useClaudeCodeConfig(): {
48
+ options: ReturnType<typeof getClaudeCodeOptions>;
49
+ isLoading: boolean;
50
+ };
51
+ /**
52
+ * Hook to get app settings from config
53
+ */
54
+ export declare function useAppSettings(): {
55
+ settings: ReturnType<typeof getAppSettings>;
56
+ isLoading: boolean;
57
+ };
58
+ //# sourceMappingURL=use-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-config.d.ts","sourceRoot":"","sources":["../src/use-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,KAAK,cAAc,EAMnB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,MAAM,EAAE,cAAc,CAAC;IACvB,sCAAsC;IACtC,SAAS,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,qCAAqC;IACrC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,2BAA2B;IAC3B,MAAM,EAAE,CACN,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,KAC9C,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,sCAAsC;IACtC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,gCAAgC;IAChC,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,IAAI,eAAe,CAkE3C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI;IACjC,OAAO,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAC7C,SAAS,EAAE,OAAO,CAAC;CACpB,CAMA;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI;IACrC,OAAO,EAAE,UAAU,CAAC,OAAO,oBAAoB,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