@google/gemini-cli 0.53.0-preview.0 → 0.54.0-nightly.20260726.g3818efbbf
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-5RDOS7UZ.js → chunk-2VCRWD5A.js} +105 -69
- package/bundle/{chunk-PVCJCQWY.js → chunk-4DF43WY7.js} +1 -1
- package/bundle/{chunk-7VUO7T2C.js → chunk-5IDNNCKI.js} +3 -3
- package/bundle/{chunk-SLQKIE73.js → chunk-6EXP7MNC.js} +1 -1
- package/bundle/{chunk-QSTUV3QH.js → chunk-6FGJ26XP.js} +7 -7
- package/bundle/{chunk-XH7QC2TB.js → chunk-6FQUF3NB.js} +2 -2
- package/bundle/{chunk-UEI42N7R.js → chunk-C52C3QZP.js} +3 -3
- package/bundle/{chunk-HF533LET.js → chunk-CP4PCA5K.js} +7699 -14271
- package/bundle/{chunk-HVYOZEAP.js → chunk-DJN5ASV2.js} +3 -3
- package/bundle/{chunk-BX6DTJOD.js → chunk-DLH2UGEO.js} +1 -1
- package/bundle/{chunk-LUM47MYE.js → chunk-DZDRGXE7.js} +1 -1
- package/bundle/chunk-F6U6G4L3.js +118 -0
- package/bundle/{chunk-6AD4A2WF.js → chunk-GKMUOHQH.js} +8 -5
- package/bundle/{chunk-PLMRBJEA.js → chunk-HG5ARHEH.js} +2 -2
- package/bundle/{chunk-27C6XFMY.js → chunk-ISVXSEBZ.js} +105 -69
- package/bundle/{chunk-PKFZO3SN.js → chunk-JFK64ABJ.js} +1 -1
- package/bundle/{chunk-BRZT2CQU.js → chunk-MHTDGIIL.js} +1 -1
- package/bundle/{chunk-CTNBR234.js → chunk-NNV4Z6XR.js} +2 -2
- package/bundle/{chunk-IODN6H35.js → chunk-NPRNIWWX.js} +1 -1
- package/bundle/{chunk-GHVD6PXK.js → chunk-OC4O5R3B.js} +9 -8
- package/bundle/chunk-OEJGR4OM.js +396934 -0
- package/bundle/{chunk-4OVORMGE.js → chunk-PHD2HIVW.js} +1 -1
- package/bundle/{chunk-BDSSP5BZ.js → chunk-QG7OFP4D.js} +1 -1
- package/bundle/{chunk-UJVAPQ7V.js → chunk-QGDYKVWX.js} +1 -1
- package/bundle/chunk-RVYNXMAI.js +154 -0
- package/bundle/chunk-SUGVZSZP.js +512 -0
- package/bundle/{chunk-SXKIOLLX.js → chunk-TIAQUEGU.js} +7 -7
- package/bundle/chunk-TUTBB2EI.js +17332 -0
- package/bundle/{chunk-WVDR5L2V.js → chunk-UFVHQWHK.js} +67 -54
- package/bundle/chunk-XUMLHXHF.js +102505 -0
- package/bundle/chunk-Y76OKNPF.js +1571 -0
- package/bundle/chunk-YONEX6IX.js +398 -0
- package/bundle/{cleanup-4FVUYQ7H.js → cleanup-CJUVYQV5.js} +2 -2
- package/bundle/{cleanup-XETKRH7X.js → cleanup-IA6XG6SC.js} +2 -2
- package/bundle/{cleanup-ZR34H2GU.js → cleanup-QIBIT7JQ.js} +2 -2
- package/bundle/cleanup-QUPE4ZH5.js +32 -0
- package/bundle/{core-PVG4D2MR.js → core-UHW46BQ2.js} +3 -1
- package/bundle/{devtoolsService-OUX7PWP3.js → devtoolsService-465M2LE6.js} +2 -2
- package/bundle/{devtoolsService-IVPTF5ZJ.js → devtoolsService-7KPRZCZM.js} +2 -2
- package/bundle/{devtoolsService-QYDPHHFN.js → devtoolsService-F7ASQSK7.js} +4 -3
- package/bundle/devtoolsService-ZJWYFVKM.js +4359 -0
- package/bundle/{dist-PRJQFPSQ.js → dist-A3MEBURU.js} +3 -1
- package/bundle/{core-I73XKBPY.js → dist-QVREEUKF.js} +3 -1
- package/bundle/dist-Y4VJWSZD.js +2156 -0
- package/bundle/docs/changelogs/index.md +20 -0
- package/bundle/docs/changelogs/latest.md +53 -18
- package/bundle/docs/changelogs/preview.md +35 -46
- package/bundle/{gemini-LA6TNI44.js → gemini-7SBFMAVQ.js} +14 -14
- package/bundle/{gemini-QKB55UV6.js → gemini-HIS5LQZQ.js} +212 -196
- package/bundle/{gemini-E2E3U6PR.js → gemini-VBI43GZ4.js} +14 -14
- package/bundle/gemini-VNJSIRD3.js +16427 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-FS3OVPXQ.js → interactiveCli-7CJ3QII7.js} +8 -8
- package/bundle/{interactiveCli-OD2LO24X.js → interactiveCli-HO3K7ZQC.js} +8 -8
- package/bundle/{interactiveCli-ADLAWPXN.js → interactiveCli-J27JH7NJ.js} +315 -296
- package/bundle/interactiveCli-QQIQEHF4.js +34816 -0
- package/bundle/{liteRtServerManager-O7PFOUFD.js → liteRtServerManager-ADM43JXF.js} +4 -4
- package/bundle/{liteRtServerManager-T2Z3RLS3.js → liteRtServerManager-FGXFYVBT.js} +4 -4
- package/bundle/{liteRtServerManager-3SKK7MNE.js → liteRtServerManager-IZIEAP3T.js} +4 -4
- package/bundle/liteRtServerManager-NRGCTYJQ.js +65 -0
- package/bundle/{oauth2-provider-Q433RA6I.js → oauth2-provider-3THMIWTP.js} +1 -1
- package/bundle/{oauth2-provider-E3S5DGLL.js → oauth2-provider-ASKQ7P2C.js} +1 -1
- package/bundle/{oauth2-provider-DFVE3NYF.js → oauth2-provider-NVAVQTFM.js} +38 -72
- package/bundle/oauth2-provider-TZOUW4Q5.js +235 -0
- package/bundle/{start-5G2UDZZ6.js → start-72YJPZDV.js} +6 -6
- package/bundle/{start-XMJ23QZN.js → start-A4ZY5O7I.js} +6 -6
- package/bundle/{start-3FPYJBRX.js → start-GCMULBVZ.js} +6 -6
- package/bundle/start-HAMF674K.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-XUMLHXHF.js";
|
|
161
161
|
import {
|
|
162
162
|
require_source
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-PHD2HIVW.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-DZDRGXE7.js";
|
|
218
218
|
import {
|
|
219
219
|
handleAutoUpdate,
|
|
220
220
|
isDevelopment,
|
|
221
221
|
relaunchApp,
|
|
222
222
|
setUpdateHandler
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-6FQUF3NB.js";
|
|
224
224
|
import {
|
|
225
225
|
isTodoList,
|
|
226
226
|
mapCoreStatusToDisplayStatus,
|
|
227
227
|
require_react
|
|
228
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-SUGVZSZP.js";
|
|
229
229
|
import {
|
|
230
230
|
registerCleanup,
|
|
231
231
|
removeCleanup,
|
|
232
232
|
runExitCleanup,
|
|
233
233
|
setupTtyCheck
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-DLH2UGEO.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,12 +266,19 @@ 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,
|
|
278
|
+
MCPDiscoveryState,
|
|
279
|
+
MCPServerStatus,
|
|
280
|
+
MessageBusType,
|
|
281
|
+
MessageSenderType,
|
|
271
282
|
ModelNotFoundError,
|
|
272
283
|
ModelSlashCommandEvent,
|
|
273
284
|
OverageMenuShownEvent,
|
|
@@ -279,20 +290,27 @@ import {
|
|
|
279
290
|
PREVIEW_GEMINI_MODEL,
|
|
280
291
|
PolicyIntegrityManager,
|
|
281
292
|
ProjectIdRequiredError,
|
|
293
|
+
QuestionType,
|
|
282
294
|
READ_FILE_DISPLAY_NAME,
|
|
283
295
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
284
296
|
RELEASE_CHANNEL_STABILITY,
|
|
285
297
|
ROOT_SCHEDULER_ID,
|
|
286
298
|
SHELL_TOOL_NAME,
|
|
287
299
|
Scheduler,
|
|
300
|
+
SessionEndReason,
|
|
301
|
+
SessionStartSource,
|
|
288
302
|
ShellExecutionService,
|
|
289
303
|
SlashCommandStatus,
|
|
290
304
|
Storage,
|
|
305
|
+
SubagentState,
|
|
291
306
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
292
307
|
TOPIC_PARAM_SUMMARY,
|
|
293
308
|
TOPIC_PARAM_TITLE,
|
|
294
309
|
TerminalQuotaError,
|
|
310
|
+
ToolConfirmationOutcome,
|
|
311
|
+
ToolErrorType,
|
|
295
312
|
TranscriptionFactory,
|
|
313
|
+
TrustLevel,
|
|
296
314
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
297
315
|
UPDATE_TOPIC_TOOL_NAME,
|
|
298
316
|
UnauthorizedError,
|
|
@@ -304,6 +322,7 @@ import {
|
|
|
304
322
|
WEB_FETCH_DISPLAY_NAME,
|
|
305
323
|
WEB_SEARCH_DISPLAY_NAME,
|
|
306
324
|
WRITE_FILE_DISPLAY_NAME,
|
|
325
|
+
WarningPriority,
|
|
307
326
|
WhisperModelManager,
|
|
308
327
|
addMCPStatusChangeListener,
|
|
309
328
|
allowEditorTypeInSandbox,
|
|
@@ -412,7 +431,7 @@ import {
|
|
|
412
431
|
validatePlanContent,
|
|
413
432
|
validatePlanPath,
|
|
414
433
|
writeToStdout
|
|
415
|
-
} from "./chunk-
|
|
434
|
+
} from "./chunk-OEJGR4OM.js";
|
|
416
435
|
import "./chunk-664ZODQF.js";
|
|
417
436
|
import "./chunk-IUUIT4SU.js";
|
|
418
437
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -5038,7 +5057,7 @@ function calculateShellMaxLines(options) {
|
|
|
5038
5057
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
5039
5058
|
return maxLinesBasedOnHeight;
|
|
5040
5059
|
}
|
|
5041
|
-
const isExecuting = status ===
|
|
5060
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
5042
5061
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
5043
5062
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
5044
5063
|
}
|
|
@@ -5072,10 +5091,10 @@ function isShellTool(name) {
|
|
|
5072
5091
|
return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
|
|
5073
5092
|
}
|
|
5074
5093
|
function isThisShellFocusable(name, status, config) {
|
|
5075
|
-
return !!(isShellTool(name) && status ===
|
|
5094
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
|
|
5076
5095
|
}
|
|
5077
5096
|
function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
|
|
5078
|
-
return !!(isShellTool(name) && status ===
|
|
5097
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
|
|
5079
5098
|
}
|
|
5080
5099
|
function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
|
|
5081
5100
|
const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
|
|
@@ -5235,13 +5254,13 @@ var formatToolArgs = (args) => {
|
|
|
5235
5254
|
var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
|
|
5236
5255
|
let headerText;
|
|
5237
5256
|
let headerColor = theme.text.secondary;
|
|
5238
|
-
if (progress.state ===
|
|
5257
|
+
if (progress.state === SubagentState.CANCELLED) {
|
|
5239
5258
|
headerText = `Subagent ${progress.agentName} was cancelled.`;
|
|
5240
5259
|
headerColor = theme.status.warning;
|
|
5241
|
-
} else if (progress.state ===
|
|
5260
|
+
} else if (progress.state === SubagentState.ERROR) {
|
|
5242
5261
|
headerText = `Subagent ${progress.agentName} failed.`;
|
|
5243
5262
|
headerColor = theme.status.error;
|
|
5244
|
-
} else if (progress.state ===
|
|
5263
|
+
} else if (progress.state === SubagentState.COMPLETED) {
|
|
5245
5264
|
headerText = `Subagent ${progress.agentName} completed.`;
|
|
5246
5265
|
headerColor = theme.status.success;
|
|
5247
5266
|
} else {
|
|
@@ -5261,7 +5280,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5261
5280
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
|
|
5262
5281
|
] }, item.id);
|
|
5263
5282
|
} else if (item.type === "tool_call") {
|
|
5264
|
-
const statusSymbol = item.status ===
|
|
5283
|
+
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 });
|
|
5265
5284
|
const formattedArgs = item.description || formatToolArgs(item.args);
|
|
5266
5285
|
const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
|
|
5267
5286
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
@@ -5272,7 +5291,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5272
5291
|
{
|
|
5273
5292
|
bold: true,
|
|
5274
5293
|
color: theme.text.primary,
|
|
5275
|
-
strikethrough: item.status ===
|
|
5294
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5276
5295
|
children: item.displayName || item.content
|
|
5277
5296
|
}
|
|
5278
5297
|
),
|
|
@@ -5281,7 +5300,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5281
5300
|
{
|
|
5282
5301
|
color: theme.text.secondary,
|
|
5283
5302
|
wrap: "truncate",
|
|
5284
|
-
strikethrough: item.status ===
|
|
5303
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5285
5304
|
children: displayArgs
|
|
5286
5305
|
}
|
|
5287
5306
|
) })
|
|
@@ -5301,7 +5320,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5301
5320
|
MarkdownDisplay,
|
|
5302
5321
|
{
|
|
5303
5322
|
text: safeJsonToMarkdown(progress.result),
|
|
5304
|
-
isPending: progress.state !==
|
|
5323
|
+
isPending: progress.state !== SubagentState.COMPLETED,
|
|
5305
5324
|
terminalWidth
|
|
5306
5325
|
}
|
|
5307
5326
|
)
|
|
@@ -5655,14 +5674,14 @@ var ToolActionsProvider = (props) => {
|
|
|
5655
5674
|
}
|
|
5656
5675
|
const details = tool.confirmationDetails;
|
|
5657
5676
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
5658
|
-
const cliOutcome = outcome ===
|
|
5677
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
5659
5678
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
5660
5679
|
}
|
|
5661
5680
|
if (tool.correlationId) {
|
|
5662
5681
|
await config.getMessageBus().publish({
|
|
5663
|
-
type:
|
|
5682
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
5664
5683
|
correlationId: tool.correlationId,
|
|
5665
|
-
confirmed: outcome !==
|
|
5684
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
5666
5685
|
requiresUserConfirmation: false,
|
|
5667
5686
|
outcome,
|
|
5668
5687
|
payload
|
|
@@ -5681,7 +5700,7 @@ var ToolActionsProvider = (props) => {
|
|
|
5681
5700
|
);
|
|
5682
5701
|
const cancel = (0, import_react12.useCallback)(
|
|
5683
5702
|
async (callId) => {
|
|
5684
|
-
await confirm(callId,
|
|
5703
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
5685
5704
|
},
|
|
5686
5705
|
[confirm]
|
|
5687
5706
|
);
|
|
@@ -5800,7 +5819,7 @@ var ToolMessage = ({
|
|
|
5800
5819
|
paddingX: 1,
|
|
5801
5820
|
flexDirection: "column",
|
|
5802
5821
|
children: [
|
|
5803
|
-
status ===
|
|
5822
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5804
5823
|
McpProgressIndicator,
|
|
5805
5824
|
{
|
|
5806
5825
|
progress,
|
|
@@ -5817,8 +5836,8 @@ var ToolMessage = ({
|
|
|
5817
5836
|
terminalWidth,
|
|
5818
5837
|
renderOutputAsMarkdown,
|
|
5819
5838
|
hasFocus: isThisShellFocused2,
|
|
5820
|
-
maxLines: kind ===
|
|
5821
|
-
overflowDirection: kind ===
|
|
5839
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
5840
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
5822
5841
|
}
|
|
5823
5842
|
),
|
|
5824
5843
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -6134,7 +6153,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
|
|
|
6134
6153
|
settings.merged,
|
|
6135
6154
|
process3.cwd()
|
|
6136
6155
|
);
|
|
6137
|
-
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel ===
|
|
6156
|
+
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
|
|
6138
6157
|
return {
|
|
6139
6158
|
currentTrustLevel: explicitTrustLevel,
|
|
6140
6159
|
isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
|
|
@@ -6179,7 +6198,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
|
|
|
6179
6198
|
process3.cwd(),
|
|
6180
6199
|
newConfig
|
|
6181
6200
|
);
|
|
6182
|
-
if (trustLevel ===
|
|
6201
|
+
if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
|
|
6183
6202
|
let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
|
|
6184
6203
|
if (source === "file") {
|
|
6185
6204
|
message = "Note: This folder is still trusted because a parent folder is trusted.";
|
|
@@ -6253,18 +6272,18 @@ function PermissionsModifyTrustDialog({
|
|
|
6253
6272
|
const TRUST_LEVEL_ITEMS = [
|
|
6254
6273
|
{
|
|
6255
6274
|
label: `Trust this folder (${dirName})`,
|
|
6256
|
-
value:
|
|
6257
|
-
key:
|
|
6275
|
+
value: TrustLevel.TRUST_FOLDER,
|
|
6276
|
+
key: TrustLevel.TRUST_FOLDER
|
|
6258
6277
|
},
|
|
6259
6278
|
{
|
|
6260
6279
|
label: `Trust parent folder (${parentFolder})`,
|
|
6261
|
-
value:
|
|
6262
|
-
key:
|
|
6280
|
+
value: TrustLevel.TRUST_PARENT,
|
|
6281
|
+
key: TrustLevel.TRUST_PARENT
|
|
6263
6282
|
},
|
|
6264
6283
|
{
|
|
6265
6284
|
label: "Don't trust",
|
|
6266
|
-
value:
|
|
6267
|
-
key:
|
|
6285
|
+
value: TrustLevel.DO_NOT_TRUST,
|
|
6286
|
+
key: TrustLevel.DO_NOT_TRUST
|
|
6268
6287
|
}
|
|
6269
6288
|
];
|
|
6270
6289
|
const {
|
|
@@ -6504,7 +6523,7 @@ var ShellToolMessage = ({
|
|
|
6504
6523
|
maxLinesLimit: maxLines
|
|
6505
6524
|
});
|
|
6506
6525
|
import_react17.default.useEffect(() => {
|
|
6507
|
-
const isExecuting = status ===
|
|
6526
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
6508
6527
|
if (isExecuting && ptyId) {
|
|
6509
6528
|
try {
|
|
6510
6529
|
const childWidth = terminalWidth - 4;
|
|
@@ -6717,13 +6736,13 @@ var SubagentGroupDisplay = ({
|
|
|
6717
6736
|
const singleAgent = toolCalls[0].resultDisplay;
|
|
6718
6737
|
if (isSubagentProgress(singleAgent)) {
|
|
6719
6738
|
switch (singleAgent.state) {
|
|
6720
|
-
case
|
|
6739
|
+
case SubagentState.COMPLETED:
|
|
6721
6740
|
headerText = "Agent Completed";
|
|
6722
6741
|
break;
|
|
6723
|
-
case
|
|
6742
|
+
case SubagentState.CANCELLED:
|
|
6724
6743
|
headerText = "Agent Cancelled";
|
|
6725
6744
|
break;
|
|
6726
|
-
case
|
|
6745
|
+
case SubagentState.ERROR:
|
|
6727
6746
|
headerText = "Agent Error";
|
|
6728
6747
|
break;
|
|
6729
6748
|
default:
|
|
@@ -6739,8 +6758,8 @@ var SubagentGroupDisplay = ({
|
|
|
6739
6758
|
for (const tc of toolCalls) {
|
|
6740
6759
|
const progress = tc.resultDisplay;
|
|
6741
6760
|
if (isSubagentProgress(progress)) {
|
|
6742
|
-
if (progress.state ===
|
|
6743
|
-
else if (progress.state ===
|
|
6761
|
+
if (progress.state === SubagentState.COMPLETED) completedCount++;
|
|
6762
|
+
else if (progress.state === SubagentState.RUNNING) runningCount++;
|
|
6744
6763
|
} else {
|
|
6745
6764
|
runningCount++;
|
|
6746
6765
|
}
|
|
@@ -6819,7 +6838,7 @@ var SubagentGroupDisplay = ({
|
|
|
6819
6838
|
if (!isExpanded) {
|
|
6820
6839
|
let content = "Starting...";
|
|
6821
6840
|
let formattedArgs;
|
|
6822
|
-
if (progress.state ===
|
|
6841
|
+
if (progress.state === SubagentState.COMPLETED) {
|
|
6823
6842
|
if (progress.terminateReason && progress.terminateReason !== "GOAL") {
|
|
6824
6843
|
content = `Finished Early (${progress.terminateReason})`;
|
|
6825
6844
|
} else {
|
|
@@ -6833,17 +6852,17 @@ var SubagentGroupDisplay = ({
|
|
|
6833
6852
|
formattedArgs = formatToolArgs(lastActivity.args);
|
|
6834
6853
|
}
|
|
6835
6854
|
}
|
|
6836
|
-
const displayArgs = progress.state ===
|
|
6855
|
+
const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
|
|
6837
6856
|
const renderStatusIcon = () => {
|
|
6838
|
-
const state = progress.state ??
|
|
6857
|
+
const state = progress.state ?? SubagentState.RUNNING;
|
|
6839
6858
|
switch (state) {
|
|
6840
|
-
case
|
|
6859
|
+
case SubagentState.RUNNING:
|
|
6841
6860
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
|
|
6842
|
-
case
|
|
6861
|
+
case SubagentState.COMPLETED:
|
|
6843
6862
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
|
|
6844
|
-
case
|
|
6863
|
+
case SubagentState.CANCELLED:
|
|
6845
6864
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
|
|
6846
|
-
case
|
|
6865
|
+
case SubagentState.ERROR:
|
|
6847
6866
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
|
|
6848
6867
|
default:
|
|
6849
6868
|
return checkExhaustive(state);
|
|
@@ -6896,22 +6915,22 @@ var hasPayload = (res) => {
|
|
|
6896
6915
|
function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
6897
6916
|
const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
|
|
6898
6917
|
const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
|
|
6899
|
-
const isAcceptedOrConfirming = status ===
|
|
6918
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
6900
6919
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
6901
6920
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
6902
6921
|
const showDiffStat = !!diff.diffStat;
|
|
6903
6922
|
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 }) });
|
|
6904
6923
|
let resultSummary = "";
|
|
6905
6924
|
let resultColor = theme.text.secondary;
|
|
6906
|
-
if (status ===
|
|
6925
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
6907
6926
|
resultSummary = "Confirming";
|
|
6908
|
-
} else if (status ===
|
|
6927
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
6909
6928
|
resultSummary = "Accepted";
|
|
6910
6929
|
resultColor = theme.text.accent;
|
|
6911
|
-
} else if (status ===
|
|
6930
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
6912
6931
|
resultSummary = "Rejected";
|
|
6913
6932
|
resultColor = theme.status.error;
|
|
6914
|
-
} else if (status ===
|
|
6933
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
6915
6934
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
6916
6935
|
resultColor = theme.status.error;
|
|
6917
6936
|
}
|
|
@@ -6942,7 +6961,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
|
|
|
6942
6961
|
filename: diff.fileName,
|
|
6943
6962
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
6944
6963
|
availableTerminalHeight,
|
|
6945
|
-
disableColor: status ===
|
|
6964
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6946
6965
|
}
|
|
6947
6966
|
);
|
|
6948
6967
|
return { description, summary, payload };
|
|
@@ -7070,10 +7089,10 @@ var DenseToolMessage = (props) => {
|
|
|
7070
7089
|
if (isGrepResult(resultDisplay)) {
|
|
7071
7090
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7072
7091
|
}
|
|
7073
|
-
if (status ===
|
|
7092
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
7074
7093
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7075
7094
|
}
|
|
7076
|
-
if (status ===
|
|
7095
|
+
if (status === CoreToolCallStatus.Error) {
|
|
7077
7096
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
7078
7097
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
7079
7098
|
"\u2192 ",
|
|
@@ -7114,7 +7133,7 @@ var DenseToolMessage = (props) => {
|
|
|
7114
7133
|
language: fileExtension,
|
|
7115
7134
|
maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7116
7135
|
settings,
|
|
7117
|
-
disableColor: status ===
|
|
7136
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
7118
7137
|
returnLines: true
|
|
7119
7138
|
});
|
|
7120
7139
|
} else {
|
|
@@ -7122,7 +7141,7 @@ var DenseToolMessage = (props) => {
|
|
|
7122
7141
|
parsedLines,
|
|
7123
7142
|
filename: diff.fileName,
|
|
7124
7143
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7125
|
-
disableColor: status ===
|
|
7144
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
7126
7145
|
});
|
|
7127
7146
|
}
|
|
7128
7147
|
}, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
|
|
@@ -7252,7 +7271,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7252
7271
|
return pendingHistoryItems.some((item) => {
|
|
7253
7272
|
if (item && item.type === "tool_group") {
|
|
7254
7273
|
return item.tools.some(
|
|
7255
|
-
(tool) =>
|
|
7274
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
7256
7275
|
);
|
|
7257
7276
|
}
|
|
7258
7277
|
return false;
|
|
@@ -7261,7 +7280,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7261
7280
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
7262
7281
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
7263
7282
|
(item) => item.tools.some(
|
|
7264
|
-
(tool) =>
|
|
7283
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
7265
7284
|
)
|
|
7266
7285
|
);
|
|
7267
7286
|
}
|
|
@@ -7284,14 +7303,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
|
|
|
7284
7303
|
if (isTrackedToolCall(t)) {
|
|
7285
7304
|
return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
|
|
7286
7305
|
} else {
|
|
7287
|
-
return t.status !==
|
|
7306
|
+
return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
|
|
7288
7307
|
}
|
|
7289
7308
|
});
|
|
7290
7309
|
const isEmbeddedShellFocused = toolsToInspect.some((t) => {
|
|
7291
7310
|
if (isTrackedToolCall(t)) {
|
|
7292
7311
|
return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
|
|
7293
7312
|
} else {
|
|
7294
|
-
return isShellTool(t.name) && t.status ===
|
|
7313
|
+
return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
|
|
7295
7314
|
}
|
|
7296
7315
|
});
|
|
7297
7316
|
const isShellCommand = toolsToInspect.some((t) => {
|
|
@@ -7390,7 +7409,7 @@ var ToolGroupMessage = ({
|
|
|
7390
7409
|
const groupedTools = (0, import_react21.useMemo)(() => {
|
|
7391
7410
|
const groups = [];
|
|
7392
7411
|
for (const tool of visibleToolCalls) {
|
|
7393
|
-
if (tool.kind ===
|
|
7412
|
+
if (tool.kind === Kind.Agent) {
|
|
7394
7413
|
const lastGroup = groups[groups.length - 1];
|
|
7395
7414
|
if (Array.isArray(lastGroup)) {
|
|
7396
7415
|
lastGroup.push(tool);
|
|
@@ -7445,7 +7464,7 @@ var ToolGroupMessage = ({
|
|
|
7445
7464
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
7446
7465
|
let countToolCallsWithResults = 0;
|
|
7447
7466
|
for (const tool of visibleToolCalls) {
|
|
7448
|
-
if (tool.kind !==
|
|
7467
|
+
if (tool.kind !== Kind.Agent) {
|
|
7449
7468
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
7450
7469
|
if (hasDensePayload(tool)) {
|
|
7451
7470
|
countToolCallsWithResults++;
|
|
@@ -7619,7 +7638,7 @@ var ToolGroupDisplay = ({
|
|
|
7619
7638
|
}
|
|
7620
7639
|
const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
|
|
7621
7640
|
const visibleTools = tools.filter(
|
|
7622
|
-
(t) => t.status !==
|
|
7641
|
+
(t) => t.status !== CoreToolCallStatus.AwaitingApproval
|
|
7623
7642
|
);
|
|
7624
7643
|
const noticeTools = visibleTools.filter((t) => t.format === "notice");
|
|
7625
7644
|
const otherTools = visibleTools.filter(
|
|
@@ -7821,18 +7840,18 @@ function CompressionMessage({
|
|
|
7821
7840
|
return "Compressing chat history";
|
|
7822
7841
|
}
|
|
7823
7842
|
switch (compressionStatus) {
|
|
7824
|
-
case
|
|
7843
|
+
case CompressionStatus.COMPRESSED:
|
|
7825
7844
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
7826
|
-
case
|
|
7845
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
7827
7846
|
if (originalTokens < 5e4) {
|
|
7828
7847
|
return "Compression was not beneficial for this history size.";
|
|
7829
7848
|
}
|
|
7830
7849
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
7831
|
-
case
|
|
7850
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
7832
7851
|
return "Could not compress chat history due to a token counting error.";
|
|
7833
|
-
case
|
|
7852
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
7834
7853
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
7835
|
-
case
|
|
7854
|
+
case CompressionStatus.NOOP:
|
|
7836
7855
|
return "Nothing to compress.";
|
|
7837
7856
|
default:
|
|
7838
7857
|
return "";
|
|
@@ -8258,8 +8277,8 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8258
8277
|
);
|
|
8259
8278
|
roleEntries.sort(([a], [b]) => {
|
|
8260
8279
|
if (a === b) return 0;
|
|
8261
|
-
if (a ===
|
|
8262
|
-
if (b ===
|
|
8280
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8281
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8263
8282
|
return a.localeCompare(b);
|
|
8264
8283
|
});
|
|
8265
8284
|
roleEntries.forEach(([role, roleMetrics]) => {
|
|
@@ -8590,8 +8609,8 @@ var ModelStatsDisplay = ({
|
|
|
8590
8609
|
return validRoles.includes(role);
|
|
8591
8610
|
}).sort((a, b) => {
|
|
8592
8611
|
if (a === b) return 0;
|
|
8593
|
-
if (a ===
|
|
8594
|
-
if (b ===
|
|
8612
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8613
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8595
8614
|
return a.localeCompare(b);
|
|
8596
8615
|
});
|
|
8597
8616
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -9382,7 +9401,7 @@ var McpStatus = ({
|
|
|
9382
9401
|
);
|
|
9383
9402
|
const originalStatus = serverStatus(serverName);
|
|
9384
9403
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
9385
|
-
const status = originalStatus ===
|
|
9404
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
9386
9405
|
let statusIndicator = "";
|
|
9387
9406
|
let statusText = "";
|
|
9388
9407
|
let statusColor = theme.text.primary;
|
|
@@ -9394,17 +9413,17 @@ var McpStatus = ({
|
|
|
9394
9413
|
statusColor = theme.text.secondary;
|
|
9395
9414
|
} else {
|
|
9396
9415
|
switch (status) {
|
|
9397
|
-
case
|
|
9416
|
+
case MCPServerStatus.CONNECTED:
|
|
9398
9417
|
statusIndicator = "\u{1F7E2}";
|
|
9399
9418
|
statusText = "Ready";
|
|
9400
9419
|
statusColor = theme.status.success;
|
|
9401
9420
|
break;
|
|
9402
|
-
case
|
|
9421
|
+
case MCPServerStatus.CONNECTING:
|
|
9403
9422
|
statusIndicator = "\u{1F504}";
|
|
9404
9423
|
statusText = "Starting... (first startup may take longer)";
|
|
9405
9424
|
statusColor = theme.status.warning;
|
|
9406
9425
|
break;
|
|
9407
|
-
case
|
|
9426
|
+
case MCPServerStatus.DISCONNECTED:
|
|
9408
9427
|
default:
|
|
9409
9428
|
statusIndicator = "\u{1F534}";
|
|
9410
9429
|
statusText = "Disconnected";
|
|
@@ -9452,12 +9471,12 @@ var McpStatus = ({
|
|
|
9452
9471
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9453
9472
|
" - ",
|
|
9454
9473
|
statusText,
|
|
9455
|
-
status ===
|
|
9474
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
9456
9475
|
] }),
|
|
9457
9476
|
authStatusNode
|
|
9458
9477
|
] }),
|
|
9459
|
-
status ===
|
|
9460
|
-
status ===
|
|
9478
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
9479
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9461
9480
|
" (",
|
|
9462
9481
|
toolCount,
|
|
9463
9482
|
" tools cached)"
|
|
@@ -10018,7 +10037,7 @@ var Notifications = () => {
|
|
|
10018
10037
|
if (dismissed) return [];
|
|
10019
10038
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
10020
10039
|
return startupWarnings.filter((w) => {
|
|
10021
|
-
if (w.priority ===
|
|
10040
|
+
if (w.priority === WarningPriority.Low) {
|
|
10022
10041
|
const count = counts[w.id] || 0;
|
|
10023
10042
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
10024
10043
|
}
|
|
@@ -10031,7 +10050,7 @@ var Notifications = () => {
|
|
|
10031
10050
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
10032
10051
|
let changed = false;
|
|
10033
10052
|
visibleWarnings.forEach((w) => {
|
|
10034
|
-
if (w.priority ===
|
|
10053
|
+
if (w.priority === WarningPriority.Low) {
|
|
10035
10054
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
10036
10055
|
changed = true;
|
|
10037
10056
|
}
|
|
@@ -10138,7 +10157,7 @@ var UserIdentity = ({ config }) => {
|
|
|
10138
10157
|
}
|
|
10139
10158
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
10140
10159
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
|
|
10141
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
10160
|
+
/* @__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: [
|
|
10142
10161
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
|
|
10143
10162
|
"Signed in with Google",
|
|
10144
10163
|
email ? ":" : ""
|
|
@@ -10381,7 +10400,7 @@ var import_react32 = __toESM(require_react(), 1);
|
|
|
10381
10400
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
10382
10401
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
10383
10402
|
const confirmingTools = allPendingTools.filter(
|
|
10384
|
-
(tool) => tool.status ===
|
|
10403
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
10385
10404
|
);
|
|
10386
10405
|
if (confirmingTools.length === 0) {
|
|
10387
10406
|
return null;
|
|
@@ -11689,7 +11708,7 @@ var ExitPlanModeDialog = ({
|
|
|
11689
11708
|
{
|
|
11690
11709
|
questions: [
|
|
11691
11710
|
{
|
|
11692
|
-
type:
|
|
11711
|
+
type: QuestionType.CHOICE,
|
|
11693
11712
|
header: "Approval",
|
|
11694
11713
|
question: planContent,
|
|
11695
11714
|
options: [
|
|
@@ -11710,9 +11729,9 @@ var ExitPlanModeDialog = ({
|
|
|
11710
11729
|
onSubmit: (answers) => {
|
|
11711
11730
|
const answer = answers["0"];
|
|
11712
11731
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
11713
|
-
onApprove(
|
|
11732
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
11714
11733
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
11715
|
-
onApprove(
|
|
11734
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
11716
11735
|
} else if (answer) {
|
|
11717
11736
|
onFeedback(answer);
|
|
11718
11737
|
}
|
|
@@ -11923,7 +11942,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11923
11942
|
);
|
|
11924
11943
|
(0, import_react37.useEffect)(() => {
|
|
11925
11944
|
if (isCancelling) {
|
|
11926
|
-
handleConfirm(
|
|
11945
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
11927
11946
|
}
|
|
11928
11947
|
}, [isCancelling, handleConfirm]);
|
|
11929
11948
|
const handleSelect = (0, import_react37.useCallback)(
|
|
@@ -11936,19 +11955,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
11936
11955
|
if (!confirmationDetails.isModifying) {
|
|
11937
11956
|
options2.push({
|
|
11938
11957
|
label: "Allow once",
|
|
11939
|
-
value:
|
|
11958
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11940
11959
|
key: "Allow once"
|
|
11941
11960
|
});
|
|
11942
11961
|
if (isTrustedFolder) {
|
|
11943
11962
|
options2.push({
|
|
11944
11963
|
label: "Allow for this session",
|
|
11945
|
-
value:
|
|
11964
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11946
11965
|
key: "Allow for this session"
|
|
11947
11966
|
});
|
|
11948
11967
|
if (allowPermanentApproval) {
|
|
11949
11968
|
options2.push({
|
|
11950
11969
|
label: "Allow for this file in all future sessions",
|
|
11951
|
-
value:
|
|
11970
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11952
11971
|
key: "Allow for this file in all future sessions"
|
|
11953
11972
|
});
|
|
11954
11973
|
}
|
|
@@ -11956,119 +11975,119 @@ ${deceptiveUrlWarnings.map(
|
|
|
11956
11975
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
11957
11976
|
options2.push({
|
|
11958
11977
|
label: "Modify with external editor",
|
|
11959
|
-
value:
|
|
11978
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
11960
11979
|
key: "Modify with external editor"
|
|
11961
11980
|
});
|
|
11962
11981
|
}
|
|
11963
11982
|
options2.push({
|
|
11964
11983
|
label: "No, suggest changes (esc)",
|
|
11965
|
-
value:
|
|
11984
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11966
11985
|
key: "No, suggest changes (esc)"
|
|
11967
11986
|
});
|
|
11968
11987
|
}
|
|
11969
11988
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
11970
11989
|
options2.push({
|
|
11971
11990
|
label: "Allow once",
|
|
11972
|
-
value:
|
|
11991
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11973
11992
|
key: "Allow once"
|
|
11974
11993
|
});
|
|
11975
11994
|
if (isTrustedFolder) {
|
|
11976
11995
|
options2.push({
|
|
11977
11996
|
label: "Allow for this session",
|
|
11978
|
-
value:
|
|
11997
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11979
11998
|
key: "Allow for this session"
|
|
11980
11999
|
});
|
|
11981
12000
|
if (allowPermanentApproval) {
|
|
11982
12001
|
options2.push({
|
|
11983
12002
|
label: "Allow for all future sessions",
|
|
11984
|
-
value:
|
|
12003
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11985
12004
|
key: "Allow for all future sessions"
|
|
11986
12005
|
});
|
|
11987
12006
|
}
|
|
11988
12007
|
}
|
|
11989
12008
|
options2.push({
|
|
11990
12009
|
label: "No, suggest changes (esc)",
|
|
11991
|
-
value:
|
|
12010
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11992
12011
|
key: "No, suggest changes (esc)"
|
|
11993
12012
|
});
|
|
11994
12013
|
} else if (confirmationDetails.type === "exec") {
|
|
11995
12014
|
options2.push({
|
|
11996
12015
|
label: "Allow once",
|
|
11997
|
-
value:
|
|
12016
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11998
12017
|
key: "Allow once"
|
|
11999
12018
|
});
|
|
12000
12019
|
if (isTrustedFolder) {
|
|
12001
12020
|
options2.push({
|
|
12002
12021
|
label: `Allow for this session`,
|
|
12003
|
-
value:
|
|
12022
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12004
12023
|
key: `Allow for this session`
|
|
12005
12024
|
});
|
|
12006
12025
|
if (allowPermanentApproval) {
|
|
12007
12026
|
options2.push({
|
|
12008
12027
|
label: `Allow this command for all future sessions`,
|
|
12009
|
-
value:
|
|
12028
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12010
12029
|
key: `Allow for all future sessions`
|
|
12011
12030
|
});
|
|
12012
12031
|
}
|
|
12013
12032
|
}
|
|
12014
12033
|
options2.push({
|
|
12015
12034
|
label: "No, suggest changes (esc)",
|
|
12016
|
-
value:
|
|
12035
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12017
12036
|
key: "No, suggest changes (esc)"
|
|
12018
12037
|
});
|
|
12019
12038
|
} else if (confirmationDetails.type === "info") {
|
|
12020
12039
|
options2.push({
|
|
12021
12040
|
label: "Allow once",
|
|
12022
|
-
value:
|
|
12041
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12023
12042
|
key: "Allow once"
|
|
12024
12043
|
});
|
|
12025
12044
|
if (isTrustedFolder) {
|
|
12026
12045
|
options2.push({
|
|
12027
12046
|
label: "Allow for this session",
|
|
12028
|
-
value:
|
|
12047
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12029
12048
|
key: "Allow for this session"
|
|
12030
12049
|
});
|
|
12031
12050
|
if (allowPermanentApproval) {
|
|
12032
12051
|
options2.push({
|
|
12033
12052
|
label: "Allow for all future sessions",
|
|
12034
|
-
value:
|
|
12053
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12035
12054
|
key: "Allow for all future sessions"
|
|
12036
12055
|
});
|
|
12037
12056
|
}
|
|
12038
12057
|
}
|
|
12039
12058
|
options2.push({
|
|
12040
12059
|
label: "No, suggest changes (esc)",
|
|
12041
|
-
value:
|
|
12060
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12042
12061
|
key: "No, suggest changes (esc)"
|
|
12043
12062
|
});
|
|
12044
12063
|
} else if (confirmationDetails.type === "mcp") {
|
|
12045
12064
|
options2.push({
|
|
12046
12065
|
label: "Allow once",
|
|
12047
|
-
value:
|
|
12066
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12048
12067
|
key: "Allow once"
|
|
12049
12068
|
});
|
|
12050
12069
|
if (isTrustedFolder) {
|
|
12051
12070
|
options2.push({
|
|
12052
12071
|
label: "Allow tool for this session",
|
|
12053
|
-
value:
|
|
12072
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
12054
12073
|
key: "Allow tool for this session"
|
|
12055
12074
|
});
|
|
12056
12075
|
options2.push({
|
|
12057
12076
|
label: "Allow all server tools for this session",
|
|
12058
|
-
value:
|
|
12077
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
12059
12078
|
key: "Allow all server tools for this session"
|
|
12060
12079
|
});
|
|
12061
12080
|
if (allowPermanentApproval) {
|
|
12062
12081
|
options2.push({
|
|
12063
12082
|
label: "Allow tool for all future sessions",
|
|
12064
|
-
value:
|
|
12083
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12065
12084
|
key: "Allow tool for all future sessions"
|
|
12066
12085
|
});
|
|
12067
12086
|
}
|
|
12068
12087
|
}
|
|
12069
12088
|
options2.push({
|
|
12070
12089
|
label: "No, suggest changes (esc)",
|
|
12071
|
-
value:
|
|
12090
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12072
12091
|
key: "No, suggest changes (esc)"
|
|
12073
12092
|
});
|
|
12074
12093
|
}
|
|
@@ -12107,7 +12126,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12107
12126
|
const containsRedirection = commandsToDisplay.some(
|
|
12108
12127
|
(cmd) => hasRedirection(cmd)
|
|
12109
12128
|
);
|
|
12110
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12129
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12111
12130
|
if (containsRedirection && !isAutoEdit) {
|
|
12112
12131
|
extraInfoLines = 1;
|
|
12113
12132
|
}
|
|
@@ -12133,7 +12152,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12133
12152
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
12134
12153
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
12135
12154
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
12136
|
-
(o) => o.value ===
|
|
12155
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
12137
12156
|
);
|
|
12138
12157
|
if (alwaysAndSaveIndex !== -1) {
|
|
12139
12158
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -12150,10 +12169,10 @@ ${deceptiveUrlWarnings.map(
|
|
|
12150
12169
|
{
|
|
12151
12170
|
questions: confirmationDetails.questions,
|
|
12152
12171
|
onSubmit: (answers) => {
|
|
12153
|
-
handleConfirm(
|
|
12172
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
12154
12173
|
},
|
|
12155
12174
|
onCancel: () => {
|
|
12156
|
-
handleConfirm(
|
|
12175
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12157
12176
|
},
|
|
12158
12177
|
width: terminalWidth,
|
|
12159
12178
|
availableHeight: bodyHeight
|
|
@@ -12174,19 +12193,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
12174
12193
|
planPath: confirmationDetails.planPath,
|
|
12175
12194
|
getPreferredEditor,
|
|
12176
12195
|
onApprove: (approvalMode) => {
|
|
12177
|
-
handleConfirm(
|
|
12196
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12178
12197
|
approved: true,
|
|
12179
12198
|
approvalMode
|
|
12180
12199
|
});
|
|
12181
12200
|
},
|
|
12182
12201
|
onFeedback: (feedback) => {
|
|
12183
|
-
handleConfirm(
|
|
12202
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12184
12203
|
approved: false,
|
|
12185
12204
|
feedback
|
|
12186
12205
|
});
|
|
12187
12206
|
},
|
|
12188
12207
|
onCancel: () => {
|
|
12189
|
-
handleConfirm(
|
|
12208
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12190
12209
|
},
|
|
12191
12210
|
width: terminalWidth,
|
|
12192
12211
|
availableHeight: bodyHeight
|
|
@@ -12295,7 +12314,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12295
12314
|
const containsRedirection = commandsToDisplay.some(
|
|
12296
12315
|
(cmd) => hasRedirection(cmd)
|
|
12297
12316
|
);
|
|
12298
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12317
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12299
12318
|
let warnings = null;
|
|
12300
12319
|
if (containsRedirection && !isAutoEdit) {
|
|
12301
12320
|
const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
|
|
@@ -12454,7 +12473,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12454
12473
|
const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
|
|
12455
12474
|
const renderRadioItem = (0, import_react37.useCallback)(
|
|
12456
12475
|
(item, { titleColor }) => {
|
|
12457
|
-
if (item.value ===
|
|
12476
|
+
if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
12458
12477
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
|
|
12459
12478
|
item.label,
|
|
12460
12479
|
" ",
|
|
@@ -14484,7 +14503,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
|
|
|
14484
14503
|
if (settings.merged.security.auth.useExternal) {
|
|
14485
14504
|
return null;
|
|
14486
14505
|
}
|
|
14487
|
-
if (authType ===
|
|
14506
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14488
14507
|
return null;
|
|
14489
14508
|
}
|
|
14490
14509
|
return validateAuthMethod(authType);
|
|
@@ -14536,7 +14555,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
14536
14555
|
}
|
|
14537
14556
|
return;
|
|
14538
14557
|
}
|
|
14539
|
-
if (authType ===
|
|
14558
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14540
14559
|
const key = await reloadApiKey();
|
|
14541
14560
|
if (!key) {
|
|
14542
14561
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -14614,31 +14633,31 @@ function AuthDialog({
|
|
|
14614
14633
|
let items = [
|
|
14615
14634
|
{
|
|
14616
14635
|
label: "Sign in with Google",
|
|
14617
|
-
value:
|
|
14618
|
-
key:
|
|
14636
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
14637
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
14619
14638
|
},
|
|
14620
14639
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
14621
14640
|
{
|
|
14622
14641
|
label: "Use Cloud Shell user credentials",
|
|
14623
|
-
value:
|
|
14624
|
-
key:
|
|
14642
|
+
value: AuthType.COMPUTE_ADC,
|
|
14643
|
+
key: AuthType.COMPUTE_ADC
|
|
14625
14644
|
}
|
|
14626
14645
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
14627
14646
|
{
|
|
14628
14647
|
label: "Use metadata server application default credentials",
|
|
14629
|
-
value:
|
|
14630
|
-
key:
|
|
14648
|
+
value: AuthType.COMPUTE_ADC,
|
|
14649
|
+
key: AuthType.COMPUTE_ADC
|
|
14631
14650
|
}
|
|
14632
14651
|
] : [],
|
|
14633
14652
|
{
|
|
14634
14653
|
label: "Use Gemini API Key",
|
|
14635
|
-
value:
|
|
14636
|
-
key:
|
|
14654
|
+
value: AuthType.USE_GEMINI,
|
|
14655
|
+
key: AuthType.USE_GEMINI
|
|
14637
14656
|
},
|
|
14638
14657
|
{
|
|
14639
14658
|
label: "Vertex AI",
|
|
14640
|
-
value:
|
|
14641
|
-
key:
|
|
14659
|
+
value: AuthType.USE_VERTEX_AI,
|
|
14660
|
+
key: AuthType.USE_VERTEX_AI
|
|
14642
14661
|
}
|
|
14643
14662
|
];
|
|
14644
14663
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -14660,9 +14679,9 @@ function AuthDialog({
|
|
|
14660
14679
|
return item.value === defaultAuthType;
|
|
14661
14680
|
}
|
|
14662
14681
|
if (process.env["GEMINI_API_KEY"]) {
|
|
14663
|
-
return item.value ===
|
|
14682
|
+
return item.value === AuthType.USE_GEMINI;
|
|
14664
14683
|
}
|
|
14665
|
-
return item.value ===
|
|
14684
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
14666
14685
|
});
|
|
14667
14686
|
if (settings.merged.security.auth.enforcedType) {
|
|
14668
14687
|
initialAuthIndex = 0;
|
|
@@ -14673,7 +14692,7 @@ function AuthDialog({
|
|
|
14673
14692
|
return;
|
|
14674
14693
|
}
|
|
14675
14694
|
if (authType) {
|
|
14676
|
-
const needsRestart = authType ===
|
|
14695
|
+
const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
|
|
14677
14696
|
if (needsRestart) {
|
|
14678
14697
|
setAuthContext({ requiresRestart: true });
|
|
14679
14698
|
} else {
|
|
@@ -14681,12 +14700,12 @@ function AuthDialog({
|
|
|
14681
14700
|
}
|
|
14682
14701
|
await clearCachedCredentialFile();
|
|
14683
14702
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
14684
|
-
if (authType ===
|
|
14703
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
14685
14704
|
setExiting(true);
|
|
14686
14705
|
setTimeout(relaunchApp, 100);
|
|
14687
14706
|
return;
|
|
14688
14707
|
}
|
|
14689
|
-
if (authType ===
|
|
14708
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14690
14709
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
14691
14710
|
return;
|
|
14692
14711
|
}
|
|
@@ -15482,11 +15501,11 @@ var PrivacyNoticeText = ({
|
|
|
15482
15501
|
}) => {
|
|
15483
15502
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15484
15503
|
switch (authType) {
|
|
15485
|
-
case
|
|
15504
|
+
case AuthType.USE_GEMINI:
|
|
15486
15505
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15487
|
-
case
|
|
15506
|
+
case AuthType.USE_VERTEX_AI:
|
|
15488
15507
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15489
|
-
case
|
|
15508
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15490
15509
|
default:
|
|
15491
15510
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15492
15511
|
}
|
|
@@ -15527,7 +15546,7 @@ function ProQuotaDialog({
|
|
|
15527
15546
|
value: "retry_always",
|
|
15528
15547
|
key: "retry_always"
|
|
15529
15548
|
},
|
|
15530
|
-
...authType ===
|
|
15549
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15531
15550
|
{
|
|
15532
15551
|
label: "Upgrade for higher limits",
|
|
15533
15552
|
value: "upgrade",
|
|
@@ -16686,7 +16705,7 @@ function ModelDialog({ onClose }) {
|
|
|
16686
16705
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
16687
16706
|
const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
|
|
16688
16707
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16689
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16708
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16690
16709
|
const manualModelSelected = (0, import_react55.useMemo)(() => {
|
|
16691
16710
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16692
16711
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -18009,10 +18028,10 @@ function initializeConsoleStore() {
|
|
|
18009
18028
|
globalConsoleMessages = [];
|
|
18010
18029
|
globalErrorCount = 0;
|
|
18011
18030
|
notifyListeners();
|
|
18012
|
-
coreEvents.off(
|
|
18013
|
-
coreEvents.off(
|
|
18014
|
-
coreEvents.on(
|
|
18015
|
-
coreEvents.on(
|
|
18031
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18032
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
18033
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18034
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
18016
18035
|
}
|
|
18017
18036
|
function notifyListeners() {
|
|
18018
18037
|
for (const listener of listeners) {
|
|
@@ -20149,7 +20168,7 @@ function usePromptCompletion({
|
|
|
20149
20168
|
{ model: "prompt-completion" },
|
|
20150
20169
|
contents,
|
|
20151
20170
|
signal,
|
|
20152
|
-
|
|
20171
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20153
20172
|
);
|
|
20154
20173
|
if (signal.aborted) {
|
|
20155
20174
|
return;
|
|
@@ -22227,9 +22246,9 @@ var InputPrompt = ({
|
|
|
22227
22246
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22228
22247
|
}
|
|
22229
22248
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22230
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22231
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22232
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22249
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22250
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22251
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22233
22252
|
let statusColor;
|
|
22234
22253
|
let statusText = "";
|
|
22235
22254
|
if (shellModeActive) {
|
|
@@ -23062,22 +23081,22 @@ var ApprovalModeIndicator = ({
|
|
|
23062
23081
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
23063
23082
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
23064
23083
|
switch (approvalMode) {
|
|
23065
|
-
case
|
|
23084
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23066
23085
|
textColor = theme.status.warning;
|
|
23067
23086
|
textContent = "auto-accept edits";
|
|
23068
23087
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23069
23088
|
break;
|
|
23070
|
-
case
|
|
23089
|
+
case ApprovalMode.PLAN:
|
|
23071
23090
|
textColor = theme.status.success;
|
|
23072
23091
|
textContent = "plan";
|
|
23073
23092
|
subText = `${cycleHint} to manual`;
|
|
23074
23093
|
break;
|
|
23075
|
-
case
|
|
23094
|
+
case ApprovalMode.YOLO:
|
|
23076
23095
|
textColor = theme.status.error;
|
|
23077
23096
|
textContent = "YOLO";
|
|
23078
23097
|
subText = yoloHint;
|
|
23079
23098
|
break;
|
|
23080
|
-
case
|
|
23099
|
+
case ApprovalMode.DEFAULT:
|
|
23081
23100
|
default:
|
|
23082
23101
|
textColor = theme.text.accent;
|
|
23083
23102
|
textContent = "";
|
|
@@ -23125,7 +23144,7 @@ var useComposerStatus = () => {
|
|
|
23125
23144
|
(item) => item.type === "tool_group"
|
|
23126
23145
|
).some(
|
|
23127
23146
|
(item) => item.tools.some(
|
|
23128
|
-
(tool) => tool.status ===
|
|
23147
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23129
23148
|
)
|
|
23130
23149
|
),
|
|
23131
23150
|
[uiState.pendingHistoryItems]
|
|
@@ -23140,13 +23159,13 @@ var useComposerStatus = () => {
|
|
|
23140
23159
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23141
23160
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23142
23161
|
switch (showApprovalModeIndicator) {
|
|
23143
|
-
case
|
|
23162
|
+
case ApprovalMode.YOLO:
|
|
23144
23163
|
return { text: "YOLO", color: theme.status.error };
|
|
23145
|
-
case
|
|
23164
|
+
case ApprovalMode.PLAN:
|
|
23146
23165
|
return { text: "plan", color: theme.status.success };
|
|
23147
|
-
case
|
|
23166
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23148
23167
|
return { text: "auto edit", color: theme.status.warning };
|
|
23149
|
-
case
|
|
23168
|
+
case ApprovalMode.DEFAULT:
|
|
23150
23169
|
default:
|
|
23151
23170
|
return null;
|
|
23152
23171
|
}
|
|
@@ -23500,7 +23519,7 @@ var ConfigInitDisplay = ({
|
|
|
23500
23519
|
let connected = 0;
|
|
23501
23520
|
const connecting = [];
|
|
23502
23521
|
for (const [name, client] of clients.entries()) {
|
|
23503
|
-
if (client.getStatus() ===
|
|
23522
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23504
23523
|
connected++;
|
|
23505
23524
|
} else {
|
|
23506
23525
|
connecting.push(name);
|
|
@@ -23522,9 +23541,9 @@ var ConfigInitDisplay = ({
|
|
|
23522
23541
|
);
|
|
23523
23542
|
}
|
|
23524
23543
|
};
|
|
23525
|
-
coreEvents.on(
|
|
23544
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23526
23545
|
return () => {
|
|
23527
|
-
coreEvents.off(
|
|
23546
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23528
23547
|
};
|
|
23529
23548
|
}, [initialMessage]);
|
|
23530
23549
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
|
|
@@ -24241,7 +24260,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24241
24260
|
callId,
|
|
24242
24261
|
name: SHELL_COMMAND_NAME,
|
|
24243
24262
|
description: rawQuery,
|
|
24244
|
-
status:
|
|
24263
|
+
status: CoreToolCallStatus.Executing,
|
|
24245
24264
|
isClientInitiated: true,
|
|
24246
24265
|
resultDisplay: "",
|
|
24247
24266
|
confirmationDetails: void 0
|
|
@@ -24382,7 +24401,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24382
24401
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24383
24402
|
}
|
|
24384
24403
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24385
|
-
let finalStatus =
|
|
24404
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24386
24405
|
const prependToAnsiOutput = (output, text) => {
|
|
24387
24406
|
const newLines = text.split("\n").map((line) => [
|
|
24388
24407
|
{
|
|
@@ -24401,20 +24420,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24401
24420
|
};
|
|
24402
24421
|
let prefix = "";
|
|
24403
24422
|
if (result.error) {
|
|
24404
|
-
finalStatus =
|
|
24423
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24405
24424
|
prefix = result.error.message;
|
|
24406
24425
|
} else if (result.aborted) {
|
|
24407
|
-
finalStatus =
|
|
24426
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24408
24427
|
prefix = "Command was cancelled.";
|
|
24409
24428
|
} else if (result.backgrounded) {
|
|
24410
|
-
finalStatus =
|
|
24429
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24411
24430
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24412
24431
|
mainContent = finalOutput;
|
|
24413
24432
|
} else if (result.signal) {
|
|
24414
|
-
finalStatus =
|
|
24433
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24415
24434
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24416
24435
|
} else if (result.exitCode !== 0) {
|
|
24417
|
-
finalStatus =
|
|
24436
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24418
24437
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24419
24438
|
}
|
|
24420
24439
|
if (prefix) {
|
|
@@ -24440,7 +24459,7 @@ ${mainContent}`;
|
|
|
24440
24459
|
status: finalStatus,
|
|
24441
24460
|
resultDisplay: finalOutput
|
|
24442
24461
|
};
|
|
24443
|
-
if (finalStatus !==
|
|
24462
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24444
24463
|
addItemToHistory(
|
|
24445
24464
|
{
|
|
24446
24465
|
type: "tool_group",
|
|
@@ -25430,12 +25449,12 @@ function useQuotaAndFallback({
|
|
|
25430
25449
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25431
25450
|
`/stats model for usage details`,
|
|
25432
25451
|
`/model to switch models.`,
|
|
25433
|
-
contentGeneratorConfig?.authType ===
|
|
25452
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25434
25453
|
].filter(Boolean);
|
|
25435
25454
|
message = messageLines.join("\n");
|
|
25436
25455
|
} else if (error instanceof ModelNotFoundError) {
|
|
25437
25456
|
isModelNotFoundError = true;
|
|
25438
|
-
if (contentGeneratorConfig?.authType ===
|
|
25457
|
+
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
25439
25458
|
const location = process.env["GOOGLE_CLOUD_LOCATION"] || "your configured region";
|
|
25440
25459
|
const messageLines = [
|
|
25441
25460
|
`Model "${failedModel}" is not available in region "${location}".`,
|
|
@@ -25627,7 +25646,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25627
25646
|
);
|
|
25628
25647
|
setEditorError(null);
|
|
25629
25648
|
setIsEditorDialogOpen(false);
|
|
25630
|
-
coreEvents.emit(
|
|
25649
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25631
25650
|
} catch (error) {
|
|
25632
25651
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25633
25652
|
}
|
|
@@ -25636,7 +25655,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25636
25655
|
);
|
|
25637
25656
|
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25638
25657
|
setIsEditorDialogOpen(false);
|
|
25639
|
-
coreEvents.emit(
|
|
25658
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25640
25659
|
}, []);
|
|
25641
25660
|
return {
|
|
25642
25661
|
isEditorDialogOpen,
|
|
@@ -26013,7 +26032,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26013
26032
|
canonicalPath: resolvedCommandPath
|
|
26014
26033
|
} = parseSlashCommand(trimmed, commands);
|
|
26015
26034
|
if (!commandToExecute) {
|
|
26016
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
26035
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
26017
26036
|
if (isMcpLoading) {
|
|
26018
26037
|
setIsProcessing(true);
|
|
26019
26038
|
if (addToHistory) {
|
|
@@ -26193,7 +26212,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26193
26212
|
onConfirm: async (resolvedOutcome) => {
|
|
26194
26213
|
resolve3({
|
|
26195
26214
|
outcome: resolvedOutcome,
|
|
26196
|
-
approvedCommands: resolvedOutcome ===
|
|
26215
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26197
26216
|
});
|
|
26198
26217
|
}
|
|
26199
26218
|
};
|
|
@@ -26201,7 +26220,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26201
26220
|
callId,
|
|
26202
26221
|
name: "Expansion",
|
|
26203
26222
|
description: "Command expansion needs shell access",
|
|
26204
|
-
status:
|
|
26223
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26205
26224
|
isClientInitiated: true,
|
|
26206
26225
|
resultDisplay: void 0,
|
|
26207
26226
|
confirmationDetails
|
|
@@ -26212,7 +26231,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26212
26231
|
});
|
|
26213
26232
|
});
|
|
26214
26233
|
setPendingItem(null);
|
|
26215
|
-
if (outcome ===
|
|
26234
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26216
26235
|
addItem(
|
|
26217
26236
|
{
|
|
26218
26237
|
type: "info" /* INFO */,
|
|
@@ -26222,7 +26241,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26222
26241
|
);
|
|
26223
26242
|
return { type: "handled" };
|
|
26224
26243
|
}
|
|
26225
|
-
if (outcome ===
|
|
26244
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26226
26245
|
setSessionShellAllowlist(
|
|
26227
26246
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26228
26247
|
);
|
|
@@ -26698,7 +26717,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26698
26717
|
let description;
|
|
26699
26718
|
let renderOutputAsMarkdown = false;
|
|
26700
26719
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26701
|
-
if (call.status ===
|
|
26720
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26702
26721
|
description = JSON.stringify(call.request.args);
|
|
26703
26722
|
} else {
|
|
26704
26723
|
description = call.invocation.getDescription();
|
|
@@ -26721,27 +26740,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26721
26740
|
let progress = void 0;
|
|
26722
26741
|
let progressTotal = void 0;
|
|
26723
26742
|
switch (call.status) {
|
|
26724
|
-
case
|
|
26743
|
+
case CoreToolCallStatus.Success:
|
|
26725
26744
|
resultDisplay = call.response.resultDisplay;
|
|
26726
26745
|
outputFile = call.response.outputFile;
|
|
26727
26746
|
break;
|
|
26728
|
-
case
|
|
26729
|
-
case
|
|
26747
|
+
case CoreToolCallStatus.Error:
|
|
26748
|
+
case CoreToolCallStatus.Cancelled:
|
|
26730
26749
|
resultDisplay = call.response.resultDisplay;
|
|
26731
26750
|
break;
|
|
26732
|
-
case
|
|
26751
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26733
26752
|
correlationId = call.correlationId;
|
|
26734
26753
|
confirmationDetails = call.confirmationDetails;
|
|
26735
26754
|
break;
|
|
26736
|
-
case
|
|
26755
|
+
case CoreToolCallStatus.Executing:
|
|
26737
26756
|
resultDisplay = call.liveOutput;
|
|
26738
26757
|
ptyId = call.pid;
|
|
26739
26758
|
progressMessage = call.progressMessage;
|
|
26740
26759
|
progress = call.progress;
|
|
26741
26760
|
progressTotal = call.progressTotal;
|
|
26742
26761
|
break;
|
|
26743
|
-
case
|
|
26744
|
-
case
|
|
26762
|
+
case CoreToolCallStatus.Scheduled:
|
|
26763
|
+
case CoreToolCallStatus.Validating:
|
|
26745
26764
|
break;
|
|
26746
26765
|
default: {
|
|
26747
26766
|
const exhaustiveCheck = call;
|
|
@@ -26812,7 +26831,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26812
26831
|
const handler = (event) => {
|
|
26813
26832
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26814
26833
|
const hasExecuting = event.toolCalls.some(
|
|
26815
|
-
(tc) => tc.status ===
|
|
26834
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26816
26835
|
);
|
|
26817
26836
|
if (hasExecuting) {
|
|
26818
26837
|
setLastToolOutputTime(Date.now());
|
|
@@ -26821,7 +26840,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26821
26840
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26822
26841
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26823
26842
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26824
|
-
(tc) => tc.status ===
|
|
26843
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26825
26844
|
);
|
|
26826
26845
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26827
26846
|
return prev;
|
|
@@ -26833,9 +26852,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26833
26852
|
};
|
|
26834
26853
|
});
|
|
26835
26854
|
};
|
|
26836
|
-
messageBus.subscribe(
|
|
26855
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26837
26856
|
return () => {
|
|
26838
|
-
messageBus.unsubscribe(
|
|
26857
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26839
26858
|
};
|
|
26840
26859
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26841
26860
|
(0, import_react98.useEffect)(() => {
|
|
@@ -26857,9 +26876,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26857
26876
|
};
|
|
26858
26877
|
});
|
|
26859
26878
|
};
|
|
26860
|
-
messageBus.subscribe(
|
|
26879
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26861
26880
|
return () => {
|
|
26862
|
-
messageBus.unsubscribe(
|
|
26881
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26863
26882
|
};
|
|
26864
26883
|
}, [messageBus]);
|
|
26865
26884
|
const schedule = (0, import_react98.useCallback)(
|
|
@@ -26958,8 +26977,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
26958
26977
|
const prev = prevMap.get(coreCall.request.callId);
|
|
26959
26978
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
26960
26979
|
let status = coreCall.status;
|
|
26961
|
-
if ((status ===
|
|
26962
|
-
status =
|
|
26980
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
26981
|
+
status = CoreToolCallStatus.Executing;
|
|
26963
26982
|
}
|
|
26964
26983
|
return {
|
|
26965
26984
|
...coreCall,
|
|
@@ -26991,7 +27010,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
26991
27010
|
};
|
|
26992
27011
|
}
|
|
26993
27012
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
26994
|
-
return toolCall.status ===
|
|
27013
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
26995
27014
|
}
|
|
26996
27015
|
function showCitations(settings) {
|
|
26997
27016
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -27001,14 +27020,14 @@ function showCitations(settings) {
|
|
|
27001
27020
|
return true;
|
|
27002
27021
|
}
|
|
27003
27022
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
27004
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
27023
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
27005
27024
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
27006
27025
|
}
|
|
27007
27026
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
27008
|
-
if (tc.status ===
|
|
27027
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
27009
27028
|
return true;
|
|
27010
27029
|
}
|
|
27011
|
-
if (tc.status ===
|
|
27030
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
27012
27031
|
return !tc.responseSubmittedToGemini;
|
|
27013
27032
|
}
|
|
27014
27033
|
return false;
|
|
@@ -27054,9 +27073,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27054
27073
|
}
|
|
27055
27074
|
setRetryStatus(payload);
|
|
27056
27075
|
};
|
|
27057
|
-
coreEvents.on(
|
|
27076
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27058
27077
|
return () => {
|
|
27059
|
-
coreEvents.off(
|
|
27078
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27060
27079
|
};
|
|
27061
27080
|
}, [isRespondingRef]);
|
|
27062
27081
|
const [
|
|
@@ -27189,12 +27208,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27189
27208
|
const tc = toolCalls[i];
|
|
27190
27209
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27191
27210
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27192
|
-
const isAgent = tc.tool?.kind ===
|
|
27211
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27193
27212
|
if (isAgent) {
|
|
27194
27213
|
let contigAgentsComplete = true;
|
|
27195
27214
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27196
27215
|
const nextTc = toolCalls[j];
|
|
27197
|
-
if (nextTc.tool?.kind ===
|
|
27216
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27198
27217
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27199
27218
|
contigAgentsComplete = false;
|
|
27200
27219
|
break;
|
|
@@ -27220,7 +27239,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27220
27239
|
let currentGroup = [];
|
|
27221
27240
|
for (const tc of toolsToPush) {
|
|
27222
27241
|
newPushed.add(tc.request.callId);
|
|
27223
|
-
if (tc.tool?.kind ===
|
|
27242
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27224
27243
|
currentGroup.push(tc);
|
|
27225
27244
|
} else {
|
|
27226
27245
|
if (currentGroup.length > 0) {
|
|
@@ -27370,7 +27389,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27370
27389
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27371
27390
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27372
27391
|
(0, import_react99.useEffect)(() => {
|
|
27373
|
-
if (config.getApprovalMode() ===
|
|
27392
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27374
27393
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27375
27394
|
(item) => item.type === "user" /* USER */
|
|
27376
27395
|
);
|
|
@@ -27438,7 +27457,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27438
27457
|
return;
|
|
27439
27458
|
}
|
|
27440
27459
|
const hasActiveTools = toolCalls.some(
|
|
27441
|
-
(tc) => tc.status ===
|
|
27460
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27442
27461
|
);
|
|
27443
27462
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27444
27463
|
if (clearBuffer) {
|
|
@@ -27465,7 +27484,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27465
27484
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27466
27485
|
return {
|
|
27467
27486
|
...tool,
|
|
27468
|
-
status:
|
|
27487
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27469
27488
|
resultDisplay: tool.resultDisplay
|
|
27470
27489
|
};
|
|
27471
27490
|
}
|
|
@@ -27530,7 +27549,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27530
27549
|
let localQueryToSendToGemini = null;
|
|
27531
27550
|
if (typeof query === "string") {
|
|
27532
27551
|
const trimmedQuery = query.trim();
|
|
27533
|
-
await logger?.logMessage(
|
|
27552
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27534
27553
|
if (!shellModeActive) {
|
|
27535
27554
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27536
27555
|
if (slashCommandResult) {
|
|
@@ -27686,7 +27705,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27686
27705
|
if (pendingHistoryItemRef.current) {
|
|
27687
27706
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27688
27707
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27689
|
-
(tool) => tool.status ===
|
|
27708
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
27690
27709
|
);
|
|
27691
27710
|
const pendingItem = {
|
|
27692
27711
|
...pendingHistoryItemRef.current,
|
|
@@ -27932,15 +27951,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27932
27951
|
let geminiMessageBuffer = "";
|
|
27933
27952
|
const toolCallRequests = [];
|
|
27934
27953
|
for await (const event of stream) {
|
|
27935
|
-
if (event.type !==
|
|
27954
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
27936
27955
|
setThought(null);
|
|
27937
27956
|
}
|
|
27938
27957
|
switch (event.type) {
|
|
27939
|
-
case
|
|
27958
|
+
case GeminiEventType.Thought:
|
|
27940
27959
|
setLastGeminiActivityTime(Date.now());
|
|
27941
27960
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
27942
27961
|
break;
|
|
27943
|
-
case
|
|
27962
|
+
case GeminiEventType.Content:
|
|
27944
27963
|
setLastGeminiActivityTime(Date.now());
|
|
27945
27964
|
geminiMessageBuffer = handleContentEvent(
|
|
27946
27965
|
event.value,
|
|
@@ -27948,16 +27967,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27948
27967
|
userMessageTimestamp
|
|
27949
27968
|
);
|
|
27950
27969
|
break;
|
|
27951
|
-
case
|
|
27970
|
+
case GeminiEventType.ToolCallRequest:
|
|
27952
27971
|
toolCallRequests.push(event.value);
|
|
27953
27972
|
break;
|
|
27954
|
-
case
|
|
27973
|
+
case GeminiEventType.UserCancelled:
|
|
27955
27974
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
27956
27975
|
break;
|
|
27957
|
-
case
|
|
27976
|
+
case GeminiEventType.Error:
|
|
27958
27977
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
27959
27978
|
break;
|
|
27960
|
-
case
|
|
27979
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
27961
27980
|
handleAgentExecutionStoppedEvent(
|
|
27962
27981
|
event.value.reason,
|
|
27963
27982
|
userMessageTimestamp,
|
|
@@ -27965,7 +27984,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27965
27984
|
event.value.contextCleared
|
|
27966
27985
|
);
|
|
27967
27986
|
break;
|
|
27968
|
-
case
|
|
27987
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
27969
27988
|
handleAgentExecutionBlockedEvent(
|
|
27970
27989
|
event.value.reason,
|
|
27971
27990
|
userMessageTimestamp,
|
|
@@ -27973,35 +27992,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27973
27992
|
event.value.contextCleared
|
|
27974
27993
|
);
|
|
27975
27994
|
break;
|
|
27976
|
-
case
|
|
27995
|
+
case GeminiEventType.ChatCompressed:
|
|
27977
27996
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
27978
27997
|
break;
|
|
27979
|
-
case
|
|
27980
|
-
case
|
|
27998
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
27999
|
+
case GeminiEventType.ToolCallResponse:
|
|
27981
28000
|
break;
|
|
27982
|
-
case
|
|
28001
|
+
case GeminiEventType.MaxSessionTurns:
|
|
27983
28002
|
handleMaxSessionTurnsEvent();
|
|
27984
28003
|
break;
|
|
27985
|
-
case
|
|
28004
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
27986
28005
|
handleContextWindowWillOverflowEvent(
|
|
27987
28006
|
event.value.estimatedRequestTokenCount,
|
|
27988
28007
|
event.value.remainingTokenCount
|
|
27989
28008
|
);
|
|
27990
28009
|
break;
|
|
27991
|
-
case
|
|
28010
|
+
case GeminiEventType.Finished:
|
|
27992
28011
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
27993
28012
|
break;
|
|
27994
|
-
case
|
|
28013
|
+
case GeminiEventType.Citation:
|
|
27995
28014
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
27996
28015
|
break;
|
|
27997
|
-
case
|
|
28016
|
+
case GeminiEventType.ModelInfo:
|
|
27998
28017
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
27999
28018
|
break;
|
|
28000
|
-
case
|
|
28019
|
+
case GeminiEventType.LoopDetected:
|
|
28001
28020
|
loopDetectedRef.current = true;
|
|
28002
28021
|
break;
|
|
28003
|
-
case
|
|
28004
|
-
case
|
|
28022
|
+
case GeminiEventType.Retry:
|
|
28023
|
+
case GeminiEventType.InvalidStream:
|
|
28005
28024
|
break;
|
|
28006
28025
|
default: {
|
|
28007
28026
|
const unreachable = event;
|
|
@@ -28042,7 +28061,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28042
28061
|
const submitQuery = (0, import_react99.useCallback)(
|
|
28043
28062
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
28044
28063
|
{
|
|
28045
|
-
operation: options?.isContinuation ?
|
|
28064
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
28046
28065
|
sessionId: config.getSessionId()
|
|
28047
28066
|
},
|
|
28048
28067
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28202,7 +28221,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28202
28221
|
);
|
|
28203
28222
|
const handleApprovalModeChange = (0, import_react99.useCallback)(
|
|
28204
28223
|
async (newApprovalMode) => {
|
|
28205
|
-
if (previousApprovalModeRef.current ===
|
|
28224
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28206
28225
|
if (geminiClient) {
|
|
28207
28226
|
try {
|
|
28208
28227
|
await geminiClient.addHistory({
|
|
@@ -28225,11 +28244,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28225
28244
|
}
|
|
28226
28245
|
}
|
|
28227
28246
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28228
|
-
if (newApprovalMode ===
|
|
28247
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28229
28248
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28230
28249
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28231
28250
|
);
|
|
28232
|
-
if (newApprovalMode ===
|
|
28251
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28233
28252
|
awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
|
|
28234
28253
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
28235
28254
|
return true;
|
|
@@ -28245,11 +28264,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28245
28264
|
if (call.correlationId) {
|
|
28246
28265
|
try {
|
|
28247
28266
|
await config.getMessageBus().publish({
|
|
28248
|
-
type:
|
|
28267
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28249
28268
|
correlationId: call.correlationId,
|
|
28250
28269
|
confirmed: true,
|
|
28251
28270
|
requiresUserConfirmation: false,
|
|
28252
|
-
outcome:
|
|
28271
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28253
28272
|
});
|
|
28254
28273
|
} catch (error) {
|
|
28255
28274
|
debugLogger.warn(
|
|
@@ -28318,14 +28337,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28318
28337
|
);
|
|
28319
28338
|
if (isLowErrorVerbosity) {
|
|
28320
28339
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28321
|
-
(tc) => tc.status ===
|
|
28340
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28322
28341
|
).length;
|
|
28323
28342
|
}
|
|
28324
28343
|
if (geminiTools.length === 0) {
|
|
28325
28344
|
return;
|
|
28326
28345
|
}
|
|
28327
28346
|
const stopExecutionTool = geminiTools.find(
|
|
28328
|
-
(tc) => tc.response.errorType ===
|
|
28347
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28329
28348
|
);
|
|
28330
28349
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28331
28350
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28345,9 +28364,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28345
28364
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28346
28365
|
);
|
|
28347
28366
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28348
|
-
(tc) => tc.status ===
|
|
28367
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28349
28368
|
);
|
|
28350
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28369
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28351
28370
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28352
28371
|
if (!turnCancelledRef.current) {
|
|
28353
28372
|
addItem({
|
|
@@ -28427,7 +28446,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28427
28446
|
return;
|
|
28428
28447
|
}
|
|
28429
28448
|
const restorableToolCalls = toolCalls.filter(
|
|
28430
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28449
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28431
28450
|
);
|
|
28432
28451
|
if (restorableToolCalls.length > 0) {
|
|
28433
28452
|
if (!gitService) {
|
|
@@ -28650,14 +28669,14 @@ var useAgentStream = ({
|
|
|
28650
28669
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28651
28670
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28652
28671
|
const desc = legacyState?.description ?? "";
|
|
28653
|
-
const fallbackKind =
|
|
28672
|
+
const fallbackKind = Kind.Other;
|
|
28654
28673
|
const newCall = {
|
|
28655
28674
|
callId: event.requestId,
|
|
28656
28675
|
name: displayName,
|
|
28657
28676
|
originalRequestName: event.name,
|
|
28658
28677
|
description: desc,
|
|
28659
28678
|
display: event.display,
|
|
28660
|
-
status:
|
|
28679
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28661
28680
|
isClientInitiated: false,
|
|
28662
28681
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28663
28682
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28675,10 +28694,10 @@ var useAgentStream = ({
|
|
|
28675
28694
|
const evtStatus = legacyState?.status;
|
|
28676
28695
|
let status = tc.status;
|
|
28677
28696
|
if (evtStatus === "executing")
|
|
28678
|
-
status =
|
|
28679
|
-
else if (evtStatus === "error") status =
|
|
28697
|
+
status = CoreToolCallStatus.Executing;
|
|
28698
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28680
28699
|
else if (evtStatus === "success")
|
|
28681
|
-
status =
|
|
28700
|
+
status = CoreToolCallStatus.Success;
|
|
28682
28701
|
const display = event.display?.result;
|
|
28683
28702
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28684
28703
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28711,7 +28730,7 @@ var useAgentStream = ({
|
|
|
28711
28730
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28712
28731
|
return {
|
|
28713
28732
|
...tc,
|
|
28714
|
-
status: event.isError ?
|
|
28733
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28715
28734
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28716
28735
|
resultDisplay,
|
|
28717
28736
|
outputFile
|
|
@@ -28777,7 +28796,7 @@ var useAgentStream = ({
|
|
|
28777
28796
|
if (!options?.isContinuation) {
|
|
28778
28797
|
if (typeof query === "string") {
|
|
28779
28798
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28780
|
-
void logger?.logMessage(
|
|
28799
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28781
28800
|
}
|
|
28782
28801
|
startNewPrompt();
|
|
28783
28802
|
}
|
|
@@ -30304,9 +30323,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30304
30323
|
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30305
30324
|
async (choice) => {
|
|
30306
30325
|
const trustLevelMap = {
|
|
30307
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30308
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30309
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
30326
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
30327
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
30328
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
30310
30329
|
};
|
|
30311
30330
|
const trustLevel = trustLevelMap[choice];
|
|
30312
30331
|
if (!trustLevel) return;
|
|
@@ -30325,7 +30344,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30325
30344
|
}, 100);
|
|
30326
30345
|
return;
|
|
30327
30346
|
}
|
|
30328
|
-
const currentIsTrusted = trustLevel ===
|
|
30347
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30329
30348
|
onTrustChange(currentIsTrusted);
|
|
30330
30349
|
setIsTrusted(currentIsTrusted);
|
|
30331
30350
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -31333,7 +31352,7 @@ function useMessageQueue({
|
|
|
31333
31352
|
var import_react107 = __toESM(require_react(), 1);
|
|
31334
31353
|
function useMcpStatus(config) {
|
|
31335
31354
|
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31336
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31355
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31337
31356
|
);
|
|
31338
31357
|
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31339
31358
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31346,12 +31365,12 @@ function useMcpStatus(config) {
|
|
|
31346
31365
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31347
31366
|
}
|
|
31348
31367
|
};
|
|
31349
|
-
coreEvents.on(
|
|
31368
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31350
31369
|
return () => {
|
|
31351
|
-
coreEvents.off(
|
|
31370
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31352
31371
|
};
|
|
31353
31372
|
}, [config]);
|
|
31354
|
-
const isMcpReady = discoveryState ===
|
|
31373
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31355
31374
|
return {
|
|
31356
31375
|
discoveryState,
|
|
31357
31376
|
mcpServerCount,
|
|
@@ -31378,7 +31397,7 @@ function useApprovalModeIndicator({
|
|
|
31378
31397
|
(key) => {
|
|
31379
31398
|
let nextApprovalMode;
|
|
31380
31399
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31381
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31400
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31382
31401
|
if (addItem) {
|
|
31383
31402
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31384
31403
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31396,21 +31415,21 @@ function useApprovalModeIndicator({
|
|
|
31396
31415
|
}
|
|
31397
31416
|
return;
|
|
31398
31417
|
}
|
|
31399
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31418
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31400
31419
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31401
31420
|
const currentMode = config.getApprovalMode();
|
|
31402
31421
|
switch (currentMode) {
|
|
31403
|
-
case
|
|
31404
|
-
nextApprovalMode =
|
|
31422
|
+
case ApprovalMode.DEFAULT:
|
|
31423
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31405
31424
|
break;
|
|
31406
|
-
case
|
|
31407
|
-
nextApprovalMode = allowPlanMode ?
|
|
31425
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31426
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31408
31427
|
break;
|
|
31409
|
-
case
|
|
31410
|
-
nextApprovalMode =
|
|
31428
|
+
case ApprovalMode.PLAN:
|
|
31429
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31411
31430
|
break;
|
|
31412
|
-
case
|
|
31413
|
-
nextApprovalMode =
|
|
31431
|
+
case ApprovalMode.YOLO:
|
|
31432
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31414
31433
|
break;
|
|
31415
31434
|
default:
|
|
31416
31435
|
}
|
|
@@ -31820,11 +31839,11 @@ var useHookDisplayState = () => {
|
|
|
31820
31839
|
removeHook();
|
|
31821
31840
|
}
|
|
31822
31841
|
};
|
|
31823
|
-
coreEvents.on(
|
|
31824
|
-
coreEvents.on(
|
|
31842
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
31843
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31825
31844
|
return () => {
|
|
31826
|
-
coreEvents.off(
|
|
31827
|
-
coreEvents.off(
|
|
31845
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
31846
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31828
31847
|
activeTimeouts.forEach(clearTimeout);
|
|
31829
31848
|
activeTimeouts.clear();
|
|
31830
31849
|
};
|
|
@@ -32663,7 +32682,7 @@ var AppContainer = (props) => {
|
|
|
32663
32682
|
setConfigInitialized(true);
|
|
32664
32683
|
startupProfiler.flush(config);
|
|
32665
32684
|
startAutoMemoryIfEnabled(config);
|
|
32666
|
-
const sessionStartSource = resumedSessionData ?
|
|
32685
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32667
32686
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32668
32687
|
if (result) {
|
|
32669
32688
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32690,7 +32709,7 @@ var AppContainer = (props) => {
|
|
|
32690
32709
|
);
|
|
32691
32710
|
const ideClient = await IdeClient.getInstance();
|
|
32692
32711
|
await ideClient.disconnect();
|
|
32693
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32712
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32694
32713
|
};
|
|
32695
32714
|
registerCleanup(cleanupFn);
|
|
32696
32715
|
return () => {
|
|
@@ -32715,11 +32734,11 @@ var AppContainer = (props) => {
|
|
|
32715
32734
|
resetTime: payload.resetTime
|
|
32716
32735
|
});
|
|
32717
32736
|
};
|
|
32718
|
-
coreEvents.on(
|
|
32719
|
-
coreEvents.on(
|
|
32737
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32738
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32720
32739
|
return () => {
|
|
32721
|
-
coreEvents.off(
|
|
32722
|
-
coreEvents.off(
|
|
32740
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32741
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32723
32742
|
};
|
|
32724
32743
|
}, [config]);
|
|
32725
32744
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32732,16 +32751,16 @@ var AppContainer = (props) => {
|
|
|
32732
32751
|
const handleAgentsDiscovered = (payload) => {
|
|
32733
32752
|
setNewAgents(payload.agents);
|
|
32734
32753
|
};
|
|
32735
|
-
coreEvents.on(
|
|
32736
|
-
coreEvents.on(
|
|
32737
|
-
coreEvents.on(
|
|
32754
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32755
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32756
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32738
32757
|
return () => {
|
|
32739
|
-
coreEvents.off(
|
|
32758
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32740
32759
|
coreEvents.off(
|
|
32741
|
-
|
|
32760
|
+
CoreEvent.AdminSettingsChanged,
|
|
32742
32761
|
handleAdminSettingsChanged
|
|
32743
32762
|
);
|
|
32744
|
-
coreEvents.off(
|
|
32763
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32745
32764
|
};
|
|
32746
32765
|
}, [settings]);
|
|
32747
32766
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32806,11 +32825,11 @@ var AppContainer = (props) => {
|
|
|
32806
32825
|
exitEditorDialog
|
|
32807
32826
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32808
32827
|
(0, import_react121.useEffect)(() => {
|
|
32809
|
-
coreEvents.on(
|
|
32810
|
-
coreEvents.on(
|
|
32828
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32829
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32811
32830
|
return () => {
|
|
32812
|
-
coreEvents.off(
|
|
32813
|
-
coreEvents.off(
|
|
32831
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32832
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32814
32833
|
};
|
|
32815
32834
|
}, [handleEditorClose, openEditorDialog]);
|
|
32816
32835
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32878,7 +32897,7 @@ var AppContainer = (props) => {
|
|
|
32878
32897
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
32879
32898
|
});
|
|
32880
32899
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
32881
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
32900
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
32882
32901
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
32883
32902
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
32884
32903
|
config,
|
|
@@ -32906,7 +32925,7 @@ var AppContainer = (props) => {
|
|
|
32906
32925
|
async (authType, scope) => {
|
|
32907
32926
|
if (authType) {
|
|
32908
32927
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
32909
|
-
if (authType ===
|
|
32928
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
32910
32929
|
setAuthContext({ requiresRestart: true });
|
|
32911
32930
|
} else {
|
|
32912
32931
|
setAuthContext({});
|
|
@@ -32934,7 +32953,7 @@ var AppContainer = (props) => {
|
|
|
32934
32953
|
);
|
|
32935
32954
|
return;
|
|
32936
32955
|
}
|
|
32937
|
-
if (authType ===
|
|
32956
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
32938
32957
|
writeToStdout(`
|
|
32939
32958
|
----------------------------------------------------------------
|
|
32940
32959
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -32957,7 +32976,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32957
32976
|
}
|
|
32958
32977
|
await saveApiKey(apiKey);
|
|
32959
32978
|
await reloadApiKey();
|
|
32960
|
-
await config.refreshAuth(
|
|
32979
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
32961
32980
|
setAuthState("authenticated" /* Authenticated */);
|
|
32962
32981
|
} catch (e) {
|
|
32963
32982
|
onAuthError(
|
|
@@ -32982,7 +33001,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32982
33001
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
32983
33002
|
);
|
|
32984
33003
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
32985
|
-
if (settings.merged.security.auth.selectedType ===
|
|
33004
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
32986
33005
|
return;
|
|
32987
33006
|
}
|
|
32988
33007
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -33118,9 +33137,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33118
33137
|
}
|
|
33119
33138
|
});
|
|
33120
33139
|
};
|
|
33121
|
-
coreEvents.on(
|
|
33140
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33122
33141
|
return () => {
|
|
33123
|
-
coreEvents.off(
|
|
33142
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33124
33143
|
};
|
|
33125
33144
|
}, []);
|
|
33126
33145
|
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
@@ -33778,7 +33797,7 @@ ${queuedText}` : queuedText;
|
|
|
33778
33797
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33779
33798
|
if (settings.merged.general.devtools) {
|
|
33780
33799
|
void (async () => {
|
|
33781
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33800
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-F7ASQSK7.js");
|
|
33782
33801
|
await toggleDevToolsPanel(
|
|
33783
33802
|
config,
|
|
33784
33803
|
showErrorDetails,
|
|
@@ -33996,17 +34015,17 @@ ${queuedText}` : queuedText;
|
|
|
33996
34015
|
Date.now()
|
|
33997
34016
|
);
|
|
33998
34017
|
};
|
|
33999
|
-
coreEvents.on(
|
|
34000
|
-
coreEvents.on(
|
|
34018
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34019
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34001
34020
|
coreEvents.drainBacklogs();
|
|
34002
34021
|
return () => {
|
|
34003
|
-
coreEvents.off(
|
|
34004
|
-
coreEvents.off(
|
|
34022
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
34023
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
34005
34024
|
};
|
|
34006
34025
|
}, [historyManager]);
|
|
34007
34026
|
const nightly = props.version.includes("nightly");
|
|
34008
34027
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
34009
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
34028
|
+
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;
|
|
34010
34029
|
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;
|
|
34011
34030
|
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
34012
34031
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
@@ -34106,9 +34125,9 @@ ${queuedText}` : queuedText;
|
|
|
34106
34125
|
const handleMemoryChanged = (result) => {
|
|
34107
34126
|
setGeminiMdFileCount(result.fileCount);
|
|
34108
34127
|
};
|
|
34109
|
-
coreEvents.on(
|
|
34128
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34110
34129
|
return () => {
|
|
34111
|
-
coreEvents.off(
|
|
34130
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34112
34131
|
};
|
|
34113
34132
|
}, []);
|
|
34114
34133
|
(0, import_react121.useEffect)(() => {
|