@google/gemini-cli 0.65.0-preview.0 → 0.66.0-nightly.20261017.ged96faedf
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/README.md +21 -56
- package/bundle/{chunk-NL7ZHGCH.js → chunk-464WBVYM.js} +1 -1
- package/bundle/{chunk-QJK54DSE.js → chunk-5VQUE3OF.js} +1 -1
- package/bundle/{chunk-VF5WQSOE.js → chunk-7ARQMEMX.js} +1 -1
- package/bundle/{chunk-2WVLIJA5.js → chunk-BUG4N6U5.js} +145 -77
- package/bundle/{chunk-F6AJM4WN.js → chunk-DPV3ZEOC.js} +3 -3
- package/bundle/{chunk-GSQEBEGC.js → chunk-ERBSM2HU.js} +3 -3
- package/bundle/{chunk-WTRK3NVX.js → chunk-GEUFOF2X.js} +106 -1500
- package/bundle/{chunk-V2R74WAG.js → chunk-H4U2CWBQ.js} +151 -81
- package/bundle/chunk-HDP6V6JI.js +1956 -0
- package/bundle/{chunk-RPHDSDL6.js → chunk-IDCWFZU3.js} +1 -1
- package/bundle/{chunk-SN7QZKXC.js → chunk-IGOTAEJY.js} +170 -1551
- package/bundle/chunk-J5QPCO3J.js +101859 -0
- package/bundle/{chunk-H2CZXS7F.js → chunk-JY3DYBJT.js} +1 -1
- package/bundle/{chunk-HLOOE7YN.js → chunk-LDGJJCVW.js} +9 -8
- package/bundle/chunk-MH4KAY5W.js +512 -0
- package/bundle/{chunk-LLE5Z636.js → chunk-NAPT3FAL.js} +106 -1500
- package/bundle/chunk-NOSWGXRT.js +1956 -0
- package/bundle/{chunk-43EXRO7A.js → chunk-NU74STQ5.js} +145 -77
- package/bundle/{chunk-K7NOVQ6G.js → chunk-QCWGLPCO.js} +376 -231
- package/bundle/{chunk-WGL5FJOS.js → chunk-QF3ALSJN.js} +3 -3
- package/bundle/{chunk-K4G5D5ZZ.js → chunk-R4KPURFC.js} +1 -1
- package/bundle/chunk-R6XDLHLP.js +1956 -0
- package/bundle/chunk-R7UPATQC.js +1956 -0
- package/bundle/chunk-RACMC24X.js +118 -0
- package/bundle/{chunk-4JGVVJGK.js → chunk-RE4V6I3G.js} +1 -1
- package/bundle/{chunk-S7BCRBI4.js → chunk-UTTFPWGQ.js} +1 -1
- package/bundle/chunk-VXYA6LA4.js +1571 -0
- package/bundle/chunk-XY2QSBID.js +17603 -0
- package/bundle/{chunk-K7AA35SP.js → chunk-YOI4DS3V.js} +365 -230
- package/bundle/chunk-YP27UYI4.js +154 -0
- package/bundle/{chunk-TP236FKO.js → chunk-YPLMNSM4.js} +8243 -15166
- package/bundle/chunk-ZFQ347ZN.js +402181 -0
- package/bundle/{cleanup-HPADDONA.js → cleanup-6FAZDCL3.js} +2 -2
- package/bundle/{cleanup-JOMSXKMP.js → cleanup-GNZLZG55.js} +2 -2
- package/bundle/{cleanup-LYRJHMMO.js → cleanup-RX3AC5ET.js} +2 -2
- package/bundle/cleanup-WAU2KYGS.js +32 -0
- package/bundle/{core-NCJTYARO.js → core-AGGXDQOT.js} +13 -1
- package/bundle/{devtoolsService-WP2OPVPB.js → devtoolsService-6XOCGTLC.js} +2 -2
- package/bundle/{devtoolsService-JFJBTZ4B.js → devtoolsService-FBTSVQ57.js} +4 -3
- package/bundle/{devtoolsService-HIZA3JGR.js → devtoolsService-UO6ZB72B.js} +2 -2
- package/bundle/devtoolsService-W5QGZ3SW.js +4359 -0
- package/bundle/{dist-GQKLLBDW.js → dist-2ELAEESC.js} +13 -1
- package/bundle/{core-IVQAI4S6.js → dist-2R7C2WHA.js} +13 -1
- package/bundle/dist-PALH7PJS.js +2280 -0
- package/bundle/docs/changelogs/index.md +22 -0
- package/bundle/docs/changelogs/latest.md +64 -54
- package/bundle/docs/changelogs/preview.md +91 -55
- package/bundle/docs/reference/configuration.md +8 -3
- package/bundle/docs/reference/keyboard-shortcuts.md +18 -4
- package/bundle/{gemini-5TUKZVGS.js → gemini-6MH55Y7F.js} +37 -18
- package/bundle/{gemini-7CHJYSHM.js → gemini-DOXUDJDY.js} +37 -18
- package/bundle/{gemini-546WMAHG.js → gemini-OHYXI52N.js} +237 -202
- package/bundle/gemini-OUEDCH4P.js +17970 -0
- package/bundle/gemini.js +14 -15
- package/bundle/{interactiveCli-E3PUPYMZ.js → interactiveCli-7LIKGDTJ.js} +1061 -989
- package/bundle/{interactiveCli-5XIAIY74.js → interactiveCli-EGQYN3KR.js} +1371 -1280
- package/bundle/{interactiveCli-L4PK7YY3.js → interactiveCli-TG7PGV4V.js} +1061 -989
- package/bundle/interactiveCli-YEXCUIFZ.js +35601 -0
- package/bundle/{liteRtServerManager-JCTYJBV5.js → liteRtServerManager-KAPXZ3EU.js} +4 -4
- package/bundle/{liteRtServerManager-JERG6KYC.js → liteRtServerManager-MSJIWMWP.js} +4 -4
- package/bundle/{liteRtServerManager-22ISMNN2.js → liteRtServerManager-PD2N3GLD.js} +4 -4
- package/bundle/liteRtServerManager-X5SCFYXM.js +65 -0
- package/bundle/{oauth2-provider-XRUER2XR.js → oauth2-provider-IUN6Z4IO.js} +1 -1
- package/bundle/{oauth2-provider-477UJQX6.js → oauth2-provider-MKJIQNWP.js} +41 -79
- package/bundle/{oauth2-provider-MKWWBW4K.js → oauth2-provider-RMF7U2UN.js} +1 -1
- package/bundle/oauth2-provider-ZM5GWCNX.js +273 -0
- package/bundle/{start-MVIPJNQ5.js → start-5GIUIER3.js} +6 -6
- package/bundle/{start-RZWSVT55.js → start-APIVGXZ3.js} +6 -6
- package/bundle/{start-AGMBPY3O.js → start-GJ4TH4KZ.js} +6 -6
- package/bundle/start-WDS52ZNE.js +18 -0
- package/package.json +1 -1
- package/bundle/chunk-4DCA4L53.js +0 -425
- package/bundle/chunk-BFIV7GTA.js +0 -425
- package/bundle/chunk-V72FRESD.js +0 -425
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
Static,
|
|
49
49
|
StreamingContext,
|
|
50
50
|
StyledLine,
|
|
51
|
+
TMUX_SPINNER_INTERVAL_MS,
|
|
51
52
|
TOOL_SUCCESS_RATE_HIGH,
|
|
52
53
|
TOOL_SUCCESS_RATE_MEDIUM,
|
|
53
54
|
TerminalCapabilityManager,
|
|
@@ -122,7 +123,6 @@ import {
|
|
|
122
123
|
render_default,
|
|
123
124
|
requestConsentInteractive,
|
|
124
125
|
require_jsx_runtime,
|
|
125
|
-
require_semver,
|
|
126
126
|
safeRepeat,
|
|
127
127
|
saveClipboardImage,
|
|
128
128
|
shouldSwitchTheme,
|
|
@@ -171,10 +171,10 @@ import {
|
|
|
171
171
|
widestLineFromStyledChars,
|
|
172
172
|
wordBreakStyledChars,
|
|
173
173
|
wrapStyledChars
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-J5QPCO3J.js";
|
|
175
175
|
import {
|
|
176
176
|
require_source
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-VXYA6LA4.js";
|
|
178
178
|
import {
|
|
179
179
|
appEvents
|
|
180
180
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -227,24 +227,25 @@ import {
|
|
|
227
227
|
stripAnsi,
|
|
228
228
|
stripUnsafeCharacters,
|
|
229
229
|
toCodePoints
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-XY2QSBID.js";
|
|
231
231
|
import {
|
|
232
232
|
handleAutoUpdate,
|
|
233
233
|
isDevelopment,
|
|
234
234
|
relaunchApp,
|
|
235
|
+
require_semver,
|
|
235
236
|
setUpdateHandler
|
|
236
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-R7UPATQC.js";
|
|
237
238
|
import {
|
|
238
239
|
isTodoList,
|
|
239
240
|
mapCoreStatusToDisplayStatus,
|
|
240
241
|
require_react
|
|
241
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-464WBVYM.js";
|
|
242
243
|
import {
|
|
243
244
|
registerCleanup,
|
|
244
245
|
removeCleanup,
|
|
245
246
|
runExitCleanup,
|
|
246
247
|
setupTtyCheck
|
|
247
|
-
} from "./chunk-
|
|
248
|
+
} from "./chunk-IDCWFZU3.js";
|
|
248
249
|
import {
|
|
249
250
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
250
251
|
AGENT_TOOL_NAME,
|
|
@@ -408,6 +409,7 @@ import {
|
|
|
408
409
|
isRenderedInHistory,
|
|
409
410
|
isStructuredToolResult,
|
|
410
411
|
isSubagentProgress,
|
|
412
|
+
isTmux,
|
|
411
413
|
isUserVisibleHook,
|
|
412
414
|
isValidEditorType,
|
|
413
415
|
isVisibleInToolGroup,
|
|
@@ -450,7 +452,7 @@ import {
|
|
|
450
452
|
validatePlanContent,
|
|
451
453
|
validatePlanPath,
|
|
452
454
|
writeToStdout
|
|
453
|
-
} from "./chunk-
|
|
455
|
+
} from "./chunk-ZFQ347ZN.js";
|
|
454
456
|
import "./chunk-664ZODQF.js";
|
|
455
457
|
import "./chunk-IUUIT4SU.js";
|
|
456
458
|
import "./chunk-L6PII3GR.js";
|
|
@@ -3266,11 +3268,11 @@ var require_registry_auth_token = __commonJS({
|
|
|
3266
3268
|
});
|
|
3267
3269
|
|
|
3268
3270
|
// packages/cli/src/interactiveCli.tsx
|
|
3269
|
-
var
|
|
3271
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
3270
3272
|
import { basename as basename5 } from "node:path";
|
|
3271
3273
|
|
|
3272
3274
|
// packages/cli/src/ui/AppContainer.tsx
|
|
3273
|
-
var
|
|
3275
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
3274
3276
|
|
|
3275
3277
|
// packages/cli/src/ui/components/HistoryItemDisplay.tsx
|
|
3276
3278
|
var import_react23 = __toESM(require_react(), 1);
|
|
@@ -5208,8 +5210,14 @@ var ToolResultDisplay = ({
|
|
|
5208
5210
|
isAlternateBuffer,
|
|
5209
5211
|
maxLinesLimit: maxLines
|
|
5210
5212
|
});
|
|
5211
|
-
const
|
|
5212
|
-
const
|
|
5213
|
+
const totalContainerWidth = terminalWidth || 0;
|
|
5214
|
+
const borderSpace = 4;
|
|
5215
|
+
const scrollbarBuffer = isAlternateBuffer ? 1 : 0;
|
|
5216
|
+
const childWidth = Math.max(0, totalContainerWidth - borderSpace);
|
|
5217
|
+
const safeContentWidth = Math.max(
|
|
5218
|
+
0,
|
|
5219
|
+
totalContainerWidth - borderSpace - scrollbarBuffer
|
|
5220
|
+
);
|
|
5213
5221
|
const keyExtractor = import_react8.default.useCallback(
|
|
5214
5222
|
(_, index) => index.toString(),
|
|
5215
5223
|
[]
|
|
@@ -5227,13 +5235,13 @@ var ToolResultDisplay = ({
|
|
|
5227
5235
|
const formattedJSON = prettyJSON ? JSON.stringify(prettyJSON, null, 2) : null;
|
|
5228
5236
|
let content;
|
|
5229
5237
|
if (formattedJSON) {
|
|
5230
|
-
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: formattedJSON });
|
|
5238
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { width: safeContentWidth, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: formattedJSON }) });
|
|
5231
5239
|
} else if (isSubagentProgress(contentData)) {
|
|
5232
5240
|
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5233
5241
|
SubagentProgressDisplay,
|
|
5234
5242
|
{
|
|
5235
5243
|
progress: contentData,
|
|
5236
|
-
terminalWidth:
|
|
5244
|
+
terminalWidth: safeContentWidth
|
|
5237
5245
|
}
|
|
5238
5246
|
);
|
|
5239
5247
|
} else if (typeof contentData === "string" && renderOutputAsMarkdown) {
|
|
@@ -5241,26 +5249,26 @@ var ToolResultDisplay = ({
|
|
|
5241
5249
|
MarkdownDisplay,
|
|
5242
5250
|
{
|
|
5243
5251
|
text: contentData,
|
|
5244
|
-
terminalWidth:
|
|
5252
|
+
terminalWidth: safeContentWidth,
|
|
5245
5253
|
renderMarkdown,
|
|
5246
5254
|
isPending: false
|
|
5247
5255
|
}
|
|
5248
5256
|
);
|
|
5249
5257
|
} else if (typeof contentData === "string" && !renderOutputAsMarkdown) {
|
|
5250
|
-
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: contentData });
|
|
5258
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { width: safeContentWidth, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: contentData }) });
|
|
5251
5259
|
} else if (isStructuredToolResult(contentData)) {
|
|
5252
5260
|
if (renderOutputAsMarkdown) {
|
|
5253
5261
|
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5254
5262
|
MarkdownDisplay,
|
|
5255
5263
|
{
|
|
5256
5264
|
text: contentData.summary,
|
|
5257
|
-
terminalWidth:
|
|
5265
|
+
terminalWidth: safeContentWidth,
|
|
5258
5266
|
renderMarkdown,
|
|
5259
5267
|
isPending: false
|
|
5260
5268
|
}
|
|
5261
5269
|
);
|
|
5262
5270
|
} else {
|
|
5263
|
-
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: contentData.summary });
|
|
5271
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { width: safeContentWidth, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: contentData.summary }) });
|
|
5264
5272
|
}
|
|
5265
5273
|
} else if (isFileDiffResult(contentData)) {
|
|
5266
5274
|
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -5270,7 +5278,7 @@ var ToolResultDisplay = ({
|
|
|
5270
5278
|
filename: contentData.fileName,
|
|
5271
5279
|
disableTruncation: contentData.isBuildFile && !isLockFile(contentData.fileName),
|
|
5272
5280
|
availableTerminalHeight: availableHeight,
|
|
5273
|
-
terminalWidth:
|
|
5281
|
+
terminalWidth: safeContentWidth
|
|
5274
5282
|
}
|
|
5275
5283
|
);
|
|
5276
5284
|
} else if (Array.isArray(contentData)) {
|
|
@@ -5280,13 +5288,13 @@ var ToolResultDisplay = ({
|
|
|
5280
5288
|
{
|
|
5281
5289
|
data: contentData,
|
|
5282
5290
|
availableTerminalHeight: isAlternateBuffer ? void 0 : availableHeight,
|
|
5283
|
-
width:
|
|
5291
|
+
width: safeContentWidth,
|
|
5284
5292
|
maxLines: isAlternateBuffer ? void 0 : maxLines,
|
|
5285
5293
|
disableTruncation: shouldDisableTruncation
|
|
5286
5294
|
}
|
|
5287
5295
|
);
|
|
5288
5296
|
} else if (typeof contentData === "object" && contentData !== null) {
|
|
5289
|
-
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: JSON.stringify(contentData, null, 2) });
|
|
5297
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box_default, { width: safeContentWidth, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: JSON.stringify(contentData, null, 2) }) });
|
|
5290
5298
|
} else {
|
|
5291
5299
|
content = null;
|
|
5292
5300
|
}
|
|
@@ -6775,8 +6783,8 @@ var import_react18 = __toESM(require_react(), 1);
|
|
|
6775
6783
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
6776
6784
|
var PAYLOAD_MARGIN_LEFT = 6;
|
|
6777
6785
|
var PAYLOAD_BORDER_CHROME_WIDTH = 4;
|
|
6778
|
-
var PAYLOAD_SCROLL_GUTTER =
|
|
6779
|
-
var PAYLOAD_MAX_WIDTH = 120 +
|
|
6786
|
+
var PAYLOAD_SCROLL_GUTTER = 1;
|
|
6787
|
+
var PAYLOAD_MAX_WIDTH = 120 + PAYLOAD_BORDER_CHROME_WIDTH;
|
|
6780
6788
|
var hasPayload = (res) => {
|
|
6781
6789
|
if (!hasSummary(res)) return false;
|
|
6782
6790
|
if (!("payload" in res)) return false;
|
|
@@ -6893,6 +6901,9 @@ function getGenericSuccessData(resultDisplay, originalDescription) {
|
|
|
6893
6901
|
}
|
|
6894
6902
|
return { description, summary, payload };
|
|
6895
6903
|
}
|
|
6904
|
+
function renderDiffLineItem(item, width) {
|
|
6905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { minHeight: 1, width, flexDirection: "column", children: item });
|
|
6906
|
+
}
|
|
6896
6907
|
var DenseToolMessage = (props) => {
|
|
6897
6908
|
const {
|
|
6898
6909
|
callId,
|
|
@@ -6992,6 +7003,17 @@ var DenseToolMessage = (props) => {
|
|
|
6992
7003
|
isAlternateBuffer
|
|
6993
7004
|
]);
|
|
6994
7005
|
const { description, summary } = viewParts;
|
|
7006
|
+
const totalContainerWidth = Math.max(
|
|
7007
|
+
0,
|
|
7008
|
+
Math.min(PAYLOAD_MAX_WIDTH, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT)
|
|
7009
|
+
);
|
|
7010
|
+
const borderSpace = PAYLOAD_BORDER_CHROME_WIDTH;
|
|
7011
|
+
const scrollbarBuffer = PAYLOAD_SCROLL_GUTTER;
|
|
7012
|
+
const safeContentWidth = Math.max(
|
|
7013
|
+
0,
|
|
7014
|
+
totalContainerWidth - borderSpace - scrollbarBuffer
|
|
7015
|
+
);
|
|
7016
|
+
const scrollableWidth = Math.max(0, totalContainerWidth - borderSpace);
|
|
6995
7017
|
const diffLines = (0, import_react18.useMemo)(() => {
|
|
6996
7018
|
if (!diff || !isExpanded || !isAlternateBuffer) return [];
|
|
6997
7019
|
const parsedLines = parseDiffWithLineNumbers(diff.fileDiff);
|
|
@@ -7002,7 +7024,7 @@ var DenseToolMessage = (props) => {
|
|
|
7002
7024
|
return colorizeCode({
|
|
7003
7025
|
code: addedContent,
|
|
7004
7026
|
language: fileExtension,
|
|
7005
|
-
maxWidth:
|
|
7027
|
+
maxWidth: safeContentWidth,
|
|
7006
7028
|
settings,
|
|
7007
7029
|
disableColor: status === CoreToolCallStatus.Cancelled,
|
|
7008
7030
|
returnLines: true
|
|
@@ -7011,11 +7033,11 @@ var DenseToolMessage = (props) => {
|
|
|
7011
7033
|
return renderDiffLines({
|
|
7012
7034
|
parsedLines,
|
|
7013
7035
|
filename: diff.fileName,
|
|
7014
|
-
terminalWidth:
|
|
7036
|
+
terminalWidth: safeContentWidth,
|
|
7015
7037
|
disableColor: status === CoreToolCallStatus.Cancelled
|
|
7016
7038
|
});
|
|
7017
7039
|
}
|
|
7018
|
-
}, [diff, isExpanded, isAlternateBuffer,
|
|
7040
|
+
}, [diff, isExpanded, isAlternateBuffer, safeContentWidth, settings, status]);
|
|
7019
7041
|
const showPayload = (0, import_react18.useMemo)(() => {
|
|
7020
7042
|
const policy = !isAlternateBuffer || !diff || isExpanded;
|
|
7021
7043
|
if (!policy) return false;
|
|
@@ -7034,8 +7056,14 @@ var DenseToolMessage = (props) => {
|
|
|
7034
7056
|
viewParts.payload,
|
|
7035
7057
|
outputFile
|
|
7036
7058
|
]);
|
|
7037
|
-
const keyExtractor = (
|
|
7038
|
-
|
|
7059
|
+
const keyExtractor = (0, import_react18.useCallback)(
|
|
7060
|
+
(_item, index) => `diff-line-${index}`,
|
|
7061
|
+
[]
|
|
7062
|
+
);
|
|
7063
|
+
const renderItem = (0, import_react18.useCallback)(
|
|
7064
|
+
({ item }) => renderDiffLineItem(item, safeContentWidth),
|
|
7065
|
+
[safeContentWidth]
|
|
7066
|
+
);
|
|
7039
7067
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
7040
7068
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { marginLeft: 2, flexDirection: "row", flexWrap: "wrap", children: [
|
|
7041
7069
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { flexDirection: "row", flexShrink: 1, children: [
|
|
@@ -7071,13 +7099,8 @@ var DenseToolMessage = (props) => {
|
|
|
7071
7099
|
borderColor: theme.border.default,
|
|
7072
7100
|
borderDimColor: true,
|
|
7073
7101
|
minWidth: 0,
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
Math.min(
|
|
7077
|
-
PAYLOAD_MAX_WIDTH,
|
|
7078
|
-
(terminalWidth || 0) - PAYLOAD_MARGIN_LEFT
|
|
7079
|
-
)
|
|
7080
|
-
),
|
|
7102
|
+
width: totalContainerWidth,
|
|
7103
|
+
maxWidth: totalContainerWidth,
|
|
7081
7104
|
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7082
7105
|
ScrollableListWithForwardRef,
|
|
7083
7106
|
{
|
|
@@ -7086,13 +7109,7 @@ var DenseToolMessage = (props) => {
|
|
|
7086
7109
|
keyExtractor,
|
|
7087
7110
|
estimatedItemHeight: () => 1,
|
|
7088
7111
|
hasFocus: isFocused,
|
|
7089
|
-
width:
|
|
7090
|
-
0,
|
|
7091
|
-
Math.min(
|
|
7092
|
-
PAYLOAD_MAX_WIDTH,
|
|
7093
|
-
(terminalWidth || 0) - PAYLOAD_MARGIN_LEFT - PAYLOAD_BORDER_CHROME_WIDTH - PAYLOAD_SCROLL_GUTTER
|
|
7094
|
-
)
|
|
7095
|
-
)
|
|
7112
|
+
width: scrollableWidth
|
|
7096
7113
|
}
|
|
7097
7114
|
)
|
|
7098
7115
|
}
|
|
@@ -9659,6 +9676,7 @@ var HistoryItemDisplay = ({
|
|
|
9659
9676
|
const inlineThinkingMode = getInlineThinkingMode(settings);
|
|
9660
9677
|
const itemForDisplay = (0, import_react23.useMemo)(() => escapeAnsiCtrlCodes(item), [item]);
|
|
9661
9678
|
const needTopMargin = !!(isFirstAfterThinking && inlineThinkingMode !== "off" || isToolGroupBoundary);
|
|
9679
|
+
const effectiveAvailableTerminalHeight = availableTerminalHeight !== void 0 && needTopMargin ? Math.max(availableTerminalHeight - 1, 1) : availableTerminalHeight;
|
|
9662
9680
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9663
9681
|
Box_default,
|
|
9664
9682
|
{
|
|
@@ -9682,7 +9700,7 @@ var HistoryItemDisplay = ({
|
|
|
9682
9700
|
{
|
|
9683
9701
|
text: itemForDisplay.text,
|
|
9684
9702
|
isPending,
|
|
9685
|
-
availableTerminalHeight: availableTerminalHeightGemini ??
|
|
9703
|
+
availableTerminalHeight: availableTerminalHeightGemini ?? effectiveAvailableTerminalHeight,
|
|
9686
9704
|
terminalWidth
|
|
9687
9705
|
}
|
|
9688
9706
|
),
|
|
@@ -9691,7 +9709,7 @@ var HistoryItemDisplay = ({
|
|
|
9691
9709
|
{
|
|
9692
9710
|
text: itemForDisplay.text,
|
|
9693
9711
|
isPending,
|
|
9694
|
-
availableTerminalHeight: availableTerminalHeightGemini ??
|
|
9712
|
+
availableTerminalHeight: availableTerminalHeightGemini ?? effectiveAvailableTerminalHeight,
|
|
9695
9713
|
terminalWidth
|
|
9696
9714
|
}
|
|
9697
9715
|
),
|
|
@@ -9754,7 +9772,7 @@ var HistoryItemDisplay = ({
|
|
|
9754
9772
|
{
|
|
9755
9773
|
item: itemForDisplay,
|
|
9756
9774
|
toolCalls: itemForDisplay.tools,
|
|
9757
|
-
availableTerminalHeight,
|
|
9775
|
+
availableTerminalHeight: effectiveAvailableTerminalHeight,
|
|
9758
9776
|
terminalWidth,
|
|
9759
9777
|
borderTop: itemForDisplay.borderTop,
|
|
9760
9778
|
borderBottom: itemForDisplay.borderBottom,
|
|
@@ -12661,6 +12679,29 @@ var ToolConfirmationQueueWithBudget = ({
|
|
|
12661
12679
|
"confirmation-queue"
|
|
12662
12680
|
) });
|
|
12663
12681
|
};
|
|
12682
|
+
var STATIC_HISTORY_ITEM_TYPES = /* @__PURE__ */ new Set([
|
|
12683
|
+
"user",
|
|
12684
|
+
"user_shell",
|
|
12685
|
+
"gemini",
|
|
12686
|
+
"gemini_content",
|
|
12687
|
+
"info",
|
|
12688
|
+
"warning",
|
|
12689
|
+
"error",
|
|
12690
|
+
"hint",
|
|
12691
|
+
"thinking",
|
|
12692
|
+
"about",
|
|
12693
|
+
"help",
|
|
12694
|
+
"stats",
|
|
12695
|
+
"model_stats",
|
|
12696
|
+
"tool_stats",
|
|
12697
|
+
"model",
|
|
12698
|
+
"quit",
|
|
12699
|
+
"extensions_list",
|
|
12700
|
+
"tools_list",
|
|
12701
|
+
"skills_list",
|
|
12702
|
+
"agents_list",
|
|
12703
|
+
"chat_list"
|
|
12704
|
+
]);
|
|
12664
12705
|
var MainContent = () => {
|
|
12665
12706
|
const { version } = useAppContext();
|
|
12666
12707
|
const uiState = useUIState();
|
|
@@ -12862,15 +12903,35 @@ var MainContent = () => {
|
|
|
12862
12903
|
const estimatedItemHeight = (0, import_react36.useCallback)(() => 100, []);
|
|
12863
12904
|
const keyExtractor = (0, import_react36.useCallback)(
|
|
12864
12905
|
(item, _index) => {
|
|
12865
|
-
if (item.type === "header")
|
|
12866
|
-
|
|
12906
|
+
if (item.type === "header") {
|
|
12907
|
+
return `header-${showHeaderDetails}-${uiState.bannerVisible}-${uiState.bannerData?.defaultText ?? ""}-${uiState.bannerData?.warningText ?? ""}-${uiState.updateInfo?.isUpdating}-${uiState.historyRemountKey}`;
|
|
12908
|
+
}
|
|
12909
|
+
if (item.type === "history") {
|
|
12910
|
+
return `${item.item.id}-${uiState.renderMarkdown}-${uiState.historyRemountKey}`;
|
|
12911
|
+
}
|
|
12867
12912
|
return "pending";
|
|
12868
12913
|
},
|
|
12869
|
-
[
|
|
12914
|
+
[
|
|
12915
|
+
showHeaderDetails,
|
|
12916
|
+
uiState.bannerVisible,
|
|
12917
|
+
uiState.bannerData?.defaultText,
|
|
12918
|
+
uiState.bannerData?.warningText,
|
|
12919
|
+
uiState.renderMarkdown,
|
|
12920
|
+
uiState.historyRemountKey,
|
|
12921
|
+
uiState.updateInfo?.isUpdating
|
|
12922
|
+
]
|
|
12870
12923
|
);
|
|
12871
12924
|
const isStaticItem = (0, import_react36.useCallback)(
|
|
12872
|
-
(item) =>
|
|
12873
|
-
|
|
12925
|
+
(item) => {
|
|
12926
|
+
if (item.type === "header") {
|
|
12927
|
+
return !uiState.updateInfo?.isUpdating;
|
|
12928
|
+
}
|
|
12929
|
+
if (item.type === "history") {
|
|
12930
|
+
return STATIC_HISTORY_ITEM_TYPES.has(item.item.type);
|
|
12931
|
+
}
|
|
12932
|
+
return false;
|
|
12933
|
+
},
|
|
12934
|
+
[uiState.updateInfo?.isUpdating]
|
|
12874
12935
|
);
|
|
12875
12936
|
const scrollableList = (0, import_react36.useMemo)(() => {
|
|
12876
12937
|
if (isAlternateBufferOrTerminalBuffer) {
|
|
@@ -18007,7 +18068,7 @@ Do you want to allow this read?`,
|
|
|
18007
18068
|
};
|
|
18008
18069
|
|
|
18009
18070
|
// packages/cli/src/ui/components/Composer.tsx
|
|
18010
|
-
var
|
|
18071
|
+
var import_react83 = __toESM(require_react(), 1);
|
|
18011
18072
|
|
|
18012
18073
|
// packages/cli/src/ui/components/ToastDisplay.tsx
|
|
18013
18074
|
var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -18189,6 +18250,8 @@ var DetailedMessagesDisplay = ({ maxHeight, width, hasFocus }) => {
|
|
|
18189
18250
|
if (messages.length === 0) {
|
|
18190
18251
|
return null;
|
|
18191
18252
|
}
|
|
18253
|
+
const headerAndBorderHeight = 4;
|
|
18254
|
+
const listHeight = maxHeight !== void 0 ? Math.max(1, maxHeight - headerAndBorderHeight) : void 0;
|
|
18192
18255
|
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
18193
18256
|
Box_default,
|
|
18194
18257
|
{
|
|
@@ -18207,10 +18270,11 @@ var DetailedMessagesDisplay = ({ maxHeight, width, hasFocus }) => {
|
|
|
18207
18270
|
"Debug Console ",
|
|
18208
18271
|
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Text, { color: theme.text.secondary, children: "(F12 to close)" })
|
|
18209
18272
|
] }) }),
|
|
18210
|
-
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Box_default, { height:
|
|
18273
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Box_default, { height: listHeight, width: width - borderAndPadding, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
18211
18274
|
ScrollableListWithForwardRef,
|
|
18212
18275
|
{
|
|
18213
18276
|
ref: scrollableListRef,
|
|
18277
|
+
containerHeight: listHeight,
|
|
18214
18278
|
data: messages,
|
|
18215
18279
|
renderItem: ({ item: msg }) => {
|
|
18216
18280
|
let textColor = theme.text.primary;
|
|
@@ -22442,7 +22506,7 @@ var InputPrompt = ({
|
|
|
22442
22506
|
};
|
|
22443
22507
|
|
|
22444
22508
|
// packages/cli/src/ui/components/StatusRow.tsx
|
|
22445
|
-
var
|
|
22509
|
+
var import_react79 = __toESM(require_react(), 1);
|
|
22446
22510
|
|
|
22447
22511
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
22448
22512
|
var import_react74 = __toESM(require_react(), 1);
|
|
@@ -22850,155 +22914,169 @@ var usePhraseCycler = (isActive, isWaiting, shouldShowFocusHint, showTips = true
|
|
|
22850
22914
|
return { currentTip, currentWittyPhrase };
|
|
22851
22915
|
};
|
|
22852
22916
|
|
|
22917
|
+
// packages/cli/src/ui/components/LoadingIndicator.tsx
|
|
22918
|
+
var import_react77 = __toESM(require_react(), 1);
|
|
22919
|
+
|
|
22920
|
+
// packages/cli/src/ui/components/GeminiRespondingSpinner.tsx
|
|
22921
|
+
var import_react76 = __toESM(require_react(), 1);
|
|
22922
|
+
|
|
22853
22923
|
// packages/cli/src/ui/components/GeminiSpinner.tsx
|
|
22854
22924
|
var import_react75 = __toESM(require_react(), 1);
|
|
22855
22925
|
var import_tinygradient = __toESM(require_tinygradient(), 1);
|
|
22856
22926
|
var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1);
|
|
22857
22927
|
var COLOR_CYCLE_DURATION_MS = 4e3;
|
|
22858
|
-
var
|
|
22859
|
-
|
|
22860
|
-
altText
|
|
22861
|
-
|
|
22862
|
-
|
|
22863
|
-
|
|
22864
|
-
|
|
22865
|
-
|
|
22866
|
-
|
|
22867
|
-
|
|
22868
|
-
|
|
22869
|
-
|
|
22870
|
-
|
|
22871
|
-
|
|
22872
|
-
|
|
22873
|
-
|
|
22874
|
-
|
|
22875
|
-
|
|
22876
|
-
|
|
22877
|
-
|
|
22878
|
-
|
|
22879
|
-
|
|
22880
|
-
|
|
22881
|
-
|
|
22882
|
-
|
|
22883
|
-
|
|
22884
|
-
|
|
22885
|
-
|
|
22886
|
-
|
|
22887
|
-
}
|
|
22928
|
+
var DEFAULT_COLOR_CYCLE_INTERVAL_MS = 30;
|
|
22929
|
+
var GeminiSpinner = import_react75.default.memo(
|
|
22930
|
+
({ spinnerType = "dots", altText }) => {
|
|
22931
|
+
const isScreenReaderEnabled = use_is_screen_reader_enabled_default();
|
|
22932
|
+
const [time, setTime] = (0, import_react75.useState)(0);
|
|
22933
|
+
const intervalMs = isTmux() ? TMUX_SPINNER_INTERVAL_MS : DEFAULT_COLOR_CYCLE_INTERVAL_MS;
|
|
22934
|
+
const googleGradient = (0, import_react75.useMemo)(() => {
|
|
22935
|
+
const brandColors = [
|
|
22936
|
+
Colors.AccentPurple,
|
|
22937
|
+
Colors.AccentBlue,
|
|
22938
|
+
Colors.AccentCyan,
|
|
22939
|
+
Colors.AccentGreen,
|
|
22940
|
+
Colors.AccentYellow,
|
|
22941
|
+
Colors.AccentRed
|
|
22942
|
+
];
|
|
22943
|
+
return (0, import_tinygradient.default)([...brandColors, brandColors[0]]);
|
|
22944
|
+
}, []);
|
|
22945
|
+
(0, import_react75.useEffect)(() => {
|
|
22946
|
+
if (isScreenReaderEnabled) {
|
|
22947
|
+
return;
|
|
22948
|
+
}
|
|
22949
|
+
const interval = setInterval(() => {
|
|
22950
|
+
setTime((prevTime) => prevTime + intervalMs);
|
|
22951
|
+
}, intervalMs);
|
|
22952
|
+
return () => clearInterval(interval);
|
|
22953
|
+
}, [isScreenReaderEnabled, intervalMs]);
|
|
22954
|
+
const progress = time % COLOR_CYCLE_DURATION_MS / COLOR_CYCLE_DURATION_MS;
|
|
22955
|
+
const currentColor = googleGradient.rgbAt(progress).toHexString();
|
|
22956
|
+
return isScreenReaderEnabled ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Text, { children: altText }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Text, { color: currentColor, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(CliSpinner, { type: spinnerType }) });
|
|
22957
|
+
}
|
|
22958
|
+
);
|
|
22959
|
+
GeminiSpinner.displayName = "GeminiSpinner";
|
|
22888
22960
|
|
|
22889
22961
|
// packages/cli/src/ui/components/GeminiRespondingSpinner.tsx
|
|
22890
22962
|
var import_jsx_runtime112 = __toESM(require_jsx_runtime(), 1);
|
|
22891
|
-
var GeminiRespondingSpinner = (
|
|
22892
|
-
|
|
22893
|
-
|
|
22894
|
-
|
|
22895
|
-
|
|
22896
|
-
|
|
22897
|
-
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
|
|
22903
|
-
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
|
|
22963
|
+
var GeminiRespondingSpinner = import_react76.default.memo(
|
|
22964
|
+
({
|
|
22965
|
+
nonRespondingDisplay,
|
|
22966
|
+
spinnerType = "dots",
|
|
22967
|
+
isHookActive = false,
|
|
22968
|
+
color
|
|
22969
|
+
}) => {
|
|
22970
|
+
const streamingState = useStreamingContext();
|
|
22971
|
+
const isScreenReaderEnabled = use_is_screen_reader_enabled_default();
|
|
22972
|
+
if (streamingState === "responding" /* Responding */ && !isHookActive) {
|
|
22973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
22974
|
+
GeminiSpinner,
|
|
22975
|
+
{
|
|
22976
|
+
spinnerType,
|
|
22977
|
+
altText: SCREEN_READER_RESPONDING
|
|
22978
|
+
}
|
|
22979
|
+
);
|
|
22980
|
+
}
|
|
22981
|
+
if (nonRespondingDisplay) {
|
|
22982
|
+
return isScreenReaderEnabled ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Text, { children: SCREEN_READER_LOADING }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Text, { color: color ?? theme.text.primary, children: nonRespondingDisplay });
|
|
22983
|
+
}
|
|
22984
|
+
return null;
|
|
22910
22985
|
}
|
|
22911
|
-
|
|
22912
|
-
|
|
22986
|
+
);
|
|
22987
|
+
GeminiRespondingSpinner.displayName = "GeminiRespondingSpinner";
|
|
22913
22988
|
|
|
22914
22989
|
// packages/cli/src/ui/components/LoadingIndicator.tsx
|
|
22915
22990
|
var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1);
|
|
22916
|
-
var LoadingIndicator = (
|
|
22917
|
-
|
|
22918
|
-
|
|
22919
|
-
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
|
|
22929
|
-
|
|
22930
|
-
|
|
22931
|
-
|
|
22932
|
-
|
|
22933
|
-
|
|
22934
|
-
|
|
22935
|
-
|
|
22936
|
-
|
|
22937
|
-
|
|
22938
|
-
|
|
22939
|
-
|
|
22940
|
-
|
|
22941
|
-
|
|
22942
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.
|
|
22943
|
-
|
|
22991
|
+
var LoadingIndicator = import_react77.default.memo(
|
|
22992
|
+
({
|
|
22993
|
+
currentLoadingPhrase,
|
|
22994
|
+
statusPhrase,
|
|
22995
|
+
wittyPhrase,
|
|
22996
|
+
showWit = false,
|
|
22997
|
+
elapsedTime,
|
|
22998
|
+
inline = false,
|
|
22999
|
+
rightContent,
|
|
23000
|
+
thought,
|
|
23001
|
+
thoughtLabel,
|
|
23002
|
+
showCancelAndTimer = true,
|
|
23003
|
+
forceRealStatusOnly = false,
|
|
23004
|
+
spinnerIcon,
|
|
23005
|
+
isHookActive = false
|
|
23006
|
+
}) => {
|
|
23007
|
+
const streamingState = useStreamingContext();
|
|
23008
|
+
const { columns: terminalWidth } = useTerminalSize();
|
|
23009
|
+
const isNarrow = isNarrowWidth(terminalWidth);
|
|
23010
|
+
if (streamingState === "idle" /* Idle */ && !currentLoadingPhrase && !statusPhrase && !thought) {
|
|
23011
|
+
return null;
|
|
23012
|
+
}
|
|
23013
|
+
const primaryText = statusPhrase ?? (currentLoadingPhrase === INTERACTIVE_SHELL_WAITING_PHRASE ? currentLoadingPhrase : thought?.subject ? thoughtLabel ?? thought.subject : currentLoadingPhrase || (streamingState === "responding" /* Responding */ ? "Thinking..." : void 0));
|
|
23014
|
+
const cancelAndTimerContent = showCancelAndTimer && streamingState === "responding" /* Responding */ ? `(esc to cancel, ${elapsedTime < 60 ? `${elapsedTime}s` : formatDuration(elapsedTime * 1e3)})` : null;
|
|
23015
|
+
const wittyPhraseNode = !forceRealStatusOnly && showWit && wittyPhrase && primaryText === "Thinking..." ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { marginLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, dimColor: true, italic: true, children: wittyPhrase }) }) : null;
|
|
23016
|
+
if (inline) {
|
|
23017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
23018
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
23019
|
+
GeminiRespondingSpinner,
|
|
23020
|
+
{
|
|
23021
|
+
nonRespondingDisplay: spinnerIcon ?? (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ ? "\u280F" : ""),
|
|
23022
|
+
isHookActive
|
|
23023
|
+
}
|
|
23024
|
+
) }),
|
|
23025
|
+
primaryText && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { flexShrink: 1, children: [
|
|
23026
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.primary, italic: true, wrap: "truncate-end", children: primaryText }),
|
|
23027
|
+
primaryText === INTERACTIVE_SHELL_WAITING_PHRASE && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text, { color: theme.ui.active, italic: true, children: [
|
|
23028
|
+
" ",
|
|
23029
|
+
"(press tab to focus)"
|
|
23030
|
+
] })
|
|
23031
|
+
] }),
|
|
23032
|
+
cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
23033
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexShrink: 0, width: 1 }),
|
|
23034
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent })
|
|
23035
|
+
] }),
|
|
23036
|
+
wittyPhraseNode
|
|
23037
|
+
] });
|
|
23038
|
+
}
|
|
23039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { paddingLeft: 0, flexDirection: "column", children: [
|
|
23040
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
23041
|
+
Box_default,
|
|
22944
23042
|
{
|
|
22945
|
-
|
|
22946
|
-
|
|
23043
|
+
width: "100%",
|
|
23044
|
+
flexDirection: isNarrow ? "column" : "row",
|
|
23045
|
+
alignItems: isNarrow ? "flex-start" : "center",
|
|
23046
|
+
children: [
|
|
23047
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
23048
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
23049
|
+
GeminiRespondingSpinner,
|
|
23050
|
+
{
|
|
23051
|
+
nonRespondingDisplay: spinnerIcon ?? (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ ? "\u280F" : ""),
|
|
23052
|
+
isHookActive
|
|
23053
|
+
}
|
|
23054
|
+
) }),
|
|
23055
|
+
primaryText && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { flexShrink: 1, children: [
|
|
23056
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.primary, italic: true, wrap: "truncate-end", children: primaryText }),
|
|
23057
|
+
primaryText === INTERACTIVE_SHELL_WAITING_PHRASE && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text, { color: theme.ui.active, italic: true, children: [
|
|
23058
|
+
" ",
|
|
23059
|
+
"(press tab to focus)"
|
|
23060
|
+
] })
|
|
23061
|
+
] }),
|
|
23062
|
+
!isNarrow && cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
23063
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexShrink: 0, width: 1 }),
|
|
23064
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent })
|
|
23065
|
+
] }),
|
|
23066
|
+
!isNarrow && wittyPhraseNode
|
|
23067
|
+
] }),
|
|
23068
|
+
!isNarrow && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexGrow: 1 }),
|
|
23069
|
+
!isNarrow && rightContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: rightContent })
|
|
23070
|
+
]
|
|
22947
23071
|
}
|
|
22948
|
-
)
|
|
22949
|
-
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
" ",
|
|
22953
|
-
"(press tab to focus)"
|
|
22954
|
-
] })
|
|
22955
|
-
] }),
|
|
22956
|
-
cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
22957
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexShrink: 0, width: 1 }),
|
|
22958
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent })
|
|
22959
|
-
] }),
|
|
22960
|
-
wittyPhraseNode
|
|
23072
|
+
),
|
|
23073
|
+
isNarrow && cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent }) }),
|
|
23074
|
+
isNarrow && wittyPhraseNode,
|
|
23075
|
+
isNarrow && rightContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: rightContent })
|
|
22961
23076
|
] });
|
|
22962
23077
|
}
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
Box_default,
|
|
22966
|
-
{
|
|
22967
|
-
width: "100%",
|
|
22968
|
-
flexDirection: isNarrow ? "column" : "row",
|
|
22969
|
-
alignItems: isNarrow ? "flex-start" : "center",
|
|
22970
|
-
children: [
|
|
22971
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
22972
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
22973
|
-
GeminiRespondingSpinner,
|
|
22974
|
-
{
|
|
22975
|
-
nonRespondingDisplay: spinnerIcon ?? (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ ? "\u280F" : ""),
|
|
22976
|
-
isHookActive
|
|
22977
|
-
}
|
|
22978
|
-
) }),
|
|
22979
|
-
primaryText && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { flexShrink: 1, children: [
|
|
22980
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.primary, italic: true, wrap: "truncate-end", children: primaryText }),
|
|
22981
|
-
primaryText === INTERACTIVE_SHELL_WAITING_PHRASE && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text, { color: theme.ui.active, italic: true, children: [
|
|
22982
|
-
" ",
|
|
22983
|
-
"(press tab to focus)"
|
|
22984
|
-
] })
|
|
22985
|
-
] }),
|
|
22986
|
-
!isNarrow && cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
22987
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexShrink: 0, width: 1 }),
|
|
22988
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent })
|
|
22989
|
-
] }),
|
|
22990
|
-
!isNarrow && wittyPhraseNode
|
|
22991
|
-
] }),
|
|
22992
|
-
!isNarrow && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexGrow: 1 }),
|
|
22993
|
-
!isNarrow && rightContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: rightContent })
|
|
22994
|
-
]
|
|
22995
|
-
}
|
|
22996
|
-
),
|
|
22997
|
-
isNarrow && cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent }) }),
|
|
22998
|
-
isNarrow && wittyPhraseNode,
|
|
22999
|
-
isNarrow && rightContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: rightContent })
|
|
23000
|
-
] });
|
|
23001
|
-
};
|
|
23078
|
+
);
|
|
23079
|
+
LoadingIndicator.displayName = "LoadingIndicator";
|
|
23002
23080
|
|
|
23003
23081
|
// packages/cli/src/ui/components/ContextSummaryDisplay.tsx
|
|
23004
23082
|
var import_jsx_runtime114 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -23187,12 +23265,12 @@ var RawMarkdownIndicator = () => {
|
|
|
23187
23265
|
};
|
|
23188
23266
|
|
|
23189
23267
|
// packages/cli/src/ui/hooks/useComposerStatus.ts
|
|
23190
|
-
var
|
|
23268
|
+
var import_react78 = __toESM(require_react(), 1);
|
|
23191
23269
|
var useComposerStatus = () => {
|
|
23192
23270
|
const uiState = useUIState();
|
|
23193
23271
|
const quotaState = useQuotaState();
|
|
23194
23272
|
const settings = useSettings();
|
|
23195
|
-
const hasPendingToolConfirmation = (0,
|
|
23273
|
+
const hasPendingToolConfirmation = (0, import_react78.useMemo)(
|
|
23196
23274
|
() => (uiState.pendingHistoryItems ?? []).filter(
|
|
23197
23275
|
(item) => item.type === "tool_group"
|
|
23198
23276
|
).some(
|
|
@@ -23208,7 +23286,7 @@ var useComposerStatus = () => {
|
|
|
23208
23286
|
);
|
|
23209
23287
|
const showLoadingIndicator = (!uiState.embeddedShellFocused || uiState.isBackgroundTaskVisible) && uiState.streamingState === "responding" /* Responding */ && !hasPendingActionRequired;
|
|
23210
23288
|
const showApprovalModeIndicator = uiState.showApprovalModeIndicator;
|
|
23211
|
-
const modeContentObj = (0,
|
|
23289
|
+
const modeContentObj = (0, import_react78.useMemo)(() => {
|
|
23212
23290
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23213
23291
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23214
23292
|
switch (showApprovalModeIndicator) {
|
|
@@ -23263,283 +23341,291 @@ var LAYOUT = {
|
|
|
23263
23341
|
CONTEXT_DISPLAY_LEFT_MARGIN_WIDE: 0,
|
|
23264
23342
|
COLLISION_GAP: 10
|
|
23265
23343
|
};
|
|
23266
|
-
var StatusNode = (
|
|
23267
|
-
|
|
23268
|
-
showWit,
|
|
23269
|
-
thought,
|
|
23270
|
-
elapsedTime,
|
|
23271
|
-
currentWittyPhrase,
|
|
23272
|
-
activeHooks,
|
|
23273
|
-
showLoadingIndicator,
|
|
23274
|
-
errorVerbosity,
|
|
23275
|
-
statusPhrase,
|
|
23276
|
-
onResize
|
|
23277
|
-
}) => {
|
|
23278
|
-
const observerRef = (0, import_react77.useRef)(null);
|
|
23279
|
-
(0, import_react77.useEffect)(
|
|
23280
|
-
() => () => {
|
|
23281
|
-
observerRef.current?.disconnect();
|
|
23282
|
-
},
|
|
23283
|
-
[]
|
|
23284
|
-
);
|
|
23285
|
-
const onRefChange = (0, import_react77.useCallback)(
|
|
23286
|
-
(node) => {
|
|
23287
|
-
if (observerRef.current) {
|
|
23288
|
-
observerRef.current.disconnect();
|
|
23289
|
-
observerRef.current = null;
|
|
23290
|
-
}
|
|
23291
|
-
if (node && onResize) {
|
|
23292
|
-
const observer = new ResizeObserver((entries) => {
|
|
23293
|
-
const entry = entries[0];
|
|
23294
|
-
if (entry) {
|
|
23295
|
-
onResize(Math.round(entry.contentRect.width));
|
|
23296
|
-
}
|
|
23297
|
-
});
|
|
23298
|
-
observer.observe(node);
|
|
23299
|
-
observerRef.current = observer;
|
|
23300
|
-
}
|
|
23301
|
-
},
|
|
23302
|
-
[onResize]
|
|
23303
|
-
);
|
|
23304
|
-
if (activeHooks.length === 0 && !showLoadingIndicator && !statusPhrase) {
|
|
23305
|
-
return null;
|
|
23306
|
-
}
|
|
23307
|
-
let currentLoadingPhrase = void 0;
|
|
23308
|
-
let currentThought = null;
|
|
23309
|
-
if (activeHooks.length > 0) {
|
|
23310
|
-
const userVisibleHooks = activeHooks.filter(
|
|
23311
|
-
(h) => isUserVisibleHook(h.source)
|
|
23312
|
-
);
|
|
23313
|
-
if (userVisibleHooks.length > 0) {
|
|
23314
|
-
const label = userVisibleHooks.length > 1 ? "Executing Hooks" : "Executing Hook";
|
|
23315
|
-
const displayNames = userVisibleHooks.map((h) => {
|
|
23316
|
-
let name = stripAnsi(h.name);
|
|
23317
|
-
if (h.index && h.total && h.total > 1) {
|
|
23318
|
-
name += ` (${h.index}/${h.total})`;
|
|
23319
|
-
}
|
|
23320
|
-
return name;
|
|
23321
|
-
});
|
|
23322
|
-
currentLoadingPhrase = `${label}: ${displayNames.join(", ")}`;
|
|
23323
|
-
} else {
|
|
23324
|
-
currentLoadingPhrase = GENERIC_WORKING_LABEL;
|
|
23325
|
-
}
|
|
23326
|
-
} else {
|
|
23327
|
-
currentThought = thought ? { ...thought, subject: stripAnsi(thought.subject) } : null;
|
|
23328
|
-
}
|
|
23329
|
-
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { ref: onRefChange, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23330
|
-
LoadingIndicator,
|
|
23331
|
-
{
|
|
23332
|
-
inline: true,
|
|
23333
|
-
showTips,
|
|
23334
|
-
showWit,
|
|
23335
|
-
errorVerbosity,
|
|
23336
|
-
thought: currentThought,
|
|
23337
|
-
currentLoadingPhrase,
|
|
23338
|
-
statusPhrase,
|
|
23339
|
-
elapsedTime,
|
|
23340
|
-
forceRealStatusOnly: false,
|
|
23341
|
-
wittyPhrase: currentWittyPhrase
|
|
23342
|
-
}
|
|
23343
|
-
) });
|
|
23344
|
-
};
|
|
23345
|
-
var StatusRow = ({
|
|
23346
|
-
showUiDetails,
|
|
23347
|
-
isNarrow,
|
|
23348
|
-
terminalWidth,
|
|
23349
|
-
hideContextSummary,
|
|
23350
|
-
hideUiDetailsForSuggestions,
|
|
23351
|
-
hasPendingActionRequired,
|
|
23352
|
-
statusPhrase: propStatusPhrase
|
|
23353
|
-
}) => {
|
|
23354
|
-
const uiState = useUIState();
|
|
23355
|
-
const statusPhrase = propStatusPhrase ?? uiState.statusPhrase;
|
|
23356
|
-
const inputState = useInputState();
|
|
23357
|
-
const settings = useSettings();
|
|
23358
|
-
const {
|
|
23359
|
-
isInteractiveShellWaiting,
|
|
23360
|
-
showLoadingIndicator,
|
|
23344
|
+
var StatusNode = import_react79.default.memo(
|
|
23345
|
+
({
|
|
23361
23346
|
showTips,
|
|
23362
23347
|
showWit,
|
|
23363
|
-
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
|
|
23371
|
-
|
|
23372
|
-
|
|
23373
|
-
|
|
23374
|
-
|
|
23375
|
-
|
|
23376
|
-
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
|
|
23380
|
-
|
|
23381
|
-
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
23386
|
-
|
|
23387
|
-
|
|
23348
|
+
thought,
|
|
23349
|
+
elapsedTime,
|
|
23350
|
+
currentWittyPhrase,
|
|
23351
|
+
activeHooks,
|
|
23352
|
+
showLoadingIndicator,
|
|
23353
|
+
errorVerbosity,
|
|
23354
|
+
statusPhrase,
|
|
23355
|
+
onResize
|
|
23356
|
+
}) => {
|
|
23357
|
+
const observerRef = (0, import_react79.useRef)(null);
|
|
23358
|
+
(0, import_react79.useEffect)(
|
|
23359
|
+
() => () => {
|
|
23360
|
+
observerRef.current?.disconnect();
|
|
23361
|
+
},
|
|
23362
|
+
[]
|
|
23363
|
+
);
|
|
23364
|
+
const onRefChange = (0, import_react79.useCallback)(
|
|
23365
|
+
(node) => {
|
|
23366
|
+
if (observerRef.current) {
|
|
23367
|
+
observerRef.current.disconnect();
|
|
23368
|
+
observerRef.current = null;
|
|
23369
|
+
}
|
|
23370
|
+
if (node && onResize) {
|
|
23371
|
+
const observer = new ResizeObserver((entries) => {
|
|
23372
|
+
const entry = entries[0];
|
|
23373
|
+
if (entry) {
|
|
23374
|
+
onResize(Math.round(entry.contentRect.width));
|
|
23375
|
+
}
|
|
23376
|
+
});
|
|
23377
|
+
observer.observe(node);
|
|
23378
|
+
observerRef.current = observer;
|
|
23388
23379
|
}
|
|
23389
|
-
}
|
|
23390
|
-
|
|
23391
|
-
|
|
23392
|
-
|
|
23393
|
-
|
|
23394
|
-
const tipContentStr = (() => {
|
|
23395
|
-
if (showTips && uiState.currentTip && !(isInteractiveShellWaiting && uiState.currentTip === INTERACTIVE_SHELL_WAITING_PHRASE)) {
|
|
23396
|
-
return uiState.currentTip;
|
|
23397
|
-
}
|
|
23398
|
-
if (settings.merged.ui.showShortcutsHint && !hideUiDetailsForSuggestions && !hasPendingActionRequired && inputState.buffer.text.length === 0) {
|
|
23399
|
-
return showUiDetails ? "? for shortcuts" : "press tab twice for more";
|
|
23380
|
+
},
|
|
23381
|
+
[onResize]
|
|
23382
|
+
);
|
|
23383
|
+
if (activeHooks.length === 0 && !showLoadingIndicator && !statusPhrase) {
|
|
23384
|
+
return null;
|
|
23400
23385
|
}
|
|
23401
|
-
|
|
23402
|
-
|
|
23403
|
-
|
|
23404
|
-
|
|
23405
|
-
|
|
23406
|
-
|
|
23407
|
-
|
|
23408
|
-
|
|
23409
|
-
|
|
23410
|
-
|
|
23411
|
-
|
|
23412
|
-
|
|
23413
|
-
|
|
23414
|
-
|
|
23415
|
-
|
|
23416
|
-
|
|
23417
|
-
|
|
23418
|
-
|
|
23419
|
-
|
|
23420
|
-
|
|
23421
|
-
|
|
23422
|
-
activeHooks: uiState.activeHooks,
|
|
23423
|
-
showLoadingIndicator,
|
|
23424
|
-
errorVerbosity: settings.merged.ui.errorVerbosity,
|
|
23425
|
-
statusPhrase,
|
|
23426
|
-
onResize: onStatusResize
|
|
23386
|
+
let currentLoadingPhrase = void 0;
|
|
23387
|
+
let currentThought = null;
|
|
23388
|
+
if (activeHooks.length > 0) {
|
|
23389
|
+
const userVisibleHooks = activeHooks.filter(
|
|
23390
|
+
(h) => isUserVisibleHook(h.source)
|
|
23391
|
+
);
|
|
23392
|
+
if (userVisibleHooks.length > 0) {
|
|
23393
|
+
const label = userVisibleHooks.length > 1 ? "Executing Hooks" : "Executing Hook";
|
|
23394
|
+
const displayNames = userVisibleHooks.map((h) => {
|
|
23395
|
+
let name = stripAnsi(h.name);
|
|
23396
|
+
if (h.index && h.total && h.total > 1) {
|
|
23397
|
+
name += ` (${h.index}/${h.total})`;
|
|
23398
|
+
}
|
|
23399
|
+
return name;
|
|
23400
|
+
});
|
|
23401
|
+
currentLoadingPhrase = `${label}: ${displayNames.join(", ")}`;
|
|
23402
|
+
} else {
|
|
23403
|
+
currentLoadingPhrase = GENERIC_WORKING_LABEL;
|
|
23404
|
+
}
|
|
23405
|
+
} else {
|
|
23406
|
+
currentThought = thought ? { ...thought, subject: stripAnsi(thought.subject) } : null;
|
|
23427
23407
|
}
|
|
23428
|
-
|
|
23429
|
-
|
|
23430
|
-
if (!tipContentStr) return null;
|
|
23431
|
-
const isShortcutHint = tipContentStr === "? for shortcuts" || tipContentStr === "press tab twice for more";
|
|
23432
|
-
const color = isShortcutHint && uiState.shortcutsHelpVisible ? theme.text.accent : theme.text.secondary;
|
|
23433
|
-
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { flexDirection: "row", justifyContent: "flex-end", ref: onTipRefChange, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23434
|
-
Text,
|
|
23408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { ref: onRefChange, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23409
|
+
LoadingIndicator,
|
|
23435
23410
|
{
|
|
23436
|
-
|
|
23437
|
-
|
|
23438
|
-
|
|
23439
|
-
|
|
23411
|
+
inline: true,
|
|
23412
|
+
showTips,
|
|
23413
|
+
showWit,
|
|
23414
|
+
errorVerbosity,
|
|
23415
|
+
thought: currentThought,
|
|
23416
|
+
currentLoadingPhrase,
|
|
23417
|
+
statusPhrase,
|
|
23418
|
+
elapsedTime,
|
|
23419
|
+
forceRealStatusOnly: false,
|
|
23420
|
+
wittyPhrase: currentWittyPhrase
|
|
23440
23421
|
}
|
|
23441
23422
|
) });
|
|
23442
|
-
};
|
|
23443
|
-
if (!showUiDetails && !showRow1Minimal && !showRow2Minimal) {
|
|
23444
|
-
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { height: LAYOUT.STATUS_MIN_HEIGHT });
|
|
23445
23423
|
}
|
|
23446
|
-
|
|
23447
|
-
|
|
23448
|
-
|
|
23449
|
-
|
|
23450
|
-
|
|
23451
|
-
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
|
|
23455
|
-
|
|
23456
|
-
|
|
23457
|
-
|
|
23458
|
-
|
|
23459
|
-
|
|
23460
|
-
|
|
23461
|
-
|
|
23462
|
-
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
|
|
23466
|
-
|
|
23467
|
-
|
|
23468
|
-
|
|
23469
|
-
|
|
23470
|
-
|
|
23471
|
-
|
|
23472
|
-
|
|
23473
|
-
|
|
23474
|
-
|
|
23475
|
-
|
|
23476
|
-
|
|
23477
|
-
|
|
23478
|
-
|
|
23479
|
-
|
|
23480
|
-
|
|
23481
|
-
|
|
23424
|
+
);
|
|
23425
|
+
StatusNode.displayName = "StatusNode";
|
|
23426
|
+
var StatusRow = import_react79.default.memo(
|
|
23427
|
+
({
|
|
23428
|
+
showUiDetails,
|
|
23429
|
+
isNarrow,
|
|
23430
|
+
terminalWidth,
|
|
23431
|
+
hideContextSummary,
|
|
23432
|
+
hideUiDetailsForSuggestions,
|
|
23433
|
+
hasPendingActionRequired,
|
|
23434
|
+
statusPhrase: propStatusPhrase
|
|
23435
|
+
}) => {
|
|
23436
|
+
const uiState = useUIState();
|
|
23437
|
+
const statusPhrase = propStatusPhrase ?? uiState.statusPhrase;
|
|
23438
|
+
const inputState = useInputState();
|
|
23439
|
+
const settings = useSettings();
|
|
23440
|
+
const {
|
|
23441
|
+
isInteractiveShellWaiting,
|
|
23442
|
+
showLoadingIndicator,
|
|
23443
|
+
showTips,
|
|
23444
|
+
showWit,
|
|
23445
|
+
modeContentObj,
|
|
23446
|
+
showMinimalContext
|
|
23447
|
+
} = useComposerStatus();
|
|
23448
|
+
const [statusWidth, setStatusWidth] = (0, import_react79.useState)(0);
|
|
23449
|
+
const [tipWidth, setTipWidth] = (0, import_react79.useState)(0);
|
|
23450
|
+
const tipObserverRef = (0, import_react79.useRef)(null);
|
|
23451
|
+
(0, import_react79.useEffect)(
|
|
23452
|
+
() => () => {
|
|
23453
|
+
tipObserverRef.current?.disconnect();
|
|
23454
|
+
},
|
|
23455
|
+
[]
|
|
23456
|
+
);
|
|
23457
|
+
const onTipRefChange = (0, import_react79.useCallback)((node) => {
|
|
23458
|
+
if (tipObserverRef.current) {
|
|
23459
|
+
tipObserverRef.current.disconnect();
|
|
23460
|
+
tipObserverRef.current = null;
|
|
23461
|
+
}
|
|
23462
|
+
if (node) {
|
|
23463
|
+
const observer = new ResizeObserver((entries) => {
|
|
23464
|
+
const entry = entries[0];
|
|
23465
|
+
if (entry) {
|
|
23466
|
+
const width = Math.round(entry.contentRect.width);
|
|
23467
|
+
if (width > 0) {
|
|
23468
|
+
setTipWidth(width);
|
|
23482
23469
|
}
|
|
23483
|
-
|
|
23484
|
-
|
|
23470
|
+
}
|
|
23471
|
+
});
|
|
23472
|
+
observer.observe(node);
|
|
23473
|
+
tipObserverRef.current = observer;
|
|
23485
23474
|
}
|
|
23486
|
-
)
|
|
23487
|
-
|
|
23488
|
-
|
|
23489
|
-
|
|
23475
|
+
}, []);
|
|
23476
|
+
const tipContentStr = (() => {
|
|
23477
|
+
if (showTips && uiState.currentTip && !(isInteractiveShellWaiting && uiState.currentTip === INTERACTIVE_SHELL_WAITING_PHRASE)) {
|
|
23478
|
+
return uiState.currentTip;
|
|
23479
|
+
}
|
|
23480
|
+
if (settings.merged.ui?.showShortcutsHint && !hideUiDetailsForSuggestions && !hasPendingActionRequired && inputState.buffer.text.length === 0) {
|
|
23481
|
+
return showUiDetails ? "? for shortcuts" : "press tab twice for more";
|
|
23482
|
+
}
|
|
23483
|
+
return void 0;
|
|
23484
|
+
})();
|
|
23485
|
+
const hasStatus = showLoadingIndicator || uiState.activeHooks.length > 0 || Boolean(statusPhrase);
|
|
23486
|
+
const effectiveStatusWidth = hasStatus ? statusWidth : 0;
|
|
23487
|
+
const willCollideTip = effectiveStatusWidth + tipWidth + LAYOUT.COLLISION_GAP > terminalWidth;
|
|
23488
|
+
const showTipLine = Boolean(
|
|
23489
|
+
!hasPendingActionRequired && tipContentStr && !willCollideTip && !isNarrow
|
|
23490
|
+
);
|
|
23491
|
+
const showRow1Minimal = showLoadingIndicator || uiState.activeHooks.length > 0 || showTipLine || Boolean(statusPhrase);
|
|
23492
|
+
const showRow2Minimal = Boolean(modeContentObj) && !hideUiDetailsForSuggestions || showMinimalContext;
|
|
23493
|
+
const showRow1 = showUiDetails || showRow1Minimal;
|
|
23494
|
+
const showRow2 = showUiDetails || showRow2Minimal;
|
|
23495
|
+
const onStatusResize = (0, import_react79.useCallback)((width) => {
|
|
23496
|
+
if (width > 0) setStatusWidth(width);
|
|
23497
|
+
}, []);
|
|
23498
|
+
const statusNode = /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23499
|
+
StatusNode,
|
|
23490
23500
|
{
|
|
23491
|
-
|
|
23492
|
-
|
|
23493
|
-
|
|
23494
|
-
|
|
23495
|
-
|
|
23496
|
-
|
|
23497
|
-
|
|
23498
|
-
|
|
23499
|
-
|
|
23500
|
-
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
|
|
23511
|
-
|
|
23512
|
-
|
|
23501
|
+
showTips,
|
|
23502
|
+
showWit,
|
|
23503
|
+
thought: uiState.thought,
|
|
23504
|
+
elapsedTime: uiState.elapsedTime,
|
|
23505
|
+
currentWittyPhrase: uiState.currentWittyPhrase,
|
|
23506
|
+
activeHooks: uiState.activeHooks,
|
|
23507
|
+
showLoadingIndicator,
|
|
23508
|
+
errorVerbosity: settings.merged.ui?.errorVerbosity,
|
|
23509
|
+
statusPhrase,
|
|
23510
|
+
onResize: onStatusResize
|
|
23511
|
+
}
|
|
23512
|
+
);
|
|
23513
|
+
const renderTipNode = () => {
|
|
23514
|
+
if (!tipContentStr) return null;
|
|
23515
|
+
const isShortcutHint = tipContentStr === "? for shortcuts" || tipContentStr === "press tab twice for more";
|
|
23516
|
+
const color = isShortcutHint && uiState.shortcutsHelpVisible ? theme.text.accent : theme.text.secondary;
|
|
23517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { flexDirection: "row", justifyContent: "flex-end", ref: onTipRefChange, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23518
|
+
Text,
|
|
23519
|
+
{
|
|
23520
|
+
color,
|
|
23521
|
+
wrap: "truncate-end",
|
|
23522
|
+
italic: !isShortcutHint && tipContentStr === uiState.currentWittyPhrase,
|
|
23523
|
+
children: tipContentStr === uiState.currentTip ? `Tip: ${tipContentStr}` : tipContentStr
|
|
23524
|
+
}
|
|
23525
|
+
) });
|
|
23526
|
+
};
|
|
23527
|
+
if (!showUiDetails && !showRow1Minimal && !showRow2Minimal) {
|
|
23528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { height: LAYOUT.STATUS_MIN_HEIGHT });
|
|
23529
|
+
}
|
|
23530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
|
|
23531
|
+
showRow1 && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
23532
|
+
Box_default,
|
|
23533
|
+
{
|
|
23534
|
+
width: "100%",
|
|
23535
|
+
flexDirection: "row",
|
|
23536
|
+
alignItems: "center",
|
|
23537
|
+
justifyContent: "space-between",
|
|
23538
|
+
minHeight: LAYOUT.STATUS_MIN_HEIGHT,
|
|
23539
|
+
children: [
|
|
23540
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { flexDirection: "row", flexGrow: 1, flexShrink: 1, children: !showUiDetails && showRow1Minimal ? /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Box_default, { flexDirection: "row", columnGap: 1, children: [
|
|
23541
|
+
statusNode,
|
|
23542
|
+
!showUiDetails && showRow2Minimal && modeContentObj && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Text, { color: modeContentObj.color, children: [
|
|
23513
23543
|
"\u25CF ",
|
|
23514
23544
|
modeContentObj.text
|
|
23515
|
-
] })
|
|
23516
|
-
}
|
|
23517
|
-
|
|
23518
|
-
|
|
23519
|
-
|
|
23520
|
-
|
|
23521
|
-
|
|
23522
|
-
|
|
23523
|
-
|
|
23524
|
-
|
|
23525
|
-
|
|
23526
|
-
|
|
23527
|
-
|
|
23528
|
-
|
|
23529
|
-
|
|
23530
|
-
|
|
23531
|
-
|
|
23532
|
-
|
|
23533
|
-
|
|
23534
|
-
|
|
23535
|
-
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
|
|
23539
|
-
|
|
23540
|
-
|
|
23541
|
-
|
|
23542
|
-
|
|
23545
|
+
] }) })
|
|
23546
|
+
] }) : isInteractiveShellWaiting ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { width: "100%", marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text, { color: theme.status.warning, children: INTERACTIVE_SHELL_WAITING_PHRASE }) }) : /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23547
|
+
Box_default,
|
|
23548
|
+
{
|
|
23549
|
+
flexDirection: "row",
|
|
23550
|
+
alignItems: isNarrow ? "flex-start" : "center",
|
|
23551
|
+
flexGrow: 1,
|
|
23552
|
+
flexShrink: 0,
|
|
23553
|
+
marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN,
|
|
23554
|
+
children: statusNode
|
|
23555
|
+
}
|
|
23556
|
+
) }),
|
|
23557
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23558
|
+
Box_default,
|
|
23559
|
+
{
|
|
23560
|
+
flexShrink: 0,
|
|
23561
|
+
marginLeft: showTipLine ? LAYOUT.TIP_LEFT_MARGIN : 0,
|
|
23562
|
+
marginRight: showTipLine ? isNarrow ? LAYOUT.TIP_RIGHT_MARGIN_NARROW : LAYOUT.TIP_RIGHT_MARGIN_WIDE : 0,
|
|
23563
|
+
position: showTipLine ? "relative" : "absolute",
|
|
23564
|
+
...showTipLine ? {} : { top: -100, left: -100 },
|
|
23565
|
+
children: !isNarrow && tipContentStr && renderTipNode()
|
|
23566
|
+
}
|
|
23567
|
+
)
|
|
23568
|
+
]
|
|
23569
|
+
}
|
|
23570
|
+
),
|
|
23571
|
+
showRow1 && showRow2 && (showUiDetails || showRow1Minimal && showRow2Minimal) && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { width: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(HorizontalLine, { dim: true }) }),
|
|
23572
|
+
showRow2 && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
23573
|
+
Box_default,
|
|
23574
|
+
{
|
|
23575
|
+
width: "100%",
|
|
23576
|
+
flexDirection: isNarrow ? "column" : "row",
|
|
23577
|
+
alignItems: isNarrow ? "flex-start" : "center",
|
|
23578
|
+
justifyContent: "space-between",
|
|
23579
|
+
children: [
|
|
23580
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23581
|
+
Box_default,
|
|
23582
|
+
{
|
|
23583
|
+
flexDirection: "row",
|
|
23584
|
+
alignItems: "center",
|
|
23585
|
+
marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN,
|
|
23586
|
+
children: showUiDetails ? /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
|
|
23587
|
+
!hideUiDetailsForSuggestions && !inputState.shellModeActive && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23588
|
+
ApprovalModeIndicator,
|
|
23589
|
+
{
|
|
23590
|
+
approvalMode: uiState.showApprovalModeIndicator,
|
|
23591
|
+
allowPlanMode: uiState.allowPlanMode
|
|
23592
|
+
}
|
|
23593
|
+
),
|
|
23594
|
+
inputState.shellModeActive && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(ShellModeIndicator, {}) }),
|
|
23595
|
+
!uiState.renderMarkdown && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(RawMarkdownIndicator, {}) })
|
|
23596
|
+
] }) : showRow2Minimal && modeContentObj && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Text, { color: modeContentObj.color, children: [
|
|
23597
|
+
"\u25CF ",
|
|
23598
|
+
modeContentObj.text
|
|
23599
|
+
] })
|
|
23600
|
+
}
|
|
23601
|
+
),
|
|
23602
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
23603
|
+
Box_default,
|
|
23604
|
+
{
|
|
23605
|
+
marginTop: isNarrow ? LAYOUT.CONTEXT_DISPLAY_TOP_MARGIN_NARROW : 0,
|
|
23606
|
+
flexDirection: "row",
|
|
23607
|
+
alignItems: "center",
|
|
23608
|
+
marginLeft: isNarrow ? LAYOUT.CONTEXT_DISPLAY_LEFT_MARGIN_NARROW : LAYOUT.CONTEXT_DISPLAY_LEFT_MARGIN_WIDE,
|
|
23609
|
+
children: [
|
|
23610
|
+
(showUiDetails || showMinimalContext) && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(StatusDisplay, { hideContextSummary }),
|
|
23611
|
+
showMinimalContext && !showUiDetails && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23612
|
+
ContextUsageDisplay,
|
|
23613
|
+
{
|
|
23614
|
+
promptTokenCount: uiState.sessionStats.lastPromptTokenCount,
|
|
23615
|
+
model: typeof uiState.currentModel === "string" ? uiState.currentModel : void 0,
|
|
23616
|
+
terminalWidth
|
|
23617
|
+
}
|
|
23618
|
+
) })
|
|
23619
|
+
]
|
|
23620
|
+
}
|
|
23621
|
+
)
|
|
23622
|
+
]
|
|
23623
|
+
}
|
|
23624
|
+
)
|
|
23625
|
+
] });
|
|
23626
|
+
}
|
|
23627
|
+
);
|
|
23628
|
+
StatusRow.displayName = "StatusRow";
|
|
23543
23629
|
|
|
23544
23630
|
// packages/cli/src/ui/components/QueuedMessageDisplay.tsx
|
|
23545
23631
|
var import_jsx_runtime121 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -23565,13 +23651,13 @@ var QueuedMessageDisplay = ({
|
|
|
23565
23651
|
};
|
|
23566
23652
|
|
|
23567
23653
|
// packages/cli/src/ui/components/ConfigInitDisplay.tsx
|
|
23568
|
-
var
|
|
23654
|
+
var import_react80 = __toESM(require_react(), 1);
|
|
23569
23655
|
var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1);
|
|
23570
23656
|
var ConfigInitDisplay = ({
|
|
23571
23657
|
message: initialMessage = "Working..."
|
|
23572
23658
|
}) => {
|
|
23573
|
-
const [message, setMessage] = (0,
|
|
23574
|
-
(0,
|
|
23659
|
+
const [message, setMessage] = (0, import_react80.useState)(initialMessage);
|
|
23660
|
+
(0, import_react80.useEffect)(() => {
|
|
23575
23661
|
const onChange = (clients) => {
|
|
23576
23662
|
if (!clients || clients.size === 0) {
|
|
23577
23663
|
setMessage(initialMessage);
|
|
@@ -23615,10 +23701,10 @@ var ConfigInitDisplay = ({
|
|
|
23615
23701
|
};
|
|
23616
23702
|
|
|
23617
23703
|
// packages/cli/src/ui/components/messages/Todo.tsx
|
|
23618
|
-
var
|
|
23704
|
+
var import_react82 = __toESM(require_react(), 1);
|
|
23619
23705
|
|
|
23620
23706
|
// packages/cli/src/ui/components/Checklist.tsx
|
|
23621
|
-
var
|
|
23707
|
+
var import_react81 = __toESM(require_react(), 1);
|
|
23622
23708
|
|
|
23623
23709
|
// packages/cli/src/ui/components/ChecklistItem.tsx
|
|
23624
23710
|
var import_jsx_runtime123 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -23669,7 +23755,7 @@ var ChecklistItem = ({
|
|
|
23669
23755
|
// packages/cli/src/ui/components/Checklist.tsx
|
|
23670
23756
|
var import_jsx_runtime124 = __toESM(require_jsx_runtime(), 1);
|
|
23671
23757
|
var ChecklistTitleDisplay = ({ title, items, toggleHint }) => {
|
|
23672
|
-
const score = (0,
|
|
23758
|
+
const score = (0, import_react81.useMemo)(() => {
|
|
23673
23759
|
let total = 0;
|
|
23674
23760
|
let completed = 0;
|
|
23675
23761
|
for (const item of items) {
|
|
@@ -23706,11 +23792,11 @@ var Checklist = ({
|
|
|
23706
23792
|
isExpanded,
|
|
23707
23793
|
toggleHint
|
|
23708
23794
|
}) => {
|
|
23709
|
-
const inProgress = (0,
|
|
23795
|
+
const inProgress = (0, import_react81.useMemo)(
|
|
23710
23796
|
() => items.find((item) => item.status === "in_progress") || null,
|
|
23711
23797
|
[items]
|
|
23712
23798
|
);
|
|
23713
|
-
const hasActiveItems = (0,
|
|
23799
|
+
const hasActiveItems = (0, import_react81.useMemo)(
|
|
23714
23800
|
() => items.some(
|
|
23715
23801
|
(item) => item.status === "pending" || item.status === "in_progress"
|
|
23716
23802
|
),
|
|
@@ -23758,7 +23844,7 @@ var Checklist = ({
|
|
|
23758
23844
|
var import_jsx_runtime125 = __toESM(require_jsx_runtime(), 1);
|
|
23759
23845
|
var TodoTray = () => {
|
|
23760
23846
|
const uiState = useUIState();
|
|
23761
|
-
const todos = (0,
|
|
23847
|
+
const todos = (0, import_react82.useMemo)(() => {
|
|
23762
23848
|
for (let i = uiState.history.length - 1; i >= 0; i--) {
|
|
23763
23849
|
const entry = uiState.history[i];
|
|
23764
23850
|
if (entry.type !== "tool_group") {
|
|
@@ -23774,7 +23860,7 @@ var TodoTray = () => {
|
|
|
23774
23860
|
}
|
|
23775
23861
|
return null;
|
|
23776
23862
|
}, [uiState.history]);
|
|
23777
|
-
const checklistItems = (0,
|
|
23863
|
+
const checklistItems = (0, import_react82.useMemo)(() => {
|
|
23778
23864
|
if (!todos || !todos.todos) {
|
|
23779
23865
|
return [];
|
|
23780
23866
|
}
|
|
@@ -23807,10 +23893,10 @@ var Composer = ({ isFocused = true }) => {
|
|
|
23807
23893
|
const config = useConfig();
|
|
23808
23894
|
const { vimEnabled, vimMode } = useVimMode();
|
|
23809
23895
|
const isScreenReaderEnabled = use_is_screen_reader_enabled_default();
|
|
23810
|
-
const { columns: terminalWidth } = useTerminalSize();
|
|
23896
|
+
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
23811
23897
|
const isNarrow = isNarrowWidth(terminalWidth);
|
|
23812
|
-
const debugConsoleMaxHeight = Math.floor(Math.max(
|
|
23813
|
-
const [suggestionsVisible, setSuggestionsVisible] = (0,
|
|
23898
|
+
const debugConsoleMaxHeight = Math.floor(Math.max(terminalHeight * 0.2, 5));
|
|
23899
|
+
const [suggestionsVisible, setSuggestionsVisible] = (0, import_react83.useState)(false);
|
|
23814
23900
|
const isAlternateBuffer = useAlternateBuffer();
|
|
23815
23901
|
const showUiDetails = uiState.cleanUiDetailsVisible;
|
|
23816
23902
|
const suggestionsPosition = isAlternateBuffer ? "above" : "below";
|
|
@@ -23822,12 +23908,12 @@ var Composer = ({ isFocused = true }) => {
|
|
|
23822
23908
|
} = useComposerStatus();
|
|
23823
23909
|
const isPassiveShortcutsHelpState = uiState.isInputActive && uiState.streamingState === "idle" && !hasPendingActionRequired;
|
|
23824
23910
|
const { setShortcutsHelpVisible } = uiActions;
|
|
23825
|
-
(0,
|
|
23911
|
+
(0, import_react83.useEffect)(() => {
|
|
23826
23912
|
if (hasPendingActionRequired && !hasPendingToolConfirmation) {
|
|
23827
23913
|
appEvents.emit("scroll-to-bottom" /* ScrollToBottom */);
|
|
23828
23914
|
}
|
|
23829
23915
|
}, [hasPendingActionRequired, hasPendingToolConfirmation]);
|
|
23830
|
-
(0,
|
|
23916
|
+
(0, import_react83.useEffect)(() => {
|
|
23831
23917
|
if (uiState.shortcutsHelpVisible && !isPassiveShortcutsHelpState) {
|
|
23832
23918
|
setShortcutsHelpVisible(false);
|
|
23833
23919
|
}
|
|
@@ -23871,7 +23957,7 @@ var Composer = ({ isFocused = true }) => {
|
|
|
23871
23957
|
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
23872
23958
|
DetailedMessagesDisplay,
|
|
23873
23959
|
{
|
|
23874
|
-
maxHeight:
|
|
23960
|
+
maxHeight: debugConsoleMaxHeight,
|
|
23875
23961
|
width: uiState.terminalWidth,
|
|
23876
23962
|
hasFocus: uiState.showErrorDetails
|
|
23877
23963
|
}
|
|
@@ -23921,11 +24007,11 @@ var ExitWarning = () => {
|
|
|
23921
24007
|
};
|
|
23922
24008
|
|
|
23923
24009
|
// packages/cli/src/ui/hooks/useFlickerDetector.ts
|
|
23924
|
-
var
|
|
24010
|
+
var import_react84 = __toESM(require_react(), 1);
|
|
23925
24011
|
function useFlickerDetector(rootUiRef, terminalHeight) {
|
|
23926
24012
|
const config = useConfig();
|
|
23927
24013
|
const { constrainHeight } = useUIState();
|
|
23928
|
-
(0,
|
|
24014
|
+
(0, import_react84.useEffect)(() => {
|
|
23929
24015
|
if (rootUiRef.current) {
|
|
23930
24016
|
const measurement = measure_element_default(rootUiRef.current);
|
|
23931
24017
|
if (measurement.height > terminalHeight) {
|
|
@@ -23977,10 +24063,10 @@ var CopyModeWarning = () => {
|
|
|
23977
24063
|
};
|
|
23978
24064
|
|
|
23979
24065
|
// packages/cli/src/ui/components/BackgroundTaskDisplay.tsx
|
|
23980
|
-
var
|
|
24066
|
+
var import_react86 = __toESM(require_react(), 1);
|
|
23981
24067
|
|
|
23982
24068
|
// packages/cli/src/ui/hooks/useExecutionLifecycle.ts
|
|
23983
|
-
var
|
|
24069
|
+
var import_react85 = __toESM(require_react(), 1);
|
|
23984
24070
|
import path12 from "node:path";
|
|
23985
24071
|
import os2 from "node:os";
|
|
23986
24072
|
import fs5 from "node:fs";
|
|
@@ -24108,8 +24194,8 @@ ${safeModelContent}
|
|
|
24108
24194
|
});
|
|
24109
24195
|
}
|
|
24110
24196
|
var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, geminiClient, setShellInputFocused, terminalWidth, terminalHeight, activeBackgroundExecutionId, isWaitingForConfirmation) => {
|
|
24111
|
-
const [state, dispatch] = (0,
|
|
24112
|
-
const manager = (0,
|
|
24197
|
+
const [state, dispatch] = (0, import_react85.useReducer)(shellReducer, initialState4);
|
|
24198
|
+
const manager = (0, import_react85.useRef)(null);
|
|
24113
24199
|
if (!manager.current) {
|
|
24114
24200
|
manager.current = {
|
|
24115
24201
|
wasVisibleBeforeForeground: false,
|
|
@@ -24120,7 +24206,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24120
24206
|
}
|
|
24121
24207
|
const m = manager.current;
|
|
24122
24208
|
const activePtyId = state.activeShellPtyId ?? activeBackgroundExecutionId ?? void 0;
|
|
24123
|
-
(0,
|
|
24209
|
+
(0, import_react85.useEffect)(() => {
|
|
24124
24210
|
const isForegroundActive = !!activePtyId || !!isWaitingForConfirmation;
|
|
24125
24211
|
if (isForegroundActive) {
|
|
24126
24212
|
if (m.restoreTimeout) {
|
|
@@ -24150,7 +24236,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24150
24236
|
m,
|
|
24151
24237
|
dispatch
|
|
24152
24238
|
]);
|
|
24153
|
-
(0,
|
|
24239
|
+
(0, import_react85.useEffect)(
|
|
24154
24240
|
() => () => {
|
|
24155
24241
|
for (const unsubscribe of m.subscriptions.values()) {
|
|
24156
24242
|
unsubscribe();
|
|
@@ -24159,7 +24245,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24159
24245
|
},
|
|
24160
24246
|
[m]
|
|
24161
24247
|
);
|
|
24162
|
-
const toggleBackgroundTasks = (0,
|
|
24248
|
+
const toggleBackgroundTasks = (0, import_react85.useCallback)(() => {
|
|
24163
24249
|
if (state.backgroundTasks.size > 0) {
|
|
24164
24250
|
const willBeVisible = !state.isBackgroundTaskVisible;
|
|
24165
24251
|
dispatch({ type: "TOGGLE_VISIBILITY" });
|
|
@@ -24191,7 +24277,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24191
24277
|
m,
|
|
24192
24278
|
dispatch
|
|
24193
24279
|
]);
|
|
24194
|
-
const backgroundCurrentExecution = (0,
|
|
24280
|
+
const backgroundCurrentExecution = (0, import_react85.useCallback)(() => {
|
|
24195
24281
|
const pidToBackground = state.activeShellPtyId ?? activeBackgroundExecutionId;
|
|
24196
24282
|
if (pidToBackground) {
|
|
24197
24283
|
m.backgroundedPids.add(pidToBackground);
|
|
@@ -24207,7 +24293,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24207
24293
|
}
|
|
24208
24294
|
}
|
|
24209
24295
|
}, [state.activeShellPtyId, activeBackgroundExecutionId, m]);
|
|
24210
|
-
const dismissBackgroundTask = (0,
|
|
24296
|
+
const dismissBackgroundTask = (0, import_react85.useCallback)(
|
|
24211
24297
|
async (pid) => {
|
|
24212
24298
|
const shell = state.backgroundTasks.get(pid);
|
|
24213
24299
|
if (shell) {
|
|
@@ -24225,7 +24311,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24225
24311
|
},
|
|
24226
24312
|
[state.backgroundTasks, dispatch, m]
|
|
24227
24313
|
);
|
|
24228
|
-
const registerBackgroundTask = (0,
|
|
24314
|
+
const registerBackgroundTask = (0, import_react85.useCallback)(
|
|
24229
24315
|
(pid, command, initialOutput, completionBehavior) => {
|
|
24230
24316
|
m.backgroundedPids.add(pid);
|
|
24231
24317
|
dispatch({
|
|
@@ -24285,7 +24371,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24285
24371
|
},
|
|
24286
24372
|
[dispatch, m]
|
|
24287
24373
|
);
|
|
24288
|
-
(0,
|
|
24374
|
+
(0, import_react85.useEffect)(() => {
|
|
24289
24375
|
const listener = (info) => {
|
|
24290
24376
|
if (m.backgroundedPids.has(info.executionId)) {
|
|
24291
24377
|
return;
|
|
@@ -24302,7 +24388,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24302
24388
|
ExecutionLifecycleService.offBackground(listener);
|
|
24303
24389
|
};
|
|
24304
24390
|
}, [registerBackgroundTask, m]);
|
|
24305
|
-
const handleShellCommand = (0,
|
|
24391
|
+
const handleShellCommand = (0, import_react85.useCallback)(
|
|
24306
24392
|
(rawQuery, abortSignal) => {
|
|
24307
24393
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
24308
24394
|
return false;
|
|
@@ -24627,21 +24713,21 @@ var BackgroundTaskDisplay = ({
|
|
|
24627
24713
|
setIsBackgroundTaskListOpen
|
|
24628
24714
|
} = useUIActions();
|
|
24629
24715
|
const activeShell = shells.get(activePid);
|
|
24630
|
-
const [output, setOutput] = (0,
|
|
24716
|
+
const [output, setOutput] = (0, import_react86.useState)(
|
|
24631
24717
|
activeShell?.output || ""
|
|
24632
24718
|
);
|
|
24633
|
-
const [highlightedPid, setHighlightedPid] = (0,
|
|
24719
|
+
const [highlightedPid, setHighlightedPid] = (0, import_react86.useState)(
|
|
24634
24720
|
activePid
|
|
24635
24721
|
);
|
|
24636
|
-
const outputRef = (0,
|
|
24637
|
-
const subscribedRef = (0,
|
|
24638
|
-
(0,
|
|
24722
|
+
const outputRef = (0, import_react86.useRef)(null);
|
|
24723
|
+
const subscribedRef = (0, import_react86.useRef)(false);
|
|
24724
|
+
(0, import_react86.useEffect)(() => {
|
|
24639
24725
|
if (!activePid) return;
|
|
24640
24726
|
const ptyWidth = Math.max(1, width - BORDER_WIDTH - CONTENT_PADDING_X * 2);
|
|
24641
24727
|
const ptyHeight = Math.max(1, height - TOTAL_OVERHEAD_HEIGHT);
|
|
24642
24728
|
ShellExecutionService.resizePty(activePid, ptyWidth, ptyHeight);
|
|
24643
24729
|
}, [activePid, width, height]);
|
|
24644
|
-
(0,
|
|
24730
|
+
(0, import_react86.useEffect)(() => {
|
|
24645
24731
|
if (!activePid) {
|
|
24646
24732
|
setOutput("");
|
|
24647
24733
|
return;
|
|
@@ -24672,7 +24758,7 @@ var BackgroundTaskDisplay = ({
|
|
|
24672
24758
|
subscribedRef.current = false;
|
|
24673
24759
|
};
|
|
24674
24760
|
}, [activePid, shells]);
|
|
24675
|
-
(0,
|
|
24761
|
+
(0, import_react86.useEffect)(() => {
|
|
24676
24762
|
if (isListOpenProp) {
|
|
24677
24763
|
setHighlightedPid(activePid);
|
|
24678
24764
|
}
|
|
@@ -25093,12 +25179,12 @@ var App = () => {
|
|
|
25093
25179
|
import process12 from "node:process";
|
|
25094
25180
|
|
|
25095
25181
|
// packages/cli/src/ui/hooks/useMemoryMonitor.ts
|
|
25096
|
-
var
|
|
25182
|
+
var import_react87 = __toESM(require_react(), 1);
|
|
25097
25183
|
import process6 from "node:process";
|
|
25098
25184
|
var MEMORY_WARNING_THRESHOLD = 7 * 1024 * 1024 * 1024;
|
|
25099
25185
|
var MEMORY_CHECK_INTERVAL = 60 * 1e3;
|
|
25100
25186
|
var useMemoryMonitor = ({ addItem }) => {
|
|
25101
|
-
(0,
|
|
25187
|
+
(0, import_react87.useEffect)(() => {
|
|
25102
25188
|
const intervalId = setInterval(() => {
|
|
25103
25189
|
const usage = process6.memoryUsage().rss;
|
|
25104
25190
|
if (usage > MEMORY_WARNING_THRESHOLD) {
|
|
@@ -25117,17 +25203,17 @@ var useMemoryMonitor = ({ addItem }) => {
|
|
|
25117
25203
|
};
|
|
25118
25204
|
|
|
25119
25205
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
25120
|
-
var
|
|
25206
|
+
var import_react89 = __toESM(require_react(), 1);
|
|
25121
25207
|
import process7 from "node:process";
|
|
25122
25208
|
|
|
25123
25209
|
// packages/cli/src/ui/contexts/TerminalContext.tsx
|
|
25124
|
-
var
|
|
25210
|
+
var import_react88 = __toESM(require_react(), 1);
|
|
25125
25211
|
var import_jsx_runtime134 = __toESM(require_jsx_runtime(), 1);
|
|
25126
|
-
var TerminalContext = (0,
|
|
25212
|
+
var TerminalContext = (0, import_react88.createContext)(
|
|
25127
25213
|
void 0
|
|
25128
25214
|
);
|
|
25129
25215
|
function useTerminalContext() {
|
|
25130
|
-
const context = (0,
|
|
25216
|
+
const context = (0, import_react88.useContext)(TerminalContext);
|
|
25131
25217
|
if (!context) {
|
|
25132
25218
|
throw new Error(
|
|
25133
25219
|
"useTerminalContext must be used within a TerminalProvider"
|
|
@@ -25138,21 +25224,21 @@ function useTerminalContext() {
|
|
|
25138
25224
|
function TerminalProvider({ children }) {
|
|
25139
25225
|
const { stdin } = use_stdin_default();
|
|
25140
25226
|
const { stdout } = use_stdout_default();
|
|
25141
|
-
const subscribers = (0,
|
|
25142
|
-
const bufferRef = (0,
|
|
25143
|
-
const subscribe2 = (0,
|
|
25227
|
+
const subscribers = (0, import_react88.useRef)(/* @__PURE__ */ new Set()).current;
|
|
25228
|
+
const bufferRef = (0, import_react88.useRef)("");
|
|
25229
|
+
const subscribe2 = (0, import_react88.useCallback)(
|
|
25144
25230
|
(handler) => {
|
|
25145
25231
|
subscribers.add(handler);
|
|
25146
25232
|
},
|
|
25147
25233
|
[subscribers]
|
|
25148
25234
|
);
|
|
25149
|
-
const unsubscribe = (0,
|
|
25235
|
+
const unsubscribe = (0, import_react88.useCallback)(
|
|
25150
25236
|
(handler) => {
|
|
25151
25237
|
subscribers.delete(handler);
|
|
25152
25238
|
},
|
|
25153
25239
|
[subscribers]
|
|
25154
25240
|
);
|
|
25155
|
-
const queryTerminalBackground = (0,
|
|
25241
|
+
const queryTerminalBackground = (0, import_react88.useCallback)(
|
|
25156
25242
|
async () => new Promise((resolve3) => {
|
|
25157
25243
|
const handler = () => {
|
|
25158
25244
|
unsubscribe(handler);
|
|
@@ -25167,7 +25253,7 @@ function TerminalProvider({ children }) {
|
|
|
25167
25253
|
}),
|
|
25168
25254
|
[stdout, subscribe2, unsubscribe]
|
|
25169
25255
|
);
|
|
25170
|
-
(0,
|
|
25256
|
+
(0, import_react88.useEffect)(() => {
|
|
25171
25257
|
const handleData = (data) => {
|
|
25172
25258
|
bufferRef.current += typeof data === "string" ? data : data.toString("utf-8");
|
|
25173
25259
|
const match = bufferRef.current.match(
|
|
@@ -25203,9 +25289,9 @@ function TerminalProvider({ children }) {
|
|
|
25203
25289
|
|
|
25204
25290
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
25205
25291
|
var useThemeCommand = (loadedSettings, setThemeError, addItem, initialThemeError, refreshStatic) => {
|
|
25206
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
25292
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react89.useState)(!!initialThemeError);
|
|
25207
25293
|
const { queryTerminalBackground } = useTerminalContext();
|
|
25208
|
-
const openThemeDialog = (0,
|
|
25294
|
+
const openThemeDialog = (0, import_react89.useCallback)(async () => {
|
|
25209
25295
|
if (process7.env["NO_COLOR"]) {
|
|
25210
25296
|
addItem(
|
|
25211
25297
|
{
|
|
@@ -25219,7 +25305,7 @@ var useThemeCommand = (loadedSettings, setThemeError, addItem, initialThemeError
|
|
|
25219
25305
|
await queryTerminalBackground();
|
|
25220
25306
|
setIsThemeDialogOpen(true);
|
|
25221
25307
|
}, [addItem, queryTerminalBackground]);
|
|
25222
|
-
const applyTheme = (0,
|
|
25308
|
+
const applyTheme = (0, import_react89.useCallback)(
|
|
25223
25309
|
(themeName) => {
|
|
25224
25310
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
25225
25311
|
setIsThemeDialogOpen(true);
|
|
@@ -25230,17 +25316,17 @@ var useThemeCommand = (loadedSettings, setThemeError, addItem, initialThemeError
|
|
|
25230
25316
|
},
|
|
25231
25317
|
[setThemeError]
|
|
25232
25318
|
);
|
|
25233
|
-
const handleThemeHighlight = (0,
|
|
25319
|
+
const handleThemeHighlight = (0, import_react89.useCallback)(
|
|
25234
25320
|
(themeName) => {
|
|
25235
25321
|
applyTheme(themeName);
|
|
25236
25322
|
},
|
|
25237
25323
|
[applyTheme]
|
|
25238
25324
|
);
|
|
25239
|
-
const closeThemeDialog = (0,
|
|
25325
|
+
const closeThemeDialog = (0, import_react89.useCallback)(() => {
|
|
25240
25326
|
applyTheme(loadedSettings.merged.ui.theme);
|
|
25241
25327
|
setIsThemeDialogOpen(false);
|
|
25242
25328
|
}, [applyTheme, loadedSettings]);
|
|
25243
|
-
const handleThemeSelect = (0,
|
|
25329
|
+
const handleThemeSelect = (0, import_react89.useCallback)(
|
|
25244
25330
|
async (themeName, scope) => {
|
|
25245
25331
|
try {
|
|
25246
25332
|
const mergedCustomThemes = {
|
|
@@ -25277,7 +25363,7 @@ var useThemeCommand = (loadedSettings, setThemeError, addItem, initialThemeError
|
|
|
25277
25363
|
};
|
|
25278
25364
|
|
|
25279
25365
|
// packages/cli/src/ui/hooks/useQuotaAndFallback.ts
|
|
25280
|
-
var
|
|
25366
|
+
var import_react90 = __toESM(require_react(), 1);
|
|
25281
25367
|
|
|
25282
25368
|
// packages/cli/src/ui/hooks/creditsFlowHandler.ts
|
|
25283
25369
|
async function handleCreditsFlow(args) {
|
|
@@ -25475,13 +25561,13 @@ function useQuotaAndFallback({
|
|
|
25475
25561
|
onShowAuthSelection,
|
|
25476
25562
|
errorVerbosity = "full"
|
|
25477
25563
|
}) {
|
|
25478
|
-
const [proQuotaRequest, setProQuotaRequest] = (0,
|
|
25479
|
-
const [validationRequest, setValidationRequest] = (0,
|
|
25480
|
-
const [overageMenuRequest, setOverageMenuRequest] = (0,
|
|
25481
|
-
const [emptyWalletRequest, setEmptyWalletRequest] = (0,
|
|
25482
|
-
const isDialogPending = (0,
|
|
25483
|
-
const isValidationPending = (0,
|
|
25484
|
-
(0,
|
|
25564
|
+
const [proQuotaRequest, setProQuotaRequest] = (0, import_react90.useState)(null);
|
|
25565
|
+
const [validationRequest, setValidationRequest] = (0, import_react90.useState)(null);
|
|
25566
|
+
const [overageMenuRequest, setOverageMenuRequest] = (0, import_react90.useState)(null);
|
|
25567
|
+
const [emptyWalletRequest, setEmptyWalletRequest] = (0, import_react90.useState)(null);
|
|
25568
|
+
const isDialogPending = (0, import_react90.useRef)(false);
|
|
25569
|
+
const isValidationPending = (0, import_react90.useRef)(false);
|
|
25570
|
+
(0, import_react90.useEffect)(() => {
|
|
25485
25571
|
const fallbackHandler = async (failedModel, fallbackModel, error) => {
|
|
25486
25572
|
const contentGeneratorConfig = config.getContentGeneratorConfig();
|
|
25487
25573
|
let message;
|
|
@@ -25607,7 +25693,7 @@ function useQuotaAndFallback({
|
|
|
25607
25693
|
onShowAuthSelection,
|
|
25608
25694
|
errorVerbosity
|
|
25609
25695
|
]);
|
|
25610
|
-
(0,
|
|
25696
|
+
(0, import_react90.useEffect)(() => {
|
|
25611
25697
|
const validationHandler = async (validationLink, validationDescription, learnMoreUrl) => {
|
|
25612
25698
|
if (isValidationPending.current) {
|
|
25613
25699
|
return "cancel";
|
|
@@ -25627,7 +25713,7 @@ function useQuotaAndFallback({
|
|
|
25627
25713
|
};
|
|
25628
25714
|
config.setValidationHandler(validationHandler);
|
|
25629
25715
|
}, [config]);
|
|
25630
|
-
const handleProQuotaChoice = (0,
|
|
25716
|
+
const handleProQuotaChoice = (0, import_react90.useCallback)(
|
|
25631
25717
|
(choice) => {
|
|
25632
25718
|
if (!proQuotaRequest) return;
|
|
25633
25719
|
const intent = choice;
|
|
@@ -25650,7 +25736,7 @@ function useQuotaAndFallback({
|
|
|
25650
25736
|
},
|
|
25651
25737
|
[proQuotaRequest, historyManager, config, setModelSwitchedFromQuotaError]
|
|
25652
25738
|
);
|
|
25653
|
-
const handleValidationChoice = (0,
|
|
25739
|
+
const handleValidationChoice = (0, import_react90.useCallback)(
|
|
25654
25740
|
(choice) => {
|
|
25655
25741
|
if (!isValidationPending.current || !validationRequest) return;
|
|
25656
25742
|
isValidationPending.current = false;
|
|
@@ -25662,14 +25748,14 @@ function useQuotaAndFallback({
|
|
|
25662
25748
|
},
|
|
25663
25749
|
[validationRequest, onShowAuthSelection]
|
|
25664
25750
|
);
|
|
25665
|
-
const handleOverageMenuChoice = (0,
|
|
25751
|
+
const handleOverageMenuChoice = (0, import_react90.useCallback)(
|
|
25666
25752
|
(choice) => {
|
|
25667
25753
|
if (!overageMenuRequest) return;
|
|
25668
25754
|
overageMenuRequest.resolve(choice);
|
|
25669
25755
|
},
|
|
25670
25756
|
[overageMenuRequest]
|
|
25671
25757
|
);
|
|
25672
|
-
const handleEmptyWalletChoice = (0,
|
|
25758
|
+
const handleEmptyWalletChoice = (0, import_react90.useCallback)(
|
|
25673
25759
|
(choice) => {
|
|
25674
25760
|
if (!emptyWalletRequest) return;
|
|
25675
25761
|
emptyWalletRequest.resolve(choice);
|
|
@@ -25699,7 +25785,7 @@ function getResetTimeMessage(delayMs) {
|
|
|
25699
25785
|
}
|
|
25700
25786
|
|
|
25701
25787
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
25702
|
-
var
|
|
25788
|
+
var import_react91 = __toESM(require_react(), 1);
|
|
25703
25789
|
|
|
25704
25790
|
// packages/cli/src/config/settingPaths.ts
|
|
25705
25791
|
var SettingPaths = {
|
|
@@ -25710,11 +25796,11 @@ var SettingPaths = {
|
|
|
25710
25796
|
|
|
25711
25797
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
25712
25798
|
var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
25713
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
25714
|
-
const openEditorDialog = (0,
|
|
25799
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react91.useState)(false);
|
|
25800
|
+
const openEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25715
25801
|
setIsEditorDialogOpen(true);
|
|
25716
25802
|
}, []);
|
|
25717
|
-
const handleEditorSelect = (0,
|
|
25803
|
+
const handleEditorSelect = (0, import_react91.useCallback)(
|
|
25718
25804
|
(editorType, scope) => {
|
|
25719
25805
|
if (editorType && (!hasValidEditorCommand(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
25720
25806
|
return;
|
|
@@ -25741,7 +25827,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25741
25827
|
},
|
|
25742
25828
|
[loadedSettings, setEditorError, addItem]
|
|
25743
25829
|
);
|
|
25744
|
-
const exitEditorDialog = (0,
|
|
25830
|
+
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25745
25831
|
setIsEditorDialogOpen(false);
|
|
25746
25832
|
coreEvents.emit(CoreEvent.EditorSelected, { editor: void 0 });
|
|
25747
25833
|
}, []);
|
|
@@ -25754,13 +25840,13 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25754
25840
|
};
|
|
25755
25841
|
|
|
25756
25842
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
25757
|
-
var
|
|
25843
|
+
var import_react92 = __toESM(require_react(), 1);
|
|
25758
25844
|
function useSettingsCommand() {
|
|
25759
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
25760
|
-
const openSettingsDialog = (0,
|
|
25845
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react92.useState)(false);
|
|
25846
|
+
const openSettingsDialog = (0, import_react92.useCallback)(() => {
|
|
25761
25847
|
setIsSettingsDialogOpen(true);
|
|
25762
25848
|
}, []);
|
|
25763
|
-
const closeSettingsDialog = (0,
|
|
25849
|
+
const closeSettingsDialog = (0, import_react92.useCallback)(() => {
|
|
25764
25850
|
setIsSettingsDialogOpen(false);
|
|
25765
25851
|
}, []);
|
|
25766
25852
|
return {
|
|
@@ -25771,13 +25857,13 @@ function useSettingsCommand() {
|
|
|
25771
25857
|
}
|
|
25772
25858
|
|
|
25773
25859
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
25774
|
-
var
|
|
25860
|
+
var import_react93 = __toESM(require_react(), 1);
|
|
25775
25861
|
var useModelCommand = () => {
|
|
25776
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
25777
|
-
const openModelDialog = (0,
|
|
25862
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react93.useState)(false);
|
|
25863
|
+
const openModelDialog = (0, import_react93.useCallback)(() => {
|
|
25778
25864
|
setIsModelDialogOpen(true);
|
|
25779
25865
|
}, []);
|
|
25780
|
-
const closeModelDialog = (0,
|
|
25866
|
+
const closeModelDialog = (0, import_react93.useCallback)(() => {
|
|
25781
25867
|
setIsModelDialogOpen(false);
|
|
25782
25868
|
}, []);
|
|
25783
25869
|
return {
|
|
@@ -25788,13 +25874,13 @@ var useModelCommand = () => {
|
|
|
25788
25874
|
};
|
|
25789
25875
|
|
|
25790
25876
|
// packages/cli/src/ui/hooks/useVoiceModelCommand.ts
|
|
25791
|
-
var
|
|
25877
|
+
var import_react94 = __toESM(require_react(), 1);
|
|
25792
25878
|
var useVoiceModelCommand = () => {
|
|
25793
|
-
const [isVoiceModelDialogOpen, setIsVoiceModelDialogOpen] = (0,
|
|
25794
|
-
const openVoiceModelDialog = (0,
|
|
25879
|
+
const [isVoiceModelDialogOpen, setIsVoiceModelDialogOpen] = (0, import_react94.useState)(false);
|
|
25880
|
+
const openVoiceModelDialog = (0, import_react94.useCallback)(() => {
|
|
25795
25881
|
setIsVoiceModelDialogOpen(true);
|
|
25796
25882
|
}, []);
|
|
25797
|
-
const closeVoiceModelDialog = (0,
|
|
25883
|
+
const closeVoiceModelDialog = (0, import_react94.useCallback)(() => {
|
|
25798
25884
|
setIsVoiceModelDialogOpen(false);
|
|
25799
25885
|
}, []);
|
|
25800
25886
|
return {
|
|
@@ -25805,7 +25891,7 @@ var useVoiceModelCommand = () => {
|
|
|
25805
25891
|
};
|
|
25806
25892
|
|
|
25807
25893
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
25808
|
-
var
|
|
25894
|
+
var import_react95 = __toESM(require_react(), 1);
|
|
25809
25895
|
import process8 from "node:process";
|
|
25810
25896
|
|
|
25811
25897
|
// packages/cli/src/services/SkillCommandLoader.ts
|
|
@@ -25898,41 +25984,41 @@ var LogoutConfirmationDialog = ({ onSelect }) => {
|
|
|
25898
25984
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
25899
25985
|
var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, setIsProcessing, actions, extensionsUpdateState, isConfigInitialized, setBannerVisible, setCustomDialog) => {
|
|
25900
25986
|
const session = useSessionStats();
|
|
25901
|
-
const [commands, setCommands] = (0,
|
|
25987
|
+
const [commands, setCommands] = (0, import_react95.useState)(
|
|
25902
25988
|
void 0
|
|
25903
25989
|
);
|
|
25904
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
25905
|
-
const reloadCommands = (0,
|
|
25990
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react95.useState)(0);
|
|
25991
|
+
const reloadCommands = (0, import_react95.useCallback)(() => {
|
|
25906
25992
|
setReloadTrigger((v) => v + 1);
|
|
25907
25993
|
}, []);
|
|
25908
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
25909
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
25994
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react95.useState)(null);
|
|
25995
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react95.useState)(
|
|
25910
25996
|
/* @__PURE__ */ new Set()
|
|
25911
25997
|
);
|
|
25912
|
-
const gitService = (0,
|
|
25998
|
+
const gitService = (0, import_react95.useMemo)(() => {
|
|
25913
25999
|
if (!config?.getProjectRoot()) {
|
|
25914
26000
|
return;
|
|
25915
26001
|
}
|
|
25916
26002
|
return new GitService(config.getProjectRoot(), config.storage);
|
|
25917
26003
|
}, [config]);
|
|
25918
|
-
const logger = (0,
|
|
26004
|
+
const logger = (0, import_react95.useMemo)(() => {
|
|
25919
26005
|
const l = new Logger(
|
|
25920
26006
|
config?.getSessionId() || "",
|
|
25921
26007
|
config?.storage ?? new Storage(process8.cwd())
|
|
25922
26008
|
);
|
|
25923
26009
|
return l;
|
|
25924
26010
|
}, [config]);
|
|
25925
|
-
const [pendingItem, setPendingItem] = (0,
|
|
26011
|
+
const [pendingItem, setPendingItem] = (0, import_react95.useState)(
|
|
25926
26012
|
null
|
|
25927
26013
|
);
|
|
25928
|
-
const pendingHistoryItems = (0,
|
|
26014
|
+
const pendingHistoryItems = (0, import_react95.useMemo)(() => {
|
|
25929
26015
|
const items = [];
|
|
25930
26016
|
if (pendingItem != null) {
|
|
25931
26017
|
items.push(pendingItem);
|
|
25932
26018
|
}
|
|
25933
26019
|
return items;
|
|
25934
26020
|
}, [pendingItem]);
|
|
25935
|
-
const addMessage = (0,
|
|
26021
|
+
const addMessage = (0, import_react95.useCallback)(
|
|
25936
26022
|
(message) => {
|
|
25937
26023
|
let historyItemContent;
|
|
25938
26024
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -25984,7 +26070,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25984
26070
|
},
|
|
25985
26071
|
[addItem]
|
|
25986
26072
|
);
|
|
25987
|
-
const commandContext = (0,
|
|
26073
|
+
const commandContext = (0, import_react95.useMemo)(
|
|
25988
26074
|
() => ({
|
|
25989
26075
|
services: {
|
|
25990
26076
|
agentContext: config,
|
|
@@ -26050,7 +26136,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26050
26136
|
setCustomDialog
|
|
26051
26137
|
]
|
|
26052
26138
|
);
|
|
26053
|
-
(0,
|
|
26139
|
+
(0, import_react95.useEffect)(() => {
|
|
26054
26140
|
if (!config) {
|
|
26055
26141
|
return;
|
|
26056
26142
|
}
|
|
@@ -26081,7 +26167,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26081
26167
|
coreEvents.off("extensionsStopping", extensionEventListener);
|
|
26082
26168
|
};
|
|
26083
26169
|
}, [config, reloadCommands]);
|
|
26084
|
-
(0,
|
|
26170
|
+
(0, import_react95.useEffect)(() => {
|
|
26085
26171
|
const controller = new AbortController();
|
|
26086
26172
|
(async () => {
|
|
26087
26173
|
const commandService = await CommandService.create(
|
|
@@ -26102,7 +26188,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26102
26188
|
controller.abort();
|
|
26103
26189
|
};
|
|
26104
26190
|
}, [config, reloadTrigger, isConfigInitialized]);
|
|
26105
|
-
const handleSlashCommand = (0,
|
|
26191
|
+
const handleSlashCommand = (0, import_react95.useCallback)(
|
|
26106
26192
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed, addToHistory = true) => {
|
|
26107
26193
|
if (!commands) {
|
|
26108
26194
|
return false;
|
|
@@ -26191,7 +26277,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26191
26277
|
return { type: "handled" };
|
|
26192
26278
|
case "logout":
|
|
26193
26279
|
setCustomDialog(
|
|
26194
|
-
(0,
|
|
26280
|
+
(0, import_react95.createElement)(LogoutConfirmationDialog, {
|
|
26195
26281
|
onSelect: async (choice) => {
|
|
26196
26282
|
setCustomDialog(null);
|
|
26197
26283
|
if (choice === "login" /* LOGIN */) {
|
|
@@ -26505,12 +26591,12 @@ var BEL = "\x07";
|
|
|
26505
26591
|
var SEP = ";";
|
|
26506
26592
|
var isTerminalApp = !isBrowser && process9.env.TERM_PROGRAM === "Apple_Terminal";
|
|
26507
26593
|
var isWindows2 = !isBrowser && process9.platform === "win32";
|
|
26508
|
-
var
|
|
26594
|
+
var isTmux2 = !isBrowser && (process9.env.TERM?.startsWith("screen") || process9.env.TERM?.startsWith("tmux") || process9.env.TMUX !== void 0);
|
|
26509
26595
|
var cwdFunction = isBrowser ? () => {
|
|
26510
26596
|
throw new Error("`process.cwd()` only works in Node.js, not the browser.");
|
|
26511
26597
|
} : process9.cwd;
|
|
26512
26598
|
var wrapOsc = (sequence) => {
|
|
26513
|
-
if (
|
|
26599
|
+
if (isTmux2) {
|
|
26514
26600
|
return "\x1BPtmux;" + sequence.replaceAll("\x1B", "\x1B\x1B") + "\x1B\\";
|
|
26515
26601
|
}
|
|
26516
26602
|
return sequence;
|
|
@@ -26701,10 +26787,10 @@ function computeTerminalTitle({
|
|
|
26701
26787
|
}
|
|
26702
26788
|
|
|
26703
26789
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
26704
|
-
var
|
|
26790
|
+
var import_react96 = __toESM(require_react(), 1);
|
|
26705
26791
|
var useLogger = (config) => {
|
|
26706
|
-
const [logger, setLogger] = (0,
|
|
26707
|
-
(0,
|
|
26792
|
+
const [logger, setLogger] = (0, import_react96.useState)(null);
|
|
26793
|
+
(0, import_react96.useEffect)(() => {
|
|
26708
26794
|
const newLogger = new Logger(config.getSessionId(), config.storage);
|
|
26709
26795
|
newLogger.initialize().then(() => setLogger(newLogger)).catch(() => {
|
|
26710
26796
|
});
|
|
@@ -26713,7 +26799,7 @@ var useLogger = (config) => {
|
|
|
26713
26799
|
};
|
|
26714
26800
|
|
|
26715
26801
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
26716
|
-
var
|
|
26802
|
+
var import_react101 = __toESM(require_react(), 1);
|
|
26717
26803
|
|
|
26718
26804
|
// packages/cli/src/ui/utils/markdownUtilities.ts
|
|
26719
26805
|
var isIndexInsideCodeBlock = (content, indexToTest) => {
|
|
@@ -26774,11 +26860,11 @@ var findLastSafeSplitPoint = (content) => {
|
|
|
26774
26860
|
};
|
|
26775
26861
|
|
|
26776
26862
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
26777
|
-
var
|
|
26863
|
+
var import_react97 = __toESM(require_react(), 1);
|
|
26778
26864
|
var useStateAndRef = (initialValue) => {
|
|
26779
|
-
const [state, setState] =
|
|
26780
|
-
const ref =
|
|
26781
|
-
const setStateInternal =
|
|
26865
|
+
const [state, setState] = import_react97.default.useState(initialValue);
|
|
26866
|
+
const ref = import_react97.default.useRef(initialValue);
|
|
26867
|
+
const setStateInternal = import_react97.default.useCallback(
|
|
26782
26868
|
(newStateOrCallback) => {
|
|
26783
26869
|
let newValue;
|
|
26784
26870
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -26887,21 +26973,21 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26887
26973
|
}
|
|
26888
26974
|
|
|
26889
26975
|
// packages/cli/src/ui/hooks/useToolScheduler.ts
|
|
26890
|
-
var
|
|
26976
|
+
var import_react98 = __toESM(require_react(), 1);
|
|
26891
26977
|
function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
26892
|
-
const [toolCallsMap, setToolCallsMap] = (0,
|
|
26893
|
-
const [lastToolOutputTime, setLastToolOutputTime] = (0,
|
|
26894
|
-
const [subagentHistoryMap, setSubagentHistoryMap] = (0,
|
|
26895
|
-
const messageBus = (0,
|
|
26896
|
-
const onCompleteRef = (0,
|
|
26897
|
-
(0,
|
|
26978
|
+
const [toolCallsMap, setToolCallsMap] = (0, import_react98.useState)({});
|
|
26979
|
+
const [lastToolOutputTime, setLastToolOutputTime] = (0, import_react98.useState)(0);
|
|
26980
|
+
const [subagentHistoryMap, setSubagentHistoryMap] = (0, import_react98.useState)({});
|
|
26981
|
+
const messageBus = (0, import_react98.useMemo)(() => config.getMessageBus(), [config]);
|
|
26982
|
+
const onCompleteRef = (0, import_react98.useRef)(onComplete);
|
|
26983
|
+
(0, import_react98.useEffect)(() => {
|
|
26898
26984
|
onCompleteRef.current = onComplete;
|
|
26899
26985
|
}, [onComplete]);
|
|
26900
|
-
const getPreferredEditorRef = (0,
|
|
26901
|
-
(0,
|
|
26986
|
+
const getPreferredEditorRef = (0, import_react98.useRef)(getPreferredEditor);
|
|
26987
|
+
(0, import_react98.useEffect)(() => {
|
|
26902
26988
|
getPreferredEditorRef.current = getPreferredEditor;
|
|
26903
26989
|
}, [getPreferredEditor]);
|
|
26904
|
-
const scheduler = (0,
|
|
26990
|
+
const scheduler = (0, import_react98.useMemo)(
|
|
26905
26991
|
() => new Scheduler({
|
|
26906
26992
|
context: config,
|
|
26907
26993
|
messageBus,
|
|
@@ -26910,12 +26996,12 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26910
26996
|
}),
|
|
26911
26997
|
[config, messageBus]
|
|
26912
26998
|
);
|
|
26913
|
-
(0,
|
|
26914
|
-
const internalAdaptToolCalls = (0,
|
|
26999
|
+
(0, import_react98.useEffect)(() => () => scheduler.dispose(), [scheduler]);
|
|
27000
|
+
const internalAdaptToolCalls = (0, import_react98.useCallback)(
|
|
26915
27001
|
(coreCalls, prevTracked) => adaptToolCalls(coreCalls, prevTracked),
|
|
26916
27002
|
[]
|
|
26917
27003
|
);
|
|
26918
|
-
(0,
|
|
27004
|
+
(0, import_react98.useEffect)(() => {
|
|
26919
27005
|
const handler = (event) => {
|
|
26920
27006
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26921
27007
|
const hasExecuting = event.toolCalls.some(
|
|
@@ -26945,7 +27031,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26945
27031
|
messageBus.unsubscribe(MessageBusType.TOOL_CALLS_UPDATE, handler);
|
|
26946
27032
|
};
|
|
26947
27033
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26948
|
-
(0,
|
|
27034
|
+
(0, import_react98.useEffect)(() => {
|
|
26949
27035
|
const handler = (event) => {
|
|
26950
27036
|
setSubagentHistoryMap((prev) => {
|
|
26951
27037
|
const history = prev[event.subagentName] ?? [];
|
|
@@ -26969,7 +27055,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26969
27055
|
messageBus.unsubscribe(MessageBusType.SUBAGENT_ACTIVITY, handler);
|
|
26970
27056
|
};
|
|
26971
27057
|
}, [messageBus]);
|
|
26972
|
-
const schedule = (0,
|
|
27058
|
+
const schedule = (0, import_react98.useCallback)(
|
|
26973
27059
|
async (request, signal) => {
|
|
26974
27060
|
setToolCallsMap({});
|
|
26975
27061
|
setSubagentHistoryMap({});
|
|
@@ -26979,13 +27065,13 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26979
27065
|
},
|
|
26980
27066
|
[scheduler]
|
|
26981
27067
|
);
|
|
26982
|
-
const cancelAll = (0,
|
|
27068
|
+
const cancelAll = (0, import_react98.useCallback)(
|
|
26983
27069
|
(_signal) => {
|
|
26984
27070
|
scheduler.cancelAll();
|
|
26985
27071
|
},
|
|
26986
27072
|
[scheduler]
|
|
26987
27073
|
);
|
|
26988
|
-
const markToolsAsSubmitted = (0,
|
|
27074
|
+
const markToolsAsSubmitted = (0, import_react98.useCallback)(
|
|
26989
27075
|
(callIdsToMark) => {
|
|
26990
27076
|
setToolCallsMap((prevMap) => {
|
|
26991
27077
|
const nextMap = { ...prevMap };
|
|
@@ -26999,7 +27085,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26999
27085
|
},
|
|
27000
27086
|
[]
|
|
27001
27087
|
);
|
|
27002
|
-
const toolCalls = (0,
|
|
27088
|
+
const toolCalls = (0, import_react98.useMemo)(() => {
|
|
27003
27089
|
const flattened = Object.values(toolCallsMap).flat();
|
|
27004
27090
|
return flattened.map((tc) => {
|
|
27005
27091
|
let subagentName = tc.request.name;
|
|
@@ -27028,7 +27114,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
27028
27114
|
};
|
|
27029
27115
|
});
|
|
27030
27116
|
}, [toolCallsMap, subagentHistoryMap]);
|
|
27031
|
-
const setToolCallsForDisplay = (0,
|
|
27117
|
+
const setToolCallsForDisplay = (0, import_react98.useCallback)(
|
|
27032
27118
|
(action) => {
|
|
27033
27119
|
setToolCallsMap((prev) => {
|
|
27034
27120
|
const currentFlattened = Object.values(prev).flat();
|
|
@@ -27081,15 +27167,15 @@ import { promises as fs6 } from "node:fs";
|
|
|
27081
27167
|
import path13 from "node:path";
|
|
27082
27168
|
|
|
27083
27169
|
// packages/cli/src/ui/hooks/useAgentStream.ts
|
|
27084
|
-
var
|
|
27170
|
+
var import_react100 = __toESM(require_react(), 1);
|
|
27085
27171
|
|
|
27086
27172
|
// packages/cli/src/ui/hooks/useTurnActivityMonitor.ts
|
|
27087
|
-
var
|
|
27173
|
+
var import_react99 = __toESM(require_react(), 1);
|
|
27088
27174
|
var useTurnActivityMonitor = (streamingState, activePtyId, pendingToolCalls = []) => {
|
|
27089
|
-
const [operationStartTime, setOperationStartTime] = (0,
|
|
27090
|
-
const prevPtyIdRef = (0,
|
|
27091
|
-
const prevStreamingStateRef = (0,
|
|
27092
|
-
(0,
|
|
27175
|
+
const [operationStartTime, setOperationStartTime] = (0, import_react99.useState)(0);
|
|
27176
|
+
const prevPtyIdRef = (0, import_react99.useRef)(void 0);
|
|
27177
|
+
const prevStreamingStateRef = (0, import_react99.useRef)(void 0);
|
|
27178
|
+
(0, import_react99.useEffect)(() => {
|
|
27093
27179
|
const isNowResponding = streamingState === "responding" /* Responding */;
|
|
27094
27180
|
const wasResponding = prevStreamingStateRef.current === "responding" /* Responding */;
|
|
27095
27181
|
const ptyChanged = activePtyId !== prevPtyIdRef.current;
|
|
@@ -27101,7 +27187,7 @@ var useTurnActivityMonitor = (streamingState, activePtyId, pendingToolCalls = []
|
|
|
27101
27187
|
prevPtyIdRef.current = activePtyId;
|
|
27102
27188
|
prevStreamingStateRef.current = streamingState;
|
|
27103
27189
|
}, [streamingState, activePtyId]);
|
|
27104
|
-
const isRedirectionActive = (0,
|
|
27190
|
+
const isRedirectionActive = (0, import_react99.useMemo)(
|
|
27105
27191
|
() => (
|
|
27106
27192
|
// Check active tool calls for run_shell_command
|
|
27107
27193
|
pendingToolCalls.some((tc) => {
|
|
@@ -27161,25 +27247,25 @@ var useAgentStream = ({
|
|
|
27161
27247
|
isShellFocused,
|
|
27162
27248
|
logger
|
|
27163
27249
|
}) => {
|
|
27164
|
-
const [initError] = (0,
|
|
27165
|
-
const [retryStatus] = (0,
|
|
27166
|
-
const [streamingState, setStreamingState] = (0,
|
|
27250
|
+
const [initError] = (0, import_react100.useState)(null);
|
|
27251
|
+
const [retryStatus] = (0, import_react100.useState)(null);
|
|
27252
|
+
const [streamingState, setStreamingState] = (0, import_react100.useState)(
|
|
27167
27253
|
"idle" /* Idle */
|
|
27168
27254
|
);
|
|
27169
|
-
const [thought, setThought] = (0,
|
|
27170
|
-
const [lastOutputTime, setLastOutputTime] = (0,
|
|
27171
|
-
const currentStreamIdRef = (0,
|
|
27172
|
-
const userMessageTimestampRef = (0,
|
|
27173
|
-
const geminiMessageBufferRef = (0,
|
|
27255
|
+
const [thought, setThought] = (0, import_react100.useState)(null);
|
|
27256
|
+
const [lastOutputTime, setLastOutputTime] = (0, import_react100.useState)(Date.now());
|
|
27257
|
+
const currentStreamIdRef = (0, import_react100.useRef)(null);
|
|
27258
|
+
const userMessageTimestampRef = (0, import_react100.useRef)(0);
|
|
27259
|
+
const geminiMessageBufferRef = (0, import_react100.useRef)("");
|
|
27174
27260
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
27175
27261
|
const [trackedTools, trackedToolsRef, setTrackedTools] = useStateAndRef([]);
|
|
27176
|
-
const toolRequestArgsRef = (0,
|
|
27262
|
+
const toolRequestArgsRef = (0, import_react100.useRef)(
|
|
27177
27263
|
/* @__PURE__ */ new Map()
|
|
27178
27264
|
);
|
|
27179
|
-
const cancellationStateRef = (0,
|
|
27265
|
+
const cancellationStateRef = (0, import_react100.useRef)(
|
|
27180
27266
|
"idle" /* Idle */
|
|
27181
27267
|
);
|
|
27182
|
-
const cancelPromiseRef = (0,
|
|
27268
|
+
const cancelPromiseRef = (0, import_react100.useRef)(Promise.resolve());
|
|
27183
27269
|
const [pushedToolCallIds, pushedToolCallIdsRef, setPushedToolCallIds] = useStateAndRef(/* @__PURE__ */ new Set());
|
|
27184
27270
|
const [_isFirstToolInGroup, isFirstToolInGroupRef, setIsFirstToolInGroup] = useStateAndRef(true);
|
|
27185
27271
|
const [_hasEmittedBoxInTurn, hasEmittedBoxInTurnRef, setHasEmittedBoxInTurn] = useStateAndRef(false);
|
|
@@ -27187,13 +27273,13 @@ var useAgentStream = ({
|
|
|
27187
27273
|
const activePtyId = void 0;
|
|
27188
27274
|
const backgroundTaskCount = 0;
|
|
27189
27275
|
const isBackgroundTaskVisible = false;
|
|
27190
|
-
const toggleBackgroundTasks = (0,
|
|
27276
|
+
const toggleBackgroundTasks = (0, import_react100.useCallback)(() => {
|
|
27191
27277
|
}, []);
|
|
27192
27278
|
const backgroundCurrentExecution = void 0;
|
|
27193
|
-
const backgroundTasks = (0,
|
|
27194
|
-
const dismissBackgroundTask = (0,
|
|
27279
|
+
const backgroundTasks = (0, import_react100.useMemo)(() => /* @__PURE__ */ new Map(), []);
|
|
27280
|
+
const dismissBackgroundTask = (0, import_react100.useCallback)(async (_pid) => {
|
|
27195
27281
|
}, []);
|
|
27196
|
-
const pendingToolCalls = (0,
|
|
27282
|
+
const pendingToolCalls = (0, import_react100.useMemo)(
|
|
27197
27283
|
() => trackedTools.map((t) => ({
|
|
27198
27284
|
request: {
|
|
27199
27285
|
name: t.originalRequestName || t.name,
|
|
@@ -27206,15 +27292,15 @@ var useAgentStream = ({
|
|
|
27206
27292
|
})),
|
|
27207
27293
|
[trackedTools]
|
|
27208
27294
|
);
|
|
27209
|
-
const [loopDetectionConfirmationRequest] = (0,
|
|
27210
|
-
const flushPendingText = (0,
|
|
27295
|
+
const [loopDetectionConfirmationRequest] = (0, import_react100.useState)(null);
|
|
27296
|
+
const flushPendingText = (0, import_react100.useCallback)(() => {
|
|
27211
27297
|
if (pendingHistoryItemRef.current) {
|
|
27212
27298
|
addItem(pendingHistoryItemRef.current, userMessageTimestampRef.current);
|
|
27213
27299
|
setPendingHistoryItem(null);
|
|
27214
27300
|
geminiMessageBufferRef.current = "";
|
|
27215
27301
|
}
|
|
27216
27302
|
}, [addItem, pendingHistoryItemRef, setPendingHistoryItem]);
|
|
27217
|
-
const cancelOngoingRequest = (0,
|
|
27303
|
+
const cancelOngoingRequest = (0, import_react100.useCallback)(
|
|
27218
27304
|
async (clearBuffer = true) => {
|
|
27219
27305
|
if (!agent) {
|
|
27220
27306
|
return;
|
|
@@ -27341,13 +27427,13 @@ var useAgentStream = ({
|
|
|
27341
27427
|
trackedToolsRef
|
|
27342
27428
|
]
|
|
27343
27429
|
);
|
|
27344
|
-
const handleApprovalModeChange = (0,
|
|
27430
|
+
const handleApprovalModeChange = (0, import_react100.useCallback)(
|
|
27345
27431
|
async (newApprovalMode) => {
|
|
27346
27432
|
debugLogger.debug(`Approval mode changed to ${newApprovalMode} (stub)`);
|
|
27347
27433
|
},
|
|
27348
27434
|
[]
|
|
27349
27435
|
);
|
|
27350
|
-
const handleEvent = (0,
|
|
27436
|
+
const handleEvent = (0, import_react100.useCallback)(
|
|
27351
27437
|
(event) => {
|
|
27352
27438
|
setLastOutputTime(Date.now());
|
|
27353
27439
|
switch (event.type) {
|
|
@@ -27501,7 +27587,7 @@ var useAgentStream = ({
|
|
|
27501
27587
|
setLastOutputTime
|
|
27502
27588
|
]
|
|
27503
27589
|
);
|
|
27504
|
-
(0,
|
|
27590
|
+
(0, import_react100.useEffect)(() => {
|
|
27505
27591
|
const unsubscribe = agent?.subscribe(handleEvent);
|
|
27506
27592
|
return () => unsubscribe?.();
|
|
27507
27593
|
}, [agent, handleEvent]);
|
|
@@ -27517,7 +27603,7 @@ var useAgentStream = ({
|
|
|
27517
27603
|
isActive: streamingState === "responding" /* Responding */ || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */
|
|
27518
27604
|
}
|
|
27519
27605
|
);
|
|
27520
|
-
const submitQuery = (0,
|
|
27606
|
+
const submitQuery = (0, import_react100.useCallback)(
|
|
27521
27607
|
async (query, options, _prompt_id) => {
|
|
27522
27608
|
if (!agent) return;
|
|
27523
27609
|
const timestamp = Date.now();
|
|
@@ -27549,7 +27635,7 @@ var useAgentStream = ({
|
|
|
27549
27635
|
},
|
|
27550
27636
|
[agent, addItem, logger, startNewPrompt]
|
|
27551
27637
|
);
|
|
27552
|
-
(0,
|
|
27638
|
+
(0, import_react100.useEffect)(() => {
|
|
27553
27639
|
if (trackedTools.length > 0) {
|
|
27554
27640
|
const isNewBatch = !trackedTools.some(
|
|
27555
27641
|
(tc) => pushedToolCallIdsRef.current.has(tc.callId)
|
|
@@ -27569,7 +27655,7 @@ var useAgentStream = ({
|
|
|
27569
27655
|
setIsFirstToolInGroup,
|
|
27570
27656
|
streamingState
|
|
27571
27657
|
]);
|
|
27572
|
-
(0,
|
|
27658
|
+
(0, import_react100.useEffect)(() => {
|
|
27573
27659
|
if (trackedTools.length === 0) return;
|
|
27574
27660
|
const allTerminal = trackedTools.every(
|
|
27575
27661
|
(tc) => tc.status === "success" || tc.status === "error" || tc.status === "cancelled"
|
|
@@ -27626,7 +27712,7 @@ var useAgentStream = ({
|
|
|
27626
27712
|
isShellFocused,
|
|
27627
27713
|
backgroundTasks
|
|
27628
27714
|
]);
|
|
27629
|
-
const pendingToolGroupItems = (0,
|
|
27715
|
+
const pendingToolGroupItems = (0, import_react100.useMemo)(() => {
|
|
27630
27716
|
const remainingTools = trackedTools.filter(
|
|
27631
27717
|
(tc) => !pushedToolCallIdsRef.current.has(tc.callId)
|
|
27632
27718
|
);
|
|
@@ -27682,7 +27768,7 @@ var useAgentStream = ({
|
|
|
27682
27768
|
isShellFocused,
|
|
27683
27769
|
backgroundTasks
|
|
27684
27770
|
]);
|
|
27685
|
-
const pendingHistoryItems = (0,
|
|
27771
|
+
const pendingHistoryItems = (0, import_react100.useMemo)(
|
|
27686
27772
|
() => [pendingHistoryItem, ...pendingToolGroupItems].filter(
|
|
27687
27773
|
(i) => i !== void 0 && i !== null
|
|
27688
27774
|
),
|
|
@@ -27758,41 +27844,41 @@ function calculateStreamingState(isResponding, toolCalls) {
|
|
|
27758
27844
|
return "idle" /* Idle */;
|
|
27759
27845
|
}
|
|
27760
27846
|
var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebugMessage, handleSlashCommand, shellModeActive, getPreferredEditor, onAuthError, _performMemoryRefresh, modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError, onCancelSubmit, setShellInputFocused, terminalWidth, terminalHeight, isShellFocused, consumeUserHint) => {
|
|
27761
|
-
const [initError, setInitError] = (0,
|
|
27762
|
-
const [retryStatus, setRetryStatus] = (0,
|
|
27847
|
+
const [initError, setInitError] = (0, import_react101.useState)(null);
|
|
27848
|
+
const [retryStatus, setRetryStatus] = (0, import_react101.useState)(
|
|
27763
27849
|
null
|
|
27764
27850
|
);
|
|
27765
27851
|
const isLowErrorVerbosity = settings.merged.ui?.errorVerbosity !== "full";
|
|
27766
|
-
const suppressedToolErrorCountRef = (0,
|
|
27767
|
-
const suppressedToolErrorNoteShownRef = (0,
|
|
27768
|
-
const lowVerbosityFailureNoteShownRef = (0,
|
|
27769
|
-
const abortControllerRef = (0,
|
|
27770
|
-
const turnCancelledRef = (0,
|
|
27771
|
-
const pendingToolCallRequestsRef = (0,
|
|
27772
|
-
const activeSchedulePromiseRef = (0,
|
|
27773
|
-
const cancellationStateRef = (0,
|
|
27852
|
+
const suppressedToolErrorCountRef = (0, import_react101.useRef)(0);
|
|
27853
|
+
const suppressedToolErrorNoteShownRef = (0, import_react101.useRef)(false);
|
|
27854
|
+
const lowVerbosityFailureNoteShownRef = (0, import_react101.useRef)(false);
|
|
27855
|
+
const abortControllerRef = (0, import_react101.useRef)(null);
|
|
27856
|
+
const turnCancelledRef = (0, import_react101.useRef)(false);
|
|
27857
|
+
const pendingToolCallRequestsRef = (0, import_react101.useRef)([]);
|
|
27858
|
+
const activeSchedulePromiseRef = (0, import_react101.useRef)(null);
|
|
27859
|
+
const cancellationStateRef = (0, import_react101.useRef)(
|
|
27774
27860
|
"idle" /* Idle */
|
|
27775
27861
|
);
|
|
27776
|
-
const cancelPromiseRef = (0,
|
|
27777
|
-
const activeQueryIdRef = (0,
|
|
27778
|
-
const previousApprovalModeRef = (0,
|
|
27862
|
+
const cancelPromiseRef = (0, import_react101.useRef)(Promise.resolve());
|
|
27863
|
+
const activeQueryIdRef = (0, import_react101.useRef)(null);
|
|
27864
|
+
const previousApprovalModeRef = (0, import_react101.useRef)(
|
|
27779
27865
|
config.getApprovalMode()
|
|
27780
27866
|
);
|
|
27781
27867
|
const [isResponding, isRespondingRef, setIsResponding] = useStateAndRef(false);
|
|
27782
27868
|
const [thought, thoughtRef, setThought] = useStateAndRef(null);
|
|
27783
27869
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
27784
|
-
const [lastGeminiActivityTime, setLastGeminiActivityTime] = (0,
|
|
27870
|
+
const [lastGeminiActivityTime, setLastGeminiActivityTime] = (0, import_react101.useState)(0);
|
|
27785
27871
|
const [pushedToolCallIds, pushedToolCallIdsRef, setPushedToolCallIds] = useStateAndRef(/* @__PURE__ */ new Set());
|
|
27786
27872
|
const [_isFirstToolInGroup, isFirstToolInGroupRef, setIsFirstToolInGroup] = useStateAndRef(true);
|
|
27787
27873
|
const { startNewPrompt, getPromptCount } = useSessionStats();
|
|
27788
27874
|
const logger = useLogger(config);
|
|
27789
|
-
const gitService = (0,
|
|
27875
|
+
const gitService = (0, import_react101.useMemo)(() => {
|
|
27790
27876
|
if (!config.getProjectRoot()) {
|
|
27791
27877
|
return;
|
|
27792
27878
|
}
|
|
27793
27879
|
return new GitService(config.getProjectRoot(), config.storage);
|
|
27794
27880
|
}, [config]);
|
|
27795
|
-
(0,
|
|
27881
|
+
(0, import_react101.useEffect)(() => {
|
|
27796
27882
|
const handleRetryAttempt = (payload) => {
|
|
27797
27883
|
if (turnCancelledRef.current || !isRespondingRef.current) {
|
|
27798
27884
|
return;
|
|
@@ -27878,13 +27964,13 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27878
27964
|
config,
|
|
27879
27965
|
getPreferredEditor
|
|
27880
27966
|
);
|
|
27881
|
-
const activeBackgroundExecutionId = (0,
|
|
27967
|
+
const activeBackgroundExecutionId = (0, import_react101.useMemo)(() => {
|
|
27882
27968
|
const executingBackgroundableTool = toolCalls.find(
|
|
27883
27969
|
isBackgroundableExecutingToolCall
|
|
27884
27970
|
);
|
|
27885
27971
|
return executingBackgroundableTool?.pid;
|
|
27886
27972
|
}, [toolCalls]);
|
|
27887
|
-
const onExec = (0,
|
|
27973
|
+
const onExec = (0, import_react101.useCallback)(
|
|
27888
27974
|
async (done) => {
|
|
27889
27975
|
setIsResponding(true);
|
|
27890
27976
|
await done;
|
|
@@ -27915,11 +28001,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27915
28001
|
terminalHeight,
|
|
27916
28002
|
activeBackgroundExecutionId
|
|
27917
28003
|
);
|
|
27918
|
-
const streamingState = (0,
|
|
28004
|
+
const streamingState = (0, import_react101.useMemo)(
|
|
27919
28005
|
() => calculateStreamingState(isResponding, toolCalls),
|
|
27920
28006
|
[isResponding, toolCalls]
|
|
27921
28007
|
);
|
|
27922
|
-
(0,
|
|
28008
|
+
(0, import_react101.useEffect)(() => {
|
|
27923
28009
|
if (toolCalls.length > 0) {
|
|
27924
28010
|
const isNewBatch = !toolCalls.some(
|
|
27925
28011
|
(tc) => pushedToolCallIdsRef.current.has(tc.request.callId)
|
|
@@ -27939,29 +28025,17 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27939
28025
|
setIsFirstToolInGroup,
|
|
27940
28026
|
streamingState
|
|
27941
28027
|
]);
|
|
27942
|
-
(0,
|
|
28028
|
+
(0, import_react101.useEffect)(() => {
|
|
28029
|
+
const isFinished = (tc) => tc.status === "success" || tc.status === "error" || tc.status === "cancelled";
|
|
27943
28030
|
const toolsToPush = [];
|
|
27944
|
-
for (
|
|
27945
|
-
const tc = toolCalls[i];
|
|
28031
|
+
for (const tc of toolCalls) {
|
|
27946
28032
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27947
|
-
if (tc
|
|
27948
|
-
const
|
|
27949
|
-
if (
|
|
27950
|
-
|
|
27951
|
-
|
|
27952
|
-
|
|
27953
|
-
if (nextTc.tool?.kind === Kind.Agent) {
|
|
27954
|
-
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27955
|
-
contigAgentsComplete = false;
|
|
27956
|
-
break;
|
|
27957
|
-
}
|
|
27958
|
-
} else {
|
|
27959
|
-
break;
|
|
27960
|
-
}
|
|
27961
|
-
}
|
|
27962
|
-
if (!contigAgentsComplete) {
|
|
27963
|
-
break;
|
|
27964
|
-
}
|
|
28033
|
+
if (isFinished(tc)) {
|
|
28034
|
+
const { groupId } = tc.request;
|
|
28035
|
+
if (groupId !== void 0 && toolCalls.some(
|
|
28036
|
+
(other) => other.request.groupId === groupId && !isFinished(other)
|
|
28037
|
+
)) {
|
|
28038
|
+
break;
|
|
27965
28039
|
}
|
|
27966
28040
|
toolsToPush.push(tc);
|
|
27967
28041
|
} else {
|
|
@@ -27973,21 +28047,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27973
28047
|
const isFirstInThisPush = isFirstToolInGroupRef.current;
|
|
27974
28048
|
const isCompactModeEnabled = settings.merged.ui?.compactToolOutput === true;
|
|
27975
28049
|
const groups = [];
|
|
27976
|
-
let
|
|
28050
|
+
let currentGroupId;
|
|
27977
28051
|
for (const tc of toolsToPush) {
|
|
27978
28052
|
newPushed.add(tc.request.callId);
|
|
27979
|
-
|
|
27980
|
-
|
|
28053
|
+
const { groupId } = tc.request;
|
|
28054
|
+
if (groupId !== void 0 && groupId === currentGroupId) {
|
|
28055
|
+
groups[groups.length - 1].push(tc);
|
|
27981
28056
|
} else {
|
|
27982
|
-
if (currentGroup.length > 0) {
|
|
27983
|
-
groups.push(currentGroup);
|
|
27984
|
-
currentGroup = [];
|
|
27985
|
-
}
|
|
27986
28057
|
groups.push([tc]);
|
|
27987
28058
|
}
|
|
27988
|
-
|
|
27989
|
-
if (currentGroup.length > 0) {
|
|
27990
|
-
groups.push(currentGroup);
|
|
28059
|
+
currentGroupId = groupId;
|
|
27991
28060
|
}
|
|
27992
28061
|
for (let i = 0; i < groups.length; i++) {
|
|
27993
28062
|
const group = groups[i];
|
|
@@ -28039,7 +28108,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28039
28108
|
backgroundTasks,
|
|
28040
28109
|
settings.merged.ui?.compactToolOutput
|
|
28041
28110
|
]);
|
|
28042
|
-
const pendingToolGroupItems = (0,
|
|
28111
|
+
const pendingToolGroupItems = (0, import_react101.useMemo)(() => {
|
|
28043
28112
|
const remainingTools = toolCalls.filter(
|
|
28044
28113
|
(tc) => !pushedToolCallIds.has(tc.request.callId)
|
|
28045
28114
|
);
|
|
@@ -28109,26 +28178,26 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28109
28178
|
backgroundTasks,
|
|
28110
28179
|
settings.merged.ui?.compactToolOutput
|
|
28111
28180
|
]);
|
|
28112
|
-
const lastQueryRef = (0,
|
|
28113
|
-
const lastPromptIdRef = (0,
|
|
28114
|
-
const loopDetectedRef = (0,
|
|
28115
|
-
const autoNudgeAttemptCountRef = (0,
|
|
28181
|
+
const lastQueryRef = (0, import_react101.useRef)(null);
|
|
28182
|
+
const lastPromptIdRef = (0, import_react101.useRef)(null);
|
|
28183
|
+
const loopDetectedRef = (0, import_react101.useRef)(false);
|
|
28184
|
+
const autoNudgeAttemptCountRef = (0, import_react101.useRef)(0);
|
|
28116
28185
|
const MAX_AUTO_NUDGE_ATTEMPTS = 2;
|
|
28117
|
-
const submitQueryRef = (0,
|
|
28186
|
+
const submitQueryRef = (0, import_react101.useRef)(null);
|
|
28118
28187
|
const [
|
|
28119
28188
|
loopDetectionConfirmationRequest,
|
|
28120
28189
|
setLoopDetectionConfirmationRequest
|
|
28121
|
-
] = (0,
|
|
28190
|
+
] = (0, import_react101.useState)(null);
|
|
28122
28191
|
const activePtyId = activeShellPtyId ?? activeBackgroundExecutionId ?? void 0;
|
|
28123
|
-
const prevActiveShellPtyIdRef = (0,
|
|
28124
|
-
(0,
|
|
28192
|
+
const prevActiveShellPtyIdRef = (0, import_react101.useRef)(null);
|
|
28193
|
+
(0, import_react101.useEffect)(() => {
|
|
28125
28194
|
if (turnCancelledRef.current && prevActiveShellPtyIdRef.current !== null && activeShellPtyId === null) {
|
|
28126
28195
|
addItem({ type: "info" /* INFO */, text: "Request cancelled." });
|
|
28127
28196
|
setIsResponding(false);
|
|
28128
28197
|
}
|
|
28129
28198
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
28130
28199
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
28131
|
-
(0,
|
|
28200
|
+
(0, import_react101.useEffect)(() => {
|
|
28132
28201
|
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
28133
28202
|
const lastUserMessageIndex = history.findLastIndex(
|
|
28134
28203
|
(item) => item.type === "user" /* USER */
|
|
@@ -28142,12 +28211,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28142
28211
|
}
|
|
28143
28212
|
}
|
|
28144
28213
|
}, [streamingState, config, history]);
|
|
28145
|
-
(0,
|
|
28214
|
+
(0, import_react101.useEffect)(() => {
|
|
28146
28215
|
if (!isResponding) {
|
|
28147
28216
|
setRetryStatus(null);
|
|
28148
28217
|
}
|
|
28149
28218
|
}, [isResponding]);
|
|
28150
|
-
const maybeAddSuppressedToolErrorNote = (0,
|
|
28219
|
+
const maybeAddSuppressedToolErrorNote = (0, import_react101.useCallback)(
|
|
28151
28220
|
(userMessageTimestamp) => {
|
|
28152
28221
|
if (!isLowErrorVerbosity) {
|
|
28153
28222
|
return;
|
|
@@ -28169,7 +28238,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28169
28238
|
},
|
|
28170
28239
|
[addItem, isLowErrorVerbosity]
|
|
28171
28240
|
);
|
|
28172
|
-
const maybeAddLowVerbosityFailureNote = (0,
|
|
28241
|
+
const maybeAddLowVerbosityFailureNote = (0, import_react101.useCallback)(
|
|
28173
28242
|
(userMessageTimestamp) => {
|
|
28174
28243
|
if (!isLowErrorVerbosity || config.getDebugMode()) {
|
|
28175
28244
|
return;
|
|
@@ -28188,7 +28257,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28188
28257
|
},
|
|
28189
28258
|
[addItem, config, isLowErrorVerbosity]
|
|
28190
28259
|
);
|
|
28191
|
-
const cancelOngoingRequest = (0,
|
|
28260
|
+
const cancelOngoingRequest = (0, import_react101.useCallback)(
|
|
28192
28261
|
async (clearBuffer = true) => {
|
|
28193
28262
|
if (turnCancelledRef.current) {
|
|
28194
28263
|
if (clearBuffer) {
|
|
@@ -28386,7 +28455,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28386
28455
|
isActive: streamingState === "responding" /* Responding */ || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */
|
|
28387
28456
|
}
|
|
28388
28457
|
);
|
|
28389
|
-
const prepareQueryForGemini = (0,
|
|
28458
|
+
const prepareQueryForGemini = (0, import_react101.useCallback)(
|
|
28390
28459
|
async (query, userMessageTimestamp, abortSignal, prompt_id) => {
|
|
28391
28460
|
if (turnCancelledRef.current) {
|
|
28392
28461
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -28492,7 +28561,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28492
28561
|
settings
|
|
28493
28562
|
]
|
|
28494
28563
|
);
|
|
28495
|
-
const handleContentEvent = (0,
|
|
28564
|
+
const handleContentEvent = (0, import_react101.useCallback)(
|
|
28496
28565
|
(eventValue, currentGeminiMessageBuffer, userMessageTimestamp) => {
|
|
28497
28566
|
setRetryStatus(null);
|
|
28498
28567
|
if (turnCancelledRef.current) {
|
|
@@ -28533,7 +28602,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28533
28602
|
},
|
|
28534
28603
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
28535
28604
|
);
|
|
28536
|
-
const handleThoughtEvent = (0,
|
|
28605
|
+
const handleThoughtEvent = (0, import_react101.useCallback)(
|
|
28537
28606
|
(eventValue, _userMessageTimestamp) => {
|
|
28538
28607
|
setThought(eventValue);
|
|
28539
28608
|
if (getInlineThinkingMode(settings) === "full") {
|
|
@@ -28545,7 +28614,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28545
28614
|
},
|
|
28546
28615
|
[addItem, settings, setThought]
|
|
28547
28616
|
);
|
|
28548
|
-
const handleUserCancelledEvent = (0,
|
|
28617
|
+
const handleUserCancelledEvent = (0, import_react101.useCallback)(
|
|
28549
28618
|
(userMessageTimestamp) => {
|
|
28550
28619
|
if (turnCancelledRef.current) {
|
|
28551
28620
|
return;
|
|
@@ -28580,7 +28649,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28580
28649
|
setIsResponding
|
|
28581
28650
|
]
|
|
28582
28651
|
);
|
|
28583
|
-
const handleErrorEvent = (0,
|
|
28652
|
+
const handleErrorEvent = (0, import_react101.useCallback)(
|
|
28584
28653
|
(eventValue, userMessageTimestamp) => {
|
|
28585
28654
|
if (pendingHistoryItemRef.current) {
|
|
28586
28655
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28613,7 +28682,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28613
28682
|
maybeAddLowVerbosityFailureNote
|
|
28614
28683
|
]
|
|
28615
28684
|
);
|
|
28616
|
-
const handleInvalidStreamEvent = (0,
|
|
28685
|
+
const handleInvalidStreamEvent = (0, import_react101.useCallback)(
|
|
28617
28686
|
(eventValue, userMessageTimestamp) => {
|
|
28618
28687
|
if (pendingHistoryItemRef.current) {
|
|
28619
28688
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28659,7 +28728,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28659
28728
|
geminiClient
|
|
28660
28729
|
]
|
|
28661
28730
|
);
|
|
28662
|
-
const handleCitationEvent = (0,
|
|
28731
|
+
const handleCitationEvent = (0, import_react101.useCallback)(
|
|
28663
28732
|
(text, userMessageTimestamp) => {
|
|
28664
28733
|
if (!showCitations(settings)) {
|
|
28665
28734
|
return;
|
|
@@ -28672,7 +28741,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28672
28741
|
},
|
|
28673
28742
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, settings]
|
|
28674
28743
|
);
|
|
28675
|
-
const handleFinishedEvent = (0,
|
|
28744
|
+
const handleFinishedEvent = (0, import_react101.useCallback)(
|
|
28676
28745
|
(event, userMessageTimestamp) => {
|
|
28677
28746
|
const finishReason = event.value.reason;
|
|
28678
28747
|
if (!finishReason) {
|
|
@@ -28708,7 +28777,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28708
28777
|
},
|
|
28709
28778
|
[addItem]
|
|
28710
28779
|
);
|
|
28711
|
-
const handleChatCompressionEvent = (0,
|
|
28780
|
+
const handleChatCompressionEvent = (0, import_react101.useCallback)(
|
|
28712
28781
|
(eventValue, userMessageTimestamp) => {
|
|
28713
28782
|
if (pendingHistoryItemRef.current) {
|
|
28714
28783
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28734,14 +28803,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28734
28803
|
},
|
|
28735
28804
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, config]
|
|
28736
28805
|
);
|
|
28737
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
28806
|
+
const handleMaxSessionTurnsEvent = (0, import_react101.useCallback)(
|
|
28738
28807
|
() => addItem({
|
|
28739
28808
|
type: "info",
|
|
28740
28809
|
text: `The session has reached the maximum number of turns: ${config.getMaxSessionTurns()}. Please update this limit in your setting.json file.`
|
|
28741
28810
|
}),
|
|
28742
28811
|
[addItem, config]
|
|
28743
28812
|
);
|
|
28744
|
-
const handleContextWindowWillOverflowEvent = (0,
|
|
28813
|
+
const handleContextWindowWillOverflowEvent = (0, import_react101.useCallback)(
|
|
28745
28814
|
(estimatedRequestTokenCount, remainingTokenCount) => {
|
|
28746
28815
|
onCancelSubmit(true);
|
|
28747
28816
|
const limit = tokenLimit(config.getModel());
|
|
@@ -28757,7 +28826,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28757
28826
|
},
|
|
28758
28827
|
[addItem, onCancelSubmit, config]
|
|
28759
28828
|
);
|
|
28760
|
-
const handleChatModelEvent = (0,
|
|
28829
|
+
const handleChatModelEvent = (0, import_react101.useCallback)(
|
|
28761
28830
|
(eventValue, userMessageTimestamp) => {
|
|
28762
28831
|
if (!settings.merged.ui.showModelInfoInChat) {
|
|
28763
28832
|
return;
|
|
@@ -28776,7 +28845,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28776
28845
|
},
|
|
28777
28846
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, settings]
|
|
28778
28847
|
);
|
|
28779
|
-
const handleAgentExecutionStoppedEvent = (0,
|
|
28848
|
+
const handleAgentExecutionStoppedEvent = (0, import_react101.useCallback)(
|
|
28780
28849
|
(reason, userMessageTimestamp, systemMessage, contextCleared) => {
|
|
28781
28850
|
if (pendingHistoryItemRef.current) {
|
|
28782
28851
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28809,7 +28878,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28809
28878
|
maybeAddLowVerbosityFailureNote
|
|
28810
28879
|
]
|
|
28811
28880
|
);
|
|
28812
|
-
const handleAgentExecutionBlockedEvent = (0,
|
|
28881
|
+
const handleAgentExecutionBlockedEvent = (0, import_react101.useCallback)(
|
|
28813
28882
|
(reason, userMessageTimestamp, systemMessage, contextCleared) => {
|
|
28814
28883
|
if (pendingHistoryItemRef.current) {
|
|
28815
28884
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28840,7 +28909,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28840
28909
|
maybeAddLowVerbosityFailureNote
|
|
28841
28910
|
]
|
|
28842
28911
|
);
|
|
28843
|
-
const processGeminiStreamEvents = (0,
|
|
28912
|
+
const processGeminiStreamEvents = (0, import_react101.useCallback)(
|
|
28844
28913
|
async (stream, userMessageTimestamp, signal, isContinuation, prompt_id) => {
|
|
28845
28914
|
let geminiMessageBuffer = "";
|
|
28846
28915
|
const toolCallRequests = [];
|
|
@@ -28978,7 +29047,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28978
29047
|
setThought
|
|
28979
29048
|
]
|
|
28980
29049
|
);
|
|
28981
|
-
const submitQuery = (0,
|
|
29050
|
+
const submitQuery = (0, import_react101.useCallback)(
|
|
28982
29051
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
28983
29052
|
{
|
|
28984
29053
|
operation: options?.isContinuation ? GeminiCliOperation.SystemPrompt : GeminiCliOperation.UserPrompt,
|
|
@@ -29144,7 +29213,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29144
29213
|
]
|
|
29145
29214
|
);
|
|
29146
29215
|
submitQueryRef.current = submitQuery;
|
|
29147
|
-
const handleApprovalModeChange = (0,
|
|
29216
|
+
const handleApprovalModeChange = (0, import_react101.useCallback)(
|
|
29148
29217
|
async (newApprovalMode) => {
|
|
29149
29218
|
if (previousApprovalModeRef.current === ApprovalMode.PLAN && newApprovalMode !== ApprovalMode.PLAN && streamingState === "idle" /* Idle */) {
|
|
29150
29219
|
if (geminiClient) {
|
|
@@ -29207,7 +29276,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29207
29276
|
},
|
|
29208
29277
|
[config, toolCalls, geminiClient, streamingState, addItem, onDebugMessage]
|
|
29209
29278
|
);
|
|
29210
|
-
const handleCompletedTools = (0,
|
|
29279
|
+
const handleCompletedTools = (0, import_react101.useCallback)(
|
|
29211
29280
|
async (completedToolCallsFromScheduler) => {
|
|
29212
29281
|
const completedAndReadyToSubmitTools = completedToolCallsFromScheduler.filter(
|
|
29213
29282
|
(tc) => {
|
|
@@ -29380,13 +29449,13 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29380
29449
|
toolCalls
|
|
29381
29450
|
]
|
|
29382
29451
|
);
|
|
29383
|
-
const pendingHistoryItems = (0,
|
|
29452
|
+
const pendingHistoryItems = (0, import_react101.useMemo)(
|
|
29384
29453
|
() => [pendingHistoryItem, ...pendingToolGroupItems].filter(
|
|
29385
29454
|
(i) => i !== void 0 && i !== null
|
|
29386
29455
|
),
|
|
29387
29456
|
[pendingHistoryItem, pendingToolGroupItems]
|
|
29388
29457
|
);
|
|
29389
|
-
(0,
|
|
29458
|
+
(0, import_react101.useEffect)(() => {
|
|
29390
29459
|
const saveRestorableToolCalls = async () => {
|
|
29391
29460
|
if (!config.getCheckpointingEnabled()) {
|
|
29392
29461
|
return;
|
|
@@ -29456,7 +29525,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29456
29525
|
};
|
|
29457
29526
|
|
|
29458
29527
|
// packages/cli/src/ui/hooks/vim.ts
|
|
29459
|
-
var
|
|
29528
|
+
var import_react102 = __toESM(require_react(), 1);
|
|
29460
29529
|
var DIGIT_MULTIPLIER = 10;
|
|
29461
29530
|
var DEFAULT_COUNT = 1;
|
|
29462
29531
|
var DIGIT_1_TO_9 = /^[1-9]$/;
|
|
@@ -29559,23 +29628,23 @@ var vimReducer = (state, action) => {
|
|
|
29559
29628
|
function useVim(buffer, onSubmit) {
|
|
29560
29629
|
const keyMatchers = useKeyMatchers();
|
|
29561
29630
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
29562
|
-
const [state, dispatch] = (0,
|
|
29563
|
-
const lastEscapeTimestampRef = (0,
|
|
29564
|
-
(0,
|
|
29631
|
+
const [state, dispatch] = (0, import_react102.useReducer)(vimReducer, initialVimState);
|
|
29632
|
+
const lastEscapeTimestampRef = (0, import_react102.useRef)(0);
|
|
29633
|
+
(0, import_react102.useEffect)(() => {
|
|
29565
29634
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
29566
29635
|
}, [vimMode]);
|
|
29567
|
-
const updateMode = (0,
|
|
29636
|
+
const updateMode = (0, import_react102.useCallback)(
|
|
29568
29637
|
(mode) => {
|
|
29569
29638
|
setVimMode(mode);
|
|
29570
29639
|
dispatch({ type: "SET_MODE", mode });
|
|
29571
29640
|
},
|
|
29572
29641
|
[setVimMode]
|
|
29573
29642
|
);
|
|
29574
|
-
const getCurrentCount = (0,
|
|
29643
|
+
const getCurrentCount = (0, import_react102.useCallback)(
|
|
29575
29644
|
() => state.count || DEFAULT_COUNT,
|
|
29576
29645
|
[state.count]
|
|
29577
29646
|
);
|
|
29578
|
-
const checkDoubleEscape = (0,
|
|
29647
|
+
const checkDoubleEscape = (0, import_react102.useCallback)(() => {
|
|
29579
29648
|
const now = Date.now();
|
|
29580
29649
|
const lastEscape = lastEscapeTimestampRef.current;
|
|
29581
29650
|
lastEscapeTimestampRef.current = now;
|
|
@@ -29585,7 +29654,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29585
29654
|
}
|
|
29586
29655
|
return false;
|
|
29587
29656
|
}, []);
|
|
29588
|
-
const executeCommand = (0,
|
|
29657
|
+
const executeCommand = (0, import_react102.useCallback)(
|
|
29589
29658
|
(cmdType, count, char) => {
|
|
29590
29659
|
switch (cmdType) {
|
|
29591
29660
|
case CMD_TYPES.DELETE_WORD_FORWARD: {
|
|
@@ -29784,7 +29853,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29784
29853
|
},
|
|
29785
29854
|
[buffer, updateMode]
|
|
29786
29855
|
);
|
|
29787
|
-
const handleInsertModeInput = (0,
|
|
29856
|
+
const handleInsertModeInput = (0, import_react102.useCallback)(
|
|
29788
29857
|
(normalizedKey) => {
|
|
29789
29858
|
if (keyMatchers["basic.cancel" /* ESCAPE */](normalizedKey)) {
|
|
29790
29859
|
checkDoubleEscape();
|
|
@@ -29818,7 +29887,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29818
29887
|
},
|
|
29819
29888
|
[buffer, dispatch, updateMode, onSubmit, checkDoubleEscape, keyMatchers]
|
|
29820
29889
|
);
|
|
29821
|
-
const normalizeKey = (0,
|
|
29890
|
+
const normalizeKey = (0, import_react102.useCallback)(
|
|
29822
29891
|
(key) => ({
|
|
29823
29892
|
name: key.name || "",
|
|
29824
29893
|
sequence: key.sequence || "",
|
|
@@ -29830,7 +29899,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29830
29899
|
}),
|
|
29831
29900
|
[]
|
|
29832
29901
|
);
|
|
29833
|
-
const handleChangeMovement = (0,
|
|
29902
|
+
const handleChangeMovement = (0, import_react102.useCallback)(
|
|
29834
29903
|
(movement) => {
|
|
29835
29904
|
const count = getCurrentCount();
|
|
29836
29905
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -29851,7 +29920,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29851
29920
|
},
|
|
29852
29921
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
29853
29922
|
);
|
|
29854
|
-
const handleDeleteMovement = (0,
|
|
29923
|
+
const handleDeleteMovement = (0, import_react102.useCallback)(
|
|
29855
29924
|
(movement) => {
|
|
29856
29925
|
const count = getCurrentCount();
|
|
29857
29926
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -29871,7 +29940,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29871
29940
|
},
|
|
29872
29941
|
[getCurrentCount, dispatch, buffer]
|
|
29873
29942
|
);
|
|
29874
|
-
const handleOperatorMotion = (0,
|
|
29943
|
+
const handleOperatorMotion = (0, import_react102.useCallback)(
|
|
29875
29944
|
(operator, motion) => {
|
|
29876
29945
|
const count = getCurrentCount();
|
|
29877
29946
|
const commandMap = {
|
|
@@ -29904,7 +29973,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29904
29973
|
},
|
|
29905
29974
|
[getCurrentCount, executeCommand, dispatch]
|
|
29906
29975
|
);
|
|
29907
|
-
const handleInput = (0,
|
|
29976
|
+
const handleInput = (0, import_react102.useCallback)(
|
|
29908
29977
|
(key) => {
|
|
29909
29978
|
if (!vimEnabled) {
|
|
29910
29979
|
return false;
|
|
@@ -30612,13 +30681,13 @@ function useVim(buffer, onSubmit) {
|
|
|
30612
30681
|
}
|
|
30613
30682
|
|
|
30614
30683
|
// packages/cli/src/ui/hooks/useTimer.ts
|
|
30615
|
-
var
|
|
30684
|
+
var import_react103 = __toESM(require_react(), 1);
|
|
30616
30685
|
var useTimer = (isActive, resetKey) => {
|
|
30617
|
-
const [elapsedTime, setElapsedTime] = (0,
|
|
30618
|
-
const timerRef = (0,
|
|
30619
|
-
const prevResetKeyRef = (0,
|
|
30620
|
-
const prevIsActiveRef = (0,
|
|
30621
|
-
(0,
|
|
30686
|
+
const [elapsedTime, setElapsedTime] = (0, import_react103.useState)(0);
|
|
30687
|
+
const timerRef = (0, import_react103.useRef)(null);
|
|
30688
|
+
const prevResetKeyRef = (0, import_react103.useRef)(resetKey);
|
|
30689
|
+
const prevIsActiveRef = (0, import_react103.useRef)(isActive);
|
|
30690
|
+
(0, import_react103.useEffect)(() => {
|
|
30622
30691
|
let shouldResetTime = false;
|
|
30623
30692
|
if (prevResetKeyRef.current !== resetKey) {
|
|
30624
30693
|
shouldResetTime = true;
|
|
@@ -30655,7 +30724,7 @@ var useTimer = (isActive, resetKey) => {
|
|
|
30655
30724
|
};
|
|
30656
30725
|
|
|
30657
30726
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
30658
|
-
var
|
|
30727
|
+
var import_react104 = __toESM(require_react(), 1);
|
|
30659
30728
|
var LOW_VERBOSITY_RETRY_HINT_ATTEMPT_THRESHOLD = 2;
|
|
30660
30729
|
var useLoadingIndicator = ({
|
|
30661
30730
|
streamingState,
|
|
@@ -30668,7 +30737,7 @@ var useLoadingIndicator = ({
|
|
|
30668
30737
|
maxLength,
|
|
30669
30738
|
pauseUpdates = false
|
|
30670
30739
|
}) => {
|
|
30671
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
30740
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react104.useState)(0);
|
|
30672
30741
|
const isTimerActive = streamingState === "responding" /* Responding */ && !pauseUpdates;
|
|
30673
30742
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
30674
30743
|
const isPhraseCyclingActive = streamingState === "responding" /* Responding */ && !pauseUpdates;
|
|
@@ -30682,9 +30751,9 @@ var useLoadingIndicator = ({
|
|
|
30682
30751
|
customWittyPhrases,
|
|
30683
30752
|
maxLength
|
|
30684
30753
|
);
|
|
30685
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
30686
|
-
const prevStreamingStateRef = (0,
|
|
30687
|
-
(0,
|
|
30754
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react104.useState)(0);
|
|
30755
|
+
const prevStreamingStateRef = (0, import_react104.useRef)(null);
|
|
30756
|
+
(0, import_react104.useEffect)(() => {
|
|
30688
30757
|
if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
30689
30758
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
30690
30759
|
setRetainedElapsedTime(0);
|
|
@@ -30750,24 +30819,24 @@ var useShellInactivityStatus = ({
|
|
|
30750
30819
|
};
|
|
30751
30820
|
|
|
30752
30821
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
30753
|
-
var
|
|
30822
|
+
var import_react105 = __toESM(require_react(), 1);
|
|
30754
30823
|
import * as process10 from "node:process";
|
|
30755
30824
|
var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
30756
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
30757
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
30758
|
-
const [discoveryResults, setDiscoveryResults] = (0,
|
|
30759
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
30760
|
-
const startupMessageSent = (0,
|
|
30761
|
-
const onTrustChangeRef = (0,
|
|
30762
|
-
const addItemRef = (0,
|
|
30763
|
-
const settingsRef = (0,
|
|
30764
|
-
(0,
|
|
30825
|
+
const [isTrusted, setIsTrusted] = (0, import_react105.useState)(void 0);
|
|
30826
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react105.useState)(false);
|
|
30827
|
+
const [discoveryResults, setDiscoveryResults] = (0, import_react105.useState)(null);
|
|
30828
|
+
const [isRestarting, setIsRestarting] = (0, import_react105.useState)(false);
|
|
30829
|
+
const startupMessageSent = (0, import_react105.useRef)(false);
|
|
30830
|
+
const onTrustChangeRef = (0, import_react105.useRef)(onTrustChange);
|
|
30831
|
+
const addItemRef = (0, import_react105.useRef)(addItem);
|
|
30832
|
+
const settingsRef = (0, import_react105.useRef)(settings);
|
|
30833
|
+
(0, import_react105.useEffect)(() => {
|
|
30765
30834
|
onTrustChangeRef.current = onTrustChange;
|
|
30766
30835
|
addItemRef.current = addItem;
|
|
30767
30836
|
settingsRef.current = settings;
|
|
30768
30837
|
}, [onTrustChange, addItem, settings]);
|
|
30769
30838
|
const folderTrust = settings.merged.security.folderTrust.enabled ?? true;
|
|
30770
|
-
(0,
|
|
30839
|
+
(0, import_react105.useEffect)(() => {
|
|
30771
30840
|
let isMounted = true;
|
|
30772
30841
|
const { isTrusted: trusted } = isWorkspaceTrusted(
|
|
30773
30842
|
settingsRef.current.merged
|
|
@@ -30802,7 +30871,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30802
30871
|
isMounted = false;
|
|
30803
30872
|
};
|
|
30804
30873
|
}, [folderTrust]);
|
|
30805
|
-
const handleFolderTrustSelect = (0,
|
|
30874
|
+
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30806
30875
|
async (choice) => {
|
|
30807
30876
|
const trustLevelMap = {
|
|
30808
30877
|
["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
|
|
@@ -31777,7 +31846,7 @@ async function checkForUpdates(settings) {
|
|
|
31777
31846
|
}
|
|
31778
31847
|
|
|
31779
31848
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
31780
|
-
var
|
|
31849
|
+
var import_react106 = __toESM(require_react(), 1);
|
|
31781
31850
|
function useMessageQueue({
|
|
31782
31851
|
isConfigInitialized,
|
|
31783
31852
|
streamingState,
|
|
@@ -31785,21 +31854,21 @@ function useMessageQueue({
|
|
|
31785
31854
|
isMcpReady,
|
|
31786
31855
|
isCompressing = false
|
|
31787
31856
|
}) {
|
|
31788
|
-
const [messageQueue2, setMessageQueue] = (0,
|
|
31789
|
-
const addMessage = (0,
|
|
31857
|
+
const [messageQueue2, setMessageQueue] = (0, import_react106.useState)([]);
|
|
31858
|
+
const addMessage = (0, import_react106.useCallback)((message) => {
|
|
31790
31859
|
const trimmedMessage = message.trim();
|
|
31791
31860
|
if (trimmedMessage.length > 0) {
|
|
31792
31861
|
setMessageQueue((prev) => [...prev, trimmedMessage]);
|
|
31793
31862
|
}
|
|
31794
31863
|
}, []);
|
|
31795
|
-
const clearQueue = (0,
|
|
31864
|
+
const clearQueue = (0, import_react106.useCallback)(() => {
|
|
31796
31865
|
setMessageQueue([]);
|
|
31797
31866
|
}, []);
|
|
31798
|
-
const getQueuedMessagesText = (0,
|
|
31867
|
+
const getQueuedMessagesText = (0, import_react106.useCallback)(() => {
|
|
31799
31868
|
if (messageQueue2.length === 0) return "";
|
|
31800
31869
|
return messageQueue2.join("\n\n");
|
|
31801
31870
|
}, [messageQueue2]);
|
|
31802
|
-
const popAllMessages = (0,
|
|
31871
|
+
const popAllMessages = (0, import_react106.useCallback)(() => {
|
|
31803
31872
|
if (messageQueue2.length === 0) {
|
|
31804
31873
|
return void 0;
|
|
31805
31874
|
}
|
|
@@ -31807,7 +31876,7 @@ function useMessageQueue({
|
|
|
31807
31876
|
setMessageQueue([]);
|
|
31808
31877
|
return allMessages;
|
|
31809
31878
|
}, [messageQueue2]);
|
|
31810
|
-
(0,
|
|
31879
|
+
(0, import_react106.useEffect)(() => {
|
|
31811
31880
|
if (isConfigInitialized && streamingState === "idle" /* Idle */ && !isCompressing && isMcpReady && messageQueue2.length > 0) {
|
|
31812
31881
|
const combinedMessage = messageQueue2.join("\n\n");
|
|
31813
31882
|
setMessageQueue([]);
|
|
@@ -31831,15 +31900,15 @@ function useMessageQueue({
|
|
|
31831
31900
|
}
|
|
31832
31901
|
|
|
31833
31902
|
// packages/cli/src/ui/hooks/useMcpStatus.ts
|
|
31834
|
-
var
|
|
31903
|
+
var import_react107 = __toESM(require_react(), 1);
|
|
31835
31904
|
function useMcpStatus(config) {
|
|
31836
|
-
const [discoveryState, setDiscoveryState] = (0,
|
|
31905
|
+
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31837
31906
|
() => config.getMcpClientManager()?.getDiscoveryState() ?? MCPDiscoveryState.NOT_STARTED
|
|
31838
31907
|
);
|
|
31839
|
-
const [mcpServerCount, setMcpServerCount] = (0,
|
|
31908
|
+
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31840
31909
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
31841
31910
|
);
|
|
31842
|
-
(0,
|
|
31911
|
+
(0, import_react107.useEffect)(() => {
|
|
31843
31912
|
const onChange = () => {
|
|
31844
31913
|
const manager = config.getMcpClientManager();
|
|
31845
31914
|
if (manager) {
|
|
@@ -31861,7 +31930,7 @@ function useMcpStatus(config) {
|
|
|
31861
31930
|
}
|
|
31862
31931
|
|
|
31863
31932
|
// packages/cli/src/ui/hooks/useApprovalModeIndicator.ts
|
|
31864
|
-
var
|
|
31933
|
+
var import_react108 = __toESM(require_react(), 1);
|
|
31865
31934
|
function useApprovalModeIndicator({
|
|
31866
31935
|
config,
|
|
31867
31936
|
addItem,
|
|
@@ -31871,8 +31940,8 @@ function useApprovalModeIndicator({
|
|
|
31871
31940
|
}) {
|
|
31872
31941
|
const keyMatchers = useKeyMatchers();
|
|
31873
31942
|
const currentConfigValue = config.getApprovalMode();
|
|
31874
|
-
const [showApprovalMode, setApprovalMode] = (0,
|
|
31875
|
-
(0,
|
|
31943
|
+
const [showApprovalMode, setApprovalMode] = (0, import_react108.useState)(currentConfigValue);
|
|
31944
|
+
(0, import_react108.useEffect)(() => {
|
|
31876
31945
|
setApprovalMode(currentConfigValue);
|
|
31877
31946
|
}, [currentConfigValue]);
|
|
31878
31947
|
useKeypress(
|
|
@@ -31941,13 +32010,13 @@ function useApprovalModeIndicator({
|
|
|
31941
32010
|
}
|
|
31942
32011
|
|
|
31943
32012
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
31944
|
-
var
|
|
32013
|
+
var import_react109 = __toESM(require_react(), 1);
|
|
31945
32014
|
import fs7 from "node:fs";
|
|
31946
32015
|
import fsPromises from "node:fs/promises";
|
|
31947
32016
|
function useGitBranchName(cwd5) {
|
|
31948
|
-
const [branchName, setBranchName] = (0,
|
|
31949
|
-
const timeoutRef = (0,
|
|
31950
|
-
const fetchBranchName = (0,
|
|
32017
|
+
const [branchName, setBranchName] = (0, import_react109.useState)(void 0);
|
|
32018
|
+
const timeoutRef = (0, import_react109.useRef)(null);
|
|
32019
|
+
const fetchBranchName = (0, import_react109.useCallback)(async () => {
|
|
31951
32020
|
try {
|
|
31952
32021
|
const { stdout } = await spawnAsync(
|
|
31953
32022
|
"git",
|
|
@@ -31969,7 +32038,7 @@ function useGitBranchName(cwd5) {
|
|
|
31969
32038
|
setBranchName(void 0);
|
|
31970
32039
|
}
|
|
31971
32040
|
}, [cwd5, setBranchName]);
|
|
31972
|
-
(0,
|
|
32041
|
+
(0, import_react109.useEffect)(() => {
|
|
31973
32042
|
void fetchBranchName();
|
|
31974
32043
|
let watcher;
|
|
31975
32044
|
let cancelled = false;
|
|
@@ -32013,7 +32082,7 @@ function useGitBranchName(cwd5) {
|
|
|
32013
32082
|
}
|
|
32014
32083
|
|
|
32015
32084
|
// packages/cli/src/ui/hooks/useSessionResume.ts
|
|
32016
|
-
var
|
|
32085
|
+
var import_react110 = __toESM(require_react(), 1);
|
|
32017
32086
|
function useSessionResume({
|
|
32018
32087
|
config,
|
|
32019
32088
|
historyManager,
|
|
@@ -32023,14 +32092,14 @@ function useSessionResume({
|
|
|
32023
32092
|
resumedSessionData,
|
|
32024
32093
|
isAuthenticating
|
|
32025
32094
|
}) {
|
|
32026
|
-
const [isResuming, setIsResuming] = (0,
|
|
32027
|
-
const historyManagerRef = (0,
|
|
32028
|
-
const refreshStaticRef = (0,
|
|
32029
|
-
(0,
|
|
32095
|
+
const [isResuming, setIsResuming] = (0, import_react110.useState)(false);
|
|
32096
|
+
const historyManagerRef = (0, import_react110.useRef)(historyManager);
|
|
32097
|
+
const refreshStaticRef = (0, import_react110.useRef)(refreshStatic);
|
|
32098
|
+
(0, import_react110.useEffect)(() => {
|
|
32030
32099
|
historyManagerRef.current = historyManager;
|
|
32031
32100
|
refreshStaticRef.current = refreshStatic;
|
|
32032
32101
|
});
|
|
32033
|
-
const loadHistoryForResume = (0,
|
|
32102
|
+
const loadHistoryForResume = (0, import_react110.useCallback)(
|
|
32034
32103
|
async (uiHistory, clientHistory, resumedData) => {
|
|
32035
32104
|
if (!isGeminiClientInitialized) {
|
|
32036
32105
|
return;
|
|
@@ -32060,8 +32129,8 @@ function useSessionResume({
|
|
|
32060
32129
|
},
|
|
32061
32130
|
[config, isGeminiClientInitialized, setQuittingMessages]
|
|
32062
32131
|
);
|
|
32063
|
-
const hasLoadedResumedSession = (0,
|
|
32064
|
-
(0,
|
|
32132
|
+
const hasLoadedResumedSession = (0, import_react110.useRef)(false);
|
|
32133
|
+
(0, import_react110.useEffect)(() => {
|
|
32065
32134
|
if (resumedSessionData && !isAuthenticating && isGeminiClientInitialized && !hasLoadedResumedSession.current) {
|
|
32066
32135
|
hasLoadedResumedSession.current = true;
|
|
32067
32136
|
const historyData = convertSessionToHistoryFormats(
|
|
@@ -32083,7 +32152,7 @@ function useSessionResume({
|
|
|
32083
32152
|
}
|
|
32084
32153
|
|
|
32085
32154
|
// packages/cli/src/ui/hooks/useIncludeDirsTrust.tsx
|
|
32086
|
-
var
|
|
32155
|
+
var import_react111 = __toESM(require_react(), 1);
|
|
32087
32156
|
var import_jsx_runtime136 = __toESM(require_jsx_runtime(), 1);
|
|
32088
32157
|
async function finishAddingDirectories(config, addItem, added, errors) {
|
|
32089
32158
|
if (!config) {
|
|
@@ -32112,7 +32181,7 @@ async function finishAddingDirectories(config, addItem, added, errors) {
|
|
|
32112
32181
|
}
|
|
32113
32182
|
function useIncludeDirsTrust(config, isTrustedFolder, historyManager, setCustomDialog) {
|
|
32114
32183
|
const { addItem } = historyManager;
|
|
32115
|
-
(0,
|
|
32184
|
+
(0, import_react111.useEffect)(() => {
|
|
32116
32185
|
if (isTrustedFolder === void 0 || !config) {
|
|
32117
32186
|
return;
|
|
32118
32187
|
}
|
|
@@ -32195,13 +32264,13 @@ Please use the permissions command to modify their trust level.`
|
|
|
32195
32264
|
}
|
|
32196
32265
|
|
|
32197
32266
|
// packages/cli/src/ui/hooks/useInputHistoryStore.ts
|
|
32198
|
-
var
|
|
32267
|
+
var import_react112 = __toESM(require_react(), 1);
|
|
32199
32268
|
function useInputHistoryStore() {
|
|
32200
|
-
const [inputHistory, setInputHistory] = (0,
|
|
32201
|
-
const [_pastSessionMessages, setPastSessionMessages] = (0,
|
|
32202
|
-
const [_currentSessionMessages, setCurrentSessionMessages] = (0,
|
|
32203
|
-
const [isInitialized, setIsInitialized] = (0,
|
|
32204
|
-
const recalculateHistory = (0,
|
|
32269
|
+
const [inputHistory, setInputHistory] = (0, import_react112.useState)([]);
|
|
32270
|
+
const [_pastSessionMessages, setPastSessionMessages] = (0, import_react112.useState)([]);
|
|
32271
|
+
const [_currentSessionMessages, setCurrentSessionMessages] = (0, import_react112.useState)([]);
|
|
32272
|
+
const [isInitialized, setIsInitialized] = (0, import_react112.useState)(false);
|
|
32273
|
+
const recalculateHistory = (0, import_react112.useCallback)(
|
|
32205
32274
|
(currentSession, pastSession) => {
|
|
32206
32275
|
const combinedMessages = [...currentSession, ...pastSession];
|
|
32207
32276
|
const deduplicatedMessages = [];
|
|
@@ -32217,7 +32286,7 @@ function useInputHistoryStore() {
|
|
|
32217
32286
|
},
|
|
32218
32287
|
[]
|
|
32219
32288
|
);
|
|
32220
|
-
const initializeFromLogger = (0,
|
|
32289
|
+
const initializeFromLogger = (0, import_react112.useCallback)(
|
|
32221
32290
|
async (logger) => {
|
|
32222
32291
|
if (isInitialized || !logger) return;
|
|
32223
32292
|
try {
|
|
@@ -32237,7 +32306,7 @@ function useInputHistoryStore() {
|
|
|
32237
32306
|
},
|
|
32238
32307
|
[isInitialized, recalculateHistory]
|
|
32239
32308
|
);
|
|
32240
|
-
const addInput = (0,
|
|
32309
|
+
const addInput = (0, import_react112.useCallback)(
|
|
32241
32310
|
(input) => {
|
|
32242
32311
|
const trimmedInput = input.trim();
|
|
32243
32312
|
if (!trimmedInput) return;
|
|
@@ -32264,12 +32333,12 @@ function useInputHistoryStore() {
|
|
|
32264
32333
|
}
|
|
32265
32334
|
|
|
32266
32335
|
// packages/cli/src/ui/hooks/useHookDisplayState.ts
|
|
32267
|
-
var
|
|
32336
|
+
var import_react113 = __toESM(require_react(), 1);
|
|
32268
32337
|
var useHookDisplayState = () => {
|
|
32269
|
-
const [activeHooks, setActiveHooks] = (0,
|
|
32270
|
-
const hookStartTimes = (0,
|
|
32271
|
-
const timeouts = (0,
|
|
32272
|
-
(0,
|
|
32338
|
+
const [activeHooks, setActiveHooks] = (0, import_react113.useState)([]);
|
|
32339
|
+
const hookStartTimes = (0, import_react113.useRef)(/* @__PURE__ */ new Map());
|
|
32340
|
+
const timeouts = (0, import_react113.useRef)(/* @__PURE__ */ new Set());
|
|
32341
|
+
(0, import_react113.useEffect)(() => {
|
|
32273
32342
|
const activeTimeouts = timeouts.current;
|
|
32274
32343
|
const startTimes = hookStartTimes.current;
|
|
32275
32344
|
const handleHookStart = (payload) => {
|
|
@@ -32334,7 +32403,7 @@ var useHookDisplayState = () => {
|
|
|
32334
32403
|
};
|
|
32335
32404
|
|
|
32336
32405
|
// packages/cli/src/ui/hooks/useBackgroundTaskManager.ts
|
|
32337
|
-
var
|
|
32406
|
+
var import_react114 = __toESM(require_react(), 1);
|
|
32338
32407
|
function useBackgroundTaskManager({
|
|
32339
32408
|
backgroundTasks,
|
|
32340
32409
|
backgroundTaskCount,
|
|
@@ -32344,9 +32413,9 @@ function useBackgroundTaskManager({
|
|
|
32344
32413
|
setEmbeddedShellFocused,
|
|
32345
32414
|
terminalHeight
|
|
32346
32415
|
}) {
|
|
32347
|
-
const [isBackgroundTaskListOpen, setIsBackgroundTaskListOpen] = (0,
|
|
32348
|
-
const [activeBackgroundTaskPid, setActiveBackgroundTaskPid] = (0,
|
|
32349
|
-
(0,
|
|
32416
|
+
const [isBackgroundTaskListOpen, setIsBackgroundTaskListOpen] = (0, import_react114.useState)(false);
|
|
32417
|
+
const [activeBackgroundTaskPid, setActiveBackgroundTaskPid] = (0, import_react114.useState)(null);
|
|
32418
|
+
(0, import_react114.useEffect)(() => {
|
|
32350
32419
|
if (backgroundTasks.size === 0) {
|
|
32351
32420
|
if (activeBackgroundTaskPid !== null) {
|
|
32352
32421
|
setActiveBackgroundTaskPid(null);
|
|
@@ -32363,7 +32432,7 @@ function useBackgroundTaskManager({
|
|
|
32363
32432
|
backgroundTaskCount,
|
|
32364
32433
|
isBackgroundTaskListOpen
|
|
32365
32434
|
]);
|
|
32366
|
-
(0,
|
|
32435
|
+
(0, import_react114.useEffect)(() => {
|
|
32367
32436
|
if (embeddedShellFocused) {
|
|
32368
32437
|
const hasActiveForegroundShell = !!activePtyId;
|
|
32369
32438
|
const hasVisibleBackgroundTask = isBackgroundTaskVisible && backgroundTasks.size > 0;
|
|
@@ -32379,7 +32448,7 @@ function useBackgroundTaskManager({
|
|
|
32379
32448
|
activePtyId,
|
|
32380
32449
|
setEmbeddedShellFocused
|
|
32381
32450
|
]);
|
|
32382
|
-
const backgroundTaskHeight = (0,
|
|
32451
|
+
const backgroundTaskHeight = (0, import_react114.useMemo)(
|
|
32383
32452
|
() => isBackgroundTaskVisible && backgroundTasks.size > 0 ? Math.max(Math.floor(terminalHeight * 0.3), 5) : 0,
|
|
32384
32453
|
[isBackgroundTaskVisible, backgroundTasks.size, terminalHeight]
|
|
32385
32454
|
);
|
|
@@ -32393,11 +32462,11 @@ function useBackgroundTaskManager({
|
|
|
32393
32462
|
}
|
|
32394
32463
|
|
|
32395
32464
|
// packages/cli/src/ui/hooks/useTerminalTheme.ts
|
|
32396
|
-
var
|
|
32465
|
+
var import_react115 = __toESM(require_react(), 1);
|
|
32397
32466
|
function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
|
|
32398
32467
|
const settings = useSettings();
|
|
32399
32468
|
const { subscribe: subscribe2, unsubscribe, queryTerminalBackground } = useTerminalContext();
|
|
32400
|
-
(0,
|
|
32469
|
+
(0, import_react115.useEffect)(() => {
|
|
32401
32470
|
if (settings.merged.ui.autoThemeSwitching === false) {
|
|
32402
32471
|
return;
|
|
32403
32472
|
}
|
|
@@ -32460,11 +32529,11 @@ function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
|
|
|
32460
32529
|
}
|
|
32461
32530
|
|
|
32462
32531
|
// packages/cli/src/ui/hooks/useTimedMessage.ts
|
|
32463
|
-
var
|
|
32532
|
+
var import_react116 = __toESM(require_react(), 1);
|
|
32464
32533
|
function useTimedMessage(durationMs) {
|
|
32465
|
-
const [message, setMessage] = (0,
|
|
32466
|
-
const timeoutRef = (0,
|
|
32467
|
-
const showMessage = (0,
|
|
32534
|
+
const [message, setMessage] = (0, import_react116.useState)(null);
|
|
32535
|
+
const timeoutRef = (0, import_react116.useRef)(null);
|
|
32536
|
+
const showMessage = (0, import_react116.useCallback)(
|
|
32468
32537
|
(msg) => {
|
|
32469
32538
|
setMessage(msg);
|
|
32470
32539
|
if (timeoutRef.current) {
|
|
@@ -32478,7 +32547,7 @@ function useTimedMessage(durationMs) {
|
|
|
32478
32547
|
},
|
|
32479
32548
|
[durationMs]
|
|
32480
32549
|
);
|
|
32481
|
-
(0,
|
|
32550
|
+
(0, import_react116.useEffect)(
|
|
32482
32551
|
() => () => {
|
|
32483
32552
|
if (timeoutRef.current) {
|
|
32484
32553
|
clearTimeout(timeoutRef.current);
|
|
@@ -32490,17 +32559,17 @@ function useTimedMessage(durationMs) {
|
|
|
32490
32559
|
}
|
|
32491
32560
|
|
|
32492
32561
|
// packages/cli/src/ui/hooks/useSuspend.ts
|
|
32493
|
-
var
|
|
32562
|
+
var import_react117 = __toESM(require_react(), 1);
|
|
32494
32563
|
import process11 from "node:process";
|
|
32495
32564
|
function useSuspend({
|
|
32496
32565
|
handleWarning,
|
|
32497
32566
|
setRawMode,
|
|
32498
32567
|
shouldUseAlternateScreen
|
|
32499
32568
|
}) {
|
|
32500
|
-
const [ctrlZPressCount, setCtrlZPressCount] = (0,
|
|
32501
|
-
const ctrlZTimerRef = (0,
|
|
32502
|
-
const onResumeHandlerRef = (0,
|
|
32503
|
-
(0,
|
|
32569
|
+
const [ctrlZPressCount, setCtrlZPressCount] = (0, import_react117.useState)(0);
|
|
32570
|
+
const ctrlZTimerRef = (0, import_react117.useRef)(null);
|
|
32571
|
+
const onResumeHandlerRef = (0, import_react117.useRef)(null);
|
|
32572
|
+
(0, import_react117.useEffect)(
|
|
32504
32573
|
() => () => {
|
|
32505
32574
|
if (ctrlZTimerRef.current) {
|
|
32506
32575
|
clearTimeout(ctrlZTimerRef.current);
|
|
@@ -32513,7 +32582,7 @@ function useSuspend({
|
|
|
32513
32582
|
},
|
|
32514
32583
|
[]
|
|
32515
32584
|
);
|
|
32516
|
-
(0,
|
|
32585
|
+
(0, import_react117.useEffect)(() => {
|
|
32517
32586
|
if (ctrlZTimerRef.current) {
|
|
32518
32587
|
clearTimeout(ctrlZTimerRef.current);
|
|
32519
32588
|
ctrlZTimerRef.current = null;
|
|
@@ -32579,17 +32648,17 @@ function useSuspend({
|
|
|
32579
32648
|
}, WARNING_PROMPT_DURATION_MS);
|
|
32580
32649
|
}
|
|
32581
32650
|
}, [ctrlZPressCount, handleWarning, setRawMode, shouldUseAlternateScreen]);
|
|
32582
|
-
const handleSuspend = (0,
|
|
32651
|
+
const handleSuspend = (0, import_react117.useCallback)(() => {
|
|
32583
32652
|
setCtrlZPressCount((prev) => prev + 1);
|
|
32584
32653
|
}, []);
|
|
32585
32654
|
return { handleSuspend };
|
|
32586
32655
|
}
|
|
32587
32656
|
|
|
32588
32657
|
// packages/cli/src/ui/hooks/useRunEventNotifications.ts
|
|
32589
|
-
var
|
|
32658
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
32590
32659
|
|
|
32591
32660
|
// packages/cli/src/ui/utils/pendingAttentionNotification.ts
|
|
32592
|
-
var
|
|
32661
|
+
var import_react118 = __toESM(require_react(), 1);
|
|
32593
32662
|
|
|
32594
32663
|
// packages/cli/src/utils/terminalNotifications.ts
|
|
32595
32664
|
var MAX_NOTIFICATION_TITLE_CHARS = 48;
|
|
@@ -32804,7 +32873,7 @@ function useRunEventNotifications({
|
|
|
32804
32873
|
hasConfirmUpdateExtensionRequests,
|
|
32805
32874
|
hasLoopDetectionConfirmationRequest
|
|
32806
32875
|
}) {
|
|
32807
|
-
const pendingAttentionNotification = (0,
|
|
32876
|
+
const pendingAttentionNotification = (0, import_react119.useMemo)(
|
|
32808
32877
|
() => getPendingAttentionNotification(
|
|
32809
32878
|
pendingHistoryItems,
|
|
32810
32879
|
commandConfirmationRequest,
|
|
@@ -32822,11 +32891,11 @@ function useRunEventNotifications({
|
|
|
32822
32891
|
hasLoopDetectionConfirmationRequest
|
|
32823
32892
|
]
|
|
32824
32893
|
);
|
|
32825
|
-
const hadPendingAttentionRef = (0,
|
|
32826
|
-
const previousFocusedRef = (0,
|
|
32827
|
-
const previousStreamingStateRef = (0,
|
|
32828
|
-
const lastSentAttentionNotificationRef = (0,
|
|
32829
|
-
(0,
|
|
32894
|
+
const hadPendingAttentionRef = (0, import_react119.useRef)(false);
|
|
32895
|
+
const previousFocusedRef = (0, import_react119.useRef)(isFocused);
|
|
32896
|
+
const previousStreamingStateRef = (0, import_react119.useRef)(streamingState);
|
|
32897
|
+
const lastSentAttentionNotificationRef = (0, import_react119.useRef)(null);
|
|
32898
|
+
(0, import_react119.useEffect)(() => {
|
|
32830
32899
|
if (!notificationsEnabled) {
|
|
32831
32900
|
return;
|
|
32832
32901
|
}
|
|
@@ -32870,7 +32939,7 @@ function useRunEventNotifications({
|
|
|
32870
32939
|
notificationMethod,
|
|
32871
32940
|
pendingAttentionNotification
|
|
32872
32941
|
]);
|
|
32873
|
-
(0,
|
|
32942
|
+
(0, import_react119.useEffect)(() => {
|
|
32874
32943
|
if (!notificationsEnabled) {
|
|
32875
32944
|
return;
|
|
32876
32945
|
}
|
|
@@ -32900,28 +32969,28 @@ function useRunEventNotifications({
|
|
|
32900
32969
|
}
|
|
32901
32970
|
|
|
32902
32971
|
// packages/cli/src/ui/hooks/useVisibilityToggle.ts
|
|
32903
|
-
var
|
|
32972
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
32904
32973
|
var APPROVAL_MODE_REVEAL_DURATION_MS = 1200;
|
|
32905
32974
|
var FOCUS_UI_ENABLED_STATE_KEY = "focusUiEnabled";
|
|
32906
32975
|
function useVisibilityToggle() {
|
|
32907
|
-
const [focusUiEnabledByDefault] = (0,
|
|
32976
|
+
const [focusUiEnabledByDefault] = (0, import_react120.useState)(
|
|
32908
32977
|
() => persistentState.get(FOCUS_UI_ENABLED_STATE_KEY) === true
|
|
32909
32978
|
);
|
|
32910
|
-
const [cleanUiDetailsVisible, setCleanUiDetailsVisibleState] = (0,
|
|
32979
|
+
const [cleanUiDetailsVisible, setCleanUiDetailsVisibleState] = (0, import_react120.useState)(
|
|
32911
32980
|
!focusUiEnabledByDefault
|
|
32912
32981
|
);
|
|
32913
|
-
const modeRevealTimeoutRef = (0,
|
|
32914
|
-
const cleanUiDetailsPinnedRef = (0,
|
|
32915
|
-
const clearModeRevealTimeout = (0,
|
|
32982
|
+
const modeRevealTimeoutRef = (0, import_react120.useRef)(null);
|
|
32983
|
+
const cleanUiDetailsPinnedRef = (0, import_react120.useRef)(!focusUiEnabledByDefault);
|
|
32984
|
+
const clearModeRevealTimeout = (0, import_react120.useCallback)(() => {
|
|
32916
32985
|
if (modeRevealTimeoutRef.current) {
|
|
32917
32986
|
clearTimeout(modeRevealTimeoutRef.current);
|
|
32918
32987
|
modeRevealTimeoutRef.current = null;
|
|
32919
32988
|
}
|
|
32920
32989
|
}, []);
|
|
32921
|
-
const persistFocusUiPreference = (0,
|
|
32990
|
+
const persistFocusUiPreference = (0, import_react120.useCallback)((isFullUiVisible) => {
|
|
32922
32991
|
persistentState.set(FOCUS_UI_ENABLED_STATE_KEY, !isFullUiVisible);
|
|
32923
32992
|
}, []);
|
|
32924
|
-
const setCleanUiDetailsVisible = (0,
|
|
32993
|
+
const setCleanUiDetailsVisible = (0, import_react120.useCallback)(
|
|
32925
32994
|
(visible) => {
|
|
32926
32995
|
clearModeRevealTimeout();
|
|
32927
32996
|
cleanUiDetailsPinnedRef.current = visible;
|
|
@@ -32930,7 +32999,7 @@ function useVisibilityToggle() {
|
|
|
32930
32999
|
},
|
|
32931
33000
|
[clearModeRevealTimeout, persistFocusUiPreference]
|
|
32932
33001
|
);
|
|
32933
|
-
const toggleCleanUiDetailsVisible = (0,
|
|
33002
|
+
const toggleCleanUiDetailsVisible = (0, import_react120.useCallback)(() => {
|
|
32934
33003
|
clearModeRevealTimeout();
|
|
32935
33004
|
setCleanUiDetailsVisibleState((visible) => {
|
|
32936
33005
|
const nextVisible = !visible;
|
|
@@ -32939,7 +33008,7 @@ function useVisibilityToggle() {
|
|
|
32939
33008
|
return nextVisible;
|
|
32940
33009
|
});
|
|
32941
33010
|
}, [clearModeRevealTimeout, persistFocusUiPreference]);
|
|
32942
|
-
const revealCleanUiDetailsTemporarily = (0,
|
|
33011
|
+
const revealCleanUiDetailsTemporarily = (0, import_react120.useCallback)(
|
|
32943
33012
|
(durationMs = APPROVAL_MODE_REVEAL_DURATION_MS) => {
|
|
32944
33013
|
if (cleanUiDetailsPinnedRef.current) {
|
|
32945
33014
|
return;
|
|
@@ -32955,7 +33024,7 @@ function useVisibilityToggle() {
|
|
|
32955
33024
|
},
|
|
32956
33025
|
[clearModeRevealTimeout]
|
|
32957
33026
|
);
|
|
32958
|
-
(0,
|
|
33027
|
+
(0, import_react120.useEffect)(() => () => clearModeRevealTimeout(), [clearModeRevealTimeout]);
|
|
32959
33028
|
return {
|
|
32960
33029
|
cleanUiDetailsVisible,
|
|
32961
33030
|
setCleanUiDetailsVisible,
|
|
@@ -33019,17 +33088,17 @@ var AppContainer = (props) => {
|
|
|
33019
33088
|
const { reset } = useOverflowActions();
|
|
33020
33089
|
const notificationsEnabled = isNotificationsEnabled(settings);
|
|
33021
33090
|
const notificationMethod = getNotificationMethod(settings);
|
|
33022
|
-
const { setOptions, dumpCurrentFrame, startRecording, stopRecording } = (0,
|
|
33023
|
-
const recordingFilenameRef = (0,
|
|
33091
|
+
const { setOptions, dumpCurrentFrame, startRecording, stopRecording } = (0, import_react121.useContext)(AppContext_default);
|
|
33092
|
+
const recordingFilenameRef = (0, import_react121.useRef)(null);
|
|
33024
33093
|
const historyManager = useHistory({
|
|
33025
33094
|
chatRecordingService: config.getGeminiClient()?.getChatRecordingService()
|
|
33026
33095
|
});
|
|
33027
33096
|
useMemoryMonitor(historyManager);
|
|
33028
33097
|
const isAlternateBuffer = config.getUseAlternateBuffer();
|
|
33029
|
-
const [mouseMode, setMouseMode] = (0,
|
|
33098
|
+
const [mouseMode, setMouseMode] = (0, import_react121.useState)(
|
|
33030
33099
|
() => config.getUseAlternateBuffer()
|
|
33031
33100
|
);
|
|
33032
|
-
(0,
|
|
33101
|
+
(0, import_react121.useEffect)(() => {
|
|
33033
33102
|
setOptions({
|
|
33034
33103
|
stickyHeadersInBackbuffer: mouseMode
|
|
33035
33104
|
});
|
|
@@ -33039,28 +33108,28 @@ var AppContainer = (props) => {
|
|
|
33039
33108
|
disableMouseEvents();
|
|
33040
33109
|
}
|
|
33041
33110
|
}, [mouseMode, setOptions]);
|
|
33042
|
-
const [corgiMode, setCorgiMode] = (0,
|
|
33043
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
33044
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
33045
|
-
const [showPrivacyNotice, setShowPrivacyNotice] = (0,
|
|
33046
|
-
const [themeError, setThemeError] = (0,
|
|
33111
|
+
const [corgiMode, setCorgiMode] = (0, import_react121.useState)(false);
|
|
33112
|
+
const [debugMessage, setDebugMessage] = (0, import_react121.useState)("");
|
|
33113
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react121.useState)(null);
|
|
33114
|
+
const [showPrivacyNotice, setShowPrivacyNotice] = (0, import_react121.useState)(false);
|
|
33115
|
+
const [themeError, setThemeError] = (0, import_react121.useState)(
|
|
33047
33116
|
initializationResult.themeError
|
|
33048
33117
|
);
|
|
33049
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
33050
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
33051
|
-
const [showDebugProfiler, setShowDebugProfiler] = (0,
|
|
33052
|
-
const [customDialog, setCustomDialog] = (0,
|
|
33118
|
+
const [isProcessing, setIsProcessing] = (0, import_react121.useState)(false);
|
|
33119
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react121.useState)(false);
|
|
33120
|
+
const [showDebugProfiler, setShowDebugProfiler] = (0, import_react121.useState)(false);
|
|
33121
|
+
const [customDialog, setCustomDialog] = (0, import_react121.useState)(
|
|
33053
33122
|
null
|
|
33054
33123
|
);
|
|
33055
|
-
const [copyModeEnabled, setCopyModeEnabled] = (0,
|
|
33056
|
-
const [pendingRestorePrompt, setPendingRestorePrompt] = (0,
|
|
33057
|
-
const toggleBackgroundTasksRef = (0,
|
|
33124
|
+
const [copyModeEnabled, setCopyModeEnabled] = (0, import_react121.useState)(false);
|
|
33125
|
+
const [pendingRestorePrompt, setPendingRestorePrompt] = (0, import_react121.useState)(false);
|
|
33126
|
+
const toggleBackgroundTasksRef = (0, import_react121.useRef)(() => {
|
|
33058
33127
|
});
|
|
33059
|
-
const isBackgroundTaskVisibleRef = (0,
|
|
33060
|
-
const backgroundTasksRef = (0,
|
|
33061
|
-
const [adminSettingsChanged, setAdminSettingsChanged] = (0,
|
|
33062
|
-
const [expandedTools, setExpandedTools] = (0,
|
|
33063
|
-
const toggleExpansion = (0,
|
|
33128
|
+
const isBackgroundTaskVisibleRef = (0, import_react121.useRef)(false);
|
|
33129
|
+
const backgroundTasksRef = (0, import_react121.useRef)(/* @__PURE__ */ new Map());
|
|
33130
|
+
const [adminSettingsChanged, setAdminSettingsChanged] = (0, import_react121.useState)(false);
|
|
33131
|
+
const [expandedTools, setExpandedTools] = (0, import_react121.useState)(/* @__PURE__ */ new Set());
|
|
33132
|
+
const toggleExpansion = (0, import_react121.useCallback)((callId) => {
|
|
33064
33133
|
setExpandedTools((prev) => {
|
|
33065
33134
|
const next = new Set(prev);
|
|
33066
33135
|
if (next.has(callId)) {
|
|
@@ -33071,7 +33140,7 @@ var AppContainer = (props) => {
|
|
|
33071
33140
|
return next;
|
|
33072
33141
|
});
|
|
33073
33142
|
}, []);
|
|
33074
|
-
const toggleAllExpansion = (0,
|
|
33143
|
+
const toggleAllExpansion = (0, import_react121.useCallback)((callIds) => {
|
|
33075
33144
|
setExpandedTools((prev) => {
|
|
33076
33145
|
const next = new Set(prev);
|
|
33077
33146
|
const anyCollapsed = callIds.some((id) => !next.has(id));
|
|
@@ -33083,25 +33152,25 @@ var AppContainer = (props) => {
|
|
|
33083
33152
|
return next;
|
|
33084
33153
|
});
|
|
33085
33154
|
}, []);
|
|
33086
|
-
const isExpanded = (0,
|
|
33155
|
+
const isExpanded = (0, import_react121.useCallback)(
|
|
33087
33156
|
(callId) => expandedTools.has(callId),
|
|
33088
33157
|
[expandedTools]
|
|
33089
33158
|
);
|
|
33090
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
33091
|
-
const [isVoiceModeEnabled, setVoiceModeEnabled] = (0,
|
|
33092
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
33093
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
33094
|
-
const [settingsNonce, setSettingsNonce] = (0,
|
|
33159
|
+
const [shellModeActive, setShellModeActive] = (0, import_react121.useState)(false);
|
|
33160
|
+
const [isVoiceModeEnabled, setVoiceModeEnabled] = (0, import_react121.useState)(false);
|
|
33161
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react121.useState)(false);
|
|
33162
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react121.useState)(0);
|
|
33163
|
+
const [settingsNonce, setSettingsNonce] = (0, import_react121.useState)(0);
|
|
33095
33164
|
const activeHooks = useHookDisplayState();
|
|
33096
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
33097
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
33165
|
+
const [updateInfo, setUpdateInfo] = (0, import_react121.useState)(null);
|
|
33166
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react121.useState)(
|
|
33098
33167
|
() => isWorkspaceTrusted(settings.merged).isTrusted
|
|
33099
33168
|
);
|
|
33100
33169
|
const [queueErrorMessage, setQueueErrorMessage] = useTimedMessage(
|
|
33101
33170
|
QUEUE_ERROR_DISPLAY_DURATION_MS
|
|
33102
33171
|
);
|
|
33103
|
-
const [newAgents, setNewAgents] = (0,
|
|
33104
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
33172
|
+
const [newAgents, setNewAgents] = (0, import_react121.useState)(null);
|
|
33173
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react121.useState)(true);
|
|
33105
33174
|
const [expandHintTrigger, triggerExpandHint] = useTimedMessage(
|
|
33106
33175
|
EXPAND_HINT_DURATION_MS
|
|
33107
33176
|
);
|
|
@@ -33109,17 +33178,17 @@ var AppContainer = (props) => {
|
|
|
33109
33178
|
const overflowState = useOverflowState();
|
|
33110
33179
|
const overflowingIdsSize = overflowState?.overflowingIds.size ?? 0;
|
|
33111
33180
|
const hasOverflowState = overflowingIdsSize > 0 || !constrainHeight;
|
|
33112
|
-
const prevOverflowingIdsSizeRef = (0,
|
|
33113
|
-
(0,
|
|
33181
|
+
const prevOverflowingIdsSizeRef = (0, import_react121.useRef)(0);
|
|
33182
|
+
(0, import_react121.useEffect)(() => {
|
|
33114
33183
|
if (overflowingIdsSize > prevOverflowingIdsSizeRef.current && hasOverflowState) {
|
|
33115
33184
|
triggerExpandHint(true);
|
|
33116
33185
|
}
|
|
33117
33186
|
prevOverflowingIdsSizeRef.current = overflowingIdsSize;
|
|
33118
33187
|
}, [hasOverflowState, overflowingIdsSize, triggerExpandHint]);
|
|
33119
|
-
const [defaultBannerText, setDefaultBannerText] = (0,
|
|
33120
|
-
const [warningBannerText, setWarningBannerText] = (0,
|
|
33121
|
-
const [bannerVisible, setBannerVisible] = (0,
|
|
33122
|
-
const bannerData = (0,
|
|
33188
|
+
const [defaultBannerText, setDefaultBannerText] = (0, import_react121.useState)("");
|
|
33189
|
+
const [warningBannerText, setWarningBannerText] = (0, import_react121.useState)("");
|
|
33190
|
+
const [bannerVisible, setBannerVisible] = (0, import_react121.useState)(true);
|
|
33191
|
+
const bannerData = (0, import_react121.useMemo)(
|
|
33123
33192
|
() => ({
|
|
33124
33193
|
defaultText: defaultBannerText,
|
|
33125
33194
|
warningText: warningBannerText
|
|
@@ -33142,24 +33211,24 @@ var AppContainer = (props) => {
|
|
|
33142
33211
|
historyManager.addItem,
|
|
33143
33212
|
config.getEnableExtensionReloading()
|
|
33144
33213
|
);
|
|
33145
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
33146
|
-
const [permissionsDialogProps, setPermissionsDialogProps] = (0,
|
|
33147
|
-
const openPermissionsDialog = (0,
|
|
33214
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react121.useState)(false);
|
|
33215
|
+
const [permissionsDialogProps, setPermissionsDialogProps] = (0, import_react121.useState)(null);
|
|
33216
|
+
const openPermissionsDialog = (0, import_react121.useCallback)(
|
|
33148
33217
|
(props2) => {
|
|
33149
33218
|
setPermissionsDialogOpen(true);
|
|
33150
33219
|
setPermissionsDialogProps(props2 ?? null);
|
|
33151
33220
|
},
|
|
33152
33221
|
[]
|
|
33153
33222
|
);
|
|
33154
|
-
const closePermissionsDialog = (0,
|
|
33223
|
+
const closePermissionsDialog = (0, import_react121.useCallback)(() => {
|
|
33155
33224
|
setPermissionsDialogOpen(false);
|
|
33156
33225
|
setPermissionsDialogProps(null);
|
|
33157
33226
|
}, []);
|
|
33158
|
-
const [isAgentConfigDialogOpen, setIsAgentConfigDialogOpen] = (0,
|
|
33159
|
-
const [selectedAgentName, setSelectedAgentName] = (0,
|
|
33160
|
-
const [selectedAgentDisplayName, setSelectedAgentDisplayName] = (0,
|
|
33161
|
-
const [selectedAgentDefinition, setSelectedAgentDefinition] = (0,
|
|
33162
|
-
const openAgentConfigDialog = (0,
|
|
33227
|
+
const [isAgentConfigDialogOpen, setIsAgentConfigDialogOpen] = (0, import_react121.useState)(false);
|
|
33228
|
+
const [selectedAgentName, setSelectedAgentName] = (0, import_react121.useState)();
|
|
33229
|
+
const [selectedAgentDisplayName, setSelectedAgentDisplayName] = (0, import_react121.useState)();
|
|
33230
|
+
const [selectedAgentDefinition, setSelectedAgentDefinition] = (0, import_react121.useState)();
|
|
33231
|
+
const openAgentConfigDialog = (0, import_react121.useCallback)(
|
|
33163
33232
|
(name, displayName, definition) => {
|
|
33164
33233
|
setSelectedAgentName(name);
|
|
33165
33234
|
setSelectedAgentDisplayName(displayName);
|
|
@@ -33168,28 +33237,28 @@ var AppContainer = (props) => {
|
|
|
33168
33237
|
},
|
|
33169
33238
|
[]
|
|
33170
33239
|
);
|
|
33171
|
-
const closeAgentConfigDialog = (0,
|
|
33240
|
+
const closeAgentConfigDialog = (0, import_react121.useCallback)(() => {
|
|
33172
33241
|
setIsAgentConfigDialogOpen(false);
|
|
33173
33242
|
setSelectedAgentName(void 0);
|
|
33174
33243
|
setSelectedAgentDisplayName(void 0);
|
|
33175
33244
|
setSelectedAgentDefinition(void 0);
|
|
33176
33245
|
}, []);
|
|
33177
|
-
const toggleDebugProfiler = (0,
|
|
33246
|
+
const toggleDebugProfiler = (0, import_react121.useCallback)(
|
|
33178
33247
|
() => setShowDebugProfiler((prev) => !prev),
|
|
33179
33248
|
[]
|
|
33180
33249
|
);
|
|
33181
|
-
const [currentModel, setCurrentModel] = (0,
|
|
33182
|
-
const [userTier, setUserTier] = (0,
|
|
33183
|
-
const [quotaStats, setQuotaStats] = (0,
|
|
33250
|
+
const [currentModel, setCurrentModel] = (0, import_react121.useState)(config.getModel());
|
|
33251
|
+
const [userTier, setUserTier] = (0, import_react121.useState)(void 0);
|
|
33252
|
+
const [quotaStats, setQuotaStats] = (0, import_react121.useState)(() => {
|
|
33184
33253
|
const remaining = config.getQuotaRemaining();
|
|
33185
33254
|
const limit = config.getQuotaLimit();
|
|
33186
33255
|
const resetTime = config.getQuotaResetTime();
|
|
33187
33256
|
return remaining !== void 0 || limit !== void 0 || resetTime !== void 0 ? { remaining, limit, resetTime } : void 0;
|
|
33188
33257
|
});
|
|
33189
|
-
const [paidTier, setPaidTier] = (0,
|
|
33258
|
+
const [paidTier, setPaidTier] = (0, import_react121.useState)(
|
|
33190
33259
|
void 0
|
|
33191
33260
|
);
|
|
33192
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
33261
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react121.useState)(false);
|
|
33193
33262
|
const logger = useLogger(config);
|
|
33194
33263
|
const { inputHistory, addInput, initializeFromLogger } = useInputHistoryStore();
|
|
33195
33264
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
@@ -33198,10 +33267,10 @@ var AppContainer = (props) => {
|
|
|
33198
33267
|
const app = use_app_default();
|
|
33199
33268
|
const { stats: sessionStats } = useSessionStats();
|
|
33200
33269
|
const branchName = useGitBranchName(config.getTargetDir());
|
|
33201
|
-
const rootUiRef = (0,
|
|
33202
|
-
const lastTitleRef = (0,
|
|
33270
|
+
const rootUiRef = (0, import_react121.useRef)(null);
|
|
33271
|
+
const lastTitleRef = (0, import_react121.useRef)(null);
|
|
33203
33272
|
const staticExtraHeight = 3;
|
|
33204
|
-
(0,
|
|
33273
|
+
(0, import_react121.useEffect)(() => {
|
|
33205
33274
|
(async () => {
|
|
33206
33275
|
if (!config.isInitialized()) {
|
|
33207
33276
|
await config.initialize();
|
|
@@ -33246,11 +33315,11 @@ var AppContainer = (props) => {
|
|
|
33246
33315
|
);
|
|
33247
33316
|
};
|
|
33248
33317
|
}, [config, resumedSessionData]);
|
|
33249
|
-
(0,
|
|
33318
|
+
(0, import_react121.useEffect)(
|
|
33250
33319
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
33251
33320
|
[historyManager.addItem]
|
|
33252
33321
|
);
|
|
33253
|
-
(0,
|
|
33322
|
+
(0, import_react121.useEffect)(() => {
|
|
33254
33323
|
const handleModelChanged = () => {
|
|
33255
33324
|
setCurrentModel(config.getModel());
|
|
33256
33325
|
};
|
|
@@ -33268,7 +33337,7 @@ var AppContainer = (props) => {
|
|
|
33268
33337
|
coreEvents.off(CoreEvent.QuotaChanged, handleQuotaChanged);
|
|
33269
33338
|
};
|
|
33270
33339
|
}, [config]);
|
|
33271
|
-
(0,
|
|
33340
|
+
(0, import_react121.useEffect)(() => {
|
|
33272
33341
|
const handleSettingsChanged = () => {
|
|
33273
33342
|
setSettingsNonce((prev) => prev + 1);
|
|
33274
33343
|
};
|
|
@@ -33292,12 +33361,12 @@ var AppContainer = (props) => {
|
|
|
33292
33361
|
}, [settings]);
|
|
33293
33362
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
33294
33363
|
const mainAreaWidth = calculateMainAreaWidth(terminalWidth, config);
|
|
33295
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
33364
|
+
const { inputWidth, suggestionsWidth } = (0, import_react121.useMemo)(() => {
|
|
33296
33365
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(mainAreaWidth);
|
|
33297
33366
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
33298
33367
|
}, [mainAreaWidth]);
|
|
33299
33368
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
33300
|
-
const getPreferredEditor = (0,
|
|
33369
|
+
const getPreferredEditor = (0, import_react121.useCallback)(() => {
|
|
33301
33370
|
const val = settings.merged.general.preferredEditor;
|
|
33302
33371
|
return isValidEditorType(val) ? val : void 0;
|
|
33303
33372
|
}, [settings.merged.general.preferredEditor]);
|
|
@@ -33310,56 +33379,56 @@ var AppContainer = (props) => {
|
|
|
33310
33379
|
shellModeActive,
|
|
33311
33380
|
getPreferredEditor
|
|
33312
33381
|
});
|
|
33313
|
-
const bufferRef = (0,
|
|
33314
|
-
(0,
|
|
33382
|
+
const bufferRef = (0, import_react121.useRef)(buffer);
|
|
33383
|
+
(0, import_react121.useEffect)(() => {
|
|
33315
33384
|
bufferRef.current = buffer;
|
|
33316
33385
|
}, [buffer]);
|
|
33317
|
-
const stableSetText = (0,
|
|
33386
|
+
const stableSetText = (0, import_react121.useCallback)((text) => {
|
|
33318
33387
|
bufferRef.current.setText(text);
|
|
33319
33388
|
}, []);
|
|
33320
|
-
(0,
|
|
33389
|
+
(0, import_react121.useEffect)(() => {
|
|
33321
33390
|
initializeFromLogger(logger);
|
|
33322
33391
|
}, [logger, initializeFromLogger]);
|
|
33323
33392
|
useTerminalSetupPrompt({
|
|
33324
33393
|
addConfirmUpdateExtensionRequest,
|
|
33325
33394
|
addItem: historyManager.addItem
|
|
33326
33395
|
});
|
|
33327
|
-
const isStdoutCorkedRef = (0,
|
|
33328
|
-
const isRefreshingStaticRef = (0,
|
|
33329
|
-
const resizeCorkSafetyTimerRef = (0,
|
|
33330
|
-
const resizeDebounceTimerRef = (0,
|
|
33331
|
-
const lastStdoutColumnsRef = (0,
|
|
33396
|
+
const isStdoutCorkedRef = (0, import_react121.useRef)(false);
|
|
33397
|
+
const isRefreshingStaticRef = (0, import_react121.useRef)(false);
|
|
33398
|
+
const resizeCorkSafetyTimerRef = (0, import_react121.useRef)(null);
|
|
33399
|
+
const resizeDebounceTimerRef = (0, import_react121.useRef)(null);
|
|
33400
|
+
const lastStdoutColumnsRef = (0, import_react121.useRef)(
|
|
33332
33401
|
stdout.columns ?? process12.stdout.columns ?? terminalWidth
|
|
33333
33402
|
);
|
|
33334
|
-
const lastRefreshedColumnsRef = (0,
|
|
33335
|
-
const terminalWidthRef = (0,
|
|
33403
|
+
const lastRefreshedColumnsRef = (0, import_react121.useRef)(terminalWidth);
|
|
33404
|
+
const terminalWidthRef = (0, import_react121.useRef)(terminalWidth);
|
|
33336
33405
|
terminalWidthRef.current = terminalWidth;
|
|
33337
|
-
const clearResizeCorkSafetyTimer = (0,
|
|
33406
|
+
const clearResizeCorkSafetyTimer = (0, import_react121.useCallback)(() => {
|
|
33338
33407
|
if (resizeCorkSafetyTimerRef.current) {
|
|
33339
33408
|
clearTimeout(resizeCorkSafetyTimerRef.current);
|
|
33340
33409
|
resizeCorkSafetyTimerRef.current = null;
|
|
33341
33410
|
}
|
|
33342
33411
|
}, []);
|
|
33343
|
-
const clearResizeDebounceTimer = (0,
|
|
33412
|
+
const clearResizeDebounceTimer = (0, import_react121.useCallback)(() => {
|
|
33344
33413
|
if (resizeDebounceTimerRef.current) {
|
|
33345
33414
|
clearTimeout(resizeDebounceTimerRef.current);
|
|
33346
33415
|
resizeDebounceTimerRef.current = null;
|
|
33347
33416
|
}
|
|
33348
33417
|
}, []);
|
|
33349
|
-
const corkStdout = (0,
|
|
33418
|
+
const corkStdout = (0, import_react121.useCallback)(() => {
|
|
33350
33419
|
if (!isStdoutCorkedRef.current && typeof stdout.cork === "function") {
|
|
33351
33420
|
stdout.cork();
|
|
33352
33421
|
isStdoutCorkedRef.current = true;
|
|
33353
33422
|
}
|
|
33354
33423
|
}, [stdout]);
|
|
33355
|
-
const uncorkStdout = (0,
|
|
33424
|
+
const uncorkStdout = (0, import_react121.useCallback)(() => {
|
|
33356
33425
|
clearResizeCorkSafetyTimer();
|
|
33357
33426
|
if (isStdoutCorkedRef.current && typeof stdout.uncork === "function") {
|
|
33358
33427
|
isStdoutCorkedRef.current = false;
|
|
33359
33428
|
stdout.uncork();
|
|
33360
33429
|
}
|
|
33361
33430
|
}, [stdout, clearResizeCorkSafetyTimer]);
|
|
33362
|
-
const refreshStatic = (0,
|
|
33431
|
+
const refreshStatic = (0, import_react121.useCallback)(() => {
|
|
33363
33432
|
if (!isAlternateBuffer && !config.getUseTerminalBuffer()) {
|
|
33364
33433
|
clearResizeDebounceTimer();
|
|
33365
33434
|
refreshStdoutSize(stdout);
|
|
@@ -33381,6 +33450,8 @@ var AppContainer = (props) => {
|
|
|
33381
33450
|
stdout.write(ENTER_SYNCHRONIZED_OUTPUT);
|
|
33382
33451
|
}
|
|
33383
33452
|
stdout.write(base_exports.clearTerminal);
|
|
33453
|
+
}
|
|
33454
|
+
if (!isAlternateBuffer || config.getUseTerminalBuffer()) {
|
|
33384
33455
|
setHistoryRemountKey((prev) => prev + 1);
|
|
33385
33456
|
}
|
|
33386
33457
|
}, [
|
|
@@ -33393,7 +33464,7 @@ var AppContainer = (props) => {
|
|
|
33393
33464
|
corkStdout,
|
|
33394
33465
|
uncorkStdout
|
|
33395
33466
|
]);
|
|
33396
|
-
(0,
|
|
33467
|
+
(0, import_react121.useLayoutEffect)(() => {
|
|
33397
33468
|
if (isRefreshingStaticRef.current) {
|
|
33398
33469
|
isRefreshingStaticRef.current = false;
|
|
33399
33470
|
refreshStdoutSize(stdout);
|
|
@@ -33411,7 +33482,7 @@ var AppContainer = (props) => {
|
|
|
33411
33482
|
isAlternateBuffer,
|
|
33412
33483
|
config.getScreenReader()
|
|
33413
33484
|
);
|
|
33414
|
-
const handleEditorClose = (0,
|
|
33485
|
+
const handleEditorClose = (0, import_react121.useCallback)(() => {
|
|
33415
33486
|
if (shouldUseAlternateScreen) {
|
|
33416
33487
|
enterAlternateScreen();
|
|
33417
33488
|
enableMouseEvents();
|
|
@@ -33423,14 +33494,14 @@ var AppContainer = (props) => {
|
|
|
33423
33494
|
terminalCapabilityManager.enableSupportedModes();
|
|
33424
33495
|
refreshStatic();
|
|
33425
33496
|
}, [refreshStatic, shouldUseAlternateScreen, app, config]);
|
|
33426
|
-
const [editorError, setEditorError] = (0,
|
|
33497
|
+
const [editorError, setEditorError] = (0, import_react121.useState)(null);
|
|
33427
33498
|
const {
|
|
33428
33499
|
isEditorDialogOpen,
|
|
33429
33500
|
openEditorDialog,
|
|
33430
33501
|
handleEditorSelect,
|
|
33431
33502
|
exitEditorDialog
|
|
33432
33503
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
33433
|
-
(0,
|
|
33504
|
+
(0, import_react121.useEffect)(() => {
|
|
33434
33505
|
coreEvents.on(CoreEvent.ExternalEditorClosed, handleEditorClose);
|
|
33435
33506
|
coreEvents.on(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
33436
33507
|
return () => {
|
|
@@ -33438,7 +33509,7 @@ var AppContainer = (props) => {
|
|
|
33438
33509
|
coreEvents.off(CoreEvent.RequestEditorSelection, openEditorDialog);
|
|
33439
33510
|
};
|
|
33440
33511
|
}, [handleEditorClose, openEditorDialog]);
|
|
33441
|
-
(0,
|
|
33512
|
+
(0, import_react121.useEffect)(() => {
|
|
33442
33513
|
if (!(settings.merged.ui.hideBanner || config.getScreenReader()) && bannerVisible && bannerText) {
|
|
33443
33514
|
refreshStatic();
|
|
33444
33515
|
}
|
|
@@ -33473,16 +33544,16 @@ var AppContainer = (props) => {
|
|
|
33473
33544
|
initializationResult.authError,
|
|
33474
33545
|
initializationResult.accountSuspensionInfo
|
|
33475
33546
|
);
|
|
33476
|
-
const [authContext, setAuthContext] = (0,
|
|
33547
|
+
const [authContext, setAuthContext] = (0, import_react121.useState)(
|
|
33477
33548
|
{}
|
|
33478
33549
|
);
|
|
33479
|
-
(0,
|
|
33550
|
+
(0, import_react121.useEffect)(() => {
|
|
33480
33551
|
if (authState === "authenticated" /* Authenticated */ && authContext.requiresRestart) {
|
|
33481
33552
|
setAuthState("awaiting_login_restart" /* AwaitingLoginRestart */);
|
|
33482
33553
|
setAuthContext({});
|
|
33483
33554
|
}
|
|
33484
33555
|
}, [authState, authContext, setAuthState]);
|
|
33485
|
-
const handleShowAuthSelection = (0,
|
|
33556
|
+
const handleShowAuthSelection = (0, import_react121.useCallback)(() => {
|
|
33486
33557
|
setAuthState("updating" /* Updating */);
|
|
33487
33558
|
}, [setAuthState]);
|
|
33488
33559
|
const {
|
|
@@ -33524,13 +33595,13 @@ var AppContainer = (props) => {
|
|
|
33524
33595
|
handleResumeSession,
|
|
33525
33596
|
handleDeleteSession: handleDeleteSessionSync
|
|
33526
33597
|
} = useSessionBrowser(config, loadHistoryForResume);
|
|
33527
|
-
const handleDeleteSession = (0,
|
|
33598
|
+
const handleDeleteSession = (0, import_react121.useCallback)(
|
|
33528
33599
|
async (session) => {
|
|
33529
33600
|
await handleDeleteSessionSync(session);
|
|
33530
33601
|
},
|
|
33531
33602
|
[handleDeleteSessionSync]
|
|
33532
33603
|
);
|
|
33533
|
-
const handleAuthSelect = (0,
|
|
33604
|
+
const handleAuthSelect = (0, import_react121.useCallback)(
|
|
33534
33605
|
async (authType, scope) => {
|
|
33535
33606
|
if (authType) {
|
|
33536
33607
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
@@ -33575,7 +33646,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33575
33646
|
},
|
|
33576
33647
|
[settings, config, setAuthState, onAuthError, setAuthContext]
|
|
33577
33648
|
);
|
|
33578
|
-
const handleApiKeySubmit = (0,
|
|
33649
|
+
const handleApiKeySubmit = (0, import_react121.useCallback)(
|
|
33579
33650
|
async (apiKey) => {
|
|
33580
33651
|
try {
|
|
33581
33652
|
onAuthError(null);
|
|
@@ -33595,16 +33666,16 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33595
33666
|
},
|
|
33596
33667
|
[setAuthState, onAuthError, reloadApiKey, config]
|
|
33597
33668
|
);
|
|
33598
|
-
const handleApiKeyCancel = (0,
|
|
33669
|
+
const handleApiKeyCancel = (0, import_react121.useCallback)(() => {
|
|
33599
33670
|
setAuthState("updating" /* Updating */);
|
|
33600
33671
|
}, [setAuthState]);
|
|
33601
|
-
(0,
|
|
33672
|
+
(0, import_react121.useEffect)(() => {
|
|
33602
33673
|
if (authState === "authenticated" /* Authenticated */) {
|
|
33603
33674
|
setUserTier(config.getUserTier());
|
|
33604
33675
|
setPaidTier(config.getUserPaidTier());
|
|
33605
33676
|
}
|
|
33606
33677
|
}, [config, authState]);
|
|
33607
|
-
(0,
|
|
33678
|
+
(0, import_react121.useEffect)(() => {
|
|
33608
33679
|
if (settings.merged.security.auth.enforcedType && settings.merged.security.auth.selectedType && settings.merged.security.auth.enforcedType !== settings.merged.security.auth.selectedType) {
|
|
33609
33680
|
onAuthError(
|
|
33610
33681
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
@@ -33640,19 +33711,19 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33640
33711
|
closeVoiceModelDialog
|
|
33641
33712
|
} = useVoiceModelCommand();
|
|
33642
33713
|
const { toggleVimEnabled } = useVimMode();
|
|
33643
|
-
const setIsBackgroundTaskListOpenRef = (0,
|
|
33714
|
+
const setIsBackgroundTaskListOpenRef = (0, import_react121.useRef)(
|
|
33644
33715
|
() => {
|
|
33645
33716
|
}
|
|
33646
33717
|
);
|
|
33647
|
-
const [shortcutsHelpVisible, setShortcutsHelpVisible] = (0,
|
|
33718
|
+
const [shortcutsHelpVisible, setShortcutsHelpVisible] = (0, import_react121.useState)(false);
|
|
33648
33719
|
const {
|
|
33649
33720
|
cleanUiDetailsVisible,
|
|
33650
33721
|
setCleanUiDetailsVisible,
|
|
33651
33722
|
toggleCleanUiDetailsVisible,
|
|
33652
33723
|
revealCleanUiDetailsTemporarily
|
|
33653
33724
|
} = useVisibilityToggle();
|
|
33654
|
-
const cancelPromiseRef = (0,
|
|
33655
|
-
const awaitCancelPromise = (0,
|
|
33725
|
+
const cancelPromiseRef = (0, import_react121.useRef)(null);
|
|
33726
|
+
const awaitCancelPromise = (0, import_react121.useCallback)(async () => {
|
|
33656
33727
|
if (!cancelPromiseRef.current) {
|
|
33657
33728
|
return;
|
|
33658
33729
|
}
|
|
@@ -33673,7 +33744,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33673
33744
|
cancelPromiseRef.current = null;
|
|
33674
33745
|
}
|
|
33675
33746
|
}, []);
|
|
33676
|
-
const slashCommandActions = (0,
|
|
33747
|
+
const slashCommandActions = (0, import_react121.useMemo)(
|
|
33677
33748
|
() => ({
|
|
33678
33749
|
openAuthDialog: () => setAuthState("updating" /* Updating */),
|
|
33679
33750
|
openThemeDialog,
|
|
@@ -33758,9 +33829,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33758
33829
|
setBannerVisible,
|
|
33759
33830
|
setCustomDialog
|
|
33760
33831
|
);
|
|
33761
|
-
const [authConsentRequest, setAuthConsentRequest] = (0,
|
|
33762
|
-
const [permissionConfirmationRequest, setPermissionConfirmationRequest] = (0,
|
|
33763
|
-
(0,
|
|
33832
|
+
const [authConsentRequest, setAuthConsentRequest] = (0, import_react121.useState)(null);
|
|
33833
|
+
const [permissionConfirmationRequest, setPermissionConfirmationRequest] = (0, import_react121.useState)(null);
|
|
33834
|
+
(0, import_react121.useEffect)(() => {
|
|
33764
33835
|
const handleConsentRequest = (payload) => {
|
|
33765
33836
|
setAuthConsentRequest({
|
|
33766
33837
|
prompt: payload.prompt,
|
|
@@ -33775,7 +33846,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33775
33846
|
coreEvents.off(CoreEvent.ConsentRequest, handleConsentRequest);
|
|
33776
33847
|
};
|
|
33777
33848
|
}, []);
|
|
33778
|
-
const performMemoryRefresh = (0,
|
|
33849
|
+
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
33779
33850
|
historyManager.addItem(
|
|
33780
33851
|
{
|
|
33781
33852
|
type: "info" /* INFO */,
|
|
@@ -33815,9 +33886,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33815
33886
|
debugLogger.warn("Error refreshing memory:", error);
|
|
33816
33887
|
}
|
|
33817
33888
|
}, [config, historyManager]);
|
|
33818
|
-
const cancelHandlerRef = (0,
|
|
33889
|
+
const cancelHandlerRef = (0, import_react121.useRef)(() => {
|
|
33819
33890
|
});
|
|
33820
|
-
const onCancelSubmit = (0,
|
|
33891
|
+
const onCancelSubmit = (0, import_react121.useCallback)(
|
|
33821
33892
|
(shouldRestorePrompt, clearBuffer = false) => {
|
|
33822
33893
|
if (shouldRestorePrompt) {
|
|
33823
33894
|
setPendingRestorePrompt(true);
|
|
@@ -33828,7 +33899,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33828
33899
|
},
|
|
33829
33900
|
[]
|
|
33830
33901
|
);
|
|
33831
|
-
(0,
|
|
33902
|
+
(0, import_react121.useEffect)(() => {
|
|
33832
33903
|
if (pendingRestorePrompt) {
|
|
33833
33904
|
const lastHistoryUserMsg = historyManager.history.findLast(
|
|
33834
33905
|
(h) => h.type === "user"
|
|
@@ -33840,9 +33911,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33840
33911
|
}
|
|
33841
33912
|
}
|
|
33842
33913
|
}, [pendingRestorePrompt, inputHistory, historyManager.history]);
|
|
33843
|
-
const pendingHintsRef = (0,
|
|
33844
|
-
const [pendingHintCount, setPendingHintCount] = (0,
|
|
33845
|
-
const consumePendingHints = (0,
|
|
33914
|
+
const pendingHintsRef = (0, import_react121.useRef)([]);
|
|
33915
|
+
const [pendingHintCount, setPendingHintCount] = (0, import_react121.useState)(0);
|
|
33916
|
+
const consumePendingHints = (0, import_react121.useCallback)(() => {
|
|
33846
33917
|
if (pendingHintsRef.current.length === 0) {
|
|
33847
33918
|
return null;
|
|
33848
33919
|
}
|
|
@@ -33851,7 +33922,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33851
33922
|
setPendingHintCount(0);
|
|
33852
33923
|
return hint;
|
|
33853
33924
|
}, []);
|
|
33854
|
-
(0,
|
|
33925
|
+
(0, import_react121.useEffect)(() => {
|
|
33855
33926
|
const hintListener = (text, source) => {
|
|
33856
33927
|
if (source !== "user_steering" && source !== "background_completion") {
|
|
33857
33928
|
return;
|
|
@@ -33864,7 +33935,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33864
33935
|
config.injectionService.offInjection(hintListener);
|
|
33865
33936
|
};
|
|
33866
33937
|
}, [config]);
|
|
33867
|
-
const streamAgent = (0,
|
|
33938
|
+
const streamAgent = (0, import_react121.useMemo)(
|
|
33868
33939
|
() => config?.getAgentSessionInteractiveEnabled() ? new LegacyAgentProtocol({ config, getPreferredEditor }) : void 0,
|
|
33869
33940
|
[config, getPreferredEditor]
|
|
33870
33941
|
);
|
|
@@ -33922,7 +33993,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33922
33993
|
dismissBackgroundTask,
|
|
33923
33994
|
retryStatus
|
|
33924
33995
|
} = activeStream;
|
|
33925
|
-
const pendingHistoryItems = (0,
|
|
33996
|
+
const pendingHistoryItems = (0, import_react121.useMemo)(
|
|
33926
33997
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
33927
33998
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
33928
33999
|
);
|
|
@@ -33945,8 +34016,8 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33945
34016
|
terminalHeight
|
|
33946
34017
|
});
|
|
33947
34018
|
setIsBackgroundTaskListOpenRef.current = setIsBackgroundTaskListOpen;
|
|
33948
|
-
const lastOutputTimeRef = (0,
|
|
33949
|
-
(0,
|
|
34019
|
+
const lastOutputTimeRef = (0, import_react121.useRef)(0);
|
|
34020
|
+
(0, import_react121.useEffect)(() => {
|
|
33950
34021
|
lastOutputTimeRef.current = lastOutputTime;
|
|
33951
34022
|
}, [lastOutputTime]);
|
|
33952
34023
|
const { shouldShowFocusHint, inactivityStatus } = useShellInactivityStatus({
|
|
@@ -33959,7 +34030,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33959
34030
|
});
|
|
33960
34031
|
const shouldShowActionRequiredTitle = inactivityStatus === "action_required";
|
|
33961
34032
|
const shouldShowSilentWorkingTitle = inactivityStatus === "silent_working";
|
|
33962
|
-
const handleApprovalModeChangeWithUiReveal = (0,
|
|
34033
|
+
const handleApprovalModeChangeWithUiReveal = (0, import_react121.useCallback)(
|
|
33963
34034
|
(mode) => {
|
|
33964
34035
|
void handleApprovalModeChange(mode);
|
|
33965
34036
|
if (!cleanUiDetailsVisible) {
|
|
@@ -33973,7 +34044,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33973
34044
|
]
|
|
33974
34045
|
);
|
|
33975
34046
|
const { isMcpReady } = useMcpStatus(config);
|
|
33976
|
-
const isCompressing = (0,
|
|
34047
|
+
const isCompressing = (0, import_react121.useMemo)(
|
|
33977
34048
|
() => pendingHistoryItems.some(
|
|
33978
34049
|
(item) => item.type === "compression" /* COMPRESSION */ && item.compression.isPending
|
|
33979
34050
|
),
|
|
@@ -33992,7 +34063,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33992
34063
|
isMcpReady,
|
|
33993
34064
|
isCompressing
|
|
33994
34065
|
});
|
|
33995
|
-
cancelHandlerRef.current = (0,
|
|
34066
|
+
cancelHandlerRef.current = (0, import_react121.useCallback)(
|
|
33996
34067
|
(shouldRestorePrompt = true, clearBuffer = false) => {
|
|
33997
34068
|
if (!clearBuffer && isToolAwaitingConfirmation(pendingHistoryItems)) {
|
|
33998
34069
|
return;
|
|
@@ -34024,7 +34095,7 @@ ${queuedText}` : queuedText;
|
|
|
34024
34095
|
pendingHistoryItems
|
|
34025
34096
|
]
|
|
34026
34097
|
);
|
|
34027
|
-
const handleHintSubmit = (0,
|
|
34098
|
+
const handleHintSubmit = (0, import_react121.useCallback)(
|
|
34028
34099
|
(hint) => {
|
|
34029
34100
|
const trimmed = hint.trim();
|
|
34030
34101
|
if (!trimmed) {
|
|
@@ -34038,7 +34109,7 @@ ${queuedText}` : queuedText;
|
|
|
34038
34109
|
},
|
|
34039
34110
|
[config, historyManager]
|
|
34040
34111
|
);
|
|
34041
|
-
const handleFinalSubmit = (0,
|
|
34112
|
+
const handleFinalSubmit = (0, import_react121.useCallback)(
|
|
34042
34113
|
async (submittedValue) => {
|
|
34043
34114
|
reset();
|
|
34044
34115
|
triggerExpandHint(null);
|
|
@@ -34122,7 +34193,7 @@ ${queuedText}` : queuedText;
|
|
|
34122
34193
|
triggerExpandHint
|
|
34123
34194
|
]
|
|
34124
34195
|
);
|
|
34125
|
-
const handleClearScreen = (0,
|
|
34196
|
+
const handleClearScreen = (0, import_react121.useCallback)(() => {
|
|
34126
34197
|
reset();
|
|
34127
34198
|
triggerExpandHint(null);
|
|
34128
34199
|
historyManager.clearItems();
|
|
@@ -34137,22 +34208,22 @@ ${queuedText}` : queuedText;
|
|
|
34137
34208
|
]);
|
|
34138
34209
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
34139
34210
|
const isInputActive = !initError && !isProcessing && !isResuming && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */ || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) && !proQuotaRequest;
|
|
34140
|
-
const observerRef = (0,
|
|
34141
|
-
(0,
|
|
34211
|
+
const observerRef = (0, import_react121.useRef)(null);
|
|
34212
|
+
(0, import_react121.useEffect)(
|
|
34142
34213
|
() => () => {
|
|
34143
34214
|
observerRef.current?.disconnect();
|
|
34144
34215
|
},
|
|
34145
34216
|
[]
|
|
34146
34217
|
);
|
|
34147
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
34148
|
-
const [lastNonCopyControlsHeight, setLastNonCopyControlsHeight] = (0,
|
|
34149
|
-
(0,
|
|
34218
|
+
const [controlsHeight, setControlsHeight] = (0, import_react121.useState)(0);
|
|
34219
|
+
const [lastNonCopyControlsHeight, setLastNonCopyControlsHeight] = (0, import_react121.useState)(0);
|
|
34220
|
+
(0, import_react121.useLayoutEffect)(() => {
|
|
34150
34221
|
if (!copyModeEnabled && controlsHeight > 0) {
|
|
34151
34222
|
setLastNonCopyControlsHeight(controlsHeight);
|
|
34152
34223
|
}
|
|
34153
34224
|
}, [copyModeEnabled, controlsHeight]);
|
|
34154
34225
|
const stableControlsHeight = copyModeEnabled && lastNonCopyControlsHeight > 0 ? lastNonCopyControlsHeight : controlsHeight;
|
|
34155
|
-
const mainControlsRef = (0,
|
|
34226
|
+
const mainControlsRef = (0, import_react121.useCallback)((node) => {
|
|
34156
34227
|
if (observerRef.current) {
|
|
34157
34228
|
observerRef.current.disconnect();
|
|
34158
34229
|
observerRef.current = null;
|
|
@@ -34187,14 +34258,14 @@ ${queuedText}` : queuedText;
|
|
|
34187
34258
|
sandboxManager: config.sandboxManager
|
|
34188
34259
|
});
|
|
34189
34260
|
const { isFocused, hasReceivedFocusEvent } = useFocus();
|
|
34190
|
-
const contextFileNames = (0,
|
|
34261
|
+
const contextFileNames = (0, import_react121.useMemo)(() => {
|
|
34191
34262
|
const fromSettings = settings.merged.context.fileName;
|
|
34192
34263
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
34193
34264
|
}, [settings.merged.context.fileName]);
|
|
34194
|
-
const initialPrompt = (0,
|
|
34195
|
-
const initialPromptSubmitted = (0,
|
|
34265
|
+
const initialPrompt = (0, import_react121.useMemo)(() => config.getQuestion(), [config]);
|
|
34266
|
+
const initialPromptSubmitted = (0, import_react121.useRef)(false);
|
|
34196
34267
|
const geminiClient = config.getGeminiClient();
|
|
34197
|
-
(0,
|
|
34268
|
+
(0, import_react121.useEffect)(() => {
|
|
34198
34269
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showPrivacyNotice && geminiClient?.isInitialized?.()) {
|
|
34199
34270
|
void handleFinalSubmit(initialPrompt);
|
|
34200
34271
|
initialPromptSubmitted.current = true;
|
|
@@ -34210,9 +34281,9 @@ ${queuedText}` : queuedText;
|
|
|
34210
34281
|
showPrivacyNotice,
|
|
34211
34282
|
geminiClient
|
|
34212
34283
|
]);
|
|
34213
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
34214
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
34215
|
-
(0,
|
|
34284
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react121.useState)(false);
|
|
34285
|
+
const [currentIDE, setCurrentIDE] = (0, import_react121.useState)(null);
|
|
34286
|
+
(0, import_react121.useEffect)(() => {
|
|
34216
34287
|
const getIde = async () => {
|
|
34217
34288
|
const ideClient = await IdeClient.getInstance();
|
|
34218
34289
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -34223,10 +34294,10 @@ ${queuedText}` : queuedText;
|
|
|
34223
34294
|
const shouldShowIdePrompt = Boolean(
|
|
34224
34295
|
currentIDE && !config.getIdeMode() && !settings.merged.ide.hasSeenNudge && !idePromptAnswered
|
|
34225
34296
|
);
|
|
34226
|
-
const [showErrorDetails, setShowErrorDetails] = (0,
|
|
34227
|
-
const [showFullTodos, setShowFullTodos] = (0,
|
|
34228
|
-
const [renderMarkdown, setRenderMarkdown] = (0,
|
|
34229
|
-
const handleExitRepeat = (0,
|
|
34297
|
+
const [showErrorDetails, setShowErrorDetails] = (0, import_react121.useState)(false);
|
|
34298
|
+
const [showFullTodos, setShowFullTodos] = (0, import_react121.useState)(false);
|
|
34299
|
+
const [renderMarkdown, setRenderMarkdown] = (0, import_react121.useState)(true);
|
|
34300
|
+
const handleExitRepeat = (0, import_react121.useCallback)(
|
|
34230
34301
|
async (count) => {
|
|
34231
34302
|
if (count > 2) {
|
|
34232
34303
|
recordExitFail(config);
|
|
@@ -34248,9 +34319,9 @@ ${queuedText}` : queuedText;
|
|
|
34248
34319
|
windowMs: WARNING_PROMPT_DURATION_MS,
|
|
34249
34320
|
onRepeat: handleExitRepeat
|
|
34250
34321
|
});
|
|
34251
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
34252
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
34253
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
34322
|
+
const [ideContextState, setIdeContextState] = (0, import_react121.useState)();
|
|
34323
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react121.useState)(false);
|
|
34324
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react121.useState)(false);
|
|
34254
34325
|
const [transientMessage, showTransientMessage] = useTimedMessage(WARNING_PROMPT_DURATION_MS);
|
|
34255
34326
|
const {
|
|
34256
34327
|
isFolderTrustDialogOpen,
|
|
@@ -34259,17 +34330,17 @@ ${queuedText}` : queuedText;
|
|
|
34259
34330
|
isRestarting
|
|
34260
34331
|
} = useFolderTrust(settings, setIsTrustedFolder, historyManager.addItem);
|
|
34261
34332
|
const policyUpdateConfirmationRequest = config.getPolicyUpdateConfirmationRequest();
|
|
34262
|
-
const [isPolicyUpdateDialogOpen, setIsPolicyUpdateDialogOpen] = (0,
|
|
34333
|
+
const [isPolicyUpdateDialogOpen, setIsPolicyUpdateDialogOpen] = (0, import_react121.useState)(
|
|
34263
34334
|
!!policyUpdateConfirmationRequest
|
|
34264
34335
|
);
|
|
34265
34336
|
const {
|
|
34266
34337
|
needsRestart: ideNeedsRestart,
|
|
34267
34338
|
restartReason: ideTrustRestartReason
|
|
34268
34339
|
} = useIdeTrustListener();
|
|
34269
|
-
const prevWidthRef = (0,
|
|
34340
|
+
const prevWidthRef = (0, import_react121.useRef)(terminalWidth);
|
|
34270
34341
|
useIncludeDirsTrust(config, isTrustedFolder, historyManager, setCustomDialog);
|
|
34271
|
-
const tabFocusTimeoutRef = (0,
|
|
34272
|
-
(0,
|
|
34342
|
+
const tabFocusTimeoutRef = (0, import_react121.useRef)(null);
|
|
34343
|
+
(0, import_react121.useEffect)(() => {
|
|
34273
34344
|
const handleTransientMessage = (payload) => {
|
|
34274
34345
|
showTransientMessage({ text: payload.message, type: payload.type });
|
|
34275
34346
|
};
|
|
@@ -34297,7 +34368,7 @@ ${queuedText}` : queuedText;
|
|
|
34297
34368
|
}
|
|
34298
34369
|
};
|
|
34299
34370
|
}, [showTransientMessage]);
|
|
34300
|
-
const handleWarning = (0,
|
|
34371
|
+
const handleWarning = (0, import_react121.useCallback)(
|
|
34301
34372
|
(message) => {
|
|
34302
34373
|
showTransientMessage({
|
|
34303
34374
|
text: message,
|
|
@@ -34311,12 +34382,12 @@ ${queuedText}` : queuedText;
|
|
|
34311
34382
|
setRawMode,
|
|
34312
34383
|
shouldUseAlternateScreen
|
|
34313
34384
|
});
|
|
34314
|
-
(0,
|
|
34385
|
+
(0, import_react121.useEffect)(() => {
|
|
34315
34386
|
if (ideNeedsRestart) {
|
|
34316
34387
|
setShowIdeRestartPrompt(true);
|
|
34317
34388
|
}
|
|
34318
34389
|
}, [ideNeedsRestart]);
|
|
34319
|
-
(0,
|
|
34390
|
+
(0, import_react121.useEffect)(() => {
|
|
34320
34391
|
if (isAlternateBuffer || config.getUseTerminalBuffer() || typeof stdout.prependListener !== "function") {
|
|
34321
34392
|
return;
|
|
34322
34393
|
}
|
|
@@ -34351,7 +34422,7 @@ ${queuedText}` : queuedText;
|
|
|
34351
34422
|
clearResizeDebounceTimer,
|
|
34352
34423
|
clearResizeCorkSafetyTimer
|
|
34353
34424
|
]);
|
|
34354
|
-
(0,
|
|
34425
|
+
(0, import_react121.useEffect)(() => {
|
|
34355
34426
|
if (prevWidthRef.current === terminalWidth) {
|
|
34356
34427
|
return;
|
|
34357
34428
|
}
|
|
@@ -34374,25 +34445,24 @@ ${queuedText}` : queuedText;
|
|
|
34374
34445
|
isAlternateBuffer,
|
|
34375
34446
|
config
|
|
34376
34447
|
]);
|
|
34377
|
-
(0,
|
|
34448
|
+
(0, import_react121.useEffect)(() => {
|
|
34378
34449
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
34379
34450
|
setIdeContextState(ideContextStore.get());
|
|
34380
34451
|
return unsubscribe;
|
|
34381
34452
|
}, []);
|
|
34382
|
-
(0,
|
|
34453
|
+
(0, import_react121.useEffect)(() => {
|
|
34383
34454
|
const openDebugConsole = () => {
|
|
34384
34455
|
setShowErrorDetails(true);
|
|
34385
|
-
setConstrainHeight(false);
|
|
34386
34456
|
};
|
|
34387
34457
|
appEvents.on("open-debug-console" /* OpenDebugConsole */, openDebugConsole);
|
|
34388
34458
|
return () => {
|
|
34389
34459
|
appEvents.off("open-debug-console" /* OpenDebugConsole */, openDebugConsole);
|
|
34390
34460
|
};
|
|
34391
34461
|
}, [config]);
|
|
34392
|
-
const handleEscapePromptChange = (0,
|
|
34462
|
+
const handleEscapePromptChange = (0, import_react121.useCallback)((showPrompt) => {
|
|
34393
34463
|
setShowEscapePrompt(showPrompt);
|
|
34394
34464
|
}, []);
|
|
34395
|
-
const handleIdePromptComplete = (0,
|
|
34465
|
+
const handleIdePromptComplete = (0, import_react121.useCallback)(
|
|
34396
34466
|
(result) => {
|
|
34397
34467
|
if (result.userSelection === "yes") {
|
|
34398
34468
|
handleSlashCommand("/ide install");
|
|
@@ -34407,7 +34477,7 @@ ${queuedText}` : queuedText;
|
|
|
34407
34477
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
34408
34478
|
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;
|
|
34409
34479
|
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;
|
|
34410
|
-
const handleGlobalKeypress = (0,
|
|
34480
|
+
const handleGlobalKeypress = (0, import_react121.useCallback)(
|
|
34411
34481
|
(key) => {
|
|
34412
34482
|
if (settings.merged.general.debugKeystrokeLogging) {
|
|
34413
34483
|
debugLogger.log("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -34498,7 +34568,7 @@ ${queuedText}` : queuedText;
|
|
|
34498
34568
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
34499
34569
|
if (settings.merged.general.devtools) {
|
|
34500
34570
|
void (async () => {
|
|
34501
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
34571
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-FBTSVQ57.js");
|
|
34502
34572
|
await toggleDevToolsPanel(
|
|
34503
34573
|
config,
|
|
34504
34574
|
showErrorDetails,
|
|
@@ -34650,7 +34720,7 @@ ${queuedText}` : queuedText;
|
|
|
34650
34720
|
priority: 200 /* Critical */
|
|
34651
34721
|
}
|
|
34652
34722
|
);
|
|
34653
|
-
(0,
|
|
34723
|
+
(0, import_react121.useEffect)(() => {
|
|
34654
34724
|
if (settings.merged.ui.hideWindowTitle) return;
|
|
34655
34725
|
const paddedTitle = computeTerminalTitle({
|
|
34656
34726
|
streamingState,
|
|
@@ -34677,7 +34747,7 @@ ${queuedText}` : queuedText;
|
|
|
34677
34747
|
config,
|
|
34678
34748
|
stdout
|
|
34679
34749
|
]);
|
|
34680
|
-
(0,
|
|
34750
|
+
(0, import_react121.useEffect)(() => {
|
|
34681
34751
|
const handleUserFeedback = (payload) => {
|
|
34682
34752
|
let type;
|
|
34683
34753
|
switch (payload.severity) {
|
|
@@ -34728,7 +34798,7 @@ ${queuedText}` : queuedText;
|
|
|
34728
34798
|
};
|
|
34729
34799
|
}, [historyManager]);
|
|
34730
34800
|
const nightly = props.version.includes("nightly");
|
|
34731
|
-
const hasPendingToolConfirmation = (0,
|
|
34801
|
+
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
34732
34802
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
34733
34803
|
[pendingHistoryItems]
|
|
34734
34804
|
);
|
|
@@ -34793,7 +34863,7 @@ ${queuedText}` : queuedText;
|
|
|
34793
34863
|
hasLoopDetectionConfirmationRequest
|
|
34794
34864
|
});
|
|
34795
34865
|
const isPassiveShortcutsHelpState = isInputActive && streamingState === "idle" /* Idle */ && !hasPendingActionRequired;
|
|
34796
|
-
(0,
|
|
34866
|
+
(0, import_react121.useEffect)(() => {
|
|
34797
34867
|
if (shortcutsHelpVisible && !isPassiveShortcutsHelpState) {
|
|
34798
34868
|
setShortcutsHelpVisible(false);
|
|
34799
34869
|
}
|
|
@@ -34802,7 +34872,7 @@ ${queuedText}` : queuedText;
|
|
|
34802
34872
|
isPassiveShortcutsHelpState,
|
|
34803
34873
|
setShortcutsHelpVisible
|
|
34804
34874
|
]);
|
|
34805
|
-
(0,
|
|
34875
|
+
(0, import_react121.useEffect)(() => {
|
|
34806
34876
|
if (!isConfigInitialized || !config.isModelSteeringEnabled() || streamingState !== "idle" /* Idle */ || !isMcpReady || isToolAwaitingConfirmation(pendingHistoryItems)) {
|
|
34807
34877
|
return;
|
|
34808
34878
|
}
|
|
@@ -34822,14 +34892,14 @@ ${queuedText}` : queuedText;
|
|
|
34822
34892
|
pendingHistoryItems,
|
|
34823
34893
|
pendingHintCount
|
|
34824
34894
|
]);
|
|
34825
|
-
const allToolCalls = (0,
|
|
34895
|
+
const allToolCalls = (0, import_react121.useMemo)(
|
|
34826
34896
|
() => getAllToolCalls(pendingHistoryItems),
|
|
34827
34897
|
[pendingHistoryItems]
|
|
34828
34898
|
);
|
|
34829
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
34899
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react121.useState)(
|
|
34830
34900
|
config.getGeminiMdFileCount()
|
|
34831
34901
|
);
|
|
34832
|
-
(0,
|
|
34902
|
+
(0, import_react121.useEffect)(() => {
|
|
34833
34903
|
const handleMemoryChanged = (result) => {
|
|
34834
34904
|
setGeminiMdFileCount(result.fileCount);
|
|
34835
34905
|
};
|
|
@@ -34838,7 +34908,7 @@ ${queuedText}` : queuedText;
|
|
|
34838
34908
|
coreEvents.off(CoreEvent.MemoryChanged, handleMemoryChanged);
|
|
34839
34909
|
};
|
|
34840
34910
|
}, []);
|
|
34841
|
-
(0,
|
|
34911
|
+
(0, import_react121.useEffect)(() => {
|
|
34842
34912
|
let isMounted = true;
|
|
34843
34913
|
const fetchBannerTexts = async () => {
|
|
34844
34914
|
const [defaultBanner, warningBanner] = await Promise.all([
|
|
@@ -34856,7 +34926,7 @@ ${queuedText}` : queuedText;
|
|
|
34856
34926
|
isMounted = false;
|
|
34857
34927
|
};
|
|
34858
34928
|
}, [config, refreshStatic]);
|
|
34859
|
-
const inputState = (0,
|
|
34929
|
+
const inputState = (0, import_react121.useMemo)(
|
|
34860
34930
|
() => ({
|
|
34861
34931
|
buffer,
|
|
34862
34932
|
userMessages: inputHistory,
|
|
@@ -34876,7 +34946,7 @@ ${queuedText}` : queuedText;
|
|
|
34876
34946
|
suggestionsWidth
|
|
34877
34947
|
]
|
|
34878
34948
|
);
|
|
34879
|
-
const quotaState = (0,
|
|
34949
|
+
const quotaState = (0, import_react121.useMemo)(
|
|
34880
34950
|
() => ({
|
|
34881
34951
|
userTier,
|
|
34882
34952
|
stats: quotaStats,
|
|
@@ -34895,7 +34965,7 @@ ${queuedText}` : queuedText;
|
|
|
34895
34965
|
emptyWalletRequest
|
|
34896
34966
|
]
|
|
34897
34967
|
);
|
|
34898
|
-
const uiState = (0,
|
|
34968
|
+
const uiState = (0, import_react121.useMemo)(
|
|
34899
34969
|
() => ({
|
|
34900
34970
|
history: historyManager.history,
|
|
34901
34971
|
historyManager,
|
|
@@ -35130,11 +35200,11 @@ ${queuedText}` : queuedText;
|
|
|
35130
35200
|
showIsExpandableHint
|
|
35131
35201
|
]
|
|
35132
35202
|
);
|
|
35133
|
-
const exitPrivacyNotice = (0,
|
|
35203
|
+
const exitPrivacyNotice = (0, import_react121.useCallback)(
|
|
35134
35204
|
() => setShowPrivacyNotice(false),
|
|
35135
35205
|
[setShowPrivacyNotice]
|
|
35136
35206
|
);
|
|
35137
|
-
const uiActions = (0,
|
|
35207
|
+
const uiActions = (0, import_react121.useMemo)(
|
|
35138
35208
|
() => ({
|
|
35139
35209
|
handleThemeSelect,
|
|
35140
35210
|
closeThemeDialog,
|
|
@@ -35352,7 +35422,9 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
35352
35422
|
debugMode: config.getDebugMode()
|
|
35353
35423
|
});
|
|
35354
35424
|
consolePatcher.patch();
|
|
35355
|
-
const { stdout: inkStdout, stderr: inkStderr } = createWorkingStdio(
|
|
35425
|
+
const { stdout: inkStdout, stderr: inkStderr } = createWorkingStdio({
|
|
35426
|
+
synchronizedOutput: process.platform !== "win32" || isTmux()
|
|
35427
|
+
});
|
|
35356
35428
|
const isShpool = !!process.env["SHPOOL_SESSION_NAME"];
|
|
35357
35429
|
const AppWrapper = () => {
|
|
35358
35430
|
useKittyKeyboardProtocol();
|
|
@@ -35371,7 +35443,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
35371
35443
|
await new Promise((resolve3) => setTimeout(resolve3, 100));
|
|
35372
35444
|
}
|
|
35373
35445
|
const instance = render_default(
|
|
35374
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
35446
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_react122.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(AppWrapper, {}),
|
|
35375
35447
|
{
|
|
35376
35448
|
stdout: inkStdout,
|
|
35377
35449
|
stderr: inkStderr,
|
|
@@ -35389,7 +35461,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
35389
35461
|
alternateBuffer: useAlternateBuffer2,
|
|
35390
35462
|
terminalBuffer: config.getUseTerminalBuffer(),
|
|
35391
35463
|
renderProcess: config.getUseRenderProcess() && config.getUseTerminalBuffer(),
|
|
35392
|
-
incrementalRendering: settings.merged.ui.incrementalRendering !== false && useAlternateBuffer2 && !isShpool,
|
|
35464
|
+
incrementalRendering: settings.merged.ui.incrementalRendering !== false && (useAlternateBuffer2 || config.getUseTerminalBuffer()) && !isShpool,
|
|
35393
35465
|
debugRainbow: settings.merged.ui.debugRainbow === true
|
|
35394
35466
|
}
|
|
35395
35467
|
);
|