@google/gemini-cli 0.36.0-preview.8 → 0.36.0
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/bundle/{chunk-N22U7LIR.js → chunk-2OFO4ODK.js} +4 -4
- package/bundle/{chunk-QBLIM2T2.js → chunk-EAXTBDLN.js} +3 -3
- package/bundle/{chunk-FWCJAF6L.js → chunk-GHJNEZXJ.js} +57 -69
- package/bundle/{chunk-5JDHTAA3.js → chunk-QVTX2M5J.js} +4 -4
- package/bundle/{chunk-UUJ4JLTB.js → chunk-UNM3DGTG.js} +3 -3
- package/bundle/{chunk-5Y6Y7SEB.js → chunk-VB55KQW3.js} +10495 -5615
- package/bundle/{core-N4UNRLQA.js → core-6V2OYDRU.js} +1 -1
- package/bundle/{dist-QEB25IFU.js → core-BMLL5RF4.js} +2 -2
- package/bundle/{devtoolsService-7D3WUF33.js → devtoolsService-QTW7GHQP.js} +2 -2
- package/bundle/{devtoolsService-NA7MR5UO.js → devtoolsService-UL6JE436.js} +4 -5
- package/bundle/{devtoolsService-Y53ZUB56.js → devtoolsService-ZKU2HLK2.js} +2 -2
- package/bundle/{dist-HD2ZHBHJ.js → dist-PYC2JXAJ.js} +1 -1
- package/bundle/gemini.js +6 -6
- package/bundle/{interactiveCli-LFO7EWZS.js → interactiveCli-A6HZ2TDO.js} +3 -3
- package/bundle/{interactiveCli-A6H7VTMC.js → interactiveCli-DWMSDCKV.js} +235 -252
- package/bundle/{interactiveCli-2JRQPNZP.js → interactiveCli-VLQHRXHU.js} +3 -3
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-QOWLZC44.js → oauth2-provider-5ENESIRQ.js} +1 -1
- package/bundle/{oauth2-provider-2WD22PTI.js → oauth2-provider-CAKFQRQV.js} +1 -1
- package/bundle/{oauth2-provider-34BPLPQX.js → oauth2-provider-RVED6DAZ.js} +73 -39
- package/package.json +1 -1
- package/bundle/chunk-642LNT3F.js +0 -97905
- package/bundle/chunk-X6CSYCBW.js +0 -354180
- package/bundle/devtoolsService-VU7N6PSG.js +0 -854
- package/bundle/dist-JYY2GAAR.js +0 -1886
- package/bundle/interactiveCli-R5N55BDV.js +0 -49299
- package/bundle/oauth2-provider-MZAUZWUS.js +0 -237
|
@@ -182,14 +182,12 @@ import {
|
|
|
182
182
|
widestLineFromStyledChars,
|
|
183
183
|
wordBreakStyledChars,
|
|
184
184
|
wrapStyledChars
|
|
185
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-EAXTBDLN.js";
|
|
186
186
|
import {
|
|
187
187
|
ApiKeyUpdatedEvent,
|
|
188
188
|
AsyncFzf,
|
|
189
189
|
AuthType,
|
|
190
|
-
CompressionStatus,
|
|
191
190
|
ConversationFinishedEvent,
|
|
192
|
-
CoreToolCallStatus,
|
|
193
191
|
CreditPurchaseClickEvent,
|
|
194
192
|
EDITOR_DISPLAY_NAMES,
|
|
195
193
|
EmptyWalletMenuShownEvent,
|
|
@@ -198,15 +196,10 @@ import {
|
|
|
198
196
|
FileSearchFactory,
|
|
199
197
|
FolderTrustDiscoveryService,
|
|
200
198
|
G1_UTM_CAMPAIGNS,
|
|
201
|
-
GeminiCliOperation,
|
|
202
|
-
GeminiEventType,
|
|
203
199
|
GitService,
|
|
204
200
|
IdeClient,
|
|
205
201
|
LlmRole,
|
|
206
202
|
Logger,
|
|
207
|
-
MCPDiscoveryState,
|
|
208
|
-
MCPServerStatus,
|
|
209
|
-
MessageSenderType,
|
|
210
203
|
ModelNotFoundError,
|
|
211
204
|
ModelSlashCommandEvent,
|
|
212
205
|
OverageMenuShownEvent,
|
|
@@ -215,8 +208,6 @@ import {
|
|
|
215
208
|
ProjectIdRequiredError,
|
|
216
209
|
ROOT_SCHEDULER_ID,
|
|
217
210
|
Scheduler,
|
|
218
|
-
SessionEndReason,
|
|
219
|
-
SessionStartSource,
|
|
220
211
|
ShellExecutionService,
|
|
221
212
|
SlashCommandStatus,
|
|
222
213
|
TerminalQuotaError,
|
|
@@ -224,7 +215,6 @@ import {
|
|
|
224
215
|
UserPromptEvent,
|
|
225
216
|
UserTierId,
|
|
226
217
|
ValidationRequiredError,
|
|
227
|
-
WarningPriority,
|
|
228
218
|
addMCPStatusChangeListener,
|
|
229
219
|
allowEditorTypeInSandbox,
|
|
230
220
|
buildG1Url,
|
|
@@ -301,12 +291,10 @@ import {
|
|
|
301
291
|
validatePlanContent,
|
|
302
292
|
validatePlanPath,
|
|
303
293
|
writeToStdout
|
|
304
|
-
} from "./chunk-
|
|
294
|
+
} from "./chunk-VB55KQW3.js";
|
|
305
295
|
import {
|
|
306
296
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
307
|
-
ApprovalMode,
|
|
308
297
|
ChangeAuthRequestedError,
|
|
309
|
-
CoreEvent,
|
|
310
298
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
311
299
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
312
300
|
DEFAULT_GEMINI_MODEL,
|
|
@@ -314,19 +302,14 @@ import {
|
|
|
314
302
|
EDIT_TOOL_NAMES,
|
|
315
303
|
FinishReason,
|
|
316
304
|
GEMINI_DIR,
|
|
317
|
-
Kind,
|
|
318
|
-
MessageBusType,
|
|
319
305
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
320
306
|
PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
|
|
321
307
|
PREVIEW_GEMINI_3_1_MODEL,
|
|
322
308
|
PREVIEW_GEMINI_FLASH_MODEL,
|
|
323
309
|
PREVIEW_GEMINI_MODEL,
|
|
324
310
|
PREVIEW_GEMINI_MODEL_AUTO,
|
|
325
|
-
QuestionType,
|
|
326
311
|
SHELL_TOOL_NAME,
|
|
327
312
|
Storage,
|
|
328
|
-
ToolConfirmationOutcome,
|
|
329
|
-
ToolErrorType,
|
|
330
313
|
UnauthorizedError,
|
|
331
314
|
VALID_GEMINI_MODELS,
|
|
332
315
|
coreEvents,
|
|
@@ -346,7 +329,7 @@ import {
|
|
|
346
329
|
safeJsonToMarkdown,
|
|
347
330
|
shortenPath,
|
|
348
331
|
tildeifyPath
|
|
349
|
-
} from "./chunk-
|
|
332
|
+
} from "./chunk-MYI75E6G.js";
|
|
350
333
|
import "./chunk-664ZODQF.js";
|
|
351
334
|
import "./chunk-RJTRUG2J.js";
|
|
352
335
|
import "./chunk-IUUIT4SU.js";
|
|
@@ -22274,7 +22257,7 @@ function calculateShellMaxLines(options) {
|
|
|
22274
22257
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
22275
22258
|
return maxLinesBasedOnHeight;
|
|
22276
22259
|
}
|
|
22277
|
-
const isExecuting = status ===
|
|
22260
|
+
const isExecuting = status === "executing" /* Executing */;
|
|
22278
22261
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
22279
22262
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
22280
22263
|
}
|
|
@@ -22307,10 +22290,10 @@ function isShellTool(name) {
|
|
|
22307
22290
|
return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME;
|
|
22308
22291
|
}
|
|
22309
22292
|
function isThisShellFocusable(name, status, config) {
|
|
22310
|
-
return !!(isShellTool(name) && status ===
|
|
22293
|
+
return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
|
|
22311
22294
|
}
|
|
22312
22295
|
function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
|
|
22313
|
-
return !!(isShellTool(name) && status ===
|
|
22296
|
+
return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
|
|
22314
22297
|
}
|
|
22315
22298
|
function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
|
|
22316
22299
|
const [userHasFocused, setUserHasFocused] = (0, import_react21.useState)(false);
|
|
@@ -22853,7 +22836,7 @@ var ToolMessage = ({
|
|
|
22853
22836
|
paddingX: 1,
|
|
22854
22837
|
flexDirection: "column",
|
|
22855
22838
|
children: [
|
|
22856
|
-
status ===
|
|
22839
|
+
status === "executing" /* Executing */ && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
22857
22840
|
McpProgressIndicator,
|
|
22858
22841
|
{
|
|
22859
22842
|
progress,
|
|
@@ -22870,8 +22853,8 @@ var ToolMessage = ({
|
|
|
22870
22853
|
terminalWidth,
|
|
22871
22854
|
renderOutputAsMarkdown,
|
|
22872
22855
|
hasFocus: isThisShellFocused2,
|
|
22873
|
-
maxLines: kind ===
|
|
22874
|
-
overflowDirection: kind ===
|
|
22856
|
+
maxLines: kind === "agent" /* Agent */ && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
22857
|
+
overflowDirection: kind === "agent" /* Agent */ ? "bottom" : "top"
|
|
22875
22858
|
}
|
|
22876
22859
|
),
|
|
22877
22860
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -23596,7 +23579,7 @@ var ShellToolMessage = ({
|
|
|
23596
23579
|
maxLinesLimit: maxLines
|
|
23597
23580
|
});
|
|
23598
23581
|
import_react29.default.useEffect(() => {
|
|
23599
|
-
const isExecuting = status ===
|
|
23582
|
+
const isExecuting = status === "executing" /* Executing */;
|
|
23600
23583
|
if (isExecuting && ptyId) {
|
|
23601
23584
|
try {
|
|
23602
23585
|
const childWidth = terminalWidth - 4;
|
|
@@ -23929,14 +23912,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
|
|
|
23929
23912
|
if (isTrackedToolCall(t)) {
|
|
23930
23913
|
return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
|
|
23931
23914
|
} else {
|
|
23932
|
-
return t.status !==
|
|
23915
|
+
return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
|
|
23933
23916
|
}
|
|
23934
23917
|
});
|
|
23935
23918
|
const isEmbeddedShellFocused = toolsToInspect.some((t) => {
|
|
23936
23919
|
if (isTrackedToolCall(t)) {
|
|
23937
23920
|
return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
|
|
23938
23921
|
} else {
|
|
23939
|
-
return isShellTool(t.name) && t.status ===
|
|
23922
|
+
return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
|
|
23940
23923
|
}
|
|
23941
23924
|
});
|
|
23942
23925
|
const isShellCommand = toolsToInspect.some((t) => {
|
|
@@ -23971,7 +23954,7 @@ var ToolGroupMessage = ({
|
|
|
23971
23954
|
const isLowErrorVerbosity = settings.merged.ui?.errorVerbosity !== "full";
|
|
23972
23955
|
const toolCalls = (0, import_react31.useMemo)(
|
|
23973
23956
|
() => allToolCalls.filter((t) => {
|
|
23974
|
-
if (isLowErrorVerbosity && t.status ===
|
|
23957
|
+
if (isLowErrorVerbosity && t.status === "error" /* Error */ && !t.isClientInitiated) {
|
|
23975
23958
|
return false;
|
|
23976
23959
|
}
|
|
23977
23960
|
return !shouldHideToolCall({
|
|
@@ -24020,15 +24003,15 @@ var ToolGroupMessage = ({
|
|
|
24020
24003
|
);
|
|
24021
24004
|
let countToolCallsWithResults = 0;
|
|
24022
24005
|
for (const tool of visibleToolCalls) {
|
|
24023
|
-
if (tool.kind !==
|
|
24006
|
+
if (tool.kind !== "agent" /* Agent */ && tool.resultDisplay !== void 0 && tool.resultDisplay !== "") {
|
|
24024
24007
|
countToolCallsWithResults++;
|
|
24025
24008
|
}
|
|
24026
24009
|
}
|
|
24027
|
-
const countOneLineToolCalls = visibleToolCalls.filter((t) => t.kind !==
|
|
24010
|
+
const countOneLineToolCalls = visibleToolCalls.filter((t) => t.kind !== "agent" /* Agent */).length - countToolCallsWithResults;
|
|
24028
24011
|
const groupedTools = (0, import_react31.useMemo)(() => {
|
|
24029
24012
|
const groups = [];
|
|
24030
24013
|
for (const tool of visibleToolCalls) {
|
|
24031
|
-
if (tool.kind ===
|
|
24014
|
+
if (tool.kind === "agent" /* Agent */) {
|
|
24032
24015
|
const lastGroup = groups[groups.length - 1];
|
|
24033
24016
|
if (Array.isArray(lastGroup)) {
|
|
24034
24017
|
lastGroup.push(tool);
|
|
@@ -24181,18 +24164,18 @@ function CompressionMessage({
|
|
|
24181
24164
|
return "Compressing chat history";
|
|
24182
24165
|
}
|
|
24183
24166
|
switch (compressionStatus) {
|
|
24184
|
-
case
|
|
24167
|
+
case 1 /* COMPRESSED */:
|
|
24185
24168
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
24186
|
-
case
|
|
24169
|
+
case 2 /* COMPRESSION_FAILED_INFLATED_TOKEN_COUNT */:
|
|
24187
24170
|
if (originalTokens < 5e4) {
|
|
24188
24171
|
return "Compression was not beneficial for this history size.";
|
|
24189
24172
|
}
|
|
24190
24173
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
24191
|
-
case
|
|
24174
|
+
case 3 /* COMPRESSION_FAILED_TOKEN_COUNT_ERROR */:
|
|
24192
24175
|
return "Could not compress chat history due to a token counting error.";
|
|
24193
|
-
case
|
|
24176
|
+
case 4 /* COMPRESSION_FAILED_EMPTY_SUMMARY */:
|
|
24194
24177
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
24195
|
-
case
|
|
24178
|
+
case 5 /* NOOP */:
|
|
24196
24179
|
return "Nothing to compress.";
|
|
24197
24180
|
default:
|
|
24198
24181
|
return "";
|
|
@@ -24938,7 +24921,7 @@ var StatsDisplay = ({
|
|
|
24938
24921
|
const config = useConfig();
|
|
24939
24922
|
const useGemini3_1 = config.getGemini31LaunchedSync?.() ?? false;
|
|
24940
24923
|
const useGemini3_1FlashLite = config.getGemini31FlashLiteLaunchedSync?.() ?? false;
|
|
24941
|
-
const useCustomToolModel = useGemini3_1 && config.getContentGeneratorConfig().authType ===
|
|
24924
|
+
const useCustomToolModel = useGemini3_1 && config.getContentGeneratorConfig().authType === "gemini-api-key" /* USE_GEMINI */;
|
|
24942
24925
|
const pooledRemaining = quotaStats?.remaining;
|
|
24943
24926
|
const pooledLimit = quotaStats?.limit;
|
|
24944
24927
|
const pooledResetTime = quotaStats?.resetTime;
|
|
@@ -25168,8 +25151,8 @@ var ModelStatsDisplay = ({
|
|
|
25168
25151
|
return validRoles.includes(role);
|
|
25169
25152
|
}).sort((a, b) => {
|
|
25170
25153
|
if (a === b) return 0;
|
|
25171
|
-
if (a ===
|
|
25172
|
-
if (b ===
|
|
25154
|
+
if (a === "main" /* MAIN */) return -1;
|
|
25155
|
+
if (b === "main" /* MAIN */) return 1;
|
|
25173
25156
|
return a.localeCompare(b);
|
|
25174
25157
|
});
|
|
25175
25158
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -25953,7 +25936,7 @@ var McpStatus = ({
|
|
|
25953
25936
|
);
|
|
25954
25937
|
const originalStatus = serverStatus(serverName);
|
|
25955
25938
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
25956
|
-
const status = originalStatus ===
|
|
25939
|
+
const status = originalStatus === "disconnected" /* DISCONNECTED */ && hasCachedItems ? "connected" /* CONNECTED */ : originalStatus;
|
|
25957
25940
|
let statusIndicator = "";
|
|
25958
25941
|
let statusText = "";
|
|
25959
25942
|
let statusColor = theme.text.primary;
|
|
@@ -25965,17 +25948,17 @@ var McpStatus = ({
|
|
|
25965
25948
|
statusColor = theme.text.secondary;
|
|
25966
25949
|
} else {
|
|
25967
25950
|
switch (status) {
|
|
25968
|
-
case
|
|
25951
|
+
case "connected" /* CONNECTED */:
|
|
25969
25952
|
statusIndicator = "\u{1F7E2}";
|
|
25970
25953
|
statusText = "Ready";
|
|
25971
25954
|
statusColor = theme.status.success;
|
|
25972
25955
|
break;
|
|
25973
|
-
case
|
|
25956
|
+
case "connecting" /* CONNECTING */:
|
|
25974
25957
|
statusIndicator = "\u{1F504}";
|
|
25975
25958
|
statusText = "Starting... (first startup may take longer)";
|
|
25976
25959
|
statusColor = theme.status.warning;
|
|
25977
25960
|
break;
|
|
25978
|
-
case
|
|
25961
|
+
case "disconnected" /* DISCONNECTED */:
|
|
25979
25962
|
default:
|
|
25980
25963
|
statusIndicator = "\u{1F534}";
|
|
25981
25964
|
statusText = "Disconnected";
|
|
@@ -26023,12 +26006,12 @@ var McpStatus = ({
|
|
|
26023
26006
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Text, { children: [
|
|
26024
26007
|
" - ",
|
|
26025
26008
|
statusText,
|
|
26026
|
-
status ===
|
|
26009
|
+
status === "connected" /* CONNECTED */ && parts.length > 0 && ` (${parts.join(", ")})`
|
|
26027
26010
|
] }),
|
|
26028
26011
|
authStatusNode
|
|
26029
26012
|
] }),
|
|
26030
|
-
status ===
|
|
26031
|
-
status ===
|
|
26013
|
+
status === "connecting" /* CONNECTING */ && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
26014
|
+
status === "disconnected" /* DISCONNECTED */ && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Text, { children: [
|
|
26032
26015
|
" (",
|
|
26033
26016
|
toolCount,
|
|
26034
26017
|
" tools cached)"
|
|
@@ -26506,7 +26489,7 @@ var Notifications = () => {
|
|
|
26506
26489
|
if (dismissed) return [];
|
|
26507
26490
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
26508
26491
|
return startupWarnings.filter((w) => {
|
|
26509
|
-
if (w.priority ===
|
|
26492
|
+
if (w.priority === "low" /* Low */) {
|
|
26510
26493
|
const count = counts[w.id] || 0;
|
|
26511
26494
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
26512
26495
|
}
|
|
@@ -26519,7 +26502,7 @@ var Notifications = () => {
|
|
|
26519
26502
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
26520
26503
|
let changed = false;
|
|
26521
26504
|
visibleWarnings.forEach((w) => {
|
|
26522
|
-
if (w.priority ===
|
|
26505
|
+
if (w.priority === "low" /* Low */) {
|
|
26523
26506
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
26524
26507
|
changed = true;
|
|
26525
26508
|
}
|
|
@@ -26624,7 +26607,7 @@ var UserIdentity = ({ config }) => {
|
|
|
26624
26607
|
}
|
|
26625
26608
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
26626
26609
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Box_default, { children: [
|
|
26627
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
26610
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Text, { children: [
|
|
26628
26611
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Text, { bold: true, children: [
|
|
26629
26612
|
"Signed in with Google",
|
|
26630
26613
|
email ? ":" : ""
|
|
@@ -26851,7 +26834,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
26851
26834
|
return pendingHistoryItems.some((item) => {
|
|
26852
26835
|
if (item && item.type === "tool_group") {
|
|
26853
26836
|
return item.tools.some(
|
|
26854
|
-
(tool) =>
|
|
26837
|
+
(tool) => "executing" /* Executing */ === tool.status
|
|
26855
26838
|
);
|
|
26856
26839
|
}
|
|
26857
26840
|
return false;
|
|
@@ -26860,7 +26843,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
26860
26843
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
26861
26844
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
26862
26845
|
(item) => item.tools.some(
|
|
26863
|
-
(tool) =>
|
|
26846
|
+
(tool) => "awaiting_approval" /* AwaitingApproval */ === tool.status
|
|
26864
26847
|
)
|
|
26865
26848
|
);
|
|
26866
26849
|
}
|
|
@@ -26872,7 +26855,7 @@ function getAllToolCalls(historyItems) {
|
|
|
26872
26855
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
26873
26856
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
26874
26857
|
const confirmingTools = allPendingTools.filter(
|
|
26875
|
-
(tool) => tool.status ===
|
|
26858
|
+
(tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
|
|
26876
26859
|
);
|
|
26877
26860
|
if (confirmingTools.length === 0) {
|
|
26878
26861
|
return null;
|
|
@@ -26951,14 +26934,14 @@ var ToolActionsProvider = (props) => {
|
|
|
26951
26934
|
}
|
|
26952
26935
|
const details = tool.confirmationDetails;
|
|
26953
26936
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
26954
|
-
const cliOutcome = outcome ===
|
|
26937
|
+
const cliOutcome = outcome === "cancel" /* Cancel */ ? "rejected" : "accepted";
|
|
26955
26938
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
26956
26939
|
}
|
|
26957
26940
|
if (tool.correlationId) {
|
|
26958
26941
|
await config.getMessageBus().publish({
|
|
26959
|
-
type:
|
|
26942
|
+
type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
|
|
26960
26943
|
correlationId: tool.correlationId,
|
|
26961
|
-
confirmed: outcome !==
|
|
26944
|
+
confirmed: outcome !== "cancel" /* Cancel */,
|
|
26962
26945
|
requiresUserConfirmation: false,
|
|
26963
26946
|
outcome,
|
|
26964
26947
|
payload
|
|
@@ -26977,7 +26960,7 @@ var ToolActionsProvider = (props) => {
|
|
|
26977
26960
|
);
|
|
26978
26961
|
const cancel = (0, import_react43.useCallback)(
|
|
26979
26962
|
async (callId) => {
|
|
26980
|
-
await confirm(callId,
|
|
26963
|
+
await confirm(callId, "cancel" /* Cancel */);
|
|
26981
26964
|
},
|
|
26982
26965
|
[confirm]
|
|
26983
26966
|
);
|
|
@@ -28244,7 +28227,7 @@ var ExitPlanModeDialog = ({
|
|
|
28244
28227
|
{
|
|
28245
28228
|
questions: [
|
|
28246
28229
|
{
|
|
28247
|
-
type:
|
|
28230
|
+
type: "choice" /* CHOICE */,
|
|
28248
28231
|
header: "Approval",
|
|
28249
28232
|
question: planContent,
|
|
28250
28233
|
options: [
|
|
@@ -28265,9 +28248,9 @@ var ExitPlanModeDialog = ({
|
|
|
28265
28248
|
onSubmit: (answers) => {
|
|
28266
28249
|
const answer = answers["0"];
|
|
28267
28250
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
28268
|
-
onApprove(
|
|
28251
|
+
onApprove("autoEdit" /* AUTO_EDIT */);
|
|
28269
28252
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
28270
|
-
onApprove(
|
|
28253
|
+
onApprove("default" /* DEFAULT */);
|
|
28271
28254
|
} else if (answer) {
|
|
28272
28255
|
onFeedback(answer);
|
|
28273
28256
|
}
|
|
@@ -28473,7 +28456,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
28473
28456
|
);
|
|
28474
28457
|
(0, import_react48.useEffect)(() => {
|
|
28475
28458
|
if (isCancelling) {
|
|
28476
|
-
handleConfirm(
|
|
28459
|
+
handleConfirm("cancel" /* Cancel */);
|
|
28477
28460
|
}
|
|
28478
28461
|
}, [isCancelling, handleConfirm]);
|
|
28479
28462
|
const handleSelect = (0, import_react48.useCallback)(
|
|
@@ -28486,19 +28469,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
28486
28469
|
if (!confirmationDetails.isModifying) {
|
|
28487
28470
|
options2.push({
|
|
28488
28471
|
label: "Allow once",
|
|
28489
|
-
value:
|
|
28472
|
+
value: "proceed_once" /* ProceedOnce */,
|
|
28490
28473
|
key: "Allow once"
|
|
28491
28474
|
});
|
|
28492
28475
|
if (isTrustedFolder) {
|
|
28493
28476
|
options2.push({
|
|
28494
28477
|
label: "Allow for this session",
|
|
28495
|
-
value:
|
|
28478
|
+
value: "proceed_always" /* ProceedAlways */,
|
|
28496
28479
|
key: "Allow for this session"
|
|
28497
28480
|
});
|
|
28498
28481
|
if (allowPermanentApproval) {
|
|
28499
28482
|
options2.push({
|
|
28500
28483
|
label: "Allow for this file in all future sessions",
|
|
28501
|
-
value:
|
|
28484
|
+
value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
|
|
28502
28485
|
key: "Allow for this file in all future sessions"
|
|
28503
28486
|
});
|
|
28504
28487
|
}
|
|
@@ -28506,119 +28489,119 @@ ${deceptiveUrlWarnings.map(
|
|
|
28506
28489
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
28507
28490
|
options2.push({
|
|
28508
28491
|
label: "Modify with external editor",
|
|
28509
|
-
value:
|
|
28492
|
+
value: "modify_with_editor" /* ModifyWithEditor */,
|
|
28510
28493
|
key: "Modify with external editor"
|
|
28511
28494
|
});
|
|
28512
28495
|
}
|
|
28513
28496
|
options2.push({
|
|
28514
28497
|
label: "No, suggest changes (esc)",
|
|
28515
|
-
value:
|
|
28498
|
+
value: "cancel" /* Cancel */,
|
|
28516
28499
|
key: "No, suggest changes (esc)"
|
|
28517
28500
|
});
|
|
28518
28501
|
}
|
|
28519
28502
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
28520
28503
|
options2.push({
|
|
28521
28504
|
label: "Allow once",
|
|
28522
|
-
value:
|
|
28505
|
+
value: "proceed_once" /* ProceedOnce */,
|
|
28523
28506
|
key: "Allow once"
|
|
28524
28507
|
});
|
|
28525
28508
|
if (isTrustedFolder) {
|
|
28526
28509
|
options2.push({
|
|
28527
28510
|
label: "Allow for this session",
|
|
28528
|
-
value:
|
|
28511
|
+
value: "proceed_always" /* ProceedAlways */,
|
|
28529
28512
|
key: "Allow for this session"
|
|
28530
28513
|
});
|
|
28531
28514
|
if (allowPermanentApproval) {
|
|
28532
28515
|
options2.push({
|
|
28533
28516
|
label: "Allow for all future sessions",
|
|
28534
|
-
value:
|
|
28517
|
+
value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
|
|
28535
28518
|
key: "Allow for all future sessions"
|
|
28536
28519
|
});
|
|
28537
28520
|
}
|
|
28538
28521
|
}
|
|
28539
28522
|
options2.push({
|
|
28540
28523
|
label: "No, suggest changes (esc)",
|
|
28541
|
-
value:
|
|
28524
|
+
value: "cancel" /* Cancel */,
|
|
28542
28525
|
key: "No, suggest changes (esc)"
|
|
28543
28526
|
});
|
|
28544
28527
|
} else if (confirmationDetails.type === "exec") {
|
|
28545
28528
|
options2.push({
|
|
28546
28529
|
label: "Allow once",
|
|
28547
|
-
value:
|
|
28530
|
+
value: "proceed_once" /* ProceedOnce */,
|
|
28548
28531
|
key: "Allow once"
|
|
28549
28532
|
});
|
|
28550
28533
|
if (isTrustedFolder) {
|
|
28551
28534
|
options2.push({
|
|
28552
28535
|
label: `Allow for this session`,
|
|
28553
|
-
value:
|
|
28536
|
+
value: "proceed_always" /* ProceedAlways */,
|
|
28554
28537
|
key: `Allow for this session`
|
|
28555
28538
|
});
|
|
28556
28539
|
if (allowPermanentApproval) {
|
|
28557
28540
|
options2.push({
|
|
28558
28541
|
label: `Allow this command for all future sessions`,
|
|
28559
|
-
value:
|
|
28542
|
+
value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
|
|
28560
28543
|
key: `Allow for all future sessions`
|
|
28561
28544
|
});
|
|
28562
28545
|
}
|
|
28563
28546
|
}
|
|
28564
28547
|
options2.push({
|
|
28565
28548
|
label: "No, suggest changes (esc)",
|
|
28566
|
-
value:
|
|
28549
|
+
value: "cancel" /* Cancel */,
|
|
28567
28550
|
key: "No, suggest changes (esc)"
|
|
28568
28551
|
});
|
|
28569
28552
|
} else if (confirmationDetails.type === "info") {
|
|
28570
28553
|
options2.push({
|
|
28571
28554
|
label: "Allow once",
|
|
28572
|
-
value:
|
|
28555
|
+
value: "proceed_once" /* ProceedOnce */,
|
|
28573
28556
|
key: "Allow once"
|
|
28574
28557
|
});
|
|
28575
28558
|
if (isTrustedFolder) {
|
|
28576
28559
|
options2.push({
|
|
28577
28560
|
label: "Allow for this session",
|
|
28578
|
-
value:
|
|
28561
|
+
value: "proceed_always" /* ProceedAlways */,
|
|
28579
28562
|
key: "Allow for this session"
|
|
28580
28563
|
});
|
|
28581
28564
|
if (allowPermanentApproval) {
|
|
28582
28565
|
options2.push({
|
|
28583
28566
|
label: "Allow for all future sessions",
|
|
28584
|
-
value:
|
|
28567
|
+
value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
|
|
28585
28568
|
key: "Allow for all future sessions"
|
|
28586
28569
|
});
|
|
28587
28570
|
}
|
|
28588
28571
|
}
|
|
28589
28572
|
options2.push({
|
|
28590
28573
|
label: "No, suggest changes (esc)",
|
|
28591
|
-
value:
|
|
28574
|
+
value: "cancel" /* Cancel */,
|
|
28592
28575
|
key: "No, suggest changes (esc)"
|
|
28593
28576
|
});
|
|
28594
28577
|
} else if (confirmationDetails.type === "mcp") {
|
|
28595
28578
|
options2.push({
|
|
28596
28579
|
label: "Allow once",
|
|
28597
|
-
value:
|
|
28580
|
+
value: "proceed_once" /* ProceedOnce */,
|
|
28598
28581
|
key: "Allow once"
|
|
28599
28582
|
});
|
|
28600
28583
|
if (isTrustedFolder) {
|
|
28601
28584
|
options2.push({
|
|
28602
28585
|
label: "Allow tool for this session",
|
|
28603
|
-
value:
|
|
28586
|
+
value: "proceed_always_tool" /* ProceedAlwaysTool */,
|
|
28604
28587
|
key: "Allow tool for this session"
|
|
28605
28588
|
});
|
|
28606
28589
|
options2.push({
|
|
28607
28590
|
label: "Allow all server tools for this session",
|
|
28608
|
-
value:
|
|
28591
|
+
value: "proceed_always_server" /* ProceedAlwaysServer */,
|
|
28609
28592
|
key: "Allow all server tools for this session"
|
|
28610
28593
|
});
|
|
28611
28594
|
if (allowPermanentApproval) {
|
|
28612
28595
|
options2.push({
|
|
28613
28596
|
label: "Allow tool for all future sessions",
|
|
28614
|
-
value:
|
|
28597
|
+
value: "proceed_always_and_save" /* ProceedAlwaysAndSave */,
|
|
28615
28598
|
key: "Allow tool for all future sessions"
|
|
28616
28599
|
});
|
|
28617
28600
|
}
|
|
28618
28601
|
}
|
|
28619
28602
|
options2.push({
|
|
28620
28603
|
label: "No, suggest changes (esc)",
|
|
28621
|
-
value:
|
|
28604
|
+
value: "cancel" /* Cancel */,
|
|
28622
28605
|
key: "No, suggest changes (esc)"
|
|
28623
28606
|
});
|
|
28624
28607
|
}
|
|
@@ -28663,7 +28646,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
28663
28646
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
28664
28647
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
28665
28648
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
28666
|
-
(o) => o.value ===
|
|
28649
|
+
(o) => o.value === "proceed_always_and_save" /* ProceedAlwaysAndSave */
|
|
28667
28650
|
);
|
|
28668
28651
|
if (alwaysAndSaveIndex !== -1) {
|
|
28669
28652
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -28679,10 +28662,10 @@ ${deceptiveUrlWarnings.map(
|
|
|
28679
28662
|
{
|
|
28680
28663
|
questions: confirmationDetails.questions,
|
|
28681
28664
|
onSubmit: (answers) => {
|
|
28682
|
-
handleConfirm(
|
|
28665
|
+
handleConfirm("proceed_once" /* ProceedOnce */, { answers });
|
|
28683
28666
|
},
|
|
28684
28667
|
onCancel: () => {
|
|
28685
|
-
handleConfirm(
|
|
28668
|
+
handleConfirm("cancel" /* Cancel */);
|
|
28686
28669
|
},
|
|
28687
28670
|
width: terminalWidth,
|
|
28688
28671
|
availableHeight: availableBodyContentHeight()
|
|
@@ -28703,19 +28686,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
28703
28686
|
planPath: confirmationDetails.planPath,
|
|
28704
28687
|
getPreferredEditor,
|
|
28705
28688
|
onApprove: (approvalMode) => {
|
|
28706
|
-
handleConfirm(
|
|
28689
|
+
handleConfirm("proceed_once" /* ProceedOnce */, {
|
|
28707
28690
|
approved: true,
|
|
28708
28691
|
approvalMode
|
|
28709
28692
|
});
|
|
28710
28693
|
},
|
|
28711
28694
|
onFeedback: (feedback) => {
|
|
28712
|
-
handleConfirm(
|
|
28695
|
+
handleConfirm("proceed_once" /* ProceedOnce */, {
|
|
28713
28696
|
approved: false,
|
|
28714
28697
|
feedback
|
|
28715
28698
|
});
|
|
28716
28699
|
},
|
|
28717
28700
|
onCancel: () => {
|
|
28718
|
-
handleConfirm(
|
|
28701
|
+
handleConfirm("cancel" /* Cancel */);
|
|
28719
28702
|
},
|
|
28720
28703
|
width: terminalWidth,
|
|
28721
28704
|
availableHeight: availableBodyContentHeight()
|
|
@@ -28792,7 +28775,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
28792
28775
|
);
|
|
28793
28776
|
let bodyContentHeight = availableBodyContentHeight();
|
|
28794
28777
|
let warnings = null;
|
|
28795
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
28778
|
+
const isAutoEdit = config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
|
|
28796
28779
|
if (containsRedirection && !isAutoEdit) {
|
|
28797
28780
|
const safeWidth = Math.max(terminalWidth, 1);
|
|
28798
28781
|
const noteLength = REDIRECTION_WARNING_NOTE_LABEL.length + REDIRECTION_WARNING_NOTE_TEXT.length;
|
|
@@ -30972,7 +30955,7 @@ function validateAuthMethodWithSettings(authType, settings) {
|
|
|
30972
30955
|
if (settings.merged.security.auth.useExternal) {
|
|
30973
30956
|
return null;
|
|
30974
30957
|
}
|
|
30975
|
-
if (authType ===
|
|
30958
|
+
if (authType === "gemini-api-key" /* USE_GEMINI */) {
|
|
30976
30959
|
return null;
|
|
30977
30960
|
}
|
|
30978
30961
|
return validateAuthMethod(authType);
|
|
@@ -31024,7 +31007,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
31024
31007
|
}
|
|
31025
31008
|
return;
|
|
31026
31009
|
}
|
|
31027
|
-
if (authType ===
|
|
31010
|
+
if (authType === "gemini-api-key" /* USE_GEMINI */) {
|
|
31028
31011
|
const key = await reloadApiKey();
|
|
31029
31012
|
if (!key) {
|
|
31030
31013
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -31099,31 +31082,31 @@ function AuthDialog({
|
|
|
31099
31082
|
let items = [
|
|
31100
31083
|
{
|
|
31101
31084
|
label: "Sign in with Google",
|
|
31102
|
-
value:
|
|
31103
|
-
key:
|
|
31085
|
+
value: "oauth-personal" /* LOGIN_WITH_GOOGLE */,
|
|
31086
|
+
key: "oauth-personal" /* LOGIN_WITH_GOOGLE */
|
|
31104
31087
|
},
|
|
31105
31088
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
31106
31089
|
{
|
|
31107
31090
|
label: "Use Cloud Shell user credentials",
|
|
31108
|
-
value:
|
|
31109
|
-
key:
|
|
31091
|
+
value: "compute-default-credentials" /* COMPUTE_ADC */,
|
|
31092
|
+
key: "compute-default-credentials" /* COMPUTE_ADC */
|
|
31110
31093
|
}
|
|
31111
31094
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
31112
31095
|
{
|
|
31113
31096
|
label: "Use metadata server application default credentials",
|
|
31114
|
-
value:
|
|
31115
|
-
key:
|
|
31097
|
+
value: "compute-default-credentials" /* COMPUTE_ADC */,
|
|
31098
|
+
key: "compute-default-credentials" /* COMPUTE_ADC */
|
|
31116
31099
|
}
|
|
31117
31100
|
] : [],
|
|
31118
31101
|
{
|
|
31119
31102
|
label: "Use Gemini API Key",
|
|
31120
|
-
value:
|
|
31121
|
-
key:
|
|
31103
|
+
value: "gemini-api-key" /* USE_GEMINI */,
|
|
31104
|
+
key: "gemini-api-key" /* USE_GEMINI */
|
|
31122
31105
|
},
|
|
31123
31106
|
{
|
|
31124
31107
|
label: "Vertex AI",
|
|
31125
|
-
value:
|
|
31126
|
-
key:
|
|
31108
|
+
value: "vertex-ai" /* USE_VERTEX_AI */,
|
|
31109
|
+
key: "vertex-ai" /* USE_VERTEX_AI */
|
|
31127
31110
|
}
|
|
31128
31111
|
];
|
|
31129
31112
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -31145,9 +31128,9 @@ function AuthDialog({
|
|
|
31145
31128
|
return item.value === defaultAuthType;
|
|
31146
31129
|
}
|
|
31147
31130
|
if (process.env["GEMINI_API_KEY"]) {
|
|
31148
|
-
return item.value ===
|
|
31131
|
+
return item.value === "gemini-api-key" /* USE_GEMINI */;
|
|
31149
31132
|
}
|
|
31150
|
-
return item.value ===
|
|
31133
|
+
return item.value === "oauth-personal" /* LOGIN_WITH_GOOGLE */;
|
|
31151
31134
|
});
|
|
31152
31135
|
if (settings.merged.security.auth.enforcedType) {
|
|
31153
31136
|
initialAuthIndex = 0;
|
|
@@ -31158,19 +31141,19 @@ function AuthDialog({
|
|
|
31158
31141
|
return;
|
|
31159
31142
|
}
|
|
31160
31143
|
if (authType) {
|
|
31161
|
-
if (authType ===
|
|
31144
|
+
if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
|
|
31162
31145
|
setAuthContext({ requiresRestart: true });
|
|
31163
31146
|
} else {
|
|
31164
31147
|
setAuthContext({});
|
|
31165
31148
|
}
|
|
31166
31149
|
await clearCachedCredentialFile();
|
|
31167
31150
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
31168
|
-
if (authType ===
|
|
31151
|
+
if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
|
|
31169
31152
|
setExiting(true);
|
|
31170
31153
|
setTimeout(relaunchApp, 100);
|
|
31171
31154
|
return;
|
|
31172
31155
|
}
|
|
31173
|
-
if (authType ===
|
|
31156
|
+
if (authType === "gemini-api-key" /* USE_GEMINI */) {
|
|
31174
31157
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
31175
31158
|
return;
|
|
31176
31159
|
}
|
|
@@ -31920,11 +31903,11 @@ var PrivacyNoticeText = ({
|
|
|
31920
31903
|
}) => {
|
|
31921
31904
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
31922
31905
|
switch (authType) {
|
|
31923
|
-
case
|
|
31906
|
+
case "gemini-api-key" /* USE_GEMINI */:
|
|
31924
31907
|
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(GeminiPrivacyNotice, { onExit });
|
|
31925
|
-
case
|
|
31908
|
+
case "vertex-ai" /* USE_VERTEX_AI */:
|
|
31926
31909
|
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
31927
|
-
case
|
|
31910
|
+
case "oauth-personal" /* LOGIN_WITH_GOOGLE */:
|
|
31928
31911
|
default:
|
|
31929
31912
|
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
31930
31913
|
}
|
|
@@ -31965,7 +31948,7 @@ function ProQuotaDialog({
|
|
|
31965
31948
|
value: "retry_always",
|
|
31966
31949
|
key: "retry_always"
|
|
31967
31950
|
},
|
|
31968
|
-
...authType ===
|
|
31951
|
+
...authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && !isUltra ? [
|
|
31969
31952
|
{
|
|
31970
31953
|
label: "Upgrade for higher limits",
|
|
31971
31954
|
value: "upgrade",
|
|
@@ -32969,7 +32952,7 @@ function ModelDialog({ onClose }) {
|
|
|
32969
32952
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
32970
32953
|
const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
|
|
32971
32954
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
32972
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
32955
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === "gemini-api-key" /* USE_GEMINI */;
|
|
32973
32956
|
const manualModelSelected = (0, import_react65.useMemo)(() => {
|
|
32974
32957
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.modelConfigService) {
|
|
32975
32958
|
const def = config.modelConfigService.getModelDefinition(preferredModel);
|
|
@@ -34699,22 +34682,22 @@ var ApprovalModeIndicator = ({
|
|
|
34699
34682
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
34700
34683
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
34701
34684
|
switch (approvalMode) {
|
|
34702
|
-
case
|
|
34685
|
+
case "autoEdit" /* AUTO_EDIT */:
|
|
34703
34686
|
textColor = theme.status.warning;
|
|
34704
34687
|
textContent = "auto-accept edits";
|
|
34705
34688
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
34706
34689
|
break;
|
|
34707
|
-
case
|
|
34690
|
+
case "plan" /* PLAN */:
|
|
34708
34691
|
textColor = theme.status.success;
|
|
34709
34692
|
textContent = "plan";
|
|
34710
34693
|
subText = `${cycleHint} to manual`;
|
|
34711
34694
|
break;
|
|
34712
|
-
case
|
|
34695
|
+
case "yolo" /* YOLO */:
|
|
34713
34696
|
textColor = theme.status.error;
|
|
34714
34697
|
textContent = "YOLO";
|
|
34715
34698
|
subText = yoloHint;
|
|
34716
34699
|
break;
|
|
34717
|
-
case
|
|
34700
|
+
case "default" /* DEFAULT */:
|
|
34718
34701
|
default:
|
|
34719
34702
|
textColor = theme.text.accent;
|
|
34720
34703
|
textContent = "";
|
|
@@ -34757,10 +34740,10 @@ function initializeConsoleStore() {
|
|
|
34757
34740
|
globalConsoleMessages = [];
|
|
34758
34741
|
globalErrorCount = 0;
|
|
34759
34742
|
notifyListeners();
|
|
34760
|
-
coreEvents.off(
|
|
34761
|
-
coreEvents.off(
|
|
34762
|
-
coreEvents.on(
|
|
34763
|
-
coreEvents.on(
|
|
34743
|
+
coreEvents.off("console-log" /* ConsoleLog */, handleConsoleLog);
|
|
34744
|
+
coreEvents.off("output" /* Output */, handleOutput);
|
|
34745
|
+
coreEvents.on("console-log" /* ConsoleLog */, handleConsoleLog);
|
|
34746
|
+
coreEvents.on("output" /* Output */, handleOutput);
|
|
34764
34747
|
}
|
|
34765
34748
|
function notifyListeners() {
|
|
34766
34749
|
for (const listener of listeners) {
|
|
@@ -36877,7 +36860,7 @@ function usePromptCompletion({
|
|
|
36877
36860
|
{ model: "prompt-completion" },
|
|
36878
36861
|
contents,
|
|
36879
36862
|
signal,
|
|
36880
|
-
|
|
36863
|
+
"utility_autocomplete" /* UTILITY_AUTOCOMPLETE */
|
|
36881
36864
|
);
|
|
36882
36865
|
if (signal.aborted) {
|
|
36883
36866
|
return;
|
|
@@ -38431,9 +38414,9 @@ var InputPrompt = ({
|
|
|
38431
38414
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
38432
38415
|
}
|
|
38433
38416
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
38434
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
38435
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
38436
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
38417
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === "autoEdit" /* AUTO_EDIT */;
|
|
38418
|
+
const showYoloStyling = !shellModeActive && approvalMode === "yolo" /* YOLO */;
|
|
38419
|
+
const showPlanStyling = !shellModeActive && approvalMode === "plan" /* PLAN */;
|
|
38437
38420
|
let statusColor;
|
|
38438
38421
|
let statusText = "";
|
|
38439
38422
|
if (shellModeActive) {
|
|
@@ -38693,7 +38676,7 @@ var ConfigInitDisplay = ({
|
|
|
38693
38676
|
let connected = 0;
|
|
38694
38677
|
const connecting = [];
|
|
38695
38678
|
for (const [name, client] of clients.entries()) {
|
|
38696
|
-
if (client.getStatus() ===
|
|
38679
|
+
if (client.getStatus() === "connected" /* CONNECTED */) {
|
|
38697
38680
|
connected++;
|
|
38698
38681
|
} else {
|
|
38699
38682
|
connecting.push(name);
|
|
@@ -38715,9 +38698,9 @@ var ConfigInitDisplay = ({
|
|
|
38715
38698
|
);
|
|
38716
38699
|
}
|
|
38717
38700
|
};
|
|
38718
|
-
coreEvents.on(
|
|
38701
|
+
coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
|
|
38719
38702
|
return () => {
|
|
38720
|
-
coreEvents.off(
|
|
38703
|
+
coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
|
|
38721
38704
|
};
|
|
38722
38705
|
}, [initialMessage]);
|
|
38723
38706
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Text, { children: [
|
|
@@ -38936,7 +38919,7 @@ var Composer = ({ isFocused = true }) => {
|
|
|
38936
38919
|
(item) => item.type === "tool_group"
|
|
38937
38920
|
).some(
|
|
38938
38921
|
(item) => item.tools.some(
|
|
38939
|
-
(tool) => tool.status ===
|
|
38922
|
+
(tool) => tool.status === "awaiting_approval" /* AwaitingApproval */
|
|
38940
38923
|
)
|
|
38941
38924
|
),
|
|
38942
38925
|
[uiState.pendingHistoryItems]
|
|
@@ -38965,16 +38948,16 @@ var Composer = ({ isFocused = true }) => {
|
|
|
38965
38948
|
const showRawMarkdownIndicator = !uiState.renderMarkdown;
|
|
38966
38949
|
let modeBleedThrough = null;
|
|
38967
38950
|
switch (showApprovalModeIndicator) {
|
|
38968
|
-
case
|
|
38951
|
+
case "yolo" /* YOLO */:
|
|
38969
38952
|
modeBleedThrough = { text: "YOLO", color: theme.status.error };
|
|
38970
38953
|
break;
|
|
38971
|
-
case
|
|
38954
|
+
case "plan" /* PLAN */:
|
|
38972
38955
|
modeBleedThrough = { text: "plan", color: theme.status.success };
|
|
38973
38956
|
break;
|
|
38974
|
-
case
|
|
38957
|
+
case "autoEdit" /* AUTO_EDIT */:
|
|
38975
38958
|
modeBleedThrough = { text: "auto edit", color: theme.status.warning };
|
|
38976
38959
|
break;
|
|
38977
|
-
case
|
|
38960
|
+
case "default" /* DEFAULT */:
|
|
38978
38961
|
modeBleedThrough = null;
|
|
38979
38962
|
break;
|
|
38980
38963
|
default:
|
|
@@ -39621,7 +39604,7 @@ var useShellCommandProcessor = (addItemToHistory, setPendingHistoryItem, onExec,
|
|
|
39621
39604
|
callId,
|
|
39622
39605
|
name: SHELL_COMMAND_NAME,
|
|
39623
39606
|
description: rawQuery,
|
|
39624
|
-
status:
|
|
39607
|
+
status: "executing" /* Executing */,
|
|
39625
39608
|
isClientInitiated: true,
|
|
39626
39609
|
resultDisplay: "",
|
|
39627
39610
|
confirmationDetails: void 0
|
|
@@ -39741,24 +39724,24 @@ var useShellCommandProcessor = (addItemToHistory, setPendingHistoryItem, onExec,
|
|
|
39741
39724
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
39742
39725
|
}
|
|
39743
39726
|
let finalOutput = mainContent;
|
|
39744
|
-
let finalStatus =
|
|
39727
|
+
let finalStatus = "success" /* Success */;
|
|
39745
39728
|
if (result.error) {
|
|
39746
|
-
finalStatus =
|
|
39729
|
+
finalStatus = "error" /* Error */;
|
|
39747
39730
|
finalOutput = `${result.error.message}
|
|
39748
39731
|
${finalOutput}`;
|
|
39749
39732
|
} else if (result.aborted) {
|
|
39750
|
-
finalStatus =
|
|
39733
|
+
finalStatus = "cancelled" /* Cancelled */;
|
|
39751
39734
|
finalOutput = `Command was cancelled.
|
|
39752
39735
|
${finalOutput}`;
|
|
39753
39736
|
} else if (result.backgrounded) {
|
|
39754
|
-
finalStatus =
|
|
39737
|
+
finalStatus = "success" /* Success */;
|
|
39755
39738
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
39756
39739
|
} else if (result.signal) {
|
|
39757
|
-
finalStatus =
|
|
39740
|
+
finalStatus = "error" /* Error */;
|
|
39758
39741
|
finalOutput = `Command terminated by signal: ${result.signal}.
|
|
39759
39742
|
${finalOutput}`;
|
|
39760
39743
|
} else if (result.exitCode !== 0) {
|
|
39761
|
-
finalStatus =
|
|
39744
|
+
finalStatus = "error" /* Error */;
|
|
39762
39745
|
finalOutput = `Command exited with code ${result.exitCode}.
|
|
39763
39746
|
${finalOutput}`;
|
|
39764
39747
|
}
|
|
@@ -39776,7 +39759,7 @@ ${finalOutput}`;
|
|
|
39776
39759
|
status: finalStatus,
|
|
39777
39760
|
resultDisplay: finalOutput
|
|
39778
39761
|
};
|
|
39779
|
-
if (finalStatus !==
|
|
39762
|
+
if (finalStatus !== "cancelled" /* Cancelled */) {
|
|
39780
39763
|
addItemToHistory(
|
|
39781
39764
|
{
|
|
39782
39765
|
type: "tool_group",
|
|
@@ -40755,7 +40738,7 @@ function useQuotaAndFallback({
|
|
|
40755
40738
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
40756
40739
|
`/stats model for usage details`,
|
|
40757
40740
|
`/model to switch models.`,
|
|
40758
|
-
contentGeneratorConfig?.authType ===
|
|
40741
|
+
contentGeneratorConfig?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? `/auth to switch to API key.` : null
|
|
40759
40742
|
].filter(Boolean);
|
|
40760
40743
|
message = messageLines.join("\n");
|
|
40761
40744
|
} else if (error instanceof ModelNotFoundError) {
|
|
@@ -40943,7 +40926,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
40943
40926
|
);
|
|
40944
40927
|
setEditorError(null);
|
|
40945
40928
|
setIsEditorDialogOpen(false);
|
|
40946
|
-
coreEvents.emit(
|
|
40929
|
+
coreEvents.emit("editor-selected" /* EditorSelected */, { editor: editorType });
|
|
40947
40930
|
} catch (error) {
|
|
40948
40931
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
40949
40932
|
}
|
|
@@ -40952,7 +40935,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
40952
40935
|
);
|
|
40953
40936
|
const exitEditorDialog = (0, import_react96.useCallback)(() => {
|
|
40954
40937
|
setIsEditorDialogOpen(false);
|
|
40955
|
-
coreEvents.emit(
|
|
40938
|
+
coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
|
|
40956
40939
|
}, []);
|
|
40957
40940
|
return {
|
|
40958
40941
|
isEditorDialogOpen,
|
|
@@ -41307,7 +41290,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
41307
41290
|
canonicalPath: resolvedCommandPath
|
|
41308
41291
|
} = parseSlashCommand(trimmed, commands);
|
|
41309
41292
|
if (!commandToExecute) {
|
|
41310
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
41293
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === "in_progress" /* IN_PROGRESS */;
|
|
41311
41294
|
if (isMcpLoading) {
|
|
41312
41295
|
setIsProcessing(true);
|
|
41313
41296
|
if (addToHistory) {
|
|
@@ -41475,7 +41458,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
41475
41458
|
onConfirm: async (resolvedOutcome) => {
|
|
41476
41459
|
resolve3({
|
|
41477
41460
|
outcome: resolvedOutcome,
|
|
41478
|
-
approvedCommands: resolvedOutcome ===
|
|
41461
|
+
approvedCommands: resolvedOutcome === "cancel" /* Cancel */ ? [] : result.commandsToConfirm
|
|
41479
41462
|
});
|
|
41480
41463
|
}
|
|
41481
41464
|
};
|
|
@@ -41483,7 +41466,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
41483
41466
|
callId,
|
|
41484
41467
|
name: "Expansion",
|
|
41485
41468
|
description: "Command expansion needs shell access",
|
|
41486
|
-
status:
|
|
41469
|
+
status: "awaiting_approval" /* AwaitingApproval */,
|
|
41487
41470
|
isClientInitiated: true,
|
|
41488
41471
|
resultDisplay: void 0,
|
|
41489
41472
|
confirmationDetails
|
|
@@ -41494,7 +41477,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
41494
41477
|
});
|
|
41495
41478
|
});
|
|
41496
41479
|
setPendingItem(null);
|
|
41497
|
-
if (outcome ===
|
|
41480
|
+
if (outcome === "cancel" /* Cancel */ || !approvedCommands || approvedCommands.length === 0) {
|
|
41498
41481
|
addItem(
|
|
41499
41482
|
{
|
|
41500
41483
|
type: "info" /* INFO */,
|
|
@@ -41504,7 +41487,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
41504
41487
|
);
|
|
41505
41488
|
return { type: "handled" };
|
|
41506
41489
|
}
|
|
41507
|
-
if (outcome ===
|
|
41490
|
+
if (outcome === "proceed_always" /* ProceedAlways */) {
|
|
41508
41491
|
setSessionShellAllowlist(
|
|
41509
41492
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
41510
41493
|
);
|
|
@@ -41981,7 +41964,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
41981
41964
|
let description;
|
|
41982
41965
|
let renderOutputAsMarkdown = false;
|
|
41983
41966
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
41984
|
-
if (call.status ===
|
|
41967
|
+
if (call.status === "error" /* Error */) {
|
|
41985
41968
|
description = JSON.stringify(call.request.args);
|
|
41986
41969
|
} else {
|
|
41987
41970
|
description = call.invocation.getDescription();
|
|
@@ -42003,27 +41986,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
42003
41986
|
let progress = void 0;
|
|
42004
41987
|
let progressTotal = void 0;
|
|
42005
41988
|
switch (call.status) {
|
|
42006
|
-
case
|
|
41989
|
+
case "success" /* Success */:
|
|
42007
41990
|
resultDisplay = call.response.resultDisplay;
|
|
42008
41991
|
outputFile = call.response.outputFile;
|
|
42009
41992
|
break;
|
|
42010
|
-
case
|
|
42011
|
-
case
|
|
41993
|
+
case "error" /* Error */:
|
|
41994
|
+
case "cancelled" /* Cancelled */:
|
|
42012
41995
|
resultDisplay = call.response.resultDisplay;
|
|
42013
41996
|
break;
|
|
42014
|
-
case
|
|
41997
|
+
case "awaiting_approval" /* AwaitingApproval */:
|
|
42015
41998
|
correlationId = call.correlationId;
|
|
42016
41999
|
confirmationDetails = call.confirmationDetails;
|
|
42017
42000
|
break;
|
|
42018
|
-
case
|
|
42001
|
+
case "executing" /* Executing */:
|
|
42019
42002
|
resultDisplay = call.liveOutput;
|
|
42020
42003
|
ptyId = call.pid;
|
|
42021
42004
|
progressMessage = call.progressMessage;
|
|
42022
42005
|
progress = call.progress;
|
|
42023
42006
|
progressTotal = call.progressTotal;
|
|
42024
42007
|
break;
|
|
42025
|
-
case
|
|
42026
|
-
case
|
|
42008
|
+
case "scheduled" /* Scheduled */:
|
|
42009
|
+
case "validating" /* Validating */:
|
|
42027
42010
|
break;
|
|
42028
42011
|
default: {
|
|
42029
42012
|
const exhaustiveCheck = call;
|
|
@@ -42092,7 +42075,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
42092
42075
|
const handler = (event) => {
|
|
42093
42076
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
42094
42077
|
const hasExecuting = event.toolCalls.some(
|
|
42095
|
-
(tc) => tc.status ===
|
|
42078
|
+
(tc) => tc.status === "executing" /* Executing */ || (tc.status === "success" /* Success */ || tc.status === "error" /* Error */) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
42096
42079
|
);
|
|
42097
42080
|
if (hasExecuting) {
|
|
42098
42081
|
setLastToolOutputTime(Date.now());
|
|
@@ -42101,7 +42084,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
42101
42084
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
42102
42085
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
42103
42086
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
42104
|
-
(tc) => tc.status ===
|
|
42087
|
+
(tc) => tc.status === "awaiting_approval" /* AwaitingApproval */ || prevCallIds.has(tc.request.callId)
|
|
42105
42088
|
);
|
|
42106
42089
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
42107
42090
|
return prev;
|
|
@@ -42113,9 +42096,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
42113
42096
|
};
|
|
42114
42097
|
});
|
|
42115
42098
|
};
|
|
42116
|
-
messageBus.subscribe(
|
|
42099
|
+
messageBus.subscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
|
|
42117
42100
|
return () => {
|
|
42118
|
-
messageBus.unsubscribe(
|
|
42101
|
+
messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
|
|
42119
42102
|
};
|
|
42120
42103
|
}, [messageBus, internalAdaptToolCalls]);
|
|
42121
42104
|
const schedule = (0, import_react102.useCallback)(
|
|
@@ -42187,8 +42170,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
42187
42170
|
const prev = prevMap.get(coreCall.request.callId);
|
|
42188
42171
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
42189
42172
|
let status = coreCall.status;
|
|
42190
|
-
if ((status ===
|
|
42191
|
-
status =
|
|
42173
|
+
if ((status === "success" /* Success */ || status === "error" /* Error */) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
42174
|
+
status = "executing" /* Executing */;
|
|
42192
42175
|
}
|
|
42193
42176
|
return {
|
|
42194
42177
|
...coreCall,
|
|
@@ -42219,7 +42202,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
42219
42202
|
};
|
|
42220
42203
|
}
|
|
42221
42204
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
42222
|
-
return toolCall.status ===
|
|
42205
|
+
return toolCall.status === "executing" /* Executing */ && typeof toolCall.pid === "number";
|
|
42223
42206
|
}
|
|
42224
42207
|
function showCitations(settings) {
|
|
42225
42208
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -42229,14 +42212,14 @@ function showCitations(settings) {
|
|
|
42229
42212
|
return true;
|
|
42230
42213
|
}
|
|
42231
42214
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
42232
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
42215
|
+
if (toolCalls.some((tc) => tc.status === "awaiting_approval" /* AwaitingApproval */)) {
|
|
42233
42216
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
42234
42217
|
}
|
|
42235
42218
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
42236
|
-
if (tc.status ===
|
|
42219
|
+
if (tc.status === "executing" /* Executing */ || tc.status === "scheduled" /* Scheduled */ || tc.status === "validating" /* Validating */) {
|
|
42237
42220
|
return true;
|
|
42238
42221
|
}
|
|
42239
|
-
if (tc.status ===
|
|
42222
|
+
if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
|
|
42240
42223
|
return !tc.responseSubmittedToGemini;
|
|
42241
42224
|
}
|
|
42242
42225
|
return false;
|
|
@@ -42289,9 +42272,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
42289
42272
|
const handleRetryAttempt = (payload) => {
|
|
42290
42273
|
setRetryStatus(payload);
|
|
42291
42274
|
};
|
|
42292
|
-
coreEvents.on(
|
|
42275
|
+
coreEvents.on("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
|
|
42293
42276
|
return () => {
|
|
42294
|
-
coreEvents.off(
|
|
42277
|
+
coreEvents.off("retry-attempt" /* RetryAttempt */, handleRetryAttempt);
|
|
42295
42278
|
};
|
|
42296
42279
|
}, []);
|
|
42297
42280
|
const [
|
|
@@ -42408,12 +42391,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
42408
42391
|
const tc = toolCalls[i];
|
|
42409
42392
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
42410
42393
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
42411
|
-
const isAgent = tc.tool?.kind ===
|
|
42394
|
+
const isAgent = tc.tool?.kind === "agent" /* Agent */;
|
|
42412
42395
|
if (isAgent) {
|
|
42413
42396
|
let contigAgentsComplete = true;
|
|
42414
42397
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
42415
42398
|
const nextTc = toolCalls[j];
|
|
42416
|
-
if (nextTc.tool?.kind ===
|
|
42399
|
+
if (nextTc.tool?.kind === "agent" /* Agent */) {
|
|
42417
42400
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
42418
42401
|
contigAgentsComplete = false;
|
|
42419
42402
|
break;
|
|
@@ -42493,9 +42476,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
42493
42476
|
const anyVisibleInPending = remainingTools.some((tc) => {
|
|
42494
42477
|
const displayName = tc.tool?.displayName ?? tc.request.name;
|
|
42495
42478
|
let hasResultDisplay = false;
|
|
42496
|
-
if (tc.status ===
|
|
42479
|
+
if (tc.status === "success" /* Success */ || tc.status === "error" /* Error */ || tc.status === "cancelled" /* Cancelled */) {
|
|
42497
42480
|
hasResultDisplay = !!tc.response?.resultDisplay;
|
|
42498
|
-
} else if (tc.status ===
|
|
42481
|
+
} else if (tc.status === "executing" /* Executing */) {
|
|
42499
42482
|
hasResultDisplay = !!tc.liveOutput;
|
|
42500
42483
|
}
|
|
42501
42484
|
if (shouldHideToolCall({
|
|
@@ -42547,7 +42530,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
42547
42530
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
42548
42531
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
42549
42532
|
(0, import_react103.useEffect)(() => {
|
|
42550
|
-
if (config.getApprovalMode() ===
|
|
42533
|
+
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
42551
42534
|
const lastUserMessageIndex = history.findLastIndex(
|
|
42552
42535
|
(item) => item.type === "user" /* USER */
|
|
42553
42536
|
);
|
|
@@ -42632,7 +42615,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
42632
42615
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
42633
42616
|
return {
|
|
42634
42617
|
...tool,
|
|
42635
|
-
status:
|
|
42618
|
+
status: "cancelled" /* Cancelled */,
|
|
42636
42619
|
resultDisplay: tool.resultDisplay
|
|
42637
42620
|
};
|
|
42638
42621
|
}
|
|
@@ -42688,7 +42671,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
42688
42671
|
let localQueryToSendToGemini = null;
|
|
42689
42672
|
if (typeof query === "string") {
|
|
42690
42673
|
const trimmedQuery = query.trim();
|
|
42691
|
-
await logger?.logMessage(
|
|
42674
|
+
await logger?.logMessage("user" /* USER */, trimmedQuery);
|
|
42692
42675
|
if (!shellModeActive) {
|
|
42693
42676
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
42694
42677
|
if (slashCommandResult) {
|
|
@@ -42844,7 +42827,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
42844
42827
|
if (pendingHistoryItemRef.current) {
|
|
42845
42828
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
42846
42829
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
42847
|
-
(tool) => tool.status ===
|
|
42830
|
+
(tool) => tool.status === "validating" /* Validating */ || tool.status === "scheduled" /* Scheduled */ || tool.status === "awaiting_approval" /* AwaitingApproval */ || tool.status === "executing" /* Executing */ ? { ...tool, status: "cancelled" /* Cancelled */ } : tool
|
|
42848
42831
|
);
|
|
42849
42832
|
const pendingItem = {
|
|
42850
42833
|
...pendingHistoryItemRef.current,
|
|
@@ -43090,15 +43073,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43090
43073
|
let geminiMessageBuffer = "";
|
|
43091
43074
|
const toolCallRequests = [];
|
|
43092
43075
|
for await (const event of stream) {
|
|
43093
|
-
if (event.type !==
|
|
43076
|
+
if (event.type !== "thought" /* Thought */ && thoughtRef.current !== null) {
|
|
43094
43077
|
setThought(null);
|
|
43095
43078
|
}
|
|
43096
43079
|
switch (event.type) {
|
|
43097
|
-
case
|
|
43080
|
+
case "thought" /* Thought */:
|
|
43098
43081
|
setLastGeminiActivityTime(Date.now());
|
|
43099
43082
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
43100
43083
|
break;
|
|
43101
|
-
case
|
|
43084
|
+
case "content" /* Content */:
|
|
43102
43085
|
setLastGeminiActivityTime(Date.now());
|
|
43103
43086
|
geminiMessageBuffer = handleContentEvent(
|
|
43104
43087
|
event.value,
|
|
@@ -43106,16 +43089,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43106
43089
|
userMessageTimestamp
|
|
43107
43090
|
);
|
|
43108
43091
|
break;
|
|
43109
|
-
case
|
|
43092
|
+
case "tool_call_request" /* ToolCallRequest */:
|
|
43110
43093
|
toolCallRequests.push(event.value);
|
|
43111
43094
|
break;
|
|
43112
|
-
case
|
|
43095
|
+
case "user_cancelled" /* UserCancelled */:
|
|
43113
43096
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
43114
43097
|
break;
|
|
43115
|
-
case
|
|
43098
|
+
case "error" /* Error */:
|
|
43116
43099
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
43117
43100
|
break;
|
|
43118
|
-
case
|
|
43101
|
+
case "agent_execution_stopped" /* AgentExecutionStopped */:
|
|
43119
43102
|
handleAgentExecutionStoppedEvent(
|
|
43120
43103
|
event.value.reason,
|
|
43121
43104
|
userMessageTimestamp,
|
|
@@ -43123,7 +43106,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43123
43106
|
event.value.contextCleared
|
|
43124
43107
|
);
|
|
43125
43108
|
break;
|
|
43126
|
-
case
|
|
43109
|
+
case "agent_execution_blocked" /* AgentExecutionBlocked */:
|
|
43127
43110
|
handleAgentExecutionBlockedEvent(
|
|
43128
43111
|
event.value.reason,
|
|
43129
43112
|
userMessageTimestamp,
|
|
@@ -43131,35 +43114,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43131
43114
|
event.value.contextCleared
|
|
43132
43115
|
);
|
|
43133
43116
|
break;
|
|
43134
|
-
case
|
|
43117
|
+
case "chat_compressed" /* ChatCompressed */:
|
|
43135
43118
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
43136
43119
|
break;
|
|
43137
|
-
case
|
|
43138
|
-
case
|
|
43120
|
+
case "tool_call_confirmation" /* ToolCallConfirmation */:
|
|
43121
|
+
case "tool_call_response" /* ToolCallResponse */:
|
|
43139
43122
|
break;
|
|
43140
|
-
case
|
|
43123
|
+
case "max_session_turns" /* MaxSessionTurns */:
|
|
43141
43124
|
handleMaxSessionTurnsEvent();
|
|
43142
43125
|
break;
|
|
43143
|
-
case
|
|
43126
|
+
case "context_window_will_overflow" /* ContextWindowWillOverflow */:
|
|
43144
43127
|
handleContextWindowWillOverflowEvent(
|
|
43145
43128
|
event.value.estimatedRequestTokenCount,
|
|
43146
43129
|
event.value.remainingTokenCount
|
|
43147
43130
|
);
|
|
43148
43131
|
break;
|
|
43149
|
-
case
|
|
43132
|
+
case "finished" /* Finished */:
|
|
43150
43133
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
43151
43134
|
break;
|
|
43152
|
-
case
|
|
43135
|
+
case "citation" /* Citation */:
|
|
43153
43136
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
43154
43137
|
break;
|
|
43155
|
-
case
|
|
43138
|
+
case "model_info" /* ModelInfo */:
|
|
43156
43139
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
43157
43140
|
break;
|
|
43158
|
-
case
|
|
43141
|
+
case "loop_detected" /* LoopDetected */:
|
|
43159
43142
|
loopDetectedRef.current = true;
|
|
43160
43143
|
break;
|
|
43161
|
-
case
|
|
43162
|
-
case
|
|
43144
|
+
case "retry" /* Retry */:
|
|
43145
|
+
case "invalid_stream" /* InvalidStream */:
|
|
43163
43146
|
break;
|
|
43164
43147
|
default: {
|
|
43165
43148
|
const unreachable = event;
|
|
@@ -43200,7 +43183,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43200
43183
|
const submitQuery = (0, import_react103.useCallback)(
|
|
43201
43184
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
43202
43185
|
{
|
|
43203
|
-
operation: options?.isContinuation ?
|
|
43186
|
+
operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */
|
|
43204
43187
|
},
|
|
43205
43188
|
async ({ metadata: spanMetadata }) => {
|
|
43206
43189
|
spanMetadata.input = query;
|
|
@@ -43359,7 +43342,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43359
43342
|
);
|
|
43360
43343
|
const handleApprovalModeChange = (0, import_react103.useCallback)(
|
|
43361
43344
|
async (newApprovalMode) => {
|
|
43362
|
-
if (previousApprovalModeRef.current ===
|
|
43345
|
+
if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
|
|
43363
43346
|
if (geminiClient) {
|
|
43364
43347
|
try {
|
|
43365
43348
|
await geminiClient.addHistory({
|
|
@@ -43382,11 +43365,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43382
43365
|
}
|
|
43383
43366
|
}
|
|
43384
43367
|
previousApprovalModeRef.current = newApprovalMode;
|
|
43385
|
-
if (newApprovalMode ===
|
|
43368
|
+
if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
|
|
43386
43369
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
43387
43370
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
43388
43371
|
);
|
|
43389
|
-
if (newApprovalMode ===
|
|
43372
|
+
if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
|
|
43390
43373
|
awaitingApprovalCalls = awaitingApprovalCalls.filter(
|
|
43391
43374
|
(call) => EDIT_TOOL_NAMES.has(call.request.name)
|
|
43392
43375
|
);
|
|
@@ -43395,11 +43378,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43395
43378
|
if (call.correlationId) {
|
|
43396
43379
|
try {
|
|
43397
43380
|
await config.getMessageBus().publish({
|
|
43398
|
-
type:
|
|
43381
|
+
type: "tool-confirmation-response" /* TOOL_CONFIRMATION_RESPONSE */,
|
|
43399
43382
|
correlationId: call.correlationId,
|
|
43400
43383
|
confirmed: true,
|
|
43401
43384
|
requiresUserConfirmation: false,
|
|
43402
|
-
outcome:
|
|
43385
|
+
outcome: "proceed_once" /* ProceedOnce */
|
|
43403
43386
|
});
|
|
43404
43387
|
} catch (error) {
|
|
43405
43388
|
debugLogger.warn(
|
|
@@ -43477,14 +43460,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43477
43460
|
);
|
|
43478
43461
|
if (isLowErrorVerbosity) {
|
|
43479
43462
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
43480
|
-
(tc) => tc.status ===
|
|
43463
|
+
(tc) => tc.status === "error" /* Error */
|
|
43481
43464
|
).length;
|
|
43482
43465
|
}
|
|
43483
43466
|
if (geminiTools.length === 0) {
|
|
43484
43467
|
return;
|
|
43485
43468
|
}
|
|
43486
43469
|
const stopExecutionTool = geminiTools.find(
|
|
43487
|
-
(tc) => tc.response.errorType ===
|
|
43470
|
+
(tc) => tc.response.errorType === "stop_execution" /* STOP_EXECUTION */
|
|
43488
43471
|
);
|
|
43489
43472
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
43490
43473
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -43501,7 +43484,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43501
43484
|
return;
|
|
43502
43485
|
}
|
|
43503
43486
|
const allToolsCancelled = geminiTools.every(
|
|
43504
|
-
(tc) => tc.status ===
|
|
43487
|
+
(tc) => tc.status === "cancelled" /* Cancelled */
|
|
43505
43488
|
);
|
|
43506
43489
|
if (allToolsCancelled) {
|
|
43507
43490
|
if (!turnCancelledRef.current) {
|
|
@@ -43583,7 +43566,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43583
43566
|
return;
|
|
43584
43567
|
}
|
|
43585
43568
|
const restorableToolCalls = toolCalls.filter(
|
|
43586
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
43569
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === "awaiting_approval" /* AwaitingApproval */
|
|
43587
43570
|
);
|
|
43588
43571
|
if (restorableToolCalls.length > 0) {
|
|
43589
43572
|
if (!gitService) {
|
|
@@ -46050,7 +46033,7 @@ function useMessageQueue({
|
|
|
46050
46033
|
var import_react110 = __toESM(require_react(), 1);
|
|
46051
46034
|
function useMcpStatus(config) {
|
|
46052
46035
|
const [discoveryState, setDiscoveryState] = (0, import_react110.useState)(
|
|
46053
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
46036
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
|
|
46054
46037
|
);
|
|
46055
46038
|
const [mcpServerCount, setMcpServerCount] = (0, import_react110.useState)(
|
|
46056
46039
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -46063,12 +46046,12 @@ function useMcpStatus(config) {
|
|
|
46063
46046
|
setMcpServerCount(manager.getMcpServerCount());
|
|
46064
46047
|
}
|
|
46065
46048
|
};
|
|
46066
|
-
coreEvents.on(
|
|
46049
|
+
coreEvents.on("mcp-client-update" /* McpClientUpdate */, onChange);
|
|
46067
46050
|
return () => {
|
|
46068
|
-
coreEvents.off(
|
|
46051
|
+
coreEvents.off("mcp-client-update" /* McpClientUpdate */, onChange);
|
|
46069
46052
|
};
|
|
46070
46053
|
}, [config]);
|
|
46071
|
-
const isMcpReady = discoveryState ===
|
|
46054
|
+
const isMcpReady = discoveryState === "completed" /* COMPLETED */ || discoveryState === "not_started" /* NOT_STARTED */ && mcpServerCount === 0;
|
|
46072
46055
|
return {
|
|
46073
46056
|
discoveryState,
|
|
46074
46057
|
mcpServerCount,
|
|
@@ -46095,7 +46078,7 @@ function useApprovalModeIndicator({
|
|
|
46095
46078
|
(key) => {
|
|
46096
46079
|
let nextApprovalMode;
|
|
46097
46080
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
46098
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
46081
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== "yolo" /* YOLO */) {
|
|
46099
46082
|
if (addItem) {
|
|
46100
46083
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
46101
46084
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -46113,21 +46096,21 @@ function useApprovalModeIndicator({
|
|
|
46113
46096
|
}
|
|
46114
46097
|
return;
|
|
46115
46098
|
}
|
|
46116
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
46099
|
+
nextApprovalMode = config.getApprovalMode() === "yolo" /* YOLO */ ? "default" /* DEFAULT */ : "yolo" /* YOLO */;
|
|
46117
46100
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
46118
46101
|
const currentMode = config.getApprovalMode();
|
|
46119
46102
|
switch (currentMode) {
|
|
46120
|
-
case
|
|
46121
|
-
nextApprovalMode =
|
|
46103
|
+
case "default" /* DEFAULT */:
|
|
46104
|
+
nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
|
|
46122
46105
|
break;
|
|
46123
|
-
case
|
|
46124
|
-
nextApprovalMode = allowPlanMode ?
|
|
46106
|
+
case "autoEdit" /* AUTO_EDIT */:
|
|
46107
|
+
nextApprovalMode = allowPlanMode ? "plan" /* PLAN */ : "default" /* DEFAULT */;
|
|
46125
46108
|
break;
|
|
46126
|
-
case
|
|
46127
|
-
nextApprovalMode =
|
|
46109
|
+
case "plan" /* PLAN */:
|
|
46110
|
+
nextApprovalMode = "default" /* DEFAULT */;
|
|
46128
46111
|
break;
|
|
46129
|
-
case
|
|
46130
|
-
nextApprovalMode =
|
|
46112
|
+
case "yolo" /* YOLO */:
|
|
46113
|
+
nextApprovalMode = "autoEdit" /* AUTO_EDIT */;
|
|
46131
46114
|
break;
|
|
46132
46115
|
default:
|
|
46133
46116
|
}
|
|
@@ -46520,11 +46503,11 @@ var useHookDisplayState = () => {
|
|
|
46520
46503
|
removeHook();
|
|
46521
46504
|
}
|
|
46522
46505
|
};
|
|
46523
|
-
coreEvents.on(
|
|
46524
|
-
coreEvents.on(
|
|
46506
|
+
coreEvents.on("hook-start" /* HookStart */, handleHookStart);
|
|
46507
|
+
coreEvents.on("hook-end" /* HookEnd */, handleHookEnd);
|
|
46525
46508
|
return () => {
|
|
46526
|
-
coreEvents.off(
|
|
46527
|
-
coreEvents.off(
|
|
46509
|
+
coreEvents.off("hook-start" /* HookStart */, handleHookStart);
|
|
46510
|
+
coreEvents.off("hook-end" /* HookEnd */, handleHookEnd);
|
|
46528
46511
|
activeTimeouts.forEach(clearTimeout);
|
|
46529
46512
|
activeTimeouts.clear();
|
|
46530
46513
|
};
|
|
@@ -47321,7 +47304,7 @@ var AppContainer = (props) => {
|
|
|
47321
47304
|
}
|
|
47322
47305
|
setConfigInitialized(true);
|
|
47323
47306
|
startupProfiler.flush(config);
|
|
47324
|
-
const sessionStartSource = resumedSessionData ?
|
|
47307
|
+
const sessionStartSource = resumedSessionData ? "resume" /* Resume */ : "startup" /* Startup */;
|
|
47325
47308
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
47326
47309
|
if (result) {
|
|
47327
47310
|
if (result.systemMessage) {
|
|
@@ -47357,7 +47340,7 @@ var AppContainer = (props) => {
|
|
|
47357
47340
|
);
|
|
47358
47341
|
const ideClient = await IdeClient.getInstance();
|
|
47359
47342
|
await ideClient.disconnect();
|
|
47360
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
47343
|
+
await config?.getHookSystem()?.fireSessionEndEvent("exit" /* Exit */);
|
|
47361
47344
|
});
|
|
47362
47345
|
}, [config, resumedSessionData]);
|
|
47363
47346
|
(0, import_react124.useEffect)(
|
|
@@ -47375,11 +47358,11 @@ var AppContainer = (props) => {
|
|
|
47375
47358
|
resetTime: payload.resetTime
|
|
47376
47359
|
});
|
|
47377
47360
|
};
|
|
47378
|
-
coreEvents.on(
|
|
47379
|
-
coreEvents.on(
|
|
47361
|
+
coreEvents.on("model-changed" /* ModelChanged */, handleModelChanged);
|
|
47362
|
+
coreEvents.on("quota-changed" /* QuotaChanged */, handleQuotaChanged);
|
|
47380
47363
|
return () => {
|
|
47381
|
-
coreEvents.off(
|
|
47382
|
-
coreEvents.off(
|
|
47364
|
+
coreEvents.off("model-changed" /* ModelChanged */, handleModelChanged);
|
|
47365
|
+
coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
|
|
47383
47366
|
};
|
|
47384
47367
|
}, [config]);
|
|
47385
47368
|
(0, import_react124.useEffect)(() => {
|
|
@@ -47392,16 +47375,16 @@ var AppContainer = (props) => {
|
|
|
47392
47375
|
const handleAgentsDiscovered = (payload) => {
|
|
47393
47376
|
setNewAgents(payload.agents);
|
|
47394
47377
|
};
|
|
47395
|
-
coreEvents.on(
|
|
47396
|
-
coreEvents.on(
|
|
47397
|
-
coreEvents.on(
|
|
47378
|
+
coreEvents.on("settings-changed" /* SettingsChanged */, handleSettingsChanged);
|
|
47379
|
+
coreEvents.on("admin-settings-changed" /* AdminSettingsChanged */, handleAdminSettingsChanged);
|
|
47380
|
+
coreEvents.on("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
|
|
47398
47381
|
return () => {
|
|
47399
|
-
coreEvents.off(
|
|
47382
|
+
coreEvents.off("settings-changed" /* SettingsChanged */, handleSettingsChanged);
|
|
47400
47383
|
coreEvents.off(
|
|
47401
|
-
|
|
47384
|
+
"admin-settings-changed" /* AdminSettingsChanged */,
|
|
47402
47385
|
handleAdminSettingsChanged
|
|
47403
47386
|
);
|
|
47404
|
-
coreEvents.off(
|
|
47387
|
+
coreEvents.off("agents-discovered" /* AgentsDiscovered */, handleAgentsDiscovered);
|
|
47405
47388
|
};
|
|
47406
47389
|
}, [settings]);
|
|
47407
47390
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -47467,11 +47450,11 @@ var AppContainer = (props) => {
|
|
|
47467
47450
|
exitEditorDialog
|
|
47468
47451
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
47469
47452
|
(0, import_react124.useEffect)(() => {
|
|
47470
|
-
coreEvents.on(
|
|
47471
|
-
coreEvents.on(
|
|
47453
|
+
coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
|
|
47454
|
+
coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
|
|
47472
47455
|
return () => {
|
|
47473
|
-
coreEvents.off(
|
|
47474
|
-
coreEvents.off(
|
|
47456
|
+
coreEvents.off("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
|
|
47457
|
+
coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
|
|
47475
47458
|
};
|
|
47476
47459
|
}, [handleEditorClose, openEditorDialog]);
|
|
47477
47460
|
(0, import_react124.useEffect)(() => {
|
|
@@ -47539,7 +47522,7 @@ var AppContainer = (props) => {
|
|
|
47539
47522
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
47540
47523
|
});
|
|
47541
47524
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
47542
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
47525
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== "gemini-api-key" /* USE_GEMINI */;
|
|
47543
47526
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
47544
47527
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
47545
47528
|
config,
|
|
@@ -47567,7 +47550,7 @@ var AppContainer = (props) => {
|
|
|
47567
47550
|
async (authType, scope) => {
|
|
47568
47551
|
if (authType) {
|
|
47569
47552
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
47570
|
-
if (authType ===
|
|
47553
|
+
if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
|
|
47571
47554
|
setAuthContext({ requiresRestart: true });
|
|
47572
47555
|
} else {
|
|
47573
47556
|
setAuthContext({});
|
|
@@ -47595,7 +47578,7 @@ var AppContainer = (props) => {
|
|
|
47595
47578
|
);
|
|
47596
47579
|
return;
|
|
47597
47580
|
}
|
|
47598
|
-
if (authType ===
|
|
47581
|
+
if (authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ && config.isBrowserLaunchSuppressed()) {
|
|
47599
47582
|
writeToStdout(`
|
|
47600
47583
|
----------------------------------------------------------------
|
|
47601
47584
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -47620,7 +47603,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
47620
47603
|
}
|
|
47621
47604
|
await saveApiKey(apiKey);
|
|
47622
47605
|
await reloadApiKey();
|
|
47623
|
-
await config.refreshAuth(
|
|
47606
|
+
await config.refreshAuth("gemini-api-key" /* USE_GEMINI */);
|
|
47624
47607
|
setAuthState("authenticated" /* Authenticated */);
|
|
47625
47608
|
} catch (e) {
|
|
47626
47609
|
onAuthError(
|
|
@@ -47645,7 +47628,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
47645
47628
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
47646
47629
|
);
|
|
47647
47630
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
47648
|
-
if (settings.merged.security.auth.selectedType ===
|
|
47631
|
+
if (settings.merged.security.auth.selectedType === "gemini-api-key" /* USE_GEMINI */) {
|
|
47649
47632
|
return;
|
|
47650
47633
|
}
|
|
47651
47634
|
const error = validateAuthMethod(
|
|
@@ -47764,9 +47747,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
47764
47747
|
}
|
|
47765
47748
|
});
|
|
47766
47749
|
};
|
|
47767
|
-
coreEvents.on(
|
|
47750
|
+
coreEvents.on("consent-request" /* ConsentRequest */, handleConsentRequest);
|
|
47768
47751
|
return () => {
|
|
47769
|
-
coreEvents.off(
|
|
47752
|
+
coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
|
|
47770
47753
|
};
|
|
47771
47754
|
}, []);
|
|
47772
47755
|
const performMemoryRefresh = (0, import_react124.useCallback)(async () => {
|
|
@@ -48369,7 +48352,7 @@ ${queuedText}` : queuedText;
|
|
|
48369
48352
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
48370
48353
|
if (settings.merged.general.devtools) {
|
|
48371
48354
|
void (async () => {
|
|
48372
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
48355
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-QTW7GHQP.js");
|
|
48373
48356
|
await toggleDevToolsPanel(
|
|
48374
48357
|
config,
|
|
48375
48358
|
showErrorDetails,
|
|
@@ -48570,10 +48553,10 @@ ${queuedText}` : queuedText;
|
|
|
48570
48553
|
);
|
|
48571
48554
|
}
|
|
48572
48555
|
};
|
|
48573
|
-
coreEvents.on(
|
|
48556
|
+
coreEvents.on("user-feedback" /* UserFeedback */, handleUserFeedback);
|
|
48574
48557
|
coreEvents.drainBacklogs();
|
|
48575
48558
|
return () => {
|
|
48576
|
-
coreEvents.off(
|
|
48559
|
+
coreEvents.off("user-feedback" /* UserFeedback */, handleUserFeedback);
|
|
48577
48560
|
};
|
|
48578
48561
|
}, [historyManager]);
|
|
48579
48562
|
const nightly = props.version.includes("nightly");
|
|
@@ -48671,9 +48654,9 @@ ${queuedText}` : queuedText;
|
|
|
48671
48654
|
const handleMemoryChanged = (result) => {
|
|
48672
48655
|
setGeminiMdFileCount(result.fileCount);
|
|
48673
48656
|
};
|
|
48674
|
-
coreEvents.on(
|
|
48657
|
+
coreEvents.on("memory-changed" /* MemoryChanged */, handleMemoryChanged);
|
|
48675
48658
|
return () => {
|
|
48676
|
-
coreEvents.off(
|
|
48659
|
+
coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
|
|
48677
48660
|
};
|
|
48678
48661
|
}, []);
|
|
48679
48662
|
(0, import_react124.useEffect)(() => {
|