@vybestack/llxprt-code 0.1.13-nightly.250727.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
@@ -15,6 +15,7 @@ import { DefaultLight } from './default-light.js';
15
15
  import { DefaultDark } from './default.js';
16
16
  import { ShadesOfPurple } from './shades-of-purple.js';
17
17
  import { XCode } from './xcode.js';
18
+ import { createCustomTheme, validateCustomTheme, } from './theme.js';
18
19
  import { ANSI } from './ansi.js';
19
20
  import { ANSILight } from './ansi-light.js';
20
21
  import { NoColorTheme } from './no-color.js';
@@ -23,6 +24,7 @@ export const DEFAULT_THEME = GreenScreen;
23
24
  class ThemeManager {
24
25
  availableThemes;
25
26
  activeTheme;
27
+ customThemes = new Map();
26
28
  constructor() {
27
29
  this.availableThemes = [
28
30
  AyuDark,
@@ -42,19 +44,107 @@ class ThemeManager {
42
44
  ];
43
45
  this.activeTheme = DEFAULT_THEME;
44
46
  }
47
+ /**
48
+ * Loads custom themes from settings.
49
+ * @param customThemesSettings Custom themes from settings.
50
+ */
51
+ loadCustomThemes(customThemesSettings) {
52
+ this.customThemes.clear();
53
+ if (!customThemesSettings) {
54
+ return;
55
+ }
56
+ for (const [name, customThemeConfig] of Object.entries(customThemesSettings)) {
57
+ const validation = validateCustomTheme(customThemeConfig);
58
+ if (validation.isValid) {
59
+ try {
60
+ const theme = createCustomTheme(customThemeConfig);
61
+ this.customThemes.set(name, theme);
62
+ }
63
+ catch (error) {
64
+ console.warn(`Failed to load custom theme "${name}":`, error);
65
+ }
66
+ }
67
+ else {
68
+ console.warn(`Invalid custom theme "${name}": ${validation.error}`);
69
+ }
70
+ }
71
+ // If the current active theme is a custom theme, keep it if still valid
72
+ if (this.activeTheme &&
73
+ this.activeTheme.type === 'custom' &&
74
+ this.customThemes.has(this.activeTheme.name)) {
75
+ this.activeTheme = this.customThemes.get(this.activeTheme.name);
76
+ }
77
+ }
78
+ /**
79
+ * Sets the active theme.
80
+ * @param themeName The name of the theme to set as active.
81
+ * @returns True if the theme was successfully set, false otherwise.
82
+ */
83
+ setActiveTheme(themeName) {
84
+ const theme = this.findThemeByName(themeName);
85
+ if (!theme) {
86
+ return false;
87
+ }
88
+ this.activeTheme = theme;
89
+ return true;
90
+ }
91
+ /**
92
+ * Gets the currently active theme.
93
+ * @returns The active theme.
94
+ */
95
+ getActiveTheme() {
96
+ if (process.env.NO_COLOR) {
97
+ return NoColorTheme;
98
+ }
99
+ // Ensure the active theme is always valid (fall back to default if not)
100
+ if (!this.activeTheme || !this.findThemeByName(this.activeTheme.name)) {
101
+ this.activeTheme = DEFAULT_THEME;
102
+ }
103
+ return this.activeTheme;
104
+ }
105
+ /**
106
+ * Gets a list of custom theme names.
107
+ * @returns Array of custom theme names.
108
+ */
109
+ getCustomThemeNames() {
110
+ return Array.from(this.customThemes.keys());
111
+ }
112
+ /**
113
+ * Checks if a theme name is a custom theme.
114
+ * @param themeName The theme name to check.
115
+ * @returns True if the theme is custom.
116
+ */
117
+ isCustomTheme(themeName) {
118
+ return this.customThemes.has(themeName);
119
+ }
45
120
  /**
46
121
  * Returns a list of available theme names.
47
122
  */
48
123
  getAvailableThemes() {
49
- const sortedThemes = [...this.availableThemes].sort((a, b) => {
124
+ const builtInThemes = this.availableThemes.map((theme) => ({
125
+ name: theme.name,
126
+ type: theme.type,
127
+ isCustom: false,
128
+ }));
129
+ const customThemes = Array.from(this.customThemes.values()).map((theme) => ({
130
+ name: theme.name,
131
+ type: theme.type,
132
+ isCustom: true,
133
+ }));
134
+ const allThemes = [...builtInThemes, ...customThemes];
135
+ const sortedThemes = allThemes.sort((a, b) => {
50
136
  const typeOrder = (type) => {
51
137
  switch (type) {
52
138
  case 'dark':
53
139
  return 1;
54
140
  case 'light':
55
141
  return 2;
56
- default:
142
+ case 'ansi':
57
143
  return 3;
144
+ case 'custom':
145
+ return 4; // Custom themes at the end
146
+ default:
147
+ return 5;
58
148
  }
59
149
  };
60
150
  const typeComparison = typeOrder(a.type) - typeOrder(b.type);
@@ -63,47 +153,27 @@ class ThemeManager {
63
153
  }
64
154
  return a.name.localeCompare(b.name);
65
155
  });
66
- return sortedThemes.map((theme) => ({
67
- name: theme.name,
68
- type: theme.type,
69
- }));
156
+ return sortedThemes;
70
157
  }
71
158
  /**
72
- * Sets the active theme.
73
- * @param themeName The name of the theme to activate.
74
- * @returns True if the theme was successfully set, false otherwise.
159
+ * Gets a theme by name.
160
+ * @param themeName The name of the theme to get.
161
+ * @returns The theme if found, undefined otherwise.
75
162
  */
76
- setActiveTheme(themeName) {
77
- const foundTheme = this.findThemeByName(themeName);
78
- if (foundTheme) {
79
- this.activeTheme = foundTheme;
80
- return true;
81
- }
82
- else {
83
- // If themeName is undefined, it means we want to set the default theme.
84
- // If findThemeByName returns undefined (e.g. default theme is also not found for some reason)
85
- // then this will return false.
86
- if (themeName === undefined) {
87
- this.activeTheme = DEFAULT_THEME;
88
- return true;
89
- }
90
- return false;
91
- }
163
+ getTheme(themeName) {
164
+ return this.findThemeByName(themeName);
92
165
  }
93
166
  findThemeByName(themeName) {
94
167
  if (!themeName) {
95
168
  return DEFAULT_THEME;
96
169
  }
97
- return this.availableThemes.find((theme) => theme.name === themeName);
98
- }
99
- /**
100
- * Returns the currently active theme object.
101
- */
102
- getActiveTheme() {
103
- if (process.env.NO_COLOR) {
104
- return NoColorTheme;
170
+ // First check built-in themes
171
+ const builtInTheme = this.availableThemes.find((theme) => theme.name === themeName);
172
+ if (builtInTheme) {
173
+ return builtInTheme;
105
174
  }
106
- return this.activeTheme;
175
+ // Then check custom themes
176
+ return this.customThemes.get(themeName);
107
177
  }
108
178
  }
109
179
  // Export an instance of the ThemeManager
@@ -1 +1 @@
1
- {"version":3,"file":"theme-manager.js","sourceRoot":"","sources":["../../../../src/ui/themes/theme-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,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,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,SAAiB;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,eAAe,CAAC,SAA6B;QAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,aAAa,CAAC;QACvB,CAAC;QAED,8BAA8B;QAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAC5C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CACpC,CAAC;QACF,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,2BAA2B;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;CACF;AAED,yCAAyC;AACzC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC"}
@@ -19,7 +19,7 @@ interface HighlightJSStyle {
19
19
  padding?: string;
20
20
  [key: string]: string | undefined;
21
21
  }
22
- export type ThemeType = 'light' | 'dark' | 'ansi';
22
+ export type ThemeType = 'light' | 'dark' | 'ansi' | 'custom';
23
23
  export interface ColorsTheme {
24
24
  type: ThemeType;
25
25
  Background: string;
@@ -31,10 +31,16 @@ export interface ColorsTheme {
31
31
  AccentGreen: string;
32
32
  AccentYellow: string;
33
33
  AccentRed: string;
34
+ DiffAdded: string;
35
+ DiffRemoved: string;
34
36
  Comment: string;
35
37
  Gray: string;
36
38
  GradientColors?: string[];
37
39
  }
40
+ export interface CustomTheme extends ColorsTheme {
41
+ type: 'custom';
42
+ name: string;
43
+ }
38
44
  export declare const lightTheme: ColorsTheme;
39
45
  export declare const darkTheme: ColorsTheme;
40
46
  export declare const ansiTheme: ColorsTheme;
@@ -52,8 +58,6 @@ export declare class Theme {
52
58
  * to Ink-compatible color strings (hex or name).
53
59
  */
54
60
  protected readonly _colorMap: Readonly<Record<string, string>>;
55
- private static readonly cssNameToHexMap;
56
- private static readonly inkSupportedNames;
57
61
  /**
58
62
  * Creates a new Theme instance.
59
63
  * @param name The name of the theme.
@@ -80,4 +84,19 @@ export declare class Theme {
80
84
  */
81
85
  protected _buildColorMap(hljsTheme: Record<string, HighlightJSStyle>): Record<string, string>;
82
86
  }
87
+ /**
88
+ * Creates a Theme instance from a custom theme configuration.
89
+ * @param customTheme The custom theme configuration.
90
+ * @returns A new Theme instance.
91
+ */
92
+ export declare function createCustomTheme(customTheme: CustomTheme): Theme;
93
+ /**
94
+ * Validates a custom theme configuration.
95
+ * @param customTheme The custom theme to validate.
96
+ * @returns An object with isValid boolean and error message if invalid.
97
+ */
98
+ export declare function validateCustomTheme(customTheme: Partial<CustomTheme>): {
99
+ isValid: boolean;
100
+ error?: string;
101
+ };
83
102
  export {};