@google/gemini-cli 0.70.0-preview.0 → 0.71.0-nightly.20261120.gd4cb1713f
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-O5EBPO5F.js → chunk-22NLCXU3.js} +2 -2
- package/bundle/{chunk-SXOGAWDG.js → chunk-3DBVNRC7.js} +1 -1
- package/bundle/{chunk-F6P6PQSG.js → chunk-3VKSDKQA.js} +1 -1
- package/bundle/{chunk-65MRMUKB.js → chunk-43QQPZRQ.js} +2 -2
- package/bundle/{chunk-NFBC76U4.js → chunk-4FKCNBUM.js} +1 -1
- package/bundle/{chunk-CJ7YZ55P.js → chunk-4SEHQOPY.js} +3 -3
- package/bundle/{chunk-BOYVA4SV.js → chunk-4V6FXIV7.js} +1 -1
- package/bundle/{chunk-ZUQTNDGH.js → chunk-4YWPS6WG.js} +7 -7
- package/bundle/{chunk-STY67ND2.js → chunk-6VJSIYX5.js} +9 -8
- package/bundle/{chunk-TX3SX2WI.js → chunk-7CGFKAQQ.js} +2 -2
- package/bundle/{chunk-CMUPNBQQ.js → chunk-7WRW57EW.js} +2 -2
- package/bundle/{chunk-I5QSCSQU.js → chunk-AQR7HAVC.js} +878 -371
- package/bundle/{chunk-T7277DWX.js → chunk-AWAS7A4U.js} +1 -1
- package/bundle/{chunk-IS5SQ7HP.js → chunk-BFYOZTEC.js} +8 -6
- package/bundle/{chunk-6XLLXGZQ.js → chunk-CVDUPOPD.js} +1 -1
- package/bundle/{chunk-AMGYQYS7.js → chunk-EV4MLSRK.js} +2 -2
- package/bundle/{chunk-NFAJ5FW5.js → chunk-H35O2XC7.js} +1 -1
- package/bundle/{chunk-HBTS2REO.js → chunk-HBX5SUG6.js} +1 -1
- package/bundle/chunk-ID6HT5PN.js +512 -0
- package/bundle/chunk-JUDLPWWJ.js +1962 -0
- package/bundle/{chunk-RVYQZ73V.js → chunk-JVBEESQE.js} +3 -3
- package/bundle/{chunk-FDIF7V5C.js → chunk-L7GW5P2N.js} +1 -1
- package/bundle/{chunk-O2DXIYZO.js → chunk-MFOWRKY4.js} +782 -323
- package/bundle/chunk-MPPDWK6R.js +40024 -0
- package/bundle/{chunk-FGTABIOQ.js → chunk-NF46UAZ5.js} +1 -1
- package/bundle/chunk-P3QKD7NI.js +190 -0
- package/bundle/chunk-P5SMSWOI.js +65 -0
- package/bundle/{chunk-ECLDXLDB.js → chunk-Q3MSDTUZ.js} +3 -3
- package/bundle/{chunk-L5UVIFFB.js → chunk-QYILFI2Q.js} +7 -7
- package/bundle/{chunk-RTIGPATB.js → chunk-R5O4JOJ7.js} +1 -1
- package/bundle/chunk-T5ERFODG.js +118 -0
- package/bundle/{chunk-SA2VIQNQ.js → chunk-TKCJYF6S.js} +8765 -15613
- package/bundle/{chunk-BCL7DJOQ.js → chunk-WEQEDCCJ.js} +71 -58
- package/bundle/chunk-YGBB6EOP.js +1571 -0
- package/bundle/chunk-ZL2NEMMB.js +420386 -0
- package/bundle/chunk-ZM7BCSH5.js +60338 -0
- package/bundle/{cleanup-44LV7E4R.js → cleanup-2V4YG4JU.js} +2 -2
- package/bundle/{cleanup-O4QBMRVU.js → cleanup-577T3DEI.js} +2 -2
- package/bundle/{cleanup-WMYSWXJR.js → cleanup-A7BQ5O2C.js} +2 -2
- package/bundle/cleanup-BER5KF3M.js +34 -0
- package/bundle/{core-LJXCBOFM.js → core-J5GAQUTA.js} +31 -1
- package/bundle/{devtoolsService-D4VCGQMJ.js → devtoolsService-5ICQIIYF.js} +2 -2
- package/bundle/{devtoolsService-G4CPAW3U.js → devtoolsService-7E2XLRN6.js} +2 -2
- package/bundle/{devtoolsService-EBOCEFTO.js → devtoolsService-B2G4MIWC.js} +4 -3
- package/bundle/devtoolsService-HFMB7OZU.js +919 -0
- package/bundle/{dist-QSS2VWMY.js → dist-63TFONDS.js} +31 -1
- package/bundle/{core-DJ7VMWCC.js → dist-J4SRUOE6.js} +31 -1
- package/bundle/dist-J54GSUG2.js +2372 -0
- package/bundle/docs/changelogs/index.md +46 -0
- package/bundle/docs/changelogs/latest.md +82 -100
- package/bundle/docs/changelogs/preview.md +82 -115
- package/bundle/{formatError-I5Q2HGMN.js → formatError-ISWUYAZB.js} +2 -2
- package/bundle/{formatError-NLKMYJNL.js → formatError-IX7HHO6M.js} +2 -2
- package/bundle/{formatError-3QIVJAE5.js → formatError-MZRXOV55.js} +2 -2
- package/bundle/formatError-U2ZQLJHB.js +14 -0
- package/bundle/{gemini-4325ARIU.js → gemini-FRGLIXP7.js} +15 -15
- package/bundle/{gemini-LOYZXP6I.js → gemini-GSQARDB2.js} +224 -208
- package/bundle/gemini-KZFVMGY3.js +20020 -0
- package/bundle/{gemini-J7ZRUAXR.js → gemini-ZZBTL6TA.js} +15 -15
- package/bundle/gemini.js +8 -8
- package/bundle/{interactiveCli-AQ67IY7V.js → interactiveCli-AHDFCTRR.js} +157 -32
- package/bundle/{interactiveCli-CEIWZCYF.js → interactiveCli-MVGIIVAP.js} +157 -32
- package/bundle/{interactiveCli-O2L63RLG.js → interactiveCli-UN4BNLK2.js} +468 -324
- package/bundle/interactiveCli-XW2S7MKZ.js +36447 -0
- package/bundle/{liteRtServerManager-HMCB6A65.js → liteRtServerManager-3MOGK3XY.js} +4 -4
- package/bundle/{liteRtServerManager-MH32CAZ5.js → liteRtServerManager-O727KCKA.js} +4 -4
- package/bundle/{liteRtServerManager-EZFHT2B3.js → liteRtServerManager-TSG2V5XN.js} +4 -4
- package/bundle/liteRtServerManager-YLE7JTV7.js +65 -0
- package/bundle/{oauth2-provider-NPOZQDQO.js → oauth2-provider-3EEFSHG4.js} +1 -1
- package/bundle/{oauth2-provider-3TFNA7VY.js → oauth2-provider-DWO2KVCY.js} +1 -1
- package/bundle/{oauth2-provider-UXC7XFV6.js → oauth2-provider-G25ZRGDY.js} +41 -79
- package/bundle/oauth2-provider-RHT5OSMO.js +273 -0
- package/bundle/{start-JIKLB3S3.js → start-4XOSRN5A.js} +6 -6
- package/bundle/{start-NSYEL7UE.js → start-7JXWL6XR.js} +6 -6
- package/bundle/{start-I2GOKFKQ.js → start-CAA6RQBK.js} +6 -6
- package/bundle/start-I3RUABAZ.js +18 -0
- package/package.json +1 -1
|
@@ -149,10 +149,10 @@ import {
|
|
|
149
149
|
useUIState,
|
|
150
150
|
useVimMode,
|
|
151
151
|
validateAuthMethod
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-ZM7BCSH5.js";
|
|
153
153
|
import {
|
|
154
154
|
require_source
|
|
155
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-H35O2XC7.js";
|
|
156
156
|
import {
|
|
157
157
|
appEvents
|
|
158
158
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -226,34 +226,38 @@ import {
|
|
|
226
226
|
widestLineFromStyledChars,
|
|
227
227
|
wordBreakStyledChars,
|
|
228
228
|
wrapStyledChars
|
|
229
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-BFYOZTEC.js";
|
|
230
230
|
import {
|
|
231
231
|
handleAutoUpdate,
|
|
232
232
|
isDevelopment,
|
|
233
233
|
relaunchApp,
|
|
234
234
|
require_semver,
|
|
235
235
|
setUpdateHandler
|
|
236
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-22NLCXU3.js";
|
|
237
237
|
import {
|
|
238
238
|
isTodoList,
|
|
239
239
|
mapCoreStatusToDisplayStatus,
|
|
240
240
|
require_react
|
|
241
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-4FKCNBUM.js";
|
|
242
242
|
import {
|
|
243
243
|
registerCleanup,
|
|
244
244
|
removeCleanup,
|
|
245
245
|
runExitCleanup,
|
|
246
246
|
setupTtyCheck
|
|
247
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-AWAS7A4U.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,
|
|
@@ -276,14 +280,21 @@ import {
|
|
|
276
280
|
GEMMA_4_31B_IT_MODEL,
|
|
277
281
|
GLOB_DISPLAY_NAME,
|
|
278
282
|
GREP_DISPLAY_NAME,
|
|
283
|
+
GeminiCliOperation,
|
|
284
|
+
GeminiEventType,
|
|
279
285
|
GitService,
|
|
280
286
|
INTERACTIVE_GEMINI_SHELL_ERROR,
|
|
281
287
|
IdeClient,
|
|
288
|
+
Kind,
|
|
282
289
|
LS_DISPLAY_NAME,
|
|
283
290
|
LegacyAgentProtocol,
|
|
284
291
|
LlmRole,
|
|
285
292
|
Logger,
|
|
286
293
|
MAX_TOKENS_EXCEEDED_SUGGESTION,
|
|
294
|
+
MCPDiscoveryState,
|
|
295
|
+
MCPServerStatus,
|
|
296
|
+
MessageBusType,
|
|
297
|
+
MessageSenderType,
|
|
287
298
|
ModelNotFoundError,
|
|
288
299
|
ModelSlashCommandEvent,
|
|
289
300
|
OTHER_BLOCKED_MESSAGE,
|
|
@@ -296,6 +307,7 @@ import {
|
|
|
296
307
|
PREVIEW_GEMINI_MODEL,
|
|
297
308
|
PolicyIntegrityManager,
|
|
298
309
|
ProjectIdRequiredError,
|
|
310
|
+
QuestionType,
|
|
299
311
|
READ_FILE_DISPLAY_NAME,
|
|
300
312
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
301
313
|
RECITATION_BLOCKED_MESSAGE,
|
|
@@ -304,16 +316,22 @@ import {
|
|
|
304
316
|
SAFETY_BLOCKED_MESSAGE,
|
|
305
317
|
SHELL_TOOL_NAME,
|
|
306
318
|
Scheduler,
|
|
319
|
+
SessionEndReason,
|
|
320
|
+
SessionStartSource,
|
|
307
321
|
ShellExecutionService,
|
|
308
322
|
SlashCommandStatus,
|
|
309
323
|
Storage,
|
|
324
|
+
SubagentState,
|
|
310
325
|
THINKING_ONLY_COMPRESS_SUGGESTION,
|
|
311
326
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
312
327
|
TOPIC_PARAM_SUMMARY,
|
|
313
328
|
TOPIC_PARAM_TITLE,
|
|
314
329
|
TRUE_EMPTY_RESPONSE_MESSAGE,
|
|
315
330
|
TerminalQuotaError,
|
|
331
|
+
ToolConfirmationOutcome,
|
|
332
|
+
ToolErrorType,
|
|
316
333
|
TranscriptionFactory,
|
|
334
|
+
TrustLevel,
|
|
317
335
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
318
336
|
UPDATE_TOPIC_TOOL_NAME,
|
|
319
337
|
UnauthorizedError,
|
|
@@ -326,6 +344,7 @@ import {
|
|
|
326
344
|
WEB_FETCH_DISPLAY_NAME,
|
|
327
345
|
WEB_SEARCH_DISPLAY_NAME,
|
|
328
346
|
WRITE_FILE_DISPLAY_NAME,
|
|
347
|
+
WarningPriority,
|
|
329
348
|
WhisperModelManager,
|
|
330
349
|
addCalendarDays,
|
|
331
350
|
addMCPStatusChangeListener,
|
|
@@ -368,8 +387,10 @@ import {
|
|
|
368
387
|
getPackageJson,
|
|
369
388
|
getPlanModeExitMessage,
|
|
370
389
|
getResponseText,
|
|
390
|
+
getShellConfiguration,
|
|
371
391
|
getVersion,
|
|
372
392
|
hasRedirection,
|
|
393
|
+
hasRedirectionAsync,
|
|
373
394
|
hasSummary,
|
|
374
395
|
hasValidEditorCommand,
|
|
375
396
|
homedir,
|
|
@@ -381,11 +402,15 @@ import {
|
|
|
381
402
|
isBackgroundExecutionData,
|
|
382
403
|
isBinary,
|
|
383
404
|
isBinaryAvailable,
|
|
405
|
+
isDefaultHasRedirection,
|
|
406
|
+
isDefaultIsInteractiveGeminiCommand,
|
|
384
407
|
isEditorAvailable,
|
|
385
408
|
isFileDiff,
|
|
386
409
|
isGrepResult,
|
|
387
410
|
isHeadlessMode,
|
|
388
411
|
isInteractiveGeminiCommand,
|
|
412
|
+
isInteractiveGeminiCommandAsync,
|
|
413
|
+
isKnownInteractiveGeminiCommandSync,
|
|
389
414
|
isListResult,
|
|
390
415
|
isNodeError,
|
|
391
416
|
isOverageEligibleModel,
|
|
@@ -441,7 +466,7 @@ import {
|
|
|
441
466
|
validatePlanContent,
|
|
442
467
|
validatePlanPath,
|
|
443
468
|
writeToStdout
|
|
444
|
-
} from "./chunk-
|
|
469
|
+
} from "./chunk-MFOWRKY4.js";
|
|
445
470
|
import "./chunk-W2AJR23G.js";
|
|
446
471
|
import "./chunk-N7J54YNL.js";
|
|
447
472
|
import "./chunk-L6PII3GR.js";
|
|
@@ -5068,7 +5093,7 @@ function calculateShellMaxLines(options) {
|
|
|
5068
5093
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
5069
5094
|
return maxLinesBasedOnHeight;
|
|
5070
5095
|
}
|
|
5071
|
-
const isExecuting = status ===
|
|
5096
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
5072
5097
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
5073
5098
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
5074
5099
|
}
|
|
@@ -5104,13 +5129,13 @@ var formatToolArgs = (args) => {
|
|
|
5104
5129
|
var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
|
|
5105
5130
|
let headerText;
|
|
5106
5131
|
let headerColor = theme.text.secondary;
|
|
5107
|
-
if (progress.state ===
|
|
5132
|
+
if (progress.state === SubagentState.CANCELLED) {
|
|
5108
5133
|
headerText = `Subagent ${progress.agentName} was cancelled.`;
|
|
5109
5134
|
headerColor = theme.status.warning;
|
|
5110
|
-
} else if (progress.state ===
|
|
5135
|
+
} else if (progress.state === SubagentState.ERROR) {
|
|
5111
5136
|
headerText = `Subagent ${progress.agentName} failed.`;
|
|
5112
5137
|
headerColor = theme.status.error;
|
|
5113
|
-
} else if (progress.state ===
|
|
5138
|
+
} else if (progress.state === SubagentState.COMPLETED) {
|
|
5114
5139
|
headerText = `Subagent ${progress.agentName} completed.`;
|
|
5115
5140
|
headerColor = theme.status.success;
|
|
5116
5141
|
} else {
|
|
@@ -5130,7 +5155,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5130
5155
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color, children: item.content }) })
|
|
5131
5156
|
] }, item.id);
|
|
5132
5157
|
} else if (item.type === "tool_call") {
|
|
5133
|
-
const statusSymbol = item.status ===
|
|
5158
|
+
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 });
|
|
5134
5159
|
const formattedArgs = item.description || formatToolArgs(item.args);
|
|
5135
5160
|
const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
|
|
5136
5161
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
@@ -5141,7 +5166,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5141
5166
|
{
|
|
5142
5167
|
bold: true,
|
|
5143
5168
|
color: theme.text.primary,
|
|
5144
|
-
strikethrough: item.status ===
|
|
5169
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5145
5170
|
children: item.displayName || item.content
|
|
5146
5171
|
}
|
|
5147
5172
|
),
|
|
@@ -5150,7 +5175,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5150
5175
|
{
|
|
5151
5176
|
color: theme.text.secondary,
|
|
5152
5177
|
wrap: "truncate",
|
|
5153
|
-
strikethrough: item.status ===
|
|
5178
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5154
5179
|
children: displayArgs
|
|
5155
5180
|
}
|
|
5156
5181
|
) })
|
|
@@ -5170,7 +5195,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5170
5195
|
MarkdownDisplay,
|
|
5171
5196
|
{
|
|
5172
5197
|
text: safeJsonToMarkdown(progress.result),
|
|
5173
|
-
isPending: progress.state !==
|
|
5198
|
+
isPending: progress.state !== SubagentState.COMPLETED,
|
|
5174
5199
|
terminalWidth
|
|
5175
5200
|
}
|
|
5176
5201
|
)
|
|
@@ -5531,7 +5556,7 @@ var ToolActionsProvider = (props) => {
|
|
|
5531
5556
|
}
|
|
5532
5557
|
const details = tool.confirmationDetails;
|
|
5533
5558
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
5534
|
-
const cliOutcome = outcome ===
|
|
5559
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
5535
5560
|
if (ideClient) {
|
|
5536
5561
|
void ideClient.resolveDiffFromCli(details.filePath, cliOutcome)?.catch((error) => {
|
|
5537
5562
|
debugLogger.error(
|
|
@@ -5543,9 +5568,9 @@ var ToolActionsProvider = (props) => {
|
|
|
5543
5568
|
}
|
|
5544
5569
|
if (tool.correlationId) {
|
|
5545
5570
|
await config.getMessageBus().publish({
|
|
5546
|
-
type:
|
|
5571
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
5547
5572
|
correlationId: tool.correlationId,
|
|
5548
|
-
confirmed: outcome !==
|
|
5573
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
5549
5574
|
requiresUserConfirmation: false,
|
|
5550
5575
|
outcome,
|
|
5551
5576
|
payload
|
|
@@ -5564,7 +5589,7 @@ var ToolActionsProvider = (props) => {
|
|
|
5564
5589
|
);
|
|
5565
5590
|
const cancel = (0, import_react10.useCallback)(
|
|
5566
5591
|
async (callId) => {
|
|
5567
|
-
await confirm(callId,
|
|
5592
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
5568
5593
|
},
|
|
5569
5594
|
[confirm]
|
|
5570
5595
|
);
|
|
@@ -5685,7 +5710,7 @@ var ToolMessage = ({
|
|
|
5685
5710
|
paddingX: 1,
|
|
5686
5711
|
flexDirection: "column",
|
|
5687
5712
|
children: [
|
|
5688
|
-
status ===
|
|
5713
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5689
5714
|
McpProgressIndicator,
|
|
5690
5715
|
{
|
|
5691
5716
|
progress,
|
|
@@ -5702,8 +5727,8 @@ var ToolMessage = ({
|
|
|
5702
5727
|
terminalWidth: safeTerminalWidth,
|
|
5703
5728
|
renderOutputAsMarkdown,
|
|
5704
5729
|
hasFocus: isThisShellFocused2,
|
|
5705
|
-
maxLines: kind ===
|
|
5706
|
-
overflowDirection: kind ===
|
|
5730
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
5731
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
5707
5732
|
}
|
|
5708
5733
|
),
|
|
5709
5734
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -6019,7 +6044,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
|
|
|
6019
6044
|
settings.merged,
|
|
6020
6045
|
process3.cwd()
|
|
6021
6046
|
);
|
|
6022
|
-
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel ===
|
|
6047
|
+
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
|
|
6023
6048
|
return {
|
|
6024
6049
|
currentTrustLevel: explicitTrustLevel,
|
|
6025
6050
|
isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
|
|
@@ -6064,7 +6089,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
|
|
|
6064
6089
|
process3.cwd(),
|
|
6065
6090
|
newConfig
|
|
6066
6091
|
);
|
|
6067
|
-
if (trustLevel ===
|
|
6092
|
+
if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
|
|
6068
6093
|
let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
|
|
6069
6094
|
if (source === "file") {
|
|
6070
6095
|
message = "Note: This folder is still trusted because a parent folder is trusted.";
|
|
@@ -6138,18 +6163,18 @@ function PermissionsModifyTrustDialog({
|
|
|
6138
6163
|
const TRUST_LEVEL_ITEMS = [
|
|
6139
6164
|
{
|
|
6140
6165
|
label: `Trust this folder (${dirName})`,
|
|
6141
|
-
value:
|
|
6142
|
-
key:
|
|
6166
|
+
value: TrustLevel.TRUST_FOLDER,
|
|
6167
|
+
key: TrustLevel.TRUST_FOLDER
|
|
6143
6168
|
},
|
|
6144
6169
|
{
|
|
6145
6170
|
label: `Trust parent folder (${parentFolder})`,
|
|
6146
|
-
value:
|
|
6147
|
-
key:
|
|
6171
|
+
value: TrustLevel.TRUST_PARENT,
|
|
6172
|
+
key: TrustLevel.TRUST_PARENT
|
|
6148
6173
|
},
|
|
6149
6174
|
{
|
|
6150
6175
|
label: "Don't trust",
|
|
6151
|
-
value:
|
|
6152
|
-
key:
|
|
6176
|
+
value: TrustLevel.DO_NOT_TRUST,
|
|
6177
|
+
key: TrustLevel.DO_NOT_TRUST
|
|
6153
6178
|
}
|
|
6154
6179
|
];
|
|
6155
6180
|
const {
|
|
@@ -6390,7 +6415,7 @@ var ShellToolMessage = ({
|
|
|
6390
6415
|
maxLinesLimit: maxLines
|
|
6391
6416
|
});
|
|
6392
6417
|
import_react15.default.useEffect(() => {
|
|
6393
|
-
const isExecuting = status ===
|
|
6418
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
6394
6419
|
if (isExecuting && ptyId) {
|
|
6395
6420
|
try {
|
|
6396
6421
|
const childWidth = safeTerminalWidth - 4;
|
|
@@ -6604,13 +6629,13 @@ var SubagentGroupDisplay = ({
|
|
|
6604
6629
|
const singleAgent = toolCalls[0].resultDisplay;
|
|
6605
6630
|
if (isSubagentProgress(singleAgent)) {
|
|
6606
6631
|
switch (singleAgent.state) {
|
|
6607
|
-
case
|
|
6632
|
+
case SubagentState.COMPLETED:
|
|
6608
6633
|
headerText = "Agent Completed";
|
|
6609
6634
|
break;
|
|
6610
|
-
case
|
|
6635
|
+
case SubagentState.CANCELLED:
|
|
6611
6636
|
headerText = "Agent Cancelled";
|
|
6612
6637
|
break;
|
|
6613
|
-
case
|
|
6638
|
+
case SubagentState.ERROR:
|
|
6614
6639
|
headerText = "Agent Error";
|
|
6615
6640
|
break;
|
|
6616
6641
|
default:
|
|
@@ -6626,8 +6651,8 @@ var SubagentGroupDisplay = ({
|
|
|
6626
6651
|
for (const tc of toolCalls) {
|
|
6627
6652
|
const progress = tc.resultDisplay;
|
|
6628
6653
|
if (isSubagentProgress(progress)) {
|
|
6629
|
-
if (progress.state ===
|
|
6630
|
-
else if (progress.state ===
|
|
6654
|
+
if (progress.state === SubagentState.COMPLETED) completedCount++;
|
|
6655
|
+
else if (progress.state === SubagentState.RUNNING) runningCount++;
|
|
6631
6656
|
} else {
|
|
6632
6657
|
runningCount++;
|
|
6633
6658
|
}
|
|
@@ -6706,7 +6731,7 @@ var SubagentGroupDisplay = ({
|
|
|
6706
6731
|
if (!isExpanded) {
|
|
6707
6732
|
let content = "Starting...";
|
|
6708
6733
|
let formattedArgs;
|
|
6709
|
-
if (progress.state ===
|
|
6734
|
+
if (progress.state === SubagentState.COMPLETED) {
|
|
6710
6735
|
if (progress.terminateReason && progress.terminateReason !== "GOAL") {
|
|
6711
6736
|
content = `Finished Early (${progress.terminateReason})`;
|
|
6712
6737
|
} else {
|
|
@@ -6720,17 +6745,17 @@ var SubagentGroupDisplay = ({
|
|
|
6720
6745
|
formattedArgs = formatToolArgs(lastActivity.args);
|
|
6721
6746
|
}
|
|
6722
6747
|
}
|
|
6723
|
-
const displayArgs = progress.state ===
|
|
6748
|
+
const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
|
|
6724
6749
|
const renderStatusIcon = () => {
|
|
6725
|
-
const state = progress.state ??
|
|
6750
|
+
const state = progress.state ?? SubagentState.RUNNING;
|
|
6726
6751
|
switch (state) {
|
|
6727
|
-
case
|
|
6752
|
+
case SubagentState.RUNNING:
|
|
6728
6753
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: "!" });
|
|
6729
|
-
case
|
|
6754
|
+
case SubagentState.COMPLETED:
|
|
6730
6755
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.success, children: "\u2713" });
|
|
6731
|
-
case
|
|
6756
|
+
case SubagentState.CANCELLED:
|
|
6732
6757
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
|
|
6733
|
-
case
|
|
6758
|
+
case SubagentState.ERROR:
|
|
6734
6759
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.error, children: "\u2717" });
|
|
6735
6760
|
default:
|
|
6736
6761
|
return checkExhaustive(state);
|
|
@@ -6809,7 +6834,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
6809
6834
|
let description;
|
|
6810
6835
|
let renderOutputAsMarkdown = false;
|
|
6811
6836
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
6812
|
-
if (call.status ===
|
|
6837
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
6813
6838
|
description = JSON.stringify(call.request.args);
|
|
6814
6839
|
} else {
|
|
6815
6840
|
description = call.invocation.getDescription();
|
|
@@ -6832,27 +6857,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
6832
6857
|
let progress = void 0;
|
|
6833
6858
|
let progressTotal = void 0;
|
|
6834
6859
|
switch (call.status) {
|
|
6835
|
-
case
|
|
6860
|
+
case CoreToolCallStatus.Success:
|
|
6836
6861
|
resultDisplay = call.response.resultDisplay;
|
|
6837
6862
|
outputFile = call.response.outputFile;
|
|
6838
6863
|
break;
|
|
6839
|
-
case
|
|
6840
|
-
case
|
|
6864
|
+
case CoreToolCallStatus.Error:
|
|
6865
|
+
case CoreToolCallStatus.Cancelled:
|
|
6841
6866
|
resultDisplay = call.response.resultDisplay;
|
|
6842
6867
|
break;
|
|
6843
|
-
case
|
|
6868
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
6844
6869
|
correlationId = call.correlationId;
|
|
6845
6870
|
confirmationDetails = call.confirmationDetails;
|
|
6846
6871
|
break;
|
|
6847
|
-
case
|
|
6872
|
+
case CoreToolCallStatus.Executing:
|
|
6848
6873
|
resultDisplay = call.liveOutput;
|
|
6849
6874
|
ptyId = call.pid;
|
|
6850
6875
|
progressMessage = call.progressMessage;
|
|
6851
6876
|
progress = call.progress;
|
|
6852
6877
|
progressTotal = call.progressTotal;
|
|
6853
6878
|
break;
|
|
6854
|
-
case
|
|
6855
|
-
case
|
|
6879
|
+
case CoreToolCallStatus.Scheduled:
|
|
6880
|
+
case CoreToolCallStatus.Validating:
|
|
6856
6881
|
break;
|
|
6857
6882
|
default: {
|
|
6858
6883
|
const exhaustiveCheck = call;
|
|
@@ -6904,22 +6929,22 @@ var PAYLOAD_MAX_WIDTH = 120 + PAYLOAD_BORDER_CHROME_WIDTH;
|
|
|
6904
6929
|
function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
6905
6930
|
const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
|
|
6906
6931
|
const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
|
|
6907
|
-
const isAcceptedOrConfirming = status ===
|
|
6932
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
6908
6933
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
6909
6934
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
6910
6935
|
const showDiffStat = !!diff.diffStat;
|
|
6911
6936
|
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 }) });
|
|
6912
6937
|
let resultSummary = "";
|
|
6913
6938
|
let resultColor = theme.text.secondary;
|
|
6914
|
-
if (status ===
|
|
6939
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
6915
6940
|
resultSummary = "Confirming";
|
|
6916
|
-
} else if (status ===
|
|
6941
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
6917
6942
|
resultSummary = "Accepted";
|
|
6918
6943
|
resultColor = theme.text.accent;
|
|
6919
|
-
} else if (status ===
|
|
6944
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
6920
6945
|
resultSummary = "Rejected";
|
|
6921
6946
|
resultColor = theme.status.error;
|
|
6922
|
-
} else if (status ===
|
|
6947
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
6923
6948
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
6924
6949
|
resultColor = theme.status.error;
|
|
6925
6950
|
}
|
|
@@ -6950,7 +6975,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
|
|
|
6950
6975
|
filename: diff.fileName,
|
|
6951
6976
|
terminalWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
|
|
6952
6977
|
availableTerminalHeight,
|
|
6953
|
-
disableColor: status ===
|
|
6978
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6954
6979
|
}
|
|
6955
6980
|
);
|
|
6956
6981
|
return { description, summary, payload };
|
|
@@ -7070,10 +7095,10 @@ var DenseToolMessage = (props) => {
|
|
|
7070
7095
|
if (isGrepResult(resultDisplay)) {
|
|
7071
7096
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7072
7097
|
}
|
|
7073
|
-
if (status ===
|
|
7098
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
7074
7099
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7075
7100
|
}
|
|
7076
|
-
if (status ===
|
|
7101
|
+
if (status === CoreToolCallStatus.Error) {
|
|
7077
7102
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
7078
7103
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
7079
7104
|
"\u2192 ",
|
|
@@ -7125,7 +7150,7 @@ var DenseToolMessage = (props) => {
|
|
|
7125
7150
|
language: fileExtension,
|
|
7126
7151
|
maxWidth: safeContentWidth,
|
|
7127
7152
|
settings,
|
|
7128
|
-
disableColor: status ===
|
|
7153
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
7129
7154
|
returnLines: true
|
|
7130
7155
|
});
|
|
7131
7156
|
} else {
|
|
@@ -7133,7 +7158,7 @@ var DenseToolMessage = (props) => {
|
|
|
7133
7158
|
parsedLines,
|
|
7134
7159
|
filename: diff.fileName,
|
|
7135
7160
|
terminalWidth: safeContentWidth,
|
|
7136
|
-
disableColor: status ===
|
|
7161
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
7137
7162
|
});
|
|
7138
7163
|
}
|
|
7139
7164
|
}, [diff, isExpanded, isAlternateBuffer, safeContentWidth, settings, status]);
|
|
@@ -7265,7 +7290,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7265
7290
|
return pendingHistoryItems.some((item) => {
|
|
7266
7291
|
if (item && item.type === "tool_group") {
|
|
7267
7292
|
return item.tools.some(
|
|
7268
|
-
(tool) =>
|
|
7293
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
7269
7294
|
);
|
|
7270
7295
|
}
|
|
7271
7296
|
return false;
|
|
@@ -7274,7 +7299,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7274
7299
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
7275
7300
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
7276
7301
|
(item) => item.tools.some(
|
|
7277
|
-
(tool) =>
|
|
7302
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
7278
7303
|
)
|
|
7279
7304
|
);
|
|
7280
7305
|
}
|
|
@@ -7351,7 +7376,7 @@ var ToolGroupMessage = ({
|
|
|
7351
7376
|
const groupedTools = (0, import_react19.useMemo)(() => {
|
|
7352
7377
|
const groups = [];
|
|
7353
7378
|
for (const tool of visibleToolCalls) {
|
|
7354
|
-
if (tool.kind ===
|
|
7379
|
+
if (tool.kind === Kind.Agent) {
|
|
7355
7380
|
const lastGroup = groups[groups.length - 1];
|
|
7356
7381
|
if (Array.isArray(lastGroup)) {
|
|
7357
7382
|
lastGroup.push(tool);
|
|
@@ -7406,7 +7431,7 @@ var ToolGroupMessage = ({
|
|
|
7406
7431
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
7407
7432
|
let countToolCallsWithResults = 0;
|
|
7408
7433
|
for (const tool of visibleToolCalls) {
|
|
7409
|
-
if (tool.kind !==
|
|
7434
|
+
if (tool.kind !== Kind.Agent) {
|
|
7410
7435
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
7411
7436
|
if (tool.hasDensePayload ?? hasDensePayload(tool)) {
|
|
7412
7437
|
countToolCallsWithResults++;
|
|
@@ -7597,7 +7622,7 @@ var ToolGroupDisplay = ({
|
|
|
7597
7622
|
}
|
|
7598
7623
|
const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
|
|
7599
7624
|
const visibleTools = tools.filter(
|
|
7600
|
-
(t) => t.status !==
|
|
7625
|
+
(t) => t.status !== CoreToolCallStatus.AwaitingApproval
|
|
7601
7626
|
);
|
|
7602
7627
|
const noticeTools = visibleTools.filter((t) => t.format === "notice");
|
|
7603
7628
|
const otherTools = visibleTools.filter(
|
|
@@ -7799,18 +7824,18 @@ function CompressionMessage({
|
|
|
7799
7824
|
return "Compressing chat history";
|
|
7800
7825
|
}
|
|
7801
7826
|
switch (compressionStatus) {
|
|
7802
|
-
case
|
|
7827
|
+
case CompressionStatus.COMPRESSED:
|
|
7803
7828
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
7804
|
-
case
|
|
7829
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
7805
7830
|
if (originalTokens < 5e4) {
|
|
7806
7831
|
return "Compression was not beneficial for this history size.";
|
|
7807
7832
|
}
|
|
7808
7833
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
7809
|
-
case
|
|
7834
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
7810
7835
|
return "Could not compress chat history due to a token counting error.";
|
|
7811
|
-
case
|
|
7836
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
7812
7837
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
7813
|
-
case
|
|
7838
|
+
case CompressionStatus.NOOP:
|
|
7814
7839
|
return "Nothing to compress.";
|
|
7815
7840
|
default:
|
|
7816
7841
|
return "";
|
|
@@ -8248,8 +8273,8 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8248
8273
|
);
|
|
8249
8274
|
roleEntries.sort(([a], [b]) => {
|
|
8250
8275
|
if (a === b) return 0;
|
|
8251
|
-
if (a ===
|
|
8252
|
-
if (b ===
|
|
8276
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8277
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8253
8278
|
return a.localeCompare(b);
|
|
8254
8279
|
});
|
|
8255
8280
|
roleEntries.forEach(([role, roleMetrics]) => {
|
|
@@ -8580,8 +8605,8 @@ var ModelStatsDisplay = ({
|
|
|
8580
8605
|
return validRoles.includes(role);
|
|
8581
8606
|
}).sort((a, b) => {
|
|
8582
8607
|
if (a === b) return 0;
|
|
8583
|
-
if (a ===
|
|
8584
|
-
if (b ===
|
|
8608
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8609
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8585
8610
|
return a.localeCompare(b);
|
|
8586
8611
|
});
|
|
8587
8612
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -9726,7 +9751,7 @@ var McpStatus = ({
|
|
|
9726
9751
|
);
|
|
9727
9752
|
const originalStatus = serverStatus(serverName);
|
|
9728
9753
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
9729
|
-
const status = originalStatus ===
|
|
9754
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
9730
9755
|
let statusIndicator = "";
|
|
9731
9756
|
let statusText = "";
|
|
9732
9757
|
let statusColor = theme.text.primary;
|
|
@@ -9738,17 +9763,17 @@ var McpStatus = ({
|
|
|
9738
9763
|
statusColor = theme.text.secondary;
|
|
9739
9764
|
} else {
|
|
9740
9765
|
switch (status) {
|
|
9741
|
-
case
|
|
9766
|
+
case MCPServerStatus.CONNECTED:
|
|
9742
9767
|
statusIndicator = "\u{1F7E2}";
|
|
9743
9768
|
statusText = "Ready";
|
|
9744
9769
|
statusColor = theme.status.success;
|
|
9745
9770
|
break;
|
|
9746
|
-
case
|
|
9771
|
+
case MCPServerStatus.CONNECTING:
|
|
9747
9772
|
statusIndicator = "\u{1F504}";
|
|
9748
9773
|
statusText = "Starting... (first startup may take longer)";
|
|
9749
9774
|
statusColor = theme.status.warning;
|
|
9750
9775
|
break;
|
|
9751
|
-
case
|
|
9776
|
+
case MCPServerStatus.DISCONNECTED:
|
|
9752
9777
|
default:
|
|
9753
9778
|
statusIndicator = "\u{1F534}";
|
|
9754
9779
|
statusText = "Disconnected";
|
|
@@ -9796,12 +9821,12 @@ var McpStatus = ({
|
|
|
9796
9821
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9797
9822
|
" - ",
|
|
9798
9823
|
statusText,
|
|
9799
|
-
status ===
|
|
9824
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
9800
9825
|
] }),
|
|
9801
9826
|
authStatusNode
|
|
9802
9827
|
] }),
|
|
9803
|
-
status ===
|
|
9804
|
-
status ===
|
|
9828
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
9829
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9805
9830
|
" (",
|
|
9806
9831
|
toolCount,
|
|
9807
9832
|
" tools cached)"
|
|
@@ -10379,7 +10404,7 @@ var Notifications = () => {
|
|
|
10379
10404
|
if (dismissed) return [];
|
|
10380
10405
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
10381
10406
|
return startupWarnings.filter((w) => {
|
|
10382
|
-
if (w.priority ===
|
|
10407
|
+
if (w.priority === WarningPriority.Low) {
|
|
10383
10408
|
const count = counts[w.id] || 0;
|
|
10384
10409
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
10385
10410
|
}
|
|
@@ -10392,7 +10417,7 @@ var Notifications = () => {
|
|
|
10392
10417
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
10393
10418
|
let changed = false;
|
|
10394
10419
|
visibleWarnings.forEach((w) => {
|
|
10395
|
-
if (w.priority ===
|
|
10420
|
+
if (w.priority === WarningPriority.Low) {
|
|
10396
10421
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
10397
10422
|
changed = true;
|
|
10398
10423
|
}
|
|
@@ -10499,7 +10524,7 @@ var UserIdentity = ({ config }) => {
|
|
|
10499
10524
|
}
|
|
10500
10525
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
10501
10526
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
|
|
10502
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
10527
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { children: [
|
|
10503
10528
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
|
|
10504
10529
|
"Signed in with Google",
|
|
10505
10530
|
email ? ":" : ""
|
|
@@ -10891,7 +10916,7 @@ var import_react31 = __toESM(require_react(), 1);
|
|
|
10891
10916
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
10892
10917
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
10893
10918
|
const confirmingTools = allPendingTools.filter(
|
|
10894
|
-
(tool) => tool.status ===
|
|
10919
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
10895
10920
|
);
|
|
10896
10921
|
if (confirmingTools.length === 0) {
|
|
10897
10922
|
return null;
|
|
@@ -12201,7 +12226,7 @@ var ExitPlanModeDialog = ({
|
|
|
12201
12226
|
{
|
|
12202
12227
|
questions: [
|
|
12203
12228
|
{
|
|
12204
|
-
type:
|
|
12229
|
+
type: QuestionType.CHOICE,
|
|
12205
12230
|
header: "Approval",
|
|
12206
12231
|
question: planContent,
|
|
12207
12232
|
options: [
|
|
@@ -12222,9 +12247,9 @@ var ExitPlanModeDialog = ({
|
|
|
12222
12247
|
onSubmit: (answers) => {
|
|
12223
12248
|
const answer = answers["0"];
|
|
12224
12249
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
12225
|
-
onApprove(
|
|
12250
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
12226
12251
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
12227
|
-
onApprove(
|
|
12252
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
12228
12253
|
} else if (answer) {
|
|
12229
12254
|
onFeedback(answer);
|
|
12230
12255
|
}
|
|
@@ -12437,7 +12462,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12437
12462
|
(0, import_react36.useEffect)(() => {
|
|
12438
12463
|
if (isCancelling) {
|
|
12439
12464
|
setIsCancelling(false);
|
|
12440
|
-
handleConfirm(
|
|
12465
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12441
12466
|
}
|
|
12442
12467
|
}, [isCancelling, handleConfirm]);
|
|
12443
12468
|
const handleSelect = (0, import_react36.useCallback)(
|
|
@@ -12450,19 +12475,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
12450
12475
|
if (!confirmationDetails.isModifying) {
|
|
12451
12476
|
options2.push({
|
|
12452
12477
|
label: "Allow once",
|
|
12453
|
-
value:
|
|
12478
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12454
12479
|
key: "Allow once"
|
|
12455
12480
|
});
|
|
12456
12481
|
if (isTrustedFolder && !confirmationDetails.isBuildFile) {
|
|
12457
12482
|
options2.push({
|
|
12458
12483
|
label: "Allow for this session",
|
|
12459
|
-
value:
|
|
12484
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12460
12485
|
key: "Allow for this session"
|
|
12461
12486
|
});
|
|
12462
12487
|
if (allowPermanentApproval) {
|
|
12463
12488
|
options2.push({
|
|
12464
12489
|
label: "Allow for this file in all future sessions",
|
|
12465
|
-
value:
|
|
12490
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12466
12491
|
key: "Allow for this file in all future sessions"
|
|
12467
12492
|
});
|
|
12468
12493
|
}
|
|
@@ -12470,45 +12495,45 @@ ${deceptiveUrlWarnings.map(
|
|
|
12470
12495
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
12471
12496
|
options2.push({
|
|
12472
12497
|
label: "Modify with external editor",
|
|
12473
|
-
value:
|
|
12498
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
12474
12499
|
key: "Modify with external editor"
|
|
12475
12500
|
});
|
|
12476
12501
|
}
|
|
12477
12502
|
options2.push({
|
|
12478
12503
|
label: "No, suggest changes (esc)",
|
|
12479
|
-
value:
|
|
12504
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12480
12505
|
key: "No, suggest changes (esc)"
|
|
12481
12506
|
});
|
|
12482
12507
|
}
|
|
12483
12508
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
12484
12509
|
options2.push({
|
|
12485
12510
|
label: "Allow once",
|
|
12486
|
-
value:
|
|
12511
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12487
12512
|
key: "Allow once"
|
|
12488
12513
|
});
|
|
12489
12514
|
if (isTrustedFolder) {
|
|
12490
12515
|
options2.push({
|
|
12491
12516
|
label: "Allow for this session",
|
|
12492
|
-
value:
|
|
12517
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12493
12518
|
key: "Allow for this session"
|
|
12494
12519
|
});
|
|
12495
12520
|
if (allowPermanentApproval) {
|
|
12496
12521
|
options2.push({
|
|
12497
12522
|
label: "Allow for all future sessions",
|
|
12498
|
-
value:
|
|
12523
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12499
12524
|
key: "Allow for all future sessions"
|
|
12500
12525
|
});
|
|
12501
12526
|
}
|
|
12502
12527
|
}
|
|
12503
12528
|
options2.push({
|
|
12504
12529
|
label: "No, suggest changes (esc)",
|
|
12505
|
-
value:
|
|
12530
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12506
12531
|
key: "No, suggest changes (esc)"
|
|
12507
12532
|
});
|
|
12508
12533
|
} else if (confirmationDetails.type === "exec") {
|
|
12509
12534
|
options2.push({
|
|
12510
12535
|
label: "Allow once",
|
|
12511
|
-
value:
|
|
12536
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12512
12537
|
key: "Allow once"
|
|
12513
12538
|
});
|
|
12514
12539
|
const hasUntrustedFlags = confirmationDetails.untrustedFlags && confirmationDetails.untrustedFlags.length > 0;
|
|
@@ -12516,75 +12541,75 @@ ${deceptiveUrlWarnings.map(
|
|
|
12516
12541
|
if (isTrustedFolder && !hasUntrustedFlags && !hasModifiedBuildFiles) {
|
|
12517
12542
|
options2.push({
|
|
12518
12543
|
label: `Allow for this session`,
|
|
12519
|
-
value:
|
|
12544
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12520
12545
|
key: `Allow for this session`
|
|
12521
12546
|
});
|
|
12522
12547
|
if (allowPermanentApproval) {
|
|
12523
12548
|
options2.push({
|
|
12524
12549
|
label: `Allow this command for all future sessions`,
|
|
12525
|
-
value:
|
|
12550
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12526
12551
|
key: `Allow for all future sessions`
|
|
12527
12552
|
});
|
|
12528
12553
|
}
|
|
12529
12554
|
}
|
|
12530
12555
|
options2.push({
|
|
12531
12556
|
label: "No, suggest changes (esc)",
|
|
12532
|
-
value:
|
|
12557
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12533
12558
|
key: "No, suggest changes (esc)"
|
|
12534
12559
|
});
|
|
12535
12560
|
} else if (confirmationDetails.type === "info") {
|
|
12536
12561
|
options2.push({
|
|
12537
12562
|
label: "Allow once",
|
|
12538
|
-
value:
|
|
12563
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12539
12564
|
key: "Allow once"
|
|
12540
12565
|
});
|
|
12541
12566
|
if (isTrustedFolder) {
|
|
12542
12567
|
options2.push({
|
|
12543
12568
|
label: "Allow for this session",
|
|
12544
|
-
value:
|
|
12569
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12545
12570
|
key: "Allow for this session"
|
|
12546
12571
|
});
|
|
12547
12572
|
if (allowPermanentApproval) {
|
|
12548
12573
|
options2.push({
|
|
12549
12574
|
label: "Allow for all future sessions",
|
|
12550
|
-
value:
|
|
12575
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12551
12576
|
key: "Allow for all future sessions"
|
|
12552
12577
|
});
|
|
12553
12578
|
}
|
|
12554
12579
|
}
|
|
12555
12580
|
options2.push({
|
|
12556
12581
|
label: "No, suggest changes (esc)",
|
|
12557
|
-
value:
|
|
12582
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12558
12583
|
key: "No, suggest changes (esc)"
|
|
12559
12584
|
});
|
|
12560
12585
|
} else if (confirmationDetails.type === "mcp") {
|
|
12561
12586
|
options2.push({
|
|
12562
12587
|
label: "Allow once",
|
|
12563
|
-
value:
|
|
12588
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12564
12589
|
key: "Allow once"
|
|
12565
12590
|
});
|
|
12566
12591
|
if (isTrustedFolder) {
|
|
12567
12592
|
options2.push({
|
|
12568
12593
|
label: "Allow tool for this session",
|
|
12569
|
-
value:
|
|
12594
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
12570
12595
|
key: "Allow tool for this session"
|
|
12571
12596
|
});
|
|
12572
12597
|
options2.push({
|
|
12573
12598
|
label: "Allow all server tools for this session",
|
|
12574
|
-
value:
|
|
12599
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
12575
12600
|
key: "Allow all server tools for this session"
|
|
12576
12601
|
});
|
|
12577
12602
|
if (allowPermanentApproval) {
|
|
12578
12603
|
options2.push({
|
|
12579
12604
|
label: "Allow tool for all future sessions",
|
|
12580
|
-
value:
|
|
12605
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12581
12606
|
key: "Allow tool for all future sessions"
|
|
12582
12607
|
});
|
|
12583
12608
|
}
|
|
12584
12609
|
}
|
|
12585
12610
|
options2.push({
|
|
12586
12611
|
label: "No, suggest changes (esc)",
|
|
12587
|
-
value:
|
|
12612
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12588
12613
|
key: "No, suggest changes (esc)"
|
|
12589
12614
|
});
|
|
12590
12615
|
}
|
|
@@ -12622,10 +12647,8 @@ ${deceptiveUrlWarnings.map(
|
|
|
12622
12647
|
} else if (confirmationDetails.type === "exec") {
|
|
12623
12648
|
const executionProps = confirmationDetails;
|
|
12624
12649
|
const commandsToDisplay = executionProps.commands && executionProps.commands.length > 0 ? executionProps.commands : [executionProps.command];
|
|
12625
|
-
const containsRedirection = commandsToDisplay.some(
|
|
12626
|
-
|
|
12627
|
-
);
|
|
12628
|
-
const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
|
|
12650
|
+
const containsRedirection = typeof executionProps.hasRedirection === "boolean" ? executionProps.hasRedirection : commandsToDisplay.some((cmd) => hasRedirection(cmd));
|
|
12651
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12629
12652
|
if (containsRedirection && !isAutoEdit) {
|
|
12630
12653
|
extraInfoLines = 1;
|
|
12631
12654
|
}
|
|
@@ -12652,7 +12675,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12652
12675
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
12653
12676
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
12654
12677
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
12655
|
-
(o) => o.value ===
|
|
12678
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
12656
12679
|
);
|
|
12657
12680
|
if (alwaysAndSaveIndex !== -1) {
|
|
12658
12681
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -12708,10 +12731,10 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12708
12731
|
{
|
|
12709
12732
|
questions: confirmationDetails.questions,
|
|
12710
12733
|
onSubmit: (answers) => {
|
|
12711
|
-
handleConfirm(
|
|
12734
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
12712
12735
|
},
|
|
12713
12736
|
onCancel: () => {
|
|
12714
|
-
handleConfirm(
|
|
12737
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12715
12738
|
},
|
|
12716
12739
|
width: safeTerminalWidth,
|
|
12717
12740
|
availableHeight: bodyHeight
|
|
@@ -12732,19 +12755,19 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12732
12755
|
planPath: confirmationDetails.planPath,
|
|
12733
12756
|
getPreferredEditor,
|
|
12734
12757
|
onApprove: (approvalMode) => {
|
|
12735
|
-
handleConfirm(
|
|
12758
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12736
12759
|
approved: true,
|
|
12737
12760
|
approvalMode
|
|
12738
12761
|
});
|
|
12739
12762
|
},
|
|
12740
12763
|
onFeedback: (feedback) => {
|
|
12741
|
-
handleConfirm(
|
|
12764
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12742
12765
|
approved: false,
|
|
12743
12766
|
feedback
|
|
12744
12767
|
});
|
|
12745
12768
|
},
|
|
12746
12769
|
onCancel: () => {
|
|
12747
|
-
handleConfirm(
|
|
12770
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12748
12771
|
},
|
|
12749
12772
|
width: safeTerminalWidth,
|
|
12750
12773
|
availableHeight: bodyHeight
|
|
@@ -12851,10 +12874,8 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12851
12874
|
const executionProps = confirmationDetails;
|
|
12852
12875
|
const isShell = isShellTool(toolName);
|
|
12853
12876
|
const commandsToDisplay = executionProps.commands && executionProps.commands.length > 1 ? executionProps.commands : [executionProps.command];
|
|
12854
|
-
const containsRedirection = commandsToDisplay.some(
|
|
12855
|
-
|
|
12856
|
-
);
|
|
12857
|
-
const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
|
|
12877
|
+
const containsRedirection = typeof executionProps.hasRedirection === "boolean" ? executionProps.hasRedirection : commandsToDisplay.some((cmd) => hasRedirection(cmd));
|
|
12878
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12858
12879
|
let warnings = null;
|
|
12859
12880
|
if (containsRedirection && !isAutoEdit) {
|
|
12860
12881
|
const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
|
|
@@ -13013,7 +13034,7 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
13013
13034
|
const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
|
|
13014
13035
|
const renderRadioItem = (0, import_react36.useCallback)(
|
|
13015
13036
|
(item, { titleColor }) => {
|
|
13016
|
-
if (item.value ===
|
|
13037
|
+
if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
13017
13038
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
|
|
13018
13039
|
item.label,
|
|
13019
13040
|
" ",
|
|
@@ -13428,7 +13449,7 @@ var MainContent = () => {
|
|
|
13428
13449
|
const hasConfirmationQueue = Boolean(
|
|
13429
13450
|
showConfirmationQueue && confirmingTool
|
|
13430
13451
|
);
|
|
13431
|
-
const isVisiblePendingItem = (item) => item.type !== "tool_group" || item.tools.some((t) => t.status !==
|
|
13452
|
+
const isVisiblePendingItem = (item) => item.type !== "tool_group" || item.tools.some((t) => t.status !== CoreToolCallStatus.AwaitingApproval);
|
|
13432
13453
|
const visiblePendingCount = pendingHistoryItems.filter(isVisiblePendingItem).length;
|
|
13433
13454
|
const shouldPartitionHeight = !isAlternateBufferOrTerminalBuffer && hasConfirmationQueue && visiblePendingCount > 0;
|
|
13434
13455
|
const pendingCount = Math.max(1, visiblePendingCount);
|
|
@@ -15153,7 +15174,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
|
|
|
15153
15174
|
if (settings.merged.security.auth.useExternal) {
|
|
15154
15175
|
return null;
|
|
15155
15176
|
}
|
|
15156
|
-
if (authType ===
|
|
15177
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
15157
15178
|
return null;
|
|
15158
15179
|
}
|
|
15159
15180
|
return validateAuthMethod(authType);
|
|
@@ -15205,7 +15226,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
15205
15226
|
}
|
|
15206
15227
|
return;
|
|
15207
15228
|
}
|
|
15208
|
-
if (authType ===
|
|
15229
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
15209
15230
|
const key = await reloadApiKey();
|
|
15210
15231
|
if (!key) {
|
|
15211
15232
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -15288,31 +15309,31 @@ function AuthDialog({
|
|
|
15288
15309
|
let items = [
|
|
15289
15310
|
{
|
|
15290
15311
|
label: "Sign in with Google",
|
|
15291
|
-
value:
|
|
15292
|
-
key:
|
|
15312
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
15313
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
15293
15314
|
},
|
|
15294
15315
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
15295
15316
|
{
|
|
15296
15317
|
label: "Use Cloud Shell user credentials",
|
|
15297
|
-
value:
|
|
15298
|
-
key:
|
|
15318
|
+
value: AuthType.COMPUTE_ADC,
|
|
15319
|
+
key: AuthType.COMPUTE_ADC
|
|
15299
15320
|
}
|
|
15300
15321
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
15301
15322
|
{
|
|
15302
15323
|
label: "Use metadata server application default credentials",
|
|
15303
|
-
value:
|
|
15304
|
-
key:
|
|
15324
|
+
value: AuthType.COMPUTE_ADC,
|
|
15325
|
+
key: AuthType.COMPUTE_ADC
|
|
15305
15326
|
}
|
|
15306
15327
|
] : [],
|
|
15307
15328
|
{
|
|
15308
15329
|
label: "Use Gemini API Key",
|
|
15309
|
-
value:
|
|
15310
|
-
key:
|
|
15330
|
+
value: AuthType.USE_GEMINI,
|
|
15331
|
+
key: AuthType.USE_GEMINI
|
|
15311
15332
|
},
|
|
15312
15333
|
{
|
|
15313
15334
|
label: "Vertex AI",
|
|
15314
|
-
value:
|
|
15315
|
-
key:
|
|
15335
|
+
value: AuthType.USE_VERTEX_AI,
|
|
15336
|
+
key: AuthType.USE_VERTEX_AI
|
|
15316
15337
|
}
|
|
15317
15338
|
];
|
|
15318
15339
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -15334,9 +15355,9 @@ function AuthDialog({
|
|
|
15334
15355
|
return item.value === defaultAuthType;
|
|
15335
15356
|
}
|
|
15336
15357
|
if (process.env["GEMINI_API_KEY"]) {
|
|
15337
|
-
return item.value ===
|
|
15358
|
+
return item.value === AuthType.USE_GEMINI;
|
|
15338
15359
|
}
|
|
15339
|
-
return item.value ===
|
|
15360
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
15340
15361
|
});
|
|
15341
15362
|
if (settings.merged.security.auth.enforcedType) {
|
|
15342
15363
|
initialAuthIndex = 0;
|
|
@@ -15347,14 +15368,14 @@ function AuthDialog({
|
|
|
15347
15368
|
return;
|
|
15348
15369
|
}
|
|
15349
15370
|
if (authType) {
|
|
15350
|
-
const needsRestart = authType ===
|
|
15371
|
+
const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
|
|
15351
15372
|
if (needsRestart) {
|
|
15352
15373
|
setAuthContext({ requiresRestart: true });
|
|
15353
15374
|
} else {
|
|
15354
15375
|
setAuthContext({});
|
|
15355
15376
|
}
|
|
15356
15377
|
const currentAuthType = settings.merged.security?.auth?.selectedType;
|
|
15357
|
-
if (authType ===
|
|
15378
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE || currentAuthType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
15358
15379
|
try {
|
|
15359
15380
|
await clearCachedCredentialFile();
|
|
15360
15381
|
} catch (error) {
|
|
@@ -15362,13 +15383,13 @@ function AuthDialog({
|
|
|
15362
15383
|
onAuthError(
|
|
15363
15384
|
"Failed to clear cached credentials: " + (error instanceof Error ? error.message : String(error))
|
|
15364
15385
|
);
|
|
15365
|
-
if (authType ===
|
|
15386
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
15366
15387
|
return;
|
|
15367
15388
|
}
|
|
15368
15389
|
}
|
|
15369
15390
|
}
|
|
15370
15391
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
15371
|
-
if (authType ===
|
|
15392
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
15372
15393
|
setExiting(true);
|
|
15373
15394
|
setTimeout(() => {
|
|
15374
15395
|
void relaunchApp({ overrideAuthType: authType }).catch((err) => {
|
|
@@ -15378,7 +15399,7 @@ function AuthDialog({
|
|
|
15378
15399
|
}, 100);
|
|
15379
15400
|
return;
|
|
15380
15401
|
}
|
|
15381
|
-
if (authType ===
|
|
15402
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
15382
15403
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
15383
15404
|
return;
|
|
15384
15405
|
}
|
|
@@ -16192,11 +16213,11 @@ var PrivacyNoticeText = ({
|
|
|
16192
16213
|
}) => {
|
|
16193
16214
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
16194
16215
|
switch (authType) {
|
|
16195
|
-
case
|
|
16216
|
+
case AuthType.USE_GEMINI:
|
|
16196
16217
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
|
|
16197
|
-
case
|
|
16218
|
+
case AuthType.USE_VERTEX_AI:
|
|
16198
16219
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
16199
|
-
case
|
|
16220
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
16200
16221
|
default:
|
|
16201
16222
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
16202
16223
|
}
|
|
@@ -16256,7 +16277,7 @@ function ProQuotaDialog({
|
|
|
16256
16277
|
value: "retry_always",
|
|
16257
16278
|
key: "retry_always"
|
|
16258
16279
|
},
|
|
16259
|
-
...authType ===
|
|
16280
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
16260
16281
|
{
|
|
16261
16282
|
label: "Upgrade for higher limits",
|
|
16262
16283
|
value: "upgrade",
|
|
@@ -17429,7 +17450,7 @@ function ModelDialog({ onClose }) {
|
|
|
17429
17450
|
const useLatestFlash = config?.hasLatestFlashGAAccess?.() ?? false;
|
|
17430
17451
|
const useLatestFlashLite = config?.hasLatestFlashLiteGAAccess?.() ?? false;
|
|
17431
17452
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
17432
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
17453
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
17433
17454
|
const manualModelSelected = (0, import_react54.useMemo)(() => {
|
|
17434
17455
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
17435
17456
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -18757,10 +18778,10 @@ function initializeConsoleStore() {
|
|
|
18757
18778
|
globalConsoleMessages = [];
|
|
18758
18779
|
globalErrorCount = 0;
|
|
18759
18780
|
notifyListeners();
|
|
18760
|
-
coreEvents.off(
|
|
18761
|
-
coreEvents.off(
|
|
18762
|
-
coreEvents.on(
|
|
18763
|
-
coreEvents.on(
|
|
18781
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18782
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
18783
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18784
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
18764
18785
|
}
|
|
18765
18786
|
function notifyListeners() {
|
|
18766
18787
|
for (const listener of listeners) {
|
|
@@ -20903,7 +20924,7 @@ function usePromptCompletion({
|
|
|
20903
20924
|
{ model: "prompt-completion" },
|
|
20904
20925
|
contents,
|
|
20905
20926
|
signal,
|
|
20906
|
-
|
|
20927
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20907
20928
|
);
|
|
20908
20929
|
if (signal.aborted) {
|
|
20909
20930
|
return;
|
|
@@ -22985,9 +23006,9 @@ var InputPrompt = ({
|
|
|
22985
23006
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22986
23007
|
}
|
|
22987
23008
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22988
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22989
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22990
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
23009
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
23010
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
23011
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22991
23012
|
let statusColor;
|
|
22992
23013
|
let statusText = "";
|
|
22993
23014
|
if (shellModeActive) {
|
|
@@ -23835,22 +23856,22 @@ var ApprovalModeIndicator = ({
|
|
|
23835
23856
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
23836
23857
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
23837
23858
|
switch (approvalMode) {
|
|
23838
|
-
case
|
|
23859
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23839
23860
|
textColor = theme.status.warning;
|
|
23840
23861
|
textContent = "auto-accept edits";
|
|
23841
23862
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23842
23863
|
break;
|
|
23843
|
-
case
|
|
23864
|
+
case ApprovalMode.PLAN:
|
|
23844
23865
|
textColor = theme.status.success;
|
|
23845
23866
|
textContent = "plan";
|
|
23846
23867
|
subText = `${cycleHint} to manual`;
|
|
23847
23868
|
break;
|
|
23848
|
-
case
|
|
23869
|
+
case ApprovalMode.YOLO:
|
|
23849
23870
|
textColor = theme.status.error;
|
|
23850
23871
|
textContent = "YOLO";
|
|
23851
23872
|
subText = yoloHint;
|
|
23852
23873
|
break;
|
|
23853
|
-
case
|
|
23874
|
+
case ApprovalMode.DEFAULT:
|
|
23854
23875
|
default:
|
|
23855
23876
|
textColor = theme.text.accent;
|
|
23856
23877
|
textContent = "";
|
|
@@ -23898,7 +23919,7 @@ var useComposerStatus = () => {
|
|
|
23898
23919
|
(item) => item.type === "tool_group"
|
|
23899
23920
|
).some(
|
|
23900
23921
|
(item) => item.tools.some(
|
|
23901
|
-
(tool) => tool.status ===
|
|
23922
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23902
23923
|
)
|
|
23903
23924
|
),
|
|
23904
23925
|
[uiState.pendingHistoryItems]
|
|
@@ -23913,13 +23934,13 @@ var useComposerStatus = () => {
|
|
|
23913
23934
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23914
23935
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23915
23936
|
switch (showApprovalModeIndicator) {
|
|
23916
|
-
case
|
|
23937
|
+
case ApprovalMode.YOLO:
|
|
23917
23938
|
return { text: "YOLO", color: theme.status.error };
|
|
23918
|
-
case
|
|
23939
|
+
case ApprovalMode.PLAN:
|
|
23919
23940
|
return { text: "plan", color: theme.status.success };
|
|
23920
|
-
case
|
|
23941
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23921
23942
|
return { text: "auto edit", color: theme.status.warning };
|
|
23922
|
-
case
|
|
23943
|
+
case ApprovalMode.DEFAULT:
|
|
23923
23944
|
default:
|
|
23924
23945
|
return null;
|
|
23925
23946
|
}
|
|
@@ -24289,7 +24310,7 @@ var ConfigInitDisplay = ({
|
|
|
24289
24310
|
let connected = 0;
|
|
24290
24311
|
const connecting = [];
|
|
24291
24312
|
for (const [name, client] of clients.entries()) {
|
|
24292
|
-
if (client.getStatus() ===
|
|
24313
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
24293
24314
|
connected++;
|
|
24294
24315
|
} else {
|
|
24295
24316
|
connecting.push(name);
|
|
@@ -24311,9 +24332,9 @@ var ConfigInitDisplay = ({
|
|
|
24311
24332
|
);
|
|
24312
24333
|
}
|
|
24313
24334
|
};
|
|
24314
|
-
coreEvents.on(
|
|
24335
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
24315
24336
|
return () => {
|
|
24316
|
-
coreEvents.off(
|
|
24337
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
24317
24338
|
};
|
|
24318
24339
|
}, [initialMessage]);
|
|
24319
24340
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
|
|
@@ -25022,7 +25043,9 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
25022
25043
|
{ type: "user_shell", text: rawQuery },
|
|
25023
25044
|
userMessageTimestamp
|
|
25024
25045
|
);
|
|
25025
|
-
|
|
25046
|
+
const useAsyncPowerShellGeminiCheck = typeof isDefaultIsInteractiveGeminiCommand === "function" && isDefaultIsInteractiveGeminiCommand(isInteractiveGeminiCommand) && typeof isInteractiveGeminiCommandAsync === "function" && typeof isKnownInteractiveGeminiCommandSync === "function" && typeof getShellConfiguration === "function" && getShellConfiguration().shell === "powershell";
|
|
25047
|
+
const syncInteractiveGeminiCheck = useAsyncPowerShellGeminiCheck ? isKnownInteractiveGeminiCommandSync(rawQuery) : isInteractiveGeminiCommand(rawQuery);
|
|
25048
|
+
if (syncInteractiveGeminiCheck === true) {
|
|
25026
25049
|
addItemToHistory(
|
|
25027
25050
|
{ type: "error", text: INTERACTIVE_GEMINI_SHELL_ERROR },
|
|
25028
25051
|
userMessageTimestamp
|
|
@@ -25034,6 +25057,22 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
25034
25057
|
let commandToExecute = rawQuery;
|
|
25035
25058
|
let pwdFilePath;
|
|
25036
25059
|
const executeCommand = async () => {
|
|
25060
|
+
if (syncInteractiveGeminiCheck === void 0 && await isInteractiveGeminiCommandAsync(
|
|
25061
|
+
rawQuery,
|
|
25062
|
+
void 0,
|
|
25063
|
+
abortSignal
|
|
25064
|
+
)) {
|
|
25065
|
+
addItemToHistory(
|
|
25066
|
+
{ type: "error", text: INTERACTIVE_GEMINI_SHELL_ERROR },
|
|
25067
|
+
userMessageTimestamp
|
|
25068
|
+
);
|
|
25069
|
+
return;
|
|
25070
|
+
}
|
|
25071
|
+
if (abortSignal.aborted) {
|
|
25072
|
+
setPendingHistoryItem(null);
|
|
25073
|
+
setShellInputFocused(false);
|
|
25074
|
+
return;
|
|
25075
|
+
}
|
|
25037
25076
|
let cumulativeStdout = "";
|
|
25038
25077
|
let isBinaryStream = false;
|
|
25039
25078
|
let binaryBytesReceived = 0;
|
|
@@ -25041,7 +25080,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
25041
25080
|
callId,
|
|
25042
25081
|
name: SHELL_COMMAND_NAME,
|
|
25043
25082
|
description: rawQuery,
|
|
25044
|
-
status:
|
|
25083
|
+
status: CoreToolCallStatus.Executing,
|
|
25045
25084
|
isClientInitiated: true,
|
|
25046
25085
|
resultDisplay: "",
|
|
25047
25086
|
confirmationDetails: void 0
|
|
@@ -25182,7 +25221,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
25182
25221
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
25183
25222
|
}
|
|
25184
25223
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
25185
|
-
let finalStatus =
|
|
25224
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
25186
25225
|
const prependToAnsiOutput = (output, text) => {
|
|
25187
25226
|
const newLines = text.split("\n").map((line) => [
|
|
25188
25227
|
{
|
|
@@ -25201,20 +25240,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
25201
25240
|
};
|
|
25202
25241
|
let prefix = "";
|
|
25203
25242
|
if (result.error) {
|
|
25204
|
-
finalStatus =
|
|
25243
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
25205
25244
|
prefix = result.error.message;
|
|
25206
25245
|
} else if (result.aborted) {
|
|
25207
|
-
finalStatus =
|
|
25246
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
25208
25247
|
prefix = "Command was cancelled.";
|
|
25209
25248
|
} else if (result.backgrounded) {
|
|
25210
|
-
finalStatus =
|
|
25249
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
25211
25250
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
25212
25251
|
mainContent = finalOutput;
|
|
25213
25252
|
} else if (result.signal) {
|
|
25214
|
-
finalStatus =
|
|
25253
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
25215
25254
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
25216
25255
|
} else if (result.exitCode !== 0) {
|
|
25217
|
-
finalStatus =
|
|
25256
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
25218
25257
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
25219
25258
|
}
|
|
25220
25259
|
if (prefix) {
|
|
@@ -25240,7 +25279,7 @@ ${mainContent}`;
|
|
|
25240
25279
|
status: finalStatus,
|
|
25241
25280
|
resultDisplay: finalOutput
|
|
25242
25281
|
};
|
|
25243
|
-
if (finalStatus !==
|
|
25282
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
25244
25283
|
addItemToHistory(
|
|
25245
25284
|
{
|
|
25246
25285
|
type: "tool_group",
|
|
@@ -26266,13 +26305,13 @@ function useQuotaAndFallback({
|
|
|
26266
26305
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
26267
26306
|
`/stats model for usage details`,
|
|
26268
26307
|
`/model to switch models.`,
|
|
26269
|
-
contentGeneratorConfig?.authType ===
|
|
26308
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
26270
26309
|
].filter(Boolean);
|
|
26271
26310
|
message = messageLines.join("\n");
|
|
26272
26311
|
}
|
|
26273
26312
|
} else if (error instanceof ModelNotFoundError) {
|
|
26274
26313
|
isModelNotFoundError = true;
|
|
26275
|
-
if (contentGeneratorConfig?.authType ===
|
|
26314
|
+
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
26276
26315
|
const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
|
|
26277
26316
|
const messageLines = [
|
|
26278
26317
|
`Model "${failedModel}" is not available in region "${location}".`,
|
|
@@ -26466,7 +26505,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
26466
26505
|
);
|
|
26467
26506
|
setEditorError(null);
|
|
26468
26507
|
setIsEditorDialogOpen(false);
|
|
26469
|
-
coreEvents.emit(
|
|
26508
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
26470
26509
|
} catch (error) {
|
|
26471
26510
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
26472
26511
|
}
|
|
@@ -26475,7 +26514,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
26475
26514
|
);
|
|
26476
26515
|
const exitEditorDialog = (0, import_react92.useCallback)(() => {
|
|
26477
26516
|
setIsEditorDialogOpen(false);
|
|
26478
|
-
coreEvents.emit(
|
|
26517
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
26479
26518
|
}, []);
|
|
26480
26519
|
return {
|
|
26481
26520
|
isEditorDialogOpen,
|
|
@@ -26863,7 +26902,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26863
26902
|
canonicalPath: resolvedCommandPath
|
|
26864
26903
|
} = parseSlashCommand(trimmed, commands);
|
|
26865
26904
|
if (!commandToExecute) {
|
|
26866
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
26905
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
26867
26906
|
if (isMcpLoading) {
|
|
26868
26907
|
setIsProcessing(true);
|
|
26869
26908
|
if (addToHistory) {
|
|
@@ -27044,7 +27083,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
27044
27083
|
onConfirm: async (resolvedOutcome) => {
|
|
27045
27084
|
resolve3({
|
|
27046
27085
|
outcome: resolvedOutcome,
|
|
27047
|
-
approvedCommands: resolvedOutcome ===
|
|
27086
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
27048
27087
|
});
|
|
27049
27088
|
}
|
|
27050
27089
|
};
|
|
@@ -27052,7 +27091,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
27052
27091
|
callId,
|
|
27053
27092
|
name: "Expansion",
|
|
27054
27093
|
description: "Command expansion needs shell access",
|
|
27055
|
-
status:
|
|
27094
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
27056
27095
|
isClientInitiated: true,
|
|
27057
27096
|
resultDisplay: void 0,
|
|
27058
27097
|
confirmationDetails
|
|
@@ -27063,7 +27102,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
27063
27102
|
});
|
|
27064
27103
|
});
|
|
27065
27104
|
setPendingItem(null);
|
|
27066
|
-
if (outcome ===
|
|
27105
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
27067
27106
|
addItem(
|
|
27068
27107
|
{
|
|
27069
27108
|
type: "info" /* INFO */,
|
|
@@ -27073,7 +27112,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
27073
27112
|
);
|
|
27074
27113
|
return { type: "handled" };
|
|
27075
27114
|
}
|
|
27076
|
-
if (outcome ===
|
|
27115
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
27077
27116
|
setSessionShellAllowlist(
|
|
27078
27117
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
27079
27118
|
);
|
|
@@ -27575,7 +27614,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
27575
27614
|
const handler = (event) => {
|
|
27576
27615
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
27577
27616
|
const hasExecuting = event.toolCalls.some(
|
|
27578
|
-
(tc) => tc.status ===
|
|
27617
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
27579
27618
|
);
|
|
27580
27619
|
if (hasExecuting) {
|
|
27581
27620
|
setLastToolOutputTime(Date.now());
|
|
@@ -27584,7 +27623,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
27584
27623
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
27585
27624
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
27586
27625
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
27587
|
-
(tc) => tc.status ===
|
|
27626
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
27588
27627
|
);
|
|
27589
27628
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
27590
27629
|
return prev;
|
|
@@ -27596,9 +27635,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
27596
27635
|
};
|
|
27597
27636
|
});
|
|
27598
27637
|
};
|
|
27599
|
-
messageBus.subscribe(
|
|
27638
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
27600
27639
|
return () => {
|
|
27601
|
-
messageBus.unsubscribe(
|
|
27640
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
27602
27641
|
};
|
|
27603
27642
|
}, [messageBus, internalAdaptToolCalls]);
|
|
27604
27643
|
(0, import_react99.useEffect)(() => {
|
|
@@ -27620,9 +27659,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
27620
27659
|
};
|
|
27621
27660
|
});
|
|
27622
27661
|
};
|
|
27623
|
-
messageBus.subscribe(
|
|
27662
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
27624
27663
|
return () => {
|
|
27625
|
-
messageBus.unsubscribe(
|
|
27664
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
27626
27665
|
};
|
|
27627
27666
|
}, [messageBus]);
|
|
27628
27667
|
const schedule = (0, import_react99.useCallback)(
|
|
@@ -27721,8 +27760,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
27721
27760
|
const prev = prevMap.get(coreCall.request.callId);
|
|
27722
27761
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
27723
27762
|
let status = coreCall.status;
|
|
27724
|
-
if ((status ===
|
|
27725
|
-
status =
|
|
27763
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
27764
|
+
status = CoreToolCallStatus.Executing;
|
|
27726
27765
|
}
|
|
27727
27766
|
return {
|
|
27728
27767
|
...coreCall,
|
|
@@ -27741,8 +27780,48 @@ var import_react101 = __toESM(require_react(), 1);
|
|
|
27741
27780
|
|
|
27742
27781
|
// packages/cli/src/ui/hooks/useTurnActivityMonitor.ts
|
|
27743
27782
|
var import_react100 = __toESM(require_react(), 1);
|
|
27783
|
+
var EMPTY_REDIRECTION_MAP = /* @__PURE__ */ new Map();
|
|
27784
|
+
function redirectionCacheReducer(state, action) {
|
|
27785
|
+
switch (action.type) {
|
|
27786
|
+
case "set": {
|
|
27787
|
+
if (state.get(action.command) === action.hasRedirection) {
|
|
27788
|
+
return state;
|
|
27789
|
+
}
|
|
27790
|
+
const next = new Map(state);
|
|
27791
|
+
next.set(action.command, action.hasRedirection);
|
|
27792
|
+
return next;
|
|
27793
|
+
}
|
|
27794
|
+
case "reset":
|
|
27795
|
+
return state.size === 0 ? state : EMPTY_REDIRECTION_MAP;
|
|
27796
|
+
default:
|
|
27797
|
+
return state;
|
|
27798
|
+
}
|
|
27799
|
+
}
|
|
27800
|
+
function shouldUseAsyncPowerShellRedirection() {
|
|
27801
|
+
return typeof isDefaultHasRedirection === "function" && isDefaultHasRedirection(hasRedirection) && typeof hasRedirectionAsync === "function" && typeof getShellConfiguration === "function" && getShellConfiguration().shell === "powershell";
|
|
27802
|
+
}
|
|
27803
|
+
function extractShellCommand(tc) {
|
|
27804
|
+
const rawCommand = tc.request.args?.["command"];
|
|
27805
|
+
return typeof rawCommand === "string" ? rawCommand : "";
|
|
27806
|
+
}
|
|
27744
27807
|
var useTurnActivityMonitor = (streamingState, activePtyId, pendingToolCalls = []) => {
|
|
27745
27808
|
const [operationStartTime, setOperationStartTime] = (0, import_react100.useState)(0);
|
|
27809
|
+
const [resolvedRedirections, dispatchRedirection] = (0, import_react100.useReducer)(
|
|
27810
|
+
redirectionCacheReducer,
|
|
27811
|
+
EMPTY_REDIRECTION_MAP
|
|
27812
|
+
);
|
|
27813
|
+
const inFlightCommandsRef = (0, import_react100.useRef)(/* @__PURE__ */ new Set());
|
|
27814
|
+
const turnEpochRef = (0, import_react100.useRef)(0);
|
|
27815
|
+
const turnAbortControllerRef = (0, import_react100.useRef)(null);
|
|
27816
|
+
const isMountedRef = (0, import_react100.useRef)(true);
|
|
27817
|
+
(0, import_react100.useEffect)(() => {
|
|
27818
|
+
isMountedRef.current = true;
|
|
27819
|
+
return () => {
|
|
27820
|
+
isMountedRef.current = false;
|
|
27821
|
+
turnAbortControllerRef.current?.abort();
|
|
27822
|
+
turnAbortControllerRef.current = null;
|
|
27823
|
+
};
|
|
27824
|
+
}, []);
|
|
27746
27825
|
const prevPtyIdRef = (0, import_react100.useRef)(void 0);
|
|
27747
27826
|
const prevStreamingStateRef = (0, import_react100.useRef)(void 0);
|
|
27748
27827
|
(0, import_react100.useEffect)(() => {
|
|
@@ -27757,17 +27836,69 @@ var useTurnActivityMonitor = (streamingState, activePtyId, pendingToolCalls = []
|
|
|
27757
27836
|
prevPtyIdRef.current = activePtyId;
|
|
27758
27837
|
prevStreamingStateRef.current = streamingState;
|
|
27759
27838
|
}, [streamingState, activePtyId]);
|
|
27760
|
-
|
|
27761
|
-
()
|
|
27762
|
-
|
|
27763
|
-
|
|
27764
|
-
|
|
27765
|
-
|
|
27839
|
+
(0, import_react100.useEffect)(() => {
|
|
27840
|
+
if (streamingState === "idle" /* Idle */ && pendingToolCalls.length === 0) {
|
|
27841
|
+
turnEpochRef.current += 1;
|
|
27842
|
+
turnAbortControllerRef.current?.abort();
|
|
27843
|
+
turnAbortControllerRef.current = null;
|
|
27844
|
+
inFlightCommandsRef.current.clear();
|
|
27845
|
+
dispatchRedirection({ type: "reset" });
|
|
27846
|
+
return;
|
|
27847
|
+
}
|
|
27848
|
+
if (!shouldUseAsyncPowerShellRedirection()) {
|
|
27849
|
+
return;
|
|
27850
|
+
}
|
|
27851
|
+
if (!turnAbortControllerRef.current || turnAbortControllerRef.current.signal.aborted) {
|
|
27852
|
+
turnAbortControllerRef.current = new AbortController();
|
|
27853
|
+
}
|
|
27854
|
+
const turnSignal = turnAbortControllerRef.current.signal;
|
|
27855
|
+
const epoch = turnEpochRef.current;
|
|
27856
|
+
for (const tc of pendingToolCalls) {
|
|
27857
|
+
if (tc.request.name !== "run_shell_command") {
|
|
27858
|
+
continue;
|
|
27859
|
+
}
|
|
27860
|
+
if (tc.confirmationDetails?.type === "exec" && typeof tc.confirmationDetails.hasRedirection === "boolean") {
|
|
27861
|
+
continue;
|
|
27862
|
+
}
|
|
27863
|
+
const command = extractShellCommand(tc);
|
|
27864
|
+
if (!command || !/[><]/.test(command) || resolvedRedirections.has(command) || inFlightCommandsRef.current.has(command)) {
|
|
27865
|
+
continue;
|
|
27866
|
+
}
|
|
27867
|
+
inFlightCommandsRef.current.add(command);
|
|
27868
|
+
void hasRedirectionAsync(command, void 0, turnSignal).then((redirected) => {
|
|
27869
|
+
inFlightCommandsRef.current.delete(command);
|
|
27870
|
+
if (isMountedRef.current && turnEpochRef.current === epoch && !turnSignal.aborted) {
|
|
27871
|
+
dispatchRedirection({
|
|
27872
|
+
type: "set",
|
|
27873
|
+
command,
|
|
27874
|
+
hasRedirection: redirected
|
|
27875
|
+
});
|
|
27876
|
+
}
|
|
27877
|
+
}).catch(() => {
|
|
27878
|
+
inFlightCommandsRef.current.delete(command);
|
|
27879
|
+
});
|
|
27880
|
+
}
|
|
27881
|
+
}, [streamingState, pendingToolCalls, resolvedRedirections]);
|
|
27882
|
+
const isRedirectionActive = (0, import_react100.useMemo)(() => {
|
|
27883
|
+
const useAsyncPowerShell = shouldUseAsyncPowerShellRedirection();
|
|
27884
|
+
return pendingToolCalls.some((tc) => {
|
|
27885
|
+
if (tc.request.name !== "run_shell_command") return false;
|
|
27886
|
+
if (tc.confirmationDetails?.type === "exec" && typeof tc.confirmationDetails.hasRedirection === "boolean") {
|
|
27887
|
+
return tc.confirmationDetails.hasRedirection;
|
|
27888
|
+
}
|
|
27889
|
+
const command = extractShellCommand(tc);
|
|
27890
|
+
if (!command) {
|
|
27891
|
+
return false;
|
|
27892
|
+
}
|
|
27893
|
+
if (!useAsyncPowerShell) {
|
|
27766
27894
|
return hasRedirection(command);
|
|
27767
|
-
}
|
|
27768
|
-
|
|
27769
|
-
|
|
27770
|
-
|
|
27895
|
+
}
|
|
27896
|
+
if (!/[><]/.test(command)) {
|
|
27897
|
+
return false;
|
|
27898
|
+
}
|
|
27899
|
+
return resolvedRedirections.get(command) ?? false;
|
|
27900
|
+
});
|
|
27901
|
+
}, [pendingToolCalls, resolvedRedirections]);
|
|
27771
27902
|
return {
|
|
27772
27903
|
operationStartTime,
|
|
27773
27904
|
isRedirectionActive
|
|
@@ -27779,7 +27910,7 @@ var CANCELLED_TOOL_ERROR_MESSAGE = "[Operation Cancelled] Reason: User cancelled
|
|
|
27779
27910
|
function createCancelledToolCall(request, tool, invocation) {
|
|
27780
27911
|
const fallbackToolName = request.name.trim() || "generic_tool";
|
|
27781
27912
|
return {
|
|
27782
|
-
status:
|
|
27913
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27783
27914
|
request,
|
|
27784
27915
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
27785
27916
|
tool: tool ?? {
|
|
@@ -27805,7 +27936,7 @@ function createCancelledToolCall(request, tool, invocation) {
|
|
|
27805
27936
|
],
|
|
27806
27937
|
resultDisplay: void 0,
|
|
27807
27938
|
error: new Error(CANCELLED_TOOL_ERROR_MESSAGE),
|
|
27808
|
-
errorType:
|
|
27939
|
+
errorType: ToolErrorType.UNHANDLED_EXCEPTION
|
|
27809
27940
|
}
|
|
27810
27941
|
};
|
|
27811
27942
|
}
|
|
@@ -27859,7 +27990,8 @@ var useAgentStream = ({
|
|
|
27859
27990
|
isClientInitiated: t.isClientInitiated ?? false,
|
|
27860
27991
|
prompt_id: ""
|
|
27861
27992
|
},
|
|
27862
|
-
status: t.status
|
|
27993
|
+
status: t.status,
|
|
27994
|
+
confirmationDetails: t.confirmationDetails
|
|
27863
27995
|
})),
|
|
27864
27996
|
[trackedTools]
|
|
27865
27997
|
);
|
|
@@ -27909,10 +28041,10 @@ var useAgentStream = ({
|
|
|
27909
28041
|
if (unpushedTools.length > 0) {
|
|
27910
28042
|
setTrackedTools(
|
|
27911
28043
|
(prev) => prev.map((tc) => {
|
|
27912
|
-
if (!pushedToolCallIdsRef.current.has(tc.callId) && tc.status !==
|
|
28044
|
+
if (!pushedToolCallIdsRef.current.has(tc.callId) && tc.status !== CoreToolCallStatus.Success && tc.status !== CoreToolCallStatus.Error && tc.status !== CoreToolCallStatus.Cancelled) {
|
|
27913
28045
|
return {
|
|
27914
28046
|
...tc,
|
|
27915
|
-
status:
|
|
28047
|
+
status: CoreToolCallStatus.Cancelled
|
|
27916
28048
|
};
|
|
27917
28049
|
}
|
|
27918
28050
|
return tc;
|
|
@@ -28057,14 +28189,14 @@ var useAgentStream = ({
|
|
|
28057
28189
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28058
28190
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28059
28191
|
const desc = legacyState?.description ?? "";
|
|
28060
|
-
const fallbackKind =
|
|
28192
|
+
const fallbackKind = Kind.Other;
|
|
28061
28193
|
const newCall = {
|
|
28062
28194
|
callId: event.requestId,
|
|
28063
28195
|
name: displayName,
|
|
28064
28196
|
originalRequestName: event.name,
|
|
28065
28197
|
description: desc,
|
|
28066
28198
|
display: event.display,
|
|
28067
|
-
status:
|
|
28199
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28068
28200
|
isClientInitiated: false,
|
|
28069
28201
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28070
28202
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28082,10 +28214,10 @@ var useAgentStream = ({
|
|
|
28082
28214
|
const evtStatus = legacyState?.status;
|
|
28083
28215
|
let status = tc.status;
|
|
28084
28216
|
if (evtStatus === "executing")
|
|
28085
|
-
status =
|
|
28086
|
-
else if (evtStatus === "error") status =
|
|
28217
|
+
status = CoreToolCallStatus.Executing;
|
|
28218
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28087
28219
|
else if (evtStatus === "success")
|
|
28088
|
-
status =
|
|
28220
|
+
status = CoreToolCallStatus.Success;
|
|
28089
28221
|
const display = event.display?.result;
|
|
28090
28222
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28091
28223
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28118,7 +28250,7 @@ var useAgentStream = ({
|
|
|
28118
28250
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28119
28251
|
return {
|
|
28120
28252
|
...tc,
|
|
28121
|
-
status: event.isError ?
|
|
28253
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28122
28254
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28123
28255
|
resultDisplay,
|
|
28124
28256
|
outputFile
|
|
@@ -28185,7 +28317,7 @@ var useAgentStream = ({
|
|
|
28185
28317
|
toolRequestArgsRef.current.clear();
|
|
28186
28318
|
if (typeof query === "string") {
|
|
28187
28319
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28188
|
-
void logger?.logMessage(
|
|
28320
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28189
28321
|
}
|
|
28190
28322
|
startNewPrompt();
|
|
28191
28323
|
}
|
|
@@ -28387,7 +28519,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
28387
28519
|
};
|
|
28388
28520
|
}
|
|
28389
28521
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
28390
|
-
return toolCall.status ===
|
|
28522
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
28391
28523
|
}
|
|
28392
28524
|
function showCitations(settings) {
|
|
28393
28525
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -28397,14 +28529,14 @@ function showCitations(settings) {
|
|
|
28397
28529
|
return true;
|
|
28398
28530
|
}
|
|
28399
28531
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
28400
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
28532
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
28401
28533
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
28402
28534
|
}
|
|
28403
28535
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
28404
|
-
if (tc.status ===
|
|
28536
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
28405
28537
|
return true;
|
|
28406
28538
|
}
|
|
28407
|
-
if (tc.status ===
|
|
28539
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
28408
28540
|
return !tc.responseSubmittedToGemini;
|
|
28409
28541
|
}
|
|
28410
28542
|
return false;
|
|
@@ -28453,14 +28585,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28453
28585
|
}, [config]);
|
|
28454
28586
|
(0, import_react102.useEffect)(() => {
|
|
28455
28587
|
const handleRetryAttempt = (payload) => {
|
|
28456
|
-
if (turnCancelledRef.current || !isRespondingRef.current || payload.role !==
|
|
28588
|
+
if (turnCancelledRef.current || !isRespondingRef.current || payload.role !== LlmRole.MAIN || !lastPromptIdRef.current || payload.promptId !== lastPromptIdRef.current) {
|
|
28457
28589
|
return;
|
|
28458
28590
|
}
|
|
28459
28591
|
setRetryStatus(payload);
|
|
28460
28592
|
};
|
|
28461
|
-
coreEvents.on(
|
|
28593
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
28462
28594
|
return () => {
|
|
28463
|
-
coreEvents.off(
|
|
28595
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
28464
28596
|
};
|
|
28465
28597
|
}, [isRespondingRef]);
|
|
28466
28598
|
const [
|
|
@@ -28511,7 +28643,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28511
28643
|
const currentModel = client?.getCurrentSequenceModel?.() ?? config.getModel();
|
|
28512
28644
|
const normalizedCompletedCalls = completedToolCallsFromScheduler.map(
|
|
28513
28645
|
(tc) => {
|
|
28514
|
-
if (tc.status ===
|
|
28646
|
+
if (tc.status === CoreToolCallStatus.Cancelled && (!tc.response?.responseParts || tc.response.responseParts.length === 0)) {
|
|
28515
28647
|
return {
|
|
28516
28648
|
...tc,
|
|
28517
28649
|
response: createCancelledToolCall(
|
|
@@ -28769,7 +28901,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28769
28901
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
28770
28902
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
28771
28903
|
(0, import_react102.useEffect)(() => {
|
|
28772
|
-
if (config.getApprovalMode() ===
|
|
28904
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
28773
28905
|
const lastUserMessageIndex = history.findLastIndex(
|
|
28774
28906
|
(item) => item.type === "user" /* USER */
|
|
28775
28907
|
);
|
|
@@ -28846,7 +28978,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28846
28978
|
return;
|
|
28847
28979
|
}
|
|
28848
28980
|
const hasActiveTools = pendingToolCallRequestsRef.current.length > 0 || toolCalls.some(
|
|
28849
|
-
(tc) => tc.status ===
|
|
28981
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating || tc.status === CoreToolCallStatus.AwaitingApproval
|
|
28850
28982
|
);
|
|
28851
28983
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
28852
28984
|
if (clearBuffer) {
|
|
@@ -28874,13 +29006,13 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28874
29006
|
if (tc.request.isClientInitiated) {
|
|
28875
29007
|
continue;
|
|
28876
29008
|
}
|
|
28877
|
-
const isAlreadySubmitted = (tc.status ===
|
|
29009
|
+
const isAlreadySubmitted = (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) && tc.responseSubmittedToGemini;
|
|
28878
29010
|
if (isAlreadySubmitted) {
|
|
28879
29011
|
seenCallIds.add(tc.request.callId);
|
|
28880
29012
|
continue;
|
|
28881
29013
|
}
|
|
28882
29014
|
seenCallIds.add(tc.request.callId);
|
|
28883
|
-
if ((tc.status ===
|
|
29015
|
+
if ((tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) && (tc.response?.responseParts?.length ?? 0) > 0) {
|
|
28884
29016
|
synthesizedCalls.push(tc);
|
|
28885
29017
|
} else {
|
|
28886
29018
|
synthesizedCalls.push(
|
|
@@ -28942,7 +29074,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28942
29074
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
28943
29075
|
return {
|
|
28944
29076
|
...tool,
|
|
28945
|
-
status:
|
|
29077
|
+
status: CoreToolCallStatus.Cancelled,
|
|
28946
29078
|
resultDisplay: tool.resultDisplay
|
|
28947
29079
|
};
|
|
28948
29080
|
}
|
|
@@ -29038,7 +29170,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29038
29170
|
let localQueryToSendToGemini = null;
|
|
29039
29171
|
if (typeof query === "string") {
|
|
29040
29172
|
const trimmedQuery = query.trim();
|
|
29041
|
-
await logger?.logMessage(
|
|
29173
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
29042
29174
|
if (!shellModeActive) {
|
|
29043
29175
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
29044
29176
|
if (slashCommandResult) {
|
|
@@ -29196,7 +29328,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29196
29328
|
if (pendingHistoryItemRef.current) {
|
|
29197
29329
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
29198
29330
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
29199
|
-
(tool) => tool.status ===
|
|
29331
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
29200
29332
|
);
|
|
29201
29333
|
const pendingItem = {
|
|
29202
29334
|
...pendingHistoryItemRef.current,
|
|
@@ -29489,15 +29621,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29489
29621
|
const toolCallRequests = [];
|
|
29490
29622
|
let hasTerminalEvent = false;
|
|
29491
29623
|
for await (const event of stream) {
|
|
29492
|
-
if (event.type !==
|
|
29624
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
29493
29625
|
setThought(null);
|
|
29494
29626
|
}
|
|
29495
29627
|
switch (event.type) {
|
|
29496
|
-
case
|
|
29628
|
+
case GeminiEventType.Thought:
|
|
29497
29629
|
setLastGeminiActivityTime(Date.now());
|
|
29498
29630
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
29499
29631
|
break;
|
|
29500
|
-
case
|
|
29632
|
+
case GeminiEventType.Content:
|
|
29501
29633
|
setLastGeminiActivityTime(Date.now());
|
|
29502
29634
|
geminiMessageBuffer = handleContentEvent(
|
|
29503
29635
|
event.value,
|
|
@@ -29505,20 +29637,20 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29505
29637
|
userMessageTimestamp
|
|
29506
29638
|
);
|
|
29507
29639
|
break;
|
|
29508
|
-
case
|
|
29640
|
+
case GeminiEventType.ToolCallRequest:
|
|
29509
29641
|
setRetryStatus(null);
|
|
29510
29642
|
toolCallRequests.push(event.value);
|
|
29511
29643
|
pendingToolCallRequestsRef.current.push(event.value);
|
|
29512
29644
|
break;
|
|
29513
|
-
case
|
|
29645
|
+
case GeminiEventType.UserCancelled:
|
|
29514
29646
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
29515
29647
|
pendingToolCallRequestsRef.current = [];
|
|
29516
29648
|
return 1 /* UserCancelled */;
|
|
29517
|
-
case
|
|
29649
|
+
case GeminiEventType.Error:
|
|
29518
29650
|
hasTerminalEvent = true;
|
|
29519
29651
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
29520
29652
|
break;
|
|
29521
|
-
case
|
|
29653
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
29522
29654
|
hasTerminalEvent = true;
|
|
29523
29655
|
handleAgentExecutionStoppedEvent(
|
|
29524
29656
|
event.value.reason,
|
|
@@ -29527,7 +29659,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29527
29659
|
event.value.contextCleared
|
|
29528
29660
|
);
|
|
29529
29661
|
break;
|
|
29530
|
-
case
|
|
29662
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
29531
29663
|
hasTerminalEvent = true;
|
|
29532
29664
|
handleAgentExecutionBlockedEvent(
|
|
29533
29665
|
event.value.reason,
|
|
@@ -29536,38 +29668,38 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29536
29668
|
event.value.contextCleared
|
|
29537
29669
|
);
|
|
29538
29670
|
break;
|
|
29539
|
-
case
|
|
29671
|
+
case GeminiEventType.ChatCompressed:
|
|
29540
29672
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
29541
29673
|
break;
|
|
29542
|
-
case
|
|
29543
|
-
case
|
|
29674
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
29675
|
+
case GeminiEventType.ToolCallResponse:
|
|
29544
29676
|
break;
|
|
29545
|
-
case
|
|
29677
|
+
case GeminiEventType.MaxSessionTurns:
|
|
29546
29678
|
hasTerminalEvent = true;
|
|
29547
29679
|
handleMaxSessionTurnsEvent();
|
|
29548
29680
|
break;
|
|
29549
|
-
case
|
|
29681
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
29550
29682
|
hasTerminalEvent = true;
|
|
29551
29683
|
handleContextWindowWillOverflowEvent(
|
|
29552
29684
|
event.value.estimatedRequestTokenCount,
|
|
29553
29685
|
event.value.remainingTokenCount
|
|
29554
29686
|
);
|
|
29555
29687
|
break;
|
|
29556
|
-
case
|
|
29688
|
+
case GeminiEventType.Finished:
|
|
29557
29689
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
29558
29690
|
break;
|
|
29559
|
-
case
|
|
29691
|
+
case GeminiEventType.Citation:
|
|
29560
29692
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
29561
29693
|
break;
|
|
29562
|
-
case
|
|
29694
|
+
case GeminiEventType.ModelInfo:
|
|
29563
29695
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
29564
29696
|
break;
|
|
29565
|
-
case
|
|
29697
|
+
case GeminiEventType.LoopDetected:
|
|
29566
29698
|
loopDetectedRef.current = true;
|
|
29567
29699
|
break;
|
|
29568
|
-
case
|
|
29700
|
+
case GeminiEventType.Retry:
|
|
29569
29701
|
break;
|
|
29570
|
-
case
|
|
29702
|
+
case GeminiEventType.InvalidStream:
|
|
29571
29703
|
hasTerminalEvent = true;
|
|
29572
29704
|
handleInvalidStreamEvent(event.value, userMessageTimestamp);
|
|
29573
29705
|
break;
|
|
@@ -29637,7 +29769,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29637
29769
|
const submitQuery = (0, import_react102.useCallback)(
|
|
29638
29770
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
29639
29771
|
{
|
|
29640
|
-
operation: options?.isContinuation ?
|
|
29772
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
29641
29773
|
sessionId: config.getSessionId()
|
|
29642
29774
|
},
|
|
29643
29775
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -29807,7 +29939,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29807
29939
|
submitQueryRef.current = submitQuery;
|
|
29808
29940
|
const handleApprovalModeChange = (0, import_react102.useCallback)(
|
|
29809
29941
|
async (newApprovalMode) => {
|
|
29810
|
-
if (previousApprovalModeRef.current ===
|
|
29942
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
29811
29943
|
if (geminiClient) {
|
|
29812
29944
|
try {
|
|
29813
29945
|
await geminiClient.addHistory({
|
|
@@ -29830,31 +29962,43 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29830
29962
|
}
|
|
29831
29963
|
}
|
|
29832
29964
|
previousApprovalModeRef.current = newApprovalMode;
|
|
29833
|
-
if (newApprovalMode ===
|
|
29965
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
29834
29966
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
29835
29967
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
29836
29968
|
);
|
|
29837
|
-
if (newApprovalMode ===
|
|
29838
|
-
|
|
29969
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
29970
|
+
const filteredCalls = [];
|
|
29971
|
+
for (const call of awaitingApprovalCalls) {
|
|
29839
29972
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
29840
|
-
|
|
29973
|
+
filteredCalls.push(call);
|
|
29974
|
+
continue;
|
|
29841
29975
|
}
|
|
29842
29976
|
if (call.request.name === SHELL_TOOL_NAME) {
|
|
29843
|
-
|
|
29844
|
-
|
|
29977
|
+
if (call.confirmationDetails?.type === "exec" && typeof call.confirmationDetails.hasRedirection === "boolean") {
|
|
29978
|
+
if (call.confirmationDetails.hasRedirection) {
|
|
29979
|
+
filteredCalls.push(call);
|
|
29980
|
+
}
|
|
29981
|
+
continue;
|
|
29982
|
+
}
|
|
29983
|
+
const rawCommand = call.request.args["command"];
|
|
29984
|
+
const command = typeof rawCommand === "string" ? rawCommand : void 0;
|
|
29985
|
+
const redirected = command ? typeof isDefaultHasRedirection === "function" && isDefaultHasRedirection(hasRedirection) && typeof hasRedirectionAsync === "function" ? await hasRedirectionAsync(command) : hasRedirection(command) : false;
|
|
29986
|
+
if (redirected) {
|
|
29987
|
+
filteredCalls.push(call);
|
|
29988
|
+
}
|
|
29845
29989
|
}
|
|
29846
|
-
|
|
29847
|
-
|
|
29990
|
+
}
|
|
29991
|
+
awaitingApprovalCalls = filteredCalls;
|
|
29848
29992
|
}
|
|
29849
29993
|
for (const call of awaitingApprovalCalls) {
|
|
29850
29994
|
if (call.correlationId) {
|
|
29851
29995
|
try {
|
|
29852
29996
|
await config.getMessageBus().publish({
|
|
29853
|
-
type:
|
|
29997
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
29854
29998
|
correlationId: call.correlationId,
|
|
29855
29999
|
confirmed: true,
|
|
29856
30000
|
requiresUserConfirmation: false,
|
|
29857
|
-
outcome:
|
|
30001
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
29858
30002
|
});
|
|
29859
30003
|
} catch (error) {
|
|
29860
30004
|
debugLogger.warn(
|
|
@@ -29946,14 +30090,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29946
30090
|
);
|
|
29947
30091
|
if (isLowErrorVerbosity) {
|
|
29948
30092
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
29949
|
-
(tc) => tc.status ===
|
|
30093
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
29950
30094
|
).length;
|
|
29951
30095
|
}
|
|
29952
30096
|
if (geminiTools.length === 0) {
|
|
29953
30097
|
return;
|
|
29954
30098
|
}
|
|
29955
30099
|
const stopExecutionTool = geminiTools.find(
|
|
29956
|
-
(tc) => tc.response.errorType ===
|
|
30100
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
29957
30101
|
);
|
|
29958
30102
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
29959
30103
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -29973,9 +30117,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29973
30117
|
(tc) => !isTopicTool2(tc.request.name)
|
|
29974
30118
|
);
|
|
29975
30119
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
29976
|
-
(tc) => tc.status ===
|
|
30120
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
29977
30121
|
);
|
|
29978
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
30122
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
29979
30123
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
29980
30124
|
if (!turnCancelledRef.current) {
|
|
29981
30125
|
addItem({
|
|
@@ -30065,7 +30209,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
30065
30209
|
return;
|
|
30066
30210
|
}
|
|
30067
30211
|
const restorableToolCalls = toolCalls.filter(
|
|
30068
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
30212
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
30069
30213
|
);
|
|
30070
30214
|
if (restorableToolCalls.length > 0) {
|
|
30071
30215
|
if (!gitService) {
|
|
@@ -31534,9 +31678,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
31534
31678
|
const handleFolderTrustSelect = (0, import_react106.useCallback)(
|
|
31535
31679
|
async (choice) => {
|
|
31536
31680
|
const trustLevelMap = {
|
|
31537
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
31538
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
31539
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
31681
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
31682
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
31683
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
31540
31684
|
};
|
|
31541
31685
|
const trustLevel = trustLevelMap[choice];
|
|
31542
31686
|
if (!trustLevel) return;
|
|
@@ -31555,7 +31699,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
31555
31699
|
}, 100);
|
|
31556
31700
|
return;
|
|
31557
31701
|
}
|
|
31558
|
-
const currentIsTrusted = trustLevel ===
|
|
31702
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
31559
31703
|
onTrustChangeRef.current(currentIsTrusted);
|
|
31560
31704
|
setIsTrusted(currentIsTrusted);
|
|
31561
31705
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -32565,7 +32709,7 @@ function useMessageQueue({
|
|
|
32565
32709
|
var import_react108 = __toESM(require_react(), 1);
|
|
32566
32710
|
function useMcpStatus(config) {
|
|
32567
32711
|
const [discoveryState, setDiscoveryState] = (0, import_react108.useState)(
|
|
32568
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
32712
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
32569
32713
|
);
|
|
32570
32714
|
const [mcpServerCount, setMcpServerCount] = (0, import_react108.useState)(
|
|
32571
32715
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -32578,12 +32722,12 @@ function useMcpStatus(config) {
|
|
|
32578
32722
|
setMcpServerCount(manager.getMcpServerCount());
|
|
32579
32723
|
}
|
|
32580
32724
|
};
|
|
32581
|
-
coreEvents.on(
|
|
32725
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
32582
32726
|
return () => {
|
|
32583
|
-
coreEvents.off(
|
|
32727
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
32584
32728
|
};
|
|
32585
32729
|
}, [config]);
|
|
32586
|
-
const isMcpReady = discoveryState ===
|
|
32730
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
32587
32731
|
return {
|
|
32588
32732
|
discoveryState,
|
|
32589
32733
|
mcpServerCount,
|
|
@@ -32610,7 +32754,7 @@ function useApprovalModeIndicator({
|
|
|
32610
32754
|
(key) => {
|
|
32611
32755
|
let nextApprovalMode;
|
|
32612
32756
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
32613
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
32757
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
32614
32758
|
if (addItem) {
|
|
32615
32759
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
32616
32760
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -32628,21 +32772,21 @@ function useApprovalModeIndicator({
|
|
|
32628
32772
|
}
|
|
32629
32773
|
return;
|
|
32630
32774
|
}
|
|
32631
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
32775
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
32632
32776
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
32633
32777
|
const currentMode = config.getApprovalMode();
|
|
32634
32778
|
switch (currentMode) {
|
|
32635
|
-
case
|
|
32636
|
-
nextApprovalMode =
|
|
32779
|
+
case ApprovalMode.DEFAULT:
|
|
32780
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
32637
32781
|
break;
|
|
32638
|
-
case
|
|
32639
|
-
nextApprovalMode = allowPlanMode ?
|
|
32782
|
+
case ApprovalMode.AUTO_EDIT:
|
|
32783
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
32640
32784
|
break;
|
|
32641
|
-
case
|
|
32642
|
-
nextApprovalMode =
|
|
32785
|
+
case ApprovalMode.PLAN:
|
|
32786
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
32643
32787
|
break;
|
|
32644
|
-
case
|
|
32645
|
-
nextApprovalMode =
|
|
32788
|
+
case ApprovalMode.YOLO:
|
|
32789
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
32646
32790
|
break;
|
|
32647
32791
|
default:
|
|
32648
32792
|
}
|
|
@@ -33066,11 +33210,11 @@ var useHookDisplayState = () => {
|
|
|
33066
33210
|
removeHook();
|
|
33067
33211
|
}
|
|
33068
33212
|
};
|
|
33069
|
-
coreEvents.on(
|
|
33070
|
-
coreEvents.on(
|
|
33213
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
33214
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
33071
33215
|
return () => {
|
|
33072
|
-
coreEvents.off(
|
|
33073
|
-
coreEvents.off(
|
|
33216
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
33217
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
33074
33218
|
activeTimeouts.forEach(clearTimeout);
|
|
33075
33219
|
activeTimeouts.clear();
|
|
33076
33220
|
};
|
|
@@ -33963,7 +34107,7 @@ var AppContainer = (props) => {
|
|
|
33963
34107
|
setConfigInitialized(true);
|
|
33964
34108
|
startupProfiler.flush(config);
|
|
33965
34109
|
startAutoMemoryIfEnabled(config);
|
|
33966
|
-
const sessionStartSource = resumedSessionData ?
|
|
34110
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
33967
34111
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
33968
34112
|
if (result) {
|
|
33969
34113
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -33990,7 +34134,7 @@ var AppContainer = (props) => {
|
|
|
33990
34134
|
);
|
|
33991
34135
|
const ideClient = await IdeClient.getInstance();
|
|
33992
34136
|
await ideClient.disconnect();
|
|
33993
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
34137
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
33994
34138
|
};
|
|
33995
34139
|
registerCleanup(cleanupFn);
|
|
33996
34140
|
return () => {
|
|
@@ -34015,11 +34159,11 @@ var AppContainer = (props) => {
|
|
|
34015
34159
|
resetTime: payload.resetTime
|
|
34016
34160
|
});
|
|
34017
34161
|
};
|
|
34018
|
-
coreEvents.on(
|
|
34019
|
-
coreEvents.on(
|
|
34162
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
34163
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
34020
34164
|
return () => {
|
|
34021
|
-
coreEvents.off(
|
|
34022
|
-
coreEvents.off(
|
|
34165
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
34166
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
34023
34167
|
};
|
|
34024
34168
|
}, [config]);
|
|
34025
34169
|
(0, import_react122.useEffect)(() => {
|
|
@@ -34032,16 +34176,16 @@ var AppContainer = (props) => {
|
|
|
34032
34176
|
const handleAgentsDiscovered = (payload) => {
|
|
34033
34177
|
setNewAgents(payload.agents);
|
|
34034
34178
|
};
|
|
34035
|
-
coreEvents.on(
|
|
34036
|
-
coreEvents.on(
|
|
34037
|
-
coreEvents.on(
|
|
34179
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
34180
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
34181
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
34038
34182
|
return () => {
|
|
34039
|
-
coreEvents.off(
|
|
34183
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
34040
34184
|
coreEvents.off(
|
|
34041
|
-
|
|
34185
|
+
CoreEvent.AdminSettingsChanged,
|
|
34042
34186
|
handleAdminSettingsChanged
|
|
34043
34187
|
);
|
|
34044
|
-
coreEvents.off(
|
|
34188
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
34045
34189
|
};
|
|
34046
34190
|
}, [settings]);
|
|
34047
34191
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -34192,11 +34336,11 @@ var AppContainer = (props) => {
|
|
|
34192
34336
|
exitEditorDialog
|
|
34193
34337
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
34194
34338
|
(0, import_react122.useEffect)(() => {
|
|
34195
|
-
coreEvents.on(
|
|
34196
|
-
coreEvents.on(
|
|
34339
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
34340
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
34197
34341
|
return () => {
|
|
34198
|
-
coreEvents.off(
|
|
34199
|
-
coreEvents.off(
|
|
34342
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
34343
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
34200
34344
|
};
|
|
34201
34345
|
}, [handleEditorClose, openEditorDialog]);
|
|
34202
34346
|
(0, import_react122.useEffect)(() => {
|
|
@@ -34267,7 +34411,7 @@ var AppContainer = (props) => {
|
|
|
34267
34411
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
34268
34412
|
});
|
|
34269
34413
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
34270
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
34414
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
34271
34415
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
34272
34416
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
34273
34417
|
config,
|
|
@@ -34295,7 +34439,7 @@ var AppContainer = (props) => {
|
|
|
34295
34439
|
async (authType, scope) => {
|
|
34296
34440
|
if (authType) {
|
|
34297
34441
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
34298
|
-
if (authType ===
|
|
34442
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
34299
34443
|
setAuthContext({ requiresRestart: true });
|
|
34300
34444
|
} else {
|
|
34301
34445
|
setAuthContext({});
|
|
@@ -34323,7 +34467,7 @@ var AppContainer = (props) => {
|
|
|
34323
34467
|
);
|
|
34324
34468
|
return;
|
|
34325
34469
|
}
|
|
34326
|
-
if (authType ===
|
|
34470
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
34327
34471
|
writeToStdout(`
|
|
34328
34472
|
----------------------------------------------------------------
|
|
34329
34473
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -34346,7 +34490,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
34346
34490
|
}
|
|
34347
34491
|
await saveApiKey(apiKey);
|
|
34348
34492
|
await reloadApiKey();
|
|
34349
|
-
await config.refreshAuth(
|
|
34493
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
34350
34494
|
setAuthState("authenticated" /* Authenticated */);
|
|
34351
34495
|
} catch (e) {
|
|
34352
34496
|
onAuthError(
|
|
@@ -34371,7 +34515,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
34371
34515
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
34372
34516
|
);
|
|
34373
34517
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
34374
|
-
if (settings.merged.security.auth.selectedType ===
|
|
34518
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
34375
34519
|
return;
|
|
34376
34520
|
}
|
|
34377
34521
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -34531,9 +34675,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
34531
34675
|
}
|
|
34532
34676
|
});
|
|
34533
34677
|
};
|
|
34534
|
-
coreEvents.on(
|
|
34678
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
34535
34679
|
return () => {
|
|
34536
|
-
coreEvents.off(
|
|
34680
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
34537
34681
|
};
|
|
34538
34682
|
}, []);
|
|
34539
34683
|
const performMemoryRefresh = (0, import_react122.useCallback)(async () => {
|
|
@@ -35173,7 +35317,7 @@ ${queuedText}` : queuedText;
|
|
|
35173
35317
|
[handleSlashCommand, settings]
|
|
35174
35318
|
);
|
|
35175
35319
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
35176
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
35320
|
+
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;
|
|
35177
35321
|
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;
|
|
35178
35322
|
const handleGlobalKeypress = (0, import_react122.useCallback)(
|
|
35179
35323
|
(key) => {
|
|
@@ -35266,7 +35410,7 @@ ${queuedText}` : queuedText;
|
|
|
35266
35410
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
35267
35411
|
if (settings.merged.general.devtools) {
|
|
35268
35412
|
void (async () => {
|
|
35269
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
35413
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-HFMB7OZU.js");
|
|
35270
35414
|
await toggleDevToolsPanel(
|
|
35271
35415
|
config,
|
|
35272
35416
|
showErrorDetails,
|
|
@@ -35487,12 +35631,12 @@ ${queuedText}` : queuedText;
|
|
|
35487
35631
|
Date.now()
|
|
35488
35632
|
);
|
|
35489
35633
|
};
|
|
35490
|
-
coreEvents.on(
|
|
35491
|
-
coreEvents.on(
|
|
35634
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
35635
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
35492
35636
|
coreEvents.drainBacklogs();
|
|
35493
35637
|
return () => {
|
|
35494
|
-
coreEvents.off(
|
|
35495
|
-
coreEvents.off(
|
|
35638
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
35639
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
35496
35640
|
};
|
|
35497
35641
|
}, [historyManager]);
|
|
35498
35642
|
const nightly = props.version.includes("nightly");
|
|
@@ -35601,9 +35745,9 @@ ${queuedText}` : queuedText;
|
|
|
35601
35745
|
const handleMemoryChanged = (result) => {
|
|
35602
35746
|
setGeminiMdFileCount(result.fileCount);
|
|
35603
35747
|
};
|
|
35604
|
-
coreEvents.on(
|
|
35748
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
35605
35749
|
return () => {
|
|
35606
|
-
coreEvents.off(
|
|
35750
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
35607
35751
|
};
|
|
35608
35752
|
}, []);
|
|
35609
35753
|
(0, import_react122.useEffect)(() => {
|