@google/gemini-cli 0.56.0 → 0.57.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/builtin/antigravity-support/SKILL.md +55 -18
- package/bundle/builtin/skill-creator/SKILL.md +221 -84
- package/bundle/{chunk-3KYPKZPU.js → chunk-3BVBON3V.js} +1 -1
- package/bundle/{chunk-DGFXNTHD.js → chunk-3NPMAHLX.js} +1 -1
- package/bundle/{chunk-IG5K7R25.js → chunk-4ALCU2HQ.js} +1 -1
- package/bundle/{chunk-ISEPPPFO.js → chunk-4SNEOO5E.js} +2 -2
- package/bundle/{chunk-CNSLGANE.js → chunk-65C235NM.js} +10 -9
- package/bundle/{chunk-R34LMPUE.js → chunk-AKCYXG7C.js} +10 -9
- package/bundle/{chunk-C5FHWCAU.js → chunk-ALVDOQNA.js} +1 -1
- package/bundle/{chunk-3YGHKCB7.js → chunk-EAK33LFP.js} +1 -1
- package/bundle/{chunk-7IXYIWSX.js → chunk-FHDRG5U4.js} +70 -56
- package/bundle/{chunk-LZUWGCRJ.js → chunk-G65GW52B.js} +1708 -1352
- package/bundle/{chunk-KUIZDCN6.js → chunk-GK7NUJ35.js} +8 -5
- package/bundle/{chunk-VBIDFL63.js → chunk-GMQ6QNZB.js} +1 -1
- package/bundle/chunk-LNXGFWGZ.js +17332 -0
- package/bundle/{chunk-TV27OEQP.js → chunk-MBWROXYM.js} +2 -2
- package/bundle/{chunk-M6D6BI7B.js → chunk-NMMXRZ53.js} +2 -2
- package/bundle/{chunk-NUVMJEWM.js → chunk-NPOI4K6X.js} +9291 -15583
- package/bundle/{chunk-435NYDJB.js → chunk-NQ4RH42O.js} +9 -8
- package/bundle/{chunk-MYCBWRZE.js → chunk-O7SBKM7M.js} +1770 -1378
- package/bundle/{chunk-HAZMOWRC.js → chunk-Q73BPF7A.js} +1 -1
- package/bundle/{chunk-Y3KSGWY2.js → chunk-QJP6CMLN.js} +3 -3
- package/bundle/{chunk-BIPFNROE.js → chunk-RLDNUS35.js} +1 -1
- package/bundle/{chunk-ZXYNNAXR.js → chunk-S5UX3QS5.js} +3 -3
- package/bundle/{chunk-Y734TK7O.js → chunk-SCBVGZXH.js} +1 -1
- package/bundle/chunk-SWQAIZEQ.js +102506 -0
- package/bundle/{chunk-MKKOABMJ.js → chunk-UMQE7UC6.js} +3 -3
- package/bundle/{chunk-JFVPVDW6.js → chunk-VBK54QCZ.js} +1 -1
- package/bundle/chunk-VGGWKRAC.js +154 -0
- package/bundle/chunk-W23OOD2C.js +118 -0
- package/bundle/chunk-WDFSF5L4.js +397601 -0
- package/bundle/chunk-XESAM7IL.js +512 -0
- package/bundle/chunk-Y3APL4PE.js +1571 -0
- package/bundle/chunk-ZMPGHLGO.js +398 -0
- package/bundle/{cleanup-IZHI7N6V.js → cleanup-2W5DPMY3.js} +2 -2
- package/bundle/{cleanup-JZLQPF2L.js → cleanup-OTHE7RNU.js} +2 -2
- package/bundle/{cleanup-LJAAR5DT.js → cleanup-SM67K64R.js} +2 -2
- package/bundle/cleanup-XAUT5CMD.js +32 -0
- package/bundle/{core-TJ2XBV6Y.js → core-US34OW5M.js} +9 -1
- package/bundle/{devtoolsService-KFURCXJN.js → devtoolsService-5J53UK6Z.js} +2 -2
- package/bundle/{devtoolsService-BFW3BN3D.js → devtoolsService-GU2GQSOF.js} +2 -2
- package/bundle/{devtoolsService-NWA77XKC.js → devtoolsService-JBFUXTCT.js} +4 -3
- package/bundle/devtoolsService-V46GUHRF.js +4359 -0
- package/bundle/{dist-7KO3HJ4C.js → dist-5TYMQVIZ.js} +9 -1
- package/bundle/{core-BQJQAXVF.js → dist-OWKHVWTR.js} +9 -1
- package/bundle/dist-V5VJYW6J.js +2180 -0
- package/bundle/docs/changelogs/latest.md +224 -3
- package/bundle/docs/get-started/authentication.mdx +1 -1
- package/bundle/docs/reference/commands.md +7 -5
- package/bundle/{gemini-54R2PJOR.js → gemini-3M22N2C3.js} +19 -16
- package/bundle/{gemini-KK7AERSF.js → gemini-LSMTDETS.js} +19 -16
- package/bundle/{gemini-2RHAL2LS.js → gemini-OZOYJF22.js} +219 -200
- package/bundle/gemini-W2B6CLJC.js +17091 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-QBZRIN4M.js → interactiveCli-D6H37PJQ.js} +60 -30
- package/bundle/{interactiveCli-BAGEJ4VO.js → interactiveCli-L3ZXOVEV.js} +367 -318
- package/bundle/{interactiveCli-F5YXG24U.js → interactiveCli-LQJM6LRE.js} +60 -30
- package/bundle/interactiveCli-RGOYDSMH.js +34984 -0
- package/bundle/{liteRtServerManager-CYBHL4LH.js → liteRtServerManager-3BY6TBHG.js} +4 -4
- package/bundle/{liteRtServerManager-DMTHAOJH.js → liteRtServerManager-C5WZRQUF.js} +4 -4
- package/bundle/{liteRtServerManager-7LTDMYKI.js → liteRtServerManager-IGKUGGP4.js} +4 -4
- package/bundle/liteRtServerManager-IJ4I2PZA.js +65 -0
- package/bundle/{oauth2-provider-NOSS4GIR.js → oauth2-provider-KSRLPOK3.js} +1 -1
- package/bundle/{oauth2-provider-S2564L6K.js → oauth2-provider-RWKTMYJF.js} +1 -1
- package/bundle/{oauth2-provider-HNMIIJDH.js → oauth2-provider-VHNLCU4Y.js} +38 -72
- package/bundle/oauth2-provider-ZT4OFVMK.js +235 -0
- package/bundle/{start-L2WLGVI3.js → start-EXAQFM4Y.js} +6 -6
- package/bundle/{start-UGLCJG5Y.js → start-IPZF32E3.js} +6 -6
- package/bundle/{start-5F3JQ7EX.js → start-SVNTSNHV.js} +6 -6
- package/bundle/start-ZXU5BFZY.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-65C235NM.js";
|
|
161
161
|
import {
|
|
162
162
|
require_source
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-RLDNUS35.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-LNXGFWGZ.js";
|
|
218
218
|
import {
|
|
219
219
|
handleAutoUpdate,
|
|
220
220
|
isDevelopment,
|
|
221
221
|
relaunchApp,
|
|
222
222
|
setUpdateHandler
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-NMMXRZ53.js";
|
|
224
224
|
import {
|
|
225
225
|
isTodoList,
|
|
226
226
|
mapCoreStatusToDisplayStatus,
|
|
227
227
|
require_react
|
|
228
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-GMQ6QNZB.js";
|
|
229
229
|
import {
|
|
230
230
|
registerCleanup,
|
|
231
231
|
removeCleanup,
|
|
232
232
|
runExitCleanup,
|
|
233
233
|
setupTtyCheck
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-EAK33LFP.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-WDFSF5L4.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
|
}
|
|
@@ -15449,8 +15468,16 @@ var CloudFreePrivacyNotice = ({
|
|
|
15449
15468
|
] });
|
|
15450
15469
|
}
|
|
15451
15470
|
const items = [
|
|
15452
|
-
{
|
|
15453
|
-
|
|
15471
|
+
{
|
|
15472
|
+
label: "Yes, grant permission to use my data for product improvement (Opt-in)",
|
|
15473
|
+
value: true,
|
|
15474
|
+
key: "true"
|
|
15475
|
+
},
|
|
15476
|
+
{
|
|
15477
|
+
label: "No, deny permission to use my data for product improvement (Opt-out)",
|
|
15478
|
+
value: false,
|
|
15479
|
+
key: "false"
|
|
15480
|
+
}
|
|
15454
15481
|
];
|
|
15455
15482
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Box_default, { flexDirection: "column", marginY: 1, children: [
|
|
15456
15483
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { bold: true, color: theme.text.accent, children: "Gemini Code Assist for Individuals Privacy Notice" }),
|
|
@@ -15465,12 +15492,15 @@ var CloudFreePrivacyNotice = ({
|
|
|
15465
15492
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Newline, {}),
|
|
15466
15493
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: theme.text.primary, children: "To help with quality and improve our products (such as generative machine-learning models), human reviewers may read, annotate, and process the data collected above. We take steps to protect your privacy as part of this process. This includes disconnecting the data from your Google Account before reviewers see or annotate it, and storing those disconnected copies for up to 18 months. Please don't submit confidential information or any data you wouldn't want a reviewer to see or Google to use to improve our products, services and machine-learning technologies." }),
|
|
15467
15494
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Newline, {}),
|
|
15495
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: theme.text.primary, children: `If you don't want this data used to improve Google's products and services, you can opt out by selecting "No, deny permission to use my data for product improvement (Opt-out)" below. Otherwise, you can opt in by selecting "Yes, grant permission to use my data for product improvement (Opt-in)".` }),
|
|
15496
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Newline, {}),
|
|
15468
15497
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
15469
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: theme.text.primary, children: "Allow Google to use this data to develop and improve our products?" }),
|
|
15498
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: theme.text.primary, children: "Allow Google to use this data to develop and improve our products and services?" }),
|
|
15470
15499
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
15471
15500
|
RadioButtonSelect,
|
|
15472
15501
|
{
|
|
15473
15502
|
items,
|
|
15503
|
+
renderItem: (item, { titleColor }) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Box_default, { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { color: titleColor, wrap: "wrap", children: item.label }) }),
|
|
15474
15504
|
initialIndex: privacyState.dataCollectionOptIn ? 0 : 1,
|
|
15475
15505
|
onSelect: (value) => {
|
|
15476
15506
|
updateDataCollectionOptIn(value);
|
|
@@ -15500,11 +15530,11 @@ var PrivacyNoticeText = ({
|
|
|
15500
15530
|
}) => {
|
|
15501
15531
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15502
15532
|
switch (authType) {
|
|
15503
|
-
case
|
|
15533
|
+
case AuthType.USE_GEMINI:
|
|
15504
15534
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15505
|
-
case
|
|
15535
|
+
case AuthType.USE_VERTEX_AI:
|
|
15506
15536
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15507
|
-
case
|
|
15537
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15508
15538
|
default:
|
|
15509
15539
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15510
15540
|
}
|
|
@@ -15564,7 +15594,7 @@ function ProQuotaDialog({
|
|
|
15564
15594
|
value: "retry_always",
|
|
15565
15595
|
key: "retry_always"
|
|
15566
15596
|
},
|
|
15567
|
-
...authType ===
|
|
15597
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15568
15598
|
{
|
|
15569
15599
|
label: "Upgrade for higher limits",
|
|
15570
15600
|
value: "upgrade",
|
|
@@ -16723,7 +16753,7 @@ function ModelDialog({ onClose }) {
|
|
|
16723
16753
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
16724
16754
|
const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
|
|
16725
16755
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16726
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16756
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16727
16757
|
const manualModelSelected = (0, import_react55.useMemo)(() => {
|
|
16728
16758
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16729
16759
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -18047,10 +18077,10 @@ function initializeConsoleStore() {
|
|
|
18047
18077
|
globalConsoleMessages = [];
|
|
18048
18078
|
globalErrorCount = 0;
|
|
18049
18079
|
notifyListeners();
|
|
18050
|
-
coreEvents.off(
|
|
18051
|
-
coreEvents.off(
|
|
18052
|
-
coreEvents.on(
|
|
18053
|
-
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);
|
|
18054
18084
|
}
|
|
18055
18085
|
function notifyListeners() {
|
|
18056
18086
|
for (const listener of listeners) {
|
|
@@ -20187,7 +20217,7 @@ function usePromptCompletion({
|
|
|
20187
20217
|
{ model: "prompt-completion" },
|
|
20188
20218
|
contents,
|
|
20189
20219
|
signal,
|
|
20190
|
-
|
|
20220
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20191
20221
|
);
|
|
20192
20222
|
if (signal.aborted) {
|
|
20193
20223
|
return;
|
|
@@ -20545,13 +20575,7 @@ function useCommandCompletion({
|
|
|
20545
20575
|
}
|
|
20546
20576
|
const lineCodePoints = toCodePoints(buffer.lines[cursorRow] || "");
|
|
20547
20577
|
const charAfterCompletion = lineCodePoints[end];
|
|
20548
|
-
|
|
20549
|
-
if (completionMode === "SLASH" /* SLASH */) {
|
|
20550
|
-
const command = slashCompletionRange.getCommandFromSuggestion(suggestion);
|
|
20551
|
-
const isExecutableCommand = !!(command && command.action);
|
|
20552
|
-
const requiresArguments = !!(command && command.completion);
|
|
20553
|
-
shouldAddSpace = !isExecutableCommand || requiresArguments;
|
|
20554
|
-
}
|
|
20578
|
+
const shouldAddSpace = true;
|
|
20555
20579
|
if (charAfterCompletion !== " " && !suggestionText.endsWith("/") && !suggestionText.endsWith("\\") && shouldAddSpace) {
|
|
20556
20580
|
suggestionText += " ";
|
|
20557
20581
|
}
|
|
@@ -22265,9 +22289,9 @@ var InputPrompt = ({
|
|
|
22265
22289
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22266
22290
|
}
|
|
22267
22291
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22268
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22269
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22270
|
-
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;
|
|
22271
22295
|
let statusColor;
|
|
22272
22296
|
let statusText = "";
|
|
22273
22297
|
if (shellModeActive) {
|
|
@@ -23100,22 +23124,22 @@ var ApprovalModeIndicator = ({
|
|
|
23100
23124
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
23101
23125
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
23102
23126
|
switch (approvalMode) {
|
|
23103
|
-
case
|
|
23127
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23104
23128
|
textColor = theme.status.warning;
|
|
23105
23129
|
textContent = "auto-accept edits";
|
|
23106
23130
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23107
23131
|
break;
|
|
23108
|
-
case
|
|
23132
|
+
case ApprovalMode.PLAN:
|
|
23109
23133
|
textColor = theme.status.success;
|
|
23110
23134
|
textContent = "plan";
|
|
23111
23135
|
subText = `${cycleHint} to manual`;
|
|
23112
23136
|
break;
|
|
23113
|
-
case
|
|
23137
|
+
case ApprovalMode.YOLO:
|
|
23114
23138
|
textColor = theme.status.error;
|
|
23115
23139
|
textContent = "YOLO";
|
|
23116
23140
|
subText = yoloHint;
|
|
23117
23141
|
break;
|
|
23118
|
-
case
|
|
23142
|
+
case ApprovalMode.DEFAULT:
|
|
23119
23143
|
default:
|
|
23120
23144
|
textColor = theme.text.accent;
|
|
23121
23145
|
textContent = "";
|
|
@@ -23163,7 +23187,7 @@ var useComposerStatus = () => {
|
|
|
23163
23187
|
(item) => item.type === "tool_group"
|
|
23164
23188
|
).some(
|
|
23165
23189
|
(item) => item.tools.some(
|
|
23166
|
-
(tool) => tool.status ===
|
|
23190
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23167
23191
|
)
|
|
23168
23192
|
),
|
|
23169
23193
|
[uiState.pendingHistoryItems]
|
|
@@ -23178,13 +23202,13 @@ var useComposerStatus = () => {
|
|
|
23178
23202
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23179
23203
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23180
23204
|
switch (showApprovalModeIndicator) {
|
|
23181
|
-
case
|
|
23205
|
+
case ApprovalMode.YOLO:
|
|
23182
23206
|
return { text: "YOLO", color: theme.status.error };
|
|
23183
|
-
case
|
|
23207
|
+
case ApprovalMode.PLAN:
|
|
23184
23208
|
return { text: "plan", color: theme.status.success };
|
|
23185
|
-
case
|
|
23209
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23186
23210
|
return { text: "auto edit", color: theme.status.warning };
|
|
23187
|
-
case
|
|
23211
|
+
case ApprovalMode.DEFAULT:
|
|
23188
23212
|
default:
|
|
23189
23213
|
return null;
|
|
23190
23214
|
}
|
|
@@ -23538,7 +23562,7 @@ var ConfigInitDisplay = ({
|
|
|
23538
23562
|
let connected = 0;
|
|
23539
23563
|
const connecting = [];
|
|
23540
23564
|
for (const [name, client] of clients.entries()) {
|
|
23541
|
-
if (client.getStatus() ===
|
|
23565
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23542
23566
|
connected++;
|
|
23543
23567
|
} else {
|
|
23544
23568
|
connecting.push(name);
|
|
@@ -23560,9 +23584,9 @@ var ConfigInitDisplay = ({
|
|
|
23560
23584
|
);
|
|
23561
23585
|
}
|
|
23562
23586
|
};
|
|
23563
|
-
coreEvents.on(
|
|
23587
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23564
23588
|
return () => {
|
|
23565
|
-
coreEvents.off(
|
|
23589
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23566
23590
|
};
|
|
23567
23591
|
}, [initialMessage]);
|
|
23568
23592
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
|
|
@@ -24279,7 +24303,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24279
24303
|
callId,
|
|
24280
24304
|
name: SHELL_COMMAND_NAME,
|
|
24281
24305
|
description: rawQuery,
|
|
24282
|
-
status:
|
|
24306
|
+
status: CoreToolCallStatus.Executing,
|
|
24283
24307
|
isClientInitiated: true,
|
|
24284
24308
|
resultDisplay: "",
|
|
24285
24309
|
confirmationDetails: void 0
|
|
@@ -24420,7 +24444,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24420
24444
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24421
24445
|
}
|
|
24422
24446
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24423
|
-
let finalStatus =
|
|
24447
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24424
24448
|
const prependToAnsiOutput = (output, text) => {
|
|
24425
24449
|
const newLines = text.split("\n").map((line) => [
|
|
24426
24450
|
{
|
|
@@ -24439,20 +24463,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24439
24463
|
};
|
|
24440
24464
|
let prefix = "";
|
|
24441
24465
|
if (result.error) {
|
|
24442
|
-
finalStatus =
|
|
24466
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24443
24467
|
prefix = result.error.message;
|
|
24444
24468
|
} else if (result.aborted) {
|
|
24445
|
-
finalStatus =
|
|
24469
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24446
24470
|
prefix = "Command was cancelled.";
|
|
24447
24471
|
} else if (result.backgrounded) {
|
|
24448
|
-
finalStatus =
|
|
24472
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24449
24473
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24450
24474
|
mainContent = finalOutput;
|
|
24451
24475
|
} else if (result.signal) {
|
|
24452
|
-
finalStatus =
|
|
24476
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24453
24477
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24454
24478
|
} else if (result.exitCode !== 0) {
|
|
24455
|
-
finalStatus =
|
|
24479
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24456
24480
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24457
24481
|
}
|
|
24458
24482
|
if (prefix) {
|
|
@@ -24478,7 +24502,7 @@ ${mainContent}`;
|
|
|
24478
24502
|
status: finalStatus,
|
|
24479
24503
|
resultDisplay: finalOutput
|
|
24480
24504
|
};
|
|
24481
|
-
if (finalStatus !==
|
|
24505
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24482
24506
|
addItemToHistory(
|
|
24483
24507
|
{
|
|
24484
24508
|
type: "tool_group",
|
|
@@ -25488,13 +25512,13 @@ function useQuotaAndFallback({
|
|
|
25488
25512
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25489
25513
|
`/stats model for usage details`,
|
|
25490
25514
|
`/model to switch models.`,
|
|
25491
|
-
contentGeneratorConfig?.authType ===
|
|
25515
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25492
25516
|
].filter(Boolean);
|
|
25493
25517
|
message = messageLines.join("\n");
|
|
25494
25518
|
}
|
|
25495
25519
|
} else if (error instanceof ModelNotFoundError) {
|
|
25496
25520
|
isModelNotFoundError = true;
|
|
25497
|
-
if (contentGeneratorConfig?.authType ===
|
|
25521
|
+
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
25498
25522
|
const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
|
|
25499
25523
|
const messageLines = [
|
|
25500
25524
|
`Model "${failedModel}" is not available in region "${location}".`,
|
|
@@ -25504,9 +25528,10 @@ function useQuotaAndFallback({
|
|
|
25504
25528
|
];
|
|
25505
25529
|
message = messageLines.join("\n");
|
|
25506
25530
|
} else if (VALID_GEMINI_MODELS.has(failedModel)) {
|
|
25531
|
+
const detailMessage = userTier === UserTierId.FREE ? "This model is not available for personal accounts." : "Your admin might have disabled the access. Contact them to enable the Preview Release Channel.";
|
|
25507
25532
|
const messageLines = [
|
|
25508
25533
|
`It seems like you don't have access to ${getDisplayString(failedModel)}.`,
|
|
25509
|
-
|
|
25534
|
+
detailMessage
|
|
25510
25535
|
];
|
|
25511
25536
|
message = messageLines.join("\n");
|
|
25512
25537
|
} else {
|
|
@@ -25687,7 +25712,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25687
25712
|
);
|
|
25688
25713
|
setEditorError(null);
|
|
25689
25714
|
setIsEditorDialogOpen(false);
|
|
25690
|
-
coreEvents.emit(
|
|
25715
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25691
25716
|
} catch (error) {
|
|
25692
25717
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25693
25718
|
}
|
|
@@ -25696,7 +25721,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25696
25721
|
);
|
|
25697
25722
|
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25698
25723
|
setIsEditorDialogOpen(false);
|
|
25699
|
-
coreEvents.emit(
|
|
25724
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25700
25725
|
}, []);
|
|
25701
25726
|
return {
|
|
25702
25727
|
isEditorDialogOpen,
|
|
@@ -26073,7 +26098,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26073
26098
|
canonicalPath: resolvedCommandPath
|
|
26074
26099
|
} = parseSlashCommand(trimmed, commands);
|
|
26075
26100
|
if (!commandToExecute) {
|
|
26076
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
26101
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
26077
26102
|
if (isMcpLoading) {
|
|
26078
26103
|
setIsProcessing(true);
|
|
26079
26104
|
if (addToHistory) {
|
|
@@ -26253,7 +26278,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26253
26278
|
onConfirm: async (resolvedOutcome) => {
|
|
26254
26279
|
resolve3({
|
|
26255
26280
|
outcome: resolvedOutcome,
|
|
26256
|
-
approvedCommands: resolvedOutcome ===
|
|
26281
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26257
26282
|
});
|
|
26258
26283
|
}
|
|
26259
26284
|
};
|
|
@@ -26261,7 +26286,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26261
26286
|
callId,
|
|
26262
26287
|
name: "Expansion",
|
|
26263
26288
|
description: "Command expansion needs shell access",
|
|
26264
|
-
status:
|
|
26289
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26265
26290
|
isClientInitiated: true,
|
|
26266
26291
|
resultDisplay: void 0,
|
|
26267
26292
|
confirmationDetails
|
|
@@ -26272,7 +26297,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26272
26297
|
});
|
|
26273
26298
|
});
|
|
26274
26299
|
setPendingItem(null);
|
|
26275
|
-
if (outcome ===
|
|
26300
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26276
26301
|
addItem(
|
|
26277
26302
|
{
|
|
26278
26303
|
type: "info" /* INFO */,
|
|
@@ -26282,7 +26307,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26282
26307
|
);
|
|
26283
26308
|
return { type: "handled" };
|
|
26284
26309
|
}
|
|
26285
|
-
if (outcome ===
|
|
26310
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26286
26311
|
setSessionShellAllowlist(
|
|
26287
26312
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26288
26313
|
);
|
|
@@ -26758,7 +26783,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26758
26783
|
let description;
|
|
26759
26784
|
let renderOutputAsMarkdown = false;
|
|
26760
26785
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26761
|
-
if (call.status ===
|
|
26786
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26762
26787
|
description = JSON.stringify(call.request.args);
|
|
26763
26788
|
} else {
|
|
26764
26789
|
description = call.invocation.getDescription();
|
|
@@ -26781,27 +26806,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26781
26806
|
let progress = void 0;
|
|
26782
26807
|
let progressTotal = void 0;
|
|
26783
26808
|
switch (call.status) {
|
|
26784
|
-
case
|
|
26809
|
+
case CoreToolCallStatus.Success:
|
|
26785
26810
|
resultDisplay = call.response.resultDisplay;
|
|
26786
26811
|
outputFile = call.response.outputFile;
|
|
26787
26812
|
break;
|
|
26788
|
-
case
|
|
26789
|
-
case
|
|
26813
|
+
case CoreToolCallStatus.Error:
|
|
26814
|
+
case CoreToolCallStatus.Cancelled:
|
|
26790
26815
|
resultDisplay = call.response.resultDisplay;
|
|
26791
26816
|
break;
|
|
26792
|
-
case
|
|
26817
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26793
26818
|
correlationId = call.correlationId;
|
|
26794
26819
|
confirmationDetails = call.confirmationDetails;
|
|
26795
26820
|
break;
|
|
26796
|
-
case
|
|
26821
|
+
case CoreToolCallStatus.Executing:
|
|
26797
26822
|
resultDisplay = call.liveOutput;
|
|
26798
26823
|
ptyId = call.pid;
|
|
26799
26824
|
progressMessage = call.progressMessage;
|
|
26800
26825
|
progress = call.progress;
|
|
26801
26826
|
progressTotal = call.progressTotal;
|
|
26802
26827
|
break;
|
|
26803
|
-
case
|
|
26804
|
-
case
|
|
26828
|
+
case CoreToolCallStatus.Scheduled:
|
|
26829
|
+
case CoreToolCallStatus.Validating:
|
|
26805
26830
|
break;
|
|
26806
26831
|
default: {
|
|
26807
26832
|
const exhaustiveCheck = call;
|
|
@@ -26872,7 +26897,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26872
26897
|
const handler = (event) => {
|
|
26873
26898
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26874
26899
|
const hasExecuting = event.toolCalls.some(
|
|
26875
|
-
(tc) => tc.status ===
|
|
26900
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26876
26901
|
);
|
|
26877
26902
|
if (hasExecuting) {
|
|
26878
26903
|
setLastToolOutputTime(Date.now());
|
|
@@ -26881,7 +26906,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26881
26906
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26882
26907
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26883
26908
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26884
|
-
(tc) => tc.status ===
|
|
26909
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26885
26910
|
);
|
|
26886
26911
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26887
26912
|
return prev;
|
|
@@ -26893,9 +26918,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26893
26918
|
};
|
|
26894
26919
|
});
|
|
26895
26920
|
};
|
|
26896
|
-
messageBus.subscribe(
|
|
26921
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26897
26922
|
return () => {
|
|
26898
|
-
messageBus.unsubscribe(
|
|
26923
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26899
26924
|
};
|
|
26900
26925
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26901
26926
|
(0, import_react98.useEffect)(() => {
|
|
@@ -26917,9 +26942,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26917
26942
|
};
|
|
26918
26943
|
});
|
|
26919
26944
|
};
|
|
26920
|
-
messageBus.subscribe(
|
|
26945
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26921
26946
|
return () => {
|
|
26922
|
-
messageBus.unsubscribe(
|
|
26947
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26923
26948
|
};
|
|
26924
26949
|
}, [messageBus]);
|
|
26925
26950
|
const schedule = (0, import_react98.useCallback)(
|
|
@@ -27018,8 +27043,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
27018
27043
|
const prev = prevMap.get(coreCall.request.callId);
|
|
27019
27044
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
27020
27045
|
let status = coreCall.status;
|
|
27021
|
-
if ((status ===
|
|
27022
|
-
status =
|
|
27046
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
27047
|
+
status = CoreToolCallStatus.Executing;
|
|
27023
27048
|
}
|
|
27024
27049
|
return {
|
|
27025
27050
|
...coreCall,
|
|
@@ -27051,7 +27076,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
27051
27076
|
};
|
|
27052
27077
|
}
|
|
27053
27078
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
27054
|
-
return toolCall.status ===
|
|
27079
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
27055
27080
|
}
|
|
27056
27081
|
function showCitations(settings) {
|
|
27057
27082
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -27061,14 +27086,14 @@ function showCitations(settings) {
|
|
|
27061
27086
|
return true;
|
|
27062
27087
|
}
|
|
27063
27088
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
27064
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
27089
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
27065
27090
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
27066
27091
|
}
|
|
27067
27092
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
27068
|
-
if (tc.status ===
|
|
27093
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
27069
27094
|
return true;
|
|
27070
27095
|
}
|
|
27071
|
-
if (tc.status ===
|
|
27096
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
27072
27097
|
return !tc.responseSubmittedToGemini;
|
|
27073
27098
|
}
|
|
27074
27099
|
return false;
|
|
@@ -27090,6 +27115,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27090
27115
|
const abortControllerRef = (0, import_react99.useRef)(null);
|
|
27091
27116
|
const turnCancelledRef = (0, import_react99.useRef)(false);
|
|
27092
27117
|
const activeQueryIdRef = (0, import_react99.useRef)(null);
|
|
27118
|
+
const historyLengthAfterUserPromptRef = (0, import_react99.useRef)(void 0);
|
|
27093
27119
|
const previousApprovalModeRef = (0, import_react99.useRef)(
|
|
27094
27120
|
config.getApprovalMode()
|
|
27095
27121
|
);
|
|
@@ -27114,9 +27140,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27114
27140
|
}
|
|
27115
27141
|
setRetryStatus(payload);
|
|
27116
27142
|
};
|
|
27117
|
-
coreEvents.on(
|
|
27143
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27118
27144
|
return () => {
|
|
27119
|
-
coreEvents.off(
|
|
27145
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27120
27146
|
};
|
|
27121
27147
|
}, [isRespondingRef]);
|
|
27122
27148
|
const [
|
|
@@ -27249,12 +27275,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27249
27275
|
const tc = toolCalls[i];
|
|
27250
27276
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27251
27277
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27252
|
-
const isAgent = tc.tool?.kind ===
|
|
27278
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27253
27279
|
if (isAgent) {
|
|
27254
27280
|
let contigAgentsComplete = true;
|
|
27255
27281
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27256
27282
|
const nextTc = toolCalls[j];
|
|
27257
|
-
if (nextTc.tool?.kind ===
|
|
27283
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27258
27284
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27259
27285
|
contigAgentsComplete = false;
|
|
27260
27286
|
break;
|
|
@@ -27280,7 +27306,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27280
27306
|
let currentGroup = [];
|
|
27281
27307
|
for (const tc of toolsToPush) {
|
|
27282
27308
|
newPushed.add(tc.request.callId);
|
|
27283
|
-
if (tc.tool?.kind ===
|
|
27309
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27284
27310
|
currentGroup.push(tc);
|
|
27285
27311
|
} else {
|
|
27286
27312
|
if (currentGroup.length > 0) {
|
|
@@ -27416,6 +27442,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27416
27442
|
const lastQueryRef = (0, import_react99.useRef)(null);
|
|
27417
27443
|
const lastPromptIdRef = (0, import_react99.useRef)(null);
|
|
27418
27444
|
const loopDetectedRef = (0, import_react99.useRef)(false);
|
|
27445
|
+
const autoNudgeAttemptCountRef = (0, import_react99.useRef)(0);
|
|
27446
|
+
const MAX_AUTO_NUDGE_ATTEMPTS = 2;
|
|
27447
|
+
const submitQueryRef = (0, import_react99.useRef)(null);
|
|
27419
27448
|
const [
|
|
27420
27449
|
loopDetectionConfirmationRequest,
|
|
27421
27450
|
setLoopDetectionConfirmationRequest
|
|
@@ -27430,7 +27459,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27430
27459
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27431
27460
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27432
27461
|
(0, import_react99.useEffect)(() => {
|
|
27433
|
-
if (config.getApprovalMode() ===
|
|
27462
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27434
27463
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27435
27464
|
(item) => item.type === "user" /* USER */
|
|
27436
27465
|
);
|
|
@@ -27498,7 +27527,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27498
27527
|
return;
|
|
27499
27528
|
}
|
|
27500
27529
|
const hasActiveTools = toolCalls.some(
|
|
27501
|
-
(tc) => tc.status ===
|
|
27530
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27502
27531
|
);
|
|
27503
27532
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27504
27533
|
if (clearBuffer) {
|
|
@@ -27525,7 +27554,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27525
27554
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27526
27555
|
return {
|
|
27527
27556
|
...tool,
|
|
27528
|
-
status:
|
|
27557
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27529
27558
|
resultDisplay: tool.resultDisplay
|
|
27530
27559
|
};
|
|
27531
27560
|
}
|
|
@@ -27590,7 +27619,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27590
27619
|
let localQueryToSendToGemini = null;
|
|
27591
27620
|
if (typeof query === "string") {
|
|
27592
27621
|
const trimmedQuery = query.trim();
|
|
27593
|
-
await logger?.logMessage(
|
|
27622
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27594
27623
|
if (!shellModeActive) {
|
|
27595
27624
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27596
27625
|
if (slashCommandResult) {
|
|
@@ -27746,7 +27775,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27746
27775
|
if (pendingHistoryItemRef.current) {
|
|
27747
27776
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27748
27777
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27749
|
-
(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
|
|
27750
27779
|
);
|
|
27751
27780
|
const pendingItem = {
|
|
27752
27781
|
...pendingHistoryItemRef.current,
|
|
@@ -28034,19 +28063,19 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28034
28063
|
]
|
|
28035
28064
|
);
|
|
28036
28065
|
const processGeminiStreamEvents = (0, import_react99.useCallback)(
|
|
28037
|
-
async (stream, userMessageTimestamp, signal) => {
|
|
28066
|
+
async (stream, userMessageTimestamp, signal, isContinuation, prompt_id) => {
|
|
28038
28067
|
let geminiMessageBuffer = "";
|
|
28039
28068
|
const toolCallRequests = [];
|
|
28040
28069
|
for await (const event of stream) {
|
|
28041
|
-
if (event.type !==
|
|
28070
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
28042
28071
|
setThought(null);
|
|
28043
28072
|
}
|
|
28044
28073
|
switch (event.type) {
|
|
28045
|
-
case
|
|
28074
|
+
case GeminiEventType.Thought:
|
|
28046
28075
|
setLastGeminiActivityTime(Date.now());
|
|
28047
28076
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
28048
28077
|
break;
|
|
28049
|
-
case
|
|
28078
|
+
case GeminiEventType.Content:
|
|
28050
28079
|
setLastGeminiActivityTime(Date.now());
|
|
28051
28080
|
geminiMessageBuffer = handleContentEvent(
|
|
28052
28081
|
event.value,
|
|
@@ -28054,16 +28083,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28054
28083
|
userMessageTimestamp
|
|
28055
28084
|
);
|
|
28056
28085
|
break;
|
|
28057
|
-
case
|
|
28086
|
+
case GeminiEventType.ToolCallRequest:
|
|
28058
28087
|
toolCallRequests.push(event.value);
|
|
28059
28088
|
break;
|
|
28060
|
-
case
|
|
28089
|
+
case GeminiEventType.UserCancelled:
|
|
28061
28090
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
28062
28091
|
break;
|
|
28063
|
-
case
|
|
28092
|
+
case GeminiEventType.Error:
|
|
28064
28093
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
28065
28094
|
break;
|
|
28066
|
-
case
|
|
28095
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
28067
28096
|
handleAgentExecutionStoppedEvent(
|
|
28068
28097
|
event.value.reason,
|
|
28069
28098
|
userMessageTimestamp,
|
|
@@ -28071,7 +28100,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28071
28100
|
event.value.contextCleared
|
|
28072
28101
|
);
|
|
28073
28102
|
break;
|
|
28074
|
-
case
|
|
28103
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
28075
28104
|
handleAgentExecutionBlockedEvent(
|
|
28076
28105
|
event.value.reason,
|
|
28077
28106
|
userMessageTimestamp,
|
|
@@ -28079,36 +28108,36 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28079
28108
|
event.value.contextCleared
|
|
28080
28109
|
);
|
|
28081
28110
|
break;
|
|
28082
|
-
case
|
|
28111
|
+
case GeminiEventType.ChatCompressed:
|
|
28083
28112
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
28084
28113
|
break;
|
|
28085
|
-
case
|
|
28086
|
-
case
|
|
28114
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
28115
|
+
case GeminiEventType.ToolCallResponse:
|
|
28087
28116
|
break;
|
|
28088
|
-
case
|
|
28117
|
+
case GeminiEventType.MaxSessionTurns:
|
|
28089
28118
|
handleMaxSessionTurnsEvent();
|
|
28090
28119
|
break;
|
|
28091
|
-
case
|
|
28120
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
28092
28121
|
handleContextWindowWillOverflowEvent(
|
|
28093
28122
|
event.value.estimatedRequestTokenCount,
|
|
28094
28123
|
event.value.remainingTokenCount
|
|
28095
28124
|
);
|
|
28096
28125
|
break;
|
|
28097
|
-
case
|
|
28126
|
+
case GeminiEventType.Finished:
|
|
28098
28127
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
28099
28128
|
break;
|
|
28100
|
-
case
|
|
28129
|
+
case GeminiEventType.Citation:
|
|
28101
28130
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
28102
28131
|
break;
|
|
28103
|
-
case
|
|
28132
|
+
case GeminiEventType.ModelInfo:
|
|
28104
28133
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
28105
28134
|
break;
|
|
28106
|
-
case
|
|
28135
|
+
case GeminiEventType.LoopDetected:
|
|
28107
28136
|
loopDetectedRef.current = true;
|
|
28108
28137
|
break;
|
|
28109
|
-
case
|
|
28138
|
+
case GeminiEventType.Retry:
|
|
28110
28139
|
break;
|
|
28111
|
-
case
|
|
28140
|
+
case GeminiEventType.InvalidStream:
|
|
28112
28141
|
handleInvalidStreamEvent(event.value, userMessageTimestamp);
|
|
28113
28142
|
break;
|
|
28114
28143
|
default: {
|
|
@@ -28123,6 +28152,17 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28123
28152
|
setPendingHistoryItem(null);
|
|
28124
28153
|
}
|
|
28125
28154
|
await scheduleToolCalls(toolCallRequests, signal);
|
|
28155
|
+
} else {
|
|
28156
|
+
const hasVisibleText = geminiMessageBuffer.trim().length > 0;
|
|
28157
|
+
if (isContinuation && !hasVisibleText && autoNudgeAttemptCountRef.current < MAX_AUTO_NUDGE_ATTEMPTS) {
|
|
28158
|
+
autoNudgeAttemptCountRef.current += 1;
|
|
28159
|
+
const nudgeMessage = "[System: You successfully executed a tool but returned an empty response. Please analyze the tool output and explain your progress or final answer.]";
|
|
28160
|
+
submitQueryRef.current?.(
|
|
28161
|
+
[{ text: nudgeMessage }],
|
|
28162
|
+
{ isContinuation: true },
|
|
28163
|
+
prompt_id
|
|
28164
|
+
);
|
|
28165
|
+
}
|
|
28126
28166
|
}
|
|
28127
28167
|
return 0 /* Completed */;
|
|
28128
28168
|
},
|
|
@@ -28151,7 +28191,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28151
28191
|
const submitQuery = (0, import_react99.useCallback)(
|
|
28152
28192
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
28153
28193
|
{
|
|
28154
|
-
operation: options?.isContinuation ?
|
|
28194
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
28155
28195
|
sessionId: config.getSessionId()
|
|
28156
28196
|
},
|
|
28157
28197
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28162,6 +28202,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28162
28202
|
activeQueryIdRef.current = queryId;
|
|
28163
28203
|
const userMessageTimestamp = Date.now();
|
|
28164
28204
|
if (!options?.isContinuation) {
|
|
28205
|
+
autoNudgeAttemptCountRef.current = 0;
|
|
28165
28206
|
setModelSwitchedFromQuotaError(false);
|
|
28166
28207
|
config.setQuotaErrorOccurred(false);
|
|
28167
28208
|
config.resetBillingTurnState(
|
|
@@ -28187,6 +28228,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28187
28228
|
if (!shouldProceed || queryToSend === null) {
|
|
28188
28229
|
return;
|
|
28189
28230
|
}
|
|
28231
|
+
if (geminiClient) {
|
|
28232
|
+
historyLengthAfterUserPromptRef.current = geminiClient.getHistory().length;
|
|
28233
|
+
}
|
|
28190
28234
|
if (!options?.isContinuation) {
|
|
28191
28235
|
if (typeof queryToSend === "string") {
|
|
28192
28236
|
const promptText = queryToSend;
|
|
@@ -28218,7 +28262,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28218
28262
|
const processingStatus = await processGeminiStreamEvents(
|
|
28219
28263
|
stream,
|
|
28220
28264
|
userMessageTimestamp,
|
|
28221
|
-
abortSignal
|
|
28265
|
+
abortSignal,
|
|
28266
|
+
options?.isContinuation,
|
|
28267
|
+
prompt_id
|
|
28222
28268
|
);
|
|
28223
28269
|
if (processingStatus === 1 /* UserCancelled */) {
|
|
28224
28270
|
return;
|
|
@@ -28309,9 +28355,10 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28309
28355
|
setIsResponding
|
|
28310
28356
|
]
|
|
28311
28357
|
);
|
|
28358
|
+
submitQueryRef.current = submitQuery;
|
|
28312
28359
|
const handleApprovalModeChange = (0, import_react99.useCallback)(
|
|
28313
28360
|
async (newApprovalMode) => {
|
|
28314
|
-
if (previousApprovalModeRef.current ===
|
|
28361
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28315
28362
|
if (geminiClient) {
|
|
28316
28363
|
try {
|
|
28317
28364
|
await geminiClient.addHistory({
|
|
@@ -28334,11 +28381,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28334
28381
|
}
|
|
28335
28382
|
}
|
|
28336
28383
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28337
|
-
if (newApprovalMode ===
|
|
28384
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28338
28385
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28339
28386
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28340
28387
|
);
|
|
28341
|
-
if (newApprovalMode ===
|
|
28388
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28342
28389
|
awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
|
|
28343
28390
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
28344
28391
|
return true;
|
|
@@ -28354,11 +28401,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28354
28401
|
if (call.correlationId) {
|
|
28355
28402
|
try {
|
|
28356
28403
|
await config.getMessageBus().publish({
|
|
28357
|
-
type:
|
|
28404
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28358
28405
|
correlationId: call.correlationId,
|
|
28359
28406
|
confirmed: true,
|
|
28360
28407
|
requiresUserConfirmation: false,
|
|
28361
|
-
outcome:
|
|
28408
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28362
28409
|
});
|
|
28363
28410
|
} catch (error) {
|
|
28364
28411
|
debugLogger.warn(
|
|
@@ -28449,14 +28496,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28449
28496
|
);
|
|
28450
28497
|
if (isLowErrorVerbosity) {
|
|
28451
28498
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28452
|
-
(tc) => tc.status ===
|
|
28499
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28453
28500
|
).length;
|
|
28454
28501
|
}
|
|
28455
28502
|
if (geminiTools.length === 0) {
|
|
28456
28503
|
return;
|
|
28457
28504
|
}
|
|
28458
28505
|
const stopExecutionTool = geminiTools.find(
|
|
28459
|
-
(tc) => tc.response.errorType ===
|
|
28506
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28460
28507
|
);
|
|
28461
28508
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28462
28509
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28476,9 +28523,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28476
28523
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28477
28524
|
);
|
|
28478
28525
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28479
|
-
(tc) => tc.status ===
|
|
28526
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28480
28527
|
);
|
|
28481
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28528
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28482
28529
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28483
28530
|
if (!turnCancelledRef.current) {
|
|
28484
28531
|
addItem({
|
|
@@ -28487,14 +28534,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28487
28534
|
});
|
|
28488
28535
|
}
|
|
28489
28536
|
setIsResponding(false);
|
|
28490
|
-
if (geminiClient) {
|
|
28491
|
-
const
|
|
28492
|
-
|
|
28493
|
-
|
|
28494
|
-
|
|
28495
|
-
|
|
28496
|
-
|
|
28497
|
-
|
|
28537
|
+
if (geminiClient && historyLengthAfterUserPromptRef.current !== void 0) {
|
|
28538
|
+
const targetLength = historyLengthAfterUserPromptRef.current;
|
|
28539
|
+
if (geminiClient.getHistory().length > targetLength) {
|
|
28540
|
+
geminiClient.setHistory(
|
|
28541
|
+
geminiClient.getHistory().slice(0, targetLength)
|
|
28542
|
+
);
|
|
28543
|
+
}
|
|
28544
|
+
historyLengthAfterUserPromptRef.current = void 0;
|
|
28498
28545
|
}
|
|
28499
28546
|
const callIdsToMarkAsSubmitted2 = geminiTools.map(
|
|
28500
28547
|
(toolCall) => toolCall.request.callId
|
|
@@ -28565,7 +28612,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28565
28612
|
return;
|
|
28566
28613
|
}
|
|
28567
28614
|
const restorableToolCalls = toolCalls.filter(
|
|
28568
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28615
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28569
28616
|
);
|
|
28570
28617
|
if (restorableToolCalls.length > 0) {
|
|
28571
28618
|
if (!gitService) {
|
|
@@ -28788,14 +28835,14 @@ var useAgentStream = ({
|
|
|
28788
28835
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28789
28836
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28790
28837
|
const desc = legacyState?.description ?? "";
|
|
28791
|
-
const fallbackKind =
|
|
28838
|
+
const fallbackKind = Kind.Other;
|
|
28792
28839
|
const newCall = {
|
|
28793
28840
|
callId: event.requestId,
|
|
28794
28841
|
name: displayName,
|
|
28795
28842
|
originalRequestName: event.name,
|
|
28796
28843
|
description: desc,
|
|
28797
28844
|
display: event.display,
|
|
28798
|
-
status:
|
|
28845
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28799
28846
|
isClientInitiated: false,
|
|
28800
28847
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28801
28848
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28813,10 +28860,10 @@ var useAgentStream = ({
|
|
|
28813
28860
|
const evtStatus = legacyState?.status;
|
|
28814
28861
|
let status = tc.status;
|
|
28815
28862
|
if (evtStatus === "executing")
|
|
28816
|
-
status =
|
|
28817
|
-
else if (evtStatus === "error") status =
|
|
28863
|
+
status = CoreToolCallStatus.Executing;
|
|
28864
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28818
28865
|
else if (evtStatus === "success")
|
|
28819
|
-
status =
|
|
28866
|
+
status = CoreToolCallStatus.Success;
|
|
28820
28867
|
const display = event.display?.result;
|
|
28821
28868
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28822
28869
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28849,7 +28896,7 @@ var useAgentStream = ({
|
|
|
28849
28896
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28850
28897
|
return {
|
|
28851
28898
|
...tc,
|
|
28852
|
-
status: event.isError ?
|
|
28899
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28853
28900
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28854
28901
|
resultDisplay,
|
|
28855
28902
|
outputFile
|
|
@@ -28915,7 +28962,7 @@ var useAgentStream = ({
|
|
|
28915
28962
|
if (!options?.isContinuation) {
|
|
28916
28963
|
if (typeof query === "string") {
|
|
28917
28964
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28918
|
-
void logger?.logMessage(
|
|
28965
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28919
28966
|
}
|
|
28920
28967
|
startNewPrompt();
|
|
28921
28968
|
}
|
|
@@ -30442,9 +30489,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30442
30489
|
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30443
30490
|
async (choice) => {
|
|
30444
30491
|
const trustLevelMap = {
|
|
30445
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30446
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30447
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
30492
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
30493
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
30494
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
30448
30495
|
};
|
|
30449
30496
|
const trustLevel = trustLevelMap[choice];
|
|
30450
30497
|
if (!trustLevel) return;
|
|
@@ -30463,7 +30510,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30463
30510
|
}, 100);
|
|
30464
30511
|
return;
|
|
30465
30512
|
}
|
|
30466
|
-
const currentIsTrusted = trustLevel ===
|
|
30513
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30467
30514
|
onTrustChange(currentIsTrusted);
|
|
30468
30515
|
setIsTrusted(currentIsTrusted);
|
|
30469
30516
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -31471,7 +31518,7 @@ function useMessageQueue({
|
|
|
31471
31518
|
var import_react107 = __toESM(require_react(), 1);
|
|
31472
31519
|
function useMcpStatus(config) {
|
|
31473
31520
|
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31474
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31521
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31475
31522
|
);
|
|
31476
31523
|
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31477
31524
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31484,12 +31531,12 @@ function useMcpStatus(config) {
|
|
|
31484
31531
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31485
31532
|
}
|
|
31486
31533
|
};
|
|
31487
|
-
coreEvents.on(
|
|
31534
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31488
31535
|
return () => {
|
|
31489
|
-
coreEvents.off(
|
|
31536
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31490
31537
|
};
|
|
31491
31538
|
}, [config]);
|
|
31492
|
-
const isMcpReady = discoveryState ===
|
|
31539
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31493
31540
|
return {
|
|
31494
31541
|
discoveryState,
|
|
31495
31542
|
mcpServerCount,
|
|
@@ -31516,7 +31563,7 @@ function useApprovalModeIndicator({
|
|
|
31516
31563
|
(key) => {
|
|
31517
31564
|
let nextApprovalMode;
|
|
31518
31565
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31519
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31566
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31520
31567
|
if (addItem) {
|
|
31521
31568
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31522
31569
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31534,21 +31581,21 @@ function useApprovalModeIndicator({
|
|
|
31534
31581
|
}
|
|
31535
31582
|
return;
|
|
31536
31583
|
}
|
|
31537
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31584
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31538
31585
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31539
31586
|
const currentMode = config.getApprovalMode();
|
|
31540
31587
|
switch (currentMode) {
|
|
31541
|
-
case
|
|
31542
|
-
nextApprovalMode =
|
|
31588
|
+
case ApprovalMode.DEFAULT:
|
|
31589
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31543
31590
|
break;
|
|
31544
|
-
case
|
|
31545
|
-
nextApprovalMode = allowPlanMode ?
|
|
31591
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31592
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31546
31593
|
break;
|
|
31547
|
-
case
|
|
31548
|
-
nextApprovalMode =
|
|
31594
|
+
case ApprovalMode.PLAN:
|
|
31595
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31549
31596
|
break;
|
|
31550
|
-
case
|
|
31551
|
-
nextApprovalMode =
|
|
31597
|
+
case ApprovalMode.YOLO:
|
|
31598
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31552
31599
|
break;
|
|
31553
31600
|
default:
|
|
31554
31601
|
}
|
|
@@ -31958,11 +32005,11 @@ var useHookDisplayState = () => {
|
|
|
31958
32005
|
removeHook();
|
|
31959
32006
|
}
|
|
31960
32007
|
};
|
|
31961
|
-
coreEvents.on(
|
|
31962
|
-
coreEvents.on(
|
|
32008
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
32009
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31963
32010
|
return () => {
|
|
31964
|
-
coreEvents.off(
|
|
31965
|
-
coreEvents.off(
|
|
32011
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
32012
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31966
32013
|
activeTimeouts.forEach(clearTimeout);
|
|
31967
32014
|
activeTimeouts.clear();
|
|
31968
32015
|
};
|
|
@@ -32801,7 +32848,7 @@ var AppContainer = (props) => {
|
|
|
32801
32848
|
setConfigInitialized(true);
|
|
32802
32849
|
startupProfiler.flush(config);
|
|
32803
32850
|
startAutoMemoryIfEnabled(config);
|
|
32804
|
-
const sessionStartSource = resumedSessionData ?
|
|
32851
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32805
32852
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32806
32853
|
if (result) {
|
|
32807
32854
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32828,7 +32875,7 @@ var AppContainer = (props) => {
|
|
|
32828
32875
|
);
|
|
32829
32876
|
const ideClient = await IdeClient.getInstance();
|
|
32830
32877
|
await ideClient.disconnect();
|
|
32831
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32878
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32832
32879
|
};
|
|
32833
32880
|
registerCleanup(cleanupFn);
|
|
32834
32881
|
return () => {
|
|
@@ -32853,11 +32900,11 @@ var AppContainer = (props) => {
|
|
|
32853
32900
|
resetTime: payload.resetTime
|
|
32854
32901
|
});
|
|
32855
32902
|
};
|
|
32856
|
-
coreEvents.on(
|
|
32857
|
-
coreEvents.on(
|
|
32903
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32904
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32858
32905
|
return () => {
|
|
32859
|
-
coreEvents.off(
|
|
32860
|
-
coreEvents.off(
|
|
32906
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32907
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32861
32908
|
};
|
|
32862
32909
|
}, [config]);
|
|
32863
32910
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32870,16 +32917,16 @@ var AppContainer = (props) => {
|
|
|
32870
32917
|
const handleAgentsDiscovered = (payload) => {
|
|
32871
32918
|
setNewAgents(payload.agents);
|
|
32872
32919
|
};
|
|
32873
|
-
coreEvents.on(
|
|
32874
|
-
coreEvents.on(
|
|
32875
|
-
coreEvents.on(
|
|
32920
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32921
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32922
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32876
32923
|
return () => {
|
|
32877
|
-
coreEvents.off(
|
|
32924
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32878
32925
|
coreEvents.off(
|
|
32879
|
-
|
|
32926
|
+
CoreEvent.AdminSettingsChanged,
|
|
32880
32927
|
handleAdminSettingsChanged
|
|
32881
32928
|
);
|
|
32882
|
-
coreEvents.off(
|
|
32929
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32883
32930
|
};
|
|
32884
32931
|
}, [settings]);
|
|
32885
32932
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32932,10 +32979,12 @@ var AppContainer = (props) => {
|
|
|
32932
32979
|
enableMouseEvents();
|
|
32933
32980
|
disableLineWrapping();
|
|
32934
32981
|
app.rerender();
|
|
32982
|
+
} else if (config.getUseTerminalBuffer()) {
|
|
32983
|
+
app.rerender();
|
|
32935
32984
|
}
|
|
32936
32985
|
terminalCapabilityManager.enableSupportedModes();
|
|
32937
32986
|
refreshStatic();
|
|
32938
|
-
}, [refreshStatic, shouldUseAlternateScreen, app]);
|
|
32987
|
+
}, [refreshStatic, shouldUseAlternateScreen, app, config]);
|
|
32939
32988
|
const [editorError, setEditorError] = (0, import_react121.useState)(null);
|
|
32940
32989
|
const {
|
|
32941
32990
|
isEditorDialogOpen,
|
|
@@ -32944,11 +32993,11 @@ var AppContainer = (props) => {
|
|
|
32944
32993
|
exitEditorDialog
|
|
32945
32994
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32946
32995
|
(0, import_react121.useEffect)(() => {
|
|
32947
|
-
coreEvents.on(
|
|
32948
|
-
coreEvents.on(
|
|
32996
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32997
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32949
32998
|
return () => {
|
|
32950
|
-
coreEvents.off(
|
|
32951
|
-
coreEvents.off(
|
|
32999
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
33000
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32952
33001
|
};
|
|
32953
33002
|
}, [handleEditorClose, openEditorDialog]);
|
|
32954
33003
|
(0, import_react121.useEffect)(() => {
|
|
@@ -33016,7 +33065,7 @@ var AppContainer = (props) => {
|
|
|
33016
33065
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
33017
33066
|
});
|
|
33018
33067
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
33019
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
33068
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
33020
33069
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
33021
33070
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
33022
33071
|
config,
|
|
@@ -33044,7 +33093,7 @@ var AppContainer = (props) => {
|
|
|
33044
33093
|
async (authType, scope) => {
|
|
33045
33094
|
if (authType) {
|
|
33046
33095
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
33047
|
-
if (authType ===
|
|
33096
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
33048
33097
|
setAuthContext({ requiresRestart: true });
|
|
33049
33098
|
} else {
|
|
33050
33099
|
setAuthContext({});
|
|
@@ -33072,7 +33121,7 @@ var AppContainer = (props) => {
|
|
|
33072
33121
|
);
|
|
33073
33122
|
return;
|
|
33074
33123
|
}
|
|
33075
|
-
if (authType ===
|
|
33124
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
33076
33125
|
writeToStdout(`
|
|
33077
33126
|
----------------------------------------------------------------
|
|
33078
33127
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -33095,7 +33144,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33095
33144
|
}
|
|
33096
33145
|
await saveApiKey(apiKey);
|
|
33097
33146
|
await reloadApiKey();
|
|
33098
|
-
await config.refreshAuth(
|
|
33147
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
33099
33148
|
setAuthState("authenticated" /* Authenticated */);
|
|
33100
33149
|
} catch (e) {
|
|
33101
33150
|
onAuthError(
|
|
@@ -33120,7 +33169,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33120
33169
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
33121
33170
|
);
|
|
33122
33171
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
33123
|
-
if (settings.merged.security.auth.selectedType ===
|
|
33172
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
33124
33173
|
return;
|
|
33125
33174
|
}
|
|
33126
33175
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -33256,9 +33305,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33256
33305
|
}
|
|
33257
33306
|
});
|
|
33258
33307
|
};
|
|
33259
|
-
coreEvents.on(
|
|
33308
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33260
33309
|
return () => {
|
|
33261
|
-
coreEvents.off(
|
|
33310
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33262
33311
|
};
|
|
33263
33312
|
}, []);
|
|
33264
33313
|
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
@@ -33916,7 +33965,7 @@ ${queuedText}` : queuedText;
|
|
|
33916
33965
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33917
33966
|
if (settings.merged.general.devtools) {
|
|
33918
33967
|
void (async () => {
|
|
33919
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33968
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-GU2GQSOF.js");
|
|
33920
33969
|
await toggleDevToolsPanel(
|
|
33921
33970
|
config,
|
|
33922
33971
|
showErrorDetails,
|
|
@@ -34134,17 +34183,17 @@ ${queuedText}` : queuedText;
|
|
|
34134
34183
|
Date.now()
|
|
34135
34184
|
);
|
|
34136
34185
|
};
|
|
34137
|
-
coreEvents.on(
|
|
34138
|
-
coreEvents.on(
|
|
34186
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34187
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34139
34188
|
coreEvents.drainBacklogs();
|
|
34140
34189
|
return () => {
|
|
34141
|
-
coreEvents.off(
|
|
34142
|
-
coreEvents.off(
|
|
34190
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34191
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34143
34192
|
};
|
|
34144
34193
|
}, [historyManager]);
|
|
34145
34194
|
const nightly = props.version.includes("nightly");
|
|
34146
34195
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
34147
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
34196
|
+
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;
|
|
34148
34197
|
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;
|
|
34149
34198
|
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
34150
34199
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
@@ -34244,9 +34293,9 @@ ${queuedText}` : queuedText;
|
|
|
34244
34293
|
const handleMemoryChanged = (result) => {
|
|
34245
34294
|
setGeminiMdFileCount(result.fileCount);
|
|
34246
34295
|
};
|
|
34247
|
-
coreEvents.on(
|
|
34296
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34248
34297
|
return () => {
|
|
34249
|
-
coreEvents.off(
|
|
34298
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34250
34299
|
};
|
|
34251
34300
|
}, []);
|
|
34252
34301
|
(0, import_react121.useEffect)(() => {
|