@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-NAPT3FAL.js";
|
|
175
175
|
import {
|
|
176
176
|
require_source
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-RE4V6I3G.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-NU74STQ5.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-HDP6V6JI.js";
|
|
237
238
|
import {
|
|
238
239
|
isTodoList,
|
|
239
240
|
mapCoreStatusToDisplayStatus,
|
|
240
241
|
require_react
|
|
241
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-5VQUE3OF.js";
|
|
242
243
|
import {
|
|
243
244
|
registerCleanup,
|
|
244
245
|
removeCleanup,
|
|
245
246
|
runExitCleanup,
|
|
246
247
|
setupTtyCheck
|
|
247
|
-
} from "./chunk-
|
|
248
|
+
} from "./chunk-YP27UYI4.js";
|
|
248
249
|
import {
|
|
249
250
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
250
251
|
AGENT_TOOL_NAME,
|
|
@@ -389,6 +390,7 @@ import {
|
|
|
389
390
|
isRenderedInHistory,
|
|
390
391
|
isStructuredToolResult,
|
|
391
392
|
isSubagentProgress,
|
|
393
|
+
isTmux,
|
|
392
394
|
isUserVisibleHook,
|
|
393
395
|
isValidEditorType,
|
|
394
396
|
isVisibleInToolGroup,
|
|
@@ -431,7 +433,7 @@ import {
|
|
|
431
433
|
validatePlanContent,
|
|
432
434
|
validatePlanPath,
|
|
433
435
|
writeToStdout
|
|
434
|
-
} from "./chunk-
|
|
436
|
+
} from "./chunk-QCWGLPCO.js";
|
|
435
437
|
import "./chunk-664ZODQF.js";
|
|
436
438
|
import "./chunk-IUUIT4SU.js";
|
|
437
439
|
import "./chunk-L6PII3GR.js";
|
|
@@ -3247,11 +3249,11 @@ var require_registry_auth_token = __commonJS({
|
|
|
3247
3249
|
});
|
|
3248
3250
|
|
|
3249
3251
|
// packages/cli/src/interactiveCli.tsx
|
|
3250
|
-
var
|
|
3252
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
3251
3253
|
import { basename as basename5 } from "node:path";
|
|
3252
3254
|
|
|
3253
3255
|
// packages/cli/src/ui/AppContainer.tsx
|
|
3254
|
-
var
|
|
3256
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
3255
3257
|
|
|
3256
3258
|
// packages/cli/src/ui/components/HistoryItemDisplay.tsx
|
|
3257
3259
|
var import_react23 = __toESM(require_react(), 1);
|
|
@@ -5189,8 +5191,14 @@ var ToolResultDisplay = ({
|
|
|
5189
5191
|
isAlternateBuffer,
|
|
5190
5192
|
maxLinesLimit: maxLines
|
|
5191
5193
|
});
|
|
5192
|
-
const
|
|
5193
|
-
const
|
|
5194
|
+
const totalContainerWidth = terminalWidth || 0;
|
|
5195
|
+
const borderSpace = 4;
|
|
5196
|
+
const scrollbarBuffer = isAlternateBuffer ? 1 : 0;
|
|
5197
|
+
const childWidth = Math.max(0, totalContainerWidth - borderSpace);
|
|
5198
|
+
const safeContentWidth = Math.max(
|
|
5199
|
+
0,
|
|
5200
|
+
totalContainerWidth - borderSpace - scrollbarBuffer
|
|
5201
|
+
);
|
|
5194
5202
|
const keyExtractor = import_react8.default.useCallback(
|
|
5195
5203
|
(_, index) => index.toString(),
|
|
5196
5204
|
[]
|
|
@@ -5208,13 +5216,13 @@ var ToolResultDisplay = ({
|
|
|
5208
5216
|
const formattedJSON = prettyJSON ? JSON.stringify(prettyJSON, null, 2) : null;
|
|
5209
5217
|
let content;
|
|
5210
5218
|
if (formattedJSON) {
|
|
5211
|
-
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: formattedJSON });
|
|
5219
|
+
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 }) });
|
|
5212
5220
|
} else if (isSubagentProgress(contentData)) {
|
|
5213
5221
|
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5214
5222
|
SubagentProgressDisplay,
|
|
5215
5223
|
{
|
|
5216
5224
|
progress: contentData,
|
|
5217
|
-
terminalWidth:
|
|
5225
|
+
terminalWidth: safeContentWidth
|
|
5218
5226
|
}
|
|
5219
5227
|
);
|
|
5220
5228
|
} else if (typeof contentData === "string" && renderOutputAsMarkdown) {
|
|
@@ -5222,26 +5230,26 @@ var ToolResultDisplay = ({
|
|
|
5222
5230
|
MarkdownDisplay,
|
|
5223
5231
|
{
|
|
5224
5232
|
text: contentData,
|
|
5225
|
-
terminalWidth:
|
|
5233
|
+
terminalWidth: safeContentWidth,
|
|
5226
5234
|
renderMarkdown,
|
|
5227
5235
|
isPending: false
|
|
5228
5236
|
}
|
|
5229
5237
|
);
|
|
5230
5238
|
} else if (typeof contentData === "string" && !renderOutputAsMarkdown) {
|
|
5231
|
-
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: contentData });
|
|
5239
|
+
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 }) });
|
|
5232
5240
|
} else if (isStructuredToolResult(contentData)) {
|
|
5233
5241
|
if (renderOutputAsMarkdown) {
|
|
5234
5242
|
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5235
5243
|
MarkdownDisplay,
|
|
5236
5244
|
{
|
|
5237
5245
|
text: contentData.summary,
|
|
5238
|
-
terminalWidth:
|
|
5246
|
+
terminalWidth: safeContentWidth,
|
|
5239
5247
|
renderMarkdown,
|
|
5240
5248
|
isPending: false
|
|
5241
5249
|
}
|
|
5242
5250
|
);
|
|
5243
5251
|
} else {
|
|
5244
|
-
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: contentData.summary });
|
|
5252
|
+
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 }) });
|
|
5245
5253
|
}
|
|
5246
5254
|
} else if (isFileDiffResult(contentData)) {
|
|
5247
5255
|
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -5251,7 +5259,7 @@ var ToolResultDisplay = ({
|
|
|
5251
5259
|
filename: contentData.fileName,
|
|
5252
5260
|
disableTruncation: contentData.isBuildFile && !isLockFile(contentData.fileName),
|
|
5253
5261
|
availableTerminalHeight: availableHeight,
|
|
5254
|
-
terminalWidth:
|
|
5262
|
+
terminalWidth: safeContentWidth
|
|
5255
5263
|
}
|
|
5256
5264
|
);
|
|
5257
5265
|
} else if (Array.isArray(contentData)) {
|
|
@@ -5261,13 +5269,13 @@ var ToolResultDisplay = ({
|
|
|
5261
5269
|
{
|
|
5262
5270
|
data: contentData,
|
|
5263
5271
|
availableTerminalHeight: isAlternateBuffer ? void 0 : availableHeight,
|
|
5264
|
-
width:
|
|
5272
|
+
width: safeContentWidth,
|
|
5265
5273
|
maxLines: isAlternateBuffer ? void 0 : maxLines,
|
|
5266
5274
|
disableTruncation: shouldDisableTruncation
|
|
5267
5275
|
}
|
|
5268
5276
|
);
|
|
5269
5277
|
} else if (typeof contentData === "object" && contentData !== null) {
|
|
5270
|
-
content = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { wrap: "wrap", color: theme.text.primary, children: JSON.stringify(contentData, null, 2) });
|
|
5278
|
+
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) }) });
|
|
5271
5279
|
} else {
|
|
5272
5280
|
content = null;
|
|
5273
5281
|
}
|
|
@@ -6756,8 +6764,8 @@ var import_react18 = __toESM(require_react(), 1);
|
|
|
6756
6764
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
6757
6765
|
var PAYLOAD_MARGIN_LEFT = 6;
|
|
6758
6766
|
var PAYLOAD_BORDER_CHROME_WIDTH = 4;
|
|
6759
|
-
var PAYLOAD_SCROLL_GUTTER =
|
|
6760
|
-
var PAYLOAD_MAX_WIDTH = 120 +
|
|
6767
|
+
var PAYLOAD_SCROLL_GUTTER = 1;
|
|
6768
|
+
var PAYLOAD_MAX_WIDTH = 120 + PAYLOAD_BORDER_CHROME_WIDTH;
|
|
6761
6769
|
var hasPayload = (res) => {
|
|
6762
6770
|
if (!hasSummary(res)) return false;
|
|
6763
6771
|
if (!("payload" in res)) return false;
|
|
@@ -6874,6 +6882,9 @@ function getGenericSuccessData(resultDisplay, originalDescription) {
|
|
|
6874
6882
|
}
|
|
6875
6883
|
return { description, summary, payload };
|
|
6876
6884
|
}
|
|
6885
|
+
function renderDiffLineItem(item, width) {
|
|
6886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Box_default, { minHeight: 1, width, flexDirection: "column", children: item });
|
|
6887
|
+
}
|
|
6877
6888
|
var DenseToolMessage = (props) => {
|
|
6878
6889
|
const {
|
|
6879
6890
|
callId,
|
|
@@ -6973,6 +6984,17 @@ var DenseToolMessage = (props) => {
|
|
|
6973
6984
|
isAlternateBuffer
|
|
6974
6985
|
]);
|
|
6975
6986
|
const { description, summary } = viewParts;
|
|
6987
|
+
const totalContainerWidth = Math.max(
|
|
6988
|
+
0,
|
|
6989
|
+
Math.min(PAYLOAD_MAX_WIDTH, (terminalWidth || 0) - PAYLOAD_MARGIN_LEFT)
|
|
6990
|
+
);
|
|
6991
|
+
const borderSpace = PAYLOAD_BORDER_CHROME_WIDTH;
|
|
6992
|
+
const scrollbarBuffer = PAYLOAD_SCROLL_GUTTER;
|
|
6993
|
+
const safeContentWidth = Math.max(
|
|
6994
|
+
0,
|
|
6995
|
+
totalContainerWidth - borderSpace - scrollbarBuffer
|
|
6996
|
+
);
|
|
6997
|
+
const scrollableWidth = Math.max(0, totalContainerWidth - borderSpace);
|
|
6976
6998
|
const diffLines = (0, import_react18.useMemo)(() => {
|
|
6977
6999
|
if (!diff || !isExpanded || !isAlternateBuffer) return [];
|
|
6978
7000
|
const parsedLines = parseDiffWithLineNumbers(diff.fileDiff);
|
|
@@ -6983,7 +7005,7 @@ var DenseToolMessage = (props) => {
|
|
|
6983
7005
|
return colorizeCode({
|
|
6984
7006
|
code: addedContent,
|
|
6985
7007
|
language: fileExtension,
|
|
6986
|
-
maxWidth:
|
|
7008
|
+
maxWidth: safeContentWidth,
|
|
6987
7009
|
settings,
|
|
6988
7010
|
disableColor: status === "cancelled" /* Cancelled */,
|
|
6989
7011
|
returnLines: true
|
|
@@ -6992,11 +7014,11 @@ var DenseToolMessage = (props) => {
|
|
|
6992
7014
|
return renderDiffLines({
|
|
6993
7015
|
parsedLines,
|
|
6994
7016
|
filename: diff.fileName,
|
|
6995
|
-
terminalWidth:
|
|
7017
|
+
terminalWidth: safeContentWidth,
|
|
6996
7018
|
disableColor: status === "cancelled" /* Cancelled */
|
|
6997
7019
|
});
|
|
6998
7020
|
}
|
|
6999
|
-
}, [diff, isExpanded, isAlternateBuffer,
|
|
7021
|
+
}, [diff, isExpanded, isAlternateBuffer, safeContentWidth, settings, status]);
|
|
7000
7022
|
const showPayload = (0, import_react18.useMemo)(() => {
|
|
7001
7023
|
const policy = !isAlternateBuffer || !diff || isExpanded;
|
|
7002
7024
|
if (!policy) return false;
|
|
@@ -7015,8 +7037,14 @@ var DenseToolMessage = (props) => {
|
|
|
7015
7037
|
viewParts.payload,
|
|
7016
7038
|
outputFile
|
|
7017
7039
|
]);
|
|
7018
|
-
const keyExtractor = (
|
|
7019
|
-
|
|
7040
|
+
const keyExtractor = (0, import_react18.useCallback)(
|
|
7041
|
+
(_item, index) => `diff-line-${index}`,
|
|
7042
|
+
[]
|
|
7043
|
+
);
|
|
7044
|
+
const renderItem = (0, import_react18.useCallback)(
|
|
7045
|
+
({ item }) => renderDiffLineItem(item, safeContentWidth),
|
|
7046
|
+
[safeContentWidth]
|
|
7047
|
+
);
|
|
7020
7048
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
7021
7049
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { marginLeft: 2, flexDirection: "row", flexWrap: "wrap", children: [
|
|
7022
7050
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Box_default, { flexDirection: "row", flexShrink: 1, children: [
|
|
@@ -7052,13 +7080,8 @@ var DenseToolMessage = (props) => {
|
|
|
7052
7080
|
borderColor: theme.border.default,
|
|
7053
7081
|
borderDimColor: true,
|
|
7054
7082
|
minWidth: 0,
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
Math.min(
|
|
7058
|
-
PAYLOAD_MAX_WIDTH,
|
|
7059
|
-
(terminalWidth || 0) - PAYLOAD_MARGIN_LEFT
|
|
7060
|
-
)
|
|
7061
|
-
),
|
|
7083
|
+
width: totalContainerWidth,
|
|
7084
|
+
maxWidth: totalContainerWidth,
|
|
7062
7085
|
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7063
7086
|
ScrollableListWithForwardRef,
|
|
7064
7087
|
{
|
|
@@ -7067,13 +7090,7 @@ var DenseToolMessage = (props) => {
|
|
|
7067
7090
|
keyExtractor,
|
|
7068
7091
|
estimatedItemHeight: () => 1,
|
|
7069
7092
|
hasFocus: isFocused,
|
|
7070
|
-
width:
|
|
7071
|
-
0,
|
|
7072
|
-
Math.min(
|
|
7073
|
-
PAYLOAD_MAX_WIDTH,
|
|
7074
|
-
(terminalWidth || 0) - PAYLOAD_MARGIN_LEFT - PAYLOAD_BORDER_CHROME_WIDTH - PAYLOAD_SCROLL_GUTTER
|
|
7075
|
-
)
|
|
7076
|
-
)
|
|
7093
|
+
width: scrollableWidth
|
|
7077
7094
|
}
|
|
7078
7095
|
)
|
|
7079
7096
|
}
|
|
@@ -9640,6 +9657,7 @@ var HistoryItemDisplay = ({
|
|
|
9640
9657
|
const inlineThinkingMode = getInlineThinkingMode(settings);
|
|
9641
9658
|
const itemForDisplay = (0, import_react23.useMemo)(() => escapeAnsiCtrlCodes(item), [item]);
|
|
9642
9659
|
const needTopMargin = !!(isFirstAfterThinking && inlineThinkingMode !== "off" || isToolGroupBoundary);
|
|
9660
|
+
const effectiveAvailableTerminalHeight = availableTerminalHeight !== void 0 && needTopMargin ? Math.max(availableTerminalHeight - 1, 1) : availableTerminalHeight;
|
|
9643
9661
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9644
9662
|
Box_default,
|
|
9645
9663
|
{
|
|
@@ -9663,7 +9681,7 @@ var HistoryItemDisplay = ({
|
|
|
9663
9681
|
{
|
|
9664
9682
|
text: itemForDisplay.text,
|
|
9665
9683
|
isPending,
|
|
9666
|
-
availableTerminalHeight: availableTerminalHeightGemini ??
|
|
9684
|
+
availableTerminalHeight: availableTerminalHeightGemini ?? effectiveAvailableTerminalHeight,
|
|
9667
9685
|
terminalWidth
|
|
9668
9686
|
}
|
|
9669
9687
|
),
|
|
@@ -9672,7 +9690,7 @@ var HistoryItemDisplay = ({
|
|
|
9672
9690
|
{
|
|
9673
9691
|
text: itemForDisplay.text,
|
|
9674
9692
|
isPending,
|
|
9675
|
-
availableTerminalHeight: availableTerminalHeightGemini ??
|
|
9693
|
+
availableTerminalHeight: availableTerminalHeightGemini ?? effectiveAvailableTerminalHeight,
|
|
9676
9694
|
terminalWidth
|
|
9677
9695
|
}
|
|
9678
9696
|
),
|
|
@@ -9735,7 +9753,7 @@ var HistoryItemDisplay = ({
|
|
|
9735
9753
|
{
|
|
9736
9754
|
item: itemForDisplay,
|
|
9737
9755
|
toolCalls: itemForDisplay.tools,
|
|
9738
|
-
availableTerminalHeight,
|
|
9756
|
+
availableTerminalHeight: effectiveAvailableTerminalHeight,
|
|
9739
9757
|
terminalWidth,
|
|
9740
9758
|
borderTop: itemForDisplay.borderTop,
|
|
9741
9759
|
borderBottom: itemForDisplay.borderBottom,
|
|
@@ -12642,6 +12660,29 @@ var ToolConfirmationQueueWithBudget = ({
|
|
|
12642
12660
|
"confirmation-queue"
|
|
12643
12661
|
) });
|
|
12644
12662
|
};
|
|
12663
|
+
var STATIC_HISTORY_ITEM_TYPES = /* @__PURE__ */ new Set([
|
|
12664
|
+
"user",
|
|
12665
|
+
"user_shell",
|
|
12666
|
+
"gemini",
|
|
12667
|
+
"gemini_content",
|
|
12668
|
+
"info",
|
|
12669
|
+
"warning",
|
|
12670
|
+
"error",
|
|
12671
|
+
"hint",
|
|
12672
|
+
"thinking",
|
|
12673
|
+
"about",
|
|
12674
|
+
"help",
|
|
12675
|
+
"stats",
|
|
12676
|
+
"model_stats",
|
|
12677
|
+
"tool_stats",
|
|
12678
|
+
"model",
|
|
12679
|
+
"quit",
|
|
12680
|
+
"extensions_list",
|
|
12681
|
+
"tools_list",
|
|
12682
|
+
"skills_list",
|
|
12683
|
+
"agents_list",
|
|
12684
|
+
"chat_list"
|
|
12685
|
+
]);
|
|
12645
12686
|
var MainContent = () => {
|
|
12646
12687
|
const { version } = useAppContext();
|
|
12647
12688
|
const uiState = useUIState();
|
|
@@ -12843,15 +12884,35 @@ var MainContent = () => {
|
|
|
12843
12884
|
const estimatedItemHeight = (0, import_react36.useCallback)(() => 100, []);
|
|
12844
12885
|
const keyExtractor = (0, import_react36.useCallback)(
|
|
12845
12886
|
(item, _index) => {
|
|
12846
|
-
if (item.type === "header")
|
|
12847
|
-
|
|
12887
|
+
if (item.type === "header") {
|
|
12888
|
+
return `header-${showHeaderDetails}-${uiState.bannerVisible}-${uiState.bannerData?.defaultText ?? ""}-${uiState.bannerData?.warningText ?? ""}-${uiState.updateInfo?.isUpdating}-${uiState.historyRemountKey}`;
|
|
12889
|
+
}
|
|
12890
|
+
if (item.type === "history") {
|
|
12891
|
+
return `${item.item.id}-${uiState.renderMarkdown}-${uiState.historyRemountKey}`;
|
|
12892
|
+
}
|
|
12848
12893
|
return "pending";
|
|
12849
12894
|
},
|
|
12850
|
-
[
|
|
12895
|
+
[
|
|
12896
|
+
showHeaderDetails,
|
|
12897
|
+
uiState.bannerVisible,
|
|
12898
|
+
uiState.bannerData?.defaultText,
|
|
12899
|
+
uiState.bannerData?.warningText,
|
|
12900
|
+
uiState.renderMarkdown,
|
|
12901
|
+
uiState.historyRemountKey,
|
|
12902
|
+
uiState.updateInfo?.isUpdating
|
|
12903
|
+
]
|
|
12851
12904
|
);
|
|
12852
12905
|
const isStaticItem = (0, import_react36.useCallback)(
|
|
12853
|
-
(item) =>
|
|
12854
|
-
|
|
12906
|
+
(item) => {
|
|
12907
|
+
if (item.type === "header") {
|
|
12908
|
+
return !uiState.updateInfo?.isUpdating;
|
|
12909
|
+
}
|
|
12910
|
+
if (item.type === "history") {
|
|
12911
|
+
return STATIC_HISTORY_ITEM_TYPES.has(item.item.type);
|
|
12912
|
+
}
|
|
12913
|
+
return false;
|
|
12914
|
+
},
|
|
12915
|
+
[uiState.updateInfo?.isUpdating]
|
|
12855
12916
|
);
|
|
12856
12917
|
const scrollableList = (0, import_react36.useMemo)(() => {
|
|
12857
12918
|
if (isAlternateBufferOrTerminalBuffer) {
|
|
@@ -17988,7 +18049,7 @@ Do you want to allow this read?`,
|
|
|
17988
18049
|
};
|
|
17989
18050
|
|
|
17990
18051
|
// packages/cli/src/ui/components/Composer.tsx
|
|
17991
|
-
var
|
|
18052
|
+
var import_react83 = __toESM(require_react(), 1);
|
|
17992
18053
|
|
|
17993
18054
|
// packages/cli/src/ui/components/ToastDisplay.tsx
|
|
17994
18055
|
var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -18170,6 +18231,8 @@ var DetailedMessagesDisplay = ({ maxHeight, width, hasFocus }) => {
|
|
|
18170
18231
|
if (messages.length === 0) {
|
|
18171
18232
|
return null;
|
|
18172
18233
|
}
|
|
18234
|
+
const headerAndBorderHeight = 4;
|
|
18235
|
+
const listHeight = maxHeight !== void 0 ? Math.max(1, maxHeight - headerAndBorderHeight) : void 0;
|
|
18173
18236
|
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
18174
18237
|
Box_default,
|
|
18175
18238
|
{
|
|
@@ -18188,10 +18251,11 @@ var DetailedMessagesDisplay = ({ maxHeight, width, hasFocus }) => {
|
|
|
18188
18251
|
"Debug Console ",
|
|
18189
18252
|
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Text, { color: theme.text.secondary, children: "(F12 to close)" })
|
|
18190
18253
|
] }) }),
|
|
18191
|
-
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Box_default, { height:
|
|
18254
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Box_default, { height: listHeight, width: width - borderAndPadding, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
18192
18255
|
ScrollableListWithForwardRef,
|
|
18193
18256
|
{
|
|
18194
18257
|
ref: scrollableListRef,
|
|
18258
|
+
containerHeight: listHeight,
|
|
18195
18259
|
data: messages,
|
|
18196
18260
|
renderItem: ({ item: msg }) => {
|
|
18197
18261
|
let textColor = theme.text.primary;
|
|
@@ -22423,7 +22487,7 @@ var InputPrompt = ({
|
|
|
22423
22487
|
};
|
|
22424
22488
|
|
|
22425
22489
|
// packages/cli/src/ui/components/StatusRow.tsx
|
|
22426
|
-
var
|
|
22490
|
+
var import_react79 = __toESM(require_react(), 1);
|
|
22427
22491
|
|
|
22428
22492
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
22429
22493
|
var import_react74 = __toESM(require_react(), 1);
|
|
@@ -22831,155 +22895,169 @@ var usePhraseCycler = (isActive, isWaiting, shouldShowFocusHint, showTips = true
|
|
|
22831
22895
|
return { currentTip, currentWittyPhrase };
|
|
22832
22896
|
};
|
|
22833
22897
|
|
|
22898
|
+
// packages/cli/src/ui/components/LoadingIndicator.tsx
|
|
22899
|
+
var import_react77 = __toESM(require_react(), 1);
|
|
22900
|
+
|
|
22901
|
+
// packages/cli/src/ui/components/GeminiRespondingSpinner.tsx
|
|
22902
|
+
var import_react76 = __toESM(require_react(), 1);
|
|
22903
|
+
|
|
22834
22904
|
// packages/cli/src/ui/components/GeminiSpinner.tsx
|
|
22835
22905
|
var import_react75 = __toESM(require_react(), 1);
|
|
22836
22906
|
var import_tinygradient = __toESM(require_tinygradient(), 1);
|
|
22837
22907
|
var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1);
|
|
22838
22908
|
var COLOR_CYCLE_DURATION_MS = 4e3;
|
|
22839
|
-
var
|
|
22840
|
-
|
|
22841
|
-
altText
|
|
22842
|
-
|
|
22843
|
-
|
|
22844
|
-
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
22848
|
-
|
|
22849
|
-
|
|
22850
|
-
|
|
22851
|
-
|
|
22852
|
-
|
|
22853
|
-
|
|
22854
|
-
|
|
22855
|
-
|
|
22856
|
-
|
|
22857
|
-
|
|
22858
|
-
|
|
22859
|
-
|
|
22860
|
-
|
|
22861
|
-
|
|
22862
|
-
|
|
22863
|
-
|
|
22864
|
-
|
|
22865
|
-
|
|
22866
|
-
|
|
22867
|
-
|
|
22868
|
-
}
|
|
22909
|
+
var DEFAULT_COLOR_CYCLE_INTERVAL_MS = 30;
|
|
22910
|
+
var GeminiSpinner = import_react75.default.memo(
|
|
22911
|
+
({ spinnerType = "dots", altText }) => {
|
|
22912
|
+
const isScreenReaderEnabled = use_is_screen_reader_enabled_default();
|
|
22913
|
+
const [time, setTime] = (0, import_react75.useState)(0);
|
|
22914
|
+
const intervalMs = isTmux() ? TMUX_SPINNER_INTERVAL_MS : DEFAULT_COLOR_CYCLE_INTERVAL_MS;
|
|
22915
|
+
const googleGradient = (0, import_react75.useMemo)(() => {
|
|
22916
|
+
const brandColors = [
|
|
22917
|
+
Colors.AccentPurple,
|
|
22918
|
+
Colors.AccentBlue,
|
|
22919
|
+
Colors.AccentCyan,
|
|
22920
|
+
Colors.AccentGreen,
|
|
22921
|
+
Colors.AccentYellow,
|
|
22922
|
+
Colors.AccentRed
|
|
22923
|
+
];
|
|
22924
|
+
return (0, import_tinygradient.default)([...brandColors, brandColors[0]]);
|
|
22925
|
+
}, []);
|
|
22926
|
+
(0, import_react75.useEffect)(() => {
|
|
22927
|
+
if (isScreenReaderEnabled) {
|
|
22928
|
+
return;
|
|
22929
|
+
}
|
|
22930
|
+
const interval = setInterval(() => {
|
|
22931
|
+
setTime((prevTime) => prevTime + intervalMs);
|
|
22932
|
+
}, intervalMs);
|
|
22933
|
+
return () => clearInterval(interval);
|
|
22934
|
+
}, [isScreenReaderEnabled, intervalMs]);
|
|
22935
|
+
const progress = time % COLOR_CYCLE_DURATION_MS / COLOR_CYCLE_DURATION_MS;
|
|
22936
|
+
const currentColor = googleGradient.rgbAt(progress).toHexString();
|
|
22937
|
+
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 }) });
|
|
22938
|
+
}
|
|
22939
|
+
);
|
|
22940
|
+
GeminiSpinner.displayName = "GeminiSpinner";
|
|
22869
22941
|
|
|
22870
22942
|
// packages/cli/src/ui/components/GeminiRespondingSpinner.tsx
|
|
22871
22943
|
var import_jsx_runtime112 = __toESM(require_jsx_runtime(), 1);
|
|
22872
|
-
var GeminiRespondingSpinner = (
|
|
22873
|
-
|
|
22874
|
-
|
|
22875
|
-
|
|
22876
|
-
|
|
22877
|
-
|
|
22878
|
-
|
|
22879
|
-
|
|
22880
|
-
|
|
22881
|
-
|
|
22882
|
-
|
|
22883
|
-
|
|
22884
|
-
|
|
22885
|
-
|
|
22886
|
-
|
|
22887
|
-
|
|
22888
|
-
|
|
22889
|
-
|
|
22890
|
-
|
|
22944
|
+
var GeminiRespondingSpinner = import_react76.default.memo(
|
|
22945
|
+
({
|
|
22946
|
+
nonRespondingDisplay,
|
|
22947
|
+
spinnerType = "dots",
|
|
22948
|
+
isHookActive = false,
|
|
22949
|
+
color
|
|
22950
|
+
}) => {
|
|
22951
|
+
const streamingState = useStreamingContext();
|
|
22952
|
+
const isScreenReaderEnabled = use_is_screen_reader_enabled_default();
|
|
22953
|
+
if (streamingState === "responding" /* Responding */ && !isHookActive) {
|
|
22954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
22955
|
+
GeminiSpinner,
|
|
22956
|
+
{
|
|
22957
|
+
spinnerType,
|
|
22958
|
+
altText: SCREEN_READER_RESPONDING
|
|
22959
|
+
}
|
|
22960
|
+
);
|
|
22961
|
+
}
|
|
22962
|
+
if (nonRespondingDisplay) {
|
|
22963
|
+
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 });
|
|
22964
|
+
}
|
|
22965
|
+
return null;
|
|
22891
22966
|
}
|
|
22892
|
-
|
|
22893
|
-
|
|
22967
|
+
);
|
|
22968
|
+
GeminiRespondingSpinner.displayName = "GeminiRespondingSpinner";
|
|
22894
22969
|
|
|
22895
22970
|
// packages/cli/src/ui/components/LoadingIndicator.tsx
|
|
22896
22971
|
var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1);
|
|
22897
|
-
var LoadingIndicator = (
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
|
|
22903
|
-
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
|
|
22910
|
-
|
|
22911
|
-
|
|
22912
|
-
|
|
22913
|
-
|
|
22914
|
-
|
|
22915
|
-
|
|
22916
|
-
|
|
22917
|
-
|
|
22918
|
-
|
|
22919
|
-
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.
|
|
22924
|
-
|
|
22972
|
+
var LoadingIndicator = import_react77.default.memo(
|
|
22973
|
+
({
|
|
22974
|
+
currentLoadingPhrase,
|
|
22975
|
+
statusPhrase,
|
|
22976
|
+
wittyPhrase,
|
|
22977
|
+
showWit = false,
|
|
22978
|
+
elapsedTime,
|
|
22979
|
+
inline = false,
|
|
22980
|
+
rightContent,
|
|
22981
|
+
thought,
|
|
22982
|
+
thoughtLabel,
|
|
22983
|
+
showCancelAndTimer = true,
|
|
22984
|
+
forceRealStatusOnly = false,
|
|
22985
|
+
spinnerIcon,
|
|
22986
|
+
isHookActive = false
|
|
22987
|
+
}) => {
|
|
22988
|
+
const streamingState = useStreamingContext();
|
|
22989
|
+
const { columns: terminalWidth } = useTerminalSize();
|
|
22990
|
+
const isNarrow = isNarrowWidth(terminalWidth);
|
|
22991
|
+
if (streamingState === "idle" /* Idle */ && !currentLoadingPhrase && !statusPhrase && !thought) {
|
|
22992
|
+
return null;
|
|
22993
|
+
}
|
|
22994
|
+
const primaryText = statusPhrase ?? (currentLoadingPhrase === INTERACTIVE_SHELL_WAITING_PHRASE ? currentLoadingPhrase : thought?.subject ? thoughtLabel ?? thought.subject : currentLoadingPhrase || (streamingState === "responding" /* Responding */ ? "Thinking..." : void 0));
|
|
22995
|
+
const cancelAndTimerContent = showCancelAndTimer && streamingState === "responding" /* Responding */ ? `(esc to cancel, ${elapsedTime < 60 ? `${elapsedTime}s` : formatDuration(elapsedTime * 1e3)})` : null;
|
|
22996
|
+
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;
|
|
22997
|
+
if (inline) {
|
|
22998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
22999
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
23000
|
+
GeminiRespondingSpinner,
|
|
23001
|
+
{
|
|
23002
|
+
nonRespondingDisplay: spinnerIcon ?? (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ ? "\u280F" : ""),
|
|
23003
|
+
isHookActive
|
|
23004
|
+
}
|
|
23005
|
+
) }),
|
|
23006
|
+
primaryText && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { flexShrink: 1, children: [
|
|
23007
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.primary, italic: true, wrap: "truncate-end", children: primaryText }),
|
|
23008
|
+
primaryText === INTERACTIVE_SHELL_WAITING_PHRASE && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text, { color: theme.ui.active, italic: true, children: [
|
|
23009
|
+
" ",
|
|
23010
|
+
"(press tab to focus)"
|
|
23011
|
+
] })
|
|
23012
|
+
] }),
|
|
23013
|
+
cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
23014
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexShrink: 0, width: 1 }),
|
|
23015
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent })
|
|
23016
|
+
] }),
|
|
23017
|
+
wittyPhraseNode
|
|
23018
|
+
] });
|
|
23019
|
+
}
|
|
23020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { paddingLeft: 0, flexDirection: "column", children: [
|
|
23021
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
23022
|
+
Box_default,
|
|
22925
23023
|
{
|
|
22926
|
-
|
|
22927
|
-
|
|
23024
|
+
width: "100%",
|
|
23025
|
+
flexDirection: isNarrow ? "column" : "row",
|
|
23026
|
+
alignItems: isNarrow ? "flex-start" : "center",
|
|
23027
|
+
children: [
|
|
23028
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
23029
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
23030
|
+
GeminiRespondingSpinner,
|
|
23031
|
+
{
|
|
23032
|
+
nonRespondingDisplay: spinnerIcon ?? (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ ? "\u280F" : ""),
|
|
23033
|
+
isHookActive
|
|
23034
|
+
}
|
|
23035
|
+
) }),
|
|
23036
|
+
primaryText && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { flexShrink: 1, children: [
|
|
23037
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.primary, italic: true, wrap: "truncate-end", children: primaryText }),
|
|
23038
|
+
primaryText === INTERACTIVE_SHELL_WAITING_PHRASE && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text, { color: theme.ui.active, italic: true, children: [
|
|
23039
|
+
" ",
|
|
23040
|
+
"(press tab to focus)"
|
|
23041
|
+
] })
|
|
23042
|
+
] }),
|
|
23043
|
+
!isNarrow && cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
23044
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexShrink: 0, width: 1 }),
|
|
23045
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent })
|
|
23046
|
+
] }),
|
|
23047
|
+
!isNarrow && wittyPhraseNode
|
|
23048
|
+
] }),
|
|
23049
|
+
!isNarrow && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexGrow: 1 }),
|
|
23050
|
+
!isNarrow && rightContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: rightContent })
|
|
23051
|
+
]
|
|
22928
23052
|
}
|
|
22929
|
-
)
|
|
22930
|
-
|
|
22931
|
-
|
|
22932
|
-
|
|
22933
|
-
" ",
|
|
22934
|
-
"(press tab to focus)"
|
|
22935
|
-
] })
|
|
22936
|
-
] }),
|
|
22937
|
-
cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
22938
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexShrink: 0, width: 1 }),
|
|
22939
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent })
|
|
22940
|
-
] }),
|
|
22941
|
-
wittyPhraseNode
|
|
23053
|
+
),
|
|
23054
|
+
isNarrow && cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent }) }),
|
|
23055
|
+
isNarrow && wittyPhraseNode,
|
|
23056
|
+
isNarrow && rightContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: rightContent })
|
|
22942
23057
|
] });
|
|
22943
23058
|
}
|
|
22944
|
-
|
|
22945
|
-
|
|
22946
|
-
Box_default,
|
|
22947
|
-
{
|
|
22948
|
-
width: "100%",
|
|
22949
|
-
flexDirection: isNarrow ? "column" : "row",
|
|
22950
|
-
alignItems: isNarrow ? "flex-start" : "center",
|
|
22951
|
-
children: [
|
|
22952
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { children: [
|
|
22953
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
22954
|
-
GeminiRespondingSpinner,
|
|
22955
|
-
{
|
|
22956
|
-
nonRespondingDisplay: spinnerIcon ?? (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ ? "\u280F" : ""),
|
|
22957
|
-
isHookActive
|
|
22958
|
-
}
|
|
22959
|
-
) }),
|
|
22960
|
-
primaryText && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Box_default, { flexShrink: 1, children: [
|
|
22961
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.primary, italic: true, wrap: "truncate-end", children: primaryText }),
|
|
22962
|
-
primaryText === INTERACTIVE_SHELL_WAITING_PHRASE && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text, { color: theme.ui.active, italic: true, children: [
|
|
22963
|
-
" ",
|
|
22964
|
-
"(press tab to focus)"
|
|
22965
|
-
] })
|
|
22966
|
-
] }),
|
|
22967
|
-
!isNarrow && cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
22968
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexShrink: 0, width: 1 }),
|
|
22969
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent })
|
|
22970
|
-
] }),
|
|
22971
|
-
!isNarrow && wittyPhraseNode
|
|
22972
|
-
] }),
|
|
22973
|
-
!isNarrow && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { flexGrow: 1 }),
|
|
22974
|
-
!isNarrow && rightContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: rightContent })
|
|
22975
|
-
]
|
|
22976
|
-
}
|
|
22977
|
-
),
|
|
22978
|
-
isNarrow && cancelAndTimerContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { color: theme.text.secondary, children: cancelAndTimerContent }) }),
|
|
22979
|
-
isNarrow && wittyPhraseNode,
|
|
22980
|
-
isNarrow && rightContent && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Box_default, { children: rightContent })
|
|
22981
|
-
] });
|
|
22982
|
-
};
|
|
23059
|
+
);
|
|
23060
|
+
LoadingIndicator.displayName = "LoadingIndicator";
|
|
22983
23061
|
|
|
22984
23062
|
// packages/cli/src/ui/components/ContextSummaryDisplay.tsx
|
|
22985
23063
|
var import_jsx_runtime114 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -23168,12 +23246,12 @@ var RawMarkdownIndicator = () => {
|
|
|
23168
23246
|
};
|
|
23169
23247
|
|
|
23170
23248
|
// packages/cli/src/ui/hooks/useComposerStatus.ts
|
|
23171
|
-
var
|
|
23249
|
+
var import_react78 = __toESM(require_react(), 1);
|
|
23172
23250
|
var useComposerStatus = () => {
|
|
23173
23251
|
const uiState = useUIState();
|
|
23174
23252
|
const quotaState = useQuotaState();
|
|
23175
23253
|
const settings = useSettings();
|
|
23176
|
-
const hasPendingToolConfirmation = (0,
|
|
23254
|
+
const hasPendingToolConfirmation = (0, import_react78.useMemo)(
|
|
23177
23255
|
() => (uiState.pendingHistoryItems ?? []).filter(
|
|
23178
23256
|
(item) => item.type === "tool_group"
|
|
23179
23257
|
).some(
|
|
@@ -23189,7 +23267,7 @@ var useComposerStatus = () => {
|
|
|
23189
23267
|
);
|
|
23190
23268
|
const showLoadingIndicator = (!uiState.embeddedShellFocused || uiState.isBackgroundTaskVisible) && uiState.streamingState === "responding" /* Responding */ && !hasPendingActionRequired;
|
|
23191
23269
|
const showApprovalModeIndicator = uiState.showApprovalModeIndicator;
|
|
23192
|
-
const modeContentObj = (0,
|
|
23270
|
+
const modeContentObj = (0, import_react78.useMemo)(() => {
|
|
23193
23271
|
const hideMinimalModeHintWhileBusy = !uiState.cleanUiDetailsVisible && (showLoadingIndicator || uiState.activeHooks.length > 0);
|
|
23194
23272
|
if (hideMinimalModeHintWhileBusy) return null;
|
|
23195
23273
|
switch (showApprovalModeIndicator) {
|
|
@@ -23244,283 +23322,291 @@ var LAYOUT = {
|
|
|
23244
23322
|
CONTEXT_DISPLAY_LEFT_MARGIN_WIDE: 0,
|
|
23245
23323
|
COLLISION_GAP: 10
|
|
23246
23324
|
};
|
|
23247
|
-
var StatusNode = (
|
|
23248
|
-
|
|
23249
|
-
showWit,
|
|
23250
|
-
thought,
|
|
23251
|
-
elapsedTime,
|
|
23252
|
-
currentWittyPhrase,
|
|
23253
|
-
activeHooks,
|
|
23254
|
-
showLoadingIndicator,
|
|
23255
|
-
errorVerbosity,
|
|
23256
|
-
statusPhrase,
|
|
23257
|
-
onResize
|
|
23258
|
-
}) => {
|
|
23259
|
-
const observerRef = (0, import_react77.useRef)(null);
|
|
23260
|
-
(0, import_react77.useEffect)(
|
|
23261
|
-
() => () => {
|
|
23262
|
-
observerRef.current?.disconnect();
|
|
23263
|
-
},
|
|
23264
|
-
[]
|
|
23265
|
-
);
|
|
23266
|
-
const onRefChange = (0, import_react77.useCallback)(
|
|
23267
|
-
(node) => {
|
|
23268
|
-
if (observerRef.current) {
|
|
23269
|
-
observerRef.current.disconnect();
|
|
23270
|
-
observerRef.current = null;
|
|
23271
|
-
}
|
|
23272
|
-
if (node && onResize) {
|
|
23273
|
-
const observer = new ResizeObserver((entries) => {
|
|
23274
|
-
const entry = entries[0];
|
|
23275
|
-
if (entry) {
|
|
23276
|
-
onResize(Math.round(entry.contentRect.width));
|
|
23277
|
-
}
|
|
23278
|
-
});
|
|
23279
|
-
observer.observe(node);
|
|
23280
|
-
observerRef.current = observer;
|
|
23281
|
-
}
|
|
23282
|
-
},
|
|
23283
|
-
[onResize]
|
|
23284
|
-
);
|
|
23285
|
-
if (activeHooks.length === 0 && !showLoadingIndicator && !statusPhrase) {
|
|
23286
|
-
return null;
|
|
23287
|
-
}
|
|
23288
|
-
let currentLoadingPhrase = void 0;
|
|
23289
|
-
let currentThought = null;
|
|
23290
|
-
if (activeHooks.length > 0) {
|
|
23291
|
-
const userVisibleHooks = activeHooks.filter(
|
|
23292
|
-
(h) => isUserVisibleHook(h.source)
|
|
23293
|
-
);
|
|
23294
|
-
if (userVisibleHooks.length > 0) {
|
|
23295
|
-
const label = userVisibleHooks.length > 1 ? "Executing Hooks" : "Executing Hook";
|
|
23296
|
-
const displayNames = userVisibleHooks.map((h) => {
|
|
23297
|
-
let name = stripAnsi(h.name);
|
|
23298
|
-
if (h.index && h.total && h.total > 1) {
|
|
23299
|
-
name += ` (${h.index}/${h.total})`;
|
|
23300
|
-
}
|
|
23301
|
-
return name;
|
|
23302
|
-
});
|
|
23303
|
-
currentLoadingPhrase = `${label}: ${displayNames.join(", ")}`;
|
|
23304
|
-
} else {
|
|
23305
|
-
currentLoadingPhrase = GENERIC_WORKING_LABEL;
|
|
23306
|
-
}
|
|
23307
|
-
} else {
|
|
23308
|
-
currentThought = thought ? { ...thought, subject: stripAnsi(thought.subject) } : null;
|
|
23309
|
-
}
|
|
23310
|
-
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { ref: onRefChange, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23311
|
-
LoadingIndicator,
|
|
23312
|
-
{
|
|
23313
|
-
inline: true,
|
|
23314
|
-
showTips,
|
|
23315
|
-
showWit,
|
|
23316
|
-
errorVerbosity,
|
|
23317
|
-
thought: currentThought,
|
|
23318
|
-
currentLoadingPhrase,
|
|
23319
|
-
statusPhrase,
|
|
23320
|
-
elapsedTime,
|
|
23321
|
-
forceRealStatusOnly: false,
|
|
23322
|
-
wittyPhrase: currentWittyPhrase
|
|
23323
|
-
}
|
|
23324
|
-
) });
|
|
23325
|
-
};
|
|
23326
|
-
var StatusRow = ({
|
|
23327
|
-
showUiDetails,
|
|
23328
|
-
isNarrow,
|
|
23329
|
-
terminalWidth,
|
|
23330
|
-
hideContextSummary,
|
|
23331
|
-
hideUiDetailsForSuggestions,
|
|
23332
|
-
hasPendingActionRequired,
|
|
23333
|
-
statusPhrase: propStatusPhrase
|
|
23334
|
-
}) => {
|
|
23335
|
-
const uiState = useUIState();
|
|
23336
|
-
const statusPhrase = propStatusPhrase ?? uiState.statusPhrase;
|
|
23337
|
-
const inputState = useInputState();
|
|
23338
|
-
const settings = useSettings();
|
|
23339
|
-
const {
|
|
23340
|
-
isInteractiveShellWaiting,
|
|
23341
|
-
showLoadingIndicator,
|
|
23325
|
+
var StatusNode = import_react79.default.memo(
|
|
23326
|
+
({
|
|
23342
23327
|
showTips,
|
|
23343
23328
|
showWit,
|
|
23344
|
-
|
|
23345
|
-
|
|
23346
|
-
|
|
23347
|
-
|
|
23348
|
-
|
|
23349
|
-
|
|
23350
|
-
|
|
23351
|
-
|
|
23352
|
-
|
|
23353
|
-
|
|
23354
|
-
|
|
23355
|
-
|
|
23356
|
-
|
|
23357
|
-
|
|
23358
|
-
|
|
23359
|
-
|
|
23360
|
-
|
|
23361
|
-
|
|
23362
|
-
|
|
23363
|
-
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23368
|
-
|
|
23329
|
+
thought,
|
|
23330
|
+
elapsedTime,
|
|
23331
|
+
currentWittyPhrase,
|
|
23332
|
+
activeHooks,
|
|
23333
|
+
showLoadingIndicator,
|
|
23334
|
+
errorVerbosity,
|
|
23335
|
+
statusPhrase,
|
|
23336
|
+
onResize
|
|
23337
|
+
}) => {
|
|
23338
|
+
const observerRef = (0, import_react79.useRef)(null);
|
|
23339
|
+
(0, import_react79.useEffect)(
|
|
23340
|
+
() => () => {
|
|
23341
|
+
observerRef.current?.disconnect();
|
|
23342
|
+
},
|
|
23343
|
+
[]
|
|
23344
|
+
);
|
|
23345
|
+
const onRefChange = (0, import_react79.useCallback)(
|
|
23346
|
+
(node) => {
|
|
23347
|
+
if (observerRef.current) {
|
|
23348
|
+
observerRef.current.disconnect();
|
|
23349
|
+
observerRef.current = null;
|
|
23350
|
+
}
|
|
23351
|
+
if (node && onResize) {
|
|
23352
|
+
const observer = new ResizeObserver((entries) => {
|
|
23353
|
+
const entry = entries[0];
|
|
23354
|
+
if (entry) {
|
|
23355
|
+
onResize(Math.round(entry.contentRect.width));
|
|
23356
|
+
}
|
|
23357
|
+
});
|
|
23358
|
+
observer.observe(node);
|
|
23359
|
+
observerRef.current = observer;
|
|
23369
23360
|
}
|
|
23370
|
-
}
|
|
23371
|
-
|
|
23372
|
-
|
|
23373
|
-
|
|
23374
|
-
|
|
23375
|
-
const tipContentStr = (() => {
|
|
23376
|
-
if (showTips && uiState.currentTip && !(isInteractiveShellWaiting && uiState.currentTip === INTERACTIVE_SHELL_WAITING_PHRASE)) {
|
|
23377
|
-
return uiState.currentTip;
|
|
23378
|
-
}
|
|
23379
|
-
if (settings.merged.ui.showShortcutsHint && !hideUiDetailsForSuggestions && !hasPendingActionRequired && inputState.buffer.text.length === 0) {
|
|
23380
|
-
return showUiDetails ? "? for shortcuts" : "press tab twice for more";
|
|
23361
|
+
},
|
|
23362
|
+
[onResize]
|
|
23363
|
+
);
|
|
23364
|
+
if (activeHooks.length === 0 && !showLoadingIndicator && !statusPhrase) {
|
|
23365
|
+
return null;
|
|
23381
23366
|
}
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
23386
|
-
|
|
23387
|
-
|
|
23388
|
-
|
|
23389
|
-
|
|
23390
|
-
|
|
23391
|
-
|
|
23392
|
-
|
|
23393
|
-
|
|
23394
|
-
|
|
23395
|
-
|
|
23396
|
-
|
|
23397
|
-
|
|
23398
|
-
|
|
23399
|
-
|
|
23400
|
-
|
|
23401
|
-
|
|
23402
|
-
|
|
23403
|
-
activeHooks: uiState.activeHooks,
|
|
23404
|
-
showLoadingIndicator,
|
|
23405
|
-
errorVerbosity: settings.merged.ui.errorVerbosity,
|
|
23406
|
-
statusPhrase,
|
|
23407
|
-
onResize: onStatusResize
|
|
23367
|
+
let currentLoadingPhrase = void 0;
|
|
23368
|
+
let currentThought = null;
|
|
23369
|
+
if (activeHooks.length > 0) {
|
|
23370
|
+
const userVisibleHooks = activeHooks.filter(
|
|
23371
|
+
(h) => isUserVisibleHook(h.source)
|
|
23372
|
+
);
|
|
23373
|
+
if (userVisibleHooks.length > 0) {
|
|
23374
|
+
const label = userVisibleHooks.length > 1 ? "Executing Hooks" : "Executing Hook";
|
|
23375
|
+
const displayNames = userVisibleHooks.map((h) => {
|
|
23376
|
+
let name = stripAnsi(h.name);
|
|
23377
|
+
if (h.index && h.total && h.total > 1) {
|
|
23378
|
+
name += ` (${h.index}/${h.total})`;
|
|
23379
|
+
}
|
|
23380
|
+
return name;
|
|
23381
|
+
});
|
|
23382
|
+
currentLoadingPhrase = `${label}: ${displayNames.join(", ")}`;
|
|
23383
|
+
} else {
|
|
23384
|
+
currentLoadingPhrase = GENERIC_WORKING_LABEL;
|
|
23385
|
+
}
|
|
23386
|
+
} else {
|
|
23387
|
+
currentThought = thought ? { ...thought, subject: stripAnsi(thought.subject) } : null;
|
|
23408
23388
|
}
|
|
23409
|
-
|
|
23410
|
-
|
|
23411
|
-
if (!tipContentStr) return null;
|
|
23412
|
-
const isShortcutHint = tipContentStr === "? for shortcuts" || tipContentStr === "press tab twice for more";
|
|
23413
|
-
const color = isShortcutHint && uiState.shortcutsHelpVisible ? theme.text.accent : theme.text.secondary;
|
|
23414
|
-
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { flexDirection: "row", justifyContent: "flex-end", ref: onTipRefChange, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23415
|
-
Text,
|
|
23389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { ref: onRefChange, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23390
|
+
LoadingIndicator,
|
|
23416
23391
|
{
|
|
23417
|
-
|
|
23418
|
-
|
|
23419
|
-
|
|
23420
|
-
|
|
23392
|
+
inline: true,
|
|
23393
|
+
showTips,
|
|
23394
|
+
showWit,
|
|
23395
|
+
errorVerbosity,
|
|
23396
|
+
thought: currentThought,
|
|
23397
|
+
currentLoadingPhrase,
|
|
23398
|
+
statusPhrase,
|
|
23399
|
+
elapsedTime,
|
|
23400
|
+
forceRealStatusOnly: false,
|
|
23401
|
+
wittyPhrase: currentWittyPhrase
|
|
23421
23402
|
}
|
|
23422
23403
|
) });
|
|
23423
|
-
};
|
|
23424
|
-
if (!showUiDetails && !showRow1Minimal && !showRow2Minimal) {
|
|
23425
|
-
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { height: LAYOUT.STATUS_MIN_HEIGHT });
|
|
23426
23404
|
}
|
|
23427
|
-
|
|
23428
|
-
|
|
23429
|
-
|
|
23430
|
-
|
|
23431
|
-
|
|
23432
|
-
|
|
23433
|
-
|
|
23434
|
-
|
|
23435
|
-
|
|
23436
|
-
|
|
23437
|
-
|
|
23438
|
-
|
|
23439
|
-
|
|
23440
|
-
|
|
23441
|
-
|
|
23442
|
-
|
|
23443
|
-
|
|
23444
|
-
|
|
23445
|
-
|
|
23446
|
-
|
|
23447
|
-
|
|
23448
|
-
|
|
23449
|
-
|
|
23450
|
-
|
|
23451
|
-
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
|
|
23455
|
-
|
|
23456
|
-
|
|
23457
|
-
|
|
23458
|
-
|
|
23459
|
-
|
|
23460
|
-
|
|
23461
|
-
|
|
23462
|
-
|
|
23405
|
+
);
|
|
23406
|
+
StatusNode.displayName = "StatusNode";
|
|
23407
|
+
var StatusRow = import_react79.default.memo(
|
|
23408
|
+
({
|
|
23409
|
+
showUiDetails,
|
|
23410
|
+
isNarrow,
|
|
23411
|
+
terminalWidth,
|
|
23412
|
+
hideContextSummary,
|
|
23413
|
+
hideUiDetailsForSuggestions,
|
|
23414
|
+
hasPendingActionRequired,
|
|
23415
|
+
statusPhrase: propStatusPhrase
|
|
23416
|
+
}) => {
|
|
23417
|
+
const uiState = useUIState();
|
|
23418
|
+
const statusPhrase = propStatusPhrase ?? uiState.statusPhrase;
|
|
23419
|
+
const inputState = useInputState();
|
|
23420
|
+
const settings = useSettings();
|
|
23421
|
+
const {
|
|
23422
|
+
isInteractiveShellWaiting,
|
|
23423
|
+
showLoadingIndicator,
|
|
23424
|
+
showTips,
|
|
23425
|
+
showWit,
|
|
23426
|
+
modeContentObj,
|
|
23427
|
+
showMinimalContext
|
|
23428
|
+
} = useComposerStatus();
|
|
23429
|
+
const [statusWidth, setStatusWidth] = (0, import_react79.useState)(0);
|
|
23430
|
+
const [tipWidth, setTipWidth] = (0, import_react79.useState)(0);
|
|
23431
|
+
const tipObserverRef = (0, import_react79.useRef)(null);
|
|
23432
|
+
(0, import_react79.useEffect)(
|
|
23433
|
+
() => () => {
|
|
23434
|
+
tipObserverRef.current?.disconnect();
|
|
23435
|
+
},
|
|
23436
|
+
[]
|
|
23437
|
+
);
|
|
23438
|
+
const onTipRefChange = (0, import_react79.useCallback)((node) => {
|
|
23439
|
+
if (tipObserverRef.current) {
|
|
23440
|
+
tipObserverRef.current.disconnect();
|
|
23441
|
+
tipObserverRef.current = null;
|
|
23442
|
+
}
|
|
23443
|
+
if (node) {
|
|
23444
|
+
const observer = new ResizeObserver((entries) => {
|
|
23445
|
+
const entry = entries[0];
|
|
23446
|
+
if (entry) {
|
|
23447
|
+
const width = Math.round(entry.contentRect.width);
|
|
23448
|
+
if (width > 0) {
|
|
23449
|
+
setTipWidth(width);
|
|
23463
23450
|
}
|
|
23464
|
-
|
|
23465
|
-
|
|
23451
|
+
}
|
|
23452
|
+
});
|
|
23453
|
+
observer.observe(node);
|
|
23454
|
+
tipObserverRef.current = observer;
|
|
23466
23455
|
}
|
|
23467
|
-
)
|
|
23468
|
-
|
|
23469
|
-
|
|
23470
|
-
|
|
23456
|
+
}, []);
|
|
23457
|
+
const tipContentStr = (() => {
|
|
23458
|
+
if (showTips && uiState.currentTip && !(isInteractiveShellWaiting && uiState.currentTip === INTERACTIVE_SHELL_WAITING_PHRASE)) {
|
|
23459
|
+
return uiState.currentTip;
|
|
23460
|
+
}
|
|
23461
|
+
if (settings.merged.ui?.showShortcutsHint && !hideUiDetailsForSuggestions && !hasPendingActionRequired && inputState.buffer.text.length === 0) {
|
|
23462
|
+
return showUiDetails ? "? for shortcuts" : "press tab twice for more";
|
|
23463
|
+
}
|
|
23464
|
+
return void 0;
|
|
23465
|
+
})();
|
|
23466
|
+
const hasStatus = showLoadingIndicator || uiState.activeHooks.length > 0 || Boolean(statusPhrase);
|
|
23467
|
+
const effectiveStatusWidth = hasStatus ? statusWidth : 0;
|
|
23468
|
+
const willCollideTip = effectiveStatusWidth + tipWidth + LAYOUT.COLLISION_GAP > terminalWidth;
|
|
23469
|
+
const showTipLine = Boolean(
|
|
23470
|
+
!hasPendingActionRequired && tipContentStr && !willCollideTip && !isNarrow
|
|
23471
|
+
);
|
|
23472
|
+
const showRow1Minimal = showLoadingIndicator || uiState.activeHooks.length > 0 || showTipLine || Boolean(statusPhrase);
|
|
23473
|
+
const showRow2Minimal = Boolean(modeContentObj) && !hideUiDetailsForSuggestions || showMinimalContext;
|
|
23474
|
+
const showRow1 = showUiDetails || showRow1Minimal;
|
|
23475
|
+
const showRow2 = showUiDetails || showRow2Minimal;
|
|
23476
|
+
const onStatusResize = (0, import_react79.useCallback)((width) => {
|
|
23477
|
+
if (width > 0) setStatusWidth(width);
|
|
23478
|
+
}, []);
|
|
23479
|
+
const statusNode = /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23480
|
+
StatusNode,
|
|
23471
23481
|
{
|
|
23472
|
-
|
|
23473
|
-
|
|
23474
|
-
|
|
23475
|
-
|
|
23476
|
-
|
|
23477
|
-
|
|
23478
|
-
|
|
23479
|
-
|
|
23480
|
-
|
|
23481
|
-
|
|
23482
|
-
|
|
23483
|
-
|
|
23484
|
-
|
|
23485
|
-
|
|
23486
|
-
|
|
23487
|
-
|
|
23488
|
-
|
|
23489
|
-
|
|
23490
|
-
|
|
23491
|
-
|
|
23492
|
-
|
|
23493
|
-
|
|
23482
|
+
showTips,
|
|
23483
|
+
showWit,
|
|
23484
|
+
thought: uiState.thought,
|
|
23485
|
+
elapsedTime: uiState.elapsedTime,
|
|
23486
|
+
currentWittyPhrase: uiState.currentWittyPhrase,
|
|
23487
|
+
activeHooks: uiState.activeHooks,
|
|
23488
|
+
showLoadingIndicator,
|
|
23489
|
+
errorVerbosity: settings.merged.ui?.errorVerbosity,
|
|
23490
|
+
statusPhrase,
|
|
23491
|
+
onResize: onStatusResize
|
|
23492
|
+
}
|
|
23493
|
+
);
|
|
23494
|
+
const renderTipNode = () => {
|
|
23495
|
+
if (!tipContentStr) return null;
|
|
23496
|
+
const isShortcutHint = tipContentStr === "? for shortcuts" || tipContentStr === "press tab twice for more";
|
|
23497
|
+
const color = isShortcutHint && uiState.shortcutsHelpVisible ? theme.text.accent : theme.text.secondary;
|
|
23498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { flexDirection: "row", justifyContent: "flex-end", ref: onTipRefChange, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23499
|
+
Text,
|
|
23500
|
+
{
|
|
23501
|
+
color,
|
|
23502
|
+
wrap: "truncate-end",
|
|
23503
|
+
italic: !isShortcutHint && tipContentStr === uiState.currentWittyPhrase,
|
|
23504
|
+
children: tipContentStr === uiState.currentTip ? `Tip: ${tipContentStr}` : tipContentStr
|
|
23505
|
+
}
|
|
23506
|
+
) });
|
|
23507
|
+
};
|
|
23508
|
+
if (!showUiDetails && !showRow1Minimal && !showRow2Minimal) {
|
|
23509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { height: LAYOUT.STATUS_MIN_HEIGHT });
|
|
23510
|
+
}
|
|
23511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
|
|
23512
|
+
showRow1 && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
23513
|
+
Box_default,
|
|
23514
|
+
{
|
|
23515
|
+
width: "100%",
|
|
23516
|
+
flexDirection: "row",
|
|
23517
|
+
alignItems: "center",
|
|
23518
|
+
justifyContent: "space-between",
|
|
23519
|
+
minHeight: LAYOUT.STATUS_MIN_HEIGHT,
|
|
23520
|
+
children: [
|
|
23521
|
+
/* @__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: [
|
|
23522
|
+
statusNode,
|
|
23523
|
+
!showUiDetails && showRow2Minimal && modeContentObj && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Text, { color: modeContentObj.color, children: [
|
|
23494
23524
|
"\u25CF ",
|
|
23495
23525
|
modeContentObj.text
|
|
23496
|
-
] })
|
|
23497
|
-
}
|
|
23498
|
-
|
|
23499
|
-
|
|
23500
|
-
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
|
|
23511
|
-
|
|
23512
|
-
|
|
23513
|
-
|
|
23514
|
-
|
|
23515
|
-
|
|
23516
|
-
|
|
23517
|
-
|
|
23518
|
-
|
|
23519
|
-
|
|
23520
|
-
|
|
23521
|
-
|
|
23522
|
-
|
|
23523
|
-
|
|
23526
|
+
] }) })
|
|
23527
|
+
] }) : 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)(
|
|
23528
|
+
Box_default,
|
|
23529
|
+
{
|
|
23530
|
+
flexDirection: "row",
|
|
23531
|
+
alignItems: isNarrow ? "flex-start" : "center",
|
|
23532
|
+
flexGrow: 1,
|
|
23533
|
+
flexShrink: 0,
|
|
23534
|
+
marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN,
|
|
23535
|
+
children: statusNode
|
|
23536
|
+
}
|
|
23537
|
+
) }),
|
|
23538
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23539
|
+
Box_default,
|
|
23540
|
+
{
|
|
23541
|
+
flexShrink: 0,
|
|
23542
|
+
marginLeft: showTipLine ? LAYOUT.TIP_LEFT_MARGIN : 0,
|
|
23543
|
+
marginRight: showTipLine ? isNarrow ? LAYOUT.TIP_RIGHT_MARGIN_NARROW : LAYOUT.TIP_RIGHT_MARGIN_WIDE : 0,
|
|
23544
|
+
position: showTipLine ? "relative" : "absolute",
|
|
23545
|
+
...showTipLine ? {} : { top: -100, left: -100 },
|
|
23546
|
+
children: !isNarrow && tipContentStr && renderTipNode()
|
|
23547
|
+
}
|
|
23548
|
+
)
|
|
23549
|
+
]
|
|
23550
|
+
}
|
|
23551
|
+
),
|
|
23552
|
+
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 }) }),
|
|
23553
|
+
showRow2 && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
23554
|
+
Box_default,
|
|
23555
|
+
{
|
|
23556
|
+
width: "100%",
|
|
23557
|
+
flexDirection: isNarrow ? "column" : "row",
|
|
23558
|
+
alignItems: isNarrow ? "flex-start" : "center",
|
|
23559
|
+
justifyContent: "space-between",
|
|
23560
|
+
children: [
|
|
23561
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23562
|
+
Box_default,
|
|
23563
|
+
{
|
|
23564
|
+
flexDirection: "row",
|
|
23565
|
+
alignItems: "center",
|
|
23566
|
+
marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN,
|
|
23567
|
+
children: showUiDetails ? /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
|
|
23568
|
+
!hideUiDetailsForSuggestions && !inputState.shellModeActive && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23569
|
+
ApprovalModeIndicator,
|
|
23570
|
+
{
|
|
23571
|
+
approvalMode: uiState.showApprovalModeIndicator,
|
|
23572
|
+
allowPlanMode: uiState.allowPlanMode
|
|
23573
|
+
}
|
|
23574
|
+
),
|
|
23575
|
+
inputState.shellModeActive && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(ShellModeIndicator, {}) }),
|
|
23576
|
+
!uiState.renderMarkdown && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(RawMarkdownIndicator, {}) })
|
|
23577
|
+
] }) : showRow2Minimal && modeContentObj && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Text, { color: modeContentObj.color, children: [
|
|
23578
|
+
"\u25CF ",
|
|
23579
|
+
modeContentObj.text
|
|
23580
|
+
] })
|
|
23581
|
+
}
|
|
23582
|
+
),
|
|
23583
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
23584
|
+
Box_default,
|
|
23585
|
+
{
|
|
23586
|
+
marginTop: isNarrow ? LAYOUT.CONTEXT_DISPLAY_TOP_MARGIN_NARROW : 0,
|
|
23587
|
+
flexDirection: "row",
|
|
23588
|
+
alignItems: "center",
|
|
23589
|
+
marginLeft: isNarrow ? LAYOUT.CONTEXT_DISPLAY_LEFT_MARGIN_NARROW : LAYOUT.CONTEXT_DISPLAY_LEFT_MARGIN_WIDE,
|
|
23590
|
+
children: [
|
|
23591
|
+
(showUiDetails || showMinimalContext) && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(StatusDisplay, { hideContextSummary }),
|
|
23592
|
+
showMinimalContext && !showUiDetails && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Box_default, { marginLeft: LAYOUT.INDICATOR_LEFT_MARGIN, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
23593
|
+
ContextUsageDisplay,
|
|
23594
|
+
{
|
|
23595
|
+
promptTokenCount: uiState.sessionStats.lastPromptTokenCount,
|
|
23596
|
+
model: typeof uiState.currentModel === "string" ? uiState.currentModel : void 0,
|
|
23597
|
+
terminalWidth
|
|
23598
|
+
}
|
|
23599
|
+
) })
|
|
23600
|
+
]
|
|
23601
|
+
}
|
|
23602
|
+
)
|
|
23603
|
+
]
|
|
23604
|
+
}
|
|
23605
|
+
)
|
|
23606
|
+
] });
|
|
23607
|
+
}
|
|
23608
|
+
);
|
|
23609
|
+
StatusRow.displayName = "StatusRow";
|
|
23524
23610
|
|
|
23525
23611
|
// packages/cli/src/ui/components/QueuedMessageDisplay.tsx
|
|
23526
23612
|
var import_jsx_runtime121 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -23546,13 +23632,13 @@ var QueuedMessageDisplay = ({
|
|
|
23546
23632
|
};
|
|
23547
23633
|
|
|
23548
23634
|
// packages/cli/src/ui/components/ConfigInitDisplay.tsx
|
|
23549
|
-
var
|
|
23635
|
+
var import_react80 = __toESM(require_react(), 1);
|
|
23550
23636
|
var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1);
|
|
23551
23637
|
var ConfigInitDisplay = ({
|
|
23552
23638
|
message: initialMessage = "Working..."
|
|
23553
23639
|
}) => {
|
|
23554
|
-
const [message, setMessage] = (0,
|
|
23555
|
-
(0,
|
|
23640
|
+
const [message, setMessage] = (0, import_react80.useState)(initialMessage);
|
|
23641
|
+
(0, import_react80.useEffect)(() => {
|
|
23556
23642
|
const onChange = (clients) => {
|
|
23557
23643
|
if (!clients || clients.size === 0) {
|
|
23558
23644
|
setMessage(initialMessage);
|
|
@@ -23596,10 +23682,10 @@ var ConfigInitDisplay = ({
|
|
|
23596
23682
|
};
|
|
23597
23683
|
|
|
23598
23684
|
// packages/cli/src/ui/components/messages/Todo.tsx
|
|
23599
|
-
var
|
|
23685
|
+
var import_react82 = __toESM(require_react(), 1);
|
|
23600
23686
|
|
|
23601
23687
|
// packages/cli/src/ui/components/Checklist.tsx
|
|
23602
|
-
var
|
|
23688
|
+
var import_react81 = __toESM(require_react(), 1);
|
|
23603
23689
|
|
|
23604
23690
|
// packages/cli/src/ui/components/ChecklistItem.tsx
|
|
23605
23691
|
var import_jsx_runtime123 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -23650,7 +23736,7 @@ var ChecklistItem = ({
|
|
|
23650
23736
|
// packages/cli/src/ui/components/Checklist.tsx
|
|
23651
23737
|
var import_jsx_runtime124 = __toESM(require_jsx_runtime(), 1);
|
|
23652
23738
|
var ChecklistTitleDisplay = ({ title, items, toggleHint }) => {
|
|
23653
|
-
const score = (0,
|
|
23739
|
+
const score = (0, import_react81.useMemo)(() => {
|
|
23654
23740
|
let total = 0;
|
|
23655
23741
|
let completed = 0;
|
|
23656
23742
|
for (const item of items) {
|
|
@@ -23687,11 +23773,11 @@ var Checklist = ({
|
|
|
23687
23773
|
isExpanded,
|
|
23688
23774
|
toggleHint
|
|
23689
23775
|
}) => {
|
|
23690
|
-
const inProgress = (0,
|
|
23776
|
+
const inProgress = (0, import_react81.useMemo)(
|
|
23691
23777
|
() => items.find((item) => item.status === "in_progress") || null,
|
|
23692
23778
|
[items]
|
|
23693
23779
|
);
|
|
23694
|
-
const hasActiveItems = (0,
|
|
23780
|
+
const hasActiveItems = (0, import_react81.useMemo)(
|
|
23695
23781
|
() => items.some(
|
|
23696
23782
|
(item) => item.status === "pending" || item.status === "in_progress"
|
|
23697
23783
|
),
|
|
@@ -23739,7 +23825,7 @@ var Checklist = ({
|
|
|
23739
23825
|
var import_jsx_runtime125 = __toESM(require_jsx_runtime(), 1);
|
|
23740
23826
|
var TodoTray = () => {
|
|
23741
23827
|
const uiState = useUIState();
|
|
23742
|
-
const todos = (0,
|
|
23828
|
+
const todos = (0, import_react82.useMemo)(() => {
|
|
23743
23829
|
for (let i = uiState.history.length - 1; i >= 0; i--) {
|
|
23744
23830
|
const entry = uiState.history[i];
|
|
23745
23831
|
if (entry.type !== "tool_group") {
|
|
@@ -23755,7 +23841,7 @@ var TodoTray = () => {
|
|
|
23755
23841
|
}
|
|
23756
23842
|
return null;
|
|
23757
23843
|
}, [uiState.history]);
|
|
23758
|
-
const checklistItems = (0,
|
|
23844
|
+
const checklistItems = (0, import_react82.useMemo)(() => {
|
|
23759
23845
|
if (!todos || !todos.todos) {
|
|
23760
23846
|
return [];
|
|
23761
23847
|
}
|
|
@@ -23788,10 +23874,10 @@ var Composer = ({ isFocused = true }) => {
|
|
|
23788
23874
|
const config = useConfig();
|
|
23789
23875
|
const { vimEnabled, vimMode } = useVimMode();
|
|
23790
23876
|
const isScreenReaderEnabled = use_is_screen_reader_enabled_default();
|
|
23791
|
-
const { columns: terminalWidth } = useTerminalSize();
|
|
23877
|
+
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
23792
23878
|
const isNarrow = isNarrowWidth(terminalWidth);
|
|
23793
|
-
const debugConsoleMaxHeight = Math.floor(Math.max(
|
|
23794
|
-
const [suggestionsVisible, setSuggestionsVisible] = (0,
|
|
23879
|
+
const debugConsoleMaxHeight = Math.floor(Math.max(terminalHeight * 0.2, 5));
|
|
23880
|
+
const [suggestionsVisible, setSuggestionsVisible] = (0, import_react83.useState)(false);
|
|
23795
23881
|
const isAlternateBuffer = useAlternateBuffer();
|
|
23796
23882
|
const showUiDetails = uiState.cleanUiDetailsVisible;
|
|
23797
23883
|
const suggestionsPosition = isAlternateBuffer ? "above" : "below";
|
|
@@ -23803,12 +23889,12 @@ var Composer = ({ isFocused = true }) => {
|
|
|
23803
23889
|
} = useComposerStatus();
|
|
23804
23890
|
const isPassiveShortcutsHelpState = uiState.isInputActive && uiState.streamingState === "idle" && !hasPendingActionRequired;
|
|
23805
23891
|
const { setShortcutsHelpVisible } = uiActions;
|
|
23806
|
-
(0,
|
|
23892
|
+
(0, import_react83.useEffect)(() => {
|
|
23807
23893
|
if (hasPendingActionRequired && !hasPendingToolConfirmation) {
|
|
23808
23894
|
appEvents.emit("scroll-to-bottom" /* ScrollToBottom */);
|
|
23809
23895
|
}
|
|
23810
23896
|
}, [hasPendingActionRequired, hasPendingToolConfirmation]);
|
|
23811
|
-
(0,
|
|
23897
|
+
(0, import_react83.useEffect)(() => {
|
|
23812
23898
|
if (uiState.shortcutsHelpVisible && !isPassiveShortcutsHelpState) {
|
|
23813
23899
|
setShortcutsHelpVisible(false);
|
|
23814
23900
|
}
|
|
@@ -23852,7 +23938,7 @@ var Composer = ({ isFocused = true }) => {
|
|
|
23852
23938
|
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
23853
23939
|
DetailedMessagesDisplay,
|
|
23854
23940
|
{
|
|
23855
|
-
maxHeight:
|
|
23941
|
+
maxHeight: debugConsoleMaxHeight,
|
|
23856
23942
|
width: uiState.terminalWidth,
|
|
23857
23943
|
hasFocus: uiState.showErrorDetails
|
|
23858
23944
|
}
|
|
@@ -23902,11 +23988,11 @@ var ExitWarning = () => {
|
|
|
23902
23988
|
};
|
|
23903
23989
|
|
|
23904
23990
|
// packages/cli/src/ui/hooks/useFlickerDetector.ts
|
|
23905
|
-
var
|
|
23991
|
+
var import_react84 = __toESM(require_react(), 1);
|
|
23906
23992
|
function useFlickerDetector(rootUiRef, terminalHeight) {
|
|
23907
23993
|
const config = useConfig();
|
|
23908
23994
|
const { constrainHeight } = useUIState();
|
|
23909
|
-
(0,
|
|
23995
|
+
(0, import_react84.useEffect)(() => {
|
|
23910
23996
|
if (rootUiRef.current) {
|
|
23911
23997
|
const measurement = measure_element_default(rootUiRef.current);
|
|
23912
23998
|
if (measurement.height > terminalHeight) {
|
|
@@ -23958,10 +24044,10 @@ var CopyModeWarning = () => {
|
|
|
23958
24044
|
};
|
|
23959
24045
|
|
|
23960
24046
|
// packages/cli/src/ui/components/BackgroundTaskDisplay.tsx
|
|
23961
|
-
var
|
|
24047
|
+
var import_react86 = __toESM(require_react(), 1);
|
|
23962
24048
|
|
|
23963
24049
|
// packages/cli/src/ui/hooks/useExecutionLifecycle.ts
|
|
23964
|
-
var
|
|
24050
|
+
var import_react85 = __toESM(require_react(), 1);
|
|
23965
24051
|
import path12 from "node:path";
|
|
23966
24052
|
import os2 from "node:os";
|
|
23967
24053
|
import fs5 from "node:fs";
|
|
@@ -24089,8 +24175,8 @@ ${safeModelContent}
|
|
|
24089
24175
|
});
|
|
24090
24176
|
}
|
|
24091
24177
|
var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, geminiClient, setShellInputFocused, terminalWidth, terminalHeight, activeBackgroundExecutionId, isWaitingForConfirmation) => {
|
|
24092
|
-
const [state, dispatch] = (0,
|
|
24093
|
-
const manager = (0,
|
|
24178
|
+
const [state, dispatch] = (0, import_react85.useReducer)(shellReducer, initialState4);
|
|
24179
|
+
const manager = (0, import_react85.useRef)(null);
|
|
24094
24180
|
if (!manager.current) {
|
|
24095
24181
|
manager.current = {
|
|
24096
24182
|
wasVisibleBeforeForeground: false,
|
|
@@ -24101,7 +24187,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24101
24187
|
}
|
|
24102
24188
|
const m = manager.current;
|
|
24103
24189
|
const activePtyId = state.activeShellPtyId ?? activeBackgroundExecutionId ?? void 0;
|
|
24104
|
-
(0,
|
|
24190
|
+
(0, import_react85.useEffect)(() => {
|
|
24105
24191
|
const isForegroundActive = !!activePtyId || !!isWaitingForConfirmation;
|
|
24106
24192
|
if (isForegroundActive) {
|
|
24107
24193
|
if (m.restoreTimeout) {
|
|
@@ -24131,7 +24217,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24131
24217
|
m,
|
|
24132
24218
|
dispatch
|
|
24133
24219
|
]);
|
|
24134
|
-
(0,
|
|
24220
|
+
(0, import_react85.useEffect)(
|
|
24135
24221
|
() => () => {
|
|
24136
24222
|
for (const unsubscribe of m.subscriptions.values()) {
|
|
24137
24223
|
unsubscribe();
|
|
@@ -24140,7 +24226,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24140
24226
|
},
|
|
24141
24227
|
[m]
|
|
24142
24228
|
);
|
|
24143
|
-
const toggleBackgroundTasks = (0,
|
|
24229
|
+
const toggleBackgroundTasks = (0, import_react85.useCallback)(() => {
|
|
24144
24230
|
if (state.backgroundTasks.size > 0) {
|
|
24145
24231
|
const willBeVisible = !state.isBackgroundTaskVisible;
|
|
24146
24232
|
dispatch({ type: "TOGGLE_VISIBILITY" });
|
|
@@ -24172,7 +24258,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24172
24258
|
m,
|
|
24173
24259
|
dispatch
|
|
24174
24260
|
]);
|
|
24175
|
-
const backgroundCurrentExecution = (0,
|
|
24261
|
+
const backgroundCurrentExecution = (0, import_react85.useCallback)(() => {
|
|
24176
24262
|
const pidToBackground = state.activeShellPtyId ?? activeBackgroundExecutionId;
|
|
24177
24263
|
if (pidToBackground) {
|
|
24178
24264
|
m.backgroundedPids.add(pidToBackground);
|
|
@@ -24188,7 +24274,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24188
24274
|
}
|
|
24189
24275
|
}
|
|
24190
24276
|
}, [state.activeShellPtyId, activeBackgroundExecutionId, m]);
|
|
24191
|
-
const dismissBackgroundTask = (0,
|
|
24277
|
+
const dismissBackgroundTask = (0, import_react85.useCallback)(
|
|
24192
24278
|
async (pid) => {
|
|
24193
24279
|
const shell = state.backgroundTasks.get(pid);
|
|
24194
24280
|
if (shell) {
|
|
@@ -24206,7 +24292,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24206
24292
|
},
|
|
24207
24293
|
[state.backgroundTasks, dispatch, m]
|
|
24208
24294
|
);
|
|
24209
|
-
const registerBackgroundTask = (0,
|
|
24295
|
+
const registerBackgroundTask = (0, import_react85.useCallback)(
|
|
24210
24296
|
(pid, command, initialOutput, completionBehavior) => {
|
|
24211
24297
|
m.backgroundedPids.add(pid);
|
|
24212
24298
|
dispatch({
|
|
@@ -24266,7 +24352,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24266
24352
|
},
|
|
24267
24353
|
[dispatch, m]
|
|
24268
24354
|
);
|
|
24269
|
-
(0,
|
|
24355
|
+
(0, import_react85.useEffect)(() => {
|
|
24270
24356
|
const listener = (info) => {
|
|
24271
24357
|
if (m.backgroundedPids.has(info.executionId)) {
|
|
24272
24358
|
return;
|
|
@@ -24283,7 +24369,7 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
|
|
|
24283
24369
|
ExecutionLifecycleService.offBackground(listener);
|
|
24284
24370
|
};
|
|
24285
24371
|
}, [registerBackgroundTask, m]);
|
|
24286
|
-
const handleShellCommand = (0,
|
|
24372
|
+
const handleShellCommand = (0, import_react85.useCallback)(
|
|
24287
24373
|
(rawQuery, abortSignal) => {
|
|
24288
24374
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
24289
24375
|
return false;
|
|
@@ -24608,21 +24694,21 @@ var BackgroundTaskDisplay = ({
|
|
|
24608
24694
|
setIsBackgroundTaskListOpen
|
|
24609
24695
|
} = useUIActions();
|
|
24610
24696
|
const activeShell = shells.get(activePid);
|
|
24611
|
-
const [output, setOutput] = (0,
|
|
24697
|
+
const [output, setOutput] = (0, import_react86.useState)(
|
|
24612
24698
|
activeShell?.output || ""
|
|
24613
24699
|
);
|
|
24614
|
-
const [highlightedPid, setHighlightedPid] = (0,
|
|
24700
|
+
const [highlightedPid, setHighlightedPid] = (0, import_react86.useState)(
|
|
24615
24701
|
activePid
|
|
24616
24702
|
);
|
|
24617
|
-
const outputRef = (0,
|
|
24618
|
-
const subscribedRef = (0,
|
|
24619
|
-
(0,
|
|
24703
|
+
const outputRef = (0, import_react86.useRef)(null);
|
|
24704
|
+
const subscribedRef = (0, import_react86.useRef)(false);
|
|
24705
|
+
(0, import_react86.useEffect)(() => {
|
|
24620
24706
|
if (!activePid) return;
|
|
24621
24707
|
const ptyWidth = Math.max(1, width - BORDER_WIDTH - CONTENT_PADDING_X * 2);
|
|
24622
24708
|
const ptyHeight = Math.max(1, height - TOTAL_OVERHEAD_HEIGHT);
|
|
24623
24709
|
ShellExecutionService.resizePty(activePid, ptyWidth, ptyHeight);
|
|
24624
24710
|
}, [activePid, width, height]);
|
|
24625
|
-
(0,
|
|
24711
|
+
(0, import_react86.useEffect)(() => {
|
|
24626
24712
|
if (!activePid) {
|
|
24627
24713
|
setOutput("");
|
|
24628
24714
|
return;
|
|
@@ -24653,7 +24739,7 @@ var BackgroundTaskDisplay = ({
|
|
|
24653
24739
|
subscribedRef.current = false;
|
|
24654
24740
|
};
|
|
24655
24741
|
}, [activePid, shells]);
|
|
24656
|
-
(0,
|
|
24742
|
+
(0, import_react86.useEffect)(() => {
|
|
24657
24743
|
if (isListOpenProp) {
|
|
24658
24744
|
setHighlightedPid(activePid);
|
|
24659
24745
|
}
|
|
@@ -25074,12 +25160,12 @@ var App = () => {
|
|
|
25074
25160
|
import process12 from "node:process";
|
|
25075
25161
|
|
|
25076
25162
|
// packages/cli/src/ui/hooks/useMemoryMonitor.ts
|
|
25077
|
-
var
|
|
25163
|
+
var import_react87 = __toESM(require_react(), 1);
|
|
25078
25164
|
import process6 from "node:process";
|
|
25079
25165
|
var MEMORY_WARNING_THRESHOLD = 7 * 1024 * 1024 * 1024;
|
|
25080
25166
|
var MEMORY_CHECK_INTERVAL = 60 * 1e3;
|
|
25081
25167
|
var useMemoryMonitor = ({ addItem }) => {
|
|
25082
|
-
(0,
|
|
25168
|
+
(0, import_react87.useEffect)(() => {
|
|
25083
25169
|
const intervalId = setInterval(() => {
|
|
25084
25170
|
const usage = process6.memoryUsage().rss;
|
|
25085
25171
|
if (usage > MEMORY_WARNING_THRESHOLD) {
|
|
@@ -25098,17 +25184,17 @@ var useMemoryMonitor = ({ addItem }) => {
|
|
|
25098
25184
|
};
|
|
25099
25185
|
|
|
25100
25186
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
25101
|
-
var
|
|
25187
|
+
var import_react89 = __toESM(require_react(), 1);
|
|
25102
25188
|
import process7 from "node:process";
|
|
25103
25189
|
|
|
25104
25190
|
// packages/cli/src/ui/contexts/TerminalContext.tsx
|
|
25105
|
-
var
|
|
25191
|
+
var import_react88 = __toESM(require_react(), 1);
|
|
25106
25192
|
var import_jsx_runtime134 = __toESM(require_jsx_runtime(), 1);
|
|
25107
|
-
var TerminalContext = (0,
|
|
25193
|
+
var TerminalContext = (0, import_react88.createContext)(
|
|
25108
25194
|
void 0
|
|
25109
25195
|
);
|
|
25110
25196
|
function useTerminalContext() {
|
|
25111
|
-
const context = (0,
|
|
25197
|
+
const context = (0, import_react88.useContext)(TerminalContext);
|
|
25112
25198
|
if (!context) {
|
|
25113
25199
|
throw new Error(
|
|
25114
25200
|
"useTerminalContext must be used within a TerminalProvider"
|
|
@@ -25119,21 +25205,21 @@ function useTerminalContext() {
|
|
|
25119
25205
|
function TerminalProvider({ children }) {
|
|
25120
25206
|
const { stdin } = use_stdin_default();
|
|
25121
25207
|
const { stdout } = use_stdout_default();
|
|
25122
|
-
const subscribers = (0,
|
|
25123
|
-
const bufferRef = (0,
|
|
25124
|
-
const subscribe2 = (0,
|
|
25208
|
+
const subscribers = (0, import_react88.useRef)(/* @__PURE__ */ new Set()).current;
|
|
25209
|
+
const bufferRef = (0, import_react88.useRef)("");
|
|
25210
|
+
const subscribe2 = (0, import_react88.useCallback)(
|
|
25125
25211
|
(handler) => {
|
|
25126
25212
|
subscribers.add(handler);
|
|
25127
25213
|
},
|
|
25128
25214
|
[subscribers]
|
|
25129
25215
|
);
|
|
25130
|
-
const unsubscribe = (0,
|
|
25216
|
+
const unsubscribe = (0, import_react88.useCallback)(
|
|
25131
25217
|
(handler) => {
|
|
25132
25218
|
subscribers.delete(handler);
|
|
25133
25219
|
},
|
|
25134
25220
|
[subscribers]
|
|
25135
25221
|
);
|
|
25136
|
-
const queryTerminalBackground = (0,
|
|
25222
|
+
const queryTerminalBackground = (0, import_react88.useCallback)(
|
|
25137
25223
|
async () => new Promise((resolve3) => {
|
|
25138
25224
|
const handler = () => {
|
|
25139
25225
|
unsubscribe(handler);
|
|
@@ -25148,7 +25234,7 @@ function TerminalProvider({ children }) {
|
|
|
25148
25234
|
}),
|
|
25149
25235
|
[stdout, subscribe2, unsubscribe]
|
|
25150
25236
|
);
|
|
25151
|
-
(0,
|
|
25237
|
+
(0, import_react88.useEffect)(() => {
|
|
25152
25238
|
const handleData = (data) => {
|
|
25153
25239
|
bufferRef.current += typeof data === "string" ? data : data.toString("utf-8");
|
|
25154
25240
|
const match = bufferRef.current.match(
|
|
@@ -25184,9 +25270,9 @@ function TerminalProvider({ children }) {
|
|
|
25184
25270
|
|
|
25185
25271
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
25186
25272
|
var useThemeCommand = (loadedSettings, setThemeError, addItem, initialThemeError, refreshStatic) => {
|
|
25187
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
25273
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react89.useState)(!!initialThemeError);
|
|
25188
25274
|
const { queryTerminalBackground } = useTerminalContext();
|
|
25189
|
-
const openThemeDialog = (0,
|
|
25275
|
+
const openThemeDialog = (0, import_react89.useCallback)(async () => {
|
|
25190
25276
|
if (process7.env["NO_COLOR"]) {
|
|
25191
25277
|
addItem(
|
|
25192
25278
|
{
|
|
@@ -25200,7 +25286,7 @@ var useThemeCommand = (loadedSettings, setThemeError, addItem, initialThemeError
|
|
|
25200
25286
|
await queryTerminalBackground();
|
|
25201
25287
|
setIsThemeDialogOpen(true);
|
|
25202
25288
|
}, [addItem, queryTerminalBackground]);
|
|
25203
|
-
const applyTheme = (0,
|
|
25289
|
+
const applyTheme = (0, import_react89.useCallback)(
|
|
25204
25290
|
(themeName) => {
|
|
25205
25291
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
25206
25292
|
setIsThemeDialogOpen(true);
|
|
@@ -25211,17 +25297,17 @@ var useThemeCommand = (loadedSettings, setThemeError, addItem, initialThemeError
|
|
|
25211
25297
|
},
|
|
25212
25298
|
[setThemeError]
|
|
25213
25299
|
);
|
|
25214
|
-
const handleThemeHighlight = (0,
|
|
25300
|
+
const handleThemeHighlight = (0, import_react89.useCallback)(
|
|
25215
25301
|
(themeName) => {
|
|
25216
25302
|
applyTheme(themeName);
|
|
25217
25303
|
},
|
|
25218
25304
|
[applyTheme]
|
|
25219
25305
|
);
|
|
25220
|
-
const closeThemeDialog = (0,
|
|
25306
|
+
const closeThemeDialog = (0, import_react89.useCallback)(() => {
|
|
25221
25307
|
applyTheme(loadedSettings.merged.ui.theme);
|
|
25222
25308
|
setIsThemeDialogOpen(false);
|
|
25223
25309
|
}, [applyTheme, loadedSettings]);
|
|
25224
|
-
const handleThemeSelect = (0,
|
|
25310
|
+
const handleThemeSelect = (0, import_react89.useCallback)(
|
|
25225
25311
|
async (themeName, scope) => {
|
|
25226
25312
|
try {
|
|
25227
25313
|
const mergedCustomThemes = {
|
|
@@ -25258,7 +25344,7 @@ var useThemeCommand = (loadedSettings, setThemeError, addItem, initialThemeError
|
|
|
25258
25344
|
};
|
|
25259
25345
|
|
|
25260
25346
|
// packages/cli/src/ui/hooks/useQuotaAndFallback.ts
|
|
25261
|
-
var
|
|
25347
|
+
var import_react90 = __toESM(require_react(), 1);
|
|
25262
25348
|
|
|
25263
25349
|
// packages/cli/src/ui/hooks/creditsFlowHandler.ts
|
|
25264
25350
|
async function handleCreditsFlow(args) {
|
|
@@ -25456,13 +25542,13 @@ function useQuotaAndFallback({
|
|
|
25456
25542
|
onShowAuthSelection,
|
|
25457
25543
|
errorVerbosity = "full"
|
|
25458
25544
|
}) {
|
|
25459
|
-
const [proQuotaRequest, setProQuotaRequest] = (0,
|
|
25460
|
-
const [validationRequest, setValidationRequest] = (0,
|
|
25461
|
-
const [overageMenuRequest, setOverageMenuRequest] = (0,
|
|
25462
|
-
const [emptyWalletRequest, setEmptyWalletRequest] = (0,
|
|
25463
|
-
const isDialogPending = (0,
|
|
25464
|
-
const isValidationPending = (0,
|
|
25465
|
-
(0,
|
|
25545
|
+
const [proQuotaRequest, setProQuotaRequest] = (0, import_react90.useState)(null);
|
|
25546
|
+
const [validationRequest, setValidationRequest] = (0, import_react90.useState)(null);
|
|
25547
|
+
const [overageMenuRequest, setOverageMenuRequest] = (0, import_react90.useState)(null);
|
|
25548
|
+
const [emptyWalletRequest, setEmptyWalletRequest] = (0, import_react90.useState)(null);
|
|
25549
|
+
const isDialogPending = (0, import_react90.useRef)(false);
|
|
25550
|
+
const isValidationPending = (0, import_react90.useRef)(false);
|
|
25551
|
+
(0, import_react90.useEffect)(() => {
|
|
25466
25552
|
const fallbackHandler = async (failedModel, fallbackModel, error) => {
|
|
25467
25553
|
const contentGeneratorConfig = config.getContentGeneratorConfig();
|
|
25468
25554
|
let message;
|
|
@@ -25588,7 +25674,7 @@ function useQuotaAndFallback({
|
|
|
25588
25674
|
onShowAuthSelection,
|
|
25589
25675
|
errorVerbosity
|
|
25590
25676
|
]);
|
|
25591
|
-
(0,
|
|
25677
|
+
(0, import_react90.useEffect)(() => {
|
|
25592
25678
|
const validationHandler = async (validationLink, validationDescription, learnMoreUrl) => {
|
|
25593
25679
|
if (isValidationPending.current) {
|
|
25594
25680
|
return "cancel";
|
|
@@ -25608,7 +25694,7 @@ function useQuotaAndFallback({
|
|
|
25608
25694
|
};
|
|
25609
25695
|
config.setValidationHandler(validationHandler);
|
|
25610
25696
|
}, [config]);
|
|
25611
|
-
const handleProQuotaChoice = (0,
|
|
25697
|
+
const handleProQuotaChoice = (0, import_react90.useCallback)(
|
|
25612
25698
|
(choice) => {
|
|
25613
25699
|
if (!proQuotaRequest) return;
|
|
25614
25700
|
const intent = choice;
|
|
@@ -25631,7 +25717,7 @@ function useQuotaAndFallback({
|
|
|
25631
25717
|
},
|
|
25632
25718
|
[proQuotaRequest, historyManager, config, setModelSwitchedFromQuotaError]
|
|
25633
25719
|
);
|
|
25634
|
-
const handleValidationChoice = (0,
|
|
25720
|
+
const handleValidationChoice = (0, import_react90.useCallback)(
|
|
25635
25721
|
(choice) => {
|
|
25636
25722
|
if (!isValidationPending.current || !validationRequest) return;
|
|
25637
25723
|
isValidationPending.current = false;
|
|
@@ -25643,14 +25729,14 @@ function useQuotaAndFallback({
|
|
|
25643
25729
|
},
|
|
25644
25730
|
[validationRequest, onShowAuthSelection]
|
|
25645
25731
|
);
|
|
25646
|
-
const handleOverageMenuChoice = (0,
|
|
25732
|
+
const handleOverageMenuChoice = (0, import_react90.useCallback)(
|
|
25647
25733
|
(choice) => {
|
|
25648
25734
|
if (!overageMenuRequest) return;
|
|
25649
25735
|
overageMenuRequest.resolve(choice);
|
|
25650
25736
|
},
|
|
25651
25737
|
[overageMenuRequest]
|
|
25652
25738
|
);
|
|
25653
|
-
const handleEmptyWalletChoice = (0,
|
|
25739
|
+
const handleEmptyWalletChoice = (0, import_react90.useCallback)(
|
|
25654
25740
|
(choice) => {
|
|
25655
25741
|
if (!emptyWalletRequest) return;
|
|
25656
25742
|
emptyWalletRequest.resolve(choice);
|
|
@@ -25680,7 +25766,7 @@ function getResetTimeMessage(delayMs) {
|
|
|
25680
25766
|
}
|
|
25681
25767
|
|
|
25682
25768
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
25683
|
-
var
|
|
25769
|
+
var import_react91 = __toESM(require_react(), 1);
|
|
25684
25770
|
|
|
25685
25771
|
// packages/cli/src/config/settingPaths.ts
|
|
25686
25772
|
var SettingPaths = {
|
|
@@ -25691,11 +25777,11 @@ var SettingPaths = {
|
|
|
25691
25777
|
|
|
25692
25778
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
25693
25779
|
var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
25694
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
25695
|
-
const openEditorDialog = (0,
|
|
25780
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react91.useState)(false);
|
|
25781
|
+
const openEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25696
25782
|
setIsEditorDialogOpen(true);
|
|
25697
25783
|
}, []);
|
|
25698
|
-
const handleEditorSelect = (0,
|
|
25784
|
+
const handleEditorSelect = (0, import_react91.useCallback)(
|
|
25699
25785
|
(editorType, scope) => {
|
|
25700
25786
|
if (editorType && (!hasValidEditorCommand(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
25701
25787
|
return;
|
|
@@ -25722,7 +25808,7 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25722
25808
|
},
|
|
25723
25809
|
[loadedSettings, setEditorError, addItem]
|
|
25724
25810
|
);
|
|
25725
|
-
const exitEditorDialog = (0,
|
|
25811
|
+
const exitEditorDialog = (0, import_react91.useCallback)(() => {
|
|
25726
25812
|
setIsEditorDialogOpen(false);
|
|
25727
25813
|
coreEvents.emit("editor-selected" /* EditorSelected */, { editor: void 0 });
|
|
25728
25814
|
}, []);
|
|
@@ -25735,13 +25821,13 @@ var useEditorSettings = (loadedSettings, setEditorError, addItem) => {
|
|
|
25735
25821
|
};
|
|
25736
25822
|
|
|
25737
25823
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
25738
|
-
var
|
|
25824
|
+
var import_react92 = __toESM(require_react(), 1);
|
|
25739
25825
|
function useSettingsCommand() {
|
|
25740
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
25741
|
-
const openSettingsDialog = (0,
|
|
25826
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react92.useState)(false);
|
|
25827
|
+
const openSettingsDialog = (0, import_react92.useCallback)(() => {
|
|
25742
25828
|
setIsSettingsDialogOpen(true);
|
|
25743
25829
|
}, []);
|
|
25744
|
-
const closeSettingsDialog = (0,
|
|
25830
|
+
const closeSettingsDialog = (0, import_react92.useCallback)(() => {
|
|
25745
25831
|
setIsSettingsDialogOpen(false);
|
|
25746
25832
|
}, []);
|
|
25747
25833
|
return {
|
|
@@ -25752,13 +25838,13 @@ function useSettingsCommand() {
|
|
|
25752
25838
|
}
|
|
25753
25839
|
|
|
25754
25840
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
25755
|
-
var
|
|
25841
|
+
var import_react93 = __toESM(require_react(), 1);
|
|
25756
25842
|
var useModelCommand = () => {
|
|
25757
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
25758
|
-
const openModelDialog = (0,
|
|
25843
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react93.useState)(false);
|
|
25844
|
+
const openModelDialog = (0, import_react93.useCallback)(() => {
|
|
25759
25845
|
setIsModelDialogOpen(true);
|
|
25760
25846
|
}, []);
|
|
25761
|
-
const closeModelDialog = (0,
|
|
25847
|
+
const closeModelDialog = (0, import_react93.useCallback)(() => {
|
|
25762
25848
|
setIsModelDialogOpen(false);
|
|
25763
25849
|
}, []);
|
|
25764
25850
|
return {
|
|
@@ -25769,13 +25855,13 @@ var useModelCommand = () => {
|
|
|
25769
25855
|
};
|
|
25770
25856
|
|
|
25771
25857
|
// packages/cli/src/ui/hooks/useVoiceModelCommand.ts
|
|
25772
|
-
var
|
|
25858
|
+
var import_react94 = __toESM(require_react(), 1);
|
|
25773
25859
|
var useVoiceModelCommand = () => {
|
|
25774
|
-
const [isVoiceModelDialogOpen, setIsVoiceModelDialogOpen] = (0,
|
|
25775
|
-
const openVoiceModelDialog = (0,
|
|
25860
|
+
const [isVoiceModelDialogOpen, setIsVoiceModelDialogOpen] = (0, import_react94.useState)(false);
|
|
25861
|
+
const openVoiceModelDialog = (0, import_react94.useCallback)(() => {
|
|
25776
25862
|
setIsVoiceModelDialogOpen(true);
|
|
25777
25863
|
}, []);
|
|
25778
|
-
const closeVoiceModelDialog = (0,
|
|
25864
|
+
const closeVoiceModelDialog = (0, import_react94.useCallback)(() => {
|
|
25779
25865
|
setIsVoiceModelDialogOpen(false);
|
|
25780
25866
|
}, []);
|
|
25781
25867
|
return {
|
|
@@ -25786,7 +25872,7 @@ var useVoiceModelCommand = () => {
|
|
|
25786
25872
|
};
|
|
25787
25873
|
|
|
25788
25874
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
25789
|
-
var
|
|
25875
|
+
var import_react95 = __toESM(require_react(), 1);
|
|
25790
25876
|
import process8 from "node:process";
|
|
25791
25877
|
|
|
25792
25878
|
// packages/cli/src/services/SkillCommandLoader.ts
|
|
@@ -25879,41 +25965,41 @@ var LogoutConfirmationDialog = ({ onSelect }) => {
|
|
|
25879
25965
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
25880
25966
|
var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, setIsProcessing, actions, extensionsUpdateState, isConfigInitialized, setBannerVisible, setCustomDialog) => {
|
|
25881
25967
|
const session = useSessionStats();
|
|
25882
|
-
const [commands, setCommands] = (0,
|
|
25968
|
+
const [commands, setCommands] = (0, import_react95.useState)(
|
|
25883
25969
|
void 0
|
|
25884
25970
|
);
|
|
25885
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
25886
|
-
const reloadCommands = (0,
|
|
25971
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react95.useState)(0);
|
|
25972
|
+
const reloadCommands = (0, import_react95.useCallback)(() => {
|
|
25887
25973
|
setReloadTrigger((v) => v + 1);
|
|
25888
25974
|
}, []);
|
|
25889
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
25890
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
25975
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react95.useState)(null);
|
|
25976
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react95.useState)(
|
|
25891
25977
|
/* @__PURE__ */ new Set()
|
|
25892
25978
|
);
|
|
25893
|
-
const gitService = (0,
|
|
25979
|
+
const gitService = (0, import_react95.useMemo)(() => {
|
|
25894
25980
|
if (!config?.getProjectRoot()) {
|
|
25895
25981
|
return;
|
|
25896
25982
|
}
|
|
25897
25983
|
return new GitService(config.getProjectRoot(), config.storage);
|
|
25898
25984
|
}, [config]);
|
|
25899
|
-
const logger = (0,
|
|
25985
|
+
const logger = (0, import_react95.useMemo)(() => {
|
|
25900
25986
|
const l = new Logger(
|
|
25901
25987
|
config?.getSessionId() || "",
|
|
25902
25988
|
config?.storage ?? new Storage(process8.cwd())
|
|
25903
25989
|
);
|
|
25904
25990
|
return l;
|
|
25905
25991
|
}, [config]);
|
|
25906
|
-
const [pendingItem, setPendingItem] = (0,
|
|
25992
|
+
const [pendingItem, setPendingItem] = (0, import_react95.useState)(
|
|
25907
25993
|
null
|
|
25908
25994
|
);
|
|
25909
|
-
const pendingHistoryItems = (0,
|
|
25995
|
+
const pendingHistoryItems = (0, import_react95.useMemo)(() => {
|
|
25910
25996
|
const items = [];
|
|
25911
25997
|
if (pendingItem != null) {
|
|
25912
25998
|
items.push(pendingItem);
|
|
25913
25999
|
}
|
|
25914
26000
|
return items;
|
|
25915
26001
|
}, [pendingItem]);
|
|
25916
|
-
const addMessage = (0,
|
|
26002
|
+
const addMessage = (0, import_react95.useCallback)(
|
|
25917
26003
|
(message) => {
|
|
25918
26004
|
let historyItemContent;
|
|
25919
26005
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -25965,7 +26051,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
25965
26051
|
},
|
|
25966
26052
|
[addItem]
|
|
25967
26053
|
);
|
|
25968
|
-
const commandContext = (0,
|
|
26054
|
+
const commandContext = (0, import_react95.useMemo)(
|
|
25969
26055
|
() => ({
|
|
25970
26056
|
services: {
|
|
25971
26057
|
agentContext: config,
|
|
@@ -26031,7 +26117,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26031
26117
|
setCustomDialog
|
|
26032
26118
|
]
|
|
26033
26119
|
);
|
|
26034
|
-
(0,
|
|
26120
|
+
(0, import_react95.useEffect)(() => {
|
|
26035
26121
|
if (!config) {
|
|
26036
26122
|
return;
|
|
26037
26123
|
}
|
|
@@ -26062,7 +26148,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26062
26148
|
coreEvents.off("extensionsStopping", extensionEventListener);
|
|
26063
26149
|
};
|
|
26064
26150
|
}, [config, reloadCommands]);
|
|
26065
|
-
(0,
|
|
26151
|
+
(0, import_react95.useEffect)(() => {
|
|
26066
26152
|
const controller = new AbortController();
|
|
26067
26153
|
(async () => {
|
|
26068
26154
|
const commandService = await CommandService.create(
|
|
@@ -26083,7 +26169,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26083
26169
|
controller.abort();
|
|
26084
26170
|
};
|
|
26085
26171
|
}, [config, reloadTrigger, isConfigInitialized]);
|
|
26086
|
-
const handleSlashCommand = (0,
|
|
26172
|
+
const handleSlashCommand = (0, import_react95.useCallback)(
|
|
26087
26173
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed, addToHistory = true) => {
|
|
26088
26174
|
if (!commands) {
|
|
26089
26175
|
return false;
|
|
@@ -26172,7 +26258,7 @@ var useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHisto
|
|
|
26172
26258
|
return { type: "handled" };
|
|
26173
26259
|
case "logout":
|
|
26174
26260
|
setCustomDialog(
|
|
26175
|
-
(0,
|
|
26261
|
+
(0, import_react95.createElement)(LogoutConfirmationDialog, {
|
|
26176
26262
|
onSelect: async (choice) => {
|
|
26177
26263
|
setCustomDialog(null);
|
|
26178
26264
|
if (choice === "login" /* LOGIN */) {
|
|
@@ -26486,12 +26572,12 @@ var BEL = "\x07";
|
|
|
26486
26572
|
var SEP = ";";
|
|
26487
26573
|
var isTerminalApp = !isBrowser && process9.env.TERM_PROGRAM === "Apple_Terminal";
|
|
26488
26574
|
var isWindows2 = !isBrowser && process9.platform === "win32";
|
|
26489
|
-
var
|
|
26575
|
+
var isTmux2 = !isBrowser && (process9.env.TERM?.startsWith("screen") || process9.env.TERM?.startsWith("tmux") || process9.env.TMUX !== void 0);
|
|
26490
26576
|
var cwdFunction = isBrowser ? () => {
|
|
26491
26577
|
throw new Error("`process.cwd()` only works in Node.js, not the browser.");
|
|
26492
26578
|
} : process9.cwd;
|
|
26493
26579
|
var wrapOsc = (sequence) => {
|
|
26494
|
-
if (
|
|
26580
|
+
if (isTmux2) {
|
|
26495
26581
|
return "\x1BPtmux;" + sequence.replaceAll("\x1B", "\x1B\x1B") + "\x1B\\";
|
|
26496
26582
|
}
|
|
26497
26583
|
return sequence;
|
|
@@ -26682,10 +26768,10 @@ function computeTerminalTitle({
|
|
|
26682
26768
|
}
|
|
26683
26769
|
|
|
26684
26770
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
26685
|
-
var
|
|
26771
|
+
var import_react96 = __toESM(require_react(), 1);
|
|
26686
26772
|
var useLogger = (config) => {
|
|
26687
|
-
const [logger, setLogger] = (0,
|
|
26688
|
-
(0,
|
|
26773
|
+
const [logger, setLogger] = (0, import_react96.useState)(null);
|
|
26774
|
+
(0, import_react96.useEffect)(() => {
|
|
26689
26775
|
const newLogger = new Logger(config.getSessionId(), config.storage);
|
|
26690
26776
|
newLogger.initialize().then(() => setLogger(newLogger)).catch(() => {
|
|
26691
26777
|
});
|
|
@@ -26694,7 +26780,7 @@ var useLogger = (config) => {
|
|
|
26694
26780
|
};
|
|
26695
26781
|
|
|
26696
26782
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
26697
|
-
var
|
|
26783
|
+
var import_react101 = __toESM(require_react(), 1);
|
|
26698
26784
|
|
|
26699
26785
|
// packages/cli/src/ui/utils/markdownUtilities.ts
|
|
26700
26786
|
var isIndexInsideCodeBlock = (content, indexToTest) => {
|
|
@@ -26755,11 +26841,11 @@ var findLastSafeSplitPoint = (content) => {
|
|
|
26755
26841
|
};
|
|
26756
26842
|
|
|
26757
26843
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
26758
|
-
var
|
|
26844
|
+
var import_react97 = __toESM(require_react(), 1);
|
|
26759
26845
|
var useStateAndRef = (initialValue) => {
|
|
26760
|
-
const [state, setState] =
|
|
26761
|
-
const ref =
|
|
26762
|
-
const setStateInternal =
|
|
26846
|
+
const [state, setState] = import_react97.default.useState(initialValue);
|
|
26847
|
+
const ref = import_react97.default.useRef(initialValue);
|
|
26848
|
+
const setStateInternal = import_react97.default.useCallback(
|
|
26763
26849
|
(newStateOrCallback) => {
|
|
26764
26850
|
let newValue;
|
|
26765
26851
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -26868,21 +26954,21 @@ function mapToDisplay(toolOrTools, options = {}) {
|
|
|
26868
26954
|
}
|
|
26869
26955
|
|
|
26870
26956
|
// packages/cli/src/ui/hooks/useToolScheduler.ts
|
|
26871
|
-
var
|
|
26957
|
+
var import_react98 = __toESM(require_react(), 1);
|
|
26872
26958
|
function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
26873
|
-
const [toolCallsMap, setToolCallsMap] = (0,
|
|
26874
|
-
const [lastToolOutputTime, setLastToolOutputTime] = (0,
|
|
26875
|
-
const [subagentHistoryMap, setSubagentHistoryMap] = (0,
|
|
26876
|
-
const messageBus = (0,
|
|
26877
|
-
const onCompleteRef = (0,
|
|
26878
|
-
(0,
|
|
26959
|
+
const [toolCallsMap, setToolCallsMap] = (0, import_react98.useState)({});
|
|
26960
|
+
const [lastToolOutputTime, setLastToolOutputTime] = (0, import_react98.useState)(0);
|
|
26961
|
+
const [subagentHistoryMap, setSubagentHistoryMap] = (0, import_react98.useState)({});
|
|
26962
|
+
const messageBus = (0, import_react98.useMemo)(() => config.getMessageBus(), [config]);
|
|
26963
|
+
const onCompleteRef = (0, import_react98.useRef)(onComplete);
|
|
26964
|
+
(0, import_react98.useEffect)(() => {
|
|
26879
26965
|
onCompleteRef.current = onComplete;
|
|
26880
26966
|
}, [onComplete]);
|
|
26881
|
-
const getPreferredEditorRef = (0,
|
|
26882
|
-
(0,
|
|
26967
|
+
const getPreferredEditorRef = (0, import_react98.useRef)(getPreferredEditor);
|
|
26968
|
+
(0, import_react98.useEffect)(() => {
|
|
26883
26969
|
getPreferredEditorRef.current = getPreferredEditor;
|
|
26884
26970
|
}, [getPreferredEditor]);
|
|
26885
|
-
const scheduler = (0,
|
|
26971
|
+
const scheduler = (0, import_react98.useMemo)(
|
|
26886
26972
|
() => new Scheduler({
|
|
26887
26973
|
context: config,
|
|
26888
26974
|
messageBus,
|
|
@@ -26891,12 +26977,12 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26891
26977
|
}),
|
|
26892
26978
|
[config, messageBus]
|
|
26893
26979
|
);
|
|
26894
|
-
(0,
|
|
26895
|
-
const internalAdaptToolCalls = (0,
|
|
26980
|
+
(0, import_react98.useEffect)(() => () => scheduler.dispose(), [scheduler]);
|
|
26981
|
+
const internalAdaptToolCalls = (0, import_react98.useCallback)(
|
|
26896
26982
|
(coreCalls, prevTracked) => adaptToolCalls(coreCalls, prevTracked),
|
|
26897
26983
|
[]
|
|
26898
26984
|
);
|
|
26899
|
-
(0,
|
|
26985
|
+
(0, import_react98.useEffect)(() => {
|
|
26900
26986
|
const handler = (event) => {
|
|
26901
26987
|
const isRoot = event.schedulerId === ROOT_SCHEDULER_ID;
|
|
26902
26988
|
const hasExecuting = event.toolCalls.some(
|
|
@@ -26926,7 +27012,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26926
27012
|
messageBus.unsubscribe("tool-calls-update" /* TOOL_CALLS_UPDATE */, handler);
|
|
26927
27013
|
};
|
|
26928
27014
|
}, [messageBus, internalAdaptToolCalls]);
|
|
26929
|
-
(0,
|
|
27015
|
+
(0, import_react98.useEffect)(() => {
|
|
26930
27016
|
const handler = (event) => {
|
|
26931
27017
|
setSubagentHistoryMap((prev) => {
|
|
26932
27018
|
const history = prev[event.subagentName] ?? [];
|
|
@@ -26950,7 +27036,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26950
27036
|
messageBus.unsubscribe("subagent-activity" /* SUBAGENT_ACTIVITY */, handler);
|
|
26951
27037
|
};
|
|
26952
27038
|
}, [messageBus]);
|
|
26953
|
-
const schedule = (0,
|
|
27039
|
+
const schedule = (0, import_react98.useCallback)(
|
|
26954
27040
|
async (request, signal) => {
|
|
26955
27041
|
setToolCallsMap({});
|
|
26956
27042
|
setSubagentHistoryMap({});
|
|
@@ -26960,13 +27046,13 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26960
27046
|
},
|
|
26961
27047
|
[scheduler]
|
|
26962
27048
|
);
|
|
26963
|
-
const cancelAll = (0,
|
|
27049
|
+
const cancelAll = (0, import_react98.useCallback)(
|
|
26964
27050
|
(_signal) => {
|
|
26965
27051
|
scheduler.cancelAll();
|
|
26966
27052
|
},
|
|
26967
27053
|
[scheduler]
|
|
26968
27054
|
);
|
|
26969
|
-
const markToolsAsSubmitted = (0,
|
|
27055
|
+
const markToolsAsSubmitted = (0, import_react98.useCallback)(
|
|
26970
27056
|
(callIdsToMark) => {
|
|
26971
27057
|
setToolCallsMap((prevMap) => {
|
|
26972
27058
|
const nextMap = { ...prevMap };
|
|
@@ -26980,7 +27066,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
26980
27066
|
},
|
|
26981
27067
|
[]
|
|
26982
27068
|
);
|
|
26983
|
-
const toolCalls = (0,
|
|
27069
|
+
const toolCalls = (0, import_react98.useMemo)(() => {
|
|
26984
27070
|
const flattened = Object.values(toolCallsMap).flat();
|
|
26985
27071
|
return flattened.map((tc) => {
|
|
26986
27072
|
let subagentName = tc.request.name;
|
|
@@ -27009,7 +27095,7 @@ function useToolScheduler(onComplete, config, getPreferredEditor) {
|
|
|
27009
27095
|
};
|
|
27010
27096
|
});
|
|
27011
27097
|
}, [toolCallsMap, subagentHistoryMap]);
|
|
27012
|
-
const setToolCallsForDisplay = (0,
|
|
27098
|
+
const setToolCallsForDisplay = (0, import_react98.useCallback)(
|
|
27013
27099
|
(action) => {
|
|
27014
27100
|
setToolCallsMap((prev) => {
|
|
27015
27101
|
const currentFlattened = Object.values(prev).flat();
|
|
@@ -27062,15 +27148,15 @@ import { promises as fs6 } from "node:fs";
|
|
|
27062
27148
|
import path13 from "node:path";
|
|
27063
27149
|
|
|
27064
27150
|
// packages/cli/src/ui/hooks/useAgentStream.ts
|
|
27065
|
-
var
|
|
27151
|
+
var import_react100 = __toESM(require_react(), 1);
|
|
27066
27152
|
|
|
27067
27153
|
// packages/cli/src/ui/hooks/useTurnActivityMonitor.ts
|
|
27068
|
-
var
|
|
27154
|
+
var import_react99 = __toESM(require_react(), 1);
|
|
27069
27155
|
var useTurnActivityMonitor = (streamingState, activePtyId, pendingToolCalls = []) => {
|
|
27070
|
-
const [operationStartTime, setOperationStartTime] = (0,
|
|
27071
|
-
const prevPtyIdRef = (0,
|
|
27072
|
-
const prevStreamingStateRef = (0,
|
|
27073
|
-
(0,
|
|
27156
|
+
const [operationStartTime, setOperationStartTime] = (0, import_react99.useState)(0);
|
|
27157
|
+
const prevPtyIdRef = (0, import_react99.useRef)(void 0);
|
|
27158
|
+
const prevStreamingStateRef = (0, import_react99.useRef)(void 0);
|
|
27159
|
+
(0, import_react99.useEffect)(() => {
|
|
27074
27160
|
const isNowResponding = streamingState === "responding" /* Responding */;
|
|
27075
27161
|
const wasResponding = prevStreamingStateRef.current === "responding" /* Responding */;
|
|
27076
27162
|
const ptyChanged = activePtyId !== prevPtyIdRef.current;
|
|
@@ -27082,7 +27168,7 @@ var useTurnActivityMonitor = (streamingState, activePtyId, pendingToolCalls = []
|
|
|
27082
27168
|
prevPtyIdRef.current = activePtyId;
|
|
27083
27169
|
prevStreamingStateRef.current = streamingState;
|
|
27084
27170
|
}, [streamingState, activePtyId]);
|
|
27085
|
-
const isRedirectionActive = (0,
|
|
27171
|
+
const isRedirectionActive = (0, import_react99.useMemo)(
|
|
27086
27172
|
() => (
|
|
27087
27173
|
// Check active tool calls for run_shell_command
|
|
27088
27174
|
pendingToolCalls.some((tc) => {
|
|
@@ -27142,25 +27228,25 @@ var useAgentStream = ({
|
|
|
27142
27228
|
isShellFocused,
|
|
27143
27229
|
logger
|
|
27144
27230
|
}) => {
|
|
27145
|
-
const [initError] = (0,
|
|
27146
|
-
const [retryStatus] = (0,
|
|
27147
|
-
const [streamingState, setStreamingState] = (0,
|
|
27231
|
+
const [initError] = (0, import_react100.useState)(null);
|
|
27232
|
+
const [retryStatus] = (0, import_react100.useState)(null);
|
|
27233
|
+
const [streamingState, setStreamingState] = (0, import_react100.useState)(
|
|
27148
27234
|
"idle" /* Idle */
|
|
27149
27235
|
);
|
|
27150
|
-
const [thought, setThought] = (0,
|
|
27151
|
-
const [lastOutputTime, setLastOutputTime] = (0,
|
|
27152
|
-
const currentStreamIdRef = (0,
|
|
27153
|
-
const userMessageTimestampRef = (0,
|
|
27154
|
-
const geminiMessageBufferRef = (0,
|
|
27236
|
+
const [thought, setThought] = (0, import_react100.useState)(null);
|
|
27237
|
+
const [lastOutputTime, setLastOutputTime] = (0, import_react100.useState)(Date.now());
|
|
27238
|
+
const currentStreamIdRef = (0, import_react100.useRef)(null);
|
|
27239
|
+
const userMessageTimestampRef = (0, import_react100.useRef)(0);
|
|
27240
|
+
const geminiMessageBufferRef = (0, import_react100.useRef)("");
|
|
27155
27241
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
27156
27242
|
const [trackedTools, trackedToolsRef, setTrackedTools] = useStateAndRef([]);
|
|
27157
|
-
const toolRequestArgsRef = (0,
|
|
27243
|
+
const toolRequestArgsRef = (0, import_react100.useRef)(
|
|
27158
27244
|
/* @__PURE__ */ new Map()
|
|
27159
27245
|
);
|
|
27160
|
-
const cancellationStateRef = (0,
|
|
27246
|
+
const cancellationStateRef = (0, import_react100.useRef)(
|
|
27161
27247
|
"idle" /* Idle */
|
|
27162
27248
|
);
|
|
27163
|
-
const cancelPromiseRef = (0,
|
|
27249
|
+
const cancelPromiseRef = (0, import_react100.useRef)(Promise.resolve());
|
|
27164
27250
|
const [pushedToolCallIds, pushedToolCallIdsRef, setPushedToolCallIds] = useStateAndRef(/* @__PURE__ */ new Set());
|
|
27165
27251
|
const [_isFirstToolInGroup, isFirstToolInGroupRef, setIsFirstToolInGroup] = useStateAndRef(true);
|
|
27166
27252
|
const [_hasEmittedBoxInTurn, hasEmittedBoxInTurnRef, setHasEmittedBoxInTurn] = useStateAndRef(false);
|
|
@@ -27168,13 +27254,13 @@ var useAgentStream = ({
|
|
|
27168
27254
|
const activePtyId = void 0;
|
|
27169
27255
|
const backgroundTaskCount = 0;
|
|
27170
27256
|
const isBackgroundTaskVisible = false;
|
|
27171
|
-
const toggleBackgroundTasks = (0,
|
|
27257
|
+
const toggleBackgroundTasks = (0, import_react100.useCallback)(() => {
|
|
27172
27258
|
}, []);
|
|
27173
27259
|
const backgroundCurrentExecution = void 0;
|
|
27174
|
-
const backgroundTasks = (0,
|
|
27175
|
-
const dismissBackgroundTask = (0,
|
|
27260
|
+
const backgroundTasks = (0, import_react100.useMemo)(() => /* @__PURE__ */ new Map(), []);
|
|
27261
|
+
const dismissBackgroundTask = (0, import_react100.useCallback)(async (_pid) => {
|
|
27176
27262
|
}, []);
|
|
27177
|
-
const pendingToolCalls = (0,
|
|
27263
|
+
const pendingToolCalls = (0, import_react100.useMemo)(
|
|
27178
27264
|
() => trackedTools.map((t) => ({
|
|
27179
27265
|
request: {
|
|
27180
27266
|
name: t.originalRequestName || t.name,
|
|
@@ -27187,15 +27273,15 @@ var useAgentStream = ({
|
|
|
27187
27273
|
})),
|
|
27188
27274
|
[trackedTools]
|
|
27189
27275
|
);
|
|
27190
|
-
const [loopDetectionConfirmationRequest] = (0,
|
|
27191
|
-
const flushPendingText = (0,
|
|
27276
|
+
const [loopDetectionConfirmationRequest] = (0, import_react100.useState)(null);
|
|
27277
|
+
const flushPendingText = (0, import_react100.useCallback)(() => {
|
|
27192
27278
|
if (pendingHistoryItemRef.current) {
|
|
27193
27279
|
addItem(pendingHistoryItemRef.current, userMessageTimestampRef.current);
|
|
27194
27280
|
setPendingHistoryItem(null);
|
|
27195
27281
|
geminiMessageBufferRef.current = "";
|
|
27196
27282
|
}
|
|
27197
27283
|
}, [addItem, pendingHistoryItemRef, setPendingHistoryItem]);
|
|
27198
|
-
const cancelOngoingRequest = (0,
|
|
27284
|
+
const cancelOngoingRequest = (0, import_react100.useCallback)(
|
|
27199
27285
|
async (clearBuffer = true) => {
|
|
27200
27286
|
if (!agent) {
|
|
27201
27287
|
return;
|
|
@@ -27322,13 +27408,13 @@ var useAgentStream = ({
|
|
|
27322
27408
|
trackedToolsRef
|
|
27323
27409
|
]
|
|
27324
27410
|
);
|
|
27325
|
-
const handleApprovalModeChange = (0,
|
|
27411
|
+
const handleApprovalModeChange = (0, import_react100.useCallback)(
|
|
27326
27412
|
async (newApprovalMode) => {
|
|
27327
27413
|
debugLogger.debug(`Approval mode changed to ${newApprovalMode} (stub)`);
|
|
27328
27414
|
},
|
|
27329
27415
|
[]
|
|
27330
27416
|
);
|
|
27331
|
-
const handleEvent = (0,
|
|
27417
|
+
const handleEvent = (0, import_react100.useCallback)(
|
|
27332
27418
|
(event) => {
|
|
27333
27419
|
setLastOutputTime(Date.now());
|
|
27334
27420
|
switch (event.type) {
|
|
@@ -27482,7 +27568,7 @@ var useAgentStream = ({
|
|
|
27482
27568
|
setLastOutputTime
|
|
27483
27569
|
]
|
|
27484
27570
|
);
|
|
27485
|
-
(0,
|
|
27571
|
+
(0, import_react100.useEffect)(() => {
|
|
27486
27572
|
const unsubscribe = agent?.subscribe(handleEvent);
|
|
27487
27573
|
return () => unsubscribe?.();
|
|
27488
27574
|
}, [agent, handleEvent]);
|
|
@@ -27498,7 +27584,7 @@ var useAgentStream = ({
|
|
|
27498
27584
|
isActive: streamingState === "responding" /* Responding */ || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */
|
|
27499
27585
|
}
|
|
27500
27586
|
);
|
|
27501
|
-
const submitQuery = (0,
|
|
27587
|
+
const submitQuery = (0, import_react100.useCallback)(
|
|
27502
27588
|
async (query, options, _prompt_id) => {
|
|
27503
27589
|
if (!agent) return;
|
|
27504
27590
|
const timestamp = Date.now();
|
|
@@ -27530,7 +27616,7 @@ var useAgentStream = ({
|
|
|
27530
27616
|
},
|
|
27531
27617
|
[agent, addItem, logger, startNewPrompt]
|
|
27532
27618
|
);
|
|
27533
|
-
(0,
|
|
27619
|
+
(0, import_react100.useEffect)(() => {
|
|
27534
27620
|
if (trackedTools.length > 0) {
|
|
27535
27621
|
const isNewBatch = !trackedTools.some(
|
|
27536
27622
|
(tc) => pushedToolCallIdsRef.current.has(tc.callId)
|
|
@@ -27550,7 +27636,7 @@ var useAgentStream = ({
|
|
|
27550
27636
|
setIsFirstToolInGroup,
|
|
27551
27637
|
streamingState
|
|
27552
27638
|
]);
|
|
27553
|
-
(0,
|
|
27639
|
+
(0, import_react100.useEffect)(() => {
|
|
27554
27640
|
if (trackedTools.length === 0) return;
|
|
27555
27641
|
const allTerminal = trackedTools.every(
|
|
27556
27642
|
(tc) => tc.status === "success" || tc.status === "error" || tc.status === "cancelled"
|
|
@@ -27607,7 +27693,7 @@ var useAgentStream = ({
|
|
|
27607
27693
|
isShellFocused,
|
|
27608
27694
|
backgroundTasks
|
|
27609
27695
|
]);
|
|
27610
|
-
const pendingToolGroupItems = (0,
|
|
27696
|
+
const pendingToolGroupItems = (0, import_react100.useMemo)(() => {
|
|
27611
27697
|
const remainingTools = trackedTools.filter(
|
|
27612
27698
|
(tc) => !pushedToolCallIdsRef.current.has(tc.callId)
|
|
27613
27699
|
);
|
|
@@ -27663,7 +27749,7 @@ var useAgentStream = ({
|
|
|
27663
27749
|
isShellFocused,
|
|
27664
27750
|
backgroundTasks
|
|
27665
27751
|
]);
|
|
27666
|
-
const pendingHistoryItems = (0,
|
|
27752
|
+
const pendingHistoryItems = (0, import_react100.useMemo)(
|
|
27667
27753
|
() => [pendingHistoryItem, ...pendingToolGroupItems].filter(
|
|
27668
27754
|
(i) => i !== void 0 && i !== null
|
|
27669
27755
|
),
|
|
@@ -27739,41 +27825,41 @@ function calculateStreamingState(isResponding, toolCalls) {
|
|
|
27739
27825
|
return "idle" /* Idle */;
|
|
27740
27826
|
}
|
|
27741
27827
|
var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebugMessage, handleSlashCommand, shellModeActive, getPreferredEditor, onAuthError, _performMemoryRefresh, modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError, onCancelSubmit, setShellInputFocused, terminalWidth, terminalHeight, isShellFocused, consumeUserHint) => {
|
|
27742
|
-
const [initError, setInitError] = (0,
|
|
27743
|
-
const [retryStatus, setRetryStatus] = (0,
|
|
27828
|
+
const [initError, setInitError] = (0, import_react101.useState)(null);
|
|
27829
|
+
const [retryStatus, setRetryStatus] = (0, import_react101.useState)(
|
|
27744
27830
|
null
|
|
27745
27831
|
);
|
|
27746
27832
|
const isLowErrorVerbosity = settings.merged.ui?.errorVerbosity !== "full";
|
|
27747
|
-
const suppressedToolErrorCountRef = (0,
|
|
27748
|
-
const suppressedToolErrorNoteShownRef = (0,
|
|
27749
|
-
const lowVerbosityFailureNoteShownRef = (0,
|
|
27750
|
-
const abortControllerRef = (0,
|
|
27751
|
-
const turnCancelledRef = (0,
|
|
27752
|
-
const pendingToolCallRequestsRef = (0,
|
|
27753
|
-
const activeSchedulePromiseRef = (0,
|
|
27754
|
-
const cancellationStateRef = (0,
|
|
27833
|
+
const suppressedToolErrorCountRef = (0, import_react101.useRef)(0);
|
|
27834
|
+
const suppressedToolErrorNoteShownRef = (0, import_react101.useRef)(false);
|
|
27835
|
+
const lowVerbosityFailureNoteShownRef = (0, import_react101.useRef)(false);
|
|
27836
|
+
const abortControllerRef = (0, import_react101.useRef)(null);
|
|
27837
|
+
const turnCancelledRef = (0, import_react101.useRef)(false);
|
|
27838
|
+
const pendingToolCallRequestsRef = (0, import_react101.useRef)([]);
|
|
27839
|
+
const activeSchedulePromiseRef = (0, import_react101.useRef)(null);
|
|
27840
|
+
const cancellationStateRef = (0, import_react101.useRef)(
|
|
27755
27841
|
"idle" /* Idle */
|
|
27756
27842
|
);
|
|
27757
|
-
const cancelPromiseRef = (0,
|
|
27758
|
-
const activeQueryIdRef = (0,
|
|
27759
|
-
const previousApprovalModeRef = (0,
|
|
27843
|
+
const cancelPromiseRef = (0, import_react101.useRef)(Promise.resolve());
|
|
27844
|
+
const activeQueryIdRef = (0, import_react101.useRef)(null);
|
|
27845
|
+
const previousApprovalModeRef = (0, import_react101.useRef)(
|
|
27760
27846
|
config.getApprovalMode()
|
|
27761
27847
|
);
|
|
27762
27848
|
const [isResponding, isRespondingRef, setIsResponding] = useStateAndRef(false);
|
|
27763
27849
|
const [thought, thoughtRef, setThought] = useStateAndRef(null);
|
|
27764
27850
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
27765
|
-
const [lastGeminiActivityTime, setLastGeminiActivityTime] = (0,
|
|
27851
|
+
const [lastGeminiActivityTime, setLastGeminiActivityTime] = (0, import_react101.useState)(0);
|
|
27766
27852
|
const [pushedToolCallIds, pushedToolCallIdsRef, setPushedToolCallIds] = useStateAndRef(/* @__PURE__ */ new Set());
|
|
27767
27853
|
const [_isFirstToolInGroup, isFirstToolInGroupRef, setIsFirstToolInGroup] = useStateAndRef(true);
|
|
27768
27854
|
const { startNewPrompt, getPromptCount } = useSessionStats();
|
|
27769
27855
|
const logger = useLogger(config);
|
|
27770
|
-
const gitService = (0,
|
|
27856
|
+
const gitService = (0, import_react101.useMemo)(() => {
|
|
27771
27857
|
if (!config.getProjectRoot()) {
|
|
27772
27858
|
return;
|
|
27773
27859
|
}
|
|
27774
27860
|
return new GitService(config.getProjectRoot(), config.storage);
|
|
27775
27861
|
}, [config]);
|
|
27776
|
-
(0,
|
|
27862
|
+
(0, import_react101.useEffect)(() => {
|
|
27777
27863
|
const handleRetryAttempt = (payload) => {
|
|
27778
27864
|
if (turnCancelledRef.current || !isRespondingRef.current) {
|
|
27779
27865
|
return;
|
|
@@ -27859,13 +27945,13 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27859
27945
|
config,
|
|
27860
27946
|
getPreferredEditor
|
|
27861
27947
|
);
|
|
27862
|
-
const activeBackgroundExecutionId = (0,
|
|
27948
|
+
const activeBackgroundExecutionId = (0, import_react101.useMemo)(() => {
|
|
27863
27949
|
const executingBackgroundableTool = toolCalls.find(
|
|
27864
27950
|
isBackgroundableExecutingToolCall
|
|
27865
27951
|
);
|
|
27866
27952
|
return executingBackgroundableTool?.pid;
|
|
27867
27953
|
}, [toolCalls]);
|
|
27868
|
-
const onExec = (0,
|
|
27954
|
+
const onExec = (0, import_react101.useCallback)(
|
|
27869
27955
|
async (done) => {
|
|
27870
27956
|
setIsResponding(true);
|
|
27871
27957
|
await done;
|
|
@@ -27896,11 +27982,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27896
27982
|
terminalHeight,
|
|
27897
27983
|
activeBackgroundExecutionId
|
|
27898
27984
|
);
|
|
27899
|
-
const streamingState = (0,
|
|
27985
|
+
const streamingState = (0, import_react101.useMemo)(
|
|
27900
27986
|
() => calculateStreamingState(isResponding, toolCalls),
|
|
27901
27987
|
[isResponding, toolCalls]
|
|
27902
27988
|
);
|
|
27903
|
-
(0,
|
|
27989
|
+
(0, import_react101.useEffect)(() => {
|
|
27904
27990
|
if (toolCalls.length > 0) {
|
|
27905
27991
|
const isNewBatch = !toolCalls.some(
|
|
27906
27992
|
(tc) => pushedToolCallIdsRef.current.has(tc.request.callId)
|
|
@@ -27920,29 +28006,17 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27920
28006
|
setIsFirstToolInGroup,
|
|
27921
28007
|
streamingState
|
|
27922
28008
|
]);
|
|
27923
|
-
(0,
|
|
28009
|
+
(0, import_react101.useEffect)(() => {
|
|
28010
|
+
const isFinished = (tc) => tc.status === "success" || tc.status === "error" || tc.status === "cancelled";
|
|
27924
28011
|
const toolsToPush = [];
|
|
27925
|
-
for (
|
|
27926
|
-
const tc = toolCalls[i];
|
|
28012
|
+
for (const tc of toolCalls) {
|
|
27927
28013
|
if (pushedToolCallIdsRef.current.has(tc.request.callId)) continue;
|
|
27928
|
-
if (tc
|
|
27929
|
-
const
|
|
27930
|
-
if (
|
|
27931
|
-
|
|
27932
|
-
|
|
27933
|
-
|
|
27934
|
-
if (nextTc.tool?.kind === "agent" /* Agent */) {
|
|
27935
|
-
if (nextTc.status !== "success" && nextTc.status !== "error" && nextTc.status !== "cancelled") {
|
|
27936
|
-
contigAgentsComplete = false;
|
|
27937
|
-
break;
|
|
27938
|
-
}
|
|
27939
|
-
} else {
|
|
27940
|
-
break;
|
|
27941
|
-
}
|
|
27942
|
-
}
|
|
27943
|
-
if (!contigAgentsComplete) {
|
|
27944
|
-
break;
|
|
27945
|
-
}
|
|
28014
|
+
if (isFinished(tc)) {
|
|
28015
|
+
const { groupId } = tc.request;
|
|
28016
|
+
if (groupId !== void 0 && toolCalls.some(
|
|
28017
|
+
(other) => other.request.groupId === groupId && !isFinished(other)
|
|
28018
|
+
)) {
|
|
28019
|
+
break;
|
|
27946
28020
|
}
|
|
27947
28021
|
toolsToPush.push(tc);
|
|
27948
28022
|
} else {
|
|
@@ -27954,21 +28028,16 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
27954
28028
|
const isFirstInThisPush = isFirstToolInGroupRef.current;
|
|
27955
28029
|
const isCompactModeEnabled = settings.merged.ui?.compactToolOutput === true;
|
|
27956
28030
|
const groups = [];
|
|
27957
|
-
let
|
|
28031
|
+
let currentGroupId;
|
|
27958
28032
|
for (const tc of toolsToPush) {
|
|
27959
28033
|
newPushed.add(tc.request.callId);
|
|
27960
|
-
|
|
27961
|
-
|
|
28034
|
+
const { groupId } = tc.request;
|
|
28035
|
+
if (groupId !== void 0 && groupId === currentGroupId) {
|
|
28036
|
+
groups[groups.length - 1].push(tc);
|
|
27962
28037
|
} else {
|
|
27963
|
-
if (currentGroup.length > 0) {
|
|
27964
|
-
groups.push(currentGroup);
|
|
27965
|
-
currentGroup = [];
|
|
27966
|
-
}
|
|
27967
28038
|
groups.push([tc]);
|
|
27968
28039
|
}
|
|
27969
|
-
|
|
27970
|
-
if (currentGroup.length > 0) {
|
|
27971
|
-
groups.push(currentGroup);
|
|
28040
|
+
currentGroupId = groupId;
|
|
27972
28041
|
}
|
|
27973
28042
|
for (let i = 0; i < groups.length; i++) {
|
|
27974
28043
|
const group = groups[i];
|
|
@@ -28020,7 +28089,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28020
28089
|
backgroundTasks,
|
|
28021
28090
|
settings.merged.ui?.compactToolOutput
|
|
28022
28091
|
]);
|
|
28023
|
-
const pendingToolGroupItems = (0,
|
|
28092
|
+
const pendingToolGroupItems = (0, import_react101.useMemo)(() => {
|
|
28024
28093
|
const remainingTools = toolCalls.filter(
|
|
28025
28094
|
(tc) => !pushedToolCallIds.has(tc.request.callId)
|
|
28026
28095
|
);
|
|
@@ -28090,26 +28159,26 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28090
28159
|
backgroundTasks,
|
|
28091
28160
|
settings.merged.ui?.compactToolOutput
|
|
28092
28161
|
]);
|
|
28093
|
-
const lastQueryRef = (0,
|
|
28094
|
-
const lastPromptIdRef = (0,
|
|
28095
|
-
const loopDetectedRef = (0,
|
|
28096
|
-
const autoNudgeAttemptCountRef = (0,
|
|
28162
|
+
const lastQueryRef = (0, import_react101.useRef)(null);
|
|
28163
|
+
const lastPromptIdRef = (0, import_react101.useRef)(null);
|
|
28164
|
+
const loopDetectedRef = (0, import_react101.useRef)(false);
|
|
28165
|
+
const autoNudgeAttemptCountRef = (0, import_react101.useRef)(0);
|
|
28097
28166
|
const MAX_AUTO_NUDGE_ATTEMPTS = 2;
|
|
28098
|
-
const submitQueryRef = (0,
|
|
28167
|
+
const submitQueryRef = (0, import_react101.useRef)(null);
|
|
28099
28168
|
const [
|
|
28100
28169
|
loopDetectionConfirmationRequest,
|
|
28101
28170
|
setLoopDetectionConfirmationRequest
|
|
28102
|
-
] = (0,
|
|
28171
|
+
] = (0, import_react101.useState)(null);
|
|
28103
28172
|
const activePtyId = activeShellPtyId ?? activeBackgroundExecutionId ?? void 0;
|
|
28104
|
-
const prevActiveShellPtyIdRef = (0,
|
|
28105
|
-
(0,
|
|
28173
|
+
const prevActiveShellPtyIdRef = (0, import_react101.useRef)(null);
|
|
28174
|
+
(0, import_react101.useEffect)(() => {
|
|
28106
28175
|
if (turnCancelledRef.current && prevActiveShellPtyIdRef.current !== null && activeShellPtyId === null) {
|
|
28107
28176
|
addItem({ type: "info" /* INFO */, text: "Request cancelled." });
|
|
28108
28177
|
setIsResponding(false);
|
|
28109
28178
|
}
|
|
28110
28179
|
prevActiveShellPtyIdRef.current = activeShellPtyId;
|
|
28111
28180
|
}, [activeShellPtyId, addItem, setIsResponding]);
|
|
28112
|
-
(0,
|
|
28181
|
+
(0, import_react101.useEffect)(() => {
|
|
28113
28182
|
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
28114
28183
|
const lastUserMessageIndex = history.findLastIndex(
|
|
28115
28184
|
(item) => item.type === "user" /* USER */
|
|
@@ -28123,12 +28192,12 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28123
28192
|
}
|
|
28124
28193
|
}
|
|
28125
28194
|
}, [streamingState, config, history]);
|
|
28126
|
-
(0,
|
|
28195
|
+
(0, import_react101.useEffect)(() => {
|
|
28127
28196
|
if (!isResponding) {
|
|
28128
28197
|
setRetryStatus(null);
|
|
28129
28198
|
}
|
|
28130
28199
|
}, [isResponding]);
|
|
28131
|
-
const maybeAddSuppressedToolErrorNote = (0,
|
|
28200
|
+
const maybeAddSuppressedToolErrorNote = (0, import_react101.useCallback)(
|
|
28132
28201
|
(userMessageTimestamp) => {
|
|
28133
28202
|
if (!isLowErrorVerbosity) {
|
|
28134
28203
|
return;
|
|
@@ -28150,7 +28219,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28150
28219
|
},
|
|
28151
28220
|
[addItem, isLowErrorVerbosity]
|
|
28152
28221
|
);
|
|
28153
|
-
const maybeAddLowVerbosityFailureNote = (0,
|
|
28222
|
+
const maybeAddLowVerbosityFailureNote = (0, import_react101.useCallback)(
|
|
28154
28223
|
(userMessageTimestamp) => {
|
|
28155
28224
|
if (!isLowErrorVerbosity || config.getDebugMode()) {
|
|
28156
28225
|
return;
|
|
@@ -28169,7 +28238,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28169
28238
|
},
|
|
28170
28239
|
[addItem, config, isLowErrorVerbosity]
|
|
28171
28240
|
);
|
|
28172
|
-
const cancelOngoingRequest = (0,
|
|
28241
|
+
const cancelOngoingRequest = (0, import_react101.useCallback)(
|
|
28173
28242
|
async (clearBuffer = true) => {
|
|
28174
28243
|
if (turnCancelledRef.current) {
|
|
28175
28244
|
if (clearBuffer) {
|
|
@@ -28367,7 +28436,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28367
28436
|
isActive: streamingState === "responding" /* Responding */ || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */
|
|
28368
28437
|
}
|
|
28369
28438
|
);
|
|
28370
|
-
const prepareQueryForGemini = (0,
|
|
28439
|
+
const prepareQueryForGemini = (0, import_react101.useCallback)(
|
|
28371
28440
|
async (query, userMessageTimestamp, abortSignal, prompt_id) => {
|
|
28372
28441
|
if (turnCancelledRef.current) {
|
|
28373
28442
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -28473,7 +28542,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28473
28542
|
settings
|
|
28474
28543
|
]
|
|
28475
28544
|
);
|
|
28476
|
-
const handleContentEvent = (0,
|
|
28545
|
+
const handleContentEvent = (0, import_react101.useCallback)(
|
|
28477
28546
|
(eventValue, currentGeminiMessageBuffer, userMessageTimestamp) => {
|
|
28478
28547
|
setRetryStatus(null);
|
|
28479
28548
|
if (turnCancelledRef.current) {
|
|
@@ -28514,7 +28583,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28514
28583
|
},
|
|
28515
28584
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
28516
28585
|
);
|
|
28517
|
-
const handleThoughtEvent = (0,
|
|
28586
|
+
const handleThoughtEvent = (0, import_react101.useCallback)(
|
|
28518
28587
|
(eventValue, _userMessageTimestamp) => {
|
|
28519
28588
|
setThought(eventValue);
|
|
28520
28589
|
if (getInlineThinkingMode(settings) === "full") {
|
|
@@ -28526,7 +28595,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28526
28595
|
},
|
|
28527
28596
|
[addItem, settings, setThought]
|
|
28528
28597
|
);
|
|
28529
|
-
const handleUserCancelledEvent = (0,
|
|
28598
|
+
const handleUserCancelledEvent = (0, import_react101.useCallback)(
|
|
28530
28599
|
(userMessageTimestamp) => {
|
|
28531
28600
|
if (turnCancelledRef.current) {
|
|
28532
28601
|
return;
|
|
@@ -28561,7 +28630,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28561
28630
|
setIsResponding
|
|
28562
28631
|
]
|
|
28563
28632
|
);
|
|
28564
|
-
const handleErrorEvent = (0,
|
|
28633
|
+
const handleErrorEvent = (0, import_react101.useCallback)(
|
|
28565
28634
|
(eventValue, userMessageTimestamp) => {
|
|
28566
28635
|
if (pendingHistoryItemRef.current) {
|
|
28567
28636
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28594,7 +28663,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28594
28663
|
maybeAddLowVerbosityFailureNote
|
|
28595
28664
|
]
|
|
28596
28665
|
);
|
|
28597
|
-
const handleInvalidStreamEvent = (0,
|
|
28666
|
+
const handleInvalidStreamEvent = (0, import_react101.useCallback)(
|
|
28598
28667
|
(eventValue, userMessageTimestamp) => {
|
|
28599
28668
|
if (pendingHistoryItemRef.current) {
|
|
28600
28669
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28640,7 +28709,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28640
28709
|
geminiClient
|
|
28641
28710
|
]
|
|
28642
28711
|
);
|
|
28643
|
-
const handleCitationEvent = (0,
|
|
28712
|
+
const handleCitationEvent = (0, import_react101.useCallback)(
|
|
28644
28713
|
(text, userMessageTimestamp) => {
|
|
28645
28714
|
if (!showCitations(settings)) {
|
|
28646
28715
|
return;
|
|
@@ -28653,7 +28722,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28653
28722
|
},
|
|
28654
28723
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, settings]
|
|
28655
28724
|
);
|
|
28656
|
-
const handleFinishedEvent = (0,
|
|
28725
|
+
const handleFinishedEvent = (0, import_react101.useCallback)(
|
|
28657
28726
|
(event, userMessageTimestamp) => {
|
|
28658
28727
|
const finishReason = event.value.reason;
|
|
28659
28728
|
if (!finishReason) {
|
|
@@ -28689,7 +28758,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28689
28758
|
},
|
|
28690
28759
|
[addItem]
|
|
28691
28760
|
);
|
|
28692
|
-
const handleChatCompressionEvent = (0,
|
|
28761
|
+
const handleChatCompressionEvent = (0, import_react101.useCallback)(
|
|
28693
28762
|
(eventValue, userMessageTimestamp) => {
|
|
28694
28763
|
if (pendingHistoryItemRef.current) {
|
|
28695
28764
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28715,14 +28784,14 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28715
28784
|
},
|
|
28716
28785
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, config]
|
|
28717
28786
|
);
|
|
28718
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
28787
|
+
const handleMaxSessionTurnsEvent = (0, import_react101.useCallback)(
|
|
28719
28788
|
() => addItem({
|
|
28720
28789
|
type: "info",
|
|
28721
28790
|
text: `The session has reached the maximum number of turns: ${config.getMaxSessionTurns()}. Please update this limit in your setting.json file.`
|
|
28722
28791
|
}),
|
|
28723
28792
|
[addItem, config]
|
|
28724
28793
|
);
|
|
28725
|
-
const handleContextWindowWillOverflowEvent = (0,
|
|
28794
|
+
const handleContextWindowWillOverflowEvent = (0, import_react101.useCallback)(
|
|
28726
28795
|
(estimatedRequestTokenCount, remainingTokenCount) => {
|
|
28727
28796
|
onCancelSubmit(true);
|
|
28728
28797
|
const limit = tokenLimit(config.getModel());
|
|
@@ -28738,7 +28807,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28738
28807
|
},
|
|
28739
28808
|
[addItem, onCancelSubmit, config]
|
|
28740
28809
|
);
|
|
28741
|
-
const handleChatModelEvent = (0,
|
|
28810
|
+
const handleChatModelEvent = (0, import_react101.useCallback)(
|
|
28742
28811
|
(eventValue, userMessageTimestamp) => {
|
|
28743
28812
|
if (!settings.merged.ui.showModelInfoInChat) {
|
|
28744
28813
|
return;
|
|
@@ -28757,7 +28826,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28757
28826
|
},
|
|
28758
28827
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, settings]
|
|
28759
28828
|
);
|
|
28760
|
-
const handleAgentExecutionStoppedEvent = (0,
|
|
28829
|
+
const handleAgentExecutionStoppedEvent = (0, import_react101.useCallback)(
|
|
28761
28830
|
(reason, userMessageTimestamp, systemMessage, contextCleared) => {
|
|
28762
28831
|
if (pendingHistoryItemRef.current) {
|
|
28763
28832
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28790,7 +28859,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28790
28859
|
maybeAddLowVerbosityFailureNote
|
|
28791
28860
|
]
|
|
28792
28861
|
);
|
|
28793
|
-
const handleAgentExecutionBlockedEvent = (0,
|
|
28862
|
+
const handleAgentExecutionBlockedEvent = (0, import_react101.useCallback)(
|
|
28794
28863
|
(reason, userMessageTimestamp, systemMessage, contextCleared) => {
|
|
28795
28864
|
if (pendingHistoryItemRef.current) {
|
|
28796
28865
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -28821,7 +28890,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28821
28890
|
maybeAddLowVerbosityFailureNote
|
|
28822
28891
|
]
|
|
28823
28892
|
);
|
|
28824
|
-
const processGeminiStreamEvents = (0,
|
|
28893
|
+
const processGeminiStreamEvents = (0, import_react101.useCallback)(
|
|
28825
28894
|
async (stream, userMessageTimestamp, signal, isContinuation, prompt_id) => {
|
|
28826
28895
|
let geminiMessageBuffer = "";
|
|
28827
28896
|
const toolCallRequests = [];
|
|
@@ -28959,7 +29028,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
28959
29028
|
setThought
|
|
28960
29029
|
]
|
|
28961
29030
|
);
|
|
28962
|
-
const submitQuery = (0,
|
|
29031
|
+
const submitQuery = (0, import_react101.useCallback)(
|
|
28963
29032
|
async (query, options, prompt_id) => runInDevTraceSpan(
|
|
28964
29033
|
{
|
|
28965
29034
|
operation: options?.isContinuation ? "system_prompt" /* SystemPrompt */ : "user_prompt" /* UserPrompt */,
|
|
@@ -29125,7 +29194,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29125
29194
|
]
|
|
29126
29195
|
);
|
|
29127
29196
|
submitQueryRef.current = submitQuery;
|
|
29128
|
-
const handleApprovalModeChange = (0,
|
|
29197
|
+
const handleApprovalModeChange = (0, import_react101.useCallback)(
|
|
29129
29198
|
async (newApprovalMode) => {
|
|
29130
29199
|
if (previousApprovalModeRef.current === "plan" /* PLAN */ && newApprovalMode !== "plan" /* PLAN */ && streamingState === "idle" /* Idle */) {
|
|
29131
29200
|
if (geminiClient) {
|
|
@@ -29188,7 +29257,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29188
29257
|
},
|
|
29189
29258
|
[config, toolCalls, geminiClient, streamingState, addItem, onDebugMessage]
|
|
29190
29259
|
);
|
|
29191
|
-
const handleCompletedTools = (0,
|
|
29260
|
+
const handleCompletedTools = (0, import_react101.useCallback)(
|
|
29192
29261
|
async (completedToolCallsFromScheduler) => {
|
|
29193
29262
|
const completedAndReadyToSubmitTools = completedToolCallsFromScheduler.filter(
|
|
29194
29263
|
(tc) => {
|
|
@@ -29361,13 +29430,13 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29361
29430
|
toolCalls
|
|
29362
29431
|
]
|
|
29363
29432
|
);
|
|
29364
|
-
const pendingHistoryItems = (0,
|
|
29433
|
+
const pendingHistoryItems = (0, import_react101.useMemo)(
|
|
29365
29434
|
() => [pendingHistoryItem, ...pendingToolGroupItems].filter(
|
|
29366
29435
|
(i) => i !== void 0 && i !== null
|
|
29367
29436
|
),
|
|
29368
29437
|
[pendingHistoryItem, pendingToolGroupItems]
|
|
29369
29438
|
);
|
|
29370
|
-
(0,
|
|
29439
|
+
(0, import_react101.useEffect)(() => {
|
|
29371
29440
|
const saveRestorableToolCalls = async () => {
|
|
29372
29441
|
if (!config.getCheckpointingEnabled()) {
|
|
29373
29442
|
return;
|
|
@@ -29437,7 +29506,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
|
|
|
29437
29506
|
};
|
|
29438
29507
|
|
|
29439
29508
|
// packages/cli/src/ui/hooks/vim.ts
|
|
29440
|
-
var
|
|
29509
|
+
var import_react102 = __toESM(require_react(), 1);
|
|
29441
29510
|
var DIGIT_MULTIPLIER = 10;
|
|
29442
29511
|
var DEFAULT_COUNT = 1;
|
|
29443
29512
|
var DIGIT_1_TO_9 = /^[1-9]$/;
|
|
@@ -29540,23 +29609,23 @@ var vimReducer = (state, action) => {
|
|
|
29540
29609
|
function useVim(buffer, onSubmit) {
|
|
29541
29610
|
const keyMatchers = useKeyMatchers();
|
|
29542
29611
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
29543
|
-
const [state, dispatch] = (0,
|
|
29544
|
-
const lastEscapeTimestampRef = (0,
|
|
29545
|
-
(0,
|
|
29612
|
+
const [state, dispatch] = (0, import_react102.useReducer)(vimReducer, initialVimState);
|
|
29613
|
+
const lastEscapeTimestampRef = (0, import_react102.useRef)(0);
|
|
29614
|
+
(0, import_react102.useEffect)(() => {
|
|
29546
29615
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
29547
29616
|
}, [vimMode]);
|
|
29548
|
-
const updateMode = (0,
|
|
29617
|
+
const updateMode = (0, import_react102.useCallback)(
|
|
29549
29618
|
(mode) => {
|
|
29550
29619
|
setVimMode(mode);
|
|
29551
29620
|
dispatch({ type: "SET_MODE", mode });
|
|
29552
29621
|
},
|
|
29553
29622
|
[setVimMode]
|
|
29554
29623
|
);
|
|
29555
|
-
const getCurrentCount = (0,
|
|
29624
|
+
const getCurrentCount = (0, import_react102.useCallback)(
|
|
29556
29625
|
() => state.count || DEFAULT_COUNT,
|
|
29557
29626
|
[state.count]
|
|
29558
29627
|
);
|
|
29559
|
-
const checkDoubleEscape = (0,
|
|
29628
|
+
const checkDoubleEscape = (0, import_react102.useCallback)(() => {
|
|
29560
29629
|
const now = Date.now();
|
|
29561
29630
|
const lastEscape = lastEscapeTimestampRef.current;
|
|
29562
29631
|
lastEscapeTimestampRef.current = now;
|
|
@@ -29566,7 +29635,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29566
29635
|
}
|
|
29567
29636
|
return false;
|
|
29568
29637
|
}, []);
|
|
29569
|
-
const executeCommand = (0,
|
|
29638
|
+
const executeCommand = (0, import_react102.useCallback)(
|
|
29570
29639
|
(cmdType, count, char) => {
|
|
29571
29640
|
switch (cmdType) {
|
|
29572
29641
|
case CMD_TYPES.DELETE_WORD_FORWARD: {
|
|
@@ -29765,7 +29834,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29765
29834
|
},
|
|
29766
29835
|
[buffer, updateMode]
|
|
29767
29836
|
);
|
|
29768
|
-
const handleInsertModeInput = (0,
|
|
29837
|
+
const handleInsertModeInput = (0, import_react102.useCallback)(
|
|
29769
29838
|
(normalizedKey) => {
|
|
29770
29839
|
if (keyMatchers["basic.cancel" /* ESCAPE */](normalizedKey)) {
|
|
29771
29840
|
checkDoubleEscape();
|
|
@@ -29799,7 +29868,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29799
29868
|
},
|
|
29800
29869
|
[buffer, dispatch, updateMode, onSubmit, checkDoubleEscape, keyMatchers]
|
|
29801
29870
|
);
|
|
29802
|
-
const normalizeKey = (0,
|
|
29871
|
+
const normalizeKey = (0, import_react102.useCallback)(
|
|
29803
29872
|
(key) => ({
|
|
29804
29873
|
name: key.name || "",
|
|
29805
29874
|
sequence: key.sequence || "",
|
|
@@ -29811,7 +29880,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29811
29880
|
}),
|
|
29812
29881
|
[]
|
|
29813
29882
|
);
|
|
29814
|
-
const handleChangeMovement = (0,
|
|
29883
|
+
const handleChangeMovement = (0, import_react102.useCallback)(
|
|
29815
29884
|
(movement) => {
|
|
29816
29885
|
const count = getCurrentCount();
|
|
29817
29886
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -29832,7 +29901,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29832
29901
|
},
|
|
29833
29902
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
29834
29903
|
);
|
|
29835
|
-
const handleDeleteMovement = (0,
|
|
29904
|
+
const handleDeleteMovement = (0, import_react102.useCallback)(
|
|
29836
29905
|
(movement) => {
|
|
29837
29906
|
const count = getCurrentCount();
|
|
29838
29907
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -29852,7 +29921,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29852
29921
|
},
|
|
29853
29922
|
[getCurrentCount, dispatch, buffer]
|
|
29854
29923
|
);
|
|
29855
|
-
const handleOperatorMotion = (0,
|
|
29924
|
+
const handleOperatorMotion = (0, import_react102.useCallback)(
|
|
29856
29925
|
(operator, motion) => {
|
|
29857
29926
|
const count = getCurrentCount();
|
|
29858
29927
|
const commandMap = {
|
|
@@ -29885,7 +29954,7 @@ function useVim(buffer, onSubmit) {
|
|
|
29885
29954
|
},
|
|
29886
29955
|
[getCurrentCount, executeCommand, dispatch]
|
|
29887
29956
|
);
|
|
29888
|
-
const handleInput = (0,
|
|
29957
|
+
const handleInput = (0, import_react102.useCallback)(
|
|
29889
29958
|
(key) => {
|
|
29890
29959
|
if (!vimEnabled) {
|
|
29891
29960
|
return false;
|
|
@@ -30593,13 +30662,13 @@ function useVim(buffer, onSubmit) {
|
|
|
30593
30662
|
}
|
|
30594
30663
|
|
|
30595
30664
|
// packages/cli/src/ui/hooks/useTimer.ts
|
|
30596
|
-
var
|
|
30665
|
+
var import_react103 = __toESM(require_react(), 1);
|
|
30597
30666
|
var useTimer = (isActive, resetKey) => {
|
|
30598
|
-
const [elapsedTime, setElapsedTime] = (0,
|
|
30599
|
-
const timerRef = (0,
|
|
30600
|
-
const prevResetKeyRef = (0,
|
|
30601
|
-
const prevIsActiveRef = (0,
|
|
30602
|
-
(0,
|
|
30667
|
+
const [elapsedTime, setElapsedTime] = (0, import_react103.useState)(0);
|
|
30668
|
+
const timerRef = (0, import_react103.useRef)(null);
|
|
30669
|
+
const prevResetKeyRef = (0, import_react103.useRef)(resetKey);
|
|
30670
|
+
const prevIsActiveRef = (0, import_react103.useRef)(isActive);
|
|
30671
|
+
(0, import_react103.useEffect)(() => {
|
|
30603
30672
|
let shouldResetTime = false;
|
|
30604
30673
|
if (prevResetKeyRef.current !== resetKey) {
|
|
30605
30674
|
shouldResetTime = true;
|
|
@@ -30636,7 +30705,7 @@ var useTimer = (isActive, resetKey) => {
|
|
|
30636
30705
|
};
|
|
30637
30706
|
|
|
30638
30707
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
30639
|
-
var
|
|
30708
|
+
var import_react104 = __toESM(require_react(), 1);
|
|
30640
30709
|
var LOW_VERBOSITY_RETRY_HINT_ATTEMPT_THRESHOLD = 2;
|
|
30641
30710
|
var useLoadingIndicator = ({
|
|
30642
30711
|
streamingState,
|
|
@@ -30649,7 +30718,7 @@ var useLoadingIndicator = ({
|
|
|
30649
30718
|
maxLength,
|
|
30650
30719
|
pauseUpdates = false
|
|
30651
30720
|
}) => {
|
|
30652
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
30721
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react104.useState)(0);
|
|
30653
30722
|
const isTimerActive = streamingState === "responding" /* Responding */ && !pauseUpdates;
|
|
30654
30723
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
30655
30724
|
const isPhraseCyclingActive = streamingState === "responding" /* Responding */ && !pauseUpdates;
|
|
@@ -30663,9 +30732,9 @@ var useLoadingIndicator = ({
|
|
|
30663
30732
|
customWittyPhrases,
|
|
30664
30733
|
maxLength
|
|
30665
30734
|
);
|
|
30666
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
30667
|
-
const prevStreamingStateRef = (0,
|
|
30668
|
-
(0,
|
|
30735
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react104.useState)(0);
|
|
30736
|
+
const prevStreamingStateRef = (0, import_react104.useRef)(null);
|
|
30737
|
+
(0, import_react104.useEffect)(() => {
|
|
30669
30738
|
if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
30670
30739
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
30671
30740
|
setRetainedElapsedTime(0);
|
|
@@ -30731,24 +30800,24 @@ var useShellInactivityStatus = ({
|
|
|
30731
30800
|
};
|
|
30732
30801
|
|
|
30733
30802
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
30734
|
-
var
|
|
30803
|
+
var import_react105 = __toESM(require_react(), 1);
|
|
30735
30804
|
import * as process10 from "node:process";
|
|
30736
30805
|
var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
30737
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
30738
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
30739
|
-
const [discoveryResults, setDiscoveryResults] = (0,
|
|
30740
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
30741
|
-
const startupMessageSent = (0,
|
|
30742
|
-
const onTrustChangeRef = (0,
|
|
30743
|
-
const addItemRef = (0,
|
|
30744
|
-
const settingsRef = (0,
|
|
30745
|
-
(0,
|
|
30806
|
+
const [isTrusted, setIsTrusted] = (0, import_react105.useState)(void 0);
|
|
30807
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react105.useState)(false);
|
|
30808
|
+
const [discoveryResults, setDiscoveryResults] = (0, import_react105.useState)(null);
|
|
30809
|
+
const [isRestarting, setIsRestarting] = (0, import_react105.useState)(false);
|
|
30810
|
+
const startupMessageSent = (0, import_react105.useRef)(false);
|
|
30811
|
+
const onTrustChangeRef = (0, import_react105.useRef)(onTrustChange);
|
|
30812
|
+
const addItemRef = (0, import_react105.useRef)(addItem);
|
|
30813
|
+
const settingsRef = (0, import_react105.useRef)(settings);
|
|
30814
|
+
(0, import_react105.useEffect)(() => {
|
|
30746
30815
|
onTrustChangeRef.current = onTrustChange;
|
|
30747
30816
|
addItemRef.current = addItem;
|
|
30748
30817
|
settingsRef.current = settings;
|
|
30749
30818
|
}, [onTrustChange, addItem, settings]);
|
|
30750
30819
|
const folderTrust = settings.merged.security.folderTrust.enabled ?? true;
|
|
30751
|
-
(0,
|
|
30820
|
+
(0, import_react105.useEffect)(() => {
|
|
30752
30821
|
let isMounted = true;
|
|
30753
30822
|
const { isTrusted: trusted } = isWorkspaceTrusted(
|
|
30754
30823
|
settingsRef.current.merged
|
|
@@ -30783,7 +30852,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
|
|
|
30783
30852
|
isMounted = false;
|
|
30784
30853
|
};
|
|
30785
30854
|
}, [folderTrust]);
|
|
30786
|
-
const handleFolderTrustSelect = (0,
|
|
30855
|
+
const handleFolderTrustSelect = (0, import_react105.useCallback)(
|
|
30787
30856
|
async (choice) => {
|
|
30788
30857
|
const trustLevelMap = {
|
|
30789
30858
|
["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
|
|
@@ -31758,7 +31827,7 @@ async function checkForUpdates(settings) {
|
|
|
31758
31827
|
}
|
|
31759
31828
|
|
|
31760
31829
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
31761
|
-
var
|
|
31830
|
+
var import_react106 = __toESM(require_react(), 1);
|
|
31762
31831
|
function useMessageQueue({
|
|
31763
31832
|
isConfigInitialized,
|
|
31764
31833
|
streamingState,
|
|
@@ -31766,21 +31835,21 @@ function useMessageQueue({
|
|
|
31766
31835
|
isMcpReady,
|
|
31767
31836
|
isCompressing = false
|
|
31768
31837
|
}) {
|
|
31769
|
-
const [messageQueue2, setMessageQueue] = (0,
|
|
31770
|
-
const addMessage = (0,
|
|
31838
|
+
const [messageQueue2, setMessageQueue] = (0, import_react106.useState)([]);
|
|
31839
|
+
const addMessage = (0, import_react106.useCallback)((message) => {
|
|
31771
31840
|
const trimmedMessage = message.trim();
|
|
31772
31841
|
if (trimmedMessage.length > 0) {
|
|
31773
31842
|
setMessageQueue((prev) => [...prev, trimmedMessage]);
|
|
31774
31843
|
}
|
|
31775
31844
|
}, []);
|
|
31776
|
-
const clearQueue = (0,
|
|
31845
|
+
const clearQueue = (0, import_react106.useCallback)(() => {
|
|
31777
31846
|
setMessageQueue([]);
|
|
31778
31847
|
}, []);
|
|
31779
|
-
const getQueuedMessagesText = (0,
|
|
31848
|
+
const getQueuedMessagesText = (0, import_react106.useCallback)(() => {
|
|
31780
31849
|
if (messageQueue2.length === 0) return "";
|
|
31781
31850
|
return messageQueue2.join("\n\n");
|
|
31782
31851
|
}, [messageQueue2]);
|
|
31783
|
-
const popAllMessages = (0,
|
|
31852
|
+
const popAllMessages = (0, import_react106.useCallback)(() => {
|
|
31784
31853
|
if (messageQueue2.length === 0) {
|
|
31785
31854
|
return void 0;
|
|
31786
31855
|
}
|
|
@@ -31788,7 +31857,7 @@ function useMessageQueue({
|
|
|
31788
31857
|
setMessageQueue([]);
|
|
31789
31858
|
return allMessages;
|
|
31790
31859
|
}, [messageQueue2]);
|
|
31791
|
-
(0,
|
|
31860
|
+
(0, import_react106.useEffect)(() => {
|
|
31792
31861
|
if (isConfigInitialized && streamingState === "idle" /* Idle */ && !isCompressing && isMcpReady && messageQueue2.length > 0) {
|
|
31793
31862
|
const combinedMessage = messageQueue2.join("\n\n");
|
|
31794
31863
|
setMessageQueue([]);
|
|
@@ -31812,15 +31881,15 @@ function useMessageQueue({
|
|
|
31812
31881
|
}
|
|
31813
31882
|
|
|
31814
31883
|
// packages/cli/src/ui/hooks/useMcpStatus.ts
|
|
31815
|
-
var
|
|
31884
|
+
var import_react107 = __toESM(require_react(), 1);
|
|
31816
31885
|
function useMcpStatus(config) {
|
|
31817
|
-
const [discoveryState, setDiscoveryState] = (0,
|
|
31886
|
+
const [discoveryState, setDiscoveryState] = (0, import_react107.useState)(
|
|
31818
31887
|
() => config.getMcpClientManager()?.getDiscoveryState() ?? "not_started" /* NOT_STARTED */
|
|
31819
31888
|
);
|
|
31820
|
-
const [mcpServerCount, setMcpServerCount] = (0,
|
|
31889
|
+
const [mcpServerCount, setMcpServerCount] = (0, import_react107.useState)(
|
|
31821
31890
|
() => config.getMcpClientManager()?.getMcpServerCount() ?? 0
|
|
31822
31891
|
);
|
|
31823
|
-
(0,
|
|
31892
|
+
(0, import_react107.useEffect)(() => {
|
|
31824
31893
|
const onChange = () => {
|
|
31825
31894
|
const manager = config.getMcpClientManager();
|
|
31826
31895
|
if (manager) {
|
|
@@ -31842,7 +31911,7 @@ function useMcpStatus(config) {
|
|
|
31842
31911
|
}
|
|
31843
31912
|
|
|
31844
31913
|
// packages/cli/src/ui/hooks/useApprovalModeIndicator.ts
|
|
31845
|
-
var
|
|
31914
|
+
var import_react108 = __toESM(require_react(), 1);
|
|
31846
31915
|
function useApprovalModeIndicator({
|
|
31847
31916
|
config,
|
|
31848
31917
|
addItem,
|
|
@@ -31852,8 +31921,8 @@ function useApprovalModeIndicator({
|
|
|
31852
31921
|
}) {
|
|
31853
31922
|
const keyMatchers = useKeyMatchers();
|
|
31854
31923
|
const currentConfigValue = config.getApprovalMode();
|
|
31855
|
-
const [showApprovalMode, setApprovalMode] = (0,
|
|
31856
|
-
(0,
|
|
31924
|
+
const [showApprovalMode, setApprovalMode] = (0, import_react108.useState)(currentConfigValue);
|
|
31925
|
+
(0, import_react108.useEffect)(() => {
|
|
31857
31926
|
setApprovalMode(currentConfigValue);
|
|
31858
31927
|
}, [currentConfigValue]);
|
|
31859
31928
|
useKeypress(
|
|
@@ -31922,13 +31991,13 @@ function useApprovalModeIndicator({
|
|
|
31922
31991
|
}
|
|
31923
31992
|
|
|
31924
31993
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
31925
|
-
var
|
|
31994
|
+
var import_react109 = __toESM(require_react(), 1);
|
|
31926
31995
|
import fs7 from "node:fs";
|
|
31927
31996
|
import fsPromises from "node:fs/promises";
|
|
31928
31997
|
function useGitBranchName(cwd5) {
|
|
31929
|
-
const [branchName, setBranchName] = (0,
|
|
31930
|
-
const timeoutRef = (0,
|
|
31931
|
-
const fetchBranchName = (0,
|
|
31998
|
+
const [branchName, setBranchName] = (0, import_react109.useState)(void 0);
|
|
31999
|
+
const timeoutRef = (0, import_react109.useRef)(null);
|
|
32000
|
+
const fetchBranchName = (0, import_react109.useCallback)(async () => {
|
|
31932
32001
|
try {
|
|
31933
32002
|
const { stdout } = await spawnAsync(
|
|
31934
32003
|
"git",
|
|
@@ -31950,7 +32019,7 @@ function useGitBranchName(cwd5) {
|
|
|
31950
32019
|
setBranchName(void 0);
|
|
31951
32020
|
}
|
|
31952
32021
|
}, [cwd5, setBranchName]);
|
|
31953
|
-
(0,
|
|
32022
|
+
(0, import_react109.useEffect)(() => {
|
|
31954
32023
|
void fetchBranchName();
|
|
31955
32024
|
let watcher;
|
|
31956
32025
|
let cancelled = false;
|
|
@@ -31994,7 +32063,7 @@ function useGitBranchName(cwd5) {
|
|
|
31994
32063
|
}
|
|
31995
32064
|
|
|
31996
32065
|
// packages/cli/src/ui/hooks/useSessionResume.ts
|
|
31997
|
-
var
|
|
32066
|
+
var import_react110 = __toESM(require_react(), 1);
|
|
31998
32067
|
function useSessionResume({
|
|
31999
32068
|
config,
|
|
32000
32069
|
historyManager,
|
|
@@ -32004,14 +32073,14 @@ function useSessionResume({
|
|
|
32004
32073
|
resumedSessionData,
|
|
32005
32074
|
isAuthenticating
|
|
32006
32075
|
}) {
|
|
32007
|
-
const [isResuming, setIsResuming] = (0,
|
|
32008
|
-
const historyManagerRef = (0,
|
|
32009
|
-
const refreshStaticRef = (0,
|
|
32010
|
-
(0,
|
|
32076
|
+
const [isResuming, setIsResuming] = (0, import_react110.useState)(false);
|
|
32077
|
+
const historyManagerRef = (0, import_react110.useRef)(historyManager);
|
|
32078
|
+
const refreshStaticRef = (0, import_react110.useRef)(refreshStatic);
|
|
32079
|
+
(0, import_react110.useEffect)(() => {
|
|
32011
32080
|
historyManagerRef.current = historyManager;
|
|
32012
32081
|
refreshStaticRef.current = refreshStatic;
|
|
32013
32082
|
});
|
|
32014
|
-
const loadHistoryForResume = (0,
|
|
32083
|
+
const loadHistoryForResume = (0, import_react110.useCallback)(
|
|
32015
32084
|
async (uiHistory, clientHistory, resumedData) => {
|
|
32016
32085
|
if (!isGeminiClientInitialized) {
|
|
32017
32086
|
return;
|
|
@@ -32041,8 +32110,8 @@ function useSessionResume({
|
|
|
32041
32110
|
},
|
|
32042
32111
|
[config, isGeminiClientInitialized, setQuittingMessages]
|
|
32043
32112
|
);
|
|
32044
|
-
const hasLoadedResumedSession = (0,
|
|
32045
|
-
(0,
|
|
32113
|
+
const hasLoadedResumedSession = (0, import_react110.useRef)(false);
|
|
32114
|
+
(0, import_react110.useEffect)(() => {
|
|
32046
32115
|
if (resumedSessionData && !isAuthenticating && isGeminiClientInitialized && !hasLoadedResumedSession.current) {
|
|
32047
32116
|
hasLoadedResumedSession.current = true;
|
|
32048
32117
|
const historyData = convertSessionToHistoryFormats(
|
|
@@ -32064,7 +32133,7 @@ function useSessionResume({
|
|
|
32064
32133
|
}
|
|
32065
32134
|
|
|
32066
32135
|
// packages/cli/src/ui/hooks/useIncludeDirsTrust.tsx
|
|
32067
|
-
var
|
|
32136
|
+
var import_react111 = __toESM(require_react(), 1);
|
|
32068
32137
|
var import_jsx_runtime136 = __toESM(require_jsx_runtime(), 1);
|
|
32069
32138
|
async function finishAddingDirectories(config, addItem, added, errors) {
|
|
32070
32139
|
if (!config) {
|
|
@@ -32093,7 +32162,7 @@ async function finishAddingDirectories(config, addItem, added, errors) {
|
|
|
32093
32162
|
}
|
|
32094
32163
|
function useIncludeDirsTrust(config, isTrustedFolder, historyManager, setCustomDialog) {
|
|
32095
32164
|
const { addItem } = historyManager;
|
|
32096
|
-
(0,
|
|
32165
|
+
(0, import_react111.useEffect)(() => {
|
|
32097
32166
|
if (isTrustedFolder === void 0 || !config) {
|
|
32098
32167
|
return;
|
|
32099
32168
|
}
|
|
@@ -32176,13 +32245,13 @@ Please use the permissions command to modify their trust level.`
|
|
|
32176
32245
|
}
|
|
32177
32246
|
|
|
32178
32247
|
// packages/cli/src/ui/hooks/useInputHistoryStore.ts
|
|
32179
|
-
var
|
|
32248
|
+
var import_react112 = __toESM(require_react(), 1);
|
|
32180
32249
|
function useInputHistoryStore() {
|
|
32181
|
-
const [inputHistory, setInputHistory] = (0,
|
|
32182
|
-
const [_pastSessionMessages, setPastSessionMessages] = (0,
|
|
32183
|
-
const [_currentSessionMessages, setCurrentSessionMessages] = (0,
|
|
32184
|
-
const [isInitialized, setIsInitialized] = (0,
|
|
32185
|
-
const recalculateHistory = (0,
|
|
32250
|
+
const [inputHistory, setInputHistory] = (0, import_react112.useState)([]);
|
|
32251
|
+
const [_pastSessionMessages, setPastSessionMessages] = (0, import_react112.useState)([]);
|
|
32252
|
+
const [_currentSessionMessages, setCurrentSessionMessages] = (0, import_react112.useState)([]);
|
|
32253
|
+
const [isInitialized, setIsInitialized] = (0, import_react112.useState)(false);
|
|
32254
|
+
const recalculateHistory = (0, import_react112.useCallback)(
|
|
32186
32255
|
(currentSession, pastSession) => {
|
|
32187
32256
|
const combinedMessages = [...currentSession, ...pastSession];
|
|
32188
32257
|
const deduplicatedMessages = [];
|
|
@@ -32198,7 +32267,7 @@ function useInputHistoryStore() {
|
|
|
32198
32267
|
},
|
|
32199
32268
|
[]
|
|
32200
32269
|
);
|
|
32201
|
-
const initializeFromLogger = (0,
|
|
32270
|
+
const initializeFromLogger = (0, import_react112.useCallback)(
|
|
32202
32271
|
async (logger) => {
|
|
32203
32272
|
if (isInitialized || !logger) return;
|
|
32204
32273
|
try {
|
|
@@ -32218,7 +32287,7 @@ function useInputHistoryStore() {
|
|
|
32218
32287
|
},
|
|
32219
32288
|
[isInitialized, recalculateHistory]
|
|
32220
32289
|
);
|
|
32221
|
-
const addInput = (0,
|
|
32290
|
+
const addInput = (0, import_react112.useCallback)(
|
|
32222
32291
|
(input) => {
|
|
32223
32292
|
const trimmedInput = input.trim();
|
|
32224
32293
|
if (!trimmedInput) return;
|
|
@@ -32245,12 +32314,12 @@ function useInputHistoryStore() {
|
|
|
32245
32314
|
}
|
|
32246
32315
|
|
|
32247
32316
|
// packages/cli/src/ui/hooks/useHookDisplayState.ts
|
|
32248
|
-
var
|
|
32317
|
+
var import_react113 = __toESM(require_react(), 1);
|
|
32249
32318
|
var useHookDisplayState = () => {
|
|
32250
|
-
const [activeHooks, setActiveHooks] = (0,
|
|
32251
|
-
const hookStartTimes = (0,
|
|
32252
|
-
const timeouts = (0,
|
|
32253
|
-
(0,
|
|
32319
|
+
const [activeHooks, setActiveHooks] = (0, import_react113.useState)([]);
|
|
32320
|
+
const hookStartTimes = (0, import_react113.useRef)(/* @__PURE__ */ new Map());
|
|
32321
|
+
const timeouts = (0, import_react113.useRef)(/* @__PURE__ */ new Set());
|
|
32322
|
+
(0, import_react113.useEffect)(() => {
|
|
32254
32323
|
const activeTimeouts = timeouts.current;
|
|
32255
32324
|
const startTimes = hookStartTimes.current;
|
|
32256
32325
|
const handleHookStart = (payload) => {
|
|
@@ -32315,7 +32384,7 @@ var useHookDisplayState = () => {
|
|
|
32315
32384
|
};
|
|
32316
32385
|
|
|
32317
32386
|
// packages/cli/src/ui/hooks/useBackgroundTaskManager.ts
|
|
32318
|
-
var
|
|
32387
|
+
var import_react114 = __toESM(require_react(), 1);
|
|
32319
32388
|
function useBackgroundTaskManager({
|
|
32320
32389
|
backgroundTasks,
|
|
32321
32390
|
backgroundTaskCount,
|
|
@@ -32325,9 +32394,9 @@ function useBackgroundTaskManager({
|
|
|
32325
32394
|
setEmbeddedShellFocused,
|
|
32326
32395
|
terminalHeight
|
|
32327
32396
|
}) {
|
|
32328
|
-
const [isBackgroundTaskListOpen, setIsBackgroundTaskListOpen] = (0,
|
|
32329
|
-
const [activeBackgroundTaskPid, setActiveBackgroundTaskPid] = (0,
|
|
32330
|
-
(0,
|
|
32397
|
+
const [isBackgroundTaskListOpen, setIsBackgroundTaskListOpen] = (0, import_react114.useState)(false);
|
|
32398
|
+
const [activeBackgroundTaskPid, setActiveBackgroundTaskPid] = (0, import_react114.useState)(null);
|
|
32399
|
+
(0, import_react114.useEffect)(() => {
|
|
32331
32400
|
if (backgroundTasks.size === 0) {
|
|
32332
32401
|
if (activeBackgroundTaskPid !== null) {
|
|
32333
32402
|
setActiveBackgroundTaskPid(null);
|
|
@@ -32344,7 +32413,7 @@ function useBackgroundTaskManager({
|
|
|
32344
32413
|
backgroundTaskCount,
|
|
32345
32414
|
isBackgroundTaskListOpen
|
|
32346
32415
|
]);
|
|
32347
|
-
(0,
|
|
32416
|
+
(0, import_react114.useEffect)(() => {
|
|
32348
32417
|
if (embeddedShellFocused) {
|
|
32349
32418
|
const hasActiveForegroundShell = !!activePtyId;
|
|
32350
32419
|
const hasVisibleBackgroundTask = isBackgroundTaskVisible && backgroundTasks.size > 0;
|
|
@@ -32360,7 +32429,7 @@ function useBackgroundTaskManager({
|
|
|
32360
32429
|
activePtyId,
|
|
32361
32430
|
setEmbeddedShellFocused
|
|
32362
32431
|
]);
|
|
32363
|
-
const backgroundTaskHeight = (0,
|
|
32432
|
+
const backgroundTaskHeight = (0, import_react114.useMemo)(
|
|
32364
32433
|
() => isBackgroundTaskVisible && backgroundTasks.size > 0 ? Math.max(Math.floor(terminalHeight * 0.3), 5) : 0,
|
|
32365
32434
|
[isBackgroundTaskVisible, backgroundTasks.size, terminalHeight]
|
|
32366
32435
|
);
|
|
@@ -32374,11 +32443,11 @@ function useBackgroundTaskManager({
|
|
|
32374
32443
|
}
|
|
32375
32444
|
|
|
32376
32445
|
// packages/cli/src/ui/hooks/useTerminalTheme.ts
|
|
32377
|
-
var
|
|
32446
|
+
var import_react115 = __toESM(require_react(), 1);
|
|
32378
32447
|
function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
|
|
32379
32448
|
const settings = useSettings();
|
|
32380
32449
|
const { subscribe: subscribe2, unsubscribe, queryTerminalBackground } = useTerminalContext();
|
|
32381
|
-
(0,
|
|
32450
|
+
(0, import_react115.useEffect)(() => {
|
|
32382
32451
|
if (settings.merged.ui.autoThemeSwitching === false) {
|
|
32383
32452
|
return;
|
|
32384
32453
|
}
|
|
@@ -32441,11 +32510,11 @@ function useTerminalTheme(handleThemeSelect, config, refreshStatic) {
|
|
|
32441
32510
|
}
|
|
32442
32511
|
|
|
32443
32512
|
// packages/cli/src/ui/hooks/useTimedMessage.ts
|
|
32444
|
-
var
|
|
32513
|
+
var import_react116 = __toESM(require_react(), 1);
|
|
32445
32514
|
function useTimedMessage(durationMs) {
|
|
32446
|
-
const [message, setMessage] = (0,
|
|
32447
|
-
const timeoutRef = (0,
|
|
32448
|
-
const showMessage = (0,
|
|
32515
|
+
const [message, setMessage] = (0, import_react116.useState)(null);
|
|
32516
|
+
const timeoutRef = (0, import_react116.useRef)(null);
|
|
32517
|
+
const showMessage = (0, import_react116.useCallback)(
|
|
32449
32518
|
(msg) => {
|
|
32450
32519
|
setMessage(msg);
|
|
32451
32520
|
if (timeoutRef.current) {
|
|
@@ -32459,7 +32528,7 @@ function useTimedMessage(durationMs) {
|
|
|
32459
32528
|
},
|
|
32460
32529
|
[durationMs]
|
|
32461
32530
|
);
|
|
32462
|
-
(0,
|
|
32531
|
+
(0, import_react116.useEffect)(
|
|
32463
32532
|
() => () => {
|
|
32464
32533
|
if (timeoutRef.current) {
|
|
32465
32534
|
clearTimeout(timeoutRef.current);
|
|
@@ -32471,17 +32540,17 @@ function useTimedMessage(durationMs) {
|
|
|
32471
32540
|
}
|
|
32472
32541
|
|
|
32473
32542
|
// packages/cli/src/ui/hooks/useSuspend.ts
|
|
32474
|
-
var
|
|
32543
|
+
var import_react117 = __toESM(require_react(), 1);
|
|
32475
32544
|
import process11 from "node:process";
|
|
32476
32545
|
function useSuspend({
|
|
32477
32546
|
handleWarning,
|
|
32478
32547
|
setRawMode,
|
|
32479
32548
|
shouldUseAlternateScreen
|
|
32480
32549
|
}) {
|
|
32481
|
-
const [ctrlZPressCount, setCtrlZPressCount] = (0,
|
|
32482
|
-
const ctrlZTimerRef = (0,
|
|
32483
|
-
const onResumeHandlerRef = (0,
|
|
32484
|
-
(0,
|
|
32550
|
+
const [ctrlZPressCount, setCtrlZPressCount] = (0, import_react117.useState)(0);
|
|
32551
|
+
const ctrlZTimerRef = (0, import_react117.useRef)(null);
|
|
32552
|
+
const onResumeHandlerRef = (0, import_react117.useRef)(null);
|
|
32553
|
+
(0, import_react117.useEffect)(
|
|
32485
32554
|
() => () => {
|
|
32486
32555
|
if (ctrlZTimerRef.current) {
|
|
32487
32556
|
clearTimeout(ctrlZTimerRef.current);
|
|
@@ -32494,7 +32563,7 @@ function useSuspend({
|
|
|
32494
32563
|
},
|
|
32495
32564
|
[]
|
|
32496
32565
|
);
|
|
32497
|
-
(0,
|
|
32566
|
+
(0, import_react117.useEffect)(() => {
|
|
32498
32567
|
if (ctrlZTimerRef.current) {
|
|
32499
32568
|
clearTimeout(ctrlZTimerRef.current);
|
|
32500
32569
|
ctrlZTimerRef.current = null;
|
|
@@ -32560,17 +32629,17 @@ function useSuspend({
|
|
|
32560
32629
|
}, WARNING_PROMPT_DURATION_MS);
|
|
32561
32630
|
}
|
|
32562
32631
|
}, [ctrlZPressCount, handleWarning, setRawMode, shouldUseAlternateScreen]);
|
|
32563
|
-
const handleSuspend = (0,
|
|
32632
|
+
const handleSuspend = (0, import_react117.useCallback)(() => {
|
|
32564
32633
|
setCtrlZPressCount((prev) => prev + 1);
|
|
32565
32634
|
}, []);
|
|
32566
32635
|
return { handleSuspend };
|
|
32567
32636
|
}
|
|
32568
32637
|
|
|
32569
32638
|
// packages/cli/src/ui/hooks/useRunEventNotifications.ts
|
|
32570
|
-
var
|
|
32639
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
32571
32640
|
|
|
32572
32641
|
// packages/cli/src/ui/utils/pendingAttentionNotification.ts
|
|
32573
|
-
var
|
|
32642
|
+
var import_react118 = __toESM(require_react(), 1);
|
|
32574
32643
|
|
|
32575
32644
|
// packages/cli/src/utils/terminalNotifications.ts
|
|
32576
32645
|
var MAX_NOTIFICATION_TITLE_CHARS = 48;
|
|
@@ -32785,7 +32854,7 @@ function useRunEventNotifications({
|
|
|
32785
32854
|
hasConfirmUpdateExtensionRequests,
|
|
32786
32855
|
hasLoopDetectionConfirmationRequest
|
|
32787
32856
|
}) {
|
|
32788
|
-
const pendingAttentionNotification = (0,
|
|
32857
|
+
const pendingAttentionNotification = (0, import_react119.useMemo)(
|
|
32789
32858
|
() => getPendingAttentionNotification(
|
|
32790
32859
|
pendingHistoryItems,
|
|
32791
32860
|
commandConfirmationRequest,
|
|
@@ -32803,11 +32872,11 @@ function useRunEventNotifications({
|
|
|
32803
32872
|
hasLoopDetectionConfirmationRequest
|
|
32804
32873
|
]
|
|
32805
32874
|
);
|
|
32806
|
-
const hadPendingAttentionRef = (0,
|
|
32807
|
-
const previousFocusedRef = (0,
|
|
32808
|
-
const previousStreamingStateRef = (0,
|
|
32809
|
-
const lastSentAttentionNotificationRef = (0,
|
|
32810
|
-
(0,
|
|
32875
|
+
const hadPendingAttentionRef = (0, import_react119.useRef)(false);
|
|
32876
|
+
const previousFocusedRef = (0, import_react119.useRef)(isFocused);
|
|
32877
|
+
const previousStreamingStateRef = (0, import_react119.useRef)(streamingState);
|
|
32878
|
+
const lastSentAttentionNotificationRef = (0, import_react119.useRef)(null);
|
|
32879
|
+
(0, import_react119.useEffect)(() => {
|
|
32811
32880
|
if (!notificationsEnabled) {
|
|
32812
32881
|
return;
|
|
32813
32882
|
}
|
|
@@ -32851,7 +32920,7 @@ function useRunEventNotifications({
|
|
|
32851
32920
|
notificationMethod,
|
|
32852
32921
|
pendingAttentionNotification
|
|
32853
32922
|
]);
|
|
32854
|
-
(0,
|
|
32923
|
+
(0, import_react119.useEffect)(() => {
|
|
32855
32924
|
if (!notificationsEnabled) {
|
|
32856
32925
|
return;
|
|
32857
32926
|
}
|
|
@@ -32881,28 +32950,28 @@ function useRunEventNotifications({
|
|
|
32881
32950
|
}
|
|
32882
32951
|
|
|
32883
32952
|
// packages/cli/src/ui/hooks/useVisibilityToggle.ts
|
|
32884
|
-
var
|
|
32953
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
32885
32954
|
var APPROVAL_MODE_REVEAL_DURATION_MS = 1200;
|
|
32886
32955
|
var FOCUS_UI_ENABLED_STATE_KEY = "focusUiEnabled";
|
|
32887
32956
|
function useVisibilityToggle() {
|
|
32888
|
-
const [focusUiEnabledByDefault] = (0,
|
|
32957
|
+
const [focusUiEnabledByDefault] = (0, import_react120.useState)(
|
|
32889
32958
|
() => persistentState.get(FOCUS_UI_ENABLED_STATE_KEY) === true
|
|
32890
32959
|
);
|
|
32891
|
-
const [cleanUiDetailsVisible, setCleanUiDetailsVisibleState] = (0,
|
|
32960
|
+
const [cleanUiDetailsVisible, setCleanUiDetailsVisibleState] = (0, import_react120.useState)(
|
|
32892
32961
|
!focusUiEnabledByDefault
|
|
32893
32962
|
);
|
|
32894
|
-
const modeRevealTimeoutRef = (0,
|
|
32895
|
-
const cleanUiDetailsPinnedRef = (0,
|
|
32896
|
-
const clearModeRevealTimeout = (0,
|
|
32963
|
+
const modeRevealTimeoutRef = (0, import_react120.useRef)(null);
|
|
32964
|
+
const cleanUiDetailsPinnedRef = (0, import_react120.useRef)(!focusUiEnabledByDefault);
|
|
32965
|
+
const clearModeRevealTimeout = (0, import_react120.useCallback)(() => {
|
|
32897
32966
|
if (modeRevealTimeoutRef.current) {
|
|
32898
32967
|
clearTimeout(modeRevealTimeoutRef.current);
|
|
32899
32968
|
modeRevealTimeoutRef.current = null;
|
|
32900
32969
|
}
|
|
32901
32970
|
}, []);
|
|
32902
|
-
const persistFocusUiPreference = (0,
|
|
32971
|
+
const persistFocusUiPreference = (0, import_react120.useCallback)((isFullUiVisible) => {
|
|
32903
32972
|
persistentState.set(FOCUS_UI_ENABLED_STATE_KEY, !isFullUiVisible);
|
|
32904
32973
|
}, []);
|
|
32905
|
-
const setCleanUiDetailsVisible = (0,
|
|
32974
|
+
const setCleanUiDetailsVisible = (0, import_react120.useCallback)(
|
|
32906
32975
|
(visible) => {
|
|
32907
32976
|
clearModeRevealTimeout();
|
|
32908
32977
|
cleanUiDetailsPinnedRef.current = visible;
|
|
@@ -32911,7 +32980,7 @@ function useVisibilityToggle() {
|
|
|
32911
32980
|
},
|
|
32912
32981
|
[clearModeRevealTimeout, persistFocusUiPreference]
|
|
32913
32982
|
);
|
|
32914
|
-
const toggleCleanUiDetailsVisible = (0,
|
|
32983
|
+
const toggleCleanUiDetailsVisible = (0, import_react120.useCallback)(() => {
|
|
32915
32984
|
clearModeRevealTimeout();
|
|
32916
32985
|
setCleanUiDetailsVisibleState((visible) => {
|
|
32917
32986
|
const nextVisible = !visible;
|
|
@@ -32920,7 +32989,7 @@ function useVisibilityToggle() {
|
|
|
32920
32989
|
return nextVisible;
|
|
32921
32990
|
});
|
|
32922
32991
|
}, [clearModeRevealTimeout, persistFocusUiPreference]);
|
|
32923
|
-
const revealCleanUiDetailsTemporarily = (0,
|
|
32992
|
+
const revealCleanUiDetailsTemporarily = (0, import_react120.useCallback)(
|
|
32924
32993
|
(durationMs = APPROVAL_MODE_REVEAL_DURATION_MS) => {
|
|
32925
32994
|
if (cleanUiDetailsPinnedRef.current) {
|
|
32926
32995
|
return;
|
|
@@ -32936,7 +33005,7 @@ function useVisibilityToggle() {
|
|
|
32936
33005
|
},
|
|
32937
33006
|
[clearModeRevealTimeout]
|
|
32938
33007
|
);
|
|
32939
|
-
(0,
|
|
33008
|
+
(0, import_react120.useEffect)(() => () => clearModeRevealTimeout(), [clearModeRevealTimeout]);
|
|
32940
33009
|
return {
|
|
32941
33010
|
cleanUiDetailsVisible,
|
|
32942
33011
|
setCleanUiDetailsVisible,
|
|
@@ -33000,17 +33069,17 @@ var AppContainer = (props) => {
|
|
|
33000
33069
|
const { reset } = useOverflowActions();
|
|
33001
33070
|
const notificationsEnabled = isNotificationsEnabled(settings);
|
|
33002
33071
|
const notificationMethod = getNotificationMethod(settings);
|
|
33003
|
-
const { setOptions, dumpCurrentFrame, startRecording, stopRecording } = (0,
|
|
33004
|
-
const recordingFilenameRef = (0,
|
|
33072
|
+
const { setOptions, dumpCurrentFrame, startRecording, stopRecording } = (0, import_react121.useContext)(AppContext_default);
|
|
33073
|
+
const recordingFilenameRef = (0, import_react121.useRef)(null);
|
|
33005
33074
|
const historyManager = useHistory({
|
|
33006
33075
|
chatRecordingService: config.getGeminiClient()?.getChatRecordingService()
|
|
33007
33076
|
});
|
|
33008
33077
|
useMemoryMonitor(historyManager);
|
|
33009
33078
|
const isAlternateBuffer = config.getUseAlternateBuffer();
|
|
33010
|
-
const [mouseMode, setMouseMode] = (0,
|
|
33079
|
+
const [mouseMode, setMouseMode] = (0, import_react121.useState)(
|
|
33011
33080
|
() => config.getUseAlternateBuffer()
|
|
33012
33081
|
);
|
|
33013
|
-
(0,
|
|
33082
|
+
(0, import_react121.useEffect)(() => {
|
|
33014
33083
|
setOptions({
|
|
33015
33084
|
stickyHeadersInBackbuffer: mouseMode
|
|
33016
33085
|
});
|
|
@@ -33020,28 +33089,28 @@ var AppContainer = (props) => {
|
|
|
33020
33089
|
disableMouseEvents();
|
|
33021
33090
|
}
|
|
33022
33091
|
}, [mouseMode, setOptions]);
|
|
33023
|
-
const [corgiMode, setCorgiMode] = (0,
|
|
33024
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
33025
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
33026
|
-
const [showPrivacyNotice, setShowPrivacyNotice] = (0,
|
|
33027
|
-
const [themeError, setThemeError] = (0,
|
|
33092
|
+
const [corgiMode, setCorgiMode] = (0, import_react121.useState)(false);
|
|
33093
|
+
const [debugMessage, setDebugMessage] = (0, import_react121.useState)("");
|
|
33094
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react121.useState)(null);
|
|
33095
|
+
const [showPrivacyNotice, setShowPrivacyNotice] = (0, import_react121.useState)(false);
|
|
33096
|
+
const [themeError, setThemeError] = (0, import_react121.useState)(
|
|
33028
33097
|
initializationResult.themeError
|
|
33029
33098
|
);
|
|
33030
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
33031
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
33032
|
-
const [showDebugProfiler, setShowDebugProfiler] = (0,
|
|
33033
|
-
const [customDialog, setCustomDialog] = (0,
|
|
33099
|
+
const [isProcessing, setIsProcessing] = (0, import_react121.useState)(false);
|
|
33100
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react121.useState)(false);
|
|
33101
|
+
const [showDebugProfiler, setShowDebugProfiler] = (0, import_react121.useState)(false);
|
|
33102
|
+
const [customDialog, setCustomDialog] = (0, import_react121.useState)(
|
|
33034
33103
|
null
|
|
33035
33104
|
);
|
|
33036
|
-
const [copyModeEnabled, setCopyModeEnabled] = (0,
|
|
33037
|
-
const [pendingRestorePrompt, setPendingRestorePrompt] = (0,
|
|
33038
|
-
const toggleBackgroundTasksRef = (0,
|
|
33105
|
+
const [copyModeEnabled, setCopyModeEnabled] = (0, import_react121.useState)(false);
|
|
33106
|
+
const [pendingRestorePrompt, setPendingRestorePrompt] = (0, import_react121.useState)(false);
|
|
33107
|
+
const toggleBackgroundTasksRef = (0, import_react121.useRef)(() => {
|
|
33039
33108
|
});
|
|
33040
|
-
const isBackgroundTaskVisibleRef = (0,
|
|
33041
|
-
const backgroundTasksRef = (0,
|
|
33042
|
-
const [adminSettingsChanged, setAdminSettingsChanged] = (0,
|
|
33043
|
-
const [expandedTools, setExpandedTools] = (0,
|
|
33044
|
-
const toggleExpansion = (0,
|
|
33109
|
+
const isBackgroundTaskVisibleRef = (0, import_react121.useRef)(false);
|
|
33110
|
+
const backgroundTasksRef = (0, import_react121.useRef)(/* @__PURE__ */ new Map());
|
|
33111
|
+
const [adminSettingsChanged, setAdminSettingsChanged] = (0, import_react121.useState)(false);
|
|
33112
|
+
const [expandedTools, setExpandedTools] = (0, import_react121.useState)(/* @__PURE__ */ new Set());
|
|
33113
|
+
const toggleExpansion = (0, import_react121.useCallback)((callId) => {
|
|
33045
33114
|
setExpandedTools((prev) => {
|
|
33046
33115
|
const next = new Set(prev);
|
|
33047
33116
|
if (next.has(callId)) {
|
|
@@ -33052,7 +33121,7 @@ var AppContainer = (props) => {
|
|
|
33052
33121
|
return next;
|
|
33053
33122
|
});
|
|
33054
33123
|
}, []);
|
|
33055
|
-
const toggleAllExpansion = (0,
|
|
33124
|
+
const toggleAllExpansion = (0, import_react121.useCallback)((callIds) => {
|
|
33056
33125
|
setExpandedTools((prev) => {
|
|
33057
33126
|
const next = new Set(prev);
|
|
33058
33127
|
const anyCollapsed = callIds.some((id) => !next.has(id));
|
|
@@ -33064,25 +33133,25 @@ var AppContainer = (props) => {
|
|
|
33064
33133
|
return next;
|
|
33065
33134
|
});
|
|
33066
33135
|
}, []);
|
|
33067
|
-
const isExpanded = (0,
|
|
33136
|
+
const isExpanded = (0, import_react121.useCallback)(
|
|
33068
33137
|
(callId) => expandedTools.has(callId),
|
|
33069
33138
|
[expandedTools]
|
|
33070
33139
|
);
|
|
33071
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
33072
|
-
const [isVoiceModeEnabled, setVoiceModeEnabled] = (0,
|
|
33073
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
33074
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
33075
|
-
const [settingsNonce, setSettingsNonce] = (0,
|
|
33140
|
+
const [shellModeActive, setShellModeActive] = (0, import_react121.useState)(false);
|
|
33141
|
+
const [isVoiceModeEnabled, setVoiceModeEnabled] = (0, import_react121.useState)(false);
|
|
33142
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react121.useState)(false);
|
|
33143
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react121.useState)(0);
|
|
33144
|
+
const [settingsNonce, setSettingsNonce] = (0, import_react121.useState)(0);
|
|
33076
33145
|
const activeHooks = useHookDisplayState();
|
|
33077
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
33078
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
33146
|
+
const [updateInfo, setUpdateInfo] = (0, import_react121.useState)(null);
|
|
33147
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react121.useState)(
|
|
33079
33148
|
() => isWorkspaceTrusted(settings.merged).isTrusted
|
|
33080
33149
|
);
|
|
33081
33150
|
const [queueErrorMessage, setQueueErrorMessage] = useTimedMessage(
|
|
33082
33151
|
QUEUE_ERROR_DISPLAY_DURATION_MS
|
|
33083
33152
|
);
|
|
33084
|
-
const [newAgents, setNewAgents] = (0,
|
|
33085
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
33153
|
+
const [newAgents, setNewAgents] = (0, import_react121.useState)(null);
|
|
33154
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react121.useState)(true);
|
|
33086
33155
|
const [expandHintTrigger, triggerExpandHint] = useTimedMessage(
|
|
33087
33156
|
EXPAND_HINT_DURATION_MS
|
|
33088
33157
|
);
|
|
@@ -33090,17 +33159,17 @@ var AppContainer = (props) => {
|
|
|
33090
33159
|
const overflowState = useOverflowState();
|
|
33091
33160
|
const overflowingIdsSize = overflowState?.overflowingIds.size ?? 0;
|
|
33092
33161
|
const hasOverflowState = overflowingIdsSize > 0 || !constrainHeight;
|
|
33093
|
-
const prevOverflowingIdsSizeRef = (0,
|
|
33094
|
-
(0,
|
|
33162
|
+
const prevOverflowingIdsSizeRef = (0, import_react121.useRef)(0);
|
|
33163
|
+
(0, import_react121.useEffect)(() => {
|
|
33095
33164
|
if (overflowingIdsSize > prevOverflowingIdsSizeRef.current && hasOverflowState) {
|
|
33096
33165
|
triggerExpandHint(true);
|
|
33097
33166
|
}
|
|
33098
33167
|
prevOverflowingIdsSizeRef.current = overflowingIdsSize;
|
|
33099
33168
|
}, [hasOverflowState, overflowingIdsSize, triggerExpandHint]);
|
|
33100
|
-
const [defaultBannerText, setDefaultBannerText] = (0,
|
|
33101
|
-
const [warningBannerText, setWarningBannerText] = (0,
|
|
33102
|
-
const [bannerVisible, setBannerVisible] = (0,
|
|
33103
|
-
const bannerData = (0,
|
|
33169
|
+
const [defaultBannerText, setDefaultBannerText] = (0, import_react121.useState)("");
|
|
33170
|
+
const [warningBannerText, setWarningBannerText] = (0, import_react121.useState)("");
|
|
33171
|
+
const [bannerVisible, setBannerVisible] = (0, import_react121.useState)(true);
|
|
33172
|
+
const bannerData = (0, import_react121.useMemo)(
|
|
33104
33173
|
() => ({
|
|
33105
33174
|
defaultText: defaultBannerText,
|
|
33106
33175
|
warningText: warningBannerText
|
|
@@ -33123,24 +33192,24 @@ var AppContainer = (props) => {
|
|
|
33123
33192
|
historyManager.addItem,
|
|
33124
33193
|
config.getEnableExtensionReloading()
|
|
33125
33194
|
);
|
|
33126
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
33127
|
-
const [permissionsDialogProps, setPermissionsDialogProps] = (0,
|
|
33128
|
-
const openPermissionsDialog = (0,
|
|
33195
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react121.useState)(false);
|
|
33196
|
+
const [permissionsDialogProps, setPermissionsDialogProps] = (0, import_react121.useState)(null);
|
|
33197
|
+
const openPermissionsDialog = (0, import_react121.useCallback)(
|
|
33129
33198
|
(props2) => {
|
|
33130
33199
|
setPermissionsDialogOpen(true);
|
|
33131
33200
|
setPermissionsDialogProps(props2 ?? null);
|
|
33132
33201
|
},
|
|
33133
33202
|
[]
|
|
33134
33203
|
);
|
|
33135
|
-
const closePermissionsDialog = (0,
|
|
33204
|
+
const closePermissionsDialog = (0, import_react121.useCallback)(() => {
|
|
33136
33205
|
setPermissionsDialogOpen(false);
|
|
33137
33206
|
setPermissionsDialogProps(null);
|
|
33138
33207
|
}, []);
|
|
33139
|
-
const [isAgentConfigDialogOpen, setIsAgentConfigDialogOpen] = (0,
|
|
33140
|
-
const [selectedAgentName, setSelectedAgentName] = (0,
|
|
33141
|
-
const [selectedAgentDisplayName, setSelectedAgentDisplayName] = (0,
|
|
33142
|
-
const [selectedAgentDefinition, setSelectedAgentDefinition] = (0,
|
|
33143
|
-
const openAgentConfigDialog = (0,
|
|
33208
|
+
const [isAgentConfigDialogOpen, setIsAgentConfigDialogOpen] = (0, import_react121.useState)(false);
|
|
33209
|
+
const [selectedAgentName, setSelectedAgentName] = (0, import_react121.useState)();
|
|
33210
|
+
const [selectedAgentDisplayName, setSelectedAgentDisplayName] = (0, import_react121.useState)();
|
|
33211
|
+
const [selectedAgentDefinition, setSelectedAgentDefinition] = (0, import_react121.useState)();
|
|
33212
|
+
const openAgentConfigDialog = (0, import_react121.useCallback)(
|
|
33144
33213
|
(name, displayName, definition) => {
|
|
33145
33214
|
setSelectedAgentName(name);
|
|
33146
33215
|
setSelectedAgentDisplayName(displayName);
|
|
@@ -33149,28 +33218,28 @@ var AppContainer = (props) => {
|
|
|
33149
33218
|
},
|
|
33150
33219
|
[]
|
|
33151
33220
|
);
|
|
33152
|
-
const closeAgentConfigDialog = (0,
|
|
33221
|
+
const closeAgentConfigDialog = (0, import_react121.useCallback)(() => {
|
|
33153
33222
|
setIsAgentConfigDialogOpen(false);
|
|
33154
33223
|
setSelectedAgentName(void 0);
|
|
33155
33224
|
setSelectedAgentDisplayName(void 0);
|
|
33156
33225
|
setSelectedAgentDefinition(void 0);
|
|
33157
33226
|
}, []);
|
|
33158
|
-
const toggleDebugProfiler = (0,
|
|
33227
|
+
const toggleDebugProfiler = (0, import_react121.useCallback)(
|
|
33159
33228
|
() => setShowDebugProfiler((prev) => !prev),
|
|
33160
33229
|
[]
|
|
33161
33230
|
);
|
|
33162
|
-
const [currentModel, setCurrentModel] = (0,
|
|
33163
|
-
const [userTier, setUserTier] = (0,
|
|
33164
|
-
const [quotaStats, setQuotaStats] = (0,
|
|
33231
|
+
const [currentModel, setCurrentModel] = (0, import_react121.useState)(config.getModel());
|
|
33232
|
+
const [userTier, setUserTier] = (0, import_react121.useState)(void 0);
|
|
33233
|
+
const [quotaStats, setQuotaStats] = (0, import_react121.useState)(() => {
|
|
33165
33234
|
const remaining = config.getQuotaRemaining();
|
|
33166
33235
|
const limit = config.getQuotaLimit();
|
|
33167
33236
|
const resetTime = config.getQuotaResetTime();
|
|
33168
33237
|
return remaining !== void 0 || limit !== void 0 || resetTime !== void 0 ? { remaining, limit, resetTime } : void 0;
|
|
33169
33238
|
});
|
|
33170
|
-
const [paidTier, setPaidTier] = (0,
|
|
33239
|
+
const [paidTier, setPaidTier] = (0, import_react121.useState)(
|
|
33171
33240
|
void 0
|
|
33172
33241
|
);
|
|
33173
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
33242
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react121.useState)(false);
|
|
33174
33243
|
const logger = useLogger(config);
|
|
33175
33244
|
const { inputHistory, addInput, initializeFromLogger } = useInputHistoryStore();
|
|
33176
33245
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
@@ -33179,10 +33248,10 @@ var AppContainer = (props) => {
|
|
|
33179
33248
|
const app = use_app_default();
|
|
33180
33249
|
const { stats: sessionStats } = useSessionStats();
|
|
33181
33250
|
const branchName = useGitBranchName(config.getTargetDir());
|
|
33182
|
-
const rootUiRef = (0,
|
|
33183
|
-
const lastTitleRef = (0,
|
|
33251
|
+
const rootUiRef = (0, import_react121.useRef)(null);
|
|
33252
|
+
const lastTitleRef = (0, import_react121.useRef)(null);
|
|
33184
33253
|
const staticExtraHeight = 3;
|
|
33185
|
-
(0,
|
|
33254
|
+
(0, import_react121.useEffect)(() => {
|
|
33186
33255
|
(async () => {
|
|
33187
33256
|
if (!config.isInitialized()) {
|
|
33188
33257
|
await config.initialize();
|
|
@@ -33227,11 +33296,11 @@ var AppContainer = (props) => {
|
|
|
33227
33296
|
);
|
|
33228
33297
|
};
|
|
33229
33298
|
}, [config, resumedSessionData]);
|
|
33230
|
-
(0,
|
|
33299
|
+
(0, import_react121.useEffect)(
|
|
33231
33300
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
33232
33301
|
[historyManager.addItem]
|
|
33233
33302
|
);
|
|
33234
|
-
(0,
|
|
33303
|
+
(0, import_react121.useEffect)(() => {
|
|
33235
33304
|
const handleModelChanged = () => {
|
|
33236
33305
|
setCurrentModel(config.getModel());
|
|
33237
33306
|
};
|
|
@@ -33249,7 +33318,7 @@ var AppContainer = (props) => {
|
|
|
33249
33318
|
coreEvents.off("quota-changed" /* QuotaChanged */, handleQuotaChanged);
|
|
33250
33319
|
};
|
|
33251
33320
|
}, [config]);
|
|
33252
|
-
(0,
|
|
33321
|
+
(0, import_react121.useEffect)(() => {
|
|
33253
33322
|
const handleSettingsChanged = () => {
|
|
33254
33323
|
setSettingsNonce((prev) => prev + 1);
|
|
33255
33324
|
};
|
|
@@ -33273,12 +33342,12 @@ var AppContainer = (props) => {
|
|
|
33273
33342
|
}, [settings]);
|
|
33274
33343
|
const { errorCount, clearErrorCount } = useErrorCount();
|
|
33275
33344
|
const mainAreaWidth = calculateMainAreaWidth(terminalWidth, config);
|
|
33276
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
33345
|
+
const { inputWidth, suggestionsWidth } = (0, import_react121.useMemo)(() => {
|
|
33277
33346
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(mainAreaWidth);
|
|
33278
33347
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
33279
33348
|
}, [mainAreaWidth]);
|
|
33280
33349
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
33281
|
-
const getPreferredEditor = (0,
|
|
33350
|
+
const getPreferredEditor = (0, import_react121.useCallback)(() => {
|
|
33282
33351
|
const val = settings.merged.general.preferredEditor;
|
|
33283
33352
|
return isValidEditorType(val) ? val : void 0;
|
|
33284
33353
|
}, [settings.merged.general.preferredEditor]);
|
|
@@ -33291,56 +33360,56 @@ var AppContainer = (props) => {
|
|
|
33291
33360
|
shellModeActive,
|
|
33292
33361
|
getPreferredEditor
|
|
33293
33362
|
});
|
|
33294
|
-
const bufferRef = (0,
|
|
33295
|
-
(0,
|
|
33363
|
+
const bufferRef = (0, import_react121.useRef)(buffer);
|
|
33364
|
+
(0, import_react121.useEffect)(() => {
|
|
33296
33365
|
bufferRef.current = buffer;
|
|
33297
33366
|
}, [buffer]);
|
|
33298
|
-
const stableSetText = (0,
|
|
33367
|
+
const stableSetText = (0, import_react121.useCallback)((text) => {
|
|
33299
33368
|
bufferRef.current.setText(text);
|
|
33300
33369
|
}, []);
|
|
33301
|
-
(0,
|
|
33370
|
+
(0, import_react121.useEffect)(() => {
|
|
33302
33371
|
initializeFromLogger(logger);
|
|
33303
33372
|
}, [logger, initializeFromLogger]);
|
|
33304
33373
|
useTerminalSetupPrompt({
|
|
33305
33374
|
addConfirmUpdateExtensionRequest,
|
|
33306
33375
|
addItem: historyManager.addItem
|
|
33307
33376
|
});
|
|
33308
|
-
const isStdoutCorkedRef = (0,
|
|
33309
|
-
const isRefreshingStaticRef = (0,
|
|
33310
|
-
const resizeCorkSafetyTimerRef = (0,
|
|
33311
|
-
const resizeDebounceTimerRef = (0,
|
|
33312
|
-
const lastStdoutColumnsRef = (0,
|
|
33377
|
+
const isStdoutCorkedRef = (0, import_react121.useRef)(false);
|
|
33378
|
+
const isRefreshingStaticRef = (0, import_react121.useRef)(false);
|
|
33379
|
+
const resizeCorkSafetyTimerRef = (0, import_react121.useRef)(null);
|
|
33380
|
+
const resizeDebounceTimerRef = (0, import_react121.useRef)(null);
|
|
33381
|
+
const lastStdoutColumnsRef = (0, import_react121.useRef)(
|
|
33313
33382
|
stdout.columns ?? process12.stdout.columns ?? terminalWidth
|
|
33314
33383
|
);
|
|
33315
|
-
const lastRefreshedColumnsRef = (0,
|
|
33316
|
-
const terminalWidthRef = (0,
|
|
33384
|
+
const lastRefreshedColumnsRef = (0, import_react121.useRef)(terminalWidth);
|
|
33385
|
+
const terminalWidthRef = (0, import_react121.useRef)(terminalWidth);
|
|
33317
33386
|
terminalWidthRef.current = terminalWidth;
|
|
33318
|
-
const clearResizeCorkSafetyTimer = (0,
|
|
33387
|
+
const clearResizeCorkSafetyTimer = (0, import_react121.useCallback)(() => {
|
|
33319
33388
|
if (resizeCorkSafetyTimerRef.current) {
|
|
33320
33389
|
clearTimeout(resizeCorkSafetyTimerRef.current);
|
|
33321
33390
|
resizeCorkSafetyTimerRef.current = null;
|
|
33322
33391
|
}
|
|
33323
33392
|
}, []);
|
|
33324
|
-
const clearResizeDebounceTimer = (0,
|
|
33393
|
+
const clearResizeDebounceTimer = (0, import_react121.useCallback)(() => {
|
|
33325
33394
|
if (resizeDebounceTimerRef.current) {
|
|
33326
33395
|
clearTimeout(resizeDebounceTimerRef.current);
|
|
33327
33396
|
resizeDebounceTimerRef.current = null;
|
|
33328
33397
|
}
|
|
33329
33398
|
}, []);
|
|
33330
|
-
const corkStdout = (0,
|
|
33399
|
+
const corkStdout = (0, import_react121.useCallback)(() => {
|
|
33331
33400
|
if (!isStdoutCorkedRef.current && typeof stdout.cork === "function") {
|
|
33332
33401
|
stdout.cork();
|
|
33333
33402
|
isStdoutCorkedRef.current = true;
|
|
33334
33403
|
}
|
|
33335
33404
|
}, [stdout]);
|
|
33336
|
-
const uncorkStdout = (0,
|
|
33405
|
+
const uncorkStdout = (0, import_react121.useCallback)(() => {
|
|
33337
33406
|
clearResizeCorkSafetyTimer();
|
|
33338
33407
|
if (isStdoutCorkedRef.current && typeof stdout.uncork === "function") {
|
|
33339
33408
|
isStdoutCorkedRef.current = false;
|
|
33340
33409
|
stdout.uncork();
|
|
33341
33410
|
}
|
|
33342
33411
|
}, [stdout, clearResizeCorkSafetyTimer]);
|
|
33343
|
-
const refreshStatic = (0,
|
|
33412
|
+
const refreshStatic = (0, import_react121.useCallback)(() => {
|
|
33344
33413
|
if (!isAlternateBuffer && !config.getUseTerminalBuffer()) {
|
|
33345
33414
|
clearResizeDebounceTimer();
|
|
33346
33415
|
refreshStdoutSize(stdout);
|
|
@@ -33362,6 +33431,8 @@ var AppContainer = (props) => {
|
|
|
33362
33431
|
stdout.write(ENTER_SYNCHRONIZED_OUTPUT);
|
|
33363
33432
|
}
|
|
33364
33433
|
stdout.write(base_exports.clearTerminal);
|
|
33434
|
+
}
|
|
33435
|
+
if (!isAlternateBuffer || config.getUseTerminalBuffer()) {
|
|
33365
33436
|
setHistoryRemountKey((prev) => prev + 1);
|
|
33366
33437
|
}
|
|
33367
33438
|
}, [
|
|
@@ -33374,7 +33445,7 @@ var AppContainer = (props) => {
|
|
|
33374
33445
|
corkStdout,
|
|
33375
33446
|
uncorkStdout
|
|
33376
33447
|
]);
|
|
33377
|
-
(0,
|
|
33448
|
+
(0, import_react121.useLayoutEffect)(() => {
|
|
33378
33449
|
if (isRefreshingStaticRef.current) {
|
|
33379
33450
|
isRefreshingStaticRef.current = false;
|
|
33380
33451
|
refreshStdoutSize(stdout);
|
|
@@ -33392,7 +33463,7 @@ var AppContainer = (props) => {
|
|
|
33392
33463
|
isAlternateBuffer,
|
|
33393
33464
|
config.getScreenReader()
|
|
33394
33465
|
);
|
|
33395
|
-
const handleEditorClose = (0,
|
|
33466
|
+
const handleEditorClose = (0, import_react121.useCallback)(() => {
|
|
33396
33467
|
if (shouldUseAlternateScreen) {
|
|
33397
33468
|
enterAlternateScreen();
|
|
33398
33469
|
enableMouseEvents();
|
|
@@ -33404,14 +33475,14 @@ var AppContainer = (props) => {
|
|
|
33404
33475
|
terminalCapabilityManager.enableSupportedModes();
|
|
33405
33476
|
refreshStatic();
|
|
33406
33477
|
}, [refreshStatic, shouldUseAlternateScreen, app, config]);
|
|
33407
|
-
const [editorError, setEditorError] = (0,
|
|
33478
|
+
const [editorError, setEditorError] = (0, import_react121.useState)(null);
|
|
33408
33479
|
const {
|
|
33409
33480
|
isEditorDialogOpen,
|
|
33410
33481
|
openEditorDialog,
|
|
33411
33482
|
handleEditorSelect,
|
|
33412
33483
|
exitEditorDialog
|
|
33413
33484
|
} = useEditorSettings(settings, setEditorError, historyManager.addItem);
|
|
33414
|
-
(0,
|
|
33485
|
+
(0, import_react121.useEffect)(() => {
|
|
33415
33486
|
coreEvents.on("external-editor-closed" /* ExternalEditorClosed */, handleEditorClose);
|
|
33416
33487
|
coreEvents.on("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
|
|
33417
33488
|
return () => {
|
|
@@ -33419,7 +33490,7 @@ var AppContainer = (props) => {
|
|
|
33419
33490
|
coreEvents.off("request-editor-selection" /* RequestEditorSelection */, openEditorDialog);
|
|
33420
33491
|
};
|
|
33421
33492
|
}, [handleEditorClose, openEditorDialog]);
|
|
33422
|
-
(0,
|
|
33493
|
+
(0, import_react121.useEffect)(() => {
|
|
33423
33494
|
if (!(settings.merged.ui.hideBanner || config.getScreenReader()) && bannerVisible && bannerText) {
|
|
33424
33495
|
refreshStatic();
|
|
33425
33496
|
}
|
|
@@ -33454,16 +33525,16 @@ var AppContainer = (props) => {
|
|
|
33454
33525
|
initializationResult.authError,
|
|
33455
33526
|
initializationResult.accountSuspensionInfo
|
|
33456
33527
|
);
|
|
33457
|
-
const [authContext, setAuthContext] = (0,
|
|
33528
|
+
const [authContext, setAuthContext] = (0, import_react121.useState)(
|
|
33458
33529
|
{}
|
|
33459
33530
|
);
|
|
33460
|
-
(0,
|
|
33531
|
+
(0, import_react121.useEffect)(() => {
|
|
33461
33532
|
if (authState === "authenticated" /* Authenticated */ && authContext.requiresRestart) {
|
|
33462
33533
|
setAuthState("awaiting_login_restart" /* AwaitingLoginRestart */);
|
|
33463
33534
|
setAuthContext({});
|
|
33464
33535
|
}
|
|
33465
33536
|
}, [authState, authContext, setAuthState]);
|
|
33466
|
-
const handleShowAuthSelection = (0,
|
|
33537
|
+
const handleShowAuthSelection = (0, import_react121.useCallback)(() => {
|
|
33467
33538
|
setAuthState("updating" /* Updating */);
|
|
33468
33539
|
}, [setAuthState]);
|
|
33469
33540
|
const {
|
|
@@ -33505,13 +33576,13 @@ var AppContainer = (props) => {
|
|
|
33505
33576
|
handleResumeSession,
|
|
33506
33577
|
handleDeleteSession: handleDeleteSessionSync
|
|
33507
33578
|
} = useSessionBrowser(config, loadHistoryForResume);
|
|
33508
|
-
const handleDeleteSession = (0,
|
|
33579
|
+
const handleDeleteSession = (0, import_react121.useCallback)(
|
|
33509
33580
|
async (session) => {
|
|
33510
33581
|
await handleDeleteSessionSync(session);
|
|
33511
33582
|
},
|
|
33512
33583
|
[handleDeleteSessionSync]
|
|
33513
33584
|
);
|
|
33514
|
-
const handleAuthSelect = (0,
|
|
33585
|
+
const handleAuthSelect = (0, import_react121.useCallback)(
|
|
33515
33586
|
async (authType, scope) => {
|
|
33516
33587
|
if (authType) {
|
|
33517
33588
|
const previousAuthType = config.getContentGeneratorConfig()?.authType ?? "unknown";
|
|
@@ -33556,7 +33627,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33556
33627
|
},
|
|
33557
33628
|
[settings, config, setAuthState, onAuthError, setAuthContext]
|
|
33558
33629
|
);
|
|
33559
|
-
const handleApiKeySubmit = (0,
|
|
33630
|
+
const handleApiKeySubmit = (0, import_react121.useCallback)(
|
|
33560
33631
|
async (apiKey) => {
|
|
33561
33632
|
try {
|
|
33562
33633
|
onAuthError(null);
|
|
@@ -33576,16 +33647,16 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33576
33647
|
},
|
|
33577
33648
|
[setAuthState, onAuthError, reloadApiKey, config]
|
|
33578
33649
|
);
|
|
33579
|
-
const handleApiKeyCancel = (0,
|
|
33650
|
+
const handleApiKeyCancel = (0, import_react121.useCallback)(() => {
|
|
33580
33651
|
setAuthState("updating" /* Updating */);
|
|
33581
33652
|
}, [setAuthState]);
|
|
33582
|
-
(0,
|
|
33653
|
+
(0, import_react121.useEffect)(() => {
|
|
33583
33654
|
if (authState === "authenticated" /* Authenticated */) {
|
|
33584
33655
|
setUserTier(config.getUserTier());
|
|
33585
33656
|
setPaidTier(config.getUserPaidTier());
|
|
33586
33657
|
}
|
|
33587
33658
|
}, [config, authState]);
|
|
33588
|
-
(0,
|
|
33659
|
+
(0, import_react121.useEffect)(() => {
|
|
33589
33660
|
if (settings.merged.security.auth.enforcedType && settings.merged.security.auth.selectedType && settings.merged.security.auth.enforcedType !== settings.merged.security.auth.selectedType) {
|
|
33590
33661
|
onAuthError(
|
|
33591
33662
|
`Authentication is enforced to be ${settings.merged.security.auth.enforcedType}, but you are currently using ${settings.merged.security.auth.selectedType}.`
|
|
@@ -33621,19 +33692,19 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33621
33692
|
closeVoiceModelDialog
|
|
33622
33693
|
} = useVoiceModelCommand();
|
|
33623
33694
|
const { toggleVimEnabled } = useVimMode();
|
|
33624
|
-
const setIsBackgroundTaskListOpenRef = (0,
|
|
33695
|
+
const setIsBackgroundTaskListOpenRef = (0, import_react121.useRef)(
|
|
33625
33696
|
() => {
|
|
33626
33697
|
}
|
|
33627
33698
|
);
|
|
33628
|
-
const [shortcutsHelpVisible, setShortcutsHelpVisible] = (0,
|
|
33699
|
+
const [shortcutsHelpVisible, setShortcutsHelpVisible] = (0, import_react121.useState)(false);
|
|
33629
33700
|
const {
|
|
33630
33701
|
cleanUiDetailsVisible,
|
|
33631
33702
|
setCleanUiDetailsVisible,
|
|
33632
33703
|
toggleCleanUiDetailsVisible,
|
|
33633
33704
|
revealCleanUiDetailsTemporarily
|
|
33634
33705
|
} = useVisibilityToggle();
|
|
33635
|
-
const cancelPromiseRef = (0,
|
|
33636
|
-
const awaitCancelPromise = (0,
|
|
33706
|
+
const cancelPromiseRef = (0, import_react121.useRef)(null);
|
|
33707
|
+
const awaitCancelPromise = (0, import_react121.useCallback)(async () => {
|
|
33637
33708
|
if (!cancelPromiseRef.current) {
|
|
33638
33709
|
return;
|
|
33639
33710
|
}
|
|
@@ -33654,7 +33725,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33654
33725
|
cancelPromiseRef.current = null;
|
|
33655
33726
|
}
|
|
33656
33727
|
}, []);
|
|
33657
|
-
const slashCommandActions = (0,
|
|
33728
|
+
const slashCommandActions = (0, import_react121.useMemo)(
|
|
33658
33729
|
() => ({
|
|
33659
33730
|
openAuthDialog: () => setAuthState("updating" /* Updating */),
|
|
33660
33731
|
openThemeDialog,
|
|
@@ -33739,9 +33810,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33739
33810
|
setBannerVisible,
|
|
33740
33811
|
setCustomDialog
|
|
33741
33812
|
);
|
|
33742
|
-
const [authConsentRequest, setAuthConsentRequest] = (0,
|
|
33743
|
-
const [permissionConfirmationRequest, setPermissionConfirmationRequest] = (0,
|
|
33744
|
-
(0,
|
|
33813
|
+
const [authConsentRequest, setAuthConsentRequest] = (0, import_react121.useState)(null);
|
|
33814
|
+
const [permissionConfirmationRequest, setPermissionConfirmationRequest] = (0, import_react121.useState)(null);
|
|
33815
|
+
(0, import_react121.useEffect)(() => {
|
|
33745
33816
|
const handleConsentRequest = (payload) => {
|
|
33746
33817
|
setAuthConsentRequest({
|
|
33747
33818
|
prompt: payload.prompt,
|
|
@@ -33756,7 +33827,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33756
33827
|
coreEvents.off("consent-request" /* ConsentRequest */, handleConsentRequest);
|
|
33757
33828
|
};
|
|
33758
33829
|
}, []);
|
|
33759
|
-
const performMemoryRefresh = (0,
|
|
33830
|
+
const performMemoryRefresh = (0, import_react121.useCallback)(async () => {
|
|
33760
33831
|
historyManager.addItem(
|
|
33761
33832
|
{
|
|
33762
33833
|
type: "info" /* INFO */,
|
|
@@ -33796,9 +33867,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33796
33867
|
debugLogger.warn("Error refreshing memory:", error);
|
|
33797
33868
|
}
|
|
33798
33869
|
}, [config, historyManager]);
|
|
33799
|
-
const cancelHandlerRef = (0,
|
|
33870
|
+
const cancelHandlerRef = (0, import_react121.useRef)(() => {
|
|
33800
33871
|
});
|
|
33801
|
-
const onCancelSubmit = (0,
|
|
33872
|
+
const onCancelSubmit = (0, import_react121.useCallback)(
|
|
33802
33873
|
(shouldRestorePrompt, clearBuffer = false) => {
|
|
33803
33874
|
if (shouldRestorePrompt) {
|
|
33804
33875
|
setPendingRestorePrompt(true);
|
|
@@ -33809,7 +33880,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33809
33880
|
},
|
|
33810
33881
|
[]
|
|
33811
33882
|
);
|
|
33812
|
-
(0,
|
|
33883
|
+
(0, import_react121.useEffect)(() => {
|
|
33813
33884
|
if (pendingRestorePrompt) {
|
|
33814
33885
|
const lastHistoryUserMsg = historyManager.history.findLast(
|
|
33815
33886
|
(h) => h.type === "user"
|
|
@@ -33821,9 +33892,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33821
33892
|
}
|
|
33822
33893
|
}
|
|
33823
33894
|
}, [pendingRestorePrompt, inputHistory, historyManager.history]);
|
|
33824
|
-
const pendingHintsRef = (0,
|
|
33825
|
-
const [pendingHintCount, setPendingHintCount] = (0,
|
|
33826
|
-
const consumePendingHints = (0,
|
|
33895
|
+
const pendingHintsRef = (0, import_react121.useRef)([]);
|
|
33896
|
+
const [pendingHintCount, setPendingHintCount] = (0, import_react121.useState)(0);
|
|
33897
|
+
const consumePendingHints = (0, import_react121.useCallback)(() => {
|
|
33827
33898
|
if (pendingHintsRef.current.length === 0) {
|
|
33828
33899
|
return null;
|
|
33829
33900
|
}
|
|
@@ -33832,7 +33903,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33832
33903
|
setPendingHintCount(0);
|
|
33833
33904
|
return hint;
|
|
33834
33905
|
}, []);
|
|
33835
|
-
(0,
|
|
33906
|
+
(0, import_react121.useEffect)(() => {
|
|
33836
33907
|
const hintListener = (text, source) => {
|
|
33837
33908
|
if (source !== "user_steering" && source !== "background_completion") {
|
|
33838
33909
|
return;
|
|
@@ -33845,7 +33916,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33845
33916
|
config.injectionService.offInjection(hintListener);
|
|
33846
33917
|
};
|
|
33847
33918
|
}, [config]);
|
|
33848
|
-
const streamAgent = (0,
|
|
33919
|
+
const streamAgent = (0, import_react121.useMemo)(
|
|
33849
33920
|
() => config?.getAgentSessionInteractiveEnabled() ? new LegacyAgentProtocol({ config, getPreferredEditor }) : void 0,
|
|
33850
33921
|
[config, getPreferredEditor]
|
|
33851
33922
|
);
|
|
@@ -33903,7 +33974,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33903
33974
|
dismissBackgroundTask,
|
|
33904
33975
|
retryStatus
|
|
33905
33976
|
} = activeStream;
|
|
33906
|
-
const pendingHistoryItems = (0,
|
|
33977
|
+
const pendingHistoryItems = (0, import_react121.useMemo)(
|
|
33907
33978
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
33908
33979
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
33909
33980
|
);
|
|
@@ -33926,8 +33997,8 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33926
33997
|
terminalHeight
|
|
33927
33998
|
});
|
|
33928
33999
|
setIsBackgroundTaskListOpenRef.current = setIsBackgroundTaskListOpen;
|
|
33929
|
-
const lastOutputTimeRef = (0,
|
|
33930
|
-
(0,
|
|
34000
|
+
const lastOutputTimeRef = (0, import_react121.useRef)(0);
|
|
34001
|
+
(0, import_react121.useEffect)(() => {
|
|
33931
34002
|
lastOutputTimeRef.current = lastOutputTime;
|
|
33932
34003
|
}, [lastOutputTime]);
|
|
33933
34004
|
const { shouldShowFocusHint, inactivityStatus } = useShellInactivityStatus({
|
|
@@ -33940,7 +34011,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33940
34011
|
});
|
|
33941
34012
|
const shouldShowActionRequiredTitle = inactivityStatus === "action_required";
|
|
33942
34013
|
const shouldShowSilentWorkingTitle = inactivityStatus === "silent_working";
|
|
33943
|
-
const handleApprovalModeChangeWithUiReveal = (0,
|
|
34014
|
+
const handleApprovalModeChangeWithUiReveal = (0, import_react121.useCallback)(
|
|
33944
34015
|
(mode) => {
|
|
33945
34016
|
void handleApprovalModeChange(mode);
|
|
33946
34017
|
if (!cleanUiDetailsVisible) {
|
|
@@ -33954,7 +34025,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33954
34025
|
]
|
|
33955
34026
|
);
|
|
33956
34027
|
const { isMcpReady } = useMcpStatus(config);
|
|
33957
|
-
const isCompressing = (0,
|
|
34028
|
+
const isCompressing = (0, import_react121.useMemo)(
|
|
33958
34029
|
() => pendingHistoryItems.some(
|
|
33959
34030
|
(item) => item.type === "compression" /* COMPRESSION */ && item.compression.isPending
|
|
33960
34031
|
),
|
|
@@ -33973,7 +34044,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
33973
34044
|
isMcpReady,
|
|
33974
34045
|
isCompressing
|
|
33975
34046
|
});
|
|
33976
|
-
cancelHandlerRef.current = (0,
|
|
34047
|
+
cancelHandlerRef.current = (0, import_react121.useCallback)(
|
|
33977
34048
|
(shouldRestorePrompt = true, clearBuffer = false) => {
|
|
33978
34049
|
if (!clearBuffer && isToolAwaitingConfirmation(pendingHistoryItems)) {
|
|
33979
34050
|
return;
|
|
@@ -34005,7 +34076,7 @@ ${queuedText}` : queuedText;
|
|
|
34005
34076
|
pendingHistoryItems
|
|
34006
34077
|
]
|
|
34007
34078
|
);
|
|
34008
|
-
const handleHintSubmit = (0,
|
|
34079
|
+
const handleHintSubmit = (0, import_react121.useCallback)(
|
|
34009
34080
|
(hint) => {
|
|
34010
34081
|
const trimmed = hint.trim();
|
|
34011
34082
|
if (!trimmed) {
|
|
@@ -34019,7 +34090,7 @@ ${queuedText}` : queuedText;
|
|
|
34019
34090
|
},
|
|
34020
34091
|
[config, historyManager]
|
|
34021
34092
|
);
|
|
34022
|
-
const handleFinalSubmit = (0,
|
|
34093
|
+
const handleFinalSubmit = (0, import_react121.useCallback)(
|
|
34023
34094
|
async (submittedValue) => {
|
|
34024
34095
|
reset();
|
|
34025
34096
|
triggerExpandHint(null);
|
|
@@ -34103,7 +34174,7 @@ ${queuedText}` : queuedText;
|
|
|
34103
34174
|
triggerExpandHint
|
|
34104
34175
|
]
|
|
34105
34176
|
);
|
|
34106
|
-
const handleClearScreen = (0,
|
|
34177
|
+
const handleClearScreen = (0, import_react121.useCallback)(() => {
|
|
34107
34178
|
reset();
|
|
34108
34179
|
triggerExpandHint(null);
|
|
34109
34180
|
historyManager.clearItems();
|
|
@@ -34118,22 +34189,22 @@ ${queuedText}` : queuedText;
|
|
|
34118
34189
|
]);
|
|
34119
34190
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
34120
34191
|
const isInputActive = !initError && !isProcessing && !isResuming && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */ || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) && !proQuotaRequest;
|
|
34121
|
-
const observerRef = (0,
|
|
34122
|
-
(0,
|
|
34192
|
+
const observerRef = (0, import_react121.useRef)(null);
|
|
34193
|
+
(0, import_react121.useEffect)(
|
|
34123
34194
|
() => () => {
|
|
34124
34195
|
observerRef.current?.disconnect();
|
|
34125
34196
|
},
|
|
34126
34197
|
[]
|
|
34127
34198
|
);
|
|
34128
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
34129
|
-
const [lastNonCopyControlsHeight, setLastNonCopyControlsHeight] = (0,
|
|
34130
|
-
(0,
|
|
34199
|
+
const [controlsHeight, setControlsHeight] = (0, import_react121.useState)(0);
|
|
34200
|
+
const [lastNonCopyControlsHeight, setLastNonCopyControlsHeight] = (0, import_react121.useState)(0);
|
|
34201
|
+
(0, import_react121.useLayoutEffect)(() => {
|
|
34131
34202
|
if (!copyModeEnabled && controlsHeight > 0) {
|
|
34132
34203
|
setLastNonCopyControlsHeight(controlsHeight);
|
|
34133
34204
|
}
|
|
34134
34205
|
}, [copyModeEnabled, controlsHeight]);
|
|
34135
34206
|
const stableControlsHeight = copyModeEnabled && lastNonCopyControlsHeight > 0 ? lastNonCopyControlsHeight : controlsHeight;
|
|
34136
|
-
const mainControlsRef = (0,
|
|
34207
|
+
const mainControlsRef = (0, import_react121.useCallback)((node) => {
|
|
34137
34208
|
if (observerRef.current) {
|
|
34138
34209
|
observerRef.current.disconnect();
|
|
34139
34210
|
observerRef.current = null;
|
|
@@ -34168,14 +34239,14 @@ ${queuedText}` : queuedText;
|
|
|
34168
34239
|
sandboxManager: config.sandboxManager
|
|
34169
34240
|
});
|
|
34170
34241
|
const { isFocused, hasReceivedFocusEvent } = useFocus();
|
|
34171
|
-
const contextFileNames = (0,
|
|
34242
|
+
const contextFileNames = (0, import_react121.useMemo)(() => {
|
|
34172
34243
|
const fromSettings = settings.merged.context.fileName;
|
|
34173
34244
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
34174
34245
|
}, [settings.merged.context.fileName]);
|
|
34175
|
-
const initialPrompt = (0,
|
|
34176
|
-
const initialPromptSubmitted = (0,
|
|
34246
|
+
const initialPrompt = (0, import_react121.useMemo)(() => config.getQuestion(), [config]);
|
|
34247
|
+
const initialPromptSubmitted = (0, import_react121.useRef)(false);
|
|
34177
34248
|
const geminiClient = config.getGeminiClient();
|
|
34178
|
-
(0,
|
|
34249
|
+
(0, import_react121.useEffect)(() => {
|
|
34179
34250
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showPrivacyNotice && geminiClient?.isInitialized?.()) {
|
|
34180
34251
|
void handleFinalSubmit(initialPrompt);
|
|
34181
34252
|
initialPromptSubmitted.current = true;
|
|
@@ -34191,9 +34262,9 @@ ${queuedText}` : queuedText;
|
|
|
34191
34262
|
showPrivacyNotice,
|
|
34192
34263
|
geminiClient
|
|
34193
34264
|
]);
|
|
34194
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
34195
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
34196
|
-
(0,
|
|
34265
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react121.useState)(false);
|
|
34266
|
+
const [currentIDE, setCurrentIDE] = (0, import_react121.useState)(null);
|
|
34267
|
+
(0, import_react121.useEffect)(() => {
|
|
34197
34268
|
const getIde = async () => {
|
|
34198
34269
|
const ideClient = await IdeClient.getInstance();
|
|
34199
34270
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -34204,10 +34275,10 @@ ${queuedText}` : queuedText;
|
|
|
34204
34275
|
const shouldShowIdePrompt = Boolean(
|
|
34205
34276
|
currentIDE && !config.getIdeMode() && !settings.merged.ide.hasSeenNudge && !idePromptAnswered
|
|
34206
34277
|
);
|
|
34207
|
-
const [showErrorDetails, setShowErrorDetails] = (0,
|
|
34208
|
-
const [showFullTodos, setShowFullTodos] = (0,
|
|
34209
|
-
const [renderMarkdown, setRenderMarkdown] = (0,
|
|
34210
|
-
const handleExitRepeat = (0,
|
|
34278
|
+
const [showErrorDetails, setShowErrorDetails] = (0, import_react121.useState)(false);
|
|
34279
|
+
const [showFullTodos, setShowFullTodos] = (0, import_react121.useState)(false);
|
|
34280
|
+
const [renderMarkdown, setRenderMarkdown] = (0, import_react121.useState)(true);
|
|
34281
|
+
const handleExitRepeat = (0, import_react121.useCallback)(
|
|
34211
34282
|
async (count) => {
|
|
34212
34283
|
if (count > 2) {
|
|
34213
34284
|
recordExitFail(config);
|
|
@@ -34229,9 +34300,9 @@ ${queuedText}` : queuedText;
|
|
|
34229
34300
|
windowMs: WARNING_PROMPT_DURATION_MS,
|
|
34230
34301
|
onRepeat: handleExitRepeat
|
|
34231
34302
|
});
|
|
34232
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
34233
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
34234
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
34303
|
+
const [ideContextState, setIdeContextState] = (0, import_react121.useState)();
|
|
34304
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react121.useState)(false);
|
|
34305
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react121.useState)(false);
|
|
34235
34306
|
const [transientMessage, showTransientMessage] = useTimedMessage(WARNING_PROMPT_DURATION_MS);
|
|
34236
34307
|
const {
|
|
34237
34308
|
isFolderTrustDialogOpen,
|
|
@@ -34240,17 +34311,17 @@ ${queuedText}` : queuedText;
|
|
|
34240
34311
|
isRestarting
|
|
34241
34312
|
} = useFolderTrust(settings, setIsTrustedFolder, historyManager.addItem);
|
|
34242
34313
|
const policyUpdateConfirmationRequest = config.getPolicyUpdateConfirmationRequest();
|
|
34243
|
-
const [isPolicyUpdateDialogOpen, setIsPolicyUpdateDialogOpen] = (0,
|
|
34314
|
+
const [isPolicyUpdateDialogOpen, setIsPolicyUpdateDialogOpen] = (0, import_react121.useState)(
|
|
34244
34315
|
!!policyUpdateConfirmationRequest
|
|
34245
34316
|
);
|
|
34246
34317
|
const {
|
|
34247
34318
|
needsRestart: ideNeedsRestart,
|
|
34248
34319
|
restartReason: ideTrustRestartReason
|
|
34249
34320
|
} = useIdeTrustListener();
|
|
34250
|
-
const prevWidthRef = (0,
|
|
34321
|
+
const prevWidthRef = (0, import_react121.useRef)(terminalWidth);
|
|
34251
34322
|
useIncludeDirsTrust(config, isTrustedFolder, historyManager, setCustomDialog);
|
|
34252
|
-
const tabFocusTimeoutRef = (0,
|
|
34253
|
-
(0,
|
|
34323
|
+
const tabFocusTimeoutRef = (0, import_react121.useRef)(null);
|
|
34324
|
+
(0, import_react121.useEffect)(() => {
|
|
34254
34325
|
const handleTransientMessage = (payload) => {
|
|
34255
34326
|
showTransientMessage({ text: payload.message, type: payload.type });
|
|
34256
34327
|
};
|
|
@@ -34278,7 +34349,7 @@ ${queuedText}` : queuedText;
|
|
|
34278
34349
|
}
|
|
34279
34350
|
};
|
|
34280
34351
|
}, [showTransientMessage]);
|
|
34281
|
-
const handleWarning = (0,
|
|
34352
|
+
const handleWarning = (0, import_react121.useCallback)(
|
|
34282
34353
|
(message) => {
|
|
34283
34354
|
showTransientMessage({
|
|
34284
34355
|
text: message,
|
|
@@ -34292,12 +34363,12 @@ ${queuedText}` : queuedText;
|
|
|
34292
34363
|
setRawMode,
|
|
34293
34364
|
shouldUseAlternateScreen
|
|
34294
34365
|
});
|
|
34295
|
-
(0,
|
|
34366
|
+
(0, import_react121.useEffect)(() => {
|
|
34296
34367
|
if (ideNeedsRestart) {
|
|
34297
34368
|
setShowIdeRestartPrompt(true);
|
|
34298
34369
|
}
|
|
34299
34370
|
}, [ideNeedsRestart]);
|
|
34300
|
-
(0,
|
|
34371
|
+
(0, import_react121.useEffect)(() => {
|
|
34301
34372
|
if (isAlternateBuffer || config.getUseTerminalBuffer() || typeof stdout.prependListener !== "function") {
|
|
34302
34373
|
return;
|
|
34303
34374
|
}
|
|
@@ -34332,7 +34403,7 @@ ${queuedText}` : queuedText;
|
|
|
34332
34403
|
clearResizeDebounceTimer,
|
|
34333
34404
|
clearResizeCorkSafetyTimer
|
|
34334
34405
|
]);
|
|
34335
|
-
(0,
|
|
34406
|
+
(0, import_react121.useEffect)(() => {
|
|
34336
34407
|
if (prevWidthRef.current === terminalWidth) {
|
|
34337
34408
|
return;
|
|
34338
34409
|
}
|
|
@@ -34355,25 +34426,24 @@ ${queuedText}` : queuedText;
|
|
|
34355
34426
|
isAlternateBuffer,
|
|
34356
34427
|
config
|
|
34357
34428
|
]);
|
|
34358
|
-
(0,
|
|
34429
|
+
(0, import_react121.useEffect)(() => {
|
|
34359
34430
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
34360
34431
|
setIdeContextState(ideContextStore.get());
|
|
34361
34432
|
return unsubscribe;
|
|
34362
34433
|
}, []);
|
|
34363
|
-
(0,
|
|
34434
|
+
(0, import_react121.useEffect)(() => {
|
|
34364
34435
|
const openDebugConsole = () => {
|
|
34365
34436
|
setShowErrorDetails(true);
|
|
34366
|
-
setConstrainHeight(false);
|
|
34367
34437
|
};
|
|
34368
34438
|
appEvents.on("open-debug-console" /* OpenDebugConsole */, openDebugConsole);
|
|
34369
34439
|
return () => {
|
|
34370
34440
|
appEvents.off("open-debug-console" /* OpenDebugConsole */, openDebugConsole);
|
|
34371
34441
|
};
|
|
34372
34442
|
}, [config]);
|
|
34373
|
-
const handleEscapePromptChange = (0,
|
|
34443
|
+
const handleEscapePromptChange = (0, import_react121.useCallback)((showPrompt) => {
|
|
34374
34444
|
setShowEscapePrompt(showPrompt);
|
|
34375
34445
|
}, []);
|
|
34376
|
-
const handleIdePromptComplete = (0,
|
|
34446
|
+
const handleIdePromptComplete = (0, import_react121.useCallback)(
|
|
34377
34447
|
(result) => {
|
|
34378
34448
|
if (result.userSelection === "yes") {
|
|
34379
34449
|
handleSlashCommand("/ide install");
|
|
@@ -34388,7 +34458,7 @@ ${queuedText}` : queuedText;
|
|
|
34388
34458
|
const isAwaitingLoginRestart = authState === "awaiting_login_restart" /* AwaitingLoginRestart */;
|
|
34389
34459
|
const loginRestartMessage = settings.merged.security.auth.selectedType === "vertex-ai" /* USE_VERTEX_AI */ ? "Authenticating to Vertex AI in Cloud Shell requires a restart to apply project settings." : void 0;
|
|
34390
34460
|
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;
|
|
34391
|
-
const handleGlobalKeypress = (0,
|
|
34461
|
+
const handleGlobalKeypress = (0, import_react121.useCallback)(
|
|
34392
34462
|
(key) => {
|
|
34393
34463
|
if (settings.merged.general.debugKeystrokeLogging) {
|
|
34394
34464
|
debugLogger.log("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -34479,7 +34549,7 @@ ${queuedText}` : queuedText;
|
|
|
34479
34549
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
34480
34550
|
if (settings.merged.general.devtools) {
|
|
34481
34551
|
void (async () => {
|
|
34482
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
34552
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-UO6ZB72B.js");
|
|
34483
34553
|
await toggleDevToolsPanel(
|
|
34484
34554
|
config,
|
|
34485
34555
|
showErrorDetails,
|
|
@@ -34631,7 +34701,7 @@ ${queuedText}` : queuedText;
|
|
|
34631
34701
|
priority: 200 /* Critical */
|
|
34632
34702
|
}
|
|
34633
34703
|
);
|
|
34634
|
-
(0,
|
|
34704
|
+
(0, import_react121.useEffect)(() => {
|
|
34635
34705
|
if (settings.merged.ui.hideWindowTitle) return;
|
|
34636
34706
|
const paddedTitle = computeTerminalTitle({
|
|
34637
34707
|
streamingState,
|
|
@@ -34658,7 +34728,7 @@ ${queuedText}` : queuedText;
|
|
|
34658
34728
|
config,
|
|
34659
34729
|
stdout
|
|
34660
34730
|
]);
|
|
34661
|
-
(0,
|
|
34731
|
+
(0, import_react121.useEffect)(() => {
|
|
34662
34732
|
const handleUserFeedback = (payload) => {
|
|
34663
34733
|
let type;
|
|
34664
34734
|
switch (payload.severity) {
|
|
@@ -34709,7 +34779,7 @@ ${queuedText}` : queuedText;
|
|
|
34709
34779
|
};
|
|
34710
34780
|
}, [historyManager]);
|
|
34711
34781
|
const nightly = props.version.includes("nightly");
|
|
34712
|
-
const hasPendingToolConfirmation = (0,
|
|
34782
|
+
const hasPendingToolConfirmation = (0, import_react121.useMemo)(
|
|
34713
34783
|
() => isToolAwaitingConfirmation(pendingHistoryItems),
|
|
34714
34784
|
[pendingHistoryItems]
|
|
34715
34785
|
);
|
|
@@ -34774,7 +34844,7 @@ ${queuedText}` : queuedText;
|
|
|
34774
34844
|
hasLoopDetectionConfirmationRequest
|
|
34775
34845
|
});
|
|
34776
34846
|
const isPassiveShortcutsHelpState = isInputActive && streamingState === "idle" /* Idle */ && !hasPendingActionRequired;
|
|
34777
|
-
(0,
|
|
34847
|
+
(0, import_react121.useEffect)(() => {
|
|
34778
34848
|
if (shortcutsHelpVisible && !isPassiveShortcutsHelpState) {
|
|
34779
34849
|
setShortcutsHelpVisible(false);
|
|
34780
34850
|
}
|
|
@@ -34783,7 +34853,7 @@ ${queuedText}` : queuedText;
|
|
|
34783
34853
|
isPassiveShortcutsHelpState,
|
|
34784
34854
|
setShortcutsHelpVisible
|
|
34785
34855
|
]);
|
|
34786
|
-
(0,
|
|
34856
|
+
(0, import_react121.useEffect)(() => {
|
|
34787
34857
|
if (!isConfigInitialized || !config.isModelSteeringEnabled() || streamingState !== "idle" /* Idle */ || !isMcpReady || isToolAwaitingConfirmation(pendingHistoryItems)) {
|
|
34788
34858
|
return;
|
|
34789
34859
|
}
|
|
@@ -34803,14 +34873,14 @@ ${queuedText}` : queuedText;
|
|
|
34803
34873
|
pendingHistoryItems,
|
|
34804
34874
|
pendingHintCount
|
|
34805
34875
|
]);
|
|
34806
|
-
const allToolCalls = (0,
|
|
34876
|
+
const allToolCalls = (0, import_react121.useMemo)(
|
|
34807
34877
|
() => getAllToolCalls(pendingHistoryItems),
|
|
34808
34878
|
[pendingHistoryItems]
|
|
34809
34879
|
);
|
|
34810
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
34880
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react121.useState)(
|
|
34811
34881
|
config.getGeminiMdFileCount()
|
|
34812
34882
|
);
|
|
34813
|
-
(0,
|
|
34883
|
+
(0, import_react121.useEffect)(() => {
|
|
34814
34884
|
const handleMemoryChanged = (result) => {
|
|
34815
34885
|
setGeminiMdFileCount(result.fileCount);
|
|
34816
34886
|
};
|
|
@@ -34819,7 +34889,7 @@ ${queuedText}` : queuedText;
|
|
|
34819
34889
|
coreEvents.off("memory-changed" /* MemoryChanged */, handleMemoryChanged);
|
|
34820
34890
|
};
|
|
34821
34891
|
}, []);
|
|
34822
|
-
(0,
|
|
34892
|
+
(0, import_react121.useEffect)(() => {
|
|
34823
34893
|
let isMounted = true;
|
|
34824
34894
|
const fetchBannerTexts = async () => {
|
|
34825
34895
|
const [defaultBanner, warningBanner] = await Promise.all([
|
|
@@ -34837,7 +34907,7 @@ ${queuedText}` : queuedText;
|
|
|
34837
34907
|
isMounted = false;
|
|
34838
34908
|
};
|
|
34839
34909
|
}, [config, refreshStatic]);
|
|
34840
|
-
const inputState = (0,
|
|
34910
|
+
const inputState = (0, import_react121.useMemo)(
|
|
34841
34911
|
() => ({
|
|
34842
34912
|
buffer,
|
|
34843
34913
|
userMessages: inputHistory,
|
|
@@ -34857,7 +34927,7 @@ ${queuedText}` : queuedText;
|
|
|
34857
34927
|
suggestionsWidth
|
|
34858
34928
|
]
|
|
34859
34929
|
);
|
|
34860
|
-
const quotaState = (0,
|
|
34930
|
+
const quotaState = (0, import_react121.useMemo)(
|
|
34861
34931
|
() => ({
|
|
34862
34932
|
userTier,
|
|
34863
34933
|
stats: quotaStats,
|
|
@@ -34876,7 +34946,7 @@ ${queuedText}` : queuedText;
|
|
|
34876
34946
|
emptyWalletRequest
|
|
34877
34947
|
]
|
|
34878
34948
|
);
|
|
34879
|
-
const uiState = (0,
|
|
34949
|
+
const uiState = (0, import_react121.useMemo)(
|
|
34880
34950
|
() => ({
|
|
34881
34951
|
history: historyManager.history,
|
|
34882
34952
|
historyManager,
|
|
@@ -35111,11 +35181,11 @@ ${queuedText}` : queuedText;
|
|
|
35111
35181
|
showIsExpandableHint
|
|
35112
35182
|
]
|
|
35113
35183
|
);
|
|
35114
|
-
const exitPrivacyNotice = (0,
|
|
35184
|
+
const exitPrivacyNotice = (0, import_react121.useCallback)(
|
|
35115
35185
|
() => setShowPrivacyNotice(false),
|
|
35116
35186
|
[setShowPrivacyNotice]
|
|
35117
35187
|
);
|
|
35118
|
-
const uiActions = (0,
|
|
35188
|
+
const uiActions = (0, import_react121.useMemo)(
|
|
35119
35189
|
() => ({
|
|
35120
35190
|
handleThemeSelect,
|
|
35121
35191
|
closeThemeDialog,
|
|
@@ -35333,7 +35403,9 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
35333
35403
|
debugMode: config.getDebugMode()
|
|
35334
35404
|
});
|
|
35335
35405
|
consolePatcher.patch();
|
|
35336
|
-
const { stdout: inkStdout, stderr: inkStderr } = createWorkingStdio(
|
|
35406
|
+
const { stdout: inkStdout, stderr: inkStderr } = createWorkingStdio({
|
|
35407
|
+
synchronizedOutput: process.platform !== "win32" || isTmux()
|
|
35408
|
+
});
|
|
35337
35409
|
const isShpool = !!process.env["SHPOOL_SESSION_NAME"];
|
|
35338
35410
|
const AppWrapper = () => {
|
|
35339
35411
|
useKittyKeyboardProtocol();
|
|
@@ -35352,7 +35424,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
35352
35424
|
await new Promise((resolve3) => setTimeout(resolve3, 100));
|
|
35353
35425
|
}
|
|
35354
35426
|
const instance = render_default(
|
|
35355
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
35427
|
+
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, {}),
|
|
35356
35428
|
{
|
|
35357
35429
|
stdout: inkStdout,
|
|
35358
35430
|
stderr: inkStderr,
|
|
@@ -35370,7 +35442,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
35370
35442
|
alternateBuffer: useAlternateBuffer2,
|
|
35371
35443
|
terminalBuffer: config.getUseTerminalBuffer(),
|
|
35372
35444
|
renderProcess: config.getUseRenderProcess() && config.getUseTerminalBuffer(),
|
|
35373
|
-
incrementalRendering: settings.merged.ui.incrementalRendering !== false && useAlternateBuffer2 && !isShpool,
|
|
35445
|
+
incrementalRendering: settings.merged.ui.incrementalRendering !== false && (useAlternateBuffer2 || config.getUseTerminalBuffer()) && !isShpool,
|
|
35374
35446
|
debugRainbow: settings.merged.ui.debugRainbow === true
|
|
35375
35447
|
}
|
|
35376
35448
|
);
|