@google/gemini-cli 0.47.0-preview.0 → 0.48.0-nightly.20260612.g4e10a34be
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-3QB7USWX.js → chunk-25ZW2ZOF.js} +1 -1
- package/bundle/{chunk-KQUKJ25H.js → chunk-3BHPNRR5.js} +1 -1
- package/bundle/{chunk-KABNLJTC.js → chunk-3P56CQDW.js} +7 -7
- package/bundle/{chunk-HVY4BTIS.js → chunk-47O5POZQ.js} +131 -122
- package/bundle/{chunk-FYSIP5RY.js → chunk-4FWMMTHD.js} +1 -1
- package/bundle/{chunk-BM2S44RN.js → chunk-57QJRHS6.js} +1 -1
- package/bundle/{chunk-X4ES3RYL.js → chunk-5OGSMQN5.js} +8 -5
- package/bundle/{chunk-HKYJF453.js → chunk-5TAF74A7.js} +67 -54
- package/bundle/{chunk-TL7FT4N6.js → chunk-BG23KJOF.js} +1 -1
- package/bundle/{chunk-X4CTUGDH.js → chunk-DR6M2CVX.js} +2 -2
- package/bundle/{chunk-OFDHSTZY.js → chunk-DV5H7HVO.js} +1 -1
- package/bundle/{chunk-TNF7XO3J.js → chunk-ERRTQLZ3.js} +1 -1
- package/bundle/{chunk-6SPQYYTY.js → chunk-FFKNXGOH.js} +7 -7
- package/bundle/{chunk-KD6CU4QC.js → chunk-FSFSH7N4.js} +2 -2
- package/bundle/{chunk-67CFYGDY.js → chunk-GSKH763B.js} +136 -124
- package/bundle/{chunk-7YWQ3SVG.js → chunk-GUFPYIHD.js} +1 -1
- package/bundle/{chunk-6SIICAIT.js → chunk-GWB6WHVI.js} +7679 -14212
- package/bundle/{chunk-3UUFOO26.js → chunk-HEBKVYVW.js} +1 -1
- package/bundle/{chunk-FJK747UW.js → chunk-I4UV4KA4.js} +2 -2
- package/bundle/chunk-JNJOXQYJ.js +1571 -0
- package/bundle/{chunk-7XI2YCOG.js → chunk-JQBYCLEO.js} +3 -3
- package/bundle/{chunk-EEM2SQ5I.js → chunk-M54YU4D6.js} +3 -3
- package/bundle/{chunk-DE7SC5BD.js → chunk-NWC2JNOB.js} +9 -8
- package/bundle/chunk-OZYTM77K.js +81736 -0
- package/bundle/chunk-PD2ER6QH.js +394678 -0
- package/bundle/{chunk-TZ4WATK3.js → chunk-RJVA7TEL.js} +1 -1
- package/bundle/{chunk-LICUB7D5.js → chunk-RWG2IKXK.js} +3 -3
- package/bundle/chunk-TMB2KDVR.js +154 -0
- package/bundle/chunk-TRKBNK3S.js +118 -0
- package/bundle/chunk-WEPCSQ47.js +17320 -0
- package/bundle/chunk-ZACXIEK6.js +512 -0
- package/bundle/chunk-ZT5PXPGC.js +398 -0
- package/bundle/{cleanup-3EC3MZGP.js → cleanup-EMSFFQXH.js} +2 -2
- package/bundle/{cleanup-KIJ65UF3.js → cleanup-JUEQXYLN.js} +2 -2
- package/bundle/{cleanup-N4ZABZAB.js → cleanup-OQN4S6N7.js} +2 -2
- package/bundle/cleanup-VI4MGW6W.js +32 -0
- package/bundle/{core-GC6OVM6C.js → core-SBDR7NMV.js} +3 -1
- package/bundle/{devtoolsService-F2IZGJZM.js → devtoolsService-4K4TUJGT.js} +2 -2
- package/bundle/{devtoolsService-6SFXG7FP.js → devtoolsService-6XIZFA3V.js} +4 -3
- package/bundle/devtoolsService-P7V47Y6U.js +856 -0
- package/bundle/{devtoolsService-TKXNBBN5.js → devtoolsService-Q6RR5ONV.js} +2 -2
- package/bundle/{dist-UMJIST56.js → dist-C77MM5UI.js} +3 -1
- package/bundle/{core-BQT7VCTF.js → dist-IZL4IUFR.js} +3 -1
- package/bundle/dist-PNS3BBFZ.js +2150 -0
- package/bundle/{gemini-S2Z7KQKB.js → gemini-22IJYAAK.js} +14 -14
- package/bundle/{gemini-63Q5IT6P.js → gemini-BU4XIO7C.js} +212 -196
- package/bundle/{gemini-K6W6EAMV.js → gemini-EXF7WM5I.js} +14 -14
- package/bundle/gemini-GA3BOQUA.js +16409 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-T5XGOQLO.js → interactiveCli-3XP7ZWTR.js} +8 -8
- package/bundle/{interactiveCli-BRHY6JS4.js → interactiveCli-AYRCP2YE.js} +314 -295
- package/bundle/interactiveCli-IK5ZIGXI.js +34766 -0
- package/bundle/{interactiveCli-QT2IE57X.js → interactiveCli-WP4PF4B4.js} +8 -8
- package/bundle/{liteRtServerManager-IPO45QQA.js → liteRtServerManager-BKMP23GM.js} +4 -4
- package/bundle/{liteRtServerManager-EMP57U7P.js → liteRtServerManager-BRKTTSTY.js} +4 -4
- package/bundle/{liteRtServerManager-W3IV755V.js → liteRtServerManager-EXA5HOJY.js} +4 -4
- package/bundle/liteRtServerManager-NPAIRQRP.js +65 -0
- package/bundle/{oauth2-provider-4K62EY2P.js → oauth2-provider-AOLL6E73.js} +1 -1
- package/bundle/{oauth2-provider-PXSU4K3R.js → oauth2-provider-J7GSQ3D3.js} +38 -72
- package/bundle/oauth2-provider-O3JJBAIN.js +235 -0
- package/bundle/{oauth2-provider-IVDLR4FX.js → oauth2-provider-R3XNUJCY.js} +1 -1
- package/bundle/policies/sandbox-default.toml +7 -0
- package/bundle/{start-FOEHIGOX.js → start-FAIQQIZB.js} +6 -6
- package/bundle/{start-NIPOXJSU.js → start-T37M4GQC.js} +6 -6
- package/bundle/{start-BQ4PN4SK.js → start-UEM457EB.js} +6 -6
- package/bundle/start-VUNII4BV.js +18 -0
- package/package.json +1 -1
|
@@ -156,13 +156,13 @@ import {
|
|
|
156
156
|
widestLineFromStyledChars,
|
|
157
157
|
wordBreakStyledChars,
|
|
158
158
|
wrapStyledChars
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-3P56CQDW.js";
|
|
160
160
|
import {
|
|
161
161
|
appEvents
|
|
162
162
|
} from "./chunk-5PS3AYFU.js";
|
|
163
163
|
import {
|
|
164
164
|
require_source
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-3BHPNRR5.js";
|
|
166
166
|
import {
|
|
167
167
|
ACTIVE_SHELL_MAX_LINES,
|
|
168
168
|
COMPACT_TOOL_SUBVIEW_MAX_LINES,
|
|
@@ -212,33 +212,37 @@ import {
|
|
|
212
212
|
stringWidth,
|
|
213
213
|
stripUnsafeCharacters,
|
|
214
214
|
toCodePoints
|
|
215
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-57QJRHS6.js";
|
|
216
216
|
import {
|
|
217
217
|
handleAutoUpdate,
|
|
218
218
|
isDevelopment,
|
|
219
219
|
relaunchApp,
|
|
220
220
|
setUpdateHandler
|
|
221
|
-
} from "./chunk-
|
|
221
|
+
} from "./chunk-DR6M2CVX.js";
|
|
222
222
|
import {
|
|
223
223
|
isTodoList,
|
|
224
224
|
mapCoreStatusToDisplayStatus,
|
|
225
225
|
require_react
|
|
226
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-GUFPYIHD.js";
|
|
227
227
|
import {
|
|
228
228
|
registerCleanup,
|
|
229
229
|
removeCleanup,
|
|
230
230
|
runExitCleanup,
|
|
231
231
|
setupTtyCheck
|
|
232
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-DV5H7HVO.js";
|
|
233
233
|
import {
|
|
234
234
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
235
235
|
AGENT_TOOL_NAME,
|
|
236
236
|
ApiKeyUpdatedEvent,
|
|
237
|
+
ApprovalMode,
|
|
237
238
|
AsyncFzf,
|
|
238
239
|
AudioRecorder,
|
|
239
240
|
AuthType,
|
|
240
241
|
ChangeAuthRequestedError,
|
|
242
|
+
CompressionStatus,
|
|
241
243
|
ConversationFinishedEvent,
|
|
244
|
+
CoreEvent,
|
|
245
|
+
CoreToolCallStatus,
|
|
242
246
|
CreditPurchaseClickEvent,
|
|
243
247
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
244
248
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
@@ -260,12 +264,19 @@ import {
|
|
|
260
264
|
GEMMA_4_31B_IT_MODEL,
|
|
261
265
|
GLOB_DISPLAY_NAME,
|
|
262
266
|
GREP_DISPLAY_NAME,
|
|
267
|
+
GeminiCliOperation,
|
|
268
|
+
GeminiEventType,
|
|
263
269
|
GitService,
|
|
264
270
|
IdeClient,
|
|
271
|
+
Kind,
|
|
265
272
|
LS_DISPLAY_NAME,
|
|
266
273
|
LegacyAgentProtocol,
|
|
267
274
|
LlmRole,
|
|
268
275
|
Logger,
|
|
276
|
+
MCPDiscoveryState,
|
|
277
|
+
MCPServerStatus,
|
|
278
|
+
MessageBusType,
|
|
279
|
+
MessageSenderType,
|
|
269
280
|
ModelNotFoundError,
|
|
270
281
|
ModelSlashCommandEvent,
|
|
271
282
|
OverageMenuShownEvent,
|
|
@@ -277,20 +288,27 @@ import {
|
|
|
277
288
|
PREVIEW_GEMINI_MODEL,
|
|
278
289
|
PolicyIntegrityManager,
|
|
279
290
|
ProjectIdRequiredError,
|
|
291
|
+
QuestionType,
|
|
280
292
|
READ_FILE_DISPLAY_NAME,
|
|
281
293
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
282
294
|
RELEASE_CHANNEL_STABILITY,
|
|
283
295
|
ROOT_SCHEDULER_ID,
|
|
284
296
|
SHELL_TOOL_NAME,
|
|
285
297
|
Scheduler,
|
|
298
|
+
SessionEndReason,
|
|
299
|
+
SessionStartSource,
|
|
286
300
|
ShellExecutionService,
|
|
287
301
|
SlashCommandStatus,
|
|
288
302
|
Storage,
|
|
303
|
+
SubagentState,
|
|
289
304
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
290
305
|
TOPIC_PARAM_SUMMARY,
|
|
291
306
|
TOPIC_PARAM_TITLE,
|
|
292
307
|
TerminalQuotaError,
|
|
308
|
+
ToolConfirmationOutcome,
|
|
309
|
+
ToolErrorType,
|
|
293
310
|
TranscriptionFactory,
|
|
311
|
+
TrustLevel,
|
|
294
312
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
295
313
|
UPDATE_TOPIC_TOOL_NAME,
|
|
296
314
|
UnauthorizedError,
|
|
@@ -302,6 +320,7 @@ import {
|
|
|
302
320
|
WEB_FETCH_DISPLAY_NAME,
|
|
303
321
|
WEB_SEARCH_DISPLAY_NAME,
|
|
304
322
|
WRITE_FILE_DISPLAY_NAME,
|
|
323
|
+
WarningPriority,
|
|
305
324
|
WhisperModelManager,
|
|
306
325
|
addMCPStatusChangeListener,
|
|
307
326
|
allowEditorTypeInSandbox,
|
|
@@ -411,7 +430,7 @@ import {
|
|
|
411
430
|
validatePlanContent,
|
|
412
431
|
validatePlanPath,
|
|
413
432
|
writeToStdout
|
|
414
|
-
} from "./chunk-
|
|
433
|
+
} from "./chunk-47O5POZQ.js";
|
|
415
434
|
import "./chunk-6HI7VNOG.js";
|
|
416
435
|
import "./chunk-TUDYL3X4.js";
|
|
417
436
|
import "./chunk-IUUIT4SU.js";
|
|
@@ -5037,7 +5056,7 @@ function calculateShellMaxLines(options) {
|
|
|
5037
5056
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
5038
5057
|
return maxLinesBasedOnHeight;
|
|
5039
5058
|
}
|
|
5040
|
-
const isExecuting = status ===
|
|
5059
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
5041
5060
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
5042
5061
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
5043
5062
|
}
|
|
@@ -5071,10 +5090,10 @@ function isShellTool(name) {
|
|
|
5071
5090
|
return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
|
|
5072
5091
|
}
|
|
5073
5092
|
function isThisShellFocusable(name, status, config) {
|
|
5074
|
-
return !!(isShellTool(name) && status ===
|
|
5093
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
|
|
5075
5094
|
}
|
|
5076
5095
|
function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
|
|
5077
|
-
return !!(isShellTool(name) && status ===
|
|
5096
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
|
|
5078
5097
|
}
|
|
5079
5098
|
function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
|
|
5080
5099
|
const [userHasFocused, setUserHasFocused] = (0, import_react9.useState)(false);
|
|
@@ -5234,13 +5253,13 @@ var formatToolArgs = (args) => {
|
|
|
5234
5253
|
var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) => {
|
|
5235
5254
|
let headerText;
|
|
5236
5255
|
let headerColor = theme.text.secondary;
|
|
5237
|
-
if (progress.state ===
|
|
5256
|
+
if (progress.state === SubagentState.CANCELLED) {
|
|
5238
5257
|
headerText = `Subagent ${progress.agentName} was cancelled.`;
|
|
5239
5258
|
headerColor = theme.status.warning;
|
|
5240
|
-
} else if (progress.state ===
|
|
5259
|
+
} else if (progress.state === SubagentState.ERROR) {
|
|
5241
5260
|
headerText = `Subagent ${progress.agentName} failed.`;
|
|
5242
5261
|
headerColor = theme.status.error;
|
|
5243
|
-
} else if (progress.state ===
|
|
5262
|
+
} else if (progress.state === SubagentState.COMPLETED) {
|
|
5244
5263
|
headerText = `Subagent ${progress.agentName} completed.`;
|
|
5245
5264
|
headerColor = theme.status.success;
|
|
5246
5265
|
} else {
|
|
@@ -5260,7 +5279,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5260
5279
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color, children: item.content }) })
|
|
5261
5280
|
] }, item.id);
|
|
5262
5281
|
} else if (item.type === "tool_call") {
|
|
5263
|
-
const statusSymbol = item.status ===
|
|
5282
|
+
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 });
|
|
5264
5283
|
const formattedArgs = item.description || formatToolArgs(item.args);
|
|
5265
5284
|
const displayArgs = formattedArgs.length > 60 ? formattedArgs.slice(0, 60) + "..." : formattedArgs;
|
|
5266
5285
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
@@ -5271,7 +5290,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5271
5290
|
{
|
|
5272
5291
|
bold: true,
|
|
5273
5292
|
color: theme.text.primary,
|
|
5274
|
-
strikethrough: item.status ===
|
|
5293
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5275
5294
|
children: item.displayName || item.content
|
|
5276
5295
|
}
|
|
5277
5296
|
),
|
|
@@ -5280,7 +5299,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5280
5299
|
{
|
|
5281
5300
|
color: theme.text.secondary,
|
|
5282
5301
|
wrap: "truncate",
|
|
5283
|
-
strikethrough: item.status ===
|
|
5302
|
+
strikethrough: item.status === SubagentState.CANCELLED,
|
|
5284
5303
|
children: displayArgs
|
|
5285
5304
|
}
|
|
5286
5305
|
) })
|
|
@@ -5300,7 +5319,7 @@ var SubagentProgressDisplay = ({ progress, terminalWidth, historyOverrides }) =>
|
|
|
5300
5319
|
MarkdownDisplay,
|
|
5301
5320
|
{
|
|
5302
5321
|
text: safeJsonToMarkdown(progress.result),
|
|
5303
|
-
isPending: progress.state !==
|
|
5322
|
+
isPending: progress.state !== SubagentState.COMPLETED,
|
|
5304
5323
|
terminalWidth
|
|
5305
5324
|
}
|
|
5306
5325
|
)
|
|
@@ -5654,14 +5673,14 @@ var ToolActionsProvider = (props) => {
|
|
|
5654
5673
|
}
|
|
5655
5674
|
const details = tool.confirmationDetails;
|
|
5656
5675
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
5657
|
-
const cliOutcome = outcome ===
|
|
5676
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
5658
5677
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
5659
5678
|
}
|
|
5660
5679
|
if (tool.correlationId) {
|
|
5661
5680
|
await config.getMessageBus().publish({
|
|
5662
|
-
type:
|
|
5681
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
5663
5682
|
correlationId: tool.correlationId,
|
|
5664
|
-
confirmed: outcome !==
|
|
5683
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
5665
5684
|
requiresUserConfirmation: false,
|
|
5666
5685
|
outcome,
|
|
5667
5686
|
payload
|
|
@@ -5680,7 +5699,7 @@ var ToolActionsProvider = (props) => {
|
|
|
5680
5699
|
);
|
|
5681
5700
|
const cancel = (0, import_react12.useCallback)(
|
|
5682
5701
|
async (callId) => {
|
|
5683
|
-
await confirm(callId,
|
|
5702
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
5684
5703
|
},
|
|
5685
5704
|
[confirm]
|
|
5686
5705
|
);
|
|
@@ -5799,7 +5818,7 @@ var ToolMessage = ({
|
|
|
5799
5818
|
paddingX: 1,
|
|
5800
5819
|
flexDirection: "column",
|
|
5801
5820
|
children: [
|
|
5802
|
-
status ===
|
|
5821
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5803
5822
|
McpProgressIndicator,
|
|
5804
5823
|
{
|
|
5805
5824
|
progress,
|
|
@@ -5816,8 +5835,8 @@ var ToolMessage = ({
|
|
|
5816
5835
|
terminalWidth,
|
|
5817
5836
|
renderOutputAsMarkdown,
|
|
5818
5837
|
hasFocus: isThisShellFocused2,
|
|
5819
|
-
maxLines: kind ===
|
|
5820
|
-
overflowDirection: kind ===
|
|
5838
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
5839
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
5821
5840
|
}
|
|
5822
5841
|
),
|
|
5823
5842
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -6133,7 +6152,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
|
|
|
6133
6152
|
settings.merged,
|
|
6134
6153
|
process3.cwd()
|
|
6135
6154
|
);
|
|
6136
|
-
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel ===
|
|
6155
|
+
const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
|
|
6137
6156
|
return {
|
|
6138
6157
|
currentTrustLevel: explicitTrustLevel,
|
|
6139
6158
|
isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
|
|
@@ -6178,7 +6197,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
|
|
|
6178
6197
|
process3.cwd(),
|
|
6179
6198
|
newConfig
|
|
6180
6199
|
);
|
|
6181
|
-
if (trustLevel ===
|
|
6200
|
+
if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
|
|
6182
6201
|
let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
|
|
6183
6202
|
if (source === "file") {
|
|
6184
6203
|
message = "Note: This folder is still trusted because a parent folder is trusted.";
|
|
@@ -6252,18 +6271,18 @@ function PermissionsModifyTrustDialog({
|
|
|
6252
6271
|
const TRUST_LEVEL_ITEMS = [
|
|
6253
6272
|
{
|
|
6254
6273
|
label: `Trust this folder (${dirName})`,
|
|
6255
|
-
value:
|
|
6256
|
-
key:
|
|
6274
|
+
value: TrustLevel.TRUST_FOLDER,
|
|
6275
|
+
key: TrustLevel.TRUST_FOLDER
|
|
6257
6276
|
},
|
|
6258
6277
|
{
|
|
6259
6278
|
label: `Trust parent folder (${parentFolder})`,
|
|
6260
|
-
value:
|
|
6261
|
-
key:
|
|
6279
|
+
value: TrustLevel.TRUST_PARENT,
|
|
6280
|
+
key: TrustLevel.TRUST_PARENT
|
|
6262
6281
|
},
|
|
6263
6282
|
{
|
|
6264
6283
|
label: "Don't trust",
|
|
6265
|
-
value:
|
|
6266
|
-
key:
|
|
6284
|
+
value: TrustLevel.DO_NOT_TRUST,
|
|
6285
|
+
key: TrustLevel.DO_NOT_TRUST
|
|
6267
6286
|
}
|
|
6268
6287
|
];
|
|
6269
6288
|
const {
|
|
@@ -6503,7 +6522,7 @@ var ShellToolMessage = ({
|
|
|
6503
6522
|
maxLinesLimit: maxLines
|
|
6504
6523
|
});
|
|
6505
6524
|
import_react17.default.useEffect(() => {
|
|
6506
|
-
const isExecuting = status ===
|
|
6525
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
6507
6526
|
if (isExecuting && ptyId) {
|
|
6508
6527
|
try {
|
|
6509
6528
|
const childWidth = terminalWidth - 4;
|
|
@@ -6716,13 +6735,13 @@ var SubagentGroupDisplay = ({
|
|
|
6716
6735
|
const singleAgent = toolCalls[0].resultDisplay;
|
|
6717
6736
|
if (isSubagentProgress(singleAgent)) {
|
|
6718
6737
|
switch (singleAgent.state) {
|
|
6719
|
-
case
|
|
6738
|
+
case SubagentState.COMPLETED:
|
|
6720
6739
|
headerText = "Agent Completed";
|
|
6721
6740
|
break;
|
|
6722
|
-
case
|
|
6741
|
+
case SubagentState.CANCELLED:
|
|
6723
6742
|
headerText = "Agent Cancelled";
|
|
6724
6743
|
break;
|
|
6725
|
-
case
|
|
6744
|
+
case SubagentState.ERROR:
|
|
6726
6745
|
headerText = "Agent Error";
|
|
6727
6746
|
break;
|
|
6728
6747
|
default:
|
|
@@ -6738,8 +6757,8 @@ var SubagentGroupDisplay = ({
|
|
|
6738
6757
|
for (const tc of toolCalls) {
|
|
6739
6758
|
const progress = tc.resultDisplay;
|
|
6740
6759
|
if (isSubagentProgress(progress)) {
|
|
6741
|
-
if (progress.state ===
|
|
6742
|
-
else if (progress.state ===
|
|
6760
|
+
if (progress.state === SubagentState.COMPLETED) completedCount++;
|
|
6761
|
+
else if (progress.state === SubagentState.RUNNING) runningCount++;
|
|
6743
6762
|
} else {
|
|
6744
6763
|
runningCount++;
|
|
6745
6764
|
}
|
|
@@ -6818,7 +6837,7 @@ var SubagentGroupDisplay = ({
|
|
|
6818
6837
|
if (!isExpanded) {
|
|
6819
6838
|
let content = "Starting...";
|
|
6820
6839
|
let formattedArgs;
|
|
6821
|
-
if (progress.state ===
|
|
6840
|
+
if (progress.state === SubagentState.COMPLETED) {
|
|
6822
6841
|
if (progress.terminateReason && progress.terminateReason !== "GOAL") {
|
|
6823
6842
|
content = `Finished Early (${progress.terminateReason})`;
|
|
6824
6843
|
} else {
|
|
@@ -6832,17 +6851,17 @@ var SubagentGroupDisplay = ({
|
|
|
6832
6851
|
formattedArgs = formatToolArgs(lastActivity.args);
|
|
6833
6852
|
}
|
|
6834
6853
|
}
|
|
6835
|
-
const displayArgs = progress.state ===
|
|
6854
|
+
const displayArgs = progress.state === SubagentState.COMPLETED ? "" : formattedArgs;
|
|
6836
6855
|
const renderStatusIcon = () => {
|
|
6837
|
-
const state = progress.state ??
|
|
6856
|
+
const state = progress.state ?? SubagentState.RUNNING;
|
|
6838
6857
|
switch (state) {
|
|
6839
|
-
case
|
|
6858
|
+
case SubagentState.RUNNING:
|
|
6840
6859
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.text.primary, children: "!" });
|
|
6841
|
-
case
|
|
6860
|
+
case SubagentState.COMPLETED:
|
|
6842
6861
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.success, children: "\u2713" });
|
|
6843
|
-
case
|
|
6862
|
+
case SubagentState.CANCELLED:
|
|
6844
6863
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.warning, children: "\u2139" });
|
|
6845
|
-
case
|
|
6864
|
+
case SubagentState.ERROR:
|
|
6846
6865
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { color: theme.status.error, children: "\u2717" });
|
|
6847
6866
|
default:
|
|
6848
6867
|
return checkExhaustive(state);
|
|
@@ -6895,22 +6914,22 @@ var hasPayload = (res) => {
|
|
|
6895
6914
|
function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
6896
6915
|
const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
|
|
6897
6916
|
const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
|
|
6898
|
-
const isAcceptedOrConfirming = status ===
|
|
6917
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
6899
6918
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
6900
6919
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
6901
6920
|
const showDiffStat = !!diff.diffStat;
|
|
6902
6921
|
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 }) });
|
|
6903
6922
|
let resultSummary = "";
|
|
6904
6923
|
let resultColor = theme.text.secondary;
|
|
6905
|
-
if (status ===
|
|
6924
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
6906
6925
|
resultSummary = "Confirming";
|
|
6907
|
-
} else if (status ===
|
|
6926
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
6908
6927
|
resultSummary = "Accepted";
|
|
6909
6928
|
resultColor = theme.text.accent;
|
|
6910
|
-
} else if (status ===
|
|
6929
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
6911
6930
|
resultSummary = "Rejected";
|
|
6912
6931
|
resultColor = theme.status.error;
|
|
6913
|
-
} else if (status ===
|
|
6932
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
6914
6933
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
6915
6934
|
resultColor = theme.status.error;
|
|
6916
6935
|
}
|
|
@@ -6941,7 +6960,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
|
|
|
6941
6960
|
filename: diff.fileName,
|
|
6942
6961
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
6943
6962
|
availableTerminalHeight,
|
|
6944
|
-
disableColor: status ===
|
|
6963
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
6945
6964
|
}
|
|
6946
6965
|
);
|
|
6947
6966
|
return { description, summary, payload };
|
|
@@ -7069,10 +7088,10 @@ var DenseToolMessage = (props) => {
|
|
|
7069
7088
|
if (isGrepResult(resultDisplay)) {
|
|
7070
7089
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7071
7090
|
}
|
|
7072
|
-
if (status ===
|
|
7091
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
7073
7092
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7074
7093
|
}
|
|
7075
|
-
if (status ===
|
|
7094
|
+
if (status === CoreToolCallStatus.Error) {
|
|
7076
7095
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
7077
7096
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
7078
7097
|
"\u2192 ",
|
|
@@ -7113,7 +7132,7 @@ var DenseToolMessage = (props) => {
|
|
|
7113
7132
|
language: fileExtension,
|
|
7114
7133
|
maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7115
7134
|
settings,
|
|
7116
|
-
disableColor: status ===
|
|
7135
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
7117
7136
|
returnLines: true
|
|
7118
7137
|
});
|
|
7119
7138
|
} else {
|
|
@@ -7121,7 +7140,7 @@ var DenseToolMessage = (props) => {
|
|
|
7121
7140
|
parsedLines,
|
|
7122
7141
|
filename: diff.fileName,
|
|
7123
7142
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7124
|
-
disableColor: status ===
|
|
7143
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
7125
7144
|
});
|
|
7126
7145
|
}
|
|
7127
7146
|
}, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
|
|
@@ -7251,7 +7270,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7251
7270
|
return pendingHistoryItems.some((item) => {
|
|
7252
7271
|
if (item && item.type === "tool_group") {
|
|
7253
7272
|
return item.tools.some(
|
|
7254
|
-
(tool) =>
|
|
7273
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
7255
7274
|
);
|
|
7256
7275
|
}
|
|
7257
7276
|
return false;
|
|
@@ -7260,7 +7279,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7260
7279
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
7261
7280
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
7262
7281
|
(item) => item.tools.some(
|
|
7263
|
-
(tool) =>
|
|
7282
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
7264
7283
|
)
|
|
7265
7284
|
);
|
|
7266
7285
|
}
|
|
@@ -7283,14 +7302,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
|
|
|
7283
7302
|
if (isTrackedToolCall(t)) {
|
|
7284
7303
|
return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
|
|
7285
7304
|
} else {
|
|
7286
|
-
return t.status !==
|
|
7305
|
+
return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
|
|
7287
7306
|
}
|
|
7288
7307
|
});
|
|
7289
7308
|
const isEmbeddedShellFocused = toolsToInspect.some((t) => {
|
|
7290
7309
|
if (isTrackedToolCall(t)) {
|
|
7291
7310
|
return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
|
|
7292
7311
|
} else {
|
|
7293
|
-
return isShellTool(t.name) && t.status ===
|
|
7312
|
+
return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
|
|
7294
7313
|
}
|
|
7295
7314
|
});
|
|
7296
7315
|
const isShellCommand = toolsToInspect.some((t) => {
|
|
@@ -7389,7 +7408,7 @@ var ToolGroupMessage = ({
|
|
|
7389
7408
|
const groupedTools = (0, import_react21.useMemo)(() => {
|
|
7390
7409
|
const groups = [];
|
|
7391
7410
|
for (const tool of visibleToolCalls) {
|
|
7392
|
-
if (tool.kind ===
|
|
7411
|
+
if (tool.kind === Kind.Agent) {
|
|
7393
7412
|
const lastGroup = groups[groups.length - 1];
|
|
7394
7413
|
if (Array.isArray(lastGroup)) {
|
|
7395
7414
|
lastGroup.push(tool);
|
|
@@ -7444,7 +7463,7 @@ var ToolGroupMessage = ({
|
|
|
7444
7463
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
7445
7464
|
let countToolCallsWithResults = 0;
|
|
7446
7465
|
for (const tool of visibleToolCalls) {
|
|
7447
|
-
if (tool.kind !==
|
|
7466
|
+
if (tool.kind !== Kind.Agent) {
|
|
7448
7467
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
7449
7468
|
if (hasDensePayload(tool)) {
|
|
7450
7469
|
countToolCallsWithResults++;
|
|
@@ -7618,7 +7637,7 @@ var ToolGroupDisplay = ({
|
|
|
7618
7637
|
}
|
|
7619
7638
|
const { tools, borderColor, borderDimColor, borderTop, borderBottom } = item;
|
|
7620
7639
|
const visibleTools = tools.filter(
|
|
7621
|
-
(t) => t.status !==
|
|
7640
|
+
(t) => t.status !== CoreToolCallStatus.AwaitingApproval
|
|
7622
7641
|
);
|
|
7623
7642
|
const noticeTools = visibleTools.filter((t) => t.format === "notice");
|
|
7624
7643
|
const otherTools = visibleTools.filter(
|
|
@@ -7820,18 +7839,18 @@ function CompressionMessage({
|
|
|
7820
7839
|
return "Compressing chat history";
|
|
7821
7840
|
}
|
|
7822
7841
|
switch (compressionStatus) {
|
|
7823
|
-
case
|
|
7842
|
+
case CompressionStatus.COMPRESSED:
|
|
7824
7843
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
7825
|
-
case
|
|
7844
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
7826
7845
|
if (originalTokens < 5e4) {
|
|
7827
7846
|
return "Compression was not beneficial for this history size.";
|
|
7828
7847
|
}
|
|
7829
7848
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
7830
|
-
case
|
|
7849
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
7831
7850
|
return "Could not compress chat history due to a token counting error.";
|
|
7832
|
-
case
|
|
7851
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
7833
7852
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
7834
|
-
case
|
|
7853
|
+
case CompressionStatus.NOOP:
|
|
7835
7854
|
return "Nothing to compress.";
|
|
7836
7855
|
default:
|
|
7837
7856
|
return "";
|
|
@@ -8257,8 +8276,8 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8257
8276
|
);
|
|
8258
8277
|
roleEntries.sort(([a], [b]) => {
|
|
8259
8278
|
if (a === b) return 0;
|
|
8260
|
-
if (a ===
|
|
8261
|
-
if (b ===
|
|
8279
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8280
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8262
8281
|
return a.localeCompare(b);
|
|
8263
8282
|
});
|
|
8264
8283
|
roleEntries.forEach(([role, roleMetrics]) => {
|
|
@@ -8589,8 +8608,8 @@ var ModelStatsDisplay = ({
|
|
|
8589
8608
|
return validRoles.includes(role);
|
|
8590
8609
|
}).sort((a, b) => {
|
|
8591
8610
|
if (a === b) return 0;
|
|
8592
|
-
if (a ===
|
|
8593
|
-
if (b ===
|
|
8611
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8612
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8594
8613
|
return a.localeCompare(b);
|
|
8595
8614
|
});
|
|
8596
8615
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -9381,7 +9400,7 @@ var McpStatus = ({
|
|
|
9381
9400
|
);
|
|
9382
9401
|
const originalStatus = serverStatus(serverName);
|
|
9383
9402
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
9384
|
-
const status = originalStatus ===
|
|
9403
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
9385
9404
|
let statusIndicator = "";
|
|
9386
9405
|
let statusText = "";
|
|
9387
9406
|
let statusColor = theme.text.primary;
|
|
@@ -9393,17 +9412,17 @@ var McpStatus = ({
|
|
|
9393
9412
|
statusColor = theme.text.secondary;
|
|
9394
9413
|
} else {
|
|
9395
9414
|
switch (status) {
|
|
9396
|
-
case
|
|
9415
|
+
case MCPServerStatus.CONNECTED:
|
|
9397
9416
|
statusIndicator = "\u{1F7E2}";
|
|
9398
9417
|
statusText = "Ready";
|
|
9399
9418
|
statusColor = theme.status.success;
|
|
9400
9419
|
break;
|
|
9401
|
-
case
|
|
9420
|
+
case MCPServerStatus.CONNECTING:
|
|
9402
9421
|
statusIndicator = "\u{1F504}";
|
|
9403
9422
|
statusText = "Starting... (first startup may take longer)";
|
|
9404
9423
|
statusColor = theme.status.warning;
|
|
9405
9424
|
break;
|
|
9406
|
-
case
|
|
9425
|
+
case MCPServerStatus.DISCONNECTED:
|
|
9407
9426
|
default:
|
|
9408
9427
|
statusIndicator = "\u{1F534}";
|
|
9409
9428
|
statusText = "Disconnected";
|
|
@@ -9451,12 +9470,12 @@ var McpStatus = ({
|
|
|
9451
9470
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9452
9471
|
" - ",
|
|
9453
9472
|
statusText,
|
|
9454
|
-
status ===
|
|
9473
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
9455
9474
|
] }),
|
|
9456
9475
|
authStatusNode
|
|
9457
9476
|
] }),
|
|
9458
|
-
status ===
|
|
9459
|
-
status ===
|
|
9477
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
9478
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
|
|
9460
9479
|
" (",
|
|
9461
9480
|
toolCount,
|
|
9462
9481
|
" tools cached)"
|
|
@@ -10017,7 +10036,7 @@ var Notifications = () => {
|
|
|
10017
10036
|
if (dismissed) return [];
|
|
10018
10037
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
10019
10038
|
return startupWarnings.filter((w) => {
|
|
10020
|
-
if (w.priority ===
|
|
10039
|
+
if (w.priority === WarningPriority.Low) {
|
|
10021
10040
|
const count = counts[w.id] || 0;
|
|
10022
10041
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
10023
10042
|
}
|
|
@@ -10030,7 +10049,7 @@ var Notifications = () => {
|
|
|
10030
10049
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
10031
10050
|
let changed = false;
|
|
10032
10051
|
visibleWarnings.forEach((w) => {
|
|
10033
|
-
if (w.priority ===
|
|
10052
|
+
if (w.priority === WarningPriority.Low) {
|
|
10034
10053
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
10035
10054
|
changed = true;
|
|
10036
10055
|
}
|
|
@@ -10137,7 +10156,7 @@ var UserIdentity = ({ config }) => {
|
|
|
10137
10156
|
}
|
|
10138
10157
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
10139
10158
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Box_default, { children: [
|
|
10140
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
10159
|
+
/* @__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: [
|
|
10141
10160
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Text, { bold: true, children: [
|
|
10142
10161
|
"Signed in with Google",
|
|
10143
10162
|
email ? ":" : ""
|
|
@@ -10380,7 +10399,7 @@ var import_react32 = __toESM(require_react(), 1);
|
|
|
10380
10399
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
10381
10400
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
10382
10401
|
const confirmingTools = allPendingTools.filter(
|
|
10383
|
-
(tool) => tool.status ===
|
|
10402
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
10384
10403
|
);
|
|
10385
10404
|
if (confirmingTools.length === 0) {
|
|
10386
10405
|
return null;
|
|
@@ -11688,7 +11707,7 @@ var ExitPlanModeDialog = ({
|
|
|
11688
11707
|
{
|
|
11689
11708
|
questions: [
|
|
11690
11709
|
{
|
|
11691
|
-
type:
|
|
11710
|
+
type: QuestionType.CHOICE,
|
|
11692
11711
|
header: "Approval",
|
|
11693
11712
|
question: planContent,
|
|
11694
11713
|
options: [
|
|
@@ -11709,9 +11728,9 @@ var ExitPlanModeDialog = ({
|
|
|
11709
11728
|
onSubmit: (answers) => {
|
|
11710
11729
|
const answer = answers["0"];
|
|
11711
11730
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
11712
|
-
onApprove(
|
|
11731
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
11713
11732
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
11714
|
-
onApprove(
|
|
11733
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
11715
11734
|
} else if (answer) {
|
|
11716
11735
|
onFeedback(answer);
|
|
11717
11736
|
}
|
|
@@ -11922,7 +11941,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
11922
11941
|
);
|
|
11923
11942
|
(0, import_react37.useEffect)(() => {
|
|
11924
11943
|
if (isCancelling) {
|
|
11925
|
-
handleConfirm(
|
|
11944
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
11926
11945
|
}
|
|
11927
11946
|
}, [isCancelling, handleConfirm]);
|
|
11928
11947
|
const handleSelect = (0, import_react37.useCallback)(
|
|
@@ -11935,19 +11954,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
11935
11954
|
if (!confirmationDetails.isModifying) {
|
|
11936
11955
|
options2.push({
|
|
11937
11956
|
label: "Allow once",
|
|
11938
|
-
value:
|
|
11957
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11939
11958
|
key: "Allow once"
|
|
11940
11959
|
});
|
|
11941
11960
|
if (isTrustedFolder) {
|
|
11942
11961
|
options2.push({
|
|
11943
11962
|
label: "Allow for this session",
|
|
11944
|
-
value:
|
|
11963
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11945
11964
|
key: "Allow for this session"
|
|
11946
11965
|
});
|
|
11947
11966
|
if (allowPermanentApproval) {
|
|
11948
11967
|
options2.push({
|
|
11949
11968
|
label: "Allow for this file in all future sessions",
|
|
11950
|
-
value:
|
|
11969
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11951
11970
|
key: "Allow for this file in all future sessions"
|
|
11952
11971
|
});
|
|
11953
11972
|
}
|
|
@@ -11955,119 +11974,119 @@ ${deceptiveUrlWarnings.map(
|
|
|
11955
11974
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
11956
11975
|
options2.push({
|
|
11957
11976
|
label: "Modify with external editor",
|
|
11958
|
-
value:
|
|
11977
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
11959
11978
|
key: "Modify with external editor"
|
|
11960
11979
|
});
|
|
11961
11980
|
}
|
|
11962
11981
|
options2.push({
|
|
11963
11982
|
label: "No, suggest changes (esc)",
|
|
11964
|
-
value:
|
|
11983
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11965
11984
|
key: "No, suggest changes (esc)"
|
|
11966
11985
|
});
|
|
11967
11986
|
}
|
|
11968
11987
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
11969
11988
|
options2.push({
|
|
11970
11989
|
label: "Allow once",
|
|
11971
|
-
value:
|
|
11990
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11972
11991
|
key: "Allow once"
|
|
11973
11992
|
});
|
|
11974
11993
|
if (isTrustedFolder) {
|
|
11975
11994
|
options2.push({
|
|
11976
11995
|
label: "Allow for this session",
|
|
11977
|
-
value:
|
|
11996
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
11978
11997
|
key: "Allow for this session"
|
|
11979
11998
|
});
|
|
11980
11999
|
if (allowPermanentApproval) {
|
|
11981
12000
|
options2.push({
|
|
11982
12001
|
label: "Allow for all future sessions",
|
|
11983
|
-
value:
|
|
12002
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
11984
12003
|
key: "Allow for all future sessions"
|
|
11985
12004
|
});
|
|
11986
12005
|
}
|
|
11987
12006
|
}
|
|
11988
12007
|
options2.push({
|
|
11989
12008
|
label: "No, suggest changes (esc)",
|
|
11990
|
-
value:
|
|
12009
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
11991
12010
|
key: "No, suggest changes (esc)"
|
|
11992
12011
|
});
|
|
11993
12012
|
} else if (confirmationDetails.type === "exec") {
|
|
11994
12013
|
options2.push({
|
|
11995
12014
|
label: "Allow once",
|
|
11996
|
-
value:
|
|
12015
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
11997
12016
|
key: "Allow once"
|
|
11998
12017
|
});
|
|
11999
12018
|
if (isTrustedFolder) {
|
|
12000
12019
|
options2.push({
|
|
12001
12020
|
label: `Allow for this session`,
|
|
12002
|
-
value:
|
|
12021
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12003
12022
|
key: `Allow for this session`
|
|
12004
12023
|
});
|
|
12005
12024
|
if (allowPermanentApproval) {
|
|
12006
12025
|
options2.push({
|
|
12007
12026
|
label: `Allow this command for all future sessions`,
|
|
12008
|
-
value:
|
|
12027
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12009
12028
|
key: `Allow for all future sessions`
|
|
12010
12029
|
});
|
|
12011
12030
|
}
|
|
12012
12031
|
}
|
|
12013
12032
|
options2.push({
|
|
12014
12033
|
label: "No, suggest changes (esc)",
|
|
12015
|
-
value:
|
|
12034
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12016
12035
|
key: "No, suggest changes (esc)"
|
|
12017
12036
|
});
|
|
12018
12037
|
} else if (confirmationDetails.type === "info") {
|
|
12019
12038
|
options2.push({
|
|
12020
12039
|
label: "Allow once",
|
|
12021
|
-
value:
|
|
12040
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12022
12041
|
key: "Allow once"
|
|
12023
12042
|
});
|
|
12024
12043
|
if (isTrustedFolder) {
|
|
12025
12044
|
options2.push({
|
|
12026
12045
|
label: "Allow for this session",
|
|
12027
|
-
value:
|
|
12046
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12028
12047
|
key: "Allow for this session"
|
|
12029
12048
|
});
|
|
12030
12049
|
if (allowPermanentApproval) {
|
|
12031
12050
|
options2.push({
|
|
12032
12051
|
label: "Allow for all future sessions",
|
|
12033
|
-
value:
|
|
12052
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12034
12053
|
key: "Allow for all future sessions"
|
|
12035
12054
|
});
|
|
12036
12055
|
}
|
|
12037
12056
|
}
|
|
12038
12057
|
options2.push({
|
|
12039
12058
|
label: "No, suggest changes (esc)",
|
|
12040
|
-
value:
|
|
12059
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12041
12060
|
key: "No, suggest changes (esc)"
|
|
12042
12061
|
});
|
|
12043
12062
|
} else if (confirmationDetails.type === "mcp") {
|
|
12044
12063
|
options2.push({
|
|
12045
12064
|
label: "Allow once",
|
|
12046
|
-
value:
|
|
12065
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12047
12066
|
key: "Allow once"
|
|
12048
12067
|
});
|
|
12049
12068
|
if (isTrustedFolder) {
|
|
12050
12069
|
options2.push({
|
|
12051
12070
|
label: "Allow tool for this session",
|
|
12052
|
-
value:
|
|
12071
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
12053
12072
|
key: "Allow tool for this session"
|
|
12054
12073
|
});
|
|
12055
12074
|
options2.push({
|
|
12056
12075
|
label: "Allow all server tools for this session",
|
|
12057
|
-
value:
|
|
12076
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
12058
12077
|
key: "Allow all server tools for this session"
|
|
12059
12078
|
});
|
|
12060
12079
|
if (allowPermanentApproval) {
|
|
12061
12080
|
options2.push({
|
|
12062
12081
|
label: "Allow tool for all future sessions",
|
|
12063
|
-
value:
|
|
12082
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12064
12083
|
key: "Allow tool for all future sessions"
|
|
12065
12084
|
});
|
|
12066
12085
|
}
|
|
12067
12086
|
}
|
|
12068
12087
|
options2.push({
|
|
12069
12088
|
label: "No, suggest changes (esc)",
|
|
12070
|
-
value:
|
|
12089
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12071
12090
|
key: "No, suggest changes (esc)"
|
|
12072
12091
|
});
|
|
12073
12092
|
}
|
|
@@ -12106,7 +12125,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12106
12125
|
const containsRedirection = commandsToDisplay.some(
|
|
12107
12126
|
(cmd) => hasRedirection(cmd)
|
|
12108
12127
|
);
|
|
12109
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12128
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12110
12129
|
if (containsRedirection && !isAutoEdit) {
|
|
12111
12130
|
extraInfoLines = 1;
|
|
12112
12131
|
}
|
|
@@ -12132,7 +12151,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12132
12151
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
12133
12152
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
12134
12153
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
12135
|
-
(o) => o.value ===
|
|
12154
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
12136
12155
|
);
|
|
12137
12156
|
if (alwaysAndSaveIndex !== -1) {
|
|
12138
12157
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -12149,10 +12168,10 @@ ${deceptiveUrlWarnings.map(
|
|
|
12149
12168
|
{
|
|
12150
12169
|
questions: confirmationDetails.questions,
|
|
12151
12170
|
onSubmit: (answers) => {
|
|
12152
|
-
handleConfirm(
|
|
12171
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
12153
12172
|
},
|
|
12154
12173
|
onCancel: () => {
|
|
12155
|
-
handleConfirm(
|
|
12174
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12156
12175
|
},
|
|
12157
12176
|
width: terminalWidth,
|
|
12158
12177
|
availableHeight: bodyHeight
|
|
@@ -12173,19 +12192,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
12173
12192
|
planPath: confirmationDetails.planPath,
|
|
12174
12193
|
getPreferredEditor,
|
|
12175
12194
|
onApprove: (approvalMode) => {
|
|
12176
|
-
handleConfirm(
|
|
12195
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12177
12196
|
approved: true,
|
|
12178
12197
|
approvalMode
|
|
12179
12198
|
});
|
|
12180
12199
|
},
|
|
12181
12200
|
onFeedback: (feedback) => {
|
|
12182
|
-
handleConfirm(
|
|
12201
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12183
12202
|
approved: false,
|
|
12184
12203
|
feedback
|
|
12185
12204
|
});
|
|
12186
12205
|
},
|
|
12187
12206
|
onCancel: () => {
|
|
12188
|
-
handleConfirm(
|
|
12207
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12189
12208
|
},
|
|
12190
12209
|
width: terminalWidth,
|
|
12191
12210
|
availableHeight: bodyHeight
|
|
@@ -12294,7 +12313,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12294
12313
|
const containsRedirection = commandsToDisplay.some(
|
|
12295
12314
|
(cmd) => hasRedirection(cmd)
|
|
12296
12315
|
);
|
|
12297
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12316
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12298
12317
|
let warnings = null;
|
|
12299
12318
|
if (containsRedirection && !isAutoEdit) {
|
|
12300
12319
|
const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
|
|
@@ -12453,7 +12472,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12453
12472
|
const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
|
|
12454
12473
|
const renderRadioItem = (0, import_react37.useCallback)(
|
|
12455
12474
|
(item, { titleColor }) => {
|
|
12456
|
-
if (item.value ===
|
|
12475
|
+
if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
12457
12476
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
|
|
12458
12477
|
item.label,
|
|
12459
12478
|
" ",
|
|
@@ -14483,7 +14502,7 @@ async function validateAuthMethodWithSettings(authType, settings) {
|
|
|
14483
14502
|
if (settings.merged.security.auth.useExternal) {
|
|
14484
14503
|
return null;
|
|
14485
14504
|
}
|
|
14486
|
-
if (authType ===
|
|
14505
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14487
14506
|
return null;
|
|
14488
14507
|
}
|
|
14489
14508
|
return validateAuthMethod(authType);
|
|
@@ -14535,7 +14554,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
14535
14554
|
}
|
|
14536
14555
|
return;
|
|
14537
14556
|
}
|
|
14538
|
-
if (authType ===
|
|
14557
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14539
14558
|
const key = await reloadApiKey();
|
|
14540
14559
|
if (!key) {
|
|
14541
14560
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -14613,31 +14632,31 @@ function AuthDialog({
|
|
|
14613
14632
|
let items = [
|
|
14614
14633
|
{
|
|
14615
14634
|
label: "Sign in with Google",
|
|
14616
|
-
value:
|
|
14617
|
-
key:
|
|
14635
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
14636
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
14618
14637
|
},
|
|
14619
14638
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
14620
14639
|
{
|
|
14621
14640
|
label: "Use Cloud Shell user credentials",
|
|
14622
|
-
value:
|
|
14623
|
-
key:
|
|
14641
|
+
value: AuthType.COMPUTE_ADC,
|
|
14642
|
+
key: AuthType.COMPUTE_ADC
|
|
14624
14643
|
}
|
|
14625
14644
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
14626
14645
|
{
|
|
14627
14646
|
label: "Use metadata server application default credentials",
|
|
14628
|
-
value:
|
|
14629
|
-
key:
|
|
14647
|
+
value: AuthType.COMPUTE_ADC,
|
|
14648
|
+
key: AuthType.COMPUTE_ADC
|
|
14630
14649
|
}
|
|
14631
14650
|
] : [],
|
|
14632
14651
|
{
|
|
14633
14652
|
label: "Use Gemini API Key",
|
|
14634
|
-
value:
|
|
14635
|
-
key:
|
|
14653
|
+
value: AuthType.USE_GEMINI,
|
|
14654
|
+
key: AuthType.USE_GEMINI
|
|
14636
14655
|
},
|
|
14637
14656
|
{
|
|
14638
14657
|
label: "Vertex AI",
|
|
14639
|
-
value:
|
|
14640
|
-
key:
|
|
14658
|
+
value: AuthType.USE_VERTEX_AI,
|
|
14659
|
+
key: AuthType.USE_VERTEX_AI
|
|
14641
14660
|
}
|
|
14642
14661
|
];
|
|
14643
14662
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -14659,9 +14678,9 @@ function AuthDialog({
|
|
|
14659
14678
|
return item.value === defaultAuthType;
|
|
14660
14679
|
}
|
|
14661
14680
|
if (process.env["GEMINI_API_KEY"]) {
|
|
14662
|
-
return item.value ===
|
|
14681
|
+
return item.value === AuthType.USE_GEMINI;
|
|
14663
14682
|
}
|
|
14664
|
-
return item.value ===
|
|
14683
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
14665
14684
|
});
|
|
14666
14685
|
if (settings.merged.security.auth.enforcedType) {
|
|
14667
14686
|
initialAuthIndex = 0;
|
|
@@ -14672,7 +14691,7 @@ function AuthDialog({
|
|
|
14672
14691
|
return;
|
|
14673
14692
|
}
|
|
14674
14693
|
if (authType) {
|
|
14675
|
-
const needsRestart = authType ===
|
|
14694
|
+
const needsRestart = authType === AuthType.LOGIN_WITH_GOOGLE || authType === AuthType.USE_VERTEX_AI && process.env["CLOUD_SHELL"] === "true";
|
|
14676
14695
|
if (needsRestart) {
|
|
14677
14696
|
setAuthContext({ requiresRestart: true });
|
|
14678
14697
|
} else {
|
|
@@ -14680,12 +14699,12 @@ function AuthDialog({
|
|
|
14680
14699
|
}
|
|
14681
14700
|
await clearCachedCredentialFile();
|
|
14682
14701
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
14683
|
-
if (authType ===
|
|
14702
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
14684
14703
|
setExiting(true);
|
|
14685
14704
|
setTimeout(relaunchApp, 100);
|
|
14686
14705
|
return;
|
|
14687
14706
|
}
|
|
14688
|
-
if (authType ===
|
|
14707
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
14689
14708
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
14690
14709
|
return;
|
|
14691
14710
|
}
|
|
@@ -15441,11 +15460,11 @@ var PrivacyNoticeText = ({
|
|
|
15441
15460
|
}) => {
|
|
15442
15461
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15443
15462
|
switch (authType) {
|
|
15444
|
-
case
|
|
15463
|
+
case AuthType.USE_GEMINI:
|
|
15445
15464
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15446
|
-
case
|
|
15465
|
+
case AuthType.USE_VERTEX_AI:
|
|
15447
15466
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15448
|
-
case
|
|
15467
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15449
15468
|
default:
|
|
15450
15469
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15451
15470
|
}
|
|
@@ -15486,7 +15505,7 @@ function ProQuotaDialog({
|
|
|
15486
15505
|
value: "retry_always",
|
|
15487
15506
|
key: "retry_always"
|
|
15488
15507
|
},
|
|
15489
|
-
...authType ===
|
|
15508
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
15490
15509
|
{
|
|
15491
15510
|
label: "Upgrade for higher limits",
|
|
15492
15511
|
value: "upgrade",
|
|
@@ -16645,7 +16664,7 @@ function ModelDialog({ onClose }) {
|
|
|
16645
16664
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
16646
16665
|
const useGemini3_5Flash = config?.hasGemini35FlashGAAccess?.() ?? false;
|
|
16647
16666
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
16648
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
16667
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
16649
16668
|
const manualModelSelected = (0, import_react55.useMemo)(() => {
|
|
16650
16669
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
16651
16670
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -17968,10 +17987,10 @@ function initializeConsoleStore() {
|
|
|
17968
17987
|
globalConsoleMessages = [];
|
|
17969
17988
|
globalErrorCount = 0;
|
|
17970
17989
|
notifyListeners();
|
|
17971
|
-
coreEvents.off(
|
|
17972
|
-
coreEvents.off(
|
|
17973
|
-
coreEvents.on(
|
|
17974
|
-
coreEvents.on(
|
|
17990
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
17991
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
17992
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
17993
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
17975
17994
|
}
|
|
17976
17995
|
function notifyListeners() {
|
|
17977
17996
|
for (const listener of listeners) {
|
|
@@ -20108,7 +20127,7 @@ function usePromptCompletion({
|
|
|
20108
20127
|
{ model: "prompt-completion" },
|
|
20109
20128
|
contents,
|
|
20110
20129
|
signal,
|
|
20111
|
-
|
|
20130
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20112
20131
|
);
|
|
20113
20132
|
if (signal.aborted) {
|
|
20114
20133
|
return;
|
|
@@ -22186,9 +22205,9 @@ var InputPrompt = ({
|
|
|
22186
22205
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22187
22206
|
}
|
|
22188
22207
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22189
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22190
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22191
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22208
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22209
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22210
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22192
22211
|
let statusColor;
|
|
22193
22212
|
let statusText = "";
|
|
22194
22213
|
if (shellModeActive) {
|
|
@@ -23021,22 +23040,22 @@ var ApprovalModeIndicator = ({
|
|
|
23021
23040
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
23022
23041
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
23023
23042
|
switch (approvalMode) {
|
|
23024
|
-
case
|
|
23043
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23025
23044
|
textColor = theme.status.warning;
|
|
23026
23045
|
textContent = "auto-accept edits";
|
|
23027
23046
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
23028
23047
|
break;
|
|
23029
|
-
case
|
|
23048
|
+
case ApprovalMode.PLAN:
|
|
23030
23049
|
textColor = theme.status.success;
|
|
23031
23050
|
textContent = "plan";
|
|
23032
23051
|
subText = `${cycleHint} to manual`;
|
|
23033
23052
|
break;
|
|
23034
|
-
case
|
|
23053
|
+
case ApprovalMode.YOLO:
|
|
23035
23054
|
textColor = theme.status.error;
|
|
23036
23055
|
textContent = "YOLO";
|
|
23037
23056
|
subText = yoloHint;
|
|
23038
23057
|
break;
|
|
23039
|
-
case
|
|
23058
|
+
case ApprovalMode.DEFAULT:
|
|
23040
23059
|
default:
|
|
23041
23060
|
textColor = theme.text.accent;
|
|
23042
23061
|
textContent = "";
|
|
@@ -23084,7 +23103,7 @@ var useComposerStatus = () => {
|
|
|
23084
23103
|
(item) => item.type === "tool_group"
|
|
23085
23104
|
).some(
|
|
23086
23105
|
(item) => item.tools.some(
|
|
23087
|
-
(tool) => tool.status ===
|
|
23106
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
23088
23107
|
)
|
|
23089
23108
|
),
|
|
23090
23109
|
[uiState.pendingHistoryItems]
|
|
@@ -23099,13 +23118,13 @@ var useComposerStatus = () => {
|
|
|
23099
23118
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23100
23119
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23101
23120
|
switch (showApprovalModeIndicator) {
|
|
23102
|
-
case
|
|
23121
|
+
case ApprovalMode.YOLO:
|
|
23103
23122
|
return { text: "YOLO", color: theme.status.error };
|
|
23104
|
-
case
|
|
23123
|
+
case ApprovalMode.PLAN:
|
|
23105
23124
|
return { text: "plan", color: theme.status.success };
|
|
23106
|
-
case
|
|
23125
|
+
case ApprovalMode.AUTO_EDIT:
|
|
23107
23126
|
return { text: "auto edit", color: theme.status.warning };
|
|
23108
|
-
case
|
|
23127
|
+
case ApprovalMode.DEFAULT:
|
|
23109
23128
|
default:
|
|
23110
23129
|
return null;
|
|
23111
23130
|
}
|
|
@@ -23459,7 +23478,7 @@ var ConfigInitDisplay = ({
|
|
|
23459
23478
|
let connected = 0;
|
|
23460
23479
|
const connecting = [];
|
|
23461
23480
|
for (const [name, client] of clients.entries()) {
|
|
23462
|
-
if (client.getStatus() ===
|
|
23481
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23463
23482
|
connected++;
|
|
23464
23483
|
} else {
|
|
23465
23484
|
connecting.push(name);
|
|
@@ -23481,9 +23500,9 @@ var ConfigInitDisplay = ({
|
|
|
23481
23500
|
);
|
|
23482
23501
|
}
|
|
23483
23502
|
};
|
|
23484
|
-
coreEvents.on(
|
|
23503
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23485
23504
|
return () => {
|
|
23486
|
-
coreEvents.off(
|
|
23505
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23487
23506
|
};
|
|
23488
23507
|
}, [initialMessage]);
|
|
23489
23508
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Text, { children: [
|
|
@@ -24200,7 +24219,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24200
24219
|
callId,
|
|
24201
24220
|
name: SHELL_COMMAND_NAME,
|
|
24202
24221
|
description: rawQuery,
|
|
24203
|
-
status:
|
|
24222
|
+
status: CoreToolCallStatus.Executing,
|
|
24204
24223
|
isClientInitiated: true,
|
|
24205
24224
|
resultDisplay: "",
|
|
24206
24225
|
confirmationDetails: void 0
|
|
@@ -24341,7 +24360,7 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24341
24360
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24342
24361
|
}
|
|
24343
24362
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24344
|
-
let finalStatus =
|
|
24363
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24345
24364
|
const prependToAnsiOutput = (output, text) => {
|
|
24346
24365
|
const newLines = text.split("\n").map((line) => [
|
|
24347
24366
|
{
|
|
@@ -24360,20 +24379,20 @@ __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
|
|
24360
24379
|
};
|
|
24361
24380
|
let prefix = "";
|
|
24362
24381
|
if (result.error) {
|
|
24363
|
-
finalStatus =
|
|
24382
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24364
24383
|
prefix = result.error.message;
|
|
24365
24384
|
} else if (result.aborted) {
|
|
24366
|
-
finalStatus =
|
|
24385
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24367
24386
|
prefix = "Command was cancelled.";
|
|
24368
24387
|
} else if (result.backgrounded) {
|
|
24369
|
-
finalStatus =
|
|
24388
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24370
24389
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24371
24390
|
mainContent = finalOutput;
|
|
24372
24391
|
} else if (result.signal) {
|
|
24373
|
-
finalStatus =
|
|
24392
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24374
24393
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24375
24394
|
} else if (result.exitCode !== 0) {
|
|
24376
|
-
finalStatus =
|
|
24395
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24377
24396
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24378
24397
|
}
|
|
24379
24398
|
if (prefix) {
|
|
@@ -24399,7 +24418,7 @@ ${mainContent}`;
|
|
|
24399
24418
|
status: finalStatus,
|
|
24400
24419
|
resultDisplay: finalOutput
|
|
24401
24420
|
};
|
|
24402
|
-
if (finalStatus !==
|
|
24421
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24403
24422
|
addItemToHistory(
|
|
24404
24423
|
{
|
|
24405
24424
|
type: "tool_group",
|
|
@@ -25389,7 +25408,7 @@ function useQuotaAndFallback({
|
|
|
25389
25408
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25390
25409
|
`/stats model for usage details`,
|
|
25391
25410
|
`/model to switch models.`,
|
|
25392
|
-
contentGeneratorConfig?.authType ===
|
|
25411
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25393
25412
|
].filter(Boolean);
|
|
25394
25413
|
message = messageLines.join("\n");
|
|
25395
25414
|
} else if (error instanceof ModelNotFoundError) {
|
|
@@ -25577,7 +25596,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25577
25596
|
);
|
|
25578
25597
|
setEditorError(null);
|
|
25579
25598
|
setIsEditorDialogOpen(false);
|
|
25580
|
-
coreEvents.emit(
|
|
25599
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25581
25600
|
} catch (error) {
|
|
25582
25601
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25583
25602
|
}
|
|
@@ -25586,7 +25605,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25586
25605
|
);
|
|
25587
25606
|
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25588
25607
|
setIsEditorDialogOpen(false);
|
|
25589
|
-
coreEvents.emit(
|
|
25608
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25590
25609
|
}, []);
|
|
25591
25610
|
return {
|
|
25592
25611
|
isEditorDialogOpen,
|
|
@@ -25963,7 +25982,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25963
25982
|
canonicalPath: resolvedCommandPath
|
|
25964
25983
|
} = parseSlashCommand(trimmed, commands);
|
|
25965
25984
|
if (!commandToExecute) {
|
|
25966
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
25985
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
25967
25986
|
if (isMcpLoading) {
|
|
25968
25987
|
setIsProcessing(true);
|
|
25969
25988
|
if (addToHistory) {
|
|
@@ -26143,7 +26162,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26143
26162
|
onConfirm: async (resolvedOutcome) => {
|
|
26144
26163
|
resolve3({
|
|
26145
26164
|
outcome: resolvedOutcome,
|
|
26146
|
-
approvedCommands: resolvedOutcome ===
|
|
26165
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
26147
26166
|
});
|
|
26148
26167
|
}
|
|
26149
26168
|
};
|
|
@@ -26151,7 +26170,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26151
26170
|
callId,
|
|
26152
26171
|
name: "Expansion",
|
|
26153
26172
|
description: "Command expansion needs shell access",
|
|
26154
|
-
status:
|
|
26173
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
26155
26174
|
isClientInitiated: true,
|
|
26156
26175
|
resultDisplay: void 0,
|
|
26157
26176
|
confirmationDetails
|
|
@@ -26162,7 +26181,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26162
26181
|
});
|
|
26163
26182
|
});
|
|
26164
26183
|
setPendingItem(null);
|
|
26165
|
-
if (outcome ===
|
|
26184
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
26166
26185
|
addItem(
|
|
26167
26186
|
{
|
|
26168
26187
|
type: "info" /* INFO */,
|
|
@@ -26172,7 +26191,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26172
26191
|
);
|
|
26173
26192
|
return { type: "handled" };
|
|
26174
26193
|
}
|
|
26175
|
-
if (outcome ===
|
|
26194
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26176
26195
|
setSessionShellAllowlist(
|
|
26177
26196
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26178
26197
|
);
|
|
@@ -26648,7 +26667,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26648
26667
|
let description;
|
|
26649
26668
|
let renderOutputAsMarkdown = false;
|
|
26650
26669
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26651
|
-
if (call.status ===
|
|
26670
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26652
26671
|
description = JSON.stringify(call.request.args);
|
|
26653
26672
|
} else {
|
|
26654
26673
|
description = call.invocation.getDescription();
|
|
@@ -26671,27 +26690,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26671
26690
|
let progress = void 0;
|
|
26672
26691
|
let progressTotal = void 0;
|
|
26673
26692
|
switch (call.status) {
|
|
26674
|
-
case
|
|
26693
|
+
case CoreToolCallStatus.Success:
|
|
26675
26694
|
resultDisplay = call.response.resultDisplay;
|
|
26676
26695
|
outputFile = call.response.outputFile;
|
|
26677
26696
|
break;
|
|
26678
|
-
case
|
|
26679
|
-
case
|
|
26697
|
+
case CoreToolCallStatus.Error:
|
|
26698
|
+
case CoreToolCallStatus.Cancelled:
|
|
26680
26699
|
resultDisplay = call.response.resultDisplay;
|
|
26681
26700
|
break;
|
|
26682
|
-
case
|
|
26701
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26683
26702
|
correlationId = call.correlationId;
|
|
26684
26703
|
confirmationDetails = call.confirmationDetails;
|
|
26685
26704
|
break;
|
|
26686
|
-
case
|
|
26705
|
+
case CoreToolCallStatus.Executing:
|
|
26687
26706
|
resultDisplay = call.liveOutput;
|
|
26688
26707
|
ptyId = call.pid;
|
|
26689
26708
|
progressMessage = call.progressMessage;
|
|
26690
26709
|
progress = call.progress;
|
|
26691
26710
|
progressTotal = call.progressTotal;
|
|
26692
26711
|
break;
|
|
26693
|
-
case
|
|
26694
|
-
case
|
|
26712
|
+
case CoreToolCallStatus.Scheduled:
|
|
26713
|
+
case CoreToolCallStatus.Validating:
|
|
26695
26714
|
break;
|
|
26696
26715
|
default: {
|
|
26697
26716
|
const exhaustiveCheck = call;
|
|
@@ -26762,7 +26781,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26762
26781
|
const handler = (event) => {
|
|
26763
26782
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26764
26783
|
const hasExecuting = event.toolCalls.some(
|
|
26765
|
-
(tc) => tc.status ===
|
|
26784
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26766
26785
|
);
|
|
26767
26786
|
if (hasExecuting) {
|
|
26768
26787
|
setLastToolOutputTime(Date.now());
|
|
@@ -26771,7 +26790,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26771
26790
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26772
26791
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26773
26792
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26774
|
-
(tc) => tc.status ===
|
|
26793
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26775
26794
|
);
|
|
26776
26795
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26777
26796
|
return prev;
|
|
@@ -26783,9 +26802,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26783
26802
|
};
|
|
26784
26803
|
});
|
|
26785
26804
|
};
|
|
26786
|
-
messageBus.subscribe(
|
|
26805
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26787
26806
|
return () => {
|
|
26788
|
-
messageBus.unsubscribe(
|
|
26807
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26789
26808
|
};
|
|
26790
26809
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26791
26810
|
(0, import_react98.useEffect)(() => {
|
|
@@ -26807,9 +26826,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26807
26826
|
};
|
|
26808
26827
|
});
|
|
26809
26828
|
};
|
|
26810
|
-
messageBus.subscribe(
|
|
26829
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26811
26830
|
return () => {
|
|
26812
|
-
messageBus.unsubscribe(
|
|
26831
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26813
26832
|
};
|
|
26814
26833
|
}, [messageBus]);
|
|
26815
26834
|
const schedule = (0, import_react98.useCallback)(
|
|
@@ -26908,8 +26927,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
26908
26927
|
const prev = prevMap.get(coreCall.request.callId);
|
|
26909
26928
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
26910
26929
|
let status = coreCall.status;
|
|
26911
|
-
if ((status ===
|
|
26912
|
-
status =
|
|
26930
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
26931
|
+
status = CoreToolCallStatus.Executing;
|
|
26913
26932
|
}
|
|
26914
26933
|
return {
|
|
26915
26934
|
...coreCall,
|
|
@@ -26941,7 +26960,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
26941
26960
|
};
|
|
26942
26961
|
}
|
|
26943
26962
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
26944
|
-
return toolCall.status ===
|
|
26963
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
26945
26964
|
}
|
|
26946
26965
|
function showCitations(settings) {
|
|
26947
26966
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -26951,14 +26970,14 @@ function showCitations(settings) {
|
|
|
26951
26970
|
return true;
|
|
26952
26971
|
}
|
|
26953
26972
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
26954
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
26973
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
26955
26974
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
26956
26975
|
}
|
|
26957
26976
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
26958
|
-
if (tc.status ===
|
|
26977
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
26959
26978
|
return true;
|
|
26960
26979
|
}
|
|
26961
|
-
if (tc.status ===
|
|
26980
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
26962
26981
|
return !tc.responseSubmittedToGemini;
|
|
26963
26982
|
}
|
|
26964
26983
|
return false;
|
|
@@ -27004,9 +27023,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27004
27023
|
}
|
|
27005
27024
|
setRetryStatus(payload);
|
|
27006
27025
|
};
|
|
27007
|
-
coreEvents.on(
|
|
27026
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27008
27027
|
return () => {
|
|
27009
|
-
coreEvents.off(
|
|
27028
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
27010
27029
|
};
|
|
27011
27030
|
}, [isRespondingRef]);
|
|
27012
27031
|
const [
|
|
@@ -27139,12 +27158,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27139
27158
|
const tc = toolCalls[i];
|
|
27140
27159
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27141
27160
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
27142
|
-
const isAgent = tc.tool?.kind ===
|
|
27161
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
27143
27162
|
if (isAgent) {
|
|
27144
27163
|
let contigAgentsComplete = true;
|
|
27145
27164
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
27146
27165
|
const nextTc = toolCalls[j];
|
|
27147
|
-
if (nextTc.tool?.kind ===
|
|
27166
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27148
27167
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27149
27168
|
contigAgentsComplete = false;
|
|
27150
27169
|
break;
|
|
@@ -27170,7 +27189,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27170
27189
|
let currentGroup = [];
|
|
27171
27190
|
for (const tc of toolsToPush) {
|
|
27172
27191
|
newPushed.add(tc.request.callId);
|
|
27173
|
-
if (tc.tool?.kind ===
|
|
27192
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27174
27193
|
currentGroup.push(tc);
|
|
27175
27194
|
} else {
|
|
27176
27195
|
if (currentGroup.length > 0) {
|
|
@@ -27320,7 +27339,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27320
27339
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27321
27340
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27322
27341
|
(0, import_react99.useEffect)(() => {
|
|
27323
|
-
if (config.getApprovalMode() ===
|
|
27342
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27324
27343
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27325
27344
|
(item) => item.type === "user" /* USER */
|
|
27326
27345
|
);
|
|
@@ -27388,7 +27407,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27388
27407
|
return;
|
|
27389
27408
|
}
|
|
27390
27409
|
const hasActiveTools = toolCalls.some(
|
|
27391
|
-
(tc) => tc.status ===
|
|
27410
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating
|
|
27392
27411
|
);
|
|
27393
27412
|
if (streamingState === "idle" /* Idle */ && !isRespondingRef.current && !hasActiveTools) {
|
|
27394
27413
|
if (clearBuffer) {
|
|
@@ -27415,7 +27434,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27415
27434
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27416
27435
|
return {
|
|
27417
27436
|
...tool,
|
|
27418
|
-
status:
|
|
27437
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27419
27438
|
resultDisplay: tool.resultDisplay
|
|
27420
27439
|
};
|
|
27421
27440
|
}
|
|
@@ -27480,7 +27499,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27480
27499
|
let localQueryToSendToGemini = null;
|
|
27481
27500
|
if (typeof query === "string") {
|
|
27482
27501
|
const trimmedQuery = query.trim();
|
|
27483
|
-
await logger?.logMessage(
|
|
27502
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27484
27503
|
if (!shellModeActive) {
|
|
27485
27504
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27486
27505
|
if (slashCommandResult) {
|
|
@@ -27636,7 +27655,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27636
27655
|
if (pendingHistoryItemRef.current) {
|
|
27637
27656
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27638
27657
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27639
|
-
(tool) => tool.status ===
|
|
27658
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
27640
27659
|
);
|
|
27641
27660
|
const pendingItem = {
|
|
27642
27661
|
...pendingHistoryItemRef.current,
|
|
@@ -27882,15 +27901,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27882
27901
|
let geminiMessageBuffer = "";
|
|
27883
27902
|
const toolCallRequests = [];
|
|
27884
27903
|
for await (const event of stream) {
|
|
27885
|
-
if (event.type !==
|
|
27904
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
27886
27905
|
setThought(null);
|
|
27887
27906
|
}
|
|
27888
27907
|
switch (event.type) {
|
|
27889
|
-
case
|
|
27908
|
+
case GeminiEventType.Thought:
|
|
27890
27909
|
setLastGeminiActivityTime(Date.now());
|
|
27891
27910
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
27892
27911
|
break;
|
|
27893
|
-
case
|
|
27912
|
+
case GeminiEventType.Content:
|
|
27894
27913
|
setLastGeminiActivityTime(Date.now());
|
|
27895
27914
|
geminiMessageBuffer = handleContentEvent(
|
|
27896
27915
|
event.value,
|
|
@@ -27898,16 +27917,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27898
27917
|
userMessageTimestamp
|
|
27899
27918
|
);
|
|
27900
27919
|
break;
|
|
27901
|
-
case
|
|
27920
|
+
case GeminiEventType.ToolCallRequest:
|
|
27902
27921
|
toolCallRequests.push(event.value);
|
|
27903
27922
|
break;
|
|
27904
|
-
case
|
|
27923
|
+
case GeminiEventType.UserCancelled:
|
|
27905
27924
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
27906
27925
|
break;
|
|
27907
|
-
case
|
|
27926
|
+
case GeminiEventType.Error:
|
|
27908
27927
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
27909
27928
|
break;
|
|
27910
|
-
case
|
|
27929
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
27911
27930
|
handleAgentExecutionStoppedEvent(
|
|
27912
27931
|
event.value.reason,
|
|
27913
27932
|
userMessageTimestamp,
|
|
@@ -27915,7 +27934,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27915
27934
|
event.value.contextCleared
|
|
27916
27935
|
);
|
|
27917
27936
|
break;
|
|
27918
|
-
case
|
|
27937
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
27919
27938
|
handleAgentExecutionBlockedEvent(
|
|
27920
27939
|
event.value.reason,
|
|
27921
27940
|
userMessageTimestamp,
|
|
@@ -27923,35 +27942,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27923
27942
|
event.value.contextCleared
|
|
27924
27943
|
);
|
|
27925
27944
|
break;
|
|
27926
|
-
case
|
|
27945
|
+
case GeminiEventType.ChatCompressed:
|
|
27927
27946
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
27928
27947
|
break;
|
|
27929
|
-
case
|
|
27930
|
-
case
|
|
27948
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
27949
|
+
case GeminiEventType.ToolCallResponse:
|
|
27931
27950
|
break;
|
|
27932
|
-
case
|
|
27951
|
+
case GeminiEventType.MaxSessionTurns:
|
|
27933
27952
|
handleMaxSessionTurnsEvent();
|
|
27934
27953
|
break;
|
|
27935
|
-
case
|
|
27954
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
27936
27955
|
handleContextWindowWillOverflowEvent(
|
|
27937
27956
|
event.value.estimatedRequestTokenCount,
|
|
27938
27957
|
event.value.remainingTokenCount
|
|
27939
27958
|
);
|
|
27940
27959
|
break;
|
|
27941
|
-
case
|
|
27960
|
+
case GeminiEventType.Finished:
|
|
27942
27961
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
27943
27962
|
break;
|
|
27944
|
-
case
|
|
27963
|
+
case GeminiEventType.Citation:
|
|
27945
27964
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
27946
27965
|
break;
|
|
27947
|
-
case
|
|
27966
|
+
case GeminiEventType.ModelInfo:
|
|
27948
27967
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
27949
27968
|
break;
|
|
27950
|
-
case
|
|
27969
|
+
case GeminiEventType.LoopDetected:
|
|
27951
27970
|
loopDetectedRef.current = true;
|
|
27952
27971
|
break;
|
|
27953
|
-
case
|
|
27954
|
-
case
|
|
27972
|
+
case GeminiEventType.Retry:
|
|
27973
|
+
case GeminiEventType.InvalidStream:
|
|
27955
27974
|
break;
|
|
27956
27975
|
default: {
|
|
27957
27976
|
const unreachable = event;
|
|
@@ -27992,7 +28011,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27992
28011
|
const submitQuery = (0, import_react99.useCallback)(
|
|
27993
28012
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
27994
28013
|
{
|
|
27995
|
-
operation: options?.isContinuation ?
|
|
28014
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
27996
28015
|
sessionId: config.getSessionId()
|
|
27997
28016
|
},
|
|
27998
28017
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -28152,7 +28171,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28152
28171
|
);
|
|
28153
28172
|
const handleApprovalModeChange = (0, import_react99.useCallback)(
|
|
28154
28173
|
async (newApprovalMode) => {
|
|
28155
|
-
if (previousApprovalModeRef.current ===
|
|
28174
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
28156
28175
|
if (geminiClient) {
|
|
28157
28176
|
try {
|
|
28158
28177
|
await geminiClient.addHistory({
|
|
@@ -28175,11 +28194,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28175
28194
|
}
|
|
28176
28195
|
}
|
|
28177
28196
|
previousApprovalModeRef.current = newApprovalMode;
|
|
28178
|
-
if (newApprovalMode ===
|
|
28197
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28179
28198
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
28180
28199
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
28181
28200
|
);
|
|
28182
|
-
if (newApprovalMode ===
|
|
28201
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
28183
28202
|
awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
|
|
28184
28203
|
if (EDIT_TOOL_NAMES.has(call.request.name)) {
|
|
28185
28204
|
return true;
|
|
@@ -28195,11 +28214,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28195
28214
|
if (call.correlationId) {
|
|
28196
28215
|
try {
|
|
28197
28216
|
await config.getMessageBus().publish({
|
|
28198
|
-
type:
|
|
28217
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28199
28218
|
correlationId: call.correlationId,
|
|
28200
28219
|
confirmed: true,
|
|
28201
28220
|
requiresUserConfirmation: false,
|
|
28202
|
-
outcome:
|
|
28221
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28203
28222
|
});
|
|
28204
28223
|
} catch (error) {
|
|
28205
28224
|
debugLogger.warn(
|
|
@@ -28268,14 +28287,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28268
28287
|
);
|
|
28269
28288
|
if (isLowErrorVerbosity) {
|
|
28270
28289
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28271
|
-
(tc) => tc.status ===
|
|
28290
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28272
28291
|
).length;
|
|
28273
28292
|
}
|
|
28274
28293
|
if (geminiTools.length === 0) {
|
|
28275
28294
|
return;
|
|
28276
28295
|
}
|
|
28277
28296
|
const stopExecutionTool = geminiTools.find(
|
|
28278
|
-
(tc) => tc.response.errorType ===
|
|
28297
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28279
28298
|
);
|
|
28280
28299
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28281
28300
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28295,9 +28314,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28295
28314
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28296
28315
|
);
|
|
28297
28316
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28298
|
-
(tc) => tc.status ===
|
|
28317
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28299
28318
|
);
|
|
28300
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28319
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28301
28320
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28302
28321
|
if (!turnCancelledRef.current) {
|
|
28303
28322
|
addItem({
|
|
@@ -28377,7 +28396,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28377
28396
|
return;
|
|
28378
28397
|
}
|
|
28379
28398
|
const restorableToolCalls = toolCalls.filter(
|
|
28380
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28399
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28381
28400
|
);
|
|
28382
28401
|
if (restorableToolCalls.length > 0) {
|
|
28383
28402
|
if (!gitService) {
|
|
@@ -28600,14 +28619,14 @@ var useAgentStream = ({
|
|
|
28600
28619
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28601
28620
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28602
28621
|
const desc = legacyState?.description ?? "";
|
|
28603
|
-
const fallbackKind =
|
|
28622
|
+
const fallbackKind = Kind.Other;
|
|
28604
28623
|
const newCall = {
|
|
28605
28624
|
callId: event.requestId,
|
|
28606
28625
|
name: displayName,
|
|
28607
28626
|
originalRequestName: event.name,
|
|
28608
28627
|
description: desc,
|
|
28609
28628
|
display: event.display,
|
|
28610
|
-
status:
|
|
28629
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28611
28630
|
isClientInitiated: false,
|
|
28612
28631
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28613
28632
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28625,10 +28644,10 @@ var useAgentStream = ({
|
|
|
28625
28644
|
const evtStatus = legacyState?.status;
|
|
28626
28645
|
let status = tc.status;
|
|
28627
28646
|
if (evtStatus === "executing")
|
|
28628
|
-
status =
|
|
28629
|
-
else if (evtStatus === "error") status =
|
|
28647
|
+
status = CoreToolCallStatus.Executing;
|
|
28648
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28630
28649
|
else if (evtStatus === "success")
|
|
28631
|
-
status =
|
|
28650
|
+
status = CoreToolCallStatus.Success;
|
|
28632
28651
|
const display = event.display?.result;
|
|
28633
28652
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28634
28653
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28661,7 +28680,7 @@ var useAgentStream = ({
|
|
|
28661
28680
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28662
28681
|
return {
|
|
28663
28682
|
...tc,
|
|
28664
|
-
status: event.isError ?
|
|
28683
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28665
28684
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28666
28685
|
resultDisplay,
|
|
28667
28686
|
outputFile
|
|
@@ -28727,7 +28746,7 @@ var useAgentStream = ({
|
|
|
28727
28746
|
if (!options?.isContinuation) {
|
|
28728
28747
|
if (typeof query === "string") {
|
|
28729
28748
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28730
|
-
void logger?.logMessage(
|
|
28749
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28731
28750
|
}
|
|
28732
28751
|
startNewPrompt();
|
|
28733
28752
|
}
|
|
@@ -30254,9 +30273,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30254
30273
|
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30255
30274
|
async (choice) => {
|
|
30256
30275
|
const trustLevelMap = {
|
|
30257
|
-
["trust_folder" /* TRUST_FOLDER */]:
|
|
30258
|
-
["trust_parent" /* TRUST_PARENT */]:
|
|
30259
|
-
["do_not_trust" /* DO_NOT_TRUST */]:
|
|
30276
|
+
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
30277
|
+
["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
|
|
30278
|
+
["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
|
|
30260
30279
|
};
|
|
30261
30280
|
const trustLevel = trustLevelMap[choice];
|
|
30262
30281
|
if (!trustLevel) return;
|
|
@@ -30275,7 +30294,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30275
30294
|
}, 100);
|
|
30276
30295
|
return;
|
|
30277
30296
|
}
|
|
30278
|
-
const currentIsTrusted = trustLevel ===
|
|
30297
|
+
const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
|
|
30279
30298
|
onTrustChange(currentIsTrusted);
|
|
30280
30299
|
setIsTrusted(currentIsTrusted);
|
|
30281
30300
|
const wasTrusted = isTrusted ?? false;
|
|
@@ -31283,7 +31302,7 @@ function useMessageQueue({
|
|
|
31283
31302
|
var import_react107 = __toESM(require_react(), 1);
|
|
31284
31303
|
function useMcpStatus(config) {
|
|
31285
31304
|
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31286
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31305
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31287
31306
|
);
|
|
31288
31307
|
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31289
31308
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31296,12 +31315,12 @@ function useMcpStatus(config) {
|
|
|
31296
31315
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31297
31316
|
}
|
|
31298
31317
|
};
|
|
31299
|
-
coreEvents.on(
|
|
31318
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31300
31319
|
return () => {
|
|
31301
|
-
coreEvents.off(
|
|
31320
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31302
31321
|
};
|
|
31303
31322
|
}, [config]);
|
|
31304
|
-
const isMcpReady = discoveryState ===
|
|
31323
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31305
31324
|
return {
|
|
31306
31325
|
discoveryState,
|
|
31307
31326
|
mcpServerCount,
|
|
@@ -31328,7 +31347,7 @@ function useApprovalModeIndicator({
|
|
|
31328
31347
|
(key) => {
|
|
31329
31348
|
let nextApprovalMode;
|
|
31330
31349
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31331
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31350
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31332
31351
|
if (addItem) {
|
|
31333
31352
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31334
31353
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31346,21 +31365,21 @@ function useApprovalModeIndicator({
|
|
|
31346
31365
|
}
|
|
31347
31366
|
return;
|
|
31348
31367
|
}
|
|
31349
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31368
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31350
31369
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31351
31370
|
const currentMode = config.getApprovalMode();
|
|
31352
31371
|
switch (currentMode) {
|
|
31353
|
-
case
|
|
31354
|
-
nextApprovalMode =
|
|
31372
|
+
case ApprovalMode.DEFAULT:
|
|
31373
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31355
31374
|
break;
|
|
31356
|
-
case
|
|
31357
|
-
nextApprovalMode = allowPlanMode ?
|
|
31375
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31376
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31358
31377
|
break;
|
|
31359
|
-
case
|
|
31360
|
-
nextApprovalMode =
|
|
31378
|
+
case ApprovalMode.PLAN:
|
|
31379
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31361
31380
|
break;
|
|
31362
|
-
case
|
|
31363
|
-
nextApprovalMode =
|
|
31381
|
+
case ApprovalMode.YOLO:
|
|
31382
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31364
31383
|
break;
|
|
31365
31384
|
default:
|
|
31366
31385
|
}
|
|
@@ -31770,11 +31789,11 @@ var useHookDisplayState = () => {
|
|
|
31770
31789
|
removeHook();
|
|
31771
31790
|
}
|
|
31772
31791
|
};
|
|
31773
|
-
coreEvents.on(
|
|
31774
|
-
coreEvents.on(
|
|
31792
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
31793
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31775
31794
|
return () => {
|
|
31776
|
-
coreEvents.off(
|
|
31777
|
-
coreEvents.off(
|
|
31795
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
31796
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31778
31797
|
activeTimeouts.forEach(clearTimeout);
|
|
31779
31798
|
activeTimeouts.clear();
|
|
31780
31799
|
};
|
|
@@ -32613,7 +32632,7 @@ var AppContainer = (props) => {
|
|
|
32613
32632
|
setConfigInitialized(true);
|
|
32614
32633
|
startupProfiler.flush(config);
|
|
32615
32634
|
startAutoMemoryIfEnabled(config);
|
|
32616
|
-
const sessionStartSource = resumedSessionData ?
|
|
32635
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32617
32636
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32618
32637
|
if (result) {
|
|
32619
32638
|
const additionalContext = result.getAdditionalContext();
|
|
@@ -32640,7 +32659,7 @@ var AppContainer = (props) => {
|
|
|
32640
32659
|
);
|
|
32641
32660
|
const ideClient = await IdeClient.getInstance();
|
|
32642
32661
|
await ideClient.disconnect();
|
|
32643
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32662
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32644
32663
|
};
|
|
32645
32664
|
registerCleanup(cleanupFn);
|
|
32646
32665
|
return () => {
|
|
@@ -32665,11 +32684,11 @@ var AppContainer = (props) => {
|
|
|
32665
32684
|
resetTime: payload.resetTime
|
|
32666
32685
|
});
|
|
32667
32686
|
};
|
|
32668
|
-
coreEvents.on(
|
|
32669
|
-
coreEvents.on(
|
|
32687
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32688
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32670
32689
|
return () => {
|
|
32671
|
-
coreEvents.off(
|
|
32672
|
-
coreEvents.off(
|
|
32690
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32691
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32673
32692
|
};
|
|
32674
32693
|
}, [config]);
|
|
32675
32694
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32682,16 +32701,16 @@ var AppContainer = (props) => {
|
|
|
32682
32701
|
const handleAgentsDiscovered = (payload) => {
|
|
32683
32702
|
setNewAgents(payload.agents);
|
|
32684
32703
|
};
|
|
32685
|
-
coreEvents.on(
|
|
32686
|
-
coreEvents.on(
|
|
32687
|
-
coreEvents.on(
|
|
32704
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32705
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32706
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32688
32707
|
return () => {
|
|
32689
|
-
coreEvents.off(
|
|
32708
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32690
32709
|
coreEvents.off(
|
|
32691
|
-
|
|
32710
|
+
CoreEvent.AdminSettingsChanged,
|
|
32692
32711
|
handleAdminSettingsChanged
|
|
32693
32712
|
);
|
|
32694
|
-
coreEvents.off(
|
|
32713
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32695
32714
|
};
|
|
32696
32715
|
}, [settings]);
|
|
32697
32716
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32756,11 +32775,11 @@ var AppContainer = (props) => {
|
|
|
32756
32775
|
exitEditorDialog
|
|
32757
32776
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32758
32777
|
(0, import_react121.useEffect)(() => {
|
|
32759
|
-
coreEvents.on(
|
|
32760
|
-
coreEvents.on(
|
|
32778
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32779
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32761
32780
|
return () => {
|
|
32762
|
-
coreEvents.off(
|
|
32763
|
-
coreEvents.off(
|
|
32781
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32782
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32764
32783
|
};
|
|
32765
32784
|
}, [handleEditorClose, openEditorDialog]);
|
|
32766
32785
|
(0, import_react121.useEffect)(() => {
|
|
@@ -32828,7 +32847,7 @@ var AppContainer = (props) => {
|
|
|
32828
32847
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
32829
32848
|
});
|
|
32830
32849
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
32831
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
32850
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
32832
32851
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
32833
32852
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
32834
32853
|
config,
|
|
@@ -32856,7 +32875,7 @@ var AppContainer = (props) => {
|
|
|
32856
32875
|
async (authType, scope) => {
|
|
32857
32876
|
if (authType) {
|
|
32858
32877
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
32859
|
-
if (authType ===
|
|
32878
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
32860
32879
|
setAuthContext({ requiresRestart: true });
|
|
32861
32880
|
} else {
|
|
32862
32881
|
setAuthContext({});
|
|
@@ -32884,7 +32903,7 @@ var AppContainer = (props) => {
|
|
|
32884
32903
|
);
|
|
32885
32904
|
return;
|
|
32886
32905
|
}
|
|
32887
|
-
if (authType ===
|
|
32906
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
32888
32907
|
writeToStdout(`
|
|
32889
32908
|
----------------------------------------------------------------
|
|
32890
32909
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -32907,7 +32926,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32907
32926
|
}
|
|
32908
32927
|
await saveApiKey(apiKey);
|
|
32909
32928
|
await reloadApiKey();
|
|
32910
|
-
await config.refreshAuth(
|
|
32929
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
32911
32930
|
setAuthState("authenticated" /* Authenticated */);
|
|
32912
32931
|
} catch (e) {
|
|
32913
32932
|
onAuthError(
|
|
@@ -32932,7 +32951,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32932
32951
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
32933
32952
|
);
|
|
32934
32953
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
32935
|
-
if (settings.merged.security.auth.selectedType ===
|
|
32954
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
32936
32955
|
return;
|
|
32937
32956
|
}
|
|
32938
32957
|
const authMethod = settings.merged.security.auth.selectedType;
|
|
@@ -33068,9 +33087,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33068
33087
|
}
|
|
33069
33088
|
});
|
|
33070
33089
|
};
|
|
33071
|
-
coreEvents.on(
|
|
33090
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33072
33091
|
return () => {
|
|
33073
|
-
coreEvents.off(
|
|
33092
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33074
33093
|
};
|
|
33075
33094
|
}, []);
|
|
33076
33095
|
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
@@ -33728,7 +33747,7 @@ ${queuedText}` : queuedText;
|
|
|
33728
33747
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33729
33748
|
if (settings.merged.general.devtools) {
|
|
33730
33749
|
void (async () => {
|
|
33731
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33750
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-4K4TUJGT.js");
|
|
33732
33751
|
await toggleDevToolsPanel(
|
|
33733
33752
|
config,
|
|
33734
33753
|
showErrorDetails,
|
|
@@ -33946,17 +33965,17 @@ ${queuedText}` : queuedText;
|
|
|
33946
33965
|
Date.now()
|
|
33947
33966
|
);
|
|
33948
33967
|
};
|
|
33949
|
-
coreEvents.on(
|
|
33950
|
-
coreEvents.on(
|
|
33968
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
33969
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
33951
33970
|
coreEvents.drainBacklogs();
|
|
33952
33971
|
return () => {
|
|
33953
|
-
coreEvents.off(
|
|
33954
|
-
coreEvents.off(
|
|
33972
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
33973
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
33955
33974
|
};
|
|
33956
33975
|
}, [historyManager]);
|
|
33957
33976
|
const nightly = props.version.includes("nightly");
|
|
33958
33977
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
33959
|
-
const loginRestartMessage = settings.merged.security.auth.selectedType ===
|
|
33978
|
+
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;
|
|
33960
33979
|
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;
|
|
33961
33980
|
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
33962
33981
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
@@ -34056,9 +34075,9 @@ ${queuedText}` : queuedText;
|
|
|
34056
34075
|
const handleMemoryChanged = (result) => {
|
|
34057
34076
|
setGeminiMdFileCount(result.fileCount);
|
|
34058
34077
|
};
|
|
34059
|
-
coreEvents.on(
|
|
34078
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34060
34079
|
return () => {
|
|
34061
|
-
coreEvents.off(
|
|
34080
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34062
34081
|
};
|
|
34063
34082
|
}, []);
|
|
34064
34083
|
(0, import_react121.useEffect)(() => {
|