@google/gemini-cli 0.54.0 → 0.54.4
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-G7VQ6O6G.js → chunk-4YSWDUQZ.js} +1 -1
- package/bundle/{chunk-IM5WJKYT.js → chunk-5NT754WV.js} +1 -1
- package/bundle/{chunk-GOQJOV4P.js → chunk-6SBXH4D5.js} +1 -1
- package/bundle/{chunk-UTXCUPDT.js → chunk-7ELLCO6U.js} +2 -2
- package/bundle/{chunk-MOGTJC2T.js → chunk-7SPI3KN6.js} +1 -1
- package/bundle/{chunk-BBNFLOXC.js → chunk-B5CTWZND.js} +1 -1
- package/bundle/{chunk-UW4NSSB6.js → chunk-BCKLMRS4.js} +3 -3
- package/bundle/{chunk-F6IU45OZ.js → chunk-BS6BSLZD.js} +98 -8
- package/bundle/{chunk-VIQEWLM4.js → chunk-D7ZXPN6G.js} +8 -5
- package/bundle/{chunk-WJKZRJIC.js → chunk-DFZESNXJ.js} +3 -3
- package/bundle/chunk-DJWQKPM3.js +1571 -0
- package/bundle/{chunk-NZ6P6XKP.js → chunk-FNQ3CHG6.js} +2 -2
- package/bundle/{chunk-OYZ2XVON.js → chunk-GHCTXZXJ.js} +3 -3
- package/bundle/{chunk-43HYOV6F.js → chunk-HX3M7TQG.js} +1 -1
- package/bundle/{chunk-5SMD2SLQ.js → chunk-IJK6RPHE.js} +2 -2
- package/bundle/{chunk-MZBH35ZS.js → chunk-IX4IHGFA.js} +1 -1
- package/bundle/{chunk-SQWRALPF.js → chunk-K6DV6ZQJ.js} +9 -8
- package/bundle/chunk-K77W7OAI.js +398 -0
- package/bundle/{chunk-SHZORH3T.js → chunk-NWWVQCEM.js} +1 -1
- package/bundle/{chunk-JPCDQXHB.js → chunk-PGCIAGXU.js} +1 -1
- package/bundle/{chunk-HS7THREL.js → chunk-QXLHAGLO.js} +104 -8
- package/bundle/{chunk-2MRUXBJ5.js → chunk-RJSQB7MD.js} +7 -7
- package/bundle/{chunk-RHINAWEP.js → chunk-TOGB2OXA.js} +67 -54
- package/bundle/chunk-TXL73KVK.js +17332 -0
- package/bundle/{chunk-YYWWE5GW.js → chunk-TYAF55F7.js} +7720 -14267
- package/bundle/chunk-UWHDOUIM.js +154 -0
- package/bundle/{chunk-TZAOURRV.js → chunk-WFY6AHA3.js} +1 -1
- package/bundle/chunk-YFMY6TMN.js +118 -0
- package/bundle/chunk-YMKYUNCI.js +397175 -0
- package/bundle/chunk-YOVSXRBK.js +512 -0
- package/bundle/{chunk-LH73BY77.js → chunk-ZJ6RWJBB.js} +7 -7
- package/bundle/chunk-ZT7DTH6P.js +102505 -0
- package/bundle/{cleanup-5UYKVLIF.js → cleanup-ID7KOVH6.js} +2 -2
- package/bundle/{cleanup-6OO5MA6W.js → cleanup-IQDM3OQH.js} +2 -2
- package/bundle/{cleanup-ODOGWYRM.js → cleanup-VC5QYANG.js} +2 -2
- package/bundle/cleanup-XKLXHTQY.js +32 -0
- package/bundle/{core-S5B3NEKC.js → core-L2IMO77B.js} +3 -1
- package/bundle/{devtoolsService-FUTPYP6V.js → devtoolsService-A4MVL3QX.js} +2 -2
- package/bundle/{devtoolsService-YWNTGRUE.js → devtoolsService-FCZAZ7OL.js} +2 -2
- package/bundle/{devtoolsService-NZQZUVCI.js → devtoolsService-MTKVT52L.js} +4 -3
- package/bundle/devtoolsService-OFTYP7HA.js +4359 -0
- package/bundle/{dist-DB6LWOKZ.js → dist-IRKAN2JJ.js} +3 -1
- package/bundle/{core-JL633Z4N.js → dist-OMDZCEPS.js} +3 -1
- package/bundle/dist-UPFVI32N.js +2172 -0
- package/bundle/{gemini-D3BRVDVJ.js → gemini-A2H7FXLW.js} +14 -14
- package/bundle/{gemini-AQASGK5V.js → gemini-ANKKRIYC.js} +214 -198
- package/bundle/{gemini-PPNY5YY6.js → gemini-RXM642S5.js} +14 -14
- package/bundle/gemini-TQ4IKPW2.js +16491 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-P7QQLIDS.js → interactiveCli-DCR23VNH.js} +21 -15
- package/bundle/{interactiveCli-CXCZMXKQ.js → interactiveCli-LU4ELYJR.js} +21 -15
- package/bundle/{interactiveCli-RU7LCVXL.js → interactiveCli-MMQJKAMI.js} +328 -303
- package/bundle/interactiveCli-XFHD4NND.js +34912 -0
- package/bundle/{liteRtServerManager-ISKYY742.js → liteRtServerManager-3XISBZSR.js} +4 -4
- package/bundle/{liteRtServerManager-MPPOFOTR.js → liteRtServerManager-AW53PI2D.js} +4 -4
- package/bundle/{liteRtServerManager-FIVLVXQJ.js → liteRtServerManager-D6QKXOSW.js} +4 -4
- package/bundle/liteRtServerManager-PKONORB7.js +65 -0
- package/bundle/{oauth2-provider-G6DF4NEU.js → oauth2-provider-7KVPKQ4C.js} +1 -1
- package/bundle/{oauth2-provider-DOIL6PEC.js → oauth2-provider-CU4P6HIT.js} +38 -72
- package/bundle/{oauth2-provider-XR5UQYQV.js → oauth2-provider-MRWRX5R2.js} +1 -1
- package/bundle/oauth2-provider-NQD4RC5Z.js +235 -0
- package/bundle/{start-S77W5RNK.js → start-7U2NBBF2.js} +6 -6
- package/bundle/{start-YWT3TSZW.js → start-HBTVIGJK.js} +6 -6
- package/bundle/{start-AJW7OVPU.js → start-JQFBJ44Q.js} +6 -6
- package/bundle/start-KLUMUSR7.js +18 -0
- package/package.json +1 -1
|
@@ -157,10 +157,10 @@ import {
|
|
|
157
157
|
widestLineFromStyledChars,
|
|
158
158
|
wordBreakStyledChars,
|
|
159
159
|
wrapStyledChars
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-TOGB2OXA.js";
|
|
161
161
|
import {
|
|
162
162
|
require_source
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-B5CTWZND.js";
|
|
164
164
|
import {
|
|
165
165
|
appEvents
|
|
166
166
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -214,33 +214,37 @@ import {
|
|
|
214
214
|
stripAnsi,
|
|
215
215
|
stripUnsafeCharacters,
|
|
216
216
|
toCodePoints
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-TXL73KVK.js";
|
|
218
218
|
import {
|
|
219
219
|
handleAutoUpdate,
|
|
220
220
|
isDevelopment,
|
|
221
221
|
relaunchApp,
|
|
222
222
|
setUpdateHandler
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-K77W7OAI.js";
|
|
224
224
|
import {
|
|
225
225
|
isTodoList,
|
|
226
226
|
mapCoreStatusToDisplayStatus,
|
|
227
227
|
require_react
|
|
228
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-IX4IHGFA.js";
|
|
229
229
|
import {
|
|
230
230
|
registerCleanup,
|
|
231
231
|
removeCleanup,
|
|
232
232
|
runExitCleanup,
|
|
233
233
|
setupTtyCheck
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-HX3M7TQG.js";
|
|
235
235
|
import {
|
|
236
236
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
237
237
|
AGENT_TOOL_NAME,
|
|
238
238
|
ApiKeyUpdatedEvent,
|
|
239
|
+
ApprovalMode,
|
|
239
240
|
AsyncFzf,
|
|
240
241
|
AudioRecorder,
|
|
241
242
|
AuthType,
|
|
242
243
|
ChangeAuthRequestedError,
|
|
244
|
+
CompressionStatus,
|
|
243
245
|
ConversationFinishedEvent,
|
|
246
|
+
CoreEvent,
|
|
247
|
+
CoreToolCallStatus,
|
|
244
248
|
CreditPurchaseClickEvent,
|
|
245
249
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
246
250
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
@@ -262,13 +266,20 @@ import {
|
|
|
262
266
|
GEMMA_4_31B_IT_MODEL,
|
|
263
267
|
GLOB_DISPLAY_NAME,
|
|
264
268
|
GREP_DISPLAY_NAME,
|
|
269
|
+
GeminiCliOperation,
|
|
270
|
+
GeminiEventType,
|
|
265
271
|
GitService,
|
|
266
272
|
IdeClient,
|
|
273
|
+
Kind,
|
|
267
274
|
LS_DISPLAY_NAME,
|
|
268
275
|
LegacyAgentProtocol,
|
|
269
276
|
LlmRole,
|
|
270
277
|
Logger,
|
|
271
278
|
MAX_TOKENS_EXCEEDED_SUGGESTION,
|
|
279
|
+
MCPDiscoveryState,
|
|
280
|
+
MCPServerStatus,
|
|
281
|
+
MessageBusType,
|
|
282
|
+
MessageSenderType,
|
|
272
283
|
ModelNotFoundError,
|
|
273
284
|
ModelSlashCommandEvent,
|
|
274
285
|
OTHER_BLOCKED_MESSAGE,
|
|
@@ -281,6 +292,7 @@ import {
|
|
|
281
292
|
PREVIEW_GEMINI_MODEL,
|
|
282
293
|
PolicyIntegrityManager,
|
|
283
294
|
ProjectIdRequiredError,
|
|
295
|
+
QuestionType,
|
|
284
296
|
READ_FILE_DISPLAY_NAME,
|
|
285
297
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
286
298
|
RECITATION_BLOCKED_MESSAGE,
|
|
@@ -289,16 +301,22 @@ import {
|
|
|
289
301
|
SAFETY_BLOCKED_MESSAGE,
|
|
290
302
|
SHELL_TOOL_NAME,
|
|
291
303
|
Scheduler,
|
|
304
|
+
SessionEndReason,
|
|
305
|
+
SessionStartSource,
|
|
292
306
|
ShellExecutionService,
|
|
293
307
|
SlashCommandStatus,
|
|
294
308
|
Storage,
|
|
309
|
+
SubagentState,
|
|
295
310
|
THINKING_ONLY_COMPRESS_SUGGESTION,
|
|
296
311
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
297
312
|
TOPIC_PARAM_SUMMARY,
|
|
298
313
|
TOPIC_PARAM_TITLE,
|
|
299
314
|
TRUE_EMPTY_RESPONSE_MESSAGE,
|
|
300
315
|
TerminalQuotaError,
|
|
316
|
+
ToolConfirmationOutcome,
|
|
317
|
+
ToolErrorType,
|
|
301
318
|
TranscriptionFactory,
|
|
319
|
+
TrustLevel,
|
|
302
320
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
303
321
|
UPDATE_TOPIC_TOOL_NAME,
|
|
304
322
|
UnauthorizedError,
|
|
@@ -310,6 +328,7 @@ import {
|
|
|
310
328
|
WEB_FETCH_DISPLAY_NAME,
|
|
311
329
|
WEB_SEARCH_DISPLAY_NAME,
|
|
312
330
|
WRITE_FILE_DISPLAY_NAME,
|
|
331
|
+
WarningPriority,
|
|
313
332
|
WhisperModelManager,
|
|
314
333
|
addMCPStatusChangeListener,
|
|
315
334
|
allowEditorTypeInSandbox,
|
|
@@ -418,7 +437,7 @@ import {
|
|
|
418
437
|
validatePlanContent,
|
|
419
438
|
validatePlanPath,
|
|
420
439
|
writeToStdout
|
|
421
|
-
} from "./chunk-
|
|
440
|
+
} from "./chunk-YMKYUNCI.js";
|
|
422
441
|
import "./chunk-664ZODQF.js";
|
|
423
442
|
import "./chunk-IUUIT4SU.js";
|
|
424
443
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -5044,7 +5063,7 @@ function calculateShellMaxLines(options) {
|
|
|
5044
5063
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
5045
5064
|
return maxLinesBasedOnHeight;
|
|
5046
5065
|
}
|
|
5047
|
-
const isExecuting = status ===
|
|
5066
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
5048
5067
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
5049
5068
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
5050
5069
|
}
|
|
@@ -5078,10 +5097,10 @@ function isShellTool(name) {
|
|
|
5078
5097
|
return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
|
|
5079
5098
|
}
|
|
5080
5099
|
function isThisShellFocusable(name, status, config) {
|
|
5081
|
-
return !!(isShellTool(name) && status ===
|
|
5100
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
|
|
5082
5101
|
}
|
|
5083
5102
|
function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
|
|
5084
|
-
return !!(isShellTool(name) && status ===
|
|
5103
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
|
|
5085
5104
|
}
|
|
5086
5105
|
function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
|
|
5087
5106
|
const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
|
|
@@ -5241,13 +5260,13 @@ var formatToolArgs = (args) => {
|
|
|
5241
5260
|
var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
|
|
5242
5261
|
let headerText;
|
|
5243
5262
|
let headerColor = theme.text.secondary;
|
|
5244
|
-
if (progress.state ===
|
|
5263
|
+
if (progress.state === SubagentState.CANCELLED) {
|
|
5245
5264
|
headerText = `Subagent ${progress.agentName} was cancelled.`;
|
|
5246
5265
|
headerColor = theme.status.warning;
|
|
5247
|
-
} else if (progress.state ===
|
|
5266
|
+
} else if (progress.state === SubagentState.ERROR) {
|
|
5248
5267
|
headerText = `Subagent ${progress.agentName} failed.`;
|
|
5249
5268
|
headerColor = theme.status.error;
|
|
5250
|
-
} else if (progress.state ===
|
|
5269
|
+
} else if (progress.state === SubagentState.COMPLETED) {
|
|
5251
5270
|
headerText = `Subagent ${progress.agentName} completed.`;
|
|
5252
5271
|
headerColor = theme.status.success;
|
|
5253
5272
|
} else {
|
|
@@ -5267,7 +5286,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5267
5286
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
|
|
5268
5287
|
] }, item.id);
|
|
5269
5288
|
} else if (item.type === "tool_call") {
|
|
5270
|
-
const statusSymbol = item.status ===
|
|
5289
|
+
const statusSymbol = item.status === SubagentState.RUNNING ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(build_default, { type: "dots" }) : item.status === SubagentState.COMPLETED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.SUCCESS }) : item.status === SubagentState.CANCELLED ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.warning, bold: true, children: TOOL_STATUS.CANCELED }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: theme.status.error, children: TOOL_STATUS.ERROR });
|
|
5271
5290
|
const formattedArgs = item.description || formatToolArgs(item.args);
|
|
5272
5291
|
const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
|
|
5273
5292
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
@@ -5278,7 +5297,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5278
5297
|
{
|
|
5279
5298
|
bold: true,
|
|
5280
5299
|
color: theme.text.primary,
|
|
5281
|
-
strikethrough: item.status ===
|
|
5300
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5282
5301
|
children: item.displayName || item.content
|
|
5283
5302
|
}
|
|
5284
5303
|
),
|
|
@@ -5287,7 +5306,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5287
5306
|
{
|
|
5288
5307
|
color: theme.text.secondary,
|
|
5289
5308
|
wrap: "truncate",
|
|
5290
|
-
strikethrough: item.status ===
|
|
5309
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5291
5310
|
children: displayArgs
|
|
5292
5311
|
}
|
|
5293
5312
|
) })
|
|
@@ -5307,7 +5326,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5307
5326
|
MarkdownDisplay,
|
|
5308
5327
|
{
|
|
5309
5328
|
text: safeJsonToMarkdown(progress.result),
|
|
5310
|
-
isPending: progress.state !==
|
|
5329
|
+
isPending: progress.state !== SubagentState.COMPLETED,
|
|
5311
5330
|
terminalWidth
|
|
5312
5331
|
}
|
|
5313
5332
|
)
|
|
@@ -5661,14 +5680,14 @@ var ToolActionsProvider = (props) => {
|
|
|
5661
5680
|
}
|
|
5662
5681
|
const details = tool.confirmationDetails;
|
|
5663
5682
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
5664
|
-
const cliOutcome = outcome ===
|
|
5683
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
5665
5684
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
5666
5685
|
}
|
|
5667
5686
|
if (tool.correlationId) {
|
|
5668
5687
|
await config.getMessageBus().publish({
|
|
5669
|
-
type:
|
|
5688
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
5670
5689
|
correlationId: tool.correlationId,
|
|
5671
|
-
confirmed: outcome !==
|
|
5690
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
5672
5691
|
requiresUserConfirmation: false,
|
|
5673
5692
|
outcome,
|
|
5674
5693
|
payload
|
|
@@ -5687,7 +5706,7 @@ var ToolActionsProvider = (props) => {
|
|
|
5687
5706
|
);
|
|
5688
5707
|
const cancel = (0, import_react12.useCallback)(
|
|
5689
5708
|
async (callId) => {
|
|
5690
|
-
await confirm(callId,
|
|
5709
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
5691
5710
|
},
|
|
5692
5711
|
[confirm]
|
|
5693
5712
|
);
|
|
@@ -5806,7 +5825,7 @@ var ToolMessage = ({
|
|
|
5806
5825
|
paddingX: 1,
|
|
5807
5826
|
flexDirection: "column",
|
|
5808
5827
|
children: [
|
|
5809
|
-
status ===
|
|
5828
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5810
5829
|
McpProgressIndicator,
|
|
5811
5830
|
{
|
|
5812
5831
|
progress,
|
|
@@ -5823,8 +5842,8 @@ var ToolMessage = ({
|
|
|
5823
5842
|
terminalWidth,
|
|
5824
5843
|
renderOutputAsMarkdown,
|
|
5825
5844
|
hasFocus: isThisShellFocused2,
|
|
5826
|
-
maxLines: kind ===
|
|
5827
|
-
overflowDirection: kind ===
|
|
5845
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
5846
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
5828
5847
|
}
|
|
5829
5848
|
),
|
|
5830
5849
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -6140,7 +6159,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
|
|
|
6140
6159
|
settings.merged,
|
|
6141
6160
|
process3.cwd()
|
|
6142
6161
|
);
|
|
6143
|
-
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel ===
|
|
6162
|
+
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
|
|
6144
6163
|
return {
|
|
6145
6164
|
currentTrustLevel: explicitTrustLevel,
|
|
6146
6165
|
isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
|
|
@@ -6185,7 +6204,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
|
|
|
6185
6204
|
process3.cwd(),
|
|
6186
6205
|
newConfig
|
|
6187
6206
|
);
|
|
6188
|
-
if (trustLevel ===
|
|
6207
|
+
if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
|
|
6189
6208
|
let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
|
|
6190
6209
|
if (source === "file") {
|
|
6191
6210
|
message = "Note: This folder is still trusted because a parent folder is trusted.";
|
|
@@ -6259,18 +6278,18 @@ function PermissionsModifyTrustDialog({
|
|
|
6259
6278
|
const TRUST_LEVEL_ITEMS = [
|
|
6260
6279
|
{
|
|
6261
6280
|
label: `Trust this folder (${dirName})`,
|
|
6262
|
-
value:
|
|
6263
|
-
key:
|
|
6281
|
+
value: TrustLevel.TRUST_FOLDER,
|
|
6282
|
+
key: TrustLevel.TRUST_FOLDER
|
|
6264
6283
|
},
|
|
6265
6284
|
{
|
|
6266
6285
|
label: `Trust parent folder (${parentFolder})`,
|
|
6267
|
-
value:
|
|
6268
|
-
key:
|
|
6286
|
+
value: TrustLevel.TRUST_PARENT,
|
|
6287
|
+
key: TrustLevel.TRUST_PARENT
|
|
6269
6288
|
},
|
|
6270
6289
|
{
|
|
6271
6290
|
label: "Don't trust",
|
|
6272
|
-
value:
|
|
6273
|
-
key:
|
|
6291
|
+
value: TrustLevel.DO_NOT_TRUST,
|
|
6292
|
+
key: TrustLevel.DO_NOT_TRUST
|
|
6274
6293
|
}
|
|
6275
6294
|
];
|
|
6276
6295
|
const {
|
|
@@ -6510,7 +6529,7 @@ var ShellToolMessage = ({
|
|
|
6510
6529
|
maxLinesLimit: maxLines
|
|
6511
6530
|
});
|
|
6512
6531
|
import_react17.default.useEffect(() => {
|
|
6513
|
-
const isExecuting = status ===
|
|
6532
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
6514
6533
|
if (isExecuting && ptyId) {
|
|
6515
6534
|
try {
|
|
6516
6535
|
const childWidth = terminalWidth - 4;
|
|
@@ -6723,13 +6742,13 @@ var SubagentGroupDisplay = ({
|
|
|
6723
6742
|
const singleAgent = toolCalls[0].resultDisplay;
|
|
6724
6743
|
if (isSubagentProgress(singleAgent)) {
|
|
6725
6744
|
switch (singleAgent.state) {
|
|
6726
|
-
case
|
|
6745
|
+
case SubagentState.COMPLETED:
|
|
6727
6746
|
headerText = "Agent Completed";
|
|
6728
6747
|
break;
|
|
6729
|
-
case
|
|
6748
|
+
case SubagentState.CANCELLED:
|
|
6730
6749
|
headerText = "Agent Cancelled";
|
|
6731
6750
|
break;
|
|
6732
|
-
case
|
|
6751
|
+
case SubagentState.ERROR:
|
|
6733
6752
|
headerText = "Agent Error";
|
|
6734
6753
|
break;
|
|
6735
6754
|
default:
|
|
@@ -6745,8 +6764,8 @@ var SubagentGroupDisplay = ({
|
|
|
6745
6764
|
for (const tc of toolCalls) {
|
|
6746
6765
|
const progress = tc.resultDisplay;
|
|
6747
6766
|
if (isSubagentProgress(progress)) {
|
|
6748
|
-
if (progress.state ===
|
|
6749
|
-
else if (progress.state ===
|
|
6767
|
+
if (progress.state === SubagentState.COMPLETED) completedCount++;
|
|
6768
|
+
else if (progress.state === SubagentState.RUNNING) runningCount++;
|
|
6750
6769
|
} else {
|
|
6751
6770
|
runningCount++;
|
|
6752
6771
|
}
|
|
@@ -6825,7 +6844,7 @@ var SubagentGroupDisplay = ({
|
|
|
6825
6844
|
if (!isExpanded) {
|
|
6826
6845
|
let content = "Starting...";
|
|
6827
6846
|
let formattedArgs;
|
|
6828
|
-
if (progress.state ===
|
|
6847
|
+
if (progress.state === SubagentState.COMPLETED) {
|
|
6829
6848
|
if (progress.terminateReason && progress.terminateReason !== "GOAL") {
|
|
6830
6849
|
content = `Finished Early (${progress.terminateReason})`;
|
|
6831
6850
|
} else {
|
|
@@ -6839,17 +6858,17 @@ var SubagentGroupDisplay = ({
|
|
|
6839
6858
|
formattedArgs = formatToolArgs(lastActivity.args);
|
|
6840
6859
|
}
|
|
6841
6860
|
}
|
|
6842
|
-
const displayArgs = progress.state ===
|
|
6861
|
+
const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
|
|
6843
6862
|
const renderStatusIcon = () => {
|
|
6844
|
-
const state = progress.state ??
|
|
6863
|
+
const state = progress.state ?? SubagentState.RUNNING;
|
|
6845
6864
|
switch (state) {
|
|
6846
|
-
case
|
|
6865
|
+
case SubagentState.RUNNING:
|
|
6847
6866
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
|
|
6848
|
-
case
|
|
6867
|
+
case SubagentState.COMPLETED:
|
|
6849
6868
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
|
|
6850
|
-
case
|
|
6869
|
+
case SubagentState.CANCELLED:
|
|
6851
6870
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
|
|
6852
|
-
case
|
|
6871
|
+
case SubagentState.ERROR:
|
|
6853
6872
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
|
|
6854
6873
|
default:
|
|
6855
6874
|
return checkExhaustive(state);
|
|
@@ -6902,22 +6921,22 @@ var hasPayload = (res) => {
|
|
|
6902
6921
|
function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
6903
6922
|
const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
|
|
6904
6923
|
const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
|
|
6905
|
-
const isAcceptedOrConfirming = status ===
|
|
6924
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
6906
6925
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
6907
6926
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
6908
6927
|
const showDiffStat = !!diff.diffStat;
|
|
6909
6928
|
const description = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
|
|
6910
6929
|
let resultSummary = "";
|
|
6911
6930
|
let resultColor = theme.text.secondary;
|
|
6912
|
-
if (status ===
|
|
6931
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
6913
6932
|
resultSummary = "Confirming";
|
|
6914
|
-
} else if (status ===
|
|
6933
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
6915
6934
|
resultSummary = "Accepted";
|
|
6916
6935
|
resultColor = theme.text.accent;
|
|
6917
|
-
} else if (status ===
|
|
6936
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
6918
6937
|
resultSummary = "Rejected";
|
|
6919
6938
|
resultColor = theme.status.error;
|
|
6920
|
-
} else if (status ===
|
|
6939
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
6921
6940
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
6922
6941
|
resultColor = theme.status.error;
|
|
6923
6942
|
}
|
|
@@ -6948,7 +6967,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
|
|
|
6948
6967
|
filename: diff.fileName,
|
|
6949
6968
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
6950
6969
|
availableTerminalHeight,
|
|
6951
|
-
disableColor: status ===
|
|
6970
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6952
6971
|
}
|
|
6953
6972
|
);
|
|
6954
6973
|
return { description, summary, payload };
|
|
@@ -7076,10 +7095,10 @@ var DenseToolMessage = (props) => {
|
|
|
7076
7095
|
if (isGrepResult(resultDisplay)) {
|
|
7077
7096
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7078
7097
|
}
|
|
7079
|
-
if (status ===
|
|
7098
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
7080
7099
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7081
7100
|
}
|
|
7082
|
-
if (status ===
|
|
7101
|
+
if (status === CoreToolCallStatus.Error) {
|
|
7083
7102
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
7084
7103
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
7085
7104
|
"\u2192 ",
|
|
@@ -7120,7 +7139,7 @@ var DenseToolMessage = (props) => {
|
|
|
7120
7139
|
language: fileExtension,
|
|
7121
7140
|
maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7122
7141
|
settings,
|
|
7123
|
-
disableColor: status ===
|
|
7142
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
7124
7143
|
returnLines: true
|
|
7125
7144
|
});
|
|
7126
7145
|
} else {
|
|
@@ -7128,7 +7147,7 @@ var DenseToolMessage = (props) => {
|
|
|
7128
7147
|
parsedLines,
|
|
7129
7148
|
filename: diff.fileName,
|
|
7130
7149
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7131
|
-
disableColor: status ===
|
|
7150
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
7132
7151
|
});
|
|
7133
7152
|
}
|
|
7134
7153
|
}, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
|
|
@@ -7258,7 +7277,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7258
7277
|
return pendingHistoryItems.some((item) => {
|
|
7259
7278
|
if (item && item.type === "tool_group") {
|
|
7260
7279
|
return item.tools.some(
|
|
7261
|
-
(tool) =>
|
|
7280
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
7262
7281
|
);
|
|
7263
7282
|
}
|
|
7264
7283
|
return false;
|
|
@@ -7267,7 +7286,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7267
7286
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
7268
7287
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
7269
7288
|
(item) => item.tools.some(
|
|
7270
|
-
(tool) =>
|
|
7289
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
7271
7290
|
)
|
|
7272
7291
|
);
|
|
7273
7292
|
}
|
|
@@ -7290,14 +7309,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
|
|
|
7290
7309
|
if (isTrackedToolCall(t)) {
|
|
7291
7310
|
return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
|
|
7292
7311
|
} else {
|
|
7293
|
-
return t.status !==
|
|
7312
|
+
return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
|
|
7294
7313
|
}
|
|
7295
7314
|
});
|
|
7296
7315
|
const isEmbeddedShellFocused = toolsToInspect.some((t) => {
|
|
7297
7316
|
if (isTrackedToolCall(t)) {
|
|
7298
7317
|
return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
|
|
7299
7318
|
} else {
|
|
7300
|
-
return isShellTool(t.name) && t.status ===
|
|
7319
|
+
return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
|
|
7301
7320
|
}
|
|
7302
7321
|
});
|
|
7303
7322
|
const isShellCommand = toolsToInspect.some((t) => {
|
|
@@ -7396,7 +7415,7 @@ var ToolGroupMessage = ({
|
|
|
7396
7415
|
const groupedTools = (0, import_react21.useMemo)(() => {
|
|
7397
7416
|
const groups = [];
|
|
7398
7417
|
for (const tool of visibleToolCalls) {
|
|
7399
|
-
if (tool.kind ===
|
|
7418
|
+
if (tool.kind === Kind.Agent) {
|
|
7400
7419
|
const lastGroup = groups[groups.length - 1];
|
|
7401
7420
|
if (Array.isArray(lastGroup)) {
|
|
7402
7421
|
lastGroup.push(tool);
|
|
@@ -7451,7 +7470,7 @@ var ToolGroupMessage = ({
|
|
|
7451
7470
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
7452
7471
|
let countToolCallsWithResults = 0;
|
|
7453
7472
|
for (const tool of visibleToolCalls) {
|
|
7454
|
-
if (tool.kind !==
|
|
7473
|
+
if (tool.kind !== Kind.Agent) {
|
|
7455
7474
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
7456
7475
|
if (hasDensePayload(tool)) {
|
|
7457
7476
|
countToolCallsWithResults++;
|
|
@@ -7625,7 +7644,7 @@ var ToolGroupDisplay = ({
|
|
|
7625
7644
|
}
|
|
7626
7645
|
const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
|
|
7627
7646
|
const visibleTools = tools.filter(
|
|
7628
|
-
(t) => t.status !==
|
|
7647
|
+
(t) => t.status !== CoreToolCallStatus.AwaitingApproval
|
|
7629
7648
|
);
|
|
7630
7649
|
const noticeTools = visibleTools.filter((t) => t.format === "notice");
|
|
7631
7650
|
const otherTools = visibleTools.filter(
|
|
@@ -7827,18 +7846,18 @@ function CompressionMessage({
|
|
|
7827
7846
|
return "Compressing chat history";
|
|
7828
7847
|
}
|
|
7829
7848
|
switch (compressionStatus) {
|
|
7830
|
-
case
|
|
7849
|
+
case CompressionStatus.COMPRESSED:
|
|
7831
7850
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
7832
|
-
case
|
|
7851
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
7833
7852
|
if (originalTokens < 5e4) {
|
|
7834
7853
|
return "Compression was not beneficial for this history size.";
|
|
7835
7854
|
}
|
|
7836
7855
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
7837
|
-
case
|
|
7856
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
7838
7857
|
return "Could not compress chat history due to a token counting error.";
|
|
7839
|
-
case
|
|
7858
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
7840
7859
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
7841
|
-
case
|
|
7860
|
+
case CompressionStatus.NOOP:
|
|
7842
7861
|
return "Nothing to compress.";
|
|
7843
7862
|
default:
|
|
7844
7863
|
return "";
|
|
@@ -8276,8 +8295,8 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8276
8295
|
);
|
|
8277
8296
|
roleEntries.sort(([a], [b]) => {
|
|
8278
8297
|
if (a === b) return 0;
|
|
8279
|
-
if (a ===
|
|
8280
|
-
if (b ===
|
|
8298
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8299
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8281
8300
|
return a.localeCompare(b);
|
|
8282
8301
|
});
|
|
8283
8302
|
roleEntries.forEach(([role, roleMetrics]) => {
|
|
@@ -8608,8 +8627,8 @@ var ModelStatsDisplay = ({
|
|
|
8608
8627
|
return validRoles.includes(role);
|
|
8609
8628
|
}).sort((a, b) => {
|
|
8610
8629
|
if (a === b) return 0;
|
|
8611
|
-
if (a ===
|
|
8612
|
-
if (b ===
|
|
8630
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8631
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8613
8632
|
return a.localeCompare(b);
|
|
8614
8633
|
});
|
|
8615
8634
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -9400,7 +9419,7 @@ var McpStatus = ({
|
|
|
9400
9419
|
);
|
|
9401
9420
|
const originalStatus = serverStatus(serverName);
|
|
9402
9421
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
9403
|
-
const status = originalStatus ===
|
|
9422
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
9404
9423
|
let statusIndicator = "";
|
|
9405
9424
|
let statusText = "";
|
|
9406
9425
|
let statusColor = theme.text.primary;
|
|
@@ -9412,17 +9431,17 @@ var McpStatus = ({
|
|
|
9412
9431
|
statusColor = theme.text.secondary;
|
|
9413
9432
|
} else {
|
|
9414
9433
|
switch (status) {
|
|
9415
|
-
case
|
|
9434
|
+
case MCPServerStatus.CONNECTED:
|
|
9416
9435
|
statusIndicator = "\u{1F7E2}";
|
|
9417
9436
|
statusText = "Ready";
|
|
9418
9437
|
statusColor = theme.status.success;
|
|
9419
9438
|
break;
|
|
9420
|
-
case
|
|
9439
|
+
case MCPServerStatus.CONNECTING:
|
|
9421
9440
|
statusIndicator = "\u{1F504}";
|
|
9422
9441
|
statusText = "Starting... (first startup may take longer)";
|
|
9423
9442
|
statusColor = theme.status.warning;
|
|
9424
9443
|
break;
|
|
9425
|
-
case
|
|
9444
|
+
case MCPServerStatus.DISCONNECTED:
|
|
9426
9445
|
default:
|
|
9427
9446
|
statusIndicator = "\u{1F534}";
|
|
9428
9447
|
statusText = "Disconnected";
|
|
@@ -9470,12 +9489,12 @@ var McpStatus = ({
|
|
|
9470
9489
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9471
9490
|
" - ",
|
|
9472
9491
|
statusText,
|
|
9473
|
-
status ===
|
|
9492
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
9474
9493
|
] }),
|
|
9475
9494
|
authStatusNode
|
|
9476
9495
|
] }),
|
|
9477
|
-
status ===
|
|
9478
|
-
status ===
|
|
9496
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
9497
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9479
9498
|
" (",
|
|
9480
9499
|
toolCount,
|
|
9481
9500
|
" tools cached)"
|
|
@@ -10036,7 +10055,7 @@ var Notifications = () => {
|
|
|
10036
10055
|
if (dismissed) return [];
|
|
10037
10056
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
10038
10057
|
return startupWarnings.filter((w) => {
|
|
10039
|
-
if (w.priority ===
|
|
10058
|
+
if (w.priority === WarningPriority.Low) {
|
|
10040
10059
|
const count = counts[w.id] || 0;
|
|
10041
10060
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
10042
10061
|
}
|
|
@@ -10049,7 +10068,7 @@ var Notifications = () => {
|
|
|
10049
10068
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
10050
10069
|
let changed = false;
|
|
10051
10070
|
visibleWarnings.forEach((w) => {
|
|
10052
|
-
if (w.priority ===
|
|
10071
|
+
if (w.priority === WarningPriority.Low) {
|
|
10053
10072
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
10054
10073
|
changed = true;
|
|
10055
10074
|
}
|
|
@@ -10156,7 +10175,7 @@ var UserIdentity = ({ config }) => {
|
|
|
10156
10175
|
}
|
|
10157
10176
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
10158
10177
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
|
|
10159
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
10178
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { children: [
|
|
10160
10179
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
|
|
10161
10180
|
"Signed in with Google",
|
|
10162
10181
|
email ? ":" : ""
|
|
@@ -10399,7 +10418,7 @@ var import_react32 = __toESM(require_react(), 1);
|
|
|
10399
10418
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
10400
10419
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
10401
10420
|
const confirmingTools = allPendingTools.filter(
|
|
10402
|
-
(tool) => tool.status ===
|
|
10421
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
10403
10422
|
);
|
|
10404
10423
|
if (confirmingTools.length === 0) {
|
|
10405
10424
|
return null;
|
|
@@ -11707,7 +11726,7 @@ var ExitPlanModeDialog = ({
|
|
|
11707
11726
|
{
|
|
11708
11727
|
questions: [
|
|
11709
11728
|
{
|
|
11710
|
-
type:
|
|
11729
|
+
type: QuestionType.CHOICE,
|
|
11711
11730
|
header: "Approval",
|
|
11712
11731
|
question: planContent,
|
|
11713
11732
|
options: [
|
|
@@ -11728,9 +11747,9 @@ var ExitPlanModeDialog = ({
|
|
|
11728
11747
|
onSubmit: (answers) => {
|
|
11729
11748
|
const answer = answers["0"];
|
|
11730
11749
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
11731
|
-
onApprove(
|
|
11750
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
11732
11751
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
11733
|
-
onApprove(
|
|
11752
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
11734
11753
|
} else if (answer) {
|
|
11735
11754
|
onFeedback(answer);
|
|
11736
11755
|
}
|
|
@@ -11941,7 +11960,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11941
11960
|
);
|
|
11942
11961
|
(0, import_react37.useEffect)(() => {
|
|
11943
11962
|
if (isCancelling) {
|
|
11944
|
-
handleConfirm(
|
|
11963
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
11945
11964
|
}
|
|
11946
11965
|
}, [isCancelling, handleConfirm]);
|
|
11947
11966
|
const handleSelect = (0, import_react37.useCallback)(
|
|
@@ -11954,19 +11973,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
11954
11973
|
if (!confirmationDetails.isModifying) {
|
|
11955
11974
|
options2.push({
|
|
11956
11975
|
label: "Allow once",
|
|
11957
|
-
value:
|
|
11976
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11958
11977
|
key: "Allow once"
|
|
11959
11978
|
});
|
|
11960
11979
|
if (isTrustedFolder) {
|
|
11961
11980
|
options2.push({
|
|
11962
11981
|
label: "Allow for this session",
|
|
11963
|
-
value:
|
|
11982
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11964
11983
|
key: "Allow for this session"
|
|
11965
11984
|
});
|
|
11966
11985
|
if (allowPermanentApproval) {
|
|
11967
11986
|
options2.push({
|
|
11968
11987
|
label: "Allow for this file in all future sessions",
|
|
11969
|
-
value:
|
|
11988
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11970
11989
|
key: "Allow for this file in all future sessions"
|
|
11971
11990
|
});
|
|
11972
11991
|
}
|
|
@@ -11974,119 +11993,119 @@ ${deceptiveUrlWarnings.map(
|
|
|
11974
11993
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
11975
11994
|
options2.push({
|
|
11976
11995
|
label: "Modify with external editor",
|
|
11977
|
-
value:
|
|
11996
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
11978
11997
|
key: "Modify with external editor"
|
|
11979
11998
|
});
|
|
11980
11999
|
}
|
|
11981
12000
|
options2.push({
|
|
11982
12001
|
label: "No, suggest changes (esc)",
|
|
11983
|
-
value:
|
|
12002
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11984
12003
|
key: "No, suggest changes (esc)"
|
|
11985
12004
|
});
|
|
11986
12005
|
}
|
|
11987
12006
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
11988
12007
|
options2.push({
|
|
11989
12008
|
label: "Allow once",
|
|
11990
|
-
value:
|
|
12009
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11991
12010
|
key: "Allow once"
|
|
11992
12011
|
});
|
|
11993
12012
|
if (isTrustedFolder) {
|
|
11994
12013
|
options2.push({
|
|
11995
12014
|
label: "Allow for this session",
|
|
11996
|
-
value:
|
|
12015
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11997
12016
|
key: "Allow for this session"
|
|
11998
12017
|
});
|
|
11999
12018
|
if (allowPermanentApproval) {
|
|
12000
12019
|
options2.push({
|
|
12001
12020
|
label: "Allow for all future sessions",
|
|
12002
|
-
value:
|
|
12021
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12003
12022
|
key: "Allow for all future sessions"
|
|
12004
12023
|
});
|
|
12005
12024
|
}
|
|
12006
12025
|
}
|
|
12007
12026
|
options2.push({
|
|
12008
12027
|
label: "No, suggest changes (esc)",
|
|
12009
|
-
value:
|
|
12028
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12010
12029
|
key: "No, suggest changes (esc)"
|
|
12011
12030
|
});
|
|
12012
12031
|
} else if (confirmationDetails.type === "exec") {
|
|
12013
12032
|
options2.push({
|
|
12014
12033
|
label: "Allow once",
|
|
12015
|
-
value:
|
|
12034
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12016
12035
|
key: "Allow once"
|
|
12017
12036
|
});
|
|
12018
12037
|
if (isTrustedFolder) {
|
|
12019
12038
|
options2.push({
|
|
12020
12039
|
label: `Allow for this session`,
|
|
12021
|
-
value:
|
|
12040
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12022
12041
|
key: `Allow for this session`
|
|
12023
12042
|
});
|
|
12024
12043
|
if (allowPermanentApproval) {
|
|
12025
12044
|
options2.push({
|
|
12026
12045
|
label: `Allow this command for all future sessions`,
|
|
12027
|
-
value:
|
|
12046
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12028
12047
|
key: `Allow for all future sessions`
|
|
12029
12048
|
});
|
|
12030
12049
|
}
|
|
12031
12050
|
}
|
|
12032
12051
|
options2.push({
|
|
12033
12052
|
label: "No, suggest changes (esc)",
|
|
12034
|
-
value:
|
|
12053
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12035
12054
|
key: "No, suggest changes (esc)"
|
|
12036
12055
|
});
|
|
12037
12056
|
} else if (confirmationDetails.type === "info") {
|
|
12038
12057
|
options2.push({
|
|
12039
12058
|
label: "Allow once",
|
|
12040
|
-
value:
|
|
12059
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12041
12060
|
key: "Allow once"
|
|
12042
12061
|
});
|
|
12043
12062
|
if (isTrustedFolder) {
|
|
12044
12063
|
options2.push({
|
|
12045
12064
|
label: "Allow for this session",
|
|
12046
|
-
value:
|
|
12065
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12047
12066
|
key: "Allow for this session"
|
|
12048
12067
|
});
|
|
12049
12068
|
if (allowPermanentApproval) {
|
|
12050
12069
|
options2.push({
|
|
12051
12070
|
label: "Allow for all future sessions",
|
|
12052
|
-
value:
|
|
12071
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12053
12072
|
key: "Allow for all future sessions"
|
|
12054
12073
|
});
|
|
12055
12074
|
}
|
|
12056
12075
|
}
|
|
12057
12076
|
options2.push({
|
|
12058
12077
|
label: "No, suggest changes (esc)",
|
|
12059
|
-
value:
|
|
12078
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12060
12079
|
key: "No, suggest changes (esc)"
|
|
12061
12080
|
});
|
|
12062
12081
|
} else if (confirmationDetails.type === "mcp") {
|
|
12063
12082
|
options2.push({
|
|
12064
12083
|
label: "Allow once",
|
|
12065
|
-
value:
|
|
12084
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12066
12085
|
key: "Allow once"
|
|
12067
12086
|
});
|
|
12068
12087
|
if (isTrustedFolder) {
|
|
12069
12088
|
options2.push({
|
|
12070
12089
|
label: "Allow tool for this session",
|
|
12071
|
-
value:
|
|
12090
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
12072
12091
|
key: "Allow tool for this session"
|
|
12073
12092
|
});
|
|
12074
12093
|
options2.push({
|
|
12075
12094
|
label: "Allow all server tools for this session",
|
|
12076
|
-
value:
|
|
12095
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
12077
12096
|
key: "Allow all server tools for this session"
|
|
12078
12097
|
});
|
|
12079
12098
|
if (allowPermanentApproval) {
|
|
12080
12099
|
options2.push({
|
|
12081
12100
|
label: "Allow tool for all future sessions",
|
|
12082
|
-
value:
|
|
12101
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12083
12102
|
key: "Allow tool for all future sessions"
|
|
12084
12103
|
});
|
|
12085
12104
|
}
|
|
12086
12105
|
}
|
|
12087
12106
|
options2.push({
|
|
12088
12107
|
label: "No, suggest changes (esc)",
|
|
12089
|
-
value:
|
|
12108
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12090
12109
|
key: "No, suggest changes (esc)"
|
|
12091
12110
|
});
|
|
12092
12111
|
}
|
|
@@ -12125,7 +12144,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12125
12144
|
const containsRedirection = commandsToDisplay.some(
|
|
12126
12145
|
(cmd) => hasRedirection(cmd)
|
|
12127
12146
|
);
|
|
12128
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12147
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12129
12148
|
if (containsRedirection && !isAutoEdit) {
|
|
12130
12149
|
extraInfoLines = 1;
|
|
12131
12150
|
}
|
|
@@ -12151,7 +12170,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12151
12170
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
12152
12171
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
12153
12172
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
12154
|
-
(o) => o.value ===
|
|
12173
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
12155
12174
|
);
|
|
12156
12175
|
if (alwaysAndSaveIndex !== -1) {
|
|
12157
12176
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -12168,10 +12187,10 @@ ${deceptiveUrlWarnings.map(
|
|
|
12168
12187
|
{
|
|
12169
12188
|
questions: confirmationDetails.questions,
|
|
12170
12189
|
onSubmit: (answers) => {
|
|
12171
|
-
handleConfirm(
|
|
12190
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
12172
12191
|
},
|
|
12173
12192
|
onCancel: () => {
|
|
12174
|
-
handleConfirm(
|
|
12193
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12175
12194
|
},
|
|
12176
12195
|
width: terminalWidth,
|
|
12177
12196
|
availableHeight: bodyHeight
|
|
@@ -12192,19 +12211,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
12192
12211
|
planPath: confirmationDetails.planPath,
|
|
12193
12212
|
getPreferredEditor,
|
|
12194
12213
|
onApprove: (approvalMode) => {
|
|
12195
|
-
handleConfirm(
|
|
12214
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12196
12215
|
approved: true,
|
|
12197
12216
|
approvalMode
|
|
12198
12217
|
});
|
|
12199
12218
|
},
|
|
12200
12219
|
onFeedback: (feedback) => {
|
|
12201
|
-
handleConfirm(
|
|
12220
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12202
12221
|
approved: false,
|
|
12203
12222
|
feedback
|
|
12204
12223
|
});
|
|
12205
12224
|
},
|
|
12206
12225
|
onCancel: () => {
|
|
12207
|
-
handleConfirm(
|
|
12226
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12208
12227
|
},
|
|
12209
12228
|
width: terminalWidth,
|
|
12210
12229
|
availableHeight: bodyHeight
|
|
@@ -12313,7 +12332,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12313
12332
|
const containsRedirection = commandsToDisplay.some(
|
|
12314
12333
|
(cmd) => hasRedirection(cmd)
|
|
12315
12334
|
);
|
|
12316
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12335
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12317
12336
|
let warnings = null;
|
|
12318
12337
|
if (containsRedirection && !isAutoEdit) {
|
|
12319
12338
|
const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
|
|
@@ -12472,7 +12491,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12472
12491
|
const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
|
|
12473
12492
|
const renderRadioItem = (0, import_react37.useCallback)(
|
|
12474
12493
|
(item, { titleColor }) => {
|
|
12475
|
-
if (item.value ===
|
|
12494
|
+
if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
12476
12495
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
|
|
12477
12496
|
item.label,
|
|
12478
12497
|
" ",
|
|
@@ -14502,7 +14521,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
|
|
|
14502
14521
|
if (settings.merged.security.auth.useExternal) {
|
|
14503
14522
|
return null;
|
|
14504
14523
|
}
|
|
14505
|
-
if (authType ===
|
|
14524
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14506
14525
|
return null;
|
|
14507
14526
|
}
|
|
14508
14527
|
return validateAuthMethod(authType);
|
|
@@ -14554,7 +14573,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
14554
14573
|
}
|
|
14555
14574
|
return;
|
|
14556
14575
|
}
|
|
14557
|
-
if (authType ===
|
|
14576
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14558
14577
|
const key = await reloadApiKey();
|
|
14559
14578
|
if (!key) {
|
|
14560
14579
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -14632,31 +14651,31 @@ function AuthDialog({
|
|
|
14632
14651
|
let items = [
|
|
14633
14652
|
{
|
|
14634
14653
|
label: "Sign in with Google",
|
|
14635
|
-
value:
|
|
14636
|
-
key:
|
|
14654
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
14655
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
14637
14656
|
},
|
|
14638
14657
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
14639
14658
|
{
|
|
14640
14659
|
label: "Use Cloud Shell user credentials",
|
|
14641
|
-
value:
|
|
14642
|
-
key:
|
|
14660
|
+
value: AuthType.COMPUTE_ADC,
|
|
14661
|
+
key: AuthType.COMPUTE_ADC
|
|
14643
14662
|
}
|
|
14644
14663
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
14645
14664
|
{
|
|
14646
14665
|
label: "Use metadata server application default credentials",
|
|
14647
|
-
value:
|
|
14648
|
-
key:
|
|
14666
|
+
value: AuthType.COMPUTE_ADC,
|
|
14667
|
+
key: AuthType.COMPUTE_ADC
|
|
14649
14668
|
}
|
|
14650
14669
|
] : [],
|
|
14651
14670
|
{
|
|
14652
14671
|
label: "Use Gemini API Key",
|
|
14653
|
-
value:
|
|
14654
|
-
key:
|
|
14672
|
+
value: AuthType.USE_GEMINI,
|
|
14673
|
+
key: AuthType.USE_GEMINI
|
|
14655
14674
|
},
|
|
14656
14675
|
{
|
|
14657
14676
|
label: "Vertex AI",
|
|
14658
|
-
value:
|
|
14659
|
-
key:
|
|
14677
|
+
value: AuthType.USE_VERTEX_AI,
|
|
14678
|
+
key: AuthType.USE_VERTEX_AI
|
|
14660
14679
|
}
|
|
14661
14680
|
];
|
|
14662
14681
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -14678,9 +14697,9 @@ function AuthDialog({
|
|
|
14678
14697
|
return item.value === defaultAuthType;
|
|
14679
14698
|
}
|
|
14680
14699
|
if (process.env["GEMINI_API_KEY"]) {
|
|
14681
|
-
return item.value ===
|
|
14700
|
+
return item.value === AuthType.USE_GEMINI;
|
|
14682
14701
|
}
|
|
14683
|
-
return item.value ===
|
|
14702
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
14684
14703
|
});
|
|
14685
14704
|
if (settings.merged.security.auth.enforcedType) {
|
|
14686
14705
|
initialAuthIndex = 0;
|
|
@@ -14691,7 +14710,7 @@ function AuthDialog({
|
|
|
14691
14710
|
return;
|
|
14692
14711
|
}
|
|
14693
14712
|
if (authType) {
|
|
14694
|
-
const needsRestart = authType ===
|
|
14713
|
+
const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
|
|
14695
14714
|
if (needsRestart) {
|
|
14696
14715
|
setAuthContext({ requiresRestart: true });
|
|
14697
14716
|
} else {
|
|
@@ -14699,12 +14718,12 @@ function AuthDialog({
|
|
|
14699
14718
|
}
|
|
14700
14719
|
await clearCachedCredentialFile();
|
|
14701
14720
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
14702
|
-
if (authType ===
|
|
14721
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
14703
14722
|
setExiting(true);
|
|
14704
14723
|
setTimeout(relaunchApp, 100);
|
|
14705
14724
|
return;
|
|
14706
14725
|
}
|
|
14707
|
-
if (authType ===
|
|
14726
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14708
14727
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
14709
14728
|
return;
|
|
14710
14729
|
}
|
|
@@ -15500,11 +15519,11 @@ var PrivacyNoticeText = ({
|
|
|
15500
15519
|
}) => {
|
|
15501
15520
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15502
15521
|
switch (authType) {
|
|
15503
|
-
case
|
|
15522
|
+
case AuthType.USE_GEMINI:
|
|
15504
15523
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15505
|
-
case
|
|
15524
|
+
case AuthType.USE_VERTEX_AI:
|
|
15506
15525
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15507
|
-
case
|
|
15526
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15508
15527
|
default:
|
|
15509
15528
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15510
15529
|
}
|
|
@@ -15545,7 +15564,7 @@ function ProQuotaDialog({
|
|
|
15545
15564
|
value: "retry_always",
|
|
15546
15565
|
key: "retry_always"
|
|
15547
15566
|
},
|
|
15548
|
-
...authType ===
|
|
15567
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15549
15568
|
{
|
|
15550
15569
|
label: "Upgrade for higher limits",
|
|
15551
15570
|
value: "upgrade",
|
|
@@ -16704,7 +16723,7 @@ function ModelDialog({ onClose }) {
|
|
|
16704
16723
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
16705
16724
|
const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
|
|
16706
16725
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16707
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16726
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16708
16727
|
const manualModelSelected = (0, import_react55.useMemo)(() => {
|
|
16709
16728
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16710
16729
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -18027,10 +18046,10 @@ function initializeConsoleStore() {
|
|
|
18027
18046
|
globalConsoleMessages = [];
|
|
18028
18047
|
globalErrorCount = 0;
|
|
18029
18048
|
notifyListeners();
|
|
18030
|
-
coreEvents.off(
|
|
18031
|
-
coreEvents.off(
|
|
18032
|
-
coreEvents.on(
|
|
18033
|
-
coreEvents.on(
|
|
18049
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18050
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
18051
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18052
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
18034
18053
|
}
|
|
18035
18054
|
function notifyListeners() {
|
|
18036
18055
|
for (const listener of listeners) {
|
|
@@ -20167,7 +20186,7 @@ function usePromptCompletion({
|
|
|
20167
20186
|
{ model: "prompt-completion" },
|
|
20168
20187
|
contents,
|
|
20169
20188
|
signal,
|
|
20170
|
-
|
|
20189
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20171
20190
|
);
|
|
20172
20191
|
if (signal.aborted) {
|
|
20173
20192
|
return;
|
|
@@ -22245,9 +22264,9 @@ var InputPrompt = ({
|
|
|
22245
22264
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22246
22265
|
}
|
|
22247
22266
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22248
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22249
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22250
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22267
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22268
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22269
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22251
22270
|
let statusColor;
|
|
22252
22271
|
let statusText = "";
|
|
22253
22272
|
if (shellModeActive) {
|
|
@@ -23080,22 +23099,22 @@ var ApprovalModeIndicator = ({
|
|
|
23080
23099
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
23081
23100
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
23082
23101
|
switch (approvalMode) {
|
|
23083
|
-
case
|
|
23102
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23084
23103
|
textColor = theme.status.warning;
|
|
23085
23104
|
textContent = "auto-accept edits";
|
|
23086
23105
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23087
23106
|
break;
|
|
23088
|
-
case
|
|
23107
|
+
case ApprovalMode.PLAN:
|
|
23089
23108
|
textColor = theme.status.success;
|
|
23090
23109
|
textContent = "plan";
|
|
23091
23110
|
subText = `${cycleHint} to manual`;
|
|
23092
23111
|
break;
|
|
23093
|
-
case
|
|
23112
|
+
case ApprovalMode.YOLO:
|
|
23094
23113
|
textColor = theme.status.error;
|
|
23095
23114
|
textContent = "YOLO";
|
|
23096
23115
|
subText = yoloHint;
|
|
23097
23116
|
break;
|
|
23098
|
-
case
|
|
23117
|
+
case ApprovalMode.DEFAULT:
|
|
23099
23118
|
default:
|
|
23100
23119
|
textColor = theme.text.accent;
|
|
23101
23120
|
textContent = "";
|
|
@@ -23143,7 +23162,7 @@ var useComposerStatus = () => {
|
|
|
23143
23162
|
(item) => item.type === "tool_group"
|
|
23144
23163
|
).some(
|
|
23145
23164
|
(item) => item.tools.some(
|
|
23146
|
-
(tool) => tool.status ===
|
|
23165
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23147
23166
|
)
|
|
23148
23167
|
),
|
|
23149
23168
|
[uiState.pendingHistoryItems]
|
|
@@ -23158,13 +23177,13 @@ var useComposerStatus = () => {
|
|
|
23158
23177
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23159
23178
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23160
23179
|
switch (showApprovalModeIndicator) {
|
|
23161
|
-
case
|
|
23180
|
+
case ApprovalMode.YOLO:
|
|
23162
23181
|
return { text: "YOLO", color: theme.status.error };
|
|
23163
|
-
case
|
|
23182
|
+
case ApprovalMode.PLAN:
|
|
23164
23183
|
return { text: "plan", color: theme.status.success };
|
|
23165
|
-
case
|
|
23184
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23166
23185
|
return { text: "auto edit", color: theme.status.warning };
|
|
23167
|
-
case
|
|
23186
|
+
case ApprovalMode.DEFAULT:
|
|
23168
23187
|
default:
|
|
23169
23188
|
return null;
|
|
23170
23189
|
}
|
|
@@ -23518,7 +23537,7 @@ var ConfigInitDisplay = ({
|
|
|
23518
23537
|
let connected = 0;
|
|
23519
23538
|
const connecting = [];
|
|
23520
23539
|
for (const [name, client] of clients.entries()) {
|
|
23521
|
-
if (client.getStatus() ===
|
|
23540
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23522
23541
|
connected++;
|
|
23523
23542
|
} else {
|
|
23524
23543
|
connecting.push(name);
|
|
@@ -23540,9 +23559,9 @@ var ConfigInitDisplay = ({
|
|
|
23540
23559
|
);
|
|
23541
23560
|
}
|
|
23542
23561
|
};
|
|
23543
|
-
coreEvents.on(
|
|
23562
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23544
23563
|
return () => {
|
|
23545
|
-
coreEvents.off(
|
|
23564
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23546
23565
|
};
|
|
23547
23566
|
}, [initialMessage]);
|
|
23548
23567
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
|
|
@@ -24259,7 +24278,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24259
24278
|
callId,
|
|
24260
24279
|
name: SHELL_COMMAND_NAME,
|
|
24261
24280
|
description: rawQuery,
|
|
24262
|
-
status:
|
|
24281
|
+
status: CoreToolCallStatus.Executing,
|
|
24263
24282
|
isClientInitiated: true,
|
|
24264
24283
|
resultDisplay: "",
|
|
24265
24284
|
confirmationDetails: void 0
|
|
@@ -24400,7 +24419,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24400
24419
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24401
24420
|
}
|
|
24402
24421
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24403
|
-
let finalStatus =
|
|
24422
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24404
24423
|
const prependToAnsiOutput = (output, text) => {
|
|
24405
24424
|
const newLines = text.split("\n").map((line) => [
|
|
24406
24425
|
{
|
|
@@ -24419,20 +24438,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24419
24438
|
};
|
|
24420
24439
|
let prefix = "";
|
|
24421
24440
|
if (result.error) {
|
|
24422
|
-
finalStatus =
|
|
24441
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24423
24442
|
prefix = result.error.message;
|
|
24424
24443
|
} else if (result.aborted) {
|
|
24425
|
-
finalStatus =
|
|
24444
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24426
24445
|
prefix = "Command was cancelled.";
|
|
24427
24446
|
} else if (result.backgrounded) {
|
|
24428
|
-
finalStatus =
|
|
24447
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24429
24448
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24430
24449
|
mainContent = finalOutput;
|
|
24431
24450
|
} else if (result.signal) {
|
|
24432
|
-
finalStatus =
|
|
24451
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24433
24452
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24434
24453
|
} else if (result.exitCode !== 0) {
|
|
24435
|
-
finalStatus =
|
|
24454
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24436
24455
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24437
24456
|
}
|
|
24438
24457
|
if (prefix) {
|
|
@@ -24458,7 +24477,7 @@ ${mainContent}`;
|
|
|
24458
24477
|
status: finalStatus,
|
|
24459
24478
|
resultDisplay: finalOutput
|
|
24460
24479
|
};
|
|
24461
|
-
if (finalStatus !==
|
|
24480
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24462
24481
|
addItemToHistory(
|
|
24463
24482
|
{
|
|
24464
24483
|
type: "tool_group",
|
|
@@ -25448,12 +25467,12 @@ function useQuotaAndFallback({
|
|
|
25448
25467
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25449
25468
|
`/stats model for usage details`,
|
|
25450
25469
|
`/model to switch models.`,
|
|
25451
|
-
contentGeneratorConfig?.authType ===
|
|
25470
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25452
25471
|
].filter(Boolean);
|
|
25453
25472
|
message = messageLines.join("\n");
|
|
25454
25473
|
} else if (error instanceof ModelNotFoundError) {
|
|
25455
25474
|
isModelNotFoundError = true;
|
|
25456
|
-
if (contentGeneratorConfig?.authType ===
|
|
25475
|
+
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
25457
25476
|
const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
|
|
25458
25477
|
const messageLines = [
|
|
25459
25478
|
`Model "${failedModel}" is not available in region "${location}".`,
|
|
@@ -25645,7 +25664,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25645
25664
|
);
|
|
25646
25665
|
setEditorError(null);
|
|
25647
25666
|
setIsEditorDialogOpen(false);
|
|
25648
|
-
coreEvents.emit(
|
|
25667
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25649
25668
|
} catch (error) {
|
|
25650
25669
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25651
25670
|
}
|
|
@@ -25654,7 +25673,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25654
25673
|
);
|
|
25655
25674
|
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25656
25675
|
setIsEditorDialogOpen(false);
|
|
25657
|
-
coreEvents.emit(
|
|
25676
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25658
25677
|
}, []);
|
|
25659
25678
|
return {
|
|
25660
25679
|
isEditorDialogOpen,
|
|
@@ -26031,7 +26050,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26031
26050
|
canonicalPath: resolvedCommandPath
|
|
26032
26051
|
} = parseSlashCommand(trimmed, commands);
|
|
26033
26052
|
if (!commandToExecute) {
|
|
26034
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
26053
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
26035
26054
|
if (isMcpLoading) {
|
|
26036
26055
|
setIsProcessing(true);
|
|
26037
26056
|
if (addToHistory) {
|
|
@@ -26211,7 +26230,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26211
26230
|
onConfirm: async (resolvedOutcome) => {
|
|
26212
26231
|
resolve3({
|
|
26213
26232
|
outcome: resolvedOutcome,
|
|
26214
|
-
approvedCommands: resolvedOutcome ===
|
|
26233
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26215
26234
|
});
|
|
26216
26235
|
}
|
|
26217
26236
|
};
|
|
@@ -26219,7 +26238,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26219
26238
|
callId,
|
|
26220
26239
|
name: "Expansion",
|
|
26221
26240
|
description: "Command expansion needs shell access",
|
|
26222
|
-
status:
|
|
26241
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26223
26242
|
isClientInitiated: true,
|
|
26224
26243
|
resultDisplay: void 0,
|
|
26225
26244
|
confirmationDetails
|
|
@@ -26230,7 +26249,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26230
26249
|
});
|
|
26231
26250
|
});
|
|
26232
26251
|
setPendingItem(null);
|
|
26233
|
-
if (outcome ===
|
|
26252
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26234
26253
|
addItem(
|
|
26235
26254
|
{
|
|
26236
26255
|
type: "info" /* INFO */,
|
|
@@ -26240,7 +26259,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26240
26259
|
);
|
|
26241
26260
|
return { type: "handled" };
|
|
26242
26261
|
}
|
|
26243
|
-
if (outcome ===
|
|
26262
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26244
26263
|
setSessionShellAllowlist(
|
|
26245
26264
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26246
26265
|
);
|
|
@@ -26716,7 +26735,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26716
26735
|
let description;
|
|
26717
26736
|
let renderOutputAsMarkdown = false;
|
|
26718
26737
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26719
|
-
if (call.status ===
|
|
26738
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26720
26739
|
description = JSON.stringify(call.request.args);
|
|
26721
26740
|
} else {
|
|
26722
26741
|
description = call.invocation.getDescription();
|
|
@@ -26739,27 +26758,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26739
26758
|
let progress = void 0;
|
|
26740
26759
|
let progressTotal = void 0;
|
|
26741
26760
|
switch (call.status) {
|
|
26742
|
-
case
|
|
26761
|
+
case CoreToolCallStatus.Success:
|
|
26743
26762
|
resultDisplay = call.response.resultDisplay;
|
|
26744
26763
|
outputFile = call.response.outputFile;
|
|
26745
26764
|
break;
|
|
26746
|
-
case
|
|
26747
|
-
case
|
|
26765
|
+
case CoreToolCallStatus.Error:
|
|
26766
|
+
case CoreToolCallStatus.Cancelled:
|
|
26748
26767
|
resultDisplay = call.response.resultDisplay;
|
|
26749
26768
|
break;
|
|
26750
|
-
case
|
|
26769
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26751
26770
|
correlationId = call.correlationId;
|
|
26752
26771
|
confirmationDetails = call.confirmationDetails;
|
|
26753
26772
|
break;
|
|
26754
|
-
case
|
|
26773
|
+
case CoreToolCallStatus.Executing:
|
|
26755
26774
|
resultDisplay = call.liveOutput;
|
|
26756
26775
|
ptyId = call.pid;
|
|
26757
26776
|
progressMessage = call.progressMessage;
|
|
26758
26777
|
progress = call.progress;
|
|
26759
26778
|
progressTotal = call.progressTotal;
|
|
26760
26779
|
break;
|
|
26761
|
-
case
|
|
26762
|
-
case
|
|
26780
|
+
case CoreToolCallStatus.Scheduled:
|
|
26781
|
+
case CoreToolCallStatus.Validating:
|
|
26763
26782
|
break;
|
|
26764
26783
|
default: {
|
|
26765
26784
|
const exhaustiveCheck = call;
|
|
@@ -26830,7 +26849,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26830
26849
|
const handler = (event) => {
|
|
26831
26850
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26832
26851
|
const hasExecuting = event.toolCalls.some(
|
|
26833
|
-
(tc) => tc.status ===
|
|
26852
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26834
26853
|
);
|
|
26835
26854
|
if (hasExecuting) {
|
|
26836
26855
|
setLastToolOutputTime(Date.now());
|
|
@@ -26839,7 +26858,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26839
26858
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26840
26859
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26841
26860
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26842
|
-
(tc) => tc.status ===
|
|
26861
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26843
26862
|
);
|
|
26844
26863
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26845
26864
|
return prev;
|
|
@@ -26851,9 +26870,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26851
26870
|
};
|
|
26852
26871
|
});
|
|
26853
26872
|
};
|
|
26854
|
-
messageBus.subscribe(
|
|
26873
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26855
26874
|
return () => {
|
|
26856
|
-
messageBus.unsubscribe(
|
|
26875
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26857
26876
|
};
|
|
26858
26877
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26859
26878
|
(0, import_react98.useEffect)(() => {
|
|
@@ -26875,9 +26894,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26875
26894
|
};
|
|
26876
26895
|
});
|
|
26877
26896
|
};
|
|
26878
|
-
messageBus.subscribe(
|
|
26897
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26879
26898
|
return () => {
|
|
26880
|
-
messageBus.unsubscribe(
|
|
26899
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26881
26900
|
};
|
|
26882
26901
|
}, [messageBus]);
|
|
26883
26902
|
const schedule = (0, import_react98.useCallback)(
|
|
@@ -26976,8 +26995,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
26976
26995
|
const prev = prevMap.get(coreCall.request.callId);
|
|
26977
26996
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
26978
26997
|
let status = coreCall.status;
|
|
26979
|
-
if ((status ===
|
|
26980
|
-
status =
|
|
26998
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
26999
|
+
status = CoreToolCallStatus.Executing;
|
|
26981
27000
|
}
|
|
26982
27001
|
return {
|
|
26983
27002
|
...coreCall,
|
|
@@ -27009,7 +27028,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
27009
27028
|
};
|
|
27010
27029
|
}
|
|
27011
27030
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
27012
|
-
return toolCall.status ===
|
|
27031
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
27013
27032
|
}
|
|
27014
27033
|
function showCitations(settings) {
|
|
27015
27034
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -27019,14 +27038,14 @@ function showCitations(settings) {
|
|
|
27019
27038
|
return true;
|
|
27020
27039
|
}
|
|
27021
27040
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
27022
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
27041
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
27023
27042
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
27024
27043
|
}
|
|
27025
27044
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
27026
|
-
if (tc.status ===
|
|
27045
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
27027
27046
|
return true;
|
|
27028
27047
|
}
|
|
27029
|
-
if (tc.status ===
|
|
27048
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
27030
27049
|
return !tc.responseSubmittedToGemini;
|
|
27031
27050
|
}
|
|
27032
27051
|
return false;
|
|
@@ -27072,9 +27091,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27072
27091
|
}
|
|
27073
27092
|
setRetryStatus(payload);
|
|
27074
27093
|
};
|
|
27075
|
-
coreEvents.on(
|
|
27094
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27076
27095
|
return () => {
|
|
27077
|
-
coreEvents.off(
|
|
27096
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27078
27097
|
};
|
|
27079
27098
|
}, [isRespondingRef]);
|
|
27080
27099
|
const [
|
|
@@ -27207,12 +27226,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27207
27226
|
const tc = toolCalls[i];
|
|
27208
27227
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27209
27228
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27210
|
-
const isAgent = tc.tool?.kind ===
|
|
27229
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27211
27230
|
if (isAgent) {
|
|
27212
27231
|
let contigAgentsComplete = true;
|
|
27213
27232
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27214
27233
|
const nextTc = toolCalls[j];
|
|
27215
|
-
if (nextTc.tool?.kind ===
|
|
27234
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27216
27235
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27217
27236
|
contigAgentsComplete = false;
|
|
27218
27237
|
break;
|
|
@@ -27238,7 +27257,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27238
27257
|
let currentGroup = [];
|
|
27239
27258
|
for (const tc of toolsToPush) {
|
|
27240
27259
|
newPushed.add(tc.request.callId);
|
|
27241
|
-
if (tc.tool?.kind ===
|
|
27260
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27242
27261
|
currentGroup.push(tc);
|
|
27243
27262
|
} else {
|
|
27244
27263
|
if (currentGroup.length > 0) {
|
|
@@ -27388,7 +27407,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27388
27407
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27389
27408
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27390
27409
|
(0, import_react99.useEffect)(() => {
|
|
27391
|
-
if (config.getApprovalMode() ===
|
|
27410
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27392
27411
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27393
27412
|
(item) => item.type === "user" /* USER */
|
|
27394
27413
|
);
|
|
@@ -27456,7 +27475,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27456
27475
|
return;
|
|
27457
27476
|
}
|
|
27458
27477
|
const hasActiveTools = toolCalls.some(
|
|
27459
|
-
(tc) => tc.status ===
|
|
27478
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27460
27479
|
);
|
|
27461
27480
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27462
27481
|
if (clearBuffer) {
|
|
@@ -27483,7 +27502,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27483
27502
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27484
27503
|
return {
|
|
27485
27504
|
...tool,
|
|
27486
|
-
status:
|
|
27505
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27487
27506
|
resultDisplay: tool.resultDisplay
|
|
27488
27507
|
};
|
|
27489
27508
|
}
|
|
@@ -27548,7 +27567,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27548
27567
|
let localQueryToSendToGemini = null;
|
|
27549
27568
|
if (typeof query === "string") {
|
|
27550
27569
|
const trimmedQuery = query.trim();
|
|
27551
|
-
await logger?.logMessage(
|
|
27570
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27552
27571
|
if (!shellModeActive) {
|
|
27553
27572
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27554
27573
|
if (slashCommandResult) {
|
|
@@ -27704,7 +27723,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27704
27723
|
if (pendingHistoryItemRef.current) {
|
|
27705
27724
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27706
27725
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27707
|
-
(tool) => tool.status ===
|
|
27726
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
27708
27727
|
);
|
|
27709
27728
|
const pendingItem = {
|
|
27710
27729
|
...pendingHistoryItemRef.current,
|
|
@@ -27996,15 +28015,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27996
28015
|
let geminiMessageBuffer = "";
|
|
27997
28016
|
const toolCallRequests = [];
|
|
27998
28017
|
for await (const event of stream) {
|
|
27999
|
-
if (event.type !==
|
|
28018
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
28000
28019
|
setThought(null);
|
|
28001
28020
|
}
|
|
28002
28021
|
switch (event.type) {
|
|
28003
|
-
case
|
|
28022
|
+
case GeminiEventType.Thought:
|
|
28004
28023
|
setLastGeminiActivityTime(Date.now());
|
|
28005
28024
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
28006
28025
|
break;
|
|
28007
|
-
case
|
|
28026
|
+
case GeminiEventType.Content:
|
|
28008
28027
|
setLastGeminiActivityTime(Date.now());
|
|
28009
28028
|
geminiMessageBuffer = handleContentEvent(
|
|
28010
28029
|
event.value,
|
|
@@ -28012,16 +28031,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28012
28031
|
userMessageTimestamp
|
|
28013
28032
|
);
|
|
28014
28033
|
break;
|
|
28015
|
-
case
|
|
28034
|
+
case GeminiEventType.ToolCallRequest:
|
|
28016
28035
|
toolCallRequests.push(event.value);
|
|
28017
28036
|
break;
|
|
28018
|
-
case
|
|
28037
|
+
case GeminiEventType.UserCancelled:
|
|
28019
28038
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
28020
28039
|
break;
|
|
28021
|
-
case
|
|
28040
|
+
case GeminiEventType.Error:
|
|
28022
28041
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
28023
28042
|
break;
|
|
28024
|
-
case
|
|
28043
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
28025
28044
|
handleAgentExecutionStoppedEvent(
|
|
28026
28045
|
event.value.reason,
|
|
28027
28046
|
userMessageTimestamp,
|
|
@@ -28029,7 +28048,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28029
28048
|
event.value.contextCleared
|
|
28030
28049
|
);
|
|
28031
28050
|
break;
|
|
28032
|
-
case
|
|
28051
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
28033
28052
|
handleAgentExecutionBlockedEvent(
|
|
28034
28053
|
event.value.reason,
|
|
28035
28054
|
userMessageTimestamp,
|
|
@@ -28037,36 +28056,36 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28037
28056
|
event.value.contextCleared
|
|
28038
28057
|
);
|
|
28039
28058
|
break;
|
|
28040
|
-
case
|
|
28059
|
+
case GeminiEventType.ChatCompressed:
|
|
28041
28060
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
28042
28061
|
break;
|
|
28043
|
-
case
|
|
28044
|
-
case
|
|
28062
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
28063
|
+
case GeminiEventType.ToolCallResponse:
|
|
28045
28064
|
break;
|
|
28046
|
-
case
|
|
28065
|
+
case GeminiEventType.MaxSessionTurns:
|
|
28047
28066
|
handleMaxSessionTurnsEvent();
|
|
28048
28067
|
break;
|
|
28049
|
-
case
|
|
28068
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
28050
28069
|
handleContextWindowWillOverflowEvent(
|
|
28051
28070
|
event.value.estimatedRequestTokenCount,
|
|
28052
28071
|
event.value.remainingTokenCount
|
|
28053
28072
|
);
|
|
28054
28073
|
break;
|
|
28055
|
-
case
|
|
28074
|
+
case GeminiEventType.Finished:
|
|
28056
28075
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
28057
28076
|
break;
|
|
28058
|
-
case
|
|
28077
|
+
case GeminiEventType.Citation:
|
|
28059
28078
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
28060
28079
|
break;
|
|
28061
|
-
case
|
|
28080
|
+
case GeminiEventType.ModelInfo:
|
|
28062
28081
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
28063
28082
|
break;
|
|
28064
|
-
case
|
|
28083
|
+
case GeminiEventType.LoopDetected:
|
|
28065
28084
|
loopDetectedRef.current = true;
|
|
28066
28085
|
break;
|
|
28067
|
-
case
|
|
28086
|
+
case GeminiEventType.Retry:
|
|
28068
28087
|
break;
|
|
28069
|
-
case
|
|
28088
|
+
case GeminiEventType.InvalidStream:
|
|
28070
28089
|
handleInvalidStreamEvent(event.value, userMessageTimestamp);
|
|
28071
28090
|
break;
|
|
28072
28091
|
default: {
|
|
@@ -28109,7 +28128,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28109
28128
|
const submitQuery = (0, import_react99.useCallback)(
|
|
28110
28129
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
28111
28130
|
{
|
|
28112
|
-
operation: options?.isContinuation ?
|
|
28131
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
28113
28132
|
sessionId: config.getSessionId()
|
|
28114
28133
|
},
|
|
28115
28134
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28269,7 +28288,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28269
28288
|
);
|
|
28270
28289
|
const handleApprovalModeChange = (0, import_react99.useCallback)(
|
|
28271
28290
|
async (newApprovalMode) => {
|
|
28272
|
-
if (previousApprovalModeRef.current ===
|
|
28291
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28273
28292
|
if (geminiClient) {
|
|
28274
28293
|
try {
|
|
28275
28294
|
await geminiClient.addHistory({
|
|
@@ -28292,11 +28311,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28292
28311
|
}
|
|
28293
28312
|
}
|
|
28294
28313
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28295
|
-
if (newApprovalMode ===
|
|
28314
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28296
28315
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28297
28316
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28298
28317
|
);
|
|
28299
|
-
if (newApprovalMode ===
|
|
28318
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28300
28319
|
awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
|
|
28301
28320
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
28302
28321
|
return true;
|
|
@@ -28312,11 +28331,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28312
28331
|
if (call.correlationId) {
|
|
28313
28332
|
try {
|
|
28314
28333
|
await config.getMessageBus().publish({
|
|
28315
|
-
type:
|
|
28334
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28316
28335
|
correlationId: call.correlationId,
|
|
28317
28336
|
confirmed: true,
|
|
28318
28337
|
requiresUserConfirmation: false,
|
|
28319
|
-
outcome:
|
|
28338
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28320
28339
|
});
|
|
28321
28340
|
} catch (error) {
|
|
28322
28341
|
debugLogger.warn(
|
|
@@ -28407,14 +28426,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28407
28426
|
);
|
|
28408
28427
|
if (isLowErrorVerbosity) {
|
|
28409
28428
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28410
|
-
(tc) => tc.status ===
|
|
28429
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28411
28430
|
).length;
|
|
28412
28431
|
}
|
|
28413
28432
|
if (geminiTools.length === 0) {
|
|
28414
28433
|
return;
|
|
28415
28434
|
}
|
|
28416
28435
|
const stopExecutionTool = geminiTools.find(
|
|
28417
|
-
(tc) => tc.response.errorType ===
|
|
28436
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28418
28437
|
);
|
|
28419
28438
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28420
28439
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28434,9 +28453,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28434
28453
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28435
28454
|
);
|
|
28436
28455
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28437
|
-
(tc) => tc.status ===
|
|
28456
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28438
28457
|
);
|
|
28439
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28458
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28440
28459
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28441
28460
|
if (!turnCancelledRef.current) {
|
|
28442
28461
|
addItem({
|
|
@@ -28463,6 +28482,19 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28463
28482
|
const responsesToSend = geminiTools.flatMap(
|
|
28464
28483
|
(toolCall) => toolCall.response.responseParts
|
|
28465
28484
|
);
|
|
28485
|
+
const callIdsToMarkAsSubmitted = geminiTools.map(
|
|
28486
|
+
(toolCall) => toolCall.request.callId
|
|
28487
|
+
);
|
|
28488
|
+
markToolsAsSubmitted(callIdsToMarkAsSubmitted);
|
|
28489
|
+
if (modelSwitchedFromQuotaError) {
|
|
28490
|
+
if (geminiClient && responsesToSend.length > 0) {
|
|
28491
|
+
await geminiClient.addHistory({
|
|
28492
|
+
role: "user",
|
|
28493
|
+
parts: responsesToSend
|
|
28494
|
+
});
|
|
28495
|
+
}
|
|
28496
|
+
return;
|
|
28497
|
+
}
|
|
28466
28498
|
if (consumeUserHint) {
|
|
28467
28499
|
const userHint = consumeUserHint();
|
|
28468
28500
|
if (userHint && userHint.trim().length > 0) {
|
|
@@ -28472,16 +28504,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28472
28504
|
});
|
|
28473
28505
|
}
|
|
28474
28506
|
}
|
|
28475
|
-
const callIdsToMarkAsSubmitted = geminiTools.map(
|
|
28476
|
-
(toolCall) => toolCall.request.callId
|
|
28477
|
-
);
|
|
28478
28507
|
const prompt_ids = geminiTools.map(
|
|
28479
28508
|
(toolCall) => toolCall.request.prompt_id
|
|
28480
28509
|
);
|
|
28481
|
-
markToolsAsSubmitted(callIdsToMarkAsSubmitted);
|
|
28482
|
-
if (modelSwitchedFromQuotaError) {
|
|
28483
|
-
return;
|
|
28484
|
-
}
|
|
28485
28510
|
submitQuery(
|
|
28486
28511
|
responsesToSend,
|
|
28487
28512
|
{
|
|
@@ -28517,7 +28542,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28517
28542
|
return;
|
|
28518
28543
|
}
|
|
28519
28544
|
const restorableToolCalls = toolCalls.filter(
|
|
28520
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28545
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28521
28546
|
);
|
|
28522
28547
|
if (restorableToolCalls.length > 0) {
|
|
28523
28548
|
if (!gitService) {
|
|
@@ -28740,14 +28765,14 @@ var useAgentStream = ({
|
|
|
28740
28765
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28741
28766
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28742
28767
|
const desc = legacyState?.description ?? "";
|
|
28743
|
-
const fallbackKind =
|
|
28768
|
+
const fallbackKind = Kind.Other;
|
|
28744
28769
|
const newCall = {
|
|
28745
28770
|
callId: event.requestId,
|
|
28746
28771
|
name: displayName,
|
|
28747
28772
|
originalRequestName: event.name,
|
|
28748
28773
|
description: desc,
|
|
28749
28774
|
display: event.display,
|
|
28750
|
-
status:
|
|
28775
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28751
28776
|
isClientInitiated: false,
|
|
28752
28777
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28753
28778
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28765,10 +28790,10 @@ var useAgentStream = ({
|
|
|
28765
28790
|
const evtStatus = legacyState?.status;
|
|
28766
28791
|
let status = tc.status;
|
|
28767
28792
|
if (evtStatus === "executing")
|
|
28768
|
-
status =
|
|
28769
|
-
else if (evtStatus === "error") status =
|
|
28793
|
+
status = CoreToolCallStatus.Executing;
|
|
28794
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28770
28795
|
else if (evtStatus === "success")
|
|
28771
|
-
status =
|
|
28796
|
+
status = CoreToolCallStatus.Success;
|
|
28772
28797
|
const display = event.display?.result;
|
|
28773
28798
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28774
28799
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28801,7 +28826,7 @@ var useAgentStream = ({
|
|
|
28801
28826
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28802
28827
|
return {
|
|
28803
28828
|
...tc,
|
|
28804
|
-
status: event.isError ?
|
|
28829
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28805
28830
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28806
28831
|
resultDisplay,
|
|
28807
28832
|
outputFile
|
|
@@ -28867,7 +28892,7 @@ var useAgentStream = ({
|
|
|
28867
28892
|
if (!options?.isContinuation) {
|
|
28868
28893
|
if (typeof query === "string") {
|
|
28869
28894
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28870
|
-
void logger?.logMessage(
|
|
28895
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28871
28896
|
}
|
|
28872
28897
|
startNewPrompt();
|
|
28873
28898
|
}
|
|
@@ -30394,9 +30419,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30394
30419
|
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30395
30420
|
async (choice) => {
|
|
30396
30421
|
const trustLevelMap = {
|
|
30397
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30398
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30399
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
30422
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
30423
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
30424
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
30400
30425
|
};
|
|
30401
30426
|
const trustLevel = trustLevelMap[choice];
|
|
30402
30427
|
if (!trustLevel) return;
|
|
@@ -30415,7 +30440,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30415
30440
|
}, 100);
|
|
30416
30441
|
return;
|
|
30417
30442
|
}
|
|
30418
|
-
const currentIsTrusted = trustLevel ===
|
|
30443
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30419
30444
|
onTrustChange(currentIsTrusted);
|
|
30420
30445
|
setIsTrusted(currentIsTrusted);
|
|
30421
30446
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -31423,7 +31448,7 @@ function useMessageQueue({
|
|
|
31423
31448
|
var import_react107 = __toESM(require_react(), 1);
|
|
31424
31449
|
function useMcpStatus(config) {
|
|
31425
31450
|
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31426
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31451
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31427
31452
|
);
|
|
31428
31453
|
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31429
31454
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31436,12 +31461,12 @@ function useMcpStatus(config) {
|
|
|
31436
31461
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31437
31462
|
}
|
|
31438
31463
|
};
|
|
31439
|
-
coreEvents.on(
|
|
31464
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31440
31465
|
return () => {
|
|
31441
|
-
coreEvents.off(
|
|
31466
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31442
31467
|
};
|
|
31443
31468
|
}, [config]);
|
|
31444
|
-
const isMcpReady = discoveryState ===
|
|
31469
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31445
31470
|
return {
|
|
31446
31471
|
discoveryState,
|
|
31447
31472
|
mcpServerCount,
|
|
@@ -31468,7 +31493,7 @@ function useApprovalModeIndicator({
|
|
|
31468
31493
|
(key) => {
|
|
31469
31494
|
let nextApprovalMode;
|
|
31470
31495
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31471
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31496
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31472
31497
|
if (addItem) {
|
|
31473
31498
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31474
31499
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31486,21 +31511,21 @@ function useApprovalModeIndicator({
|
|
|
31486
31511
|
}
|
|
31487
31512
|
return;
|
|
31488
31513
|
}
|
|
31489
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31514
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31490
31515
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31491
31516
|
const currentMode = config.getApprovalMode();
|
|
31492
31517
|
switch (currentMode) {
|
|
31493
|
-
case
|
|
31494
|
-
nextApprovalMode =
|
|
31518
|
+
case ApprovalMode.DEFAULT:
|
|
31519
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31495
31520
|
break;
|
|
31496
|
-
case
|
|
31497
|
-
nextApprovalMode = allowPlanMode ?
|
|
31521
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31522
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31498
31523
|
break;
|
|
31499
|
-
case
|
|
31500
|
-
nextApprovalMode =
|
|
31524
|
+
case ApprovalMode.PLAN:
|
|
31525
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31501
31526
|
break;
|
|
31502
|
-
case
|
|
31503
|
-
nextApprovalMode =
|
|
31527
|
+
case ApprovalMode.YOLO:
|
|
31528
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31504
31529
|
break;
|
|
31505
31530
|
default:
|
|
31506
31531
|
}
|
|
@@ -31910,11 +31935,11 @@ var useHookDisplayState = () => {
|
|
|
31910
31935
|
removeHook();
|
|
31911
31936
|
}
|
|
31912
31937
|
};
|
|
31913
|
-
coreEvents.on(
|
|
31914
|
-
coreEvents.on(
|
|
31938
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
31939
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31915
31940
|
return () => {
|
|
31916
|
-
coreEvents.off(
|
|
31917
|
-
coreEvents.off(
|
|
31941
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
31942
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31918
31943
|
activeTimeouts.forEach(clearTimeout);
|
|
31919
31944
|
activeTimeouts.clear();
|
|
31920
31945
|
};
|
|
@@ -32753,7 +32778,7 @@ var AppContainer = (props) => {
|
|
|
32753
32778
|
setConfigInitialized(true);
|
|
32754
32779
|
startupProfiler.flush(config);
|
|
32755
32780
|
startAutoMemoryIfEnabled(config);
|
|
32756
|
-
const sessionStartSource = resumedSessionData ?
|
|
32781
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32757
32782
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32758
32783
|
if (result) {
|
|
32759
32784
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32780,7 +32805,7 @@ var AppContainer = (props) => {
|
|
|
32780
32805
|
);
|
|
32781
32806
|
const ideClient = await IdeClient.getInstance();
|
|
32782
32807
|
await ideClient.disconnect();
|
|
32783
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32808
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32784
32809
|
};
|
|
32785
32810
|
registerCleanup(cleanupFn);
|
|
32786
32811
|
return () => {
|
|
@@ -32805,11 +32830,11 @@ var AppContainer = (props) => {
|
|
|
32805
32830
|
resetTime: payload.resetTime
|
|
32806
32831
|
});
|
|
32807
32832
|
};
|
|
32808
|
-
coreEvents.on(
|
|
32809
|
-
coreEvents.on(
|
|
32833
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32834
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32810
32835
|
return () => {
|
|
32811
|
-
coreEvents.off(
|
|
32812
|
-
coreEvents.off(
|
|
32836
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32837
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32813
32838
|
};
|
|
32814
32839
|
}, [config]);
|
|
32815
32840
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32822,16 +32847,16 @@ var AppContainer = (props) => {
|
|
|
32822
32847
|
const handleAgentsDiscovered = (payload) => {
|
|
32823
32848
|
setNewAgents(payload.agents);
|
|
32824
32849
|
};
|
|
32825
|
-
coreEvents.on(
|
|
32826
|
-
coreEvents.on(
|
|
32827
|
-
coreEvents.on(
|
|
32850
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32851
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32852
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32828
32853
|
return () => {
|
|
32829
|
-
coreEvents.off(
|
|
32854
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32830
32855
|
coreEvents.off(
|
|
32831
|
-
|
|
32856
|
+
CoreEvent.AdminSettingsChanged,
|
|
32832
32857
|
handleAdminSettingsChanged
|
|
32833
32858
|
);
|
|
32834
|
-
coreEvents.off(
|
|
32859
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32835
32860
|
};
|
|
32836
32861
|
}, [settings]);
|
|
32837
32862
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32896,11 +32921,11 @@ var AppContainer = (props) => {
|
|
|
32896
32921
|
exitEditorDialog
|
|
32897
32922
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32898
32923
|
(0, import_react121.useEffect)(() => {
|
|
32899
|
-
coreEvents.on(
|
|
32900
|
-
coreEvents.on(
|
|
32924
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32925
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32901
32926
|
return () => {
|
|
32902
|
-
coreEvents.off(
|
|
32903
|
-
coreEvents.off(
|
|
32927
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32928
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32904
32929
|
};
|
|
32905
32930
|
}, [handleEditorClose, openEditorDialog]);
|
|
32906
32931
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32968,7 +32993,7 @@ var AppContainer = (props) => {
|
|
|
32968
32993
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
32969
32994
|
});
|
|
32970
32995
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
32971
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
32996
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
32972
32997
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
32973
32998
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
32974
32999
|
config,
|
|
@@ -32996,7 +33021,7 @@ var AppContainer = (props) => {
|
|
|
32996
33021
|
async (authType, scope) => {
|
|
32997
33022
|
if (authType) {
|
|
32998
33023
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
32999
|
-
if (authType ===
|
|
33024
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
33000
33025
|
setAuthContext({ requiresRestart: true });
|
|
33001
33026
|
} else {
|
|
33002
33027
|
setAuthContext({});
|
|
@@ -33024,7 +33049,7 @@ var AppContainer = (props) => {
|
|
|
33024
33049
|
);
|
|
33025
33050
|
return;
|
|
33026
33051
|
}
|
|
33027
|
-
if (authType ===
|
|
33052
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
33028
33053
|
writeToStdout(`
|
|
33029
33054
|
----------------------------------------------------------------
|
|
33030
33055
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -33047,7 +33072,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33047
33072
|
}
|
|
33048
33073
|
await saveApiKey(apiKey);
|
|
33049
33074
|
await reloadApiKey();
|
|
33050
|
-
await config.refreshAuth(
|
|
33075
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
33051
33076
|
setAuthState("authenticated" /* Authenticated */);
|
|
33052
33077
|
} catch (e) {
|
|
33053
33078
|
onAuthError(
|
|
@@ -33072,7 +33097,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33072
33097
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
33073
33098
|
);
|
|
33074
33099
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
33075
|
-
if (settings.merged.security.auth.selectedType ===
|
|
33100
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
33076
33101
|
return;
|
|
33077
33102
|
}
|
|
33078
33103
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -33208,9 +33233,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33208
33233
|
}
|
|
33209
33234
|
});
|
|
33210
33235
|
};
|
|
33211
|
-
coreEvents.on(
|
|
33236
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33212
33237
|
return () => {
|
|
33213
|
-
coreEvents.off(
|
|
33238
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33214
33239
|
};
|
|
33215
33240
|
}, []);
|
|
33216
33241
|
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
@@ -33868,7 +33893,7 @@ ${queuedText}` : queuedText;
|
|
|
33868
33893
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33869
33894
|
if (settings.merged.general.devtools) {
|
|
33870
33895
|
void (async () => {
|
|
33871
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33896
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-FCZAZ7OL.js");
|
|
33872
33897
|
await toggleDevToolsPanel(
|
|
33873
33898
|
config,
|
|
33874
33899
|
showErrorDetails,
|
|
@@ -34086,17 +34111,17 @@ ${queuedText}` : queuedText;
|
|
|
34086
34111
|
Date.now()
|
|
34087
34112
|
);
|
|
34088
34113
|
};
|
|
34089
|
-
coreEvents.on(
|
|
34090
|
-
coreEvents.on(
|
|
34114
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34115
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34091
34116
|
coreEvents.drainBacklogs();
|
|
34092
34117
|
return () => {
|
|
34093
|
-
coreEvents.off(
|
|
34094
|
-
coreEvents.off(
|
|
34118
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34119
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34095
34120
|
};
|
|
34096
34121
|
}, [historyManager]);
|
|
34097
34122
|
const nightly = props.version.includes("nightly");
|
|
34098
34123
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
34099
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
34124
|
+
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;
|
|
34100
34125
|
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;
|
|
34101
34126
|
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
34102
34127
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
@@ -34196,9 +34221,9 @@ ${queuedText}` : queuedText;
|
|
|
34196
34221
|
const handleMemoryChanged = (result) => {
|
|
34197
34222
|
setGeminiMdFileCount(result.fileCount);
|
|
34198
34223
|
};
|
|
34199
|
-
coreEvents.on(
|
|
34224
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34200
34225
|
return () => {
|
|
34201
|
-
coreEvents.off(
|
|
34226
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34202
34227
|
};
|
|
34203
34228
|
}, []);
|
|
34204
34229
|
(0, import_react121.useEffect)(() => {
|