@google/gemini-cli 0.45.0 → 0.46.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/{chunk-SG46YSQ3.js → chunk-24H54ISH.js} +7 -7
- package/bundle/{chunk-YI3KORH5.js → chunk-3EC3ZLRQ.js} +2 -2
- package/bundle/{chunk-EORX7LYI.js → chunk-3WW2LTMX.js} +1 -1
- package/bundle/{chunk-2ARYG3KE.js → chunk-4B7MDBUK.js} +1 -1
- package/bundle/{chunk-EUYIPFPA.js → chunk-5CWORGE3.js} +1 -1
- package/bundle/{chunk-K6WTIGVC.js → chunk-5IBYZHR7.js} +2 -2
- package/bundle/{chunk-TWSSMLUS.js → chunk-7Y6NU65D.js} +1 -1
- package/bundle/{chunk-4KOU3QNT.js → chunk-EG7USKV5.js} +8 -5
- package/bundle/{chunk-PNU4GACG.js → chunk-EZDKSTIF.js} +2 -2
- package/bundle/{chunk-THZMPVCN.js → chunk-GRD2P7HY.js} +1 -1
- package/bundle/chunk-HQNVDCXK.js +154 -0
- package/bundle/chunk-ILHDA6XU.js +17320 -0
- package/bundle/{chunk-6T7N6JF2.js → chunk-ITC7TFJU.js} +156 -50
- package/bundle/{chunk-53SRWMUU.js → chunk-JF6RJW53.js} +1 -1
- package/bundle/chunk-JPYTHGMI.js +398 -0
- package/bundle/{chunk-XV2YFH7B.js → chunk-KOJR46UO.js} +7654 -14056
- package/bundle/{chunk-4EBMYFID.js → chunk-KQ4V7ZN4.js} +67 -54
- package/bundle/chunk-O3UKVEBS.js +81685 -0
- package/bundle/{chunk-VL3FKVC7.js → chunk-ONUDATHO.js} +3 -3
- package/bundle/{chunk-N6QPQL7E.js → chunk-QEVRJ7HY.js} +183 -50
- package/bundle/{chunk-3TWZMAJU.js → chunk-QFWAILKU.js} +3 -3
- package/bundle/{chunk-GVEZJIV3.js → chunk-QMCEWHRR.js} +1 -1
- package/bundle/{chunk-IL7J46PP.js → chunk-R4LEIQZM.js} +3 -3
- package/bundle/{chunk-JLFE3KRS.js → chunk-RXYIE5L5.js} +1 -1
- package/bundle/{chunk-Z5F25543.js → chunk-UM53YDCH.js} +1 -1
- package/bundle/{chunk-PXEK5ENZ.js → chunk-VEHSYWQT.js} +9 -8
- package/bundle/chunk-VETILJQA.js +1571 -0
- package/bundle/chunk-VOFVOS4I.js +118 -0
- package/bundle/chunk-WRWCUHAM.js +512 -0
- package/bundle/chunk-XVDCGVTF.js +394545 -0
- package/bundle/{chunk-HFVEWB6N.js → chunk-YINW7YTJ.js} +1 -1
- package/bundle/{chunk-KSNTXH4E.js → chunk-YIOYXRDP.js} +7 -7
- package/bundle/{cleanup-3SMSXJJA.js → cleanup-4ZTB4WMN.js} +2 -2
- package/bundle/{cleanup-FNQ3LEWG.js → cleanup-7LLX4OFN.js} +2 -2
- package/bundle/{cleanup-I56KHTTC.js → cleanup-GI5426XS.js} +2 -2
- package/bundle/cleanup-ZBLVGXIK.js +32 -0
- package/bundle/{core-KGXBOJTX.js → core-3UQQYNJF.js} +7 -1
- package/bundle/{devtoolsService-EW3B2Y63.js → devtoolsService-GJWWZ2KK.js} +2 -2
- package/bundle/{devtoolsService-F7PHNBEQ.js → devtoolsService-UNQILSWI.js} +4 -3
- package/bundle/devtoolsService-Z2YXVMYF.js +856 -0
- package/bundle/{devtoolsService-VFEFRDYG.js → devtoolsService-ZYGDAPOV.js} +2 -2
- package/bundle/{dist-2G5KTD32.js → dist-4NVM6I2N.js} +7 -1
- package/bundle/{core-AQUUQTX2.js → dist-LIQULVXZ.js} +7 -1
- package/bundle/dist-XPP357J7.js +2140 -0
- package/bundle/docs/changelogs/index.md +14 -0
- package/bundle/docs/changelogs/latest.md +202 -199
- package/bundle/docs/changelogs/preview.md +44 -200
- package/bundle/docs/issue-and-pr-automation.md +29 -1
- package/bundle/docs/reference/configuration.md +71 -0
- package/bundle/{gemini-ORQHD633.js → gemini-5WY2YO7R.js} +18 -15
- package/bundle/{gemini-JMMBFICD.js → gemini-7GZVH4VW.js} +216 -197
- package/bundle/{gemini-4KS2EZX6.js → gemini-QDOVPRKF.js} +18 -15
- package/bundle/gemini-RBKWBGCC.js +16409 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-XUZZOZXX.js → interactiveCli-BMKHWEH4.js} +29 -13
- package/bundle/{interactiveCli-ESB66RW7.js → interactiveCli-OEFOYFJU.js} +335 -300
- package/bundle/interactiveCli-OGE5OTZB.js +34742 -0
- package/bundle/{interactiveCli-ZJXV4DW7.js → interactiveCli-W3CMLQIM.js} +29 -13
- package/bundle/{liteRtServerManager-HELKQKOZ.js → liteRtServerManager-3QOJEGNL.js} +4 -4
- package/bundle/{liteRtServerManager-RNNHEQJI.js → liteRtServerManager-HPVNUYFX.js} +4 -4
- package/bundle/{liteRtServerManager-DORIWEMR.js → liteRtServerManager-Q6LTEYH4.js} +4 -4
- package/bundle/liteRtServerManager-YL4YRHOA.js +65 -0
- package/bundle/{oauth2-provider-2IJNOFOO.js → oauth2-provider-3WXIASQA.js} +1 -1
- package/bundle/{oauth2-provider-7N4OFPTL.js → oauth2-provider-CTPS7JLT.js} +1 -1
- package/bundle/{oauth2-provider-YYLBPESU.js → oauth2-provider-K52EY6RG.js} +38 -72
- package/bundle/oauth2-provider-PJJE326A.js +235 -0
- package/bundle/{start-IGG6LDST.js → start-25W6VZG6.js} +6 -6
- package/bundle/{start-R7DTCFCN.js → start-JBJSIKIB.js} +6 -6
- package/bundle/{start-66KF6MVV.js → start-PK22QMBT.js} +6 -6
- package/bundle/start-XAEHV6FV.js +18 -0
- package/package.json +1 -1
|
@@ -155,13 +155,13 @@ import {
|
|
|
155
155
|
widestLineFromStyledChars,
|
|
156
156
|
wordBreakStyledChars,
|
|
157
157
|
wrapStyledChars
|
|
158
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-O3UKVEBS.js";
|
|
159
159
|
import {
|
|
160
160
|
appEvents
|
|
161
161
|
} from "./chunk-5PS3AYFU.js";
|
|
162
162
|
import {
|
|
163
163
|
require_source
|
|
164
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-RXYIE5L5.js";
|
|
165
165
|
import {
|
|
166
166
|
ACTIVE_SHELL_MAX_LINES,
|
|
167
167
|
COMPACT_TOOL_SUBVIEW_MAX_LINES,
|
|
@@ -211,33 +211,37 @@ import {
|
|
|
211
211
|
stringWidth,
|
|
212
212
|
stripUnsafeCharacters,
|
|
213
213
|
toCodePoints
|
|
214
|
-
} from "./chunk-
|
|
214
|
+
} from "./chunk-5CWORGE3.js";
|
|
215
215
|
import {
|
|
216
216
|
handleAutoUpdate,
|
|
217
217
|
isDevelopment,
|
|
218
218
|
relaunchApp,
|
|
219
219
|
setUpdateHandler
|
|
220
|
-
} from "./chunk-
|
|
220
|
+
} from "./chunk-JPYTHGMI.js";
|
|
221
221
|
import {
|
|
222
222
|
isTodoList,
|
|
223
223
|
mapCoreStatusToDisplayStatus,
|
|
224
224
|
require_react
|
|
225
|
-
} from "./chunk-
|
|
225
|
+
} from "./chunk-WRWCUHAM.js";
|
|
226
226
|
import {
|
|
227
227
|
registerCleanup,
|
|
228
228
|
removeCleanup,
|
|
229
229
|
runExitCleanup,
|
|
230
230
|
setupTtyCheck
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-7Y6NU65D.js";
|
|
232
232
|
import {
|
|
233
233
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
234
234
|
AGENT_TOOL_NAME,
|
|
235
235
|
ApiKeyUpdatedEvent,
|
|
236
|
+
ApprovalMode,
|
|
236
237
|
AsyncFzf,
|
|
237
238
|
AudioRecorder,
|
|
238
239
|
AuthType,
|
|
239
240
|
ChangeAuthRequestedError,
|
|
241
|
+
CompressionStatus,
|
|
240
242
|
ConversationFinishedEvent,
|
|
243
|
+
CoreEvent,
|
|
244
|
+
CoreToolCallStatus,
|
|
241
245
|
CreditPurchaseClickEvent,
|
|
242
246
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
243
247
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
@@ -259,12 +263,19 @@ import {
|
|
|
259
263
|
GEMMA_4_31B_IT_MODEL,
|
|
260
264
|
GLOB_DISPLAY_NAME,
|
|
261
265
|
GREP_DISPLAY_NAME,
|
|
266
|
+
GeminiCliOperation,
|
|
267
|
+
GeminiEventType,
|
|
262
268
|
GitService,
|
|
263
269
|
IdeClient,
|
|
270
|
+
Kind,
|
|
264
271
|
LS_DISPLAY_NAME,
|
|
265
272
|
LegacyAgentProtocol,
|
|
266
273
|
LlmRole,
|
|
267
274
|
Logger,
|
|
275
|
+
MCPDiscoveryState,
|
|
276
|
+
MCPServerStatus,
|
|
277
|
+
MessageBusType,
|
|
278
|
+
MessageSenderType,
|
|
268
279
|
ModelNotFoundError,
|
|
269
280
|
ModelSlashCommandEvent,
|
|
270
281
|
OverageMenuShownEvent,
|
|
@@ -276,20 +287,27 @@ import {
|
|
|
276
287
|
PREVIEW_GEMINI_MODEL,
|
|
277
288
|
PolicyIntegrityManager,
|
|
278
289
|
ProjectIdRequiredError,
|
|
290
|
+
QuestionType,
|
|
279
291
|
READ_FILE_DISPLAY_NAME,
|
|
280
292
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
281
293
|
RELEASE_CHANNEL_STABILITY,
|
|
282
294
|
ROOT_SCHEDULER_ID,
|
|
283
295
|
SHELL_TOOL_NAME,
|
|
284
296
|
Scheduler,
|
|
297
|
+
SessionEndReason,
|
|
298
|
+
SessionStartSource,
|
|
285
299
|
ShellExecutionService,
|
|
286
300
|
SlashCommandStatus,
|
|
287
301
|
Storage,
|
|
302
|
+
SubagentState,
|
|
288
303
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
289
304
|
TOPIC_PARAM_SUMMARY,
|
|
290
305
|
TOPIC_PARAM_TITLE,
|
|
291
306
|
TerminalQuotaError,
|
|
307
|
+
ToolConfirmationOutcome,
|
|
308
|
+
ToolErrorType,
|
|
292
309
|
TranscriptionFactory,
|
|
310
|
+
TrustLevel,
|
|
293
311
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
294
312
|
UPDATE_TOPIC_TOOL_NAME,
|
|
295
313
|
UnauthorizedError,
|
|
@@ -301,6 +319,7 @@ import {
|
|
|
301
319
|
WEB_FETCH_DISPLAY_NAME,
|
|
302
320
|
WEB_SEARCH_DISPLAY_NAME,
|
|
303
321
|
WRITE_FILE_DISPLAY_NAME,
|
|
322
|
+
WarningPriority,
|
|
304
323
|
WhisperModelManager,
|
|
305
324
|
addMCPStatusChangeListener,
|
|
306
325
|
allowEditorTypeInSandbox,
|
|
@@ -410,7 +429,7 @@ import {
|
|
|
410
429
|
validatePlanContent,
|
|
411
430
|
validatePlanPath,
|
|
412
431
|
writeToStdout
|
|
413
|
-
} from "./chunk-
|
|
432
|
+
} from "./chunk-ITC7TFJU.js";
|
|
414
433
|
import "./chunk-6HI7VNOG.js";
|
|
415
434
|
import "./chunk-TUDYL3X4.js";
|
|
416
435
|
import "./chunk-IUUIT4SU.js";
|
|
@@ -5036,7 +5055,7 @@ function calculateShellMaxLines(options) {
|
|
|
5036
5055
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
5037
5056
|
return maxLinesBasedOnHeight;
|
|
5038
5057
|
}
|
|
5039
|
-
const isExecuting = status ===
|
|
5058
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
5040
5059
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
5041
5060
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
5042
5061
|
}
|
|
@@ -5070,10 +5089,10 @@ function isShellTool(name) {
|
|
|
5070
5089
|
return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
|
|
5071
5090
|
}
|
|
5072
5091
|
function isThisShellFocusable(name, status, config) {
|
|
5073
|
-
return !!(isShellTool(name) && status ===
|
|
5092
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
|
|
5074
5093
|
}
|
|
5075
5094
|
function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
|
|
5076
|
-
return !!(isShellTool(name) && status ===
|
|
5095
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
|
|
5077
5096
|
}
|
|
5078
5097
|
function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
|
|
5079
5098
|
const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
|
|
@@ -5233,13 +5252,13 @@ var formatToolArgs = (args) => {
|
|
|
5233
5252
|
var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
|
|
5234
5253
|
let headerText;
|
|
5235
5254
|
let headerColor = theme.text.secondary;
|
|
5236
|
-
if (progress.state ===
|
|
5255
|
+
if (progress.state === SubagentState.CANCELLED) {
|
|
5237
5256
|
headerText = `Subagent ${progress.agentName} was cancelled.`;
|
|
5238
5257
|
headerColor = theme.status.warning;
|
|
5239
|
-
} else if (progress.state ===
|
|
5258
|
+
} else if (progress.state === SubagentState.ERROR) {
|
|
5240
5259
|
headerText = `Subagent ${progress.agentName} failed.`;
|
|
5241
5260
|
headerColor = theme.status.error;
|
|
5242
|
-
} else if (progress.state ===
|
|
5261
|
+
} else if (progress.state === SubagentState.COMPLETED) {
|
|
5243
5262
|
headerText = `Subagent ${progress.agentName} completed.`;
|
|
5244
5263
|
headerColor = theme.status.success;
|
|
5245
5264
|
} else {
|
|
@@ -5259,7 +5278,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5259
5278
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
|
|
5260
5279
|
] }, item.id);
|
|
5261
5280
|
} else if (item.type === "tool_call") {
|
|
5262
|
-
const statusSymbol = item.status ===
|
|
5281
|
+
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 });
|
|
5263
5282
|
const formattedArgs = item.description || formatToolArgs(item.args);
|
|
5264
5283
|
const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
|
|
5265
5284
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
@@ -5270,7 +5289,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5270
5289
|
{
|
|
5271
5290
|
bold: true,
|
|
5272
5291
|
color: theme.text.primary,
|
|
5273
|
-
strikethrough: item.status ===
|
|
5292
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5274
5293
|
children: item.displayName || item.content
|
|
5275
5294
|
}
|
|
5276
5295
|
),
|
|
@@ -5279,7 +5298,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5279
5298
|
{
|
|
5280
5299
|
color: theme.text.secondary,
|
|
5281
5300
|
wrap: "truncate",
|
|
5282
|
-
strikethrough: item.status ===
|
|
5301
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5283
5302
|
children: displayArgs
|
|
5284
5303
|
}
|
|
5285
5304
|
) })
|
|
@@ -5299,7 +5318,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5299
5318
|
MarkdownDisplay,
|
|
5300
5319
|
{
|
|
5301
5320
|
text: safeJsonToMarkdown(progress.result),
|
|
5302
|
-
isPending: progress.state !==
|
|
5321
|
+
isPending: progress.state !== SubagentState.COMPLETED,
|
|
5303
5322
|
terminalWidth
|
|
5304
5323
|
}
|
|
5305
5324
|
)
|
|
@@ -5653,14 +5672,14 @@ var ToolActionsProvider = (props) => {
|
|
|
5653
5672
|
}
|
|
5654
5673
|
const details = tool.confirmationDetails;
|
|
5655
5674
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
5656
|
-
const cliOutcome = outcome ===
|
|
5675
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
5657
5676
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
5658
5677
|
}
|
|
5659
5678
|
if (tool.correlationId) {
|
|
5660
5679
|
await config.getMessageBus().publish({
|
|
5661
|
-
type:
|
|
5680
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
5662
5681
|
correlationId: tool.correlationId,
|
|
5663
|
-
confirmed: outcome !==
|
|
5682
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
5664
5683
|
requiresUserConfirmation: false,
|
|
5665
5684
|
outcome,
|
|
5666
5685
|
payload
|
|
@@ -5679,7 +5698,7 @@ var ToolActionsProvider = (props) => {
|
|
|
5679
5698
|
);
|
|
5680
5699
|
const cancel = (0, import_react12.useCallback)(
|
|
5681
5700
|
async (callId) => {
|
|
5682
|
-
await confirm(callId,
|
|
5701
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
5683
5702
|
},
|
|
5684
5703
|
[confirm]
|
|
5685
5704
|
);
|
|
@@ -5798,7 +5817,7 @@ var ToolMessage = ({
|
|
|
5798
5817
|
paddingX: 1,
|
|
5799
5818
|
flexDirection: "column",
|
|
5800
5819
|
children: [
|
|
5801
|
-
status ===
|
|
5820
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5802
5821
|
McpProgressIndicator,
|
|
5803
5822
|
{
|
|
5804
5823
|
progress,
|
|
@@ -5815,8 +5834,8 @@ var ToolMessage = ({
|
|
|
5815
5834
|
terminalWidth,
|
|
5816
5835
|
renderOutputAsMarkdown,
|
|
5817
5836
|
hasFocus: isThisShellFocused2,
|
|
5818
|
-
maxLines: kind ===
|
|
5819
|
-
overflowDirection: kind ===
|
|
5837
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
5838
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
5820
5839
|
}
|
|
5821
5840
|
),
|
|
5822
5841
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -6132,7 +6151,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
|
|
|
6132
6151
|
settings.merged,
|
|
6133
6152
|
process3.cwd()
|
|
6134
6153
|
);
|
|
6135
|
-
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel ===
|
|
6154
|
+
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
|
|
6136
6155
|
return {
|
|
6137
6156
|
currentTrustLevel: explicitTrustLevel,
|
|
6138
6157
|
isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
|
|
@@ -6177,7 +6196,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
|
|
|
6177
6196
|
process3.cwd(),
|
|
6178
6197
|
newConfig
|
|
6179
6198
|
);
|
|
6180
|
-
if (trustLevel ===
|
|
6199
|
+
if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
|
|
6181
6200
|
let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
|
|
6182
6201
|
if (source === "file") {
|
|
6183
6202
|
message = "Note: This folder is still trusted because a parent folder is trusted.";
|
|
@@ -6251,18 +6270,18 @@ function PermissionsModifyTrustDialog({
|
|
|
6251
6270
|
const TRUST_LEVEL_ITEMS = [
|
|
6252
6271
|
{
|
|
6253
6272
|
label: `Trust this folder (${dirName})`,
|
|
6254
|
-
value:
|
|
6255
|
-
key:
|
|
6273
|
+
value: TrustLevel.TRUST_FOLDER,
|
|
6274
|
+
key: TrustLevel.TRUST_FOLDER
|
|
6256
6275
|
},
|
|
6257
6276
|
{
|
|
6258
6277
|
label: `Trust parent folder (${parentFolder})`,
|
|
6259
|
-
value:
|
|
6260
|
-
key:
|
|
6278
|
+
value: TrustLevel.TRUST_PARENT,
|
|
6279
|
+
key: TrustLevel.TRUST_PARENT
|
|
6261
6280
|
},
|
|
6262
6281
|
{
|
|
6263
6282
|
label: "Don't trust",
|
|
6264
|
-
value:
|
|
6265
|
-
key:
|
|
6283
|
+
value: TrustLevel.DO_NOT_TRUST,
|
|
6284
|
+
key: TrustLevel.DO_NOT_TRUST
|
|
6266
6285
|
}
|
|
6267
6286
|
];
|
|
6268
6287
|
const {
|
|
@@ -6502,7 +6521,7 @@ var ShellToolMessage = ({
|
|
|
6502
6521
|
maxLinesLimit: maxLines
|
|
6503
6522
|
});
|
|
6504
6523
|
import_react17.default.useEffect(() => {
|
|
6505
|
-
const isExecuting = status ===
|
|
6524
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
6506
6525
|
if (isExecuting && ptyId) {
|
|
6507
6526
|
try {
|
|
6508
6527
|
const childWidth = terminalWidth - 4;
|
|
@@ -6715,13 +6734,13 @@ var SubagentGroupDisplay = ({
|
|
|
6715
6734
|
const singleAgent = toolCalls[0].resultDisplay;
|
|
6716
6735
|
if (isSubagentProgress(singleAgent)) {
|
|
6717
6736
|
switch (singleAgent.state) {
|
|
6718
|
-
case
|
|
6737
|
+
case SubagentState.COMPLETED:
|
|
6719
6738
|
headerText = "Agent Completed";
|
|
6720
6739
|
break;
|
|
6721
|
-
case
|
|
6740
|
+
case SubagentState.CANCELLED:
|
|
6722
6741
|
headerText = "Agent Cancelled";
|
|
6723
6742
|
break;
|
|
6724
|
-
case
|
|
6743
|
+
case SubagentState.ERROR:
|
|
6725
6744
|
headerText = "Agent Error";
|
|
6726
6745
|
break;
|
|
6727
6746
|
default:
|
|
@@ -6737,8 +6756,8 @@ var SubagentGroupDisplay = ({
|
|
|
6737
6756
|
for (const tc of toolCalls) {
|
|
6738
6757
|
const progress = tc.resultDisplay;
|
|
6739
6758
|
if (isSubagentProgress(progress)) {
|
|
6740
|
-
if (progress.state ===
|
|
6741
|
-
else if (progress.state ===
|
|
6759
|
+
if (progress.state === SubagentState.COMPLETED) completedCount++;
|
|
6760
|
+
else if (progress.state === SubagentState.RUNNING) runningCount++;
|
|
6742
6761
|
} else {
|
|
6743
6762
|
runningCount++;
|
|
6744
6763
|
}
|
|
@@ -6817,7 +6836,7 @@ var SubagentGroupDisplay = ({
|
|
|
6817
6836
|
if (!isExpanded) {
|
|
6818
6837
|
let content = "Starting...";
|
|
6819
6838
|
let formattedArgs;
|
|
6820
|
-
if (progress.state ===
|
|
6839
|
+
if (progress.state === SubagentState.COMPLETED) {
|
|
6821
6840
|
if (progress.terminateReason && progress.terminateReason !== "GOAL") {
|
|
6822
6841
|
content = `Finished Early (${progress.terminateReason})`;
|
|
6823
6842
|
} else {
|
|
@@ -6831,17 +6850,17 @@ var SubagentGroupDisplay = ({
|
|
|
6831
6850
|
formattedArgs = formatToolArgs(lastActivity.args);
|
|
6832
6851
|
}
|
|
6833
6852
|
}
|
|
6834
|
-
const displayArgs = progress.state ===
|
|
6853
|
+
const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
|
|
6835
6854
|
const renderStatusIcon = () => {
|
|
6836
|
-
const state = progress.state ??
|
|
6855
|
+
const state = progress.state ?? SubagentState.RUNNING;
|
|
6837
6856
|
switch (state) {
|
|
6838
|
-
case
|
|
6857
|
+
case SubagentState.RUNNING:
|
|
6839
6858
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
|
|
6840
|
-
case
|
|
6859
|
+
case SubagentState.COMPLETED:
|
|
6841
6860
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
|
|
6842
|
-
case
|
|
6861
|
+
case SubagentState.CANCELLED:
|
|
6843
6862
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
|
|
6844
|
-
case
|
|
6863
|
+
case SubagentState.ERROR:
|
|
6845
6864
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
|
|
6846
6865
|
default:
|
|
6847
6866
|
return checkExhaustive(state);
|
|
@@ -6894,22 +6913,22 @@ var hasPayload = (res) => {
|
|
|
6894
6913
|
function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
6895
6914
|
const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
|
|
6896
6915
|
const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
|
|
6897
|
-
const isAcceptedOrConfirming = status ===
|
|
6916
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
6898
6917
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
6899
6918
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
6900
6919
|
const showDiffStat = !!diff.diffStat;
|
|
6901
6920
|
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 }) });
|
|
6902
6921
|
let resultSummary = "";
|
|
6903
6922
|
let resultColor = theme.text.secondary;
|
|
6904
|
-
if (status ===
|
|
6923
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
6905
6924
|
resultSummary = "Confirming";
|
|
6906
|
-
} else if (status ===
|
|
6925
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
6907
6926
|
resultSummary = "Accepted";
|
|
6908
6927
|
resultColor = theme.text.accent;
|
|
6909
|
-
} else if (status ===
|
|
6928
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
6910
6929
|
resultSummary = "Rejected";
|
|
6911
6930
|
resultColor = theme.status.error;
|
|
6912
|
-
} else if (status ===
|
|
6931
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
6913
6932
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
6914
6933
|
resultColor = theme.status.error;
|
|
6915
6934
|
}
|
|
@@ -6940,7 +6959,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
|
|
|
6940
6959
|
filename: diff.fileName,
|
|
6941
6960
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
6942
6961
|
availableTerminalHeight,
|
|
6943
|
-
disableColor: status ===
|
|
6962
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6944
6963
|
}
|
|
6945
6964
|
);
|
|
6946
6965
|
return { description, summary, payload };
|
|
@@ -7068,10 +7087,10 @@ var DenseToolMessage = (props) => {
|
|
|
7068
7087
|
if (isGrepResult(resultDisplay)) {
|
|
7069
7088
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7070
7089
|
}
|
|
7071
|
-
if (status ===
|
|
7090
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
7072
7091
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7073
7092
|
}
|
|
7074
|
-
if (status ===
|
|
7093
|
+
if (status === CoreToolCallStatus.Error) {
|
|
7075
7094
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
7076
7095
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
7077
7096
|
"\u2192 ",
|
|
@@ -7112,7 +7131,7 @@ var DenseToolMessage = (props) => {
|
|
|
7112
7131
|
language: fileExtension,
|
|
7113
7132
|
maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7114
7133
|
settings,
|
|
7115
|
-
disableColor: status ===
|
|
7134
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
7116
7135
|
returnLines: true
|
|
7117
7136
|
});
|
|
7118
7137
|
} else {
|
|
@@ -7120,7 +7139,7 @@ var DenseToolMessage = (props) => {
|
|
|
7120
7139
|
parsedLines,
|
|
7121
7140
|
filename: diff.fileName,
|
|
7122
7141
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7123
|
-
disableColor: status ===
|
|
7142
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
7124
7143
|
});
|
|
7125
7144
|
}
|
|
7126
7145
|
}, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
|
|
@@ -7250,7 +7269,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7250
7269
|
return pendingHistoryItems.some((item) => {
|
|
7251
7270
|
if (item && item.type === "tool_group") {
|
|
7252
7271
|
return item.tools.some(
|
|
7253
|
-
(tool) =>
|
|
7272
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
7254
7273
|
);
|
|
7255
7274
|
}
|
|
7256
7275
|
return false;
|
|
@@ -7259,7 +7278,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7259
7278
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
7260
7279
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
7261
7280
|
(item) => item.tools.some(
|
|
7262
|
-
(tool) =>
|
|
7281
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
7263
7282
|
)
|
|
7264
7283
|
);
|
|
7265
7284
|
}
|
|
@@ -7282,14 +7301,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
|
|
|
7282
7301
|
if (isTrackedToolCall(t)) {
|
|
7283
7302
|
return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
|
|
7284
7303
|
} else {
|
|
7285
|
-
return t.status !==
|
|
7304
|
+
return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
|
|
7286
7305
|
}
|
|
7287
7306
|
});
|
|
7288
7307
|
const isEmbeddedShellFocused = toolsToInspect.some((t) => {
|
|
7289
7308
|
if (isTrackedToolCall(t)) {
|
|
7290
7309
|
return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
|
|
7291
7310
|
} else {
|
|
7292
|
-
return isShellTool(t.name) && t.status ===
|
|
7311
|
+
return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
|
|
7293
7312
|
}
|
|
7294
7313
|
});
|
|
7295
7314
|
const isShellCommand = toolsToInspect.some((t) => {
|
|
@@ -7388,7 +7407,7 @@ var ToolGroupMessage = ({
|
|
|
7388
7407
|
const groupedTools = (0, import_react21.useMemo)(() => {
|
|
7389
7408
|
const groups = [];
|
|
7390
7409
|
for (const tool of visibleToolCalls) {
|
|
7391
|
-
if (tool.kind ===
|
|
7410
|
+
if (tool.kind === Kind.Agent) {
|
|
7392
7411
|
const lastGroup = groups[groups.length - 1];
|
|
7393
7412
|
if (Array.isArray(lastGroup)) {
|
|
7394
7413
|
lastGroup.push(tool);
|
|
@@ -7443,7 +7462,7 @@ var ToolGroupMessage = ({
|
|
|
7443
7462
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
7444
7463
|
let countToolCallsWithResults = 0;
|
|
7445
7464
|
for (const tool of visibleToolCalls) {
|
|
7446
|
-
if (tool.kind !==
|
|
7465
|
+
if (tool.kind !== Kind.Agent) {
|
|
7447
7466
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
7448
7467
|
if (hasDensePayload(tool)) {
|
|
7449
7468
|
countToolCallsWithResults++;
|
|
@@ -7617,7 +7636,7 @@ var ToolGroupDisplay = ({
|
|
|
7617
7636
|
}
|
|
7618
7637
|
const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
|
|
7619
7638
|
const visibleTools = tools.filter(
|
|
7620
|
-
(t) => t.status !==
|
|
7639
|
+
(t) => t.status !== CoreToolCallStatus.AwaitingApproval
|
|
7621
7640
|
);
|
|
7622
7641
|
const noticeTools = visibleTools.filter((t) => t.format === "notice");
|
|
7623
7642
|
const otherTools = visibleTools.filter(
|
|
@@ -7819,18 +7838,18 @@ function CompressionMessage({
|
|
|
7819
7838
|
return "Compressing chat history";
|
|
7820
7839
|
}
|
|
7821
7840
|
switch (compressionStatus) {
|
|
7822
|
-
case
|
|
7841
|
+
case CompressionStatus.COMPRESSED:
|
|
7823
7842
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
7824
|
-
case
|
|
7843
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
7825
7844
|
if (originalTokens < 5e4) {
|
|
7826
7845
|
return "Compression was not beneficial for this history size.";
|
|
7827
7846
|
}
|
|
7828
7847
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
7829
|
-
case
|
|
7848
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
7830
7849
|
return "Could not compress chat history due to a token counting error.";
|
|
7831
|
-
case
|
|
7850
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
7832
7851
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
7833
|
-
case
|
|
7852
|
+
case CompressionStatus.NOOP:
|
|
7834
7853
|
return "Nothing to compress.";
|
|
7835
7854
|
default:
|
|
7836
7855
|
return "";
|
|
@@ -8243,7 +8262,7 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8243
8262
|
Object.entries(models).forEach(([name, metrics]) => {
|
|
8244
8263
|
rows.push({
|
|
8245
8264
|
name,
|
|
8246
|
-
displayName: name,
|
|
8265
|
+
displayName: getDisplayString(name),
|
|
8247
8266
|
requests: metrics.api.totalRequests,
|
|
8248
8267
|
cachedTokens: metrics.tokens.cached.toLocaleString(),
|
|
8249
8268
|
inputTokens: metrics.tokens.prompt.toLocaleString(),
|
|
@@ -8256,8 +8275,8 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8256
8275
|
);
|
|
8257
8276
|
roleEntries.sort(([a], [b]) => {
|
|
8258
8277
|
if (a === b) return 0;
|
|
8259
|
-
if (a ===
|
|
8260
|
-
if (b ===
|
|
8278
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8279
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8261
8280
|
return a.localeCompare(b);
|
|
8262
8281
|
});
|
|
8263
8282
|
roleEntries.forEach(([role, roleMetrics]) => {
|
|
@@ -8588,8 +8607,8 @@ var ModelStatsDisplay = ({
|
|
|
8588
8607
|
return validRoles.includes(role);
|
|
8589
8608
|
}).sort((a, b) => {
|
|
8590
8609
|
if (a === b) return 0;
|
|
8591
|
-
if (a ===
|
|
8592
|
-
if (b ===
|
|
8610
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8611
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8593
8612
|
return a.localeCompare(b);
|
|
8594
8613
|
});
|
|
8595
8614
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -8727,7 +8746,7 @@ var ModelStatsDisplay = ({
|
|
|
8727
8746
|
},
|
|
8728
8747
|
...modelNames.map((name) => ({
|
|
8729
8748
|
key: name,
|
|
8730
|
-
header: name,
|
|
8749
|
+
header: getDisplayString(name),
|
|
8731
8750
|
flexGrow: 1,
|
|
8732
8751
|
renderCell: (row) => {
|
|
8733
8752
|
if (row.isSection) return null;
|
|
@@ -9380,7 +9399,7 @@ var McpStatus = ({
|
|
|
9380
9399
|
);
|
|
9381
9400
|
const originalStatus = serverStatus(serverName);
|
|
9382
9401
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
9383
|
-
const status = originalStatus ===
|
|
9402
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
9384
9403
|
let statusIndicator = "";
|
|
9385
9404
|
let statusText = "";
|
|
9386
9405
|
let statusColor = theme.text.primary;
|
|
@@ -9392,17 +9411,17 @@ var McpStatus = ({
|
|
|
9392
9411
|
statusColor = theme.text.secondary;
|
|
9393
9412
|
} else {
|
|
9394
9413
|
switch (status) {
|
|
9395
|
-
case
|
|
9414
|
+
case MCPServerStatus.CONNECTED:
|
|
9396
9415
|
statusIndicator = "\u{1F7E2}";
|
|
9397
9416
|
statusText = "Ready";
|
|
9398
9417
|
statusColor = theme.status.success;
|
|
9399
9418
|
break;
|
|
9400
|
-
case
|
|
9419
|
+
case MCPServerStatus.CONNECTING:
|
|
9401
9420
|
statusIndicator = "\u{1F504}";
|
|
9402
9421
|
statusText = "Starting... (first startup may take longer)";
|
|
9403
9422
|
statusColor = theme.status.warning;
|
|
9404
9423
|
break;
|
|
9405
|
-
case
|
|
9424
|
+
case MCPServerStatus.DISCONNECTED:
|
|
9406
9425
|
default:
|
|
9407
9426
|
statusIndicator = "\u{1F534}";
|
|
9408
9427
|
statusText = "Disconnected";
|
|
@@ -9450,12 +9469,12 @@ var McpStatus = ({
|
|
|
9450
9469
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9451
9470
|
" - ",
|
|
9452
9471
|
statusText,
|
|
9453
|
-
status ===
|
|
9472
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
9454
9473
|
] }),
|
|
9455
9474
|
authStatusNode
|
|
9456
9475
|
] }),
|
|
9457
|
-
status ===
|
|
9458
|
-
status ===
|
|
9476
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
9477
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9459
9478
|
" (",
|
|
9460
9479
|
toolCount,
|
|
9461
9480
|
" tools cached)"
|
|
@@ -10016,7 +10035,7 @@ var Notifications = () => {
|
|
|
10016
10035
|
if (dismissed) return [];
|
|
10017
10036
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
10018
10037
|
return startupWarnings.filter((w) => {
|
|
10019
|
-
if (w.priority ===
|
|
10038
|
+
if (w.priority === WarningPriority.Low) {
|
|
10020
10039
|
const count = counts[w.id] || 0;
|
|
10021
10040
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
10022
10041
|
}
|
|
@@ -10029,7 +10048,7 @@ var Notifications = () => {
|
|
|
10029
10048
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
10030
10049
|
let changed = false;
|
|
10031
10050
|
visibleWarnings.forEach((w) => {
|
|
10032
|
-
if (w.priority ===
|
|
10051
|
+
if (w.priority === WarningPriority.Low) {
|
|
10033
10052
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
10034
10053
|
changed = true;
|
|
10035
10054
|
}
|
|
@@ -10136,7 +10155,7 @@ var UserIdentity = ({ config }) => {
|
|
|
10136
10155
|
}
|
|
10137
10156
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
10138
10157
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
|
|
10139
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
10158
|
+
/* @__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: [
|
|
10140
10159
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
|
|
10141
10160
|
"Signed in with Google",
|
|
10142
10161
|
email ? ":" : ""
|
|
@@ -10370,7 +10389,7 @@ var import_react32 = __toESM(require_react(), 1);
|
|
|
10370
10389
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
10371
10390
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
10372
10391
|
const confirmingTools = allPendingTools.filter(
|
|
10373
|
-
(tool) => tool.status ===
|
|
10392
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
10374
10393
|
);
|
|
10375
10394
|
if (confirmingTools.length === 0) {
|
|
10376
10395
|
return null;
|
|
@@ -11678,7 +11697,7 @@ var ExitPlanModeDialog = ({
|
|
|
11678
11697
|
{
|
|
11679
11698
|
questions: [
|
|
11680
11699
|
{
|
|
11681
|
-
type:
|
|
11700
|
+
type: QuestionType.CHOICE,
|
|
11682
11701
|
header: "Approval",
|
|
11683
11702
|
question: planContent,
|
|
11684
11703
|
options: [
|
|
@@ -11699,9 +11718,9 @@ var ExitPlanModeDialog = ({
|
|
|
11699
11718
|
onSubmit: (answers) => {
|
|
11700
11719
|
const answer = answers["0"];
|
|
11701
11720
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
11702
|
-
onApprove(
|
|
11721
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
11703
11722
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
11704
|
-
onApprove(
|
|
11723
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
11705
11724
|
} else if (answer) {
|
|
11706
11725
|
onFeedback(answer);
|
|
11707
11726
|
}
|
|
@@ -11912,7 +11931,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11912
11931
|
);
|
|
11913
11932
|
(0, import_react37.useEffect)(() => {
|
|
11914
11933
|
if (isCancelling) {
|
|
11915
|
-
handleConfirm(
|
|
11934
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
11916
11935
|
}
|
|
11917
11936
|
}, [isCancelling, handleConfirm]);
|
|
11918
11937
|
const handleSelect = (0, import_react37.useCallback)(
|
|
@@ -11925,19 +11944,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
11925
11944
|
if (!confirmationDetails.isModifying) {
|
|
11926
11945
|
options2.push({
|
|
11927
11946
|
label: "Allow once",
|
|
11928
|
-
value:
|
|
11947
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11929
11948
|
key: "Allow once"
|
|
11930
11949
|
});
|
|
11931
11950
|
if (isTrustedFolder) {
|
|
11932
11951
|
options2.push({
|
|
11933
11952
|
label: "Allow for this session",
|
|
11934
|
-
value:
|
|
11953
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11935
11954
|
key: "Allow for this session"
|
|
11936
11955
|
});
|
|
11937
11956
|
if (allowPermanentApproval) {
|
|
11938
11957
|
options2.push({
|
|
11939
11958
|
label: "Allow for this file in all future sessions",
|
|
11940
|
-
value:
|
|
11959
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11941
11960
|
key: "Allow for this file in all future sessions"
|
|
11942
11961
|
});
|
|
11943
11962
|
}
|
|
@@ -11945,119 +11964,119 @@ ${deceptiveUrlWarnings.map(
|
|
|
11945
11964
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
11946
11965
|
options2.push({
|
|
11947
11966
|
label: "Modify with external editor",
|
|
11948
|
-
value:
|
|
11967
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
11949
11968
|
key: "Modify with external editor"
|
|
11950
11969
|
});
|
|
11951
11970
|
}
|
|
11952
11971
|
options2.push({
|
|
11953
11972
|
label: "No, suggest changes (esc)",
|
|
11954
|
-
value:
|
|
11973
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11955
11974
|
key: "No, suggest changes (esc)"
|
|
11956
11975
|
});
|
|
11957
11976
|
}
|
|
11958
11977
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
11959
11978
|
options2.push({
|
|
11960
11979
|
label: "Allow once",
|
|
11961
|
-
value:
|
|
11980
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11962
11981
|
key: "Allow once"
|
|
11963
11982
|
});
|
|
11964
11983
|
if (isTrustedFolder) {
|
|
11965
11984
|
options2.push({
|
|
11966
11985
|
label: "Allow for this session",
|
|
11967
|
-
value:
|
|
11986
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11968
11987
|
key: "Allow for this session"
|
|
11969
11988
|
});
|
|
11970
11989
|
if (allowPermanentApproval) {
|
|
11971
11990
|
options2.push({
|
|
11972
11991
|
label: "Allow for all future sessions",
|
|
11973
|
-
value:
|
|
11992
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11974
11993
|
key: "Allow for all future sessions"
|
|
11975
11994
|
});
|
|
11976
11995
|
}
|
|
11977
11996
|
}
|
|
11978
11997
|
options2.push({
|
|
11979
11998
|
label: "No, suggest changes (esc)",
|
|
11980
|
-
value:
|
|
11999
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11981
12000
|
key: "No, suggest changes (esc)"
|
|
11982
12001
|
});
|
|
11983
12002
|
} else if (confirmationDetails.type === "exec") {
|
|
11984
12003
|
options2.push({
|
|
11985
12004
|
label: "Allow once",
|
|
11986
|
-
value:
|
|
12005
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11987
12006
|
key: "Allow once"
|
|
11988
12007
|
});
|
|
11989
12008
|
if (isTrustedFolder) {
|
|
11990
12009
|
options2.push({
|
|
11991
12010
|
label: `Allow for this session`,
|
|
11992
|
-
value:
|
|
12011
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11993
12012
|
key: `Allow for this session`
|
|
11994
12013
|
});
|
|
11995
12014
|
if (allowPermanentApproval) {
|
|
11996
12015
|
options2.push({
|
|
11997
12016
|
label: `Allow this command for all future sessions`,
|
|
11998
|
-
value:
|
|
12017
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11999
12018
|
key: `Allow for all future sessions`
|
|
12000
12019
|
});
|
|
12001
12020
|
}
|
|
12002
12021
|
}
|
|
12003
12022
|
options2.push({
|
|
12004
12023
|
label: "No, suggest changes (esc)",
|
|
12005
|
-
value:
|
|
12024
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12006
12025
|
key: "No, suggest changes (esc)"
|
|
12007
12026
|
});
|
|
12008
12027
|
} else if (confirmationDetails.type === "info") {
|
|
12009
12028
|
options2.push({
|
|
12010
12029
|
label: "Allow once",
|
|
12011
|
-
value:
|
|
12030
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12012
12031
|
key: "Allow once"
|
|
12013
12032
|
});
|
|
12014
12033
|
if (isTrustedFolder) {
|
|
12015
12034
|
options2.push({
|
|
12016
12035
|
label: "Allow for this session",
|
|
12017
|
-
value:
|
|
12036
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12018
12037
|
key: "Allow for this session"
|
|
12019
12038
|
});
|
|
12020
12039
|
if (allowPermanentApproval) {
|
|
12021
12040
|
options2.push({
|
|
12022
12041
|
label: "Allow for all future sessions",
|
|
12023
|
-
value:
|
|
12042
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12024
12043
|
key: "Allow for all future sessions"
|
|
12025
12044
|
});
|
|
12026
12045
|
}
|
|
12027
12046
|
}
|
|
12028
12047
|
options2.push({
|
|
12029
12048
|
label: "No, suggest changes (esc)",
|
|
12030
|
-
value:
|
|
12049
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12031
12050
|
key: "No, suggest changes (esc)"
|
|
12032
12051
|
});
|
|
12033
12052
|
} else if (confirmationDetails.type === "mcp") {
|
|
12034
12053
|
options2.push({
|
|
12035
12054
|
label: "Allow once",
|
|
12036
|
-
value:
|
|
12055
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12037
12056
|
key: "Allow once"
|
|
12038
12057
|
});
|
|
12039
12058
|
if (isTrustedFolder) {
|
|
12040
12059
|
options2.push({
|
|
12041
12060
|
label: "Allow tool for this session",
|
|
12042
|
-
value:
|
|
12061
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
12043
12062
|
key: "Allow tool for this session"
|
|
12044
12063
|
});
|
|
12045
12064
|
options2.push({
|
|
12046
12065
|
label: "Allow all server tools for this session",
|
|
12047
|
-
value:
|
|
12066
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
12048
12067
|
key: "Allow all server tools for this session"
|
|
12049
12068
|
});
|
|
12050
12069
|
if (allowPermanentApproval) {
|
|
12051
12070
|
options2.push({
|
|
12052
12071
|
label: "Allow tool for all future sessions",
|
|
12053
|
-
value:
|
|
12072
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12054
12073
|
key: "Allow tool for all future sessions"
|
|
12055
12074
|
});
|
|
12056
12075
|
}
|
|
12057
12076
|
}
|
|
12058
12077
|
options2.push({
|
|
12059
12078
|
label: "No, suggest changes (esc)",
|
|
12060
|
-
value:
|
|
12079
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12061
12080
|
key: "No, suggest changes (esc)"
|
|
12062
12081
|
});
|
|
12063
12082
|
}
|
|
@@ -12096,7 +12115,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12096
12115
|
const containsRedirection = commandsToDisplay.some(
|
|
12097
12116
|
(cmd) => hasRedirection(cmd)
|
|
12098
12117
|
);
|
|
12099
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12118
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12100
12119
|
if (containsRedirection && !isAutoEdit) {
|
|
12101
12120
|
extraInfoLines = 1;
|
|
12102
12121
|
}
|
|
@@ -12122,7 +12141,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12122
12141
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
12123
12142
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
12124
12143
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
12125
|
-
(o) => o.value ===
|
|
12144
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
12126
12145
|
);
|
|
12127
12146
|
if (alwaysAndSaveIndex !== -1) {
|
|
12128
12147
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -12139,10 +12158,10 @@ ${deceptiveUrlWarnings.map(
|
|
|
12139
12158
|
{
|
|
12140
12159
|
questions: confirmationDetails.questions,
|
|
12141
12160
|
onSubmit: (answers) => {
|
|
12142
|
-
handleConfirm(
|
|
12161
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
12143
12162
|
},
|
|
12144
12163
|
onCancel: () => {
|
|
12145
|
-
handleConfirm(
|
|
12164
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12146
12165
|
},
|
|
12147
12166
|
width: terminalWidth,
|
|
12148
12167
|
availableHeight: bodyHeight
|
|
@@ -12163,19 +12182,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
12163
12182
|
planPath: confirmationDetails.planPath,
|
|
12164
12183
|
getPreferredEditor,
|
|
12165
12184
|
onApprove: (approvalMode) => {
|
|
12166
|
-
handleConfirm(
|
|
12185
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12167
12186
|
approved: true,
|
|
12168
12187
|
approvalMode
|
|
12169
12188
|
});
|
|
12170
12189
|
},
|
|
12171
12190
|
onFeedback: (feedback) => {
|
|
12172
|
-
handleConfirm(
|
|
12191
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12173
12192
|
approved: false,
|
|
12174
12193
|
feedback
|
|
12175
12194
|
});
|
|
12176
12195
|
},
|
|
12177
12196
|
onCancel: () => {
|
|
12178
|
-
handleConfirm(
|
|
12197
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12179
12198
|
},
|
|
12180
12199
|
width: terminalWidth,
|
|
12181
12200
|
availableHeight: bodyHeight
|
|
@@ -12284,7 +12303,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12284
12303
|
const containsRedirection = commandsToDisplay.some(
|
|
12285
12304
|
(cmd) => hasRedirection(cmd)
|
|
12286
12305
|
);
|
|
12287
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12306
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12288
12307
|
let warnings = null;
|
|
12289
12308
|
if (containsRedirection && !isAutoEdit) {
|
|
12290
12309
|
const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
|
|
@@ -12443,7 +12462,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12443
12462
|
const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
|
|
12444
12463
|
const renderRadioItem = (0, import_react37.useCallback)(
|
|
12445
12464
|
(item, { titleColor }) => {
|
|
12446
|
-
if (item.value ===
|
|
12465
|
+
if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
12447
12466
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
|
|
12448
12467
|
item.label,
|
|
12449
12468
|
" ",
|
|
@@ -14473,7 +14492,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
|
|
|
14473
14492
|
if (settings.merged.security.auth.useExternal) {
|
|
14474
14493
|
return null;
|
|
14475
14494
|
}
|
|
14476
|
-
if (authType ===
|
|
14495
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14477
14496
|
return null;
|
|
14478
14497
|
}
|
|
14479
14498
|
return validateAuthMethod(authType);
|
|
@@ -14525,7 +14544,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
14525
14544
|
}
|
|
14526
14545
|
return;
|
|
14527
14546
|
}
|
|
14528
|
-
if (authType ===
|
|
14547
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14529
14548
|
const key = await reloadApiKey();
|
|
14530
14549
|
if (!key) {
|
|
14531
14550
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -14603,31 +14622,31 @@ function AuthDialog({
|
|
|
14603
14622
|
let items = [
|
|
14604
14623
|
{
|
|
14605
14624
|
label: "Sign in with Google",
|
|
14606
|
-
value:
|
|
14607
|
-
key:
|
|
14625
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
14626
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
14608
14627
|
},
|
|
14609
14628
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
14610
14629
|
{
|
|
14611
14630
|
label: "Use Cloud Shell user credentials",
|
|
14612
|
-
value:
|
|
14613
|
-
key:
|
|
14631
|
+
value: AuthType.COMPUTE_ADC,
|
|
14632
|
+
key: AuthType.COMPUTE_ADC
|
|
14614
14633
|
}
|
|
14615
14634
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
14616
14635
|
{
|
|
14617
14636
|
label: "Use metadata server application default credentials",
|
|
14618
|
-
value:
|
|
14619
|
-
key:
|
|
14637
|
+
value: AuthType.COMPUTE_ADC,
|
|
14638
|
+
key: AuthType.COMPUTE_ADC
|
|
14620
14639
|
}
|
|
14621
14640
|
] : [],
|
|
14622
14641
|
{
|
|
14623
14642
|
label: "Use Gemini API Key",
|
|
14624
|
-
value:
|
|
14625
|
-
key:
|
|
14643
|
+
value: AuthType.USE_GEMINI,
|
|
14644
|
+
key: AuthType.USE_GEMINI
|
|
14626
14645
|
},
|
|
14627
14646
|
{
|
|
14628
14647
|
label: "Vertex AI",
|
|
14629
|
-
value:
|
|
14630
|
-
key:
|
|
14648
|
+
value: AuthType.USE_VERTEX_AI,
|
|
14649
|
+
key: AuthType.USE_VERTEX_AI
|
|
14631
14650
|
}
|
|
14632
14651
|
];
|
|
14633
14652
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -14649,9 +14668,9 @@ function AuthDialog({
|
|
|
14649
14668
|
return item.value === defaultAuthType;
|
|
14650
14669
|
}
|
|
14651
14670
|
if (process.env["GEMINI_API_KEY"]) {
|
|
14652
|
-
return item.value ===
|
|
14671
|
+
return item.value === AuthType.USE_GEMINI;
|
|
14653
14672
|
}
|
|
14654
|
-
return item.value ===
|
|
14673
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
14655
14674
|
});
|
|
14656
14675
|
if (settings.merged.security.auth.enforcedType) {
|
|
14657
14676
|
initialAuthIndex = 0;
|
|
@@ -14662,7 +14681,7 @@ function AuthDialog({
|
|
|
14662
14681
|
return;
|
|
14663
14682
|
}
|
|
14664
14683
|
if (authType) {
|
|
14665
|
-
const needsRestart = authType ===
|
|
14684
|
+
const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
|
|
14666
14685
|
if (needsRestart) {
|
|
14667
14686
|
setAuthContext({ requiresRestart: true });
|
|
14668
14687
|
} else {
|
|
@@ -14670,12 +14689,12 @@ function AuthDialog({
|
|
|
14670
14689
|
}
|
|
14671
14690
|
await clearCachedCredentialFile();
|
|
14672
14691
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
14673
|
-
if (authType ===
|
|
14692
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
14674
14693
|
setExiting(true);
|
|
14675
14694
|
setTimeout(relaunchApp, 100);
|
|
14676
14695
|
return;
|
|
14677
14696
|
}
|
|
14678
|
-
if (authType ===
|
|
14697
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14679
14698
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
14680
14699
|
return;
|
|
14681
14700
|
}
|
|
@@ -15027,9 +15046,18 @@ function EditorSettingsDialog({
|
|
|
15027
15046
|
let editorIndex = currentPreference ? editorItems.findIndex(
|
|
15028
15047
|
(item) => item.type === currentPreference
|
|
15029
15048
|
) : 0;
|
|
15030
|
-
|
|
15049
|
+
const isUnsupportedEditor = editorIndex === -1;
|
|
15050
|
+
if (isUnsupportedEditor) {
|
|
15031
15051
|
editorIndex = 0;
|
|
15032
15052
|
}
|
|
15053
|
+
(0, import_react50.useEffect)(() => {
|
|
15054
|
+
if (isUnsupportedEditor && currentPreference) {
|
|
15055
|
+
coreEvents.emitFeedback(
|
|
15056
|
+
"error",
|
|
15057
|
+
`Editor is not supported: ${currentPreference}`
|
|
15058
|
+
);
|
|
15059
|
+
}
|
|
15060
|
+
}, [isUnsupportedEditor, currentPreference]);
|
|
15033
15061
|
const scopeItems = [
|
|
15034
15062
|
{
|
|
15035
15063
|
label: "User Settings",
|
|
@@ -15422,11 +15450,11 @@ var PrivacyNoticeText = ({
|
|
|
15422
15450
|
}) => {
|
|
15423
15451
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15424
15452
|
switch (authType) {
|
|
15425
|
-
case
|
|
15453
|
+
case AuthType.USE_GEMINI:
|
|
15426
15454
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15427
|
-
case
|
|
15455
|
+
case AuthType.USE_VERTEX_AI:
|
|
15428
15456
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15429
|
-
case
|
|
15457
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15430
15458
|
default:
|
|
15431
15459
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15432
15460
|
}
|
|
@@ -15467,7 +15495,7 @@ function ProQuotaDialog({
|
|
|
15467
15495
|
value: "retry_always",
|
|
15468
15496
|
key: "retry_always"
|
|
15469
15497
|
},
|
|
15470
|
-
...authType ===
|
|
15498
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15471
15499
|
{
|
|
15472
15500
|
label: "Upgrade for higher limits",
|
|
15473
15501
|
value: "upgrade",
|
|
@@ -16624,8 +16652,9 @@ function ModelDialog({ onClose }) {
|
|
|
16624
16652
|
const preferredModel = config?.getModel() || GEMINI_MODEL_ALIAS_AUTO;
|
|
16625
16653
|
const shouldShowPreviewModels = config?.getHasAccessToPreviewModel() ?? false;
|
|
16626
16654
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
16655
|
+
const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
|
|
16627
16656
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16628
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16657
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16629
16658
|
const manualModelSelected = (0, import_react55.useMemo)(() => {
|
|
16630
16659
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16631
16660
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -16668,6 +16697,7 @@ function ModelDialog({ onClose }) {
|
|
|
16668
16697
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16669
16698
|
const allOptions = config.getModelConfigService().getAvailableModelOptions({
|
|
16670
16699
|
useGemini3_1: useGemini31,
|
|
16700
|
+
useGemini3_5Flash,
|
|
16671
16701
|
useCustomTools: useCustomToolModel,
|
|
16672
16702
|
hasAccessToPreview: shouldShowPreviewModels,
|
|
16673
16703
|
hasAccessToProModel
|
|
@@ -16692,7 +16722,8 @@ function ModelDialog({ onClose }) {
|
|
|
16692
16722
|
title: getDisplayString(GEMINI_MODEL_ALIAS_AUTO),
|
|
16693
16723
|
description: getAutoModelDescription(
|
|
16694
16724
|
shouldShowPreviewModels,
|
|
16695
|
-
useGemini31
|
|
16725
|
+
useGemini31,
|
|
16726
|
+
useGemini3_5Flash
|
|
16696
16727
|
),
|
|
16697
16728
|
key: GEMINI_MODEL_ALIAS_AUTO
|
|
16698
16729
|
},
|
|
@@ -16709,6 +16740,7 @@ function ModelDialog({ onClose }) {
|
|
|
16709
16740
|
shouldShowPreviewModels,
|
|
16710
16741
|
manualModelSelected,
|
|
16711
16742
|
useGemini31,
|
|
16743
|
+
useGemini3_5Flash,
|
|
16712
16744
|
useCustomToolModel,
|
|
16713
16745
|
hasAccessToProModel
|
|
16714
16746
|
]);
|
|
@@ -16716,6 +16748,7 @@ function ModelDialog({ onClose }) {
|
|
|
16716
16748
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16717
16749
|
const allOptions = config.getModelConfigService().getAvailableModelOptions({
|
|
16718
16750
|
useGemini3_1: useGemini31,
|
|
16751
|
+
useGemini3_5Flash,
|
|
16719
16752
|
useCustomTools: useCustomToolModel,
|
|
16720
16753
|
hasAccessToPreview: shouldShowPreviewModels,
|
|
16721
16754
|
hasAccessToProModel
|
|
@@ -16789,6 +16822,7 @@ function ModelDialog({ onClose }) {
|
|
|
16789
16822
|
}, [
|
|
16790
16823
|
shouldShowPreviewModels,
|
|
16791
16824
|
useGemini31,
|
|
16825
|
+
useGemini3_5Flash,
|
|
16792
16826
|
useCustomToolModel,
|
|
16793
16827
|
hasAccessToProModel,
|
|
16794
16828
|
config
|
|
@@ -17943,10 +17977,10 @@ function initializeConsoleStore() {
|
|
|
17943
17977
|
globalConsoleMessages = [];
|
|
17944
17978
|
globalErrorCount = 0;
|
|
17945
17979
|
notifyListeners();
|
|
17946
|
-
coreEvents.off(
|
|
17947
|
-
coreEvents.off(
|
|
17948
|
-
coreEvents.on(
|
|
17949
|
-
coreEvents.on(
|
|
17980
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
17981
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
17982
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
17983
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
17950
17984
|
}
|
|
17951
17985
|
function notifyListeners() {
|
|
17952
17986
|
for (const listener of listeners) {
|
|
@@ -20083,7 +20117,7 @@ function usePromptCompletion({
|
|
|
20083
20117
|
{ model: "prompt-completion" },
|
|
20084
20118
|
contents,
|
|
20085
20119
|
signal,
|
|
20086
|
-
|
|
20120
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20087
20121
|
);
|
|
20088
20122
|
if (signal.aborted) {
|
|
20089
20123
|
return;
|
|
@@ -22161,9 +22195,9 @@ var InputPrompt = ({
|
|
|
22161
22195
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22162
22196
|
}
|
|
22163
22197
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22164
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22165
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22166
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22198
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22199
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22200
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22167
22201
|
let statusColor;
|
|
22168
22202
|
let statusText = "";
|
|
22169
22203
|
if (shellModeActive) {
|
|
@@ -22600,7 +22634,8 @@ var WITTY_LOADING_PHRASES = [
|
|
|
22600
22634
|
"Have you tried turning it off and on again? (The loading screen, not me.)",
|
|
22601
22635
|
"Constructing additional pylons",
|
|
22602
22636
|
"New line? That\u2019s Ctrl+J.",
|
|
22603
|
-
"Releasing the HypnoDrones"
|
|
22637
|
+
"Releasing the HypnoDrones",
|
|
22638
|
+
"Pushing the button, Frank."
|
|
22604
22639
|
];
|
|
22605
22640
|
|
|
22606
22641
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
@@ -22995,22 +23030,22 @@ var ApprovalModeIndicator = ({
|
|
|
22995
23030
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
22996
23031
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
22997
23032
|
switch (approvalMode) {
|
|
22998
|
-
case
|
|
23033
|
+
case ApprovalMode.AUTO_EDIT:
|
|
22999
23034
|
textColor = theme.status.warning;
|
|
23000
23035
|
textContent = "auto-accept edits";
|
|
23001
23036
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23002
23037
|
break;
|
|
23003
|
-
case
|
|
23038
|
+
case ApprovalMode.PLAN:
|
|
23004
23039
|
textColor = theme.status.success;
|
|
23005
23040
|
textContent = "plan";
|
|
23006
23041
|
subText = `${cycleHint} to manual`;
|
|
23007
23042
|
break;
|
|
23008
|
-
case
|
|
23043
|
+
case ApprovalMode.YOLO:
|
|
23009
23044
|
textColor = theme.status.error;
|
|
23010
23045
|
textContent = "YOLO";
|
|
23011
23046
|
subText = yoloHint;
|
|
23012
23047
|
break;
|
|
23013
|
-
case
|
|
23048
|
+
case ApprovalMode.DEFAULT:
|
|
23014
23049
|
default:
|
|
23015
23050
|
textColor = theme.text.accent;
|
|
23016
23051
|
textContent = "";
|
|
@@ -23058,7 +23093,7 @@ var useComposerStatus = () => {
|
|
|
23058
23093
|
(item) => item.type === "tool_group"
|
|
23059
23094
|
).some(
|
|
23060
23095
|
(item) => item.tools.some(
|
|
23061
|
-
(tool) => tool.status ===
|
|
23096
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23062
23097
|
)
|
|
23063
23098
|
),
|
|
23064
23099
|
[uiState.pendingHistoryItems]
|
|
@@ -23073,13 +23108,13 @@ var useComposerStatus = () => {
|
|
|
23073
23108
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23074
23109
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23075
23110
|
switch (showApprovalModeIndicator) {
|
|
23076
|
-
case
|
|
23111
|
+
case ApprovalMode.YOLO:
|
|
23077
23112
|
return { text: "YOLO", color: theme.status.error };
|
|
23078
|
-
case
|
|
23113
|
+
case ApprovalMode.PLAN:
|
|
23079
23114
|
return { text: "plan", color: theme.status.success };
|
|
23080
|
-
case
|
|
23115
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23081
23116
|
return { text: "auto edit", color: theme.status.warning };
|
|
23082
|
-
case
|
|
23117
|
+
case ApprovalMode.DEFAULT:
|
|
23083
23118
|
default:
|
|
23084
23119
|
return null;
|
|
23085
23120
|
}
|
|
@@ -23433,7 +23468,7 @@ var ConfigInitDisplay = ({
|
|
|
23433
23468
|
let connected = 0;
|
|
23434
23469
|
const connecting = [];
|
|
23435
23470
|
for (const [name, client] of clients.entries()) {
|
|
23436
|
-
if (client.getStatus() ===
|
|
23471
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23437
23472
|
connected++;
|
|
23438
23473
|
} else {
|
|
23439
23474
|
connecting.push(name);
|
|
@@ -23455,9 +23490,9 @@ var ConfigInitDisplay = ({
|
|
|
23455
23490
|
);
|
|
23456
23491
|
}
|
|
23457
23492
|
};
|
|
23458
|
-
coreEvents.on(
|
|
23493
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23459
23494
|
return () => {
|
|
23460
|
-
coreEvents.off(
|
|
23495
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23461
23496
|
};
|
|
23462
23497
|
}, [initialMessage]);
|
|
23463
23498
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
|
|
@@ -24174,7 +24209,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24174
24209
|
callId,
|
|
24175
24210
|
name: SHELL_COMMAND_NAME,
|
|
24176
24211
|
description: rawQuery,
|
|
24177
|
-
status:
|
|
24212
|
+
status: CoreToolCallStatus.Executing,
|
|
24178
24213
|
isClientInitiated: true,
|
|
24179
24214
|
resultDisplay: "",
|
|
24180
24215
|
confirmationDetails: void 0
|
|
@@ -24315,7 +24350,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24315
24350
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24316
24351
|
}
|
|
24317
24352
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24318
|
-
let finalStatus =
|
|
24353
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24319
24354
|
const prependToAnsiOutput = (output, text) => {
|
|
24320
24355
|
const newLines = text.split("\n").map((line) => [
|
|
24321
24356
|
{
|
|
@@ -24334,20 +24369,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24334
24369
|
};
|
|
24335
24370
|
let prefix = "";
|
|
24336
24371
|
if (result.error) {
|
|
24337
|
-
finalStatus =
|
|
24372
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24338
24373
|
prefix = result.error.message;
|
|
24339
24374
|
} else if (result.aborted) {
|
|
24340
|
-
finalStatus =
|
|
24375
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24341
24376
|
prefix = "Command was cancelled.";
|
|
24342
24377
|
} else if (result.backgrounded) {
|
|
24343
|
-
finalStatus =
|
|
24378
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24344
24379
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24345
24380
|
mainContent = finalOutput;
|
|
24346
24381
|
} else if (result.signal) {
|
|
24347
|
-
finalStatus =
|
|
24382
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24348
24383
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24349
24384
|
} else if (result.exitCode !== 0) {
|
|
24350
|
-
finalStatus =
|
|
24385
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24351
24386
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24352
24387
|
}
|
|
24353
24388
|
if (prefix) {
|
|
@@ -24373,7 +24408,7 @@ ${mainContent}`;
|
|
|
24373
24408
|
status: finalStatus,
|
|
24374
24409
|
resultDisplay: finalOutput
|
|
24375
24410
|
};
|
|
24376
|
-
if (finalStatus !==
|
|
24411
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24377
24412
|
addItemToHistory(
|
|
24378
24413
|
{
|
|
24379
24414
|
type: "tool_group",
|
|
@@ -25363,7 +25398,7 @@ function useQuotaAndFallback({
|
|
|
25363
25398
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25364
25399
|
`/stats model for usage details`,
|
|
25365
25400
|
`/model to switch models.`,
|
|
25366
|
-
contentGeneratorConfig?.authType ===
|
|
25401
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25367
25402
|
].filter(Boolean);
|
|
25368
25403
|
message = messageLines.join("\n");
|
|
25369
25404
|
} else if (error instanceof ModelNotFoundError) {
|
|
@@ -25551,7 +25586,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25551
25586
|
);
|
|
25552
25587
|
setEditorError(null);
|
|
25553
25588
|
setIsEditorDialogOpen(false);
|
|
25554
|
-
coreEvents.emit(
|
|
25589
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25555
25590
|
} catch (error) {
|
|
25556
25591
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25557
25592
|
}
|
|
@@ -25560,7 +25595,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25560
25595
|
);
|
|
25561
25596
|
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25562
25597
|
setIsEditorDialogOpen(false);
|
|
25563
|
-
coreEvents.emit(
|
|
25598
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25564
25599
|
}, []);
|
|
25565
25600
|
return {
|
|
25566
25601
|
isEditorDialogOpen,
|
|
@@ -25937,7 +25972,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25937
25972
|
canonicalPath: resolvedCommandPath
|
|
25938
25973
|
} = parseSlashCommand(trimmed, commands);
|
|
25939
25974
|
if (!commandToExecute) {
|
|
25940
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
25975
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
25941
25976
|
if (isMcpLoading) {
|
|
25942
25977
|
setIsProcessing(true);
|
|
25943
25978
|
if (addToHistory) {
|
|
@@ -26117,7 +26152,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26117
26152
|
onConfirm: async (resolvedOutcome) => {
|
|
26118
26153
|
resolve3({
|
|
26119
26154
|
outcome: resolvedOutcome,
|
|
26120
|
-
approvedCommands: resolvedOutcome ===
|
|
26155
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26121
26156
|
});
|
|
26122
26157
|
}
|
|
26123
26158
|
};
|
|
@@ -26125,7 +26160,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26125
26160
|
callId,
|
|
26126
26161
|
name: "Expansion",
|
|
26127
26162
|
description: "Command expansion needs shell access",
|
|
26128
|
-
status:
|
|
26163
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26129
26164
|
isClientInitiated: true,
|
|
26130
26165
|
resultDisplay: void 0,
|
|
26131
26166
|
confirmationDetails
|
|
@@ -26136,7 +26171,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26136
26171
|
});
|
|
26137
26172
|
});
|
|
26138
26173
|
setPendingItem(null);
|
|
26139
|
-
if (outcome ===
|
|
26174
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26140
26175
|
addItem(
|
|
26141
26176
|
{
|
|
26142
26177
|
type: "info" /* INFO */,
|
|
@@ -26146,7 +26181,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26146
26181
|
);
|
|
26147
26182
|
return { type: "handled" };
|
|
26148
26183
|
}
|
|
26149
|
-
if (outcome ===
|
|
26184
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26150
26185
|
setSessionShellAllowlist(
|
|
26151
26186
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26152
26187
|
);
|
|
@@ -26622,7 +26657,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26622
26657
|
let description;
|
|
26623
26658
|
let renderOutputAsMarkdown = false;
|
|
26624
26659
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26625
|
-
if (call.status ===
|
|
26660
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26626
26661
|
description = JSON.stringify(call.request.args);
|
|
26627
26662
|
} else {
|
|
26628
26663
|
description = call.invocation.getDescription();
|
|
@@ -26645,27 +26680,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26645
26680
|
let progress = void 0;
|
|
26646
26681
|
let progressTotal = void 0;
|
|
26647
26682
|
switch (call.status) {
|
|
26648
|
-
case
|
|
26683
|
+
case CoreToolCallStatus.Success:
|
|
26649
26684
|
resultDisplay = call.response.resultDisplay;
|
|
26650
26685
|
outputFile = call.response.outputFile;
|
|
26651
26686
|
break;
|
|
26652
|
-
case
|
|
26653
|
-
case
|
|
26687
|
+
case CoreToolCallStatus.Error:
|
|
26688
|
+
case CoreToolCallStatus.Cancelled:
|
|
26654
26689
|
resultDisplay = call.response.resultDisplay;
|
|
26655
26690
|
break;
|
|
26656
|
-
case
|
|
26691
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26657
26692
|
correlationId = call.correlationId;
|
|
26658
26693
|
confirmationDetails = call.confirmationDetails;
|
|
26659
26694
|
break;
|
|
26660
|
-
case
|
|
26695
|
+
case CoreToolCallStatus.Executing:
|
|
26661
26696
|
resultDisplay = call.liveOutput;
|
|
26662
26697
|
ptyId = call.pid;
|
|
26663
26698
|
progressMessage = call.progressMessage;
|
|
26664
26699
|
progress = call.progress;
|
|
26665
26700
|
progressTotal = call.progressTotal;
|
|
26666
26701
|
break;
|
|
26667
|
-
case
|
|
26668
|
-
case
|
|
26702
|
+
case CoreToolCallStatus.Scheduled:
|
|
26703
|
+
case CoreToolCallStatus.Validating:
|
|
26669
26704
|
break;
|
|
26670
26705
|
default: {
|
|
26671
26706
|
const exhaustiveCheck = call;
|
|
@@ -26736,7 +26771,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26736
26771
|
const handler = (event) => {
|
|
26737
26772
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26738
26773
|
const hasExecuting = event.toolCalls.some(
|
|
26739
|
-
(tc) => tc.status ===
|
|
26774
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26740
26775
|
);
|
|
26741
26776
|
if (hasExecuting) {
|
|
26742
26777
|
setLastToolOutputTime(Date.now());
|
|
@@ -26745,7 +26780,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26745
26780
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26746
26781
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26747
26782
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26748
|
-
(tc) => tc.status ===
|
|
26783
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26749
26784
|
);
|
|
26750
26785
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26751
26786
|
return prev;
|
|
@@ -26757,9 +26792,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26757
26792
|
};
|
|
26758
26793
|
});
|
|
26759
26794
|
};
|
|
26760
|
-
messageBus.subscribe(
|
|
26795
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26761
26796
|
return () => {
|
|
26762
|
-
messageBus.unsubscribe(
|
|
26797
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26763
26798
|
};
|
|
26764
26799
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26765
26800
|
(0, import_react98.useEffect)(() => {
|
|
@@ -26781,9 +26816,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26781
26816
|
};
|
|
26782
26817
|
});
|
|
26783
26818
|
};
|
|
26784
|
-
messageBus.subscribe(
|
|
26819
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26785
26820
|
return () => {
|
|
26786
|
-
messageBus.unsubscribe(
|
|
26821
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26787
26822
|
};
|
|
26788
26823
|
}, [messageBus]);
|
|
26789
26824
|
const schedule = (0, import_react98.useCallback)(
|
|
@@ -26882,8 +26917,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
26882
26917
|
const prev = prevMap.get(coreCall.request.callId);
|
|
26883
26918
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
26884
26919
|
let status = coreCall.status;
|
|
26885
|
-
if ((status ===
|
|
26886
|
-
status =
|
|
26920
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
26921
|
+
status = CoreToolCallStatus.Executing;
|
|
26887
26922
|
}
|
|
26888
26923
|
return {
|
|
26889
26924
|
...coreCall,
|
|
@@ -26915,7 +26950,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
26915
26950
|
};
|
|
26916
26951
|
}
|
|
26917
26952
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
26918
|
-
return toolCall.status ===
|
|
26953
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
26919
26954
|
}
|
|
26920
26955
|
function showCitations(settings) {
|
|
26921
26956
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -26925,14 +26960,14 @@ function showCitations(settings) {
|
|
|
26925
26960
|
return true;
|
|
26926
26961
|
}
|
|
26927
26962
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
26928
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
26963
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
26929
26964
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
26930
26965
|
}
|
|
26931
26966
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
26932
|
-
if (tc.status ===
|
|
26967
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
26933
26968
|
return true;
|
|
26934
26969
|
}
|
|
26935
|
-
if (tc.status ===
|
|
26970
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
26936
26971
|
return !tc.responseSubmittedToGemini;
|
|
26937
26972
|
}
|
|
26938
26973
|
return false;
|
|
@@ -26978,9 +27013,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
26978
27013
|
}
|
|
26979
27014
|
setRetryStatus(payload);
|
|
26980
27015
|
};
|
|
26981
|
-
coreEvents.on(
|
|
27016
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
26982
27017
|
return () => {
|
|
26983
|
-
coreEvents.off(
|
|
27018
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
26984
27019
|
};
|
|
26985
27020
|
}, [isRespondingRef]);
|
|
26986
27021
|
const [
|
|
@@ -27113,12 +27148,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27113
27148
|
const tc = toolCalls[i];
|
|
27114
27149
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27115
27150
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27116
|
-
const isAgent = tc.tool?.kind ===
|
|
27151
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27117
27152
|
if (isAgent) {
|
|
27118
27153
|
let contigAgentsComplete = true;
|
|
27119
27154
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27120
27155
|
const nextTc = toolCalls[j];
|
|
27121
|
-
if (nextTc.tool?.kind ===
|
|
27156
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27122
27157
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27123
27158
|
contigAgentsComplete = false;
|
|
27124
27159
|
break;
|
|
@@ -27144,7 +27179,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27144
27179
|
let currentGroup = [];
|
|
27145
27180
|
for (const tc of toolsToPush) {
|
|
27146
27181
|
newPushed.add(tc.request.callId);
|
|
27147
|
-
if (tc.tool?.kind ===
|
|
27182
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27148
27183
|
currentGroup.push(tc);
|
|
27149
27184
|
} else {
|
|
27150
27185
|
if (currentGroup.length > 0) {
|
|
@@ -27294,7 +27329,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27294
27329
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27295
27330
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27296
27331
|
(0, import_react99.useEffect)(() => {
|
|
27297
|
-
if (config.getApprovalMode() ===
|
|
27332
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27298
27333
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27299
27334
|
(item) => item.type === "user" /* USER */
|
|
27300
27335
|
);
|
|
@@ -27362,7 +27397,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27362
27397
|
return;
|
|
27363
27398
|
}
|
|
27364
27399
|
const hasActiveTools = toolCalls.some(
|
|
27365
|
-
(tc) => tc.status ===
|
|
27400
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27366
27401
|
);
|
|
27367
27402
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27368
27403
|
if (clearBuffer) {
|
|
@@ -27389,7 +27424,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27389
27424
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27390
27425
|
return {
|
|
27391
27426
|
...tool,
|
|
27392
|
-
status:
|
|
27427
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27393
27428
|
resultDisplay: tool.resultDisplay
|
|
27394
27429
|
};
|
|
27395
27430
|
}
|
|
@@ -27454,7 +27489,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27454
27489
|
let localQueryToSendToGemini = null;
|
|
27455
27490
|
if (typeof query === "string") {
|
|
27456
27491
|
const trimmedQuery = query.trim();
|
|
27457
|
-
await logger?.logMessage(
|
|
27492
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27458
27493
|
if (!shellModeActive) {
|
|
27459
27494
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27460
27495
|
if (slashCommandResult) {
|
|
@@ -27610,7 +27645,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27610
27645
|
if (pendingHistoryItemRef.current) {
|
|
27611
27646
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27612
27647
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27613
|
-
(tool) => tool.status ===
|
|
27648
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
27614
27649
|
);
|
|
27615
27650
|
const pendingItem = {
|
|
27616
27651
|
...pendingHistoryItemRef.current,
|
|
@@ -27856,15 +27891,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27856
27891
|
let geminiMessageBuffer = "";
|
|
27857
27892
|
const toolCallRequests = [];
|
|
27858
27893
|
for await (const event of stream) {
|
|
27859
|
-
if (event.type !==
|
|
27894
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
27860
27895
|
setThought(null);
|
|
27861
27896
|
}
|
|
27862
27897
|
switch (event.type) {
|
|
27863
|
-
case
|
|
27898
|
+
case GeminiEventType.Thought:
|
|
27864
27899
|
setLastGeminiActivityTime(Date.now());
|
|
27865
27900
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
27866
27901
|
break;
|
|
27867
|
-
case
|
|
27902
|
+
case GeminiEventType.Content:
|
|
27868
27903
|
setLastGeminiActivityTime(Date.now());
|
|
27869
27904
|
geminiMessageBuffer = handleContentEvent(
|
|
27870
27905
|
event.value,
|
|
@@ -27872,16 +27907,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27872
27907
|
userMessageTimestamp
|
|
27873
27908
|
);
|
|
27874
27909
|
break;
|
|
27875
|
-
case
|
|
27910
|
+
case GeminiEventType.ToolCallRequest:
|
|
27876
27911
|
toolCallRequests.push(event.value);
|
|
27877
27912
|
break;
|
|
27878
|
-
case
|
|
27913
|
+
case GeminiEventType.UserCancelled:
|
|
27879
27914
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
27880
27915
|
break;
|
|
27881
|
-
case
|
|
27916
|
+
case GeminiEventType.Error:
|
|
27882
27917
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
27883
27918
|
break;
|
|
27884
|
-
case
|
|
27919
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
27885
27920
|
handleAgentExecutionStoppedEvent(
|
|
27886
27921
|
event.value.reason,
|
|
27887
27922
|
userMessageTimestamp,
|
|
@@ -27889,7 +27924,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27889
27924
|
event.value.contextCleared
|
|
27890
27925
|
);
|
|
27891
27926
|
break;
|
|
27892
|
-
case
|
|
27927
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
27893
27928
|
handleAgentExecutionBlockedEvent(
|
|
27894
27929
|
event.value.reason,
|
|
27895
27930
|
userMessageTimestamp,
|
|
@@ -27897,35 +27932,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27897
27932
|
event.value.contextCleared
|
|
27898
27933
|
);
|
|
27899
27934
|
break;
|
|
27900
|
-
case
|
|
27935
|
+
case GeminiEventType.ChatCompressed:
|
|
27901
27936
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
27902
27937
|
break;
|
|
27903
|
-
case
|
|
27904
|
-
case
|
|
27938
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
27939
|
+
case GeminiEventType.ToolCallResponse:
|
|
27905
27940
|
break;
|
|
27906
|
-
case
|
|
27941
|
+
case GeminiEventType.MaxSessionTurns:
|
|
27907
27942
|
handleMaxSessionTurnsEvent();
|
|
27908
27943
|
break;
|
|
27909
|
-
case
|
|
27944
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
27910
27945
|
handleContextWindowWillOverflowEvent(
|
|
27911
27946
|
event.value.estimatedRequestTokenCount,
|
|
27912
27947
|
event.value.remainingTokenCount
|
|
27913
27948
|
);
|
|
27914
27949
|
break;
|
|
27915
|
-
case
|
|
27950
|
+
case GeminiEventType.Finished:
|
|
27916
27951
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
27917
27952
|
break;
|
|
27918
|
-
case
|
|
27953
|
+
case GeminiEventType.Citation:
|
|
27919
27954
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
27920
27955
|
break;
|
|
27921
|
-
case
|
|
27956
|
+
case GeminiEventType.ModelInfo:
|
|
27922
27957
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
27923
27958
|
break;
|
|
27924
|
-
case
|
|
27959
|
+
case GeminiEventType.LoopDetected:
|
|
27925
27960
|
loopDetectedRef.current = true;
|
|
27926
27961
|
break;
|
|
27927
|
-
case
|
|
27928
|
-
case
|
|
27962
|
+
case GeminiEventType.Retry:
|
|
27963
|
+
case GeminiEventType.InvalidStream:
|
|
27929
27964
|
break;
|
|
27930
27965
|
default: {
|
|
27931
27966
|
const unreachable = event;
|
|
@@ -27966,7 +28001,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27966
28001
|
const submitQuery = (0, import_react99.useCallback)(
|
|
27967
28002
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
27968
28003
|
{
|
|
27969
|
-
operation: options?.isContinuation ?
|
|
28004
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
27970
28005
|
sessionId: config.getSessionId()
|
|
27971
28006
|
},
|
|
27972
28007
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28126,7 +28161,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28126
28161
|
);
|
|
28127
28162
|
const handleApprovalModeChange = (0, import_react99.useCallback)(
|
|
28128
28163
|
async (newApprovalMode) => {
|
|
28129
|
-
if (previousApprovalModeRef.current ===
|
|
28164
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28130
28165
|
if (geminiClient) {
|
|
28131
28166
|
try {
|
|
28132
28167
|
await geminiClient.addHistory({
|
|
@@ -28149,11 +28184,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28149
28184
|
}
|
|
28150
28185
|
}
|
|
28151
28186
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28152
|
-
if (newApprovalMode ===
|
|
28187
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28153
28188
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28154
28189
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28155
28190
|
);
|
|
28156
|
-
if (newApprovalMode ===
|
|
28191
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28157
28192
|
awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
|
|
28158
28193
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
28159
28194
|
return true;
|
|
@@ -28169,11 +28204,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28169
28204
|
if (call.correlationId) {
|
|
28170
28205
|
try {
|
|
28171
28206
|
await config.getMessageBus().publish({
|
|
28172
|
-
type:
|
|
28207
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28173
28208
|
correlationId: call.correlationId,
|
|
28174
28209
|
confirmed: true,
|
|
28175
28210
|
requiresUserConfirmation: false,
|
|
28176
|
-
outcome:
|
|
28211
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28177
28212
|
});
|
|
28178
28213
|
} catch (error) {
|
|
28179
28214
|
debugLogger.warn(
|
|
@@ -28242,14 +28277,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28242
28277
|
);
|
|
28243
28278
|
if (isLowErrorVerbosity) {
|
|
28244
28279
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28245
|
-
(tc) => tc.status ===
|
|
28280
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28246
28281
|
).length;
|
|
28247
28282
|
}
|
|
28248
28283
|
if (geminiTools.length === 0) {
|
|
28249
28284
|
return;
|
|
28250
28285
|
}
|
|
28251
28286
|
const stopExecutionTool = geminiTools.find(
|
|
28252
|
-
(tc) => tc.response.errorType ===
|
|
28287
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28253
28288
|
);
|
|
28254
28289
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28255
28290
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28269,9 +28304,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28269
28304
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28270
28305
|
);
|
|
28271
28306
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28272
|
-
(tc) => tc.status ===
|
|
28307
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28273
28308
|
);
|
|
28274
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28309
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28275
28310
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28276
28311
|
if (!turnCancelledRef.current) {
|
|
28277
28312
|
addItem({
|
|
@@ -28351,7 +28386,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28351
28386
|
return;
|
|
28352
28387
|
}
|
|
28353
28388
|
const restorableToolCalls = toolCalls.filter(
|
|
28354
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28389
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28355
28390
|
);
|
|
28356
28391
|
if (restorableToolCalls.length > 0) {
|
|
28357
28392
|
if (!gitService) {
|
|
@@ -28574,14 +28609,14 @@ var useAgentStream = ({
|
|
|
28574
28609
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28575
28610
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28576
28611
|
const desc = legacyState?.description ?? "";
|
|
28577
|
-
const fallbackKind =
|
|
28612
|
+
const fallbackKind = Kind.Other;
|
|
28578
28613
|
const newCall = {
|
|
28579
28614
|
callId: event.requestId,
|
|
28580
28615
|
name: displayName,
|
|
28581
28616
|
originalRequestName: event.name,
|
|
28582
28617
|
description: desc,
|
|
28583
28618
|
display: event.display,
|
|
28584
|
-
status:
|
|
28619
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28585
28620
|
isClientInitiated: false,
|
|
28586
28621
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28587
28622
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28599,10 +28634,10 @@ var useAgentStream = ({
|
|
|
28599
28634
|
const evtStatus = legacyState?.status;
|
|
28600
28635
|
let status = tc.status;
|
|
28601
28636
|
if (evtStatus === "executing")
|
|
28602
|
-
status =
|
|
28603
|
-
else if (evtStatus === "error") status =
|
|
28637
|
+
status = CoreToolCallStatus.Executing;
|
|
28638
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28604
28639
|
else if (evtStatus === "success")
|
|
28605
|
-
status =
|
|
28640
|
+
status = CoreToolCallStatus.Success;
|
|
28606
28641
|
const display = event.display?.result;
|
|
28607
28642
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28608
28643
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28635,7 +28670,7 @@ var useAgentStream = ({
|
|
|
28635
28670
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28636
28671
|
return {
|
|
28637
28672
|
...tc,
|
|
28638
|
-
status: event.isError ?
|
|
28673
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28639
28674
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28640
28675
|
resultDisplay,
|
|
28641
28676
|
outputFile
|
|
@@ -28701,7 +28736,7 @@ var useAgentStream = ({
|
|
|
28701
28736
|
if (!options?.isContinuation) {
|
|
28702
28737
|
if (typeof query === "string") {
|
|
28703
28738
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28704
|
-
void logger?.logMessage(
|
|
28739
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28705
28740
|
}
|
|
28706
28741
|
startNewPrompt();
|
|
28707
28742
|
}
|
|
@@ -30228,9 +30263,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30228
30263
|
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30229
30264
|
async (choice) => {
|
|
30230
30265
|
const trustLevelMap = {
|
|
30231
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30232
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30233
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
30266
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
30267
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
30268
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
30234
30269
|
};
|
|
30235
30270
|
const trustLevel = trustLevelMap[choice];
|
|
30236
30271
|
if (!trustLevel) return;
|
|
@@ -30249,7 +30284,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30249
30284
|
}, 100);
|
|
30250
30285
|
return;
|
|
30251
30286
|
}
|
|
30252
|
-
const currentIsTrusted = trustLevel ===
|
|
30287
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30253
30288
|
onTrustChange(currentIsTrusted);
|
|
30254
30289
|
setIsTrusted(currentIsTrusted);
|
|
30255
30290
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -31257,7 +31292,7 @@ function useMessageQueue({
|
|
|
31257
31292
|
var import_react107 = __toESM(require_react(), 1);
|
|
31258
31293
|
function useMcpStatus(config) {
|
|
31259
31294
|
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31260
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31295
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31261
31296
|
);
|
|
31262
31297
|
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31263
31298
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31270,12 +31305,12 @@ function useMcpStatus(config) {
|
|
|
31270
31305
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31271
31306
|
}
|
|
31272
31307
|
};
|
|
31273
|
-
coreEvents.on(
|
|
31308
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31274
31309
|
return () => {
|
|
31275
|
-
coreEvents.off(
|
|
31310
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31276
31311
|
};
|
|
31277
31312
|
}, [config]);
|
|
31278
|
-
const isMcpReady = discoveryState ===
|
|
31313
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31279
31314
|
return {
|
|
31280
31315
|
discoveryState,
|
|
31281
31316
|
mcpServerCount,
|
|
@@ -31302,7 +31337,7 @@ function useApprovalModeIndicator({
|
|
|
31302
31337
|
(key) => {
|
|
31303
31338
|
let nextApprovalMode;
|
|
31304
31339
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31305
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31340
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31306
31341
|
if (addItem) {
|
|
31307
31342
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31308
31343
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31320,21 +31355,21 @@ function useApprovalModeIndicator({
|
|
|
31320
31355
|
}
|
|
31321
31356
|
return;
|
|
31322
31357
|
}
|
|
31323
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31358
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31324
31359
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31325
31360
|
const currentMode = config.getApprovalMode();
|
|
31326
31361
|
switch (currentMode) {
|
|
31327
|
-
case
|
|
31328
|
-
nextApprovalMode =
|
|
31362
|
+
case ApprovalMode.DEFAULT:
|
|
31363
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31329
31364
|
break;
|
|
31330
|
-
case
|
|
31331
|
-
nextApprovalMode = allowPlanMode ?
|
|
31365
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31366
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31332
31367
|
break;
|
|
31333
|
-
case
|
|
31334
|
-
nextApprovalMode =
|
|
31368
|
+
case ApprovalMode.PLAN:
|
|
31369
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31335
31370
|
break;
|
|
31336
|
-
case
|
|
31337
|
-
nextApprovalMode =
|
|
31371
|
+
case ApprovalMode.YOLO:
|
|
31372
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31338
31373
|
break;
|
|
31339
31374
|
default:
|
|
31340
31375
|
}
|
|
@@ -31744,11 +31779,11 @@ var useHookDisplayState = () => {
|
|
|
31744
31779
|
removeHook();
|
|
31745
31780
|
}
|
|
31746
31781
|
};
|
|
31747
|
-
coreEvents.on(
|
|
31748
|
-
coreEvents.on(
|
|
31782
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
31783
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31749
31784
|
return () => {
|
|
31750
|
-
coreEvents.off(
|
|
31751
|
-
coreEvents.off(
|
|
31785
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
31786
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31752
31787
|
activeTimeouts.forEach(clearTimeout);
|
|
31753
31788
|
activeTimeouts.clear();
|
|
31754
31789
|
};
|
|
@@ -32587,7 +32622,7 @@ var AppContainer = (props) => {
|
|
|
32587
32622
|
setConfigInitialized(true);
|
|
32588
32623
|
startupProfiler.flush(config);
|
|
32589
32624
|
startAutoMemoryIfEnabled(config);
|
|
32590
|
-
const sessionStartSource = resumedSessionData ?
|
|
32625
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32591
32626
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32592
32627
|
if (result) {
|
|
32593
32628
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32614,7 +32649,7 @@ var AppContainer = (props) => {
|
|
|
32614
32649
|
);
|
|
32615
32650
|
const ideClient = await IdeClient.getInstance();
|
|
32616
32651
|
await ideClient.disconnect();
|
|
32617
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32652
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32618
32653
|
};
|
|
32619
32654
|
registerCleanup(cleanupFn);
|
|
32620
32655
|
return () => {
|
|
@@ -32639,11 +32674,11 @@ var AppContainer = (props) => {
|
|
|
32639
32674
|
resetTime: payload.resetTime
|
|
32640
32675
|
});
|
|
32641
32676
|
};
|
|
32642
|
-
coreEvents.on(
|
|
32643
|
-
coreEvents.on(
|
|
32677
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32678
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32644
32679
|
return () => {
|
|
32645
|
-
coreEvents.off(
|
|
32646
|
-
coreEvents.off(
|
|
32680
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32681
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32647
32682
|
};
|
|
32648
32683
|
}, [config]);
|
|
32649
32684
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32656,16 +32691,16 @@ var AppContainer = (props) => {
|
|
|
32656
32691
|
const handleAgentsDiscovered = (payload) => {
|
|
32657
32692
|
setNewAgents(payload.agents);
|
|
32658
32693
|
};
|
|
32659
|
-
coreEvents.on(
|
|
32660
|
-
coreEvents.on(
|
|
32661
|
-
coreEvents.on(
|
|
32694
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32695
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32696
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32662
32697
|
return () => {
|
|
32663
|
-
coreEvents.off(
|
|
32698
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32664
32699
|
coreEvents.off(
|
|
32665
|
-
|
|
32700
|
+
CoreEvent.AdminSettingsChanged,
|
|
32666
32701
|
handleAdminSettingsChanged
|
|
32667
32702
|
);
|
|
32668
|
-
coreEvents.off(
|
|
32703
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32669
32704
|
};
|
|
32670
32705
|
}, [settings]);
|
|
32671
32706
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32730,11 +32765,11 @@ var AppContainer = (props) => {
|
|
|
32730
32765
|
exitEditorDialog
|
|
32731
32766
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32732
32767
|
(0, import_react121.useEffect)(() => {
|
|
32733
|
-
coreEvents.on(
|
|
32734
|
-
coreEvents.on(
|
|
32768
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32769
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32735
32770
|
return () => {
|
|
32736
|
-
coreEvents.off(
|
|
32737
|
-
coreEvents.off(
|
|
32771
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32772
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32738
32773
|
};
|
|
32739
32774
|
}, [handleEditorClose, openEditorDialog]);
|
|
32740
32775
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32802,7 +32837,7 @@ var AppContainer = (props) => {
|
|
|
32802
32837
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
32803
32838
|
});
|
|
32804
32839
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
32805
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
32840
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
32806
32841
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
32807
32842
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
32808
32843
|
config,
|
|
@@ -32830,7 +32865,7 @@ var AppContainer = (props) => {
|
|
|
32830
32865
|
async (authType, scope) => {
|
|
32831
32866
|
if (authType) {
|
|
32832
32867
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
32833
|
-
if (authType ===
|
|
32868
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
32834
32869
|
setAuthContext({ requiresRestart: true });
|
|
32835
32870
|
} else {
|
|
32836
32871
|
setAuthContext({});
|
|
@@ -32858,7 +32893,7 @@ var AppContainer = (props) => {
|
|
|
32858
32893
|
);
|
|
32859
32894
|
return;
|
|
32860
32895
|
}
|
|
32861
|
-
if (authType ===
|
|
32896
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
32862
32897
|
writeToStdout(`
|
|
32863
32898
|
----------------------------------------------------------------
|
|
32864
32899
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -32881,7 +32916,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32881
32916
|
}
|
|
32882
32917
|
await saveApiKey(apiKey);
|
|
32883
32918
|
await reloadApiKey();
|
|
32884
|
-
await config.refreshAuth(
|
|
32919
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
32885
32920
|
setAuthState("authenticated" /* Authenticated */);
|
|
32886
32921
|
} catch (e) {
|
|
32887
32922
|
onAuthError(
|
|
@@ -32906,7 +32941,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32906
32941
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
32907
32942
|
);
|
|
32908
32943
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
32909
|
-
if (settings.merged.security.auth.selectedType ===
|
|
32944
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
32910
32945
|
return;
|
|
32911
32946
|
}
|
|
32912
32947
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -33042,9 +33077,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33042
33077
|
}
|
|
33043
33078
|
});
|
|
33044
33079
|
};
|
|
33045
|
-
coreEvents.on(
|
|
33080
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33046
33081
|
return () => {
|
|
33047
|
-
coreEvents.off(
|
|
33082
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33048
33083
|
};
|
|
33049
33084
|
}, []);
|
|
33050
33085
|
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
@@ -33702,7 +33737,7 @@ ${queuedText}` : queuedText;
|
|
|
33702
33737
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33703
33738
|
if (settings.merged.general.devtools) {
|
|
33704
33739
|
void (async () => {
|
|
33705
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33740
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-Z2YXVMYF.js");
|
|
33706
33741
|
await toggleDevToolsPanel(
|
|
33707
33742
|
config,
|
|
33708
33743
|
showErrorDetails,
|
|
@@ -33920,17 +33955,17 @@ ${queuedText}` : queuedText;
|
|
|
33920
33955
|
Date.now()
|
|
33921
33956
|
);
|
|
33922
33957
|
};
|
|
33923
|
-
coreEvents.on(
|
|
33924
|
-
coreEvents.on(
|
|
33958
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
33959
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
33925
33960
|
coreEvents.drainBacklogs();
|
|
33926
33961
|
return () => {
|
|
33927
|
-
coreEvents.off(
|
|
33928
|
-
coreEvents.off(
|
|
33962
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
33963
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
33929
33964
|
};
|
|
33930
33965
|
}, [historyManager]);
|
|
33931
33966
|
const nightly = props.version.includes("nightly");
|
|
33932
33967
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
33933
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
33968
|
+
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;
|
|
33934
33969
|
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;
|
|
33935
33970
|
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
33936
33971
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
@@ -34030,9 +34065,9 @@ ${queuedText}` : queuedText;
|
|
|
34030
34065
|
const handleMemoryChanged = (result) => {
|
|
34031
34066
|
setGeminiMdFileCount(result.fileCount);
|
|
34032
34067
|
};
|
|
34033
|
-
coreEvents.on(
|
|
34068
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34034
34069
|
return () => {
|
|
34035
|
-
coreEvents.off(
|
|
34070
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34036
34071
|
};
|
|
34037
34072
|
}, []);
|
|
34038
34073
|
(0, import_react121.useEffect)(() => {
|