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 @@
1
+ {"version":3,"file":"use-stats.js","sourceRoot":"","sources":["../src/use-stats.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE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,CAAC,CAAC;IACX,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,UAAU,GAAG,WAAW,CAC5B,KAAK,EACH,KAAa,EACb,GAAa,EACb,WAAoC,EACjB,EAAE;QACrB,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;YACxB,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACnC,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;QAC7B,CAAC;QAED,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO;YACxC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;YACxD,CAAC,CAAC,CAAC,CAAC;QAEN,WAAW,CAAC,KAAK,CAAC,CAAC;QACnB,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;QAE5B,qBAAqB;QACrB,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACtB,OAAO,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;QAC3E,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,qBAAqB;IACrB,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;gBACxB,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACrC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,YAAY;QACZ,UAAU;QACV,eAAe,EAAE,QAAQ;QACzB,eAAe,EAAE,QAAQ;KAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Hook for tracking terminal dimensions and handling resize events.
3
+ * Provides reactive terminal size state for responsive layouts.
4
+ */
5
+ export interface TerminalSize {
6
+ /** Terminal width in columns */
7
+ width: number;
8
+ /** Terminal height in rows */
9
+ height: number;
10
+ }
11
+ export interface UseTerminalSizeResult extends TerminalSize {
12
+ /** Whether the terminal is considered "small" */
13
+ isSmall: boolean;
14
+ /** Whether the terminal is too small for the UI */
15
+ isTooSmall: boolean;
16
+ }
17
+ /** Minimum dimensions for a functional UI */
18
+ export declare const MIN_WIDTH = 40;
19
+ export declare const MIN_HEIGHT = 15;
20
+ /** Threshold for "small" terminal classification */
21
+ export declare const SMALL_WIDTH = 80;
22
+ export declare const SMALL_HEIGHT = 24;
23
+ /**
24
+ * React hook for tracking terminal size with responsive breakpoints.
25
+ *
26
+ * @returns Terminal dimensions and size classification
27
+ */
28
+ export declare function useTerminalSize(): UseTerminalSizeResult;
29
+ //# sourceMappingURL=use-terminal-size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-terminal-size.d.ts","sourceRoot":"","sources":["../src/use-terminal-size.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,YAAY;IAC3B,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,mDAAmD;IACnD,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,6CAA6C;AAC7C,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,oDAAoD;AACpD,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,qBAAqB,CAkCvD"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Hook for tracking terminal dimensions and handling resize events.
3
+ * Provides reactive terminal size state for responsive layouts.
4
+ */
5
+ import { useState, useEffect } from "react";
6
+ import { useStdout } from "ink";
7
+ /** Minimum dimensions for a functional UI */
8
+ export const MIN_WIDTH = 40;
9
+ export const MIN_HEIGHT = 15;
10
+ /** Threshold for "small" terminal classification */
11
+ export const SMALL_WIDTH = 80;
12
+ export const SMALL_HEIGHT = 24;
13
+ /**
14
+ * React hook for tracking terminal size with responsive breakpoints.
15
+ *
16
+ * @returns Terminal dimensions and size classification
17
+ */
18
+ export function useTerminalSize() {
19
+ const { stdout } = useStdout();
20
+ const [size, setSize] = useState(() => ({
21
+ width: stdout?.columns ?? 80,
22
+ height: stdout?.rows ?? 24,
23
+ }));
24
+ useEffect(() => {
25
+ const handleResize = () => {
26
+ setSize({
27
+ width: stdout?.columns ?? 80,
28
+ height: stdout?.rows ?? 24,
29
+ });
30
+ };
31
+ // Listen for terminal resize events
32
+ if (stdout) {
33
+ stdout.on("resize", handleResize);
34
+ return () => {
35
+ stdout.off("resize", handleResize);
36
+ };
37
+ }
38
+ return undefined;
39
+ }, [stdout]);
40
+ const isSmall = size.width < SMALL_WIDTH || size.height < SMALL_HEIGHT;
41
+ const isTooSmall = size.width < MIN_WIDTH || size.height < MIN_HEIGHT;
42
+ return {
43
+ ...size,
44
+ isSmall,
45
+ isTooSmall,
46
+ };
47
+ }
48
+ //# sourceMappingURL=use-terminal-size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-terminal-size.js","sourceRoot":"","sources":["../src/use-terminal-size.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAgBhC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAC5B,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAE7B,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAE/B;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAE/B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAe,GAAG,EAAE,CAAC,CAAC;QACpD,KAAK,EAAE,MAAM,EAAE,OAAO,IAAI,EAAE;QAC5B,MAAM,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE;KAC3B,CAAC,CAAC,CAAC;IAEJ,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,GAAG,EAAE;YACxB,OAAO,CAAC;gBACN,KAAK,EAAE,MAAM,EAAE,OAAO,IAAI,EAAE;gBAC5B,MAAM,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE;aAC3B,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,oCAAoC;QACpC,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YAClC,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACrC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,GAAG,WAAW,IAAI,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;IACvE,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,GAAG,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;IAEtE,OAAO;QACL,GAAG,IAAI;QACP,OAAO;QACP,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Theme Hook and Context
3
+ *
4
+ * Provides the current theme to all components via React context.
5
+ * Reads the theme preference from config and applies it consistently.
6
+ */
7
+ import { type ReactNode } from "react";
8
+ import { type Theme, type ThemeId, themes } from "./themes.js";
9
+ import type { BrainrotConfig } from "./config.js";
10
+ /**
11
+ * Theme context value
12
+ */
13
+ interface ThemeContextValue {
14
+ /** Current theme */
15
+ theme: Theme;
16
+ /** Current theme ID */
17
+ themeId: ThemeId;
18
+ /** All available themes for selection */
19
+ availableThemes: typeof themes;
20
+ }
21
+ /**
22
+ * Theme context with default theme
23
+ */
24
+ declare const ThemeContext: import("react").Context<ThemeContextValue>;
25
+ export interface ThemeProviderProps {
26
+ /** Current configuration containing theme preferences */
27
+ config: BrainrotConfig;
28
+ /** Child components */
29
+ children: ReactNode;
30
+ }
31
+ /**
32
+ * Theme provider component
33
+ * Wraps the app to provide theme context to all components
34
+ */
35
+ export declare function ThemeProvider({ config, children }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
36
+ /**
37
+ * Hook to access the current theme
38
+ * Returns the complete theme object with colors, status colors, etc.
39
+ */
40
+ export declare function useTheme(): ThemeContextValue;
41
+ /**
42
+ * Hook to access just the color palette
43
+ * Convenience wrapper for common use case
44
+ */
45
+ export declare function useThemeColors(): import("./themes.js").ThemeColors;
46
+ /**
47
+ * Hook to access status colors
48
+ */
49
+ export declare function useStatusColors(): import("./themes.js").ThemeStatusColors;
50
+ /**
51
+ * Hook to access alert colors
52
+ */
53
+ export declare function useAlertColors(): import("./themes.js").ThemeAlertColors;
54
+ /**
55
+ * Hook to access game colors
56
+ */
57
+ export declare function useGameColors(): import("./themes.js").ThemeGameColors;
58
+ /**
59
+ * Hook to access rank colors
60
+ */
61
+ export declare function useRankColors(): import("./themes.js").ThemeRankColors;
62
+ /**
63
+ * Get color for a status value using theme
64
+ */
65
+ export declare function getThemedStatusColor(theme: Theme, status: string): string;
66
+ /**
67
+ * Get color for an alert type using theme
68
+ */
69
+ export declare function getThemedAlertColor(theme: Theme, type: string): string;
70
+ /**
71
+ * Get color for a rank position using theme
72
+ */
73
+ export declare function getThemedRankColor(theme: Theme, position: number, isHighlighted?: boolean): string | undefined;
74
+ export { ThemeContext };
75
+ export type { Theme, ThemeId, ThemeColors } from "./themes.js";
76
+ //# sourceMappingURL=useTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/useTheme.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAY,MAAM,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD;;GAEG;AACH,UAAU,iBAAiB;IACzB,oBAAoB;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,eAAe,EAAE,OAAO,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,QAAA,MAAM,YAAY,4CAIhB,CAAC;AAMH,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,MAAM,EAAE,cAAc,CAAC;IACvB,uBAAuB;IACvB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CAgDrE;AAMD;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,iBAAiB,CAE5C;AAED;;;GAGG;AACH,wBAAgB,cAAc,sCAG7B;AAED;;GAEG;AACH,wBAAgB,eAAe,4CAG9B;AAED;;GAEG;AACH,wBAAgB,cAAc,2CAG7B;AAED;;GAEG;AACH,wBAAgB,aAAa,0CAG5B;AAED;;GAEG;AACH,wBAAgB,aAAa,0CAG5B;AAMD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,GACb,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,MAAM,GACX,MAAM,CAIR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,MAAM,EAChB,aAAa,GAAE,OAAe,GAC7B,MAAM,GAAG,SAAS,CAKpB;AAMD,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,136 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Theme Hook and Context
4
+ *
5
+ * Provides the current theme to all components via React context.
6
+ * Reads the theme preference from config and applies it consistently.
7
+ */
8
+ import { createContext, useContext, useMemo } from "react";
9
+ import { getTheme, themes } from "./themes.js";
10
+ /**
11
+ * Theme context with default theme
12
+ */
13
+ const ThemeContext = createContext({
14
+ theme: getTheme("default"),
15
+ themeId: "default",
16
+ availableThemes: themes,
17
+ });
18
+ /**
19
+ * Theme provider component
20
+ * Wraps the app to provide theme context to all components
21
+ */
22
+ export function ThemeProvider({ config, children }) {
23
+ const themePrefs = config.theme ?? {};
24
+ // Determine the theme ID from config
25
+ const themeId = useMemo(() => {
26
+ const colorScheme = themePrefs.colorScheme ?? "default";
27
+ return colorScheme;
28
+ }, [themePrefs.colorScheme]);
29
+ // Get the base theme
30
+ const baseTheme = useMemo(() => getTheme(themeId), [themeId]);
31
+ // Apply any custom color overrides from config
32
+ const theme = useMemo(() => {
33
+ const customColors = themePrefs.colors;
34
+ if (!customColors) {
35
+ return baseTheme;
36
+ }
37
+ // Merge custom colors into the theme
38
+ return {
39
+ ...baseTheme,
40
+ colors: {
41
+ ...baseTheme.colors,
42
+ ...(customColors.primary && { primary: customColors.primary }),
43
+ ...(customColors.secondary && { secondary: customColors.secondary }),
44
+ ...(customColors.accent && { accent: customColors.accent }),
45
+ ...(customColors.success && { success: customColors.success }),
46
+ ...(customColors.warning && { warning: customColors.warning }),
47
+ ...(customColors.error && { error: customColors.error }),
48
+ },
49
+ };
50
+ }, [baseTheme, themePrefs.colors]);
51
+ const contextValue = useMemo(() => ({
52
+ theme,
53
+ themeId,
54
+ availableThemes: themes,
55
+ }), [theme, themeId]);
56
+ return (_jsx(ThemeContext.Provider, { value: contextValue, children: children }));
57
+ }
58
+ // ============================================================================
59
+ // THEME HOOK
60
+ // ============================================================================
61
+ /**
62
+ * Hook to access the current theme
63
+ * Returns the complete theme object with colors, status colors, etc.
64
+ */
65
+ export function useTheme() {
66
+ return useContext(ThemeContext);
67
+ }
68
+ /**
69
+ * Hook to access just the color palette
70
+ * Convenience wrapper for common use case
71
+ */
72
+ export function useThemeColors() {
73
+ const { theme } = useTheme();
74
+ return theme.colors;
75
+ }
76
+ /**
77
+ * Hook to access status colors
78
+ */
79
+ export function useStatusColors() {
80
+ const { theme } = useTheme();
81
+ return theme.statusColors;
82
+ }
83
+ /**
84
+ * Hook to access alert colors
85
+ */
86
+ export function useAlertColors() {
87
+ const { theme } = useTheme();
88
+ return theme.alertColors;
89
+ }
90
+ /**
91
+ * Hook to access game colors
92
+ */
93
+ export function useGameColors() {
94
+ const { theme } = useTheme();
95
+ return theme.gameColors;
96
+ }
97
+ /**
98
+ * Hook to access rank colors
99
+ */
100
+ export function useRankColors() {
101
+ const { theme } = useTheme();
102
+ return theme.rankColors;
103
+ }
104
+ // ============================================================================
105
+ // UTILITY FUNCTIONS
106
+ // ============================================================================
107
+ /**
108
+ * Get color for a status value using theme
109
+ */
110
+ export function getThemedStatusColor(theme, status) {
111
+ return (theme.statusColors[status] ??
112
+ theme.colors.textMuted);
113
+ }
114
+ /**
115
+ * Get color for an alert type using theme
116
+ */
117
+ export function getThemedAlertColor(theme, type) {
118
+ return (theme.alertColors[type] ?? theme.colors.info);
119
+ }
120
+ /**
121
+ * Get color for a rank position using theme
122
+ */
123
+ export function getThemedRankColor(theme, position, isHighlighted = false) {
124
+ if (isHighlighted)
125
+ return theme.rankColors.highlighted;
126
+ if (position === 1)
127
+ return theme.rankColors.first;
128
+ if (position <= 3)
129
+ return theme.rankColors.top3;
130
+ return theme.rankColors.normal;
131
+ }
132
+ // ============================================================================
133
+ // RE-EXPORTS FOR CONVENIENCE
134
+ // ============================================================================
135
+ export { ThemeContext };
136
+ //# sourceMappingURL=useTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../src/useTheme.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAC3E,OAAO,EAA4B,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAmBzE;;GAEG;AACH,MAAM,YAAY,GAAG,aAAa,CAAoB;IACpD,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,SAAS;IAClB,eAAe,EAAE,MAAM;CACxB,CAAC,CAAC;AAaH;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAsB;IACpE,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;IAEtC,qCAAqC;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAY,EAAE;QACpC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,SAAS,CAAC;QACxD,OAAO,WAAsB,CAAC;IAChC,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAE7B,qBAAqB;IACrB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9D,+CAA+C;IAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAU,EAAE;QAChC,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC;QACvC,IAAI,C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,IAAI,QAAQ,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;IAClD,IAAI,QAAQ,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;IAChD,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;AACjC,CAAC;AAED,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E,OAAO,EAAE,YAAY,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "brainrot-cli",
3
+ "version": "0.1.0",
4
+ "description": "A terminal-native CLI that wraps Claude Code with built-in games to play while agents work",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "brainrot": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "dev": "tsc --watch",
16
+ "start": "node dist/index.js",
17
+ "typecheck": "tsc --noEmit",
18
+ "lint": "eslint src",
19
+ "lint:fix": "eslint src --fix",
20
+ "format": "prettier --write \"src/**/*.{ts,tsx}\"",
21
+ "format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
22
+ "test": "vitest",
23
+ "test:run": "vitest run",
24
+ "prepublishOnly": "npm run build && npm run typecheck && npm run lint"
25
+ },
26
+ "keywords": [
27
+ "cli",
28
+ "tui",
29
+ "terminal",
30
+ "ink",
31
+ "claude-code",
32
+ "games"
33
+ ],
34
+ "author": "",
35
+ "license": "MIT",
36
+ "engines": {
37
+ "node": ">=18.0.0"
38
+ },
39
+ "dependencies": {
40
+ "ink": "^6.6.0",
41
+ "react": "^19.2.3"
42
+ },
43
+ "devDependencies": {
44
+ "@eslint/js": "^9.39.2",
45
+ "@types/node": "^25.0.8",
46
+ "@types/react": "^19.2.8",
47
+ "@typescript-eslint/eslint-plugin": "^8.53.0",
48
+ "@typescript-eslint/parser": "^8.53.0",
49
+ "eslint": "^9.39.2",
50
+ "eslint-config-prettier": "^10.1.8",
51
+ "eslint-plugin-react": "^7.37.5",
52
+ "eslint-plugin-react-hooks": "^7.0.1",
53
+ "prettier": "^3.7.4",
54
+ "typescript": "^5.9.3",
55
+ "typescript-eslint": "^8.53.0",
56
+ "vitest": "^4.0.17"
57
+ }
58
+ }