@google/gemini-cli 0.64.0-preview.0 → 0.64.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/{chunk-EDVFNWRG.js → chunk-2XMCTNPW.js} +1 -1
- package/bundle/{chunk-HN74ORTP.js → chunk-46DG3MEK.js} +15 -3
- package/bundle/{chunk-UFQDAROY.js → chunk-4TPFLAND.js} +1 -1
- package/bundle/{chunk-A4TO2DY2.js → chunk-627EICDK.js} +8258 -14927
- package/bundle/{chunk-EDYPRCAA.js → chunk-6JF3XGX6.js} +2 -2
- package/bundle/{chunk-SDWOC67Z.js → chunk-7AV6KELE.js} +1 -1
- package/bundle/{chunk-EBP6K2WG.js → chunk-7FPYEHDV.js} +25 -9
- package/bundle/{chunk-U76XPSKR.js → chunk-7OAPTXNW.js} +89 -60
- package/bundle/{chunk-EFX5XL6M.js → chunk-BONG2QK5.js} +2 -2
- package/bundle/{chunk-VBVCLWLA.js → chunk-BRVQMVD5.js} +2 -2
- package/bundle/{chunk-2NQXIWQK.js → chunk-BSE7BCTQ.js} +15 -3
- package/bundle/chunk-BYVRH4VZ.js +103137 -0
- package/bundle/{chunk-HSZIYPL6.js → chunk-EE4FVMPM.js} +3 -3
- package/bundle/{chunk-QUCRASYB.js → chunk-GWH2CDNQ.js} +1 -1
- package/bundle/{chunk-NX7TO2DU.js → chunk-H2WBGLUF.js} +1 -1
- package/bundle/{chunk-Y2HXXBXI.js → chunk-J7KGQZGT.js} +1 -1
- package/bundle/{chunk-UBGF6JU5.js → chunk-JLBO43LX.js} +1 -1
- package/bundle/{chunk-ZPLFLZQA.js → chunk-L3JNREL2.js} +21 -7
- package/bundle/{chunk-ZQW7OGUO.js → chunk-MN5WGELB.js} +426 -91
- package/bundle/{chunk-6OFXOGEG.js → chunk-NTBZBCDY.js} +456 -94
- package/bundle/{chunk-ZOHM7BPT.js → chunk-ONZZ4MZP.js} +1 -1
- package/bundle/chunk-POXVKWMH.js +17519 -0
- package/bundle/{chunk-MLSLNORV.js → chunk-R7OEYEVK.js} +3 -3
- package/bundle/{chunk-KCCVXZ52.js → chunk-RIRMXE4G.js} +25 -9
- package/bundle/{chunk-2VN53SWW.js → chunk-RQB6UOWL.js} +9 -8
- package/bundle/{chunk-VJYKQD5D.js → chunk-SQZOWFWU.js} +3 -3
- package/bundle/chunk-T7UXARRX.js +401531 -0
- package/bundle/chunk-TDYDNMXH.js +425 -0
- package/bundle/chunk-TVJ4WAFU.js +512 -0
- package/bundle/chunk-XNLASMX4.js +154 -0
- package/bundle/chunk-Y3EQFIOM.js +118 -0
- package/bundle/chunk-YKGBOB2S.js +1571 -0
- package/bundle/{cleanup-GGCB2LVD.js → cleanup-5HA3CDPH.js} +2 -2
- package/bundle/{cleanup-JRDG3OTL.js → cleanup-LXXTR2OE.js} +2 -2
- package/bundle/{cleanup-SSW6IXTR.js → cleanup-RM72YALN.js} +2 -2
- package/bundle/cleanup-TBTZ6WZD.js +32 -0
- package/bundle/{core-IUIZE6JW.js → core-NBQGNNOM.js} +11 -1
- package/bundle/{devtoolsService-3SADPKKB.js → devtoolsService-BUAVC3ZD.js} +2 -2
- package/bundle/{devtoolsService-XZCKFZP5.js → devtoolsService-DCRIOTR4.js} +2 -2
- package/bundle/{devtoolsService-MF6JKRUV.js → devtoolsService-PXS65V3Y.js} +4 -3
- package/bundle/devtoolsService-ZHFOHPIS.js +4359 -0
- package/bundle/{dist-7L3BRW6V.js → dist-24APVFHT.js} +11 -1
- package/bundle/{core-6HRWFQZW.js → dist-EOOSNLUQ.js} +11 -1
- package/bundle/dist-YP3VMVL6.js +2262 -0
- package/bundle/docs/tools/mcp-server.md +41 -12
- package/bundle/{gemini-JPMMQ3KA.js → gemini-LHZDQRUM.js} +13 -13
- package/bundle/{gemini-ZMMDUAQJ.js → gemini-Q4LI2KHU.js} +214 -198
- package/bundle/gemini-QM6PZXIH.js +17934 -0
- package/bundle/{gemini-QOQNG5VY.js → gemini-UEMV4Y7B.js} +13 -13
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-R3P4A3FC.js → interactiveCli-HMZ5ZWK4.js} +9 -20
- package/bundle/{interactiveCli-UDWGRVJL.js → interactiveCli-IQQYS4AV.js} +9 -20
- package/bundle/{interactiveCli-3I4TG5SK.js → interactiveCli-QCNSW3M7.js} +313 -305
- package/bundle/interactiveCli-QXZXFSNY.js +34968 -0
- package/bundle/{liteRtServerManager-OVPUSK2T.js → liteRtServerManager-2I4N5IEZ.js} +4 -4
- package/bundle/{liteRtServerManager-RAV63AGE.js → liteRtServerManager-3IZ2LKBD.js} +4 -4
- package/bundle/{liteRtServerManager-4MWCEVVM.js → liteRtServerManager-RABYR6TB.js} +4 -4
- package/bundle/liteRtServerManager-T3MOB7VG.js +65 -0
- package/bundle/{oauth2-provider-FVTRRJZR.js → oauth2-provider-I3CU23H3.js} +1 -1
- package/bundle/{oauth2-provider-EWOA64PR.js → oauth2-provider-INBLO6HF.js} +38 -72
- package/bundle/oauth2-provider-UZV2BJA3.js +235 -0
- package/bundle/{oauth2-provider-XFP63FGJ.js → oauth2-provider-XFPEOXNY.js} +1 -1
- package/bundle/{start-DJAIXPPY.js → start-4UWH3BI7.js} +6 -6
- package/bundle/{start-VQQ2Q5KT.js → start-CQTZWDLV.js} +6 -6
- package/bundle/{start-5O7TBK5L.js → start-D6DJS7SZ.js} +6 -6
- package/bundle/start-IXFELTCY.js +18 -0
- package/package.json +1 -1
|
@@ -171,10 +171,10 @@ import {
|
|
|
171
171
|
widestLineFromStyledChars,
|
|
172
172
|
wordBreakStyledChars,
|
|
173
173
|
wrapStyledChars
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-7OAPTXNW.js";
|
|
175
175
|
import {
|
|
176
176
|
require_source
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-ONZZ4MZP.js";
|
|
178
178
|
import {
|
|
179
179
|
appEvents
|
|
180
180
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -227,33 +227,37 @@ import {
|
|
|
227
227
|
stripAnsi,
|
|
228
228
|
stripUnsafeCharacters,
|
|
229
229
|
toCodePoints
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-L3JNREL2.js";
|
|
231
231
|
import {
|
|
232
232
|
handleAutoUpdate,
|
|
233
233
|
isDevelopment,
|
|
234
234
|
relaunchApp,
|
|
235
235
|
setUpdateHandler
|
|
236
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-6JF3XGX6.js";
|
|
237
237
|
import {
|
|
238
238
|
isTodoList,
|
|
239
239
|
mapCoreStatusToDisplayStatus,
|
|
240
240
|
require_react
|
|
241
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-RQB6UOWL.js";
|
|
242
242
|
import {
|
|
243
243
|
registerCleanup,
|
|
244
244
|
removeCleanup,
|
|
245
245
|
runExitCleanup,
|
|
246
246
|
setupTtyCheck
|
|
247
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-4TPFLAND.js";
|
|
248
248
|
import {
|
|
249
249
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
250
250
|
AGENT_TOOL_NAME,
|
|
251
251
|
ApiKeyUpdatedEvent,
|
|
252
|
+
ApprovalMode,
|
|
252
253
|
AsyncFzf,
|
|
253
254
|
AudioRecorder,
|
|
254
255
|
AuthType,
|
|
255
256
|
ChangeAuthRequestedError,
|
|
257
|
+
CompressionStatus,
|
|
256
258
|
ConversationFinishedEvent,
|
|
259
|
+
CoreEvent,
|
|
260
|
+
CoreToolCallStatus,
|
|
257
261
|
CreditPurchaseClickEvent,
|
|
258
262
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
259
263
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
@@ -275,13 +279,20 @@ import {
|
|
|
275
279
|
GEMMA_4_31B_IT_MODEL,
|
|
276
280
|
GLOB_DISPLAY_NAME,
|
|
277
281
|
GREP_DISPLAY_NAME,
|
|
282
|
+
GeminiCliOperation,
|
|
283
|
+
GeminiEventType,
|
|
278
284
|
GitService,
|
|
279
285
|
IdeClient,
|
|
286
|
+
Kind,
|
|
280
287
|
LS_DISPLAY_NAME,
|
|
281
288
|
LegacyAgentProtocol,
|
|
282
289
|
LlmRole,
|
|
283
290
|
Logger,
|
|
284
291
|
MAX_TOKENS_EXCEEDED_SUGGESTION,
|
|
292
|
+
MCPDiscoveryState,
|
|
293
|
+
MCPServerStatus,
|
|
294
|
+
MessageBusType,
|
|
295
|
+
MessageSenderType,
|
|
285
296
|
ModelNotFoundError,
|
|
286
297
|
ModelSlashCommandEvent,
|
|
287
298
|
OTHER_BLOCKED_MESSAGE,
|
|
@@ -294,6 +305,7 @@ import {
|
|
|
294
305
|
PREVIEW_GEMINI_MODEL,
|
|
295
306
|
PolicyIntegrityManager,
|
|
296
307
|
ProjectIdRequiredError,
|
|
308
|
+
QuestionType,
|
|
297
309
|
READ_FILE_DISPLAY_NAME,
|
|
298
310
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
299
311
|
RECITATION_BLOCKED_MESSAGE,
|
|
@@ -302,16 +314,22 @@ import {
|
|
|
302
314
|
SAFETY_BLOCKED_MESSAGE,
|
|
303
315
|
SHELL_TOOL_NAME,
|
|
304
316
|
Scheduler,
|
|
317
|
+
SessionEndReason,
|
|
318
|
+
SessionStartSource,
|
|
305
319
|
ShellExecutionService,
|
|
306
320
|
SlashCommandStatus,
|
|
307
321
|
Storage,
|
|
322
|
+
SubagentState,
|
|
308
323
|
THINKING_ONLY_COMPRESS_SUGGESTION,
|
|
309
324
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
310
325
|
TOPIC_PARAM_SUMMARY,
|
|
311
326
|
TOPIC_PARAM_TITLE,
|
|
312
327
|
TRUE_EMPTY_RESPONSE_MESSAGE,
|
|
313
328
|
TerminalQuotaError,
|
|
329
|
+
ToolConfirmationOutcome,
|
|
330
|
+
ToolErrorType,
|
|
314
331
|
TranscriptionFactory,
|
|
332
|
+
TrustLevel,
|
|
315
333
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
316
334
|
UPDATE_TOPIC_TOOL_NAME,
|
|
317
335
|
UnauthorizedError,
|
|
@@ -323,6 +341,7 @@ import {
|
|
|
323
341
|
WEB_FETCH_DISPLAY_NAME,
|
|
324
342
|
WEB_SEARCH_DISPLAY_NAME,
|
|
325
343
|
WRITE_FILE_DISPLAY_NAME,
|
|
344
|
+
WarningPriority,
|
|
326
345
|
WhisperModelManager,
|
|
327
346
|
addMCPStatusChangeListener,
|
|
328
347
|
allowEditorTypeInSandbox,
|
|
@@ -430,7 +449,7 @@ import {
|
|
|
430
449
|
validatePlanContent,
|
|
431
450
|
validatePlanPath,
|
|
432
451
|
writeToStdout
|
|
433
|
-
} from "./chunk-
|
|
452
|
+
} from "./chunk-T7UXARRX.js";
|
|
434
453
|
import "./chunk-664ZODQF.js";
|
|
435
454
|
import "./chunk-IUUIT4SU.js";
|
|
436
455
|
import "./chunk-L6PII3GR.js";
|
|
@@ -5057,7 +5076,7 @@ function calculateShellMaxLines(options) {
|
|
|
5057
5076
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
5058
5077
|
return maxLinesBasedOnHeight;
|
|
5059
5078
|
}
|
|
5060
|
-
const isExecuting = status ===
|
|
5079
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
5061
5080
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
5062
5081
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
5063
5082
|
}
|
|
@@ -5093,13 +5112,13 @@ var formatToolArgs = (args) => {
|
|
|
5093
5112
|
var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
|
|
5094
5113
|
let headerText;
|
|
5095
5114
|
let headerColor = theme.text.secondary;
|
|
5096
|
-
if (progress.state ===
|
|
5115
|
+
if (progress.state === SubagentState.CANCELLED) {
|
|
5097
5116
|
headerText = `Subagent ${progress.agentName} was cancelled.`;
|
|
5098
5117
|
headerColor = theme.status.warning;
|
|
5099
|
-
} else if (progress.state ===
|
|
5118
|
+
} else if (progress.state === SubagentState.ERROR) {
|
|
5100
5119
|
headerText = `Subagent ${progress.agentName} failed.`;
|
|
5101
5120
|
headerColor = theme.status.error;
|
|
5102
|
-
} else if (progress.state ===
|
|
5121
|
+
} else if (progress.state === SubagentState.COMPLETED) {
|
|
5103
5122
|
headerText = `Subagent ${progress.agentName} completed.`;
|
|
5104
5123
|
headerColor = theme.status.success;
|
|
5105
5124
|
} else {
|
|
@@ -5119,7 +5138,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5119
5138
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color, children: item.content }) })
|
|
5120
5139
|
] }, item.id);
|
|
5121
5140
|
} else if (item.type === "tool_call") {
|
|
5122
|
-
const statusSymbol = item.status ===
|
|
5141
|
+
const statusSymbol = item.status === SubagentState.RUNNING ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(build_default, { type: "dots" }) : item.status === SubagentState.COMPLETED ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === SubagentState.CANCELLED ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
|
|
5123
5142
|
const formattedArgs = item.description || formatToolArgs(item.args);
|
|
5124
5143
|
const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
|
|
5125
5144
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
@@ -5130,7 +5149,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5130
5149
|
{
|
|
5131
5150
|
bold: true,
|
|
5132
5151
|
color: theme.text.primary,
|
|
5133
|
-
strikethrough: item.status ===
|
|
5152
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5134
5153
|
children: item.displayName || item.content
|
|
5135
5154
|
}
|
|
5136
5155
|
),
|
|
@@ -5139,7 +5158,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5139
5158
|
{
|
|
5140
5159
|
color: theme.text.secondary,
|
|
5141
5160
|
wrap: "truncate",
|
|
5142
|
-
strikethrough: item.status ===
|
|
5161
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5143
5162
|
children: displayArgs
|
|
5144
5163
|
}
|
|
5145
5164
|
) })
|
|
@@ -5159,7 +5178,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5159
5178
|
MarkdownDisplay,
|
|
5160
5179
|
{
|
|
5161
5180
|
text: safeJsonToMarkdown(progress.result),
|
|
5162
|
-
isPending: progress.state !==
|
|
5181
|
+
isPending: progress.state !== SubagentState.COMPLETED,
|
|
5163
5182
|
terminalWidth
|
|
5164
5183
|
}
|
|
5165
5184
|
)
|
|
@@ -5514,14 +5533,14 @@ var ToolActionsProvider = (props) => {
|
|
|
5514
5533
|
}
|
|
5515
5534
|
const details = tool.confirmationDetails;
|
|
5516
5535
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
5517
|
-
const cliOutcome = outcome ===
|
|
5536
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
5518
5537
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
5519
5538
|
}
|
|
5520
5539
|
if (tool.correlationId) {
|
|
5521
5540
|
await config.getMessageBus().publish({
|
|
5522
|
-
type:
|
|
5541
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
5523
5542
|
correlationId: tool.correlationId,
|
|
5524
|
-
confirmed: outcome !==
|
|
5543
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
5525
5544
|
requiresUserConfirmation: false,
|
|
5526
5545
|
outcome,
|
|
5527
5546
|
payload
|
|
@@ -5540,7 +5559,7 @@ var ToolActionsProvider = (props) => {
|
|
|
5540
5559
|
);
|
|
5541
5560
|
const cancel = (0, import_react10.useCallback)(
|
|
5542
5561
|
async (callId) => {
|
|
5543
|
-
await confirm(callId,
|
|
5562
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
5544
5563
|
},
|
|
5545
5564
|
[confirm]
|
|
5546
5565
|
);
|
|
@@ -5661,7 +5680,7 @@ var ToolMessage = ({
|
|
|
5661
5680
|
paddingX: 1,
|
|
5662
5681
|
flexDirection: "column",
|
|
5663
5682
|
children: [
|
|
5664
|
-
status ===
|
|
5683
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5665
5684
|
McpProgressIndicator,
|
|
5666
5685
|
{
|
|
5667
5686
|
progress,
|
|
@@ -5678,8 +5697,8 @@ var ToolMessage = ({
|
|
|
5678
5697
|
terminalWidth: safeTerminalWidth,
|
|
5679
5698
|
renderOutputAsMarkdown,
|
|
5680
5699
|
hasFocus: isThisShellFocused2,
|
|
5681
|
-
maxLines: kind ===
|
|
5682
|
-
overflowDirection: kind ===
|
|
5700
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
5701
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
5683
5702
|
}
|
|
5684
5703
|
),
|
|
5685
5704
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -5995,7 +6014,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
|
|
|
5995
6014
|
settings.merged,
|
|
5996
6015
|
process3.cwd()
|
|
5997
6016
|
);
|
|
5998
|
-
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel ===
|
|
6017
|
+
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
|
|
5999
6018
|
return {
|
|
6000
6019
|
currentTrustLevel: explicitTrustLevel,
|
|
6001
6020
|
isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
|
|
@@ -6040,7 +6059,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
|
|
|
6040
6059
|
process3.cwd(),
|
|
6041
6060
|
newConfig
|
|
6042
6061
|
);
|
|
6043
|
-
if (trustLevel ===
|
|
6062
|
+
if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
|
|
6044
6063
|
let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
|
|
6045
6064
|
if (source === "file") {
|
|
6046
6065
|
message = "Note: This folder is still trusted because a parent folder is trusted.";
|
|
@@ -6114,18 +6133,18 @@ function PermissionsModifyTrustDialog({
|
|
|
6114
6133
|
const TRUST_LEVEL_ITEMS = [
|
|
6115
6134
|
{
|
|
6116
6135
|
label: `Trust this folder (${dirName})`,
|
|
6117
|
-
value:
|
|
6118
|
-
key:
|
|
6136
|
+
value: TrustLevel.TRUST_FOLDER,
|
|
6137
|
+
key: TrustLevel.TRUST_FOLDER
|
|
6119
6138
|
},
|
|
6120
6139
|
{
|
|
6121
6140
|
label: `Trust parent folder (${parentFolder})`,
|
|
6122
|
-
value:
|
|
6123
|
-
key:
|
|
6141
|
+
value: TrustLevel.TRUST_PARENT,
|
|
6142
|
+
key: TrustLevel.TRUST_PARENT
|
|
6124
6143
|
},
|
|
6125
6144
|
{
|
|
6126
6145
|
label: "Don't trust",
|
|
6127
|
-
value:
|
|
6128
|
-
key:
|
|
6146
|
+
value: TrustLevel.DO_NOT_TRUST,
|
|
6147
|
+
key: TrustLevel.DO_NOT_TRUST
|
|
6129
6148
|
}
|
|
6130
6149
|
];
|
|
6131
6150
|
const {
|
|
@@ -6366,7 +6385,7 @@ var ShellToolMessage = ({
|
|
|
6366
6385
|
maxLinesLimit: maxLines
|
|
6367
6386
|
});
|
|
6368
6387
|
import_react15.default.useEffect(() => {
|
|
6369
|
-
const isExecuting = status ===
|
|
6388
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
6370
6389
|
if (isExecuting && ptyId) {
|
|
6371
6390
|
try {
|
|
6372
6391
|
const childWidth = safeTerminalWidth - 4;
|
|
@@ -6580,13 +6599,13 @@ var SubagentGroupDisplay = ({
|
|
|
6580
6599
|
const singleAgent = toolCalls[0].resultDisplay;
|
|
6581
6600
|
if (isSubagentProgress(singleAgent)) {
|
|
6582
6601
|
switch (singleAgent.state) {
|
|
6583
|
-
case
|
|
6602
|
+
case SubagentState.COMPLETED:
|
|
6584
6603
|
headerText = "Agent Completed";
|
|
6585
6604
|
break;
|
|
6586
|
-
case
|
|
6605
|
+
case SubagentState.CANCELLED:
|
|
6587
6606
|
headerText = "Agent Cancelled";
|
|
6588
6607
|
break;
|
|
6589
|
-
case
|
|
6608
|
+
case SubagentState.ERROR:
|
|
6590
6609
|
headerText = "Agent Error";
|
|
6591
6610
|
break;
|
|
6592
6611
|
default:
|
|
@@ -6602,8 +6621,8 @@ var SubagentGroupDisplay = ({
|
|
|
6602
6621
|
for (const tc of toolCalls) {
|
|
6603
6622
|
const progress = tc.resultDisplay;
|
|
6604
6623
|
if (isSubagentProgress(progress)) {
|
|
6605
|
-
if (progress.state ===
|
|
6606
|
-
else if (progress.state ===
|
|
6624
|
+
if (progress.state === SubagentState.COMPLETED) completedCount++;
|
|
6625
|
+
else if (progress.state === SubagentState.RUNNING) runningCount++;
|
|
6607
6626
|
} else {
|
|
6608
6627
|
runningCount++;
|
|
6609
6628
|
}
|
|
@@ -6682,7 +6701,7 @@ var SubagentGroupDisplay = ({
|
|
|
6682
6701
|
if (!isExpanded) {
|
|
6683
6702
|
let content = "Starting...";
|
|
6684
6703
|
let formattedArgs;
|
|
6685
|
-
if (progress.state ===
|
|
6704
|
+
if (progress.state === SubagentState.COMPLETED) {
|
|
6686
6705
|
if (progress.terminateReason && progress.terminateReason !== "GOAL") {
|
|
6687
6706
|
content = `Finished Early (${progress.terminateReason})`;
|
|
6688
6707
|
} else {
|
|
@@ -6696,17 +6715,17 @@ var SubagentGroupDisplay = ({
|
|
|
6696
6715
|
formattedArgs = formatToolArgs(lastActivity.args);
|
|
6697
6716
|
}
|
|
6698
6717
|
}
|
|
6699
|
-
const displayArgs = progress.state ===
|
|
6718
|
+
const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
|
|
6700
6719
|
const renderStatusIcon = () => {
|
|
6701
|
-
const state = progress.state ??
|
|
6720
|
+
const state = progress.state ?? SubagentState.RUNNING;
|
|
6702
6721
|
switch (state) {
|
|
6703
|
-
case
|
|
6722
|
+
case SubagentState.RUNNING:
|
|
6704
6723
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.text.primary, children: "!" });
|
|
6705
|
-
case
|
|
6724
|
+
case SubagentState.COMPLETED:
|
|
6706
6725
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.success, children: "\u2713" });
|
|
6707
|
-
case
|
|
6726
|
+
case SubagentState.CANCELLED:
|
|
6708
6727
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
|
|
6709
|
-
case
|
|
6728
|
+
case SubagentState.ERROR:
|
|
6710
6729
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { color: theme.status.error, children: "\u2717" });
|
|
6711
6730
|
default:
|
|
6712
6731
|
return checkExhaustive(state);
|
|
@@ -6759,22 +6778,22 @@ var hasPayload = (res) => {
|
|
|
6759
6778
|
function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
6760
6779
|
const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
|
|
6761
6780
|
const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
|
|
6762
|
-
const isAcceptedOrConfirming = status ===
|
|
6781
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
6763
6782
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
6764
6783
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
6765
6784
|
const showDiffStat = !!diff.diffStat;
|
|
6766
6785
|
const description = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
|
|
6767
6786
|
let resultSummary = "";
|
|
6768
6787
|
let resultColor = theme.text.secondary;
|
|
6769
|
-
if (status ===
|
|
6788
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
6770
6789
|
resultSummary = "Confirming";
|
|
6771
|
-
} else if (status ===
|
|
6790
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
6772
6791
|
resultSummary = "Accepted";
|
|
6773
6792
|
resultColor = theme.text.accent;
|
|
6774
|
-
} else if (status ===
|
|
6793
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
6775
6794
|
resultSummary = "Rejected";
|
|
6776
6795
|
resultColor = theme.status.error;
|
|
6777
|
-
} else if (status ===
|
|
6796
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
6778
6797
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
6779
6798
|
resultColor = theme.status.error;
|
|
6780
6799
|
}
|
|
@@ -6805,7 +6824,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
|
|
|
6805
6824
|
filename: diff.fileName,
|
|
6806
6825
|
terminalWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
|
|
6807
6826
|
availableTerminalHeight,
|
|
6808
|
-
disableColor: status ===
|
|
6827
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6809
6828
|
}
|
|
6810
6829
|
);
|
|
6811
6830
|
return { description, summary, payload };
|
|
@@ -6933,10 +6952,10 @@ var DenseToolMessage = (props) => {
|
|
|
6933
6952
|
if (isGrepResult(resultDisplay)) {
|
|
6934
6953
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
6935
6954
|
}
|
|
6936
|
-
if (status ===
|
|
6955
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
6937
6956
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
6938
6957
|
}
|
|
6939
|
-
if (status ===
|
|
6958
|
+
if (status === CoreToolCallStatus.Error) {
|
|
6940
6959
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
6941
6960
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
6942
6961
|
"\u2192 ",
|
|
@@ -6977,7 +6996,7 @@ var DenseToolMessage = (props) => {
|
|
|
6977
6996
|
language: fileExtension,
|
|
6978
6997
|
maxWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
|
|
6979
6998
|
settings,
|
|
6980
|
-
disableColor: status ===
|
|
6999
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
6981
7000
|
returnLines: true
|
|
6982
7001
|
});
|
|
6983
7002
|
} else {
|
|
@@ -6985,7 +7004,7 @@ var DenseToolMessage = (props) => {
|
|
|
6985
7004
|
parsedLines,
|
|
6986
7005
|
filename: diff.fileName,
|
|
6987
7006
|
terminalWidth: Math.max(0, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT),
|
|
6988
|
-
disableColor: status ===
|
|
7007
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6989
7008
|
});
|
|
6990
7009
|
}
|
|
6991
7010
|
}, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
|
|
@@ -7122,7 +7141,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7122
7141
|
return pendingHistoryItems.some((item) => {
|
|
7123
7142
|
if (item && item.type === "tool_group") {
|
|
7124
7143
|
return item.tools.some(
|
|
7125
|
-
(tool) =>
|
|
7144
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
7126
7145
|
);
|
|
7127
7146
|
}
|
|
7128
7147
|
return false;
|
|
@@ -7131,7 +7150,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7131
7150
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
7132
7151
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
7133
7152
|
(item) => item.tools.some(
|
|
7134
|
-
(tool) =>
|
|
7153
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
7135
7154
|
)
|
|
7136
7155
|
);
|
|
7137
7156
|
}
|
|
@@ -7219,7 +7238,7 @@ var ToolGroupMessage = ({
|
|
|
7219
7238
|
const groupedTools = (0, import_react19.useMemo)(() => {
|
|
7220
7239
|
const groups = [];
|
|
7221
7240
|
for (const tool of visibleToolCalls) {
|
|
7222
|
-
if (tool.kind ===
|
|
7241
|
+
if (tool.kind === Kind.Agent) {
|
|
7223
7242
|
const lastGroup = groups[groups.length - 1];
|
|
7224
7243
|
if (Array.isArray(lastGroup)) {
|
|
7225
7244
|
lastGroup.push(tool);
|
|
@@ -7274,7 +7293,7 @@ var ToolGroupMessage = ({
|
|
|
7274
7293
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
7275
7294
|
let countToolCallsWithResults = 0;
|
|
7276
7295
|
for (const tool of visibleToolCalls) {
|
|
7277
|
-
if (tool.kind !==
|
|
7296
|
+
if (tool.kind !== Kind.Agent) {
|
|
7278
7297
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
7279
7298
|
if (hasDensePayload(tool)) {
|
|
7280
7299
|
countToolCallsWithResults++;
|
|
@@ -7465,7 +7484,7 @@ var ToolGroupDisplay = ({
|
|
|
7465
7484
|
}
|
|
7466
7485
|
const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
|
|
7467
7486
|
const visibleTools = tools.filter(
|
|
7468
|
-
(t) => t.status !==
|
|
7487
|
+
(t) => t.status !== CoreToolCallStatus.AwaitingApproval
|
|
7469
7488
|
);
|
|
7470
7489
|
const noticeTools = visibleTools.filter((t) => t.format === "notice");
|
|
7471
7490
|
const otherTools = visibleTools.filter(
|
|
@@ -7667,18 +7686,18 @@ function CompressionMessage({
|
|
|
7667
7686
|
return "Compressing chat history";
|
|
7668
7687
|
}
|
|
7669
7688
|
switch (compressionStatus) {
|
|
7670
|
-
case
|
|
7689
|
+
case CompressionStatus.COMPRESSED:
|
|
7671
7690
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
7672
|
-
case
|
|
7691
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
7673
7692
|
if (originalTokens < 5e4) {
|
|
7674
7693
|
return "Compression was not beneficial for this history size.";
|
|
7675
7694
|
}
|
|
7676
7695
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
7677
|
-
case
|
|
7696
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
7678
7697
|
return "Could not compress chat history due to a token counting error.";
|
|
7679
|
-
case
|
|
7698
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
7680
7699
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
7681
|
-
case
|
|
7700
|
+
case CompressionStatus.NOOP:
|
|
7682
7701
|
return "Nothing to compress.";
|
|
7683
7702
|
default:
|
|
7684
7703
|
return "";
|
|
@@ -8116,8 +8135,8 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8116
8135
|
);
|
|
8117
8136
|
roleEntries.sort(([a], [b]) => {
|
|
8118
8137
|
if (a === b) return 0;
|
|
8119
|
-
if (a ===
|
|
8120
|
-
if (b ===
|
|
8138
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8139
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8121
8140
|
return a.localeCompare(b);
|
|
8122
8141
|
});
|
|
8123
8142
|
roleEntries.forEach(([role, roleMetrics]) => {
|
|
@@ -8448,8 +8467,8 @@ var ModelStatsDisplay = ({
|
|
|
8448
8467
|
return validRoles.includes(role);
|
|
8449
8468
|
}).sort((a, b) => {
|
|
8450
8469
|
if (a === b) return 0;
|
|
8451
|
-
if (a ===
|
|
8452
|
-
if (b ===
|
|
8470
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8471
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8453
8472
|
return a.localeCompare(b);
|
|
8454
8473
|
});
|
|
8455
8474
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -9240,7 +9259,7 @@ var McpStatus = ({
|
|
|
9240
9259
|
);
|
|
9241
9260
|
const originalStatus = serverStatus(serverName);
|
|
9242
9261
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
9243
|
-
const status = originalStatus ===
|
|
9262
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
9244
9263
|
let statusIndicator = "";
|
|
9245
9264
|
let statusText = "";
|
|
9246
9265
|
let statusColor = theme.text.primary;
|
|
@@ -9252,17 +9271,17 @@ var McpStatus = ({
|
|
|
9252
9271
|
statusColor = theme.text.secondary;
|
|
9253
9272
|
} else {
|
|
9254
9273
|
switch (status) {
|
|
9255
|
-
case
|
|
9274
|
+
case MCPServerStatus.CONNECTED:
|
|
9256
9275
|
statusIndicator = "\u{1F7E2}";
|
|
9257
9276
|
statusText = "Ready";
|
|
9258
9277
|
statusColor = theme.status.success;
|
|
9259
9278
|
break;
|
|
9260
|
-
case
|
|
9279
|
+
case MCPServerStatus.CONNECTING:
|
|
9261
9280
|
statusIndicator = "\u{1F504}";
|
|
9262
9281
|
statusText = "Starting... (first startup may take longer)";
|
|
9263
9282
|
statusColor = theme.status.warning;
|
|
9264
9283
|
break;
|
|
9265
|
-
case
|
|
9284
|
+
case MCPServerStatus.DISCONNECTED:
|
|
9266
9285
|
default:
|
|
9267
9286
|
statusIndicator = "\u{1F534}";
|
|
9268
9287
|
statusText = "Disconnected";
|
|
@@ -9310,12 +9329,12 @@ var McpStatus = ({
|
|
|
9310
9329
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Text, { children: [
|
|
9311
9330
|
" - ",
|
|
9312
9331
|
statusText,
|
|
9313
|
-
status ===
|
|
9332
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
9314
9333
|
] }),
|
|
9315
9334
|
authStatusNode
|
|
9316
9335
|
] }),
|
|
9317
|
-
status ===
|
|
9318
|
-
status ===
|
|
9336
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
9337
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Text, { children: [
|
|
9319
9338
|
" (",
|
|
9320
9339
|
toolCount,
|
|
9321
9340
|
" tools cached)"
|
|
@@ -9876,7 +9895,7 @@ var Notifications = () => {
|
|
|
9876
9895
|
if (dismissed) return [];
|
|
9877
9896
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
9878
9897
|
return startupWarnings.filter((w) => {
|
|
9879
|
-
if (w.priority ===
|
|
9898
|
+
if (w.priority === WarningPriority.Low) {
|
|
9880
9899
|
const count = counts[w.id] || 0;
|
|
9881
9900
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
9882
9901
|
}
|
|
@@ -9889,7 +9908,7 @@ var Notifications = () => {
|
|
|
9889
9908
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
9890
9909
|
let changed = false;
|
|
9891
9910
|
visibleWarnings.forEach((w) => {
|
|
9892
|
-
if (w.priority ===
|
|
9911
|
+
if (w.priority === WarningPriority.Low) {
|
|
9893
9912
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
9894
9913
|
changed = true;
|
|
9895
9914
|
}
|
|
@@ -9996,7 +10015,7 @@ var UserIdentity = ({ config }) => {
|
|
|
9996
10015
|
}
|
|
9997
10016
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
9998
10017
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Box_default, { children: [
|
|
9999
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
10018
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Text, { children: [
|
|
10000
10019
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Text, { bold: true, children: [
|
|
10001
10020
|
"Signed in with Google",
|
|
10002
10021
|
email ? ":" : ""
|
|
@@ -10239,7 +10258,7 @@ var import_react30 = __toESM(require_react(), 1);
|
|
|
10239
10258
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
10240
10259
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
10241
10260
|
const confirmingTools = allPendingTools.filter(
|
|
10242
|
-
(tool) => tool.status ===
|
|
10261
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
10243
10262
|
);
|
|
10244
10263
|
if (confirmingTools.length === 0) {
|
|
10245
10264
|
return null;
|
|
@@ -11549,7 +11568,7 @@ var ExitPlanModeDialog = ({
|
|
|
11549
11568
|
{
|
|
11550
11569
|
questions: [
|
|
11551
11570
|
{
|
|
11552
|
-
type:
|
|
11571
|
+
type: QuestionType.CHOICE,
|
|
11553
11572
|
header: "Approval",
|
|
11554
11573
|
question: planContent,
|
|
11555
11574
|
options: [
|
|
@@ -11570,9 +11589,9 @@ var ExitPlanModeDialog = ({
|
|
|
11570
11589
|
onSubmit: (answers) => {
|
|
11571
11590
|
const answer = answers["0"];
|
|
11572
11591
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
11573
|
-
onApprove(
|
|
11592
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
11574
11593
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
11575
|
-
onApprove(
|
|
11594
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
11576
11595
|
} else if (answer) {
|
|
11577
11596
|
onFeedback(answer);
|
|
11578
11597
|
}
|
|
@@ -11784,7 +11803,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11784
11803
|
);
|
|
11785
11804
|
(0, import_react35.useEffect)(() => {
|
|
11786
11805
|
if (isCancelling) {
|
|
11787
|
-
handleConfirm(
|
|
11806
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
11788
11807
|
}
|
|
11789
11808
|
}, [isCancelling, handleConfirm]);
|
|
11790
11809
|
const handleSelect = (0, import_react35.useCallback)(
|
|
@@ -11797,19 +11816,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
11797
11816
|
if (!confirmationDetails.isModifying) {
|
|
11798
11817
|
options2.push({
|
|
11799
11818
|
label: "Allow once",
|
|
11800
|
-
value:
|
|
11819
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11801
11820
|
key: "Allow once"
|
|
11802
11821
|
});
|
|
11803
11822
|
if (isTrustedFolder && !confirmationDetails.isBuildFile) {
|
|
11804
11823
|
options2.push({
|
|
11805
11824
|
label: "Allow for this session",
|
|
11806
|
-
value:
|
|
11825
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11807
11826
|
key: "Allow for this session"
|
|
11808
11827
|
});
|
|
11809
11828
|
if (allowPermanentApproval) {
|
|
11810
11829
|
options2.push({
|
|
11811
11830
|
label: "Allow for this file in all future sessions",
|
|
11812
|
-
value:
|
|
11831
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11813
11832
|
key: "Allow for this file in all future sessions"
|
|
11814
11833
|
});
|
|
11815
11834
|
}
|
|
@@ -11817,45 +11836,45 @@ ${deceptiveUrlWarnings.map(
|
|
|
11817
11836
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
11818
11837
|
options2.push({
|
|
11819
11838
|
label: "Modify with external editor",
|
|
11820
|
-
value:
|
|
11839
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
11821
11840
|
key: "Modify with external editor"
|
|
11822
11841
|
});
|
|
11823
11842
|
}
|
|
11824
11843
|
options2.push({
|
|
11825
11844
|
label: "No, suggest changes (esc)",
|
|
11826
|
-
value:
|
|
11845
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11827
11846
|
key: "No, suggest changes (esc)"
|
|
11828
11847
|
});
|
|
11829
11848
|
}
|
|
11830
11849
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
11831
11850
|
options2.push({
|
|
11832
11851
|
label: "Allow once",
|
|
11833
|
-
value:
|
|
11852
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11834
11853
|
key: "Allow once"
|
|
11835
11854
|
});
|
|
11836
11855
|
if (isTrustedFolder) {
|
|
11837
11856
|
options2.push({
|
|
11838
11857
|
label: "Allow for this session",
|
|
11839
|
-
value:
|
|
11858
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11840
11859
|
key: "Allow for this session"
|
|
11841
11860
|
});
|
|
11842
11861
|
if (allowPermanentApproval) {
|
|
11843
11862
|
options2.push({
|
|
11844
11863
|
label: "Allow for all future sessions",
|
|
11845
|
-
value:
|
|
11864
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11846
11865
|
key: "Allow for all future sessions"
|
|
11847
11866
|
});
|
|
11848
11867
|
}
|
|
11849
11868
|
}
|
|
11850
11869
|
options2.push({
|
|
11851
11870
|
label: "No, suggest changes (esc)",
|
|
11852
|
-
value:
|
|
11871
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11853
11872
|
key: "No, suggest changes (esc)"
|
|
11854
11873
|
});
|
|
11855
11874
|
} else if (confirmationDetails.type === "exec") {
|
|
11856
11875
|
options2.push({
|
|
11857
11876
|
label: "Allow once",
|
|
11858
|
-
value:
|
|
11877
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11859
11878
|
key: "Allow once"
|
|
11860
11879
|
});
|
|
11861
11880
|
const hasUntrustedFlags = confirmationDetails.untrustedFlags && confirmationDetails.untrustedFlags.length > 0;
|
|
@@ -11863,75 +11882,75 @@ ${deceptiveUrlWarnings.map(
|
|
|
11863
11882
|
if (isTrustedFolder && !hasUntrustedFlags && !hasModifiedBuildFiles) {
|
|
11864
11883
|
options2.push({
|
|
11865
11884
|
label: `Allow for this session`,
|
|
11866
|
-
value:
|
|
11885
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11867
11886
|
key: `Allow for this session`
|
|
11868
11887
|
});
|
|
11869
11888
|
if (allowPermanentApproval) {
|
|
11870
11889
|
options2.push({
|
|
11871
11890
|
label: `Allow this command for all future sessions`,
|
|
11872
|
-
value:
|
|
11891
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11873
11892
|
key: `Allow for all future sessions`
|
|
11874
11893
|
});
|
|
11875
11894
|
}
|
|
11876
11895
|
}
|
|
11877
11896
|
options2.push({
|
|
11878
11897
|
label: "No, suggest changes (esc)",
|
|
11879
|
-
value:
|
|
11898
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11880
11899
|
key: "No, suggest changes (esc)"
|
|
11881
11900
|
});
|
|
11882
11901
|
} else if (confirmationDetails.type === "info") {
|
|
11883
11902
|
options2.push({
|
|
11884
11903
|
label: "Allow once",
|
|
11885
|
-
value:
|
|
11904
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11886
11905
|
key: "Allow once"
|
|
11887
11906
|
});
|
|
11888
11907
|
if (isTrustedFolder) {
|
|
11889
11908
|
options2.push({
|
|
11890
11909
|
label: "Allow for this session",
|
|
11891
|
-
value:
|
|
11910
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11892
11911
|
key: "Allow for this session"
|
|
11893
11912
|
});
|
|
11894
11913
|
if (allowPermanentApproval) {
|
|
11895
11914
|
options2.push({
|
|
11896
11915
|
label: "Allow for all future sessions",
|
|
11897
|
-
value:
|
|
11916
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11898
11917
|
key: "Allow for all future sessions"
|
|
11899
11918
|
});
|
|
11900
11919
|
}
|
|
11901
11920
|
}
|
|
11902
11921
|
options2.push({
|
|
11903
11922
|
label: "No, suggest changes (esc)",
|
|
11904
|
-
value:
|
|
11923
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11905
11924
|
key: "No, suggest changes (esc)"
|
|
11906
11925
|
});
|
|
11907
11926
|
} else if (confirmationDetails.type === "mcp") {
|
|
11908
11927
|
options2.push({
|
|
11909
11928
|
label: "Allow once",
|
|
11910
|
-
value:
|
|
11929
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11911
11930
|
key: "Allow once"
|
|
11912
11931
|
});
|
|
11913
11932
|
if (isTrustedFolder) {
|
|
11914
11933
|
options2.push({
|
|
11915
11934
|
label: "Allow tool for this session",
|
|
11916
|
-
value:
|
|
11935
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
11917
11936
|
key: "Allow tool for this session"
|
|
11918
11937
|
});
|
|
11919
11938
|
options2.push({
|
|
11920
11939
|
label: "Allow all server tools for this session",
|
|
11921
|
-
value:
|
|
11940
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
11922
11941
|
key: "Allow all server tools for this session"
|
|
11923
11942
|
});
|
|
11924
11943
|
if (allowPermanentApproval) {
|
|
11925
11944
|
options2.push({
|
|
11926
11945
|
label: "Allow tool for all future sessions",
|
|
11927
|
-
value:
|
|
11946
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11928
11947
|
key: "Allow tool for all future sessions"
|
|
11929
11948
|
});
|
|
11930
11949
|
}
|
|
11931
11950
|
}
|
|
11932
11951
|
options2.push({
|
|
11933
11952
|
label: "No, suggest changes (esc)",
|
|
11934
|
-
value:
|
|
11953
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11935
11954
|
key: "No, suggest changes (esc)"
|
|
11936
11955
|
});
|
|
11937
11956
|
}
|
|
@@ -11972,7 +11991,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11972
11991
|
const containsRedirection = commandsToDisplay.some(
|
|
11973
11992
|
(cmd) => hasRedirection(cmd)
|
|
11974
11993
|
);
|
|
11975
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
11994
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
11976
11995
|
if (containsRedirection && !isAutoEdit) {
|
|
11977
11996
|
extraInfoLines = 1;
|
|
11978
11997
|
}
|
|
@@ -11999,7 +12018,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11999
12018
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
12000
12019
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
12001
12020
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
12002
|
-
(o) => o.value ===
|
|
12021
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
12003
12022
|
);
|
|
12004
12023
|
if (alwaysAndSaveIndex !== -1) {
|
|
12005
12024
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -12048,10 +12067,10 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12048
12067
|
{
|
|
12049
12068
|
questions: confirmationDetails.questions,
|
|
12050
12069
|
onSubmit: (answers) => {
|
|
12051
|
-
handleConfirm(
|
|
12070
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
12052
12071
|
},
|
|
12053
12072
|
onCancel: () => {
|
|
12054
|
-
handleConfirm(
|
|
12073
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12055
12074
|
},
|
|
12056
12075
|
width: safeTerminalWidth,
|
|
12057
12076
|
availableHeight: bodyHeight
|
|
@@ -12072,19 +12091,19 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12072
12091
|
planPath: confirmationDetails.planPath,
|
|
12073
12092
|
getPreferredEditor,
|
|
12074
12093
|
onApprove: (approvalMode) => {
|
|
12075
|
-
handleConfirm(
|
|
12094
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12076
12095
|
approved: true,
|
|
12077
12096
|
approvalMode
|
|
12078
12097
|
});
|
|
12079
12098
|
},
|
|
12080
12099
|
onFeedback: (feedback) => {
|
|
12081
|
-
handleConfirm(
|
|
12100
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12082
12101
|
approved: false,
|
|
12083
12102
|
feedback
|
|
12084
12103
|
});
|
|
12085
12104
|
},
|
|
12086
12105
|
onCancel: () => {
|
|
12087
|
-
handleConfirm(
|
|
12106
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12088
12107
|
},
|
|
12089
12108
|
width: safeTerminalWidth,
|
|
12090
12109
|
availableHeight: bodyHeight
|
|
@@ -12194,7 +12213,7 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12194
12213
|
const containsRedirection = commandsToDisplay.some(
|
|
12195
12214
|
(cmd) => hasRedirection(cmd)
|
|
12196
12215
|
);
|
|
12197
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12216
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12198
12217
|
let warnings = null;
|
|
12199
12218
|
if (containsRedirection && !isAutoEdit) {
|
|
12200
12219
|
const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
|
|
@@ -12353,7 +12372,7 @@ Ensure you trust all modifications made to build files before approving executio
|
|
|
12353
12372
|
const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
|
|
12354
12373
|
const renderRadioItem = (0, import_react35.useCallback)(
|
|
12355
12374
|
(item, { titleColor }) => {
|
|
12356
|
-
if (item.value ===
|
|
12375
|
+
if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
12357
12376
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
|
|
12358
12377
|
item.label,
|
|
12359
12378
|
" ",
|
|
@@ -12742,7 +12761,7 @@ var MainContent = () => {
|
|
|
12742
12761
|
const hasConfirmationQueue = Boolean(
|
|
12743
12762
|
showConfirmationQueue && confirmingTool
|
|
12744
12763
|
);
|
|
12745
|
-
const isVisiblePendingItem = (item) => item.type !== "tool_group" || item.tools.some((t) => t.status !==
|
|
12764
|
+
const isVisiblePendingItem = (item) => item.type !== "tool_group" || item.tools.some((t) => t.status !== CoreToolCallStatus.AwaitingApproval);
|
|
12746
12765
|
const visiblePendingCount = pendingHistoryItems.filter(isVisiblePendingItem).length;
|
|
12747
12766
|
const shouldPartitionHeight = !isAlternateBufferOrTerminalBuffer && hasConfirmationQueue && visiblePendingCount > 0;
|
|
12748
12767
|
const pendingCount = Math.max(1, visiblePendingCount);
|
|
@@ -14446,7 +14465,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
|
|
|
14446
14465
|
if (settings.merged.security.auth.useExternal) {
|
|
14447
14466
|
return null;
|
|
14448
14467
|
}
|
|
14449
|
-
if (authType ===
|
|
14468
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14450
14469
|
return null;
|
|
14451
14470
|
}
|
|
14452
14471
|
return validateAuthMethod(authType);
|
|
@@ -14498,7 +14517,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
14498
14517
|
}
|
|
14499
14518
|
return;
|
|
14500
14519
|
}
|
|
14501
|
-
if (authType ===
|
|
14520
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14502
14521
|
const key = await reloadApiKey();
|
|
14503
14522
|
if (!key) {
|
|
14504
14523
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -14576,31 +14595,31 @@ function AuthDialog({
|
|
|
14576
14595
|
let items = [
|
|
14577
14596
|
{
|
|
14578
14597
|
label: "Sign in with Google",
|
|
14579
|
-
value:
|
|
14580
|
-
key:
|
|
14598
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
14599
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
14581
14600
|
},
|
|
14582
14601
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
14583
14602
|
{
|
|
14584
14603
|
label: "Use Cloud Shell user credentials",
|
|
14585
|
-
value:
|
|
14586
|
-
key:
|
|
14604
|
+
value: AuthType.COMPUTE_ADC,
|
|
14605
|
+
key: AuthType.COMPUTE_ADC
|
|
14587
14606
|
}
|
|
14588
14607
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
14589
14608
|
{
|
|
14590
14609
|
label: "Use metadata server application default credentials",
|
|
14591
|
-
value:
|
|
14592
|
-
key:
|
|
14610
|
+
value: AuthType.COMPUTE_ADC,
|
|
14611
|
+
key: AuthType.COMPUTE_ADC
|
|
14593
14612
|
}
|
|
14594
14613
|
] : [],
|
|
14595
14614
|
{
|
|
14596
14615
|
label: "Use Gemini API Key",
|
|
14597
|
-
value:
|
|
14598
|
-
key:
|
|
14616
|
+
value: AuthType.USE_GEMINI,
|
|
14617
|
+
key: AuthType.USE_GEMINI
|
|
14599
14618
|
},
|
|
14600
14619
|
{
|
|
14601
14620
|
label: "Vertex AI",
|
|
14602
|
-
value:
|
|
14603
|
-
key:
|
|
14621
|
+
value: AuthType.USE_VERTEX_AI,
|
|
14622
|
+
key: AuthType.USE_VERTEX_AI
|
|
14604
14623
|
}
|
|
14605
14624
|
];
|
|
14606
14625
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -14622,9 +14641,9 @@ function AuthDialog({
|
|
|
14622
14641
|
return item.value === defaultAuthType;
|
|
14623
14642
|
}
|
|
14624
14643
|
if (process.env["GEMINI_API_KEY"]) {
|
|
14625
|
-
return item.value ===
|
|
14644
|
+
return item.value === AuthType.USE_GEMINI;
|
|
14626
14645
|
}
|
|
14627
|
-
return item.value ===
|
|
14646
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
14628
14647
|
});
|
|
14629
14648
|
if (settings.merged.security.auth.enforcedType) {
|
|
14630
14649
|
initialAuthIndex = 0;
|
|
@@ -14635,7 +14654,7 @@ function AuthDialog({
|
|
|
14635
14654
|
return;
|
|
14636
14655
|
}
|
|
14637
14656
|
if (authType) {
|
|
14638
|
-
const needsRestart = authType ===
|
|
14657
|
+
const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
|
|
14639
14658
|
if (needsRestart) {
|
|
14640
14659
|
setAuthContext({ requiresRestart: true });
|
|
14641
14660
|
} else {
|
|
@@ -14646,7 +14665,7 @@ function AuthDialog({
|
|
|
14646
14665
|
await clearCachedCredentialFile();
|
|
14647
14666
|
}
|
|
14648
14667
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
14649
|
-
if (authType ===
|
|
14668
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
14650
14669
|
setExiting(true);
|
|
14651
14670
|
setTimeout(() => {
|
|
14652
14671
|
void relaunchApp({ overrideAuthType: authType }).catch((err) => {
|
|
@@ -14656,7 +14675,7 @@ function AuthDialog({
|
|
|
14656
14675
|
}, 100);
|
|
14657
14676
|
return;
|
|
14658
14677
|
}
|
|
14659
|
-
if (authType ===
|
|
14678
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14660
14679
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
14661
14680
|
return;
|
|
14662
14681
|
}
|
|
@@ -15463,11 +15482,11 @@ var PrivacyNoticeText = ({
|
|
|
15463
15482
|
}) => {
|
|
15464
15483
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15465
15484
|
switch (authType) {
|
|
15466
|
-
case
|
|
15485
|
+
case AuthType.USE_GEMINI:
|
|
15467
15486
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15468
|
-
case
|
|
15487
|
+
case AuthType.USE_VERTEX_AI:
|
|
15469
15488
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15470
|
-
case
|
|
15489
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15471
15490
|
default:
|
|
15472
15491
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15473
15492
|
}
|
|
@@ -15527,7 +15546,7 @@ function ProQuotaDialog({
|
|
|
15527
15546
|
value: "retry_always",
|
|
15528
15547
|
key: "retry_always"
|
|
15529
15548
|
},
|
|
15530
|
-
...authType ===
|
|
15549
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15531
15550
|
{
|
|
15532
15551
|
label: "Upgrade for higher limits",
|
|
15533
15552
|
value: "upgrade",
|
|
@@ -16694,7 +16713,7 @@ function ModelDialog({ onClose }) {
|
|
|
16694
16713
|
const useLatestFlash = config?.hasLatestFlashGAAccess?.() ?? false;
|
|
16695
16714
|
const useLatestFlashLite = config?.hasLatestFlashLiteGAAccess?.() ?? false;
|
|
16696
16715
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16697
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16716
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16698
16717
|
const manualModelSelected = (0, import_react53.useMemo)(() => {
|
|
16699
16718
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16700
16719
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -18022,10 +18041,10 @@ function initializeConsoleStore() {
|
|
|
18022
18041
|
globalConsoleMessages = [];
|
|
18023
18042
|
globalErrorCount = 0;
|
|
18024
18043
|
notifyListeners();
|
|
18025
|
-
coreEvents.off(
|
|
18026
|
-
coreEvents.off(
|
|
18027
|
-
coreEvents.on(
|
|
18028
|
-
coreEvents.on(
|
|
18044
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18045
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
18046
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18047
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
18029
18048
|
}
|
|
18030
18049
|
function notifyListeners() {
|
|
18031
18050
|
for (const listener of listeners) {
|
|
@@ -20162,7 +20181,7 @@ function usePromptCompletion({
|
|
|
20162
20181
|
{ model: "prompt-completion" },
|
|
20163
20182
|
contents,
|
|
20164
20183
|
signal,
|
|
20165
|
-
|
|
20184
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20166
20185
|
);
|
|
20167
20186
|
if (signal.aborted) {
|
|
20168
20187
|
return;
|
|
@@ -22241,9 +22260,9 @@ var InputPrompt = ({
|
|
|
22241
22260
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22242
22261
|
}
|
|
22243
22262
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22244
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22245
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22246
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22263
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22264
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22265
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22247
22266
|
let statusColor;
|
|
22248
22267
|
let statusText = "";
|
|
22249
22268
|
if (shellModeActive) {
|
|
@@ -23077,22 +23096,22 @@ var ApprovalModeIndicator = ({
|
|
|
23077
23096
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
23078
23097
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
23079
23098
|
switch (approvalMode) {
|
|
23080
|
-
case
|
|
23099
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23081
23100
|
textColor = theme.status.warning;
|
|
23082
23101
|
textContent = "auto-accept edits";
|
|
23083
23102
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23084
23103
|
break;
|
|
23085
|
-
case
|
|
23104
|
+
case ApprovalMode.PLAN:
|
|
23086
23105
|
textColor = theme.status.success;
|
|
23087
23106
|
textContent = "plan";
|
|
23088
23107
|
subText = `${cycleHint} to manual`;
|
|
23089
23108
|
break;
|
|
23090
|
-
case
|
|
23109
|
+
case ApprovalMode.YOLO:
|
|
23091
23110
|
textColor = theme.status.error;
|
|
23092
23111
|
textContent = "YOLO";
|
|
23093
23112
|
subText = yoloHint;
|
|
23094
23113
|
break;
|
|
23095
|
-
case
|
|
23114
|
+
case ApprovalMode.DEFAULT:
|
|
23096
23115
|
default:
|
|
23097
23116
|
textColor = theme.text.accent;
|
|
23098
23117
|
textContent = "";
|
|
@@ -23140,7 +23159,7 @@ var useComposerStatus = () => {
|
|
|
23140
23159
|
(item) => item.type === "tool_group"
|
|
23141
23160
|
).some(
|
|
23142
23161
|
(item) => item.tools.some(
|
|
23143
|
-
(tool) => tool.status ===
|
|
23162
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23144
23163
|
)
|
|
23145
23164
|
),
|
|
23146
23165
|
[uiState.pendingHistoryItems]
|
|
@@ -23155,13 +23174,13 @@ var useComposerStatus = () => {
|
|
|
23155
23174
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23156
23175
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23157
23176
|
switch (showApprovalModeIndicator) {
|
|
23158
|
-
case
|
|
23177
|
+
case ApprovalMode.YOLO:
|
|
23159
23178
|
return { text: "YOLO", color: theme.status.error };
|
|
23160
|
-
case
|
|
23179
|
+
case ApprovalMode.PLAN:
|
|
23161
23180
|
return { text: "plan", color: theme.status.success };
|
|
23162
|
-
case
|
|
23181
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23163
23182
|
return { text: "auto edit", color: theme.status.warning };
|
|
23164
|
-
case
|
|
23183
|
+
case ApprovalMode.DEFAULT:
|
|
23165
23184
|
default:
|
|
23166
23185
|
return null;
|
|
23167
23186
|
}
|
|
@@ -23523,7 +23542,7 @@ var ConfigInitDisplay = ({
|
|
|
23523
23542
|
let connected = 0;
|
|
23524
23543
|
const connecting = [];
|
|
23525
23544
|
for (const [name, client] of clients.entries()) {
|
|
23526
|
-
if (client.getStatus() ===
|
|
23545
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23527
23546
|
connected++;
|
|
23528
23547
|
} else {
|
|
23529
23548
|
connecting.push(name);
|
|
@@ -23545,9 +23564,9 @@ var ConfigInitDisplay = ({
|
|
|
23545
23564
|
);
|
|
23546
23565
|
}
|
|
23547
23566
|
};
|
|
23548
|
-
coreEvents.on(
|
|
23567
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23549
23568
|
return () => {
|
|
23550
|
-
coreEvents.off(
|
|
23569
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23551
23570
|
};
|
|
23552
23571
|
}, [initialMessage]);
|
|
23553
23572
|
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Text, { children: [
|
|
@@ -24268,7 +24287,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24268
24287
|
callId,
|
|
24269
24288
|
name: SHELL_COMMAND_NAME,
|
|
24270
24289
|
description: rawQuery,
|
|
24271
|
-
status:
|
|
24290
|
+
status: CoreToolCallStatus.Executing,
|
|
24272
24291
|
isClientInitiated: true,
|
|
24273
24292
|
resultDisplay: "",
|
|
24274
24293
|
confirmationDetails: void 0
|
|
@@ -24409,7 +24428,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24409
24428
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24410
24429
|
}
|
|
24411
24430
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24412
|
-
let finalStatus =
|
|
24431
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24413
24432
|
const prependToAnsiOutput = (output, text) => {
|
|
24414
24433
|
const newLines = text.split("\n").map((line) => [
|
|
24415
24434
|
{
|
|
@@ -24428,20 +24447,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24428
24447
|
};
|
|
24429
24448
|
let prefix = "";
|
|
24430
24449
|
if (result.error) {
|
|
24431
|
-
finalStatus =
|
|
24450
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24432
24451
|
prefix = result.error.message;
|
|
24433
24452
|
} else if (result.aborted) {
|
|
24434
|
-
finalStatus =
|
|
24453
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24435
24454
|
prefix = "Command was cancelled.";
|
|
24436
24455
|
} else if (result.backgrounded) {
|
|
24437
|
-
finalStatus =
|
|
24456
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24438
24457
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24439
24458
|
mainContent = finalOutput;
|
|
24440
24459
|
} else if (result.signal) {
|
|
24441
|
-
finalStatus =
|
|
24460
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24442
24461
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24443
24462
|
} else if (result.exitCode !== 0) {
|
|
24444
|
-
finalStatus =
|
|
24463
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24445
24464
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24446
24465
|
}
|
|
24447
24466
|
if (prefix) {
|
|
@@ -24467,7 +24486,7 @@ ${mainContent}`;
|
|
|
24467
24486
|
status: finalStatus,
|
|
24468
24487
|
resultDisplay: finalOutput
|
|
24469
24488
|
};
|
|
24470
|
-
if (finalStatus !==
|
|
24489
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24471
24490
|
addItemToHistory(
|
|
24472
24491
|
{
|
|
24473
24492
|
type: "tool_group",
|
|
@@ -25477,13 +25496,13 @@ function useQuotaAndFallback({
|
|
|
25477
25496
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25478
25497
|
`/stats model for usage details`,
|
|
25479
25498
|
`/model to switch models.`,
|
|
25480
|
-
contentGeneratorConfig?.authType ===
|
|
25499
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25481
25500
|
].filter(Boolean);
|
|
25482
25501
|
message = messageLines.join("\n");
|
|
25483
25502
|
}
|
|
25484
25503
|
} else if (error instanceof ModelNotFoundError) {
|
|
25485
25504
|
isModelNotFoundError = true;
|
|
25486
|
-
if (contentGeneratorConfig?.authType ===
|
|
25505
|
+
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
25487
25506
|
const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
|
|
25488
25507
|
const messageLines = [
|
|
25489
25508
|
`Model "${failedModel}" is not available in region "${location}".`,
|
|
@@ -25677,7 +25696,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25677
25696
|
);
|
|
25678
25697
|
setEditorError(null);
|
|
25679
25698
|
setIsEditorDialogOpen(false);
|
|
25680
|
-
coreEvents.emit(
|
|
25699
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25681
25700
|
} catch (error) {
|
|
25682
25701
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25683
25702
|
}
|
|
@@ -25686,7 +25705,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25686
25705
|
);
|
|
25687
25706
|
const exitEditorDialog = (0, import_react89.useCallback)(() => {
|
|
25688
25707
|
setIsEditorDialogOpen(false);
|
|
25689
|
-
coreEvents.emit(
|
|
25708
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25690
25709
|
}, []);
|
|
25691
25710
|
return {
|
|
25692
25711
|
isEditorDialogOpen,
|
|
@@ -26063,7 +26082,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26063
26082
|
canonicalPath: resolvedCommandPath
|
|
26064
26083
|
} = parseSlashCommand(trimmed, commands);
|
|
26065
26084
|
if (!commandToExecute) {
|
|
26066
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
26085
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
26067
26086
|
if (isMcpLoading) {
|
|
26068
26087
|
setIsProcessing(true);
|
|
26069
26088
|
if (addToHistory) {
|
|
@@ -26243,7 +26262,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26243
26262
|
onConfirm: async (resolvedOutcome) => {
|
|
26244
26263
|
resolve3({
|
|
26245
26264
|
outcome: resolvedOutcome,
|
|
26246
|
-
approvedCommands: resolvedOutcome ===
|
|
26265
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26247
26266
|
});
|
|
26248
26267
|
}
|
|
26249
26268
|
};
|
|
@@ -26251,7 +26270,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26251
26270
|
callId,
|
|
26252
26271
|
name: "Expansion",
|
|
26253
26272
|
description: "Command expansion needs shell access",
|
|
26254
|
-
status:
|
|
26273
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26255
26274
|
isClientInitiated: true,
|
|
26256
26275
|
resultDisplay: void 0,
|
|
26257
26276
|
confirmationDetails
|
|
@@ -26262,7 +26281,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26262
26281
|
});
|
|
26263
26282
|
});
|
|
26264
26283
|
setPendingItem(null);
|
|
26265
|
-
if (outcome ===
|
|
26284
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26266
26285
|
addItem(
|
|
26267
26286
|
{
|
|
26268
26287
|
type: "info" /* INFO */,
|
|
@@ -26272,7 +26291,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26272
26291
|
);
|
|
26273
26292
|
return { type: "handled" };
|
|
26274
26293
|
}
|
|
26275
|
-
if (outcome ===
|
|
26294
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26276
26295
|
setSessionShellAllowlist(
|
|
26277
26296
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26278
26297
|
);
|
|
@@ -26748,7 +26767,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26748
26767
|
let description;
|
|
26749
26768
|
let renderOutputAsMarkdown = false;
|
|
26750
26769
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26751
|
-
if (call.status ===
|
|
26770
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26752
26771
|
description = JSON.stringify(call.request.args);
|
|
26753
26772
|
} else {
|
|
26754
26773
|
description = call.invocation.getDescription();
|
|
@@ -26771,27 +26790,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26771
26790
|
let progress = void 0;
|
|
26772
26791
|
let progressTotal = void 0;
|
|
26773
26792
|
switch (call.status) {
|
|
26774
|
-
case
|
|
26793
|
+
case CoreToolCallStatus.Success:
|
|
26775
26794
|
resultDisplay = call.response.resultDisplay;
|
|
26776
26795
|
outputFile = call.response.outputFile;
|
|
26777
26796
|
break;
|
|
26778
|
-
case
|
|
26779
|
-
case
|
|
26797
|
+
case CoreToolCallStatus.Error:
|
|
26798
|
+
case CoreToolCallStatus.Cancelled:
|
|
26780
26799
|
resultDisplay = call.response.resultDisplay;
|
|
26781
26800
|
break;
|
|
26782
|
-
case
|
|
26801
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26783
26802
|
correlationId = call.correlationId;
|
|
26784
26803
|
confirmationDetails = call.confirmationDetails;
|
|
26785
26804
|
break;
|
|
26786
|
-
case
|
|
26805
|
+
case CoreToolCallStatus.Executing:
|
|
26787
26806
|
resultDisplay = call.liveOutput;
|
|
26788
26807
|
ptyId = call.pid;
|
|
26789
26808
|
progressMessage = call.progressMessage;
|
|
26790
26809
|
progress = call.progress;
|
|
26791
26810
|
progressTotal = call.progressTotal;
|
|
26792
26811
|
break;
|
|
26793
|
-
case
|
|
26794
|
-
case
|
|
26812
|
+
case CoreToolCallStatus.Scheduled:
|
|
26813
|
+
case CoreToolCallStatus.Validating:
|
|
26795
26814
|
break;
|
|
26796
26815
|
default: {
|
|
26797
26816
|
const exhaustiveCheck = call;
|
|
@@ -26862,7 +26881,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26862
26881
|
const handler = (event) => {
|
|
26863
26882
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26864
26883
|
const hasExecuting = event.toolCalls.some(
|
|
26865
|
-
(tc) => tc.status ===
|
|
26884
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26866
26885
|
);
|
|
26867
26886
|
if (hasExecuting) {
|
|
26868
26887
|
setLastToolOutputTime(Date.now());
|
|
@@ -26871,7 +26890,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26871
26890
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26872
26891
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26873
26892
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26874
|
-
(tc) => tc.status ===
|
|
26893
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26875
26894
|
);
|
|
26876
26895
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26877
26896
|
return prev;
|
|
@@ -26883,9 +26902,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26883
26902
|
};
|
|
26884
26903
|
});
|
|
26885
26904
|
};
|
|
26886
|
-
messageBus.subscribe(
|
|
26905
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26887
26906
|
return () => {
|
|
26888
|
-
messageBus.unsubscribe(
|
|
26907
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26889
26908
|
};
|
|
26890
26909
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26891
26910
|
(0, import_react96.useEffect)(() => {
|
|
@@ -26907,9 +26926,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26907
26926
|
};
|
|
26908
26927
|
});
|
|
26909
26928
|
};
|
|
26910
|
-
messageBus.subscribe(
|
|
26929
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26911
26930
|
return () => {
|
|
26912
|
-
messageBus.unsubscribe(
|
|
26931
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26913
26932
|
};
|
|
26914
26933
|
}, [messageBus]);
|
|
26915
26934
|
const schedule = (0, import_react96.useCallback)(
|
|
@@ -27008,8 +27027,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
27008
27027
|
const prev = prevMap.get(coreCall.request.callId);
|
|
27009
27028
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
27010
27029
|
let status = coreCall.status;
|
|
27011
|
-
if ((status ===
|
|
27012
|
-
status =
|
|
27030
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
27031
|
+
status = CoreToolCallStatus.Executing;
|
|
27013
27032
|
}
|
|
27014
27033
|
return {
|
|
27015
27034
|
...coreCall,
|
|
@@ -27041,7 +27060,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
27041
27060
|
};
|
|
27042
27061
|
}
|
|
27043
27062
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
27044
|
-
return toolCall.status ===
|
|
27063
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
27045
27064
|
}
|
|
27046
27065
|
function showCitations(settings) {
|
|
27047
27066
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -27051,14 +27070,14 @@ function showCitations(settings) {
|
|
|
27051
27070
|
return true;
|
|
27052
27071
|
}
|
|
27053
27072
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
27054
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
27073
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
27055
27074
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
27056
27075
|
}
|
|
27057
27076
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
27058
|
-
if (tc.status ===
|
|
27077
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
27059
27078
|
return true;
|
|
27060
27079
|
}
|
|
27061
|
-
if (tc.status ===
|
|
27080
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
27062
27081
|
return !tc.responseSubmittedToGemini;
|
|
27063
27082
|
}
|
|
27064
27083
|
return false;
|
|
@@ -27080,7 +27099,6 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27080
27099
|
const abortControllerRef = (0, import_react97.useRef)(null);
|
|
27081
27100
|
const turnCancelledRef = (0, import_react97.useRef)(false);
|
|
27082
27101
|
const activeQueryIdRef = (0, import_react97.useRef)(null);
|
|
27083
|
-
const historyLengthAfterUserPromptRef = (0, import_react97.useRef)(void 0);
|
|
27084
27102
|
const previousApprovalModeRef = (0, import_react97.useRef)(
|
|
27085
27103
|
config.getApprovalMode()
|
|
27086
27104
|
);
|
|
@@ -27105,9 +27123,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27105
27123
|
}
|
|
27106
27124
|
setRetryStatus(payload);
|
|
27107
27125
|
};
|
|
27108
|
-
coreEvents.on(
|
|
27126
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27109
27127
|
return () => {
|
|
27110
|
-
coreEvents.off(
|
|
27128
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27111
27129
|
};
|
|
27112
27130
|
}, [isRespondingRef]);
|
|
27113
27131
|
const [
|
|
@@ -27240,12 +27258,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27240
27258
|
const tc = toolCalls[i];
|
|
27241
27259
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27242
27260
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27243
|
-
const isAgent = tc.tool?.kind ===
|
|
27261
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27244
27262
|
if (isAgent) {
|
|
27245
27263
|
let contigAgentsComplete = true;
|
|
27246
27264
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27247
27265
|
const nextTc = toolCalls[j];
|
|
27248
|
-
if (nextTc.tool?.kind ===
|
|
27266
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27249
27267
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27250
27268
|
contigAgentsComplete = false;
|
|
27251
27269
|
break;
|
|
@@ -27271,7 +27289,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27271
27289
|
let currentGroup = [];
|
|
27272
27290
|
for (const tc of toolsToPush) {
|
|
27273
27291
|
newPushed.add(tc.request.callId);
|
|
27274
|
-
if (tc.tool?.kind ===
|
|
27292
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27275
27293
|
currentGroup.push(tc);
|
|
27276
27294
|
} else {
|
|
27277
27295
|
if (currentGroup.length > 0) {
|
|
@@ -27424,7 +27442,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27424
27442
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27425
27443
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27426
27444
|
(0, import_react97.useEffect)(() => {
|
|
27427
|
-
if (config.getApprovalMode() ===
|
|
27445
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27428
27446
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27429
27447
|
(item) => item.type === "user" /* USER */
|
|
27430
27448
|
);
|
|
@@ -27492,7 +27510,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27492
27510
|
return;
|
|
27493
27511
|
}
|
|
27494
27512
|
const hasActiveTools = toolCalls.some(
|
|
27495
|
-
(tc) => tc.status ===
|
|
27513
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27496
27514
|
);
|
|
27497
27515
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27498
27516
|
if (clearBuffer) {
|
|
@@ -27519,7 +27537,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27519
27537
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27520
27538
|
return {
|
|
27521
27539
|
...tool,
|
|
27522
|
-
status:
|
|
27540
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27523
27541
|
resultDisplay: tool.resultDisplay
|
|
27524
27542
|
};
|
|
27525
27543
|
}
|
|
@@ -27584,7 +27602,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27584
27602
|
let localQueryToSendToGemini = null;
|
|
27585
27603
|
if (typeof query === "string") {
|
|
27586
27604
|
const trimmedQuery = query.trim();
|
|
27587
|
-
await logger?.logMessage(
|
|
27605
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27588
27606
|
if (!shellModeActive) {
|
|
27589
27607
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27590
27608
|
if (slashCommandResult) {
|
|
@@ -27740,7 +27758,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27740
27758
|
if (pendingHistoryItemRef.current) {
|
|
27741
27759
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27742
27760
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27743
|
-
(tool) => tool.status ===
|
|
27761
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
27744
27762
|
);
|
|
27745
27763
|
const pendingItem = {
|
|
27746
27764
|
...pendingHistoryItemRef.current,
|
|
@@ -28032,15 +28050,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28032
28050
|
let geminiMessageBuffer = "";
|
|
28033
28051
|
const toolCallRequests = [];
|
|
28034
28052
|
for await (const event of stream) {
|
|
28035
|
-
if (event.type !==
|
|
28053
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
28036
28054
|
setThought(null);
|
|
28037
28055
|
}
|
|
28038
28056
|
switch (event.type) {
|
|
28039
|
-
case
|
|
28057
|
+
case GeminiEventType.Thought:
|
|
28040
28058
|
setLastGeminiActivityTime(Date.now());
|
|
28041
28059
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
28042
28060
|
break;
|
|
28043
|
-
case
|
|
28061
|
+
case GeminiEventType.Content:
|
|
28044
28062
|
setLastGeminiActivityTime(Date.now());
|
|
28045
28063
|
geminiMessageBuffer = handleContentEvent(
|
|
28046
28064
|
event.value,
|
|
@@ -28048,16 +28066,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28048
28066
|
userMessageTimestamp
|
|
28049
28067
|
);
|
|
28050
28068
|
break;
|
|
28051
|
-
case
|
|
28069
|
+
case GeminiEventType.ToolCallRequest:
|
|
28052
28070
|
toolCallRequests.push(event.value);
|
|
28053
28071
|
break;
|
|
28054
|
-
case
|
|
28072
|
+
case GeminiEventType.UserCancelled:
|
|
28055
28073
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
28056
28074
|
break;
|
|
28057
|
-
case
|
|
28075
|
+
case GeminiEventType.Error:
|
|
28058
28076
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
28059
28077
|
break;
|
|
28060
|
-
case
|
|
28078
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
28061
28079
|
handleAgentExecutionStoppedEvent(
|
|
28062
28080
|
event.value.reason,
|
|
28063
28081
|
userMessageTimestamp,
|
|
@@ -28065,7 +28083,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28065
28083
|
event.value.contextCleared
|
|
28066
28084
|
);
|
|
28067
28085
|
break;
|
|
28068
|
-
case
|
|
28086
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
28069
28087
|
handleAgentExecutionBlockedEvent(
|
|
28070
28088
|
event.value.reason,
|
|
28071
28089
|
userMessageTimestamp,
|
|
@@ -28073,36 +28091,36 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28073
28091
|
event.value.contextCleared
|
|
28074
28092
|
);
|
|
28075
28093
|
break;
|
|
28076
|
-
case
|
|
28094
|
+
case GeminiEventType.ChatCompressed:
|
|
28077
28095
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
28078
28096
|
break;
|
|
28079
|
-
case
|
|
28080
|
-
case
|
|
28097
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
28098
|
+
case GeminiEventType.ToolCallResponse:
|
|
28081
28099
|
break;
|
|
28082
|
-
case
|
|
28100
|
+
case GeminiEventType.MaxSessionTurns:
|
|
28083
28101
|
handleMaxSessionTurnsEvent();
|
|
28084
28102
|
break;
|
|
28085
|
-
case
|
|
28103
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
28086
28104
|
handleContextWindowWillOverflowEvent(
|
|
28087
28105
|
event.value.estimatedRequestTokenCount,
|
|
28088
28106
|
event.value.remainingTokenCount
|
|
28089
28107
|
);
|
|
28090
28108
|
break;
|
|
28091
|
-
case
|
|
28109
|
+
case GeminiEventType.Finished:
|
|
28092
28110
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
28093
28111
|
break;
|
|
28094
|
-
case
|
|
28112
|
+
case GeminiEventType.Citation:
|
|
28095
28113
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
28096
28114
|
break;
|
|
28097
|
-
case
|
|
28115
|
+
case GeminiEventType.ModelInfo:
|
|
28098
28116
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
28099
28117
|
break;
|
|
28100
|
-
case
|
|
28118
|
+
case GeminiEventType.LoopDetected:
|
|
28101
28119
|
loopDetectedRef.current = true;
|
|
28102
28120
|
break;
|
|
28103
|
-
case
|
|
28121
|
+
case GeminiEventType.Retry:
|
|
28104
28122
|
break;
|
|
28105
|
-
case
|
|
28123
|
+
case GeminiEventType.InvalidStream:
|
|
28106
28124
|
handleInvalidStreamEvent(event.value, userMessageTimestamp);
|
|
28107
28125
|
break;
|
|
28108
28126
|
default: {
|
|
@@ -28156,7 +28174,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28156
28174
|
const submitQuery = (0, import_react97.useCallback)(
|
|
28157
28175
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
28158
28176
|
{
|
|
28159
|
-
operation: options?.isContinuation ?
|
|
28177
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
28160
28178
|
sessionId: config.getSessionId()
|
|
28161
28179
|
},
|
|
28162
28180
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28193,9 +28211,6 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28193
28211
|
if (!shouldProceed || queryToSend === null) {
|
|
28194
28212
|
return;
|
|
28195
28213
|
}
|
|
28196
|
-
if (geminiClient) {
|
|
28197
|
-
historyLengthAfterUserPromptRef.current = geminiClient.getHistory().length;
|
|
28198
|
-
}
|
|
28199
28214
|
if (!options?.isContinuation) {
|
|
28200
28215
|
if (typeof queryToSend === "string") {
|
|
28201
28216
|
const promptText = queryToSend;
|
|
@@ -28323,7 +28338,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28323
28338
|
submitQueryRef.current = submitQuery;
|
|
28324
28339
|
const handleApprovalModeChange = (0, import_react97.useCallback)(
|
|
28325
28340
|
async (newApprovalMode) => {
|
|
28326
|
-
if (previousApprovalModeRef.current ===
|
|
28341
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28327
28342
|
if (geminiClient) {
|
|
28328
28343
|
try {
|
|
28329
28344
|
await geminiClient.addHistory({
|
|
@@ -28346,11 +28361,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28346
28361
|
}
|
|
28347
28362
|
}
|
|
28348
28363
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28349
|
-
if (newApprovalMode ===
|
|
28364
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28350
28365
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28351
28366
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28352
28367
|
);
|
|
28353
|
-
if (newApprovalMode ===
|
|
28368
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28354
28369
|
awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
|
|
28355
28370
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
28356
28371
|
return true;
|
|
@@ -28366,11 +28381,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28366
28381
|
if (call.correlationId) {
|
|
28367
28382
|
try {
|
|
28368
28383
|
await config.getMessageBus().publish({
|
|
28369
|
-
type:
|
|
28384
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28370
28385
|
correlationId: call.correlationId,
|
|
28371
28386
|
confirmed: true,
|
|
28372
28387
|
requiresUserConfirmation: false,
|
|
28373
|
-
outcome:
|
|
28388
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28374
28389
|
});
|
|
28375
28390
|
} catch (error) {
|
|
28376
28391
|
debugLogger.warn(
|
|
@@ -28461,14 +28476,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28461
28476
|
);
|
|
28462
28477
|
if (isLowErrorVerbosity) {
|
|
28463
28478
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28464
|
-
(tc) => tc.status ===
|
|
28479
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28465
28480
|
).length;
|
|
28466
28481
|
}
|
|
28467
28482
|
if (geminiTools.length === 0) {
|
|
28468
28483
|
return;
|
|
28469
28484
|
}
|
|
28470
28485
|
const stopExecutionTool = geminiTools.find(
|
|
28471
|
-
(tc) => tc.response.errorType ===
|
|
28486
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28472
28487
|
);
|
|
28473
28488
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28474
28489
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28488,9 +28503,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28488
28503
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28489
28504
|
);
|
|
28490
28505
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28491
|
-
(tc) => tc.status ===
|
|
28506
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28492
28507
|
);
|
|
28493
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28508
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28494
28509
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28495
28510
|
if (!turnCancelledRef.current) {
|
|
28496
28511
|
addItem({
|
|
@@ -28499,14 +28514,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28499
28514
|
});
|
|
28500
28515
|
}
|
|
28501
28516
|
setIsResponding(false);
|
|
28502
|
-
|
|
28503
|
-
const targetLength = historyLengthAfterUserPromptRef.current;
|
|
28504
|
-
if (geminiClient.getHistory().length > targetLength) {
|
|
28505
|
-
geminiClient.setHistory(
|
|
28506
|
-
geminiClient.getHistory().slice(0, targetLength)
|
|
28507
|
-
);
|
|
28508
|
-
}
|
|
28509
|
-
}
|
|
28517
|
+
geminiClient?.discardTrailingUnansweredToolCallTurn();
|
|
28510
28518
|
const callIdsToMarkAsSubmitted2 = geminiTools.map(
|
|
28511
28519
|
(toolCall) => toolCall.request.callId
|
|
28512
28520
|
);
|
|
@@ -28576,7 +28584,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28576
28584
|
return;
|
|
28577
28585
|
}
|
|
28578
28586
|
const restorableToolCalls = toolCalls.filter(
|
|
28579
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28587
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28580
28588
|
);
|
|
28581
28589
|
if (restorableToolCalls.length > 0) {
|
|
28582
28590
|
if (!gitService) {
|
|
@@ -28799,14 +28807,14 @@ var useAgentStream = ({
|
|
|
28799
28807
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28800
28808
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28801
28809
|
const desc = legacyState?.description ?? "";
|
|
28802
|
-
const fallbackKind =
|
|
28810
|
+
const fallbackKind = Kind.Other;
|
|
28803
28811
|
const newCall = {
|
|
28804
28812
|
callId: event.requestId,
|
|
28805
28813
|
name: displayName,
|
|
28806
28814
|
originalRequestName: event.name,
|
|
28807
28815
|
description: desc,
|
|
28808
28816
|
display: event.display,
|
|
28809
|
-
status:
|
|
28817
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28810
28818
|
isClientInitiated: false,
|
|
28811
28819
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28812
28820
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28824,10 +28832,10 @@ var useAgentStream = ({
|
|
|
28824
28832
|
const evtStatus = legacyState?.status;
|
|
28825
28833
|
let status = tc.status;
|
|
28826
28834
|
if (evtStatus === "executing")
|
|
28827
|
-
status =
|
|
28828
|
-
else if (evtStatus === "error") status =
|
|
28835
|
+
status = CoreToolCallStatus.Executing;
|
|
28836
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28829
28837
|
else if (evtStatus === "success")
|
|
28830
|
-
status =
|
|
28838
|
+
status = CoreToolCallStatus.Success;
|
|
28831
28839
|
const display = event.display?.result;
|
|
28832
28840
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28833
28841
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28860,7 +28868,7 @@ var useAgentStream = ({
|
|
|
28860
28868
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28861
28869
|
return {
|
|
28862
28870
|
...tc,
|
|
28863
|
-
status: event.isError ?
|
|
28871
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28864
28872
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28865
28873
|
resultDisplay,
|
|
28866
28874
|
outputFile
|
|
@@ -28926,7 +28934,7 @@ var useAgentStream = ({
|
|
|
28926
28934
|
if (!options?.isContinuation) {
|
|
28927
28935
|
if (typeof query === "string") {
|
|
28928
28936
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28929
|
-
void logger?.logMessage(
|
|
28937
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28930
28938
|
}
|
|
28931
28939
|
startNewPrompt();
|
|
28932
28940
|
}
|
|
@@ -30457,9 +30465,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30457
30465
|
const handleFolderTrustSelect = (0, import_react103.useCallback)(
|
|
30458
30466
|
async (choice) => {
|
|
30459
30467
|
const trustLevelMap = {
|
|
30460
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30461
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30462
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
30468
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
30469
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
30470
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
30463
30471
|
};
|
|
30464
30472
|
const trustLevel = trustLevelMap[choice];
|
|
30465
30473
|
if (!trustLevel) return;
|
|
@@ -30478,7 +30486,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30478
30486
|
}, 100);
|
|
30479
30487
|
return;
|
|
30480
30488
|
}
|
|
30481
|
-
const currentIsTrusted = trustLevel ===
|
|
30489
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30482
30490
|
onTrustChangeRef.current(currentIsTrusted);
|
|
30483
30491
|
setIsTrusted(currentIsTrusted);
|
|
30484
30492
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -31486,7 +31494,7 @@ function useMessageQueue({
|
|
|
31486
31494
|
var import_react105 = __toESM(require_react(), 1);
|
|
31487
31495
|
function useMcpStatus(config) {
|
|
31488
31496
|
const [discoveryState, setDiscoveryState] = (0, import_react105.useState)(
|
|
31489
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31497
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31490
31498
|
);
|
|
31491
31499
|
const [mcpServerCount, setMcpServerCount] = (0, import_react105.useState)(
|
|
31492
31500
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31499,12 +31507,12 @@ function useMcpStatus(config) {
|
|
|
31499
31507
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31500
31508
|
}
|
|
31501
31509
|
};
|
|
31502
|
-
coreEvents.on(
|
|
31510
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31503
31511
|
return () => {
|
|
31504
|
-
coreEvents.off(
|
|
31512
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31505
31513
|
};
|
|
31506
31514
|
}, [config]);
|
|
31507
|
-
const isMcpReady = discoveryState ===
|
|
31515
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31508
31516
|
return {
|
|
31509
31517
|
discoveryState,
|
|
31510
31518
|
mcpServerCount,
|
|
@@ -31531,7 +31539,7 @@ function useApprovalModeIndicator({
|
|
|
31531
31539
|
(key) => {
|
|
31532
31540
|
let nextApprovalMode;
|
|
31533
31541
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31534
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31542
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31535
31543
|
if (addItem) {
|
|
31536
31544
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31537
31545
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31549,21 +31557,21 @@ function useApprovalModeIndicator({
|
|
|
31549
31557
|
}
|
|
31550
31558
|
return;
|
|
31551
31559
|
}
|
|
31552
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31560
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31553
31561
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31554
31562
|
const currentMode = config.getApprovalMode();
|
|
31555
31563
|
switch (currentMode) {
|
|
31556
|
-
case
|
|
31557
|
-
nextApprovalMode =
|
|
31564
|
+
case ApprovalMode.DEFAULT:
|
|
31565
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31558
31566
|
break;
|
|
31559
|
-
case
|
|
31560
|
-
nextApprovalMode = allowPlanMode ?
|
|
31567
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31568
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31561
31569
|
break;
|
|
31562
|
-
case
|
|
31563
|
-
nextApprovalMode =
|
|
31570
|
+
case ApprovalMode.PLAN:
|
|
31571
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31564
31572
|
break;
|
|
31565
|
-
case
|
|
31566
|
-
nextApprovalMode =
|
|
31573
|
+
case ApprovalMode.YOLO:
|
|
31574
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31567
31575
|
break;
|
|
31568
31576
|
default:
|
|
31569
31577
|
}
|
|
@@ -31973,11 +31981,11 @@ var useHookDisplayState = () => {
|
|
|
31973
31981
|
removeHook();
|
|
31974
31982
|
}
|
|
31975
31983
|
};
|
|
31976
|
-
coreEvents.on(
|
|
31977
|
-
coreEvents.on(
|
|
31984
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
31985
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31978
31986
|
return () => {
|
|
31979
|
-
coreEvents.off(
|
|
31980
|
-
coreEvents.off(
|
|
31987
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
31988
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31981
31989
|
activeTimeouts.forEach(clearTimeout);
|
|
31982
31990
|
activeTimeouts.clear();
|
|
31983
31991
|
};
|
|
@@ -32816,7 +32824,7 @@ var AppContainer = (props) => {
|
|
|
32816
32824
|
setConfigInitialized(true);
|
|
32817
32825
|
startupProfiler.flush(config);
|
|
32818
32826
|
startAutoMemoryIfEnabled(config);
|
|
32819
|
-
const sessionStartSource = resumedSessionData ?
|
|
32827
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32820
32828
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32821
32829
|
if (result) {
|
|
32822
32830
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32843,7 +32851,7 @@ var AppContainer = (props) => {
|
|
|
32843
32851
|
);
|
|
32844
32852
|
const ideClient = await IdeClient.getInstance();
|
|
32845
32853
|
await ideClient.disconnect();
|
|
32846
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32854
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32847
32855
|
};
|
|
32848
32856
|
registerCleanup(cleanupFn);
|
|
32849
32857
|
return () => {
|
|
@@ -32868,11 +32876,11 @@ var AppContainer = (props) => {
|
|
|
32868
32876
|
resetTime: payload.resetTime
|
|
32869
32877
|
});
|
|
32870
32878
|
};
|
|
32871
|
-
coreEvents.on(
|
|
32872
|
-
coreEvents.on(
|
|
32879
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32880
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32873
32881
|
return () => {
|
|
32874
|
-
coreEvents.off(
|
|
32875
|
-
coreEvents.off(
|
|
32882
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32883
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32876
32884
|
};
|
|
32877
32885
|
}, [config]);
|
|
32878
32886
|
(0, import_react119.useEffect)(() => {
|
|
@@ -32885,16 +32893,16 @@ var AppContainer = (props) => {
|
|
|
32885
32893
|
const handleAgentsDiscovered = (payload) => {
|
|
32886
32894
|
setNewAgents(payload.agents);
|
|
32887
32895
|
};
|
|
32888
|
-
coreEvents.on(
|
|
32889
|
-
coreEvents.on(
|
|
32890
|
-
coreEvents.on(
|
|
32896
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32897
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32898
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32891
32899
|
return () => {
|
|
32892
|
-
coreEvents.off(
|
|
32900
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32893
32901
|
coreEvents.off(
|
|
32894
|
-
|
|
32902
|
+
CoreEvent.AdminSettingsChanged,
|
|
32895
32903
|
handleAdminSettingsChanged
|
|
32896
32904
|
);
|
|
32897
|
-
coreEvents.off(
|
|
32905
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32898
32906
|
};
|
|
32899
32907
|
}, [settings]);
|
|
32900
32908
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32961,11 +32969,11 @@ var AppContainer = (props) => {
|
|
|
32961
32969
|
exitEditorDialog
|
|
32962
32970
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32963
32971
|
(0, import_react119.useEffect)(() => {
|
|
32964
|
-
coreEvents.on(
|
|
32965
|
-
coreEvents.on(
|
|
32972
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32973
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32966
32974
|
return () => {
|
|
32967
|
-
coreEvents.off(
|
|
32968
|
-
coreEvents.off(
|
|
32975
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32976
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32969
32977
|
};
|
|
32970
32978
|
}, [handleEditorClose, openEditorDialog]);
|
|
32971
32979
|
(0, import_react119.useEffect)(() => {
|
|
@@ -33033,7 +33041,7 @@ var AppContainer = (props) => {
|
|
|
33033
33041
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
33034
33042
|
});
|
|
33035
33043
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
33036
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
33044
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
33037
33045
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
33038
33046
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
33039
33047
|
config,
|
|
@@ -33061,7 +33069,7 @@ var AppContainer = (props) => {
|
|
|
33061
33069
|
async (authType, scope) => {
|
|
33062
33070
|
if (authType) {
|
|
33063
33071
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
33064
|
-
if (authType ===
|
|
33072
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
33065
33073
|
setAuthContext({ requiresRestart: true });
|
|
33066
33074
|
} else {
|
|
33067
33075
|
setAuthContext({});
|
|
@@ -33089,7 +33097,7 @@ var AppContainer = (props) => {
|
|
|
33089
33097
|
);
|
|
33090
33098
|
return;
|
|
33091
33099
|
}
|
|
33092
|
-
if (authType ===
|
|
33100
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
33093
33101
|
writeToStdout(`
|
|
33094
33102
|
----------------------------------------------------------------
|
|
33095
33103
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -33112,7 +33120,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33112
33120
|
}
|
|
33113
33121
|
await saveApiKey(apiKey);
|
|
33114
33122
|
await reloadApiKey();
|
|
33115
|
-
await config.refreshAuth(
|
|
33123
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
33116
33124
|
setAuthState("authenticated" /* Authenticated */);
|
|
33117
33125
|
} catch (e) {
|
|
33118
33126
|
onAuthError(
|
|
@@ -33137,7 +33145,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33137
33145
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
33138
33146
|
);
|
|
33139
33147
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
33140
|
-
if (settings.merged.security.auth.selectedType ===
|
|
33148
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
33141
33149
|
return;
|
|
33142
33150
|
}
|
|
33143
33151
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -33273,9 +33281,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33273
33281
|
}
|
|
33274
33282
|
});
|
|
33275
33283
|
};
|
|
33276
|
-
coreEvents.on(
|
|
33284
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33277
33285
|
return () => {
|
|
33278
|
-
coreEvents.off(
|
|
33286
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33279
33287
|
};
|
|
33280
33288
|
}, []);
|
|
33281
33289
|
const performMemoryRefresh = (0, import_react119.useCallback)(async () => {
|
|
@@ -33845,7 +33853,7 @@ ${queuedText}` : queuedText;
|
|
|
33845
33853
|
[handleSlashCommand, settings]
|
|
33846
33854
|
);
|
|
33847
33855
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
33848
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
33856
|
+
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;
|
|
33849
33857
|
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;
|
|
33850
33858
|
const handleGlobalKeypress = (0, import_react119.useCallback)(
|
|
33851
33859
|
(key) => {
|
|
@@ -33935,7 +33943,7 @@ ${queuedText}` : queuedText;
|
|
|
33935
33943
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33936
33944
|
if (settings.merged.general.devtools) {
|
|
33937
33945
|
void (async () => {
|
|
33938
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33946
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-ZHFOHPIS.js");
|
|
33939
33947
|
await toggleDevToolsPanel(
|
|
33940
33948
|
config,
|
|
33941
33949
|
showErrorDetails,
|
|
@@ -34154,12 +34162,12 @@ ${queuedText}` : queuedText;
|
|
|
34154
34162
|
Date.now()
|
|
34155
34163
|
);
|
|
34156
34164
|
};
|
|
34157
|
-
coreEvents.on(
|
|
34158
|
-
coreEvents.on(
|
|
34165
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34166
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34159
34167
|
coreEvents.drainBacklogs();
|
|
34160
34168
|
return () => {
|
|
34161
|
-
coreEvents.off(
|
|
34162
|
-
coreEvents.off(
|
|
34169
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34170
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34163
34171
|
};
|
|
34164
34172
|
}, [historyManager]);
|
|
34165
34173
|
const nightly = props.version.includes("nightly");
|
|
@@ -34267,9 +34275,9 @@ ${queuedText}` : queuedText;
|
|
|
34267
34275
|
const handleMemoryChanged = (result) => {
|
|
34268
34276
|
setGeminiMdFileCount(result.fileCount);
|
|
34269
34277
|
};
|
|
34270
|
-
coreEvents.on(
|
|
34278
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34271
34279
|
return () => {
|
|
34272
|
-
coreEvents.off(
|
|
34280
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34273
34281
|
};
|
|
34274
34282
|
}, []);
|
|
34275
34283
|
(0, import_react119.useEffect)(() => {
|