@google/gemini-cli 0.39.0-preview.0 → 0.39.0-preview.2
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-NMO6M2JW.js → chunk-3R2FLB3Z.js} +4 -4
- package/bundle/{chunk-UCJYTRQH.js → chunk-45GIY5RT.js} +1 -1
- package/bundle/{chunk-CB4IHCOV.js → chunk-4UUOHXDW.js} +354 -296
- package/bundle/{chunk-ZFUMNFZD.js → chunk-5J5LWISO.js} +6536 -11870
- package/bundle/{chunk-DY3XSEN6.js → chunk-AZ7QQWNX.js} +2 -2
- package/bundle/{chunk-L5FKR6GE.js → chunk-GX4YOB7T.js} +4 -4
- package/bundle/{chunk-KMWY7IVQ.js → chunk-N3GUGFOL.js} +72 -60
- package/bundle/chunk-OXCH4FS3.js +360288 -0
- package/bundle/{chunk-5ZBBJS2A.js → chunk-QC6EGBZW.js} +1 -1
- package/bundle/chunk-RTX4LTWK.js +101702 -0
- package/bundle/chunk-SS4CWRZ5.js +156 -0
- package/bundle/{chunk-LF246RTE.js → chunk-TKGFTY3B.js} +404 -307
- package/bundle/{cleanup-INA6FKQG.js → cleanup-3EICKDDN.js} +2 -2
- package/bundle/{cleanup-DKDGF4IA.js → cleanup-4SLYOL44.js} +3 -3
- package/bundle/{cleanup-B7STSNY5.js → cleanup-6N6E742H.js} +2 -2
- package/bundle/cleanup-OG2MXKZ7.js +33 -0
- package/bundle/{core-6MCGZ334.js → core-KLYK3V6Z.js} +3 -1
- package/bundle/{devtoolsService-QN4BQSIF.js → devtoolsService-FS7WXGBF.js} +2 -2
- package/bundle/{devtoolsService-BXBCDCC2.js → devtoolsService-K4DENTYF.js} +2 -2
- package/bundle/{devtoolsService-DDDJINQW.js → devtoolsService-RLXZWLDT.js} +5 -4
- package/bundle/devtoolsService-X4577PYZ.js +871 -0
- package/bundle/{dist-2M52ZJGU.js → dist-5ET5G5PC.js} +3 -1
- package/bundle/{core-MYQB6KXT.js → dist-DQVXGLSO.js} +4 -2
- package/bundle/dist-P4XAO4SC.js +2010 -0
- package/bundle/docs/cli/plan-mode.md +1 -2
- package/bundle/{gemini-TS2LMZH4.js → gemini-6GWCDHXK.js} +8 -8
- package/bundle/{gemini-BA3BDBJT.js → gemini-FLGPH5GJ.js} +8 -8
- package/bundle/{gemini-JFTJVXU4.js → gemini-NBKLSVA3.js} +184 -169
- package/bundle/gemini-YOFQ5KF4.js +15321 -0
- package/bundle/gemini.js +3 -3
- package/bundle/{interactiveCli-7ZBDFPFP.js → interactiveCli-AGSLCKNH.js} +6 -5
- package/bundle/{interactiveCli-W43ANBCL.js → interactiveCli-H3NLGP7Z.js} +6 -5
- package/bundle/{interactiveCli-K6QHA2GI.js → interactiveCli-NAPN3E2K.js} +277 -259
- package/bundle/interactiveCli-TCZBSTKU.js +34493 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-53ZABNLX.js → oauth2-provider-CWUR5RGE.js} +1 -1
- package/bundle/{oauth2-provider-T4YYJWZG.js → oauth2-provider-EA452S4C.js} +39 -73
- package/bundle/oauth2-provider-LV6VPYTU.js +237 -0
- package/bundle/{oauth2-provider-3YCIQHIN.js → oauth2-provider-YKYTKUWD.js} +1 -1
- package/package.json +1 -1
|
@@ -197,7 +197,7 @@ import {
|
|
|
197
197
|
widestLineFromStyledChars,
|
|
198
198
|
wordBreakStyledChars,
|
|
199
199
|
wrapStyledChars
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-RTX4LTWK.js";
|
|
201
201
|
import {
|
|
202
202
|
appEvents
|
|
203
203
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -206,12 +206,14 @@ import {
|
|
|
206
206
|
removeCleanup,
|
|
207
207
|
runExitCleanup,
|
|
208
208
|
setupTtyCheck
|
|
209
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-AZ7QQWNX.js";
|
|
210
210
|
import {
|
|
211
211
|
ApiKeyUpdatedEvent,
|
|
212
212
|
AsyncFzf,
|
|
213
213
|
AuthType,
|
|
214
|
+
CompressionStatus,
|
|
214
215
|
ConversationFinishedEvent,
|
|
216
|
+
CoreToolCallStatus,
|
|
215
217
|
CreditPurchaseClickEvent,
|
|
216
218
|
EDITOR_DISPLAY_NAMES,
|
|
217
219
|
EmptyWalletMenuShownEvent,
|
|
@@ -221,11 +223,16 @@ import {
|
|
|
221
223
|
FileSearchFactory,
|
|
222
224
|
FolderTrustDiscoveryService,
|
|
223
225
|
G1_UTM_CAMPAIGNS,
|
|
226
|
+
GeminiCliOperation,
|
|
227
|
+
GeminiEventType,
|
|
224
228
|
GitService,
|
|
225
229
|
IdeClient,
|
|
226
230
|
LegacyAgentProtocol,
|
|
227
231
|
LlmRole,
|
|
228
232
|
Logger,
|
|
233
|
+
MCPDiscoveryState,
|
|
234
|
+
MCPServerStatus,
|
|
235
|
+
MessageSenderType,
|
|
229
236
|
ModelNotFoundError,
|
|
230
237
|
ModelSlashCommandEvent,
|
|
231
238
|
OverageMenuShownEvent,
|
|
@@ -234,6 +241,8 @@ import {
|
|
|
234
241
|
ProjectIdRequiredError,
|
|
235
242
|
ROOT_SCHEDULER_ID,
|
|
236
243
|
Scheduler,
|
|
244
|
+
SessionEndReason,
|
|
245
|
+
SessionStartSource,
|
|
237
246
|
ShellExecutionService,
|
|
238
247
|
SlashCommandStatus,
|
|
239
248
|
TerminalQuotaError,
|
|
@@ -241,6 +250,7 @@ import {
|
|
|
241
250
|
UserPromptEvent,
|
|
242
251
|
UserTierId,
|
|
243
252
|
ValidationRequiredError,
|
|
253
|
+
WarningPriority,
|
|
244
254
|
addMCPStatusChangeListener,
|
|
245
255
|
allowEditorTypeInSandbox,
|
|
246
256
|
belongsInConfirmationQueue,
|
|
@@ -323,11 +333,13 @@ import {
|
|
|
323
333
|
validatePlanContent,
|
|
324
334
|
validatePlanPath,
|
|
325
335
|
writeToStdout
|
|
326
|
-
} from "./chunk-
|
|
336
|
+
} from "./chunk-4UUOHXDW.js";
|
|
327
337
|
import {
|
|
328
338
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
329
339
|
AGENT_TOOL_NAME,
|
|
340
|
+
ApprovalMode,
|
|
330
341
|
ChangeAuthRequestedError,
|
|
342
|
+
CoreEvent,
|
|
331
343
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
332
344
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
333
345
|
DEFAULT_GEMINI_MODEL,
|
|
@@ -338,13 +350,16 @@ import {
|
|
|
338
350
|
GEMINI_DIR,
|
|
339
351
|
GLOB_DISPLAY_NAME,
|
|
340
352
|
GREP_DISPLAY_NAME,
|
|
353
|
+
Kind,
|
|
341
354
|
LS_DISPLAY_NAME,
|
|
355
|
+
MessageBusType,
|
|
342
356
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
343
357
|
PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
|
|
344
358
|
PREVIEW_GEMINI_3_1_MODEL,
|
|
345
359
|
PREVIEW_GEMINI_FLASH_MODEL,
|
|
346
360
|
PREVIEW_GEMINI_MODEL,
|
|
347
361
|
PREVIEW_GEMINI_MODEL_AUTO,
|
|
362
|
+
QuestionType,
|
|
348
363
|
READ_FILE_DISPLAY_NAME,
|
|
349
364
|
READ_MANY_FILES_DISPLAY_NAME,
|
|
350
365
|
SHELL_TOOL_NAME,
|
|
@@ -352,6 +367,8 @@ import {
|
|
|
352
367
|
TOPIC_PARAM_STRATEGIC_INTENT,
|
|
353
368
|
TOPIC_PARAM_SUMMARY,
|
|
354
369
|
TOPIC_PARAM_TITLE,
|
|
370
|
+
ToolConfirmationOutcome,
|
|
371
|
+
ToolErrorType,
|
|
355
372
|
UPDATE_TOPIC_DISPLAY_NAME,
|
|
356
373
|
UPDATE_TOPIC_TOOL_NAME,
|
|
357
374
|
UnauthorizedError,
|
|
@@ -381,7 +398,7 @@ import {
|
|
|
381
398
|
safeJsonToMarkdown,
|
|
382
399
|
shortenPath,
|
|
383
400
|
tildeifyPath
|
|
384
|
-
} from "./chunk-
|
|
401
|
+
} from "./chunk-67TFD6HC.js";
|
|
385
402
|
import "./chunk-664ZODQF.js";
|
|
386
403
|
import "./chunk-RJTRUG2J.js";
|
|
387
404
|
import "./chunk-IUUIT4SU.js";
|
|
@@ -5749,7 +5766,7 @@ function calculateShellMaxLines(options) {
|
|
|
5749
5766
|
if (isAlternateBuffer && isThisShellFocused2 && !constrainHeight) {
|
|
5750
5767
|
return maxLinesBasedOnHeight;
|
|
5751
5768
|
}
|
|
5752
|
-
const isExecuting = status ===
|
|
5769
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
5753
5770
|
const shellMaxLinesLimit = isExecuting ? ACTIVE_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD : COMPLETED_SHELL_MAX_LINES - SHELL_CONTENT_OVERHEAD;
|
|
5754
5771
|
return Math.min(maxLinesBasedOnHeight, shellMaxLinesLimit);
|
|
5755
5772
|
}
|
|
@@ -5782,10 +5799,10 @@ function isShellTool(name) {
|
|
|
5782
5799
|
return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME;
|
|
5783
5800
|
}
|
|
5784
5801
|
function isThisShellFocusable(name, status, config) {
|
|
5785
|
-
return !!(isShellTool(name) && status ===
|
|
5802
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && config?.getEnableInteractiveShell());
|
|
5786
5803
|
}
|
|
5787
5804
|
function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
|
|
5788
|
-
return !!(isShellTool(name) && status ===
|
|
5805
|
+
return !!(isShellTool(name) && status === CoreToolCallStatus.Executing && ptyId === activeShellPtyId && embeddedShellFocused);
|
|
5789
5806
|
}
|
|
5790
5807
|
function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
|
|
5791
5808
|
const [userHasFocused, setUserHasFocused] = (0, import_react16.useState)(false);
|
|
@@ -6383,7 +6400,7 @@ var ToolMessage = ({
|
|
|
6383
6400
|
paddingX: 1,
|
|
6384
6401
|
flexDirection: "column",
|
|
6385
6402
|
children: [
|
|
6386
|
-
status ===
|
|
6403
|
+
status === CoreToolCallStatus.Executing && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
6387
6404
|
McpProgressIndicator,
|
|
6388
6405
|
{
|
|
6389
6406
|
progress,
|
|
@@ -6400,8 +6417,8 @@ var ToolMessage = ({
|
|
|
6400
6417
|
terminalWidth,
|
|
6401
6418
|
renderOutputAsMarkdown,
|
|
6402
6419
|
hasFocus: isThisShellFocused2,
|
|
6403
|
-
maxLines: kind ===
|
|
6404
|
-
overflowDirection: kind ===
|
|
6420
|
+
maxLines: kind === Kind.Agent && availableTerminalHeight !== void 0 ? SUBAGENT_MAX_LINES : void 0,
|
|
6421
|
+
overflowDirection: kind === Kind.Agent ? "bottom" : "top"
|
|
6405
6422
|
}
|
|
6406
6423
|
),
|
|
6407
6424
|
isThisShellFocused2 && config && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -7101,7 +7118,7 @@ var ShellToolMessage = ({
|
|
|
7101
7118
|
maxLinesLimit: maxLines
|
|
7102
7119
|
});
|
|
7103
7120
|
import_react23.default.useEffect(() => {
|
|
7104
|
-
const isExecuting = status ===
|
|
7121
|
+
const isExecuting = status === CoreToolCallStatus.Executing;
|
|
7105
7122
|
if (isExecuting && ptyId) {
|
|
7106
7123
|
try {
|
|
7107
7124
|
const childWidth = terminalWidth - 4;
|
|
@@ -7287,14 +7304,14 @@ var ToolActionsProvider = (props) => {
|
|
|
7287
7304
|
}
|
|
7288
7305
|
const details = tool.confirmationDetails;
|
|
7289
7306
|
if (details?.type === "edit" && isDiffingEnabled && "filePath" in details) {
|
|
7290
|
-
const cliOutcome = outcome ===
|
|
7307
|
+
const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? "rejected" : "accepted";
|
|
7291
7308
|
await ideClient?.resolveDiffFromCli(details.filePath, cliOutcome);
|
|
7292
7309
|
}
|
|
7293
7310
|
if (tool.correlationId) {
|
|
7294
7311
|
await config.getMessageBus().publish({
|
|
7295
|
-
type:
|
|
7312
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
7296
7313
|
correlationId: tool.correlationId,
|
|
7297
|
-
confirmed: outcome !==
|
|
7314
|
+
confirmed: outcome !== ToolConfirmationOutcome.Cancel,
|
|
7298
7315
|
requiresUserConfirmation: false,
|
|
7299
7316
|
outcome,
|
|
7300
7317
|
payload
|
|
@@ -7313,7 +7330,7 @@ var ToolActionsProvider = (props) => {
|
|
|
7313
7330
|
);
|
|
7314
7331
|
const cancel = (0, import_react24.useCallback)(
|
|
7315
7332
|
async (callId) => {
|
|
7316
|
-
await confirm(callId,
|
|
7333
|
+
await confirm(callId, ToolConfirmationOutcome.Cancel);
|
|
7317
7334
|
},
|
|
7318
7335
|
[confirm]
|
|
7319
7336
|
);
|
|
@@ -7600,22 +7617,22 @@ var hasPayload = (res) => {
|
|
|
7600
7617
|
function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerminalHeight, isClickable) {
|
|
7601
7618
|
const added = (diff.diffStat?.model_added_lines ?? 0) + (diff.diffStat?.user_added_lines ?? 0);
|
|
7602
7619
|
const removed = (diff.diffStat?.model_removed_lines ?? 0) + (diff.diffStat?.user_removed_lines ?? 0);
|
|
7603
|
-
const isAcceptedOrConfirming = status ===
|
|
7620
|
+
const isAcceptedOrConfirming = status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing || status === CoreToolCallStatus.AwaitingApproval;
|
|
7604
7621
|
const addColor = isAcceptedOrConfirming ? theme.status.success : theme.text.secondary;
|
|
7605
7622
|
const removeColor = isAcceptedOrConfirming ? theme.status.error : theme.text.secondary;
|
|
7606
7623
|
const showDiffStat = !!diff.diffStat;
|
|
7607
7624
|
const description = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box_default, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text, { color: theme.text.secondary, wrap: "truncate-end", children: diff.fileName }) });
|
|
7608
7625
|
let resultSummary = "";
|
|
7609
7626
|
let resultColor = theme.text.secondary;
|
|
7610
|
-
if (status ===
|
|
7627
|
+
if (status === CoreToolCallStatus.AwaitingApproval) {
|
|
7611
7628
|
resultSummary = "Confirming";
|
|
7612
|
-
} else if (status ===
|
|
7629
|
+
} else if (status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Executing) {
|
|
7613
7630
|
resultSummary = "Accepted";
|
|
7614
7631
|
resultColor = theme.text.accent;
|
|
7615
|
-
} else if (status ===
|
|
7632
|
+
} else if (status === CoreToolCallStatus.Cancelled) {
|
|
7616
7633
|
resultSummary = "Rejected";
|
|
7617
7634
|
resultColor = theme.status.error;
|
|
7618
|
-
} else if (status ===
|
|
7635
|
+
} else if (status === CoreToolCallStatus.Error) {
|
|
7619
7636
|
resultSummary = typeof resultDisplay === "string" ? resultDisplay : "Failed";
|
|
7620
7637
|
resultColor = theme.status.error;
|
|
7621
7638
|
}
|
|
@@ -7646,7 +7663,7 @@ function getFileOpData(diff, status, resultDisplay, terminalWidth, availableTerm
|
|
|
7646
7663
|
filename: diff.fileName,
|
|
7647
7664
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7648
7665
|
availableTerminalHeight,
|
|
7649
|
-
disableColor: status ===
|
|
7666
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
7650
7667
|
}
|
|
7651
7668
|
);
|
|
7652
7669
|
return { description, summary, payload };
|
|
@@ -7774,10 +7791,10 @@ var DenseToolMessage = (props) => {
|
|
|
7774
7791
|
if (isGrepResult(resultDisplay)) {
|
|
7775
7792
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7776
7793
|
}
|
|
7777
|
-
if (status ===
|
|
7794
|
+
if (status === CoreToolCallStatus.Success && resultDisplay) {
|
|
7778
7795
|
return getGenericSuccessData(resultDisplay, originalDescription);
|
|
7779
7796
|
}
|
|
7780
|
-
if (status ===
|
|
7797
|
+
if (status === CoreToolCallStatus.Error) {
|
|
7781
7798
|
const text = typeof resultDisplay === "string" ? resultDisplay.replace(/\n/g, " ") : "Failed";
|
|
7782
7799
|
const errorSummary = /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Text, { color: theme.status.error, wrap: "truncate-end", children: [
|
|
7783
7800
|
"\u2192 ",
|
|
@@ -7818,7 +7835,7 @@ var DenseToolMessage = (props) => {
|
|
|
7818
7835
|
language: fileExtension,
|
|
7819
7836
|
maxWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7820
7837
|
settings,
|
|
7821
|
-
disableColor: status ===
|
|
7838
|
+
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
7822
7839
|
returnLines: true
|
|
7823
7840
|
});
|
|
7824
7841
|
} else {
|
|
@@ -7826,7 +7843,7 @@ var DenseToolMessage = (props) => {
|
|
|
7826
7843
|
parsedLines,
|
|
7827
7844
|
filename: diff.fileName,
|
|
7828
7845
|
terminalWidth: terminalWidth - PAYLOAD_MARGIN_LEFT,
|
|
7829
|
-
disableColor: status ===
|
|
7846
|
+
disableColor: status === CoreToolCallStatus.Cancelled
|
|
7830
7847
|
});
|
|
7831
7848
|
}
|
|
7832
7849
|
}, [diff, isExpanded, isAlternateBuffer, terminalWidth, settings, status]);
|
|
@@ -7956,7 +7973,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7956
7973
|
return pendingHistoryItems.some((item) => {
|
|
7957
7974
|
if (item && item.type === "tool_group") {
|
|
7958
7975
|
return item.tools.some(
|
|
7959
|
-
(tool) =>
|
|
7976
|
+
(tool) => CoreToolCallStatus.Executing === tool.status
|
|
7960
7977
|
);
|
|
7961
7978
|
}
|
|
7962
7979
|
return false;
|
|
@@ -7965,7 +7982,7 @@ function isToolExecuting(pendingHistoryItems) {
|
|
|
7965
7982
|
function isToolAwaitingConfirmation(pendingHistoryItems) {
|
|
7966
7983
|
return pendingHistoryItems.filter((item) => item.type === "tool_group").some(
|
|
7967
7984
|
(item) => item.tools.some(
|
|
7968
|
-
(tool) =>
|
|
7985
|
+
(tool) => CoreToolCallStatus.AwaitingApproval === tool.status
|
|
7969
7986
|
)
|
|
7970
7987
|
);
|
|
7971
7988
|
}
|
|
@@ -7988,14 +8005,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
|
|
|
7988
8005
|
if (isTrackedToolCall(t)) {
|
|
7989
8006
|
return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
|
|
7990
8007
|
} else {
|
|
7991
|
-
return t.status !==
|
|
8008
|
+
return t.status !== CoreToolCallStatus.Success && t.status !== CoreToolCallStatus.Error && t.status !== CoreToolCallStatus.Cancelled;
|
|
7992
8009
|
}
|
|
7993
8010
|
});
|
|
7994
8011
|
const isEmbeddedShellFocused = toolsToInspect.some((t) => {
|
|
7995
8012
|
if (isTrackedToolCall(t)) {
|
|
7996
8013
|
return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
|
|
7997
8014
|
} else {
|
|
7998
|
-
return isShellTool(t.name) && t.status ===
|
|
8015
|
+
return isShellTool(t.name) && t.status === CoreToolCallStatus.Executing && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
|
|
7999
8016
|
}
|
|
8000
8017
|
});
|
|
8001
8018
|
const isShellCommand = toolsToInspect.some((t) => {
|
|
@@ -8094,7 +8111,7 @@ var ToolGroupMessage = ({
|
|
|
8094
8111
|
const groupedTools = (0, import_react28.useMemo)(() => {
|
|
8095
8112
|
const groups = [];
|
|
8096
8113
|
for (const tool of visibleToolCalls) {
|
|
8097
|
-
if (tool.kind ===
|
|
8114
|
+
if (tool.kind === Kind.Agent) {
|
|
8098
8115
|
const lastGroup = groups[groups.length - 1];
|
|
8099
8116
|
if (Array.isArray(lastGroup)) {
|
|
8100
8117
|
lastGroup.push(tool);
|
|
@@ -8148,7 +8165,7 @@ var ToolGroupMessage = ({
|
|
|
8148
8165
|
}, [groupedTools, isCompactModeEnabled, borderTopOverride]);
|
|
8149
8166
|
let countToolCallsWithResults = 0;
|
|
8150
8167
|
for (const tool of visibleToolCalls) {
|
|
8151
|
-
if (tool.kind !==
|
|
8168
|
+
if (tool.kind !== Kind.Agent) {
|
|
8152
8169
|
if (isCompactTool(tool, isCompactModeEnabled)) {
|
|
8153
8170
|
if (hasDensePayload(tool)) {
|
|
8154
8171
|
countToolCallsWithResults++;
|
|
@@ -8344,18 +8361,18 @@ function CompressionMessage({
|
|
|
8344
8361
|
return "Compressing chat history";
|
|
8345
8362
|
}
|
|
8346
8363
|
switch (compressionStatus) {
|
|
8347
|
-
case
|
|
8364
|
+
case CompressionStatus.COMPRESSED:
|
|
8348
8365
|
return `Chat history compressed from ${originalTokens} to ${newTokens} tokens.`;
|
|
8349
|
-
case
|
|
8366
|
+
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
8350
8367
|
if (originalTokens < 5e4) {
|
|
8351
8368
|
return "Compression was not beneficial for this history size.";
|
|
8352
8369
|
}
|
|
8353
8370
|
return "Chat history compression did not reduce size. This may indicate issues with the compression prompt.";
|
|
8354
|
-
case
|
|
8371
|
+
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
|
8355
8372
|
return "Could not compress chat history due to a token counting error.";
|
|
8356
|
-
case
|
|
8373
|
+
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
|
8357
8374
|
return "Chat history compression failed: the model returned an empty summary.";
|
|
8358
|
-
case
|
|
8375
|
+
case CompressionStatus.NOOP:
|
|
8359
8376
|
return "Nothing to compress.";
|
|
8360
8377
|
default:
|
|
8361
8378
|
return "";
|
|
@@ -8769,8 +8786,8 @@ var ModelUsageTable = ({ models }) => {
|
|
|
8769
8786
|
);
|
|
8770
8787
|
roleEntries.sort(([a], [b]) => {
|
|
8771
8788
|
if (a === b) return 0;
|
|
8772
|
-
if (a ===
|
|
8773
|
-
if (b ===
|
|
8789
|
+
if (a === LlmRole.MAIN) return -1;
|
|
8790
|
+
if (b === LlmRole.MAIN) return 1;
|
|
8774
8791
|
return a.localeCompare(b);
|
|
8775
8792
|
});
|
|
8776
8793
|
roleEntries.forEach(([role, roleMetrics]) => {
|
|
@@ -9101,8 +9118,8 @@ var ModelStatsDisplay = ({
|
|
|
9101
9118
|
return validRoles.includes(role);
|
|
9102
9119
|
}).sort((a, b) => {
|
|
9103
9120
|
if (a === b) return 0;
|
|
9104
|
-
if (a ===
|
|
9105
|
-
if (b ===
|
|
9121
|
+
if (a === LlmRole.MAIN) return -1;
|
|
9122
|
+
if (b === LlmRole.MAIN) return 1;
|
|
9106
9123
|
return a.localeCompare(b);
|
|
9107
9124
|
});
|
|
9108
9125
|
const createRow = (metric, getValue, options = {}) => {
|
|
@@ -9892,7 +9909,7 @@ var McpStatus = ({
|
|
|
9892
9909
|
);
|
|
9893
9910
|
const originalStatus = serverStatus(serverName);
|
|
9894
9911
|
const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0 || serverResources.length > 0;
|
|
9895
|
-
const status = originalStatus ===
|
|
9912
|
+
const status = originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems ? MCPServerStatus.CONNECTED : originalStatus;
|
|
9896
9913
|
let statusIndicator = "";
|
|
9897
9914
|
let statusText = "";
|
|
9898
9915
|
let statusColor = theme.text.primary;
|
|
@@ -9904,17 +9921,17 @@ var McpStatus = ({
|
|
|
9904
9921
|
statusColor = theme.text.secondary;
|
|
9905
9922
|
} else {
|
|
9906
9923
|
switch (status) {
|
|
9907
|
-
case
|
|
9924
|
+
case MCPServerStatus.CONNECTED:
|
|
9908
9925
|
statusIndicator = "\u{1F7E2}";
|
|
9909
9926
|
statusText = "Ready";
|
|
9910
9927
|
statusColor = theme.status.success;
|
|
9911
9928
|
break;
|
|
9912
|
-
case
|
|
9929
|
+
case MCPServerStatus.CONNECTING:
|
|
9913
9930
|
statusIndicator = "\u{1F504}";
|
|
9914
9931
|
statusText = "Starting... (first startup may take longer)";
|
|
9915
9932
|
statusColor = theme.status.warning;
|
|
9916
9933
|
break;
|
|
9917
|
-
case
|
|
9934
|
+
case MCPServerStatus.DISCONNECTED:
|
|
9918
9935
|
default:
|
|
9919
9936
|
statusIndicator = "\u{1F534}";
|
|
9920
9937
|
statusText = "Disconnected";
|
|
@@ -9962,12 +9979,12 @@ var McpStatus = ({
|
|
|
9962
9979
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Text, { children: [
|
|
9963
9980
|
" - ",
|
|
9964
9981
|
statusText,
|
|
9965
|
-
status ===
|
|
9982
|
+
status === MCPServerStatus.CONNECTED && parts.length > 0 && ` (${parts.join(", ")})`
|
|
9966
9983
|
] }),
|
|
9967
9984
|
authStatusNode
|
|
9968
9985
|
] }),
|
|
9969
|
-
status ===
|
|
9970
|
-
status ===
|
|
9986
|
+
status === MCPServerStatus.CONNECTING && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text, { children: " (tools and prompts will appear when ready)" }),
|
|
9987
|
+
status === MCPServerStatus.DISCONNECTED && toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Text, { children: [
|
|
9971
9988
|
" (",
|
|
9972
9989
|
toolCount,
|
|
9973
9990
|
" tools cached)"
|
|
@@ -10446,7 +10463,7 @@ var Notifications = () => {
|
|
|
10446
10463
|
if (dismissed) return [];
|
|
10447
10464
|
const counts = persistentState.get("startupWarningCounts") || {};
|
|
10448
10465
|
return startupWarnings.filter((w) => {
|
|
10449
|
-
if (w.priority ===
|
|
10466
|
+
if (w.priority === WarningPriority.Low) {
|
|
10450
10467
|
const count = counts[w.id] || 0;
|
|
10451
10468
|
return count < MAX_STARTUP_WARNING_SHOW_COUNT;
|
|
10452
10469
|
}
|
|
@@ -10459,7 +10476,7 @@ var Notifications = () => {
|
|
|
10459
10476
|
const counts = { ...persistentState.get("startupWarningCounts") || {} };
|
|
10460
10477
|
let changed = false;
|
|
10461
10478
|
visibleWarnings.forEach((w) => {
|
|
10462
|
-
if (w.priority ===
|
|
10479
|
+
if (w.priority === WarningPriority.Low) {
|
|
10463
10480
|
counts[w.id] = (counts[w.id] || 0) + 1;
|
|
10464
10481
|
changed = true;
|
|
10465
10482
|
}
|
|
@@ -10566,7 +10583,7 @@ var UserIdentity = ({ config }) => {
|
|
|
10566
10583
|
}
|
|
10567
10584
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
10568
10585
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Box_default, { children: [
|
|
10569
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType ===
|
|
10586
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: authType === AuthType.LOGIN_WITH_GOOGLE ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Text, { children: [
|
|
10570
10587
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Text, { bold: true, children: [
|
|
10571
10588
|
"Signed in with Google",
|
|
10572
10589
|
email ? ":" : ""
|
|
@@ -10800,7 +10817,7 @@ var import_react39 = __toESM(require_react(), 1);
|
|
|
10800
10817
|
function getConfirmingToolState(pendingHistoryItems) {
|
|
10801
10818
|
const allPendingTools = getAllToolCalls(pendingHistoryItems);
|
|
10802
10819
|
const confirmingTools = allPendingTools.filter(
|
|
10803
|
-
(tool) => tool.status ===
|
|
10820
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
10804
10821
|
);
|
|
10805
10822
|
if (confirmingTools.length === 0) {
|
|
10806
10823
|
return null;
|
|
@@ -11984,7 +12001,8 @@ function usePlanContent(planPath, config) {
|
|
|
11984
12001
|
try {
|
|
11985
12002
|
const pathError = await validatePlanPath(
|
|
11986
12003
|
planPath,
|
|
11987
|
-
config.storage.getPlansDir()
|
|
12004
|
+
config.storage.getPlansDir(),
|
|
12005
|
+
config.getProjectRoot()
|
|
11988
12006
|
);
|
|
11989
12007
|
if (ignore) return;
|
|
11990
12008
|
if (pathError) {
|
|
@@ -12109,7 +12127,7 @@ var ExitPlanModeDialog = ({
|
|
|
12109
12127
|
{
|
|
12110
12128
|
questions: [
|
|
12111
12129
|
{
|
|
12112
|
-
type:
|
|
12130
|
+
type: QuestionType.CHOICE,
|
|
12113
12131
|
header: "Approval",
|
|
12114
12132
|
question: planContent,
|
|
12115
12133
|
options: [
|
|
@@ -12130,9 +12148,9 @@ var ExitPlanModeDialog = ({
|
|
|
12130
12148
|
onSubmit: (answers) => {
|
|
12131
12149
|
const answer = answers["0"];
|
|
12132
12150
|
if (answer === "Yes, automatically accept edits" /* Auto */) {
|
|
12133
|
-
onApprove(
|
|
12151
|
+
onApprove(ApprovalMode.AUTO_EDIT);
|
|
12134
12152
|
} else if (answer === "Yes, manually accept edits" /* Manual */) {
|
|
12135
|
-
onApprove(
|
|
12153
|
+
onApprove(ApprovalMode.DEFAULT);
|
|
12136
12154
|
} else if (answer) {
|
|
12137
12155
|
onFeedback(answer);
|
|
12138
12156
|
}
|
|
@@ -12343,7 +12361,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12343
12361
|
);
|
|
12344
12362
|
(0, import_react44.useEffect)(() => {
|
|
12345
12363
|
if (isCancelling) {
|
|
12346
|
-
handleConfirm(
|
|
12364
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12347
12365
|
}
|
|
12348
12366
|
}, [isCancelling, handleConfirm]);
|
|
12349
12367
|
const handleSelect = (0, import_react44.useCallback)(
|
|
@@ -12356,19 +12374,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
12356
12374
|
if (!confirmationDetails.isModifying) {
|
|
12357
12375
|
options2.push({
|
|
12358
12376
|
label: "Allow once",
|
|
12359
|
-
value:
|
|
12377
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12360
12378
|
key: "Allow once"
|
|
12361
12379
|
});
|
|
12362
12380
|
if (isTrustedFolder) {
|
|
12363
12381
|
options2.push({
|
|
12364
12382
|
label: "Allow for this session",
|
|
12365
|
-
value:
|
|
12383
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12366
12384
|
key: "Allow for this session"
|
|
12367
12385
|
});
|
|
12368
12386
|
if (allowPermanentApproval) {
|
|
12369
12387
|
options2.push({
|
|
12370
12388
|
label: "Allow for this file in all future sessions",
|
|
12371
|
-
value:
|
|
12389
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12372
12390
|
key: "Allow for this file in all future sessions"
|
|
12373
12391
|
});
|
|
12374
12392
|
}
|
|
@@ -12376,119 +12394,119 @@ ${deceptiveUrlWarnings.map(
|
|
|
12376
12394
|
if (!config.getIdeMode() || !isDiffingEnabled) {
|
|
12377
12395
|
options2.push({
|
|
12378
12396
|
label: "Modify with external editor",
|
|
12379
|
-
value:
|
|
12397
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
12380
12398
|
key: "Modify with external editor"
|
|
12381
12399
|
});
|
|
12382
12400
|
}
|
|
12383
12401
|
options2.push({
|
|
12384
12402
|
label: "No, suggest changes (esc)",
|
|
12385
|
-
value:
|
|
12403
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12386
12404
|
key: "No, suggest changes (esc)"
|
|
12387
12405
|
});
|
|
12388
12406
|
}
|
|
12389
12407
|
} else if (confirmationDetails.type === "sandbox_expansion") {
|
|
12390
12408
|
options2.push({
|
|
12391
12409
|
label: "Allow once",
|
|
12392
|
-
value:
|
|
12410
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12393
12411
|
key: "Allow once"
|
|
12394
12412
|
});
|
|
12395
12413
|
if (isTrustedFolder) {
|
|
12396
12414
|
options2.push({
|
|
12397
12415
|
label: "Allow for this session",
|
|
12398
|
-
value:
|
|
12416
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12399
12417
|
key: "Allow for this session"
|
|
12400
12418
|
});
|
|
12401
12419
|
if (allowPermanentApproval) {
|
|
12402
12420
|
options2.push({
|
|
12403
12421
|
label: "Allow for all future sessions",
|
|
12404
|
-
value:
|
|
12422
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12405
12423
|
key: "Allow for all future sessions"
|
|
12406
12424
|
});
|
|
12407
12425
|
}
|
|
12408
12426
|
}
|
|
12409
12427
|
options2.push({
|
|
12410
12428
|
label: "No, suggest changes (esc)",
|
|
12411
|
-
value:
|
|
12429
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12412
12430
|
key: "No, suggest changes (esc)"
|
|
12413
12431
|
});
|
|
12414
12432
|
} else if (confirmationDetails.type === "exec") {
|
|
12415
12433
|
options2.push({
|
|
12416
12434
|
label: "Allow once",
|
|
12417
|
-
value:
|
|
12435
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12418
12436
|
key: "Allow once"
|
|
12419
12437
|
});
|
|
12420
12438
|
if (isTrustedFolder) {
|
|
12421
12439
|
options2.push({
|
|
12422
12440
|
label: `Allow for this session`,
|
|
12423
|
-
value:
|
|
12441
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12424
12442
|
key: `Allow for this session`
|
|
12425
12443
|
});
|
|
12426
12444
|
if (allowPermanentApproval) {
|
|
12427
12445
|
options2.push({
|
|
12428
12446
|
label: `Allow this command for all future sessions`,
|
|
12429
|
-
value:
|
|
12447
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12430
12448
|
key: `Allow for all future sessions`
|
|
12431
12449
|
});
|
|
12432
12450
|
}
|
|
12433
12451
|
}
|
|
12434
12452
|
options2.push({
|
|
12435
12453
|
label: "No, suggest changes (esc)",
|
|
12436
|
-
value:
|
|
12454
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12437
12455
|
key: "No, suggest changes (esc)"
|
|
12438
12456
|
});
|
|
12439
12457
|
} else if (confirmationDetails.type === "info") {
|
|
12440
12458
|
options2.push({
|
|
12441
12459
|
label: "Allow once",
|
|
12442
|
-
value:
|
|
12460
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12443
12461
|
key: "Allow once"
|
|
12444
12462
|
});
|
|
12445
12463
|
if (isTrustedFolder) {
|
|
12446
12464
|
options2.push({
|
|
12447
12465
|
label: "Allow for this session",
|
|
12448
|
-
value:
|
|
12466
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
12449
12467
|
key: "Allow for this session"
|
|
12450
12468
|
});
|
|
12451
12469
|
if (allowPermanentApproval) {
|
|
12452
12470
|
options2.push({
|
|
12453
12471
|
label: "Allow for all future sessions",
|
|
12454
|
-
value:
|
|
12472
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12455
12473
|
key: "Allow for all future sessions"
|
|
12456
12474
|
});
|
|
12457
12475
|
}
|
|
12458
12476
|
}
|
|
12459
12477
|
options2.push({
|
|
12460
12478
|
label: "No, suggest changes (esc)",
|
|
12461
|
-
value:
|
|
12479
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12462
12480
|
key: "No, suggest changes (esc)"
|
|
12463
12481
|
});
|
|
12464
12482
|
} else if (confirmationDetails.type === "mcp") {
|
|
12465
12483
|
options2.push({
|
|
12466
12484
|
label: "Allow once",
|
|
12467
|
-
value:
|
|
12485
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
12468
12486
|
key: "Allow once"
|
|
12469
12487
|
});
|
|
12470
12488
|
if (isTrustedFolder) {
|
|
12471
12489
|
options2.push({
|
|
12472
12490
|
label: "Allow tool for this session",
|
|
12473
|
-
value:
|
|
12491
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
12474
12492
|
key: "Allow tool for this session"
|
|
12475
12493
|
});
|
|
12476
12494
|
options2.push({
|
|
12477
12495
|
label: "Allow all server tools for this session",
|
|
12478
|
-
value:
|
|
12496
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
12479
12497
|
key: "Allow all server tools for this session"
|
|
12480
12498
|
});
|
|
12481
12499
|
if (allowPermanentApproval) {
|
|
12482
12500
|
options2.push({
|
|
12483
12501
|
label: "Allow tool for all future sessions",
|
|
12484
|
-
value:
|
|
12502
|
+
value: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
12485
12503
|
key: "Allow tool for all future sessions"
|
|
12486
12504
|
});
|
|
12487
12505
|
}
|
|
12488
12506
|
}
|
|
12489
12507
|
options2.push({
|
|
12490
12508
|
label: "No, suggest changes (esc)",
|
|
12491
|
-
value:
|
|
12509
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
12492
12510
|
key: "No, suggest changes (esc)"
|
|
12493
12511
|
});
|
|
12494
12512
|
}
|
|
@@ -12527,7 +12545,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12527
12545
|
const containsRedirection = commandsToDisplay.some(
|
|
12528
12546
|
(cmd) => hasRedirection(cmd)
|
|
12529
12547
|
);
|
|
12530
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12548
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12531
12549
|
if (containsRedirection && !isAutoEdit) {
|
|
12532
12550
|
extraInfoLines = 1;
|
|
12533
12551
|
}
|
|
@@ -12553,7 +12571,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12553
12571
|
const isSafeToPersist = confirmationDetails.type === "info" || confirmationDetails.type === "edit" || confirmationDetails.type === "mcp";
|
|
12554
12572
|
if (isSafeToPersist && settings.merged.security.autoAddToPolicyByDefault) {
|
|
12555
12573
|
const alwaysAndSaveIndex = options2.findIndex(
|
|
12556
|
-
(o) => o.value ===
|
|
12574
|
+
(o) => o.value === ToolConfirmationOutcome.ProceedAlwaysAndSave
|
|
12557
12575
|
);
|
|
12558
12576
|
if (alwaysAndSaveIndex !== -1) {
|
|
12559
12577
|
initialIndex2 = alwaysAndSaveIndex;
|
|
@@ -12570,10 +12588,10 @@ ${deceptiveUrlWarnings.map(
|
|
|
12570
12588
|
{
|
|
12571
12589
|
questions: confirmationDetails.questions,
|
|
12572
12590
|
onSubmit: (answers) => {
|
|
12573
|
-
handleConfirm(
|
|
12591
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, { answers });
|
|
12574
12592
|
},
|
|
12575
12593
|
onCancel: () => {
|
|
12576
|
-
handleConfirm(
|
|
12594
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12577
12595
|
},
|
|
12578
12596
|
width: terminalWidth,
|
|
12579
12597
|
availableHeight: bodyHeight
|
|
@@ -12594,19 +12612,19 @@ ${deceptiveUrlWarnings.map(
|
|
|
12594
12612
|
planPath: confirmationDetails.planPath,
|
|
12595
12613
|
getPreferredEditor,
|
|
12596
12614
|
onApprove: (approvalMode) => {
|
|
12597
|
-
handleConfirm(
|
|
12615
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12598
12616
|
approved: true,
|
|
12599
12617
|
approvalMode
|
|
12600
12618
|
});
|
|
12601
12619
|
},
|
|
12602
12620
|
onFeedback: (feedback) => {
|
|
12603
|
-
handleConfirm(
|
|
12621
|
+
handleConfirm(ToolConfirmationOutcome.ProceedOnce, {
|
|
12604
12622
|
approved: false,
|
|
12605
12623
|
feedback
|
|
12606
12624
|
});
|
|
12607
12625
|
},
|
|
12608
12626
|
onCancel: () => {
|
|
12609
|
-
handleConfirm(
|
|
12627
|
+
handleConfirm(ToolConfirmationOutcome.Cancel);
|
|
12610
12628
|
},
|
|
12611
12629
|
width: terminalWidth,
|
|
12612
12630
|
availableHeight: bodyHeight
|
|
@@ -12716,7 +12734,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12716
12734
|
const containsRedirection = commandsToDisplay.some(
|
|
12717
12735
|
(cmd) => hasRedirection(cmd)
|
|
12718
12736
|
);
|
|
12719
|
-
const isAutoEdit = config.getApprovalMode() ===
|
|
12737
|
+
const isAutoEdit = config.getApprovalMode() === ApprovalMode.YOLO || config.getApprovalMode() === ApprovalMode.AUTO_EDIT;
|
|
12720
12738
|
let warnings = null;
|
|
12721
12739
|
if (containsRedirection && !isAutoEdit) {
|
|
12722
12740
|
const tipText = `To auto-accept, press ${formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */)}`;
|
|
@@ -12879,7 +12897,7 @@ ${deceptiveUrlWarnings.map(
|
|
|
12879
12897
|
const bodyOverflowDirection = confirmationDetails.type === "mcp" && isMcpToolDetailsExpanded ? "bottom" : "top";
|
|
12880
12898
|
const renderRadioItem = (0, import_react44.useCallback)(
|
|
12881
12899
|
(item, { titleColor }) => {
|
|
12882
|
-
if (item.value ===
|
|
12900
|
+
if (item.value === ToolConfirmationOutcome.ProceedAlwaysAndSave) {
|
|
12883
12901
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(Text, { color: titleColor, wrap: "truncate", children: [
|
|
12884
12902
|
item.label,
|
|
12885
12903
|
" ",
|
|
@@ -15035,7 +15053,7 @@ function validateAuthMethodWithSettings(authType, settings) {
|
|
|
15035
15053
|
if (settings.merged.security.auth.useExternal) {
|
|
15036
15054
|
return null;
|
|
15037
15055
|
}
|
|
15038
|
-
if (authType ===
|
|
15056
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
15039
15057
|
return null;
|
|
15040
15058
|
}
|
|
15041
15059
|
return validateAuthMethod(authType);
|
|
@@ -15087,7 +15105,7 @@ var useAuthCommand = (settings, config, initialAuthError = null, initialAccountS
|
|
|
15087
15105
|
}
|
|
15088
15106
|
return;
|
|
15089
15107
|
}
|
|
15090
|
-
if (authType ===
|
|
15108
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
15091
15109
|
const key = await reloadApiKey();
|
|
15092
15110
|
if (!key) {
|
|
15093
15111
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
@@ -15162,31 +15180,31 @@ function AuthDialog({
|
|
|
15162
15180
|
let items = [
|
|
15163
15181
|
{
|
|
15164
15182
|
label: "Sign in with Google",
|
|
15165
|
-
value:
|
|
15166
|
-
key:
|
|
15183
|
+
value: AuthType.LOGIN_WITH_GOOGLE,
|
|
15184
|
+
key: AuthType.LOGIN_WITH_GOOGLE
|
|
15167
15185
|
},
|
|
15168
15186
|
...process.env["CLOUD_SHELL"] === "true" ? [
|
|
15169
15187
|
{
|
|
15170
15188
|
label: "Use Cloud Shell user credentials",
|
|
15171
|
-
value:
|
|
15172
|
-
key:
|
|
15189
|
+
value: AuthType.COMPUTE_ADC,
|
|
15190
|
+
key: AuthType.COMPUTE_ADC
|
|
15173
15191
|
}
|
|
15174
15192
|
] : process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true" ? [
|
|
15175
15193
|
{
|
|
15176
15194
|
label: "Use metadata server application default credentials",
|
|
15177
|
-
value:
|
|
15178
|
-
key:
|
|
15195
|
+
value: AuthType.COMPUTE_ADC,
|
|
15196
|
+
key: AuthType.COMPUTE_ADC
|
|
15179
15197
|
}
|
|
15180
15198
|
] : [],
|
|
15181
15199
|
{
|
|
15182
15200
|
label: "Use Gemini API Key",
|
|
15183
|
-
value:
|
|
15184
|
-
key:
|
|
15201
|
+
value: AuthType.USE_GEMINI,
|
|
15202
|
+
key: AuthType.USE_GEMINI
|
|
15185
15203
|
},
|
|
15186
15204
|
{
|
|
15187
15205
|
label: "Vertex AI",
|
|
15188
|
-
value:
|
|
15189
|
-
key:
|
|
15206
|
+
value: AuthType.USE_VERTEX_AI,
|
|
15207
|
+
key: AuthType.USE_VERTEX_AI
|
|
15190
15208
|
}
|
|
15191
15209
|
];
|
|
15192
15210
|
if (settings.merged.security.auth.enforcedType) {
|
|
@@ -15208,9 +15226,9 @@ function AuthDialog({
|
|
|
15208
15226
|
return item.value === defaultAuthType;
|
|
15209
15227
|
}
|
|
15210
15228
|
if (process.env["GEMINI_API_KEY"]) {
|
|
15211
|
-
return item.value ===
|
|
15229
|
+
return item.value === AuthType.USE_GEMINI;
|
|
15212
15230
|
}
|
|
15213
|
-
return item.value ===
|
|
15231
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
15214
15232
|
});
|
|
15215
15233
|
if (settings.merged.security.auth.enforcedType) {
|
|
15216
15234
|
initialAuthIndex = 0;
|
|
@@ -15221,19 +15239,19 @@ function AuthDialog({
|
|
|
15221
15239
|
return;
|
|
15222
15240
|
}
|
|
15223
15241
|
if (authType) {
|
|
15224
|
-
if (authType ===
|
|
15242
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
15225
15243
|
setAuthContext({ requiresRestart: true });
|
|
15226
15244
|
} else {
|
|
15227
15245
|
setAuthContext({});
|
|
15228
15246
|
}
|
|
15229
15247
|
await clearCachedCredentialFile();
|
|
15230
15248
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
15231
|
-
if (authType ===
|
|
15249
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
15232
15250
|
setExiting(true);
|
|
15233
15251
|
setTimeout(relaunchApp, 100);
|
|
15234
15252
|
return;
|
|
15235
15253
|
}
|
|
15236
|
-
if (authType ===
|
|
15254
|
+
if (authType === AuthType.USE_GEMINI) {
|
|
15237
15255
|
setAuthState("awaiting_api_key_input" /* AwaitingApiKeyInput */);
|
|
15238
15256
|
return;
|
|
15239
15257
|
}
|
|
@@ -15983,11 +16001,11 @@ var PrivacyNoticeText = ({
|
|
|
15983
16001
|
}) => {
|
|
15984
16002
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
15985
16003
|
switch (authType) {
|
|
15986
|
-
case
|
|
16004
|
+
case AuthType.USE_GEMINI:
|
|
15987
16005
|
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(GeminiPrivacyNotice, { onExit });
|
|
15988
|
-
case
|
|
16006
|
+
case AuthType.USE_VERTEX_AI:
|
|
15989
16007
|
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(CloudPaidPrivacyNotice, { onExit });
|
|
15990
|
-
case
|
|
16008
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
15991
16009
|
default:
|
|
15992
16010
|
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(CloudFreePrivacyNotice, { config, onExit });
|
|
15993
16011
|
}
|
|
@@ -16028,7 +16046,7 @@ function ProQuotaDialog({
|
|
|
16028
16046
|
value: "retry_always",
|
|
16029
16047
|
key: "retry_always"
|
|
16030
16048
|
},
|
|
16031
|
-
...authType ===
|
|
16049
|
+
...authType === AuthType.LOGIN_WITH_GOOGLE && !isUltra ? [
|
|
16032
16050
|
{
|
|
16033
16051
|
label: "Upgrade for higher limits",
|
|
16034
16052
|
value: "upgrade",
|
|
@@ -17181,7 +17199,7 @@ function ModelDialog({ onClose }) {
|
|
|
17181
17199
|
const useGemini31 = config?.getGemini31LaunchedSync?.() ?? false;
|
|
17182
17200
|
const useGemini31FlashLite = config?.getGemini31FlashLiteLaunchedSync?.() ?? false;
|
|
17183
17201
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
17184
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
17202
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
17185
17203
|
const manualModelSelected = (0, import_react62.useMemo)(() => {
|
|
17186
17204
|
if (config?.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
17187
17205
|
const def = config.getModelConfigService().getModelDefinition(preferredModel);
|
|
@@ -18233,10 +18251,10 @@ function initializeConsoleStore() {
|
|
|
18233
18251
|
globalConsoleMessages = [];
|
|
18234
18252
|
globalErrorCount = 0;
|
|
18235
18253
|
notifyListeners();
|
|
18236
|
-
coreEvents.off(
|
|
18237
|
-
coreEvents.off(
|
|
18238
|
-
coreEvents.on(
|
|
18239
|
-
coreEvents.on(
|
|
18254
|
+
coreEvents.off(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18255
|
+
coreEvents.off(CoreEvent.Output, handleOutput);
|
|
18256
|
+
coreEvents.on(CoreEvent.ConsoleLog, handleConsoleLog);
|
|
18257
|
+
coreEvents.on(CoreEvent.Output, handleOutput);
|
|
18240
18258
|
}
|
|
18241
18259
|
function notifyListeners() {
|
|
18242
18260
|
for (const listener of listeners) {
|
|
@@ -20312,7 +20330,7 @@ function usePromptCompletion({
|
|
|
20312
20330
|
{ model: "prompt-completion" },
|
|
20313
20331
|
contents,
|
|
20314
20332
|
signal,
|
|
20315
|
-
|
|
20333
|
+
LlmRole.UTILITY_AUTOCOMPLETE
|
|
20316
20334
|
);
|
|
20317
20335
|
if (signal.aborted) {
|
|
20318
20336
|
return;
|
|
@@ -22049,9 +22067,9 @@ var InputPrompt = ({
|
|
|
22049
22067
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
22050
22068
|
}
|
|
22051
22069
|
}, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
|
|
22052
|
-
const showAutoAcceptStyling = !shellModeActive && approvalMode ===
|
|
22053
|
-
const showYoloStyling = !shellModeActive && approvalMode ===
|
|
22054
|
-
const showPlanStyling = !shellModeActive && approvalMode ===
|
|
22070
|
+
const showAutoAcceptStyling = !shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
|
22071
|
+
const showYoloStyling = !shellModeActive && approvalMode === ApprovalMode.YOLO;
|
|
22072
|
+
const showPlanStyling = !shellModeActive && approvalMode === ApprovalMode.PLAN;
|
|
22055
22073
|
let statusColor;
|
|
22056
22074
|
let statusText = "";
|
|
22057
22075
|
if (shellModeActive) {
|
|
@@ -22897,22 +22915,22 @@ var ApprovalModeIndicator = ({
|
|
|
22897
22915
|
const cycleHint = formatCommand("app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */);
|
|
22898
22916
|
const yoloHint = formatCommand("app.toggleYolo" /* TOGGLE_YOLO */);
|
|
22899
22917
|
switch (approvalMode) {
|
|
22900
|
-
case
|
|
22918
|
+
case ApprovalMode.AUTO_EDIT:
|
|
22901
22919
|
textColor = theme.status.warning;
|
|
22902
22920
|
textContent = "auto-accept edits";
|
|
22903
22921
|
subText = allowPlanMode ? `${cycleHint} to plan` : `${cycleHint} to manual`;
|
|
22904
22922
|
break;
|
|
22905
|
-
case
|
|
22923
|
+
case ApprovalMode.PLAN:
|
|
22906
22924
|
textColor = theme.status.success;
|
|
22907
22925
|
textContent = "plan";
|
|
22908
22926
|
subText = `${cycleHint} to manual`;
|
|
22909
22927
|
break;
|
|
22910
|
-
case
|
|
22928
|
+
case ApprovalMode.YOLO:
|
|
22911
22929
|
textColor = theme.status.error;
|
|
22912
22930
|
textContent = "YOLO";
|
|
22913
22931
|
subText = yoloHint;
|
|
22914
22932
|
break;
|
|
22915
|
-
case
|
|
22933
|
+
case ApprovalMode.DEFAULT:
|
|
22916
22934
|
default:
|
|
22917
22935
|
textColor = theme.text.accent;
|
|
22918
22936
|
textContent = "";
|
|
@@ -22960,7 +22978,7 @@ var useComposerStatus = () => {
|
|
|
22960
22978
|
(item) => item.type === "tool_group"
|
|
22961
22979
|
).some(
|
|
22962
22980
|
(item) => item.tools.some(
|
|
22963
|
-
(tool) => tool.status ===
|
|
22981
|
+
(tool) => tool.status === CoreToolCallStatus.AwaitingApproval
|
|
22964
22982
|
)
|
|
22965
22983
|
),
|
|
22966
22984
|
[uiState.pendingHistoryItems]
|
|
@@ -22975,13 +22993,13 @@ var useComposerStatus = () => {
|
|
|
22975
22993
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
22976
22994
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
22977
22995
|
switch (showApprovalModeIndicator) {
|
|
22978
|
-
case
|
|
22996
|
+
case ApprovalMode.YOLO:
|
|
22979
22997
|
return { text: "YOLO", color: theme.status.error };
|
|
22980
|
-
case
|
|
22998
|
+
case ApprovalMode.PLAN:
|
|
22981
22999
|
return { text: "plan", color: theme.status.success };
|
|
22982
|
-
case
|
|
23000
|
+
case ApprovalMode.AUTO_EDIT:
|
|
22983
23001
|
return { text: "auto edit", color: theme.status.warning };
|
|
22984
|
-
case
|
|
23002
|
+
case ApprovalMode.DEFAULT:
|
|
22985
23003
|
default:
|
|
22986
23004
|
return null;
|
|
22987
23005
|
}
|
|
@@ -23335,7 +23353,7 @@ var ConfigInitDisplay = ({
|
|
|
23335
23353
|
let connected = 0;
|
|
23336
23354
|
const connecting = [];
|
|
23337
23355
|
for (const [name, client] of clients.entries()) {
|
|
23338
|
-
if (client.getStatus() ===
|
|
23356
|
+
if (client.getStatus() === MCPServerStatus.CONNECTED) {
|
|
23339
23357
|
connected++;
|
|
23340
23358
|
} else {
|
|
23341
23359
|
connecting.push(name);
|
|
@@ -23357,9 +23375,9 @@ var ConfigInitDisplay = ({
|
|
|
23357
23375
|
);
|
|
23358
23376
|
}
|
|
23359
23377
|
};
|
|
23360
|
-
coreEvents.on(
|
|
23378
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
23361
23379
|
return () => {
|
|
23362
|
-
coreEvents.off(
|
|
23380
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
23363
23381
|
};
|
|
23364
23382
|
}, [initialMessage]);
|
|
23365
23383
|
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(Text, { children: [
|
|
@@ -24084,7 +24102,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24084
24102
|
callId,
|
|
24085
24103
|
name: SHELL_COMMAND_NAME,
|
|
24086
24104
|
description: rawQuery,
|
|
24087
|
-
status:
|
|
24105
|
+
status: CoreToolCallStatus.Executing,
|
|
24088
24106
|
isClientInitiated: true,
|
|
24089
24107
|
resultDisplay: "",
|
|
24090
24108
|
confirmationDetails: void 0
|
|
@@ -24210,7 +24228,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24210
24228
|
mainContent = result.output.trim() || "(Command produced no output)";
|
|
24211
24229
|
}
|
|
24212
24230
|
let finalOutput = result.ansiOutput && result.ansiOutput.length > 0 ? result.ansiOutput : mainContent;
|
|
24213
|
-
let finalStatus =
|
|
24231
|
+
let finalStatus = CoreToolCallStatus.Success;
|
|
24214
24232
|
const prependToAnsiOutput = (output, text) => {
|
|
24215
24233
|
const newLines = text.split("\n").map((line) => [
|
|
24216
24234
|
{
|
|
@@ -24229,20 +24247,20 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24229
24247
|
};
|
|
24230
24248
|
let prefix = "";
|
|
24231
24249
|
if (result.error) {
|
|
24232
|
-
finalStatus =
|
|
24250
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24233
24251
|
prefix = result.error.message;
|
|
24234
24252
|
} else if (result.aborted) {
|
|
24235
|
-
finalStatus =
|
|
24253
|
+
finalStatus = CoreToolCallStatus.Cancelled;
|
|
24236
24254
|
prefix = "Command was cancelled.";
|
|
24237
24255
|
} else if (result.backgrounded) {
|
|
24238
|
-
finalStatus =
|
|
24256
|
+
finalStatus = CoreToolCallStatus.Success;
|
|
24239
24257
|
finalOutput = `Command moved to background (PID: ${result.pid}). Output hidden. Press Ctrl+B to view.`;
|
|
24240
24258
|
mainContent = finalOutput;
|
|
24241
24259
|
} else if (result.signal) {
|
|
24242
|
-
finalStatus =
|
|
24260
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24243
24261
|
prefix = `Command terminated by signal: ${result.signal}.`;
|
|
24244
24262
|
} else if (result.exitCode !== 0) {
|
|
24245
|
-
finalStatus =
|
|
24263
|
+
finalStatus = CoreToolCallStatus.Error;
|
|
24246
24264
|
prefix = `Command exited with code ${result.exitCode}.`;
|
|
24247
24265
|
}
|
|
24248
24266
|
if (prefix) {
|
|
@@ -24268,7 +24286,7 @@ ${mainContent}`;
|
|
|
24268
24286
|
status: finalStatus,
|
|
24269
24287
|
resultDisplay: finalOutput
|
|
24270
24288
|
};
|
|
24271
|
-
if (finalStatus !==
|
|
24289
|
+
if (finalStatus !== CoreToolCallStatus.Cancelled) {
|
|
24272
24290
|
addItemToHistory(
|
|
24273
24291
|
{
|
|
24274
24292
|
type: "tool_group",
|
|
@@ -25249,7 +25267,7 @@ function useQuotaAndFallback({
|
|
|
25249
25267
|
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25250
25268
|
`/stats model for usage details`,
|
|
25251
25269
|
`/model to switch models.`,
|
|
25252
|
-
contentGeneratorConfig?.authType ===
|
|
25270
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25253
25271
|
].filter(Boolean);
|
|
25254
25272
|
message = messageLines.join("\n");
|
|
25255
25273
|
} else if (error instanceof ModelNotFoundError) {
|
|
@@ -25437,7 +25455,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25437
25455
|
);
|
|
25438
25456
|
setEditorError(null);
|
|
25439
25457
|
setIsEditorDialogOpen(false);
|
|
25440
|
-
coreEvents.emit(
|
|
25458
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: editorType });
|
|
25441
25459
|
} catch (error) {
|
|
25442
25460
|
setEditorError(`Failed to set editor preference: ${error}`);
|
|
25443
25461
|
}
|
|
@@ -25446,7 +25464,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25446
25464
|
);
|
|
25447
25465
|
const exitEditorDialog = (0, import_react95.useCallback)(() => {
|
|
25448
25466
|
setIsEditorDialogOpen(false);
|
|
25449
|
-
coreEvents.emit(
|
|
25467
|
+
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25450
25468
|
}, []);
|
|
25451
25469
|
return {
|
|
25452
25470
|
isEditorDialogOpen,
|
|
@@ -25801,7 +25819,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25801
25819
|
canonicalPath: resolvedCommandPath
|
|
25802
25820
|
} = parseSlashCommand(trimmed, commands);
|
|
25803
25821
|
if (!commandToExecute) {
|
|
25804
|
-
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() ===
|
|
25822
|
+
const isMcpLoading = config?.getMcpClientManager()?.getDiscoveryState() === MCPDiscoveryState.IN_PROGRESS;
|
|
25805
25823
|
if (isMcpLoading) {
|
|
25806
25824
|
setIsProcessing(true);
|
|
25807
25825
|
if (addToHistory) {
|
|
@@ -25969,7 +25987,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25969
25987
|
onConfirm: async (resolvedOutcome) => {
|
|
25970
25988
|
resolve3({
|
|
25971
25989
|
outcome: resolvedOutcome,
|
|
25972
|
-
approvedCommands: resolvedOutcome ===
|
|
25990
|
+
approvedCommands: resolvedOutcome === ToolConfirmationOutcome.Cancel ? [] : result.commandsToConfirm
|
|
25973
25991
|
});
|
|
25974
25992
|
}
|
|
25975
25993
|
};
|
|
@@ -25977,7 +25995,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25977
25995
|
callId,
|
|
25978
25996
|
name: "Expansion",
|
|
25979
25997
|
description: "Command expansion needs shell access",
|
|
25980
|
-
status:
|
|
25998
|
+
status: CoreToolCallStatus.AwaitingApproval,
|
|
25981
25999
|
isClientInitiated: true,
|
|
25982
26000
|
resultDisplay: void 0,
|
|
25983
26001
|
confirmationDetails
|
|
@@ -25988,7 +26006,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25988
26006
|
});
|
|
25989
26007
|
});
|
|
25990
26008
|
setPendingItem(null);
|
|
25991
|
-
if (outcome ===
|
|
26009
|
+
if (outcome === ToolConfirmationOutcome.Cancel || !approvedCommands || approvedCommands.length === 0) {
|
|
25992
26010
|
addItem(
|
|
25993
26011
|
{
|
|
25994
26012
|
type: "info" /* INFO */,
|
|
@@ -25998,7 +26016,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25998
26016
|
);
|
|
25999
26017
|
return { type: "handled" };
|
|
26000
26018
|
}
|
|
26001
|
-
if (outcome ===
|
|
26019
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
26002
26020
|
setSessionShellAllowlist(
|
|
26003
26021
|
(prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
|
|
26004
26022
|
);
|
|
@@ -26474,7 +26492,7 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26474
26492
|
let description;
|
|
26475
26493
|
let renderOutputAsMarkdown = false;
|
|
26476
26494
|
const displayName = call.tool?.displayName ?? call.request.name;
|
|
26477
|
-
if (call.status ===
|
|
26495
|
+
if (call.status === CoreToolCallStatus.Error) {
|
|
26478
26496
|
description = JSON.stringify(call.request.args);
|
|
26479
26497
|
} else {
|
|
26480
26498
|
description = call.invocation.getDescription();
|
|
@@ -26497,27 +26515,27 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26497
26515
|
let progress = void 0;
|
|
26498
26516
|
let progressTotal = void 0;
|
|
26499
26517
|
switch (call.status) {
|
|
26500
|
-
case
|
|
26518
|
+
case CoreToolCallStatus.Success:
|
|
26501
26519
|
resultDisplay = call.response.resultDisplay;
|
|
26502
26520
|
outputFile = call.response.outputFile;
|
|
26503
26521
|
break;
|
|
26504
|
-
case
|
|
26505
|
-
case
|
|
26522
|
+
case CoreToolCallStatus.Error:
|
|
26523
|
+
case CoreToolCallStatus.Cancelled:
|
|
26506
26524
|
resultDisplay = call.response.resultDisplay;
|
|
26507
26525
|
break;
|
|
26508
|
-
case
|
|
26526
|
+
case CoreToolCallStatus.AwaitingApproval:
|
|
26509
26527
|
correlationId = call.correlationId;
|
|
26510
26528
|
confirmationDetails = call.confirmationDetails;
|
|
26511
26529
|
break;
|
|
26512
|
-
case
|
|
26530
|
+
case CoreToolCallStatus.Executing:
|
|
26513
26531
|
resultDisplay = call.liveOutput;
|
|
26514
26532
|
ptyId = call.pid;
|
|
26515
26533
|
progressMessage = call.progressMessage;
|
|
26516
26534
|
progress = call.progress;
|
|
26517
26535
|
progressTotal = call.progressTotal;
|
|
26518
26536
|
break;
|
|
26519
|
-
case
|
|
26520
|
-
case
|
|
26537
|
+
case CoreToolCallStatus.Scheduled:
|
|
26538
|
+
case CoreToolCallStatus.Validating:
|
|
26521
26539
|
break;
|
|
26522
26540
|
default: {
|
|
26523
26541
|
const exhaustiveCheck = call;
|
|
@@ -26588,7 +26606,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26588
26606
|
const handler = (event) => {
|
|
26589
26607
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26590
26608
|
const hasExecuting = event.toolCalls.some(
|
|
26591
|
-
(tc) => tc.status ===
|
|
26609
|
+
(tc) => tc.status === CoreToolCallStatus.Executing || (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error) && "tailToolCallRequest" in tc && tc.tailToolCallRequest != null
|
|
26592
26610
|
);
|
|
26593
26611
|
if (hasExecuting) {
|
|
26594
26612
|
setLastToolOutputTime(Date.now());
|
|
@@ -26597,7 +26615,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26597
26615
|
const prevCalls = prev[event.schedulerId] ?? [];
|
|
26598
26616
|
const prevCallIds = new Set(prevCalls.map((tc) => tc.request.callId));
|
|
26599
26617
|
const filteredToolCalls = isRoot ? event.toolCalls : event.toolCalls.filter(
|
|
26600
|
-
(tc) => tc.status ===
|
|
26618
|
+
(tc) => tc.status === CoreToolCallStatus.AwaitingApproval || prevCallIds.has(tc.request.callId)
|
|
26601
26619
|
);
|
|
26602
26620
|
if (!isRoot && filteredToolCalls.length === 0 && prevCalls.length === 0) {
|
|
26603
26621
|
return prev;
|
|
@@ -26609,9 +26627,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26609
26627
|
};
|
|
26610
26628
|
});
|
|
26611
26629
|
};
|
|
26612
|
-
messageBus.subscribe(
|
|
26630
|
+
messageBus.subscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26613
26631
|
return () => {
|
|
26614
|
-
messageBus.unsubscribe(
|
|
26632
|
+
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26615
26633
|
};
|
|
26616
26634
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26617
26635
|
(0, import_react101.useEffect)(() => {
|
|
@@ -26633,9 +26651,9 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26633
26651
|
};
|
|
26634
26652
|
});
|
|
26635
26653
|
};
|
|
26636
|
-
messageBus.subscribe(
|
|
26654
|
+
messageBus.subscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26637
26655
|
return () => {
|
|
26638
|
-
messageBus.unsubscribe(
|
|
26656
|
+
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26639
26657
|
};
|
|
26640
26658
|
}, [messageBus]);
|
|
26641
26659
|
const schedule = (0, import_react101.useCallback)(
|
|
@@ -26734,8 +26752,8 @@ function adaptToolCalls(coreCalls, prevTracked) {
|
|
|
26734
26752
|
const prev = prevMap.get(coreCall.request.callId);
|
|
26735
26753
|
const responseSubmittedToGemini = prev?.responseSubmittedToGemini ?? false;
|
|
26736
26754
|
let status = coreCall.status;
|
|
26737
|
-
if ((status ===
|
|
26738
|
-
status =
|
|
26755
|
+
if ((status === CoreToolCallStatus.Success || status === CoreToolCallStatus.Error) && "tailToolCallRequest" in coreCall && coreCall.tailToolCallRequest != null) {
|
|
26756
|
+
status = CoreToolCallStatus.Executing;
|
|
26739
26757
|
}
|
|
26740
26758
|
return {
|
|
26741
26759
|
...coreCall,
|
|
@@ -26767,7 +26785,7 @@ function getBackgroundedToolInfo(toolCall) {
|
|
|
26767
26785
|
};
|
|
26768
26786
|
}
|
|
26769
26787
|
function isBackgroundableExecutingToolCall(toolCall) {
|
|
26770
|
-
return toolCall.status ===
|
|
26788
|
+
return toolCall.status === CoreToolCallStatus.Executing && typeof toolCall.pid === "number";
|
|
26771
26789
|
}
|
|
26772
26790
|
function showCitations(settings) {
|
|
26773
26791
|
const enabled = settings.merged.ui.showCitations;
|
|
@@ -26777,14 +26795,14 @@ function showCitations(settings) {
|
|
|
26777
26795
|
return true;
|
|
26778
26796
|
}
|
|
26779
26797
|
function calculateStreamingState(isResponding, toolCalls) {
|
|
26780
|
-
if (toolCalls.some((tc) => tc.status ===
|
|
26798
|
+
if (toolCalls.some((tc) => tc.status === CoreToolCallStatus.AwaitingApproval)) {
|
|
26781
26799
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
26782
26800
|
}
|
|
26783
26801
|
const isAnyToolActive = toolCalls.some((tc) => {
|
|
26784
|
-
if (tc.status ===
|
|
26802
|
+
if (tc.status === CoreToolCallStatus.Executing || tc.status === CoreToolCallStatus.Scheduled || tc.status === CoreToolCallStatus.Validating) {
|
|
26785
26803
|
return true;
|
|
26786
26804
|
}
|
|
26787
|
-
if (tc.status ===
|
|
26805
|
+
if (tc.status === CoreToolCallStatus.Success || tc.status === CoreToolCallStatus.Error || tc.status === CoreToolCallStatus.Cancelled) {
|
|
26788
26806
|
return !tc.responseSubmittedToGemini;
|
|
26789
26807
|
}
|
|
26790
26808
|
return false;
|
|
@@ -26831,9 +26849,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
26831
26849
|
}
|
|
26832
26850
|
setRetryStatus(payload);
|
|
26833
26851
|
};
|
|
26834
|
-
coreEvents.on(
|
|
26852
|
+
coreEvents.on(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
26835
26853
|
return () => {
|
|
26836
|
-
coreEvents.off(
|
|
26854
|
+
coreEvents.off(CoreEvent.RetryAttempt, handleRetryAttempt);
|
|
26837
26855
|
};
|
|
26838
26856
|
}, [isRespondingRef]);
|
|
26839
26857
|
const [
|
|
@@ -26966,12 +26984,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
26966
26984
|
const tc = toolCalls[i];
|
|
26967
26985
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
26968
26986
|
if (tc.status === "success" || tc.status === "error" || tc.status === "cancelled") {
|
|
26969
|
-
const isAgent = tc.tool?.kind ===
|
|
26987
|
+
const isAgent = tc.tool?.kind === Kind.Agent;
|
|
26970
26988
|
if (isAgent) {
|
|
26971
26989
|
let contigAgentsComplete = true;
|
|
26972
26990
|
for (let j = i + 1; j < toolCalls.length; j++) {
|
|
26973
26991
|
const nextTc = toolCalls[j];
|
|
26974
|
-
if (nextTc.tool?.kind ===
|
|
26992
|
+
if (nextTc.tool?.kind === Kind.Agent) {
|
|
26975
26993
|
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
26976
26994
|
contigAgentsComplete = false;
|
|
26977
26995
|
break;
|
|
@@ -26997,7 +27015,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
26997
27015
|
let currentGroup = [];
|
|
26998
27016
|
for (const tc of toolsToPush) {
|
|
26999
27017
|
newPushed.add(tc.request.callId);
|
|
27000
|
-
if (tc.tool?.kind ===
|
|
27018
|
+
if (tc.tool?.kind === Kind.Agent) {
|
|
27001
27019
|
currentGroup.push(tc);
|
|
27002
27020
|
} else {
|
|
27003
27021
|
if (currentGroup.length > 0) {
|
|
@@ -27147,7 +27165,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27147
27165
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
27148
27166
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
27149
27167
|
(0, import_react102.useEffect)(() => {
|
|
27150
|
-
if (config.getApprovalMode() ===
|
|
27168
|
+
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
27151
27169
|
const lastUserMessageIndex = history.findLastIndex(
|
|
27152
27170
|
(item) => item.type === "user" /* USER */
|
|
27153
27171
|
);
|
|
@@ -27233,7 +27251,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27233
27251
|
if (tool.name === SHELL_COMMAND_NAME) {
|
|
27234
27252
|
return {
|
|
27235
27253
|
...tool,
|
|
27236
|
-
status:
|
|
27254
|
+
status: CoreToolCallStatus.Cancelled,
|
|
27237
27255
|
resultDisplay: tool.resultDisplay
|
|
27238
27256
|
};
|
|
27239
27257
|
}
|
|
@@ -27289,7 +27307,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27289
27307
|
let localQueryToSendToGemini = null;
|
|
27290
27308
|
if (typeof query === "string") {
|
|
27291
27309
|
const trimmedQuery = query.trim();
|
|
27292
|
-
await logger?.logMessage(
|
|
27310
|
+
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
|
27293
27311
|
if (!shellModeActive) {
|
|
27294
27312
|
const slashCommandResult = isSlashCommand(trimmedQuery) ? await handleSlashCommand(trimmedQuery) : false;
|
|
27295
27313
|
if (slashCommandResult) {
|
|
@@ -27445,7 +27463,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27445
27463
|
if (pendingHistoryItemRef.current) {
|
|
27446
27464
|
if (pendingHistoryItemRef.current.type === "tool_group") {
|
|
27447
27465
|
const updatedTools = pendingHistoryItemRef.current.tools.map(
|
|
27448
|
-
(tool) => tool.status ===
|
|
27466
|
+
(tool) => tool.status === CoreToolCallStatus.Validating || tool.status === CoreToolCallStatus.Scheduled || tool.status === CoreToolCallStatus.AwaitingApproval || tool.status === CoreToolCallStatus.Executing ? { ...tool, status: CoreToolCallStatus.Cancelled } : tool
|
|
27449
27467
|
);
|
|
27450
27468
|
const pendingItem = {
|
|
27451
27469
|
...pendingHistoryItemRef.current,
|
|
@@ -27691,15 +27709,15 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27691
27709
|
let geminiMessageBuffer = "";
|
|
27692
27710
|
const toolCallRequests = [];
|
|
27693
27711
|
for await (const event of stream) {
|
|
27694
|
-
if (event.type !==
|
|
27712
|
+
if (event.type !== GeminiEventType.Thought && thoughtRef.current !== null) {
|
|
27695
27713
|
setThought(null);
|
|
27696
27714
|
}
|
|
27697
27715
|
switch (event.type) {
|
|
27698
|
-
case
|
|
27716
|
+
case GeminiEventType.Thought:
|
|
27699
27717
|
setLastGeminiActivityTime(Date.now());
|
|
27700
27718
|
handleThoughtEvent(event.value, userMessageTimestamp);
|
|
27701
27719
|
break;
|
|
27702
|
-
case
|
|
27720
|
+
case GeminiEventType.Content:
|
|
27703
27721
|
setLastGeminiActivityTime(Date.now());
|
|
27704
27722
|
geminiMessageBuffer = handleContentEvent(
|
|
27705
27723
|
event.value,
|
|
@@ -27707,16 +27725,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27707
27725
|
userMessageTimestamp
|
|
27708
27726
|
);
|
|
27709
27727
|
break;
|
|
27710
|
-
case
|
|
27728
|
+
case GeminiEventType.ToolCallRequest:
|
|
27711
27729
|
toolCallRequests.push(event.value);
|
|
27712
27730
|
break;
|
|
27713
|
-
case
|
|
27731
|
+
case GeminiEventType.UserCancelled:
|
|
27714
27732
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
27715
27733
|
break;
|
|
27716
|
-
case
|
|
27734
|
+
case GeminiEventType.Error:
|
|
27717
27735
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
27718
27736
|
break;
|
|
27719
|
-
case
|
|
27737
|
+
case GeminiEventType.AgentExecutionStopped:
|
|
27720
27738
|
handleAgentExecutionStoppedEvent(
|
|
27721
27739
|
event.value.reason,
|
|
27722
27740
|
userMessageTimestamp,
|
|
@@ -27724,7 +27742,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27724
27742
|
event.value.contextCleared
|
|
27725
27743
|
);
|
|
27726
27744
|
break;
|
|
27727
|
-
case
|
|
27745
|
+
case GeminiEventType.AgentExecutionBlocked:
|
|
27728
27746
|
handleAgentExecutionBlockedEvent(
|
|
27729
27747
|
event.value.reason,
|
|
27730
27748
|
userMessageTimestamp,
|
|
@@ -27732,35 +27750,35 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27732
27750
|
event.value.contextCleared
|
|
27733
27751
|
);
|
|
27734
27752
|
break;
|
|
27735
|
-
case
|
|
27753
|
+
case GeminiEventType.ChatCompressed:
|
|
27736
27754
|
handleChatCompressionEvent(event.value, userMessageTimestamp);
|
|
27737
27755
|
break;
|
|
27738
|
-
case
|
|
27739
|
-
case
|
|
27756
|
+
case GeminiEventType.ToolCallConfirmation:
|
|
27757
|
+
case GeminiEventType.ToolCallResponse:
|
|
27740
27758
|
break;
|
|
27741
|
-
case
|
|
27759
|
+
case GeminiEventType.MaxSessionTurns:
|
|
27742
27760
|
handleMaxSessionTurnsEvent();
|
|
27743
27761
|
break;
|
|
27744
|
-
case
|
|
27762
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
27745
27763
|
handleContextWindowWillOverflowEvent(
|
|
27746
27764
|
event.value.estimatedRequestTokenCount,
|
|
27747
27765
|
event.value.remainingTokenCount
|
|
27748
27766
|
);
|
|
27749
27767
|
break;
|
|
27750
|
-
case
|
|
27768
|
+
case GeminiEventType.Finished:
|
|
27751
27769
|
handleFinishedEvent(event, userMessageTimestamp);
|
|
27752
27770
|
break;
|
|
27753
|
-
case
|
|
27771
|
+
case GeminiEventType.Citation:
|
|
27754
27772
|
handleCitationEvent(event.value, userMessageTimestamp);
|
|
27755
27773
|
break;
|
|
27756
|
-
case
|
|
27774
|
+
case GeminiEventType.ModelInfo:
|
|
27757
27775
|
handleChatModelEvent(event.value, userMessageTimestamp);
|
|
27758
27776
|
break;
|
|
27759
|
-
case
|
|
27777
|
+
case GeminiEventType.LoopDetected:
|
|
27760
27778
|
loopDetectedRef.current = true;
|
|
27761
27779
|
break;
|
|
27762
|
-
case
|
|
27763
|
-
case
|
|
27780
|
+
case GeminiEventType.Retry:
|
|
27781
|
+
case GeminiEventType.InvalidStream:
|
|
27764
27782
|
break;
|
|
27765
27783
|
default: {
|
|
27766
27784
|
const unreachable = event;
|
|
@@ -27801,7 +27819,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27801
27819
|
const submitQuery = (0, import_react102.useCallback)(
|
|
27802
27820
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
27803
27821
|
{
|
|
27804
|
-
operation: options?.isContinuation ?
|
|
27822
|
+
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
27805
27823
|
sessionId: config.getSessionId()
|
|
27806
27824
|
},
|
|
27807
27825
|
async ({ metadata: spanMetadata }) => {
|
|
@@ -27962,7 +27980,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27962
27980
|
);
|
|
27963
27981
|
const handleApprovalModeChange = (0, import_react102.useCallback)(
|
|
27964
27982
|
async (newApprovalMode) => {
|
|
27965
|
-
if (previousApprovalModeRef.current ===
|
|
27983
|
+
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
27966
27984
|
if (geminiClient) {
|
|
27967
27985
|
try {
|
|
27968
27986
|
await geminiClient.addHistory({
|
|
@@ -27985,11 +28003,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27985
28003
|
}
|
|
27986
28004
|
}
|
|
27987
28005
|
previousApprovalModeRef.current = newApprovalMode;
|
|
27988
|
-
if (newApprovalMode ===
|
|
28006
|
+
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
27989
28007
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
27990
28008
|
(call) => call.status === "awaiting_approval" && !call.request.forcedAsk
|
|
27991
28009
|
);
|
|
27992
|
-
if (newApprovalMode ===
|
|
28010
|
+
if (newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
27993
28011
|
awaitingApprovalCalls = awaitingApprovalCalls.filter(
|
|
27994
28012
|
(call) => EDIT_TOOL_NAMES.has(call.request.name)
|
|
27995
28013
|
);
|
|
@@ -27998,11 +28016,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27998
28016
|
if (call.correlationId) {
|
|
27999
28017
|
try {
|
|
28000
28018
|
await config.getMessageBus().publish({
|
|
28001
|
-
type:
|
|
28019
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
28002
28020
|
correlationId: call.correlationId,
|
|
28003
28021
|
confirmed: true,
|
|
28004
28022
|
requiresUserConfirmation: false,
|
|
28005
|
-
outcome:
|
|
28023
|
+
outcome: ToolConfirmationOutcome.ProceedOnce
|
|
28006
28024
|
});
|
|
28007
28025
|
} catch (error) {
|
|
28008
28026
|
debugLogger.warn(
|
|
@@ -28080,14 +28098,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28080
28098
|
);
|
|
28081
28099
|
if (isLowErrorVerbosity) {
|
|
28082
28100
|
suppressedToolErrorCountRef.current += geminiTools.filter(
|
|
28083
|
-
(tc) => tc.status ===
|
|
28101
|
+
(tc) => tc.status === CoreToolCallStatus.Error
|
|
28084
28102
|
).length;
|
|
28085
28103
|
}
|
|
28086
28104
|
if (geminiTools.length === 0) {
|
|
28087
28105
|
return;
|
|
28088
28106
|
}
|
|
28089
28107
|
const stopExecutionTool = geminiTools.find(
|
|
28090
|
-
(tc) => tc.response.errorType ===
|
|
28108
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
28091
28109
|
);
|
|
28092
28110
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
28093
28111
|
maybeAddSuppressedToolErrorNote();
|
|
@@ -28107,9 +28125,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28107
28125
|
(tc) => !isTopicTool2(tc.request.name)
|
|
28108
28126
|
);
|
|
28109
28127
|
const allDeclinableToolsCancelled = declinableTools.length > 0 && declinableTools.every(
|
|
28110
|
-
(tc) => tc.status ===
|
|
28128
|
+
(tc) => tc.status === CoreToolCallStatus.Cancelled
|
|
28111
28129
|
);
|
|
28112
|
-
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status ===
|
|
28130
|
+
const allToolsCancelled = geminiTools.length > 0 && geminiTools.every((tc) => tc.status === CoreToolCallStatus.Cancelled);
|
|
28113
28131
|
if (allDeclinableToolsCancelled || allToolsCancelled) {
|
|
28114
28132
|
if (!turnCancelledRef.current) {
|
|
28115
28133
|
addItem({
|
|
@@ -28190,7 +28208,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28190
28208
|
return;
|
|
28191
28209
|
}
|
|
28192
28210
|
const restorableToolCalls = toolCalls.filter(
|
|
28193
|
-
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status ===
|
|
28211
|
+
(toolCall) => EDIT_TOOL_NAMES.has(toolCall.request.name) && toolCall.status === CoreToolCallStatus.AwaitingApproval
|
|
28194
28212
|
);
|
|
28195
28213
|
if (restorableToolCalls.length > 0) {
|
|
28196
28214
|
if (!gitService) {
|
|
@@ -28409,14 +28427,14 @@ var useAgentStream = ({
|
|
|
28409
28427
|
const displayName = legacyState?.displayName ?? event.name;
|
|
28410
28428
|
const isOutputMarkdown = legacyState?.isOutputMarkdown ?? false;
|
|
28411
28429
|
const desc = legacyState?.description ?? "";
|
|
28412
|
-
const fallbackKind =
|
|
28430
|
+
const fallbackKind = Kind.Other;
|
|
28413
28431
|
const newCall = {
|
|
28414
28432
|
callId: event.requestId,
|
|
28415
28433
|
name: displayName,
|
|
28416
28434
|
originalRequestName: event.name,
|
|
28417
28435
|
description: desc,
|
|
28418
28436
|
display: event.display,
|
|
28419
|
-
status:
|
|
28437
|
+
status: CoreToolCallStatus.Scheduled,
|
|
28420
28438
|
isClientInitiated: false,
|
|
28421
28439
|
renderOutputAsMarkdown: isOutputMarkdown,
|
|
28422
28440
|
kind: legacyState?.kind ?? fallbackKind,
|
|
@@ -28434,10 +28452,10 @@ var useAgentStream = ({
|
|
|
28434
28452
|
const evtStatus = legacyState?.status;
|
|
28435
28453
|
let status = tc.status;
|
|
28436
28454
|
if (evtStatus === "executing")
|
|
28437
|
-
status =
|
|
28438
|
-
else if (evtStatus === "error") status =
|
|
28455
|
+
status = CoreToolCallStatus.Executing;
|
|
28456
|
+
else if (evtStatus === "error") status = CoreToolCallStatus.Error;
|
|
28439
28457
|
else if (evtStatus === "success")
|
|
28440
|
-
status =
|
|
28458
|
+
status = CoreToolCallStatus.Success;
|
|
28441
28459
|
const display = event.display?.result;
|
|
28442
28460
|
const liveOutput = displayContentToString(display) ?? tc.resultDisplay;
|
|
28443
28461
|
const progressMessage = legacyState?.progressMessage ?? tc.progressMessage;
|
|
@@ -28470,7 +28488,7 @@ var useAgentStream = ({
|
|
|
28470
28488
|
const resultDisplay = displayContentToString(display) ?? tc.resultDisplay;
|
|
28471
28489
|
return {
|
|
28472
28490
|
...tc,
|
|
28473
|
-
status: event.isError ?
|
|
28491
|
+
status: event.isError ? CoreToolCallStatus.Error : CoreToolCallStatus.Success,
|
|
28474
28492
|
display: event.display ? { ...tc.display, ...event.display } : tc.display,
|
|
28475
28493
|
resultDisplay,
|
|
28476
28494
|
outputFile
|
|
@@ -28522,7 +28540,7 @@ var useAgentStream = ({
|
|
|
28522
28540
|
if (!options?.isContinuation) {
|
|
28523
28541
|
if (typeof query === "string") {
|
|
28524
28542
|
addItem({ type: "user" /* USER */, text: query }, timestamp);
|
|
28525
|
-
void logger?.logMessage(
|
|
28543
|
+
void logger?.logMessage(MessageSenderType.USER, query);
|
|
28526
28544
|
}
|
|
28527
28545
|
startNewPrompt();
|
|
28528
28546
|
}
|
|
@@ -31042,7 +31060,7 @@ function useMessageQueue({
|
|
|
31042
31060
|
var import_react110 = __toESM(require_react(), 1);
|
|
31043
31061
|
function useMcpStatus(config) {
|
|
31044
31062
|
const [discoveryState, setDiscoveryState] = (0, import_react110.useState)(
|
|
31045
|
-
() => config.getMcpClientManager()?.getDiscoveryState() ??
|
|
31063
|
+
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31046
31064
|
);
|
|
31047
31065
|
const [mcpServerCount, setMcpServerCount] = (0, import_react110.useState)(
|
|
31048
31066
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
@@ -31055,12 +31073,12 @@ function useMcpStatus(config) {
|
|
|
31055
31073
|
setMcpServerCount(manager.getMcpServerCount());
|
|
31056
31074
|
}
|
|
31057
31075
|
};
|
|
31058
|
-
coreEvents.on(
|
|
31076
|
+
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
|
|
31059
31077
|
return () => {
|
|
31060
|
-
coreEvents.off(
|
|
31078
|
+
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
|
|
31061
31079
|
};
|
|
31062
31080
|
}, [config]);
|
|
31063
|
-
const isMcpReady = discoveryState ===
|
|
31081
|
+
const isMcpReady = discoveryState === MCPDiscoveryState.COMPLETED || discoveryState === MCPDiscoveryState.NOT_STARTED && mcpServerCount === 0;
|
|
31064
31082
|
return {
|
|
31065
31083
|
discoveryState,
|
|
31066
31084
|
mcpServerCount,
|
|
@@ -31087,7 +31105,7 @@ function useApprovalModeIndicator({
|
|
|
31087
31105
|
(key) => {
|
|
31088
31106
|
let nextApprovalMode;
|
|
31089
31107
|
if (keyMatchers["app.toggleYolo" /* TOGGLE_YOLO */](key)) {
|
|
31090
|
-
if (config.isYoloModeDisabled() && config.getApprovalMode() !==
|
|
31108
|
+
if (config.isYoloModeDisabled() && config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
31091
31109
|
if (addItem) {
|
|
31092
31110
|
let text = "You cannot enter YOLO mode since it is disabled in your settings.";
|
|
31093
31111
|
const adminSettings = config.getRemoteAdminSettings();
|
|
@@ -31105,21 +31123,21 @@ function useApprovalModeIndicator({
|
|
|
31105
31123
|
}
|
|
31106
31124
|
return;
|
|
31107
31125
|
}
|
|
31108
|
-
nextApprovalMode = config.getApprovalMode() ===
|
|
31126
|
+
nextApprovalMode = config.getApprovalMode() === ApprovalMode.YOLO ? ApprovalMode.DEFAULT : ApprovalMode.YOLO;
|
|
31109
31127
|
} else if (keyMatchers["app.cycleApprovalMode" /* CYCLE_APPROVAL_MODE */](key)) {
|
|
31110
31128
|
const currentMode = config.getApprovalMode();
|
|
31111
31129
|
switch (currentMode) {
|
|
31112
|
-
case
|
|
31113
|
-
nextApprovalMode =
|
|
31130
|
+
case ApprovalMode.DEFAULT:
|
|
31131
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31114
31132
|
break;
|
|
31115
|
-
case
|
|
31116
|
-
nextApprovalMode = allowPlanMode ?
|
|
31133
|
+
case ApprovalMode.AUTO_EDIT:
|
|
31134
|
+
nextApprovalMode = allowPlanMode ? ApprovalMode.PLAN : ApprovalMode.DEFAULT;
|
|
31117
31135
|
break;
|
|
31118
|
-
case
|
|
31119
|
-
nextApprovalMode =
|
|
31136
|
+
case ApprovalMode.PLAN:
|
|
31137
|
+
nextApprovalMode = ApprovalMode.DEFAULT;
|
|
31120
31138
|
break;
|
|
31121
|
-
case
|
|
31122
|
-
nextApprovalMode =
|
|
31139
|
+
case ApprovalMode.YOLO:
|
|
31140
|
+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
|
|
31123
31141
|
break;
|
|
31124
31142
|
default:
|
|
31125
31143
|
}
|
|
@@ -31512,11 +31530,11 @@ var useHookDisplayState = () => {
|
|
|
31512
31530
|
removeHook();
|
|
31513
31531
|
}
|
|
31514
31532
|
};
|
|
31515
|
-
coreEvents.on(
|
|
31516
|
-
coreEvents.on(
|
|
31533
|
+
coreEvents.on(CoreEvent.HookStart, handleHookStart);
|
|
31534
|
+
coreEvents.on(CoreEvent.HookEnd, handleHookEnd);
|
|
31517
31535
|
return () => {
|
|
31518
|
-
coreEvents.off(
|
|
31519
|
-
coreEvents.off(
|
|
31536
|
+
coreEvents.off(CoreEvent.HookStart, handleHookStart);
|
|
31537
|
+
coreEvents.off(CoreEvent.HookEnd, handleHookEnd);
|
|
31520
31538
|
activeTimeouts.forEach(clearTimeout);
|
|
31521
31539
|
activeTimeouts.clear();
|
|
31522
31540
|
};
|
|
@@ -32361,7 +32379,7 @@ var AppContainer = (props) => {
|
|
|
32361
32379
|
debugLogger.error("Failed to start memory service:", e);
|
|
32362
32380
|
});
|
|
32363
32381
|
}
|
|
32364
|
-
const sessionStartSource = resumedSessionData ?
|
|
32382
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
32365
32383
|
const result = await config.getHookSystem()?.fireSessionStartEvent(sessionStartSource);
|
|
32366
32384
|
if (result) {
|
|
32367
32385
|
if (result.systemMessage) {
|
|
@@ -32397,7 +32415,7 @@ var AppContainer = (props) => {
|
|
|
32397
32415
|
);
|
|
32398
32416
|
const ideClient = await IdeClient.getInstance();
|
|
32399
32417
|
await ideClient.disconnect();
|
|
32400
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
32418
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
32401
32419
|
};
|
|
32402
32420
|
registerCleanup(cleanupFn);
|
|
32403
32421
|
return () => {
|
|
@@ -32422,11 +32440,11 @@ var AppContainer = (props) => {
|
|
|
32422
32440
|
resetTime: payload.resetTime
|
|
32423
32441
|
});
|
|
32424
32442
|
};
|
|
32425
|
-
coreEvents.on(
|
|
32426
|
-
coreEvents.on(
|
|
32443
|
+
coreEvents.on(CoreEvent.ModelChanged, handleModelChanged);
|
|
32444
|
+
coreEvents.on(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32427
32445
|
return () => {
|
|
32428
|
-
coreEvents.off(
|
|
32429
|
-
coreEvents.off(
|
|
32446
|
+
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
|
32447
|
+
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
32430
32448
|
};
|
|
32431
32449
|
}, [config]);
|
|
32432
32450
|
(0, import_react124.useEffect)(() => {
|
|
@@ -32439,16 +32457,16 @@ var AppContainer = (props) => {
|
|
|
32439
32457
|
const handleAgentsDiscovered = (payload) => {
|
|
32440
32458
|
setNewAgents(payload.agents);
|
|
32441
32459
|
};
|
|
32442
|
-
coreEvents.on(
|
|
32443
|
-
coreEvents.on(
|
|
32444
|
-
coreEvents.on(
|
|
32460
|
+
coreEvents.on(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32461
|
+
coreEvents.on(CoreEvent.AdminSettingsChanged, handleAdminSettingsChanged);
|
|
32462
|
+
coreEvents.on(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32445
32463
|
return () => {
|
|
32446
|
-
coreEvents.off(
|
|
32464
|
+
coreEvents.off(CoreEvent.SettingsChanged, handleSettingsChanged);
|
|
32447
32465
|
coreEvents.off(
|
|
32448
|
-
|
|
32466
|
+
CoreEvent.AdminSettingsChanged,
|
|
32449
32467
|
handleAdminSettingsChanged
|
|
32450
32468
|
);
|
|
32451
|
-
coreEvents.off(
|
|
32469
|
+
coreEvents.off(CoreEvent.AgentsDiscovered, handleAgentsDiscovered);
|
|
32452
32470
|
};
|
|
32453
32471
|
}, [settings]);
|
|
32454
32472
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
@@ -32514,11 +32532,11 @@ var AppContainer = (props) => {
|
|
|
32514
32532
|
exitEditorDialog
|
|
32515
32533
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
32516
32534
|
(0, import_react124.useEffect)(() => {
|
|
32517
|
-
coreEvents.on(
|
|
32518
|
-
coreEvents.on(
|
|
32535
|
+
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32536
|
+
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32519
32537
|
return () => {
|
|
32520
|
-
coreEvents.off(
|
|
32521
|
-
coreEvents.off(
|
|
32538
|
+
coreEvents.off(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
32539
|
+
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
32522
32540
|
};
|
|
32523
32541
|
}, [handleEditorClose, openEditorDialog]);
|
|
32524
32542
|
(0, import_react124.useEffect)(() => {
|
|
@@ -32586,7 +32604,7 @@ var AppContainer = (props) => {
|
|
|
32586
32604
|
errorVerbosity: settings.merged.ui.errorVerbosity
|
|
32587
32605
|
});
|
|
32588
32606
|
const isAuthDialogOpen = authState === "updating" /* Updating */;
|
|
32589
|
-
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !==
|
|
32607
|
+
const isAuthenticating = authState === "unauthenticated" /* Unauthenticated */ && settings.merged.security.auth.selectedType !== AuthType.USE_GEMINI;
|
|
32590
32608
|
const isGeminiClientInitialized = config.getGeminiClient()?.isInitialized();
|
|
32591
32609
|
const { loadHistoryForResume, isResuming } = useSessionResume({
|
|
32592
32610
|
config,
|
|
@@ -32614,7 +32632,7 @@ var AppContainer = (props) => {
|
|
|
32614
32632
|
async (authType, scope) => {
|
|
32615
32633
|
if (authType) {
|
|
32616
32634
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
32617
|
-
if (authType ===
|
|
32635
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
32618
32636
|
setAuthContext({ requiresRestart: true });
|
|
32619
32637
|
} else {
|
|
32620
32638
|
setAuthContext({});
|
|
@@ -32642,7 +32660,7 @@ var AppContainer = (props) => {
|
|
|
32642
32660
|
);
|
|
32643
32661
|
return;
|
|
32644
32662
|
}
|
|
32645
|
-
if (authType ===
|
|
32663
|
+
if (authType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
32646
32664
|
writeToStdout(`
|
|
32647
32665
|
----------------------------------------------------------------
|
|
32648
32666
|
Logging in with Google... Restarting Gemini CLI to continue.
|
|
@@ -32667,7 +32685,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32667
32685
|
}
|
|
32668
32686
|
await saveApiKey(apiKey);
|
|
32669
32687
|
await reloadApiKey();
|
|
32670
|
-
await config.refreshAuth(
|
|
32688
|
+
await config.refreshAuth(AuthType.USE_GEMINI);
|
|
32671
32689
|
setAuthState("authenticated" /* Authenticated */);
|
|
32672
32690
|
} catch (e) {
|
|
32673
32691
|
onAuthError(
|
|
@@ -32692,7 +32710,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32692
32710
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
32693
32711
|
);
|
|
32694
32712
|
} else if (settings.merged.security.auth.selectedType && !settings.merged.security.auth.useExternal) {
|
|
32695
|
-
if (settings.merged.security.auth.selectedType ===
|
|
32713
|
+
if (settings.merged.security.auth.selectedType === AuthType.USE_GEMINI) {
|
|
32696
32714
|
return;
|
|
32697
32715
|
}
|
|
32698
32716
|
const error = validateAuthMethod(
|
|
@@ -32811,9 +32829,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
32811
32829
|
}
|
|
32812
32830
|
});
|
|
32813
32831
|
};
|
|
32814
|
-
coreEvents.on(
|
|
32832
|
+
coreEvents.on(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
32815
32833
|
return () => {
|
|
32816
|
-
coreEvents.off(
|
|
32834
|
+
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
32817
32835
|
};
|
|
32818
32836
|
}, []);
|
|
32819
32837
|
const performMemoryRefresh = (0, import_react124.useCallback)(async () => {
|
|
@@ -33486,7 +33504,7 @@ ${queuedText}` : queuedText;
|
|
|
33486
33504
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33487
33505
|
if (settings.merged.general.devtools) {
|
|
33488
33506
|
void (async () => {
|
|
33489
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33507
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-RLXZWLDT.js");
|
|
33490
33508
|
await toggleDevToolsPanel(
|
|
33491
33509
|
config,
|
|
33492
33510
|
showErrorDetails,
|
|
@@ -33704,12 +33722,12 @@ ${queuedText}` : queuedText;
|
|
|
33704
33722
|
Date.now()
|
|
33705
33723
|
);
|
|
33706
33724
|
};
|
|
33707
|
-
coreEvents.on(
|
|
33708
|
-
coreEvents.on(
|
|
33725
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
33726
|
+
coreEvents.on(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
33709
33727
|
coreEvents.drainBacklogs();
|
|
33710
33728
|
return () => {
|
|
33711
|
-
coreEvents.off(
|
|
33712
|
-
coreEvents.off(
|
|
33729
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
33730
|
+
coreEvents.off(CoreEvent.HookSystemMessage, handleHookSystemMessage);
|
|
33713
33731
|
};
|
|
33714
33732
|
}, [historyManager]);
|
|
33715
33733
|
const nightly = props.version.includes("nightly");
|
|
@@ -33811,9 +33829,9 @@ ${queuedText}` : queuedText;
|
|
|
33811
33829
|
const handleMemoryChanged = (result) => {
|
|
33812
33830
|
setGeminiMdFileCount(result.fileCount);
|
|
33813
33831
|
};
|
|
33814
|
-
coreEvents.on(
|
|
33832
|
+
coreEvents.on(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
33815
33833
|
return () => {
|
|
33816
|
-
coreEvents.off(
|
|
33834
|
+
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
33817
33835
|
};
|
|
33818
33836
|
}, []);
|
|
33819
33837
|
(0, import_react124.useEffect)(() => {
|