@google/gemini-cli 0.43.0-preview.0 → 0.43.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-MXKXLNQD.js → chunk-3BNJIKEP.js} +2 -2
- package/bundle/{chunk-UIG2IVPJ.js → chunk-4G3X2H3F.js} +1 -1
- package/bundle/{chunk-LFGJVOVZ.js → chunk-4SLX6GS6.js} +7 -7
- package/bundle/{chunk-MRHFLHPJ.js → chunk-4ZT3EIBI.js} +1 -1
- package/bundle/{chunk-HQXINMBL.js → chunk-6YMGRLOQ.js} +1 -1
- package/bundle/{chunk-43AGRA7S.js → chunk-CKPZGEE3.js} +2 -2
- package/bundle/{chunk-WQOLTO3C.js → chunk-CZPVSLJF.js} +1 -1
- package/bundle/{chunk-PSWUV2OO.js → chunk-DJCG6GWZ.js} +2 -2
- package/bundle/{chunk-6XOSIMPZ.js → chunk-ERQUIEOO.js} +9 -8
- package/bundle/{chunk-SYD5SJFT.js → chunk-EWAAFVBK.js} +9 -6
- package/bundle/{chunk-T3SUXLQQ.js → chunk-F7PEGIBA.js} +2 -2
- package/bundle/{chunk-P4UQCQUB.js → chunk-ICOPZSVB.js} +3 -3
- package/bundle/{chunk-PGJUNQPO.js → chunk-IF5BAOVJ.js} +1 -1
- package/bundle/chunk-KILFUY3Y.js +512 -0
- package/bundle/{chunk-JENIU3E3.js → chunk-L4LBKMR6.js} +1 -1
- package/bundle/{chunk-LBQFRHYD.js → chunk-LTFEPQ67.js} +1 -1
- package/bundle/{chunk-X26T73X6.js → chunk-LTSFEC7U.js} +2 -2
- package/bundle/{chunk-SAISHGWW.js → chunk-MRVZNBXY.js} +4 -4
- package/bundle/{chunk-QYUN3J2L.js → chunk-N3MLU4IQ.js} +68 -55
- package/bundle/{chunk-UNAVBUTP.js → chunk-NDSJWRFE.js} +6974 -13060
- package/bundle/{chunk-NBRZ4A3S.js → chunk-NG2WIKH5.js} +2 -2
- package/bundle/chunk-PLEERNRJ.js +156 -0
- package/bundle/{chunk-PYLHDAUK.js → chunk-QAQT56LH.js} +3 -3
- package/bundle/{chunk-4TLQKGTR.js → chunk-S36EONMM.js} +1 -1
- package/bundle/chunk-UB4AWMZC.js +391 -0
- package/bundle/{chunk-Q23X5R4A.js → chunk-UBCHSKF2.js} +7 -7
- package/bundle/chunk-ULCEBJMK.js +17248 -0
- package/bundle/chunk-UUHMEKLA.js +357199 -0
- package/bundle/chunk-UW3H4T6A.js +1571 -0
- package/bundle/{chunk-46T44JOY.js → chunk-VSTO23O2.js} +1 -1
- package/bundle/chunk-XKIM3BNI.js +118 -0
- package/bundle/chunk-YIHNW7CC.js +81649 -0
- package/bundle/{cleanup-MI76P55B.js → cleanup-BMLCC7SO.js} +2 -2
- package/bundle/{cleanup-NZBQYB7U.js → cleanup-LMJA4J5S.js} +3 -3
- package/bundle/cleanup-M7RSLDBR.js +33 -0
- package/bundle/{cleanup-EIZJH2E3.js → cleanup-NMUMRIEF.js} +2 -2
- package/bundle/{core-T2TBFAYG.js → core-WXTAU5UX.js} +1 -1
- package/bundle/{devtoolsService-LV5NJ2BT.js → devtoolsService-2L5U47ZQ.js} +2 -2
- package/bundle/{devtoolsService-FYTOIC37.js → devtoolsService-6THA6GNX.js} +2 -2
- package/bundle/{devtoolsService-7KZDSYEF.js → devtoolsService-J2AC6YXM.js} +5 -4
- package/bundle/devtoolsService-SRWIME2Q.js +857 -0
- package/bundle/{dist-ETX67B7P.js → dist-DIIMIT2U.js} +1 -1
- package/bundle/{core-ERSGIOMQ.js → dist-MXL7ZG46.js} +2 -2
- package/bundle/dist-POIHCQVM.js +2124 -0
- package/bundle/{gemini-IVKBXHDT.js → gemini-D32FDZXN.js} +13 -13
- package/bundle/{gemini-Z77GAAR6.js → gemini-DLZ2R4X7.js} +202 -188
- package/bundle/{gemini-JKWQQTKP.js → gemini-HYQU2RK2.js} +13 -13
- package/bundle/gemini-JJG7ZGWB.js +16356 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-36WZS6KT.js → interactiveCli-DHMPW4RS.js} +8 -8
- package/bundle/{interactiveCli-SME5QTEN.js → interactiveCli-K7ETWJMN.js} +315 -296
- package/bundle/{interactiveCli-BQ36B66Z.js → interactiveCli-NR7OUF3G.js} +8 -8
- package/bundle/interactiveCli-X4AUP7T7.js +34752 -0
- package/bundle/{liteRtServerManager-2QD4R3A3.js → liteRtServerManager-L7C3D5RL.js} +4 -4
- package/bundle/{liteRtServerManager-N6OMT6W5.js → liteRtServerManager-PKRLUK2P.js} +4 -4
- package/bundle/{liteRtServerManager-ISYDOBNC.js → liteRtServerManager-TEBDIGEN.js} +5 -5
- package/bundle/liteRtServerManager-UPCAT7Z2.js +66 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-DOSIH6VE.js → oauth2-provider-52IJKUJI.js} +1 -1
- package/bundle/{oauth2-provider-VFOABWBW.js → oauth2-provider-OPOTTZ5C.js} +1 -1
- package/bundle/{oauth2-provider-TZF6EZRX.js → oauth2-provider-TOAKXOL7.js} +39 -73
- package/bundle/oauth2-provider-WN4YIDA4.js +237 -0
- package/bundle/{start-3GPIRK3E.js → start-6KIIUSAH.js} +6 -6
- package/bundle/{start-6NONW677.js → start-7ZNSGJD6.js} +7 -7
- package/bundle/start-EPIILWLN.js +19 -0
- package/bundle/{start-M6MUPEJS.js → start-TMFPUYEL.js} +6 -6
- package/package.json +1 -1
|
@@ -155,13 +155,13 @@ import {
|
|
|
155
155
|
widestLineFromStyledChars,
|
|
156
156
|
wordBreakStyledChars,
|
|
157
157
|
wrapStyledChars
|
|
158
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-YIHNW7CC.js";
|
|
159
159
|
import {
|
|
160
160
|
appEvents
|
|
161
161
|
} from "./chunk-5PS3AYFU.js";
|
|
162
162
|
import {
|
|
163
163
|
require_source
|
|
164
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-L4LBKMR6.js";
|
|
165
165
|
import {
|
|
166
166
|
ACTIVE_SHELL_MAX_LINES,
|
|
167
167
|
COMPACT_TOOL_SUBVIEW_MAX_LINES,
|
|
@@ -211,30 +211,32 @@ import {
|
|
|
211
211
|
stringWidth,
|
|
212
212
|
stripUnsafeCharacters,
|
|
213
213
|
toCodePoints
|
|
214
|
-
} from "./chunk-
|
|
214
|
+
} from "./chunk-ULCEBJMK.js";
|
|
215
215
|
import {
|
|
216
216
|
handleAutoUpdate,
|
|
217
217
|
isDevelopment,
|
|
218
218
|
relaunchApp,
|
|
219
219
|
setUpdateHandler
|
|
220
|
-
} from "./chunk-
|
|
220
|
+
} from "./chunk-UB4AWMZC.js";
|
|
221
221
|
import {
|
|
222
222
|
isTodoList,
|
|
223
223
|
mapCoreStatusToDisplayStatus,
|
|
224
224
|
require_react
|
|
225
|
-
} from "./chunk-
|
|
225
|
+
} from "./chunk-ERQUIEOO.js";
|
|
226
226
|
import {
|
|
227
227
|
registerCleanup,
|
|
228
228
|
removeCleanup,
|
|
229
229
|
runExitCleanup,
|
|
230
230
|
setupTtyCheck
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-PLEERNRJ.js";
|
|
232
232
|
import {
|
|
233
233
|
ApiKeyUpdatedEvent,
|
|
234
234
|
AsyncFzf,
|
|
235
235
|
AudioRecorder,
|
|
236
236
|
AuthType,
|
|
237
|
+
CompressionStatus,
|
|
237
238
|
ConversationFinishedEvent,
|
|
239
|
+
CoreToolCallStatus,
|
|
238
240
|
CreditPurchaseClickEvent,
|
|
239
241
|
EDITOR_DISPLAY_NAMES,
|
|
240
242
|
EmptyWalletMenuShownEvent,
|
|
@@ -244,11 +246,16 @@ import {
|
|
|
244
246
|
FileSearchFactory,
|
|
245
247
|
FolderTrustDiscoveryService,
|
|
246
248
|
G1_UTM_CAMPAIGNS,
|
|
249
|
+
GeminiCliOperation,
|
|
250
|
+
GeminiEventType,
|
|
247
251
|
GitService,
|
|
248
252
|
IdeClient,
|
|
249
253
|
LegacyAgentProtocol,
|
|
250
254
|
LlmRole,
|
|
251
255
|
Logger,
|
|
256
|
+
MCPDiscoveryState,
|
|
257
|
+
MCPServerStatus,
|
|
258
|
+
MessageSenderType,
|
|
252
259
|
ModelNotFoundError,
|
|
253
260
|
ModelSlashCommandEvent,
|
|
254
261
|
OverageMenuShownEvent,
|
|
@@ -258,14 +265,19 @@ import {
|
|
|
258
265
|
RELEASE_CHANNEL_STABILITY,
|
|
259
266
|
ROOT_SCHEDULER_ID,
|
|
260
267
|
Scheduler,
|
|
268
|
+
SessionEndReason,
|
|
269
|
+
SessionStartSource,
|
|
261
270
|
ShellExecutionService,
|
|
262
271
|
SlashCommandStatus,
|
|
272
|
+
SubagentState,
|
|
263
273
|
TerminalQuotaError,
|
|
264
274
|
TranscriptionFactory,
|
|
275
|
+
TrustLevel,
|
|
265
276
|
UserAccountManager,
|
|
266
277
|
UserPromptEvent,
|
|
267
278
|
UserTierId,
|
|
268
279
|
ValidationRequiredError,
|
|
280
|
+
WarningPriority,
|
|
269
281
|
WhisperModelManager,
|
|
270
282
|
addMCPStatusChangeListener,
|
|
271
283
|
allowEditorTypeInSandbox,
|
|
@@ -353,11 +365,13 @@ import {
|
|
|
353
365
|
validatePlanContent,
|
|
354
366
|
validatePlanPath,
|
|
355
367
|
writeToStdout
|
|
356
|
-
} from "./chunk-
|
|
368
|
+
} from "./chunk-UUHMEKLA.js";
|
|
357
369
|
import {
|
|
358
370
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
359
371
|
AGENT_TOOL_NAME,
|
|
372
|
+
ApprovalMode,
|
|
360
373
|
ChangeAuthRequestedError,
|
|
374
|
+
CoreEvent,
|
|
361
375
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
362
376
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
363
377
|
DEFAULT_GEMINI_MODEL,
|
|
@@ -370,13 +384,16 @@ import {
|
|
|
370
384
|
GEMMA_4_31B_IT_MODEL,
|
|
371
385
|
GLOB_DISPLAY_NAME,
|
|
372
386
|
GREP_DISPLAY_NAME,
|
|
387
|
+
Kind,
|
|
373
388
|
LS_DISPLAY_NAME,
|
|
389
|
+
MessageBusType,
|
|
374
390
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
375
391
|
PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
|
|
376
392
|
PREVIEW_GEMINI_3_1_MODEL,
|
|
377
393
|
PREVIEW_GEMINI_FLASH_MODEL,
|
|
378
394
|
PREVIEW_GEMINI_MODEL,
|
|
379
395
|
PREVIEW_GEMINI_MODEL_AUTO,
|
|
396
|
+
QuestionType,
|
|
380
397
|
READ_FILE_DISPLAY_NAME,
|
|
381
398
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
382
399
|
SHELL_TOOL_NAME,
|
|
@@ -384,6 +401,8 @@ import {
|
|
|
384
401
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
385
402
|
TOPIC_PARAM_SUMMARY,
|
|
386
403
|
TOPIC_PARAM_TITLE,
|
|
404
|
+
ToolConfirmationOutcome,
|
|
405
|
+
ToolErrorType,
|
|
387
406
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
388
407
|
UPDATE_TOPIC_TOOL_NAME,
|
|
389
408
|
UnauthorizedError,
|
|
@@ -413,7 +432,7 @@ import {
|
|
|
413
432
|
safeJsonToMarkdown,
|
|
414
433
|
shortenPath,
|
|
415
434
|
tildeifyPath
|
|
416
|
-
} from "./chunk-
|
|
435
|
+
} from "./chunk-UJ26GAE5.js";
|
|
417
436
|
import "./chunk-664ZODQF.js";
|
|
418
437
|
import "./chunk-RJTRUG2J.js";
|
|
419
438
|
import "./chunk-IUUIT4SU.js";
|
|
@@ -5039,7 +5058,7 @@ function calculateShellMaxLines(options) {
|
|
|
5039
5058
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
5040
5059
|
return maxLinesBasedOnHeight;
|
|
5041
5060
|
}
|
|
5042
|
-
const isExecuting = status ===
|
|
5061
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
5043
5062
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
5044
5063
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
5045
5064
|
}
|
|
@@ -5073,10 +5092,10 @@ function isShellTool(name) {
|
|
|
5073
5092
|
return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
|
|
5074
5093
|
}
|
|
5075
5094
|
function isThisShellFocusable(name, status, config) {
|
|
5076
|
-
return !!(isShellTool(name) && status ===
|
|
5095
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
|
|
5077
5096
|
}
|
|
5078
5097
|
function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
|
|
5079
|
-
return !!(isShellTool(name) && status ===
|
|
5098
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
|
|
5080
5099
|
}
|
|
5081
5100
|
function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
|
|
5082
5101
|
const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
|
|
@@ -5236,13 +5255,13 @@ var formatToolArgs = (args) => {
|
|
|
5236
5255
|
var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
|
|
5237
5256
|
let headerText;
|
|
5238
5257
|
let headerColor = theme.text.secondary;
|
|
5239
|
-
if (progress.state ===
|
|
5258
|
+
if (progress.state === SubagentState.CANCELLED) {
|
|
5240
5259
|
headerText = `Subagent ${progress.agentName} was cancelled.`;
|
|
5241
5260
|
headerColor = theme.status.warning;
|
|
5242
|
-
} else if (progress.state ===
|
|
5261
|
+
} else if (progress.state === SubagentState.ERROR) {
|
|
5243
5262
|
headerText = `Subagent ${progress.agentName} failed.`;
|
|
5244
5263
|
headerColor = theme.status.error;
|
|
5245
|
-
} else if (progress.state ===
|
|
5264
|
+
} else if (progress.state === SubagentState.COMPLETED) {
|
|
5246
5265
|
headerText = `Subagent ${progress.agentName} completed.`;
|
|
5247
5266
|
headerColor = theme.status.success;
|
|
5248
5267
|
} else {
|
|
@@ -5262,7 +5281,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5262
5281
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
|
|
5263
5282
|
] }, item.id);
|
|
5264
5283
|
} else if (item.type === "tool_call") {
|
|
5265
|
-
const statusSymbol = item.status ===
|
|
5284
|
+
const statusSymbol = item.status === SubagentState.RUNNING ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(build_default, { type: "dots" }) : item.status === SubagentState.COMPLETED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === SubagentState.CANCELLED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
|
|
5266
5285
|
const formattedArgs = item.description || formatToolArgs(item.args);
|
|
5267
5286
|
const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
|
|
5268
5287
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
@@ -5273,7 +5292,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5273
5292
|
{
|
|
5274
5293
|
bold: true,
|
|
5275
5294
|
color: theme.text.primary,
|
|
5276
|
-
strikethrough: item.status ===
|
|
5295
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5277
5296
|
children: item.displayName || item.content
|
|
5278
5297
|
}
|
|
5279
5298
|
),
|
|
@@ -5282,7 +5301,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5282
5301
|
{
|
|
5283
5302
|
color: theme.text.secondary,
|
|
5284
5303
|
wrap: "truncate",
|
|
5285
|
-
strikethrough: item.status ===
|
|
5304
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5286
5305
|
children: displayArgs
|
|
5287
5306
|
}
|
|
5288
5307
|
) })
|
|
@@ -5302,7 +5321,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5302
5321
|
MarkdownDisplay,
|
|
5303
5322
|
{
|
|
5304
5323
|
text: safeJsonToMarkdown(progress.result),
|
|
5305
|
-
isPending: progress.state !==
|
|
5324
|
+
isPending: progress.state !== SubagentState.COMPLETED,
|
|
5306
5325
|
terminalWidth
|
|
5307
5326
|
}
|
|
5308
5327
|
)
|
|
@@ -5656,14 +5675,14 @@ var ToolActionsProvider = (props) => {
|
|
|
5656
5675
|
}
|
|
5657
5676
|
const details = tool.confirmationDetails;
|
|
5658
5677
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
5659
|
-
const cliOutcome = outcome ===
|
|
5678
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
5660
5679
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
5661
5680
|
}
|
|
5662
5681
|
if (tool.correlationId) {
|
|
5663
5682
|
await config.getMessageBus().publish({
|
|
5664
|
-
type:
|
|
5683
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
5665
5684
|
correlationId: tool.correlationId,
|
|
5666
|
-
confirmed: outcome !==
|
|
5685
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
5667
5686
|
requiresUserConfirmation: false,
|
|
5668
5687
|
outcome,
|
|
5669
5688
|
payload
|
|
@@ -5682,7 +5701,7 @@ var ToolActionsProvider = (props) => {
|
|
|
5682
5701
|
);
|
|
5683
5702
|
const cancel = (0, import_react12.useCallback)(
|
|
5684
5703
|
async (callId) => {
|
|
5685
|
-
await confirm(callId,
|
|
5704
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
5686
5705
|
},
|
|
5687
5706
|
[confirm]
|
|
5688
5707
|
);
|
|
@@ -5801,7 +5820,7 @@ var ToolMessage = ({
|
|
|
5801
5820
|
paddingX: 1,
|
|
5802
5821
|
flexDirection: "column",
|
|
5803
5822
|
children: [
|
|
5804
|
-
status ===
|
|
5823
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5805
5824
|
McpProgressIndicator,
|
|
5806
5825
|
{
|
|
5807
5826
|
progress,
|
|
@@ -5818,8 +5837,8 @@ var ToolMessage = ({
|
|
|
5818
5837
|
terminalWidth,
|
|
5819
5838
|
renderOutputAsMarkdown,
|
|
5820
5839
|
hasFocus: isThisShellFocused2,
|
|
5821
|
-
maxLines: kind ===
|
|
5822
|
-
overflowDirection: kind ===
|
|
5840
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
5841
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
5823
5842
|
}
|
|
5824
5843
|
),
|
|
5825
5844
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -6135,7 +6154,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
|
|
|
6135
6154
|
settings.merged,
|
|
6136
6155
|
process3.cwd()
|
|
6137
6156
|
);
|
|
6138
|
-
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel ===
|
|
6157
|
+
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
|
|
6139
6158
|
return {
|
|
6140
6159
|
currentTrustLevel: explicitTrustLevel,
|
|
6141
6160
|
isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
|
|
@@ -6180,7 +6199,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
|
|
|
6180
6199
|
process3.cwd(),
|
|
6181
6200
|
newConfig
|
|
6182
6201
|
);
|
|
6183
|
-
if (trustLevel ===
|
|
6202
|
+
if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
|
|
6184
6203
|
let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
|
|
6185
6204
|
if (source === "file") {
|
|
6186
6205
|
message = "Note: This folder is still trusted because a parent folder is trusted.";
|
|
@@ -6254,18 +6273,18 @@ function PermissionsModifyTrustDialog({
|
|
|
6254
6273
|
const TRUST_LEVEL_ITEMS = [
|
|
6255
6274
|
{
|
|
6256
6275
|
label: `Trust this folder (${dirName})`,
|
|
6257
|
-
value:
|
|
6258
|
-
key:
|
|
6276
|
+
value: TrustLevel.TRUST_FOLDER,
|
|
6277
|
+
key: TrustLevel.TRUST_FOLDER
|
|
6259
6278
|
},
|
|
6260
6279
|
{
|
|
6261
6280
|
label: `Trust parent folder (${parentFolder})`,
|
|
6262
|
-
value:
|
|
6263
|
-
key:
|
|
6281
|
+
value: TrustLevel.TRUST_PARENT,
|
|
6282
|
+
key: TrustLevel.TRUST_PARENT
|
|
6264
6283
|
},
|
|
6265
6284
|
{
|
|
6266
6285
|
label: "Don't trust",
|
|
6267
|
-
value:
|
|
6268
|
-
key:
|
|
6286
|
+
value: TrustLevel.DO_NOT_TRUST,
|
|
6287
|
+
key: TrustLevel.DO_NOT_TRUST
|
|
6269
6288
|
}
|
|
6270
6289
|
];
|
|
6271
6290
|
const {
|
|
@@ -6505,7 +6524,7 @@ var ShellToolMessage = ({
|
|
|
6505
6524
|
maxLinesLimit: maxLines
|
|
6506
6525
|
});
|
|
6507
6526
|
import_react17.default.useEffect(() => {
|
|
6508
|
-
const isExecuting = status ===
|
|
6527
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
6509
6528
|
if (isExecuting && ptyId) {
|
|
6510
6529
|
try {
|
|
6511
6530
|
const childWidth = terminalWidth - 4;
|
|
@@ -6718,13 +6737,13 @@ var SubagentGroupDisplay = ({
|
|
|
6718
6737
|
const singleAgent = toolCalls[0].resultDisplay;
|
|
6719
6738
|
if (isSubagentProgress(singleAgent)) {
|
|
6720
6739
|
switch (singleAgent.state) {
|
|
6721
|
-
case
|
|
6740
|
+
case SubagentState.COMPLETED:
|
|
6722
6741
|
headerText = "Agent Completed";
|
|
6723
6742
|
break;
|
|
6724
|
-
case
|
|
6743
|
+
case SubagentState.CANCELLED:
|
|
6725
6744
|
headerText = "Agent Cancelled";
|
|
6726
6745
|
break;
|
|
6727
|
-
case
|
|
6746
|
+
case SubagentState.ERROR:
|
|
6728
6747
|
headerText = "Agent Error";
|
|
6729
6748
|
break;
|
|
6730
6749
|
default:
|
|
@@ -6740,8 +6759,8 @@ var SubagentGroupDisplay = ({
|
|
|
6740
6759
|
for (const tc of toolCalls) {
|
|
6741
6760
|
const progress = tc.resultDisplay;
|
|
6742
6761
|
if (isSubagentProgress(progress)) {
|
|
6743
|
-
if (progress.state ===
|
|
6744
|
-
else if (progress.state ===
|
|
6762
|
+
if (progress.state === SubagentState.COMPLETED) completedCount++;
|
|
6763
|
+
else if (progress.state === SubagentState.RUNNING) runningCount++;
|
|
6745
6764
|
} else {
|
|
6746
6765
|
runningCount++;
|
|
6747
6766
|
}
|
|
@@ -6820,7 +6839,7 @@ var SubagentGroupDisplay = ({
|
|
|
6820
6839
|
if (!isExpanded) {
|
|
6821
6840
|
let content = "Starting...";
|
|
6822
6841
|
let formattedArgs;
|
|
6823
|
-
if (progress.state ===
|
|
6842
|
+
if (progress.state === SubagentState.COMPLETED) {
|
|
6824
6843
|
if (progress.terminateReason && progress.terminateReason !== "GOAL") {
|
|
6825
6844
|
content = `Finished Early (${progress.terminateReason})`;
|
|
6826
6845
|
} else {
|
|
@@ -6834,17 +6853,17 @@ var SubagentGroupDisplay = ({
|
|
|
6834
6853
|
formattedArgs = formatToolArgs(lastActivity.args);
|
|
6835
6854
|
}
|
|
6836
6855
|
}
|
|
6837
|
-
const displayArgs = progress.state ===
|
|
6856
|
+
const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
|
|
6838
6857
|
const renderStatusIcon = () => {
|
|
6839
|
-
const state = progress.state ??
|
|
6858
|
+
const state = progress.state ?? SubagentState.RUNNING;
|
|
6840
6859
|
switch (state) {
|
|
6841
|
-
case
|
|
6860
|
+
case SubagentState.RUNNING:
|
|
6842
6861
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
|
|
6843
|
-
case
|
|
6862
|
+
case SubagentState.COMPLETED:
|
|
6844
6863
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
|
|
6845
|
-
case
|
|
6864
|
+
case SubagentState.CANCELLED:
|
|
6846
6865
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
|
|
6847
|
-
case
|
|
6866
|
+
case SubagentState.ERROR:
|
|
6848
6867
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
|
|
6849
6868
|
default:
|
|
6850
6869
|
return checkExhaustive(state);
|
|
@@ -6897,22 +6916,22 @@ var hasPayload = (res) => {
|
|
|
6897
6916
|
function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
6898
6917
|
const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
|
|
6899
6918
|
const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
|
|
6900
|
-
const isAcceptedOrConfirming = status ===
|
|
6919
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
6901
6920
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
6902
6921
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
6903
6922
|
const showDiffStat = !!diff.diffStat;
|
|
6904
6923
|
const description = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
|
|
6905
6924
|
let resultSummary = "";
|
|
6906
6925
|
let resultColor = theme.text.secondary;
|
|
6907
|
-
if (status ===
|
|
6926
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
6908
6927
|
resultSummary = "Confirming";
|
|
6909
|
-
} else if (status ===
|
|
6928
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
6910
6929
|
resultSummary = "Accepted";
|
|
6911
6930
|
resultColor = theme.text.accent;
|
|
6912
|
-
} else if (status ===
|
|
6931
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
6913
6932
|
resultSummary = "Rejected";
|
|
6914
6933
|
resultColor = theme.status.error;
|
|
6915
|
-
} else if (status ===
|
|
6934
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
6916
6935
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
6917
6936
|
resultColor = theme.status.error;
|
|
6918
6937
|
}
|
|
@@ -6943,7 +6962,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
|
|
|
6943
6962
|
filename: diff.fileName,
|
|
6944
6963
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
6945
6964
|
availableTerminalHeight,
|
|
6946
|
-
disableColor: status ===
|
|
6965
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6947
6966
|
}
|
|
6948
6967
|
);
|
|
6949
6968
|
return { description, summary, payload };
|
|
@@ -7071,10 +7090,10 @@ var DenseToolMessage = (props) => {
|
|
|
7071
7090
|
if (isGrepResult(resultDisplay)) {
|
|
7072
7091
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7073
7092
|
}
|
|
7074
|
-
if (status ===
|
|
7093
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
7075
7094
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7076
7095
|
}
|
|
7077
|
-
if (status ===
|
|
7096
|
+
if (status === CoreToolCallStatus.Error) {
|
|
7078
7097
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
7079
7098
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
7080
7099
|
"\u2192 ",
|
|
@@ -7115,7 +7134,7 @@ var DenseToolMessage = (props) => {
|
|
|
7115
7134
|
language: fileExtension,
|
|
7116
7135
|
maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7117
7136
|
settings,
|
|
7118
|
-
disableColor: status ===
|
|
7137
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
7119
7138
|
returnLines: true
|
|
7120
7139
|
});
|
|
7121
7140
|
} else {
|
|
@@ -7123,7 +7142,7 @@ var DenseToolMessage = (props) => {
|
|
|
7123
7142
|
parsedLines,
|
|
7124
7143
|
filename: diff.fileName,
|
|
7125
7144
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7126
|
-
disableColor: status ===
|
|
7145
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
7127
7146
|
});
|
|
7128
7147
|
}
|
|
7129
7148
|
}, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
|
|
@@ -7253,7 +7272,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7253
7272
|
return pendingHistoryItems.some((item) => {
|
|
7254
7273
|
if (item && item.type === "tool_group") {
|
|
7255
7274
|
return item.tools.some(
|
|
7256
|
-
(tool) =>
|
|
7275
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
7257
7276
|
);
|
|
7258
7277
|
}
|
|
7259
7278
|
return false;
|
|
@@ -7262,7 +7281,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7262
7281
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
7263
7282
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
7264
7283
|
(item) => item.tools.some(
|
|
7265
|
-
(tool) =>
|
|
7284
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
7266
7285
|
)
|
|
7267
7286
|
);
|
|
7268
7287
|
}
|
|
@@ -7285,14 +7304,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
|
|
|
7285
7304
|
if (isTrackedToolCall(t)) {
|
|
7286
7305
|
return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
|
|
7287
7306
|
} else {
|
|
7288
|
-
return t.status !==
|
|
7307
|
+
return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
|
|
7289
7308
|
}
|
|
7290
7309
|
});
|
|
7291
7310
|
const isEmbeddedShellFocused = toolsToInspect.some((t) => {
|
|
7292
7311
|
if (isTrackedToolCall(t)) {
|
|
7293
7312
|
return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
|
|
7294
7313
|
} else {
|
|
7295
|
-
return isShellTool(t.name) && t.status ===
|
|
7314
|
+
return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
|
|
7296
7315
|
}
|
|
7297
7316
|
});
|
|
7298
7317
|
const isShellCommand = toolsToInspect.some((t) => {
|
|
@@ -7391,7 +7410,7 @@ var ToolGroupMessage = ({
|
|
|
7391
7410
|
const groupedTools = (0, import_react21.useMemo)(() => {
|
|
7392
7411
|
const groups = [];
|
|
7393
7412
|
for (const tool of visibleToolCalls) {
|
|
7394
|
-
if (tool.kind ===
|
|
7413
|
+
if (tool.kind === Kind.Agent) {
|
|
7395
7414
|
const lastGroup = groups[groups.length - 1];
|
|
7396
7415
|
if (Array.isArray(lastGroup)) {
|
|
7397
7416
|
lastGroup.push(tool);
|
|
@@ -7446,7 +7465,7 @@ var ToolGroupMessage = ({
|
|
|
7446
7465
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
7447
7466
|
let countToolCallsWithResults = 0;
|
|
7448
7467
|
for (const tool of visibleToolCalls) {
|
|
7449
|
-
if (tool.kind !==
|
|
7468
|
+
if (tool.kind !== Kind.Agent) {
|
|
7450
7469
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
7451
7470
|
if (hasDensePayload(tool)) {
|
|
7452
7471
|
countToolCallsWithResults++;
|
|
@@ -7620,7 +7639,7 @@ var ToolGroupDisplay = ({
|
|
|
7620
7639
|
}
|
|
7621
7640
|
const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
|
|
7622
7641
|
const visibleTools = tools.filter(
|
|
7623
|
-
(t) => t.status !==
|
|
7642
|
+
(t) => t.status !== CoreToolCallStatus.AwaitingApproval
|
|
7624
7643
|
);
|
|
7625
7644
|
const noticeTools = visibleTools.filter((t) => t.format === "notice");
|
|
7626
7645
|
const otherTools = visibleTools.filter(
|
|
@@ -7822,18 +7841,18 @@ function CompressionMessage({
|
|
|
7822
7841
|
return "Compressing chat history";
|
|
7823
7842
|
}
|
|
7824
7843
|
switch (compressionStatus) {
|
|
7825
|
-
case
|
|
7844
|
+
case CompressionStatus.COMPRESSED:
|
|
7826
7845
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
7827
|
-
case
|
|
7846
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
7828
7847
|
if (originalTokens < 5e4) {
|
|
7829
7848
|
return "Compression was not beneficial for this history size.";
|
|
7830
7849
|
}
|
|
7831
7850
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
7832
|
-
case
|
|
7851
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
7833
7852
|
return "Could not compress chat history due to a token counting error.";
|
|
7834
|
-
case
|
|
7853
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
7835
7854
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
7836
|
-
case
|
|
7855
|
+
case CompressionStatus.NOOP:
|
|
7837
7856
|
return "Nothing to compress.";
|
|
7838
7857
|
default:
|
|
7839
7858
|
return "";
|
|
@@ -8259,8 +8278,8 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8259
8278
|
);
|
|
8260
8279
|
roleEntries.sort(([a], [b]) => {
|
|
8261
8280
|
if (a === b) return 0;
|
|
8262
|
-
if (a ===
|
|
8263
|
-
if (b ===
|
|
8281
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8282
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8264
8283
|
return a.localeCompare(b);
|
|
8265
8284
|
});
|
|
8266
8285
|
roleEntries.forEach(([role, roleMetrics]) => {
|
|
@@ -8591,8 +8610,8 @@ var ModelStatsDisplay = ({
|
|
|
8591
8610
|
return validRoles.includes(role);
|
|
8592
8611
|
}).sort((a, b) => {
|
|
8593
8612
|
if (a === b) return 0;
|
|
8594
|
-
if (a ===
|
|
8595
|
-
if (b ===
|
|
8613
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8614
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8596
8615
|
return a.localeCompare(b);
|
|
8597
8616
|
});
|
|
8598
8617
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -9383,7 +9402,7 @@ var McpStatus = ({
|
|
|
9383
9402
|
);
|
|
9384
9403
|
const originalStatus = serverStatus(serverName);
|
|
9385
9404
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
9386
|
-
const status = originalStatus ===
|
|
9405
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
9387
9406
|
let statusIndicator = "";
|
|
9388
9407
|
let statusText = "";
|
|
9389
9408
|
let statusColor = theme.text.primary;
|
|
@@ -9395,17 +9414,17 @@ var McpStatus = ({
|
|
|
9395
9414
|
statusColor = theme.text.secondary;
|
|
9396
9415
|
} else {
|
|
9397
9416
|
switch (status) {
|
|
9398
|
-
case
|
|
9417
|
+
case MCPServerStatus.CONNECTED:
|
|
9399
9418
|
statusIndicator = "\u{1F7E2}";
|
|
9400
9419
|
statusText = "Ready";
|
|
9401
9420
|
statusColor = theme.status.success;
|
|
9402
9421
|
break;
|
|
9403
|
-
case
|
|
9422
|
+
case MCPServerStatus.CONNECTING:
|
|
9404
9423
|
statusIndicator = "\u{1F504}";
|
|
9405
9424
|
statusText = "Starting... (first startup may take longer)";
|
|
9406
9425
|
statusColor = theme.status.warning;
|
|
9407
9426
|
break;
|
|
9408
|
-
case
|
|
9427
|
+
case MCPServerStatus.DISCONNECTED:
|
|
9409
9428
|
default:
|
|
9410
9429
|
statusIndicator = "\u{1F534}";
|
|
9411
9430
|
statusText = "Disconnected";
|
|
@@ -9453,12 +9472,12 @@ var McpStatus = ({
|
|
|
9453
9472
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9454
9473
|
" - ",
|
|
9455
9474
|
statusText,
|
|
9456
|
-
status ===
|
|
9475
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
9457
9476
|
] }),
|
|
9458
9477
|
authStatusNode
|
|
9459
9478
|
] }),
|
|
9460
|
-
status ===
|
|
9461
|
-
status ===
|
|
9479
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
9480
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9462
9481
|
" (",
|
|
9463
9482
|
toolCount,
|
|
9464
9483
|
" tools cached)"
|
|
@@ -10019,7 +10038,7 @@ var Notifications = () => {
|
|
|
10019
10038
|
if (dismissed) return [];
|
|
10020
10039
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
10021
10040
|
return startupWarnings.filter((w) => {
|
|
10022
|
-
if (w.priority ===
|
|
10041
|
+
if (w.priority === WarningPriority.Low) {
|
|
10023
10042
|
const count = counts[w.id] || 0;
|
|
10024
10043
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
10025
10044
|
}
|
|
@@ -10032,7 +10051,7 @@ var Notifications = () => {
|
|
|
10032
10051
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
10033
10052
|
let changed = false;
|
|
10034
10053
|
visibleWarnings.forEach((w) => {
|
|
10035
|
-
if (w.priority ===
|
|
10054
|
+
if (w.priority === WarningPriority.Low) {
|
|
10036
10055
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
10037
10056
|
changed = true;
|
|
10038
10057
|
}
|
|
@@ -10139,7 +10158,7 @@ var UserIdentity = ({ config }) => {
|
|
|
10139
10158
|
}
|
|
10140
10159
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
10141
10160
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
|
|
10142
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
10161
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { children: [
|
|
10143
10162
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
|
|
10144
10163
|
"Signed in with Google",
|
|
10145
10164
|
email ? ":" : ""
|
|
@@ -10373,7 +10392,7 @@ var import_react32 = __toESM(require_react(), 1);
|
|
|
10373
10392
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
10374
10393
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
10375
10394
|
const confirmingTools = allPendingTools.filter(
|
|
10376
|
-
(tool) => tool.status ===
|
|
10395
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
10377
10396
|
);
|
|
10378
10397
|
if (confirmingTools.length === 0) {
|
|
10379
10398
|
return null;
|
|
@@ -11681,7 +11700,7 @@ var ExitPlanModeDialog = ({
|
|
|
11681
11700
|
{
|
|
11682
11701
|
questions: [
|
|
11683
11702
|
{
|
|
11684
|
-
type:
|
|
11703
|
+
type: QuestionType.CHOICE,
|
|
11685
11704
|
header: "Approval",
|
|
11686
11705
|
question: planContent,
|
|
11687
11706
|
options: [
|
|
@@ -11702,9 +11721,9 @@ var ExitPlanModeDialog = ({
|
|
|
11702
11721
|
onSubmit: (answers) => {
|
|
11703
11722
|
const answer = answers["0"];
|
|
11704
11723
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
11705
|
-
onApprove(
|
|
11724
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
11706
11725
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
11707
|
-
onApprove(
|
|
11726
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
11708
11727
|
} else if (answer) {
|
|
11709
11728
|
onFeedback(answer);
|
|
11710
11729
|
}
|
|
@@ -11915,7 +11934,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11915
11934
|
);
|
|
11916
11935
|
(0, import_react37.useEffect)(() => {
|
|
11917
11936
|
if (isCancelling) {
|
|
11918
|
-
handleConfirm(
|
|
11937
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
11919
11938
|
}
|
|
11920
11939
|
}, [isCancelling, handleConfirm]);
|
|
11921
11940
|
const handleSelect = (0, import_react37.useCallback)(
|
|
@@ -11928,19 +11947,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
11928
11947
|
if (!confirmationDetails.isModifying) {
|
|
11929
11948
|
options2.push({
|
|
11930
11949
|
label: "Allow once",
|
|
11931
|
-
value:
|
|
11950
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11932
11951
|
key: "Allow once"
|
|
11933
11952
|
});
|
|
11934
11953
|
if (isTrustedFolder) {
|
|
11935
11954
|
options2.push({
|
|
11936
11955
|
label: "Allow for this session",
|
|
11937
|
-
value:
|
|
11956
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11938
11957
|
key: "Allow for this session"
|
|
11939
11958
|
});
|
|
11940
11959
|
if (allowPermanentApproval) {
|
|
11941
11960
|
options2.push({
|
|
11942
11961
|
label: "Allow for this file in all future sessions",
|
|
11943
|
-
value:
|
|
11962
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11944
11963
|
key: "Allow for this file in all future sessions"
|
|
11945
11964
|
});
|
|
11946
11965
|
}
|
|
@@ -11948,119 +11967,119 @@ ${deceptiveUrlWarnings.map(
|
|
|
11948
11967
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
11949
11968
|
options2.push({
|
|
11950
11969
|
label: "Modify with external editor",
|
|
11951
|
-
value:
|
|
11970
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
11952
11971
|
key: "Modify with external editor"
|
|
11953
11972
|
});
|
|
11954
11973
|
}
|
|
11955
11974
|
options2.push({
|
|
11956
11975
|
label: "No, suggest changes (esc)",
|
|
11957
|
-
value:
|
|
11976
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11958
11977
|
key: "No, suggest changes (esc)"
|
|
11959
11978
|
});
|
|
11960
11979
|
}
|
|
11961
11980
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
11962
11981
|
options2.push({
|
|
11963
11982
|
label: "Allow once",
|
|
11964
|
-
value:
|
|
11983
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11965
11984
|
key: "Allow once"
|
|
11966
11985
|
});
|
|
11967
11986
|
if (isTrustedFolder) {
|
|
11968
11987
|
options2.push({
|
|
11969
11988
|
label: "Allow for this session",
|
|
11970
|
-
value:
|
|
11989
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11971
11990
|
key: "Allow for this session"
|
|
11972
11991
|
});
|
|
11973
11992
|
if (allowPermanentApproval) {
|
|
11974
11993
|
options2.push({
|
|
11975
11994
|
label: "Allow for all future sessions",
|
|
11976
|
-
value:
|
|
11995
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11977
11996
|
key: "Allow for all future sessions"
|
|
11978
11997
|
});
|
|
11979
11998
|
}
|
|
11980
11999
|
}
|
|
11981
12000
|
options2.push({
|
|
11982
12001
|
label: "No, suggest changes (esc)",
|
|
11983
|
-
value:
|
|
12002
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11984
12003
|
key: "No, suggest changes (esc)"
|
|
11985
12004
|
});
|
|
11986
12005
|
} else if (confirmationDetails.type === "exec") {
|
|
11987
12006
|
options2.push({
|
|
11988
12007
|
label: "Allow once",
|
|
11989
|
-
value:
|
|
12008
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11990
12009
|
key: "Allow once"
|
|
11991
12010
|
});
|
|
11992
12011
|
if (isTrustedFolder) {
|
|
11993
12012
|
options2.push({
|
|
11994
12013
|
label: `Allow for this session`,
|
|
11995
|
-
value:
|
|
12014
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11996
12015
|
key: `Allow for this session`
|
|
11997
12016
|
});
|
|
11998
12017
|
if (allowPermanentApproval) {
|
|
11999
12018
|
options2.push({
|
|
12000
12019
|
label: `Allow this command for all future sessions`,
|
|
12001
|
-
value:
|
|
12020
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12002
12021
|
key: `Allow for all future sessions`
|
|
12003
12022
|
});
|
|
12004
12023
|
}
|
|
12005
12024
|
}
|
|
12006
12025
|
options2.push({
|
|
12007
12026
|
label: "No, suggest changes (esc)",
|
|
12008
|
-
value:
|
|
12027
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12009
12028
|
key: "No, suggest changes (esc)"
|
|
12010
12029
|
});
|
|
12011
12030
|
} else if (confirmationDetails.type === "info") {
|
|
12012
12031
|
options2.push({
|
|
12013
12032
|
label: "Allow once",
|
|
12014
|
-
value:
|
|
12033
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12015
12034
|
key: "Allow once"
|
|
12016
12035
|
});
|
|
12017
12036
|
if (isTrustedFolder) {
|
|
12018
12037
|
options2.push({
|
|
12019
12038
|
label: "Allow for this session",
|
|
12020
|
-
value:
|
|
12039
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12021
12040
|
key: "Allow for this session"
|
|
12022
12041
|
});
|
|
12023
12042
|
if (allowPermanentApproval) {
|
|
12024
12043
|
options2.push({
|
|
12025
12044
|
label: "Allow for all future sessions",
|
|
12026
|
-
value:
|
|
12045
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12027
12046
|
key: "Allow for all future sessions"
|
|
12028
12047
|
});
|
|
12029
12048
|
}
|
|
12030
12049
|
}
|
|
12031
12050
|
options2.push({
|
|
12032
12051
|
label: "No, suggest changes (esc)",
|
|
12033
|
-
value:
|
|
12052
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12034
12053
|
key: "No, suggest changes (esc)"
|
|
12035
12054
|
});
|
|
12036
12055
|
} else if (confirmationDetails.type === "mcp") {
|
|
12037
12056
|
options2.push({
|
|
12038
12057
|
label: "Allow once",
|
|
12039
|
-
value:
|
|
12058
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12040
12059
|
key: "Allow once"
|
|
12041
12060
|
});
|
|
12042
12061
|
if (isTrustedFolder) {
|
|
12043
12062
|
options2.push({
|
|
12044
12063
|
label: "Allow tool for this session",
|
|
12045
|
-
value:
|
|
12064
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
12046
12065
|
key: "Allow tool for this session"
|
|
12047
12066
|
});
|
|
12048
12067
|
options2.push({
|
|
12049
12068
|
label: "Allow all server tools for this session",
|
|
12050
|
-
value:
|
|
12069
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
12051
12070
|
key: "Allow all server tools for this session"
|
|
12052
12071
|
});
|
|
12053
12072
|
if (allowPermanentApproval) {
|
|
12054
12073
|
options2.push({
|
|
12055
12074
|
label: "Allow tool for all future sessions",
|
|
12056
|
-
value:
|
|
12075
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12057
12076
|
key: "Allow tool for all future sessions"
|
|
12058
12077
|
});
|
|
12059
12078
|
}
|
|
12060
12079
|
}
|
|
12061
12080
|
options2.push({
|
|
12062
12081
|
label: "No, suggest changes (esc)",
|
|
12063
|
-
value:
|
|
12082
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12064
12083
|
key: "No, suggest changes (esc)"
|
|
12065
12084
|
});
|
|
12066
12085
|
}
|
|
@@ -12099,7 +12118,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12099
12118
|
const containsRedirection = commandsToDisplay.some(
|
|
12100
12119
|
(cmd) => hasRedirection(cmd)
|
|
12101
12120
|
);
|
|
12102
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12121
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12103
12122
|
if (containsRedirection && !isAutoEdit) {
|
|
12104
12123
|
extraInfoLines = 1;
|
|
12105
12124
|
}
|
|
@@ -12125,7 +12144,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12125
12144
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
12126
12145
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
12127
12146
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
12128
|
-
(o) => o.value ===
|
|
12147
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
12129
12148
|
);
|
|
12130
12149
|
if (alwaysAndSaveIndex !== -1) {
|
|
12131
12150
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -12142,10 +12161,10 @@ ${deceptiveUrlWarnings.map(
|
|
|
12142
12161
|
{
|
|
12143
12162
|
questions: confirmationDetails.questions,
|
|
12144
12163
|
onSubmit: (answers) => {
|
|
12145
|
-
handleConfirm(
|
|
12164
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
12146
12165
|
},
|
|
12147
12166
|
onCancel: () => {
|
|
12148
|
-
handleConfirm(
|
|
12167
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12149
12168
|
},
|
|
12150
12169
|
width: terminalWidth,
|
|
12151
12170
|
availableHeight: bodyHeight
|
|
@@ -12166,19 +12185,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
12166
12185
|
planPath: confirmationDetails.planPath,
|
|
12167
12186
|
getPreferredEditor,
|
|
12168
12187
|
onApprove: (approvalMode) => {
|
|
12169
|
-
handleConfirm(
|
|
12188
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12170
12189
|
approved: true,
|
|
12171
12190
|
approvalMode
|
|
12172
12191
|
});
|
|
12173
12192
|
},
|
|
12174
12193
|
onFeedback: (feedback) => {
|
|
12175
|
-
handleConfirm(
|
|
12194
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12176
12195
|
approved: false,
|
|
12177
12196
|
feedback
|
|
12178
12197
|
});
|
|
12179
12198
|
},
|
|
12180
12199
|
onCancel: () => {
|
|
12181
|
-
handleConfirm(
|
|
12200
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12182
12201
|
},
|
|
12183
12202
|
width: terminalWidth,
|
|
12184
12203
|
availableHeight: bodyHeight
|
|
@@ -12287,7 +12306,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12287
12306
|
const containsRedirection = commandsToDisplay.some(
|
|
12288
12307
|
(cmd) => hasRedirection(cmd)
|
|
12289
12308
|
);
|
|
12290
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12309
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12291
12310
|
let warnings = null;
|
|
12292
12311
|
if (containsRedirection && !isAutoEdit) {
|
|
12293
12312
|
const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
|
|
@@ -12446,7 +12465,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12446
12465
|
const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
|
|
12447
12466
|
const renderRadioItem = (0, import_react37.useCallback)(
|
|
12448
12467
|
(item, { titleColor }) => {
|
|
12449
|
-
if (item.value ===
|
|
12468
|
+
if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
12450
12469
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
|
|
12451
12470
|
item.label,
|
|
12452
12471
|
" ",
|
|
@@ -14476,7 +14495,7 @@ function validateAuthMethodWithSettings(authType, settings) {
|
|
|
14476
14495
|
if (settings.merged.security.auth.useExternal) {
|
|
14477
14496
|
return null;
|
|
14478
14497
|
}
|
|
14479
|
-
if (authType ===
|
|
14498
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14480
14499
|
return null;
|
|
14481
14500
|
}
|
|
14482
14501
|
return validateAuthMethod(authType);
|
|
@@ -14528,7 +14547,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
14528
14547
|
}
|
|
14529
14548
|
return;
|
|
14530
14549
|
}
|
|
14531
|
-
if (authType ===
|
|
14550
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14532
14551
|
const key = await reloadApiKey();
|
|
14533
14552
|
if (!key) {
|
|
14534
14553
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -14603,31 +14622,31 @@ function AuthDialog({
|
|
|
14603
14622
|
let items = [
|
|
14604
14623
|
{
|
|
14605
14624
|
label: "Sign in with Google",
|
|
14606
|
-
value:
|
|
14607
|
-
key:
|
|
14625
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
14626
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
14608
14627
|
},
|
|
14609
14628
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
14610
14629
|
{
|
|
14611
14630
|
label: "Use Cloud Shell user credentials",
|
|
14612
|
-
value:
|
|
14613
|
-
key:
|
|
14631
|
+
value: AuthType.COMPUTE_ADC,
|
|
14632
|
+
key: AuthType.COMPUTE_ADC
|
|
14614
14633
|
}
|
|
14615
14634
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
14616
14635
|
{
|
|
14617
14636
|
label: "Use metadata server application default credentials",
|
|
14618
|
-
value:
|
|
14619
|
-
key:
|
|
14637
|
+
value: AuthType.COMPUTE_ADC,
|
|
14638
|
+
key: AuthType.COMPUTE_ADC
|
|
14620
14639
|
}
|
|
14621
14640
|
] : [],
|
|
14622
14641
|
{
|
|
14623
14642
|
label: "Use Gemini API Key",
|
|
14624
|
-
value:
|
|
14625
|
-
key:
|
|
14643
|
+
value: AuthType.USE_GEMINI,
|
|
14644
|
+
key: AuthType.USE_GEMINI
|
|
14626
14645
|
},
|
|
14627
14646
|
{
|
|
14628
14647
|
label: "Vertex AI",
|
|
14629
|
-
value:
|
|
14630
|
-
key:
|
|
14648
|
+
value: AuthType.USE_VERTEX_AI,
|
|
14649
|
+
key: AuthType.USE_VERTEX_AI
|
|
14631
14650
|
}
|
|
14632
14651
|
];
|
|
14633
14652
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -14649,9 +14668,9 @@ function AuthDialog({
|
|
|
14649
14668
|
return item.value === defaultAuthType;
|
|
14650
14669
|
}
|
|
14651
14670
|
if (process.env["GEMINI_API_KEY"]) {
|
|
14652
|
-
return item.value ===
|
|
14671
|
+
return item.value === AuthType.USE_GEMINI;
|
|
14653
14672
|
}
|
|
14654
|
-
return item.value ===
|
|
14673
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
14655
14674
|
});
|
|
14656
14675
|
if (settings.merged.security.auth.enforcedType) {
|
|
14657
14676
|
initialAuthIndex = 0;
|
|
@@ -14662,7 +14681,7 @@ function AuthDialog({
|
|
|
14662
14681
|
return;
|
|
14663
14682
|
}
|
|
14664
14683
|
if (authType) {
|
|
14665
|
-
const needsRestart = authType ===
|
|
14684
|
+
const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
|
|
14666
14685
|
if (needsRestart) {
|
|
14667
14686
|
setAuthContext({ requiresRestart: true });
|
|
14668
14687
|
} else {
|
|
@@ -14670,12 +14689,12 @@ function AuthDialog({
|
|
|
14670
14689
|
}
|
|
14671
14690
|
await clearCachedCredentialFile();
|
|
14672
14691
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
14673
|
-
if (authType ===
|
|
14692
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
14674
14693
|
setExiting(true);
|
|
14675
14694
|
setTimeout(relaunchApp, 100);
|
|
14676
14695
|
return;
|
|
14677
14696
|
}
|
|
14678
|
-
if (authType ===
|
|
14697
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14679
14698
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
14680
14699
|
return;
|
|
14681
14700
|
}
|
|
@@ -15425,11 +15444,11 @@ var PrivacyNoticeText = ({
|
|
|
15425
15444
|
}) => {
|
|
15426
15445
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15427
15446
|
switch (authType) {
|
|
15428
|
-
case
|
|
15447
|
+
case AuthType.USE_GEMINI:
|
|
15429
15448
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15430
|
-
case
|
|
15449
|
+
case AuthType.USE_VERTEX_AI:
|
|
15431
15450
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15432
|
-
case
|
|
15451
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15433
15452
|
default:
|
|
15434
15453
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15435
15454
|
}
|
|
@@ -15470,7 +15489,7 @@ function ProQuotaDialog({
|
|
|
15470
15489
|
value: "retry_always",
|
|
15471
15490
|
key: "retry_always"
|
|
15472
15491
|
},
|
|
15473
|
-
...authType ===
|
|
15492
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15474
15493
|
{
|
|
15475
15494
|
label: "Upgrade for higher limits",
|
|
15476
15495
|
value: "upgrade",
|
|
@@ -16629,7 +16648,7 @@ function ModelDialog({ onClose }) {
|
|
|
16629
16648
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
16630
16649
|
const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
|
|
16631
16650
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16632
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16651
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16633
16652
|
const manualModelSelected = (0, import_react55.useMemo)(() => {
|
|
16634
16653
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16635
16654
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -17946,10 +17965,10 @@ function initializeConsoleStore() {
|
|
|
17946
17965
|
globalConsoleMessages = [];
|
|
17947
17966
|
globalErrorCount = 0;
|
|
17948
17967
|
notifyListeners();
|
|
17949
|
-
coreEvents.off(
|
|
17950
|
-
coreEvents.off(
|
|
17951
|
-
coreEvents.on(
|
|
17952
|
-
coreEvents.on(
|
|
17968
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
17969
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
17970
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
17971
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
17953
17972
|
}
|
|
17954
17973
|
function notifyListeners() {
|
|
17955
17974
|
for (const listener of listeners) {
|
|
@@ -20082,7 +20101,7 @@ function usePromptCompletion({
|
|
|
20082
20101
|
{ model: "prompt-completion" },
|
|
20083
20102
|
contents,
|
|
20084
20103
|
signal,
|
|
20085
|
-
|
|
20104
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20086
20105
|
);
|
|
20087
20106
|
if (signal.aborted) {
|
|
20088
20107
|
return;
|
|
@@ -22156,9 +22175,9 @@ var InputPrompt = ({
|
|
|
22156
22175
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22157
22176
|
}
|
|
22158
22177
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22159
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22160
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22161
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22178
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22179
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22180
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22162
22181
|
let statusColor;
|
|
22163
22182
|
let statusText = "";
|
|
22164
22183
|
if (shellModeActive) {
|
|
@@ -22991,22 +23010,22 @@ var ApprovalModeIndicator = ({
|
|
|
22991
23010
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
22992
23011
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
22993
23012
|
switch (approvalMode) {
|
|
22994
|
-
case
|
|
23013
|
+
case ApprovalMode.AUTO_EDIT:
|
|
22995
23014
|
textColor = theme.status.warning;
|
|
22996
23015
|
textContent = "auto-accept edits";
|
|
22997
23016
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
22998
23017
|
break;
|
|
22999
|
-
case
|
|
23018
|
+
case ApprovalMode.PLAN:
|
|
23000
23019
|
textColor = theme.status.success;
|
|
23001
23020
|
textContent = "plan";
|
|
23002
23021
|
subText = `${cycleHint} to manual`;
|
|
23003
23022
|
break;
|
|
23004
|
-
case
|
|
23023
|
+
case ApprovalMode.YOLO:
|
|
23005
23024
|
textColor = theme.status.error;
|
|
23006
23025
|
textContent = "YOLO";
|
|
23007
23026
|
subText = yoloHint;
|
|
23008
23027
|
break;
|
|
23009
|
-
case
|
|
23028
|
+
case ApprovalMode.DEFAULT:
|
|
23010
23029
|
default:
|
|
23011
23030
|
textColor = theme.text.accent;
|
|
23012
23031
|
textContent = "";
|
|
@@ -23054,7 +23073,7 @@ var useComposerStatus = () => {
|
|
|
23054
23073
|
(item) => item.type === "tool_group"
|
|
23055
23074
|
).some(
|
|
23056
23075
|
(item) => item.tools.some(
|
|
23057
|
-
(tool) => tool.status ===
|
|
23076
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23058
23077
|
)
|
|
23059
23078
|
),
|
|
23060
23079
|
[uiState.pendingHistoryItems]
|
|
@@ -23069,13 +23088,13 @@ var useComposerStatus = () => {
|
|
|
23069
23088
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23070
23089
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23071
23090
|
switch (showApprovalModeIndicator) {
|
|
23072
|
-
case
|
|
23091
|
+
case ApprovalMode.YOLO:
|
|
23073
23092
|
return { text: "YOLO", color: theme.status.error };
|
|
23074
|
-
case
|
|
23093
|
+
case ApprovalMode.PLAN:
|
|
23075
23094
|
return { text: "plan", color: theme.status.success };
|
|
23076
|
-
case
|
|
23095
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23077
23096
|
return { text: "auto edit", color: theme.status.warning };
|
|
23078
|
-
case
|
|
23097
|
+
case ApprovalMode.DEFAULT:
|
|
23079
23098
|
default:
|
|
23080
23099
|
return null;
|
|
23081
23100
|
}
|
|
@@ -23429,7 +23448,7 @@ var ConfigInitDisplay = ({
|
|
|
23429
23448
|
let connected = 0;
|
|
23430
23449
|
const connecting = [];
|
|
23431
23450
|
for (const [name, client] of clients.entries()) {
|
|
23432
|
-
if (client.getStatus() ===
|
|
23451
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23433
23452
|
connected++;
|
|
23434
23453
|
} else {
|
|
23435
23454
|
connecting.push(name);
|
|
@@ -23451,9 +23470,9 @@ var ConfigInitDisplay = ({
|
|
|
23451
23470
|
);
|
|
23452
23471
|
}
|
|
23453
23472
|
};
|
|
23454
|
-
coreEvents.on(
|
|
23473
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23455
23474
|
return () => {
|
|
23456
|
-
coreEvents.off(
|
|
23475
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23457
23476
|
};
|
|
23458
23477
|
}, [initialMessage]);
|
|
23459
23478
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
|
|
@@ -24168,7 +24187,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24168
24187
|
callId,
|
|
24169
24188
|
name: SHELL_COMMAND_NAME,
|
|
24170
24189
|
description: rawQuery,
|
|
24171
|
-
status:
|
|
24190
|
+
status: CoreToolCallStatus.Executing,
|
|
24172
24191
|
isClientInitiated: true,
|
|
24173
24192
|
resultDisplay: "",
|
|
24174
24193
|
confirmationDetails: void 0
|
|
@@ -24309,7 +24328,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24309
24328
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24310
24329
|
}
|
|
24311
24330
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24312
|
-
let finalStatus =
|
|
24331
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24313
24332
|
const prependToAnsiOutput = (output, text) => {
|
|
24314
24333
|
const newLines = text.split("\n").map((line) => [
|
|
24315
24334
|
{
|
|
@@ -24328,20 +24347,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24328
24347
|
};
|
|
24329
24348
|
let prefix = "";
|
|
24330
24349
|
if (result.error) {
|
|
24331
|
-
finalStatus =
|
|
24350
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24332
24351
|
prefix = result.error.message;
|
|
24333
24352
|
} else if (result.aborted) {
|
|
24334
|
-
finalStatus =
|
|
24353
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24335
24354
|
prefix = "Command was cancelled.";
|
|
24336
24355
|
} else if (result.backgrounded) {
|
|
24337
|
-
finalStatus =
|
|
24356
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24338
24357
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24339
24358
|
mainContent = finalOutput;
|
|
24340
24359
|
} else if (result.signal) {
|
|
24341
|
-
finalStatus =
|
|
24360
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24342
24361
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24343
24362
|
} else if (result.exitCode !== 0) {
|
|
24344
|
-
finalStatus =
|
|
24363
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24345
24364
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24346
24365
|
}
|
|
24347
24366
|
if (prefix) {
|
|
@@ -24367,7 +24386,7 @@ ${mainContent}`;
|
|
|
24367
24386
|
status: finalStatus,
|
|
24368
24387
|
resultDisplay: finalOutput
|
|
24369
24388
|
};
|
|
24370
|
-
if (finalStatus !==
|
|
24389
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24371
24390
|
addItemToHistory(
|
|
24372
24391
|
{
|
|
24373
24392
|
type: "tool_group",
|
|
@@ -25357,7 +25376,7 @@ function useQuotaAndFallback({
|
|
|
25357
25376
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25358
25377
|
`/stats model for usage details`,
|
|
25359
25378
|
`/model to switch models.`,
|
|
25360
|
-
contentGeneratorConfig?.authType ===
|
|
25379
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25361
25380
|
].filter(Boolean);
|
|
25362
25381
|
message = messageLines.join("\n");
|
|
25363
25382
|
} else if (error instanceof ModelNotFoundError) {
|
|
@@ -25545,7 +25564,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25545
25564
|
);
|
|
25546
25565
|
setEditorError(null);
|
|
25547
25566
|
setIsEditorDialogOpen(false);
|
|
25548
|
-
coreEvents.emit(
|
|
25567
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25549
25568
|
} catch (error) {
|
|
25550
25569
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25551
25570
|
}
|
|
@@ -25554,7 +25573,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25554
25573
|
);
|
|
25555
25574
|
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25556
25575
|
setIsEditorDialogOpen(false);
|
|
25557
|
-
coreEvents.emit(
|
|
25576
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25558
25577
|
}, []);
|
|
25559
25578
|
return {
|
|
25560
25579
|
isEditorDialogOpen,
|
|
@@ -25931,7 +25950,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25931
25950
|
canonicalPath: resolvedCommandPath
|
|
25932
25951
|
} = parseSlashCommand(trimmed, commands);
|
|
25933
25952
|
if (!commandToExecute) {
|
|
25934
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
25953
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
25935
25954
|
if (isMcpLoading) {
|
|
25936
25955
|
setIsProcessing(true);
|
|
25937
25956
|
if (addToHistory) {
|
|
@@ -26111,7 +26130,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26111
26130
|
onConfirm: async (resolvedOutcome) => {
|
|
26112
26131
|
resolve3({
|
|
26113
26132
|
outcome: resolvedOutcome,
|
|
26114
|
-
approvedCommands: resolvedOutcome ===
|
|
26133
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26115
26134
|
});
|
|
26116
26135
|
}
|
|
26117
26136
|
};
|
|
@@ -26119,7 +26138,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26119
26138
|
callId,
|
|
26120
26139
|
name: "Expansion",
|
|
26121
26140
|
description: "Command expansion needs shell access",
|
|
26122
|
-
status:
|
|
26141
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26123
26142
|
isClientInitiated: true,
|
|
26124
26143
|
resultDisplay: void 0,
|
|
26125
26144
|
confirmationDetails
|
|
@@ -26130,7 +26149,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26130
26149
|
});
|
|
26131
26150
|
});
|
|
26132
26151
|
setPendingItem(null);
|
|
26133
|
-
if (outcome ===
|
|
26152
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26134
26153
|
addItem(
|
|
26135
26154
|
{
|
|
26136
26155
|
type: "info" /* INFO */,
|
|
@@ -26140,7 +26159,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26140
26159
|
);
|
|
26141
26160
|
return { type: "handled" };
|
|
26142
26161
|
}
|
|
26143
|
-
if (outcome ===
|
|
26162
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26144
26163
|
setSessionShellAllowlist(
|
|
26145
26164
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26146
26165
|
);
|
|
@@ -26616,7 +26635,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26616
26635
|
let description;
|
|
26617
26636
|
let renderOutputAsMarkdown = false;
|
|
26618
26637
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26619
|
-
if (call.status ===
|
|
26638
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26620
26639
|
description = JSON.stringify(call.request.args);
|
|
26621
26640
|
} else {
|
|
26622
26641
|
description = call.invocation.getDescription();
|
|
@@ -26639,27 +26658,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26639
26658
|
let progress = void 0;
|
|
26640
26659
|
let progressTotal = void 0;
|
|
26641
26660
|
switch (call.status) {
|
|
26642
|
-
case
|
|
26661
|
+
case CoreToolCallStatus.Success:
|
|
26643
26662
|
resultDisplay = call.response.resultDisplay;
|
|
26644
26663
|
outputFile = call.response.outputFile;
|
|
26645
26664
|
break;
|
|
26646
|
-
case
|
|
26647
|
-
case
|
|
26665
|
+
case CoreToolCallStatus.Error:
|
|
26666
|
+
case CoreToolCallStatus.Cancelled:
|
|
26648
26667
|
resultDisplay = call.response.resultDisplay;
|
|
26649
26668
|
break;
|
|
26650
|
-
case
|
|
26669
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26651
26670
|
correlationId = call.correlationId;
|
|
26652
26671
|
confirmationDetails = call.confirmationDetails;
|
|
26653
26672
|
break;
|
|
26654
|
-
case
|
|
26673
|
+
case CoreToolCallStatus.Executing:
|
|
26655
26674
|
resultDisplay = call.liveOutput;
|
|
26656
26675
|
ptyId = call.pid;
|
|
26657
26676
|
progressMessage = call.progressMessage;
|
|
26658
26677
|
progress = call.progress;
|
|
26659
26678
|
progressTotal = call.progressTotal;
|
|
26660
26679
|
break;
|
|
26661
|
-
case
|
|
26662
|
-
case
|
|
26680
|
+
case CoreToolCallStatus.Scheduled:
|
|
26681
|
+
case CoreToolCallStatus.Validating:
|
|
26663
26682
|
break;
|
|
26664
26683
|
default: {
|
|
26665
26684
|
const exhaustiveCheck = call;
|
|
@@ -26730,7 +26749,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26730
26749
|
const handler = (event) => {
|
|
26731
26750
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26732
26751
|
const hasExecuting = event.toolCalls.some(
|
|
26733
|
-
(tc) => tc.status ===
|
|
26752
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26734
26753
|
);
|
|
26735
26754
|
if (hasExecuting) {
|
|
26736
26755
|
setLastToolOutputTime(Date.now());
|
|
@@ -26739,7 +26758,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26739
26758
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26740
26759
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26741
26760
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26742
|
-
(tc) => tc.status ===
|
|
26761
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26743
26762
|
);
|
|
26744
26763
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26745
26764
|
return prev;
|
|
@@ -26751,9 +26770,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26751
26770
|
};
|
|
26752
26771
|
});
|
|
26753
26772
|
};
|
|
26754
|
-
messageBus.subscribe(
|
|
26773
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26755
26774
|
return () => {
|
|
26756
|
-
messageBus.unsubscribe(
|
|
26775
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26757
26776
|
};
|
|
26758
26777
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26759
26778
|
(0, import_react98.useEffect)(() => {
|
|
@@ -26775,9 +26794,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26775
26794
|
};
|
|
26776
26795
|
});
|
|
26777
26796
|
};
|
|
26778
|
-
messageBus.subscribe(
|
|
26797
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26779
26798
|
return () => {
|
|
26780
|
-
messageBus.unsubscribe(
|
|
26799
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26781
26800
|
};
|
|
26782
26801
|
}, [messageBus]);
|
|
26783
26802
|
const schedule = (0, import_react98.useCallback)(
|
|
@@ -26876,8 +26895,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
26876
26895
|
const prev = prevMap.get(coreCall.request.callId);
|
|
26877
26896
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
26878
26897
|
let status = coreCall.status;
|
|
26879
|
-
if ((status ===
|
|
26880
|
-
status =
|
|
26898
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
26899
|
+
status = CoreToolCallStatus.Executing;
|
|
26881
26900
|
}
|
|
26882
26901
|
return {
|
|
26883
26902
|
...coreCall,
|
|
@@ -26909,7 +26928,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
26909
26928
|
};
|
|
26910
26929
|
}
|
|
26911
26930
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
26912
|
-
return toolCall.status ===
|
|
26931
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
26913
26932
|
}
|
|
26914
26933
|
function showCitations(settings) {
|
|
26915
26934
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -26919,14 +26938,14 @@ function showCitations(settings) {
|
|
|
26919
26938
|
return true;
|
|
26920
26939
|
}
|
|
26921
26940
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
26922
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
26941
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
26923
26942
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
26924
26943
|
}
|
|
26925
26944
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
26926
|
-
if (tc.status ===
|
|
26945
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
26927
26946
|
return true;
|
|
26928
26947
|
}
|
|
26929
|
-
if (tc.status ===
|
|
26948
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
26930
26949
|
return !tc.responseSubmittedToGemini;
|
|
26931
26950
|
}
|
|
26932
26951
|
return false;
|
|
@@ -26973,9 +26992,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
26973
26992
|
}
|
|
26974
26993
|
setRetryStatus(payload);
|
|
26975
26994
|
};
|
|
26976
|
-
coreEvents.on(
|
|
26995
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
26977
26996
|
return () => {
|
|
26978
|
-
coreEvents.off(
|
|
26997
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
26979
26998
|
};
|
|
26980
26999
|
}, [isRespondingRef]);
|
|
26981
27000
|
const [
|
|
@@ -27108,12 +27127,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27108
27127
|
const tc = toolCalls[i];
|
|
27109
27128
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27110
27129
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27111
|
-
const isAgent = tc.tool?.kind ===
|
|
27130
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27112
27131
|
if (isAgent) {
|
|
27113
27132
|
let contigAgentsComplete = true;
|
|
27114
27133
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27115
27134
|
const nextTc = toolCalls[j];
|
|
27116
|
-
if (nextTc.tool?.kind ===
|
|
27135
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27117
27136
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27118
27137
|
contigAgentsComplete = false;
|
|
27119
27138
|
break;
|
|
@@ -27139,7 +27158,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27139
27158
|
let currentGroup = [];
|
|
27140
27159
|
for (const tc of toolsToPush) {
|
|
27141
27160
|
newPushed.add(tc.request.callId);
|
|
27142
|
-
if (tc.tool?.kind ===
|
|
27161
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27143
27162
|
currentGroup.push(tc);
|
|
27144
27163
|
} else {
|
|
27145
27164
|
if (currentGroup.length > 0) {
|
|
@@ -27289,7 +27308,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27289
27308
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27290
27309
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27291
27310
|
(0, import_react99.useEffect)(() => {
|
|
27292
|
-
if (config.getApprovalMode() ===
|
|
27311
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27293
27312
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27294
27313
|
(item) => item.type === "user" /* USER */
|
|
27295
27314
|
);
|
|
@@ -27357,7 +27376,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27357
27376
|
return;
|
|
27358
27377
|
}
|
|
27359
27378
|
const hasActiveTools = toolCalls.some(
|
|
27360
|
-
(tc) => tc.status ===
|
|
27379
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27361
27380
|
);
|
|
27362
27381
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27363
27382
|
if (clearBuffer) {
|
|
@@ -27384,7 +27403,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27384
27403
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27385
27404
|
return {
|
|
27386
27405
|
...tool,
|
|
27387
|
-
status:
|
|
27406
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27388
27407
|
resultDisplay: tool.resultDisplay
|
|
27389
27408
|
};
|
|
27390
27409
|
}
|
|
@@ -27449,7 +27468,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27449
27468
|
let localQueryToSendToGemini = null;
|
|
27450
27469
|
if (typeof query === "string") {
|
|
27451
27470
|
const trimmedQuery = query.trim();
|
|
27452
|
-
await logger?.logMessage(
|
|
27471
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27453
27472
|
if (!shellModeActive) {
|
|
27454
27473
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27455
27474
|
if (slashCommandResult) {
|
|
@@ -27605,7 +27624,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27605
27624
|
if (pendingHistoryItemRef.current) {
|
|
27606
27625
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27607
27626
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27608
|
-
(tool) => tool.status ===
|
|
27627
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
27609
27628
|
);
|
|
27610
27629
|
const pendingItem = {
|
|
27611
27630
|
...pendingHistoryItemRef.current,
|
|
@@ -27851,15 +27870,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27851
27870
|
let geminiMessageBuffer = "";
|
|
27852
27871
|
const toolCallRequests = [];
|
|
27853
27872
|
for await (const event of stream) {
|
|
27854
|
-
if (event.type !==
|
|
27873
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
27855
27874
|
setThought(null);
|
|
27856
27875
|
}
|
|
27857
27876
|
switch (event.type) {
|
|
27858
|
-
case
|
|
27877
|
+
case GeminiEventType.Thought:
|
|
27859
27878
|
setLastGeminiActivityTime(Date.now());
|
|
27860
27879
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
27861
27880
|
break;
|
|
27862
|
-
case
|
|
27881
|
+
case GeminiEventType.Content:
|
|
27863
27882
|
setLastGeminiActivityTime(Date.now());
|
|
27864
27883
|
geminiMessageBuffer = handleContentEvent(
|
|
27865
27884
|
event.value,
|
|
@@ -27867,16 +27886,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27867
27886
|
userMessageTimestamp
|
|
27868
27887
|
);
|
|
27869
27888
|
break;
|
|
27870
|
-
case
|
|
27889
|
+
case GeminiEventType.ToolCallRequest:
|
|
27871
27890
|
toolCallRequests.push(event.value);
|
|
27872
27891
|
break;
|
|
27873
|
-
case
|
|
27892
|
+
case GeminiEventType.UserCancelled:
|
|
27874
27893
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
27875
27894
|
break;
|
|
27876
|
-
case
|
|
27895
|
+
case GeminiEventType.Error:
|
|
27877
27896
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
27878
27897
|
break;
|
|
27879
|
-
case
|
|
27898
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
27880
27899
|
handleAgentExecutionStoppedEvent(
|
|
27881
27900
|
event.value.reason,
|
|
27882
27901
|
userMessageTimestamp,
|
|
@@ -27884,7 +27903,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27884
27903
|
event.value.contextCleared
|
|
27885
27904
|
);
|
|
27886
27905
|
break;
|
|
27887
|
-
case
|
|
27906
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
27888
27907
|
handleAgentExecutionBlockedEvent(
|
|
27889
27908
|
event.value.reason,
|
|
27890
27909
|
userMessageTimestamp,
|
|
@@ -27892,35 +27911,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27892
27911
|
event.value.contextCleared
|
|
27893
27912
|
);
|
|
27894
27913
|
break;
|
|
27895
|
-
case
|
|
27914
|
+
case GeminiEventType.ChatCompressed:
|
|
27896
27915
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
27897
27916
|
break;
|
|
27898
|
-
case
|
|
27899
|
-
case
|
|
27917
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
27918
|
+
case GeminiEventType.ToolCallResponse:
|
|
27900
27919
|
break;
|
|
27901
|
-
case
|
|
27920
|
+
case GeminiEventType.MaxSessionTurns:
|
|
27902
27921
|
handleMaxSessionTurnsEvent();
|
|
27903
27922
|
break;
|
|
27904
|
-
case
|
|
27923
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
27905
27924
|
handleContextWindowWillOverflowEvent(
|
|
27906
27925
|
event.value.estimatedRequestTokenCount,
|
|
27907
27926
|
event.value.remainingTokenCount
|
|
27908
27927
|
);
|
|
27909
27928
|
break;
|
|
27910
|
-
case
|
|
27929
|
+
case GeminiEventType.Finished:
|
|
27911
27930
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
27912
27931
|
break;
|
|
27913
|
-
case
|
|
27932
|
+
case GeminiEventType.Citation:
|
|
27914
27933
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
27915
27934
|
break;
|
|
27916
|
-
case
|
|
27935
|
+
case GeminiEventType.ModelInfo:
|
|
27917
27936
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
27918
27937
|
break;
|
|
27919
|
-
case
|
|
27938
|
+
case GeminiEventType.LoopDetected:
|
|
27920
27939
|
loopDetectedRef.current = true;
|
|
27921
27940
|
break;
|
|
27922
|
-
case
|
|
27923
|
-
case
|
|
27941
|
+
case GeminiEventType.Retry:
|
|
27942
|
+
case GeminiEventType.InvalidStream:
|
|
27924
27943
|
break;
|
|
27925
27944
|
default: {
|
|
27926
27945
|
const unreachable = event;
|
|
@@ -27961,7 +27980,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27961
27980
|
const submitQuery = (0, import_react99.useCallback)(
|
|
27962
27981
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
27963
27982
|
{
|
|
27964
|
-
operation: options?.isContinuation ?
|
|
27983
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
27965
27984
|
sessionId: config.getSessionId()
|
|
27966
27985
|
},
|
|
27967
27986
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28121,7 +28140,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28121
28140
|
);
|
|
28122
28141
|
const handleApprovalModeChange = (0, import_react99.useCallback)(
|
|
28123
28142
|
async (newApprovalMode) => {
|
|
28124
|
-
if (previousApprovalModeRef.current ===
|
|
28143
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28125
28144
|
if (geminiClient) {
|
|
28126
28145
|
try {
|
|
28127
28146
|
await geminiClient.addHistory({
|
|
@@ -28144,11 +28163,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28144
28163
|
}
|
|
28145
28164
|
}
|
|
28146
28165
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28147
|
-
if (newApprovalMode ===
|
|
28166
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28148
28167
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28149
28168
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28150
28169
|
);
|
|
28151
|
-
if (newApprovalMode ===
|
|
28170
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28152
28171
|
awaitingApprovalCalls = awaitingApprovalCalls.filter(
|
|
28153
28172
|
(call) => EDIT_TOOL_NAMES.has(call.request.name)
|
|
28154
28173
|
);
|
|
@@ -28157,11 +28176,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28157
28176
|
if (call.correlationId) {
|
|
28158
28177
|
try {
|
|
28159
28178
|
await config.getMessageBus().publish({
|
|
28160
|
-
type:
|
|
28179
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28161
28180
|
correlationId: call.correlationId,
|
|
28162
28181
|
confirmed: true,
|
|
28163
28182
|
requiresUserConfirmation: false,
|
|
28164
|
-
outcome:
|
|
28183
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28165
28184
|
});
|
|
28166
28185
|
} catch (error) {
|
|
28167
28186
|
debugLogger.warn(
|
|
@@ -28239,14 +28258,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28239
28258
|
);
|
|
28240
28259
|
if (isLowErrorVerbosity) {
|
|
28241
28260
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28242
|
-
(tc) => tc.status ===
|
|
28261
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28243
28262
|
).length;
|
|
28244
28263
|
}
|
|
28245
28264
|
if (geminiTools.length === 0) {
|
|
28246
28265
|
return;
|
|
28247
28266
|
}
|
|
28248
28267
|
const stopExecutionTool = geminiTools.find(
|
|
28249
|
-
(tc) => tc.response.errorType ===
|
|
28268
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28250
28269
|
);
|
|
28251
28270
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28252
28271
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28266,9 +28285,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28266
28285
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28267
28286
|
);
|
|
28268
28287
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28269
|
-
(tc) => tc.status ===
|
|
28288
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28270
28289
|
);
|
|
28271
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28290
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28272
28291
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28273
28292
|
if (!turnCancelledRef.current) {
|
|
28274
28293
|
addItem({
|
|
@@ -28349,7 +28368,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28349
28368
|
return;
|
|
28350
28369
|
}
|
|
28351
28370
|
const restorableToolCalls = toolCalls.filter(
|
|
28352
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28371
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28353
28372
|
);
|
|
28354
28373
|
if (restorableToolCalls.length > 0) {
|
|
28355
28374
|
if (!gitService) {
|
|
@@ -28572,14 +28591,14 @@ var useAgentStream = ({
|
|
|
28572
28591
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28573
28592
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28574
28593
|
const desc = legacyState?.description ?? "";
|
|
28575
|
-
const fallbackKind =
|
|
28594
|
+
const fallbackKind = Kind.Other;
|
|
28576
28595
|
const newCall = {
|
|
28577
28596
|
callId: event.requestId,
|
|
28578
28597
|
name: displayName,
|
|
28579
28598
|
originalRequestName: event.name,
|
|
28580
28599
|
description: desc,
|
|
28581
28600
|
display: event.display,
|
|
28582
|
-
status:
|
|
28601
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28583
28602
|
isClientInitiated: false,
|
|
28584
28603
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28585
28604
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28597,10 +28616,10 @@ var useAgentStream = ({
|
|
|
28597
28616
|
const evtStatus = legacyState?.status;
|
|
28598
28617
|
let status = tc.status;
|
|
28599
28618
|
if (evtStatus === "executing")
|
|
28600
|
-
status =
|
|
28601
|
-
else if (evtStatus === "error") status =
|
|
28619
|
+
status = CoreToolCallStatus.Executing;
|
|
28620
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28602
28621
|
else if (evtStatus === "success")
|
|
28603
|
-
status =
|
|
28622
|
+
status = CoreToolCallStatus.Success;
|
|
28604
28623
|
const display = event.display?.result;
|
|
28605
28624
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28606
28625
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28633,7 +28652,7 @@ var useAgentStream = ({
|
|
|
28633
28652
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28634
28653
|
return {
|
|
28635
28654
|
...tc,
|
|
28636
|
-
status: event.isError ?
|
|
28655
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28637
28656
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28638
28657
|
resultDisplay,
|
|
28639
28658
|
outputFile
|
|
@@ -28699,7 +28718,7 @@ var useAgentStream = ({
|
|
|
28699
28718
|
if (!options?.isContinuation) {
|
|
28700
28719
|
if (typeof query === "string") {
|
|
28701
28720
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28702
|
-
void logger?.logMessage(
|
|
28721
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28703
28722
|
}
|
|
28704
28723
|
startNewPrompt();
|
|
28705
28724
|
}
|
|
@@ -30223,9 +30242,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30223
30242
|
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30224
30243
|
async (choice) => {
|
|
30225
30244
|
const trustLevelMap = {
|
|
30226
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30227
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30228
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
30245
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
30246
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
30247
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
30229
30248
|
};
|
|
30230
30249
|
const trustLevel = trustLevelMap[choice];
|
|
30231
30250
|
if (!trustLevel) return;
|
|
@@ -30244,7 +30263,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30244
30263
|
}, 100);
|
|
30245
30264
|
return;
|
|
30246
30265
|
}
|
|
30247
|
-
const currentIsTrusted = trustLevel ===
|
|
30266
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30248
30267
|
onTrustChange(currentIsTrusted);
|
|
30249
30268
|
setIsTrusted(currentIsTrusted);
|
|
30250
30269
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -31252,7 +31271,7 @@ function useMessageQueue({
|
|
|
31252
31271
|
var import_react107 = __toESM(require_react(), 1);
|
|
31253
31272
|
function useMcpStatus(config) {
|
|
31254
31273
|
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31255
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31274
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31256
31275
|
);
|
|
31257
31276
|
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31258
31277
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31265,12 +31284,12 @@ function useMcpStatus(config) {
|
|
|
31265
31284
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31266
31285
|
}
|
|
31267
31286
|
};
|
|
31268
|
-
coreEvents.on(
|
|
31287
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31269
31288
|
return () => {
|
|
31270
|
-
coreEvents.off(
|
|
31289
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31271
31290
|
};
|
|
31272
31291
|
}, [config]);
|
|
31273
|
-
const isMcpReady = discoveryState ===
|
|
31292
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31274
31293
|
return {
|
|
31275
31294
|
discoveryState,
|
|
31276
31295
|
mcpServerCount,
|
|
@@ -31297,7 +31316,7 @@ function useApprovalModeIndicator({
|
|
|
31297
31316
|
(key) => {
|
|
31298
31317
|
let nextApprovalMode;
|
|
31299
31318
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31300
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31319
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31301
31320
|
if (addItem) {
|
|
31302
31321
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31303
31322
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31315,21 +31334,21 @@ function useApprovalModeIndicator({
|
|
|
31315
31334
|
}
|
|
31316
31335
|
return;
|
|
31317
31336
|
}
|
|
31318
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31337
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31319
31338
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31320
31339
|
const currentMode = config.getApprovalMode();
|
|
31321
31340
|
switch (currentMode) {
|
|
31322
|
-
case
|
|
31323
|
-
nextApprovalMode =
|
|
31341
|
+
case ApprovalMode.DEFAULT:
|
|
31342
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31324
31343
|
break;
|
|
31325
|
-
case
|
|
31326
|
-
nextApprovalMode = allowPlanMode ?
|
|
31344
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31345
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31327
31346
|
break;
|
|
31328
|
-
case
|
|
31329
|
-
nextApprovalMode =
|
|
31347
|
+
case ApprovalMode.PLAN:
|
|
31348
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31330
31349
|
break;
|
|
31331
|
-
case
|
|
31332
|
-
nextApprovalMode =
|
|
31350
|
+
case ApprovalMode.YOLO:
|
|
31351
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31333
31352
|
break;
|
|
31334
31353
|
default:
|
|
31335
31354
|
}
|
|
@@ -31739,11 +31758,11 @@ var useHookDisplayState = () => {
|
|
|
31739
31758
|
removeHook();
|
|
31740
31759
|
}
|
|
31741
31760
|
};
|
|
31742
|
-
coreEvents.on(
|
|
31743
|
-
coreEvents.on(
|
|
31761
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
31762
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31744
31763
|
return () => {
|
|
31745
|
-
coreEvents.off(
|
|
31746
|
-
coreEvents.off(
|
|
31764
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
31765
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31747
31766
|
activeTimeouts.forEach(clearTimeout);
|
|
31748
31767
|
activeTimeouts.clear();
|
|
31749
31768
|
};
|
|
@@ -32596,7 +32615,7 @@ var AppContainer = (props) => {
|
|
|
32596
32615
|
setConfigInitialized(true);
|
|
32597
32616
|
startupProfiler.flush(config);
|
|
32598
32617
|
startAutoMemoryIfEnabled(config);
|
|
32599
|
-
const sessionStartSource = resumedSessionData ?
|
|
32618
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32600
32619
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32601
32620
|
if (result) {
|
|
32602
32621
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32623,7 +32642,7 @@ var AppContainer = (props) => {
|
|
|
32623
32642
|
);
|
|
32624
32643
|
const ideClient = await IdeClient.getInstance();
|
|
32625
32644
|
await ideClient.disconnect();
|
|
32626
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32645
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32627
32646
|
};
|
|
32628
32647
|
registerCleanup(cleanupFn);
|
|
32629
32648
|
return () => {
|
|
@@ -32648,11 +32667,11 @@ var AppContainer = (props) => {
|
|
|
32648
32667
|
resetTime: payload.resetTime
|
|
32649
32668
|
});
|
|
32650
32669
|
};
|
|
32651
|
-
coreEvents.on(
|
|
32652
|
-
coreEvents.on(
|
|
32670
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32671
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32653
32672
|
return () => {
|
|
32654
|
-
coreEvents.off(
|
|
32655
|
-
coreEvents.off(
|
|
32673
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32674
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32656
32675
|
};
|
|
32657
32676
|
}, [config]);
|
|
32658
32677
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32665,16 +32684,16 @@ var AppContainer = (props) => {
|
|
|
32665
32684
|
const handleAgentsDiscovered = (payload) => {
|
|
32666
32685
|
setNewAgents(payload.agents);
|
|
32667
32686
|
};
|
|
32668
|
-
coreEvents.on(
|
|
32669
|
-
coreEvents.on(
|
|
32670
|
-
coreEvents.on(
|
|
32687
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32688
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32689
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32671
32690
|
return () => {
|
|
32672
|
-
coreEvents.off(
|
|
32691
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32673
32692
|
coreEvents.off(
|
|
32674
|
-
|
|
32693
|
+
CoreEvent.AdminSettingsChanged,
|
|
32675
32694
|
handleAdminSettingsChanged
|
|
32676
32695
|
);
|
|
32677
|
-
coreEvents.off(
|
|
32696
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32678
32697
|
};
|
|
32679
32698
|
}, [settings]);
|
|
32680
32699
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32740,11 +32759,11 @@ var AppContainer = (props) => {
|
|
|
32740
32759
|
exitEditorDialog
|
|
32741
32760
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32742
32761
|
(0, import_react121.useEffect)(() => {
|
|
32743
|
-
coreEvents.on(
|
|
32744
|
-
coreEvents.on(
|
|
32762
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32763
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32745
32764
|
return () => {
|
|
32746
|
-
coreEvents.off(
|
|
32747
|
-
coreEvents.off(
|
|
32765
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32766
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32748
32767
|
};
|
|
32749
32768
|
}, [handleEditorClose, openEditorDialog]);
|
|
32750
32769
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32812,7 +32831,7 @@ var AppContainer = (props) => {
|
|
|
32812
32831
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
32813
32832
|
});
|
|
32814
32833
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
32815
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
32834
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
32816
32835
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
32817
32836
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
32818
32837
|
config,
|
|
@@ -32840,7 +32859,7 @@ var AppContainer = (props) => {
|
|
|
32840
32859
|
async (authType, scope) => {
|
|
32841
32860
|
if (authType) {
|
|
32842
32861
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
32843
|
-
if (authType ===
|
|
32862
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
32844
32863
|
setAuthContext({ requiresRestart: true });
|
|
32845
32864
|
} else {
|
|
32846
32865
|
setAuthContext({});
|
|
@@ -32868,7 +32887,7 @@ var AppContainer = (props) => {
|
|
|
32868
32887
|
);
|
|
32869
32888
|
return;
|
|
32870
32889
|
}
|
|
32871
|
-
if (authType ===
|
|
32890
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
32872
32891
|
writeToStdout(`
|
|
32873
32892
|
----------------------------------------------------------------
|
|
32874
32893
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -32891,7 +32910,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32891
32910
|
}
|
|
32892
32911
|
await saveApiKey(apiKey);
|
|
32893
32912
|
await reloadApiKey();
|
|
32894
|
-
await config.refreshAuth(
|
|
32913
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
32895
32914
|
setAuthState("authenticated" /* Authenticated */);
|
|
32896
32915
|
} catch (e) {
|
|
32897
32916
|
onAuthError(
|
|
@@ -32916,7 +32935,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32916
32935
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
32917
32936
|
);
|
|
32918
32937
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
32919
|
-
if (settings.merged.security.auth.selectedType ===
|
|
32938
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
32920
32939
|
return;
|
|
32921
32940
|
}
|
|
32922
32941
|
const error = validateAuthMethod(
|
|
@@ -33045,9 +33064,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33045
33064
|
}
|
|
33046
33065
|
});
|
|
33047
33066
|
};
|
|
33048
|
-
coreEvents.on(
|
|
33067
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33049
33068
|
return () => {
|
|
33050
|
-
coreEvents.off(
|
|
33069
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33051
33070
|
};
|
|
33052
33071
|
}, []);
|
|
33053
33072
|
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
@@ -33728,7 +33747,7 @@ ${queuedText}` : queuedText;
|
|
|
33728
33747
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33729
33748
|
if (settings.merged.general.devtools) {
|
|
33730
33749
|
void (async () => {
|
|
33731
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33750
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-J2AC6YXM.js");
|
|
33732
33751
|
await toggleDevToolsPanel(
|
|
33733
33752
|
config,
|
|
33734
33753
|
showErrorDetails,
|
|
@@ -33946,17 +33965,17 @@ ${queuedText}` : queuedText;
|
|
|
33946
33965
|
Date.now()
|
|
33947
33966
|
);
|
|
33948
33967
|
};
|
|
33949
|
-
coreEvents.on(
|
|
33950
|
-
coreEvents.on(
|
|
33968
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
33969
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
33951
33970
|
coreEvents.drainBacklogs();
|
|
33952
33971
|
return () => {
|
|
33953
|
-
coreEvents.off(
|
|
33954
|
-
coreEvents.off(
|
|
33972
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
33973
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
33955
33974
|
};
|
|
33956
33975
|
}, [historyManager]);
|
|
33957
33976
|
const nightly = props.version.includes("nightly");
|
|
33958
33977
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
33959
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
33978
|
+
const loginRestartMessage = settings.merged.security.auth.selectedType === AuthType.USE_VERTEX_AI ? "Authenticating to Vertex AI in Cloud Shell requires a restart to apply project settings." : void 0;
|
|
33960
33979
|
const dialogsVisible = shouldShowIdePrompt || isFolderTrustDialogOpen || isPolicyUpdateDialogOpen || adminSettingsChanged || !!commandConfirmationRequest || !!authConsentRequest || !!permissionConfirmationRequest || !!customDialog || confirmUpdateExtensionRequests.length > 0 || !!loopDetectionConfirmationRequest || isThemeDialogOpen || isSettingsDialogOpen || isModelDialogOpen || isVoiceModelDialogOpen || isAgentConfigDialogOpen || isPermissionsDialogOpen || isAuthenticating || isAuthDialogOpen || isEditorDialogOpen || showPrivacyNotice || showIdeRestartPrompt || !!proQuotaRequest || !!validationRequest || !!overageMenuRequest || !!emptyWalletRequest || isSessionBrowserOpen || authState === "awaiting_api_key_input" /* AwaitingApiKeyInput */ || isAwaitingLoginRestart || !!newAgents;
|
|
33961
33980
|
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
33962
33981
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
@@ -34056,9 +34075,9 @@ ${queuedText}` : queuedText;
|
|
|
34056
34075
|
const handleMemoryChanged = (result) => {
|
|
34057
34076
|
setGeminiMdFileCount(result.fileCount);
|
|
34058
34077
|
};
|
|
34059
|
-
coreEvents.on(
|
|
34078
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34060
34079
|
return () => {
|
|
34061
|
-
coreEvents.off(
|
|
34080
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34062
34081
|
};
|
|
34063
34082
|
}, []);
|
|
34064
34083
|
(0, import_react121.useEffect)(() => {
|