@google/gemini-cli 0.1.12 → 0.1.13-nightly.250727.3e81359c
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.
- package/README.md +30 -3
- package/dist/google-gemini-cli-0.1.13.tgz +0 -0
- package/dist/package.json +6 -4
- package/dist/src/acp/acp.d.ts +208 -0
- package/dist/src/acp/acp.js +193 -0
- package/dist/src/acp/acp.js.map +1 -0
- package/dist/src/acp/acpPeer.d.ts +8 -0
- package/dist/src/acp/acpPeer.js +537 -0
- package/dist/src/acp/acpPeer.js.map +1 -0
- package/dist/src/config/config.d.ts +6 -2
- package/dist/src/config/config.js +77 -13
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +2 -2
- package/dist/src/config/extension.js +21 -16
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/settings.d.ts +15 -2
- package/dist/src/config/settings.js +25 -10
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.d.ts +1 -0
- package/dist/src/gemini.js +31 -34
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/patches/is-in-ci.d.ts +7 -0
- package/dist/src/patches/is-in-ci.js +15 -0
- package/dist/src/patches/is-in-ci.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
- package/dist/src/services/BuiltinCommandLoader.js +72 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +43 -5
- package/dist/src/services/CommandService.js +61 -19
- package/dist/src/services/CommandService.js.map +1 -1
- package/dist/src/services/FileCommandLoader.d.ts +37 -0
- package/dist/src/services/FileCommandLoader.js +157 -0
- package/dist/src/services/FileCommandLoader.js.map +1 -0
- package/dist/src/services/McpPromptLoader.d.ts +25 -0
- package/dist/src/services/McpPromptLoader.js +192 -0
- package/dist/src/services/McpPromptLoader.js.map +1 -0
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +21 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js +28 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/types.d.ts +34 -0
- package/dist/src/services/prompt-processors/types.js +10 -0
- package/dist/src/services/prompt-processors/types.js.map +1 -0
- package/dist/src/services/types.d.ts +22 -0
- package/dist/src/services/types.js +7 -0
- package/dist/src/services/types.js.map +1 -0
- package/dist/src/ui/App.js +127 -100
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/colors.js +6 -0
- package/dist/src/ui/colors.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.d.ts +7 -0
- package/dist/src/ui/commands/aboutCommand.js +39 -0
- package/dist/src/ui/commands/aboutCommand.js.map +1 -0
- package/dist/src/ui/commands/authCommand.d.ts +7 -0
- package/dist/src/ui/commands/authCommand.js +16 -0
- package/dist/src/ui/commands/authCommand.js.map +1 -0
- package/dist/src/ui/commands/bugCommand.d.ts +7 -0
- package/dist/src/ui/commands/bugCommand.js +63 -0
- package/dist/src/ui/commands/bugCommand.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.d.ts +7 -0
- package/dist/src/ui/commands/chatCommand.js +179 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.js +14 -2
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.d.ts +7 -0
- package/dist/src/ui/commands/compressCommand.js +64 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -0
- package/dist/src/ui/commands/copyCommand.d.ts +7 -0
- package/dist/src/ui/commands/copyCommand.js +59 -0
- package/dist/src/ui/commands/copyCommand.js.map +1 -0
- package/dist/src/ui/commands/corgiCommand.d.ts +7 -0
- package/dist/src/ui/commands/corgiCommand.js +15 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.d.ts +7 -0
- package/dist/src/ui/commands/docsCommand.js +31 -0
- package/dist/src/ui/commands/docsCommand.js.map +1 -0
- package/dist/src/ui/commands/editorCommand.d.ts +7 -0
- package/dist/src/ui/commands/editorCommand.js +16 -0
- package/dist/src/ui/commands/editorCommand.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/extensionsCommand.js +31 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.js +3 -1
- package/dist/src/ui/commands/helpCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.d.ts +8 -0
- package/dist/src/ui/commands/ideCommand.js +121 -0
- package/dist/src/ui/commands/ideCommand.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
- package/dist/src/ui/commands/mcpCommand.js +425 -0
- package/dist/src/ui/commands/mcpCommand.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.js +11 -4
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/privacyCommand.d.ts +7 -0
- package/dist/src/ui/commands/privacyCommand.js +16 -0
- package/dist/src/ui/commands/privacyCommand.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.d.ts +7 -0
- package/dist/src/ui/commands/quitCommand.js +34 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -0
- package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
- package/dist/src/ui/commands/restoreCommand.js +128 -0
- package/dist/src/ui/commands/restoreCommand.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.d.ts +7 -0
- package/dist/src/ui/commands/statsCommand.js +54 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.js +2 -0
- package/dist/src/ui/commands/themeCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
- package/dist/src/ui/commands/toolsCommand.js +56 -0
- package/dist/src/ui/commands/toolsCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +61 -4
- package/dist/src/ui/commands/types.js +6 -1
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/vimCommand.d.ts +7 -0
- package/dist/src/ui/commands/vimCommand.js +23 -0
- package/dist/src/ui/commands/vimCommand.js.map +1 -0
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +6 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +46 -19
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +1 -0
- package/dist/src/ui/components/Footer.js +2 -2
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Header.js +1 -1
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Help.d.ts +1 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +11 -0
- package/dist/src/ui/components/IDEContextDetailDisplay.js +19 -0
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +3 -1
- package/dist/src/ui/components/InputPrompt.js +85 -113
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.js +51 -25
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/Tips.js +1 -1
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.js +12 -11
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +5 -4
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js +3 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js +69 -2
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +3 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +60 -10
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +273 -3
- package/dist/src/ui/components/shared/text-buffer.js +426 -80
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +72 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js +565 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -0
- package/dist/src/ui/constants.d.ts +1 -0
- package/dist/src/ui/constants.js +1 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/VimModeContext.d.ts +19 -0
- package/dist/src/ui/contexts/VimModeContext.js +48 -0
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +54 -15
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +2 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +154 -177
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +3 -10
- package/dist/src/ui/hooks/slashCommandProcessor.js +121 -879
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.js +2 -1
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +4 -1
- package/dist/src/ui/hooks/useCompletion.js +141 -25
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.js +53 -37
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.d.ts +6 -0
- package/dist/src/ui/hooks/useFocus.js +41 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.js +74 -11
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useInputHistory.d.ts +1 -1
- package/dist/src/ui/hooks/useKeypress.js +5 -2
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +5 -5
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/useShellHistory.d.ts +3 -2
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js +24 -23
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/vim.d.ts +28 -0
- package/dist/src/ui/hooks/vim.js +630 -0
- package/dist/src/ui/hooks/vim.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.js +3 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +2 -0
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/atom-one-dark.js +2 -0
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
- package/dist/src/ui/themes/ayu-light.js +3 -1
- package/dist/src/ui/themes/ayu-light.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +3 -1
- package/dist/src/ui/themes/ayu.js.map +1 -1
- package/dist/src/ui/themes/color-utils.d.ts +21 -0
- package/dist/src/ui/themes/color-utils.js +221 -0
- package/dist/src/ui/themes/color-utils.js.map +1 -0
- package/dist/src/ui/themes/dracula.js +2 -0
- package/dist/src/ui/themes/dracula.js.map +1 -1
- package/dist/src/ui/themes/github-dark.js +2 -0
- package/dist/src/ui/themes/github-dark.js.map +1 -1
- package/dist/src/ui/themes/github-light.js +2 -0
- package/dist/src/ui/themes/github-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +3 -1
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +3 -1
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/shades-of-purple.d.ts +1 -1
- package/dist/src/ui/themes/shades-of-purple.js +3 -1
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.d.ts +31 -6
- package/dist/src/ui/themes/theme-manager.js +113 -34
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +23 -3
- package/dist/src/ui/themes/theme.js +244 -182
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +3 -1
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +9 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +3 -1
- package/dist/src/ui/utils/CodeColorizer.js +23 -11
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.d.ts +1 -0
- package/dist/src/ui/utils/commandUtils.js +47 -0
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/markdownUtilities.js +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +0 -8
- package/dist/src/ui/utils/textUtils.js +0 -22
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.js +4 -0
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/events.d.ts +11 -0
- package/dist/src/utils/events.js +13 -0
- package/dist/src/utils/events.js.map +1 -0
- package/dist/src/utils/sandbox.js +7 -3
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.js +22 -1
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.d.ts +7 -0
- package/dist/src/validateNonInterActiveAuth.js +35 -0
- package/dist/src/validateNonInterActiveAuth.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -5
- package/dist/google-gemini-cli-0.1.11.tgz +0 -0
|
@@ -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: '#
|
|
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
|
-
|
|
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
|
-
//
|
|
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,238 @@ 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' and 'DiffRemoved' are not required as they were added after
|
|
296
|
+
// the theme format was defined.
|
|
297
|
+
'Comment',
|
|
298
|
+
'Gray',
|
|
299
|
+
];
|
|
300
|
+
const recommendedFields = [
|
|
301
|
+
'DiffAdded',
|
|
302
|
+
'DiffRemoved',
|
|
303
|
+
];
|
|
304
|
+
for (const field of requiredFields) {
|
|
305
|
+
if (!customTheme[field]) {
|
|
306
|
+
return {
|
|
307
|
+
isValid: false,
|
|
308
|
+
error: `Missing required field: ${field}`,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
const missingFields = [];
|
|
313
|
+
for (const field of recommendedFields) {
|
|
314
|
+
if (!customTheme[field]) {
|
|
315
|
+
missingFields.push(field);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
// Validate color format (basic hex validation)
|
|
319
|
+
const colorFields = [
|
|
320
|
+
'Background',
|
|
321
|
+
'Foreground',
|
|
322
|
+
'LightBlue',
|
|
323
|
+
'AccentBlue',
|
|
324
|
+
'AccentPurple',
|
|
325
|
+
'AccentCyan',
|
|
326
|
+
'AccentGreen',
|
|
327
|
+
'AccentYellow',
|
|
328
|
+
'AccentRed',
|
|
329
|
+
'DiffAdded',
|
|
330
|
+
'DiffRemoved',
|
|
331
|
+
'Comment',
|
|
332
|
+
'Gray',
|
|
333
|
+
];
|
|
334
|
+
for (const field of colorFields) {
|
|
335
|
+
const color = customTheme[field];
|
|
336
|
+
if (color !== undefined && !isValidColor(color)) {
|
|
337
|
+
return {
|
|
338
|
+
isValid: false,
|
|
339
|
+
error: `Invalid color format for ${field}: ${color}`,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
// Validate theme name
|
|
344
|
+
if (customTheme.name && !isValidThemeName(customTheme.name)) {
|
|
345
|
+
return {
|
|
346
|
+
isValid: false,
|
|
347
|
+
error: `Invalid theme name: ${customTheme.name}`,
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
isValid: true,
|
|
352
|
+
warning: missingFields.length > 0
|
|
353
|
+
? `Missing field(s) ${missingFields.join(', ')}`
|
|
354
|
+
: undefined,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Checks if a theme name is valid.
|
|
359
|
+
* @param name The theme name to validate.
|
|
360
|
+
* @returns True if the theme name is valid.
|
|
361
|
+
*/
|
|
362
|
+
function isValidThemeName(name) {
|
|
363
|
+
// Theme name should be non-empty and not contain invalid characters
|
|
364
|
+
return name.trim().length > 0 && name.trim().length <= 50;
|
|
365
|
+
}
|
|
304
366
|
//# sourceMappingURL=theme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../../src/ui/themes/theme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../../src/ui/themes/theme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA2B9D,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,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,SAAS;IACtB,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,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,SAAS;IACtB,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,IAA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AAE,CAAC;QAC5D,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,uBAAuB,WAAW,CAAC,IAAI,EAAE;SACjD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EACL,aAAa,CAAC,MAAM,GAAG,CAAC;YACtB,CAAC,CAAC,oBAAoB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAChD,CAAC,CAAC,SAAS;KAChB,CAAC;AACJ,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"}
|
|
@@ -7,7 +7,7 @@ import { Theme } from './theme.js';
|
|
|
7
7
|
const xcodeColors = {
|
|
8
8
|
type: 'light',
|
|
9
9
|
Background: '#fff',
|
|
10
|
-
Foreground: '
|
|
10
|
+
Foreground: '#444',
|
|
11
11
|
LightBlue: '#0E0EFF',
|
|
12
12
|
AccentBlue: '#1c00cf',
|
|
13
13
|
AccentPurple: '#aa0d91',
|
|
@@ -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":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAoB,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,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AE,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"}
|
package/dist/src/ui/types.d.ts
CHANGED
|
@@ -160,6 +160,14 @@ export interface ConsoleMessageItem {
|
|
|
160
160
|
content: string;
|
|
161
161
|
count: number;
|
|
162
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Result type for a slash command that should immediately result in a prompt
|
|
165
|
+
* being submitted to the Gemini model.
|
|
166
|
+
*/
|
|
167
|
+
export interface SubmitPromptResult {
|
|
168
|
+
type: 'submit_prompt';
|
|
169
|
+
content: string;
|
|
170
|
+
}
|
|
163
171
|
/**
|
|
164
172
|
* Defines the result of the slash command processor for its consumer (useGeminiStream).
|
|
165
173
|
*/
|
|
@@ -169,4 +177,4 @@ export type SlashCommandProcessorResult = {
|
|
|
169
177
|
toolArgs: Record<string, unknown>;
|
|
170
178
|
} | {
|
|
171
179
|
type: 'handled';
|
|
172
|
-
};
|
|
180
|
+
} | 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;
|