@google/gemini-cli 0.37.0-preview.0 → 0.37.0-preview.1
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-ULC3DHVX.js → chunk-33B2YA3V.js} +4 -4
- package/bundle/{chunk-3TN4SOLW.js → chunk-43UUP7VO.js} +72 -29
- package/bundle/{chunk-R5X4CMUM.js → chunk-5OOT636U.js} +30 -23
- package/bundle/{chunk-A62NZYIK.js → chunk-BLL44IGV.js} +71 -59
- package/bundle/{chunk-7UZ4Y32N.js → chunk-JS5WSGB2.js} +30 -23
- package/bundle/{chunk-LEK5YYAR.js → chunk-PPWUMHZT.js} +65 -28
- package/bundle/chunk-TSSVZ7RZ.js +98376 -0
- package/bundle/{chunk-TJ76C6AA.js → chunk-VSXV53B7.js} +5901 -11014
- package/bundle/{chunk-XX7JYMTE.js → chunk-WZB27TDF.js} +4 -4
- package/bundle/chunk-ZB4UQCX5.js +356418 -0
- package/bundle/{core-5OME6LT4.js → core-RMRIZ3E5.js} +4 -2
- package/bundle/{devtoolsService-TVWW3DBW.js → devtoolsService-2ULAA43E.js} +3 -3
- package/bundle/{devtoolsService-IDLWLZFQ.js → devtoolsService-AWVCG2N2.js} +5 -4
- package/bundle/devtoolsService-IWSTJYRB.js +871 -0
- package/bundle/{devtoolsService-4FIYD6OW.js → devtoolsService-SZYXXACN.js} +3 -3
- package/bundle/{core-CUCGSGCA.js → dist-4FKFY6XB.js} +4 -2
- package/bundle/{dist-YWCADMDD.js → dist-PRDBNGX2.js} +4 -2
- package/bundle/dist-TCCEQJDV.js +1942 -0
- package/bundle/docs/cli/plan-mode.md +10 -3
- package/bundle/docs/reference/policy-engine.md +20 -1
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-4WFWOVAQ.js → interactiveCli-24VGI5NV.js} +4 -4
- package/bundle/{interactiveCli-6SIGBRWS.js → interactiveCli-D2MTTARB.js} +4 -4
- package/bundle/{interactiveCli-4ZZ72DR3.js → interactiveCli-DX76MWWT.js} +264 -247
- package/bundle/interactiveCli-VNDJAKWG.js +50355 -0
- package/bundle/{memoryDiscovery-NS2EGHYH.js → memoryDiscovery-A265O6ML.js} +1 -1
- package/bundle/{memoryDiscovery-VL3OH25S.js → memoryDiscovery-H6J7KIH2.js} +1 -1
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-TYBJKXSJ.js → oauth2-provider-FZUTS3SV.js} +2 -2
- package/bundle/{oauth2-provider-HGHECKPY.js → oauth2-provider-K25DXIWC.js} +2 -2
- package/bundle/{oauth2-provider-YYRJ44X5.js → oauth2-provider-N73M7SQI.js} +39 -73
- package/bundle/oauth2-provider-RMDEEXSP.js +237 -0
- package/package.json +1 -1
|
@@ -186,12 +186,14 @@ import {
|
|
|
186
186
|
widestLineFromStyledChars,
|
|
187
187
|
wordBreakStyledChars,
|
|
188
188
|
wrapStyledChars
|
|
189
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-TSSVZ7RZ.js";
|
|
190
190
|
import {
|
|
191
191
|
ApiKeyUpdatedEvent,
|
|
192
192
|
AsyncFzf,
|
|
193
193
|
AuthType,
|
|
194
|
+
CompressionStatus,
|
|
194
195
|
ConversationFinishedEvent,
|
|
196
|
+
CoreToolCallStatus,
|
|
195
197
|
CreditPurchaseClickEvent,
|
|
196
198
|
EDITOR_DISPLAY_NAMES,
|
|
197
199
|
EmptyWalletMenuShownEvent,
|
|
@@ -201,10 +203,15 @@ import {
|
|
|
201
203
|
FileSearchFactory,
|
|
202
204
|
FolderTrustDiscoveryService,
|
|
203
205
|
G1_UTM_CAMPAIGNS,
|
|
206
|
+
GeminiCliOperation,
|
|
207
|
+
GeminiEventType,
|
|
204
208
|
GitService,
|
|
205
209
|
IdeClient,
|
|
206
210
|
LlmRole,
|
|
207
211
|
Logger,
|
|
212
|
+
MCPDiscoveryState,
|
|
213
|
+
MCPServerStatus,
|
|
214
|
+
MessageSenderType,
|
|
208
215
|
ModelNotFoundError,
|
|
209
216
|
ModelSlashCommandEvent,
|
|
210
217
|
OverageMenuShownEvent,
|
|
@@ -213,6 +220,8 @@ import {
|
|
|
213
220
|
ProjectIdRequiredError,
|
|
214
221
|
ROOT_SCHEDULER_ID,
|
|
215
222
|
Scheduler,
|
|
223
|
+
SessionEndReason,
|
|
224
|
+
SessionStartSource,
|
|
216
225
|
ShellExecutionService,
|
|
217
226
|
SlashCommandStatus,
|
|
218
227
|
TerminalQuotaError,
|
|
@@ -220,6 +229,7 @@ import {
|
|
|
220
229
|
UserPromptEvent,
|
|
221
230
|
UserTierId,
|
|
222
231
|
ValidationRequiredError,
|
|
232
|
+
WarningPriority,
|
|
223
233
|
addMCPStatusChangeListener,
|
|
224
234
|
allowEditorTypeInSandbox,
|
|
225
235
|
buildG1Url,
|
|
@@ -296,10 +306,12 @@ import {
|
|
|
296
306
|
validatePlanContent,
|
|
297
307
|
validatePlanPath,
|
|
298
308
|
writeToStdout
|
|
299
|
-
} from "./chunk-
|
|
309
|
+
} from "./chunk-ZB4UQCX5.js";
|
|
300
310
|
import {
|
|
301
311
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
312
|
+
ApprovalMode,
|
|
302
313
|
ChangeAuthRequestedError,
|
|
314
|
+
CoreEvent,
|
|
303
315
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
304
316
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
305
317
|
DEFAULT_GEMINI_MODEL,
|
|
@@ -310,13 +322,16 @@ import {
|
|
|
310
322
|
GEMINI_DIR,
|
|
311
323
|
GLOB_DISPLAY_NAME,
|
|
312
324
|
GREP_DISPLAY_NAME,
|
|
325
|
+
Kind,
|
|
313
326
|
LS_DISPLAY_NAME,
|
|
327
|
+
MessageBusType,
|
|
314
328
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
315
329
|
PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
|
|
316
330
|
PREVIEW_GEMINI_3_1_MODEL,
|
|
317
331
|
PREVIEW_GEMINI_FLASH_MODEL,
|
|
318
332
|
PREVIEW_GEMINI_MODEL,
|
|
319
333
|
PREVIEW_GEMINI_MODEL_AUTO,
|
|
334
|
+
QuestionType,
|
|
320
335
|
READ_FILE_DISPLAY_NAME,
|
|
321
336
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
322
337
|
SHELL_TOOL_NAME,
|
|
@@ -324,6 +339,8 @@ import {
|
|
|
324
339
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
325
340
|
TOPIC_PARAM_SUMMARY,
|
|
326
341
|
TOPIC_PARAM_TITLE,
|
|
342
|
+
ToolConfirmationOutcome,
|
|
343
|
+
ToolErrorType,
|
|
327
344
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
328
345
|
UPDATE_TOPIC_TOOL_NAME,
|
|
329
346
|
UnauthorizedError,
|
|
@@ -354,7 +371,7 @@ import {
|
|
|
354
371
|
safeJsonToMarkdown,
|
|
355
372
|
shortenPath,
|
|
356
373
|
tildeifyPath
|
|
357
|
-
} from "./chunk-
|
|
374
|
+
} from "./chunk-JS5WSGB2.js";
|
|
358
375
|
import "./chunk-664ZODQF.js";
|
|
359
376
|
import {
|
|
360
377
|
appEvents
|
|
@@ -22321,7 +22338,7 @@ function calculateShellMaxLines(options) {
|
|
|
22321
22338
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
22322
22339
|
return maxLinesBasedOnHeight;
|
|
22323
22340
|
}
|
|
22324
|
-
const isExecuting = status ===
|
|
22341
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
22325
22342
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
22326
22343
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
22327
22344
|
}
|
|
@@ -22354,10 +22371,10 @@ function isShellTool(name) {
|
|
|
22354
22371
|
return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME;
|
|
22355
22372
|
}
|
|
22356
22373
|
function isThisShellFocusable(name, status, config) {
|
|
22357
|
-
return !!(isShellTool(name) && status ===
|
|
22374
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
|
|
22358
22375
|
}
|
|
22359
22376
|
function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
|
|
22360
|
-
return !!(isShellTool(name) && status ===
|
|
22377
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
|
|
22361
22378
|
}
|
|
22362
22379
|
function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
|
|
22363
22380
|
const [userHasFocused, setUserHasFocused] = (0, import_react21.useState)(false);
|
|
@@ -22917,7 +22934,7 @@ var ToolMessage = ({
|
|
|
22917
22934
|
paddingX: 1,
|
|
22918
22935
|
flexDirection: "column",
|
|
22919
22936
|
children: [
|
|
22920
|
-
status ===
|
|
22937
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
22921
22938
|
McpProgressIndicator,
|
|
22922
22939
|
{
|
|
22923
22940
|
progress,
|
|
@@ -22934,8 +22951,8 @@ var ToolMessage = ({
|
|
|
22934
22951
|
terminalWidth,
|
|
22935
22952
|
renderOutputAsMarkdown,
|
|
22936
22953
|
hasFocus: isThisShellFocused2,
|
|
22937
|
-
maxLines: kind ===
|
|
22938
|
-
overflowDirection: kind ===
|
|
22954
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
22955
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
22939
22956
|
}
|
|
22940
22957
|
),
|
|
22941
22958
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -23660,7 +23677,7 @@ var ShellToolMessage = ({
|
|
|
23660
23677
|
maxLinesLimit: maxLines
|
|
23661
23678
|
});
|
|
23662
23679
|
import_react29.default.useEffect(() => {
|
|
23663
|
-
const isExecuting = status ===
|
|
23680
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
23664
23681
|
if (isExecuting && ptyId) {
|
|
23665
23682
|
try {
|
|
23666
23683
|
const childWidth = terminalWidth - 4;
|
|
@@ -24060,14 +24077,14 @@ var ToolActionsProvider = (props) => {
|
|
|
24060
24077
|
}
|
|
24061
24078
|
const details = tool.confirmationDetails;
|
|
24062
24079
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
24063
|
-
const cliOutcome = outcome ===
|
|
24080
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
24064
24081
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
24065
24082
|
}
|
|
24066
24083
|
if (tool.correlationId) {
|
|
24067
24084
|
await config.getMessageBus().publish({
|
|
24068
|
-
type:
|
|
24085
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
24069
24086
|
correlationId: tool.correlationId,
|
|
24070
|
-
confirmed: outcome !==
|
|
24087
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
24071
24088
|
requiresUserConfirmation: false,
|
|
24072
24089
|
outcome,
|
|
24073
24090
|
payload
|
|
@@ -24086,7 +24103,7 @@ var ToolActionsProvider = (props) => {
|
|
|
24086
24103
|
);
|
|
24087
24104
|
const cancel = (0, import_react31.useCallback)(
|
|
24088
24105
|
async (callId) => {
|
|
24089
|
-
await confirm(callId,
|
|
24106
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
24090
24107
|
},
|
|
24091
24108
|
[confirm]
|
|
24092
24109
|
);
|
|
@@ -24132,22 +24149,22 @@ var RenderItemsList = ({ items, maxVisible = 20 }) => {
|
|
|
24132
24149
|
function getFileOpData(diff2, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
24133
24150
|
const added = (diff2.diffStat?.model_added_lines ?? 0) + (diff2.diffStat?.user_added_lines ?? 0);
|
|
24134
24151
|
const removed = (diff2.diffStat?.model_removed_lines ?? 0) + (diff2.diffStat?.user_removed_lines ?? 0);
|
|
24135
|
-
const isAcceptedOrConfirming = status ===
|
|
24152
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
24136
24153
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
24137
24154
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
24138
24155
|
const showDiffStat = !!diff2.diffStat;
|
|
24139
24156
|
const description = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff2.fileName }) });
|
|
24140
24157
|
let resultSummary = "";
|
|
24141
24158
|
let resultColor = theme.text.secondary;
|
|
24142
|
-
if (status ===
|
|
24159
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
24143
24160
|
resultSummary = "Confirming";
|
|
24144
|
-
} else if (status ===
|
|
24161
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
24145
24162
|
resultSummary = "Accepted";
|
|
24146
24163
|
resultColor = theme.text.accent;
|
|
24147
|
-
} else if (status ===
|
|
24164
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
24148
24165
|
resultSummary = "Rejected";
|
|
24149
24166
|
resultColor = theme.status.error;
|
|
24150
|
-
} else if (status ===
|
|
24167
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
24151
24168
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
24152
24169
|
resultColor = theme.status.error;
|
|
24153
24170
|
}
|
|
@@ -24178,7 +24195,7 @@ function getFileOpData(diff2, status, resultDisplay, terminalWidth, availableTer
|
|
|
24178
24195
|
filename: diff2.fileName,
|
|
24179
24196
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
24180
24197
|
availableTerminalHeight,
|
|
24181
|
-
disableColor: status ===
|
|
24198
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
24182
24199
|
}
|
|
24183
24200
|
);
|
|
24184
24201
|
return { description, summary, payload };
|
|
@@ -24322,10 +24339,10 @@ var DenseToolMessage = (props) => {
|
|
|
24322
24339
|
if (isGrepResult(resultDisplay)) {
|
|
24323
24340
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
24324
24341
|
}
|
|
24325
|
-
if (status ===
|
|
24342
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
24326
24343
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
24327
24344
|
}
|
|
24328
|
-
if (status ===
|
|
24345
|
+
if (status === CoreToolCallStatus.Error) {
|
|
24329
24346
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
24330
24347
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
24331
24348
|
"\u2192 ",
|
|
@@ -24366,7 +24383,7 @@ var DenseToolMessage = (props) => {
|
|
|
24366
24383
|
language: fileExtension,
|
|
24367
24384
|
maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
24368
24385
|
settings,
|
|
24369
|
-
disableColor: status ===
|
|
24386
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
24370
24387
|
returnLines: true
|
|
24371
24388
|
});
|
|
24372
24389
|
} else {
|
|
@@ -24374,7 +24391,7 @@ var DenseToolMessage = (props) => {
|
|
|
24374
24391
|
parsedLines,
|
|
24375
24392
|
filename: diff2.fileName,
|
|
24376
24393
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
24377
|
-
disableColor: status ===
|
|
24394
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
24378
24395
|
});
|
|
24379
24396
|
}
|
|
24380
24397
|
}, [diff2, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
|
|
@@ -24474,14 +24491,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
|
|
|
24474
24491
|
if (isTrackedToolCall(t)) {
|
|
24475
24492
|
return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
|
|
24476
24493
|
} else {
|
|
24477
|
-
return t.status !==
|
|
24494
|
+
return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
|
|
24478
24495
|
}
|
|
24479
24496
|
});
|
|
24480
24497
|
const isEmbeddedShellFocused = toolsToInspect.some((t) => {
|
|
24481
24498
|
if (isTrackedToolCall(t)) {
|
|
24482
24499
|
return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
|
|
24483
24500
|
} else {
|
|
24484
|
-
return isShellTool(t.name) && t.status ===
|
|
24501
|
+
return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
|
|
24485
24502
|
}
|
|
24486
24503
|
});
|
|
24487
24504
|
const isShellCommand = toolsToInspect.some((t) => {
|
|
@@ -24551,7 +24568,7 @@ var ToolGroupMessage = ({
|
|
|
24551
24568
|
const isCompactModeEnabled = settings.merged.ui?.compactToolOutput === true;
|
|
24552
24569
|
const visibleToolCalls = (0, import_react33.useMemo)(
|
|
24553
24570
|
() => allToolCalls.filter((t) => {
|
|
24554
|
-
if (isLowErrorVerbosity && t.status ===
|
|
24571
|
+
if (isLowErrorVerbosity && t.status === CoreToolCallStatus.Error && !t.isClientInitiated) {
|
|
24555
24572
|
return false;
|
|
24556
24573
|
}
|
|
24557
24574
|
if (shouldHideToolCall({
|
|
@@ -24594,7 +24611,7 @@ var ToolGroupMessage = ({
|
|
|
24594
24611
|
const groupedTools = (0, import_react33.useMemo)(() => {
|
|
24595
24612
|
const groups = [];
|
|
24596
24613
|
for (const tool of visibleToolCalls) {
|
|
24597
|
-
if (tool.kind ===
|
|
24614
|
+
if (tool.kind === Kind.Agent) {
|
|
24598
24615
|
const lastGroup = groups[groups.length - 1];
|
|
24599
24616
|
if (Array.isArray(lastGroup)) {
|
|
24600
24617
|
lastGroup.push(tool);
|
|
@@ -24643,7 +24660,7 @@ var ToolGroupMessage = ({
|
|
|
24643
24660
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
24644
24661
|
let countToolCallsWithResults = 0;
|
|
24645
24662
|
for (const tool of visibleToolCalls) {
|
|
24646
|
-
if (tool.kind !==
|
|
24663
|
+
if (tool.kind !== Kind.Agent) {
|
|
24647
24664
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
24648
24665
|
if (hasDensePayload(tool)) {
|
|
24649
24666
|
countToolCallsWithResults++;
|
|
@@ -24858,18 +24875,18 @@ function CompressionMessage({
|
|
|
24858
24875
|
return "Compressing chat history";
|
|
24859
24876
|
}
|
|
24860
24877
|
switch (compressionStatus) {
|
|
24861
|
-
case
|
|
24878
|
+
case CompressionStatus.COMPRESSED:
|
|
24862
24879
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
24863
|
-
case
|
|
24880
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
24864
24881
|
if (originalTokens < 5e4) {
|
|
24865
24882
|
return "Compression was not beneficial for this history size.";
|
|
24866
24883
|
}
|
|
24867
24884
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
24868
|
-
case
|
|
24885
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
24869
24886
|
return "Could not compress chat history due to a token counting error.";
|
|
24870
|
-
case
|
|
24887
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
24871
24888
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
24872
|
-
case
|
|
24889
|
+
case CompressionStatus.NOOP:
|
|
24873
24890
|
return "Nothing to compress.";
|
|
24874
24891
|
default:
|
|
24875
24892
|
return "";
|
|
@@ -25638,7 +25655,7 @@ var StatsDisplay = ({
|
|
|
25638
25655
|
const config = useConfig();
|
|
25639
25656
|
const useGemini3_1 = config.getGemini31LaunchedSync?.() ?? false;
|
|
25640
25657
|
const useGemini3_1FlashLite = config.getGemini31FlashLiteLaunchedSync?.() ?? false;
|
|
25641
|
-
const useCustomToolModel = useGemini3_1 && config.getContentGeneratorConfig().authType ===
|
|
25658
|
+
const useCustomToolModel = useGemini3_1 && config.getContentGeneratorConfig().authType === AuthType.USE_GEMINI;
|
|
25642
25659
|
const pooledRemaining = quotaStats?.remaining;
|
|
25643
25660
|
const pooledLimit = quotaStats?.limit;
|
|
25644
25661
|
const pooledResetTime = quotaStats?.resetTime;
|
|
@@ -25868,8 +25885,8 @@ var ModelStatsDisplay = ({
|
|
|
25868
25885
|
return validRoles.includes(role);
|
|
25869
25886
|
}).sort((a, b) => {
|
|
25870
25887
|
if (a === b) return 0;
|
|
25871
|
-
if (a ===
|
|
25872
|
-
if (b ===
|
|
25888
|
+
if (a === LlmRole.MAIN) return -1;
|
|
25889
|
+
if (b === LlmRole.MAIN) return 1;
|
|
25873
25890
|
return a.localeCompare(b);
|
|
25874
25891
|
});
|
|
25875
25892
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -26659,7 +26676,7 @@ var McpStatus = ({
|
|
|
26659
26676
|
);
|
|
26660
26677
|
const originalStatus = serverStatus(serverName);
|
|
26661
26678
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
26662
|
-
const status = originalStatus ===
|
|
26679
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
26663
26680
|
let statusIndicator = "";
|
|
26664
26681
|
let statusText = "";
|
|
26665
26682
|
let statusColor = theme.text.primary;
|
|
@@ -26671,17 +26688,17 @@ var McpStatus = ({
|
|
|
26671
26688
|
statusColor = theme.text.secondary;
|
|
26672
26689
|
} else {
|
|
26673
26690
|
switch (status) {
|
|
26674
|
-
case
|
|
26691
|
+
case MCPServerStatus.CONNECTED:
|
|
26675
26692
|
statusIndicator = "\u{1F7E2}";
|
|
26676
26693
|
statusText = "Ready";
|
|
26677
26694
|
statusColor = theme.status.success;
|
|
26678
26695
|
break;
|
|
26679
|
-
case
|
|
26696
|
+
case MCPServerStatus.CONNECTING:
|
|
26680
26697
|
statusIndicator = "\u{1F504}";
|
|
26681
26698
|
statusText = "Starting... (first startup may take longer)";
|
|
26682
26699
|
statusColor = theme.status.warning;
|
|
26683
26700
|
break;
|
|
26684
|
-
case
|
|
26701
|
+
case MCPServerStatus.DISCONNECTED:
|
|
26685
26702
|
default:
|
|
26686
26703
|
statusIndicator = "\u{1F534}";
|
|
26687
26704
|
statusText = "Disconnected";
|
|
@@ -26729,12 +26746,12 @@ var McpStatus = ({
|
|
|
26729
26746
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Text, { children: [
|
|
26730
26747
|
" - ",
|
|
26731
26748
|
statusText,
|
|
26732
|
-
status ===
|
|
26749
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
26733
26750
|
] }),
|
|
26734
26751
|
authStatusNode
|
|
26735
26752
|
] }),
|
|
26736
|
-
status ===
|
|
26737
|
-
status ===
|
|
26753
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
26754
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Text, { children: [
|
|
26738
26755
|
" (",
|
|
26739
26756
|
toolCount,
|
|
26740
26757
|
" tools cached)"
|
|
@@ -27223,7 +27240,7 @@ var Notifications = () => {
|
|
|
27223
27240
|
if (dismissed) return [];
|
|
27224
27241
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
27225
27242
|
return startupWarnings.filter((w) => {
|
|
27226
|
-
if (w.priority ===
|
|
27243
|
+
if (w.priority === WarningPriority.Low) {
|
|
27227
27244
|
const count = counts[w.id] || 0;
|
|
27228
27245
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
27229
27246
|
}
|
|
@@ -27236,7 +27253,7 @@ var Notifications = () => {
|
|
|
27236
27253
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
27237
27254
|
let changed = false;
|
|
27238
27255
|
visibleWarnings.forEach((w) => {
|
|
27239
|
-
if (w.priority ===
|
|
27256
|
+
if (w.priority === WarningPriority.Low) {
|
|
27240
27257
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
27241
27258
|
changed = true;
|
|
27242
27259
|
}
|
|
@@ -27343,7 +27360,7 @@ var UserIdentity = ({ config }) => {
|
|
|
27343
27360
|
}
|
|
27344
27361
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
27345
27362
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Box_default, { children: [
|
|
27346
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
27363
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Text, { children: [
|
|
27347
27364
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Text, { bold: true, children: [
|
|
27348
27365
|
"Signed in with Google",
|
|
27349
27366
|
email ? ":" : ""
|
|
@@ -27596,7 +27613,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
27596
27613
|
return pendingHistoryItems.some((item) => {
|
|
27597
27614
|
if (item && item.type === "tool_group") {
|
|
27598
27615
|
return item.tools.some(
|
|
27599
|
-
(tool) =>
|
|
27616
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
27600
27617
|
);
|
|
27601
27618
|
}
|
|
27602
27619
|
return false;
|
|
@@ -27605,7 +27622,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
27605
27622
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
27606
27623
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
27607
27624
|
(item) => item.tools.some(
|
|
27608
|
-
(tool) =>
|
|
27625
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
27609
27626
|
)
|
|
27610
27627
|
);
|
|
27611
27628
|
}
|
|
@@ -27617,7 +27634,7 @@ function getAllToolCalls(historyItems) {
|
|
|
27617
27634
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
27618
27635
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
27619
27636
|
const confirmingTools = allPendingTools.filter(
|
|
27620
|
-
(tool) => tool.status ===
|
|
27637
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
27621
27638
|
);
|
|
27622
27639
|
if (confirmingTools.length === 0) {
|
|
27623
27640
|
return null;
|
|
@@ -28905,7 +28922,7 @@ var ExitPlanModeDialog = ({
|
|
|
28905
28922
|
{
|
|
28906
28923
|
questions: [
|
|
28907
28924
|
{
|
|
28908
|
-
type:
|
|
28925
|
+
type: QuestionType.CHOICE,
|
|
28909
28926
|
header: "Approval",
|
|
28910
28927
|
question: planContent,
|
|
28911
28928
|
options: [
|
|
@@ -28926,9 +28943,9 @@ var ExitPlanModeDialog = ({
|
|
|
28926
28943
|
onSubmit: (answers) => {
|
|
28927
28944
|
const answer = answers["0"];
|
|
28928
28945
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
28929
|
-
onApprove(
|
|
28946
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
28930
28947
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
28931
|
-
onApprove(
|
|
28948
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
28932
28949
|
} else if (answer) {
|
|
28933
28950
|
onFeedback(answer);
|
|
28934
28951
|
}
|
|
@@ -29134,7 +29151,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
29134
29151
|
);
|
|
29135
29152
|
(0, import_react49.useEffect)(() => {
|
|
29136
29153
|
if (isCancelling) {
|
|
29137
|
-
handleConfirm(
|
|
29154
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
29138
29155
|
}
|
|
29139
29156
|
}, [isCancelling, handleConfirm]);
|
|
29140
29157
|
const handleSelect = (0, import_react49.useCallback)(
|
|
@@ -29147,19 +29164,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
29147
29164
|
if (!confirmationDetails.isModifying) {
|
|
29148
29165
|
options2.push({
|
|
29149
29166
|
label: "Allow once",
|
|
29150
|
-
value:
|
|
29167
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
29151
29168
|
key: "Allow once"
|
|
29152
29169
|
});
|
|
29153
29170
|
if (isTrustedFolder) {
|
|
29154
29171
|
options2.push({
|
|
29155
29172
|
label: "Allow for this session",
|
|
29156
|
-
value:
|
|
29173
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
29157
29174
|
key: "Allow for this session"
|
|
29158
29175
|
});
|
|
29159
29176
|
if (allowPermanentApproval) {
|
|
29160
29177
|
options2.push({
|
|
29161
29178
|
label: "Allow for this file in all future sessions",
|
|
29162
|
-
value:
|
|
29179
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
29163
29180
|
key: "Allow for this file in all future sessions"
|
|
29164
29181
|
});
|
|
29165
29182
|
}
|
|
@@ -29167,119 +29184,119 @@ ${deceptiveUrlWarnings.map(
|
|
|
29167
29184
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
29168
29185
|
options2.push({
|
|
29169
29186
|
label: "Modify with external editor",
|
|
29170
|
-
value:
|
|
29187
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
29171
29188
|
key: "Modify with external editor"
|
|
29172
29189
|
});
|
|
29173
29190
|
}
|
|
29174
29191
|
options2.push({
|
|
29175
29192
|
label: "No, suggest changes (esc)",
|
|
29176
|
-
value:
|
|
29193
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
29177
29194
|
key: "No, suggest changes (esc)"
|
|
29178
29195
|
});
|
|
29179
29196
|
}
|
|
29180
29197
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
29181
29198
|
options2.push({
|
|
29182
29199
|
label: "Allow once",
|
|
29183
|
-
value:
|
|
29200
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
29184
29201
|
key: "Allow once"
|
|
29185
29202
|
});
|
|
29186
29203
|
if (isTrustedFolder) {
|
|
29187
29204
|
options2.push({
|
|
29188
29205
|
label: "Allow for this session",
|
|
29189
|
-
value:
|
|
29206
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
29190
29207
|
key: "Allow for this session"
|
|
29191
29208
|
});
|
|
29192
29209
|
if (allowPermanentApproval) {
|
|
29193
29210
|
options2.push({
|
|
29194
29211
|
label: "Allow for all future sessions",
|
|
29195
|
-
value:
|
|
29212
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
29196
29213
|
key: "Allow for all future sessions"
|
|
29197
29214
|
});
|
|
29198
29215
|
}
|
|
29199
29216
|
}
|
|
29200
29217
|
options2.push({
|
|
29201
29218
|
label: "No, suggest changes (esc)",
|
|
29202
|
-
value:
|
|
29219
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
29203
29220
|
key: "No, suggest changes (esc)"
|
|
29204
29221
|
});
|
|
29205
29222
|
} else if (confirmationDetails.type === "exec") {
|
|
29206
29223
|
options2.push({
|
|
29207
29224
|
label: "Allow once",
|
|
29208
|
-
value:
|
|
29225
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
29209
29226
|
key: "Allow once"
|
|
29210
29227
|
});
|
|
29211
29228
|
if (isTrustedFolder) {
|
|
29212
29229
|
options2.push({
|
|
29213
29230
|
label: `Allow for this session`,
|
|
29214
|
-
value:
|
|
29231
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
29215
29232
|
key: `Allow for this session`
|
|
29216
29233
|
});
|
|
29217
29234
|
if (allowPermanentApproval) {
|
|
29218
29235
|
options2.push({
|
|
29219
29236
|
label: `Allow this command for all future sessions`,
|
|
29220
|
-
value:
|
|
29237
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
29221
29238
|
key: `Allow for all future sessions`
|
|
29222
29239
|
});
|
|
29223
29240
|
}
|
|
29224
29241
|
}
|
|
29225
29242
|
options2.push({
|
|
29226
29243
|
label: "No, suggest changes (esc)",
|
|
29227
|
-
value:
|
|
29244
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
29228
29245
|
key: "No, suggest changes (esc)"
|
|
29229
29246
|
});
|
|
29230
29247
|
} else if (confirmationDetails.type === "info") {
|
|
29231
29248
|
options2.push({
|
|
29232
29249
|
label: "Allow once",
|
|
29233
|
-
value:
|
|
29250
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
29234
29251
|
key: "Allow once"
|
|
29235
29252
|
});
|
|
29236
29253
|
if (isTrustedFolder) {
|
|
29237
29254
|
options2.push({
|
|
29238
29255
|
label: "Allow for this session",
|
|
29239
|
-
value:
|
|
29256
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
29240
29257
|
key: "Allow for this session"
|
|
29241
29258
|
});
|
|
29242
29259
|
if (allowPermanentApproval) {
|
|
29243
29260
|
options2.push({
|
|
29244
29261
|
label: "Allow for all future sessions",
|
|
29245
|
-
value:
|
|
29262
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
29246
29263
|
key: "Allow for all future sessions"
|
|
29247
29264
|
});
|
|
29248
29265
|
}
|
|
29249
29266
|
}
|
|
29250
29267
|
options2.push({
|
|
29251
29268
|
label: "No, suggest changes (esc)",
|
|
29252
|
-
value:
|
|
29269
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
29253
29270
|
key: "No, suggest changes (esc)"
|
|
29254
29271
|
});
|
|
29255
29272
|
} else if (confirmationDetails.type === "mcp") {
|
|
29256
29273
|
options2.push({
|
|
29257
29274
|
label: "Allow once",
|
|
29258
|
-
value:
|
|
29275
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
29259
29276
|
key: "Allow once"
|
|
29260
29277
|
});
|
|
29261
29278
|
if (isTrustedFolder) {
|
|
29262
29279
|
options2.push({
|
|
29263
29280
|
label: "Allow tool for this session",
|
|
29264
|
-
value:
|
|
29281
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
29265
29282
|
key: "Allow tool for this session"
|
|
29266
29283
|
});
|
|
29267
29284
|
options2.push({
|
|
29268
29285
|
label: "Allow all server tools for this session",
|
|
29269
|
-
value:
|
|
29286
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
29270
29287
|
key: "Allow all server tools for this session"
|
|
29271
29288
|
});
|
|
29272
29289
|
if (allowPermanentApproval) {
|
|
29273
29290
|
options2.push({
|
|
29274
29291
|
label: "Allow tool for all future sessions",
|
|
29275
|
-
value:
|
|
29292
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
29276
29293
|
key: "Allow tool for all future sessions"
|
|
29277
29294
|
});
|
|
29278
29295
|
}
|
|
29279
29296
|
}
|
|
29280
29297
|
options2.push({
|
|
29281
29298
|
label: "No, suggest changes (esc)",
|
|
29282
|
-
value:
|
|
29299
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
29283
29300
|
key: "No, suggest changes (esc)"
|
|
29284
29301
|
});
|
|
29285
29302
|
}
|
|
@@ -29324,7 +29341,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
29324
29341
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
29325
29342
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
29326
29343
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
29327
|
-
(o) => o.value ===
|
|
29344
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
29328
29345
|
);
|
|
29329
29346
|
if (alwaysAndSaveIndex !== -1) {
|
|
29330
29347
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -29340,10 +29357,10 @@ ${deceptiveUrlWarnings.map(
|
|
|
29340
29357
|
{
|
|
29341
29358
|
questions: confirmationDetails.questions,
|
|
29342
29359
|
onSubmit: (answers) => {
|
|
29343
|
-
handleConfirm(
|
|
29360
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
29344
29361
|
},
|
|
29345
29362
|
onCancel: () => {
|
|
29346
|
-
handleConfirm(
|
|
29363
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
29347
29364
|
},
|
|
29348
29365
|
width: terminalWidth,
|
|
29349
29366
|
availableHeight: availableBodyContentHeight()
|
|
@@ -29364,19 +29381,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
29364
29381
|
planPath: confirmationDetails.planPath,
|
|
29365
29382
|
getPreferredEditor,
|
|
29366
29383
|
onApprove: (approvalMode) => {
|
|
29367
|
-
handleConfirm(
|
|
29384
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
29368
29385
|
approved: true,
|
|
29369
29386
|
approvalMode
|
|
29370
29387
|
});
|
|
29371
29388
|
},
|
|
29372
29389
|
onFeedback: (feedback) => {
|
|
29373
|
-
handleConfirm(
|
|
29390
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
29374
29391
|
approved: false,
|
|
29375
29392
|
feedback
|
|
29376
29393
|
});
|
|
29377
29394
|
},
|
|
29378
29395
|
onCancel: () => {
|
|
29379
|
-
handleConfirm(
|
|
29396
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
29380
29397
|
},
|
|
29381
29398
|
width: terminalWidth,
|
|
29382
29399
|
availableHeight: availableBodyContentHeight()
|
|
@@ -29453,7 +29470,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
29453
29470
|
);
|
|
29454
29471
|
let bodyContentHeight = availableBodyContentHeight();
|
|
29455
29472
|
let warnings = null;
|
|
29456
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
29473
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
29457
29474
|
if (containsRedirection && !isAutoEdit) {
|
|
29458
29475
|
const safeWidth = Math.max(terminalWidth, 1);
|
|
29459
29476
|
const noteLength = REDIRECTION_WARNING_NOTE_LABEL.length + REDIRECTION_WARNING_NOTE_TEXT.length;
|
|
@@ -31671,7 +31688,7 @@ function validateAuthMethodWithSettings(authType, settings) {
|
|
|
31671
31688
|
if (settings.merged.security.auth.useExternal) {
|
|
31672
31689
|
return null;
|
|
31673
31690
|
}
|
|
31674
|
-
if (authType ===
|
|
31691
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
31675
31692
|
return null;
|
|
31676
31693
|
}
|
|
31677
31694
|
return validateAuthMethod(authType);
|
|
@@ -31723,7 +31740,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
31723
31740
|
}
|
|
31724
31741
|
return;
|
|
31725
31742
|
}
|
|
31726
|
-
if (authType ===
|
|
31743
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
31727
31744
|
const key = await reloadApiKey();
|
|
31728
31745
|
if (!key) {
|
|
31729
31746
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -31798,31 +31815,31 @@ function AuthDialog({
|
|
|
31798
31815
|
let items = [
|
|
31799
31816
|
{
|
|
31800
31817
|
label: "Sign in with Google",
|
|
31801
|
-
value:
|
|
31802
|
-
key:
|
|
31818
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
31819
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
31803
31820
|
},
|
|
31804
31821
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
31805
31822
|
{
|
|
31806
31823
|
label: "Use Cloud Shell user credentials",
|
|
31807
|
-
value:
|
|
31808
|
-
key:
|
|
31824
|
+
value: AuthType.COMPUTE_ADC,
|
|
31825
|
+
key: AuthType.COMPUTE_ADC
|
|
31809
31826
|
}
|
|
31810
31827
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
31811
31828
|
{
|
|
31812
31829
|
label: "Use metadata server application default credentials",
|
|
31813
|
-
value:
|
|
31814
|
-
key:
|
|
31830
|
+
value: AuthType.COMPUTE_ADC,
|
|
31831
|
+
key: AuthType.COMPUTE_ADC
|
|
31815
31832
|
}
|
|
31816
31833
|
] : [],
|
|
31817
31834
|
{
|
|
31818
31835
|
label: "Use Gemini API Key",
|
|
31819
|
-
value:
|
|
31820
|
-
key:
|
|
31836
|
+
value: AuthType.USE_GEMINI,
|
|
31837
|
+
key: AuthType.USE_GEMINI
|
|
31821
31838
|
},
|
|
31822
31839
|
{
|
|
31823
31840
|
label: "Vertex AI",
|
|
31824
|
-
value:
|
|
31825
|
-
key:
|
|
31841
|
+
value: AuthType.USE_VERTEX_AI,
|
|
31842
|
+
key: AuthType.USE_VERTEX_AI
|
|
31826
31843
|
}
|
|
31827
31844
|
];
|
|
31828
31845
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -31844,9 +31861,9 @@ function AuthDialog({
|
|
|
31844
31861
|
return item.value === defaultAuthType;
|
|
31845
31862
|
}
|
|
31846
31863
|
if (process.env["GEMINI_API_KEY"]) {
|
|
31847
|
-
return item.value ===
|
|
31864
|
+
return item.value === AuthType.USE_GEMINI;
|
|
31848
31865
|
}
|
|
31849
|
-
return item.value ===
|
|
31866
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
31850
31867
|
});
|
|
31851
31868
|
if (settings.merged.security.auth.enforcedType) {
|
|
31852
31869
|
initialAuthIndex = 0;
|
|
@@ -31857,19 +31874,19 @@ function AuthDialog({
|
|
|
31857
31874
|
return;
|
|
31858
31875
|
}
|
|
31859
31876
|
if (authType) {
|
|
31860
|
-
if (authType ===
|
|
31877
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
31861
31878
|
setAuthContext({ requiresRestart: true });
|
|
31862
31879
|
} else {
|
|
31863
31880
|
setAuthContext({});
|
|
31864
31881
|
}
|
|
31865
31882
|
await clearCachedCredentialFile();
|
|
31866
31883
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
31867
|
-
if (authType ===
|
|
31884
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
31868
31885
|
setExiting(true);
|
|
31869
31886
|
setTimeout(relaunchApp, 100);
|
|
31870
31887
|
return;
|
|
31871
31888
|
}
|
|
31872
|
-
if (authType ===
|
|
31889
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
31873
31890
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
31874
31891
|
return;
|
|
31875
31892
|
}
|
|
@@ -32619,11 +32636,11 @@ var PrivacyNoticeText = ({
|
|
|
32619
32636
|
}) => {
|
|
32620
32637
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
32621
32638
|
switch (authType) {
|
|
32622
|
-
case
|
|
32639
|
+
case AuthType.USE_GEMINI:
|
|
32623
32640
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(GeminiPrivacyNotice, { onExit });
|
|
32624
|
-
case
|
|
32641
|
+
case AuthType.USE_VERTEX_AI:
|
|
32625
32642
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
32626
|
-
case
|
|
32643
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
32627
32644
|
default:
|
|
32628
32645
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
32629
32646
|
}
|
|
@@ -32664,7 +32681,7 @@ function ProQuotaDialog({
|
|
|
32664
32681
|
value: "retry_always",
|
|
32665
32682
|
key: "retry_always"
|
|
32666
32683
|
},
|
|
32667
|
-
...authType ===
|
|
32684
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
32668
32685
|
{
|
|
32669
32686
|
label: "Upgrade for higher limits",
|
|
32670
32687
|
value: "upgrade",
|
|
@@ -33668,7 +33685,7 @@ function ModelDialog({ onClose }) {
|
|
|
33668
33685
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
33669
33686
|
const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
|
|
33670
33687
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
33671
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
33688
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
33672
33689
|
const manualModelSelected = (0, import_react66.useMemo)(() => {
|
|
33673
33690
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
33674
33691
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -34713,10 +34730,10 @@ function initializeConsoleStore() {
|
|
|
34713
34730
|
globalConsoleMessages = [];
|
|
34714
34731
|
globalErrorCount = 0;
|
|
34715
34732
|
notifyListeners();
|
|
34716
|
-
coreEvents.off(
|
|
34717
|
-
coreEvents.off(
|
|
34718
|
-
coreEvents.on(
|
|
34719
|
-
coreEvents.on(
|
|
34733
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
34734
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
34735
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
34736
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
34720
34737
|
}
|
|
34721
34738
|
function notifyListeners() {
|
|
34722
34739
|
for (const listener of listeners) {
|
|
@@ -36792,7 +36809,7 @@ function usePromptCompletion({
|
|
|
36792
36809
|
{ model: "prompt-completion" },
|
|
36793
36810
|
contents,
|
|
36794
36811
|
signal,
|
|
36795
|
-
|
|
36812
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
36796
36813
|
);
|
|
36797
36814
|
if (signal.aborted) {
|
|
36798
36815
|
return;
|
|
@@ -38376,9 +38393,9 @@ var InputPrompt = ({
|
|
|
38376
38393
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
38377
38394
|
}
|
|
38378
38395
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
38379
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
38380
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
38381
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
38396
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
38397
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
38398
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
38382
38399
|
let statusColor;
|
|
38383
38400
|
let statusText = "";
|
|
38384
38401
|
if (shellModeActive) {
|
|
@@ -39291,22 +39308,22 @@ var ApprovalModeIndicator = ({
|
|
|
39291
39308
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
39292
39309
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
39293
39310
|
switch (approvalMode) {
|
|
39294
|
-
case
|
|
39311
|
+
case ApprovalMode.AUTO_EDIT:
|
|
39295
39312
|
textColor = theme.status.warning;
|
|
39296
39313
|
textContent = "auto-accept edits";
|
|
39297
39314
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
39298
39315
|
break;
|
|
39299
|
-
case
|
|
39316
|
+
case ApprovalMode.PLAN:
|
|
39300
39317
|
textColor = theme.status.success;
|
|
39301
39318
|
textContent = "plan";
|
|
39302
39319
|
subText = `${cycleHint} to manual`;
|
|
39303
39320
|
break;
|
|
39304
|
-
case
|
|
39321
|
+
case ApprovalMode.YOLO:
|
|
39305
39322
|
textColor = theme.status.error;
|
|
39306
39323
|
textContent = "YOLO";
|
|
39307
39324
|
subText = yoloHint;
|
|
39308
39325
|
break;
|
|
39309
|
-
case
|
|
39326
|
+
case ApprovalMode.DEFAULT:
|
|
39310
39327
|
default:
|
|
39311
39328
|
textColor = theme.text.accent;
|
|
39312
39329
|
textContent = "";
|
|
@@ -39353,7 +39370,7 @@ var useComposerStatus = () => {
|
|
|
39353
39370
|
(item) => item.type === "tool_group"
|
|
39354
39371
|
).some(
|
|
39355
39372
|
(item) => item.tools.some(
|
|
39356
|
-
(tool) => tool.status ===
|
|
39373
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
39357
39374
|
)
|
|
39358
39375
|
),
|
|
39359
39376
|
[uiState.pendingHistoryItems]
|
|
@@ -39368,13 +39385,13 @@ var useComposerStatus = () => {
|
|
|
39368
39385
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
39369
39386
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
39370
39387
|
switch (showApprovalModeIndicator) {
|
|
39371
|
-
case
|
|
39388
|
+
case ApprovalMode.YOLO:
|
|
39372
39389
|
return { text: "YOLO", color: theme.status.error };
|
|
39373
|
-
case
|
|
39390
|
+
case ApprovalMode.PLAN:
|
|
39374
39391
|
return { text: "plan", color: theme.status.success };
|
|
39375
|
-
case
|
|
39392
|
+
case ApprovalMode.AUTO_EDIT:
|
|
39376
39393
|
return { text: "auto edit", color: theme.status.warning };
|
|
39377
|
-
case
|
|
39394
|
+
case ApprovalMode.DEFAULT:
|
|
39378
39395
|
default:
|
|
39379
39396
|
return null;
|
|
39380
39397
|
}
|
|
@@ -39715,7 +39732,7 @@ var ConfigInitDisplay = ({
|
|
|
39715
39732
|
let connected = 0;
|
|
39716
39733
|
const connecting = [];
|
|
39717
39734
|
for (const [name, client] of clients.entries()) {
|
|
39718
|
-
if (client.getStatus() ===
|
|
39735
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
39719
39736
|
connected++;
|
|
39720
39737
|
} else {
|
|
39721
39738
|
connecting.push(name);
|
|
@@ -39737,9 +39754,9 @@ var ConfigInitDisplay = ({
|
|
|
39737
39754
|
);
|
|
39738
39755
|
}
|
|
39739
39756
|
};
|
|
39740
|
-
coreEvents.on(
|
|
39757
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
39741
39758
|
return () => {
|
|
39742
|
-
coreEvents.off(
|
|
39759
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
39743
39760
|
};
|
|
39744
39761
|
}, [initialMessage]);
|
|
39745
39762
|
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(Text, { children: [
|
|
@@ -40464,7 +40481,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
40464
40481
|
callId,
|
|
40465
40482
|
name: SHELL_COMMAND_NAME,
|
|
40466
40483
|
description: rawQuery,
|
|
40467
|
-
status:
|
|
40484
|
+
status: CoreToolCallStatus.Executing,
|
|
40468
40485
|
isClientInitiated: true,
|
|
40469
40486
|
resultDisplay: "",
|
|
40470
40487
|
confirmationDetails: void 0
|
|
@@ -40589,24 +40606,24 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
40589
40606
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
40590
40607
|
}
|
|
40591
40608
|
let finalOutput = mainContent;
|
|
40592
|
-
let finalStatus =
|
|
40609
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
40593
40610
|
if (result.error) {
|
|
40594
|
-
finalStatus =
|
|
40611
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
40595
40612
|
finalOutput = `${result.error.message}
|
|
40596
40613
|
${finalOutput}`;
|
|
40597
40614
|
} else if (result.aborted) {
|
|
40598
|
-
finalStatus =
|
|
40615
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
40599
40616
|
finalOutput = `Command was cancelled.
|
|
40600
40617
|
${finalOutput}`;
|
|
40601
40618
|
} else if (result.backgrounded) {
|
|
40602
|
-
finalStatus =
|
|
40619
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
40603
40620
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
40604
40621
|
} else if (result.signal) {
|
|
40605
|
-
finalStatus =
|
|
40622
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
40606
40623
|
finalOutput = `Command terminated by signal: ${result.signal}.
|
|
40607
40624
|
${finalOutput}`;
|
|
40608
40625
|
} else if (result.exitCode !== 0) {
|
|
40609
|
-
finalStatus =
|
|
40626
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
40610
40627
|
finalOutput = `Command exited with code ${result.exitCode}.
|
|
40611
40628
|
${finalOutput}`;
|
|
40612
40629
|
}
|
|
@@ -40624,7 +40641,7 @@ ${finalOutput}`;
|
|
|
40624
40641
|
status: finalStatus,
|
|
40625
40642
|
resultDisplay: finalOutput
|
|
40626
40643
|
};
|
|
40627
|
-
if (finalStatus !==
|
|
40644
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
40628
40645
|
addItemToHistory(
|
|
40629
40646
|
{
|
|
40630
40647
|
type: "tool_group",
|
|
@@ -41605,7 +41622,7 @@ function useQuotaAndFallback({
|
|
|
41605
41622
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
41606
41623
|
`/stats model for usage details`,
|
|
41607
41624
|
`/model to switch models.`,
|
|
41608
|
-
contentGeneratorConfig?.authType ===
|
|
41625
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
41609
41626
|
].filter(Boolean);
|
|
41610
41627
|
message = messageLines.join("\n");
|
|
41611
41628
|
} else if (error instanceof ModelNotFoundError) {
|
|
@@ -41793,7 +41810,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
41793
41810
|
);
|
|
41794
41811
|
setEditorError(null);
|
|
41795
41812
|
setIsEditorDialogOpen(false);
|
|
41796
|
-
coreEvents.emit(
|
|
41813
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
41797
41814
|
} catch (error) {
|
|
41798
41815
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
41799
41816
|
}
|
|
@@ -41802,7 +41819,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
41802
41819
|
);
|
|
41803
41820
|
const exitEditorDialog = (0, import_react99.useCallback)(() => {
|
|
41804
41821
|
setIsEditorDialogOpen(false);
|
|
41805
|
-
coreEvents.emit(
|
|
41822
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
41806
41823
|
}, []);
|
|
41807
41824
|
return {
|
|
41808
41825
|
isEditorDialogOpen,
|
|
@@ -42157,7 +42174,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
42157
42174
|
canonicalPath: resolvedCommandPath
|
|
42158
42175
|
} = parseSlashCommand(trimmed, commands);
|
|
42159
42176
|
if (!commandToExecute) {
|
|
42160
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
42177
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
42161
42178
|
if (isMcpLoading) {
|
|
42162
42179
|
setIsProcessing(true);
|
|
42163
42180
|
if (addToHistory) {
|
|
@@ -42325,7 +42342,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
42325
42342
|
onConfirm: async (resolvedOutcome) => {
|
|
42326
42343
|
resolve3({
|
|
42327
42344
|
outcome: resolvedOutcome,
|
|
42328
|
-
approvedCommands: resolvedOutcome ===
|
|
42345
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
42329
42346
|
});
|
|
42330
42347
|
}
|
|
42331
42348
|
};
|
|
@@ -42333,7 +42350,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
42333
42350
|
callId,
|
|
42334
42351
|
name: "Expansion",
|
|
42335
42352
|
description: "Command expansion needs shell access",
|
|
42336
|
-
status:
|
|
42353
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
42337
42354
|
isClientInitiated: true,
|
|
42338
42355
|
resultDisplay: void 0,
|
|
42339
42356
|
confirmationDetails
|
|
@@ -42344,7 +42361,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
42344
42361
|
});
|
|
42345
42362
|
});
|
|
42346
42363
|
setPendingItem(null);
|
|
42347
|
-
if (outcome ===
|
|
42364
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
42348
42365
|
addItem(
|
|
42349
42366
|
{
|
|
42350
42367
|
type: "info" /* INFO */,
|
|
@@ -42354,7 +42371,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
42354
42371
|
);
|
|
42355
42372
|
return { type: "handled" };
|
|
42356
42373
|
}
|
|
42357
|
-
if (outcome ===
|
|
42374
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
42358
42375
|
setSessionShellAllowlist(
|
|
42359
42376
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
42360
42377
|
);
|
|
@@ -42834,7 +42851,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
42834
42851
|
let description;
|
|
42835
42852
|
let renderOutputAsMarkdown = false;
|
|
42836
42853
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
42837
|
-
if (call.status ===
|
|
42854
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
42838
42855
|
description = JSON.stringify(call.request.args);
|
|
42839
42856
|
} else {
|
|
42840
42857
|
description = call.invocation.getDescription();
|
|
@@ -42857,27 +42874,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
42857
42874
|
let progress = void 0;
|
|
42858
42875
|
let progressTotal = void 0;
|
|
42859
42876
|
switch (call.status) {
|
|
42860
|
-
case
|
|
42877
|
+
case CoreToolCallStatus.Success:
|
|
42861
42878
|
resultDisplay = call.response.resultDisplay;
|
|
42862
42879
|
outputFile = call.response.outputFile;
|
|
42863
42880
|
break;
|
|
42864
|
-
case
|
|
42865
|
-
case
|
|
42881
|
+
case CoreToolCallStatus.Error:
|
|
42882
|
+
case CoreToolCallStatus.Cancelled:
|
|
42866
42883
|
resultDisplay = call.response.resultDisplay;
|
|
42867
42884
|
break;
|
|
42868
|
-
case
|
|
42885
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
42869
42886
|
correlationId = call.correlationId;
|
|
42870
42887
|
confirmationDetails = call.confirmationDetails;
|
|
42871
42888
|
break;
|
|
42872
|
-
case
|
|
42889
|
+
case CoreToolCallStatus.Executing:
|
|
42873
42890
|
resultDisplay = call.liveOutput;
|
|
42874
42891
|
ptyId = call.pid;
|
|
42875
42892
|
progressMessage = call.progressMessage;
|
|
42876
42893
|
progress = call.progress;
|
|
42877
42894
|
progressTotal = call.progressTotal;
|
|
42878
42895
|
break;
|
|
42879
|
-
case
|
|
42880
|
-
case
|
|
42896
|
+
case CoreToolCallStatus.Scheduled:
|
|
42897
|
+
case CoreToolCallStatus.Validating:
|
|
42881
42898
|
break;
|
|
42882
42899
|
default: {
|
|
42883
42900
|
const exhaustiveCheck = call;
|
|
@@ -42948,7 +42965,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
42948
42965
|
const handler = (event) => {
|
|
42949
42966
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
42950
42967
|
const hasExecuting = event.toolCalls.some(
|
|
42951
|
-
(tc) => tc.status ===
|
|
42968
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
42952
42969
|
);
|
|
42953
42970
|
if (hasExecuting) {
|
|
42954
42971
|
setLastToolOutputTime(Date.now());
|
|
@@ -42957,7 +42974,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
42957
42974
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
42958
42975
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
42959
42976
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
42960
|
-
(tc) => tc.status ===
|
|
42977
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
42961
42978
|
);
|
|
42962
42979
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
42963
42980
|
return prev;
|
|
@@ -42969,9 +42986,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
42969
42986
|
};
|
|
42970
42987
|
});
|
|
42971
42988
|
};
|
|
42972
|
-
messageBus.subscribe(
|
|
42989
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
42973
42990
|
return () => {
|
|
42974
|
-
messageBus.unsubscribe(
|
|
42991
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
42975
42992
|
};
|
|
42976
42993
|
}, [messageBus, internalAdaptToolCalls]);
|
|
42977
42994
|
(0, import_react105.useEffect)(() => {
|
|
@@ -42993,9 +43010,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
42993
43010
|
};
|
|
42994
43011
|
});
|
|
42995
43012
|
};
|
|
42996
|
-
messageBus.subscribe(
|
|
43013
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
42997
43014
|
return () => {
|
|
42998
|
-
messageBus.unsubscribe(
|
|
43015
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
42999
43016
|
};
|
|
43000
43017
|
}, [messageBus]);
|
|
43001
43018
|
const schedule = (0, import_react105.useCallback)(
|
|
@@ -43093,8 +43110,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
43093
43110
|
const prev = prevMap.get(coreCall.request.callId);
|
|
43094
43111
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
43095
43112
|
let status = coreCall.status;
|
|
43096
|
-
if ((status ===
|
|
43097
|
-
status =
|
|
43113
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
43114
|
+
status = CoreToolCallStatus.Executing;
|
|
43098
43115
|
}
|
|
43099
43116
|
return {
|
|
43100
43117
|
...coreCall,
|
|
@@ -43126,7 +43143,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
43126
43143
|
};
|
|
43127
43144
|
}
|
|
43128
43145
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
43129
|
-
return toolCall.status ===
|
|
43146
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
43130
43147
|
}
|
|
43131
43148
|
function showCitations(settings) {
|
|
43132
43149
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -43136,14 +43153,14 @@ function showCitations(settings) {
|
|
|
43136
43153
|
return true;
|
|
43137
43154
|
}
|
|
43138
43155
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
43139
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
43156
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
43140
43157
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
43141
43158
|
}
|
|
43142
43159
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
43143
|
-
if (tc.status ===
|
|
43160
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
43144
43161
|
return true;
|
|
43145
43162
|
}
|
|
43146
|
-
if (tc.status ===
|
|
43163
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
43147
43164
|
return !tc.responseSubmittedToGemini;
|
|
43148
43165
|
}
|
|
43149
43166
|
return false;
|
|
@@ -43196,9 +43213,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43196
43213
|
const handleRetryAttempt = (payload) => {
|
|
43197
43214
|
setRetryStatus(payload);
|
|
43198
43215
|
};
|
|
43199
|
-
coreEvents.on(
|
|
43216
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
43200
43217
|
return () => {
|
|
43201
|
-
coreEvents.off(
|
|
43218
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
43202
43219
|
};
|
|
43203
43220
|
}, []);
|
|
43204
43221
|
const [
|
|
@@ -43331,12 +43348,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43331
43348
|
const tc = toolCalls[i];
|
|
43332
43349
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
43333
43350
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
43334
|
-
const isAgent = tc.tool?.kind ===
|
|
43351
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
43335
43352
|
if (isAgent) {
|
|
43336
43353
|
let contigAgentsComplete = true;
|
|
43337
43354
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
43338
43355
|
const nextTc = toolCalls[j];
|
|
43339
|
-
if (nextTc.tool?.kind ===
|
|
43356
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
43340
43357
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
43341
43358
|
contigAgentsComplete = false;
|
|
43342
43359
|
break;
|
|
@@ -43362,7 +43379,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43362
43379
|
let currentGroup = [];
|
|
43363
43380
|
for (const tc of toolsToPush) {
|
|
43364
43381
|
newPushed.add(tc.request.callId);
|
|
43365
|
-
if (tc.tool?.kind ===
|
|
43382
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
43366
43383
|
currentGroup.push(tc);
|
|
43367
43384
|
} else {
|
|
43368
43385
|
if (currentGroup.length > 0) {
|
|
@@ -43461,9 +43478,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43461
43478
|
const isToolVisible = (tc) => {
|
|
43462
43479
|
const displayName = tc.tool?.displayName ?? tc.request.name;
|
|
43463
43480
|
let hasResultDisplay = false;
|
|
43464
|
-
if (tc.status ===
|
|
43481
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
43465
43482
|
hasResultDisplay = !!tc.response?.resultDisplay;
|
|
43466
|
-
} else if (tc.status ===
|
|
43483
|
+
} else if (tc.status === CoreToolCallStatus.Executing) {
|
|
43467
43484
|
hasResultDisplay = !!tc.liveOutput;
|
|
43468
43485
|
}
|
|
43469
43486
|
if (shouldHideToolCall({
|
|
@@ -43525,7 +43542,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43525
43542
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
43526
43543
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
43527
43544
|
(0, import_react106.useEffect)(() => {
|
|
43528
|
-
if (config.getApprovalMode() ===
|
|
43545
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
43529
43546
|
const lastUserMessageIndex = history.findLastIndex(
|
|
43530
43547
|
(item) => item.type === "user" /* USER */
|
|
43531
43548
|
);
|
|
@@ -43610,7 +43627,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43610
43627
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
43611
43628
|
return {
|
|
43612
43629
|
...tool,
|
|
43613
|
-
status:
|
|
43630
|
+
status: CoreToolCallStatus.Cancelled,
|
|
43614
43631
|
resultDisplay: tool.resultDisplay
|
|
43615
43632
|
};
|
|
43616
43633
|
}
|
|
@@ -43666,7 +43683,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43666
43683
|
let localQueryToSendToGemini = null;
|
|
43667
43684
|
if (typeof query === "string") {
|
|
43668
43685
|
const trimmedQuery = query.trim();
|
|
43669
|
-
await logger?.logMessage(
|
|
43686
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
43670
43687
|
if (!shellModeActive) {
|
|
43671
43688
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
43672
43689
|
if (slashCommandResult) {
|
|
@@ -43822,7 +43839,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
43822
43839
|
if (pendingHistoryItemRef.current) {
|
|
43823
43840
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
43824
43841
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
43825
|
-
(tool) => tool.status ===
|
|
43842
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
43826
43843
|
);
|
|
43827
43844
|
const pendingItem = {
|
|
43828
43845
|
...pendingHistoryItemRef.current,
|
|
@@ -44068,15 +44085,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44068
44085
|
let geminiMessageBuffer = "";
|
|
44069
44086
|
const toolCallRequests = [];
|
|
44070
44087
|
for await (const event of stream) {
|
|
44071
|
-
if (event.type !==
|
|
44088
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
44072
44089
|
setThought(null);
|
|
44073
44090
|
}
|
|
44074
44091
|
switch (event.type) {
|
|
44075
|
-
case
|
|
44092
|
+
case GeminiEventType.Thought:
|
|
44076
44093
|
setLastGeminiActivityTime(Date.now());
|
|
44077
44094
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
44078
44095
|
break;
|
|
44079
|
-
case
|
|
44096
|
+
case GeminiEventType.Content:
|
|
44080
44097
|
setLastGeminiActivityTime(Date.now());
|
|
44081
44098
|
geminiMessageBuffer = handleContentEvent(
|
|
44082
44099
|
event.value,
|
|
@@ -44084,16 +44101,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44084
44101
|
userMessageTimestamp
|
|
44085
44102
|
);
|
|
44086
44103
|
break;
|
|
44087
|
-
case
|
|
44104
|
+
case GeminiEventType.ToolCallRequest:
|
|
44088
44105
|
toolCallRequests.push(event.value);
|
|
44089
44106
|
break;
|
|
44090
|
-
case
|
|
44107
|
+
case GeminiEventType.UserCancelled:
|
|
44091
44108
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
44092
44109
|
break;
|
|
44093
|
-
case
|
|
44110
|
+
case GeminiEventType.Error:
|
|
44094
44111
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
44095
44112
|
break;
|
|
44096
|
-
case
|
|
44113
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
44097
44114
|
handleAgentExecutionStoppedEvent(
|
|
44098
44115
|
event.value.reason,
|
|
44099
44116
|
userMessageTimestamp,
|
|
@@ -44101,7 +44118,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44101
44118
|
event.value.contextCleared
|
|
44102
44119
|
);
|
|
44103
44120
|
break;
|
|
44104
|
-
case
|
|
44121
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
44105
44122
|
handleAgentExecutionBlockedEvent(
|
|
44106
44123
|
event.value.reason,
|
|
44107
44124
|
userMessageTimestamp,
|
|
@@ -44109,35 +44126,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44109
44126
|
event.value.contextCleared
|
|
44110
44127
|
);
|
|
44111
44128
|
break;
|
|
44112
|
-
case
|
|
44129
|
+
case GeminiEventType.ChatCompressed:
|
|
44113
44130
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
44114
44131
|
break;
|
|
44115
|
-
case
|
|
44116
|
-
case
|
|
44132
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
44133
|
+
case GeminiEventType.ToolCallResponse:
|
|
44117
44134
|
break;
|
|
44118
|
-
case
|
|
44135
|
+
case GeminiEventType.MaxSessionTurns:
|
|
44119
44136
|
handleMaxSessionTurnsEvent();
|
|
44120
44137
|
break;
|
|
44121
|
-
case
|
|
44138
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
44122
44139
|
handleContextWindowWillOverflowEvent(
|
|
44123
44140
|
event.value.estimatedRequestTokenCount,
|
|
44124
44141
|
event.value.remainingTokenCount
|
|
44125
44142
|
);
|
|
44126
44143
|
break;
|
|
44127
|
-
case
|
|
44144
|
+
case GeminiEventType.Finished:
|
|
44128
44145
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
44129
44146
|
break;
|
|
44130
|
-
case
|
|
44147
|
+
case GeminiEventType.Citation:
|
|
44131
44148
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
44132
44149
|
break;
|
|
44133
|
-
case
|
|
44150
|
+
case GeminiEventType.ModelInfo:
|
|
44134
44151
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
44135
44152
|
break;
|
|
44136
|
-
case
|
|
44153
|
+
case GeminiEventType.LoopDetected:
|
|
44137
44154
|
loopDetectedRef.current = true;
|
|
44138
44155
|
break;
|
|
44139
|
-
case
|
|
44140
|
-
case
|
|
44156
|
+
case GeminiEventType.Retry:
|
|
44157
|
+
case GeminiEventType.InvalidStream:
|
|
44141
44158
|
break;
|
|
44142
44159
|
default: {
|
|
44143
44160
|
const unreachable = event;
|
|
@@ -44178,7 +44195,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44178
44195
|
const submitQuery = (0, import_react106.useCallback)(
|
|
44179
44196
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
44180
44197
|
{
|
|
44181
|
-
operation: options?.isContinuation ?
|
|
44198
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt
|
|
44182
44199
|
},
|
|
44183
44200
|
async ({ metadata: spanMetadata }) => {
|
|
44184
44201
|
spanMetadata.input = query;
|
|
@@ -44337,7 +44354,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44337
44354
|
);
|
|
44338
44355
|
const handleApprovalModeChange = (0, import_react106.useCallback)(
|
|
44339
44356
|
async (newApprovalMode) => {
|
|
44340
|
-
if (previousApprovalModeRef.current ===
|
|
44357
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
44341
44358
|
if (geminiClient) {
|
|
44342
44359
|
try {
|
|
44343
44360
|
await geminiClient.addHistory({
|
|
@@ -44360,11 +44377,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44360
44377
|
}
|
|
44361
44378
|
}
|
|
44362
44379
|
previousApprovalModeRef.current = newApprovalMode;
|
|
44363
|
-
if (newApprovalMode ===
|
|
44380
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
44364
44381
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
44365
44382
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
44366
44383
|
);
|
|
44367
|
-
if (newApprovalMode ===
|
|
44384
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
44368
44385
|
awaitingApprovalCalls = awaitingApprovalCalls.filter(
|
|
44369
44386
|
(call) => EDIT_TOOL_NAMES.has(call.request.name)
|
|
44370
44387
|
);
|
|
@@ -44373,11 +44390,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44373
44390
|
if (call.correlationId) {
|
|
44374
44391
|
try {
|
|
44375
44392
|
await config.getMessageBus().publish({
|
|
44376
|
-
type:
|
|
44393
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
44377
44394
|
correlationId: call.correlationId,
|
|
44378
44395
|
confirmed: true,
|
|
44379
44396
|
requiresUserConfirmation: false,
|
|
44380
|
-
outcome:
|
|
44397
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
44381
44398
|
});
|
|
44382
44399
|
} catch (error) {
|
|
44383
44400
|
debugLogger.warn(
|
|
@@ -44455,14 +44472,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44455
44472
|
);
|
|
44456
44473
|
if (isLowErrorVerbosity) {
|
|
44457
44474
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
44458
|
-
(tc) => tc.status ===
|
|
44475
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
44459
44476
|
).length;
|
|
44460
44477
|
}
|
|
44461
44478
|
if (geminiTools.length === 0) {
|
|
44462
44479
|
return;
|
|
44463
44480
|
}
|
|
44464
44481
|
const stopExecutionTool = geminiTools.find(
|
|
44465
|
-
(tc) => tc.response.errorType ===
|
|
44482
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
44466
44483
|
);
|
|
44467
44484
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
44468
44485
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -44479,7 +44496,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44479
44496
|
return;
|
|
44480
44497
|
}
|
|
44481
44498
|
const allToolsCancelled = geminiTools.every(
|
|
44482
|
-
(tc) => tc.status ===
|
|
44499
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
44483
44500
|
);
|
|
44484
44501
|
if (allToolsCancelled) {
|
|
44485
44502
|
if (!turnCancelledRef.current) {
|
|
@@ -44561,7 +44578,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
44561
44578
|
return;
|
|
44562
44579
|
}
|
|
44563
44580
|
const restorableToolCalls = toolCalls.filter(
|
|
44564
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
44581
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
44565
44582
|
);
|
|
44566
44583
|
if (restorableToolCalls.length > 0) {
|
|
44567
44584
|
if (!gitService) {
|
|
@@ -47028,7 +47045,7 @@ function useMessageQueue({
|
|
|
47028
47045
|
var import_react113 = __toESM(require_react(), 1);
|
|
47029
47046
|
function useMcpStatus(config) {
|
|
47030
47047
|
const [discoveryState, setDiscoveryState] = (0, import_react113.useState)(
|
|
47031
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
47048
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
47032
47049
|
);
|
|
47033
47050
|
const [mcpServerCount, setMcpServerCount] = (0, import_react113.useState)(
|
|
47034
47051
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -47041,12 +47058,12 @@ function useMcpStatus(config) {
|
|
|
47041
47058
|
setMcpServerCount(manager.getMcpServerCount());
|
|
47042
47059
|
}
|
|
47043
47060
|
};
|
|
47044
|
-
coreEvents.on(
|
|
47061
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
47045
47062
|
return () => {
|
|
47046
|
-
coreEvents.off(
|
|
47063
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
47047
47064
|
};
|
|
47048
47065
|
}, [config]);
|
|
47049
|
-
const isMcpReady = discoveryState ===
|
|
47066
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
47050
47067
|
return {
|
|
47051
47068
|
discoveryState,
|
|
47052
47069
|
mcpServerCount,
|
|
@@ -47073,7 +47090,7 @@ function useApprovalModeIndicator({
|
|
|
47073
47090
|
(key) => {
|
|
47074
47091
|
let nextApprovalMode;
|
|
47075
47092
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
47076
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
47093
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
47077
47094
|
if (addItem) {
|
|
47078
47095
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
47079
47096
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -47091,21 +47108,21 @@ function useApprovalModeIndicator({
|
|
|
47091
47108
|
}
|
|
47092
47109
|
return;
|
|
47093
47110
|
}
|
|
47094
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
47111
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
47095
47112
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
47096
47113
|
const currentMode = config.getApprovalMode();
|
|
47097
47114
|
switch (currentMode) {
|
|
47098
|
-
case
|
|
47099
|
-
nextApprovalMode =
|
|
47115
|
+
case ApprovalMode.DEFAULT:
|
|
47116
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
47100
47117
|
break;
|
|
47101
|
-
case
|
|
47102
|
-
nextApprovalMode = allowPlanMode ?
|
|
47118
|
+
case ApprovalMode.AUTO_EDIT:
|
|
47119
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
47103
47120
|
break;
|
|
47104
|
-
case
|
|
47105
|
-
nextApprovalMode =
|
|
47121
|
+
case ApprovalMode.PLAN:
|
|
47122
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
47106
47123
|
break;
|
|
47107
|
-
case
|
|
47108
|
-
nextApprovalMode =
|
|
47124
|
+
case ApprovalMode.YOLO:
|
|
47125
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
47109
47126
|
break;
|
|
47110
47127
|
default:
|
|
47111
47128
|
}
|
|
@@ -47498,11 +47515,11 @@ var useHookDisplayState = () => {
|
|
|
47498
47515
|
removeHook();
|
|
47499
47516
|
}
|
|
47500
47517
|
};
|
|
47501
|
-
coreEvents.on(
|
|
47502
|
-
coreEvents.on(
|
|
47518
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
47519
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
47503
47520
|
return () => {
|
|
47504
|
-
coreEvents.off(
|
|
47505
|
-
coreEvents.off(
|
|
47521
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
47522
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
47506
47523
|
activeTimeouts.forEach(clearTimeout);
|
|
47507
47524
|
activeTimeouts.clear();
|
|
47508
47525
|
};
|
|
@@ -48327,7 +48344,7 @@ var AppContainer = (props) => {
|
|
|
48327
48344
|
}
|
|
48328
48345
|
setConfigInitialized(true);
|
|
48329
48346
|
startupProfiler.flush(config);
|
|
48330
|
-
const sessionStartSource = resumedSessionData ?
|
|
48347
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
48331
48348
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
48332
48349
|
if (result) {
|
|
48333
48350
|
if (result.systemMessage) {
|
|
@@ -48363,7 +48380,7 @@ var AppContainer = (props) => {
|
|
|
48363
48380
|
);
|
|
48364
48381
|
const ideClient = await IdeClient.getInstance();
|
|
48365
48382
|
await ideClient.disconnect();
|
|
48366
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
48383
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
48367
48384
|
});
|
|
48368
48385
|
}, [config, resumedSessionData]);
|
|
48369
48386
|
(0, import_react127.useEffect)(
|
|
@@ -48381,11 +48398,11 @@ var AppContainer = (props) => {
|
|
|
48381
48398
|
resetTime: payload.resetTime
|
|
48382
48399
|
});
|
|
48383
48400
|
};
|
|
48384
|
-
coreEvents.on(
|
|
48385
|
-
coreEvents.on(
|
|
48401
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
48402
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
48386
48403
|
return () => {
|
|
48387
|
-
coreEvents.off(
|
|
48388
|
-
coreEvents.off(
|
|
48404
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
48405
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
48389
48406
|
};
|
|
48390
48407
|
}, [config]);
|
|
48391
48408
|
(0, import_react127.useEffect)(() => {
|
|
@@ -48398,16 +48415,16 @@ var AppContainer = (props) => {
|
|
|
48398
48415
|
const handleAgentsDiscovered = (payload) => {
|
|
48399
48416
|
setNewAgents(payload.agents);
|
|
48400
48417
|
};
|
|
48401
|
-
coreEvents.on(
|
|
48402
|
-
coreEvents.on(
|
|
48403
|
-
coreEvents.on(
|
|
48418
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
48419
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
48420
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
48404
48421
|
return () => {
|
|
48405
|
-
coreEvents.off(
|
|
48422
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
48406
48423
|
coreEvents.off(
|
|
48407
|
-
|
|
48424
|
+
CoreEvent.AdminSettingsChanged,
|
|
48408
48425
|
handleAdminSettingsChanged
|
|
48409
48426
|
);
|
|
48410
|
-
coreEvents.off(
|
|
48427
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
48411
48428
|
};
|
|
48412
48429
|
}, [settings]);
|
|
48413
48430
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -48473,11 +48490,11 @@ var AppContainer = (props) => {
|
|
|
48473
48490
|
exitEditorDialog
|
|
48474
48491
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
48475
48492
|
(0, import_react127.useEffect)(() => {
|
|
48476
|
-
coreEvents.on(
|
|
48477
|
-
coreEvents.on(
|
|
48493
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
48494
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
48478
48495
|
return () => {
|
|
48479
|
-
coreEvents.off(
|
|
48480
|
-
coreEvents.off(
|
|
48496
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
48497
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
48481
48498
|
};
|
|
48482
48499
|
}, [handleEditorClose, openEditorDialog]);
|
|
48483
48500
|
(0, import_react127.useEffect)(() => {
|
|
@@ -48545,7 +48562,7 @@ var AppContainer = (props) => {
|
|
|
48545
48562
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
48546
48563
|
});
|
|
48547
48564
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
48548
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
48565
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
48549
48566
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
48550
48567
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
48551
48568
|
config,
|
|
@@ -48573,7 +48590,7 @@ var AppContainer = (props) => {
|
|
|
48573
48590
|
async (authType, scope) => {
|
|
48574
48591
|
if (authType) {
|
|
48575
48592
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
48576
|
-
if (authType ===
|
|
48593
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
48577
48594
|
setAuthContext({ requiresRestart: true });
|
|
48578
48595
|
} else {
|
|
48579
48596
|
setAuthContext({});
|
|
@@ -48601,7 +48618,7 @@ var AppContainer = (props) => {
|
|
|
48601
48618
|
);
|
|
48602
48619
|
return;
|
|
48603
48620
|
}
|
|
48604
|
-
if (authType ===
|
|
48621
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
48605
48622
|
writeToStdout(`
|
|
48606
48623
|
----------------------------------------------------------------
|
|
48607
48624
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -48626,7 +48643,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
48626
48643
|
}
|
|
48627
48644
|
await saveApiKey(apiKey);
|
|
48628
48645
|
await reloadApiKey();
|
|
48629
|
-
await config.refreshAuth(
|
|
48646
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
48630
48647
|
setAuthState("authenticated" /* Authenticated */);
|
|
48631
48648
|
} catch (e) {
|
|
48632
48649
|
onAuthError(
|
|
@@ -48651,7 +48668,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
48651
48668
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
48652
48669
|
);
|
|
48653
48670
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
48654
|
-
if (settings.merged.security.auth.selectedType ===
|
|
48671
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
48655
48672
|
return;
|
|
48656
48673
|
}
|
|
48657
48674
|
const error = validateAuthMethod(
|
|
@@ -48770,9 +48787,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
48770
48787
|
}
|
|
48771
48788
|
});
|
|
48772
48789
|
};
|
|
48773
|
-
coreEvents.on(
|
|
48790
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
48774
48791
|
return () => {
|
|
48775
|
-
coreEvents.off(
|
|
48792
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
48776
48793
|
};
|
|
48777
48794
|
}, []);
|
|
48778
48795
|
const performMemoryRefresh = (0, import_react127.useCallback)(async () => {
|
|
@@ -49389,7 +49406,7 @@ ${queuedText}` : queuedText;
|
|
|
49389
49406
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
49390
49407
|
if (settings.merged.general.devtools) {
|
|
49391
49408
|
void (async () => {
|
|
49392
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
49409
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-IWSTJYRB.js");
|
|
49393
49410
|
await toggleDevToolsPanel(
|
|
49394
49411
|
config,
|
|
49395
49412
|
showErrorDetails,
|
|
@@ -49591,10 +49608,10 @@ ${queuedText}` : queuedText;
|
|
|
49591
49608
|
);
|
|
49592
49609
|
}
|
|
49593
49610
|
};
|
|
49594
|
-
coreEvents.on(
|
|
49611
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
49595
49612
|
coreEvents.drainBacklogs();
|
|
49596
49613
|
return () => {
|
|
49597
|
-
coreEvents.off(
|
|
49614
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
49598
49615
|
};
|
|
49599
49616
|
}, [historyManager]);
|
|
49600
49617
|
const nightly = props.version.includes("nightly");
|
|
@@ -49696,9 +49713,9 @@ ${queuedText}` : queuedText;
|
|
|
49696
49713
|
const handleMemoryChanged = (result) => {
|
|
49697
49714
|
setGeminiMdFileCount(result.fileCount);
|
|
49698
49715
|
};
|
|
49699
|
-
coreEvents.on(
|
|
49716
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
49700
49717
|
return () => {
|
|
49701
|
-
coreEvents.off(
|
|
49718
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
49702
49719
|
};
|
|
49703
49720
|
}, []);
|
|
49704
49721
|
(0, import_react127.useEffect)(() => {
|