@google/gemini-cli 0.63.0-preview.0 → 0.64.0-nightly.20261001.gc6bccb7ec
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-EIMVJG2V.js → chunk-2AWGKUBT.js} +1 -1
- package/bundle/{chunk-GRSO6OI3.js → chunk-33M6KTJD.js} +11 -9
- package/bundle/{chunk-2J6RC447.js → chunk-3V7PFNJW.js} +3 -3
- package/bundle/{chunk-NWSCUKK3.js → chunk-5Q2IR4AT.js} +1512 -1317
- package/bundle/{chunk-RXHIISMM.js → chunk-5S3XVXG6.js} +1 -1
- package/bundle/{chunk-R6Q6D3UA.js → chunk-A7EL6FWX.js} +1 -1
- package/bundle/{chunk-UEOEM4H5.js → chunk-AMALQQ3Z.js} +3 -3
- package/bundle/{chunk-EWEUWTBB.js → chunk-CBYMGCHX.js} +75 -60
- package/bundle/{chunk-2NCBQURB.js → chunk-CFKLEVXK.js} +1 -1
- package/bundle/{chunk-RC6VJ6FT.js → chunk-DGM2IXGQ.js} +1 -1
- package/bundle/{chunk-NTWFJ2RF.js → chunk-EUQCH4QF.js} +2 -2
- package/bundle/{chunk-KCB54UJ5.js → chunk-FLYR6TVJ.js} +9279 -16064
- package/bundle/{chunk-H4WLRV6U.js → chunk-FQCPUDNE.js} +2 -2
- package/bundle/{chunk-BVDTRESW.js → chunk-FSELSFI5.js} +1 -1
- package/bundle/{chunk-5VYF5TVF.js → chunk-G4FAHQEH.js} +2 -2
- package/bundle/{chunk-Z5RCAIV5.js → chunk-I5GYMICM.js} +7 -5
- package/bundle/{chunk-JEUVKR2X.js → chunk-IGVQSZBB.js} +3 -3
- package/bundle/{chunk-HBZBBLAV.js → chunk-JMQIN5UZ.js} +1521 -1323
- package/bundle/{chunk-KPPDDNGJ.js → chunk-JW5YA5WN.js} +9 -8
- package/bundle/chunk-KTIX6VY2.js +17446 -0
- package/bundle/{chunk-SNGNFODQ.js → chunk-KUSXLIPR.js} +1 -1
- package/bundle/{chunk-ZDQYLJYN.js → chunk-KVZWFEJY.js} +1 -1
- package/bundle/{chunk-2P4ETAEG.js → chunk-LTM347XQ.js} +1 -1
- package/bundle/chunk-LXT3NLFW.js +118 -0
- package/bundle/chunk-PAWJR2VY.js +1571 -0
- package/bundle/chunk-RVS5CHWO.js +425 -0
- package/bundle/{chunk-B2C7BQ4Z.js → chunk-RW6IRAFG.js} +11 -9
- package/bundle/{chunk-CTL6DZSY.js → chunk-U4667HKR.js} +1 -1
- package/bundle/chunk-WTO5SKFR.js +400730 -0
- package/bundle/chunk-WXSWGEUJ.js +512 -0
- package/bundle/chunk-XKSEOGBW.js +154 -0
- package/bundle/chunk-ZG5IQP2R.js +102953 -0
- package/bundle/{cleanup-EX2L3L3E.js → cleanup-I7CTORMX.js} +2 -2
- package/bundle/{cleanup-IT7XR7KS.js → cleanup-MOFJ6BES.js} +2 -2
- package/bundle/{cleanup-WWLYKZIX.js → cleanup-OAR3IBTA.js} +2 -2
- package/bundle/cleanup-WFLHSVPH.js +32 -0
- package/bundle/{core-GAJB2LOX.js → core-VXMTLS6K.js} +1 -1
- package/bundle/{devtoolsService-TJPENQSW.js → devtoolsService-4QAJJ6WJ.js} +2 -2
- package/bundle/{devtoolsService-S4ZTRGJL.js → devtoolsService-54XKSYYW.js} +4 -3
- package/bundle/{devtoolsService-4YTFHHPN.js → devtoolsService-L6BPP3IA.js} +2 -2
- package/bundle/devtoolsService-LSDQLZ62.js +4359 -0
- package/bundle/{dist-MTMOCTIW.js → dist-BNMP57Q5.js} +1 -1
- package/bundle/{core-D5D4MF5H.js → dist-FJ7DKGAM.js} +1 -1
- package/bundle/dist-U5DFAJ4Y.js +2250 -0
- package/bundle/docs/changelogs/preview.md +54 -65
- package/bundle/{gemini-5T5BS7L7.js → gemini-L553JD26.js} +66 -95
- package/bundle/{gemini-FHORRYHM.js → gemini-LN35PXGR.js} +66 -95
- package/bundle/gemini-VZOPAMKQ.js +17834 -0
- package/bundle/{gemini-UQRS6TBE.js → gemini-W63I3AHM.js} +266 -279
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-WOM6QZHM.js → interactiveCli-2JCDVYVC.js} +26 -23
- package/bundle/{interactiveCli-I5K7O5Z6.js → interactiveCli-KN6ETEWY.js} +26 -23
- package/bundle/{interactiveCli-5YNYZTMK.js → interactiveCli-N7HBJ434.js} +329 -307
- package/bundle/interactiveCli-TX7INBPE.js +34918 -0
- package/bundle/{liteRtServerManager-EH2L2UVH.js → liteRtServerManager-GIDPQRR4.js} +4 -4
- package/bundle/{liteRtServerManager-ZLIHBLZP.js → liteRtServerManager-NK3OA5CI.js} +4 -4
- package/bundle/{liteRtServerManager-3N5KI6YS.js → liteRtServerManager-NSDSBW7B.js} +4 -4
- package/bundle/liteRtServerManager-PKOODTU4.js +65 -0
- package/bundle/{oauth2-provider-TA2KRXWQ.js → oauth2-provider-DE3RVHTQ.js} +1 -1
- package/bundle/{oauth2-provider-5GFYTXFU.js → oauth2-provider-FDRYB63N.js} +38 -72
- package/bundle/{oauth2-provider-NGSH2JQK.js → oauth2-provider-KMACQ2PX.js} +1 -1
- package/bundle/oauth2-provider-UAZAD3AF.js +235 -0
- package/bundle/{start-M3IUNCYH.js → start-5X2H6QGN.js} +6 -6
- package/bundle/{start-MWDNIQUY.js → start-AMYT67DW.js} +6 -6
- package/bundle/{start-CWI6OP6N.js → start-QYGGE4KC.js} +6 -6
- package/bundle/start-WWUBZPNX.js +18 -0
- package/package.json +1 -1
|
@@ -171,10 +171,10 @@ import {
|
|
|
171
171
|
widestLineFromStyledChars,
|
|
172
172
|
wordBreakStyledChars,
|
|
173
173
|
wrapStyledChars
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-ZG5IQP2R.js";
|
|
175
175
|
import {
|
|
176
176
|
require_source
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-KUSXLIPR.js";
|
|
178
178
|
import {
|
|
179
179
|
appEvents
|
|
180
180
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -227,33 +227,37 @@ import {
|
|
|
227
227
|
stripAnsi,
|
|
228
228
|
stripUnsafeCharacters,
|
|
229
229
|
toCodePoints
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-CFKLEVXK.js";
|
|
231
231
|
import {
|
|
232
232
|
handleAutoUpdate,
|
|
233
233
|
isDevelopment,
|
|
234
234
|
relaunchApp,
|
|
235
235
|
setUpdateHandler
|
|
236
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-G4FAHQEH.js";
|
|
237
237
|
import {
|
|
238
238
|
isTodoList,
|
|
239
239
|
mapCoreStatusToDisplayStatus,
|
|
240
240
|
require_react
|
|
241
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-JW5YA5WN.js";
|
|
242
242
|
import {
|
|
243
243
|
registerCleanup,
|
|
244
244
|
removeCleanup,
|
|
245
245
|
runExitCleanup,
|
|
246
246
|
setupTtyCheck
|
|
247
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-5S3XVXG6.js";
|
|
248
248
|
import {
|
|
249
249
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
250
250
|
AGENT_TOOL_NAME,
|
|
251
251
|
ApiKeyUpdatedEvent,
|
|
252
|
+
ApprovalMode,
|
|
252
253
|
AsyncFzf,
|
|
253
254
|
AudioRecorder,
|
|
254
255
|
AuthType,
|
|
255
256
|
ChangeAuthRequestedError,
|
|
257
|
+
CompressionStatus,
|
|
256
258
|
ConversationFinishedEvent,
|
|
259
|
+
CoreEvent,
|
|
260
|
+
CoreToolCallStatus,
|
|
257
261
|
CreditPurchaseClickEvent,
|
|
258
262
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
259
263
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
@@ -275,13 +279,20 @@ import {
|
|
|
275
279
|
GEMMA_4_31B_IT_MODEL,
|
|
276
280
|
GLOB_DISPLAY_NAME,
|
|
277
281
|
GREP_DISPLAY_NAME,
|
|
282
|
+
GeminiCliOperation,
|
|
283
|
+
GeminiEventType,
|
|
278
284
|
GitService,
|
|
279
285
|
IdeClient,
|
|
286
|
+
Kind,
|
|
280
287
|
LS_DISPLAY_NAME,
|
|
281
288
|
LegacyAgentProtocol,
|
|
282
289
|
LlmRole,
|
|
283
290
|
Logger,
|
|
284
291
|
MAX_TOKENS_EXCEEDED_SUGGESTION,
|
|
292
|
+
MCPDiscoveryState,
|
|
293
|
+
MCPServerStatus,
|
|
294
|
+
MessageBusType,
|
|
295
|
+
MessageSenderType,
|
|
285
296
|
ModelNotFoundError,
|
|
286
297
|
ModelSlashCommandEvent,
|
|
287
298
|
OTHER_BLOCKED_MESSAGE,
|
|
@@ -294,6 +305,7 @@ import {
|
|
|
294
305
|
PREVIEW_GEMINI_MODEL,
|
|
295
306
|
PolicyIntegrityManager,
|
|
296
307
|
ProjectIdRequiredError,
|
|
308
|
+
QuestionType,
|
|
297
309
|
READ_FILE_DISPLAY_NAME,
|
|
298
310
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
299
311
|
RECITATION_BLOCKED_MESSAGE,
|
|
@@ -302,16 +314,22 @@ import {
|
|
|
302
314
|
SAFETY_BLOCKED_MESSAGE,
|
|
303
315
|
SHELL_TOOL_NAME,
|
|
304
316
|
Scheduler,
|
|
317
|
+
SessionEndReason,
|
|
318
|
+
SessionStartSource,
|
|
305
319
|
ShellExecutionService,
|
|
306
320
|
SlashCommandStatus,
|
|
307
321
|
Storage,
|
|
322
|
+
SubagentState,
|
|
308
323
|
THINKING_ONLY_COMPRESS_SUGGESTION,
|
|
309
324
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
310
325
|
TOPIC_PARAM_SUMMARY,
|
|
311
326
|
TOPIC_PARAM_TITLE,
|
|
312
327
|
TRUE_EMPTY_RESPONSE_MESSAGE,
|
|
313
328
|
TerminalQuotaError,
|
|
329
|
+
ToolConfirmationOutcome,
|
|
330
|
+
ToolErrorType,
|
|
314
331
|
TranscriptionFactory,
|
|
332
|
+
TrustLevel,
|
|
315
333
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
316
334
|
UPDATE_TOPIC_TOOL_NAME,
|
|
317
335
|
UnauthorizedError,
|
|
@@ -323,6 +341,7 @@ import {
|
|
|
323
341
|
WEB_FETCH_DISPLAY_NAME,
|
|
324
342
|
WEB_SEARCH_DISPLAY_NAME,
|
|
325
343
|
WRITE_FILE_DISPLAY_NAME,
|
|
344
|
+
WarningPriority,
|
|
326
345
|
WhisperModelManager,
|
|
327
346
|
addMCPStatusChangeListener,
|
|
328
347
|
allowEditorTypeInSandbox,
|
|
@@ -430,7 +449,7 @@ import {
|
|
|
430
449
|
validatePlanContent,
|
|
431
450
|
validatePlanPath,
|
|
432
451
|
writeToStdout
|
|
433
|
-
} from "./chunk-
|
|
452
|
+
} from "./chunk-5Q2IR4AT.js";
|
|
434
453
|
import "./chunk-664ZODQF.js";
|
|
435
454
|
import "./chunk-IUUIT4SU.js";
|
|
436
455
|
import "./chunk-L6PII3GR.js";
|
|
@@ -5057,7 +5076,7 @@ function calculateShellMaxLines(options) {
|
|
|
5057
5076
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
5058
5077
|
return maxLinesBasedOnHeight;
|
|
5059
5078
|
}
|
|
5060
|
-
const isExecuting = status ===
|
|
5079
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
5061
5080
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
5062
5081
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
5063
5082
|
}
|
|
@@ -5093,13 +5112,13 @@ var formatToolArgs = (args) => {
|
|
|
5093
5112
|
var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
|
|
5094
5113
|
let headerText;
|
|
5095
5114
|
let headerColor = theme.text.secondary;
|
|
5096
|
-
if (progress.state ===
|
|
5115
|
+
if (progress.state === SubagentState.CANCELLED) {
|
|
5097
5116
|
headerText = `Subagent ${progress.agentName} was cancelled.`;
|
|
5098
5117
|
headerColor = theme.status.warning;
|
|
5099
|
-
} else if (progress.state ===
|
|
5118
|
+
} else if (progress.state === SubagentState.ERROR) {
|
|
5100
5119
|
headerText = `Subagent ${progress.agentName} failed.`;
|
|
5101
5120
|
headerColor = theme.status.error;
|
|
5102
|
-
} else if (progress.state ===
|
|
5121
|
+
} else if (progress.state === SubagentState.COMPLETED) {
|
|
5103
5122
|
headerText = `Subagent ${progress.agentName} completed.`;
|
|
5104
5123
|
headerColor = theme.status.success;
|
|
5105
5124
|
} else {
|
|
@@ -5119,7 +5138,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5119
5138
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color, children: item.content }) })
|
|
5120
5139
|
] }, item.id);
|
|
5121
5140
|
} else if (item.type === "tool_call") {
|
|
5122
|
-
const statusSymbol = item.status ===
|
|
5141
|
+
const statusSymbol = item.status === SubagentState.RUNNING ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(build_default, { type: "dots" }) : item.status === SubagentState.COMPLETED ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === SubagentState.CANCELLED ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
|
|
5123
5142
|
const formattedArgs = item.description || formatToolArgs(item.args);
|
|
5124
5143
|
const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
|
|
5125
5144
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
@@ -5130,7 +5149,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5130
5149
|
{
|
|
5131
5150
|
bold: true,
|
|
5132
5151
|
color: theme.text.primary,
|
|
5133
|
-
strikethrough: item.status ===
|
|
5152
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5134
5153
|
children: item.displayName || item.content
|
|
5135
5154
|
}
|
|
5136
5155
|
),
|
|
@@ -5139,7 +5158,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5139
5158
|
{
|
|
5140
5159
|
color: theme.text.secondary,
|
|
5141
5160
|
wrap: "truncate",
|
|
5142
|
-
strikethrough: item.status ===
|
|
5161
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5143
5162
|
children: displayArgs
|
|
5144
5163
|
}
|
|
5145
5164
|
) })
|
|
@@ -5159,7 +5178,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5159
5178
|
MarkdownDisplay,
|
|
5160
5179
|
{
|
|
5161
5180
|
text: safeJsonToMarkdown(progress.result),
|
|
5162
|
-
isPending: progress.state !==
|
|
5181
|
+
isPending: progress.state !== SubagentState.COMPLETED,
|
|
5163
5182
|
terminalWidth
|
|
5164
5183
|
}
|
|
5165
5184
|
)
|
|
@@ -5514,14 +5533,14 @@ var ToolActionsProvider = (props) => {
|
|
|
5514
5533
|
}
|
|
5515
5534
|
const details = tool.confirmationDetails;
|
|
5516
5535
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
5517
|
-
const cliOutcome = outcome ===
|
|
5536
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
5518
5537
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
5519
5538
|
}
|
|
5520
5539
|
if (tool.correlationId) {
|
|
5521
5540
|
await config.getMessageBus().publish({
|
|
5522
|
-
type:
|
|
5541
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
5523
5542
|
correlationId: tool.correlationId,
|
|
5524
|
-
confirmed: outcome !==
|
|
5543
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
5525
5544
|
requiresUserConfirmation: false,
|
|
5526
5545
|
outcome,
|
|
5527
5546
|
payload
|
|
@@ -5540,7 +5559,7 @@ var ToolActionsProvider = (props) => {
|
|
|
5540
5559
|
);
|
|
5541
5560
|
const cancel = (0, import_react10.useCallback)(
|
|
5542
5561
|
async (callId) => {
|
|
5543
|
-
await confirm(callId,
|
|
5562
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
5544
5563
|
},
|
|
5545
5564
|
[confirm]
|
|
5546
5565
|
);
|
|
@@ -5661,7 +5680,7 @@ var ToolMessage = ({
|
|
|
5661
5680
|
paddingX: 1,
|
|
5662
5681
|
flexDirection: "column",
|
|
5663
5682
|
children: [
|
|
5664
|
-
status ===
|
|
5683
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5665
5684
|
McpProgressIndicator,
|
|
5666
5685
|
{
|
|
5667
5686
|
progress,
|
|
@@ -5678,8 +5697,8 @@ var ToolMessage = ({
|
|
|
5678
5697
|
terminalWidth: safeTerminalWidth,
|
|
5679
5698
|
renderOutputAsMarkdown,
|
|
5680
5699
|
hasFocus: isThisShellFocused2,
|
|
5681
|
-
maxLines: kind ===
|
|
5682
|
-
overflowDirection: kind ===
|
|
5700
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
5701
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
5683
5702
|
}
|
|
5684
5703
|
),
|
|
5685
5704
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -5995,7 +6014,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
|
|
|
5995
6014
|
settings.merged,
|
|
5996
6015
|
process3.cwd()
|
|
5997
6016
|
);
|
|
5998
|
-
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel ===
|
|
6017
|
+
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
|
|
5999
6018
|
return {
|
|
6000
6019
|
currentTrustLevel: explicitTrustLevel,
|
|
6001
6020
|
isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
|
|
@@ -6040,7 +6059,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
|
|
|
6040
6059
|
process3.cwd(),
|
|
6041
6060
|
newConfig
|
|
6042
6061
|
);
|
|
6043
|
-
if (trustLevel ===
|
|
6062
|
+
if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
|
|
6044
6063
|
let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
|
|
6045
6064
|
if (source === "file") {
|
|
6046
6065
|
message = "Note: This folder is still trusted because a parent folder is trusted.";
|
|
@@ -6114,18 +6133,18 @@ function PermissionsModifyTrustDialog({
|
|
|
6114
6133
|
const TRUST_LEVEL_ITEMS = [
|
|
6115
6134
|
{
|
|
6116
6135
|
label: `Trust this folder (${dirName})`,
|
|
6117
|
-
value:
|
|
6118
|
-
key:
|
|
6136
|
+
value: TrustLevel.TRUST_FOLDER,
|
|
6137
|
+
key: TrustLevel.TRUST_FOLDER
|
|
6119
6138
|
},
|
|
6120
6139
|
{
|
|
6121
6140
|
label: `Trust parent folder (${parentFolder})`,
|
|
6122
|
-
value:
|
|
6123
|
-
key:
|
|
6141
|
+
value: TrustLevel.TRUST_PARENT,
|
|
6142
|
+
key: TrustLevel.TRUST_PARENT
|
|
6124
6143
|
},
|
|
6125
6144
|
{
|
|
6126
6145
|
label: "Don't trust",
|
|
6127
|
-
value:
|
|
6128
|
-
key:
|
|
6146
|
+
value: TrustLevel.DO_NOT_TRUST,
|
|
6147
|
+
key: TrustLevel.DO_NOT_TRUST
|
|
6129
6148
|
}
|
|
6130
6149
|
];
|
|
6131
6150
|
const {
|
|
@@ -6366,7 +6385,7 @@ var ShellToolMessage = ({
|
|
|
6366
6385
|
maxLinesLimit: maxLines
|
|
6367
6386
|
});
|
|
6368
6387
|
import_react15.default.useEffect(() => {
|
|
6369
|
-
const isExecuting = status ===
|
|
6388
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
6370
6389
|
if (isExecuting && ptyId) {
|
|
6371
6390
|
try {
|
|
6372
6391
|
const childWidth = safeTerminalWidth - 4;
|
|
@@ -6580,13 +6599,13 @@ var SubagentGroupDisplay = ({
|
|
|
6580
6599
|
const singleAgent = toolCalls[0].resultDisplay;
|
|
6581
6600
|
if (isSubagentProgress(singleAgent)) {
|
|
6582
6601
|
switch (singleAgent.state) {
|
|
6583
|
-
case
|
|
6602
|
+
case SubagentState.COMPLETED:
|
|
6584
6603
|
headerText = "Agent Completed";
|
|
6585
6604
|
break;
|
|
6586
|
-
case
|
|
6605
|
+
case SubagentState.CANCELLED:
|
|
6587
6606
|
headerText = "Agent Cancelled";
|
|
6588
6607
|
break;
|
|
6589
|
-
case
|
|
6608
|
+
case SubagentState.ERROR:
|
|
6590
6609
|
headerText = "Agent Error";
|
|
6591
6610
|
break;
|
|
6592
6611
|
default:
|
|
@@ -6602,8 +6621,8 @@ var SubagentGroupDisplay = ({
|
|
|
6602
6621
|
for (const tc of toolCalls) {
|
|
6603
6622
|
const progress = tc.resultDisplay;
|
|
6604
6623
|
if (isSubagentProgress(progress)) {
|
|
6605
|
-
if (progress.state ===
|
|
6606
|
-
else if (progress.state ===
|
|
6624
|
+
if (progress.state === SubagentState.COMPLETED) completedCount++;
|
|
6625
|
+
else if (progress.state === SubagentState.RUNNING) runningCount++;
|
|
6607
6626
|
} else {
|
|
6608
6627
|
runningCount++;
|
|
6609
6628
|
}
|
|
@@ -6682,7 +6701,7 @@ var SubagentGroupDisplay = ({
|
|
|
6682
6701
|
if (!isExpanded) {
|
|
6683
6702
|
let content = "Starting...";
|
|
6684
6703
|
let formattedArgs;
|
|
6685
|
-
if (progress.state ===
|
|
6704
|
+
if (progress.state === SubagentState.COMPLETED) {
|
|
6686
6705
|
if (progress.terminateReason && progress.terminateReason !== "GOAL") {
|
|
6687
6706
|
content = `Finished Early (${progress.terminateReason})`;
|
|
6688
6707
|
} else {
|
|
@@ -6696,17 +6715,17 @@ var SubagentGroupDisplay = ({
|
|
|
6696
6715
|
formattedArgs = formatToolArgs(lastActivity.args);
|
|
6697
6716
|
}
|
|
6698
6717
|
}
|
|
6699
|
-
const displayArgs = progress.state ===
|
|
6718
|
+
const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
|
|
6700
6719
|
const renderStatusIcon = () => {
|
|
6701
|
-
const state = progress.state ??
|
|
6720
|
+
const state = progress.state ?? SubagentState.RUNNING;
|
|
6702
6721
|
switch (state) {
|
|
6703
|
-
case
|
|
6722
|
+
case SubagentState.RUNNING:
|
|
6704
6723
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: "!" });
|
|
6705
|
-
case
|
|
6724
|
+
case SubagentState.COMPLETED:
|
|
6706
6725
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.success, children: "\u2713" });
|
|
6707
|
-
case
|
|
6726
|
+
case SubagentState.CANCELLED:
|
|
6708
6727
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
|
|
6709
|
-
case
|
|
6728
|
+
case SubagentState.ERROR:
|
|
6710
6729
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.error, children: "\u2717" });
|
|
6711
6730
|
default:
|
|
6712
6731
|
return checkExhaustive(state);
|
|
@@ -6759,22 +6778,22 @@ var hasPayload = (res) => {
|
|
|
6759
6778
|
function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
6760
6779
|
const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
|
|
6761
6780
|
const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
|
|
6762
|
-
const isAcceptedOrConfirming = status ===
|
|
6781
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
6763
6782
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
6764
6783
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
6765
6784
|
const showDiffStat = !!diff.diffStat;
|
|
6766
6785
|
const description = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
|
|
6767
6786
|
let resultSummary = "";
|
|
6768
6787
|
let resultColor = theme.text.secondary;
|
|
6769
|
-
if (status ===
|
|
6788
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
6770
6789
|
resultSummary = "Confirming";
|
|
6771
|
-
} else if (status ===
|
|
6790
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
6772
6791
|
resultSummary = "Accepted";
|
|
6773
6792
|
resultColor = theme.text.accent;
|
|
6774
|
-
} else if (status ===
|
|
6793
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
6775
6794
|
resultSummary = "Rejected";
|
|
6776
6795
|
resultColor = theme.status.error;
|
|
6777
|
-
} else if (status ===
|
|
6796
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
6778
6797
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
6779
6798
|
resultColor = theme.status.error;
|
|
6780
6799
|
}
|
|
@@ -6805,7 +6824,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
|
|
|
6805
6824
|
filename: diff.fileName,
|
|
6806
6825
|
terminalWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
|
|
6807
6826
|
availableTerminalHeight,
|
|
6808
|
-
disableColor: status ===
|
|
6827
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6809
6828
|
}
|
|
6810
6829
|
);
|
|
6811
6830
|
return { description, summary, payload };
|
|
@@ -6933,10 +6952,10 @@ var DenseToolMessage = (props) => {
|
|
|
6933
6952
|
if (isGrepResult(resultDisplay)) {
|
|
6934
6953
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
6935
6954
|
}
|
|
6936
|
-
if (status ===
|
|
6955
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
6937
6956
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
6938
6957
|
}
|
|
6939
|
-
if (status ===
|
|
6958
|
+
if (status === CoreToolCallStatus.Error) {
|
|
6940
6959
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
6941
6960
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
6942
6961
|
"\u2192 ",
|
|
@@ -6977,7 +6996,7 @@ var DenseToolMessage = (props) => {
|
|
|
6977
6996
|
language: fileExtension,
|
|
6978
6997
|
maxWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
|
|
6979
6998
|
settings,
|
|
6980
|
-
disableColor: status ===
|
|
6999
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
6981
7000
|
returnLines: true
|
|
6982
7001
|
});
|
|
6983
7002
|
} else {
|
|
@@ -6985,7 +7004,7 @@ var DenseToolMessage = (props) => {
|
|
|
6985
7004
|
parsedLines,
|
|
6986
7005
|
filename: diff.fileName,
|
|
6987
7006
|
terminalWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
|
|
6988
|
-
disableColor: status ===
|
|
7007
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6989
7008
|
});
|
|
6990
7009
|
}
|
|
6991
7010
|
}, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
|
|
@@ -7122,7 +7141,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7122
7141
|
return pendingHistoryItems.some((item) => {
|
|
7123
7142
|
if (item && item.type === "tool_group") {
|
|
7124
7143
|
return item.tools.some(
|
|
7125
|
-
(tool) =>
|
|
7144
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
7126
7145
|
);
|
|
7127
7146
|
}
|
|
7128
7147
|
return false;
|
|
@@ -7131,7 +7150,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7131
7150
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
7132
7151
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
7133
7152
|
(item) => item.tools.some(
|
|
7134
|
-
(tool) =>
|
|
7153
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
7135
7154
|
)
|
|
7136
7155
|
);
|
|
7137
7156
|
}
|
|
@@ -7219,7 +7238,7 @@ var ToolGroupMessage = ({
|
|
|
7219
7238
|
const groupedTools = (0, import_react19.useMemo)(() => {
|
|
7220
7239
|
const groups = [];
|
|
7221
7240
|
for (const tool of visibleToolCalls) {
|
|
7222
|
-
if (tool.kind ===
|
|
7241
|
+
if (tool.kind === Kind.Agent) {
|
|
7223
7242
|
const lastGroup = groups[groups.length - 1];
|
|
7224
7243
|
if (Array.isArray(lastGroup)) {
|
|
7225
7244
|
lastGroup.push(tool);
|
|
@@ -7274,7 +7293,7 @@ var ToolGroupMessage = ({
|
|
|
7274
7293
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
7275
7294
|
let countToolCallsWithResults = 0;
|
|
7276
7295
|
for (const tool of visibleToolCalls) {
|
|
7277
|
-
if (tool.kind !==
|
|
7296
|
+
if (tool.kind !== Kind.Agent) {
|
|
7278
7297
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
7279
7298
|
if (hasDensePayload(tool)) {
|
|
7280
7299
|
countToolCallsWithResults++;
|
|
@@ -7465,7 +7484,7 @@ var ToolGroupDisplay = ({
|
|
|
7465
7484
|
}
|
|
7466
7485
|
const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
|
|
7467
7486
|
const visibleTools = tools.filter(
|
|
7468
|
-
(t) => t.status !==
|
|
7487
|
+
(t) => t.status !== CoreToolCallStatus.AwaitingApproval
|
|
7469
7488
|
);
|
|
7470
7489
|
const noticeTools = visibleTools.filter((t) => t.format === "notice");
|
|
7471
7490
|
const otherTools = visibleTools.filter(
|
|
@@ -7667,18 +7686,18 @@ function CompressionMessage({
|
|
|
7667
7686
|
return "Compressing chat history";
|
|
7668
7687
|
}
|
|
7669
7688
|
switch (compressionStatus) {
|
|
7670
|
-
case
|
|
7689
|
+
case CompressionStatus.COMPRESSED:
|
|
7671
7690
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
7672
|
-
case
|
|
7691
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
7673
7692
|
if (originalTokens < 5e4) {
|
|
7674
7693
|
return "Compression was not beneficial for this history size.";
|
|
7675
7694
|
}
|
|
7676
7695
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
7677
|
-
case
|
|
7696
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
7678
7697
|
return "Could not compress chat history due to a token counting error.";
|
|
7679
|
-
case
|
|
7698
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
7680
7699
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
7681
|
-
case
|
|
7700
|
+
case CompressionStatus.NOOP:
|
|
7682
7701
|
return "Nothing to compress.";
|
|
7683
7702
|
default:
|
|
7684
7703
|
return "";
|
|
@@ -8116,8 +8135,8 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8116
8135
|
);
|
|
8117
8136
|
roleEntries.sort(([a], [b]) => {
|
|
8118
8137
|
if (a === b) return 0;
|
|
8119
|
-
if (a ===
|
|
8120
|
-
if (b ===
|
|
8138
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8139
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8121
8140
|
return a.localeCompare(b);
|
|
8122
8141
|
});
|
|
8123
8142
|
roleEntries.forEach(([role, roleMetrics]) => {
|
|
@@ -8448,8 +8467,8 @@ var ModelStatsDisplay = ({
|
|
|
8448
8467
|
return validRoles.includes(role);
|
|
8449
8468
|
}).sort((a, b) => {
|
|
8450
8469
|
if (a === b) return 0;
|
|
8451
|
-
if (a ===
|
|
8452
|
-
if (b ===
|
|
8470
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8471
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8453
8472
|
return a.localeCompare(b);
|
|
8454
8473
|
});
|
|
8455
8474
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -9240,7 +9259,7 @@ var McpStatus = ({
|
|
|
9240
9259
|
);
|
|
9241
9260
|
const originalStatus = serverStatus(serverName);
|
|
9242
9261
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
9243
|
-
const status = originalStatus ===
|
|
9262
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
9244
9263
|
let statusIndicator = "";
|
|
9245
9264
|
let statusText = "";
|
|
9246
9265
|
let statusColor = theme.text.primary;
|
|
@@ -9252,17 +9271,17 @@ var McpStatus = ({
|
|
|
9252
9271
|
statusColor = theme.text.secondary;
|
|
9253
9272
|
} else {
|
|
9254
9273
|
switch (status) {
|
|
9255
|
-
case
|
|
9274
|
+
case MCPServerStatus.CONNECTED:
|
|
9256
9275
|
statusIndicator = "\u{1F7E2}";
|
|
9257
9276
|
statusText = "Ready";
|
|
9258
9277
|
statusColor = theme.status.success;
|
|
9259
9278
|
break;
|
|
9260
|
-
case
|
|
9279
|
+
case MCPServerStatus.CONNECTING:
|
|
9261
9280
|
statusIndicator = "\u{1F504}";
|
|
9262
9281
|
statusText = "Starting... (first startup may take longer)";
|
|
9263
9282
|
statusColor = theme.status.warning;
|
|
9264
9283
|
break;
|
|
9265
|
-
case
|
|
9284
|
+
case MCPServerStatus.DISCONNECTED:
|
|
9266
9285
|
default:
|
|
9267
9286
|
statusIndicator = "\u{1F534}";
|
|
9268
9287
|
statusText = "Disconnected";
|
|
@@ -9310,12 +9329,12 @@ var McpStatus = ({
|
|
|
9310
9329
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Text, { children: [
|
|
9311
9330
|
" - ",
|
|
9312
9331
|
statusText,
|
|
9313
|
-
status ===
|
|
9332
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
9314
9333
|
] }),
|
|
9315
9334
|
authStatusNode
|
|
9316
9335
|
] }),
|
|
9317
|
-
status ===
|
|
9318
|
-
status ===
|
|
9336
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
9337
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Text, { children: [
|
|
9319
9338
|
" (",
|
|
9320
9339
|
toolCount,
|
|
9321
9340
|
" tools cached)"
|
|
@@ -9876,7 +9895,7 @@ var Notifications = () => {
|
|
|
9876
9895
|
if (dismissed) return [];
|
|
9877
9896
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
9878
9897
|
return startupWarnings.filter((w) => {
|
|
9879
|
-
if (w.priority ===
|
|
9898
|
+
if (w.priority === WarningPriority.Low) {
|
|
9880
9899
|
const count = counts[w.id] || 0;
|
|
9881
9900
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
9882
9901
|
}
|
|
@@ -9889,7 +9908,7 @@ var Notifications = () => {
|
|
|
9889
9908
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
9890
9909
|
let changed = false;
|
|
9891
9910
|
visibleWarnings.forEach((w) => {
|
|
9892
|
-
if (w.priority ===
|
|
9911
|
+
if (w.priority === WarningPriority.Low) {
|
|
9893
9912
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
9894
9913
|
changed = true;
|
|
9895
9914
|
}
|
|
@@ -9996,7 +10015,7 @@ var UserIdentity = ({ config }) => {
|
|
|
9996
10015
|
}
|
|
9997
10016
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
9998
10017
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Box_default, { children: [
|
|
9999
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
10018
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Text, { children: [
|
|
10000
10019
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Text, { bold: true, children: [
|
|
10001
10020
|
"Signed in with Google",
|
|
10002
10021
|
email ? ":" : ""
|
|
@@ -10239,7 +10258,7 @@ var import_react30 = __toESM(require_react(), 1);
|
|
|
10239
10258
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
10240
10259
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
10241
10260
|
const confirmingTools = allPendingTools.filter(
|
|
10242
|
-
(tool) => tool.status ===
|
|
10261
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
10243
10262
|
);
|
|
10244
10263
|
if (confirmingTools.length === 0) {
|
|
10245
10264
|
return null;
|
|
@@ -11548,7 +11567,7 @@ var ExitPlanModeDialog = ({
|
|
|
11548
11567
|
{
|
|
11549
11568
|
questions: [
|
|
11550
11569
|
{
|
|
11551
|
-
type:
|
|
11570
|
+
type: QuestionType.CHOICE,
|
|
11552
11571
|
header: "Approval",
|
|
11553
11572
|
question: planContent,
|
|
11554
11573
|
options: [
|
|
@@ -11569,9 +11588,9 @@ var ExitPlanModeDialog = ({
|
|
|
11569
11588
|
onSubmit: (answers) => {
|
|
11570
11589
|
const answer = answers["0"];
|
|
11571
11590
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
11572
|
-
onApprove(
|
|
11591
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
11573
11592
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
11574
|
-
onApprove(
|
|
11593
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
11575
11594
|
} else if (answer) {
|
|
11576
11595
|
onFeedback(answer);
|
|
11577
11596
|
}
|
|
@@ -11783,7 +11802,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11783
11802
|
);
|
|
11784
11803
|
(0, import_react35.useEffect)(() => {
|
|
11785
11804
|
if (isCancelling) {
|
|
11786
|
-
handleConfirm(
|
|
11805
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
11787
11806
|
}
|
|
11788
11807
|
}, [isCancelling, handleConfirm]);
|
|
11789
11808
|
const handleSelect = (0, import_react35.useCallback)(
|
|
@@ -11796,19 +11815,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
11796
11815
|
if (!confirmationDetails.isModifying) {
|
|
11797
11816
|
options2.push({
|
|
11798
11817
|
label: "Allow once",
|
|
11799
|
-
value:
|
|
11818
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11800
11819
|
key: "Allow once"
|
|
11801
11820
|
});
|
|
11802
11821
|
if (isTrustedFolder && !confirmationDetails.isBuildFile) {
|
|
11803
11822
|
options2.push({
|
|
11804
11823
|
label: "Allow for this session",
|
|
11805
|
-
value:
|
|
11824
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11806
11825
|
key: "Allow for this session"
|
|
11807
11826
|
});
|
|
11808
11827
|
if (allowPermanentApproval) {
|
|
11809
11828
|
options2.push({
|
|
11810
11829
|
label: "Allow for this file in all future sessions",
|
|
11811
|
-
value:
|
|
11830
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11812
11831
|
key: "Allow for this file in all future sessions"
|
|
11813
11832
|
});
|
|
11814
11833
|
}
|
|
@@ -11816,45 +11835,45 @@ ${deceptiveUrlWarnings.map(
|
|
|
11816
11835
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
11817
11836
|
options2.push({
|
|
11818
11837
|
label: "Modify with external editor",
|
|
11819
|
-
value:
|
|
11838
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
11820
11839
|
key: "Modify with external editor"
|
|
11821
11840
|
});
|
|
11822
11841
|
}
|
|
11823
11842
|
options2.push({
|
|
11824
11843
|
label: "No, suggest changes (esc)",
|
|
11825
|
-
value:
|
|
11844
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11826
11845
|
key: "No, suggest changes (esc)"
|
|
11827
11846
|
});
|
|
11828
11847
|
}
|
|
11829
11848
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
11830
11849
|
options2.push({
|
|
11831
11850
|
label: "Allow once",
|
|
11832
|
-
value:
|
|
11851
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11833
11852
|
key: "Allow once"
|
|
11834
11853
|
});
|
|
11835
11854
|
if (isTrustedFolder) {
|
|
11836
11855
|
options2.push({
|
|
11837
11856
|
label: "Allow for this session",
|
|
11838
|
-
value:
|
|
11857
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11839
11858
|
key: "Allow for this session"
|
|
11840
11859
|
});
|
|
11841
11860
|
if (allowPermanentApproval) {
|
|
11842
11861
|
options2.push({
|
|
11843
11862
|
label: "Allow for all future sessions",
|
|
11844
|
-
value:
|
|
11863
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11845
11864
|
key: "Allow for all future sessions"
|
|
11846
11865
|
});
|
|
11847
11866
|
}
|
|
11848
11867
|
}
|
|
11849
11868
|
options2.push({
|
|
11850
11869
|
label: "No, suggest changes (esc)",
|
|
11851
|
-
value:
|
|
11870
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11852
11871
|
key: "No, suggest changes (esc)"
|
|
11853
11872
|
});
|
|
11854
11873
|
} else if (confirmationDetails.type === "exec") {
|
|
11855
11874
|
options2.push({
|
|
11856
11875
|
label: "Allow once",
|
|
11857
|
-
value:
|
|
11876
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11858
11877
|
key: "Allow once"
|
|
11859
11878
|
});
|
|
11860
11879
|
const hasUntrustedFlags = confirmationDetails.untrustedFlags && confirmationDetails.untrustedFlags.length > 0;
|
|
@@ -11862,75 +11881,75 @@ ${deceptiveUrlWarnings.map(
|
|
|
11862
11881
|
if (isTrustedFolder && !hasUntrustedFlags && !hasModifiedBuildFiles) {
|
|
11863
11882
|
options2.push({
|
|
11864
11883
|
label: `Allow for this session`,
|
|
11865
|
-
value:
|
|
11884
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11866
11885
|
key: `Allow for this session`
|
|
11867
11886
|
});
|
|
11868
11887
|
if (allowPermanentApproval) {
|
|
11869
11888
|
options2.push({
|
|
11870
11889
|
label: `Allow this command for all future sessions`,
|
|
11871
|
-
value:
|
|
11890
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11872
11891
|
key: `Allow for all future sessions`
|
|
11873
11892
|
});
|
|
11874
11893
|
}
|
|
11875
11894
|
}
|
|
11876
11895
|
options2.push({
|
|
11877
11896
|
label: "No, suggest changes (esc)",
|
|
11878
|
-
value:
|
|
11897
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11879
11898
|
key: "No, suggest changes (esc)"
|
|
11880
11899
|
});
|
|
11881
11900
|
} else if (confirmationDetails.type === "info") {
|
|
11882
11901
|
options2.push({
|
|
11883
11902
|
label: "Allow once",
|
|
11884
|
-
value:
|
|
11903
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11885
11904
|
key: "Allow once"
|
|
11886
11905
|
});
|
|
11887
11906
|
if (isTrustedFolder) {
|
|
11888
11907
|
options2.push({
|
|
11889
11908
|
label: "Allow for this session",
|
|
11890
|
-
value:
|
|
11909
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11891
11910
|
key: "Allow for this session"
|
|
11892
11911
|
});
|
|
11893
11912
|
if (allowPermanentApproval) {
|
|
11894
11913
|
options2.push({
|
|
11895
11914
|
label: "Allow for all future sessions",
|
|
11896
|
-
value:
|
|
11915
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11897
11916
|
key: "Allow for all future sessions"
|
|
11898
11917
|
});
|
|
11899
11918
|
}
|
|
11900
11919
|
}
|
|
11901
11920
|
options2.push({
|
|
11902
11921
|
label: "No, suggest changes (esc)",
|
|
11903
|
-
value:
|
|
11922
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11904
11923
|
key: "No, suggest changes (esc)"
|
|
11905
11924
|
});
|
|
11906
11925
|
} else if (confirmationDetails.type === "mcp") {
|
|
11907
11926
|
options2.push({
|
|
11908
11927
|
label: "Allow once",
|
|
11909
|
-
value:
|
|
11928
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11910
11929
|
key: "Allow once"
|
|
11911
11930
|
});
|
|
11912
11931
|
if (isTrustedFolder) {
|
|
11913
11932
|
options2.push({
|
|
11914
11933
|
label: "Allow tool for this session",
|
|
11915
|
-
value:
|
|
11934
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
11916
11935
|
key: "Allow tool for this session"
|
|
11917
11936
|
});
|
|
11918
11937
|
options2.push({
|
|
11919
11938
|
label: "Allow all server tools for this session",
|
|
11920
|
-
value:
|
|
11939
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
11921
11940
|
key: "Allow all server tools for this session"
|
|
11922
11941
|
});
|
|
11923
11942
|
if (allowPermanentApproval) {
|
|
11924
11943
|
options2.push({
|
|
11925
11944
|
label: "Allow tool for all future sessions",
|
|
11926
|
-
value:
|
|
11945
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11927
11946
|
key: "Allow tool for all future sessions"
|
|
11928
11947
|
});
|
|
11929
11948
|
}
|
|
11930
11949
|
}
|
|
11931
11950
|
options2.push({
|
|
11932
11951
|
label: "No, suggest changes (esc)",
|
|
11933
|
-
value:
|
|
11952
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11934
11953
|
key: "No, suggest changes (esc)"
|
|
11935
11954
|
});
|
|
11936
11955
|
}
|
|
@@ -11971,7 +11990,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11971
11990
|
const containsRedirection = commandsToDisplay.some(
|
|
11972
11991
|
(cmd) => hasRedirection(cmd)
|
|
11973
11992
|
);
|
|
11974
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
11993
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
11975
11994
|
if (containsRedirection && !isAutoEdit) {
|
|
11976
11995
|
extraInfoLines = 1;
|
|
11977
11996
|
}
|
|
@@ -11998,7 +12017,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11998
12017
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
11999
12018
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
12000
12019
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
12001
|
-
(o) => o.value ===
|
|
12020
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
12002
12021
|
);
|
|
12003
12022
|
if (alwaysAndSaveIndex !== -1) {
|
|
12004
12023
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -12047,10 +12066,10 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12047
12066
|
{
|
|
12048
12067
|
questions: confirmationDetails.questions,
|
|
12049
12068
|
onSubmit: (answers) => {
|
|
12050
|
-
handleConfirm(
|
|
12069
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
12051
12070
|
},
|
|
12052
12071
|
onCancel: () => {
|
|
12053
|
-
handleConfirm(
|
|
12072
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12054
12073
|
},
|
|
12055
12074
|
width: safeTerminalWidth,
|
|
12056
12075
|
availableHeight: bodyHeight
|
|
@@ -12071,19 +12090,19 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12071
12090
|
planPath: confirmationDetails.planPath,
|
|
12072
12091
|
getPreferredEditor,
|
|
12073
12092
|
onApprove: (approvalMode) => {
|
|
12074
|
-
handleConfirm(
|
|
12093
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12075
12094
|
approved: true,
|
|
12076
12095
|
approvalMode
|
|
12077
12096
|
});
|
|
12078
12097
|
},
|
|
12079
12098
|
onFeedback: (feedback) => {
|
|
12080
|
-
handleConfirm(
|
|
12099
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12081
12100
|
approved: false,
|
|
12082
12101
|
feedback
|
|
12083
12102
|
});
|
|
12084
12103
|
},
|
|
12085
12104
|
onCancel: () => {
|
|
12086
|
-
handleConfirm(
|
|
12105
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12087
12106
|
},
|
|
12088
12107
|
width: safeTerminalWidth,
|
|
12089
12108
|
availableHeight: bodyHeight
|
|
@@ -12193,7 +12212,7 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12193
12212
|
const containsRedirection = commandsToDisplay.some(
|
|
12194
12213
|
(cmd) => hasRedirection(cmd)
|
|
12195
12214
|
);
|
|
12196
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12215
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12197
12216
|
let warnings = null;
|
|
12198
12217
|
if (containsRedirection && !isAutoEdit) {
|
|
12199
12218
|
const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
|
|
@@ -12352,7 +12371,7 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12352
12371
|
const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
|
|
12353
12372
|
const renderRadioItem = (0, import_react35.useCallback)(
|
|
12354
12373
|
(item, { titleColor }) => {
|
|
12355
|
-
if (item.value ===
|
|
12374
|
+
if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
12356
12375
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
|
|
12357
12376
|
item.label,
|
|
12358
12377
|
" ",
|
|
@@ -14397,7 +14416,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
|
|
|
14397
14416
|
if (settings.merged.security.auth.useExternal) {
|
|
14398
14417
|
return null;
|
|
14399
14418
|
}
|
|
14400
|
-
if (authType ===
|
|
14419
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14401
14420
|
return null;
|
|
14402
14421
|
}
|
|
14403
14422
|
return validateAuthMethod(authType);
|
|
@@ -14449,7 +14468,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
14449
14468
|
}
|
|
14450
14469
|
return;
|
|
14451
14470
|
}
|
|
14452
|
-
if (authType ===
|
|
14471
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14453
14472
|
const key = await reloadApiKey();
|
|
14454
14473
|
if (!key) {
|
|
14455
14474
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -14527,31 +14546,31 @@ function AuthDialog({
|
|
|
14527
14546
|
let items = [
|
|
14528
14547
|
{
|
|
14529
14548
|
label: "Sign in with Google",
|
|
14530
|
-
value:
|
|
14531
|
-
key:
|
|
14549
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
14550
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
14532
14551
|
},
|
|
14533
14552
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
14534
14553
|
{
|
|
14535
14554
|
label: "Use Cloud Shell user credentials",
|
|
14536
|
-
value:
|
|
14537
|
-
key:
|
|
14555
|
+
value: AuthType.COMPUTE_ADC,
|
|
14556
|
+
key: AuthType.COMPUTE_ADC
|
|
14538
14557
|
}
|
|
14539
14558
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
14540
14559
|
{
|
|
14541
14560
|
label: "Use metadata server application default credentials",
|
|
14542
|
-
value:
|
|
14543
|
-
key:
|
|
14561
|
+
value: AuthType.COMPUTE_ADC,
|
|
14562
|
+
key: AuthType.COMPUTE_ADC
|
|
14544
14563
|
}
|
|
14545
14564
|
] : [],
|
|
14546
14565
|
{
|
|
14547
14566
|
label: "Use Gemini API Key",
|
|
14548
|
-
value:
|
|
14549
|
-
key:
|
|
14567
|
+
value: AuthType.USE_GEMINI,
|
|
14568
|
+
key: AuthType.USE_GEMINI
|
|
14550
14569
|
},
|
|
14551
14570
|
{
|
|
14552
14571
|
label: "Vertex AI",
|
|
14553
|
-
value:
|
|
14554
|
-
key:
|
|
14572
|
+
value: AuthType.USE_VERTEX_AI,
|
|
14573
|
+
key: AuthType.USE_VERTEX_AI
|
|
14555
14574
|
}
|
|
14556
14575
|
];
|
|
14557
14576
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -14573,9 +14592,9 @@ function AuthDialog({
|
|
|
14573
14592
|
return item.value === defaultAuthType;
|
|
14574
14593
|
}
|
|
14575
14594
|
if (process.env["GEMINI_API_KEY"]) {
|
|
14576
|
-
return item.value ===
|
|
14595
|
+
return item.value === AuthType.USE_GEMINI;
|
|
14577
14596
|
}
|
|
14578
|
-
return item.value ===
|
|
14597
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
14579
14598
|
});
|
|
14580
14599
|
if (settings.merged.security.auth.enforcedType) {
|
|
14581
14600
|
initialAuthIndex = 0;
|
|
@@ -14586,7 +14605,7 @@ function AuthDialog({
|
|
|
14586
14605
|
return;
|
|
14587
14606
|
}
|
|
14588
14607
|
if (authType) {
|
|
14589
|
-
const needsRestart = authType ===
|
|
14608
|
+
const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
|
|
14590
14609
|
if (needsRestart) {
|
|
14591
14610
|
setAuthContext({ requiresRestart: true });
|
|
14592
14611
|
} else {
|
|
@@ -14597,7 +14616,7 @@ function AuthDialog({
|
|
|
14597
14616
|
await clearCachedCredentialFile();
|
|
14598
14617
|
}
|
|
14599
14618
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
14600
|
-
if (authType ===
|
|
14619
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
14601
14620
|
setExiting(true);
|
|
14602
14621
|
setTimeout(() => {
|
|
14603
14622
|
void relaunchApp({ overrideAuthType: authType }).catch((err) => {
|
|
@@ -14607,7 +14626,7 @@ function AuthDialog({
|
|
|
14607
14626
|
}, 100);
|
|
14608
14627
|
return;
|
|
14609
14628
|
}
|
|
14610
|
-
if (authType ===
|
|
14629
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14611
14630
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
14612
14631
|
return;
|
|
14613
14632
|
}
|
|
@@ -15414,11 +15433,11 @@ var PrivacyNoticeText = ({
|
|
|
15414
15433
|
}) => {
|
|
15415
15434
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15416
15435
|
switch (authType) {
|
|
15417
|
-
case
|
|
15436
|
+
case AuthType.USE_GEMINI:
|
|
15418
15437
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15419
|
-
case
|
|
15438
|
+
case AuthType.USE_VERTEX_AI:
|
|
15420
15439
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15421
|
-
case
|
|
15440
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15422
15441
|
default:
|
|
15423
15442
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15424
15443
|
}
|
|
@@ -15478,7 +15497,7 @@ function ProQuotaDialog({
|
|
|
15478
15497
|
value: "retry_always",
|
|
15479
15498
|
key: "retry_always"
|
|
15480
15499
|
},
|
|
15481
|
-
...authType ===
|
|
15500
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15482
15501
|
{
|
|
15483
15502
|
label: "Upgrade for higher limits",
|
|
15484
15503
|
value: "upgrade",
|
|
@@ -16645,7 +16664,7 @@ function ModelDialog({ onClose }) {
|
|
|
16645
16664
|
const useLatestFlash = config?.hasLatestFlashGAAccess?.() ?? false;
|
|
16646
16665
|
const useLatestFlashLite = config?.hasLatestFlashLiteGAAccess?.() ?? false;
|
|
16647
16666
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16648
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16667
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16649
16668
|
const manualModelSelected = (0, import_react53.useMemo)(() => {
|
|
16650
16669
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16651
16670
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -17973,10 +17992,10 @@ function initializeConsoleStore() {
|
|
|
17973
17992
|
globalConsoleMessages = [];
|
|
17974
17993
|
globalErrorCount = 0;
|
|
17975
17994
|
notifyListeners();
|
|
17976
|
-
coreEvents.off(
|
|
17977
|
-
coreEvents.off(
|
|
17978
|
-
coreEvents.on(
|
|
17979
|
-
coreEvents.on(
|
|
17995
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
17996
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
17997
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
17998
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
17980
17999
|
}
|
|
17981
18000
|
function notifyListeners() {
|
|
17982
18001
|
for (const listener of listeners) {
|
|
@@ -20113,7 +20132,7 @@ function usePromptCompletion({
|
|
|
20113
20132
|
{ model: "prompt-completion" },
|
|
20114
20133
|
contents,
|
|
20115
20134
|
signal,
|
|
20116
|
-
|
|
20135
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20117
20136
|
);
|
|
20118
20137
|
if (signal.aborted) {
|
|
20119
20138
|
return;
|
|
@@ -22185,9 +22204,9 @@ var InputPrompt = ({
|
|
|
22185
22204
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22186
22205
|
}
|
|
22187
22206
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22188
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22189
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22190
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22207
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22208
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22209
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22191
22210
|
let statusColor;
|
|
22192
22211
|
let statusText = "";
|
|
22193
22212
|
if (shellModeActive) {
|
|
@@ -23021,22 +23040,22 @@ var ApprovalModeIndicator = ({
|
|
|
23021
23040
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
23022
23041
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
23023
23042
|
switch (approvalMode) {
|
|
23024
|
-
case
|
|
23043
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23025
23044
|
textColor = theme.status.warning;
|
|
23026
23045
|
textContent = "auto-accept edits";
|
|
23027
23046
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23028
23047
|
break;
|
|
23029
|
-
case
|
|
23048
|
+
case ApprovalMode.PLAN:
|
|
23030
23049
|
textColor = theme.status.success;
|
|
23031
23050
|
textContent = "plan";
|
|
23032
23051
|
subText = `${cycleHint} to manual`;
|
|
23033
23052
|
break;
|
|
23034
|
-
case
|
|
23053
|
+
case ApprovalMode.YOLO:
|
|
23035
23054
|
textColor = theme.status.error;
|
|
23036
23055
|
textContent = "YOLO";
|
|
23037
23056
|
subText = yoloHint;
|
|
23038
23057
|
break;
|
|
23039
|
-
case
|
|
23058
|
+
case ApprovalMode.DEFAULT:
|
|
23040
23059
|
default:
|
|
23041
23060
|
textColor = theme.text.accent;
|
|
23042
23061
|
textContent = "";
|
|
@@ -23084,7 +23103,7 @@ var useComposerStatus = () => {
|
|
|
23084
23103
|
(item) => item.type === "tool_group"
|
|
23085
23104
|
).some(
|
|
23086
23105
|
(item) => item.tools.some(
|
|
23087
|
-
(tool) => tool.status ===
|
|
23106
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23088
23107
|
)
|
|
23089
23108
|
),
|
|
23090
23109
|
[uiState.pendingHistoryItems]
|
|
@@ -23099,13 +23118,13 @@ var useComposerStatus = () => {
|
|
|
23099
23118
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23100
23119
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23101
23120
|
switch (showApprovalModeIndicator) {
|
|
23102
|
-
case
|
|
23121
|
+
case ApprovalMode.YOLO:
|
|
23103
23122
|
return { text: "YOLO", color: theme.status.error };
|
|
23104
|
-
case
|
|
23123
|
+
case ApprovalMode.PLAN:
|
|
23105
23124
|
return { text: "plan", color: theme.status.success };
|
|
23106
|
-
case
|
|
23125
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23107
23126
|
return { text: "auto edit", color: theme.status.warning };
|
|
23108
|
-
case
|
|
23127
|
+
case ApprovalMode.DEFAULT:
|
|
23109
23128
|
default:
|
|
23110
23129
|
return null;
|
|
23111
23130
|
}
|
|
@@ -23466,7 +23485,7 @@ var ConfigInitDisplay = ({
|
|
|
23466
23485
|
let connected = 0;
|
|
23467
23486
|
const connecting = [];
|
|
23468
23487
|
for (const [name, client] of clients.entries()) {
|
|
23469
|
-
if (client.getStatus() ===
|
|
23488
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23470
23489
|
connected++;
|
|
23471
23490
|
} else {
|
|
23472
23491
|
connecting.push(name);
|
|
@@ -23488,9 +23507,9 @@ var ConfigInitDisplay = ({
|
|
|
23488
23507
|
);
|
|
23489
23508
|
}
|
|
23490
23509
|
};
|
|
23491
|
-
coreEvents.on(
|
|
23510
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23492
23511
|
return () => {
|
|
23493
|
-
coreEvents.off(
|
|
23512
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23494
23513
|
};
|
|
23495
23514
|
}, [initialMessage]);
|
|
23496
23515
|
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text, { children: [
|
|
@@ -24207,7 +24226,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24207
24226
|
callId,
|
|
24208
24227
|
name: SHELL_COMMAND_NAME,
|
|
24209
24228
|
description: rawQuery,
|
|
24210
|
-
status:
|
|
24229
|
+
status: CoreToolCallStatus.Executing,
|
|
24211
24230
|
isClientInitiated: true,
|
|
24212
24231
|
resultDisplay: "",
|
|
24213
24232
|
confirmationDetails: void 0
|
|
@@ -24348,7 +24367,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24348
24367
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24349
24368
|
}
|
|
24350
24369
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24351
|
-
let finalStatus =
|
|
24370
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24352
24371
|
const prependToAnsiOutput = (output, text) => {
|
|
24353
24372
|
const newLines = text.split("\n").map((line) => [
|
|
24354
24373
|
{
|
|
@@ -24367,20 +24386,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24367
24386
|
};
|
|
24368
24387
|
let prefix = "";
|
|
24369
24388
|
if (result.error) {
|
|
24370
|
-
finalStatus =
|
|
24389
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24371
24390
|
prefix = result.error.message;
|
|
24372
24391
|
} else if (result.aborted) {
|
|
24373
|
-
finalStatus =
|
|
24392
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24374
24393
|
prefix = "Command was cancelled.";
|
|
24375
24394
|
} else if (result.backgrounded) {
|
|
24376
|
-
finalStatus =
|
|
24395
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24377
24396
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24378
24397
|
mainContent = finalOutput;
|
|
24379
24398
|
} else if (result.signal) {
|
|
24380
|
-
finalStatus =
|
|
24399
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24381
24400
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24382
24401
|
} else if (result.exitCode !== 0) {
|
|
24383
|
-
finalStatus =
|
|
24402
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24384
24403
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24385
24404
|
}
|
|
24386
24405
|
if (prefix) {
|
|
@@ -24406,7 +24425,7 @@ ${mainContent}`;
|
|
|
24406
24425
|
status: finalStatus,
|
|
24407
24426
|
resultDisplay: finalOutput
|
|
24408
24427
|
};
|
|
24409
|
-
if (finalStatus !==
|
|
24428
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24410
24429
|
addItemToHistory(
|
|
24411
24430
|
{
|
|
24412
24431
|
type: "tool_group",
|
|
@@ -25416,13 +25435,13 @@ function useQuotaAndFallback({
|
|
|
25416
25435
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25417
25436
|
`/stats model for usage details`,
|
|
25418
25437
|
`/model to switch models.`,
|
|
25419
|
-
contentGeneratorConfig?.authType ===
|
|
25438
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25420
25439
|
].filter(Boolean);
|
|
25421
25440
|
message = messageLines.join("\n");
|
|
25422
25441
|
}
|
|
25423
25442
|
} else if (error instanceof ModelNotFoundError) {
|
|
25424
25443
|
isModelNotFoundError = true;
|
|
25425
|
-
if (contentGeneratorConfig?.authType ===
|
|
25444
|
+
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
25426
25445
|
const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
|
|
25427
25446
|
const messageLines = [
|
|
25428
25447
|
`Model "${failedModel}" is not available in region "${location}".`,
|
|
@@ -25616,7 +25635,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25616
25635
|
);
|
|
25617
25636
|
setEditorError(null);
|
|
25618
25637
|
setIsEditorDialogOpen(false);
|
|
25619
|
-
coreEvents.emit(
|
|
25638
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25620
25639
|
} catch (error) {
|
|
25621
25640
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25622
25641
|
}
|
|
@@ -25625,7 +25644,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25625
25644
|
);
|
|
25626
25645
|
const exitEditorDialog = (0, import_react89.useCallback)(() => {
|
|
25627
25646
|
setIsEditorDialogOpen(false);
|
|
25628
|
-
coreEvents.emit(
|
|
25647
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25629
25648
|
}, []);
|
|
25630
25649
|
return {
|
|
25631
25650
|
isEditorDialogOpen,
|
|
@@ -26002,7 +26021,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26002
26021
|
canonicalPath: resolvedCommandPath
|
|
26003
26022
|
} = parseSlashCommand(trimmed, commands);
|
|
26004
26023
|
if (!commandToExecute) {
|
|
26005
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
26024
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
26006
26025
|
if (isMcpLoading) {
|
|
26007
26026
|
setIsProcessing(true);
|
|
26008
26027
|
if (addToHistory) {
|
|
@@ -26182,7 +26201,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26182
26201
|
onConfirm: async (resolvedOutcome) => {
|
|
26183
26202
|
resolve3({
|
|
26184
26203
|
outcome: resolvedOutcome,
|
|
26185
|
-
approvedCommands: resolvedOutcome ===
|
|
26204
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26186
26205
|
});
|
|
26187
26206
|
}
|
|
26188
26207
|
};
|
|
@@ -26190,7 +26209,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26190
26209
|
callId,
|
|
26191
26210
|
name: "Expansion",
|
|
26192
26211
|
description: "Command expansion needs shell access",
|
|
26193
|
-
status:
|
|
26212
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26194
26213
|
isClientInitiated: true,
|
|
26195
26214
|
resultDisplay: void 0,
|
|
26196
26215
|
confirmationDetails
|
|
@@ -26201,7 +26220,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26201
26220
|
});
|
|
26202
26221
|
});
|
|
26203
26222
|
setPendingItem(null);
|
|
26204
|
-
if (outcome ===
|
|
26223
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26205
26224
|
addItem(
|
|
26206
26225
|
{
|
|
26207
26226
|
type: "info" /* INFO */,
|
|
@@ -26211,7 +26230,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26211
26230
|
);
|
|
26212
26231
|
return { type: "handled" };
|
|
26213
26232
|
}
|
|
26214
|
-
if (outcome ===
|
|
26233
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26215
26234
|
setSessionShellAllowlist(
|
|
26216
26235
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26217
26236
|
);
|
|
@@ -26687,7 +26706,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26687
26706
|
let description;
|
|
26688
26707
|
let renderOutputAsMarkdown = false;
|
|
26689
26708
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26690
|
-
if (call.status ===
|
|
26709
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26691
26710
|
description = JSON.stringify(call.request.args);
|
|
26692
26711
|
} else {
|
|
26693
26712
|
description = call.invocation.getDescription();
|
|
@@ -26710,27 +26729,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26710
26729
|
let progress = void 0;
|
|
26711
26730
|
let progressTotal = void 0;
|
|
26712
26731
|
switch (call.status) {
|
|
26713
|
-
case
|
|
26732
|
+
case CoreToolCallStatus.Success:
|
|
26714
26733
|
resultDisplay = call.response.resultDisplay;
|
|
26715
26734
|
outputFile = call.response.outputFile;
|
|
26716
26735
|
break;
|
|
26717
|
-
case
|
|
26718
|
-
case
|
|
26736
|
+
case CoreToolCallStatus.Error:
|
|
26737
|
+
case CoreToolCallStatus.Cancelled:
|
|
26719
26738
|
resultDisplay = call.response.resultDisplay;
|
|
26720
26739
|
break;
|
|
26721
|
-
case
|
|
26740
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26722
26741
|
correlationId = call.correlationId;
|
|
26723
26742
|
confirmationDetails = call.confirmationDetails;
|
|
26724
26743
|
break;
|
|
26725
|
-
case
|
|
26744
|
+
case CoreToolCallStatus.Executing:
|
|
26726
26745
|
resultDisplay = call.liveOutput;
|
|
26727
26746
|
ptyId = call.pid;
|
|
26728
26747
|
progressMessage = call.progressMessage;
|
|
26729
26748
|
progress = call.progress;
|
|
26730
26749
|
progressTotal = call.progressTotal;
|
|
26731
26750
|
break;
|
|
26732
|
-
case
|
|
26733
|
-
case
|
|
26751
|
+
case CoreToolCallStatus.Scheduled:
|
|
26752
|
+
case CoreToolCallStatus.Validating:
|
|
26734
26753
|
break;
|
|
26735
26754
|
default: {
|
|
26736
26755
|
const exhaustiveCheck = call;
|
|
@@ -26801,7 +26820,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26801
26820
|
const handler = (event) => {
|
|
26802
26821
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26803
26822
|
const hasExecuting = event.toolCalls.some(
|
|
26804
|
-
(tc) => tc.status ===
|
|
26823
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26805
26824
|
);
|
|
26806
26825
|
if (hasExecuting) {
|
|
26807
26826
|
setLastToolOutputTime(Date.now());
|
|
@@ -26810,7 +26829,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26810
26829
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26811
26830
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26812
26831
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26813
|
-
(tc) => tc.status ===
|
|
26832
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26814
26833
|
);
|
|
26815
26834
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26816
26835
|
return prev;
|
|
@@ -26822,9 +26841,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26822
26841
|
};
|
|
26823
26842
|
});
|
|
26824
26843
|
};
|
|
26825
|
-
messageBus.subscribe(
|
|
26844
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26826
26845
|
return () => {
|
|
26827
|
-
messageBus.unsubscribe(
|
|
26846
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26828
26847
|
};
|
|
26829
26848
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26830
26849
|
(0, import_react96.useEffect)(() => {
|
|
@@ -26846,9 +26865,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26846
26865
|
};
|
|
26847
26866
|
});
|
|
26848
26867
|
};
|
|
26849
|
-
messageBus.subscribe(
|
|
26868
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26850
26869
|
return () => {
|
|
26851
|
-
messageBus.unsubscribe(
|
|
26870
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26852
26871
|
};
|
|
26853
26872
|
}, [messageBus]);
|
|
26854
26873
|
const schedule = (0, import_react96.useCallback)(
|
|
@@ -26947,8 +26966,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
26947
26966
|
const prev = prevMap.get(coreCall.request.callId);
|
|
26948
26967
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
26949
26968
|
let status = coreCall.status;
|
|
26950
|
-
if ((status ===
|
|
26951
|
-
status =
|
|
26969
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
26970
|
+
status = CoreToolCallStatus.Executing;
|
|
26952
26971
|
}
|
|
26953
26972
|
return {
|
|
26954
26973
|
...coreCall,
|
|
@@ -26980,7 +26999,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
26980
26999
|
};
|
|
26981
27000
|
}
|
|
26982
27001
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
26983
|
-
return toolCall.status ===
|
|
27002
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
26984
27003
|
}
|
|
26985
27004
|
function showCitations(settings) {
|
|
26986
27005
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -26990,14 +27009,14 @@ function showCitations(settings) {
|
|
|
26990
27009
|
return true;
|
|
26991
27010
|
}
|
|
26992
27011
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
26993
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
27012
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
26994
27013
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
26995
27014
|
}
|
|
26996
27015
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
26997
|
-
if (tc.status ===
|
|
27016
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
26998
27017
|
return true;
|
|
26999
27018
|
}
|
|
27000
|
-
if (tc.status ===
|
|
27019
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
27001
27020
|
return !tc.responseSubmittedToGemini;
|
|
27002
27021
|
}
|
|
27003
27022
|
return false;
|
|
@@ -27044,9 +27063,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27044
27063
|
}
|
|
27045
27064
|
setRetryStatus(payload);
|
|
27046
27065
|
};
|
|
27047
|
-
coreEvents.on(
|
|
27066
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27048
27067
|
return () => {
|
|
27049
|
-
coreEvents.off(
|
|
27068
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27050
27069
|
};
|
|
27051
27070
|
}, [isRespondingRef]);
|
|
27052
27071
|
const [
|
|
@@ -27179,12 +27198,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27179
27198
|
const tc = toolCalls[i];
|
|
27180
27199
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27181
27200
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27182
|
-
const isAgent = tc.tool?.kind ===
|
|
27201
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27183
27202
|
if (isAgent) {
|
|
27184
27203
|
let contigAgentsComplete = true;
|
|
27185
27204
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27186
27205
|
const nextTc = toolCalls[j];
|
|
27187
|
-
if (nextTc.tool?.kind ===
|
|
27206
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27188
27207
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27189
27208
|
contigAgentsComplete = false;
|
|
27190
27209
|
break;
|
|
@@ -27210,7 +27229,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27210
27229
|
let currentGroup = [];
|
|
27211
27230
|
for (const tc of toolsToPush) {
|
|
27212
27231
|
newPushed.add(tc.request.callId);
|
|
27213
|
-
if (tc.tool?.kind ===
|
|
27232
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27214
27233
|
currentGroup.push(tc);
|
|
27215
27234
|
} else {
|
|
27216
27235
|
if (currentGroup.length > 0) {
|
|
@@ -27363,7 +27382,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27363
27382
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27364
27383
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27365
27384
|
(0, import_react97.useEffect)(() => {
|
|
27366
|
-
if (config.getApprovalMode() ===
|
|
27385
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27367
27386
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27368
27387
|
(item) => item.type === "user" /* USER */
|
|
27369
27388
|
);
|
|
@@ -27431,7 +27450,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27431
27450
|
return;
|
|
27432
27451
|
}
|
|
27433
27452
|
const hasActiveTools = toolCalls.some(
|
|
27434
|
-
(tc) => tc.status ===
|
|
27453
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27435
27454
|
);
|
|
27436
27455
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27437
27456
|
if (clearBuffer) {
|
|
@@ -27458,7 +27477,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27458
27477
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27459
27478
|
return {
|
|
27460
27479
|
...tool,
|
|
27461
|
-
status:
|
|
27480
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27462
27481
|
resultDisplay: tool.resultDisplay
|
|
27463
27482
|
};
|
|
27464
27483
|
}
|
|
@@ -27523,7 +27542,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27523
27542
|
let localQueryToSendToGemini = null;
|
|
27524
27543
|
if (typeof query === "string") {
|
|
27525
27544
|
const trimmedQuery = query.trim();
|
|
27526
|
-
await logger?.logMessage(
|
|
27545
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27527
27546
|
if (!shellModeActive) {
|
|
27528
27547
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27529
27548
|
if (slashCommandResult) {
|
|
@@ -27679,7 +27698,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27679
27698
|
if (pendingHistoryItemRef.current) {
|
|
27680
27699
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27681
27700
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27682
|
-
(tool) => tool.status ===
|
|
27701
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
27683
27702
|
);
|
|
27684
27703
|
const pendingItem = {
|
|
27685
27704
|
...pendingHistoryItemRef.current,
|
|
@@ -27971,15 +27990,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27971
27990
|
let geminiMessageBuffer = "";
|
|
27972
27991
|
const toolCallRequests = [];
|
|
27973
27992
|
for await (const event of stream) {
|
|
27974
|
-
if (event.type !==
|
|
27993
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
27975
27994
|
setThought(null);
|
|
27976
27995
|
}
|
|
27977
27996
|
switch (event.type) {
|
|
27978
|
-
case
|
|
27997
|
+
case GeminiEventType.Thought:
|
|
27979
27998
|
setLastGeminiActivityTime(Date.now());
|
|
27980
27999
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
27981
28000
|
break;
|
|
27982
|
-
case
|
|
28001
|
+
case GeminiEventType.Content:
|
|
27983
28002
|
setLastGeminiActivityTime(Date.now());
|
|
27984
28003
|
geminiMessageBuffer = handleContentEvent(
|
|
27985
28004
|
event.value,
|
|
@@ -27987,16 +28006,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27987
28006
|
userMessageTimestamp
|
|
27988
28007
|
);
|
|
27989
28008
|
break;
|
|
27990
|
-
case
|
|
28009
|
+
case GeminiEventType.ToolCallRequest:
|
|
27991
28010
|
toolCallRequests.push(event.value);
|
|
27992
28011
|
break;
|
|
27993
|
-
case
|
|
28012
|
+
case GeminiEventType.UserCancelled:
|
|
27994
28013
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
27995
28014
|
break;
|
|
27996
|
-
case
|
|
28015
|
+
case GeminiEventType.Error:
|
|
27997
28016
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
27998
28017
|
break;
|
|
27999
|
-
case
|
|
28018
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
28000
28019
|
handleAgentExecutionStoppedEvent(
|
|
28001
28020
|
event.value.reason,
|
|
28002
28021
|
userMessageTimestamp,
|
|
@@ -28004,7 +28023,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28004
28023
|
event.value.contextCleared
|
|
28005
28024
|
);
|
|
28006
28025
|
break;
|
|
28007
|
-
case
|
|
28026
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
28008
28027
|
handleAgentExecutionBlockedEvent(
|
|
28009
28028
|
event.value.reason,
|
|
28010
28029
|
userMessageTimestamp,
|
|
@@ -28012,36 +28031,36 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28012
28031
|
event.value.contextCleared
|
|
28013
28032
|
);
|
|
28014
28033
|
break;
|
|
28015
|
-
case
|
|
28034
|
+
case GeminiEventType.ChatCompressed:
|
|
28016
28035
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
28017
28036
|
break;
|
|
28018
|
-
case
|
|
28019
|
-
case
|
|
28037
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
28038
|
+
case GeminiEventType.ToolCallResponse:
|
|
28020
28039
|
break;
|
|
28021
|
-
case
|
|
28040
|
+
case GeminiEventType.MaxSessionTurns:
|
|
28022
28041
|
handleMaxSessionTurnsEvent();
|
|
28023
28042
|
break;
|
|
28024
|
-
case
|
|
28043
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
28025
28044
|
handleContextWindowWillOverflowEvent(
|
|
28026
28045
|
event.value.estimatedRequestTokenCount,
|
|
28027
28046
|
event.value.remainingTokenCount
|
|
28028
28047
|
);
|
|
28029
28048
|
break;
|
|
28030
|
-
case
|
|
28049
|
+
case GeminiEventType.Finished:
|
|
28031
28050
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
28032
28051
|
break;
|
|
28033
|
-
case
|
|
28052
|
+
case GeminiEventType.Citation:
|
|
28034
28053
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
28035
28054
|
break;
|
|
28036
|
-
case
|
|
28055
|
+
case GeminiEventType.ModelInfo:
|
|
28037
28056
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
28038
28057
|
break;
|
|
28039
|
-
case
|
|
28058
|
+
case GeminiEventType.LoopDetected:
|
|
28040
28059
|
loopDetectedRef.current = true;
|
|
28041
28060
|
break;
|
|
28042
|
-
case
|
|
28061
|
+
case GeminiEventType.Retry:
|
|
28043
28062
|
break;
|
|
28044
|
-
case
|
|
28063
|
+
case GeminiEventType.InvalidStream:
|
|
28045
28064
|
handleInvalidStreamEvent(event.value, userMessageTimestamp);
|
|
28046
28065
|
break;
|
|
28047
28066
|
default: {
|
|
@@ -28095,7 +28114,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28095
28114
|
const submitQuery = (0, import_react97.useCallback)(
|
|
28096
28115
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
28097
28116
|
{
|
|
28098
|
-
operation: options?.isContinuation ?
|
|
28117
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
28099
28118
|
sessionId: config.getSessionId()
|
|
28100
28119
|
},
|
|
28101
28120
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28262,7 +28281,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28262
28281
|
submitQueryRef.current = submitQuery;
|
|
28263
28282
|
const handleApprovalModeChange = (0, import_react97.useCallback)(
|
|
28264
28283
|
async (newApprovalMode) => {
|
|
28265
|
-
if (previousApprovalModeRef.current ===
|
|
28284
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28266
28285
|
if (geminiClient) {
|
|
28267
28286
|
try {
|
|
28268
28287
|
await geminiClient.addHistory({
|
|
@@ -28285,11 +28304,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28285
28304
|
}
|
|
28286
28305
|
}
|
|
28287
28306
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28288
|
-
if (newApprovalMode ===
|
|
28307
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28289
28308
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28290
28309
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28291
28310
|
);
|
|
28292
|
-
if (newApprovalMode ===
|
|
28311
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28293
28312
|
awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
|
|
28294
28313
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
28295
28314
|
return true;
|
|
@@ -28305,11 +28324,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28305
28324
|
if (call.correlationId) {
|
|
28306
28325
|
try {
|
|
28307
28326
|
await config.getMessageBus().publish({
|
|
28308
|
-
type:
|
|
28327
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28309
28328
|
correlationId: call.correlationId,
|
|
28310
28329
|
confirmed: true,
|
|
28311
28330
|
requiresUserConfirmation: false,
|
|
28312
|
-
outcome:
|
|
28331
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28313
28332
|
});
|
|
28314
28333
|
} catch (error) {
|
|
28315
28334
|
debugLogger.warn(
|
|
@@ -28400,14 +28419,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28400
28419
|
);
|
|
28401
28420
|
if (isLowErrorVerbosity) {
|
|
28402
28421
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28403
|
-
(tc) => tc.status ===
|
|
28422
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28404
28423
|
).length;
|
|
28405
28424
|
}
|
|
28406
28425
|
if (geminiTools.length === 0) {
|
|
28407
28426
|
return;
|
|
28408
28427
|
}
|
|
28409
28428
|
const stopExecutionTool = geminiTools.find(
|
|
28410
|
-
(tc) => tc.response.errorType ===
|
|
28429
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28411
28430
|
);
|
|
28412
28431
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28413
28432
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28427,9 +28446,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28427
28446
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28428
28447
|
);
|
|
28429
28448
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28430
|
-
(tc) => tc.status ===
|
|
28449
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28431
28450
|
);
|
|
28432
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28451
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28433
28452
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28434
28453
|
if (!turnCancelledRef.current) {
|
|
28435
28454
|
addItem({
|
|
@@ -28515,7 +28534,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28515
28534
|
return;
|
|
28516
28535
|
}
|
|
28517
28536
|
const restorableToolCalls = toolCalls.filter(
|
|
28518
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28537
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28519
28538
|
);
|
|
28520
28539
|
if (restorableToolCalls.length > 0) {
|
|
28521
28540
|
if (!gitService) {
|
|
@@ -28738,14 +28757,14 @@ var useAgentStream = ({
|
|
|
28738
28757
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28739
28758
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28740
28759
|
const desc = legacyState?.description ?? "";
|
|
28741
|
-
const fallbackKind =
|
|
28760
|
+
const fallbackKind = Kind.Other;
|
|
28742
28761
|
const newCall = {
|
|
28743
28762
|
callId: event.requestId,
|
|
28744
28763
|
name: displayName,
|
|
28745
28764
|
originalRequestName: event.name,
|
|
28746
28765
|
description: desc,
|
|
28747
28766
|
display: event.display,
|
|
28748
|
-
status:
|
|
28767
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28749
28768
|
isClientInitiated: false,
|
|
28750
28769
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28751
28770
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28763,10 +28782,10 @@ var useAgentStream = ({
|
|
|
28763
28782
|
const evtStatus = legacyState?.status;
|
|
28764
28783
|
let status = tc.status;
|
|
28765
28784
|
if (evtStatus === "executing")
|
|
28766
|
-
status =
|
|
28767
|
-
else if (evtStatus === "error") status =
|
|
28785
|
+
status = CoreToolCallStatus.Executing;
|
|
28786
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28768
28787
|
else if (evtStatus === "success")
|
|
28769
|
-
status =
|
|
28788
|
+
status = CoreToolCallStatus.Success;
|
|
28770
28789
|
const display = event.display?.result;
|
|
28771
28790
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28772
28791
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28799,7 +28818,7 @@ var useAgentStream = ({
|
|
|
28799
28818
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28800
28819
|
return {
|
|
28801
28820
|
...tc,
|
|
28802
|
-
status: event.isError ?
|
|
28821
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28803
28822
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28804
28823
|
resultDisplay,
|
|
28805
28824
|
outputFile
|
|
@@ -28865,7 +28884,7 @@ var useAgentStream = ({
|
|
|
28865
28884
|
if (!options?.isContinuation) {
|
|
28866
28885
|
if (typeof query === "string") {
|
|
28867
28886
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28868
|
-
void logger?.logMessage(
|
|
28887
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28869
28888
|
}
|
|
28870
28889
|
startNewPrompt();
|
|
28871
28890
|
}
|
|
@@ -30349,10 +30368,20 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30349
30368
|
const [discoveryResults, setDiscoveryResults] = (0, import_react103.useState)(null);
|
|
30350
30369
|
const [isRestarting, setIsRestarting] = (0, import_react103.useState)(false);
|
|
30351
30370
|
const startupMessageSent = (0, import_react103.useRef)(false);
|
|
30371
|
+
const onTrustChangeRef = (0, import_react103.useRef)(onTrustChange);
|
|
30372
|
+
const addItemRef = (0, import_react103.useRef)(addItem);
|
|
30373
|
+
const settingsRef = (0, import_react103.useRef)(settings);
|
|
30374
|
+
(0, import_react103.useEffect)(() => {
|
|
30375
|
+
onTrustChangeRef.current = onTrustChange;
|
|
30376
|
+
addItemRef.current = addItem;
|
|
30377
|
+
settingsRef.current = settings;
|
|
30378
|
+
}, [onTrustChange, addItem, settings]);
|
|
30352
30379
|
const folderTrust = settings.merged.security.folderTrust.enabled ?? true;
|
|
30353
30380
|
(0, import_react103.useEffect)(() => {
|
|
30354
30381
|
let isMounted = true;
|
|
30355
|
-
const { isTrusted: trusted } = isWorkspaceTrusted(
|
|
30382
|
+
const { isTrusted: trusted } = isWorkspaceTrusted(
|
|
30383
|
+
settingsRef.current.merged
|
|
30384
|
+
);
|
|
30356
30385
|
if (trusted === void 0 || trusted === false) {
|
|
30357
30386
|
void FolderTrustDiscoveryService.discover(process10.cwd()).then((results) => {
|
|
30358
30387
|
if (isMounted) {
|
|
@@ -30363,7 +30392,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30363
30392
|
}
|
|
30364
30393
|
const showUntrustedMessage = () => {
|
|
30365
30394
|
if (trusted === false && !startupMessageSent.current) {
|
|
30366
|
-
|
|
30395
|
+
addItemRef.current(
|
|
30367
30396
|
{
|
|
30368
30397
|
type: "info" /* INFO */,
|
|
30369
30398
|
text: "This folder is untrusted, project settings, hooks, MCPs, and GEMINI.md files will not be applied for this folder.\nUse the `/permissions` command to change the trust level."
|
|
@@ -30373,29 +30402,22 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30373
30402
|
startupMessageSent.current = true;
|
|
30374
30403
|
}
|
|
30375
30404
|
};
|
|
30376
|
-
if (
|
|
30377
|
-
if (isMounted) {
|
|
30378
|
-
setIsTrusted(trusted);
|
|
30379
|
-
setIsFolderTrustDialogOpen(false);
|
|
30380
|
-
onTrustChange(true);
|
|
30381
|
-
showUntrustedMessage();
|
|
30382
|
-
}
|
|
30383
|
-
} else if (isMounted) {
|
|
30405
|
+
if (isMounted) {
|
|
30384
30406
|
setIsTrusted(trusted);
|
|
30385
|
-
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
30386
|
-
|
|
30407
|
+
setIsFolderTrustDialogOpen(!isHeadlessMode() && trusted === void 0);
|
|
30408
|
+
onTrustChangeRef.current(trusted);
|
|
30387
30409
|
showUntrustedMessage();
|
|
30388
30410
|
}
|
|
30389
30411
|
return () => {
|
|
30390
30412
|
isMounted = false;
|
|
30391
30413
|
};
|
|
30392
|
-
}, [folderTrust
|
|
30414
|
+
}, [folderTrust]);
|
|
30393
30415
|
const handleFolderTrustSelect = (0, import_react103.useCallback)(
|
|
30394
30416
|
async (choice) => {
|
|
30395
30417
|
const trustLevelMap = {
|
|
30396
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30397
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30398
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
30418
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
30419
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
30420
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
30399
30421
|
};
|
|
30400
30422
|
const trustLevel = trustLevelMap[choice];
|
|
30401
30423
|
if (!trustLevel) return;
|
|
@@ -30414,8 +30436,8 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30414
30436
|
}, 100);
|
|
30415
30437
|
return;
|
|
30416
30438
|
}
|
|
30417
|
-
const currentIsTrusted = trustLevel ===
|
|
30418
|
-
|
|
30439
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30440
|
+
onTrustChangeRef.current(currentIsTrusted);
|
|
30419
30441
|
setIsTrusted(currentIsTrusted);
|
|
30420
30442
|
const wasTrusted = isTrusted ?? false;
|
|
30421
30443
|
if (wasTrusted !== currentIsTrusted) {
|
|
@@ -30425,7 +30447,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30425
30447
|
setIsFolderTrustDialogOpen(false);
|
|
30426
30448
|
}
|
|
30427
30449
|
},
|
|
30428
|
-
[
|
|
30450
|
+
[isTrusted]
|
|
30429
30451
|
);
|
|
30430
30452
|
return {
|
|
30431
30453
|
isTrusted,
|
|
@@ -31422,7 +31444,7 @@ function useMessageQueue({
|
|
|
31422
31444
|
var import_react105 = __toESM(require_react(), 1);
|
|
31423
31445
|
function useMcpStatus(config) {
|
|
31424
31446
|
const [discoveryState, setDiscoveryState] = (0, import_react105.useState)(
|
|
31425
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31447
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31426
31448
|
);
|
|
31427
31449
|
const [mcpServerCount, setMcpServerCount] = (0, import_react105.useState)(
|
|
31428
31450
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31435,12 +31457,12 @@ function useMcpStatus(config) {
|
|
|
31435
31457
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31436
31458
|
}
|
|
31437
31459
|
};
|
|
31438
|
-
coreEvents.on(
|
|
31460
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31439
31461
|
return () => {
|
|
31440
|
-
coreEvents.off(
|
|
31462
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31441
31463
|
};
|
|
31442
31464
|
}, [config]);
|
|
31443
|
-
const isMcpReady = discoveryState ===
|
|
31465
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31444
31466
|
return {
|
|
31445
31467
|
discoveryState,
|
|
31446
31468
|
mcpServerCount,
|
|
@@ -31467,7 +31489,7 @@ function useApprovalModeIndicator({
|
|
|
31467
31489
|
(key) => {
|
|
31468
31490
|
let nextApprovalMode;
|
|
31469
31491
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31470
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31492
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31471
31493
|
if (addItem) {
|
|
31472
31494
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31473
31495
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31485,21 +31507,21 @@ function useApprovalModeIndicator({
|
|
|
31485
31507
|
}
|
|
31486
31508
|
return;
|
|
31487
31509
|
}
|
|
31488
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31510
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31489
31511
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31490
31512
|
const currentMode = config.getApprovalMode();
|
|
31491
31513
|
switch (currentMode) {
|
|
31492
|
-
case
|
|
31493
|
-
nextApprovalMode =
|
|
31514
|
+
case ApprovalMode.DEFAULT:
|
|
31515
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31494
31516
|
break;
|
|
31495
|
-
case
|
|
31496
|
-
nextApprovalMode = allowPlanMode ?
|
|
31517
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31518
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31497
31519
|
break;
|
|
31498
|
-
case
|
|
31499
|
-
nextApprovalMode =
|
|
31520
|
+
case ApprovalMode.PLAN:
|
|
31521
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31500
31522
|
break;
|
|
31501
|
-
case
|
|
31502
|
-
nextApprovalMode =
|
|
31523
|
+
case ApprovalMode.YOLO:
|
|
31524
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31503
31525
|
break;
|
|
31504
31526
|
default:
|
|
31505
31527
|
}
|
|
@@ -31909,11 +31931,11 @@ var useHookDisplayState = () => {
|
|
|
31909
31931
|
removeHook();
|
|
31910
31932
|
}
|
|
31911
31933
|
};
|
|
31912
|
-
coreEvents.on(
|
|
31913
|
-
coreEvents.on(
|
|
31934
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
31935
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31914
31936
|
return () => {
|
|
31915
|
-
coreEvents.off(
|
|
31916
|
-
coreEvents.off(
|
|
31937
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
31938
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31917
31939
|
activeTimeouts.forEach(clearTimeout);
|
|
31918
31940
|
activeTimeouts.clear();
|
|
31919
31941
|
};
|
|
@@ -32752,7 +32774,7 @@ var AppContainer = (props) => {
|
|
|
32752
32774
|
setConfigInitialized(true);
|
|
32753
32775
|
startupProfiler.flush(config);
|
|
32754
32776
|
startAutoMemoryIfEnabled(config);
|
|
32755
|
-
const sessionStartSource = resumedSessionData ?
|
|
32777
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32756
32778
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32757
32779
|
if (result) {
|
|
32758
32780
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32779,7 +32801,7 @@ var AppContainer = (props) => {
|
|
|
32779
32801
|
);
|
|
32780
32802
|
const ideClient = await IdeClient.getInstance();
|
|
32781
32803
|
await ideClient.disconnect();
|
|
32782
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32804
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32783
32805
|
};
|
|
32784
32806
|
registerCleanup(cleanupFn);
|
|
32785
32807
|
return () => {
|
|
@@ -32804,11 +32826,11 @@ var AppContainer = (props) => {
|
|
|
32804
32826
|
resetTime: payload.resetTime
|
|
32805
32827
|
});
|
|
32806
32828
|
};
|
|
32807
|
-
coreEvents.on(
|
|
32808
|
-
coreEvents.on(
|
|
32829
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32830
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32809
32831
|
return () => {
|
|
32810
|
-
coreEvents.off(
|
|
32811
|
-
coreEvents.off(
|
|
32832
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32833
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32812
32834
|
};
|
|
32813
32835
|
}, [config]);
|
|
32814
32836
|
(0, import_react119.useEffect)(() => {
|
|
@@ -32821,16 +32843,16 @@ var AppContainer = (props) => {
|
|
|
32821
32843
|
const handleAgentsDiscovered = (payload) => {
|
|
32822
32844
|
setNewAgents(payload.agents);
|
|
32823
32845
|
};
|
|
32824
|
-
coreEvents.on(
|
|
32825
|
-
coreEvents.on(
|
|
32826
|
-
coreEvents.on(
|
|
32846
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32847
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32848
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32827
32849
|
return () => {
|
|
32828
|
-
coreEvents.off(
|
|
32850
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32829
32851
|
coreEvents.off(
|
|
32830
|
-
|
|
32852
|
+
CoreEvent.AdminSettingsChanged,
|
|
32831
32853
|
handleAdminSettingsChanged
|
|
32832
32854
|
);
|
|
32833
|
-
coreEvents.off(
|
|
32855
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32834
32856
|
};
|
|
32835
32857
|
}, [settings]);
|
|
32836
32858
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32897,11 +32919,11 @@ var AppContainer = (props) => {
|
|
|
32897
32919
|
exitEditorDialog
|
|
32898
32920
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32899
32921
|
(0, import_react119.useEffect)(() => {
|
|
32900
|
-
coreEvents.on(
|
|
32901
|
-
coreEvents.on(
|
|
32922
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32923
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32902
32924
|
return () => {
|
|
32903
|
-
coreEvents.off(
|
|
32904
|
-
coreEvents.off(
|
|
32925
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32926
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32905
32927
|
};
|
|
32906
32928
|
}, [handleEditorClose, openEditorDialog]);
|
|
32907
32929
|
(0, import_react119.useEffect)(() => {
|
|
@@ -32969,7 +32991,7 @@ var AppContainer = (props) => {
|
|
|
32969
32991
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
32970
32992
|
});
|
|
32971
32993
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
32972
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
32994
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
32973
32995
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
32974
32996
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
32975
32997
|
config,
|
|
@@ -32997,7 +33019,7 @@ var AppContainer = (props) => {
|
|
|
32997
33019
|
async (authType, scope) => {
|
|
32998
33020
|
if (authType) {
|
|
32999
33021
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
33000
|
-
if (authType ===
|
|
33022
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
33001
33023
|
setAuthContext({ requiresRestart: true });
|
|
33002
33024
|
} else {
|
|
33003
33025
|
setAuthContext({});
|
|
@@ -33025,7 +33047,7 @@ var AppContainer = (props) => {
|
|
|
33025
33047
|
);
|
|
33026
33048
|
return;
|
|
33027
33049
|
}
|
|
33028
|
-
if (authType ===
|
|
33050
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
33029
33051
|
writeToStdout(`
|
|
33030
33052
|
----------------------------------------------------------------
|
|
33031
33053
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -33048,7 +33070,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33048
33070
|
}
|
|
33049
33071
|
await saveApiKey(apiKey);
|
|
33050
33072
|
await reloadApiKey();
|
|
33051
|
-
await config.refreshAuth(
|
|
33073
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
33052
33074
|
setAuthState("authenticated" /* Authenticated */);
|
|
33053
33075
|
} catch (e) {
|
|
33054
33076
|
onAuthError(
|
|
@@ -33073,7 +33095,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33073
33095
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
33074
33096
|
);
|
|
33075
33097
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
33076
|
-
if (settings.merged.security.auth.selectedType ===
|
|
33098
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
33077
33099
|
return;
|
|
33078
33100
|
}
|
|
33079
33101
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -33209,9 +33231,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33209
33231
|
}
|
|
33210
33232
|
});
|
|
33211
33233
|
};
|
|
33212
|
-
coreEvents.on(
|
|
33234
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33213
33235
|
return () => {
|
|
33214
|
-
coreEvents.off(
|
|
33236
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33215
33237
|
};
|
|
33216
33238
|
}, []);
|
|
33217
33239
|
const performMemoryRefresh = (0, import_react119.useCallback)(async () => {
|
|
@@ -33869,7 +33891,7 @@ ${queuedText}` : queuedText;
|
|
|
33869
33891
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33870
33892
|
if (settings.merged.general.devtools) {
|
|
33871
33893
|
void (async () => {
|
|
33872
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33894
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-54XKSYYW.js");
|
|
33873
33895
|
await toggleDevToolsPanel(
|
|
33874
33896
|
config,
|
|
33875
33897
|
showErrorDetails,
|
|
@@ -34087,17 +34109,17 @@ ${queuedText}` : queuedText;
|
|
|
34087
34109
|
Date.now()
|
|
34088
34110
|
);
|
|
34089
34111
|
};
|
|
34090
|
-
coreEvents.on(
|
|
34091
|
-
coreEvents.on(
|
|
34112
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34113
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34092
34114
|
coreEvents.drainBacklogs();
|
|
34093
34115
|
return () => {
|
|
34094
|
-
coreEvents.off(
|
|
34095
|
-
coreEvents.off(
|
|
34116
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34117
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34096
34118
|
};
|
|
34097
34119
|
}, [historyManager]);
|
|
34098
34120
|
const nightly = props.version.includes("nightly");
|
|
34099
34121
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
34100
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
34122
|
+
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;
|
|
34101
34123
|
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;
|
|
34102
34124
|
const hasPendingToolConfirmation = (0, import_react119.useMemo)(
|
|
34103
34125
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
@@ -34203,9 +34225,9 @@ ${queuedText}` : queuedText;
|
|
|
34203
34225
|
const handleMemoryChanged = (result) => {
|
|
34204
34226
|
setGeminiMdFileCount(result.fileCount);
|
|
34205
34227
|
};
|
|
34206
|
-
coreEvents.on(
|
|
34228
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34207
34229
|
return () => {
|
|
34208
|
-
coreEvents.off(
|
|
34230
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34209
34231
|
};
|
|
34210
34232
|
}, []);
|
|
34211
34233
|
(0, import_react119.useEffect)(() => {
|