@google/gemini-cli 0.57.0-preview.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/{chunk-ACDZS2RE.js → chunk-3BVBON3V.js} +1 -1
- package/bundle/{chunk-2UGGPOEV.js → chunk-3NPMAHLX.js} +1 -1
- package/bundle/{chunk-QVDXZMEX.js → chunk-4ALCU2HQ.js} +1 -1
- package/bundle/{chunk-NXS624CI.js → chunk-4SNEOO5E.js} +2 -2
- package/bundle/{chunk-73OHVDUZ.js → chunk-65C235NM.js} +7 -7
- package/bundle/{chunk-HKTHSWSS.js → chunk-AKCYXG7C.js} +7 -7
- package/bundle/{chunk-IKGOC5B6.js → chunk-ALVDOQNA.js} +1 -1
- package/bundle/{chunk-OFFEM74O.js → chunk-EAK33LFP.js} +1 -1
- package/bundle/{chunk-3C6JYNPC.js → chunk-FHDRG5U4.js} +67 -54
- package/bundle/{chunk-2UICYJMD.js → chunk-G65GW52B.js} +107 -21
- package/bundle/{chunk-WH63Z45A.js → chunk-GK7NUJ35.js} +8 -5
- package/bundle/{chunk-SHIJDXMN.js → chunk-GMQ6QNZB.js} +1 -1
- package/bundle/chunk-LNXGFWGZ.js +17332 -0
- package/bundle/{chunk-O3QB4SVS.js → chunk-MBWROXYM.js} +2 -2
- package/bundle/{chunk-W4CY7TCG.js → chunk-NMMXRZ53.js} +2 -2
- package/bundle/{chunk-R3JDAZVL.js → chunk-NPOI4K6X.js} +7771 -14363
- package/bundle/{chunk-QB46S6FV.js → chunk-NQ4RH42O.js} +9 -8
- package/bundle/{chunk-FWGOOSQK.js → chunk-O7SBKM7M.js} +112 -20
- package/bundle/{chunk-M6E5CLIH.js → chunk-Q73BPF7A.js} +1 -1
- package/bundle/{chunk-XDJMDRLM.js → chunk-QJP6CMLN.js} +3 -3
- package/bundle/{chunk-EBKNEOAO.js → chunk-RLDNUS35.js} +1 -1
- package/bundle/{chunk-H2URGA7U.js → chunk-S5UX3QS5.js} +3 -3
- package/bundle/{chunk-XZF4EZOQ.js → chunk-SCBVGZXH.js} +1 -1
- package/bundle/chunk-SWQAIZEQ.js +102506 -0
- package/bundle/{chunk-6S4UF4JM.js → chunk-UMQE7UC6.js} +3 -3
- package/bundle/{chunk-ZY7Z5W6K.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-JP2FD3CQ.js → cleanup-2W5DPMY3.js} +2 -2
- package/bundle/{cleanup-YFIFTNZ6.js → cleanup-OTHE7RNU.js} +2 -2
- package/bundle/{cleanup-Z65H2CUW.js → cleanup-SM67K64R.js} +2 -2
- package/bundle/cleanup-XAUT5CMD.js +32 -0
- package/bundle/{core-UBOS4Q6R.js → core-US34OW5M.js} +7 -1
- package/bundle/{devtoolsService-A34WT2MQ.js → devtoolsService-5J53UK6Z.js} +2 -2
- package/bundle/{devtoolsService-ACKZ7HRR.js → devtoolsService-GU2GQSOF.js} +2 -2
- package/bundle/{devtoolsService-BHG3WQEY.js → devtoolsService-JBFUXTCT.js} +4 -3
- package/bundle/devtoolsService-V46GUHRF.js +4359 -0
- package/bundle/{dist-B7OLK6PK.js → dist-5TYMQVIZ.js} +7 -1
- package/bundle/{core-EKXLT2AG.js → dist-OWKHVWTR.js} +7 -1
- package/bundle/dist-V5VJYW6J.js +2180 -0
- package/bundle/{gemini-3U3DNSSI.js → gemini-3M22N2C3.js} +13 -13
- package/bundle/{gemini-NJXFBFVJ.js → gemini-LSMTDETS.js} +214 -198
- package/bundle/gemini-OZOYJF22.js +17091 -0
- package/bundle/{gemini-7Z3ODIIX.js → gemini-W2B6CLJC.js} +13 -13
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-FIWFPOOG.js → interactiveCli-D6H37PJQ.js} +40 -18
- package/bundle/{interactiveCli-DNV4GCM5.js → interactiveCli-L3ZXOVEV.js} +347 -306
- package/bundle/{interactiveCli-LMXAWUCU.js → interactiveCli-LQJM6LRE.js} +40 -18
- package/bundle/interactiveCli-RGOYDSMH.js +34984 -0
- package/bundle/{liteRtServerManager-P62A6ZVG.js → liteRtServerManager-3BY6TBHG.js} +4 -4
- package/bundle/{liteRtServerManager-VBKDVKLU.js → liteRtServerManager-C5WZRQUF.js} +4 -4
- package/bundle/{liteRtServerManager-LQMOE7JK.js → liteRtServerManager-IGKUGGP4.js} +4 -4
- package/bundle/liteRtServerManager-IJ4I2PZA.js +65 -0
- package/bundle/{oauth2-provider-FWKP5A4D.js → oauth2-provider-KSRLPOK3.js} +1 -1
- package/bundle/{oauth2-provider-BKNKX6FS.js → oauth2-provider-RWKTMYJF.js} +1 -1
- package/bundle/{oauth2-provider-UPRM4Y2J.js → oauth2-provider-VHNLCU4Y.js} +38 -72
- package/bundle/oauth2-provider-ZT4OFVMK.js +235 -0
- package/bundle/{start-DG3DHS3K.js → start-EXAQFM4Y.js} +6 -6
- package/bundle/{start-Y2JKSYXK.js → start-IPZF32E3.js} +6 -6
- package/bundle/{start-BMBCT2CF.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
|
}
|
|
@@ -15511,11 +15530,11 @@ var PrivacyNoticeText = ({
|
|
|
15511
15530
|
}) => {
|
|
15512
15531
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15513
15532
|
switch (authType) {
|
|
15514
|
-
case
|
|
15533
|
+
case AuthType.USE_GEMINI:
|
|
15515
15534
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15516
|
-
case
|
|
15535
|
+
case AuthType.USE_VERTEX_AI:
|
|
15517
15536
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15518
|
-
case
|
|
15537
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15519
15538
|
default:
|
|
15520
15539
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15521
15540
|
}
|
|
@@ -15575,7 +15594,7 @@ function ProQuotaDialog({
|
|
|
15575
15594
|
value: "retry_always",
|
|
15576
15595
|
key: "retry_always"
|
|
15577
15596
|
},
|
|
15578
|
-
...authType ===
|
|
15597
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15579
15598
|
{
|
|
15580
15599
|
label: "Upgrade for higher limits",
|
|
15581
15600
|
value: "upgrade",
|
|
@@ -16734,7 +16753,7 @@ function ModelDialog({ onClose }) {
|
|
|
16734
16753
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
16735
16754
|
const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
|
|
16736
16755
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16737
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16756
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16738
16757
|
const manualModelSelected = (0, import_react55.useMemo)(() => {
|
|
16739
16758
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16740
16759
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -18058,10 +18077,10 @@ function initializeConsoleStore() {
|
|
|
18058
18077
|
globalConsoleMessages = [];
|
|
18059
18078
|
globalErrorCount = 0;
|
|
18060
18079
|
notifyListeners();
|
|
18061
|
-
coreEvents.off(
|
|
18062
|
-
coreEvents.off(
|
|
18063
|
-
coreEvents.on(
|
|
18064
|
-
coreEvents.on(
|
|
18080
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18081
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
18082
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18083
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
18065
18084
|
}
|
|
18066
18085
|
function notifyListeners() {
|
|
18067
18086
|
for (const listener of listeners) {
|
|
@@ -20198,7 +20217,7 @@ function usePromptCompletion({
|
|
|
20198
20217
|
{ model: "prompt-completion" },
|
|
20199
20218
|
contents,
|
|
20200
20219
|
signal,
|
|
20201
|
-
|
|
20220
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20202
20221
|
);
|
|
20203
20222
|
if (signal.aborted) {
|
|
20204
20223
|
return;
|
|
@@ -22270,9 +22289,9 @@ var InputPrompt = ({
|
|
|
22270
22289
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22271
22290
|
}
|
|
22272
22291
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22273
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22274
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22275
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22292
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22293
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22294
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22276
22295
|
let statusColor;
|
|
22277
22296
|
let statusText = "";
|
|
22278
22297
|
if (shellModeActive) {
|
|
@@ -23105,22 +23124,22 @@ var ApprovalModeIndicator = ({
|
|
|
23105
23124
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
23106
23125
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
23107
23126
|
switch (approvalMode) {
|
|
23108
|
-
case
|
|
23127
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23109
23128
|
textColor = theme.status.warning;
|
|
23110
23129
|
textContent = "auto-accept edits";
|
|
23111
23130
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23112
23131
|
break;
|
|
23113
|
-
case
|
|
23132
|
+
case ApprovalMode.PLAN:
|
|
23114
23133
|
textColor = theme.status.success;
|
|
23115
23134
|
textContent = "plan";
|
|
23116
23135
|
subText = `${cycleHint} to manual`;
|
|
23117
23136
|
break;
|
|
23118
|
-
case
|
|
23137
|
+
case ApprovalMode.YOLO:
|
|
23119
23138
|
textColor = theme.status.error;
|
|
23120
23139
|
textContent = "YOLO";
|
|
23121
23140
|
subText = yoloHint;
|
|
23122
23141
|
break;
|
|
23123
|
-
case
|
|
23142
|
+
case ApprovalMode.DEFAULT:
|
|
23124
23143
|
default:
|
|
23125
23144
|
textColor = theme.text.accent;
|
|
23126
23145
|
textContent = "";
|
|
@@ -23168,7 +23187,7 @@ var useComposerStatus = () => {
|
|
|
23168
23187
|
(item) => item.type === "tool_group"
|
|
23169
23188
|
).some(
|
|
23170
23189
|
(item) => item.tools.some(
|
|
23171
|
-
(tool) => tool.status ===
|
|
23190
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23172
23191
|
)
|
|
23173
23192
|
),
|
|
23174
23193
|
[uiState.pendingHistoryItems]
|
|
@@ -23183,13 +23202,13 @@ var useComposerStatus = () => {
|
|
|
23183
23202
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23184
23203
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23185
23204
|
switch (showApprovalModeIndicator) {
|
|
23186
|
-
case
|
|
23205
|
+
case ApprovalMode.YOLO:
|
|
23187
23206
|
return { text: "YOLO", color: theme.status.error };
|
|
23188
|
-
case
|
|
23207
|
+
case ApprovalMode.PLAN:
|
|
23189
23208
|
return { text: "plan", color: theme.status.success };
|
|
23190
|
-
case
|
|
23209
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23191
23210
|
return { text: "auto edit", color: theme.status.warning };
|
|
23192
|
-
case
|
|
23211
|
+
case ApprovalMode.DEFAULT:
|
|
23193
23212
|
default:
|
|
23194
23213
|
return null;
|
|
23195
23214
|
}
|
|
@@ -23543,7 +23562,7 @@ var ConfigInitDisplay = ({
|
|
|
23543
23562
|
let connected = 0;
|
|
23544
23563
|
const connecting = [];
|
|
23545
23564
|
for (const [name, client] of clients.entries()) {
|
|
23546
|
-
if (client.getStatus() ===
|
|
23565
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23547
23566
|
connected++;
|
|
23548
23567
|
} else {
|
|
23549
23568
|
connecting.push(name);
|
|
@@ -23565,9 +23584,9 @@ var ConfigInitDisplay = ({
|
|
|
23565
23584
|
);
|
|
23566
23585
|
}
|
|
23567
23586
|
};
|
|
23568
|
-
coreEvents.on(
|
|
23587
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23569
23588
|
return () => {
|
|
23570
|
-
coreEvents.off(
|
|
23589
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23571
23590
|
};
|
|
23572
23591
|
}, [initialMessage]);
|
|
23573
23592
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
|
|
@@ -24284,7 +24303,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24284
24303
|
callId,
|
|
24285
24304
|
name: SHELL_COMMAND_NAME,
|
|
24286
24305
|
description: rawQuery,
|
|
24287
|
-
status:
|
|
24306
|
+
status: CoreToolCallStatus.Executing,
|
|
24288
24307
|
isClientInitiated: true,
|
|
24289
24308
|
resultDisplay: "",
|
|
24290
24309
|
confirmationDetails: void 0
|
|
@@ -24425,7 +24444,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24425
24444
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24426
24445
|
}
|
|
24427
24446
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24428
|
-
let finalStatus =
|
|
24447
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24429
24448
|
const prependToAnsiOutput = (output, text) => {
|
|
24430
24449
|
const newLines = text.split("\n").map((line) => [
|
|
24431
24450
|
{
|
|
@@ -24444,20 +24463,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24444
24463
|
};
|
|
24445
24464
|
let prefix = "";
|
|
24446
24465
|
if (result.error) {
|
|
24447
|
-
finalStatus =
|
|
24466
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24448
24467
|
prefix = result.error.message;
|
|
24449
24468
|
} else if (result.aborted) {
|
|
24450
|
-
finalStatus =
|
|
24469
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24451
24470
|
prefix = "Command was cancelled.";
|
|
24452
24471
|
} else if (result.backgrounded) {
|
|
24453
|
-
finalStatus =
|
|
24472
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24454
24473
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24455
24474
|
mainContent = finalOutput;
|
|
24456
24475
|
} else if (result.signal) {
|
|
24457
|
-
finalStatus =
|
|
24476
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24458
24477
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24459
24478
|
} else if (result.exitCode !== 0) {
|
|
24460
|
-
finalStatus =
|
|
24479
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24461
24480
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24462
24481
|
}
|
|
24463
24482
|
if (prefix) {
|
|
@@ -24483,7 +24502,7 @@ ${mainContent}`;
|
|
|
24483
24502
|
status: finalStatus,
|
|
24484
24503
|
resultDisplay: finalOutput
|
|
24485
24504
|
};
|
|
24486
|
-
if (finalStatus !==
|
|
24505
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24487
24506
|
addItemToHistory(
|
|
24488
24507
|
{
|
|
24489
24508
|
type: "tool_group",
|
|
@@ -25493,13 +25512,13 @@ function useQuotaAndFallback({
|
|
|
25493
25512
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25494
25513
|
`/stats model for usage details`,
|
|
25495
25514
|
`/model to switch models.`,
|
|
25496
|
-
contentGeneratorConfig?.authType ===
|
|
25515
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25497
25516
|
].filter(Boolean);
|
|
25498
25517
|
message = messageLines.join("\n");
|
|
25499
25518
|
}
|
|
25500
25519
|
} else if (error instanceof ModelNotFoundError) {
|
|
25501
25520
|
isModelNotFoundError = true;
|
|
25502
|
-
if (contentGeneratorConfig?.authType ===
|
|
25521
|
+
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
25503
25522
|
const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
|
|
25504
25523
|
const messageLines = [
|
|
25505
25524
|
`Model "${failedModel}" is not available in region "${location}".`,
|
|
@@ -25693,7 +25712,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25693
25712
|
);
|
|
25694
25713
|
setEditorError(null);
|
|
25695
25714
|
setIsEditorDialogOpen(false);
|
|
25696
|
-
coreEvents.emit(
|
|
25715
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25697
25716
|
} catch (error) {
|
|
25698
25717
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25699
25718
|
}
|
|
@@ -25702,7 +25721,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25702
25721
|
);
|
|
25703
25722
|
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25704
25723
|
setIsEditorDialogOpen(false);
|
|
25705
|
-
coreEvents.emit(
|
|
25724
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25706
25725
|
}, []);
|
|
25707
25726
|
return {
|
|
25708
25727
|
isEditorDialogOpen,
|
|
@@ -26079,7 +26098,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26079
26098
|
canonicalPath: resolvedCommandPath
|
|
26080
26099
|
} = parseSlashCommand(trimmed, commands);
|
|
26081
26100
|
if (!commandToExecute) {
|
|
26082
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
26101
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
26083
26102
|
if (isMcpLoading) {
|
|
26084
26103
|
setIsProcessing(true);
|
|
26085
26104
|
if (addToHistory) {
|
|
@@ -26259,7 +26278,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26259
26278
|
onConfirm: async (resolvedOutcome) => {
|
|
26260
26279
|
resolve3({
|
|
26261
26280
|
outcome: resolvedOutcome,
|
|
26262
|
-
approvedCommands: resolvedOutcome ===
|
|
26281
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26263
26282
|
});
|
|
26264
26283
|
}
|
|
26265
26284
|
};
|
|
@@ -26267,7 +26286,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26267
26286
|
callId,
|
|
26268
26287
|
name: "Expansion",
|
|
26269
26288
|
description: "Command expansion needs shell access",
|
|
26270
|
-
status:
|
|
26289
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26271
26290
|
isClientInitiated: true,
|
|
26272
26291
|
resultDisplay: void 0,
|
|
26273
26292
|
confirmationDetails
|
|
@@ -26278,7 +26297,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26278
26297
|
});
|
|
26279
26298
|
});
|
|
26280
26299
|
setPendingItem(null);
|
|
26281
|
-
if (outcome ===
|
|
26300
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26282
26301
|
addItem(
|
|
26283
26302
|
{
|
|
26284
26303
|
type: "info" /* INFO */,
|
|
@@ -26288,7 +26307,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26288
26307
|
);
|
|
26289
26308
|
return { type: "handled" };
|
|
26290
26309
|
}
|
|
26291
|
-
if (outcome ===
|
|
26310
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26292
26311
|
setSessionShellAllowlist(
|
|
26293
26312
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26294
26313
|
);
|
|
@@ -26764,7 +26783,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26764
26783
|
let description;
|
|
26765
26784
|
let renderOutputAsMarkdown = false;
|
|
26766
26785
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26767
|
-
if (call.status ===
|
|
26786
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26768
26787
|
description = JSON.stringify(call.request.args);
|
|
26769
26788
|
} else {
|
|
26770
26789
|
description = call.invocation.getDescription();
|
|
@@ -26787,27 +26806,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26787
26806
|
let progress = void 0;
|
|
26788
26807
|
let progressTotal = void 0;
|
|
26789
26808
|
switch (call.status) {
|
|
26790
|
-
case
|
|
26809
|
+
case CoreToolCallStatus.Success:
|
|
26791
26810
|
resultDisplay = call.response.resultDisplay;
|
|
26792
26811
|
outputFile = call.response.outputFile;
|
|
26793
26812
|
break;
|
|
26794
|
-
case
|
|
26795
|
-
case
|
|
26813
|
+
case CoreToolCallStatus.Error:
|
|
26814
|
+
case CoreToolCallStatus.Cancelled:
|
|
26796
26815
|
resultDisplay = call.response.resultDisplay;
|
|
26797
26816
|
break;
|
|
26798
|
-
case
|
|
26817
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26799
26818
|
correlationId = call.correlationId;
|
|
26800
26819
|
confirmationDetails = call.confirmationDetails;
|
|
26801
26820
|
break;
|
|
26802
|
-
case
|
|
26821
|
+
case CoreToolCallStatus.Executing:
|
|
26803
26822
|
resultDisplay = call.liveOutput;
|
|
26804
26823
|
ptyId = call.pid;
|
|
26805
26824
|
progressMessage = call.progressMessage;
|
|
26806
26825
|
progress = call.progress;
|
|
26807
26826
|
progressTotal = call.progressTotal;
|
|
26808
26827
|
break;
|
|
26809
|
-
case
|
|
26810
|
-
case
|
|
26828
|
+
case CoreToolCallStatus.Scheduled:
|
|
26829
|
+
case CoreToolCallStatus.Validating:
|
|
26811
26830
|
break;
|
|
26812
26831
|
default: {
|
|
26813
26832
|
const exhaustiveCheck = call;
|
|
@@ -26878,7 +26897,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26878
26897
|
const handler = (event) => {
|
|
26879
26898
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26880
26899
|
const hasExecuting = event.toolCalls.some(
|
|
26881
|
-
(tc) => tc.status ===
|
|
26900
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26882
26901
|
);
|
|
26883
26902
|
if (hasExecuting) {
|
|
26884
26903
|
setLastToolOutputTime(Date.now());
|
|
@@ -26887,7 +26906,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26887
26906
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26888
26907
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26889
26908
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26890
|
-
(tc) => tc.status ===
|
|
26909
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26891
26910
|
);
|
|
26892
26911
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26893
26912
|
return prev;
|
|
@@ -26899,9 +26918,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26899
26918
|
};
|
|
26900
26919
|
});
|
|
26901
26920
|
};
|
|
26902
|
-
messageBus.subscribe(
|
|
26921
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26903
26922
|
return () => {
|
|
26904
|
-
messageBus.unsubscribe(
|
|
26923
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26905
26924
|
};
|
|
26906
26925
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26907
26926
|
(0, import_react98.useEffect)(() => {
|
|
@@ -26923,9 +26942,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26923
26942
|
};
|
|
26924
26943
|
});
|
|
26925
26944
|
};
|
|
26926
|
-
messageBus.subscribe(
|
|
26945
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26927
26946
|
return () => {
|
|
26928
|
-
messageBus.unsubscribe(
|
|
26947
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26929
26948
|
};
|
|
26930
26949
|
}, [messageBus]);
|
|
26931
26950
|
const schedule = (0, import_react98.useCallback)(
|
|
@@ -27024,8 +27043,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
27024
27043
|
const prev = prevMap.get(coreCall.request.callId);
|
|
27025
27044
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
27026
27045
|
let status = coreCall.status;
|
|
27027
|
-
if ((status ===
|
|
27028
|
-
status =
|
|
27046
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
27047
|
+
status = CoreToolCallStatus.Executing;
|
|
27029
27048
|
}
|
|
27030
27049
|
return {
|
|
27031
27050
|
...coreCall,
|
|
@@ -27057,7 +27076,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
27057
27076
|
};
|
|
27058
27077
|
}
|
|
27059
27078
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
27060
|
-
return toolCall.status ===
|
|
27079
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
27061
27080
|
}
|
|
27062
27081
|
function showCitations(settings) {
|
|
27063
27082
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -27067,14 +27086,14 @@ function showCitations(settings) {
|
|
|
27067
27086
|
return true;
|
|
27068
27087
|
}
|
|
27069
27088
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
27070
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
27089
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
27071
27090
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
27072
27091
|
}
|
|
27073
27092
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
27074
|
-
if (tc.status ===
|
|
27093
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
27075
27094
|
return true;
|
|
27076
27095
|
}
|
|
27077
|
-
if (tc.status ===
|
|
27096
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
27078
27097
|
return !tc.responseSubmittedToGemini;
|
|
27079
27098
|
}
|
|
27080
27099
|
return false;
|
|
@@ -27096,6 +27115,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27096
27115
|
const abortControllerRef = (0, import_react99.useRef)(null);
|
|
27097
27116
|
const turnCancelledRef = (0, import_react99.useRef)(false);
|
|
27098
27117
|
const activeQueryIdRef = (0, import_react99.useRef)(null);
|
|
27118
|
+
const historyLengthAfterUserPromptRef = (0, import_react99.useRef)(void 0);
|
|
27099
27119
|
const previousApprovalModeRef = (0, import_react99.useRef)(
|
|
27100
27120
|
config.getApprovalMode()
|
|
27101
27121
|
);
|
|
@@ -27120,9 +27140,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27120
27140
|
}
|
|
27121
27141
|
setRetryStatus(payload);
|
|
27122
27142
|
};
|
|
27123
|
-
coreEvents.on(
|
|
27143
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27124
27144
|
return () => {
|
|
27125
|
-
coreEvents.off(
|
|
27145
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27126
27146
|
};
|
|
27127
27147
|
}, [isRespondingRef]);
|
|
27128
27148
|
const [
|
|
@@ -27255,12 +27275,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27255
27275
|
const tc = toolCalls[i];
|
|
27256
27276
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27257
27277
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27258
|
-
const isAgent = tc.tool?.kind ===
|
|
27278
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27259
27279
|
if (isAgent) {
|
|
27260
27280
|
let contigAgentsComplete = true;
|
|
27261
27281
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27262
27282
|
const nextTc = toolCalls[j];
|
|
27263
|
-
if (nextTc.tool?.kind ===
|
|
27283
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27264
27284
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27265
27285
|
contigAgentsComplete = false;
|
|
27266
27286
|
break;
|
|
@@ -27286,7 +27306,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27286
27306
|
let currentGroup = [];
|
|
27287
27307
|
for (const tc of toolsToPush) {
|
|
27288
27308
|
newPushed.add(tc.request.callId);
|
|
27289
|
-
if (tc.tool?.kind ===
|
|
27309
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27290
27310
|
currentGroup.push(tc);
|
|
27291
27311
|
} else {
|
|
27292
27312
|
if (currentGroup.length > 0) {
|
|
@@ -27422,6 +27442,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27422
27442
|
const lastQueryRef = (0, import_react99.useRef)(null);
|
|
27423
27443
|
const lastPromptIdRef = (0, import_react99.useRef)(null);
|
|
27424
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);
|
|
27425
27448
|
const [
|
|
27426
27449
|
loopDetectionConfirmationRequest,
|
|
27427
27450
|
setLoopDetectionConfirmationRequest
|
|
@@ -27436,7 +27459,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27436
27459
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27437
27460
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27438
27461
|
(0, import_react99.useEffect)(() => {
|
|
27439
|
-
if (config.getApprovalMode() ===
|
|
27462
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27440
27463
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27441
27464
|
(item) => item.type === "user" /* USER */
|
|
27442
27465
|
);
|
|
@@ -27504,7 +27527,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27504
27527
|
return;
|
|
27505
27528
|
}
|
|
27506
27529
|
const hasActiveTools = toolCalls.some(
|
|
27507
|
-
(tc) => tc.status ===
|
|
27530
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27508
27531
|
);
|
|
27509
27532
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27510
27533
|
if (clearBuffer) {
|
|
@@ -27531,7 +27554,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27531
27554
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27532
27555
|
return {
|
|
27533
27556
|
...tool,
|
|
27534
|
-
status:
|
|
27557
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27535
27558
|
resultDisplay: tool.resultDisplay
|
|
27536
27559
|
};
|
|
27537
27560
|
}
|
|
@@ -27596,7 +27619,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27596
27619
|
let localQueryToSendToGemini = null;
|
|
27597
27620
|
if (typeof query === "string") {
|
|
27598
27621
|
const trimmedQuery = query.trim();
|
|
27599
|
-
await logger?.logMessage(
|
|
27622
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27600
27623
|
if (!shellModeActive) {
|
|
27601
27624
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27602
27625
|
if (slashCommandResult) {
|
|
@@ -27752,7 +27775,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27752
27775
|
if (pendingHistoryItemRef.current) {
|
|
27753
27776
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27754
27777
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27755
|
-
(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
|
|
27756
27779
|
);
|
|
27757
27780
|
const pendingItem = {
|
|
27758
27781
|
...pendingHistoryItemRef.current,
|
|
@@ -28040,19 +28063,19 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28040
28063
|
]
|
|
28041
28064
|
);
|
|
28042
28065
|
const processGeminiStreamEvents = (0, import_react99.useCallback)(
|
|
28043
|
-
async (stream, userMessageTimestamp, signal) => {
|
|
28066
|
+
async (stream, userMessageTimestamp, signal, isContinuation, prompt_id) => {
|
|
28044
28067
|
let geminiMessageBuffer = "";
|
|
28045
28068
|
const toolCallRequests = [];
|
|
28046
28069
|
for await (const event of stream) {
|
|
28047
|
-
if (event.type !==
|
|
28070
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
28048
28071
|
setThought(null);
|
|
28049
28072
|
}
|
|
28050
28073
|
switch (event.type) {
|
|
28051
|
-
case
|
|
28074
|
+
case GeminiEventType.Thought:
|
|
28052
28075
|
setLastGeminiActivityTime(Date.now());
|
|
28053
28076
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
28054
28077
|
break;
|
|
28055
|
-
case
|
|
28078
|
+
case GeminiEventType.Content:
|
|
28056
28079
|
setLastGeminiActivityTime(Date.now());
|
|
28057
28080
|
geminiMessageBuffer = handleContentEvent(
|
|
28058
28081
|
event.value,
|
|
@@ -28060,16 +28083,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28060
28083
|
userMessageTimestamp
|
|
28061
28084
|
);
|
|
28062
28085
|
break;
|
|
28063
|
-
case
|
|
28086
|
+
case GeminiEventType.ToolCallRequest:
|
|
28064
28087
|
toolCallRequests.push(event.value);
|
|
28065
28088
|
break;
|
|
28066
|
-
case
|
|
28089
|
+
case GeminiEventType.UserCancelled:
|
|
28067
28090
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
28068
28091
|
break;
|
|
28069
|
-
case
|
|
28092
|
+
case GeminiEventType.Error:
|
|
28070
28093
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
28071
28094
|
break;
|
|
28072
|
-
case
|
|
28095
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
28073
28096
|
handleAgentExecutionStoppedEvent(
|
|
28074
28097
|
event.value.reason,
|
|
28075
28098
|
userMessageTimestamp,
|
|
@@ -28077,7 +28100,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28077
28100
|
event.value.contextCleared
|
|
28078
28101
|
);
|
|
28079
28102
|
break;
|
|
28080
|
-
case
|
|
28103
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
28081
28104
|
handleAgentExecutionBlockedEvent(
|
|
28082
28105
|
event.value.reason,
|
|
28083
28106
|
userMessageTimestamp,
|
|
@@ -28085,36 +28108,36 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28085
28108
|
event.value.contextCleared
|
|
28086
28109
|
);
|
|
28087
28110
|
break;
|
|
28088
|
-
case
|
|
28111
|
+
case GeminiEventType.ChatCompressed:
|
|
28089
28112
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
28090
28113
|
break;
|
|
28091
|
-
case
|
|
28092
|
-
case
|
|
28114
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
28115
|
+
case GeminiEventType.ToolCallResponse:
|
|
28093
28116
|
break;
|
|
28094
|
-
case
|
|
28117
|
+
case GeminiEventType.MaxSessionTurns:
|
|
28095
28118
|
handleMaxSessionTurnsEvent();
|
|
28096
28119
|
break;
|
|
28097
|
-
case
|
|
28120
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
28098
28121
|
handleContextWindowWillOverflowEvent(
|
|
28099
28122
|
event.value.estimatedRequestTokenCount,
|
|
28100
28123
|
event.value.remainingTokenCount
|
|
28101
28124
|
);
|
|
28102
28125
|
break;
|
|
28103
|
-
case
|
|
28126
|
+
case GeminiEventType.Finished:
|
|
28104
28127
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
28105
28128
|
break;
|
|
28106
|
-
case
|
|
28129
|
+
case GeminiEventType.Citation:
|
|
28107
28130
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
28108
28131
|
break;
|
|
28109
|
-
case
|
|
28132
|
+
case GeminiEventType.ModelInfo:
|
|
28110
28133
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
28111
28134
|
break;
|
|
28112
|
-
case
|
|
28135
|
+
case GeminiEventType.LoopDetected:
|
|
28113
28136
|
loopDetectedRef.current = true;
|
|
28114
28137
|
break;
|
|
28115
|
-
case
|
|
28138
|
+
case GeminiEventType.Retry:
|
|
28116
28139
|
break;
|
|
28117
|
-
case
|
|
28140
|
+
case GeminiEventType.InvalidStream:
|
|
28118
28141
|
handleInvalidStreamEvent(event.value, userMessageTimestamp);
|
|
28119
28142
|
break;
|
|
28120
28143
|
default: {
|
|
@@ -28129,6 +28152,17 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28129
28152
|
setPendingHistoryItem(null);
|
|
28130
28153
|
}
|
|
28131
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
|
+
}
|
|
28132
28166
|
}
|
|
28133
28167
|
return 0 /* Completed */;
|
|
28134
28168
|
},
|
|
@@ -28157,7 +28191,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28157
28191
|
const submitQuery = (0, import_react99.useCallback)(
|
|
28158
28192
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
28159
28193
|
{
|
|
28160
|
-
operation: options?.isContinuation ?
|
|
28194
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
28161
28195
|
sessionId: config.getSessionId()
|
|
28162
28196
|
},
|
|
28163
28197
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28168,6 +28202,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28168
28202
|
activeQueryIdRef.current = queryId;
|
|
28169
28203
|
const userMessageTimestamp = Date.now();
|
|
28170
28204
|
if (!options?.isContinuation) {
|
|
28205
|
+
autoNudgeAttemptCountRef.current = 0;
|
|
28171
28206
|
setModelSwitchedFromQuotaError(false);
|
|
28172
28207
|
config.setQuotaErrorOccurred(false);
|
|
28173
28208
|
config.resetBillingTurnState(
|
|
@@ -28193,6 +28228,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28193
28228
|
if (!shouldProceed || queryToSend === null) {
|
|
28194
28229
|
return;
|
|
28195
28230
|
}
|
|
28231
|
+
if (geminiClient) {
|
|
28232
|
+
historyLengthAfterUserPromptRef.current = geminiClient.getHistory().length;
|
|
28233
|
+
}
|
|
28196
28234
|
if (!options?.isContinuation) {
|
|
28197
28235
|
if (typeof queryToSend === "string") {
|
|
28198
28236
|
const promptText = queryToSend;
|
|
@@ -28224,7 +28262,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28224
28262
|
const processingStatus = await processGeminiStreamEvents(
|
|
28225
28263
|
stream,
|
|
28226
28264
|
userMessageTimestamp,
|
|
28227
|
-
abortSignal
|
|
28265
|
+
abortSignal,
|
|
28266
|
+
options?.isContinuation,
|
|
28267
|
+
prompt_id
|
|
28228
28268
|
);
|
|
28229
28269
|
if (processingStatus === 1 /* UserCancelled */) {
|
|
28230
28270
|
return;
|
|
@@ -28315,9 +28355,10 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28315
28355
|
setIsResponding
|
|
28316
28356
|
]
|
|
28317
28357
|
);
|
|
28358
|
+
submitQueryRef.current = submitQuery;
|
|
28318
28359
|
const handleApprovalModeChange = (0, import_react99.useCallback)(
|
|
28319
28360
|
async (newApprovalMode) => {
|
|
28320
|
-
if (previousApprovalModeRef.current ===
|
|
28361
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28321
28362
|
if (geminiClient) {
|
|
28322
28363
|
try {
|
|
28323
28364
|
await geminiClient.addHistory({
|
|
@@ -28340,11 +28381,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28340
28381
|
}
|
|
28341
28382
|
}
|
|
28342
28383
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28343
|
-
if (newApprovalMode ===
|
|
28384
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28344
28385
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28345
28386
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28346
28387
|
);
|
|
28347
|
-
if (newApprovalMode ===
|
|
28388
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28348
28389
|
awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
|
|
28349
28390
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
28350
28391
|
return true;
|
|
@@ -28360,11 +28401,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28360
28401
|
if (call.correlationId) {
|
|
28361
28402
|
try {
|
|
28362
28403
|
await config.getMessageBus().publish({
|
|
28363
|
-
type:
|
|
28404
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28364
28405
|
correlationId: call.correlationId,
|
|
28365
28406
|
confirmed: true,
|
|
28366
28407
|
requiresUserConfirmation: false,
|
|
28367
|
-
outcome:
|
|
28408
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28368
28409
|
});
|
|
28369
28410
|
} catch (error) {
|
|
28370
28411
|
debugLogger.warn(
|
|
@@ -28455,14 +28496,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28455
28496
|
);
|
|
28456
28497
|
if (isLowErrorVerbosity) {
|
|
28457
28498
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28458
|
-
(tc) => tc.status ===
|
|
28499
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28459
28500
|
).length;
|
|
28460
28501
|
}
|
|
28461
28502
|
if (geminiTools.length === 0) {
|
|
28462
28503
|
return;
|
|
28463
28504
|
}
|
|
28464
28505
|
const stopExecutionTool = geminiTools.find(
|
|
28465
|
-
(tc) => tc.response.errorType ===
|
|
28506
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28466
28507
|
);
|
|
28467
28508
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28468
28509
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28482,9 +28523,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28482
28523
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28483
28524
|
);
|
|
28484
28525
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28485
|
-
(tc) => tc.status ===
|
|
28526
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28486
28527
|
);
|
|
28487
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28528
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28488
28529
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28489
28530
|
if (!turnCancelledRef.current) {
|
|
28490
28531
|
addItem({
|
|
@@ -28493,14 +28534,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28493
28534
|
});
|
|
28494
28535
|
}
|
|
28495
28536
|
setIsResponding(false);
|
|
28496
|
-
if (geminiClient) {
|
|
28497
|
-
const
|
|
28498
|
-
|
|
28499
|
-
|
|
28500
|
-
|
|
28501
|
-
|
|
28502
|
-
|
|
28503
|
-
|
|
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;
|
|
28504
28545
|
}
|
|
28505
28546
|
const callIdsToMarkAsSubmitted2 = geminiTools.map(
|
|
28506
28547
|
(toolCall) => toolCall.request.callId
|
|
@@ -28571,7 +28612,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28571
28612
|
return;
|
|
28572
28613
|
}
|
|
28573
28614
|
const restorableToolCalls = toolCalls.filter(
|
|
28574
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28615
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28575
28616
|
);
|
|
28576
28617
|
if (restorableToolCalls.length > 0) {
|
|
28577
28618
|
if (!gitService) {
|
|
@@ -28794,14 +28835,14 @@ var useAgentStream = ({
|
|
|
28794
28835
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28795
28836
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28796
28837
|
const desc = legacyState?.description ?? "";
|
|
28797
|
-
const fallbackKind =
|
|
28838
|
+
const fallbackKind = Kind.Other;
|
|
28798
28839
|
const newCall = {
|
|
28799
28840
|
callId: event.requestId,
|
|
28800
28841
|
name: displayName,
|
|
28801
28842
|
originalRequestName: event.name,
|
|
28802
28843
|
description: desc,
|
|
28803
28844
|
display: event.display,
|
|
28804
|
-
status:
|
|
28845
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28805
28846
|
isClientInitiated: false,
|
|
28806
28847
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28807
28848
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28819,10 +28860,10 @@ var useAgentStream = ({
|
|
|
28819
28860
|
const evtStatus = legacyState?.status;
|
|
28820
28861
|
let status = tc.status;
|
|
28821
28862
|
if (evtStatus === "executing")
|
|
28822
|
-
status =
|
|
28823
|
-
else if (evtStatus === "error") status =
|
|
28863
|
+
status = CoreToolCallStatus.Executing;
|
|
28864
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28824
28865
|
else if (evtStatus === "success")
|
|
28825
|
-
status =
|
|
28866
|
+
status = CoreToolCallStatus.Success;
|
|
28826
28867
|
const display = event.display?.result;
|
|
28827
28868
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28828
28869
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28855,7 +28896,7 @@ var useAgentStream = ({
|
|
|
28855
28896
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28856
28897
|
return {
|
|
28857
28898
|
...tc,
|
|
28858
|
-
status: event.isError ?
|
|
28899
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28859
28900
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28860
28901
|
resultDisplay,
|
|
28861
28902
|
outputFile
|
|
@@ -28921,7 +28962,7 @@ var useAgentStream = ({
|
|
|
28921
28962
|
if (!options?.isContinuation) {
|
|
28922
28963
|
if (typeof query === "string") {
|
|
28923
28964
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28924
|
-
void logger?.logMessage(
|
|
28965
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28925
28966
|
}
|
|
28926
28967
|
startNewPrompt();
|
|
28927
28968
|
}
|
|
@@ -30448,9 +30489,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30448
30489
|
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30449
30490
|
async (choice) => {
|
|
30450
30491
|
const trustLevelMap = {
|
|
30451
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30452
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30453
|
-
["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
|
|
30454
30495
|
};
|
|
30455
30496
|
const trustLevel = trustLevelMap[choice];
|
|
30456
30497
|
if (!trustLevel) return;
|
|
@@ -30469,7 +30510,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30469
30510
|
}, 100);
|
|
30470
30511
|
return;
|
|
30471
30512
|
}
|
|
30472
|
-
const currentIsTrusted = trustLevel ===
|
|
30513
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30473
30514
|
onTrustChange(currentIsTrusted);
|
|
30474
30515
|
setIsTrusted(currentIsTrusted);
|
|
30475
30516
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -31477,7 +31518,7 @@ function useMessageQueue({
|
|
|
31477
31518
|
var import_react107 = __toESM(require_react(), 1);
|
|
31478
31519
|
function useMcpStatus(config) {
|
|
31479
31520
|
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31480
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31521
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31481
31522
|
);
|
|
31482
31523
|
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31483
31524
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31490,12 +31531,12 @@ function useMcpStatus(config) {
|
|
|
31490
31531
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31491
31532
|
}
|
|
31492
31533
|
};
|
|
31493
|
-
coreEvents.on(
|
|
31534
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31494
31535
|
return () => {
|
|
31495
|
-
coreEvents.off(
|
|
31536
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31496
31537
|
};
|
|
31497
31538
|
}, [config]);
|
|
31498
|
-
const isMcpReady = discoveryState ===
|
|
31539
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31499
31540
|
return {
|
|
31500
31541
|
discoveryState,
|
|
31501
31542
|
mcpServerCount,
|
|
@@ -31522,7 +31563,7 @@ function useApprovalModeIndicator({
|
|
|
31522
31563
|
(key) => {
|
|
31523
31564
|
let nextApprovalMode;
|
|
31524
31565
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31525
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31566
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31526
31567
|
if (addItem) {
|
|
31527
31568
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31528
31569
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31540,21 +31581,21 @@ function useApprovalModeIndicator({
|
|
|
31540
31581
|
}
|
|
31541
31582
|
return;
|
|
31542
31583
|
}
|
|
31543
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31584
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31544
31585
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31545
31586
|
const currentMode = config.getApprovalMode();
|
|
31546
31587
|
switch (currentMode) {
|
|
31547
|
-
case
|
|
31548
|
-
nextApprovalMode =
|
|
31588
|
+
case ApprovalMode.DEFAULT:
|
|
31589
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31549
31590
|
break;
|
|
31550
|
-
case
|
|
31551
|
-
nextApprovalMode = allowPlanMode ?
|
|
31591
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31592
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31552
31593
|
break;
|
|
31553
|
-
case
|
|
31554
|
-
nextApprovalMode =
|
|
31594
|
+
case ApprovalMode.PLAN:
|
|
31595
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31555
31596
|
break;
|
|
31556
|
-
case
|
|
31557
|
-
nextApprovalMode =
|
|
31597
|
+
case ApprovalMode.YOLO:
|
|
31598
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31558
31599
|
break;
|
|
31559
31600
|
default:
|
|
31560
31601
|
}
|
|
@@ -31964,11 +32005,11 @@ var useHookDisplayState = () => {
|
|
|
31964
32005
|
removeHook();
|
|
31965
32006
|
}
|
|
31966
32007
|
};
|
|
31967
|
-
coreEvents.on(
|
|
31968
|
-
coreEvents.on(
|
|
32008
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
32009
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31969
32010
|
return () => {
|
|
31970
|
-
coreEvents.off(
|
|
31971
|
-
coreEvents.off(
|
|
32011
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
32012
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31972
32013
|
activeTimeouts.forEach(clearTimeout);
|
|
31973
32014
|
activeTimeouts.clear();
|
|
31974
32015
|
};
|
|
@@ -32807,7 +32848,7 @@ var AppContainer = (props) => {
|
|
|
32807
32848
|
setConfigInitialized(true);
|
|
32808
32849
|
startupProfiler.flush(config);
|
|
32809
32850
|
startAutoMemoryIfEnabled(config);
|
|
32810
|
-
const sessionStartSource = resumedSessionData ?
|
|
32851
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32811
32852
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32812
32853
|
if (result) {
|
|
32813
32854
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32834,7 +32875,7 @@ var AppContainer = (props) => {
|
|
|
32834
32875
|
);
|
|
32835
32876
|
const ideClient = await IdeClient.getInstance();
|
|
32836
32877
|
await ideClient.disconnect();
|
|
32837
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32878
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32838
32879
|
};
|
|
32839
32880
|
registerCleanup(cleanupFn);
|
|
32840
32881
|
return () => {
|
|
@@ -32859,11 +32900,11 @@ var AppContainer = (props) => {
|
|
|
32859
32900
|
resetTime: payload.resetTime
|
|
32860
32901
|
});
|
|
32861
32902
|
};
|
|
32862
|
-
coreEvents.on(
|
|
32863
|
-
coreEvents.on(
|
|
32903
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32904
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32864
32905
|
return () => {
|
|
32865
|
-
coreEvents.off(
|
|
32866
|
-
coreEvents.off(
|
|
32906
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32907
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32867
32908
|
};
|
|
32868
32909
|
}, [config]);
|
|
32869
32910
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32876,16 +32917,16 @@ var AppContainer = (props) => {
|
|
|
32876
32917
|
const handleAgentsDiscovered = (payload) => {
|
|
32877
32918
|
setNewAgents(payload.agents);
|
|
32878
32919
|
};
|
|
32879
|
-
coreEvents.on(
|
|
32880
|
-
coreEvents.on(
|
|
32881
|
-
coreEvents.on(
|
|
32920
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32921
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32922
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32882
32923
|
return () => {
|
|
32883
|
-
coreEvents.off(
|
|
32924
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32884
32925
|
coreEvents.off(
|
|
32885
|
-
|
|
32926
|
+
CoreEvent.AdminSettingsChanged,
|
|
32886
32927
|
handleAdminSettingsChanged
|
|
32887
32928
|
);
|
|
32888
|
-
coreEvents.off(
|
|
32929
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32889
32930
|
};
|
|
32890
32931
|
}, [settings]);
|
|
32891
32932
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32952,11 +32993,11 @@ var AppContainer = (props) => {
|
|
|
32952
32993
|
exitEditorDialog
|
|
32953
32994
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32954
32995
|
(0, import_react121.useEffect)(() => {
|
|
32955
|
-
coreEvents.on(
|
|
32956
|
-
coreEvents.on(
|
|
32996
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32997
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32957
32998
|
return () => {
|
|
32958
|
-
coreEvents.off(
|
|
32959
|
-
coreEvents.off(
|
|
32999
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
33000
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32960
33001
|
};
|
|
32961
33002
|
}, [handleEditorClose, openEditorDialog]);
|
|
32962
33003
|
(0, import_react121.useEffect)(() => {
|
|
@@ -33024,7 +33065,7 @@ var AppContainer = (props) => {
|
|
|
33024
33065
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
33025
33066
|
});
|
|
33026
33067
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
33027
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
33068
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
33028
33069
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
33029
33070
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
33030
33071
|
config,
|
|
@@ -33052,7 +33093,7 @@ var AppContainer = (props) => {
|
|
|
33052
33093
|
async (authType, scope) => {
|
|
33053
33094
|
if (authType) {
|
|
33054
33095
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
33055
|
-
if (authType ===
|
|
33096
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
33056
33097
|
setAuthContext({ requiresRestart: true });
|
|
33057
33098
|
} else {
|
|
33058
33099
|
setAuthContext({});
|
|
@@ -33080,7 +33121,7 @@ var AppContainer = (props) => {
|
|
|
33080
33121
|
);
|
|
33081
33122
|
return;
|
|
33082
33123
|
}
|
|
33083
|
-
if (authType ===
|
|
33124
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
33084
33125
|
writeToStdout(`
|
|
33085
33126
|
----------------------------------------------------------------
|
|
33086
33127
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -33103,7 +33144,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33103
33144
|
}
|
|
33104
33145
|
await saveApiKey(apiKey);
|
|
33105
33146
|
await reloadApiKey();
|
|
33106
|
-
await config.refreshAuth(
|
|
33147
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
33107
33148
|
setAuthState("authenticated" /* Authenticated */);
|
|
33108
33149
|
} catch (e) {
|
|
33109
33150
|
onAuthError(
|
|
@@ -33128,7 +33169,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33128
33169
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
33129
33170
|
);
|
|
33130
33171
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
33131
|
-
if (settings.merged.security.auth.selectedType ===
|
|
33172
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
33132
33173
|
return;
|
|
33133
33174
|
}
|
|
33134
33175
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -33264,9 +33305,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33264
33305
|
}
|
|
33265
33306
|
});
|
|
33266
33307
|
};
|
|
33267
|
-
coreEvents.on(
|
|
33308
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33268
33309
|
return () => {
|
|
33269
|
-
coreEvents.off(
|
|
33310
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33270
33311
|
};
|
|
33271
33312
|
}, []);
|
|
33272
33313
|
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
@@ -33924,7 +33965,7 @@ ${queuedText}` : queuedText;
|
|
|
33924
33965
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33925
33966
|
if (settings.merged.general.devtools) {
|
|
33926
33967
|
void (async () => {
|
|
33927
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33968
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-GU2GQSOF.js");
|
|
33928
33969
|
await toggleDevToolsPanel(
|
|
33929
33970
|
config,
|
|
33930
33971
|
showErrorDetails,
|
|
@@ -34142,17 +34183,17 @@ ${queuedText}` : queuedText;
|
|
|
34142
34183
|
Date.now()
|
|
34143
34184
|
);
|
|
34144
34185
|
};
|
|
34145
|
-
coreEvents.on(
|
|
34146
|
-
coreEvents.on(
|
|
34186
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34187
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34147
34188
|
coreEvents.drainBacklogs();
|
|
34148
34189
|
return () => {
|
|
34149
|
-
coreEvents.off(
|
|
34150
|
-
coreEvents.off(
|
|
34190
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34191
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34151
34192
|
};
|
|
34152
34193
|
}, [historyManager]);
|
|
34153
34194
|
const nightly = props.version.includes("nightly");
|
|
34154
34195
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
34155
|
-
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;
|
|
34156
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;
|
|
34157
34198
|
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
34158
34199
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
@@ -34252,9 +34293,9 @@ ${queuedText}` : queuedText;
|
|
|
34252
34293
|
const handleMemoryChanged = (result) => {
|
|
34253
34294
|
setGeminiMdFileCount(result.fileCount);
|
|
34254
34295
|
};
|
|
34255
|
-
coreEvents.on(
|
|
34296
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34256
34297
|
return () => {
|
|
34257
|
-
coreEvents.off(
|
|
34298
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34258
34299
|
};
|
|
34259
34300
|
}, []);
|
|
34260
34301
|
(0, import_react121.useEffect)(() => {
|