@google/gemini-cli 0.1.17-nightly.250808.60362e03 → 0.1.18
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 +0 -10
- package/dist/google-gemini-cli-0.1.17.tgz +0 -0
- package/dist/package.json +2 -4
- package/dist/src/acp/acpPeer.js +64 -72
- package/dist/src/acp/acpPeer.js.map +1 -1
- package/dist/src/config/config.js +38 -67
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/settings.d.ts +1 -5
- package/dist/src/config/settings.js +1 -17
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.js +27 -3
- 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/nonInteractiveCli.js +1 -0
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +2 -1
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/ui/App.js +13 -44
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.js +18 -57
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +0 -1
- package/dist/src/ui/components/AsciiArt.js +0 -10
- package/dist/src/ui/components/AsciiArt.js.map +1 -1
- package/dist/src/ui/components/AuthInProgress.js +3 -3
- package/dist/src/ui/components/AuthInProgress.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +24 -21
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/Footer.js +5 -14
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Header.d.ts +1 -0
- package/dist/src/ui/components/Header.js +5 -13
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.js +1 -14
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +3 -3
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +5 -10
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +9 -29
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +4 -7
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +1 -4
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +1 -2
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +2 -1
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js +12 -12
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/themes/ansi-light.js +1 -2
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +1 -2
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/atom-one-dark.js +1 -2
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
- package/dist/src/ui/themes/ayu-light.js +1 -2
- package/dist/src/ui/themes/ayu-light.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +1 -2
- package/dist/src/ui/themes/ayu.js.map +1 -1
- package/dist/src/ui/themes/default-light.js +1 -2
- package/dist/src/ui/themes/default-light.js.map +1 -1
- package/dist/src/ui/themes/default.js +1 -2
- package/dist/src/ui/themes/default.js.map +1 -1
- package/dist/src/ui/themes/dracula.js +1 -2
- package/dist/src/ui/themes/dracula.js.map +1 -1
- package/dist/src/ui/themes/github-dark.js +1 -2
- package/dist/src/ui/themes/github-dark.js.map +1 -1
- package/dist/src/ui/themes/github-light.js +1 -2
- package/dist/src/ui/themes/github-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +1 -2
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +1 -30
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/shades-of-purple.js +1 -2
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.d.ts +0 -6
- package/dist/src/ui/themes/theme-manager.js +0 -7
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +2 -45
- package/dist/src/ui/themes/theme.js +107 -92
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +1 -2
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +0 -1
- package/dist/src/ui/utils/ConsolePatcher.js +0 -3
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.d.ts +0 -1
- package/dist/src/ui/utils/commandUtils.js +1 -22
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/utils/gitUtils.d.ts +1 -21
- package/dist/src/utils/gitUtils.js +3 -70
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/sandbox.js +405 -416
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -5
- package/dist/src/commands/mcp/add.d.ts +0 -7
- package/dist/src/commands/mcp/add.js +0 -155
- package/dist/src/commands/mcp/add.js.map +0 -1
- package/dist/src/commands/mcp/list.d.ts +0 -8
- package/dist/src/commands/mcp/list.js +0 -110
- package/dist/src/commands/mcp/list.js.map +0 -1
- package/dist/src/commands/mcp/remove.d.ts +0 -7
- package/dist/src/commands/mcp/remove.js +0 -44
- package/dist/src/commands/mcp/remove.js.map +0 -1
- package/dist/src/commands/mcp.d.ts +0 -7
- package/dist/src/commands/mcp.js +0 -23
- package/dist/src/commands/mcp.js.map +0 -1
- package/dist/src/ui/IdeIntegrationNudge.d.ts +0 -13
- package/dist/src/ui/IdeIntegrationNudge.js +0 -31
- package/dist/src/ui/IdeIntegrationNudge.js.map +0 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +0 -9
- package/dist/src/ui/components/ContextUsageDisplay.js +0 -14
- package/dist/src/ui/components/ContextUsageDisplay.js.map +0 -1
- package/dist/src/ui/semantic-colors.d.ts +0 -7
- package/dist/src/ui/semantic-colors.js +0 -24
- package/dist/src/ui/semantic-colors.js.map +0 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +0 -37
- package/dist/src/ui/themes/semantic-tokens.js +0 -94
- package/dist/src/ui/themes/semantic-tokens.js.map +0 -1
- package/dist/src/ui/utils/isNarrowWidth.d.ts +0 -6
- package/dist/src/ui/utils/isNarrowWidth.js +0 -9
- package/dist/src/ui/utils/isNarrowWidth.js.map +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { resolveColor } from './color-utils.js';
|
|
6
|
+
import { isValidColor, resolveColor } from './color-utils.js';
|
|
7
7
|
export const lightTheme = {
|
|
8
8
|
type: 'light',
|
|
9
9
|
Background: '#FAFAFA',
|
|
@@ -58,7 +58,6 @@ export class Theme {
|
|
|
58
58
|
name;
|
|
59
59
|
type;
|
|
60
60
|
colors;
|
|
61
|
-
semanticColors;
|
|
62
61
|
/**
|
|
63
62
|
* The default foreground color for text when no specific highlight rule applies.
|
|
64
63
|
* This is an Ink-compatible color string (hex or name).
|
|
@@ -74,11 +73,10 @@ export class Theme {
|
|
|
74
73
|
* @param name The name of the theme.
|
|
75
74
|
* @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object.
|
|
76
75
|
*/
|
|
77
|
-
constructor(name, type, rawMappings, colors
|
|
76
|
+
constructor(name, type, rawMappings, colors) {
|
|
78
77
|
this.name = name;
|
|
79
78
|
this.type = type;
|
|
80
79
|
this.colors = colors;
|
|
81
|
-
this.semanticColors = semanticColors;
|
|
82
80
|
this._colorMap = Object.freeze(this._buildColorMap(rawMappings)); // Build and freeze the map
|
|
83
81
|
// Determine the default foreground color
|
|
84
82
|
const rawDefaultColor = rawMappings['hljs']?.color;
|
|
@@ -137,124 +135,107 @@ export class Theme {
|
|
|
137
135
|
* @returns A new Theme instance.
|
|
138
136
|
*/
|
|
139
137
|
export function createCustomTheme(customTheme) {
|
|
140
|
-
const colors = {
|
|
141
|
-
type: 'custom',
|
|
142
|
-
Background: customTheme.background?.primary ?? customTheme.Background ?? '',
|
|
143
|
-
Foreground: customTheme.text?.primary ?? customTheme.Foreground ?? '',
|
|
144
|
-
LightBlue: customTheme.text?.link ?? customTheme.LightBlue ?? '',
|
|
145
|
-
AccentBlue: customTheme.text?.link ?? customTheme.AccentBlue ?? '',
|
|
146
|
-
AccentPurple: customTheme.text?.accent ?? customTheme.AccentPurple ?? '',
|
|
147
|
-
AccentCyan: customTheme.text?.link ?? customTheme.AccentCyan ?? '',
|
|
148
|
-
AccentGreen: customTheme.status?.success ?? customTheme.AccentGreen ?? '',
|
|
149
|
-
AccentYellow: customTheme.status?.warning ?? customTheme.AccentYellow ?? '',
|
|
150
|
-
AccentRed: customTheme.status?.error ?? customTheme.AccentRed ?? '',
|
|
151
|
-
DiffAdded: customTheme.background?.diff?.added ?? customTheme.DiffAdded ?? '',
|
|
152
|
-
DiffRemoved: customTheme.background?.diff?.removed ?? customTheme.DiffRemoved ?? '',
|
|
153
|
-
Comment: customTheme.ui?.comment ?? customTheme.Comment ?? '',
|
|
154
|
-
Gray: customTheme.text?.secondary ?? customTheme.Gray ?? '',
|
|
155
|
-
GradientColors: customTheme.ui?.gradient ?? customTheme.GradientColors,
|
|
156
|
-
};
|
|
157
138
|
// Generate CSS properties mappings based on the custom theme colors
|
|
158
139
|
const rawMappings = {
|
|
159
140
|
hljs: {
|
|
160
141
|
display: 'block',
|
|
161
142
|
overflowX: 'auto',
|
|
162
143
|
padding: '0.5em',
|
|
163
|
-
background:
|
|
164
|
-
color:
|
|
144
|
+
background: customTheme.Background,
|
|
145
|
+
color: customTheme.Foreground,
|
|
165
146
|
},
|
|
166
147
|
'hljs-keyword': {
|
|
167
|
-
color:
|
|
148
|
+
color: customTheme.AccentBlue,
|
|
168
149
|
},
|
|
169
150
|
'hljs-literal': {
|
|
170
|
-
color:
|
|
151
|
+
color: customTheme.AccentBlue,
|
|
171
152
|
},
|
|
172
153
|
'hljs-symbol': {
|
|
173
|
-
color:
|
|
154
|
+
color: customTheme.AccentBlue,
|
|
174
155
|
},
|
|
175
156
|
'hljs-name': {
|
|
176
|
-
color:
|
|
157
|
+
color: customTheme.AccentBlue,
|
|
177
158
|
},
|
|
178
159
|
'hljs-link': {
|
|
179
|
-
color:
|
|
160
|
+
color: customTheme.AccentBlue,
|
|
180
161
|
textDecoration: 'underline',
|
|
181
162
|
},
|
|
182
163
|
'hljs-built_in': {
|
|
183
|
-
color:
|
|
164
|
+
color: customTheme.AccentCyan,
|
|
184
165
|
},
|
|
185
166
|
'hljs-type': {
|
|
186
|
-
color:
|
|
167
|
+
color: customTheme.AccentCyan,
|
|
187
168
|
},
|
|
188
169
|
'hljs-number': {
|
|
189
|
-
color:
|
|
170
|
+
color: customTheme.AccentGreen,
|
|
190
171
|
},
|
|
191
172
|
'hljs-class': {
|
|
192
|
-
color:
|
|
173
|
+
color: customTheme.AccentGreen,
|
|
193
174
|
},
|
|
194
175
|
'hljs-string': {
|
|
195
|
-
color:
|
|
176
|
+
color: customTheme.AccentYellow,
|
|
196
177
|
},
|
|
197
178
|
'hljs-meta-string': {
|
|
198
|
-
color:
|
|
179
|
+
color: customTheme.AccentYellow,
|
|
199
180
|
},
|
|
200
181
|
'hljs-regexp': {
|
|
201
|
-
color:
|
|
182
|
+
color: customTheme.AccentRed,
|
|
202
183
|
},
|
|
203
184
|
'hljs-template-tag': {
|
|
204
|
-
color:
|
|
185
|
+
color: customTheme.AccentRed,
|
|
205
186
|
},
|
|
206
187
|
'hljs-subst': {
|
|
207
|
-
color:
|
|
188
|
+
color: customTheme.Foreground,
|
|
208
189
|
},
|
|
209
190
|
'hljs-function': {
|
|
210
|
-
color:
|
|
191
|
+
color: customTheme.Foreground,
|
|
211
192
|
},
|
|
212
193
|
'hljs-title': {
|
|
213
|
-
color:
|
|
194
|
+
color: customTheme.Foreground,
|
|
214
195
|
},
|
|
215
196
|
'hljs-params': {
|
|
216
|
-
color:
|
|
197
|
+
color: customTheme.Foreground,
|
|
217
198
|
},
|
|
218
199
|
'hljs-formula': {
|
|
219
|
-
color:
|
|
200
|
+
color: customTheme.Foreground,
|
|
220
201
|
},
|
|
221
202
|
'hljs-comment': {
|
|
222
|
-
color:
|
|
203
|
+
color: customTheme.Comment,
|
|
223
204
|
fontStyle: 'italic',
|
|
224
205
|
},
|
|
225
206
|
'hljs-quote': {
|
|
226
|
-
color:
|
|
207
|
+
color: customTheme.Comment,
|
|
227
208
|
fontStyle: 'italic',
|
|
228
209
|
},
|
|
229
210
|
'hljs-doctag': {
|
|
230
|
-
color:
|
|
211
|
+
color: customTheme.Comment,
|
|
231
212
|
},
|
|
232
213
|
'hljs-meta': {
|
|
233
|
-
color:
|
|
214
|
+
color: customTheme.Gray,
|
|
234
215
|
},
|
|
235
216
|
'hljs-meta-keyword': {
|
|
236
|
-
color:
|
|
217
|
+
color: customTheme.Gray,
|
|
237
218
|
},
|
|
238
219
|
'hljs-tag': {
|
|
239
|
-
color:
|
|
220
|
+
color: customTheme.Gray,
|
|
240
221
|
},
|
|
241
222
|
'hljs-variable': {
|
|
242
|
-
color:
|
|
223
|
+
color: customTheme.AccentPurple,
|
|
243
224
|
},
|
|
244
225
|
'hljs-template-variable': {
|
|
245
|
-
color:
|
|
226
|
+
color: customTheme.AccentPurple,
|
|
246
227
|
},
|
|
247
228
|
'hljs-attr': {
|
|
248
|
-
color:
|
|
229
|
+
color: customTheme.LightBlue,
|
|
249
230
|
},
|
|
250
231
|
'hljs-attribute': {
|
|
251
|
-
color:
|
|
232
|
+
color: customTheme.LightBlue,
|
|
252
233
|
},
|
|
253
234
|
'hljs-builtin-name': {
|
|
254
|
-
color:
|
|
235
|
+
color: customTheme.LightBlue,
|
|
255
236
|
},
|
|
256
237
|
'hljs-section': {
|
|
257
|
-
color:
|
|
238
|
+
color: customTheme.AccentYellow,
|
|
258
239
|
},
|
|
259
240
|
'hljs-emphasis': {
|
|
260
241
|
fontStyle: 'italic',
|
|
@@ -263,64 +244,35 @@ export function createCustomTheme(customTheme) {
|
|
|
263
244
|
fontWeight: 'bold',
|
|
264
245
|
},
|
|
265
246
|
'hljs-bullet': {
|
|
266
|
-
color:
|
|
247
|
+
color: customTheme.AccentYellow,
|
|
267
248
|
},
|
|
268
249
|
'hljs-selector-tag': {
|
|
269
|
-
color:
|
|
250
|
+
color: customTheme.AccentYellow,
|
|
270
251
|
},
|
|
271
252
|
'hljs-selector-id': {
|
|
272
|
-
color:
|
|
253
|
+
color: customTheme.AccentYellow,
|
|
273
254
|
},
|
|
274
255
|
'hljs-selector-class': {
|
|
275
|
-
color:
|
|
256
|
+
color: customTheme.AccentYellow,
|
|
276
257
|
},
|
|
277
258
|
'hljs-selector-attr': {
|
|
278
|
-
color:
|
|
259
|
+
color: customTheme.AccentYellow,
|
|
279
260
|
},
|
|
280
261
|
'hljs-selector-pseudo': {
|
|
281
|
-
color:
|
|
262
|
+
color: customTheme.AccentYellow,
|
|
282
263
|
},
|
|
283
264
|
'hljs-addition': {
|
|
284
|
-
backgroundColor:
|
|
265
|
+
backgroundColor: customTheme.AccentGreen,
|
|
285
266
|
display: 'inline-block',
|
|
286
267
|
width: '100%',
|
|
287
268
|
},
|
|
288
269
|
'hljs-deletion': {
|
|
289
|
-
backgroundColor:
|
|
270
|
+
backgroundColor: customTheme.AccentRed,
|
|
290
271
|
display: 'inline-block',
|
|
291
272
|
width: '100%',
|
|
292
273
|
},
|
|
293
274
|
};
|
|
294
|
-
|
|
295
|
-
text: {
|
|
296
|
-
primary: colors.Foreground,
|
|
297
|
-
secondary: colors.Gray,
|
|
298
|
-
link: colors.AccentBlue,
|
|
299
|
-
accent: colors.AccentPurple,
|
|
300
|
-
},
|
|
301
|
-
background: {
|
|
302
|
-
primary: colors.Background,
|
|
303
|
-
diff: {
|
|
304
|
-
added: colors.DiffAdded,
|
|
305
|
-
removed: colors.DiffRemoved,
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
border: {
|
|
309
|
-
default: colors.Gray,
|
|
310
|
-
focused: colors.AccentBlue,
|
|
311
|
-
},
|
|
312
|
-
ui: {
|
|
313
|
-
comment: colors.Comment,
|
|
314
|
-
symbol: colors.Gray,
|
|
315
|
-
gradient: colors.GradientColors,
|
|
316
|
-
},
|
|
317
|
-
status: {
|
|
318
|
-
error: colors.AccentRed,
|
|
319
|
-
success: colors.AccentGreen,
|
|
320
|
-
warning: colors.AccentYellow,
|
|
321
|
-
},
|
|
322
|
-
};
|
|
323
|
-
return new Theme(customTheme.name, 'custom', rawMappings, colors, semanticColors);
|
|
275
|
+
return new Theme(customTheme.name, 'custom', rawMappings, customTheme);
|
|
324
276
|
}
|
|
325
277
|
/**
|
|
326
278
|
* Validates a custom theme configuration.
|
|
@@ -328,7 +280,67 @@ export function createCustomTheme(customTheme) {
|
|
|
328
280
|
* @returns An object with isValid boolean and error message if invalid.
|
|
329
281
|
*/
|
|
330
282
|
export function validateCustomTheme(customTheme) {
|
|
331
|
-
//
|
|
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
|
|
332
344
|
if (customTheme.name && !isValidThemeName(customTheme.name)) {
|
|
333
345
|
return {
|
|
334
346
|
isValid: false,
|
|
@@ -337,6 +349,9 @@ export function validateCustomTheme(customTheme) {
|
|
|
337
349
|
}
|
|
338
350
|
return {
|
|
339
351
|
isValid: true,
|
|
352
|
+
warning: missingFields.length > 0
|
|
353
|
+
? `Missing field(s) ${missingFields.join(', ')}`
|
|
354
|
+
: undefined,
|
|
340
355
|
};
|
|
341
356
|
}
|
|
342
357
|
/**
|
|
@@ -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;IACt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CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAChD,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;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"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { Theme } from './theme.js';
|
|
7
|
-
import { lightSemanticColors } from './semantic-tokens.js';
|
|
8
7
|
const xcodeColors = {
|
|
9
8
|
type: 'light',
|
|
10
9
|
Background: '#fff',
|
|
@@ -142,5 +141,5 @@ export const XCode = new Theme('Xcode', 'light', {
|
|
|
142
141
|
'hljs-emphasis': {
|
|
143
142
|
fontStyle: 'italic',
|
|
144
143
|
},
|
|
145
|
-
}, xcodeColors
|
|
144
|
+
}, xcodeColors);
|
|
146
145
|
//# sourceMappingURL=xcode.js.map
|
|
@@ -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;
|
|
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,KAAK,EAAE,WAAW,CAAC,IAAI;KACxB;IACD,cAAc,EAAE;QACd,KAAK,EAAE,WAAW,CAAC,OAAO;KAC3B;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,WAAW,CAAC,OAAO;KAC3B;IACD,UAAU,EAAE;QACV,KAAK,EAAE,WAAW,CAAC,YAAY;KAChC;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,WAAW,CAAC,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,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"}
|
package/dist/src/ui/types.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export class ConsolePatcher {
|
|
|
9
9
|
originalConsoleWarn = console.warn;
|
|
10
10
|
originalConsoleError = console.error;
|
|
11
11
|
originalConsoleDebug = console.debug;
|
|
12
|
-
originalConsoleInfo = console.info;
|
|
13
12
|
params;
|
|
14
13
|
constructor(params) {
|
|
15
14
|
this.params = params;
|
|
@@ -19,14 +18,12 @@ export class ConsolePatcher {
|
|
|
19
18
|
console.warn = this.patchConsoleMethod('warn', this.originalConsoleWarn);
|
|
20
19
|
console.error = this.patchConsoleMethod('error', this.originalConsoleError);
|
|
21
20
|
console.debug = this.patchConsoleMethod('debug', this.originalConsoleDebug);
|
|
22
|
-
console.info = this.patchConsoleMethod('info', this.originalConsoleInfo);
|
|
23
21
|
}
|
|
24
22
|
cleanup = () => {
|
|
25
23
|
console.log = this.originalConsoleLog;
|
|
26
24
|
console.warn = this.originalConsoleWarn;
|
|
27
25
|
console.error = this.originalConsoleError;
|
|
28
26
|
console.debug = this.originalConsoleDebug;
|
|
29
|
-
console.info = this.originalConsoleInfo;
|
|
30
27
|
};
|
|
31
28
|
formatArgs = (args) => util.format(...args);
|
|
32
29
|
patchConsoleMethod = (type, originalMethod) => (...args) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsolePatcher.js","sourceRoot":"","sources":["../../../../src/ui/utils/ConsolePatcher.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AASxB,MAAM,OAAO,cAAc;IACjB,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;IACjC,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IACnC,oBAAoB,GAAG,OAAO,CAAC,KAAK,CAAC;IACrC,oBAAoB,GAAG,OAAO,CAAC,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ConsolePatcher.js","sourceRoot":"","sources":["../../../../src/ui/utils/ConsolePatcher.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AASxB,MAAM,OAAO,cAAc;IACjB,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;IACjC,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IACnC,oBAAoB,GAAG,OAAO,CAAC,KAAK,CAAC;IACrC,oBAAoB,GAAG,OAAO,CAAC,KAAK,CAAC;IAErC,MAAM,CAAuB;IAErC,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK;QACH,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACtE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;Q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UAAU,CAAC,IAAI,CAAC;oBAC9B,KAAK,EAAE,CAAC;iBACT,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC,CAAC;CACL"}
|
|
@@ -23,7 +23,7 @@ query.startsWith('@') || /\s@/.test(query);
|
|
|
23
23
|
* @returns True if the query looks like an '/' command, false otherwise.
|
|
24
24
|
*/
|
|
25
25
|
export const isSlashCommand = (query) => query.startsWith('/');
|
|
26
|
-
//
|
|
26
|
+
//Copies a string snippet to the clipboard for different platforms
|
|
27
27
|
export const copyToClipboard = async (text) => {
|
|
28
28
|
const run = (cmd, args) => new Promise((resolve, reject) => {
|
|
29
29
|
const child = spawn(cmd, args);
|
|
@@ -69,25 +69,4 @@ export const copyToClipboard = async (text) => {
|
|
|
69
69
|
throw new Error(`Unsupported platform: ${process.platform}`);
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
export const getUrlOpenCommand = () => {
|
|
73
|
-
// --- Determine the OS-specific command to open URLs ---
|
|
74
|
-
let openCmd;
|
|
75
|
-
switch (process.platform) {
|
|
76
|
-
case 'darwin':
|
|
77
|
-
openCmd = 'open';
|
|
78
|
-
break;
|
|
79
|
-
case 'win32':
|
|
80
|
-
openCmd = 'start';
|
|
81
|
-
break;
|
|
82
|
-
case 'linux':
|
|
83
|
-
openCmd = 'xdg-open';
|
|
84
|
-
break;
|
|
85
|
-
default:
|
|
86
|
-
// Default to xdg-open, which appears to be supported for the less popular operating systems.
|
|
87
|
-
openCmd = 'xdg-open';
|
|
88
|
-
console.warn(`Unknown platform: ${process.platform}. Attempting to open URLs with: ${openCmd}.`);
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
return openCmd;
|
|
92
|
-
};
|
|
93
72
|
//# sourceMappingURL=commandUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/commandUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO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CAAC,YAAY,CAAC,OAAO;wBACtB,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;oBAC3B,MAAM,WAAW,GACf,aAAa,YAAY,KAAK;wBAC5B,CAAC,CAAC,aAAa,CAAC,OAAO;wBACvB,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;oBAC5B,MAAM,IAAI,KAAK,CACb,qCAAqC,UAAU,aAAa,WAAW,6DAA6D,CACrI,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,OAAO;QACT;YACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjE,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -7,24 +7,4 @@
|
|
|
7
7
|
* Checks if a directory is within a git repository hosted on GitHub.
|
|
8
8
|
* @returns true if the directory is in a git repository with a github.com remote, false otherwise
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
11
|
-
/**
|
|
12
|
-
* getGitRepoRoot returns the root directory of the git repository.
|
|
13
|
-
* @returns the path to the root of the git repo.
|
|
14
|
-
* @throws error if the exec command fails.
|
|
15
|
-
*/
|
|
16
|
-
export declare const getGitRepoRoot: () => string;
|
|
17
|
-
/**
|
|
18
|
-
* getLatestGitHubRelease returns the release tag as a string.
|
|
19
|
-
* @returns string of the release tag (e.g. "v1.2.3").
|
|
20
|
-
*/
|
|
21
|
-
export declare const getLatestGitHubRelease: (proxy?: string) => Promise<string>;
|
|
22
|
-
/**
|
|
23
|
-
* getGitHubRepoInfo returns the owner and repository for a GitHub repo.
|
|
24
|
-
* @returns the owner and repository of the github repo.
|
|
25
|
-
* @throws error if the exec command fails.
|
|
26
|
-
*/
|
|
27
|
-
export declare function getGitHubRepoInfo(): {
|
|
28
|
-
owner: string;
|
|
29
|
-
repo: string;
|
|
30
|
-
};
|
|
10
|
+
export declare function isGitHubRepository(): boolean;
|
|
@@ -4,88 +4,21 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { execSync } from 'child_process';
|
|
7
|
-
import { ProxyAgent, setGlobalDispatcher } from 'undici';
|
|
8
7
|
/**
|
|
9
8
|
* Checks if a directory is within a git repository hosted on GitHub.
|
|
10
9
|
* @returns true if the directory is in a git repository with a github.com remote, false otherwise
|
|
11
10
|
*/
|
|
12
|
-
export
|
|
11
|
+
export function isGitHubRepository() {
|
|
13
12
|
try {
|
|
14
|
-
const remotes =
|
|
13
|
+
const remotes = execSync('git remote -v', {
|
|
15
14
|
encoding: 'utf-8',
|
|
16
|
-
})
|
|
15
|
+
});
|
|
17
16
|
const pattern = /github\.com/;
|
|
18
17
|
return pattern.test(remotes);
|
|
19
18
|
}
|
|
20
19
|
catch (_error) {
|
|
21
20
|
// If any filesystem error occurs, assume not a git repo
|
|
22
|
-
console.debug(`Failed to get git remote:`, _error);
|
|
23
21
|
return false;
|
|
24
22
|
}
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* getGitRepoRoot returns the root directory of the git repository.
|
|
28
|
-
* @returns the path to the root of the git repo.
|
|
29
|
-
* @throws error if the exec command fails.
|
|
30
|
-
*/
|
|
31
|
-
export const getGitRepoRoot = () => {
|
|
32
|
-
const gitRepoRoot = (execSync('git rev-parse --show-toplevel', {
|
|
33
|
-
encoding: 'utf-8',
|
|
34
|
-
}) || '').trim();
|
|
35
|
-
if (!gitRepoRoot) {
|
|
36
|
-
throw new Error(`Git repo returned empty value`);
|
|
37
|
-
}
|
|
38
|
-
return gitRepoRoot;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* getLatestGitHubRelease returns the release tag as a string.
|
|
42
|
-
* @returns string of the release tag (e.g. "v1.2.3").
|
|
43
|
-
*/
|
|
44
|
-
export const getLatestGitHubRelease = async (proxy) => {
|
|
45
|
-
try {
|
|
46
|
-
const controller = new AbortController();
|
|
47
|
-
if (proxy) {
|
|
48
|
-
setGlobalDispatcher(new ProxyAgent(proxy));
|
|
49
|
-
}
|
|
50
|
-
const endpoint = `https://api.github.com/repos/google-github-actions/run-gemini-cli/releases/latest`;
|
|
51
|
-
const response = await fetch(endpoint, {
|
|
52
|
-
method: 'GET',
|
|
53
|
-
headers: {
|
|
54
|
-
Accept: 'application/vnd.github+json',
|
|
55
|
-
'Content-Type': 'application/json',
|
|
56
|
-
'X-GitHub-Api-Version': '2022-11-28',
|
|
57
|
-
},
|
|
58
|
-
signal: controller.signal,
|
|
59
|
-
});
|
|
60
|
-
if (!response.ok) {
|
|
61
|
-
throw new Error(`Invalid response code: ${response.status} - ${response.statusText}`);
|
|
62
|
-
}
|
|
63
|
-
const releaseTag = (await response.json()).tag_name;
|
|
64
|
-
if (!releaseTag) {
|
|
65
|
-
throw new Error(`Response did not include tag_name field`);
|
|
66
|
-
}
|
|
67
|
-
return releaseTag;
|
|
68
|
-
}
|
|
69
|
-
catch (_error) {
|
|
70
|
-
console.debug(`Failed to determine latest run-gemini-cli release:`, _error);
|
|
71
|
-
throw new Error(`Unable to determine the latest run-gemini-cli release on GitHub.`);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* getGitHubRepoInfo returns the owner and repository for a GitHub repo.
|
|
76
|
-
* @returns the owner and repository of the github repo.
|
|
77
|
-
* @throws error if the exec command fails.
|
|
78
|
-
*/
|
|
79
|
-
export function getGitHubRepoInfo() {
|
|
80
|
-
const remoteUrl = execSync('git remote get-url origin', {
|
|
81
|
-
encoding: 'utf-8',
|
|
82
|
-
}).trim();
|
|
83
|
-
// Matches either https://github.com/owner/repo.git or git@github.com:owner/repo.git
|
|
84
|
-
const match = remoteUrl.match(/(?:https?:\/\/|git@)github\.com(?::|\/)([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
85
|
-
// If the regex fails match, throw an error.
|
|
86
|
-
if (!match || !match[1] || !match[2]) {
|
|
87
|
-
throw new Error(`Owner & repo could not be extracted from remote URL: ${remoteUrl}`);
|
|
88
|
-
}
|
|
89
|
-
return { owner: match[1], repo: match[2] };
|
|
90
23
|
}
|
|
91
24
|
//# sourceMappingURL=gitUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitUtils.js","sourceRoot":"","sources":["../../../src/utils/gitUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"gitUtils.js","sourceRoot":"","sources":["../../../src/utils/gitUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,QAAQ,CAAC,eAAe,EAAE;YACxC,QAAQ,EAAE,OAAO;SAClB,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,aAAa,CAAC;QAE9B,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,wDAAwD;QACxD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|