@google/gemini-cli 0.60.0-preview.0 → 0.61.0-nightly.20260910.ged2ac40df
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-SZWITNYT.js → chunk-2QZM4LJN.js} +1 -1
- package/bundle/{chunk-ZX526LXA.js → chunk-3OTKJGN2.js} +7 -7
- package/bundle/{chunk-ZOCA7DR7.js → chunk-4GFDY7WB.js} +2 -2
- package/bundle/{chunk-JO3EXXPQ.js → chunk-53VIROYL.js} +1 -1
- package/bundle/{chunk-RY7G2LHR.js → chunk-5RBKI65Z.js} +1 -1
- package/bundle/{chunk-FZ5V6AOR.js → chunk-6SVZC6SZ.js} +1 -1
- package/bundle/{chunk-AS5HUHJQ.js → chunk-6TKDB4RW.js} +1 -1
- package/bundle/{chunk-WSRDZIEX.js → chunk-72RRXB4E.js} +8 -5
- package/bundle/{chunk-MHUSLH6Z.js → chunk-BFF47G2T.js} +67 -54
- package/bundle/{chunk-6JC2DFFV.js → chunk-CMP3WNPY.js} +7 -7
- package/bundle/{chunk-HSV5XF4Y.js → chunk-DHG4ARAF.js} +1 -1
- package/bundle/{chunk-3BBEM33B.js → chunk-G2HNVZYL.js} +1 -1
- package/bundle/{chunk-MNWBDZEW.js → chunk-GTUUXLUY.js} +1 -1
- package/bundle/{chunk-GXZJHUYG.js → chunk-KG5DGMJV.js} +3 -3
- package/bundle/{chunk-MOFAO64Q.js → chunk-KNYCFGTX.js} +1 -1
- package/bundle/{chunk-CJ3F2CF4.js → chunk-KZT23R5R.js} +2 -2
- package/bundle/{chunk-OXCETUAV.js → chunk-LNLXANUU.js} +9 -8
- package/bundle/chunk-MXKFKSG4.js +399011 -0
- package/bundle/chunk-OZHDMU2F.js +154 -0
- package/bundle/{chunk-VWG6RSQF.js → chunk-OZVST7GR.js} +3 -3
- package/bundle/{chunk-B35ENJ4E.js → chunk-PGLYJVDY.js} +2 -2
- package/bundle/chunk-Q5JCV3BH.js +17353 -0
- package/bundle/chunk-QU5RSCXN.js +512 -0
- package/bundle/chunk-QZJZIVUG.js +398 -0
- package/bundle/{chunk-KJ3DSGP6.js → chunk-RRFXRV32.js} +7 -7
- package/bundle/{chunk-Z3ZCNEN5.js → chunk-UBRBPMXX.js} +3 -3
- package/bundle/{chunk-CBLSL3EM.js → chunk-V2DJ3GMS.js} +1 -1
- package/bundle/{chunk-QKQP4OAM.js → chunk-V34DFXBX.js} +7748 -14586
- package/bundle/chunk-VRALRT3P.js +1571 -0
- package/bundle/{chunk-IIXMDKNQ.js → chunk-W5JPEXLZ.js} +7 -7
- package/bundle/chunk-XGFMBHG3.js +102670 -0
- package/bundle/chunk-YLYKYWW3.js +118 -0
- package/bundle/{cleanup-3NLZUFCB.js → cleanup-AK7434A7.js} +2 -2
- package/bundle/{cleanup-WA2HUZYP.js → cleanup-JTG5TRZP.js} +2 -2
- package/bundle/{cleanup-WSQUEKV4.js → cleanup-MJXZWPAB.js} +2 -2
- package/bundle/cleanup-W7HO5CNI.js +32 -0
- package/bundle/{core-X7B62CE3.js → core-TD3QT7YV.js} +1 -1
- package/bundle/{devtoolsService-IFCLCSNA.js → devtoolsService-BGFJ6VEB.js} +2 -2
- package/bundle/{devtoolsService-4UGAYGLM.js → devtoolsService-HZ4GVNIF.js} +2 -2
- package/bundle/{devtoolsService-77KBSPWB.js → devtoolsService-IEHCU262.js} +4 -3
- package/bundle/devtoolsService-MM4VAG36.js +4359 -0
- package/bundle/{dist-VKHG4X3B.js → dist-CVIHLQWK.js} +1 -1
- package/bundle/{core-25XEBKOQ.js → dist-LILFBCD6.js} +1 -1
- package/bundle/dist-S2NRVNNH.js +2216 -0
- package/bundle/docs/changelogs/index.md +12 -0
- package/bundle/docs/changelogs/latest.md +22 -32
- package/bundle/docs/changelogs/preview.md +54 -17
- package/bundle/{gemini-4L7IGTB3.js → gemini-JE6ATRM2.js} +14 -14
- package/bundle/{gemini-MPHWQGRY.js → gemini-UAYFDFHZ.js} +214 -198
- package/bundle/{gemini-CXRDUIMP.js → gemini-ZMC7Y4M5.js} +14 -14
- package/bundle/gemini-ZYZPV75S.js +17432 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-JODN5SQN.js → interactiveCli-CDZPTKWD.js} +8 -8
- package/bundle/{interactiveCli-DVEN62HN.js → interactiveCli-CINZJAW3.js} +315 -296
- package/bundle/{interactiveCli-RJOWMONA.js → interactiveCli-DPNMRBAJ.js} +8 -8
- package/bundle/interactiveCli-SHWIRB7J.js +34983 -0
- package/bundle/{liteRtServerManager-4SSYZUK3.js → liteRtServerManager-2HEYKFZ4.js} +4 -4
- package/bundle/{liteRtServerManager-M3O7V7NG.js → liteRtServerManager-CIEEHOLV.js} +4 -4
- package/bundle/{liteRtServerManager-2BNWXU4Z.js → liteRtServerManager-DTHM5I53.js} +4 -4
- package/bundle/liteRtServerManager-YKNVLCAP.js +65 -0
- package/bundle/{oauth2-provider-AB6H7OQC.js → oauth2-provider-4A2OGPBN.js} +1 -1
- package/bundle/{oauth2-provider-4YN5U44E.js → oauth2-provider-NOMBCN3D.js} +38 -72
- package/bundle/oauth2-provider-T6KKWELC.js +235 -0
- package/bundle/{oauth2-provider-RN6EIMPY.js → oauth2-provider-UMQ4PPFM.js} +1 -1
- package/bundle/{start-GCL5I7SK.js → start-CVRMCPJA.js} +6 -6
- package/bundle/{start-S3YRO6NU.js → start-JPSB6LGS.js} +6 -6
- package/bundle/{start-26ICYOUJ.js → start-M4RCGGY7.js} +6 -6
- package/bundle/start-PQKM3CTE.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-BFF47G2T.js";
|
|
161
161
|
import {
|
|
162
162
|
require_source
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-VRALRT3P.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-5RBKI65Z.js";
|
|
218
218
|
import {
|
|
219
219
|
handleAutoUpdate,
|
|
220
220
|
isDevelopment,
|
|
221
221
|
relaunchApp,
|
|
222
222
|
setUpdateHandler
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-KZT23R5R.js";
|
|
224
224
|
import {
|
|
225
225
|
isTodoList,
|
|
226
226
|
mapCoreStatusToDisplayStatus,
|
|
227
227
|
require_react
|
|
228
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-QU5RSCXN.js";
|
|
229
229
|
import {
|
|
230
230
|
registerCleanup,
|
|
231
231
|
removeCleanup,
|
|
232
232
|
runExitCleanup,
|
|
233
233
|
setupTtyCheck
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-53VIROYL.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-V34DFXBX.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
|
}
|
|
@@ -15511,11 +15530,11 @@ var PrivacyNoticeText = ({
|
|
|
15511
15530
|
}) => {
|
|
15512
15531
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15513
15532
|
switch (authType) {
|
|
15514
|
-
case
|
|
15533
|
+
case AuthType.USE_GEMINI:
|
|
15515
15534
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15516
|
-
case
|
|
15535
|
+
case AuthType.USE_VERTEX_AI:
|
|
15517
15536
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15518
|
-
case
|
|
15537
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15519
15538
|
default:
|
|
15520
15539
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15521
15540
|
}
|
|
@@ -15575,7 +15594,7 @@ function ProQuotaDialog({
|
|
|
15575
15594
|
value: "retry_always",
|
|
15576
15595
|
key: "retry_always"
|
|
15577
15596
|
},
|
|
15578
|
-
...authType ===
|
|
15597
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15579
15598
|
{
|
|
15580
15599
|
label: "Upgrade for higher limits",
|
|
15581
15600
|
value: "upgrade",
|
|
@@ -16734,7 +16753,7 @@ function ModelDialog({ onClose }) {
|
|
|
16734
16753
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
16735
16754
|
const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
|
|
16736
16755
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16737
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16756
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16738
16757
|
const manualModelSelected = (0, import_react55.useMemo)(() => {
|
|
16739
16758
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16740
16759
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -18058,10 +18077,10 @@ function initializeConsoleStore() {
|
|
|
18058
18077
|
globalConsoleMessages = [];
|
|
18059
18078
|
globalErrorCount = 0;
|
|
18060
18079
|
notifyListeners();
|
|
18061
|
-
coreEvents.off(
|
|
18062
|
-
coreEvents.off(
|
|
18063
|
-
coreEvents.on(
|
|
18064
|
-
coreEvents.on(
|
|
18080
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18081
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
18082
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18083
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
18065
18084
|
}
|
|
18066
18085
|
function notifyListeners() {
|
|
18067
18086
|
for (const listener of listeners) {
|
|
@@ -20198,7 +20217,7 @@ function usePromptCompletion({
|
|
|
20198
20217
|
{ model: "prompt-completion" },
|
|
20199
20218
|
contents,
|
|
20200
20219
|
signal,
|
|
20201
|
-
|
|
20220
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20202
20221
|
);
|
|
20203
20222
|
if (signal.aborted) {
|
|
20204
20223
|
return;
|
|
@@ -22270,9 +22289,9 @@ var InputPrompt = ({
|
|
|
22270
22289
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22271
22290
|
}
|
|
22272
22291
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22273
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22274
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22275
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22292
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22293
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22294
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22276
22295
|
let statusColor;
|
|
22277
22296
|
let statusText = "";
|
|
22278
22297
|
if (shellModeActive) {
|
|
@@ -23105,22 +23124,22 @@ var ApprovalModeIndicator = ({
|
|
|
23105
23124
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
23106
23125
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
23107
23126
|
switch (approvalMode) {
|
|
23108
|
-
case
|
|
23127
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23109
23128
|
textColor = theme.status.warning;
|
|
23110
23129
|
textContent = "auto-accept edits";
|
|
23111
23130
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23112
23131
|
break;
|
|
23113
|
-
case
|
|
23132
|
+
case ApprovalMode.PLAN:
|
|
23114
23133
|
textColor = theme.status.success;
|
|
23115
23134
|
textContent = "plan";
|
|
23116
23135
|
subText = `${cycleHint} to manual`;
|
|
23117
23136
|
break;
|
|
23118
|
-
case
|
|
23137
|
+
case ApprovalMode.YOLO:
|
|
23119
23138
|
textColor = theme.status.error;
|
|
23120
23139
|
textContent = "YOLO";
|
|
23121
23140
|
subText = yoloHint;
|
|
23122
23141
|
break;
|
|
23123
|
-
case
|
|
23142
|
+
case ApprovalMode.DEFAULT:
|
|
23124
23143
|
default:
|
|
23125
23144
|
textColor = theme.text.accent;
|
|
23126
23145
|
textContent = "";
|
|
@@ -23168,7 +23187,7 @@ var useComposerStatus = () => {
|
|
|
23168
23187
|
(item) => item.type === "tool_group"
|
|
23169
23188
|
).some(
|
|
23170
23189
|
(item) => item.tools.some(
|
|
23171
|
-
(tool) => tool.status ===
|
|
23190
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23172
23191
|
)
|
|
23173
23192
|
),
|
|
23174
23193
|
[uiState.pendingHistoryItems]
|
|
@@ -23183,13 +23202,13 @@ var useComposerStatus = () => {
|
|
|
23183
23202
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23184
23203
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23185
23204
|
switch (showApprovalModeIndicator) {
|
|
23186
|
-
case
|
|
23205
|
+
case ApprovalMode.YOLO:
|
|
23187
23206
|
return { text: "YOLO", color: theme.status.error };
|
|
23188
|
-
case
|
|
23207
|
+
case ApprovalMode.PLAN:
|
|
23189
23208
|
return { text: "plan", color: theme.status.success };
|
|
23190
|
-
case
|
|
23209
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23191
23210
|
return { text: "auto edit", color: theme.status.warning };
|
|
23192
|
-
case
|
|
23211
|
+
case ApprovalMode.DEFAULT:
|
|
23193
23212
|
default:
|
|
23194
23213
|
return null;
|
|
23195
23214
|
}
|
|
@@ -23543,7 +23562,7 @@ var ConfigInitDisplay = ({
|
|
|
23543
23562
|
let connected = 0;
|
|
23544
23563
|
const connecting = [];
|
|
23545
23564
|
for (const [name, client] of clients.entries()) {
|
|
23546
|
-
if (client.getStatus() ===
|
|
23565
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23547
23566
|
connected++;
|
|
23548
23567
|
} else {
|
|
23549
23568
|
connecting.push(name);
|
|
@@ -23565,9 +23584,9 @@ var ConfigInitDisplay = ({
|
|
|
23565
23584
|
);
|
|
23566
23585
|
}
|
|
23567
23586
|
};
|
|
23568
|
-
coreEvents.on(
|
|
23587
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23569
23588
|
return () => {
|
|
23570
|
-
coreEvents.off(
|
|
23589
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23571
23590
|
};
|
|
23572
23591
|
}, [initialMessage]);
|
|
23573
23592
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
|
|
@@ -24284,7 +24303,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24284
24303
|
callId,
|
|
24285
24304
|
name: SHELL_COMMAND_NAME,
|
|
24286
24305
|
description: rawQuery,
|
|
24287
|
-
status:
|
|
24306
|
+
status: CoreToolCallStatus.Executing,
|
|
24288
24307
|
isClientInitiated: true,
|
|
24289
24308
|
resultDisplay: "",
|
|
24290
24309
|
confirmationDetails: void 0
|
|
@@ -24425,7 +24444,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24425
24444
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24426
24445
|
}
|
|
24427
24446
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24428
|
-
let finalStatus =
|
|
24447
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24429
24448
|
const prependToAnsiOutput = (output, text) => {
|
|
24430
24449
|
const newLines = text.split("\n").map((line) => [
|
|
24431
24450
|
{
|
|
@@ -24444,20 +24463,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24444
24463
|
};
|
|
24445
24464
|
let prefix = "";
|
|
24446
24465
|
if (result.error) {
|
|
24447
|
-
finalStatus =
|
|
24466
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24448
24467
|
prefix = result.error.message;
|
|
24449
24468
|
} else if (result.aborted) {
|
|
24450
|
-
finalStatus =
|
|
24469
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24451
24470
|
prefix = "Command was cancelled.";
|
|
24452
24471
|
} else if (result.backgrounded) {
|
|
24453
|
-
finalStatus =
|
|
24472
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24454
24473
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24455
24474
|
mainContent = finalOutput;
|
|
24456
24475
|
} else if (result.signal) {
|
|
24457
|
-
finalStatus =
|
|
24476
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24458
24477
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24459
24478
|
} else if (result.exitCode !== 0) {
|
|
24460
|
-
finalStatus =
|
|
24479
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24461
24480
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24462
24481
|
}
|
|
24463
24482
|
if (prefix) {
|
|
@@ -24483,7 +24502,7 @@ ${mainContent}`;
|
|
|
24483
24502
|
status: finalStatus,
|
|
24484
24503
|
resultDisplay: finalOutput
|
|
24485
24504
|
};
|
|
24486
|
-
if (finalStatus !==
|
|
24505
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24487
24506
|
addItemToHistory(
|
|
24488
24507
|
{
|
|
24489
24508
|
type: "tool_group",
|
|
@@ -25493,13 +25512,13 @@ function useQuotaAndFallback({
|
|
|
25493
25512
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25494
25513
|
`/stats model for usage details`,
|
|
25495
25514
|
`/model to switch models.`,
|
|
25496
|
-
contentGeneratorConfig?.authType ===
|
|
25515
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25497
25516
|
].filter(Boolean);
|
|
25498
25517
|
message = messageLines.join("\n");
|
|
25499
25518
|
}
|
|
25500
25519
|
} else if (error instanceof ModelNotFoundError) {
|
|
25501
25520
|
isModelNotFoundError = true;
|
|
25502
|
-
if (contentGeneratorConfig?.authType ===
|
|
25521
|
+
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
25503
25522
|
const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
|
|
25504
25523
|
const messageLines = [
|
|
25505
25524
|
`Model "${failedModel}" is not available in region "${location}".`,
|
|
@@ -25693,7 +25712,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25693
25712
|
);
|
|
25694
25713
|
setEditorError(null);
|
|
25695
25714
|
setIsEditorDialogOpen(false);
|
|
25696
|
-
coreEvents.emit(
|
|
25715
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25697
25716
|
} catch (error) {
|
|
25698
25717
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25699
25718
|
}
|
|
@@ -25702,7 +25721,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25702
25721
|
);
|
|
25703
25722
|
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25704
25723
|
setIsEditorDialogOpen(false);
|
|
25705
|
-
coreEvents.emit(
|
|
25724
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25706
25725
|
}, []);
|
|
25707
25726
|
return {
|
|
25708
25727
|
isEditorDialogOpen,
|
|
@@ -26079,7 +26098,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26079
26098
|
canonicalPath: resolvedCommandPath
|
|
26080
26099
|
} = parseSlashCommand(trimmed, commands);
|
|
26081
26100
|
if (!commandToExecute) {
|
|
26082
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
26101
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
26083
26102
|
if (isMcpLoading) {
|
|
26084
26103
|
setIsProcessing(true);
|
|
26085
26104
|
if (addToHistory) {
|
|
@@ -26259,7 +26278,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26259
26278
|
onConfirm: async (resolvedOutcome) => {
|
|
26260
26279
|
resolve3({
|
|
26261
26280
|
outcome: resolvedOutcome,
|
|
26262
|
-
approvedCommands: resolvedOutcome ===
|
|
26281
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26263
26282
|
});
|
|
26264
26283
|
}
|
|
26265
26284
|
};
|
|
@@ -26267,7 +26286,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26267
26286
|
callId,
|
|
26268
26287
|
name: "Expansion",
|
|
26269
26288
|
description: "Command expansion needs shell access",
|
|
26270
|
-
status:
|
|
26289
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26271
26290
|
isClientInitiated: true,
|
|
26272
26291
|
resultDisplay: void 0,
|
|
26273
26292
|
confirmationDetails
|
|
@@ -26278,7 +26297,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26278
26297
|
});
|
|
26279
26298
|
});
|
|
26280
26299
|
setPendingItem(null);
|
|
26281
|
-
if (outcome ===
|
|
26300
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26282
26301
|
addItem(
|
|
26283
26302
|
{
|
|
26284
26303
|
type: "info" /* INFO */,
|
|
@@ -26288,7 +26307,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26288
26307
|
);
|
|
26289
26308
|
return { type: "handled" };
|
|
26290
26309
|
}
|
|
26291
|
-
if (outcome ===
|
|
26310
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26292
26311
|
setSessionShellAllowlist(
|
|
26293
26312
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26294
26313
|
);
|
|
@@ -26764,7 +26783,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26764
26783
|
let description;
|
|
26765
26784
|
let renderOutputAsMarkdown = false;
|
|
26766
26785
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26767
|
-
if (call.status ===
|
|
26786
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26768
26787
|
description = JSON.stringify(call.request.args);
|
|
26769
26788
|
} else {
|
|
26770
26789
|
description = call.invocation.getDescription();
|
|
@@ -26787,27 +26806,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26787
26806
|
let progress = void 0;
|
|
26788
26807
|
let progressTotal = void 0;
|
|
26789
26808
|
switch (call.status) {
|
|
26790
|
-
case
|
|
26809
|
+
case CoreToolCallStatus.Success:
|
|
26791
26810
|
resultDisplay = call.response.resultDisplay;
|
|
26792
26811
|
outputFile = call.response.outputFile;
|
|
26793
26812
|
break;
|
|
26794
|
-
case
|
|
26795
|
-
case
|
|
26813
|
+
case CoreToolCallStatus.Error:
|
|
26814
|
+
case CoreToolCallStatus.Cancelled:
|
|
26796
26815
|
resultDisplay = call.response.resultDisplay;
|
|
26797
26816
|
break;
|
|
26798
|
-
case
|
|
26817
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26799
26818
|
correlationId = call.correlationId;
|
|
26800
26819
|
confirmationDetails = call.confirmationDetails;
|
|
26801
26820
|
break;
|
|
26802
|
-
case
|
|
26821
|
+
case CoreToolCallStatus.Executing:
|
|
26803
26822
|
resultDisplay = call.liveOutput;
|
|
26804
26823
|
ptyId = call.pid;
|
|
26805
26824
|
progressMessage = call.progressMessage;
|
|
26806
26825
|
progress = call.progress;
|
|
26807
26826
|
progressTotal = call.progressTotal;
|
|
26808
26827
|
break;
|
|
26809
|
-
case
|
|
26810
|
-
case
|
|
26828
|
+
case CoreToolCallStatus.Scheduled:
|
|
26829
|
+
case CoreToolCallStatus.Validating:
|
|
26811
26830
|
break;
|
|
26812
26831
|
default: {
|
|
26813
26832
|
const exhaustiveCheck = call;
|
|
@@ -26878,7 +26897,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26878
26897
|
const handler = (event) => {
|
|
26879
26898
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26880
26899
|
const hasExecuting = event.toolCalls.some(
|
|
26881
|
-
(tc) => tc.status ===
|
|
26900
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26882
26901
|
);
|
|
26883
26902
|
if (hasExecuting) {
|
|
26884
26903
|
setLastToolOutputTime(Date.now());
|
|
@@ -26887,7 +26906,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26887
26906
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26888
26907
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26889
26908
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26890
|
-
(tc) => tc.status ===
|
|
26909
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26891
26910
|
);
|
|
26892
26911
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26893
26912
|
return prev;
|
|
@@ -26899,9 +26918,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26899
26918
|
};
|
|
26900
26919
|
});
|
|
26901
26920
|
};
|
|
26902
|
-
messageBus.subscribe(
|
|
26921
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26903
26922
|
return () => {
|
|
26904
|
-
messageBus.unsubscribe(
|
|
26923
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26905
26924
|
};
|
|
26906
26925
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26907
26926
|
(0, import_react98.useEffect)(() => {
|
|
@@ -26923,9 +26942,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26923
26942
|
};
|
|
26924
26943
|
});
|
|
26925
26944
|
};
|
|
26926
|
-
messageBus.subscribe(
|
|
26945
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26927
26946
|
return () => {
|
|
26928
|
-
messageBus.unsubscribe(
|
|
26947
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26929
26948
|
};
|
|
26930
26949
|
}, [messageBus]);
|
|
26931
26950
|
const schedule = (0, import_react98.useCallback)(
|
|
@@ -27024,8 +27043,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
27024
27043
|
const prev = prevMap.get(coreCall.request.callId);
|
|
27025
27044
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
27026
27045
|
let status = coreCall.status;
|
|
27027
|
-
if ((status ===
|
|
27028
|
-
status =
|
|
27046
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
27047
|
+
status = CoreToolCallStatus.Executing;
|
|
27029
27048
|
}
|
|
27030
27049
|
return {
|
|
27031
27050
|
...coreCall,
|
|
@@ -27057,7 +27076,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
27057
27076
|
};
|
|
27058
27077
|
}
|
|
27059
27078
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
27060
|
-
return toolCall.status ===
|
|
27079
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
27061
27080
|
}
|
|
27062
27081
|
function showCitations(settings) {
|
|
27063
27082
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -27067,14 +27086,14 @@ function showCitations(settings) {
|
|
|
27067
27086
|
return true;
|
|
27068
27087
|
}
|
|
27069
27088
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
27070
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
27089
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
27071
27090
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
27072
27091
|
}
|
|
27073
27092
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
27074
|
-
if (tc.status ===
|
|
27093
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
27075
27094
|
return true;
|
|
27076
27095
|
}
|
|
27077
|
-
if (tc.status ===
|
|
27096
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
27078
27097
|
return !tc.responseSubmittedToGemini;
|
|
27079
27098
|
}
|
|
27080
27099
|
return false;
|
|
@@ -27121,9 +27140,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27121
27140
|
}
|
|
27122
27141
|
setRetryStatus(payload);
|
|
27123
27142
|
};
|
|
27124
|
-
coreEvents.on(
|
|
27143
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27125
27144
|
return () => {
|
|
27126
|
-
coreEvents.off(
|
|
27145
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27127
27146
|
};
|
|
27128
27147
|
}, [isRespondingRef]);
|
|
27129
27148
|
const [
|
|
@@ -27256,12 +27275,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27256
27275
|
const tc = toolCalls[i];
|
|
27257
27276
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27258
27277
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27259
|
-
const isAgent = tc.tool?.kind ===
|
|
27278
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27260
27279
|
if (isAgent) {
|
|
27261
27280
|
let contigAgentsComplete = true;
|
|
27262
27281
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27263
27282
|
const nextTc = toolCalls[j];
|
|
27264
|
-
if (nextTc.tool?.kind ===
|
|
27283
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27265
27284
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27266
27285
|
contigAgentsComplete = false;
|
|
27267
27286
|
break;
|
|
@@ -27287,7 +27306,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27287
27306
|
let currentGroup = [];
|
|
27288
27307
|
for (const tc of toolsToPush) {
|
|
27289
27308
|
newPushed.add(tc.request.callId);
|
|
27290
|
-
if (tc.tool?.kind ===
|
|
27309
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27291
27310
|
currentGroup.push(tc);
|
|
27292
27311
|
} else {
|
|
27293
27312
|
if (currentGroup.length > 0) {
|
|
@@ -27440,7 +27459,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27440
27459
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27441
27460
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27442
27461
|
(0, import_react99.useEffect)(() => {
|
|
27443
|
-
if (config.getApprovalMode() ===
|
|
27462
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27444
27463
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27445
27464
|
(item) => item.type === "user" /* USER */
|
|
27446
27465
|
);
|
|
@@ -27508,7 +27527,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27508
27527
|
return;
|
|
27509
27528
|
}
|
|
27510
27529
|
const hasActiveTools = toolCalls.some(
|
|
27511
|
-
(tc) => tc.status ===
|
|
27530
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27512
27531
|
);
|
|
27513
27532
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27514
27533
|
if (clearBuffer) {
|
|
@@ -27535,7 +27554,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27535
27554
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27536
27555
|
return {
|
|
27537
27556
|
...tool,
|
|
27538
|
-
status:
|
|
27557
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27539
27558
|
resultDisplay: tool.resultDisplay
|
|
27540
27559
|
};
|
|
27541
27560
|
}
|
|
@@ -27600,7 +27619,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27600
27619
|
let localQueryToSendToGemini = null;
|
|
27601
27620
|
if (typeof query === "string") {
|
|
27602
27621
|
const trimmedQuery = query.trim();
|
|
27603
|
-
await logger?.logMessage(
|
|
27622
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27604
27623
|
if (!shellModeActive) {
|
|
27605
27624
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27606
27625
|
if (slashCommandResult) {
|
|
@@ -27756,7 +27775,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27756
27775
|
if (pendingHistoryItemRef.current) {
|
|
27757
27776
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27758
27777
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27759
|
-
(tool) => tool.status ===
|
|
27778
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
27760
27779
|
);
|
|
27761
27780
|
const pendingItem = {
|
|
27762
27781
|
...pendingHistoryItemRef.current,
|
|
@@ -28048,15 +28067,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28048
28067
|
let geminiMessageBuffer = "";
|
|
28049
28068
|
const toolCallRequests = [];
|
|
28050
28069
|
for await (const event of stream) {
|
|
28051
|
-
if (event.type !==
|
|
28070
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
28052
28071
|
setThought(null);
|
|
28053
28072
|
}
|
|
28054
28073
|
switch (event.type) {
|
|
28055
|
-
case
|
|
28074
|
+
case GeminiEventType.Thought:
|
|
28056
28075
|
setLastGeminiActivityTime(Date.now());
|
|
28057
28076
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
28058
28077
|
break;
|
|
28059
|
-
case
|
|
28078
|
+
case GeminiEventType.Content:
|
|
28060
28079
|
setLastGeminiActivityTime(Date.now());
|
|
28061
28080
|
geminiMessageBuffer = handleContentEvent(
|
|
28062
28081
|
event.value,
|
|
@@ -28064,16 +28083,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28064
28083
|
userMessageTimestamp
|
|
28065
28084
|
);
|
|
28066
28085
|
break;
|
|
28067
|
-
case
|
|
28086
|
+
case GeminiEventType.ToolCallRequest:
|
|
28068
28087
|
toolCallRequests.push(event.value);
|
|
28069
28088
|
break;
|
|
28070
|
-
case
|
|
28089
|
+
case GeminiEventType.UserCancelled:
|
|
28071
28090
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
28072
28091
|
break;
|
|
28073
|
-
case
|
|
28092
|
+
case GeminiEventType.Error:
|
|
28074
28093
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
28075
28094
|
break;
|
|
28076
|
-
case
|
|
28095
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
28077
28096
|
handleAgentExecutionStoppedEvent(
|
|
28078
28097
|
event.value.reason,
|
|
28079
28098
|
userMessageTimestamp,
|
|
@@ -28081,7 +28100,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28081
28100
|
event.value.contextCleared
|
|
28082
28101
|
);
|
|
28083
28102
|
break;
|
|
28084
|
-
case
|
|
28103
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
28085
28104
|
handleAgentExecutionBlockedEvent(
|
|
28086
28105
|
event.value.reason,
|
|
28087
28106
|
userMessageTimestamp,
|
|
@@ -28089,36 +28108,36 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28089
28108
|
event.value.contextCleared
|
|
28090
28109
|
);
|
|
28091
28110
|
break;
|
|
28092
|
-
case
|
|
28111
|
+
case GeminiEventType.ChatCompressed:
|
|
28093
28112
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
28094
28113
|
break;
|
|
28095
|
-
case
|
|
28096
|
-
case
|
|
28114
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
28115
|
+
case GeminiEventType.ToolCallResponse:
|
|
28097
28116
|
break;
|
|
28098
|
-
case
|
|
28117
|
+
case GeminiEventType.MaxSessionTurns:
|
|
28099
28118
|
handleMaxSessionTurnsEvent();
|
|
28100
28119
|
break;
|
|
28101
|
-
case
|
|
28120
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
28102
28121
|
handleContextWindowWillOverflowEvent(
|
|
28103
28122
|
event.value.estimatedRequestTokenCount,
|
|
28104
28123
|
event.value.remainingTokenCount
|
|
28105
28124
|
);
|
|
28106
28125
|
break;
|
|
28107
|
-
case
|
|
28126
|
+
case GeminiEventType.Finished:
|
|
28108
28127
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
28109
28128
|
break;
|
|
28110
|
-
case
|
|
28129
|
+
case GeminiEventType.Citation:
|
|
28111
28130
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
28112
28131
|
break;
|
|
28113
|
-
case
|
|
28132
|
+
case GeminiEventType.ModelInfo:
|
|
28114
28133
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
28115
28134
|
break;
|
|
28116
|
-
case
|
|
28135
|
+
case GeminiEventType.LoopDetected:
|
|
28117
28136
|
loopDetectedRef.current = true;
|
|
28118
28137
|
break;
|
|
28119
|
-
case
|
|
28138
|
+
case GeminiEventType.Retry:
|
|
28120
28139
|
break;
|
|
28121
|
-
case
|
|
28140
|
+
case GeminiEventType.InvalidStream:
|
|
28122
28141
|
handleInvalidStreamEvent(event.value, userMessageTimestamp);
|
|
28123
28142
|
break;
|
|
28124
28143
|
default: {
|
|
@@ -28172,7 +28191,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28172
28191
|
const submitQuery = (0, import_react99.useCallback)(
|
|
28173
28192
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
28174
28193
|
{
|
|
28175
|
-
operation: options?.isContinuation ?
|
|
28194
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
28176
28195
|
sessionId: config.getSessionId()
|
|
28177
28196
|
},
|
|
28178
28197
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28339,7 +28358,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28339
28358
|
submitQueryRef.current = submitQuery;
|
|
28340
28359
|
const handleApprovalModeChange = (0, import_react99.useCallback)(
|
|
28341
28360
|
async (newApprovalMode) => {
|
|
28342
|
-
if (previousApprovalModeRef.current ===
|
|
28361
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28343
28362
|
if (geminiClient) {
|
|
28344
28363
|
try {
|
|
28345
28364
|
await geminiClient.addHistory({
|
|
@@ -28362,11 +28381,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28362
28381
|
}
|
|
28363
28382
|
}
|
|
28364
28383
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28365
|
-
if (newApprovalMode ===
|
|
28384
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28366
28385
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28367
28386
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28368
28387
|
);
|
|
28369
|
-
if (newApprovalMode ===
|
|
28388
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28370
28389
|
awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
|
|
28371
28390
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
28372
28391
|
return true;
|
|
@@ -28382,11 +28401,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28382
28401
|
if (call.correlationId) {
|
|
28383
28402
|
try {
|
|
28384
28403
|
await config.getMessageBus().publish({
|
|
28385
|
-
type:
|
|
28404
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28386
28405
|
correlationId: call.correlationId,
|
|
28387
28406
|
confirmed: true,
|
|
28388
28407
|
requiresUserConfirmation: false,
|
|
28389
|
-
outcome:
|
|
28408
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28390
28409
|
});
|
|
28391
28410
|
} catch (error) {
|
|
28392
28411
|
debugLogger.warn(
|
|
@@ -28477,14 +28496,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28477
28496
|
);
|
|
28478
28497
|
if (isLowErrorVerbosity) {
|
|
28479
28498
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28480
|
-
(tc) => tc.status ===
|
|
28499
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28481
28500
|
).length;
|
|
28482
28501
|
}
|
|
28483
28502
|
if (geminiTools.length === 0) {
|
|
28484
28503
|
return;
|
|
28485
28504
|
}
|
|
28486
28505
|
const stopExecutionTool = geminiTools.find(
|
|
28487
|
-
(tc) => tc.response.errorType ===
|
|
28506
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28488
28507
|
);
|
|
28489
28508
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28490
28509
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28504,9 +28523,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28504
28523
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28505
28524
|
);
|
|
28506
28525
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28507
|
-
(tc) => tc.status ===
|
|
28526
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28508
28527
|
);
|
|
28509
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28528
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28510
28529
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28511
28530
|
if (!turnCancelledRef.current) {
|
|
28512
28531
|
addItem({
|
|
@@ -28592,7 +28611,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28592
28611
|
return;
|
|
28593
28612
|
}
|
|
28594
28613
|
const restorableToolCalls = toolCalls.filter(
|
|
28595
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28614
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28596
28615
|
);
|
|
28597
28616
|
if (restorableToolCalls.length > 0) {
|
|
28598
28617
|
if (!gitService) {
|
|
@@ -28815,14 +28834,14 @@ var useAgentStream = ({
|
|
|
28815
28834
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28816
28835
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28817
28836
|
const desc = legacyState?.description ?? "";
|
|
28818
|
-
const fallbackKind =
|
|
28837
|
+
const fallbackKind = Kind.Other;
|
|
28819
28838
|
const newCall = {
|
|
28820
28839
|
callId: event.requestId,
|
|
28821
28840
|
name: displayName,
|
|
28822
28841
|
originalRequestName: event.name,
|
|
28823
28842
|
description: desc,
|
|
28824
28843
|
display: event.display,
|
|
28825
|
-
status:
|
|
28844
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28826
28845
|
isClientInitiated: false,
|
|
28827
28846
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28828
28847
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28840,10 +28859,10 @@ var useAgentStream = ({
|
|
|
28840
28859
|
const evtStatus = legacyState?.status;
|
|
28841
28860
|
let status = tc.status;
|
|
28842
28861
|
if (evtStatus === "executing")
|
|
28843
|
-
status =
|
|
28844
|
-
else if (evtStatus === "error") status =
|
|
28862
|
+
status = CoreToolCallStatus.Executing;
|
|
28863
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28845
28864
|
else if (evtStatus === "success")
|
|
28846
|
-
status =
|
|
28865
|
+
status = CoreToolCallStatus.Success;
|
|
28847
28866
|
const display = event.display?.result;
|
|
28848
28867
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28849
28868
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28876,7 +28895,7 @@ var useAgentStream = ({
|
|
|
28876
28895
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28877
28896
|
return {
|
|
28878
28897
|
...tc,
|
|
28879
|
-
status: event.isError ?
|
|
28898
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28880
28899
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28881
28900
|
resultDisplay,
|
|
28882
28901
|
outputFile
|
|
@@ -28942,7 +28961,7 @@ var useAgentStream = ({
|
|
|
28942
28961
|
if (!options?.isContinuation) {
|
|
28943
28962
|
if (typeof query === "string") {
|
|
28944
28963
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28945
|
-
void logger?.logMessage(
|
|
28964
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28946
28965
|
}
|
|
28947
28966
|
startNewPrompt();
|
|
28948
28967
|
}
|
|
@@ -30469,9 +30488,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30469
30488
|
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30470
30489
|
async (choice) => {
|
|
30471
30490
|
const trustLevelMap = {
|
|
30472
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30473
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30474
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
30491
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
30492
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
30493
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
30475
30494
|
};
|
|
30476
30495
|
const trustLevel = trustLevelMap[choice];
|
|
30477
30496
|
if (!trustLevel) return;
|
|
@@ -30490,7 +30509,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30490
30509
|
}, 100);
|
|
30491
30510
|
return;
|
|
30492
30511
|
}
|
|
30493
|
-
const currentIsTrusted = trustLevel ===
|
|
30512
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30494
30513
|
onTrustChange(currentIsTrusted);
|
|
30495
30514
|
setIsTrusted(currentIsTrusted);
|
|
30496
30515
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -31498,7 +31517,7 @@ function useMessageQueue({
|
|
|
31498
31517
|
var import_react107 = __toESM(require_react(), 1);
|
|
31499
31518
|
function useMcpStatus(config) {
|
|
31500
31519
|
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31501
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31520
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31502
31521
|
);
|
|
31503
31522
|
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31504
31523
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31511,12 +31530,12 @@ function useMcpStatus(config) {
|
|
|
31511
31530
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31512
31531
|
}
|
|
31513
31532
|
};
|
|
31514
|
-
coreEvents.on(
|
|
31533
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31515
31534
|
return () => {
|
|
31516
|
-
coreEvents.off(
|
|
31535
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31517
31536
|
};
|
|
31518
31537
|
}, [config]);
|
|
31519
|
-
const isMcpReady = discoveryState ===
|
|
31538
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31520
31539
|
return {
|
|
31521
31540
|
discoveryState,
|
|
31522
31541
|
mcpServerCount,
|
|
@@ -31543,7 +31562,7 @@ function useApprovalModeIndicator({
|
|
|
31543
31562
|
(key) => {
|
|
31544
31563
|
let nextApprovalMode;
|
|
31545
31564
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31546
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31565
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31547
31566
|
if (addItem) {
|
|
31548
31567
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31549
31568
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31561,21 +31580,21 @@ function useApprovalModeIndicator({
|
|
|
31561
31580
|
}
|
|
31562
31581
|
return;
|
|
31563
31582
|
}
|
|
31564
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31583
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31565
31584
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31566
31585
|
const currentMode = config.getApprovalMode();
|
|
31567
31586
|
switch (currentMode) {
|
|
31568
|
-
case
|
|
31569
|
-
nextApprovalMode =
|
|
31587
|
+
case ApprovalMode.DEFAULT:
|
|
31588
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31570
31589
|
break;
|
|
31571
|
-
case
|
|
31572
|
-
nextApprovalMode = allowPlanMode ?
|
|
31590
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31591
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31573
31592
|
break;
|
|
31574
|
-
case
|
|
31575
|
-
nextApprovalMode =
|
|
31593
|
+
case ApprovalMode.PLAN:
|
|
31594
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31576
31595
|
break;
|
|
31577
|
-
case
|
|
31578
|
-
nextApprovalMode =
|
|
31596
|
+
case ApprovalMode.YOLO:
|
|
31597
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31579
31598
|
break;
|
|
31580
31599
|
default:
|
|
31581
31600
|
}
|
|
@@ -31985,11 +32004,11 @@ var useHookDisplayState = () => {
|
|
|
31985
32004
|
removeHook();
|
|
31986
32005
|
}
|
|
31987
32006
|
};
|
|
31988
|
-
coreEvents.on(
|
|
31989
|
-
coreEvents.on(
|
|
32007
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
32008
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31990
32009
|
return () => {
|
|
31991
|
-
coreEvents.off(
|
|
31992
|
-
coreEvents.off(
|
|
32010
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
32011
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31993
32012
|
activeTimeouts.forEach(clearTimeout);
|
|
31994
32013
|
activeTimeouts.clear();
|
|
31995
32014
|
};
|
|
@@ -32828,7 +32847,7 @@ var AppContainer = (props) => {
|
|
|
32828
32847
|
setConfigInitialized(true);
|
|
32829
32848
|
startupProfiler.flush(config);
|
|
32830
32849
|
startAutoMemoryIfEnabled(config);
|
|
32831
|
-
const sessionStartSource = resumedSessionData ?
|
|
32850
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32832
32851
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32833
32852
|
if (result) {
|
|
32834
32853
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32855,7 +32874,7 @@ var AppContainer = (props) => {
|
|
|
32855
32874
|
);
|
|
32856
32875
|
const ideClient = await IdeClient.getInstance();
|
|
32857
32876
|
await ideClient.disconnect();
|
|
32858
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32877
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32859
32878
|
};
|
|
32860
32879
|
registerCleanup(cleanupFn);
|
|
32861
32880
|
return () => {
|
|
@@ -32880,11 +32899,11 @@ var AppContainer = (props) => {
|
|
|
32880
32899
|
resetTime: payload.resetTime
|
|
32881
32900
|
});
|
|
32882
32901
|
};
|
|
32883
|
-
coreEvents.on(
|
|
32884
|
-
coreEvents.on(
|
|
32902
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32903
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32885
32904
|
return () => {
|
|
32886
|
-
coreEvents.off(
|
|
32887
|
-
coreEvents.off(
|
|
32905
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32906
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32888
32907
|
};
|
|
32889
32908
|
}, [config]);
|
|
32890
32909
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32897,16 +32916,16 @@ var AppContainer = (props) => {
|
|
|
32897
32916
|
const handleAgentsDiscovered = (payload) => {
|
|
32898
32917
|
setNewAgents(payload.agents);
|
|
32899
32918
|
};
|
|
32900
|
-
coreEvents.on(
|
|
32901
|
-
coreEvents.on(
|
|
32902
|
-
coreEvents.on(
|
|
32919
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32920
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32921
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32903
32922
|
return () => {
|
|
32904
|
-
coreEvents.off(
|
|
32923
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32905
32924
|
coreEvents.off(
|
|
32906
|
-
|
|
32925
|
+
CoreEvent.AdminSettingsChanged,
|
|
32907
32926
|
handleAdminSettingsChanged
|
|
32908
32927
|
);
|
|
32909
|
-
coreEvents.off(
|
|
32928
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32910
32929
|
};
|
|
32911
32930
|
}, [settings]);
|
|
32912
32931
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32973,11 +32992,11 @@ var AppContainer = (props) => {
|
|
|
32973
32992
|
exitEditorDialog
|
|
32974
32993
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32975
32994
|
(0, import_react121.useEffect)(() => {
|
|
32976
|
-
coreEvents.on(
|
|
32977
|
-
coreEvents.on(
|
|
32995
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32996
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32978
32997
|
return () => {
|
|
32979
|
-
coreEvents.off(
|
|
32980
|
-
coreEvents.off(
|
|
32998
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32999
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32981
33000
|
};
|
|
32982
33001
|
}, [handleEditorClose, openEditorDialog]);
|
|
32983
33002
|
(0, import_react121.useEffect)(() => {
|
|
@@ -33045,7 +33064,7 @@ var AppContainer = (props) => {
|
|
|
33045
33064
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
33046
33065
|
});
|
|
33047
33066
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
33048
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
33067
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
33049
33068
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
33050
33069
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
33051
33070
|
config,
|
|
@@ -33073,7 +33092,7 @@ var AppContainer = (props) => {
|
|
|
33073
33092
|
async (authType, scope) => {
|
|
33074
33093
|
if (authType) {
|
|
33075
33094
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
33076
|
-
if (authType ===
|
|
33095
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
33077
33096
|
setAuthContext({ requiresRestart: true });
|
|
33078
33097
|
} else {
|
|
33079
33098
|
setAuthContext({});
|
|
@@ -33101,7 +33120,7 @@ var AppContainer = (props) => {
|
|
|
33101
33120
|
);
|
|
33102
33121
|
return;
|
|
33103
33122
|
}
|
|
33104
|
-
if (authType ===
|
|
33123
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
33105
33124
|
writeToStdout(`
|
|
33106
33125
|
----------------------------------------------------------------
|
|
33107
33126
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -33124,7 +33143,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33124
33143
|
}
|
|
33125
33144
|
await saveApiKey(apiKey);
|
|
33126
33145
|
await reloadApiKey();
|
|
33127
|
-
await config.refreshAuth(
|
|
33146
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
33128
33147
|
setAuthState("authenticated" /* Authenticated */);
|
|
33129
33148
|
} catch (e) {
|
|
33130
33149
|
onAuthError(
|
|
@@ -33149,7 +33168,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33149
33168
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
33150
33169
|
);
|
|
33151
33170
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
33152
|
-
if (settings.merged.security.auth.selectedType ===
|
|
33171
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
33153
33172
|
return;
|
|
33154
33173
|
}
|
|
33155
33174
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -33285,9 +33304,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33285
33304
|
}
|
|
33286
33305
|
});
|
|
33287
33306
|
};
|
|
33288
|
-
coreEvents.on(
|
|
33307
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33289
33308
|
return () => {
|
|
33290
|
-
coreEvents.off(
|
|
33309
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33291
33310
|
};
|
|
33292
33311
|
}, []);
|
|
33293
33312
|
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
@@ -33945,7 +33964,7 @@ ${queuedText}` : queuedText;
|
|
|
33945
33964
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33946
33965
|
if (settings.merged.general.devtools) {
|
|
33947
33966
|
void (async () => {
|
|
33948
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33967
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-BGFJ6VEB.js");
|
|
33949
33968
|
await toggleDevToolsPanel(
|
|
33950
33969
|
config,
|
|
33951
33970
|
showErrorDetails,
|
|
@@ -34163,17 +34182,17 @@ ${queuedText}` : queuedText;
|
|
|
34163
34182
|
Date.now()
|
|
34164
34183
|
);
|
|
34165
34184
|
};
|
|
34166
|
-
coreEvents.on(
|
|
34167
|
-
coreEvents.on(
|
|
34185
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34186
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34168
34187
|
coreEvents.drainBacklogs();
|
|
34169
34188
|
return () => {
|
|
34170
|
-
coreEvents.off(
|
|
34171
|
-
coreEvents.off(
|
|
34189
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34190
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34172
34191
|
};
|
|
34173
34192
|
}, [historyManager]);
|
|
34174
34193
|
const nightly = props.version.includes("nightly");
|
|
34175
34194
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
34176
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
34195
|
+
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;
|
|
34177
34196
|
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;
|
|
34178
34197
|
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
34179
34198
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
@@ -34273,9 +34292,9 @@ ${queuedText}` : queuedText;
|
|
|
34273
34292
|
const handleMemoryChanged = (result) => {
|
|
34274
34293
|
setGeminiMdFileCount(result.fileCount);
|
|
34275
34294
|
};
|
|
34276
|
-
coreEvents.on(
|
|
34295
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34277
34296
|
return () => {
|
|
34278
|
-
coreEvents.off(
|
|
34297
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34279
34298
|
};
|
|
34280
34299
|
}, []);
|
|
34281
34300
|
(0, import_react121.useEffect)(() => {
|