@vybestack/llxprt-code 0.1.15 → 0.1.16-hotfix1

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 (163) hide show
  1. package/README.md +37 -2
  2. package/dist/package.json +3 -3
  3. package/dist/src/config/config.d.ts +4 -1
  4. package/dist/src/config/config.js +151 -54
  5. package/dist/src/config/config.js.map +1 -1
  6. package/dist/src/config/settings.d.ts +11 -2
  7. package/dist/src/config/settings.js +84 -23
  8. package/dist/src/config/settings.js.map +1 -1
  9. package/dist/src/gemini.d.ts +2 -0
  10. package/dist/src/gemini.js +177 -21
  11. package/dist/src/gemini.js.map +1 -1
  12. package/dist/src/generated/git-commit.d.ts +1 -1
  13. package/dist/src/generated/git-commit.js +1 -1
  14. package/dist/src/generated/git-commit.js.map +1 -1
  15. package/dist/src/integration-tests/GITHUB_ACTIONS_README.md +41 -0
  16. package/dist/src/integration-tests/test-utils.d.ts +68 -0
  17. package/dist/src/integration-tests/test-utils.js +167 -0
  18. package/dist/src/integration-tests/test-utils.js.map +1 -0
  19. package/dist/src/nonInteractiveCli.js +24 -66
  20. package/dist/src/nonInteractiveCli.js.map +1 -1
  21. package/dist/src/providers/IFileSystem.d.ts +42 -0
  22. package/dist/src/providers/IFileSystem.js +46 -0
  23. package/dist/src/providers/IFileSystem.js.map +1 -0
  24. package/dist/src/providers/providerConfigUtils.d.ts +0 -4
  25. package/dist/src/providers/providerConfigUtils.js +21 -52
  26. package/dist/src/providers/providerConfigUtils.js.map +1 -1
  27. package/dist/src/providers/providerManagerInstance.d.ts +6 -1
  28. package/dist/src/providers/providerManagerInstance.js +117 -82
  29. package/dist/src/providers/providerManagerInstance.js.map +1 -1
  30. package/dist/src/services/BuiltinCommandLoader.js +11 -0
  31. package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
  32. package/dist/src/ui/App.js +61 -48
  33. package/dist/src/ui/App.js.map +1 -1
  34. package/dist/src/ui/commands/aboutCommand.js +2 -5
  35. package/dist/src/ui/commands/aboutCommand.js.map +1 -1
  36. package/dist/src/ui/commands/baseurlCommand.js +54 -9
  37. package/dist/src/ui/commands/baseurlCommand.js.map +1 -1
  38. package/dist/src/ui/commands/diagnosticsCommand.d.ts +10 -0
  39. package/dist/src/ui/commands/diagnosticsCommand.js +122 -0
  40. package/dist/src/ui/commands/diagnosticsCommand.js.map +1 -0
  41. package/dist/src/ui/commands/directoryCommand.d.ts +8 -0
  42. package/dist/src/ui/commands/directoryCommand.js +116 -0
  43. package/dist/src/ui/commands/directoryCommand.js.map +1 -0
  44. package/dist/src/ui/commands/ideCommand.js +101 -105
  45. package/dist/src/ui/commands/ideCommand.js.map +1 -1
  46. package/dist/src/ui/commands/initCommand.js +63 -31
  47. package/dist/src/ui/commands/initCommand.js.map +1 -1
  48. package/dist/src/ui/commands/keyCommand.js +75 -11
  49. package/dist/src/ui/commands/keyCommand.js.map +1 -1
  50. package/dist/src/ui/commands/keyfileCommand.js +54 -13
  51. package/dist/src/ui/commands/keyfileCommand.js.map +1 -1
  52. package/dist/src/ui/commands/memoryCommand.js +2 -1
  53. package/dist/src/ui/commands/memoryCommand.js.map +1 -1
  54. package/dist/src/ui/commands/modelCommand.js +2 -5
  55. package/dist/src/ui/commands/modelCommand.js.map +1 -1
  56. package/dist/src/ui/commands/profileCommand.d.ts +10 -0
  57. package/dist/src/ui/commands/profileCommand.js +592 -0
  58. package/dist/src/ui/commands/profileCommand.js.map +1 -0
  59. package/dist/src/ui/commands/providerCommand.js +46 -3
  60. package/dist/src/ui/commands/providerCommand.js.map +1 -1
  61. package/dist/src/ui/commands/setCommand.d.ts +7 -0
  62. package/dist/src/ui/commands/setCommand.js +431 -0
  63. package/dist/src/ui/commands/setCommand.js.map +1 -0
  64. package/dist/src/ui/commands/setupGithubCommand.d.ts +7 -0
  65. package/dist/src/ui/commands/setupGithubCommand.js +49 -0
  66. package/dist/src/ui/commands/setupGithubCommand.js.map +1 -0
  67. package/dist/src/ui/commands/types.d.ts +1 -1
  68. package/dist/src/ui/commands/types.js.map +1 -1
  69. package/dist/src/ui/components/DebugProfiler.d.ts +6 -0
  70. package/dist/src/ui/components/DebugProfiler.js +26 -0
  71. package/dist/src/ui/components/DebugProfiler.js.map +1 -0
  72. package/dist/src/ui/components/Footer.d.ts +1 -0
  73. package/dist/src/ui/components/Footer.js +5 -4
  74. package/dist/src/ui/components/Footer.js.map +1 -1
  75. package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +2 -1
  76. package/dist/src/ui/components/IDEContextDetailDisplay.js +3 -3
  77. package/dist/src/ui/components/IDEContextDetailDisplay.js.map +1 -1
  78. package/dist/src/ui/components/InputPrompt.js +123 -12
  79. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  80. package/dist/src/ui/components/LoadProfileDialog.d.ts +13 -0
  81. package/dist/src/ui/components/LoadProfileDialog.js +57 -0
  82. package/dist/src/ui/components/LoadProfileDialog.js.map +1 -0
  83. package/dist/src/ui/components/PrepareLabel.d.ts +15 -0
  84. package/dist/src/ui/components/PrepareLabel.js +16 -0
  85. package/dist/src/ui/components/PrepareLabel.js.map +1 -0
  86. package/dist/src/ui/components/ProviderModelDialog.js +75 -28
  87. package/dist/src/ui/components/ProviderModelDialog.js.map +1 -1
  88. package/dist/src/ui/components/SecureKeyInput.d.ts +15 -0
  89. package/dist/src/ui/components/SecureKeyInput.js +58 -0
  90. package/dist/src/ui/components/SecureKeyInput.js.map +1 -0
  91. package/dist/src/ui/components/SuggestionsDisplay.d.ts +1 -0
  92. package/dist/src/ui/components/SuggestionsDisplay.js +3 -3
  93. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
  94. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +15 -4
  95. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
  96. package/dist/src/ui/components/messages/UserMessage.js +4 -1
  97. package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
  98. package/dist/src/ui/components/shared/text-buffer.js +9 -14
  99. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  100. package/dist/src/ui/containers/SessionController.js +14 -15
  101. package/dist/src/ui/containers/SessionController.js.map +1 -1
  102. package/dist/src/ui/editors/editorSettingsManager.js +2 -0
  103. package/dist/src/ui/editors/editorSettingsManager.js.map +1 -1
  104. package/dist/src/ui/hooks/atCommandProcessor.js +56 -48
  105. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  106. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +1 -1
  107. package/dist/src/ui/hooks/slashCommandProcessor.js +13 -3
  108. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  109. package/dist/src/ui/hooks/useAuthCommand.js +9 -0
  110. package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
  111. package/dist/src/ui/hooks/useCompletion.d.ts +5 -5
  112. package/dist/src/ui/hooks/useCompletion.js +7 -407
  113. package/dist/src/ui/hooks/useCompletion.js.map +1 -1
  114. package/dist/src/ui/hooks/useGeminiStream.js +61 -10
  115. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  116. package/dist/src/ui/hooks/useLoadProfileDialog.d.ts +27 -0
  117. package/dist/src/ui/hooks/useLoadProfileDialog.js +138 -0
  118. package/dist/src/ui/hooks/useLoadProfileDialog.js.map +1 -0
  119. package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +19 -0
  120. package/dist/src/ui/hooks/useReverseSearchCompletion.js +54 -0
  121. package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -0
  122. package/dist/src/ui/hooks/useShellHistory.d.ts +1 -0
  123. package/dist/src/ui/hooks/useShellHistory.js +30 -7
  124. package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
  125. package/dist/src/ui/hooks/useSlashCompletion.d.ts +24 -0
  126. package/dist/src/ui/hooks/useSlashCompletion.js +451 -0
  127. package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -0
  128. package/dist/src/ui/reducers/appReducer.d.ts +3 -2
  129. package/dist/src/ui/reducers/appReducer.js +1 -0
  130. package/dist/src/ui/reducers/appReducer.js.map +1 -1
  131. package/dist/src/ui/utils/renderLoopDetector.js +3 -3
  132. package/dist/src/ui/utils/renderLoopDetector.js.map +1 -1
  133. package/dist/src/ui/utils/secureInputHandler.d.ts +46 -0
  134. package/dist/src/ui/utils/secureInputHandler.js +128 -0
  135. package/dist/src/ui/utils/secureInputHandler.js.map +1 -0
  136. package/dist/src/ui/utils/updateCheck.js +57 -12
  137. package/dist/src/ui/utils/updateCheck.js.map +1 -1
  138. package/dist/src/utils/gitUtils.d.ts +10 -0
  139. package/dist/src/utils/gitUtils.js +24 -0
  140. package/dist/src/utils/gitUtils.js.map +1 -0
  141. package/dist/src/utils/handleAutoUpdate.d.ts +2 -1
  142. package/dist/src/utils/handleAutoUpdate.js +8 -4
  143. package/dist/src/utils/handleAutoUpdate.js.map +1 -1
  144. package/dist/src/utils/sandbox-macos-permissive-closed.sb +6 -0
  145. package/dist/src/utils/sandbox-macos-permissive-open.sb +6 -0
  146. package/dist/src/utils/sandbox-macos-permissive-proxied.sb +6 -0
  147. package/dist/src/utils/sandbox-macos-restrictive-closed.sb +6 -0
  148. package/dist/src/utils/sandbox-macos-restrictive-open.sb +6 -0
  149. package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +6 -0
  150. package/dist/src/utils/sandbox.d.ts +2 -2
  151. package/dist/src/utils/sandbox.js +35 -11
  152. package/dist/src/utils/sandbox.js.map +1 -1
  153. package/dist/src/utils/spawnWrapper.d.ts +7 -0
  154. package/dist/src/utils/spawnWrapper.js +8 -0
  155. package/dist/src/utils/spawnWrapper.js.map +1 -0
  156. package/dist/src/validateNonInterActiveAuth.d.ts +2 -1
  157. package/dist/src/validateNonInterActiveAuth.js +31 -5
  158. package/dist/src/validateNonInterActiveAuth.js.map +1 -1
  159. package/dist/tsconfig.tsbuildinfo +1 -1
  160. package/package.json +3 -3
  161. package/dist/src/providers/enhanceConfigWithProviders.d.ts +0 -12
  162. package/dist/src/providers/enhanceConfigWithProviders.js +0 -16
  163. package/dist/src/providers/enhanceConfigWithProviders.js.map +0 -1
@@ -0,0 +1,592 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Vybestack LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { CommandKind, } from './types.js';
7
+ import { ProfileManager, AuthType, } from '@vybestack/llxprt-code-core';
8
+ import { SettingScope } from '../../config/settings.js';
9
+ /**
10
+ * Profile save subcommand
11
+ */
12
+ const saveCommand = {
13
+ name: 'save',
14
+ description: 'save current configuration to a profile',
15
+ kind: CommandKind.BUILT_IN,
16
+ completion: async (_context, partialArg) => {
17
+ const profileManager = new ProfileManager();
18
+ const profiles = await profileManager.listProfiles();
19
+ // Filter profiles based on partial argument
20
+ if (partialArg) {
21
+ // Handle quoted partial arguments
22
+ const unquoted = partialArg.startsWith('"')
23
+ ? partialArg.slice(1)
24
+ : partialArg;
25
+ return profiles.filter((profile) => profile.startsWith(unquoted));
26
+ }
27
+ return profiles;
28
+ },
29
+ action: async (context, args) => {
30
+ // Parse profile name from args
31
+ const trimmedArgs = args?.trim();
32
+ if (!trimmedArgs) {
33
+ // For now, show usage until dialog system is implemented
34
+ return {
35
+ type: 'message',
36
+ messageType: 'error',
37
+ content: 'Usage: /profile save "<profile-name>"',
38
+ };
39
+ }
40
+ // Extract profile name - handle quoted names
41
+ const profileNameMatch = trimmedArgs.match(/^"([^"]+)"$/);
42
+ const profileName = profileNameMatch ? profileNameMatch[1] : trimmedArgs;
43
+ if (!profileName) {
44
+ return {
45
+ type: 'message',
46
+ messageType: 'error',
47
+ content: 'Usage: /profile save "<profile-name>"',
48
+ };
49
+ }
50
+ // Validate profile name - basic validation
51
+ if (profileName.includes('/') || profileName.includes('\\')) {
52
+ return {
53
+ type: 'message',
54
+ messageType: 'error',
55
+ content: 'Profile name cannot contain path separators',
56
+ };
57
+ }
58
+ try {
59
+ // Check if config is available
60
+ if (!context.services.config) {
61
+ return {
62
+ type: 'message',
63
+ messageType: 'error',
64
+ content: 'No configuration available',
65
+ };
66
+ }
67
+ // Get current provider and model
68
+ const providerName = context.services.config.getProvider();
69
+ const modelName = context.services.config.getModel();
70
+ // Get the provider manager and active provider
71
+ const providerManager = context.services.config.getProviderManager();
72
+ const activeProvider = providerManager?.getActiveProvider();
73
+ // Get model params from provider
74
+ let modelParams = {};
75
+ if (activeProvider &&
76
+ 'getModelParams' in activeProvider &&
77
+ activeProvider.getModelParams) {
78
+ modelParams = activeProvider.getModelParams() || {};
79
+ }
80
+ // Get ephemeral settings from config
81
+ const allEphemeralSettings = context.services.config.getEphemeralSettings();
82
+ const ephemeralKeys = [
83
+ 'context-limit',
84
+ 'compression-threshold',
85
+ 'base-url',
86
+ 'tool-format',
87
+ 'api-version',
88
+ 'custom-headers',
89
+ ];
90
+ const ephemeralSettings = {};
91
+ for (const key of ephemeralKeys) {
92
+ const value = allEphemeralSettings[key];
93
+ if (value !== undefined) {
94
+ ephemeralSettings[key] = value;
95
+ }
96
+ }
97
+ // Get auth-keyfile from ephemeral settings (set by /keyfile command)
98
+ const ephemeralKeyfile = allEphemeralSettings['auth-keyfile'];
99
+ if (ephemeralKeyfile) {
100
+ ephemeralSettings['auth-keyfile'] =
101
+ ephemeralKeyfile;
102
+ // Don't save auth-key if using keyfile
103
+ }
104
+ else {
105
+ // Get auth-key from ephemeral settings (set by /key command)
106
+ const ephemeralApiKey = allEphemeralSettings['auth-key'];
107
+ if (ephemeralApiKey) {
108
+ ephemeralSettings['auth-key'] =
109
+ ephemeralApiKey;
110
+ }
111
+ }
112
+ // Fallback: Check persistent settings for base-url if not in ephemeral
113
+ // This handles the case where base-url was set with the old command
114
+ if (!ephemeralSettings['base-url']) {
115
+ const allSettings = context.services.settings.merged || {};
116
+ const providerBaseUrls = allSettings.providerBaseUrls || {};
117
+ if (providerName && providerBaseUrls[providerName]) {
118
+ ephemeralSettings['base-url'] =
119
+ providerBaseUrls[providerName];
120
+ }
121
+ }
122
+ // Create profile object
123
+ const profile = {
124
+ version: 1,
125
+ provider: providerName || '',
126
+ model: modelName || '',
127
+ modelParams,
128
+ ephemeralSettings: ephemeralSettings,
129
+ };
130
+ // Save profile
131
+ const profileManager = new ProfileManager();
132
+ await profileManager.saveProfile(profileName, profile);
133
+ return {
134
+ type: 'message',
135
+ messageType: 'info',
136
+ content: `Profile '${profileName}' saved`,
137
+ };
138
+ }
139
+ catch (error) {
140
+ return {
141
+ type: 'message',
142
+ messageType: 'error',
143
+ content: `Failed to save profile: ${error instanceof Error ? error.message : String(error)}`,
144
+ };
145
+ }
146
+ },
147
+ };
148
+ /**
149
+ * Profile load subcommand
150
+ */
151
+ const loadCommand = {
152
+ name: 'load',
153
+ description: 'load configuration from a saved profile',
154
+ kind: CommandKind.BUILT_IN,
155
+ completion: async (_context, partialArg) => {
156
+ const profileManager = new ProfileManager();
157
+ const profiles = await profileManager.listProfiles();
158
+ // Filter profiles based on partial argument
159
+ if (partialArg) {
160
+ // Handle quoted partial arguments
161
+ const unquoted = partialArg.startsWith('"')
162
+ ? partialArg.slice(1)
163
+ : partialArg;
164
+ return profiles.filter((profile) => profile.startsWith(unquoted));
165
+ }
166
+ return profiles;
167
+ },
168
+ action: async (context, args) => {
169
+ // Parse profile name from args
170
+ const trimmedArgs = args?.trim();
171
+ if (!trimmedArgs) {
172
+ // Open interactive profile selection dialog
173
+ return {
174
+ type: 'dialog',
175
+ dialog: 'loadProfile',
176
+ };
177
+ }
178
+ // Extract profile name - handle quoted names
179
+ const profileNameMatch = trimmedArgs.match(/^"([^"]+)"$/);
180
+ const profileName = profileNameMatch ? profileNameMatch[1] : trimmedArgs;
181
+ if (!profileName) {
182
+ return {
183
+ type: 'message',
184
+ messageType: 'error',
185
+ content: 'Usage: /profile load "<profile-name>"',
186
+ };
187
+ }
188
+ // Validate profile name - basic validation
189
+ if (profileName.includes('/') || profileName.includes('\\')) {
190
+ return {
191
+ type: 'message',
192
+ messageType: 'error',
193
+ content: 'Profile name cannot contain path separators',
194
+ };
195
+ }
196
+ try {
197
+ // Check if config is available
198
+ if (!context.services.config) {
199
+ return {
200
+ type: 'message',
201
+ messageType: 'error',
202
+ content: 'No configuration available',
203
+ };
204
+ }
205
+ // Load the profile
206
+ const profileManager = new ProfileManager();
207
+ const profile = await profileManager.loadProfile(profileName);
208
+ // Apply settings in the correct order:
209
+ // 1. Set provider first
210
+ const providerManager = context.services.config.getProviderManager();
211
+ if (providerManager) {
212
+ providerManager.setActiveProvider(profile.provider);
213
+ // Ensure provider manager is set on config
214
+ context.services.config.setProviderManager(providerManager);
215
+ // Update the provider in config
216
+ context.services.config.setProvider(profile.provider);
217
+ }
218
+ // 2. Set model second
219
+ console.debug(`[Profile Load] Setting model to ${profile.model}`);
220
+ context.services.config.setModel(profile.model);
221
+ // Also set model on the provider
222
+ const activeProviderForModel = providerManager?.getActiveProvider();
223
+ if (activeProviderForModel && activeProviderForModel.setModel) {
224
+ console.debug(`[Profile Load] Setting model on provider to ${profile.model}`);
225
+ activeProviderForModel.setModel(profile.model);
226
+ }
227
+ // 3. Clear existing ephemeral settings first
228
+ const ephemeralKeys = [
229
+ 'auth-key',
230
+ 'auth-keyfile',
231
+ 'context-limit',
232
+ 'compression-threshold',
233
+ 'base-url',
234
+ 'tool-format',
235
+ 'api-version',
236
+ 'custom-headers',
237
+ ];
238
+ // Clear all known ephemeral settings
239
+ for (const key of ephemeralKeys) {
240
+ context.services.config.setEphemeralSetting(key, undefined);
241
+ }
242
+ // Reset GeminiClient compression settings
243
+ const geminiClient = context.services.config.getGeminiClient();
244
+ if (geminiClient) {
245
+ geminiClient.setCompressionSettings(undefined, undefined);
246
+ }
247
+ // Clear model parameters on the provider
248
+ const activeProvider = providerManager?.getActiveProvider();
249
+ if (activeProvider &&
250
+ 'setModelParams' in activeProvider &&
251
+ activeProvider.setModelParams) {
252
+ // Clear all existing model params by passing undefined
253
+ activeProvider.setModelParams(undefined);
254
+ }
255
+ // 4. Apply ephemeral settings from profile
256
+ for (const [key, value] of Object.entries(profile.ephemeralSettings)) {
257
+ // Store in ephemeral settings
258
+ context.services.config.setEphemeralSetting(key, value);
259
+ // Special handling for auth-key, auth-keyfile, and base-url
260
+ if (key === 'auth-key' && typeof value === 'string') {
261
+ // Directly set API key on the provider without saving to persistent settings
262
+ const activeProvider = providerManager?.getActiveProvider();
263
+ if (activeProvider && activeProvider.setApiKey) {
264
+ activeProvider.setApiKey(value);
265
+ }
266
+ }
267
+ else if (key === 'auth-keyfile' && typeof value === 'string') {
268
+ // Load API key from file
269
+ try {
270
+ const { promises: fs } = await import('fs');
271
+ const { homedir } = await import('os');
272
+ const resolvedPath = value.replace(/^~/, homedir());
273
+ const apiKey = (await fs.readFile(resolvedPath, 'utf-8')).trim();
274
+ const activeProvider = providerManager?.getActiveProvider();
275
+ if (activeProvider && activeProvider.setApiKey && apiKey) {
276
+ activeProvider.setApiKey(apiKey);
277
+ }
278
+ }
279
+ catch (error) {
280
+ // Log error but continue loading profile
281
+ console.error(`Failed to load keyfile ${value}:`, error);
282
+ }
283
+ }
284
+ else if (key === 'base-url' && typeof value === 'string') {
285
+ // Directly set base URL on the provider without saving to persistent settings
286
+ const activeProvider = providerManager?.getActiveProvider();
287
+ if (activeProvider && activeProvider.setBaseUrl) {
288
+ // Handle "none" as clearing the base URL
289
+ if (value === 'none') {
290
+ console.debug('[Profile] Clearing base URL (value was "none")');
291
+ activeProvider.setBaseUrl(undefined);
292
+ }
293
+ else {
294
+ console.debug(`[Profile] Setting base URL to: ${value}`);
295
+ activeProvider.setBaseUrl(value);
296
+ }
297
+ }
298
+ }
299
+ }
300
+ // Apply compression settings if they exist in the profile
301
+ const contextLimit = profile.ephemeralSettings['context-limit'];
302
+ const compressionThreshold = profile.ephemeralSettings['compression-threshold'];
303
+ if ((contextLimit !== undefined || compressionThreshold !== undefined) &&
304
+ geminiClient) {
305
+ geminiClient.setCompressionSettings(compressionThreshold, contextLimit);
306
+ }
307
+ // 5. Call provider.setModelParams() with the profile's model params
308
+ if (activeProvider &&
309
+ 'setModelParams' in activeProvider &&
310
+ activeProvider.setModelParams) {
311
+ if (profile.modelParams &&
312
+ Object.keys(profile.modelParams).length > 0) {
313
+ activeProvider.setModelParams(profile.modelParams);
314
+ }
315
+ }
316
+ // 6. Refresh auth to ensure provider is properly initialized
317
+ const currentAuthType = context.services.config.getContentGeneratorConfig()?.authType ||
318
+ AuthType.LOGIN_WITH_GOOGLE;
319
+ await context.services.config.refreshAuth(currentAuthType);
320
+ return {
321
+ type: 'message',
322
+ messageType: 'info',
323
+ content: `Profile '${profileName}' loaded`,
324
+ };
325
+ }
326
+ catch (error) {
327
+ // Handle specific error messages
328
+ if (error instanceof Error) {
329
+ if (error.message.includes('not found')) {
330
+ return {
331
+ type: 'message',
332
+ messageType: 'error',
333
+ content: `Profile '${profileName}' not found`,
334
+ };
335
+ }
336
+ if (error.message.includes('corrupted')) {
337
+ return {
338
+ type: 'message',
339
+ messageType: 'error',
340
+ content: `Profile '${profileName}' is corrupted`,
341
+ };
342
+ }
343
+ if (error.message.includes('missing required fields')) {
344
+ return {
345
+ type: 'message',
346
+ messageType: 'error',
347
+ content: `Profile '${profileName}' is invalid: missing required fields`,
348
+ };
349
+ }
350
+ return {
351
+ type: 'message',
352
+ messageType: 'error',
353
+ content: `Failed to load profile: ${error.message}`,
354
+ };
355
+ }
356
+ return {
357
+ type: 'message',
358
+ messageType: 'error',
359
+ content: `Failed to load profile: ${String(error)}`,
360
+ };
361
+ }
362
+ },
363
+ };
364
+ /**
365
+ * Profile delete subcommand
366
+ */
367
+ const deleteCommand = {
368
+ name: 'delete',
369
+ description: 'delete a saved profile',
370
+ kind: CommandKind.BUILT_IN,
371
+ completion: async (_context, partialArg) => {
372
+ const profileManager = new ProfileManager();
373
+ const profiles = await profileManager.listProfiles();
374
+ // Filter profiles based on partial argument
375
+ if (partialArg) {
376
+ // Handle quoted partial arguments
377
+ const unquoted = partialArg.startsWith('"')
378
+ ? partialArg.slice(1)
379
+ : partialArg;
380
+ return profiles.filter((profile) => profile.startsWith(unquoted));
381
+ }
382
+ return profiles;
383
+ },
384
+ action: async (context, args) => {
385
+ // Parse profile name from args
386
+ const trimmedArgs = args?.trim();
387
+ if (!trimmedArgs) {
388
+ // For now, show usage until dialog system is implemented
389
+ return {
390
+ type: 'message',
391
+ messageType: 'error',
392
+ content: 'Usage: /profile delete "<profile-name>"',
393
+ };
394
+ }
395
+ // Extract profile name - handle quoted names
396
+ const profileNameMatch = trimmedArgs.match(/^"([^"]+)"$/);
397
+ const profileName = profileNameMatch ? profileNameMatch[1] : trimmedArgs;
398
+ if (!profileName) {
399
+ return {
400
+ type: 'message',
401
+ messageType: 'error',
402
+ content: 'Usage: /profile delete "<profile-name>"',
403
+ };
404
+ }
405
+ // Validate profile name - basic validation
406
+ if (profileName.includes('/') || profileName.includes('\\')) {
407
+ return {
408
+ type: 'message',
409
+ messageType: 'error',
410
+ content: 'Profile name cannot contain path separators',
411
+ };
412
+ }
413
+ try {
414
+ // Delete the profile
415
+ const profileManager = new ProfileManager();
416
+ await profileManager.deleteProfile(profileName);
417
+ return {
418
+ type: 'message',
419
+ messageType: 'info',
420
+ content: `Profile '${profileName}' deleted`,
421
+ };
422
+ }
423
+ catch (error) {
424
+ // Handle specific error messages
425
+ if (error instanceof Error) {
426
+ if (error.message.includes('not found')) {
427
+ return {
428
+ type: 'message',
429
+ messageType: 'error',
430
+ content: `Profile '${profileName}' not found`,
431
+ };
432
+ }
433
+ return {
434
+ type: 'message',
435
+ messageType: 'error',
436
+ content: `Failed to delete profile: ${error.message}`,
437
+ };
438
+ }
439
+ return {
440
+ type: 'message',
441
+ messageType: 'error',
442
+ content: `Failed to delete profile: ${String(error)}`,
443
+ };
444
+ }
445
+ },
446
+ };
447
+ /**
448
+ * Profile set-default subcommand
449
+ */
450
+ const setDefaultCommand = {
451
+ name: 'set-default',
452
+ description: 'set a profile to load automatically on startup',
453
+ kind: CommandKind.BUILT_IN,
454
+ completion: async (_context, partialArg) => {
455
+ const profileManager = new ProfileManager();
456
+ const profiles = await profileManager.listProfiles();
457
+ // Add 'none' option to clear default
458
+ const options = ['none', ...profiles];
459
+ // Filter based on partial argument
460
+ if (partialArg) {
461
+ const unquoted = partialArg.startsWith('"')
462
+ ? partialArg.slice(1)
463
+ : partialArg;
464
+ return options.filter((option) => option.startsWith(unquoted));
465
+ }
466
+ return options;
467
+ },
468
+ action: async (context, args) => {
469
+ // Parse profile name from args
470
+ const trimmedArgs = args?.trim();
471
+ if (!trimmedArgs) {
472
+ return {
473
+ type: 'message',
474
+ messageType: 'error',
475
+ content: 'Usage: /profile set-default "<profile-name>" or /profile set-default none',
476
+ };
477
+ }
478
+ // Extract profile name - handle quoted names
479
+ const profileNameMatch = trimmedArgs.match(/^"([^"]+)"$/);
480
+ const profileName = profileNameMatch ? profileNameMatch[1] : trimmedArgs;
481
+ if (!profileName) {
482
+ return {
483
+ type: 'message',
484
+ messageType: 'error',
485
+ content: 'Usage: /profile set-default "<profile-name>" or /profile set-default none',
486
+ };
487
+ }
488
+ try {
489
+ // Check if settings service is available
490
+ if (!context.services.settings) {
491
+ return {
492
+ type: 'message',
493
+ messageType: 'error',
494
+ content: 'Settings service not available',
495
+ };
496
+ }
497
+ if (profileName.toLowerCase() === 'none') {
498
+ // Clear the default profile
499
+ context.services.settings.setValue(SettingScope.User, 'defaultProfile', undefined);
500
+ return {
501
+ type: 'message',
502
+ messageType: 'info',
503
+ content: 'Default profile cleared. Gemini will start with default settings.',
504
+ };
505
+ }
506
+ // Verify profile exists
507
+ const profileManager = new ProfileManager();
508
+ const profiles = await profileManager.listProfiles();
509
+ if (!profiles.includes(profileName)) {
510
+ return {
511
+ type: 'message',
512
+ messageType: 'error',
513
+ content: `Profile '${profileName}' not found. Use /profile list to see available profiles.`,
514
+ };
515
+ }
516
+ // Set the default profile
517
+ context.services.settings.setValue(SettingScope.User, 'defaultProfile', profileName);
518
+ return {
519
+ type: 'message',
520
+ messageType: 'info',
521
+ content: `Profile '${profileName}' set as default. It will be loaded automatically on startup.`,
522
+ };
523
+ }
524
+ catch (error) {
525
+ return {
526
+ type: 'message',
527
+ messageType: 'error',
528
+ content: `Failed to set default profile: ${error instanceof Error ? error.message : String(error)}`,
529
+ };
530
+ }
531
+ },
532
+ };
533
+ /**
534
+ * Profile list subcommand
535
+ */
536
+ const listCommand = {
537
+ name: 'list',
538
+ description: 'list all saved profiles',
539
+ kind: CommandKind.BUILT_IN,
540
+ action: async (_context, _args) => {
541
+ try {
542
+ const profileManager = new ProfileManager();
543
+ const profiles = await profileManager.listProfiles();
544
+ if (profiles.length === 0) {
545
+ return {
546
+ type: 'message',
547
+ messageType: 'info',
548
+ content: 'No profiles saved yet. Use /profile save "<name>" to create one.',
549
+ };
550
+ }
551
+ const profileList = profiles.map((name) => ` • ${name}`).join('\n');
552
+ return {
553
+ type: 'message',
554
+ messageType: 'info',
555
+ content: `Saved profiles:\n${profileList}`,
556
+ };
557
+ }
558
+ catch (error) {
559
+ return {
560
+ type: 'message',
561
+ messageType: 'error',
562
+ content: `Failed to list profiles: ${error instanceof Error ? error.message : String(error)}`,
563
+ };
564
+ }
565
+ },
566
+ };
567
+ /**
568
+ * Main profile command that handles subcommands
569
+ */
570
+ export const profileCommand = {
571
+ name: 'profile',
572
+ description: 'manage configuration profiles',
573
+ kind: CommandKind.BUILT_IN,
574
+ subCommands: [
575
+ saveCommand,
576
+ loadCommand,
577
+ deleteCommand,
578
+ setDefaultCommand,
579
+ listCommand,
580
+ ],
581
+ action: async (_context, _args) => ({
582
+ type: 'message',
583
+ messageType: 'info',
584
+ content: `Profile management commands:
585
+ /profile save "<name>" - Save current configuration
586
+ /profile load "<name>" - Load a saved profile
587
+ /profile delete "<name>" - Delete a saved profile
588
+ /profile set-default "<name>" - Set profile to load on startup (or "none")
589
+ /profile list - List all saved profiles`,
590
+ }),
591
+ };
592
+ //# sourceMappingURL=profileCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profileCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/profileCommand.ts"],"names":[],"mappings":"A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