@vybestack/llxprt-code 0.1.13-nightly.250728.2261021c → 0.1.14

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 (204) hide show
  1. package/README.md +24 -0
  2. package/dist/package.json +7 -5
  3. package/dist/src/acp/acpPeer.js +1 -0
  4. package/dist/src/acp/acpPeer.js.map +1 -1
  5. package/dist/src/config/config.d.ts +3 -2
  6. package/dist/src/config/config.js +19 -32
  7. package/dist/src/config/config.js.map +1 -1
  8. package/dist/src/config/settings.d.ts +7 -2
  9. package/dist/src/config/settings.js +25 -10
  10. package/dist/src/config/settings.js.map +1 -1
  11. package/dist/src/gemini.js +7 -33
  12. package/dist/src/gemini.js.map +1 -1
  13. package/dist/src/generated/git-commit.d.ts +1 -1
  14. package/dist/src/generated/git-commit.js +1 -1
  15. package/dist/src/patches/is-in-ci.d.ts +7 -0
  16. package/dist/src/patches/is-in-ci.js +15 -0
  17. package/dist/src/patches/is-in-ci.js.map +1 -0
  18. package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
  19. package/dist/src/services/BuiltinCommandLoader.js +82 -0
  20. package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
  21. package/dist/src/services/CommandService.d.ts +43 -7
  22. package/dist/src/services/CommandService.js +61 -64
  23. package/dist/src/services/CommandService.js.map +1 -1
  24. package/dist/src/services/FileCommandLoader.d.ts +37 -0
  25. package/dist/src/services/FileCommandLoader.js +156 -0
  26. package/dist/src/services/FileCommandLoader.js.map +1 -0
  27. package/dist/src/services/prompt-processors/argumentProcessor.d.ts +21 -0
  28. package/dist/src/services/prompt-processors/argumentProcessor.js +28 -0
  29. package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -0
  30. package/dist/src/services/prompt-processors/types.d.ts +34 -0
  31. package/dist/src/services/prompt-processors/types.js +10 -0
  32. package/dist/src/services/prompt-processors/types.js.map +1 -0
  33. package/dist/src/services/types.d.ts +22 -0
  34. package/dist/src/services/types.js +7 -0
  35. package/dist/src/services/types.js.map +1 -0
  36. package/dist/src/ui/App.js +19 -10
  37. package/dist/src/ui/App.js.map +1 -1
  38. package/dist/src/ui/colors.js +6 -0
  39. package/dist/src/ui/colors.js.map +1 -1
  40. package/dist/src/ui/commands/aboutCommand.js +2 -0
  41. package/dist/src/ui/commands/aboutCommand.js.map +1 -1
  42. package/dist/src/ui/commands/authCommand.js +66 -4
  43. package/dist/src/ui/commands/authCommand.js.map +1 -1
  44. package/dist/src/ui/commands/baseurlCommand.js +2 -0
  45. package/dist/src/ui/commands/baseurlCommand.js.map +1 -1
  46. package/dist/src/ui/commands/bugCommand.js +3 -1
  47. package/dist/src/ui/commands/bugCommand.js.map +1 -1
  48. package/dist/src/ui/commands/chatCommand.js +12 -2
  49. package/dist/src/ui/commands/chatCommand.js.map +1 -1
  50. package/dist/src/ui/commands/clearCommand.js +2 -0
  51. package/dist/src/ui/commands/clearCommand.js.map +1 -1
  52. package/dist/src/ui/commands/compressCommand.js +3 -1
  53. package/dist/src/ui/commands/compressCommand.js.map +1 -1
  54. package/dist/src/ui/commands/copyCommand.d.ts +7 -0
  55. package/dist/src/ui/commands/copyCommand.js +59 -0
  56. package/dist/src/ui/commands/copyCommand.js.map +1 -0
  57. package/dist/src/ui/commands/docsCommand.js +2 -0
  58. package/dist/src/ui/commands/docsCommand.js.map +1 -1
  59. package/dist/src/ui/commands/editorCommand.js +2 -0
  60. package/dist/src/ui/commands/editorCommand.js.map +1 -1
  61. package/dist/src/ui/commands/extensionsCommand.js +2 -0
  62. package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
  63. package/dist/src/ui/commands/helpCommand.js +3 -1
  64. package/dist/src/ui/commands/helpCommand.js.map +1 -1
  65. package/dist/src/ui/commands/ideCommand.js +21 -23
  66. package/dist/src/ui/commands/ideCommand.js.map +1 -1
  67. package/dist/src/ui/commands/keyCommand.js +2 -0
  68. package/dist/src/ui/commands/keyCommand.js.map +1 -1
  69. package/dist/src/ui/commands/keyfileCommand.js +2 -0
  70. package/dist/src/ui/commands/keyfileCommand.js.map +1 -1
  71. package/dist/src/ui/commands/mcpCommand.js +181 -5
  72. package/dist/src/ui/commands/mcpCommand.js.map +1 -1
  73. package/dist/src/ui/commands/memoryCommand.js +11 -4
  74. package/dist/src/ui/commands/memoryCommand.js.map +1 -1
  75. package/dist/src/ui/commands/modelCommand.js +2 -0
  76. package/dist/src/ui/commands/modelCommand.js.map +1 -1
  77. package/dist/src/ui/commands/privacyCommand.js +2 -0
  78. package/dist/src/ui/commands/privacyCommand.js.map +1 -1
  79. package/dist/src/ui/commands/providerCommand.js +2 -0
  80. package/dist/src/ui/commands/providerCommand.js.map +1 -1
  81. package/dist/src/ui/commands/quitCommand.js +3 -1
  82. package/dist/src/ui/commands/quitCommand.js.map +1 -1
  83. package/dist/src/ui/commands/restoreCommand.js +2 -0
  84. package/dist/src/ui/commands/restoreCommand.js.map +1 -1
  85. package/dist/src/ui/commands/statsCommand.js +5 -1
  86. package/dist/src/ui/commands/statsCommand.js.map +1 -1
  87. package/dist/src/ui/commands/themeCommand.js +2 -0
  88. package/dist/src/ui/commands/themeCommand.js.map +1 -1
  89. package/dist/src/ui/commands/toolformatCommand.d.ts +7 -0
  90. package/dist/src/ui/commands/toolformatCommand.js +89 -0
  91. package/dist/src/ui/commands/toolformatCommand.js.map +1 -0
  92. package/dist/src/ui/commands/toolsCommand.js +2 -0
  93. package/dist/src/ui/commands/toolsCommand.js.map +1 -1
  94. package/dist/src/ui/commands/types.d.ts +30 -3
  95. package/dist/src/ui/commands/types.js +5 -1
  96. package/dist/src/ui/commands/types.js.map +1 -1
  97. package/dist/src/ui/commands/vimCommand.d.ts +7 -0
  98. package/dist/src/ui/commands/vimCommand.js +30 -0
  99. package/dist/src/ui/commands/vimCommand.js.map +1 -0
  100. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +3 -2
  101. package/dist/src/ui/components/ContextSummaryDisplay.js +10 -10
  102. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
  103. package/dist/src/ui/components/Footer.js +12 -1
  104. package/dist/src/ui/components/Footer.js.map +1 -1
  105. package/dist/src/ui/components/Help.d.ts +1 -1
  106. package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +11 -0
  107. package/dist/src/ui/components/IDEContextDetailDisplay.js +19 -0
  108. package/dist/src/ui/components/IDEContextDetailDisplay.js.map +1 -0
  109. package/dist/src/ui/components/InputPrompt.d.ts +1 -1
  110. package/dist/src/ui/components/InputPrompt.js +9 -99
  111. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  112. package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
  113. package/dist/src/ui/components/ThemeDialog.js +49 -18
  114. package/dist/src/ui/components/ThemeDialog.js.map +1 -1
  115. package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
  116. package/dist/src/ui/components/messages/DiffRenderer.d.ts +1 -0
  117. package/dist/src/ui/components/messages/DiffRenderer.js +12 -11
  118. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
  119. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +5 -4
  120. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
  121. package/dist/src/ui/components/shared/text-buffer.d.ts +3 -1
  122. package/dist/src/ui/components/shared/text-buffer.js +10 -9
  123. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  124. package/dist/src/ui/containers/SessionController.js +42 -31
  125. package/dist/src/ui/containers/SessionController.js.map +1 -1
  126. package/dist/src/ui/contexts/VimModeContext.d.ts +19 -0
  127. package/dist/src/ui/contexts/VimModeContext.js +51 -0
  128. package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
  129. package/dist/src/ui/hooks/atCommandProcessor.js +54 -15
  130. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  131. package/dist/src/ui/hooks/shellCommandProcessor.js +22 -8
  132. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
  133. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +2 -2
  134. package/dist/src/ui/hooks/slashCommandProcessor.js +43 -605
  135. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  136. package/dist/src/ui/hooks/useAuthCommand.js +2 -2
  137. package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
  138. package/dist/src/ui/hooks/useCompletion.d.ts +3 -1
  139. package/dist/src/ui/hooks/useCompletion.js +113 -24
  140. package/dist/src/ui/hooks/useCompletion.js.map +1 -1
  141. package/dist/src/ui/hooks/useGeminiStream.js +57 -11
  142. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  143. package/dist/src/ui/hooks/useInputHistory.d.ts +1 -1
  144. package/dist/src/ui/hooks/usePhraseCycler.js +27 -131
  145. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
  146. package/dist/src/ui/hooks/useShellHistory.d.ts +3 -2
  147. package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
  148. package/dist/src/ui/hooks/useThemeCommand.js +22 -2
  149. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
  150. package/dist/src/ui/privacy/PrivacyNotice.js +16 -2
  151. package/dist/src/ui/privacy/PrivacyNotice.js.map +1 -1
  152. package/dist/src/ui/themes/ansi-light.js +2 -0
  153. package/dist/src/ui/themes/ansi-light.js.map +1 -1
  154. package/dist/src/ui/themes/ansi.js +2 -0
  155. package/dist/src/ui/themes/ansi.js.map +1 -1
  156. package/dist/src/ui/themes/atom-one-dark.js +2 -0
  157. package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
  158. package/dist/src/ui/themes/ayu-light.js +3 -1
  159. package/dist/src/ui/themes/ayu-light.js.map +1 -1
  160. package/dist/src/ui/themes/ayu.js +3 -1
  161. package/dist/src/ui/themes/ayu.js.map +1 -1
  162. package/dist/src/ui/themes/color-utils.d.ts +21 -0
  163. package/dist/src/ui/themes/color-utils.js +221 -0
  164. package/dist/src/ui/themes/color-utils.js.map +1 -0
  165. package/dist/src/ui/themes/dracula.js +2 -0
  166. package/dist/src/ui/themes/dracula.js.map +1 -1
  167. package/dist/src/ui/themes/github-dark.js +2 -0
  168. package/dist/src/ui/themes/github-dark.js.map +1 -1
  169. package/dist/src/ui/themes/github-light.js +2 -0
  170. package/dist/src/ui/themes/github-light.js.map +1 -1
  171. package/dist/src/ui/themes/googlecode.js +2 -0
  172. package/dist/src/ui/themes/googlecode.js.map +1 -1
  173. package/dist/src/ui/themes/green-screen.js +2 -0
  174. package/dist/src/ui/themes/green-screen.js.map +1 -1
  175. package/dist/src/ui/themes/no-color.js +3 -1
  176. package/dist/src/ui/themes/no-color.js.map +1 -1
  177. package/dist/src/ui/themes/shades-of-purple.d.ts +1 -1
  178. package/dist/src/ui/themes/shades-of-purple.js +3 -1
  179. package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
  180. package/dist/src/ui/themes/theme-manager.d.ts +31 -6
  181. package/dist/src/ui/themes/theme-manager.js +104 -34
  182. package/dist/src/ui/themes/theme-manager.js.map +1 -1
  183. package/dist/src/ui/themes/theme.d.ts +22 -3
  184. package/dist/src/ui/themes/theme.js +229 -182
  185. package/dist/src/ui/themes/theme.js.map +1 -1
  186. package/dist/src/ui/themes/xcode.js +2 -0
  187. package/dist/src/ui/themes/xcode.js.map +1 -1
  188. package/dist/src/ui/types.d.ts +9 -1
  189. package/dist/src/ui/utils/CodeColorizer.d.ts +3 -1
  190. package/dist/src/ui/utils/CodeColorizer.js +23 -11
  191. package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
  192. package/dist/src/ui/utils/commandUtils.d.ts +1 -0
  193. package/dist/src/ui/utils/commandUtils.js +47 -0
  194. package/dist/src/ui/utils/commandUtils.js.map +1 -1
  195. package/dist/src/ui/utils/markdownUtilities.js +1 -1
  196. package/dist/src/utils/sandbox.js +19 -19
  197. package/dist/src/utils/sandbox.js.map +1 -1
  198. package/dist/src/utils/userStartupWarnings.js +22 -1
  199. package/dist/src/utils/userStartupWarnings.js.map +1 -1
  200. package/dist/src/validateNonInterActiveAuth.d.ts +7 -0
  201. package/dist/src/validateNonInterActiveAuth.js +61 -0
  202. package/dist/src/validateNonInterActiveAuth.js.map +1 -0
  203. package/dist/tsconfig.tsbuildinfo +1 -1
  204. package/package.json +7 -5
@@ -3,6 +3,7 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import { isValidColor, resolveColor } from './color-utils.js';
6
7
  export const lightTheme = {
7
8
  type: 'light',
8
9
  Background: '#FAFAFA',
@@ -14,8 +15,10 @@ export const lightTheme = {
14
15
  AccentGreen: '#3CA84B',
15
16
  AccentYellow: '#D5A40A',
16
17
  AccentRed: '#DD4C4C',
18
+ DiffAdded: '#C6EAD8',
19
+ DiffRemoved: '#FFCCCC',
17
20
  Comment: '#008000',
18
- Gray: '#B7BECC',
21
+ Gray: '#97a0b0',
19
22
  GradientColors: ['#4796E4', '#847ACE', '#C3677F'],
20
23
  };
21
24
  export const darkTheme = {
@@ -29,6 +32,8 @@ export const darkTheme = {
29
32
  AccentGreen: '#A6E3A1',
30
33
  AccentYellow: '#F9E2AF',
31
34
  AccentRed: '#F38BA8',
35
+ DiffAdded: '#28350B',
36
+ DiffRemoved: '#430000',
32
37
  Comment: '#6C7086',
33
38
  Gray: '#6C7086',
34
39
  GradientColors: ['#4796E4', '#847ACE', '#C3677F'],
@@ -44,6 +49,8 @@ export const ansiTheme = {
44
49
  AccentGreen: 'green',
45
50
  AccentYellow: 'yellow',
46
51
  AccentRed: 'red',
52
+ DiffAdded: 'green',
53
+ DiffRemoved: 'red',
47
54
  Comment: 'gray',
48
55
  Gray: 'gray',
49
56
  };
@@ -61,170 +68,6 @@ export class Theme {
61
68
  * to Ink-compatible color strings (hex or name).
62
69
  */
63
70
  _colorMap;
64
- // --- Static Helper Data ---
65
- // Mapping from common CSS color names (lowercase) to hex codes (lowercase)
66
- // Excludes names directly supported by Ink
67
- static cssNameToHexMap = {
68
- aliceblue: '#f0f8ff',
69
- antiquewhite: '#faebd7',
70
- aqua: '#00ffff',
71
- aquamarine: '#7fffd4',
72
- azure: '#f0ffff',
73
- beige: '#f5f5dc',
74
- bisque: '#ffe4c4',
75
- blanchedalmond: '#ffebcd',
76
- blueviolet: '#8a2be2',
77
- brown: '#a52a2a',
78
- burlywood: '#deb887',
79
- cadetblue: '#5f9ea0',
80
- chartreuse: '#7fff00',
81
- chocolate: '#d2691e',
82
- coral: '#ff7f50',
83
- cornflowerblue: '#6495ed',
84
- cornsilk: '#fff8dc',
85
- crimson: '#dc143c',
86
- darkblue: '#00008b',
87
- darkcyan: '#008b8b',
88
- darkgoldenrod: '#b8860b',
89
- darkgray: '#a9a9a9',
90
- darkgrey: '#a9a9a9',
91
- darkgreen: '#006400',
92
- darkkhaki: '#bdb76b',
93
- darkmagenta: '#8b008b',
94
- darkolivegreen: '#556b2f',
95
- darkorange: '#ff8c00',
96
- darkorchid: '#9932cc',
97
- darkred: '#8b0000',
98
- darksalmon: '#e9967a',
99
- darkseagreen: '#8fbc8f',
100
- darkslateblue: '#483d8b',
101
- darkslategray: '#2f4f4f',
102
- darkslategrey: '#2f4f4f',
103
- darkturquoise: '#00ced1',
104
- darkviolet: '#9400d3',
105
- deeppink: '#ff1493',
106
- deepskyblue: '#00bfff',
107
- dimgray: '#696969',
108
- dimgrey: '#696969',
109
- dodgerblue: '#1e90ff',
110
- firebrick: '#b22222',
111
- floralwhite: '#fffaf0',
112
- forestgreen: '#228b22',
113
- fuchsia: '#ff00ff',
114
- gainsboro: '#dcdcdc',
115
- ghostwhite: '#f8f8ff',
116
- gold: '#ffd700',
117
- goldenrod: '#daa520',
118
- greenyellow: '#adff2f',
119
- honeydew: '#f0fff0',
120
- hotpink: '#ff69b4',
121
- indianred: '#cd5c5c',
122
- indigo: '#4b0082',
123
- ivory: '#fffff0',
124
- khaki: '#f0e68c',
125
- lavender: '#e6e6fa',
126
- lavenderblush: '#fff0f5',
127
- lawngreen: '#7cfc00',
128
- lemonchiffon: '#fffacd',
129
- lightblue: '#add8e6',
130
- lightcoral: '#f08080',
131
- lightcyan: '#e0ffff',
132
- lightgoldenrodyellow: '#fafad2',
133
- lightgray: '#d3d3d3',
134
- lightgrey: '#d3d3d3',
135
- lightgreen: '#90ee90',
136
- lightpink: '#ffb6c1',
137
- lightsalmon: '#ffa07a',
138
- lightseagreen: '#20b2aa',
139
- lightskyblue: '#87cefa',
140
- lightslategray: '#778899',
141
- lightslategrey: '#778899',
142
- lightsteelblue: '#b0c4de',
143
- lightyellow: '#ffffe0',
144
- lime: '#00ff00',
145
- limegreen: '#32cd32',
146
- linen: '#faf0e6',
147
- maroon: '#800000',
148
- mediumaquamarine: '#66cdaa',
149
- mediumblue: '#0000cd',
150
- mediumorchid: '#ba55d3',
151
- mediumpurple: '#9370db',
152
- mediumseagreen: '#3cb371',
153
- mediumslateblue: '#7b68ee',
154
- mediumspringgreen: '#00fa9a',
155
- mediumturquoise: '#48d1cc',
156
- mediumvioletred: '#c71585',
157
- midnightblue: '#191970',
158
- mintcream: '#f5fffa',
159
- mistyrose: '#ffe4e1',
160
- moccasin: '#ffe4b5',
161
- navajowhite: '#ffdead',
162
- navy: '#000080',
163
- oldlace: '#fdf5e6',
164
- olive: '#808000',
165
- olivedrab: '#6b8e23',
166
- orange: '#ffa500',
167
- orangered: '#ff4500',
168
- orchid: '#da70d6',
169
- palegoldenrod: '#eee8aa',
170
- palegreen: '#98fb98',
171
- paleturquoise: '#afeeee',
172
- palevioletred: '#db7093',
173
- papayawhip: '#ffefd5',
174
- peachpuff: '#ffdab9',
175
- peru: '#cd853f',
176
- pink: '#ffc0cb',
177
- plum: '#dda0dd',
178
- powderblue: '#b0e0e6',
179
- purple: '#800080',
180
- rebeccapurple: '#663399',
181
- rosybrown: '#bc8f8f',
182
- royalblue: '#4169e1',
183
- saddlebrown: '#8b4513',
184
- salmon: '#fa8072',
185
- sandybrown: '#f4a460',
186
- seagreen: '#2e8b57',
187
- seashell: '#fff5ee',
188
- sienna: '#a0522d',
189
- silver: '#c0c0c0',
190
- skyblue: '#87ceeb',
191
- slateblue: '#6a5acd',
192
- slategray: '#708090',
193
- slategrey: '#708090',
194
- snow: '#fffafa',
195
- springgreen: '#00ff7f',
196
- steelblue: '#4682b4',
197
- tan: '#d2b48c',
198
- teal: '#008080',
199
- thistle: '#d8bfd8',
200
- tomato: '#ff6347',
201
- turquoise: '#40e0d0',
202
- violet: '#ee82ee',
203
- wheat: '#f5deb3',
204
- whitesmoke: '#f5f5f5',
205
- yellowgreen: '#9acd32',
206
- };
207
- // Define the set of Ink's named colors for quick lookup
208
- static inkSupportedNames = new Set([
209
- 'black',
210
- 'red',
211
- 'green',
212
- 'yellow',
213
- 'blue',
214
- 'cyan',
215
- 'magenta',
216
- 'white',
217
- 'gray',
218
- 'grey',
219
- 'blackbright',
220
- 'redbright',
221
- 'greenbright',
222
- 'yellowbright',
223
- 'bluebright',
224
- 'cyanbright',
225
- 'magentabright',
226
- 'whitebright',
227
- ]);
228
71
  /**
229
72
  * Creates a new Theme instance.
230
73
  * @param name The name of the theme.
@@ -255,22 +98,7 @@ export class Theme {
255
98
  * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable.
256
99
  */
257
100
  static _resolveColor(colorValue) {
258
- const lowerColor = colorValue.toLowerCase();
259
- // 1. Check if it's already a hex code
260
- if (lowerColor.startsWith('#')) {
261
- return lowerColor; // Use hex directly
262
- }
263
- // 2. Check if it's an Ink supported name (lowercase)
264
- else if (Theme.inkSupportedNames.has(lowerColor)) {
265
- return lowerColor; // Use Ink name directly
266
- }
267
- // 3. Check if it's a known CSS name we can map to hex
268
- else if (Theme.cssNameToHexMap[lowerColor]) {
269
- return Theme.cssNameToHexMap[lowerColor]; // Use mapped hex
270
- }
271
- // 4. Could not resolve
272
- console.warn(`[Theme] Could not resolve color "${colorValue}" to an Ink-compatible format.`);
273
- return undefined;
101
+ return resolveColor(colorValue);
274
102
  }
275
103
  /**
276
104
  * Builds the internal map from highlight.js class names to Ink-compatible color strings.
@@ -293,7 +121,7 @@ export class Theme {
293
121
  inkTheme[key] = resolvedColor;
294
122
  }
295
123
  // If color is not resolvable, it's omitted from the map,
296
- // allowing fallback to the default foreground color.
124
+ // this enables falling back to the default foreground color.
297
125
  }
298
126
  // We currently only care about the 'color' property for Ink rendering.
299
127
  // Other properties like background, fontStyle, etc., are ignored.
@@ -301,4 +129,223 @@ export class Theme {
301
129
  return inkTheme;
302
130
  }
303
131
  }
132
+ /**
133
+ * Creates a Theme instance from a custom theme configuration.
134
+ * @param customTheme The custom theme configuration.
135
+ * @returns A new Theme instance.
136
+ */
137
+ export function createCustomTheme(customTheme) {
138
+ // Generate CSS properties mappings based on the custom theme colors
139
+ const rawMappings = {
140
+ hljs: {
141
+ display: 'block',
142
+ overflowX: 'auto',
143
+ padding: '0.5em',
144
+ background: customTheme.Background,
145
+ color: customTheme.Foreground,
146
+ },
147
+ 'hljs-keyword': {
148
+ color: customTheme.AccentBlue,
149
+ },
150
+ 'hljs-literal': {
151
+ color: customTheme.AccentBlue,
152
+ },
153
+ 'hljs-symbol': {
154
+ color: customTheme.AccentBlue,
155
+ },
156
+ 'hljs-name': {
157
+ color: customTheme.AccentBlue,
158
+ },
159
+ 'hljs-link': {
160
+ color: customTheme.AccentBlue,
161
+ textDecoration: 'underline',
162
+ },
163
+ 'hljs-built_in': {
164
+ color: customTheme.AccentCyan,
165
+ },
166
+ 'hljs-type': {
167
+ color: customTheme.AccentCyan,
168
+ },
169
+ 'hljs-number': {
170
+ color: customTheme.AccentGreen,
171
+ },
172
+ 'hljs-class': {
173
+ color: customTheme.AccentGreen,
174
+ },
175
+ 'hljs-string': {
176
+ color: customTheme.AccentYellow,
177
+ },
178
+ 'hljs-meta-string': {
179
+ color: customTheme.AccentYellow,
180
+ },
181
+ 'hljs-regexp': {
182
+ color: customTheme.AccentRed,
183
+ },
184
+ 'hljs-template-tag': {
185
+ color: customTheme.AccentRed,
186
+ },
187
+ 'hljs-subst': {
188
+ color: customTheme.Foreground,
189
+ },
190
+ 'hljs-function': {
191
+ color: customTheme.Foreground,
192
+ },
193
+ 'hljs-title': {
194
+ color: customTheme.Foreground,
195
+ },
196
+ 'hljs-params': {
197
+ color: customTheme.Foreground,
198
+ },
199
+ 'hljs-formula': {
200
+ color: customTheme.Foreground,
201
+ },
202
+ 'hljs-comment': {
203
+ color: customTheme.Comment,
204
+ fontStyle: 'italic',
205
+ },
206
+ 'hljs-quote': {
207
+ color: customTheme.Comment,
208
+ fontStyle: 'italic',
209
+ },
210
+ 'hljs-doctag': {
211
+ color: customTheme.Comment,
212
+ },
213
+ 'hljs-meta': {
214
+ color: customTheme.Gray,
215
+ },
216
+ 'hljs-meta-keyword': {
217
+ color: customTheme.Gray,
218
+ },
219
+ 'hljs-tag': {
220
+ color: customTheme.Gray,
221
+ },
222
+ 'hljs-variable': {
223
+ color: customTheme.AccentPurple,
224
+ },
225
+ 'hljs-template-variable': {
226
+ color: customTheme.AccentPurple,
227
+ },
228
+ 'hljs-attr': {
229
+ color: customTheme.LightBlue,
230
+ },
231
+ 'hljs-attribute': {
232
+ color: customTheme.LightBlue,
233
+ },
234
+ 'hljs-builtin-name': {
235
+ color: customTheme.LightBlue,
236
+ },
237
+ 'hljs-section': {
238
+ color: customTheme.AccentYellow,
239
+ },
240
+ 'hljs-emphasis': {
241
+ fontStyle: 'italic',
242
+ },
243
+ 'hljs-strong': {
244
+ fontWeight: 'bold',
245
+ },
246
+ 'hljs-bullet': {
247
+ color: customTheme.AccentYellow,
248
+ },
249
+ 'hljs-selector-tag': {
250
+ color: customTheme.AccentYellow,
251
+ },
252
+ 'hljs-selector-id': {
253
+ color: customTheme.AccentYellow,
254
+ },
255
+ 'hljs-selector-class': {
256
+ color: customTheme.AccentYellow,
257
+ },
258
+ 'hljs-selector-attr': {
259
+ color: customTheme.AccentYellow,
260
+ },
261
+ 'hljs-selector-pseudo': {
262
+ color: customTheme.AccentYellow,
263
+ },
264
+ 'hljs-addition': {
265
+ backgroundColor: customTheme.AccentGreen,
266
+ display: 'inline-block',
267
+ width: '100%',
268
+ },
269
+ 'hljs-deletion': {
270
+ backgroundColor: customTheme.AccentRed,
271
+ display: 'inline-block',
272
+ width: '100%',
273
+ },
274
+ };
275
+ return new Theme(customTheme.name, 'custom', rawMappings, customTheme);
276
+ }
277
+ /**
278
+ * Validates a custom theme configuration.
279
+ * @param customTheme The custom theme to validate.
280
+ * @returns An object with isValid boolean and error message if invalid.
281
+ */
282
+ export function validateCustomTheme(customTheme) {
283
+ // Check required fields
284
+ const requiredFields = [
285
+ 'name',
286
+ 'Background',
287
+ 'Foreground',
288
+ 'LightBlue',
289
+ 'AccentBlue',
290
+ 'AccentPurple',
291
+ 'AccentCyan',
292
+ 'AccentGreen',
293
+ 'AccentYellow',
294
+ 'AccentRed',
295
+ 'DiffAdded',
296
+ 'DiffRemoved',
297
+ 'Comment',
298
+ 'Gray',
299
+ ];
300
+ for (const field of requiredFields) {
301
+ if (!customTheme[field]) {
302
+ return {
303
+ isValid: false,
304
+ error: `Missing required field: ${field}`,
305
+ };
306
+ }
307
+ }
308
+ // Validate color format (basic hex validation)
309
+ const colorFields = [
310
+ 'Background',
311
+ 'Foreground',
312
+ 'LightBlue',
313
+ 'AccentBlue',
314
+ 'AccentPurple',
315
+ 'AccentCyan',
316
+ 'AccentGreen',
317
+ 'AccentYellow',
318
+ 'AccentRed',
319
+ 'DiffAdded',
320
+ 'DiffRemoved',
321
+ 'Comment',
322
+ 'Gray',
323
+ ];
324
+ for (const field of colorFields) {
325
+ const color = customTheme[field];
326
+ if (!isValidColor(color)) {
327
+ return {
328
+ isValid: false,
329
+ error: `Invalid color format for ${field}: ${color}`,
330
+ };
331
+ }
332
+ }
333
+ // Validate theme name
334
+ if (customTheme.name && !isValidThemeName(customTheme.name)) {
335
+ return {
336
+ isValid: false,
337
+ error: `Invalid theme name: ${customTheme.name}`,
338
+ };
339
+ }
340
+ return { isValid: true };
341
+ }
342
+ /**
343
+ * Checks if a theme name is valid.
344
+ * @param name The theme name to validate.
345
+ * @returns True if the theme name is valid.
346
+ */
347
+ function isValidThemeName(name) {
348
+ // Theme name should be non-empty and not contain invalid characters
349
+ return name.trim().length > 0 && name.trim().length <= 50;
350
+ }
304
351
  //# sourceMappingURL=theme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../../src/ui/themes/theme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuCH,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,cAAc,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;CAClD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAgB;IACpC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,cAAc,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;CAClD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAgB;IACpC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,OAAO;IACnB,UAAU,EAAE,OAAO;IACnB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,MAAM;IAClB,YAAY,EAAE,SAAS;IACvB,UAAU,EAAE,MAAM;IAClB,W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,WAAW,GAA6B;QAC5C,YAAY;QACZ,YAAY;QACZ,WAAW;QACX,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,aAAa;QACb,cAAc;QACd,WAAW;QACX,WAAW;QACX,aAAa;QACb,SAAS;QACT,MAAM;KACP,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QAChC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAW,CAAC;QAC3C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,4BAA4B,KAAK,KAAK,KAAK,EAAE;aACrD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,sBAAsB;IACtB,IAAI,WAAW,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5D,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,uBAAuB,WAAW,CAAC,IAAI,EAAE;SACjD,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,IAAY;IACpC,oEAAoE;IACpE,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC;AAC5D,CAAC"}
@@ -15,6 +15,8 @@ const xcodeColors = {
15
15
  AccentGreen: '#007400',
16
16
  AccentYellow: '#836C28',
17
17
  AccentRed: '#c41a16',
18
+ DiffAdded: '#C6EAD8',
19
+ DiffRemoved: '#FEDEDE',
18
20
  Comment: '#007400',
19
21
  Gray: '#c0c0c0',
20
22
  GradientColors: ['#1c00cf', '#007400'],
@@ -1 +1 @@
1
- {"version":3,"file":"xcode.js","sourceRoot":"","sources":["../../../../src/ui/themes/xcode.ts"],"names":[],"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E,QAAQ;KACpB;IACD,eAAe,EAAE;QACf,eAAe,EAAE,SAAS;KAC3B;IACD,eAAe,EAAE;QACf,eAAe,EAAE,SAAS;KAC3B;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,qBAAqB,EAAE;QACrB,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,aAAa,EAAE;QACb,UAAU,EAAE,MAAM;KACnB;IACD,aAAa,EAAE;QACb,UAAU,EAAE,MAAM;KACnB;IACD,eAAe,EAAE;QACf,SAAS,EAAE,QAAQ;KACpB;CACF,EACD,WAAW,CACZ,CAAC"}
1
+ {"version":3,"file":"xcode.js","sourceRoot":"","sources":["../../../../src/ui/themes/xcode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAoB,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,GAAgB;IAC/B,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,cAAc,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU,IAAI,KAAK,CACnC,OAAO,EACP,OAAO,EACP;IACE,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,MAAM;QACjB,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,WAAW,CAAC,UAAU;QAClC,KAAK,EAAE,WAAW,CAAC,UAAU;KAC9B;IACD,gBAAgB,EAAE;QAChB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AW,EAAE;QACX,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,wBAAwB,EAAE;QACxB,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,eAAe,EAAE;QACf,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,mBAAmB,EAAE;QACnB,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,aAAa,EAAE;QACb,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,WAAW,CAAC,UAAU;KAC9B;IACD,cAAc,EAAE;QACd,eAAe,EAAE,MAAM;QACvB,SAAS,EAAE,QAAQ;KACpB;IACD,eAAe,EAAE;QACf,eAAe,EAAE,SAAS;KAC3B;IACD,eAAe,EAAE;QACf,eAAe,EAAE,SAAS;KAC3B;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,qBAAqB,EAAE;QACrB,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,aAAa,EAAE;QACb,UAAU,EAAE,MAAM;KACnB;IACD,aAAa,EAAE;QACb,UAAU,EAAE,MAAM;KACnB;IACD,eAAe,EAAE;QACf,SAAS,EAAE,QAAQ;KACpB;CACF,EACD,WAAW,CACZ,CAAC"}
@@ -172,6 +172,14 @@ export interface ConsoleMessageItem {
172
172
  content: string;
173
173
  count: number;
174
174
  }
175
+ /**
176
+ * Result type for a slash command that should immediately result in a prompt
177
+ * being submitted to the Gemini model.
178
+ */
179
+ export interface SubmitPromptResult {
180
+ type: 'submit_prompt';
181
+ content: string;
182
+ }
175
183
  /**
176
184
  * Defines the result of the slash command processor for its consumer (useGeminiStream).
177
185
  */
@@ -181,4 +189,4 @@ export type SlashCommandProcessorResult = {
181
189
  toolArgs: Record<string, unknown>;
182
190
  } | {
183
191
  type: 'handled';
184
- };
192
+ } | SubmitPromptResult;
@@ -4,6 +4,8 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import React from 'react';
7
+ import { Theme } from '../themes/theme.js';
8
+ export declare function colorizeLine(line: string, language: string | null, theme?: Theme): React.ReactNode;
7
9
  /**
8
10
  * Renders syntax-highlighted code for Ink applications using a selected theme.
9
11
  *
@@ -11,4 +13,4 @@ import React from 'react';
11
13
  * @param language The language identifier (e.g., 'javascript', 'css', 'html')
12
14
  * @returns A React.ReactNode containing Ink <Text> elements for the highlighted code.
13
15
  */
14
- export declare function colorizeCode(code: string, language: string | null, availableHeight?: number, maxWidth?: number): React.ReactNode;
16
+ export declare function colorizeCode(code: string, language: string | null, availableHeight?: number, maxWidth?: number, theme?: Theme): React.ReactNode;
@@ -29,7 +29,7 @@ function renderHastNode(node, theme, inheritedColor) {
29
29
  }
30
30
  }
31
31
  // Determine the color to pass down: Use this element's specific color
32
- // if found, otherwise, continue passing down the already inherited color.
32
+ // if found; otherwise, continue passing down the already inherited color.
33
33
  const colorToPassDown = elementColor || inheritedColor;
34
34
  // Recursively render children, passing the determined color down
35
35
  // Ensure child type matches expected HAST structure (ElementContent is common)
@@ -38,9 +38,9 @@ function renderHastNode(node, theme, inheritedColor) {
38
38
  // Use a React Fragment to avoid adding unnecessary elements.
39
39
  return _jsx(React.Fragment, { children: children });
40
40
  }
41
- // Handle Root Node: Start recursion with initial inherited color
41
+ // Handle Root Node: Start recursion with initially inherited color
42
42
  if (node.type === 'root') {
43
- // Check if children array is empty - this happens when lowlight can't detect language – fallback to plain text
43
+ // Check if children array is empty - this happens when lowlight can't detect language – fall back to plain text
44
44
  if (!node.children || node.children.length === 0) {
45
45
  return null;
46
46
  }
@@ -51,6 +51,22 @@ function renderHastNode(node, theme, inheritedColor) {
51
51
  // Handle unknown or unsupported node types
52
52
  return null;
53
53
  }
54
+ function highlightAndRenderLine(line, language, theme) {
55
+ try {
56
+ const getHighlightedLine = () => !language || !lowlight.registered(language)
57
+ ? lowlight.highlightAuto(line)
58
+ : lowlight.highlight(language, line);
59
+ const renderedNode = renderHastNode(getHighlightedLine(), theme, undefined);
60
+ return renderedNode !== null ? renderedNode : line;
61
+ }
62
+ catch (_error) {
63
+ return line;
64
+ }
65
+ }
66
+ export function colorizeLine(line, language, theme) {
67
+ const activeTheme = theme || themeManager.getActiveTheme();
68
+ return highlightAndRenderLine(line, language, activeTheme);
69
+ }
54
70
  /**
55
71
  * Renders syntax-highlighted code for Ink applications using a selected theme.
56
72
  *
@@ -58,9 +74,9 @@ function renderHastNode(node, theme, inheritedColor) {
58
74
  * @param language The language identifier (e.g., 'javascript', 'css', 'html')
59
75
  * @returns A React.ReactNode containing Ink <Text> elements for the highlighted code.
60
76
  */
61
- export function colorizeCode(code, language, availableHeight, maxWidth) {
77
+ export function colorizeCode(code, language, availableHeight, maxWidth, theme) {
62
78
  const codeToHighlight = code.replace(/\n$/, '');
63
- const activeTheme = themeManager.getActiveTheme();
79
+ const activeTheme = theme || themeManager.getActiveTheme();
64
80
  try {
65
81
  // Render the HAST tree using the adapted theme
66
82
  // Apply the theme's default foreground color to the top-level Text element
@@ -76,18 +92,14 @@ export function colorizeCode(code, language, availableHeight, maxWidth) {
76
92
  lines = lines.slice(sliceIndex);
77
93
  }
78
94
  }
79
- const getHighlightedLines = (line) => !language || !lowlight.registered(language)
80
- ? lowlight.highlightAuto(line)
81
- : lowlight.highlight(language, line);
82
95
  return (_jsx(MaxSizedBox, { maxHeight: availableHeight, maxWidth: maxWidth, additionalHiddenLinesCount: hiddenLinesCount, overflowDirection: "top", children: lines.map((line, index) => {
83
- const renderedNode = renderHastNode(getHighlightedLines(line), activeTheme, undefined);
84
- const contentToRender = renderedNode !== null ? renderedNode : line;
96
+ const contentToRender = highlightAndRenderLine(line, language, activeTheme);
85
97
  return (_jsxs(Box, { children: [_jsx(Text, { color: activeTheme.colors.Gray, children: `${String(index + 1 + hiddenLinesCount).padStart(padWidth, ' ')} ` }), _jsx(Text, { color: activeTheme.defaultColor, wrap: "wrap", children: contentToRender })] }, index));
86
98
  }) }));
87
99
  }
88
100
  catch (error) {
89
101
  console.error(`[colorizeCode] Error highlighting code for language "${language}":`, error);
90
- // Fallback to plain text with default color on error
102
+ // Fall back to plain text with default color on error
91
103
  // Also display line numbers in fallback
92
104
  const lines = codeToHighlight.split('\n');
93
105
  const padWidth = String(lines.length).length; // Calculate padding width based on number of lines