@vybestack/llxprt-code 0.4.3 → 0.4.5
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 +8 -0
- package/dist/package.json +3 -3
- package/dist/src/{ui/components/ProQuotaDialog.test.d.ts → auth/oauth-manager-initialization.spec.d.ts} +1 -1
- package/dist/src/auth/oauth-manager-initialization.spec.js +206 -0
- package/dist/src/auth/oauth-manager-initialization.spec.js.map +1 -0
- package/dist/src/auth/oauth-manager.js +4 -8
- package/dist/src/auth/oauth-manager.js.map +1 -1
- package/dist/src/config/cliEphemeralSettings.d.ts +9 -0
- package/dist/src/config/cliEphemeralSettings.js +28 -0
- package/dist/src/config/cliEphemeralSettings.js.map +1 -0
- package/dist/src/config/cliEphemeralSettings.test.d.ts +6 -0
- package/dist/src/config/cliEphemeralSettings.test.js +36 -0
- package/dist/src/config/cliEphemeralSettings.test.js.map +1 -0
- package/dist/src/config/config.d.ts +1 -0
- package/dist/src/config/config.js +14 -0
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/settings.js +8 -1
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.js +106 -133
- 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/providers/credentialPrecedence.d.ts +22 -0
- package/dist/src/providers/credentialPrecedence.js +44 -0
- package/dist/src/providers/credentialPrecedence.js.map +1 -0
- package/dist/src/providers/credentialPrecedence.test.d.ts +6 -0
- package/dist/src/providers/credentialPrecedence.test.js +52 -0
- package/dist/src/providers/credentialPrecedence.test.js.map +1 -0
- package/dist/src/providers/oauth-provider-registration.d.ts +21 -0
- package/dist/src/providers/oauth-provider-registration.js +55 -0
- package/dist/src/providers/oauth-provider-registration.js.map +1 -0
- package/dist/src/providers/providerManagerInstance.js +19 -12
- package/dist/src/providers/providerManagerInstance.js.map +1 -1
- package/dist/src/settings/ephemeralSettings.d.ts +17 -0
- package/dist/src/settings/ephemeralSettings.js +178 -0
- package/dist/src/settings/ephemeralSettings.js.map +1 -0
- package/dist/src/ui/App.js +14 -144
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +3 -2
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/setCommand.js +12 -184
- package/dist/src/ui/commands/setCommand.js.map +1 -1
- package/dist/src/ui/commands/setCommand.test.js +16 -0
- package/dist/src/ui/commands/setCommand.test.js.map +1 -1
- package/dist/src/ui/containers/SessionController.js +1 -60
- package/dist/src/ui/containers/SessionController.js.map +1 -1
- package/dist/src/ui/containers/SessionController.test.js +0 -101
- package/dist/src/ui/containers/SessionController.test.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +1 -1
- package/dist/src/ui/hooks/useGeminiStream.integration.test.js +1 -3
- package/dist/src/ui/hooks/useGeminiStream.integration.test.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +6 -12
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useTodoPausePreserver.d.ts +20 -0
- package/dist/src/ui/hooks/useTodoPausePreserver.js +31 -0
- package/dist/src/ui/hooks/useTodoPausePreserver.js.map +1 -0
- package/dist/src/ui/reducers/sessionReducer.d.ts +0 -4
- package/dist/src/ui/reducers/sessionReducer.js +0 -2
- package/dist/src/ui/reducers/sessionReducer.js.map +1 -1
- package/dist/src/ui/useTodoPausePreserver.test.d.ts +6 -0
- package/dist/src/ui/useTodoPausePreserver.test.js +21 -0
- package/dist/src/ui/useTodoPausePreserver.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/src/ui/components/ProQuotaDialog.d.ts +0 -13
- package/dist/src/ui/components/ProQuotaDialog.js +0 -22
- package/dist/src/ui/components/ProQuotaDialog.js.map +0 -1
- package/dist/src/ui/components/ProQuotaDialog.test.js +0 -57
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Vybestack LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { GeminiOAuthProvider } from '../auth/gemini-oauth-provider.js';
|
|
7
|
+
import { QwenOAuthProvider } from '../auth/qwen-oauth-provider.js';
|
|
8
|
+
import { AnthropicOAuthProvider } from '../auth/anthropic-oauth-provider.js';
|
|
9
|
+
/**
|
|
10
|
+
* Track which OAuth providers have been registered to avoid duplicate registration
|
|
11
|
+
*/
|
|
12
|
+
let registeredProviders = new Set();
|
|
13
|
+
/**
|
|
14
|
+
* Context-aware OAuth provider registration
|
|
15
|
+
* Only registers OAuth providers when actually needed for specific providers
|
|
16
|
+
*/
|
|
17
|
+
export function ensureOAuthProviderRegistered(providerName, oauthManager, tokenStore, addItem) {
|
|
18
|
+
if (registeredProviders.has(providerName) || !oauthManager) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
let oauthProvider = null;
|
|
22
|
+
switch (providerName) {
|
|
23
|
+
case 'gemini':
|
|
24
|
+
oauthProvider = new GeminiOAuthProvider(tokenStore);
|
|
25
|
+
break;
|
|
26
|
+
case 'qwen':
|
|
27
|
+
oauthProvider = new QwenOAuthProvider(tokenStore);
|
|
28
|
+
break;
|
|
29
|
+
case 'anthropic':
|
|
30
|
+
oauthProvider = new AnthropicOAuthProvider(tokenStore);
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
return; // No OAuth provider needed for this provider name
|
|
34
|
+
}
|
|
35
|
+
if (oauthProvider && addItem) {
|
|
36
|
+
oauthProvider.setAddItem?.(addItem);
|
|
37
|
+
}
|
|
38
|
+
if (oauthProvider) {
|
|
39
|
+
oauthManager.registerProvider(oauthProvider);
|
|
40
|
+
registeredProviders.add(providerName);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if an OAuth provider has been registered
|
|
45
|
+
*/
|
|
46
|
+
export function isOAuthProviderRegistered(providerName) {
|
|
47
|
+
return registeredProviders.has(providerName);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Reset registered providers (mainly for testing)
|
|
51
|
+
*/
|
|
52
|
+
export function resetRegisteredProviders() {
|
|
53
|
+
registeredProviders = new Set();
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=oauth-provider-registration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-provider-registration.js","sourceRoot":"","sources":["../../../src/providers/oauth-provider-registration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAK7E;;GAEG;AACH,IAAI,mBAAmB,GAAG,IAAI,GAAG,EAAU,CAAC;AAE5C;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC3C,YAAoB,EACpB,YAA0B,EAC1B,UAAmC,EACnC,OAGW;IAEX,IAAI,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QAC3D,OAAO;IACT,CAAC;IAED,IAAI,aAAa,GAAG,IAAI,CAAC;IAEzB,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,QAAQ;YACX,aAAa,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;YACpD,MAAM;QACR,KAAK,MAAM;YACT,aAAa,GAAG,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC;YAClD,MAAM;QACR,KAAK,WAAW;YACd,aAAa,GAAG,IAAI,sBAAsB,CAAC,UAAU,CAAC,CAAC;YACvD,MAAM;QACR;YACE,OAAO,CAAC,kDAAkD;IAC9D,CAAC;IAED,IAAI,aAAa,IAAI,OAAO,EAAE,CAAC;QAC7B,aAAa,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,aAAa,EAAE,CAAC;QAClB,YAAY,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAC7C,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,YAAoB;IAC5D,OAAO,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACtC,mBAAmB,GAAG,IAAI,GAAG,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -9,9 +9,7 @@ import { LoadedSettings, USER_SETTINGS_PATH, } from '../config/settings.js';
|
|
|
9
9
|
import stripJsonComments from 'strip-json-comments';
|
|
10
10
|
import { OAuthManager } from '../auth/oauth-manager.js';
|
|
11
11
|
import { MultiProviderTokenStore } from '../auth/types.js';
|
|
12
|
-
import {
|
|
13
|
-
import { QwenOAuthProvider } from '../auth/qwen-oauth-provider.js';
|
|
14
|
-
import { AnthropicOAuthProvider } from '../auth/anthropic-oauth-provider.js';
|
|
12
|
+
import { ensureOAuthProviderRegistered } from './oauth-provider-registration.js';
|
|
15
13
|
/**
|
|
16
14
|
* Sanitizes API keys to remove problematic characters that cause ByteString errors.
|
|
17
15
|
* This handles cases where API key files have encoding issues or contain
|
|
@@ -96,25 +94,26 @@ export function getProviderManager(config, allowBrowserEnvironment = false, sett
|
|
|
96
94
|
const tokenStore = new MultiProviderTokenStore();
|
|
97
95
|
const oauthManager = new OAuthManager(tokenStore, loadedSettings);
|
|
98
96
|
oauthManagerInstance = oauthManager;
|
|
99
|
-
//
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const anthropicOAuthProvider = new AnthropicOAuthProvider(tokenStore);
|
|
103
|
-
oauthManager.registerProvider(geminiOAuthProvider);
|
|
104
|
-
oauthManager.registerProvider(qwenOAuthProvider);
|
|
105
|
-
oauthManager.registerProvider(anthropicOAuthProvider);
|
|
97
|
+
// CRITICAL FIX: Don't register OAuth providers upfront
|
|
98
|
+
// They should be registered on-demand when actually needed
|
|
99
|
+
// This prevents premature OAuth initialization during MCP operations
|
|
106
100
|
// Set config BEFORE registering providers so logging wrapper works
|
|
107
101
|
if (config) {
|
|
108
102
|
providerManagerInstance.setConfig(config);
|
|
109
103
|
// CRITICAL: Set provider manager on config so LoggingProviderWrapper can accumulate tokens!
|
|
110
104
|
config.setProviderManager(providerManagerInstance);
|
|
111
105
|
}
|
|
112
|
-
//
|
|
106
|
+
// Register OAuth providers on-demand when creating actual providers
|
|
107
|
+
// Gemini Provider
|
|
113
108
|
const geminiProvider = new GeminiProvider(undefined, undefined, config, oauthManager);
|
|
114
109
|
if (config) {
|
|
115
110
|
geminiProvider.setConfig(config);
|
|
116
111
|
}
|
|
117
112
|
providerManagerInstance.registerProvider(geminiProvider);
|
|
113
|
+
// Register Gemini OAuth provider when Gemini provider is created
|
|
114
|
+
if (oauthManager && tokenStore) {
|
|
115
|
+
void ensureOAuthProviderRegistered('gemini', oauthManager, tokenStore, addItem);
|
|
116
|
+
}
|
|
118
117
|
// Gemini auth configuration removed - use explicit --key/--keyfile, /key//keyfile commands, profiles, env vars, or OAuth only
|
|
119
118
|
// Always register OpenAI provider
|
|
120
119
|
// Priority: Environment variable only - no automatic keyfile loading
|
|
@@ -163,6 +162,10 @@ export function getProviderManager(config, allowBrowserEnvironment = false, sett
|
|
|
163
162
|
configurable: true,
|
|
164
163
|
});
|
|
165
164
|
providerManagerInstance.registerProvider(qwenProvider);
|
|
165
|
+
// Register Qwen OAuth provider when Qwen provider is created
|
|
166
|
+
if (oauthManager && tokenStore) {
|
|
167
|
+
void ensureOAuthProviderRegistered('qwen', oauthManager, tokenStore, addItem);
|
|
168
|
+
}
|
|
166
169
|
// Register OpenAI Responses provider (for o1, o3 models)
|
|
167
170
|
// This provider exclusively uses the /responses endpoint
|
|
168
171
|
const openaiResponsesProvider = new OpenAIResponsesProvider(openaiApiKey || undefined, // Use same API key as OpenAI
|
|
@@ -180,8 +183,12 @@ export function getProviderManager(config, allowBrowserEnvironment = false, sett
|
|
|
180
183
|
allowBrowserEnvironment,
|
|
181
184
|
};
|
|
182
185
|
const anthropicProvider = new AnthropicProvider(anthropicApiKey || undefined, // Pass undefined instead of empty string to allow OAuth fallback
|
|
183
|
-
anthropicBaseUrl, anthropicProviderConfig, oauthManager);
|
|
186
|
+
anthropicBaseUrl, anthropicProviderConfig, anthropicApiKey ? undefined : oauthManager);
|
|
184
187
|
providerManagerInstance.registerProvider(anthropicProvider);
|
|
188
|
+
// Register Anthropic OAuth provider only if no API key is available
|
|
189
|
+
if (!anthropicApiKey && oauthManager && tokenStore) {
|
|
190
|
+
void ensureOAuthProviderRegistered('anthropic', oauthManager, tokenStore, addItem);
|
|
191
|
+
}
|
|
185
192
|
// Set default provider to gemini
|
|
186
193
|
providerManagerInstance.setActiveProvider('gemini');
|
|
187
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerManagerInstance.js","sourceRoot":"","sources":["../../../src/providers/providerManagerInstance.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAe,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAEL,cAAc,EACd,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"providerManagerInstance.js","sourceRoot":"","sources":["../../../src/providers/providerManagerInstance.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAe,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAEL,cAAc,EACd,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAGjF;;;;GAIG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,SAAS,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAE7C,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CACV,yFAAyF;YACvF,wEAAwE,CAC3E,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,IAAI,uBAAuB,GAA2B,IAAI,CAAC;AAC3D,IAAI,kBAAkB,GAAuB,IAAI,CAAC;AAClD,IAAI,oBAAoB,GAAwB,IAAI,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,EAAe;IAC3C,kBAAkB,GAAG,EAAE,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,SAAS,aAAa;IACpB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,kBAAkB,GAAG,IAAI,cAAc,EAAE,CAAC;IAC5C,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,MAAe,EACf,uBAAu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C;QACF,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAC7C,eAAe,IAAI,SAAS,EAAE,iEAAiE;QAC/F,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAC3C,CAAC;QACF,uBAAuB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;QAE5D,oEAAoE;QACpE,IAAI,CAAC,eAAe,IAAI,YAAY,IAAI,UAAU,EAAE,CAAC;YACnD,KAAK,6BAA6B,CAChC,WAAW,EACX,YAAY,EACZ,UAAU,EACV,OAAO,CACR,CAAC;QACJ,CAAC;QAED,iCAAiC;QACjC,uBAAuB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,uBAAuB,GAAG,IAAI,CAAC;IAC/B,kBAAkB,GAAG,IAAI,CAAC;IAC1B,oBAAoB,GAAG,IAAI,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED,OAAO,EAAE,kBAAkB,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Vybestack LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare const ephemeralSettingHelp: Record<string, string>;
|
|
7
|
+
export type EphemeralSettingKey = keyof typeof ephemeralSettingHelp;
|
|
8
|
+
export interface EphemeralParseSuccess {
|
|
9
|
+
success: true;
|
|
10
|
+
value: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface EphemeralParseFailure {
|
|
13
|
+
success: false;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export type EphemeralParseResult = EphemeralParseSuccess | EphemeralParseFailure;
|
|
17
|
+
export declare function parseEphemeralSettingValue(key: string, rawValue: string): EphemeralParseResult;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Vybestack LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export const ephemeralSettingHelp = {
|
|
7
|
+
'context-limit': 'Maximum number of tokens for the context window (e.g., 100000)',
|
|
8
|
+
'compression-threshold': 'Fraction of context limit that triggers compression (0.0-1.0, e.g., 0.7 for 70%)',
|
|
9
|
+
'base-url': 'Base URL for API requests',
|
|
10
|
+
'tool-format': 'Tool format override for the provider',
|
|
11
|
+
'api-version': 'API version to use',
|
|
12
|
+
'custom-headers': 'Custom HTTP headers as JSON object',
|
|
13
|
+
'stream-options': 'Stream options for OpenAI API (default: { include_usage: true })',
|
|
14
|
+
streaming: 'Enable or disable streaming responses (enabled/disabled, default: enabled)',
|
|
15
|
+
'shell-replacement': 'Allow command substitution ($(), <(), backticks) in shell commands (default: false)',
|
|
16
|
+
'socket-timeout': 'Request timeout in milliseconds for local AI servers (default: 60000)',
|
|
17
|
+
'socket-keepalive': 'Enable TCP keepalive for local AI server connections (true/false, default: true)',
|
|
18
|
+
'socket-nodelay': 'Enable TCP_NODELAY concept for local AI servers (true/false, default: true)',
|
|
19
|
+
'tool-output-max-items': 'Maximum number of items/files/matches returned by tools (default: 50)',
|
|
20
|
+
'tool-output-max-tokens': 'Maximum tokens in tool output (default: 50000)',
|
|
21
|
+
'tool-output-truncate-mode': 'How to handle exceeding limits: warn, truncate, or sample (default: warn)',
|
|
22
|
+
'tool-output-item-size-limit': 'Maximum size per item/file in bytes (default: 524288 = 512KB)',
|
|
23
|
+
'max-prompt-tokens': 'Maximum tokens allowed in any prompt sent to LLM (default: 200000)',
|
|
24
|
+
emojifilter: 'Emoji filter mode (allowed, auto, warn, error)',
|
|
25
|
+
retries: 'Maximum number of retry attempts for API calls (default: varies by provider)',
|
|
26
|
+
retrywait: 'Initial delay in milliseconds between retry attempts (default: varies by provider)',
|
|
27
|
+
maxTurnsPerPrompt: 'Maximum number of turns allowed per prompt before stopping (default: 100, -1 for unlimited)',
|
|
28
|
+
};
|
|
29
|
+
const validEphemeralKeys = Object.keys(ephemeralSettingHelp);
|
|
30
|
+
export function parseEphemeralSettingValue(key, rawValue) {
|
|
31
|
+
if (!validEphemeralKeys.includes(key)) {
|
|
32
|
+
return {
|
|
33
|
+
success: false,
|
|
34
|
+
message: `Invalid setting key: ${key}. Valid keys are: ${validEphemeralKeys.join(', ')}`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
let parsedValue = parseValue(rawValue);
|
|
38
|
+
if (key === 'compression-threshold') {
|
|
39
|
+
const numValue = parsedValue;
|
|
40
|
+
if (typeof numValue !== 'number' || numValue <= 0 || numValue > 1) {
|
|
41
|
+
return {
|
|
42
|
+
success: false,
|
|
43
|
+
message: 'compression-threshold must be a decimal between 0 and 1 (e.g., 0.7 for 70%)',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (key === 'context-limit') {
|
|
48
|
+
const numValue = parsedValue;
|
|
49
|
+
if (typeof numValue !== 'number' ||
|
|
50
|
+
numValue <= 0 ||
|
|
51
|
+
!Number.isInteger(numValue)) {
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
message: 'context-limit must be a positive integer (e.g., 100000)',
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (key === 'socket-timeout') {
|
|
59
|
+
const numValue = parsedValue;
|
|
60
|
+
if (typeof numValue !== 'number' ||
|
|
61
|
+
numValue <= 0 ||
|
|
62
|
+
!Number.isInteger(numValue)) {
|
|
63
|
+
return {
|
|
64
|
+
success: false,
|
|
65
|
+
message: 'socket-timeout must be a positive integer in milliseconds (e.g., 60000)',
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (key === 'socket-keepalive' || key === 'socket-nodelay') {
|
|
70
|
+
if (typeof parsedValue !== 'boolean') {
|
|
71
|
+
return {
|
|
72
|
+
success: false,
|
|
73
|
+
message: `${key} must be either 'true' or 'false'`,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (key === 'tool-output-max-items' ||
|
|
78
|
+
key === 'tool-output-max-tokens' ||
|
|
79
|
+
key === 'tool-output-item-size-limit' ||
|
|
80
|
+
key === 'max-prompt-tokens') {
|
|
81
|
+
const numValue = parsedValue;
|
|
82
|
+
if (typeof numValue !== 'number' ||
|
|
83
|
+
numValue <= 0 ||
|
|
84
|
+
!Number.isInteger(numValue)) {
|
|
85
|
+
return {
|
|
86
|
+
success: false,
|
|
87
|
+
message: `${key} must be a positive integer`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (key === 'maxTurnsPerPrompt') {
|
|
92
|
+
const numValue = parsedValue;
|
|
93
|
+
if (typeof numValue !== 'number' ||
|
|
94
|
+
!Number.isInteger(numValue) ||
|
|
95
|
+
(numValue !== -1 && numValue <= 0)) {
|
|
96
|
+
return {
|
|
97
|
+
success: false,
|
|
98
|
+
message: `${key} must be a positive integer or -1 for unlimited`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (key === 'tool-output-truncate-mode') {
|
|
103
|
+
const validModes = ['warn', 'truncate', 'sample'];
|
|
104
|
+
if (!validModes.includes(parsedValue)) {
|
|
105
|
+
return {
|
|
106
|
+
success: false,
|
|
107
|
+
message: `${key} must be one of: ${validModes.join(', ')}`,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (key === 'emojifilter') {
|
|
112
|
+
const validModes = ['allowed', 'auto', 'warn', 'error'];
|
|
113
|
+
const value = parsedValue;
|
|
114
|
+
const normalizedValue = value.toLowerCase();
|
|
115
|
+
if (!validModes.includes(normalizedValue)) {
|
|
116
|
+
return {
|
|
117
|
+
success: false,
|
|
118
|
+
message: `Invalid emoji filter mode '${parsedValue}'. Valid modes are: ${validModes.join(', ')}`,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
parsedValue = normalizedValue;
|
|
122
|
+
}
|
|
123
|
+
if (key === 'shell-replacement') {
|
|
124
|
+
if (typeof parsedValue !== 'boolean') {
|
|
125
|
+
return {
|
|
126
|
+
success: false,
|
|
127
|
+
message: `shell-replacement must be either 'true' or 'false'`,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (key === 'streaming') {
|
|
132
|
+
const validModes = ['enabled', 'disabled'];
|
|
133
|
+
if (typeof parsedValue === 'boolean') {
|
|
134
|
+
parsedValue = parsedValue ? 'enabled' : 'disabled';
|
|
135
|
+
}
|
|
136
|
+
else if (typeof parsedValue === 'string' &&
|
|
137
|
+
validModes.includes(parsedValue.toLowerCase())) {
|
|
138
|
+
parsedValue = parsedValue.toLowerCase();
|
|
139
|
+
}
|
|
140
|
+
else if (typeof parsedValue === 'string' &&
|
|
141
|
+
validModes.includes(parsedValue.trim().toLowerCase())) {
|
|
142
|
+
parsedValue = parsedValue.trim().toLowerCase();
|
|
143
|
+
}
|
|
144
|
+
else if (typeof parsedValue === 'string' &&
|
|
145
|
+
['true', 'false'].includes(parsedValue.toLowerCase())) {
|
|
146
|
+
parsedValue =
|
|
147
|
+
parsedValue.toLowerCase() === 'true' ? 'enabled' : 'disabled';
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
return {
|
|
151
|
+
success: false,
|
|
152
|
+
message: `Invalid streaming mode '${parsedValue}'. Valid modes are: ${validModes.join(', ')}`,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return { success: true, value: parsedValue };
|
|
157
|
+
}
|
|
158
|
+
function parseValue(value) {
|
|
159
|
+
if (/^-?\d+(\.\d+)?$/.test(value)) {
|
|
160
|
+
const num = Number(value);
|
|
161
|
+
if (!Number.isNaN(num)) {
|
|
162
|
+
return num;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (value.toLowerCase() === 'true') {
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
if (value.toLowerCase() === 'false') {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
try {
|
|
172
|
+
return JSON.parse(value);
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return value;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=ephemeralSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ephemeralSettings.js","sourceRoot":"","sources":["../../../src/settings/ephemeralSettings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IAC1D,eAAe,EACb,gEAAgE;IAClE,uBAAuB,EACrB,kFAAkF;IACpF,UAAU,EAAE,2BAA2B;IACvC,aAAa,EAAE,uCAAuC;IACtD,aAAa,EAAE,oBAAoB;IACnC,gBAAgB,EAAE,oCAAoC;IACtD,gBAAgB,EACd,kEAAkE;IACpE,SAAS,EACP,4EAA4E;IAC9E,mBAAmB,EACjB,qFAAqF;IACvF,gBAAgB,EACd,uEAAuE;IACzE,kBAAkB,EAChB,kFAAkF;IACpF,gBAAgB,EACd,6EAA6E;IAC/E,uBAAuB,EACrB,uEAAuE;IACzE,wBAAwB,EAAE,gDAAgD;IAC1E,2BAA2B,EACzB,2EAA2E;IAC7E,6BAA6B,EAC3B,+DAA+D;IACjE,mBAAmB,EACjB,oEAAoE;IACtE,WAAW,EAAE,gDAAgD;IAC7D,OAAO,EACL,8EAA8E;IAChF,SAAS,EACP,oFAAoF;IACtF,iBAAiB,EACf,6FAA6F;CAChG,CAAC;AAEF,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAkB7D,MAAM,UAAU,0BAA0B,CACxC,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import { HistoryItemDisplay } from './components/HistoryItemDisplay.js';
|
|
|
44
44
|
import { ContextSummaryDisplay } from './components/ContextSummaryDisplay.js';
|
|
45
45
|
import { useHistory } from './hooks/useHistoryManager.js';
|
|
46
46
|
import { useInputHistoryStore } from './hooks/useInputHistoryStore.js';
|
|
47
|
+
import { useTodoPausePreserver, TodoPausePreserver, } from './hooks/useTodoPausePreserver.js';
|
|
47
48
|
import process from 'node:process';
|
|
48
|
-
import { getErrorMessage, getAllLlxprtMdFilenames, ApprovalMode, isEditorAvailable,
|
|
49
|
+
import { getErrorMessage, getAllLlxprtMdFilenames, ApprovalMode, isEditorAvailable, ideContext, getSettingsService, DebugLogger, uiTelemetryService, } from '@vybestack/llxprt-code-core';
|
|
49
50
|
import { IdeIntegrationNudge, } from './IdeIntegrationNudge.js';
|
|
50
51
|
import { validateAuthMethod } from '../config/auth.js';
|
|
51
52
|
import { useLogger } from './hooks/useLogger.js';
|
|
@@ -73,7 +74,6 @@ import { ShowMoreLines } from './components/ShowMoreLines.js';
|
|
|
73
74
|
import { PrivacyNotice } from './privacy/PrivacyNotice.js';
|
|
74
75
|
import { useSettingsCommand } from './hooks/useSettingsCommand.js';
|
|
75
76
|
import { SettingsDialog } from './components/SettingsDialog.js';
|
|
76
|
-
import { ProQuotaDialog } from './components/ProQuotaDialog.js';
|
|
77
77
|
import { setUpdateHandler } from '../utils/handleAutoUpdate.js';
|
|
78
78
|
import { appEvents, AppEvent } from '../utils/events.js';
|
|
79
79
|
import { getProviderManager } from '../providers/providerManagerInstance.js';
|
|
@@ -119,6 +119,10 @@ const App = (props) => {
|
|
|
119
119
|
const nightly = version.includes('nightly');
|
|
120
120
|
const { history, addItem, clearItems, loadHistory } = useHistory();
|
|
121
121
|
const { updateTodos } = useTodoContext();
|
|
122
|
+
const todoPauseController = useMemo(() => new TodoPausePreserver(), []);
|
|
123
|
+
const registerTodoPause = useCallback(() => {
|
|
124
|
+
todoPauseController.registerTodoPause();
|
|
125
|
+
}, [todoPauseController]);
|
|
122
126
|
const [idePromptAnswered, setIdePromptAnswered] = useState(false);
|
|
123
127
|
const currentIDE = config.getIdeClient()?.getCurrentIde();
|
|
124
128
|
useEffect(() => {
|
|
@@ -238,16 +242,12 @@ const App = (props) => {
|
|
|
238
242
|
const ctrlDTimerRef = useRef(null);
|
|
239
243
|
const [constrainHeight, setConstrainHeight] = useState(true);
|
|
240
244
|
const [showPrivacyNotice, setShowPrivacyNotice] = useState(false);
|
|
241
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = useState(false);
|
|
242
|
-
const [userTier, setUserTier] = useState(undefined);
|
|
243
245
|
const [ideContextState, setIdeContextState] = useState();
|
|
244
246
|
const [showEscapePrompt, setShowEscapePrompt] = useState(false);
|
|
245
247
|
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = useState(false);
|
|
246
248
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
247
249
|
const [providerModels, setProviderModels] = useState([]);
|
|
248
250
|
const { showWorkspaceMigrationDialog, workspaceExtensions, onWorkspaceMigrationDialogOpen, onWorkspaceMigrationDialogClose, } = useWorkspaceMigration(settings);
|
|
249
|
-
const [isProQuotaDialogOpen, setIsProQuotaDialogOpen] = useState(false);
|
|
250
|
-
const [proQuotaDialogResolver, setProQuotaDialogResolver] = useState(null);
|
|
251
251
|
useEffect(() => {
|
|
252
252
|
const unsubscribe = ideContext.subscribeToIdeContext(setIdeContextState);
|
|
253
253
|
// Set the initial value
|
|
@@ -344,13 +344,6 @@ const App = (props) => {
|
|
|
344
344
|
settings.merged.useExternalAuth,
|
|
345
345
|
setAuthError,
|
|
346
346
|
]);
|
|
347
|
-
// Sync user tier from config when authentication changes
|
|
348
|
-
useEffect(() => {
|
|
349
|
-
// Only sync when not currently authenticating
|
|
350
|
-
if (!isAuthenticating) {
|
|
351
|
-
setUserTier(config.getGeminiClient()?.getUserTier());
|
|
352
|
-
}
|
|
353
|
-
}, [config, isAuthenticating]);
|
|
354
347
|
// Check for OAuth code needed flag
|
|
355
348
|
useEffect(() => {
|
|
356
349
|
const checkOAuthFlag = setInterval(() => {
|
|
@@ -491,111 +484,6 @@ const App = (props) => {
|
|
|
491
484
|
const interval = setInterval(updateTokenMetrics, 1000);
|
|
492
485
|
return () => clearInterval(interval);
|
|
493
486
|
}, []);
|
|
494
|
-
// Set up Flash fallback handler
|
|
495
|
-
useEffect(() => {
|
|
496
|
-
const flashFallbackHandler = async (currentModel, fallbackModel, error) => {
|
|
497
|
-
// Check if we've already switched to the fallback model
|
|
498
|
-
if (config.isInFallbackMode()) {
|
|
499
|
-
// If we're already in fallback mode, don't show the dialog again
|
|
500
|
-
return false;
|
|
501
|
-
}
|
|
502
|
-
let message;
|
|
503
|
-
const contentGenConfig = config.getContentGeneratorConfig();
|
|
504
|
-
const authType = contentGenConfig?.authType;
|
|
505
|
-
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
506
|
-
// Use actual user tier if available; otherwise, default to FREE tier behavior (safe default)
|
|
507
|
-
const isPaidTier = userTier === UserTierId.LEGACY || userTier === UserTierId.STANDARD;
|
|
508
|
-
// Check if this is a Pro quota exceeded error
|
|
509
|
-
if (error && isProQuotaExceededError(error)) {
|
|
510
|
-
if (isPaidTier) {
|
|
511
|
-
message = `⚡ You have reached your daily ${currentModel} quota limit.
|
|
512
|
-
⚡ You can choose to authenticate with a paid API key or continue with the fallback model.
|
|
513
|
-
⚡ To continue accessing the ${currentModel} model today, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
|
|
514
|
-
}
|
|
515
|
-
else {
|
|
516
|
-
message = `⚡ You have reached your daily ${currentModel} quota limit.
|
|
517
|
-
⚡ You can choose to authenticate with a paid API key or continue with the fallback model.
|
|
518
|
-
⚡ To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist
|
|
519
|
-
⚡ Or you can utilize a Gemini API Key. See: https://goo.gle/gemini-cli-docs-auth#gemini-api-key
|
|
520
|
-
⚡ You can switch authentication methods by typing /auth`;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
else if (error && isGenericQuotaExceededError(error)) {
|
|
524
|
-
if (isPaidTier) {
|
|
525
|
-
message = `You have reached your daily quota limit.
|
|
526
|
-
To continue, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey
|
|
527
|
-
Or you can switch to a different model using the /model command`;
|
|
528
|
-
}
|
|
529
|
-
else {
|
|
530
|
-
message = `You have reached your daily quota limit.
|
|
531
|
-
To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist
|
|
532
|
-
Or you can utilize a Gemini API Key. See: https://goo.gle/gemini-cli-docs-auth#gemini-api-key
|
|
533
|
-
You can switch authentication methods by typing /auth or switch to a different model using /model`;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
else {
|
|
537
|
-
if (isPaidTier) {
|
|
538
|
-
// Default message for other cases (like consecutive 429s)
|
|
539
|
-
message = `You are experiencing capacity issues with ${currentModel}.
|
|
540
|
-
Possible reasons are consecutive capacity errors or reaching your daily ${currentModel} quota limit.
|
|
541
|
-
To continue, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey
|
|
542
|
-
Or you can switch to a different model using the /model command`;
|
|
543
|
-
}
|
|
544
|
-
else {
|
|
545
|
-
// Default message for other cases (like consecutive 429s)
|
|
546
|
-
message = `You are experiencing capacity issues with ${currentModel}.
|
|
547
|
-
Possible reasons are consecutive capacity errors or reaching your daily ${currentModel} quota limit.
|
|
548
|
-
To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist
|
|
549
|
-
Or you can utilize a Gemini API Key. See: https://goo.gle/gemini-cli-docs-auth#gemini-api-key
|
|
550
|
-
You can switch authentication methods by typing /auth or switch to a different model using /model`;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
// Add message to UI history
|
|
554
|
-
if (message) {
|
|
555
|
-
addItem({
|
|
556
|
-
type: MessageType.INFO,
|
|
557
|
-
text: message,
|
|
558
|
-
}, Date.now());
|
|
559
|
-
}
|
|
560
|
-
// For Pro quota errors, show the dialog and wait for user's choice
|
|
561
|
-
if (error && isProQuotaExceededError(error)) {
|
|
562
|
-
// Set the flag to prevent tool continuation
|
|
563
|
-
setModelSwitchedFromQuotaError(true);
|
|
564
|
-
// Set global quota error flag to prevent Flash model calls
|
|
565
|
-
config.setQuotaErrorOccurred(true);
|
|
566
|
-
// Show the ProQuotaDialog and wait for user's choice
|
|
567
|
-
const shouldContinueWithFallback = await new Promise((resolve) => {
|
|
568
|
-
setIsProQuotaDialogOpen(true);
|
|
569
|
-
setProQuotaDialogResolver(() => resolve);
|
|
570
|
-
});
|
|
571
|
-
// If user chose to continue with fallback, we don't need to stop the current prompt
|
|
572
|
-
if (shouldContinueWithFallback) {
|
|
573
|
-
// Switch to fallback model for future use
|
|
574
|
-
config.setModel(fallbackModel);
|
|
575
|
-
config.setFallbackMode(true);
|
|
576
|
-
logFlashFallback(config, new FlashFallbackEvent(config.getContentGeneratorConfig()?.authType ||
|
|
577
|
-
AuthType.USE_PROVIDER));
|
|
578
|
-
return true; // Continue with current prompt using fallback model
|
|
579
|
-
}
|
|
580
|
-
// If user chose to authenticate, stop current prompt
|
|
581
|
-
return false;
|
|
582
|
-
}
|
|
583
|
-
// For other quota errors, automatically switch to fallback model
|
|
584
|
-
// Set the flag to prevent tool continuation
|
|
585
|
-
setModelSwitchedFromQuotaError(true);
|
|
586
|
-
// Set global quota error flag to prevent Flash model calls
|
|
587
|
-
config.setQuotaErrorOccurred(true);
|
|
588
|
-
}
|
|
589
|
-
// Don't switch models - let the user decide
|
|
590
|
-
// Don't set fallback mode either
|
|
591
|
-
const contentGenConfigForEvent = config.getContentGeneratorConfig();
|
|
592
|
-
const authTypeForEvent = contentGenConfigForEvent?.authType || AuthType.USE_PROVIDER;
|
|
593
|
-
// Still log the event for telemetry
|
|
594
|
-
logFlashFallback(config, new FlashFallbackEvent(authTypeForEvent));
|
|
595
|
-
return false; // Don't continue with current prompt
|
|
596
|
-
};
|
|
597
|
-
config.setFlashFallbackHandler(flashFallbackHandler);
|
|
598
|
-
}, [config, addItem, userTier]);
|
|
599
487
|
// Terminal and UI setup
|
|
600
488
|
const { rows: terminalHeight, columns: terminalWidth } = useTerminalSize();
|
|
601
489
|
const { stdin, setRawMode } = useStdin();
|
|
@@ -689,7 +577,7 @@ You can switch authentication methods by typing /auth or switch to a different m
|
|
|
689
577
|
}
|
|
690
578
|
}
|
|
691
579
|
}, []);
|
|
692
|
-
const { streamingState, submitQuery, initError, pendingHistoryItems: pendingGeminiHistoryItems, thought, cancelOngoingRequest, } = useGeminiStream(config.getGeminiClient(), history, addItem, config, settings, setDebugMessage, handleSlashCommand, shellModeActive, getPreferredEditor, onAuthError, performMemoryRefresh,
|
|
580
|
+
const { streamingState, submitQuery, initError, pendingHistoryItems: pendingGeminiHistoryItems, thought, cancelOngoingRequest, } = useGeminiStream(config.getGeminiClient(), history, addItem, config, settings, setDebugMessage, handleSlashCommand, shellModeActive, getPreferredEditor, onAuthError, performMemoryRefresh, refreshStatic, handleUserCancel, registerTodoPause);
|
|
693
581
|
const pendingHistoryItems = useMemo(() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems], [pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]);
|
|
694
582
|
// Message queue functionality removed - not implemented
|
|
695
583
|
// Update the cancel handler with message queue support
|
|
@@ -715,11 +603,11 @@ You can switch authentication methods by typing /auth or switch to a different m
|
|
|
715
603
|
submitQuery(trimmedValue);
|
|
716
604
|
}
|
|
717
605
|
}, [submitQuery, inputHistoryStore]);
|
|
718
|
-
const handleUserInputSubmit =
|
|
719
|
-
|
|
720
|
-
updateTodos
|
|
721
|
-
handleFinalSubmit
|
|
722
|
-
}
|
|
606
|
+
const { handleUserInputSubmit } = useTodoPausePreserver({
|
|
607
|
+
controller: todoPauseController,
|
|
608
|
+
updateTodos,
|
|
609
|
+
handleFinalSubmit,
|
|
610
|
+
});
|
|
723
611
|
const handleIdePromptComplete = useCallback((result) => {
|
|
724
612
|
if (result.userSelection === 'yes') {
|
|
725
613
|
if (result.isExtensionPreInstalled) {
|
|
@@ -738,23 +626,6 @@ You can switch authentication methods by typing /auth or switch to a different m
|
|
|
738
626
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
739
627
|
const { elapsedTime, currentLoadingPhrase } = useLoadingIndicator(streamingState, settings.merged.customWittyPhrases);
|
|
740
628
|
const showAutoAcceptIndicator = useAutoAcceptIndicator({ config, addItem });
|
|
741
|
-
const handleProQuotaChoice = useCallback((choice) => {
|
|
742
|
-
setIsProQuotaDialogOpen(false);
|
|
743
|
-
if (!proQuotaDialogResolver)
|
|
744
|
-
return;
|
|
745
|
-
const resolveValue = choice !== 'auth';
|
|
746
|
-
proQuotaDialogResolver(resolveValue);
|
|
747
|
-
setProQuotaDialogResolver(null);
|
|
748
|
-
if (choice === 'auth') {
|
|
749
|
-
openAuthDialog();
|
|
750
|
-
}
|
|
751
|
-
else {
|
|
752
|
-
addItem({
|
|
753
|
-
type: MessageType.INFO,
|
|
754
|
-
text: 'Switched to fallback model. Tip: Press Ctrl+P to recall your previous prompt and submit it again if you wish.',
|
|
755
|
-
}, Date.now());
|
|
756
|
-
}
|
|
757
|
-
}, [proQuotaDialogResolver, openAuthDialog, addItem]);
|
|
758
629
|
const handleExit = useCallback((pressedOnce, setPressedOnce, timerRef) => {
|
|
759
630
|
if (pressedOnce) {
|
|
760
631
|
if (timerRef.current) {
|
|
@@ -858,8 +729,7 @@ You can switch authentication methods by typing /auth or switch to a different m
|
|
|
858
729
|
const isInputActive = (streamingState === StreamingState.Idle ||
|
|
859
730
|
streamingState === StreamingState.Responding) &&
|
|
860
731
|
!initError &&
|
|
861
|
-
!isProcessing
|
|
862
|
-
!isProQuotaDialogOpen;
|
|
732
|
+
!isProcessing;
|
|
863
733
|
const handleClearScreen = useCallback(() => {
|
|
864
734
|
clearItems();
|
|
865
735
|
clearConsoleMessagesState();
|
|
@@ -969,7 +839,7 @@ You can switch authentication methods by typing /auth or switch to a different m
|
|
|
969
839
|
], children: (item) => item }, staticKey), _jsx(OverflowProvider, { children: _jsxs(Box, { ref: pendingHistoryItemRef, flexDirection: "column", children: [pendingHistoryItems.map((item, i) => (_jsx(HistoryItemDisplay, { availableTerminalHeight: constrainHeight ? availableTerminalHeight : undefined, terminalWidth: mainAreaWidth,
|
|
970
840
|
// TODO(taehykim): It seems like references to ids aren't necessary in
|
|
971
841
|
// HistoryItemDisplay. Refactor later. Use a fake id for now.
|
|
972
|
-
item: { ...item, id: 0 }, isPending: true, config: config, isFocused: !isEditorDialogOpen, slashCommands: slashCommands }, i))), _jsx(ShowMoreLines, { constrainHeight: constrainHeight })] }) }), _jsxs(Box, { flexDirection: "column", ref: mainControlsRef, children: [updateInfo && _jsx(UpdateNotification, { message: updateInfo.message }), startupWarnings.length > 0 && (_jsx(Box, { borderStyle: "round", borderColor: Colors.AccentYellow, paddingX: 1, marginY: 1, flexDirection: "column", children: startupWarnings.map((warning, index) => (_jsx(Text, { color: Colors.AccentYellow, children: warning }, index))) })), _jsx(TodoPanel, { width: inputWidth }), showWorkspaceMigrationDialog ? (_jsx(WorkspaceMigrationDialog, { workspaceExtensions: workspaceExtensions, onOpen: onWorkspaceMigrationDialogOpen, onClose: onWorkspaceMigrationDialogClose })) : shouldShowIdePrompt && currentIDE ? (_jsx(IdeIntegrationNudge, { ide: currentIDE, onComplete: handleIdePromptComplete })) :
|
|
842
|
+
item: { ...item, id: 0 }, isPending: true, config: config, isFocused: !isEditorDialogOpen, slashCommands: slashCommands }, i))), _jsx(ShowMoreLines, { constrainHeight: constrainHeight })] }) }), _jsxs(Box, { flexDirection: "column", ref: mainControlsRef, children: [updateInfo && _jsx(UpdateNotification, { message: updateInfo.message }), startupWarnings.length > 0 && (_jsx(Box, { borderStyle: "round", borderColor: Colors.AccentYellow, paddingX: 1, marginY: 1, flexDirection: "column", children: startupWarnings.map((warning, index) => (_jsx(Text, { color: Colors.AccentYellow, children: warning }, index))) })), _jsx(TodoPanel, { width: inputWidth }), showWorkspaceMigrationDialog ? (_jsx(WorkspaceMigrationDialog, { workspaceExtensions: workspaceExtensions, onOpen: onWorkspaceMigrationDialogOpen, onClose: onWorkspaceMigrationDialogClose })) : shouldShowIdePrompt && currentIDE ? (_jsx(IdeIntegrationNudge, { ide: currentIDE, onComplete: handleIdePromptComplete })) : showIdeRestartPrompt ? (_jsx(Box, { borderStyle: "round", borderColor: Colors.AccentYellow, paddingX: 1, children: _jsx(Text, { color: Colors.AccentYellow, children: "Workspace trust has changed. Press 'r' to restart Gemini to apply the changes." }) })) : isFolderTrustDialogOpen ? (_jsx(FolderTrustDialog, { onSelect: handleFolderTrustSelect, isRestarting: isRestarting })) : shellConfirmationRequest ? (_jsx(ShellConfirmationDialog, { request: shellConfirmationRequest })) : confirmationRequest ? (_jsxs(Box, { flexDirection: "column", children: [confirmationRequest.prompt, _jsx(Box, { paddingY: 1, children: _jsx(RadioButtonSelect, { isFocused: !!confirmationRequest, items: [
|
|
973
843
|
{ label: 'Yes', value: true },
|
|
974
844
|
{ label: 'No', value: false },
|
|
975
845
|
], onSelect: handleConfirmationSelect }) })] })) : isThemeDialogOpen ? (_jsxs(Box, { flexDirection: "column", children: [_themeError && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: Colors.AccentRed, children: _themeError }) })), _jsx(ThemeDialog, { onSelect: handleThemeSelect, onHighlight: handleThemeHighlight, settings: settings, availableTerminalHeight: constrainHeight
|