@rdmind/rdmind 0.0.28-alpha.8 → 0.0.28-alpha.9
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/cli.js +545 -523
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -26803,7 +26803,7 @@ var require_backend = __commonJS({
|
|
|
26803
26803
|
});
|
|
26804
26804
|
return a._currentValue;
|
|
26805
26805
|
}, "useContext"),
|
|
26806
|
-
useEffect: /* @__PURE__ */ __name(function
|
|
26806
|
+
useEffect: /* @__PURE__ */ __name(function useEffect58(a) {
|
|
26807
26807
|
C();
|
|
26808
26808
|
x.push({
|
|
26809
26809
|
primitive: "Effect",
|
|
@@ -26880,7 +26880,7 @@ var require_backend = __commonJS({
|
|
|
26880
26880
|
});
|
|
26881
26881
|
return a;
|
|
26882
26882
|
}, "useRef"),
|
|
26883
|
-
useState: /* @__PURE__ */ __name(function
|
|
26883
|
+
useState: /* @__PURE__ */ __name(function useState67(a) {
|
|
26884
26884
|
var b = C();
|
|
26885
26885
|
a = null !== b ? b.memoizedState : "function" === typeof a ? a() : a;
|
|
26886
26886
|
x.push({
|
|
@@ -184663,7 +184663,7 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
|
|
|
184663
184663
|
};
|
|
184664
184664
|
}
|
|
184665
184665
|
async function createContentGenerator(config, gcConfig, sessionId2, isInitialAuth) {
|
|
184666
|
-
const version2 = "0.0.28-alpha.
|
|
184666
|
+
const version2 = "0.0.28-alpha.9";
|
|
184667
184667
|
const userAgent2 = `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
184668
184668
|
const baseHeaders = {
|
|
184669
184669
|
"User-Agent": userAgent2
|
|
@@ -259065,7 +259065,7 @@ var init_git_commit = __esm({
|
|
|
259065
259065
|
"use strict";
|
|
259066
259066
|
init_esbuild_shims();
|
|
259067
259067
|
GIT_COMMIT_INFO = "8e1bdaa6";
|
|
259068
|
-
CLI_VERSION = "0.0.28-alpha.
|
|
259068
|
+
CLI_VERSION = "0.0.28-alpha.9";
|
|
259069
259069
|
}
|
|
259070
259070
|
});
|
|
259071
259071
|
|
|
@@ -301955,7 +301955,7 @@ init_esbuild_shims();
|
|
|
301955
301955
|
|
|
301956
301956
|
// packages/cli/src/gemini.tsx
|
|
301957
301957
|
init_esbuild_shims();
|
|
301958
|
-
var
|
|
301958
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
301959
301959
|
|
|
301960
301960
|
// node_modules/ink/build/index.js
|
|
301961
301961
|
init_esbuild_shims();
|
|
@@ -308519,7 +308519,7 @@ var measure_element_default = measureElement;
|
|
|
308519
308519
|
|
|
308520
308520
|
// packages/cli/src/ui/AppContainer.tsx
|
|
308521
308521
|
init_esbuild_shims();
|
|
308522
|
-
var
|
|
308522
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
308523
308523
|
|
|
308524
308524
|
// packages/cli/src/ui/App.tsx
|
|
308525
308525
|
init_esbuild_shims();
|
|
@@ -334640,6 +334640,7 @@ init_esbuild_shims();
|
|
|
334640
334640
|
|
|
334641
334641
|
// packages/cli/src/ui/components/Notifications.tsx
|
|
334642
334642
|
init_esbuild_shims();
|
|
334643
|
+
var import_react68 = __toESM(require_react(), 1);
|
|
334643
334644
|
|
|
334644
334645
|
// packages/cli/src/ui/contexts/AppContext.tsx
|
|
334645
334646
|
init_esbuild_shims();
|
|
@@ -334669,10 +334670,31 @@ var UpdateNotification = /* @__PURE__ */ __name(({ message }) => /* @__PURE__ */
|
|
|
334669
334670
|
|
|
334670
334671
|
// packages/cli/src/ui/components/Notifications.tsx
|
|
334671
334672
|
var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
|
|
334673
|
+
var L4_WARNING_AUTO_HIDE_DELAY = 3e3;
|
|
334672
334674
|
var Notifications = /* @__PURE__ */ __name(() => {
|
|
334673
334675
|
const { startupWarnings } = useAppContext();
|
|
334674
334676
|
const { initError, streamingState, updateInfo } = useUIState();
|
|
334675
|
-
const
|
|
334677
|
+
const [hiddenWarnings, setHiddenWarnings] = (0, import_react68.useState)(
|
|
334678
|
+
/* @__PURE__ */ new Set()
|
|
334679
|
+
);
|
|
334680
|
+
const visibleWarnings = startupWarnings.filter(
|
|
334681
|
+
(warning) => !hiddenWarnings.has(warning)
|
|
334682
|
+
);
|
|
334683
|
+
(0, import_react68.useEffect)(() => {
|
|
334684
|
+
const timers = [];
|
|
334685
|
+
startupWarnings.forEach((warning) => {
|
|
334686
|
+
if (warning.includes("L4\u7B49\u7EA7\u4ED3\u5E93") || warning.includes("\u5207\u6362\u5230QS\u5E73\u53F0\u6A21\u578B")) {
|
|
334687
|
+
const timer = setTimeout(() => {
|
|
334688
|
+
setHiddenWarnings((prev) => new Set(prev).add(warning));
|
|
334689
|
+
}, L4_WARNING_AUTO_HIDE_DELAY);
|
|
334690
|
+
timers.push(timer);
|
|
334691
|
+
}
|
|
334692
|
+
});
|
|
334693
|
+
return () => {
|
|
334694
|
+
timers.forEach((timer) => clearTimeout(timer));
|
|
334695
|
+
};
|
|
334696
|
+
}, [startupWarnings]);
|
|
334697
|
+
const showStartupWarnings = visibleWarnings.length > 0;
|
|
334676
334698
|
const showInitError = initError && streamingState !== "responding" /* Responding */;
|
|
334677
334699
|
if (!showStartupWarnings && !showInitError && !updateInfo) {
|
|
334678
334700
|
return null;
|
|
@@ -334687,7 +334709,7 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
334687
334709
|
paddingX: 1,
|
|
334688
334710
|
marginY: 1,
|
|
334689
334711
|
flexDirection: "column",
|
|
334690
|
-
children:
|
|
334712
|
+
children: visibleWarnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Text, { color: theme.status.warning, children: warning }, index))
|
|
334691
334713
|
}
|
|
334692
334714
|
),
|
|
334693
334715
|
showInitError && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
@@ -334807,7 +334829,7 @@ init_esbuild_shims();
|
|
|
334807
334829
|
|
|
334808
334830
|
// node_modules/ink-link/dist/index.js
|
|
334809
334831
|
init_esbuild_shims();
|
|
334810
|
-
var
|
|
334832
|
+
var import_react69 = __toESM(require_react(), 1);
|
|
334811
334833
|
var import_prop_types2 = __toESM(require_prop_types(), 1);
|
|
334812
334834
|
|
|
334813
334835
|
// node_modules/terminal-link/index.js
|
|
@@ -334955,10 +334977,10 @@ terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
|
|
|
334955
334977
|
// node_modules/ink-link/dist/index.js
|
|
334956
334978
|
var Link = /* @__PURE__ */ __name(({ children, url: url2, fallback = true }) => (
|
|
334957
334979
|
// eslint-disable-line react/function-component-definition
|
|
334958
|
-
|
|
334980
|
+
import_react69.default.createElement(
|
|
334959
334981
|
Transform,
|
|
334960
334982
|
{ transform: /* @__PURE__ */ __name((children2) => terminalLink(children2, url2, { fallback }), "transform") },
|
|
334961
|
-
|
|
334983
|
+
import_react69.default.createElement(Text, null, children)
|
|
334962
334984
|
)
|
|
334963
334985
|
), "Link");
|
|
334964
334986
|
Link.propTypes = {
|
|
@@ -335232,7 +335254,7 @@ __name(LoopDetectionConfirmation, "LoopDetectionConfirmation");
|
|
|
335232
335254
|
|
|
335233
335255
|
// packages/cli/src/ui/components/FolderTrustDialog.tsx
|
|
335234
335256
|
init_esbuild_shims();
|
|
335235
|
-
var
|
|
335257
|
+
var import_react70 = __toESM(require_react(), 1);
|
|
335236
335258
|
import * as process26 from "node:process";
|
|
335237
335259
|
import * as path65 from "node:path";
|
|
335238
335260
|
|
|
@@ -335287,7 +335309,7 @@ var FolderTrustDialog = /* @__PURE__ */ __name(({
|
|
|
335287
335309
|
onSelect,
|
|
335288
335310
|
isRestarting
|
|
335289
335311
|
}) => {
|
|
335290
|
-
(0,
|
|
335312
|
+
(0, import_react70.useEffect)(() => {
|
|
335291
335313
|
const doRelaunch = /* @__PURE__ */ __name(async () => {
|
|
335292
335314
|
if (isRestarting) {
|
|
335293
335315
|
setTimeout(async () => {
|
|
@@ -335426,7 +335448,7 @@ var ShellConfirmationDialog = /* @__PURE__ */ __name(({ request: request4 }) =>
|
|
|
335426
335448
|
|
|
335427
335449
|
// packages/cli/src/ui/components/ConsentPrompt.tsx
|
|
335428
335450
|
init_esbuild_shims();
|
|
335429
|
-
var
|
|
335451
|
+
var import_react71 = __toESM(require_react(), 1);
|
|
335430
335452
|
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
|
|
335431
335453
|
var ConsentPrompt = /* @__PURE__ */ __name((props) => {
|
|
335432
335454
|
const { prompt, onConfirm, terminalWidth } = props;
|
|
@@ -335464,7 +335486,7 @@ var ConsentPrompt = /* @__PURE__ */ __name((props) => {
|
|
|
335464
335486
|
|
|
335465
335487
|
// packages/cli/src/ui/components/ThemeDialog.tsx
|
|
335466
335488
|
init_esbuild_shims();
|
|
335467
|
-
var
|
|
335489
|
+
var import_react72 = __toESM(require_react(), 1);
|
|
335468
335490
|
init_settings();
|
|
335469
335491
|
|
|
335470
335492
|
// packages/cli/src/utils/dialogScopeUtils.ts
|
|
@@ -335724,10 +335746,10 @@ function ThemeDialog({
|
|
|
335724
335746
|
availableTerminalHeight,
|
|
335725
335747
|
terminalWidth
|
|
335726
335748
|
}) {
|
|
335727
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
335749
|
+
const [selectedScope, setSelectedScope] = (0, import_react72.useState)(
|
|
335728
335750
|
"User" /* User */
|
|
335729
335751
|
);
|
|
335730
|
-
const [highlightedThemeName, setHighlightedThemeName] = (0,
|
|
335752
|
+
const [highlightedThemeName, setHighlightedThemeName] = (0, import_react72.useState)(settings.merged.ui?.theme || DEFAULT_THEME.name);
|
|
335731
335753
|
const customThemes = selectedScope === "User" /* User */ ? settings.user.settings.ui?.customThemes || {} : settings.merged.ui?.customThemes || {};
|
|
335732
335754
|
const builtInThemes = themeManager.getAvailableThemes().filter((theme2) => theme2.type !== "custom");
|
|
335733
335755
|
const customThemeNames = Object.keys(customThemes);
|
|
@@ -335752,7 +335774,7 @@ function ThemeDialog({
|
|
|
335752
335774
|
(item) => item.value === highlightedThemeName
|
|
335753
335775
|
);
|
|
335754
335776
|
const safeInitialThemeIndex = initialThemeIndex >= 0 ? initialThemeIndex : 0;
|
|
335755
|
-
const handleThemeSelect = (0,
|
|
335777
|
+
const handleThemeSelect = (0, import_react72.useCallback)(
|
|
335756
335778
|
(themeName) => {
|
|
335757
335779
|
onSelect(themeName, selectedScope);
|
|
335758
335780
|
},
|
|
@@ -335762,16 +335784,16 @@ function ThemeDialog({
|
|
|
335762
335784
|
setHighlightedThemeName(themeName);
|
|
335763
335785
|
onHighlight(themeName);
|
|
335764
335786
|
}, "handleThemeHighlight");
|
|
335765
|
-
const handleScopeHighlight = (0,
|
|
335787
|
+
const handleScopeHighlight = (0, import_react72.useCallback)((scope) => {
|
|
335766
335788
|
setSelectedScope(scope);
|
|
335767
335789
|
}, []);
|
|
335768
|
-
const handleScopeSelect = (0,
|
|
335790
|
+
const handleScopeSelect = (0, import_react72.useCallback)(
|
|
335769
335791
|
(scope) => {
|
|
335770
335792
|
onSelect(highlightedThemeName, scope);
|
|
335771
335793
|
},
|
|
335772
335794
|
[onSelect, highlightedThemeName]
|
|
335773
335795
|
);
|
|
335774
|
-
const [mode, setMode] = (0,
|
|
335796
|
+
const [mode, setMode] = (0, import_react72.useState)("theme");
|
|
335775
335797
|
useKeypress(
|
|
335776
335798
|
(key) => {
|
|
335777
335799
|
if (key.name === "tab") {
|
|
@@ -335928,32 +335950,32 @@ __name(ThemeDialog, "ThemeDialog");
|
|
|
335928
335950
|
|
|
335929
335951
|
// packages/cli/src/ui/components/SettingsDialog.tsx
|
|
335930
335952
|
init_esbuild_shims();
|
|
335931
|
-
var
|
|
335953
|
+
var import_react74 = __toESM(require_react(), 1);
|
|
335932
335954
|
init_settings();
|
|
335933
335955
|
|
|
335934
335956
|
// packages/cli/src/ui/contexts/VimModeContext.tsx
|
|
335935
335957
|
init_esbuild_shims();
|
|
335936
|
-
var
|
|
335958
|
+
var import_react73 = __toESM(require_react(), 1);
|
|
335937
335959
|
init_settings();
|
|
335938
335960
|
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
|
|
335939
|
-
var VimModeContext = (0,
|
|
335961
|
+
var VimModeContext = (0, import_react73.createContext)(void 0);
|
|
335940
335962
|
var VimModeProvider = /* @__PURE__ */ __name(({
|
|
335941
335963
|
children,
|
|
335942
335964
|
settings
|
|
335943
335965
|
}) => {
|
|
335944
335966
|
const initialVimEnabled = settings.merged.general?.vimMode ?? false;
|
|
335945
|
-
const [vimEnabled, setVimEnabled] = (0,
|
|
335946
|
-
const [vimMode, setVimMode] = (0,
|
|
335967
|
+
const [vimEnabled, setVimEnabled] = (0, import_react73.useState)(initialVimEnabled);
|
|
335968
|
+
const [vimMode, setVimMode] = (0, import_react73.useState)(
|
|
335947
335969
|
initialVimEnabled ? "NORMAL" : "INSERT"
|
|
335948
335970
|
);
|
|
335949
|
-
(0,
|
|
335971
|
+
(0, import_react73.useEffect)(() => {
|
|
335950
335972
|
const enabled = settings.merged.general?.vimMode ?? false;
|
|
335951
335973
|
setVimEnabled(enabled);
|
|
335952
335974
|
if (enabled) {
|
|
335953
335975
|
setVimMode("NORMAL");
|
|
335954
335976
|
}
|
|
335955
335977
|
}, [settings.merged.general?.vimMode]);
|
|
335956
|
-
const toggleVimEnabled = (0,
|
|
335978
|
+
const toggleVimEnabled = (0, import_react73.useCallback)(async () => {
|
|
335957
335979
|
const newValue = !vimEnabled;
|
|
335958
335980
|
setVimEnabled(newValue);
|
|
335959
335981
|
if (newValue) {
|
|
@@ -335971,7 +335993,7 @@ var VimModeProvider = /* @__PURE__ */ __name(({
|
|
|
335971
335993
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(VimModeContext.Provider, { value, children });
|
|
335972
335994
|
}, "VimModeProvider");
|
|
335973
335995
|
var useVimMode = /* @__PURE__ */ __name(() => {
|
|
335974
|
-
const context2 = (0,
|
|
335996
|
+
const context2 = (0, import_react73.useContext)(VimModeContext);
|
|
335975
335997
|
if (context2 === void 0) {
|
|
335976
335998
|
throw new Error("useVimMode must be used within a VimModeProvider");
|
|
335977
335999
|
}
|
|
@@ -335992,27 +336014,27 @@ function SettingsDialog({
|
|
|
335992
336014
|
config
|
|
335993
336015
|
}) {
|
|
335994
336016
|
const { vimEnabled, toggleVimEnabled } = useVimMode();
|
|
335995
|
-
const [focusSection, setFocusSection] = (0,
|
|
336017
|
+
const [focusSection, setFocusSection] = (0, import_react74.useState)(
|
|
335996
336018
|
"settings"
|
|
335997
336019
|
);
|
|
335998
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
336020
|
+
const [selectedScope, setSelectedScope] = (0, import_react74.useState)(
|
|
335999
336021
|
"User" /* User */
|
|
336000
336022
|
);
|
|
336001
|
-
const [activeSettingIndex, setActiveSettingIndex] = (0,
|
|
336002
|
-
const [scrollOffset, setScrollOffset] = (0,
|
|
336003
|
-
const [showRestartPrompt, setShowRestartPrompt] = (0,
|
|
336004
|
-
const [pendingSettings, setPendingSettings] = (0,
|
|
336023
|
+
const [activeSettingIndex, setActiveSettingIndex] = (0, import_react74.useState)(0);
|
|
336024
|
+
const [scrollOffset, setScrollOffset] = (0, import_react74.useState)(0);
|
|
336025
|
+
const [showRestartPrompt, setShowRestartPrompt] = (0, import_react74.useState)(false);
|
|
336026
|
+
const [pendingSettings, setPendingSettings] = (0, import_react74.useState)(
|
|
336005
336027
|
() => (
|
|
336006
336028
|
// Deep clone to avoid mutation
|
|
336007
336029
|
structuredClone(settings.forScope(selectedScope).settings)
|
|
336008
336030
|
)
|
|
336009
336031
|
);
|
|
336010
|
-
const [modifiedSettings, setModifiedSettings] = (0,
|
|
336032
|
+
const [modifiedSettings, setModifiedSettings] = (0, import_react74.useState)(
|
|
336011
336033
|
/* @__PURE__ */ new Set()
|
|
336012
336034
|
);
|
|
336013
|
-
const [globalPendingChanges, setGlobalPendingChanges] = (0,
|
|
336014
|
-
const [_restartRequiredSettings, setRestartRequiredSettings] = (0,
|
|
336015
|
-
(0,
|
|
336035
|
+
const [globalPendingChanges, setGlobalPendingChanges] = (0, import_react74.useState)(/* @__PURE__ */ new Map());
|
|
336036
|
+
const [_restartRequiredSettings, setRestartRequiredSettings] = (0, import_react74.useState)(/* @__PURE__ */ new Set());
|
|
336037
|
+
(0, import_react74.useEffect)(() => {
|
|
336016
336038
|
let updated = structuredClone(settings.forScope(selectedScope).settings);
|
|
336017
336039
|
const newModified = /* @__PURE__ */ new Set();
|
|
336018
336040
|
const newRestartRequired = /* @__PURE__ */ new Set();
|
|
@@ -336147,11 +336169,11 @@ function SettingsDialog({
|
|
|
336147
336169
|
});
|
|
336148
336170
|
}, "generateSettingsItems");
|
|
336149
336171
|
const items = generateSettingsItems();
|
|
336150
|
-
const [editingKey, setEditingKey] = (0,
|
|
336151
|
-
const [editBuffer, setEditBuffer] = (0,
|
|
336152
|
-
const [editCursorPos, setEditCursorPos] = (0,
|
|
336153
|
-
const [cursorVisible, setCursorVisible] = (0,
|
|
336154
|
-
(0,
|
|
336172
|
+
const [editingKey, setEditingKey] = (0, import_react74.useState)(null);
|
|
336173
|
+
const [editBuffer, setEditBuffer] = (0, import_react74.useState)("");
|
|
336174
|
+
const [editCursorPos, setEditCursorPos] = (0, import_react74.useState)(0);
|
|
336175
|
+
const [cursorVisible, setCursorVisible] = (0, import_react74.useState)(true);
|
|
336176
|
+
(0, import_react74.useEffect)(() => {
|
|
336155
336177
|
if (!editingKey) {
|
|
336156
336178
|
setCursorVisible(true);
|
|
336157
336179
|
return;
|
|
@@ -336288,7 +336310,7 @@ function SettingsDialog({
|
|
|
336288
336310
|
maxVisibleItems = Math.max(1, Math.floor(availableHeightForSettings / 2));
|
|
336289
336311
|
}
|
|
336290
336312
|
const effectiveMaxItemsToShow = availableTerminalHeight ? Math.min(maxVisibleItems, items.length) : maxItemsToShow;
|
|
336291
|
-
|
|
336313
|
+
import_react74.default.useEffect(() => {
|
|
336292
336314
|
if (!showScopeSelection && focusSection === "scope") {
|
|
336293
336315
|
setFocusSection("settings");
|
|
336294
336316
|
}
|
|
@@ -336596,7 +336618,7 @@ function SettingsDialog({
|
|
|
336596
336618
|
selectedScope,
|
|
336597
336619
|
settings
|
|
336598
336620
|
);
|
|
336599
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
336621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_react74.default.Fragment, { children: [
|
|
336600
336622
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(Box_default, { flexDirection: "row", alignItems: "center", children: [
|
|
336601
336623
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Box_default, { minWidth: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
336602
336624
|
Text,
|
|
@@ -336656,7 +336678,7 @@ __name(SettingsDialog, "SettingsDialog");
|
|
|
336656
336678
|
|
|
336657
336679
|
// packages/cli/src/ui/components/QwenOAuthProgress.tsx
|
|
336658
336680
|
init_esbuild_shims();
|
|
336659
|
-
var
|
|
336681
|
+
var import_react75 = __toESM(require_react(), 1);
|
|
336660
336682
|
var import_qrcode_terminal = __toESM(require_main2(), 1);
|
|
336661
336683
|
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
|
|
336662
336684
|
function QrCodeDisplay({
|
|
@@ -336728,9 +336750,9 @@ function QwenOAuthProgress({
|
|
|
336728
336750
|
authMessage
|
|
336729
336751
|
}) {
|
|
336730
336752
|
const defaultTimeout = deviceAuth?.expires_in || 300;
|
|
336731
|
-
const [timeRemaining, setTimeRemaining] = (0,
|
|
336732
|
-
const [dots, setDots] = (0,
|
|
336733
|
-
const [qrCodeData, setQrCodeData] = (0,
|
|
336753
|
+
const [timeRemaining, setTimeRemaining] = (0, import_react75.useState)(defaultTimeout);
|
|
336754
|
+
const [dots, setDots] = (0, import_react75.useState)("");
|
|
336755
|
+
const [qrCodeData, setQrCodeData] = (0, import_react75.useState)(null);
|
|
336734
336756
|
useKeypress(
|
|
336735
336757
|
(key) => {
|
|
336736
336758
|
if (authStatus === "timeout" || authStatus === "error") {
|
|
@@ -336741,7 +336763,7 @@ function QwenOAuthProgress({
|
|
|
336741
336763
|
},
|
|
336742
336764
|
{ isActive: true }
|
|
336743
336765
|
);
|
|
336744
|
-
(0,
|
|
336766
|
+
(0, import_react75.useEffect)(() => {
|
|
336745
336767
|
if (!deviceAuth?.verification_uri_complete) {
|
|
336746
336768
|
return;
|
|
336747
336769
|
}
|
|
@@ -336761,7 +336783,7 @@ function QwenOAuthProgress({
|
|
|
336761
336783
|
}, "generateQR");
|
|
336762
336784
|
generateQR();
|
|
336763
336785
|
}, [deviceAuth?.verification_uri_complete]);
|
|
336764
|
-
(0,
|
|
336786
|
+
(0, import_react75.useEffect)(() => {
|
|
336765
336787
|
const timer = setInterval(() => {
|
|
336766
336788
|
setTimeRemaining((prev) => {
|
|
336767
336789
|
if (prev <= 1) {
|
|
@@ -336773,7 +336795,7 @@ function QwenOAuthProgress({
|
|
|
336773
336795
|
}, 1e3);
|
|
336774
336796
|
return () => clearInterval(timer);
|
|
336775
336797
|
}, [onTimeout]);
|
|
336776
|
-
(0,
|
|
336798
|
+
(0, import_react75.useEffect)(() => {
|
|
336777
336799
|
const dotsTimer = setInterval(() => {
|
|
336778
336800
|
setDots((prev) => {
|
|
336779
336801
|
if (prev.length >= 3) return "";
|
|
@@ -336782,7 +336804,7 @@ function QwenOAuthProgress({
|
|
|
336782
336804
|
}, 500);
|
|
336783
336805
|
return () => clearInterval(dotsTimer);
|
|
336784
336806
|
}, []);
|
|
336785
|
-
const qrCodeDisplay = (0,
|
|
336807
|
+
const qrCodeDisplay = (0, import_react75.useMemo)(() => {
|
|
336786
336808
|
if (!deviceAuth?.verification_uri_complete) return null;
|
|
336787
336809
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
336788
336810
|
QrCodeDisplay,
|
|
@@ -336862,13 +336884,13 @@ __name(QwenOAuthProgress, "QwenOAuthProgress");
|
|
|
336862
336884
|
|
|
336863
336885
|
// packages/cli/src/ui/auth/AuthDialog.tsx
|
|
336864
336886
|
init_esbuild_shims();
|
|
336865
|
-
var
|
|
336887
|
+
var import_react78 = __toESM(require_react(), 1);
|
|
336866
336888
|
init_core2();
|
|
336867
336889
|
init_settings();
|
|
336868
336890
|
|
|
336869
336891
|
// packages/cli/src/ui/contexts/UIActionsContext.tsx
|
|
336870
336892
|
init_esbuild_shims();
|
|
336871
|
-
var
|
|
336893
|
+
var import_react77 = __toESM(require_react(), 1);
|
|
336872
336894
|
init_core2();
|
|
336873
336895
|
init_settings();
|
|
336874
336896
|
|
|
@@ -336938,7 +336960,7 @@ var ModelSwitchDialog = /* @__PURE__ */ __name(({
|
|
|
336938
336960
|
|
|
336939
336961
|
// packages/cli/src/ui/components/OpenAIKeyPrompt.tsx
|
|
336940
336962
|
init_esbuild_shims();
|
|
336941
|
-
var
|
|
336963
|
+
var import_react76 = __toESM(require_react(), 1);
|
|
336942
336964
|
init_zod();
|
|
336943
336965
|
var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
|
|
336944
336966
|
var credentialSchema = external_exports.object({
|
|
@@ -336953,11 +336975,11 @@ function OpenAIKeyPrompt({
|
|
|
336953
336975
|
defaultBaseUrl,
|
|
336954
336976
|
defaultModel
|
|
336955
336977
|
}) {
|
|
336956
|
-
const [apiKey, setApiKey] = (0,
|
|
336957
|
-
const [baseUrl, setBaseUrl] = (0,
|
|
336958
|
-
const [model, setModel] = (0,
|
|
336959
|
-
const [currentField, setCurrentField] = (0,
|
|
336960
|
-
const [validationError, setValidationError] = (0,
|
|
336978
|
+
const [apiKey, setApiKey] = (0, import_react76.useState)(defaultApiKey || "");
|
|
336979
|
+
const [baseUrl, setBaseUrl] = (0, import_react76.useState)(defaultBaseUrl || "");
|
|
336980
|
+
const [model, setModel] = (0, import_react76.useState)(defaultModel || "");
|
|
336981
|
+
const [currentField, setCurrentField] = (0, import_react76.useState)("apiKey");
|
|
336982
|
+
const [validationError, setValidationError] = (0, import_react76.useState)(null);
|
|
336961
336983
|
const validateAndSubmit = /* @__PURE__ */ __name(() => {
|
|
336962
336984
|
setValidationError(null);
|
|
336963
336985
|
try {
|
|
@@ -337130,9 +337152,9 @@ function OpenAIKeyPrompt({
|
|
|
337130
337152
|
__name(OpenAIKeyPrompt, "OpenAIKeyPrompt");
|
|
337131
337153
|
|
|
337132
337154
|
// packages/cli/src/ui/contexts/UIActionsContext.tsx
|
|
337133
|
-
var UIActionsContext = (0,
|
|
337155
|
+
var UIActionsContext = (0, import_react77.createContext)(null);
|
|
337134
337156
|
var useUIActions = /* @__PURE__ */ __name(() => {
|
|
337135
|
-
const context2 = (0,
|
|
337157
|
+
const context2 = (0, import_react77.useContext)(UIActionsContext);
|
|
337136
337158
|
if (!context2) {
|
|
337137
337159
|
throw new Error("useUIActions must be used within a UIActionsProvider");
|
|
337138
337160
|
}
|
|
@@ -337152,8 +337174,8 @@ function AuthDialog() {
|
|
|
337152
337174
|
const { pendingAuthType, authError } = useUIState();
|
|
337153
337175
|
const { handleAuthSelect: onAuthSelect } = useUIActions();
|
|
337154
337176
|
const settings = useSettings();
|
|
337155
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
337156
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
337177
|
+
const [errorMessage, setErrorMessage] = (0, import_react78.useState)(null);
|
|
337178
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react78.useState)(null);
|
|
337157
337179
|
const items = [
|
|
337158
337180
|
{ key: "xhs-sso" /* XHS_SSO */, label: "\u5C0F\u7EA2\u4E66 SSO", value: "xhs-sso" /* XHS_SSO */ },
|
|
337159
337181
|
{
|
|
@@ -337241,7 +337263,7 @@ __name(AuthDialog, "AuthDialog");
|
|
|
337241
337263
|
|
|
337242
337264
|
// packages/cli/src/ui/components/EditorSettingsDialog.tsx
|
|
337243
337265
|
init_esbuild_shims();
|
|
337244
|
-
var
|
|
337266
|
+
var import_react79 = __toESM(require_react(), 1);
|
|
337245
337267
|
|
|
337246
337268
|
// packages/cli/src/ui/editors/editorSettingsManager.ts
|
|
337247
337269
|
init_esbuild_shims();
|
|
@@ -337300,10 +337322,10 @@ function EditorSettingsDialog({
|
|
|
337300
337322
|
settings,
|
|
337301
337323
|
onExit
|
|
337302
337324
|
}) {
|
|
337303
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
337325
|
+
const [selectedScope, setSelectedScope] = (0, import_react79.useState)(
|
|
337304
337326
|
"User" /* User */
|
|
337305
337327
|
);
|
|
337306
|
-
const [focusedSection, setFocusedSection] = (0,
|
|
337328
|
+
const [focusedSection, setFocusedSection] = (0, import_react79.useState)(
|
|
337307
337329
|
"editor"
|
|
337308
337330
|
);
|
|
337309
337331
|
useKeypress(
|
|
@@ -337434,12 +337456,12 @@ __name(EditorSettingsDialog, "EditorSettingsDialog");
|
|
|
337434
337456
|
// packages/cli/src/ui/components/WorkspaceMigrationDialog.tsx
|
|
337435
337457
|
init_esbuild_shims();
|
|
337436
337458
|
init_extension();
|
|
337437
|
-
var
|
|
337459
|
+
var import_react80 = __toESM(require_react(), 1);
|
|
337438
337460
|
var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
|
|
337439
337461
|
function WorkspaceMigrationDialog(props) {
|
|
337440
337462
|
const { workspaceExtensions, onOpen, onClose } = props;
|
|
337441
|
-
const [migrationComplete, setMigrationComplete] = (0,
|
|
337442
|
-
const [failedExtensions, setFailedExtensions] = (0,
|
|
337463
|
+
const [migrationComplete, setMigrationComplete] = (0, import_react80.useState)(false);
|
|
337464
|
+
const [failedExtensions, setFailedExtensions] = (0, import_react80.useState)([]);
|
|
337443
337465
|
onOpen();
|
|
337444
337466
|
const onMigrate = /* @__PURE__ */ __name(async () => {
|
|
337445
337467
|
const failed = await performWorkspaceExtensionMigration(
|
|
@@ -337564,7 +337586,7 @@ init_trustedFolders();
|
|
|
337564
337586
|
|
|
337565
337587
|
// packages/cli/src/ui/hooks/usePermissionsModifyTrust.ts
|
|
337566
337588
|
init_esbuild_shims();
|
|
337567
|
-
var
|
|
337589
|
+
var import_react81 = __toESM(require_react(), 1);
|
|
337568
337590
|
init_trustedFolders();
|
|
337569
337591
|
import * as process28 from "node:process";
|
|
337570
337592
|
function getInitialTrustState(settings, cwd7) {
|
|
@@ -337582,20 +337604,20 @@ __name(getInitialTrustState, "getInitialTrustState");
|
|
|
337582
337604
|
var usePermissionsModifyTrust = /* @__PURE__ */ __name((onExit, addItem) => {
|
|
337583
337605
|
const settings = useSettings();
|
|
337584
337606
|
const cwd7 = process28.cwd();
|
|
337585
|
-
const [initialState2] = (0,
|
|
337586
|
-
const [currentTrustLevel] = (0,
|
|
337607
|
+
const [initialState2] = (0, import_react81.useState)(() => getInitialTrustState(settings, cwd7));
|
|
337608
|
+
const [currentTrustLevel] = (0, import_react81.useState)(
|
|
337587
337609
|
initialState2.currentTrustLevel
|
|
337588
337610
|
);
|
|
337589
|
-
const [pendingTrustLevel, setPendingTrustLevel] = (0,
|
|
337590
|
-
const [isInheritedTrustFromParent] = (0,
|
|
337611
|
+
const [pendingTrustLevel, setPendingTrustLevel] = (0, import_react81.useState)();
|
|
337612
|
+
const [isInheritedTrustFromParent] = (0, import_react81.useState)(
|
|
337591
337613
|
initialState2.isInheritedTrustFromParent
|
|
337592
337614
|
);
|
|
337593
|
-
const [isInheritedTrustFromIde] = (0,
|
|
337615
|
+
const [isInheritedTrustFromIde] = (0, import_react81.useState)(
|
|
337594
337616
|
initialState2.isInheritedTrustFromIde
|
|
337595
337617
|
);
|
|
337596
|
-
const [needsRestart, setNeedsRestart] = (0,
|
|
337618
|
+
const [needsRestart, setNeedsRestart] = (0, import_react81.useState)(false);
|
|
337597
337619
|
const isFolderTrustEnabled2 = !!settings.merged.security?.folderTrust?.enabled;
|
|
337598
|
-
const updateTrustLevel = (0,
|
|
337620
|
+
const updateTrustLevel = (0, import_react81.useCallback)(
|
|
337599
337621
|
(trustLevel) => {
|
|
337600
337622
|
const wasTrusted = isWorkspaceTrusted(settings.merged).isTrusted;
|
|
337601
337623
|
const currentConfig = loadTrustedFolders().user.config;
|
|
@@ -337628,7 +337650,7 @@ var usePermissionsModifyTrust = /* @__PURE__ */ __name((onExit, addItem) => {
|
|
|
337628
337650
|
},
|
|
337629
337651
|
[cwd7, settings.merged, onExit, addItem]
|
|
337630
337652
|
);
|
|
337631
|
-
const commitTrustLevelChange = (0,
|
|
337653
|
+
const commitTrustLevelChange = (0, import_react81.useCallback)(() => {
|
|
337632
337654
|
if (pendingTrustLevel) {
|
|
337633
337655
|
const folders = loadTrustedFolders();
|
|
337634
337656
|
folders.setValue(cwd7, pendingTrustLevel);
|
|
@@ -337741,7 +337763,7 @@ __name(PermissionsModifyTrustDialog, "PermissionsModifyTrustDialog");
|
|
|
337741
337763
|
|
|
337742
337764
|
// packages/cli/src/ui/components/ModelDialog.tsx
|
|
337743
337765
|
init_esbuild_shims();
|
|
337744
|
-
var
|
|
337766
|
+
var import_react83 = __toESM(require_react(), 1);
|
|
337745
337767
|
|
|
337746
337768
|
// packages/cli/src/ui/components/shared/DescriptiveRadioButtonSelect.tsx
|
|
337747
337769
|
init_esbuild_shims();
|
|
@@ -337825,7 +337847,7 @@ __name(isVisionModel, "isVisionModel");
|
|
|
337825
337847
|
|
|
337826
337848
|
// packages/cli/src/ui/components/XhsSsoModelConfigFlow.tsx
|
|
337827
337849
|
init_esbuild_shims();
|
|
337828
|
-
var
|
|
337850
|
+
var import_react82 = __toESM(require_react(), 1);
|
|
337829
337851
|
|
|
337830
337852
|
// packages/cli/src/config/xhsSsoProviders.ts
|
|
337831
337853
|
init_esbuild_shims();
|
|
@@ -337861,9 +337883,9 @@ function XhsSsoModelConfigFlow({
|
|
|
337861
337883
|
onCancel,
|
|
337862
337884
|
rdmindSsoId
|
|
337863
337885
|
}) {
|
|
337864
|
-
const config = (0,
|
|
337865
|
-
const [isLoading, setIsLoading] = (0,
|
|
337866
|
-
const [error, setError] = (0,
|
|
337886
|
+
const config = (0, import_react82.useContext)(ConfigContext);
|
|
337887
|
+
const [isLoading, setIsLoading] = (0, import_react82.useState)(false);
|
|
337888
|
+
const [error, setError] = (0, import_react82.useState)(null);
|
|
337867
337889
|
useKeypress(
|
|
337868
337890
|
(key) => {
|
|
337869
337891
|
if (key.name === "escape" && !isLoading) {
|
|
@@ -337872,7 +337894,7 @@ function XhsSsoModelConfigFlow({
|
|
|
337872
337894
|
},
|
|
337873
337895
|
{ isActive: true }
|
|
337874
337896
|
);
|
|
337875
|
-
const modelItems = (0,
|
|
337897
|
+
const modelItems = (0, import_react82.useMemo)(
|
|
337876
337898
|
() => XHS_SSO_MODELS.map((model) => ({
|
|
337877
337899
|
key: model.id,
|
|
337878
337900
|
value: model,
|
|
@@ -337882,7 +337904,7 @@ function XhsSsoModelConfigFlow({
|
|
|
337882
337904
|
[]
|
|
337883
337905
|
);
|
|
337884
337906
|
const currentModel = config?.getModel();
|
|
337885
|
-
const initialIndex = (0,
|
|
337907
|
+
const initialIndex = (0, import_react82.useMemo)(() => {
|
|
337886
337908
|
if (!currentModel) {
|
|
337887
337909
|
return 0;
|
|
337888
337910
|
}
|
|
@@ -337972,14 +337994,14 @@ init_settings();
|
|
|
337972
337994
|
init_core2();
|
|
337973
337995
|
var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1);
|
|
337974
337996
|
function ModelDialog({ onClose }) {
|
|
337975
|
-
const config = (0,
|
|
337976
|
-
const settings = (0,
|
|
337997
|
+
const config = (0, import_react83.useContext)(ConfigContext);
|
|
337998
|
+
const settings = (0, import_react83.useContext)(SettingsContext);
|
|
337977
337999
|
const authType = config?.getAuthType() ?? "qwen-oauth" /* QWEN_OAUTH */;
|
|
337978
|
-
const availableModels = (0,
|
|
338000
|
+
const availableModels = (0, import_react83.useMemo)(
|
|
337979
338001
|
() => getAvailableModelsForAuthType(authType),
|
|
337980
338002
|
[authType]
|
|
337981
338003
|
);
|
|
337982
|
-
const MODEL_OPTIONS = (0,
|
|
338004
|
+
const MODEL_OPTIONS = (0, import_react83.useMemo)(
|
|
337983
338005
|
() => availableModels.map((model) => ({
|
|
337984
338006
|
value: model.id,
|
|
337985
338007
|
title: model.label,
|
|
@@ -337989,11 +338011,11 @@ function ModelDialog({ onClose }) {
|
|
|
337989
338011
|
[availableModels]
|
|
337990
338012
|
);
|
|
337991
338013
|
const preferredModel = config?.getModel() || MAINLINE_CODER;
|
|
337992
|
-
const initialIndex = (0,
|
|
338014
|
+
const initialIndex = (0, import_react83.useMemo)(
|
|
337993
338015
|
() => MODEL_OPTIONS.findIndex((option2) => option2.value === preferredModel),
|
|
337994
338016
|
[MODEL_OPTIONS, preferredModel]
|
|
337995
338017
|
);
|
|
337996
|
-
const handleSelect = (0,
|
|
338018
|
+
const handleSelect = (0, import_react83.useCallback)(
|
|
337997
338019
|
(model) => {
|
|
337998
338020
|
if (config) {
|
|
337999
338021
|
config.setModel(model);
|
|
@@ -338012,7 +338034,7 @@ function ModelDialog({ onClose }) {
|
|
|
338012
338034
|
},
|
|
338013
338035
|
{ isActive: true }
|
|
338014
338036
|
);
|
|
338015
|
-
const handleOpenAIConfigSubmit = (0,
|
|
338037
|
+
const handleOpenAIConfigSubmit = (0, import_react83.useCallback)(
|
|
338016
338038
|
async (apiKey, baseUrl, model) => {
|
|
338017
338039
|
if (config && settings) {
|
|
338018
338040
|
config.updateCredentials({
|
|
@@ -338037,7 +338059,7 @@ function ModelDialog({ onClose }) {
|
|
|
338037
338059
|
},
|
|
338038
338060
|
[config, settings, onClose]
|
|
338039
338061
|
);
|
|
338040
|
-
const handleXhsSsoConfigComplete = (0,
|
|
338062
|
+
const handleXhsSsoConfigComplete = (0, import_react83.useCallback)(
|
|
338041
338063
|
async (xhsSsoConfig) => {
|
|
338042
338064
|
if (config && settings) {
|
|
338043
338065
|
config.updateCredentials({
|
|
@@ -338109,7 +338131,7 @@ __name(ModelDialog, "ModelDialog");
|
|
|
338109
338131
|
|
|
338110
338132
|
// packages/cli/src/ui/components/ApprovalModeDialog.tsx
|
|
338111
338133
|
init_esbuild_shims();
|
|
338112
|
-
var
|
|
338134
|
+
var import_react84 = __toESM(require_react(), 1);
|
|
338113
338135
|
init_core2();
|
|
338114
338136
|
init_settings();
|
|
338115
338137
|
var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -338133,10 +338155,10 @@ function ApprovalModeDialog({
|
|
|
338133
338155
|
currentMode,
|
|
338134
338156
|
availableTerminalHeight: _availableTerminalHeight
|
|
338135
338157
|
}) {
|
|
338136
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
338158
|
+
const [selectedScope, setSelectedScope] = (0, import_react84.useState)(
|
|
338137
338159
|
"User" /* User */
|
|
338138
338160
|
);
|
|
338139
|
-
const [highlightedMode, setHighlightedMode] = (0,
|
|
338161
|
+
const [highlightedMode, setHighlightedMode] = (0, import_react84.useState)(
|
|
338140
338162
|
currentMode || "default" /* DEFAULT */
|
|
338141
338163
|
);
|
|
338142
338164
|
const modeItems = APPROVAL_MODES.map((mode) => ({
|
|
@@ -338148,7 +338170,7 @@ function ApprovalModeDialog({
|
|
|
338148
338170
|
(item) => item.value === highlightedMode
|
|
338149
338171
|
);
|
|
338150
338172
|
const safeInitialModeIndex = initialModeIndex >= 0 ? initialModeIndex : 0;
|
|
338151
|
-
const handleModeSelect = (0,
|
|
338173
|
+
const handleModeSelect = (0, import_react84.useCallback)(
|
|
338152
338174
|
(mode) => {
|
|
338153
338175
|
onSelect(mode, selectedScope);
|
|
338154
338176
|
},
|
|
@@ -338157,16 +338179,16 @@ function ApprovalModeDialog({
|
|
|
338157
338179
|
const handleModeHighlight = /* @__PURE__ */ __name((mode) => {
|
|
338158
338180
|
setHighlightedMode(mode);
|
|
338159
338181
|
}, "handleModeHighlight");
|
|
338160
|
-
const handleScopeHighlight = (0,
|
|
338182
|
+
const handleScopeHighlight = (0, import_react84.useCallback)((scope) => {
|
|
338161
338183
|
setSelectedScope(scope);
|
|
338162
338184
|
}, []);
|
|
338163
|
-
const handleScopeSelect = (0,
|
|
338185
|
+
const handleScopeSelect = (0, import_react84.useCallback)(
|
|
338164
338186
|
(scope) => {
|
|
338165
338187
|
onSelect(highlightedMode, scope);
|
|
338166
338188
|
},
|
|
338167
338189
|
[onSelect, highlightedMode]
|
|
338168
338190
|
);
|
|
338169
|
-
const [focusSection, setFocusSection] = (0,
|
|
338191
|
+
const [focusSection, setFocusSection] = (0, import_react84.useState)("mode");
|
|
338170
338192
|
useKeypress(
|
|
338171
338193
|
(key) => {
|
|
338172
338194
|
if (key.name === "tab") {
|
|
@@ -338667,7 +338689,7 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
338667
338689
|
|
|
338668
338690
|
// packages/cli/src/ui/components/Composer.tsx
|
|
338669
338691
|
init_esbuild_shims();
|
|
338670
|
-
var
|
|
338692
|
+
var import_react98 = __toESM(require_react(), 1);
|
|
338671
338693
|
|
|
338672
338694
|
// packages/cli/src/ui/components/LoadingIndicator.tsx
|
|
338673
338695
|
init_esbuild_shims();
|
|
@@ -338913,14 +338935,14 @@ var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, wid
|
|
|
338913
338935
|
|
|
338914
338936
|
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
338915
338937
|
init_esbuild_shims();
|
|
338916
|
-
var
|
|
338938
|
+
var import_react94 = __toESM(require_react(), 1);
|
|
338917
338939
|
|
|
338918
338940
|
// packages/cli/src/ui/components/SuggestionsDisplay.tsx
|
|
338919
338941
|
init_esbuild_shims();
|
|
338920
338942
|
|
|
338921
338943
|
// packages/cli/src/ui/components/PrepareLabel.tsx
|
|
338922
338944
|
init_esbuild_shims();
|
|
338923
|
-
var
|
|
338945
|
+
var import_react85 = __toESM(require_react(), 1);
|
|
338924
338946
|
var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1);
|
|
338925
338947
|
var MAX_WIDTH = 150;
|
|
338926
338948
|
var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
@@ -338986,7 +339008,7 @@ var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
|
338986
339008
|
after
|
|
338987
339009
|
] });
|
|
338988
339010
|
}, "_PrepareLabel");
|
|
338989
|
-
var PrepareLabel =
|
|
339011
|
+
var PrepareLabel = import_react85.default.memo(_PrepareLabel);
|
|
338990
339012
|
|
|
338991
339013
|
// packages/cli/src/ui/components/SuggestionsDisplay.tsx
|
|
338992
339014
|
var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -339065,7 +339087,7 @@ __name(SuggestionsDisplay, "SuggestionsDisplay");
|
|
|
339065
339087
|
|
|
339066
339088
|
// packages/cli/src/ui/hooks/useInputHistory.ts
|
|
339067
339089
|
init_esbuild_shims();
|
|
339068
|
-
var
|
|
339090
|
+
var import_react86 = __toESM(require_react(), 1);
|
|
339069
339091
|
function useInputHistory({
|
|
339070
339092
|
userMessages,
|
|
339071
339093
|
onSubmit,
|
|
@@ -339073,13 +339095,13 @@ function useInputHistory({
|
|
|
339073
339095
|
currentQuery,
|
|
339074
339096
|
onChange
|
|
339075
339097
|
}) {
|
|
339076
|
-
const [historyIndex, setHistoryIndex] = (0,
|
|
339077
|
-
const [originalQueryBeforeNav, setOriginalQueryBeforeNav] = (0,
|
|
339078
|
-
const resetHistoryNav = (0,
|
|
339098
|
+
const [historyIndex, setHistoryIndex] = (0, import_react86.useState)(-1);
|
|
339099
|
+
const [originalQueryBeforeNav, setOriginalQueryBeforeNav] = (0, import_react86.useState)("");
|
|
339100
|
+
const resetHistoryNav = (0, import_react86.useCallback)(() => {
|
|
339079
339101
|
setHistoryIndex(-1);
|
|
339080
339102
|
setOriginalQueryBeforeNav("");
|
|
339081
339103
|
}, []);
|
|
339082
|
-
const handleSubmit = (0,
|
|
339104
|
+
const handleSubmit = (0, import_react86.useCallback)(
|
|
339083
339105
|
(value) => {
|
|
339084
339106
|
const trimmedValue = value.trim();
|
|
339085
339107
|
if (trimmedValue) {
|
|
@@ -339089,7 +339111,7 @@ function useInputHistory({
|
|
|
339089
339111
|
},
|
|
339090
339112
|
[onSubmit, resetHistoryNav]
|
|
339091
339113
|
);
|
|
339092
|
-
const navigateUp = (0,
|
|
339114
|
+
const navigateUp = (0, import_react86.useCallback)(() => {
|
|
339093
339115
|
if (!isActive) return false;
|
|
339094
339116
|
if (userMessages.length === 0) return false;
|
|
339095
339117
|
let nextIndex = historyIndex;
|
|
@@ -339118,7 +339140,7 @@ function useInputHistory({
|
|
|
339118
339140
|
// Use currentQuery from props
|
|
339119
339141
|
setOriginalQueryBeforeNav
|
|
339120
339142
|
]);
|
|
339121
|
-
const navigateDown = (0,
|
|
339143
|
+
const navigateDown = (0, import_react86.useCallback)(() => {
|
|
339122
339144
|
if (!isActive) return false;
|
|
339123
339145
|
if (historyIndex === -1) return false;
|
|
339124
339146
|
const nextIndex = historyIndex - 1;
|
|
@@ -339151,7 +339173,7 @@ var import_chalk7 = __toESM(require_source(), 1);
|
|
|
339151
339173
|
|
|
339152
339174
|
// packages/cli/src/ui/hooks/useShellHistory.ts
|
|
339153
339175
|
init_esbuild_shims();
|
|
339154
|
-
var
|
|
339176
|
+
var import_react87 = __toESM(require_react(), 1);
|
|
339155
339177
|
init_core2();
|
|
339156
339178
|
import * as fs75 from "node:fs/promises";
|
|
339157
339179
|
import * as path77 from "node:path";
|
|
@@ -339196,10 +339218,10 @@ async function writeHistoryFile(filePath, history) {
|
|
|
339196
339218
|
}
|
|
339197
339219
|
__name(writeHistoryFile, "writeHistoryFile");
|
|
339198
339220
|
function useShellHistory(projectRoot, storage) {
|
|
339199
|
-
const [history, setHistory] = (0,
|
|
339200
|
-
const [historyIndex, setHistoryIndex] = (0,
|
|
339201
|
-
const [historyFilePath, setHistoryFilePath] = (0,
|
|
339202
|
-
(0,
|
|
339221
|
+
const [history, setHistory] = (0, import_react87.useState)([]);
|
|
339222
|
+
const [historyIndex, setHistoryIndex] = (0, import_react87.useState)(-1);
|
|
339223
|
+
const [historyFilePath, setHistoryFilePath] = (0, import_react87.useState)(null);
|
|
339224
|
+
(0, import_react87.useEffect)(() => {
|
|
339203
339225
|
async function loadHistory() {
|
|
339204
339226
|
const filePath = await getHistoryFilePath(projectRoot, storage);
|
|
339205
339227
|
setHistoryFilePath(filePath);
|
|
@@ -339209,7 +339231,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
339209
339231
|
__name(loadHistory, "loadHistory");
|
|
339210
339232
|
loadHistory();
|
|
339211
339233
|
}, [projectRoot, storage]);
|
|
339212
|
-
const addCommandToHistory = (0,
|
|
339234
|
+
const addCommandToHistory = (0, import_react87.useCallback)(
|
|
339213
339235
|
(command2) => {
|
|
339214
339236
|
if (!command2.trim() || !historyFilePath) {
|
|
339215
339237
|
return;
|
|
@@ -339221,7 +339243,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
339221
339243
|
},
|
|
339222
339244
|
[history, historyFilePath]
|
|
339223
339245
|
);
|
|
339224
|
-
const getPreviousCommand = (0,
|
|
339246
|
+
const getPreviousCommand = (0, import_react87.useCallback)(() => {
|
|
339225
339247
|
if (history.length === 0) {
|
|
339226
339248
|
return null;
|
|
339227
339249
|
}
|
|
@@ -339229,7 +339251,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
339229
339251
|
setHistoryIndex(newIndex);
|
|
339230
339252
|
return history[newIndex] ?? null;
|
|
339231
339253
|
}, [history, historyIndex]);
|
|
339232
|
-
const getNextCommand = (0,
|
|
339254
|
+
const getNextCommand = (0, import_react87.useCallback)(() => {
|
|
339233
339255
|
if (historyIndex < 0) {
|
|
339234
339256
|
return null;
|
|
339235
339257
|
}
|
|
@@ -339240,7 +339262,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
339240
339262
|
}
|
|
339241
339263
|
return history[newIndex] ?? null;
|
|
339242
339264
|
}, [history, historyIndex]);
|
|
339243
|
-
const resetHistoryPosition = (0,
|
|
339265
|
+
const resetHistoryPosition = (0, import_react87.useCallback)(() => {
|
|
339244
339266
|
setHistoryIndex(-1);
|
|
339245
339267
|
}, []);
|
|
339246
339268
|
return {
|
|
@@ -339255,19 +339277,19 @@ __name(useShellHistory, "useShellHistory");
|
|
|
339255
339277
|
|
|
339256
339278
|
// packages/cli/src/ui/hooks/useReverseSearchCompletion.tsx
|
|
339257
339279
|
init_esbuild_shims();
|
|
339258
|
-
var
|
|
339280
|
+
var import_react89 = __toESM(require_react(), 1);
|
|
339259
339281
|
|
|
339260
339282
|
// packages/cli/src/ui/hooks/useCompletion.ts
|
|
339261
339283
|
init_esbuild_shims();
|
|
339262
|
-
var
|
|
339284
|
+
var import_react88 = __toESM(require_react(), 1);
|
|
339263
339285
|
function useCompletion() {
|
|
339264
|
-
const [suggestions, setSuggestions] = (0,
|
|
339265
|
-
const [activeSuggestionIndex, setActiveSuggestionIndex] = (0,
|
|
339266
|
-
const [visibleStartIndex, setVisibleStartIndex] = (0,
|
|
339267
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
339268
|
-
const [isLoadingSuggestions, setIsLoadingSuggestions] = (0,
|
|
339269
|
-
const [isPerfectMatch, setIsPerfectMatch] = (0,
|
|
339270
|
-
const resetCompletionState = (0,
|
|
339286
|
+
const [suggestions, setSuggestions] = (0, import_react88.useState)([]);
|
|
339287
|
+
const [activeSuggestionIndex, setActiveSuggestionIndex] = (0, import_react88.useState)(-1);
|
|
339288
|
+
const [visibleStartIndex, setVisibleStartIndex] = (0, import_react88.useState)(0);
|
|
339289
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react88.useState)(false);
|
|
339290
|
+
const [isLoadingSuggestions, setIsLoadingSuggestions] = (0, import_react88.useState)(false);
|
|
339291
|
+
const [isPerfectMatch, setIsPerfectMatch] = (0, import_react88.useState)(false);
|
|
339292
|
+
const resetCompletionState = (0, import_react88.useCallback)(() => {
|
|
339271
339293
|
setSuggestions([]);
|
|
339272
339294
|
setActiveSuggestionIndex(-1);
|
|
339273
339295
|
setVisibleStartIndex(0);
|
|
@@ -339275,7 +339297,7 @@ function useCompletion() {
|
|
|
339275
339297
|
setIsLoadingSuggestions(false);
|
|
339276
339298
|
setIsPerfectMatch(false);
|
|
339277
339299
|
}, []);
|
|
339278
|
-
const navigateUp = (0,
|
|
339300
|
+
const navigateUp = (0, import_react88.useCallback)(() => {
|
|
339279
339301
|
if (suggestions.length === 0) return;
|
|
339280
339302
|
setActiveSuggestionIndex((prevActiveIndex) => {
|
|
339281
339303
|
const newActiveIndex = prevActiveIndex <= 0 ? suggestions.length - 1 : prevActiveIndex - 1;
|
|
@@ -339291,7 +339313,7 @@ function useCompletion() {
|
|
|
339291
339313
|
return newActiveIndex;
|
|
339292
339314
|
});
|
|
339293
339315
|
}, [suggestions.length]);
|
|
339294
|
-
const navigateDown = (0,
|
|
339316
|
+
const navigateDown = (0, import_react88.useCallback)(() => {
|
|
339295
339317
|
if (suggestions.length === 0) return;
|
|
339296
339318
|
setActiveSuggestionIndex((prevActiveIndex) => {
|
|
339297
339319
|
const newActiveIndex = prevActiveIndex >= suggestions.length - 1 ? 0 : prevActiveIndex + 1;
|
|
@@ -339330,8 +339352,8 @@ __name(useCompletion, "useCompletion");
|
|
|
339330
339352
|
|
|
339331
339353
|
// packages/cli/src/ui/hooks/useReverseSearchCompletion.tsx
|
|
339332
339354
|
function useDebouncedValue(value, delay4 = 200) {
|
|
339333
|
-
const [debounced, setDebounced] = (0,
|
|
339334
|
-
(0,
|
|
339355
|
+
const [debounced, setDebounced] = (0, import_react89.useState)(value);
|
|
339356
|
+
(0, import_react89.useEffect)(() => {
|
|
339335
339357
|
const handle = setTimeout(() => setDebounced(value), delay4);
|
|
339336
339358
|
return () => clearTimeout(handle);
|
|
339337
339359
|
}, [value, delay4]);
|
|
@@ -339354,19 +339376,19 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
339354
339376
|
setVisibleStartIndex
|
|
339355
339377
|
} = useCompletion();
|
|
339356
339378
|
const debouncedQuery = useDebouncedValue(buffer.text, 100);
|
|
339357
|
-
const prevQueryRef = (0,
|
|
339358
|
-
const prevMatchesRef = (0,
|
|
339359
|
-
(0,
|
|
339379
|
+
const prevQueryRef = (0, import_react89.useRef)("");
|
|
339380
|
+
const prevMatchesRef = (0, import_react89.useRef)([]);
|
|
339381
|
+
(0, import_react89.useEffect)(() => {
|
|
339360
339382
|
if (reverseSearchActive) {
|
|
339361
339383
|
prevQueryRef.current = "";
|
|
339362
339384
|
prevMatchesRef.current = [];
|
|
339363
339385
|
}
|
|
339364
339386
|
}, [reverseSearchActive]);
|
|
339365
|
-
(0,
|
|
339387
|
+
(0, import_react89.useEffect)(() => {
|
|
339366
339388
|
prevQueryRef.current = "";
|
|
339367
339389
|
prevMatchesRef.current = [];
|
|
339368
339390
|
}, [history]);
|
|
339369
|
-
const searchHistory = (0,
|
|
339391
|
+
const searchHistory = (0, import_react89.useCallback)(
|
|
339370
339392
|
(query, items) => {
|
|
339371
339393
|
const out = [];
|
|
339372
339394
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -339380,7 +339402,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
339380
339402
|
},
|
|
339381
339403
|
[]
|
|
339382
339404
|
);
|
|
339383
|
-
const matches = (0,
|
|
339405
|
+
const matches = (0, import_react89.useMemo)(() => {
|
|
339384
339406
|
if (!reverseSearchActive) return [];
|
|
339385
339407
|
if (debouncedQuery.length === 0)
|
|
339386
339408
|
return history.map((cmd) => ({
|
|
@@ -339393,7 +339415,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
339393
339415
|
const source2 = canUseCache ? prevMatchesRef.current.map((m) => m.value) : history;
|
|
339394
339416
|
return searchHistory(query, source2);
|
|
339395
339417
|
}, [debouncedQuery, history, reverseSearchActive, searchHistory]);
|
|
339396
|
-
(0,
|
|
339418
|
+
(0, import_react89.useEffect)(() => {
|
|
339397
339419
|
if (!reverseSearchActive) {
|
|
339398
339420
|
resetCompletionState();
|
|
339399
339421
|
return;
|
|
@@ -339415,7 +339437,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
339415
339437
|
setVisibleStartIndex,
|
|
339416
339438
|
resetCompletionState
|
|
339417
339439
|
]);
|
|
339418
|
-
const handleAutocomplete = (0,
|
|
339440
|
+
const handleAutocomplete = (0, import_react89.useCallback)(
|
|
339419
339441
|
(i) => {
|
|
339420
339442
|
if (i < 0 || i >= suggestions.length) return;
|
|
339421
339443
|
buffer.setText(suggestions[i].value);
|
|
@@ -339439,11 +339461,11 @@ __name(useReverseSearchCompletion, "useReverseSearchCompletion");
|
|
|
339439
339461
|
|
|
339440
339462
|
// packages/cli/src/ui/hooks/useCommandCompletion.tsx
|
|
339441
339463
|
init_esbuild_shims();
|
|
339442
|
-
var
|
|
339464
|
+
var import_react92 = __toESM(require_react(), 1);
|
|
339443
339465
|
|
|
339444
339466
|
// packages/cli/src/ui/hooks/useAtCompletion.ts
|
|
339445
339467
|
init_esbuild_shims();
|
|
339446
|
-
var
|
|
339468
|
+
var import_react90 = __toESM(require_react(), 1);
|
|
339447
339469
|
init_core2();
|
|
339448
339470
|
var initialState = {
|
|
339449
339471
|
status: "idle" /* IDLE */,
|
|
@@ -339502,20 +339524,20 @@ function useAtCompletion(props) {
|
|
|
339502
339524
|
setSuggestions,
|
|
339503
339525
|
setIsLoadingSuggestions
|
|
339504
339526
|
} = props;
|
|
339505
|
-
const [state, dispatch] = (0,
|
|
339506
|
-
const fileSearch = (0,
|
|
339507
|
-
const searchAbortController = (0,
|
|
339508
|
-
const slowSearchTimer = (0,
|
|
339509
|
-
(0,
|
|
339527
|
+
const [state, dispatch] = (0, import_react90.useReducer)(atCompletionReducer, initialState);
|
|
339528
|
+
const fileSearch = (0, import_react90.useRef)(null);
|
|
339529
|
+
const searchAbortController = (0, import_react90.useRef)(null);
|
|
339530
|
+
const slowSearchTimer = (0, import_react90.useRef)(null);
|
|
339531
|
+
(0, import_react90.useEffect)(() => {
|
|
339510
339532
|
setSuggestions(state.suggestions);
|
|
339511
339533
|
}, [state.suggestions, setSuggestions]);
|
|
339512
|
-
(0,
|
|
339534
|
+
(0, import_react90.useEffect)(() => {
|
|
339513
339535
|
setIsLoadingSuggestions(state.isLoading);
|
|
339514
339536
|
}, [state.isLoading, setIsLoadingSuggestions]);
|
|
339515
|
-
(0,
|
|
339537
|
+
(0, import_react90.useEffect)(() => {
|
|
339516
339538
|
dispatch({ type: "RESET" });
|
|
339517
339539
|
}, [cwd7, config]);
|
|
339518
|
-
(0,
|
|
339540
|
+
(0, import_react90.useEffect)(() => {
|
|
339519
339541
|
if (!enabled) {
|
|
339520
339542
|
if (state.status === "ready" /* READY */ || state.status === "error" /* ERROR */) {
|
|
339521
339543
|
dispatch({ type: "RESET" });
|
|
@@ -339532,7 +339554,7 @@ function useAtCompletion(props) {
|
|
|
339532
339554
|
dispatch({ type: "SEARCH", payload: pattern });
|
|
339533
339555
|
}
|
|
339534
339556
|
}, [enabled, pattern, state.status, state.pattern]);
|
|
339535
|
-
(0,
|
|
339557
|
+
(0, import_react90.useEffect)(() => {
|
|
339536
339558
|
const initialize = /* @__PURE__ */ __name(async () => {
|
|
339537
339559
|
try {
|
|
339538
339560
|
const searcher = FileSearchFactory.create({
|
|
@@ -339607,7 +339629,7 @@ __name(useAtCompletion, "useAtCompletion");
|
|
|
339607
339629
|
|
|
339608
339630
|
// packages/cli/src/ui/hooks/useSlashCompletion.ts
|
|
339609
339631
|
init_esbuild_shims();
|
|
339610
|
-
var
|
|
339632
|
+
var import_react91 = __toESM(require_react(), 1);
|
|
339611
339633
|
init_fzf_es();
|
|
339612
339634
|
function logErrorSafely(error, context2) {
|
|
339613
339635
|
if (error instanceof Error) {
|
|
@@ -339622,7 +339644,7 @@ function matchesCommand(cmd, query) {
|
|
|
339622
339644
|
}
|
|
339623
339645
|
__name(matchesCommand, "matchesCommand");
|
|
339624
339646
|
function useCommandParser(query, slashCommands) {
|
|
339625
|
-
return (0,
|
|
339647
|
+
return (0, import_react91.useMemo)(() => {
|
|
339626
339648
|
if (!query) {
|
|
339627
339649
|
return {
|
|
339628
339650
|
hasTrailingSpace: false,
|
|
@@ -339692,9 +339714,9 @@ function useCommandParser(query, slashCommands) {
|
|
|
339692
339714
|
}
|
|
339693
339715
|
__name(useCommandParser, "useCommandParser");
|
|
339694
339716
|
function useCommandSuggestions(parserResult, commandContext, getFzfForCommands, getPrefixSuggestions) {
|
|
339695
|
-
const [suggestions, setSuggestions] = (0,
|
|
339696
|
-
const [isLoading, setIsLoading] = (0,
|
|
339697
|
-
(0,
|
|
339717
|
+
const [suggestions, setSuggestions] = (0, import_react91.useState)([]);
|
|
339718
|
+
const [isLoading, setIsLoading] = (0, import_react91.useState)(false);
|
|
339719
|
+
(0, import_react91.useEffect)(() => {
|
|
339698
339720
|
const abortController = new AbortController();
|
|
339699
339721
|
const { signal } = abortController;
|
|
339700
339722
|
const {
|
|
@@ -339814,7 +339836,7 @@ function useCommandSuggestions(parserResult, commandContext, getFzfForCommands,
|
|
|
339814
339836
|
}
|
|
339815
339837
|
__name(useCommandSuggestions, "useCommandSuggestions");
|
|
339816
339838
|
function useCompletionPositions(query, parserResult) {
|
|
339817
|
-
return (0,
|
|
339839
|
+
return (0, import_react91.useMemo)(() => {
|
|
339818
339840
|
if (!query) {
|
|
339819
339841
|
return { start: -1, end: -1 };
|
|
339820
339842
|
}
|
|
@@ -339836,7 +339858,7 @@ function useCompletionPositions(query, parserResult) {
|
|
|
339836
339858
|
}
|
|
339837
339859
|
__name(useCompletionPositions, "useCompletionPositions");
|
|
339838
339860
|
function usePerfectMatch(parserResult) {
|
|
339839
|
-
return (0,
|
|
339861
|
+
return (0, import_react91.useMemo)(() => {
|
|
339840
339862
|
const { hasTrailingSpace, partial, leafCommand, currentLevel } = parserResult;
|
|
339841
339863
|
if (hasTrailingSpace) {
|
|
339842
339864
|
return { isPerfectMatch: false };
|
|
@@ -339866,13 +339888,13 @@ function useSlashCompletion(props) {
|
|
|
339866
339888
|
setIsLoadingSuggestions,
|
|
339867
339889
|
setIsPerfectMatch
|
|
339868
339890
|
} = props;
|
|
339869
|
-
const [completionStart, setCompletionStart] = (0,
|
|
339870
|
-
const [completionEnd, setCompletionEnd] = (0,
|
|
339871
|
-
const fzfInstanceCache = (0,
|
|
339891
|
+
const [completionStart, setCompletionStart] = (0, import_react91.useState)(-1);
|
|
339892
|
+
const [completionEnd, setCompletionEnd] = (0, import_react91.useState)(-1);
|
|
339893
|
+
const fzfInstanceCache = (0, import_react91.useMemo)(
|
|
339872
339894
|
() => /* @__PURE__ */ new WeakMap(),
|
|
339873
339895
|
[]
|
|
339874
339896
|
);
|
|
339875
|
-
const getFzfForCommands = (0,
|
|
339897
|
+
const getFzfForCommands = (0, import_react91.useMemo)(
|
|
339876
339898
|
() => (commands) => {
|
|
339877
339899
|
if (!commands || commands.length === 0) {
|
|
339878
339900
|
return null;
|
|
@@ -339916,7 +339938,7 @@ function useSlashCompletion(props) {
|
|
|
339916
339938
|
},
|
|
339917
339939
|
[fzfInstanceCache]
|
|
339918
339940
|
);
|
|
339919
|
-
const getPrefixSuggestions = (0,
|
|
339941
|
+
const getPrefixSuggestions = (0, import_react91.useMemo)(
|
|
339920
339942
|
() => (commands, partial) => commands.filter(
|
|
339921
339943
|
(cmd) => cmd.description && !cmd.hidden && (cmd.name.toLowerCase().startsWith(partial.toLowerCase()) || cmd.altNames?.some(
|
|
339922
339944
|
(alt) => alt.toLowerCase().startsWith(partial.toLowerCase())
|
|
@@ -339936,7 +339958,7 @@ function useSlashCompletion(props) {
|
|
|
339936
339958
|
parserResult
|
|
339937
339959
|
);
|
|
339938
339960
|
const { isPerfectMatch } = usePerfectMatch(parserResult);
|
|
339939
|
-
(0,
|
|
339961
|
+
(0, import_react91.useEffect)(() => {
|
|
339940
339962
|
if (!enabled) {
|
|
339941
339963
|
setSuggestions([]);
|
|
339942
339964
|
setIsLoadingSuggestions(false);
|
|
@@ -339945,7 +339967,7 @@ function useSlashCompletion(props) {
|
|
|
339945
339967
|
setCompletionEnd(-1);
|
|
339946
339968
|
}
|
|
339947
339969
|
}, [enabled, setSuggestions, setIsLoadingSuggestions, setIsPerfectMatch]);
|
|
339948
|
-
(0,
|
|
339970
|
+
(0, import_react91.useEffect)(() => {
|
|
339949
339971
|
if (!enabled || query === null) {
|
|
339950
339972
|
return;
|
|
339951
339973
|
}
|
|
@@ -339994,7 +340016,7 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
339994
340016
|
} = useCompletion();
|
|
339995
340017
|
const cursorRow = buffer.cursor[0];
|
|
339996
340018
|
const cursorCol = buffer.cursor[1];
|
|
339997
|
-
const { completionMode, query, completionStart, completionEnd } = (0,
|
|
340019
|
+
const { completionMode, query, completionStart, completionEnd } = (0, import_react92.useMemo)(() => {
|
|
339998
340020
|
const currentLine = buffer.lines[cursorRow] || "";
|
|
339999
340021
|
if (cursorRow === 0 && isSlashCommand(currentLine.trim())) {
|
|
340000
340022
|
return {
|
|
@@ -340063,11 +340085,11 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
340063
340085
|
setIsLoadingSuggestions,
|
|
340064
340086
|
setIsPerfectMatch
|
|
340065
340087
|
});
|
|
340066
|
-
(0,
|
|
340088
|
+
(0, import_react92.useEffect)(() => {
|
|
340067
340089
|
setActiveSuggestionIndex(suggestions.length > 0 ? 0 : -1);
|
|
340068
340090
|
setVisibleStartIndex(0);
|
|
340069
340091
|
}, [suggestions, setActiveSuggestionIndex, setVisibleStartIndex]);
|
|
340070
|
-
(0,
|
|
340092
|
+
(0, import_react92.useEffect)(() => {
|
|
340071
340093
|
if (completionMode === "IDLE" /* IDLE */ || reverseSearchActive) {
|
|
340072
340094
|
resetCompletionState();
|
|
340073
340095
|
return;
|
|
@@ -340081,7 +340103,7 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
340081
340103
|
resetCompletionState,
|
|
340082
340104
|
setShowSuggestions
|
|
340083
340105
|
]);
|
|
340084
|
-
const handleAutocomplete = (0,
|
|
340106
|
+
const handleAutocomplete = (0, import_react92.useCallback)(
|
|
340085
340107
|
(indexToUse) => {
|
|
340086
340108
|
if (indexToUse < 0 || indexToUse >= suggestions.length) {
|
|
340087
340109
|
return;
|
|
@@ -340311,9 +340333,9 @@ import * as path79 from "node:path";
|
|
|
340311
340333
|
|
|
340312
340334
|
// packages/cli/src/ui/contexts/ShellFocusContext.tsx
|
|
340313
340335
|
init_esbuild_shims();
|
|
340314
|
-
var
|
|
340315
|
-
var ShellFocusContext = (0,
|
|
340316
|
-
var useShellFocusState = /* @__PURE__ */ __name(() => (0,
|
|
340336
|
+
var import_react93 = __toESM(require_react(), 1);
|
|
340337
|
+
var ShellFocusContext = (0, import_react93.createContext)(true);
|
|
340338
|
+
var useShellFocusState = /* @__PURE__ */ __name(() => (0, import_react93.useContext)(ShellFocusContext), "useShellFocusState");
|
|
340317
340339
|
|
|
340318
340340
|
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
340319
340341
|
var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -340353,29 +340375,29 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340353
340375
|
isEmbeddedShellFocused
|
|
340354
340376
|
}) => {
|
|
340355
340377
|
const isShellFocused = useShellFocusState();
|
|
340356
|
-
const [justNavigatedHistory, setJustNavigatedHistory] = (0,
|
|
340357
|
-
const [escPressCount, setEscPressCount] = (0,
|
|
340358
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
340359
|
-
const escapeTimerRef = (0,
|
|
340360
|
-
const [recentPasteTime, setRecentPasteTime] = (0,
|
|
340361
|
-
const pasteTimeoutRef = (0,
|
|
340362
|
-
const [dirs, setDirs] = (0,
|
|
340378
|
+
const [justNavigatedHistory, setJustNavigatedHistory] = (0, import_react94.useState)(false);
|
|
340379
|
+
const [escPressCount, setEscPressCount] = (0, import_react94.useState)(0);
|
|
340380
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react94.useState)(false);
|
|
340381
|
+
const escapeTimerRef = (0, import_react94.useRef)(null);
|
|
340382
|
+
const [recentPasteTime, setRecentPasteTime] = (0, import_react94.useState)(null);
|
|
340383
|
+
const pasteTimeoutRef = (0, import_react94.useRef)(null);
|
|
340384
|
+
const [dirs, setDirs] = (0, import_react94.useState)(
|
|
340363
340385
|
config.getWorkspaceContext().getDirectories()
|
|
340364
340386
|
);
|
|
340365
340387
|
const dirsChanged = config.getWorkspaceContext().getDirectories();
|
|
340366
|
-
(0,
|
|
340388
|
+
(0, import_react94.useEffect)(() => {
|
|
340367
340389
|
if (dirs.length !== dirsChanged.length) {
|
|
340368
340390
|
setDirs(dirsChanged);
|
|
340369
340391
|
}
|
|
340370
340392
|
}, [dirs.length, dirsChanged]);
|
|
340371
|
-
const [reverseSearchActive, setReverseSearchActive] = (0,
|
|
340372
|
-
const [commandSearchActive, setCommandSearchActive] = (0,
|
|
340373
|
-
const [textBeforeReverseSearch, setTextBeforeReverseSearch] = (0,
|
|
340374
|
-
const [cursorPosition, setCursorPosition] = (0,
|
|
340393
|
+
const [reverseSearchActive, setReverseSearchActive] = (0, import_react94.useState)(false);
|
|
340394
|
+
const [commandSearchActive, setCommandSearchActive] = (0, import_react94.useState)(false);
|
|
340395
|
+
const [textBeforeReverseSearch, setTextBeforeReverseSearch] = (0, import_react94.useState)("");
|
|
340396
|
+
const [cursorPosition, setCursorPosition] = (0, import_react94.useState)([
|
|
340375
340397
|
0,
|
|
340376
340398
|
0
|
|
340377
340399
|
]);
|
|
340378
|
-
const [expandedSuggestionIndex, setExpandedSuggestionIndex] = (0,
|
|
340400
|
+
const [expandedSuggestionIndex, setExpandedSuggestionIndex] = (0, import_react94.useState)(-1);
|
|
340379
340401
|
const shellHistory = useShellHistory(config.getProjectRoot());
|
|
340380
340402
|
const shellHistoryData = shellHistory.history;
|
|
340381
340403
|
const completion3 = useCommandCompletion(
|
|
@@ -340401,7 +340423,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340401
340423
|
const resetReverseSearchCompletionState = reverseSearchCompletion.resetCompletionState;
|
|
340402
340424
|
const resetCommandSearchCompletionState = commandSearchCompletion.resetCompletionState;
|
|
340403
340425
|
const showCursor = focus && isShellFocused && !isEmbeddedShellFocused;
|
|
340404
|
-
const resetEscapeState = (0,
|
|
340426
|
+
const resetEscapeState = (0, import_react94.useCallback)(() => {
|
|
340405
340427
|
if (escapeTimerRef.current) {
|
|
340406
340428
|
clearTimeout(escapeTimerRef.current);
|
|
340407
340429
|
escapeTimerRef.current = null;
|
|
@@ -340409,12 +340431,12 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340409
340431
|
setEscPressCount(0);
|
|
340410
340432
|
setShowEscapePrompt(false);
|
|
340411
340433
|
}, []);
|
|
340412
|
-
(0,
|
|
340434
|
+
(0, import_react94.useEffect)(() => {
|
|
340413
340435
|
if (onEscapePromptChange) {
|
|
340414
340436
|
onEscapePromptChange(showEscapePrompt);
|
|
340415
340437
|
}
|
|
340416
340438
|
}, [showEscapePrompt, onEscapePromptChange]);
|
|
340417
|
-
(0,
|
|
340439
|
+
(0, import_react94.useEffect)(
|
|
340418
340440
|
() => () => {
|
|
340419
340441
|
if (escapeTimerRef.current) {
|
|
340420
340442
|
clearTimeout(escapeTimerRef.current);
|
|
@@ -340425,7 +340447,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340425
340447
|
},
|
|
340426
340448
|
[]
|
|
340427
340449
|
);
|
|
340428
|
-
const handleSubmitAndClear = (0,
|
|
340450
|
+
const handleSubmitAndClear = (0, import_react94.useCallback)(
|
|
340429
340451
|
(submittedValue) => {
|
|
340430
340452
|
if (shellModeActive) {
|
|
340431
340453
|
shellHistory.addCommandToHistory(submittedValue);
|
|
@@ -340444,7 +340466,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340444
340466
|
resetReverseSearchCompletionState
|
|
340445
340467
|
]
|
|
340446
340468
|
);
|
|
340447
|
-
const customSetTextAndResetCompletionSignal = (0,
|
|
340469
|
+
const customSetTextAndResetCompletionSignal = (0, import_react94.useCallback)(
|
|
340448
340470
|
(newText) => {
|
|
340449
340471
|
buffer.setText(newText);
|
|
340450
340472
|
setJustNavigatedHistory(true);
|
|
@@ -340458,7 +340480,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340458
340480
|
currentQuery: buffer.text,
|
|
340459
340481
|
onChange: customSetTextAndResetCompletionSignal
|
|
340460
340482
|
});
|
|
340461
|
-
(0,
|
|
340483
|
+
(0, import_react94.useEffect)(() => {
|
|
340462
340484
|
if (justNavigatedHistory) {
|
|
340463
340485
|
resetCompletionState();
|
|
340464
340486
|
resetReverseSearchCompletionState();
|
|
@@ -340474,7 +340496,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340474
340496
|
resetReverseSearchCompletionState,
|
|
340475
340497
|
resetCommandSearchCompletionState
|
|
340476
340498
|
]);
|
|
340477
|
-
const handleClipboardImage = (0,
|
|
340499
|
+
const handleClipboardImage = (0, import_react94.useCallback)(async () => {
|
|
340478
340500
|
try {
|
|
340479
340501
|
if (await clipboardHasImage()) {
|
|
340480
340502
|
const imagePath = await saveClipboardImage(config.getTargetDir());
|
|
@@ -340506,7 +340528,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340506
340528
|
console.error("Error handling clipboard image:", error);
|
|
340507
340529
|
}
|
|
340508
340530
|
}, [buffer, config]);
|
|
340509
|
-
const handleInput = (0,
|
|
340531
|
+
const handleInput = (0, import_react94.useCallback)(
|
|
340510
340532
|
(key) => {
|
|
340511
340533
|
if (!focus && !key.paste) {
|
|
340512
340534
|
return;
|
|
@@ -340963,15 +340985,15 @@ import process31 from "node:process";
|
|
|
340963
340985
|
|
|
340964
340986
|
// packages/cli/src/ui/components/MemoryUsageDisplay.tsx
|
|
340965
340987
|
init_esbuild_shims();
|
|
340966
|
-
var
|
|
340988
|
+
var import_react95 = __toESM(require_react(), 1);
|
|
340967
340989
|
import process30 from "node:process";
|
|
340968
340990
|
var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1);
|
|
340969
340991
|
var MemoryUsageDisplay = /* @__PURE__ */ __name(() => {
|
|
340970
|
-
const [memoryUsage, setMemoryUsage] = (0,
|
|
340971
|
-
const [memoryUsageColor, setMemoryUsageColor] = (0,
|
|
340992
|
+
const [memoryUsage, setMemoryUsage] = (0, import_react95.useState)("");
|
|
340993
|
+
const [memoryUsageColor, setMemoryUsageColor] = (0, import_react95.useState)(
|
|
340972
340994
|
theme.text.secondary
|
|
340973
340995
|
);
|
|
340974
|
-
(0,
|
|
340996
|
+
(0, import_react95.useEffect)(() => {
|
|
340975
340997
|
const updateMemory = /* @__PURE__ */ __name(() => {
|
|
340976
340998
|
const usage2 = process30.memoryUsage().rss;
|
|
340977
340999
|
setMemoryUsage(formatMemoryUsage2(usage2));
|
|
@@ -341011,12 +341033,12 @@ var ContextUsageDisplay = /* @__PURE__ */ __name(({
|
|
|
341011
341033
|
|
|
341012
341034
|
// packages/cli/src/ui/components/DebugProfiler.tsx
|
|
341013
341035
|
init_esbuild_shims();
|
|
341014
|
-
var
|
|
341036
|
+
var import_react96 = __toESM(require_react(), 1);
|
|
341015
341037
|
var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1);
|
|
341016
341038
|
var DebugProfiler = /* @__PURE__ */ __name(() => {
|
|
341017
|
-
const numRenders = (0,
|
|
341018
|
-
const [showNumRenders, setShowNumRenders] = (0,
|
|
341019
|
-
(0,
|
|
341039
|
+
const numRenders = (0, import_react96.useRef)(0);
|
|
341040
|
+
const [showNumRenders, setShowNumRenders] = (0, import_react96.useState)(false);
|
|
341041
|
+
(0, import_react96.useEffect)(() => {
|
|
341020
341042
|
numRenders.current++;
|
|
341021
341043
|
});
|
|
341022
341044
|
useKeypress(
|
|
@@ -341195,7 +341217,7 @@ init_core2();
|
|
|
341195
341217
|
|
|
341196
341218
|
// packages/cli/src/ui/components/ConfigInitDisplay.tsx
|
|
341197
341219
|
init_esbuild_shims();
|
|
341198
|
-
var
|
|
341220
|
+
var import_react97 = __toESM(require_react(), 1);
|
|
341199
341221
|
|
|
341200
341222
|
// packages/cli/src/utils/events.ts
|
|
341201
341223
|
init_esbuild_shims();
|
|
@@ -341207,8 +341229,8 @@ init_core2();
|
|
|
341207
341229
|
var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1);
|
|
341208
341230
|
var ConfigInitDisplay = /* @__PURE__ */ __name(() => {
|
|
341209
341231
|
const config = useConfig();
|
|
341210
|
-
const [message, setMessage] = (0,
|
|
341211
|
-
(0,
|
|
341232
|
+
const [message, setMessage] = (0, import_react97.useState)("Initializing...");
|
|
341233
|
+
(0, import_react97.useEffect)(() => {
|
|
341212
341234
|
const onChange = /* @__PURE__ */ __name((clients) => {
|
|
341213
341235
|
if (!clients || clients.size === 0) {
|
|
341214
341236
|
setMessage(`Initializing...`);
|
|
@@ -341247,7 +341269,7 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
341247
341269
|
const isNarrow = isNarrowWidth(terminalWidth);
|
|
341248
341270
|
const debugConsoleMaxHeight = Math.floor(Math.max(terminalWidth * 0.2, 5));
|
|
341249
341271
|
const { contextFileNames, showAutoAcceptIndicator } = uiState;
|
|
341250
|
-
const { containerWidth } = (0,
|
|
341272
|
+
const { containerWidth } = (0, import_react98.useMemo)(
|
|
341251
341273
|
() => calculatePromptWidths(uiState.terminalWidth),
|
|
341252
341274
|
[uiState.terminalWidth]
|
|
341253
341275
|
);
|
|
@@ -347360,7 +347382,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
347360
347382
|
// packages/cli/src/utils/version.ts
|
|
347361
347383
|
async function getCliVersion() {
|
|
347362
347384
|
const pkgJson = await getPackageJson();
|
|
347363
|
-
return "0.0.28-alpha.
|
|
347385
|
+
return "0.0.28-alpha.9";
|
|
347364
347386
|
}
|
|
347365
347387
|
__name(getCliVersion, "getCliVersion");
|
|
347366
347388
|
|
|
@@ -348425,12 +348447,12 @@ import process50 from "node:process";
|
|
|
348425
348447
|
|
|
348426
348448
|
// packages/cli/src/ui/hooks/useMemoryMonitor.ts
|
|
348427
348449
|
init_esbuild_shims();
|
|
348428
|
-
var
|
|
348450
|
+
var import_react99 = __toESM(require_react(), 1);
|
|
348429
348451
|
import process33 from "node:process";
|
|
348430
348452
|
var MEMORY_WARNING_THRESHOLD = 7 * 1024 * 1024 * 1024;
|
|
348431
348453
|
var MEMORY_CHECK_INTERVAL = 60 * 1e3;
|
|
348432
348454
|
var useMemoryMonitor = /* @__PURE__ */ __name(({ addItem }) => {
|
|
348433
|
-
(0,
|
|
348455
|
+
(0, import_react99.useEffect)(() => {
|
|
348434
348456
|
const intervalId = setInterval(() => {
|
|
348435
348457
|
const usage2 = process33.memoryUsage().rss;
|
|
348436
348458
|
if (usage2 > MEMORY_WARNING_THRESHOLD) {
|
|
@@ -348450,11 +348472,11 @@ var useMemoryMonitor = /* @__PURE__ */ __name(({ addItem }) => {
|
|
|
348450
348472
|
|
|
348451
348473
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
348452
348474
|
init_esbuild_shims();
|
|
348453
|
-
var
|
|
348475
|
+
var import_react100 = __toESM(require_react(), 1);
|
|
348454
348476
|
import process34 from "node:process";
|
|
348455
348477
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError) => {
|
|
348456
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
348457
|
-
const openThemeDialog = (0,
|
|
348478
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react100.useState)(!!initialThemeError);
|
|
348479
|
+
const openThemeDialog = (0, import_react100.useCallback)(() => {
|
|
348458
348480
|
if (process34.env["NO_COLOR"]) {
|
|
348459
348481
|
addItem(
|
|
348460
348482
|
{
|
|
@@ -348467,7 +348489,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
348467
348489
|
}
|
|
348468
348490
|
setIsThemeDialogOpen(true);
|
|
348469
348491
|
}, [addItem]);
|
|
348470
|
-
const applyTheme = (0,
|
|
348492
|
+
const applyTheme = (0, import_react100.useCallback)(
|
|
348471
348493
|
(themeName) => {
|
|
348472
348494
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
348473
348495
|
setIsThemeDialogOpen(true);
|
|
@@ -348478,13 +348500,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
348478
348500
|
},
|
|
348479
348501
|
[setThemeError]
|
|
348480
348502
|
);
|
|
348481
|
-
const handleThemeHighlight = (0,
|
|
348503
|
+
const handleThemeHighlight = (0, import_react100.useCallback)(
|
|
348482
348504
|
(themeName) => {
|
|
348483
348505
|
applyTheme(themeName);
|
|
348484
348506
|
},
|
|
348485
348507
|
[applyTheme]
|
|
348486
348508
|
);
|
|
348487
|
-
const handleThemeSelect = (0,
|
|
348509
|
+
const handleThemeSelect = (0, import_react100.useCallback)(
|
|
348488
348510
|
(themeName, scope) => {
|
|
348489
348511
|
try {
|
|
348490
348512
|
const mergedCustomThemes = {
|
|
@@ -348521,7 +348543,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
348521
348543
|
// packages/cli/src/ui/auth/useAuth.ts
|
|
348522
348544
|
init_esbuild_shims();
|
|
348523
348545
|
init_core2();
|
|
348524
|
-
var
|
|
348546
|
+
var import_react102 = __toESM(require_react(), 1);
|
|
348525
348547
|
init_xhsSsoConfig();
|
|
348526
348548
|
|
|
348527
348549
|
// packages/cli/src/ui/auth/performSsoAuthFlow.ts
|
|
@@ -348656,16 +348678,16 @@ __name(performSsoAuthFlow, "performSsoAuthFlow");
|
|
|
348656
348678
|
|
|
348657
348679
|
// packages/cli/src/ui/hooks/useQwenAuth.ts
|
|
348658
348680
|
init_esbuild_shims();
|
|
348659
|
-
var
|
|
348681
|
+
var import_react101 = __toESM(require_react(), 1);
|
|
348660
348682
|
init_core2();
|
|
348661
348683
|
var useQwenAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) => {
|
|
348662
|
-
const [qwenAuthState, setQwenAuthState] = (0,
|
|
348684
|
+
const [qwenAuthState, setQwenAuthState] = (0, import_react101.useState)({
|
|
348663
348685
|
deviceAuth: null,
|
|
348664
348686
|
authStatus: "idle",
|
|
348665
348687
|
authMessage: null
|
|
348666
348688
|
});
|
|
348667
348689
|
const isQwenAuth = pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */;
|
|
348668
|
-
(0,
|
|
348690
|
+
(0, import_react101.useEffect)(() => {
|
|
348669
348691
|
if (!isQwenAuth || !isAuthenticating) {
|
|
348670
348692
|
setQwenAuthState({
|
|
348671
348693
|
deviceAuth: null,
|
|
@@ -348705,7 +348727,7 @@ var useQwenAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) =>
|
|
|
348705
348727
|
qwenOAuth2Events.off("auth-progress" /* AuthProgress */, handleAuthProgress);
|
|
348706
348728
|
};
|
|
348707
348729
|
}, [isQwenAuth, isAuthenticating]);
|
|
348708
|
-
const cancelQwenAuth = (0,
|
|
348730
|
+
const cancelQwenAuth = (0, import_react101.useCallback)(() => {
|
|
348709
348731
|
qwenOAuth2Events.emit("auth-cancel" /* AuthCancel */);
|
|
348710
348732
|
setQwenAuthState({
|
|
348711
348733
|
deviceAuth: null,
|
|
@@ -348723,22 +348745,22 @@ var useQwenAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) =>
|
|
|
348723
348745
|
var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
348724
348746
|
const unAuthenticated = settings.merged.security?.auth?.selectedType === void 0;
|
|
348725
348747
|
const isSSOAutoAuthInProgress = shouldTriggerAutoSSOAuth(settings);
|
|
348726
|
-
const [authState, setAuthState] = (0,
|
|
348748
|
+
const [authState, setAuthState] = (0, import_react102.useState)(
|
|
348727
348749
|
unAuthenticated ? "updating" /* Updating */ : "unauthenticated" /* Unauthenticated */
|
|
348728
348750
|
);
|
|
348729
|
-
const [authError, setAuthError] = (0,
|
|
348730
|
-
const [isAuthenticating, setIsAuthenticating] = (0,
|
|
348731
|
-
const [isAuthDialogOpen, setIsAuthDialogOpen] = (0,
|
|
348751
|
+
const [authError, setAuthError] = (0, import_react102.useState)(null);
|
|
348752
|
+
const [isAuthenticating, setIsAuthenticating] = (0, import_react102.useState)(false);
|
|
348753
|
+
const [isAuthDialogOpen, setIsAuthDialogOpen] = (0, import_react102.useState)(
|
|
348732
348754
|
unAuthenticated && !isSSOAutoAuthInProgress
|
|
348733
348755
|
);
|
|
348734
|
-
const [pendingAuthType, setPendingAuthType] = (0,
|
|
348756
|
+
const [pendingAuthType, setPendingAuthType] = (0, import_react102.useState)(
|
|
348735
348757
|
void 0
|
|
348736
348758
|
);
|
|
348737
348759
|
const { qwenAuthState, cancelQwenAuth } = useQwenAuth(
|
|
348738
348760
|
pendingAuthType,
|
|
348739
348761
|
isAuthenticating
|
|
348740
348762
|
);
|
|
348741
|
-
const onAuthError = (0,
|
|
348763
|
+
const onAuthError = (0, import_react102.useCallback)(
|
|
348742
348764
|
(error) => {
|
|
348743
348765
|
setAuthError(error);
|
|
348744
348766
|
if (error) {
|
|
@@ -348748,7 +348770,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348748
348770
|
},
|
|
348749
348771
|
[setAuthError, setAuthState]
|
|
348750
348772
|
);
|
|
348751
|
-
const handleAuthFailure = (0,
|
|
348773
|
+
const handleAuthFailure = (0, import_react102.useCallback)(
|
|
348752
348774
|
(error) => {
|
|
348753
348775
|
setIsAuthenticating(false);
|
|
348754
348776
|
setPendingAuthType(void 0);
|
|
@@ -348766,7 +348788,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348766
348788
|
},
|
|
348767
348789
|
[onAuthError, pendingAuthType, config]
|
|
348768
348790
|
);
|
|
348769
|
-
const handleAuthSuccess = (0,
|
|
348791
|
+
const handleAuthSuccess = (0, import_react102.useCallback)(
|
|
348770
348792
|
async (authType, scope, credentials) => {
|
|
348771
348793
|
try {
|
|
348772
348794
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
@@ -348811,7 +348833,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348811
348833
|
},
|
|
348812
348834
|
[settings, handleAuthFailure, config, addItem]
|
|
348813
348835
|
);
|
|
348814
|
-
const performAuth = (0,
|
|
348836
|
+
const performAuth = (0, import_react102.useCallback)(
|
|
348815
348837
|
async (authType, scope, credentials) => {
|
|
348816
348838
|
try {
|
|
348817
348839
|
await config.refreshAuth(authType);
|
|
@@ -348822,7 +348844,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348822
348844
|
},
|
|
348823
348845
|
[config, handleAuthSuccess, handleAuthFailure]
|
|
348824
348846
|
);
|
|
348825
|
-
const handleAuthSelect = (0,
|
|
348847
|
+
const handleAuthSelect = (0, import_react102.useCallback)(
|
|
348826
348848
|
async (authType, scope, credentials) => {
|
|
348827
348849
|
if (!authType) {
|
|
348828
348850
|
setIsAuthDialogOpen(false);
|
|
@@ -348940,10 +348962,10 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348940
348962
|
addItem
|
|
348941
348963
|
]
|
|
348942
348964
|
);
|
|
348943
|
-
const openAuthDialog = (0,
|
|
348965
|
+
const openAuthDialog = (0, import_react102.useCallback)(() => {
|
|
348944
348966
|
setIsAuthDialogOpen(true);
|
|
348945
348967
|
}, []);
|
|
348946
|
-
const cancelAuthentication = (0,
|
|
348968
|
+
const cancelAuthentication = (0, import_react102.useCallback)(() => {
|
|
348947
348969
|
if (isAuthenticating && pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
348948
348970
|
cancelQwenAuth();
|
|
348949
348971
|
}
|
|
@@ -348955,7 +348977,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348955
348977
|
setIsAuthDialogOpen(true);
|
|
348956
348978
|
setAuthError(null);
|
|
348957
348979
|
}, [isAuthenticating, pendingAuthType, cancelQwenAuth, config]);
|
|
348958
|
-
(0,
|
|
348980
|
+
(0, import_react102.useEffect)(() => {
|
|
348959
348981
|
const defaultAuthType = process.env["QWEN_DEFAULT_AUTH_TYPE"];
|
|
348960
348982
|
if (defaultAuthType && !["qwen-oauth" /* QWEN_OAUTH */, "openai" /* USE_OPENAI */, "xhs-sso" /* XHS_SSO */].includes(
|
|
348961
348983
|
defaultAuthType
|
|
@@ -348983,7 +349005,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348983
349005
|
// packages/cli/src/ui/hooks/useQuotaAndFallback.ts
|
|
348984
349006
|
init_esbuild_shims();
|
|
348985
349007
|
init_core2();
|
|
348986
|
-
var
|
|
349008
|
+
var import_react103 = __toESM(require_react(), 1);
|
|
348987
349009
|
function useQuotaAndFallback({
|
|
348988
349010
|
config,
|
|
348989
349011
|
historyManager,
|
|
@@ -348991,9 +349013,9 @@ function useQuotaAndFallback({
|
|
|
348991
349013
|
setAuthState,
|
|
348992
349014
|
setModelSwitchedFromQuotaError
|
|
348993
349015
|
}) {
|
|
348994
|
-
const [proQuotaRequest, setProQuotaRequest] = (0,
|
|
348995
|
-
const isDialogPending = (0,
|
|
348996
|
-
(0,
|
|
349016
|
+
const [proQuotaRequest, setProQuotaRequest] = (0, import_react103.useState)(null);
|
|
349017
|
+
const isDialogPending = (0, import_react103.useRef)(false);
|
|
349018
|
+
(0, import_react103.useEffect)(() => {
|
|
348997
349019
|
const fallbackHandler = /* @__PURE__ */ __name(async (failedModel, fallbackModel, error) => {
|
|
348998
349020
|
if (config.isInFallbackMode()) {
|
|
348999
349021
|
return null;
|
|
@@ -349071,7 +349093,7 @@ function useQuotaAndFallback({
|
|
|
349071
349093
|
}, "fallbackHandler");
|
|
349072
349094
|
config.setFallbackModelHandler(fallbackHandler);
|
|
349073
349095
|
}, [config, historyManager, userTier, setModelSwitchedFromQuotaError]);
|
|
349074
|
-
const handleProQuotaChoice = (0,
|
|
349096
|
+
const handleProQuotaChoice = (0, import_react103.useCallback)(
|
|
349075
349097
|
(choice2) => {
|
|
349076
349098
|
if (!proQuotaRequest) return;
|
|
349077
349099
|
const intent = choice2 === "auth" ? "auth" : "retry";
|
|
@@ -349101,14 +349123,14 @@ __name(useQuotaAndFallback, "useQuotaAndFallback");
|
|
|
349101
349123
|
|
|
349102
349124
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
349103
349125
|
init_esbuild_shims();
|
|
349104
|
-
var
|
|
349126
|
+
var import_react104 = __toESM(require_react(), 1);
|
|
349105
349127
|
init_core2();
|
|
349106
349128
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem) => {
|
|
349107
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
349108
|
-
const openEditorDialog = (0,
|
|
349129
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react104.useState)(false);
|
|
349130
|
+
const openEditorDialog = (0, import_react104.useCallback)(() => {
|
|
349109
349131
|
setIsEditorDialogOpen(true);
|
|
349110
349132
|
}, []);
|
|
349111
|
-
const handleEditorSelect = (0,
|
|
349133
|
+
const handleEditorSelect = (0, import_react104.useCallback)(
|
|
349112
349134
|
(editorType, scope) => {
|
|
349113
349135
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
349114
349136
|
return;
|
|
@@ -349130,7 +349152,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
349130
349152
|
},
|
|
349131
349153
|
[loadedSettings, setEditorError, addItem]
|
|
349132
349154
|
);
|
|
349133
|
-
const exitEditorDialog = (0,
|
|
349155
|
+
const exitEditorDialog = (0, import_react104.useCallback)(() => {
|
|
349134
349156
|
setIsEditorDialogOpen(false);
|
|
349135
349157
|
}, []);
|
|
349136
349158
|
return {
|
|
@@ -349143,13 +349165,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
349143
349165
|
|
|
349144
349166
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
349145
349167
|
init_esbuild_shims();
|
|
349146
|
-
var
|
|
349168
|
+
var import_react105 = __toESM(require_react(), 1);
|
|
349147
349169
|
function useSettingsCommand() {
|
|
349148
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
349149
|
-
const openSettingsDialog = (0,
|
|
349170
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react105.useState)(false);
|
|
349171
|
+
const openSettingsDialog = (0, import_react105.useCallback)(() => {
|
|
349150
349172
|
setIsSettingsDialogOpen(true);
|
|
349151
349173
|
}, []);
|
|
349152
|
-
const closeSettingsDialog = (0,
|
|
349174
|
+
const closeSettingsDialog = (0, import_react105.useCallback)(() => {
|
|
349153
349175
|
setIsSettingsDialogOpen(false);
|
|
349154
349176
|
}, []);
|
|
349155
349177
|
return {
|
|
@@ -349162,13 +349184,13 @@ __name(useSettingsCommand, "useSettingsCommand");
|
|
|
349162
349184
|
|
|
349163
349185
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
349164
349186
|
init_esbuild_shims();
|
|
349165
|
-
var
|
|
349187
|
+
var import_react106 = __toESM(require_react(), 1);
|
|
349166
349188
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
349167
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
349168
|
-
const openModelDialog = (0,
|
|
349189
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react106.useState)(false);
|
|
349190
|
+
const openModelDialog = (0, import_react106.useCallback)(() => {
|
|
349169
349191
|
setIsModelDialogOpen(true);
|
|
349170
349192
|
}, []);
|
|
349171
|
-
const closeModelDialog = (0,
|
|
349193
|
+
const closeModelDialog = (0, import_react106.useCallback)(() => {
|
|
349172
349194
|
setIsModelDialogOpen(false);
|
|
349173
349195
|
}, []);
|
|
349174
349196
|
return {
|
|
@@ -349180,13 +349202,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
349180
349202
|
|
|
349181
349203
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
349182
349204
|
init_esbuild_shims();
|
|
349183
|
-
var
|
|
349205
|
+
var import_react107 = __toESM(require_react(), 1);
|
|
349184
349206
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) => {
|
|
349185
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
349186
|
-
const openApprovalModeDialog = (0,
|
|
349207
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react107.useState)(false);
|
|
349208
|
+
const openApprovalModeDialog = (0, import_react107.useCallback)(() => {
|
|
349187
349209
|
setIsApprovalModeDialogOpen(true);
|
|
349188
349210
|
}, []);
|
|
349189
|
-
const handleApprovalModeSelect = (0,
|
|
349211
|
+
const handleApprovalModeSelect = (0, import_react107.useCallback)(
|
|
349190
349212
|
(mode, scope) => {
|
|
349191
349213
|
try {
|
|
349192
349214
|
if (!mode) {
|
|
@@ -349212,7 +349234,7 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) =>
|
|
|
349212
349234
|
|
|
349213
349235
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
349214
349236
|
init_esbuild_shims();
|
|
349215
|
-
var
|
|
349237
|
+
var import_react110 = __toESM(require_react(), 1);
|
|
349216
349238
|
|
|
349217
349239
|
// packages/cli/node_modules/@google/genai/dist/node/index.mjs
|
|
349218
349240
|
init_esbuild_shims();
|
|
@@ -350046,7 +350068,7 @@ ${formatUsageMessage()}`
|
|
|
350046
350068
|
|
|
350047
350069
|
// packages/cli/src/ui/commands/chatCommand.ts
|
|
350048
350070
|
init_esbuild_shims();
|
|
350049
|
-
var
|
|
350071
|
+
var import_react108 = __toESM(require_react(), 1);
|
|
350050
350072
|
import * as fsPromises5 from "node:fs/promises";
|
|
350051
350073
|
init_core2();
|
|
350052
350074
|
import path86 from "node:path";
|
|
@@ -350134,11 +350156,11 @@ var saveCommand = {
|
|
|
350134
350156
|
if (exists2) {
|
|
350135
350157
|
return {
|
|
350136
350158
|
type: "confirm_action",
|
|
350137
|
-
prompt:
|
|
350159
|
+
prompt: import_react108.default.createElement(
|
|
350138
350160
|
Text,
|
|
350139
350161
|
null,
|
|
350140
350162
|
"A checkpoint with the tag ",
|
|
350141
|
-
|
|
350163
|
+
import_react108.default.createElement(Text, { color: theme.text.accent }, tag2),
|
|
350142
350164
|
" already exists. Do you want to overwrite it?"
|
|
350143
350165
|
),
|
|
350144
350166
|
originalInvocation: {
|
|
@@ -352617,7 +352639,7 @@ init_esbuild_shims();
|
|
|
352617
352639
|
init_core2();
|
|
352618
352640
|
import * as fs81 from "node:fs";
|
|
352619
352641
|
import * as path90 from "node:path";
|
|
352620
|
-
var
|
|
352642
|
+
var import_react109 = __toESM(require_react(), 1);
|
|
352621
352643
|
var initCommand = {
|
|
352622
352644
|
name: "init",
|
|
352623
352645
|
description: "\u5206\u6790\u9879\u76EE\u5E76\u521B\u5EFA RDMind.md ",
|
|
@@ -352643,7 +352665,7 @@ var initCommand = {
|
|
|
352643
352665
|
type: "confirm_action",
|
|
352644
352666
|
// TODO: Move to .tsx file to use JSX syntax instead of React.createElement
|
|
352645
352667
|
// For now, using React.createElement to maintain .ts compatibility for PR review
|
|
352646
|
-
prompt:
|
|
352668
|
+
prompt: import_react109.default.createElement(
|
|
352647
352669
|
Text,
|
|
352648
352670
|
null,
|
|
352649
352671
|
`A ${contextFileName} file already exists in this directory. Do you want to regenerate it?`
|
|
@@ -356265,41 +356287,41 @@ var parseSlashCommand = /* @__PURE__ */ __name((query, commands) => {
|
|
|
356265
356287
|
init_extensions();
|
|
356266
356288
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, setIsProcessing, setGeminiMdFileCount, actions, extensionsUpdateState, isConfigInitialized) => {
|
|
356267
356289
|
const session = useSessionStats();
|
|
356268
|
-
const [commands, setCommands] = (0,
|
|
356269
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
356270
|
-
const reloadCommands = (0,
|
|
356290
|
+
const [commands, setCommands] = (0, import_react110.useState)([]);
|
|
356291
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react110.useState)(0);
|
|
356292
|
+
const reloadCommands = (0, import_react110.useCallback)(() => {
|
|
356271
356293
|
setReloadTrigger((v) => v + 1);
|
|
356272
356294
|
}, []);
|
|
356273
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
356274
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
356275
|
-
const [quitConfirmationRequest, setQuitConfirmationRequest] = (0,
|
|
356276
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
356295
|
+
const [shellConfirmationRequest, setShellConfirmationRequest] = (0, import_react110.useState)(null);
|
|
356296
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react110.useState)(null);
|
|
356297
|
+
const [quitConfirmationRequest, setQuitConfirmationRequest] = (0, import_react110.useState)(null);
|
|
356298
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react110.useState)(
|
|
356277
356299
|
/* @__PURE__ */ new Set()
|
|
356278
356300
|
);
|
|
356279
|
-
const gitService = (0,
|
|
356301
|
+
const gitService = (0, import_react110.useMemo)(() => {
|
|
356280
356302
|
if (!config?.getProjectRoot()) {
|
|
356281
356303
|
return;
|
|
356282
356304
|
}
|
|
356283
356305
|
return new GitService(config.getProjectRoot(), config.storage);
|
|
356284
356306
|
}, [config]);
|
|
356285
|
-
const logger6 = (0,
|
|
356307
|
+
const logger6 = (0, import_react110.useMemo)(() => {
|
|
356286
356308
|
const l2 = new Logger(
|
|
356287
356309
|
config?.getSessionId() || "",
|
|
356288
356310
|
config?.storage ?? new Storage(process37.cwd())
|
|
356289
356311
|
);
|
|
356290
356312
|
return l2;
|
|
356291
356313
|
}, [config]);
|
|
356292
|
-
const [pendingItem, setPendingItem] = (0,
|
|
356314
|
+
const [pendingItem, setPendingItem] = (0, import_react110.useState)(
|
|
356293
356315
|
null
|
|
356294
356316
|
);
|
|
356295
|
-
const pendingHistoryItems = (0,
|
|
356317
|
+
const pendingHistoryItems = (0, import_react110.useMemo)(() => {
|
|
356296
356318
|
const items = [];
|
|
356297
356319
|
if (pendingItem != null) {
|
|
356298
356320
|
items.push(pendingItem);
|
|
356299
356321
|
}
|
|
356300
356322
|
return items;
|
|
356301
356323
|
}, [pendingItem]);
|
|
356302
|
-
const addMessage = (0,
|
|
356324
|
+
const addMessage = (0, import_react110.useCallback)(
|
|
356303
356325
|
(message) => {
|
|
356304
356326
|
let historyItemContent;
|
|
356305
356327
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -356355,7 +356377,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
356355
356377
|
},
|
|
356356
356378
|
[addItem]
|
|
356357
356379
|
);
|
|
356358
|
-
const commandContext = (0,
|
|
356380
|
+
const commandContext = (0, import_react110.useMemo)(
|
|
356359
356381
|
() => ({
|
|
356360
356382
|
services: {
|
|
356361
356383
|
config,
|
|
@@ -356407,7 +356429,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
356407
356429
|
extensionsUpdateState
|
|
356408
356430
|
]
|
|
356409
356431
|
);
|
|
356410
|
-
(0,
|
|
356432
|
+
(0, import_react110.useEffect)(() => {
|
|
356411
356433
|
if (!config) {
|
|
356412
356434
|
return;
|
|
356413
356435
|
}
|
|
@@ -356425,7 +356447,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
356425
356447
|
})();
|
|
356426
356448
|
};
|
|
356427
356449
|
}, [config, reloadCommands]);
|
|
356428
|
-
(0,
|
|
356450
|
+
(0, import_react110.useEffect)(() => {
|
|
356429
356451
|
const controller = new AbortController();
|
|
356430
356452
|
const load = /* @__PURE__ */ __name(async () => {
|
|
356431
356453
|
const loaders = [
|
|
@@ -356444,7 +356466,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
356444
356466
|
controller.abort();
|
|
356445
356467
|
};
|
|
356446
356468
|
}, [config, reloadTrigger, isConfigInitialized]);
|
|
356447
|
-
const handleSlashCommand2 = (0,
|
|
356469
|
+
const handleSlashCommand2 = (0, import_react110.useCallback)(
|
|
356448
356470
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed) => {
|
|
356449
356471
|
if (typeof rawQuery !== "string") {
|
|
356450
356472
|
return false;
|
|
@@ -356767,7 +356789,7 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
356767
356789
|
|
|
356768
356790
|
// packages/cli/src/ui/hooks/useConsoleMessages.ts
|
|
356769
356791
|
init_esbuild_shims();
|
|
356770
|
-
var
|
|
356792
|
+
var import_react111 = __toESM(require_react(), 1);
|
|
356771
356793
|
function consoleMessagesReducer(state, action) {
|
|
356772
356794
|
switch (action.type) {
|
|
356773
356795
|
case "ADD_MESSAGES": {
|
|
@@ -356793,11 +356815,11 @@ function consoleMessagesReducer(state, action) {
|
|
|
356793
356815
|
}
|
|
356794
356816
|
__name(consoleMessagesReducer, "consoleMessagesReducer");
|
|
356795
356817
|
function useConsoleMessages() {
|
|
356796
|
-
const [consoleMessages, dispatch] = (0,
|
|
356797
|
-
const messageQueueRef = (0,
|
|
356798
|
-
const timeoutRef = (0,
|
|
356799
|
-
const [, startTransition] = (0,
|
|
356800
|
-
const processQueue = (0,
|
|
356818
|
+
const [consoleMessages, dispatch] = (0, import_react111.useReducer)(consoleMessagesReducer, []);
|
|
356819
|
+
const messageQueueRef = (0, import_react111.useRef)([]);
|
|
356820
|
+
const timeoutRef = (0, import_react111.useRef)(null);
|
|
356821
|
+
const [, startTransition] = (0, import_react111.useTransition)();
|
|
356822
|
+
const processQueue = (0, import_react111.useCallback)(() => {
|
|
356801
356823
|
if (messageQueueRef.current.length > 0) {
|
|
356802
356824
|
const messagesToProcess = messageQueueRef.current;
|
|
356803
356825
|
messageQueueRef.current = [];
|
|
@@ -356807,7 +356829,7 @@ function useConsoleMessages() {
|
|
|
356807
356829
|
}
|
|
356808
356830
|
timeoutRef.current = null;
|
|
356809
356831
|
}, []);
|
|
356810
|
-
const handleNewMessage = (0,
|
|
356832
|
+
const handleNewMessage = (0, import_react111.useCallback)(
|
|
356811
356833
|
(message) => {
|
|
356812
356834
|
messageQueueRef.current.push(message);
|
|
356813
356835
|
if (!timeoutRef.current) {
|
|
@@ -356816,7 +356838,7 @@ function useConsoleMessages() {
|
|
|
356816
356838
|
},
|
|
356817
356839
|
[processQueue]
|
|
356818
356840
|
);
|
|
356819
|
-
const clearConsoleMessages = (0,
|
|
356841
|
+
const clearConsoleMessages = (0, import_react111.useCallback)(() => {
|
|
356820
356842
|
if (timeoutRef.current) {
|
|
356821
356843
|
clearTimeout(timeoutRef.current);
|
|
356822
356844
|
timeoutRef.current = null;
|
|
@@ -356826,7 +356848,7 @@ function useConsoleMessages() {
|
|
|
356826
356848
|
dispatch({ type: "CLEAR" });
|
|
356827
356849
|
});
|
|
356828
356850
|
}, []);
|
|
356829
|
-
(0,
|
|
356851
|
+
(0, import_react111.useEffect)(
|
|
356830
356852
|
() => () => {
|
|
356831
356853
|
if (timeoutRef.current) {
|
|
356832
356854
|
clearTimeout(timeoutRef.current);
|
|
@@ -356856,11 +356878,11 @@ __name(computeWindowTitle, "computeWindowTitle");
|
|
|
356856
356878
|
|
|
356857
356879
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
356858
356880
|
init_esbuild_shims();
|
|
356859
|
-
var
|
|
356881
|
+
var import_react112 = __toESM(require_react(), 1);
|
|
356860
356882
|
init_core2();
|
|
356861
356883
|
var useLogger = /* @__PURE__ */ __name((storage) => {
|
|
356862
|
-
const [logger6, setLogger] = (0,
|
|
356863
|
-
(0,
|
|
356884
|
+
const [logger6, setLogger] = (0, import_react112.useState)(null);
|
|
356885
|
+
(0, import_react112.useEffect)(() => {
|
|
356864
356886
|
const newLogger = new Logger(sessionId, storage);
|
|
356865
356887
|
newLogger.initialize().then(() => {
|
|
356866
356888
|
setLogger(newLogger);
|
|
@@ -356872,12 +356894,12 @@ var useLogger = /* @__PURE__ */ __name((storage) => {
|
|
|
356872
356894
|
|
|
356873
356895
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
356874
356896
|
init_esbuild_shims();
|
|
356875
|
-
var
|
|
356897
|
+
var import_react117 = __toESM(require_react(), 1);
|
|
356876
356898
|
init_core2();
|
|
356877
356899
|
|
|
356878
356900
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
356879
356901
|
init_esbuild_shims();
|
|
356880
|
-
var
|
|
356902
|
+
var import_react113 = __toESM(require_react(), 1);
|
|
356881
356903
|
init_core2();
|
|
356882
356904
|
import crypto18 from "node:crypto";
|
|
356883
356905
|
import path98 from "node:path";
|
|
@@ -356906,8 +356928,8 @@ ${modelContent}
|
|
|
356906
356928
|
}
|
|
356907
356929
|
__name(addShellCommandToGeminiHistory, "addShellCommandToGeminiHistory");
|
|
356908
356930
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, geminiClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
356909
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
356910
|
-
const handleShellCommand = (0,
|
|
356931
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react113.useState)(null);
|
|
356932
|
+
const handleShellCommand = (0, import_react113.useCallback)(
|
|
356911
356933
|
(rawQuery, abortSignal) => {
|
|
356912
356934
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
356913
356935
|
return false;
|
|
@@ -357156,7 +357178,7 @@ ${finalOutput}`;
|
|
|
357156
357178
|
// packages/cli/src/ui/hooks/useVisionAutoSwitch.ts
|
|
357157
357179
|
init_esbuild_shims();
|
|
357158
357180
|
init_core2();
|
|
357159
|
-
var
|
|
357181
|
+
var import_react114 = __toESM(require_react(), 1);
|
|
357160
357182
|
init_core2();
|
|
357161
357183
|
function hasImageParts(parts) {
|
|
357162
357184
|
if (typeof parts === "string") {
|
|
@@ -357246,8 +357268,8 @@ function processVisionSwitchOutcome(outcome) {
|
|
|
357246
357268
|
}
|
|
357247
357269
|
__name(processVisionSwitchOutcome, "processVisionSwitchOutcome");
|
|
357248
357270
|
function useVisionAutoSwitch(config, addItem, visionModelPreviewEnabled = true, onVisionSwitchRequired) {
|
|
357249
|
-
const originalModelRef = (0,
|
|
357250
|
-
const handleVisionSwitch = (0,
|
|
357271
|
+
const originalModelRef = (0, import_react114.useRef)(null);
|
|
357272
|
+
const handleVisionSwitch = (0, import_react114.useCallback)(
|
|
357251
357273
|
async (query, userMessageTimestamp, isContinuation) => {
|
|
357252
357274
|
if (isContinuation || !onVisionSwitchRequired) {
|
|
357253
357275
|
return { shouldProceed: true };
|
|
@@ -357348,7 +357370,7 @@ function useVisionAutoSwitch(config, addItem, visionModelPreviewEnabled = true,
|
|
|
357348
357370
|
},
|
|
357349
357371
|
[config, addItem, visionModelPreviewEnabled, onVisionSwitchRequired]
|
|
357350
357372
|
);
|
|
357351
|
-
const restoreOriginalModel = (0,
|
|
357373
|
+
const restoreOriginalModel = (0, import_react114.useCallback)(async () => {
|
|
357352
357374
|
if (originalModelRef.current) {
|
|
357353
357375
|
await config.setModel(originalModelRef.current, {
|
|
357354
357376
|
reason: "vision_auto_switch",
|
|
@@ -357764,11 +357786,11 @@ var findLastSafeSplitPoint = /* @__PURE__ */ __name((content) => {
|
|
|
357764
357786
|
|
|
357765
357787
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
357766
357788
|
init_esbuild_shims();
|
|
357767
|
-
var
|
|
357789
|
+
var import_react115 = __toESM(require_react(), 1);
|
|
357768
357790
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
357769
|
-
const [state, setState] =
|
|
357770
|
-
const ref =
|
|
357771
|
-
const setStateInternal =
|
|
357791
|
+
const [state, setState] = import_react115.default.useState(initialValue);
|
|
357792
|
+
const ref = import_react115.default.useRef(initialValue);
|
|
357793
|
+
const setStateInternal = import_react115.default.useCallback(
|
|
357772
357794
|
(newStateOrCallback) => {
|
|
357773
357795
|
let newValue;
|
|
357774
357796
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -357787,10 +357809,10 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
357787
357809
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
357788
357810
|
init_esbuild_shims();
|
|
357789
357811
|
init_core2();
|
|
357790
|
-
var
|
|
357812
|
+
var import_react116 = __toESM(require_react(), 1);
|
|
357791
357813
|
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
|
|
357792
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
357793
|
-
const outputUpdateHandler = (0,
|
|
357814
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react116.useState)([]);
|
|
357815
|
+
const outputUpdateHandler = (0, import_react116.useCallback)(
|
|
357794
357816
|
(toolCallId, outputChunk) => {
|
|
357795
357817
|
setToolCallsForDisplay(
|
|
357796
357818
|
(prevCalls) => prevCalls.map((tc) => {
|
|
@@ -357804,13 +357826,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
357804
357826
|
},
|
|
357805
357827
|
[]
|
|
357806
357828
|
);
|
|
357807
|
-
const allToolCallsCompleteHandler = (0,
|
|
357829
|
+
const allToolCallsCompleteHandler = (0, import_react116.useCallback)(
|
|
357808
357830
|
async (completedToolCalls) => {
|
|
357809
357831
|
await onComplete(completedToolCalls);
|
|
357810
357832
|
},
|
|
357811
357833
|
[onComplete]
|
|
357812
357834
|
);
|
|
357813
|
-
const toolCallsUpdateHandler = (0,
|
|
357835
|
+
const toolCallsUpdateHandler = (0, import_react116.useCallback)(
|
|
357814
357836
|
(updatedCoreToolCalls) => {
|
|
357815
357837
|
setToolCallsForDisplay(
|
|
357816
357838
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -357837,7 +357859,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
357837
357859
|
},
|
|
357838
357860
|
[setToolCallsForDisplay]
|
|
357839
357861
|
);
|
|
357840
|
-
const scheduler = (0,
|
|
357862
|
+
const scheduler = (0, import_react116.useMemo)(
|
|
357841
357863
|
() => new CoreToolScheduler({
|
|
357842
357864
|
outputUpdateHandler,
|
|
357843
357865
|
onAllToolCallsComplete: allToolCallsCompleteHandler,
|
|
@@ -357856,13 +357878,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
357856
357878
|
onEditorClose
|
|
357857
357879
|
]
|
|
357858
357880
|
);
|
|
357859
|
-
const schedule = (0,
|
|
357881
|
+
const schedule = (0, import_react116.useCallback)(
|
|
357860
357882
|
(request4, signal) => {
|
|
357861
357883
|
void scheduler.schedule(request4, signal);
|
|
357862
357884
|
},
|
|
357863
357885
|
[scheduler]
|
|
357864
357886
|
);
|
|
357865
|
-
const markToolsAsSubmitted = (0,
|
|
357887
|
+
const markToolsAsSubmitted = (0, import_react116.useCallback)(
|
|
357866
357888
|
(callIdsToMark) => {
|
|
357867
357889
|
setToolCallsForDisplay(
|
|
357868
357890
|
(prevCalls) => prevCalls.map(
|
|
@@ -358011,18 +358033,18 @@ function showCitations(settings) {
|
|
|
358011
358033
|
}
|
|
358012
358034
|
__name(showCitations, "showCitations");
|
|
358013
358035
|
var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, config, settings, onDebugMessage, handleSlashCommand2, shellModeActive, getPreferredEditor, onAuthError, performMemoryRefresh, modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError, onEditorClose, onCancelSubmit, visionModelPreviewEnabled, setShellInputFocused, terminalWidth, terminalHeight, onVisionSwitchRequired, isShellFocused) => {
|
|
358014
|
-
const [initError, setInitError] = (0,
|
|
358015
|
-
const abortControllerRef = (0,
|
|
358016
|
-
const turnCancelledRef = (0,
|
|
358017
|
-
const isSubmittingQueryRef = (0,
|
|
358018
|
-
const [isResponding, setIsResponding] = (0,
|
|
358019
|
-
const [thought, setThought] = (0,
|
|
358036
|
+
const [initError, setInitError] = (0, import_react117.useState)(null);
|
|
358037
|
+
const abortControllerRef = (0, import_react117.useRef)(null);
|
|
358038
|
+
const turnCancelledRef = (0, import_react117.useRef)(false);
|
|
358039
|
+
const isSubmittingQueryRef = (0, import_react117.useRef)(false);
|
|
358040
|
+
const [isResponding, setIsResponding] = (0, import_react117.useState)(false);
|
|
358041
|
+
const [thought, setThought] = (0, import_react117.useState)(null);
|
|
358020
358042
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
358021
|
-
const processedMemoryToolsRef = (0,
|
|
358043
|
+
const processedMemoryToolsRef = (0, import_react117.useRef)(/* @__PURE__ */ new Set());
|
|
358022
358044
|
const { startNewPrompt, getPromptCount } = useSessionStats();
|
|
358023
358045
|
const storage = config.storage;
|
|
358024
358046
|
const logger6 = useLogger(storage);
|
|
358025
|
-
const gitService = (0,
|
|
358047
|
+
const gitService = (0, import_react117.useMemo)(() => {
|
|
358026
358048
|
if (!config.getProjectRoot()) {
|
|
358027
358049
|
return;
|
|
358028
358050
|
}
|
|
@@ -358046,11 +358068,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358046
358068
|
getPreferredEditor,
|
|
358047
358069
|
onEditorClose
|
|
358048
358070
|
);
|
|
358049
|
-
const pendingToolCallGroupDisplay = (0,
|
|
358071
|
+
const pendingToolCallGroupDisplay = (0, import_react117.useMemo)(
|
|
358050
358072
|
() => toolCalls.length ? mapToDisplay(toolCalls) : void 0,
|
|
358051
358073
|
[toolCalls]
|
|
358052
358074
|
);
|
|
358053
|
-
const activeToolPtyId = (0,
|
|
358075
|
+
const activeToolPtyId = (0, import_react117.useMemo)(() => {
|
|
358054
358076
|
const executingShellTool = toolCalls?.find(
|
|
358055
358077
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
358056
358078
|
);
|
|
@@ -358059,12 +358081,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358059
358081
|
}
|
|
358060
358082
|
return void 0;
|
|
358061
358083
|
}, [toolCalls]);
|
|
358062
|
-
const loopDetectedRef = (0,
|
|
358084
|
+
const loopDetectedRef = (0, import_react117.useRef)(false);
|
|
358063
358085
|
const [
|
|
358064
358086
|
loopDetectionConfirmationRequest,
|
|
358065
358087
|
setLoopDetectionConfirmationRequest
|
|
358066
|
-
] = (0,
|
|
358067
|
-
const onExec = (0,
|
|
358088
|
+
] = (0, import_react117.useState)(null);
|
|
358089
|
+
const onExec = (0, import_react117.useCallback)(async (done) => {
|
|
358068
358090
|
setIsResponding(true);
|
|
358069
358091
|
await done;
|
|
358070
358092
|
setIsResponding(false);
|
|
@@ -358087,12 +358109,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358087
358109
|
onVisionSwitchRequired
|
|
358088
358110
|
);
|
|
358089
358111
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
358090
|
-
(0,
|
|
358112
|
+
(0, import_react117.useEffect)(() => {
|
|
358091
358113
|
if (!activePtyId) {
|
|
358092
358114
|
setShellInputFocused(false);
|
|
358093
358115
|
}
|
|
358094
358116
|
}, [activePtyId, setShellInputFocused]);
|
|
358095
|
-
const streamingState = (0,
|
|
358117
|
+
const streamingState = (0, import_react117.useMemo)(() => {
|
|
358096
358118
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
358097
358119
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
358098
358120
|
}
|
|
@@ -358103,7 +358125,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358103
358125
|
}
|
|
358104
358126
|
return "idle" /* Idle */;
|
|
358105
358127
|
}, [isResponding, toolCalls]);
|
|
358106
|
-
(0,
|
|
358128
|
+
(0, import_react117.useEffect)(() => {
|
|
358107
358129
|
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
358108
358130
|
const lastUserMessageIndex = history.findLastIndex(
|
|
358109
358131
|
(item) => item.type === "user" /* USER */
|
|
@@ -358117,7 +358139,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358117
358139
|
}
|
|
358118
358140
|
}
|
|
358119
358141
|
}, [streamingState, config, history]);
|
|
358120
|
-
const cancelOngoingRequest = (0,
|
|
358142
|
+
const cancelOngoingRequest = (0, import_react117.useCallback)(() => {
|
|
358121
358143
|
if (streamingState !== "responding" /* Responding */) {
|
|
358122
358144
|
return;
|
|
358123
358145
|
}
|
|
@@ -358166,7 +358188,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358166
358188
|
},
|
|
358167
358189
|
{ isActive: streamingState === "responding" /* Responding */ }
|
|
358168
358190
|
);
|
|
358169
|
-
const prepareQueryForGemini = (0,
|
|
358191
|
+
const prepareQueryForGemini = (0, import_react117.useCallback)(
|
|
358170
358192
|
async (query, userMessageTimestamp, abortSignal, prompt_id) => {
|
|
358171
358193
|
if (turnCancelledRef.current) {
|
|
358172
358194
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -358261,7 +358283,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358261
358283
|
scheduleToolCalls
|
|
358262
358284
|
]
|
|
358263
358285
|
);
|
|
358264
|
-
const handleContentEvent = (0,
|
|
358286
|
+
const handleContentEvent = (0, import_react117.useCallback)(
|
|
358265
358287
|
(eventValue, currentGeminiMessageBuffer, userMessageTimestamp) => {
|
|
358266
358288
|
if (turnCancelledRef.current) {
|
|
358267
358289
|
return "";
|
|
@@ -358297,7 +358319,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358297
358319
|
},
|
|
358298
358320
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
358299
358321
|
);
|
|
358300
|
-
const handleUserCancelledEvent = (0,
|
|
358322
|
+
const handleUserCancelledEvent = (0, import_react117.useCallback)(
|
|
358301
358323
|
(userMessageTimestamp) => {
|
|
358302
358324
|
if (turnCancelledRef.current) {
|
|
358303
358325
|
return;
|
|
@@ -358326,7 +358348,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358326
358348
|
},
|
|
358327
358349
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, setThought]
|
|
358328
358350
|
);
|
|
358329
|
-
const handleErrorEvent = (0,
|
|
358351
|
+
const handleErrorEvent = (0, import_react117.useCallback)(
|
|
358330
358352
|
(eventValue, userMessageTimestamp) => {
|
|
358331
358353
|
if (pendingHistoryItemRef.current) {
|
|
358332
358354
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -358349,7 +358371,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358349
358371
|
},
|
|
358350
358372
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, config, setThought]
|
|
358351
358373
|
);
|
|
358352
|
-
const handleCitationEvent = (0,
|
|
358374
|
+
const handleCitationEvent = (0, import_react117.useCallback)(
|
|
358353
358375
|
(text, userMessageTimestamp) => {
|
|
358354
358376
|
if (!showCitations(settings)) {
|
|
358355
358377
|
return;
|
|
@@ -358362,7 +358384,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358362
358384
|
},
|
|
358363
358385
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, settings]
|
|
358364
358386
|
);
|
|
358365
|
-
const handleFinishedEvent = (0,
|
|
358387
|
+
const handleFinishedEvent = (0, import_react117.useCallback)(
|
|
358366
358388
|
(event, userMessageTimestamp) => {
|
|
358367
358389
|
const finishReason = event.value.reason;
|
|
358368
358390
|
if (!finishReason) {
|
|
@@ -358396,7 +358418,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358396
358418
|
},
|
|
358397
358419
|
[addItem]
|
|
358398
358420
|
);
|
|
358399
|
-
const handleChatCompressionEvent = (0,
|
|
358421
|
+
const handleChatCompressionEvent = (0, import_react117.useCallback)(
|
|
358400
358422
|
(eventValue, userMessageTimestamp) => {
|
|
358401
358423
|
if (pendingHistoryItemRef.current) {
|
|
358402
358424
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -358412,7 +358434,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358412
358434
|
},
|
|
358413
358435
|
[addItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
358414
358436
|
);
|
|
358415
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
358437
|
+
const handleMaxSessionTurnsEvent = (0, import_react117.useCallback)(
|
|
358416
358438
|
() => addItem(
|
|
358417
358439
|
{
|
|
358418
358440
|
type: "info",
|
|
@@ -358422,7 +358444,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358422
358444
|
),
|
|
358423
358445
|
[addItem, config]
|
|
358424
358446
|
);
|
|
358425
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
358447
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react117.useCallback)(
|
|
358426
358448
|
(value) => addItem(
|
|
358427
358449
|
{
|
|
358428
358450
|
type: "error",
|
|
@@ -358437,7 +358459,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358437
358459
|
),
|
|
358438
358460
|
[addItem]
|
|
358439
358461
|
);
|
|
358440
|
-
const handleLoopDetectionConfirmation = (0,
|
|
358462
|
+
const handleLoopDetectionConfirmation = (0, import_react117.useCallback)(
|
|
358441
358463
|
(result) => {
|
|
358442
358464
|
setLoopDetectionConfirmationRequest(null);
|
|
358443
358465
|
if (result.userSelection === "disable") {
|
|
@@ -358461,12 +358483,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358461
358483
|
},
|
|
358462
358484
|
[config, addItem]
|
|
358463
358485
|
);
|
|
358464
|
-
const handleLoopDetectedEvent = (0,
|
|
358486
|
+
const handleLoopDetectedEvent = (0, import_react117.useCallback)(() => {
|
|
358465
358487
|
setLoopDetectionConfirmationRequest({
|
|
358466
358488
|
onComplete: handleLoopDetectionConfirmation
|
|
358467
358489
|
});
|
|
358468
358490
|
}, [handleLoopDetectionConfirmation]);
|
|
358469
|
-
const processGeminiStreamEvents = (0,
|
|
358491
|
+
const processGeminiStreamEvents = (0, import_react117.useCallback)(
|
|
358470
358492
|
async (stream2, userMessageTimestamp, signal) => {
|
|
358471
358493
|
let geminiMessageBuffer = "";
|
|
358472
358494
|
const toolCallRequests = [];
|
|
@@ -358540,7 +358562,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358540
358562
|
handleCitationEvent
|
|
358541
358563
|
]
|
|
358542
358564
|
);
|
|
358543
|
-
const submitQuery = (0,
|
|
358565
|
+
const submitQuery = (0, import_react117.useCallback)(
|
|
358544
358566
|
async (query, options2, prompt_id) => {
|
|
358545
358567
|
if (isSubmittingQueryRef.current && !options2?.isContinuation) {
|
|
358546
358568
|
return;
|
|
@@ -358673,7 +358695,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358673
358695
|
restoreOriginalModel
|
|
358674
358696
|
]
|
|
358675
358697
|
);
|
|
358676
|
-
const handleApprovalModeChange = (0,
|
|
358698
|
+
const handleApprovalModeChange = (0, import_react117.useCallback)(
|
|
358677
358699
|
async (newApprovalMode) => {
|
|
358678
358700
|
if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "auto-edit" /* AUTO_EDIT */) {
|
|
358679
358701
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -358702,7 +358724,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358702
358724
|
},
|
|
358703
358725
|
[toolCalls]
|
|
358704
358726
|
);
|
|
358705
|
-
const handleCompletedTools = (0,
|
|
358727
|
+
const handleCompletedTools = (0, import_react117.useCallback)(
|
|
358706
358728
|
async (completedToolCallsFromScheduler) => {
|
|
358707
358729
|
if (isResponding) {
|
|
358708
358730
|
return;
|
|
@@ -358787,13 +358809,13 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358787
358809
|
modelSwitchedFromQuotaError
|
|
358788
358810
|
]
|
|
358789
358811
|
);
|
|
358790
|
-
const pendingHistoryItems = (0,
|
|
358812
|
+
const pendingHistoryItems = (0, import_react117.useMemo)(
|
|
358791
358813
|
() => [pendingHistoryItem, pendingToolCallGroupDisplay].filter(
|
|
358792
358814
|
(i) => i !== void 0 && i !== null
|
|
358793
358815
|
),
|
|
358794
358816
|
[pendingHistoryItem, pendingToolCallGroupDisplay]
|
|
358795
358817
|
);
|
|
358796
|
-
(0,
|
|
358818
|
+
(0, import_react117.useEffect)(() => {
|
|
358797
358819
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
358798
358820
|
if (!config.getCheckpointingEnabled()) {
|
|
358799
358821
|
return;
|
|
@@ -358912,7 +358934,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358912
358934
|
|
|
358913
358935
|
// packages/cli/src/ui/hooks/vim.ts
|
|
358914
358936
|
init_esbuild_shims();
|
|
358915
|
-
var
|
|
358937
|
+
var import_react118 = __toESM(require_react(), 1);
|
|
358916
358938
|
var DIGIT_MULTIPLIER = 10;
|
|
358917
358939
|
var DEFAULT_COUNT = 1;
|
|
358918
358940
|
var DIGIT_1_TO_9 = /^[1-9]$/;
|
|
@@ -358975,22 +358997,22 @@ var vimReducer = /* @__PURE__ */ __name((state, action) => {
|
|
|
358975
358997
|
}, "vimReducer");
|
|
358976
358998
|
function useVim(buffer, onSubmit) {
|
|
358977
358999
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
358978
|
-
const [state, dispatch] = (0,
|
|
358979
|
-
(0,
|
|
359000
|
+
const [state, dispatch] = (0, import_react118.useReducer)(vimReducer, initialVimState);
|
|
359001
|
+
(0, import_react118.useEffect)(() => {
|
|
358980
359002
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
358981
359003
|
}, [vimMode]);
|
|
358982
|
-
const updateMode = (0,
|
|
359004
|
+
const updateMode = (0, import_react118.useCallback)(
|
|
358983
359005
|
(mode) => {
|
|
358984
359006
|
setVimMode(mode);
|
|
358985
359007
|
dispatch({ type: "SET_MODE", mode });
|
|
358986
359008
|
},
|
|
358987
359009
|
[setVimMode]
|
|
358988
359010
|
);
|
|
358989
|
-
const getCurrentCount = (0,
|
|
359011
|
+
const getCurrentCount = (0, import_react118.useCallback)(
|
|
358990
359012
|
() => state.count || DEFAULT_COUNT,
|
|
358991
359013
|
[state.count]
|
|
358992
359014
|
);
|
|
358993
|
-
const executeCommand = (0,
|
|
359015
|
+
const executeCommand = (0, import_react118.useCallback)(
|
|
358994
359016
|
(cmdType, count) => {
|
|
358995
359017
|
switch (cmdType) {
|
|
358996
359018
|
case CMD_TYPES.DELETE_WORD_FORWARD: {
|
|
@@ -359066,7 +359088,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359066
359088
|
},
|
|
359067
359089
|
[buffer, updateMode]
|
|
359068
359090
|
);
|
|
359069
|
-
const handleInsertModeInput = (0,
|
|
359091
|
+
const handleInsertModeInput = (0, import_react118.useCallback)(
|
|
359070
359092
|
(normalizedKey) => {
|
|
359071
359093
|
if (normalizedKey.name === "escape") {
|
|
359072
359094
|
buffer.vimEscapeInsertMode();
|
|
@@ -359097,7 +359119,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359097
359119
|
},
|
|
359098
359120
|
[buffer, dispatch, updateMode, onSubmit]
|
|
359099
359121
|
);
|
|
359100
|
-
const normalizeKey = (0,
|
|
359122
|
+
const normalizeKey = (0, import_react118.useCallback)(
|
|
359101
359123
|
(key) => ({
|
|
359102
359124
|
name: key.name || "",
|
|
359103
359125
|
sequence: key.sequence || "",
|
|
@@ -359108,7 +359130,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359108
359130
|
}),
|
|
359109
359131
|
[]
|
|
359110
359132
|
);
|
|
359111
|
-
const handleChangeMovement = (0,
|
|
359133
|
+
const handleChangeMovement = (0, import_react118.useCallback)(
|
|
359112
359134
|
(movement) => {
|
|
359113
359135
|
const count = getCurrentCount();
|
|
359114
359136
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -359129,7 +359151,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359129
359151
|
},
|
|
359130
359152
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
359131
359153
|
);
|
|
359132
|
-
const handleOperatorMotion = (0,
|
|
359154
|
+
const handleOperatorMotion = (0, import_react118.useCallback)(
|
|
359133
359155
|
(operator2, motion) => {
|
|
359134
359156
|
const count = getCurrentCount();
|
|
359135
359157
|
const commandMap = {
|
|
@@ -359156,7 +359178,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359156
359178
|
},
|
|
359157
359179
|
[getCurrentCount, executeCommand, dispatch]
|
|
359158
359180
|
);
|
|
359159
|
-
const handleInput = (0,
|
|
359181
|
+
const handleInput = (0, import_react118.useCallback)(
|
|
359160
359182
|
(key) => {
|
|
359161
359183
|
if (!vimEnabled) {
|
|
359162
359184
|
return false;
|
|
@@ -359524,14 +359546,14 @@ __name(initializeApp, "initializeApp");
|
|
|
359524
359546
|
|
|
359525
359547
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
359526
359548
|
init_esbuild_shims();
|
|
359527
|
-
var
|
|
359549
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
359528
359550
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
359529
359551
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
359530
359552
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
359531
359553
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
359532
359554
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
359533
359555
|
}, "cleanup");
|
|
359534
|
-
(0,
|
|
359556
|
+
(0, import_react119.useEffect)(() => {
|
|
359535
359557
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
359536
359558
|
process.on("exit", cleanup);
|
|
359537
359559
|
process.on("SIGINT", cleanup);
|
|
@@ -359550,13 +359572,13 @@ init_esbuild_shims();
|
|
|
359550
359572
|
|
|
359551
359573
|
// packages/cli/src/ui/hooks/useTimer.ts
|
|
359552
359574
|
init_esbuild_shims();
|
|
359553
|
-
var
|
|
359575
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
359554
359576
|
var useTimer = /* @__PURE__ */ __name((isActive, resetKey) => {
|
|
359555
|
-
const [elapsedTime, setElapsedTime] = (0,
|
|
359556
|
-
const timerRef = (0,
|
|
359557
|
-
const prevResetKeyRef = (0,
|
|
359558
|
-
const prevIsActiveRef = (0,
|
|
359559
|
-
(0,
|
|
359577
|
+
const [elapsedTime, setElapsedTime] = (0, import_react120.useState)(0);
|
|
359578
|
+
const timerRef = (0, import_react120.useRef)(null);
|
|
359579
|
+
const prevResetKeyRef = (0, import_react120.useRef)(resetKey);
|
|
359580
|
+
const prevIsActiveRef = (0, import_react120.useRef)(isActive);
|
|
359581
|
+
(0, import_react120.useEffect)(() => {
|
|
359560
359582
|
let shouldResetTime = false;
|
|
359561
359583
|
if (prevResetKeyRef.current !== resetKey) {
|
|
359562
359584
|
shouldResetTime = true;
|
|
@@ -359594,7 +359616,7 @@ var useTimer = /* @__PURE__ */ __name((isActive, resetKey) => {
|
|
|
359594
359616
|
|
|
359595
359617
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
359596
359618
|
init_esbuild_shims();
|
|
359597
|
-
var
|
|
359619
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
359598
359620
|
var WITTY_LOADING_PHRASES = [
|
|
359599
359621
|
"\u51AC\u74DC\u3001\u9EC4\u74DC\u3001\u897F\u74DC\u3001\u5357\u74DC\u90FD\u80FD\u5403\uFF0C\u4EC0\u4E48\u74DC\u4E0D\u80FD\u5403\uFF1F",
|
|
359600
359622
|
"\u76C6\u91CC\u67096\u53EA\u9992\u5934\uFF0C6\u4E2A\u5C0F\u670B\u53CB\u6BCF\u4EBA\u5206\u52301\u53EA\uFF0C\u4F46\u76C6\u91CC\u8FD8\u7559\u77401\u53EA\uFF0C\u4E3A\u4EC0\u4E48\uFF1F",
|
|
@@ -359699,11 +359721,11 @@ var WITTY_LOADING_PHRASES = [
|
|
|
359699
359721
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
359700
359722
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
359701
359723
|
const loadingPhrases = customPhrases && customPhrases.length > 0 ? customPhrases : WITTY_LOADING_PHRASES;
|
|
359702
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
359724
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react121.useState)(
|
|
359703
359725
|
loadingPhrases[0]
|
|
359704
359726
|
);
|
|
359705
|
-
const phraseIntervalRef = (0,
|
|
359706
|
-
(0,
|
|
359727
|
+
const phraseIntervalRef = (0, import_react121.useRef)(null);
|
|
359728
|
+
(0, import_react121.useEffect)(() => {
|
|
359707
359729
|
if (isWaiting) {
|
|
359708
359730
|
setCurrentLoadingPhrase("Waiting for user confirmation...");
|
|
359709
359731
|
if (phraseIntervalRef.current) {
|
|
@@ -359740,9 +359762,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
359740
359762
|
}, "usePhraseCycler");
|
|
359741
359763
|
|
|
359742
359764
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
359743
|
-
var
|
|
359765
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
359744
359766
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases) => {
|
|
359745
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
359767
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react122.useState)(0);
|
|
359746
359768
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
359747
359769
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
359748
359770
|
const isPhraseCyclingActive = streamingState === "responding" /* Responding */;
|
|
@@ -359752,9 +359774,9 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
359752
359774
|
isWaiting,
|
|
359753
359775
|
customWittyPhrases
|
|
359754
359776
|
);
|
|
359755
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
359756
|
-
const prevStreamingStateRef = (0,
|
|
359757
|
-
(0,
|
|
359777
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react122.useState)(0);
|
|
359778
|
+
const prevStreamingStateRef = (0, import_react122.useRef)(null);
|
|
359779
|
+
(0, import_react122.useEffect)(() => {
|
|
359758
359780
|
if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
359759
359781
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
359760
359782
|
setRetainedElapsedTime(0);
|
|
@@ -359774,21 +359796,21 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
359774
359796
|
|
|
359775
359797
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
359776
359798
|
init_esbuild_shims();
|
|
359777
|
-
var
|
|
359799
|
+
var import_react123 = __toESM(require_react(), 1);
|
|
359778
359800
|
init_trustedFolders();
|
|
359779
359801
|
import * as process38 from "node:process";
|
|
359780
359802
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
359781
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
359782
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
359783
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
359803
|
+
const [isTrusted, setIsTrusted] = (0, import_react123.useState)(void 0);
|
|
359804
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react123.useState)(false);
|
|
359805
|
+
const [isRestarting, setIsRestarting] = (0, import_react123.useState)(false);
|
|
359784
359806
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
359785
|
-
(0,
|
|
359807
|
+
(0, import_react123.useEffect)(() => {
|
|
359786
359808
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
359787
359809
|
setIsTrusted(trusted);
|
|
359788
359810
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
359789
359811
|
onTrustChange(trusted);
|
|
359790
359812
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
359791
|
-
const handleFolderTrustSelect = (0,
|
|
359813
|
+
const handleFolderTrustSelect = (0, import_react123.useCallback)(
|
|
359792
359814
|
(choice2) => {
|
|
359793
359815
|
const trustedFolders = loadTrustedFolders();
|
|
359794
359816
|
const cwd7 = process38.cwd();
|
|
@@ -362973,27 +362995,27 @@ var ConsolePatcher = class {
|
|
|
362973
362995
|
|
|
362974
362996
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
362975
362997
|
init_esbuild_shims();
|
|
362976
|
-
var
|
|
362998
|
+
var import_react124 = __toESM(require_react(), 1);
|
|
362977
362999
|
function useMessageQueue({
|
|
362978
363000
|
isConfigInitialized,
|
|
362979
363001
|
streamingState,
|
|
362980
363002
|
submitQuery
|
|
362981
363003
|
}) {
|
|
362982
|
-
const [messageQueue, setMessageQueue] = (0,
|
|
362983
|
-
const addMessage = (0,
|
|
363004
|
+
const [messageQueue, setMessageQueue] = (0, import_react124.useState)([]);
|
|
363005
|
+
const addMessage = (0, import_react124.useCallback)((message) => {
|
|
362984
363006
|
const trimmedMessage = message.trim();
|
|
362985
363007
|
if (trimmedMessage.length > 0) {
|
|
362986
363008
|
setMessageQueue((prev) => [...prev, trimmedMessage]);
|
|
362987
363009
|
}
|
|
362988
363010
|
}, []);
|
|
362989
|
-
const clearQueue = (0,
|
|
363011
|
+
const clearQueue = (0, import_react124.useCallback)(() => {
|
|
362990
363012
|
setMessageQueue([]);
|
|
362991
363013
|
}, []);
|
|
362992
|
-
const getQueuedMessagesText = (0,
|
|
363014
|
+
const getQueuedMessagesText = (0, import_react124.useCallback)(() => {
|
|
362993
363015
|
if (messageQueue.length === 0) return "";
|
|
362994
363016
|
return messageQueue.join("\n\n");
|
|
362995
363017
|
}, [messageQueue]);
|
|
362996
|
-
(0,
|
|
363018
|
+
(0, import_react124.useEffect)(() => {
|
|
362997
363019
|
if (isConfigInitialized && streamingState === "idle" /* Idle */ && messageQueue.length > 0) {
|
|
362998
363020
|
const combinedMessage = messageQueue.join("\n\n");
|
|
362999
363021
|
setMessageQueue([]);
|
|
@@ -363012,15 +363034,15 @@ __name(useMessageQueue, "useMessageQueue");
|
|
|
363012
363034
|
// packages/cli/src/ui/hooks/useAutoAcceptIndicator.ts
|
|
363013
363035
|
init_esbuild_shims();
|
|
363014
363036
|
init_core2();
|
|
363015
|
-
var
|
|
363037
|
+
var import_react125 = __toESM(require_react(), 1);
|
|
363016
363038
|
function useAutoAcceptIndicator({
|
|
363017
363039
|
config,
|
|
363018
363040
|
addItem,
|
|
363019
363041
|
onApprovalModeChange
|
|
363020
363042
|
}) {
|
|
363021
363043
|
const currentConfigValue = config.getApprovalMode();
|
|
363022
|
-
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0,
|
|
363023
|
-
(0,
|
|
363044
|
+
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0, import_react125.useState)(currentConfigValue);
|
|
363045
|
+
(0, import_react125.useEffect)(() => {
|
|
363024
363046
|
setShowAutoAcceptIndicator(currentConfigValue);
|
|
363025
363047
|
}, [currentConfigValue]);
|
|
363026
363048
|
useKeypress(
|
|
@@ -363053,16 +363075,16 @@ __name(useAutoAcceptIndicator, "useAutoAcceptIndicator");
|
|
|
363053
363075
|
|
|
363054
363076
|
// packages/cli/src/ui/hooks/useWorkspaceMigration.ts
|
|
363055
363077
|
init_esbuild_shims();
|
|
363056
|
-
var
|
|
363078
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
363057
363079
|
init_extension();
|
|
363058
363080
|
init_settings();
|
|
363059
363081
|
import process48 from "node:process";
|
|
363060
363082
|
function useWorkspaceMigration(settings) {
|
|
363061
|
-
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0,
|
|
363062
|
-
const [workspaceExtensions, setWorkspaceExtensions] = (0,
|
|
363083
|
+
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0, import_react126.useState)(false);
|
|
363084
|
+
const [workspaceExtensions, setWorkspaceExtensions] = (0, import_react126.useState)(
|
|
363063
363085
|
[]
|
|
363064
363086
|
);
|
|
363065
|
-
(0,
|
|
363087
|
+
(0, import_react126.useEffect)(() => {
|
|
363066
363088
|
if (!(settings.merged.experimental?.extensionManagement ?? true)) {
|
|
363067
363089
|
return;
|
|
363068
363090
|
}
|
|
@@ -363104,14 +363126,14 @@ __name(useWorkspaceMigration, "useWorkspaceMigration");
|
|
|
363104
363126
|
|
|
363105
363127
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
363106
363128
|
init_esbuild_shims();
|
|
363107
|
-
var
|
|
363129
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
363108
363130
|
init_core2();
|
|
363109
363131
|
import fs96 from "node:fs";
|
|
363110
363132
|
import fsPromises7 from "node:fs/promises";
|
|
363111
363133
|
import path110 from "node:path";
|
|
363112
363134
|
function useGitBranchName(cwd7) {
|
|
363113
|
-
const [branchName, setBranchName] = (0,
|
|
363114
|
-
const fetchBranchName = (0,
|
|
363135
|
+
const [branchName, setBranchName] = (0, import_react127.useState)(void 0);
|
|
363136
|
+
const fetchBranchName = (0, import_react127.useCallback)(async () => {
|
|
363115
363137
|
try {
|
|
363116
363138
|
if (!isCommandAvailable("git").available) {
|
|
363117
363139
|
return;
|
|
@@ -363136,7 +363158,7 @@ function useGitBranchName(cwd7) {
|
|
|
363136
363158
|
setBranchName(void 0);
|
|
363137
363159
|
}
|
|
363138
363160
|
}, [cwd7, setBranchName]);
|
|
363139
|
-
(0,
|
|
363161
|
+
(0, import_react127.useEffect)(() => {
|
|
363140
363162
|
fetchBranchName();
|
|
363141
363163
|
const gitLogsHeadPath = path110.join(cwd7, ".git", "logs", "HEAD");
|
|
363142
363164
|
let watcher;
|
|
@@ -363164,7 +363186,7 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
363164
363186
|
init_esbuild_shims();
|
|
363165
363187
|
init_errors4();
|
|
363166
363188
|
init_extensions();
|
|
363167
|
-
var
|
|
363189
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
363168
363190
|
init_extension();
|
|
363169
363191
|
init_checks();
|
|
363170
363192
|
function confirmationRequestsReducer(state, action) {
|
|
@@ -363180,15 +363202,15 @@ function confirmationRequestsReducer(state, action) {
|
|
|
363180
363202
|
}
|
|
363181
363203
|
__name(confirmationRequestsReducer, "confirmationRequestsReducer");
|
|
363182
363204
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) => {
|
|
363183
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
363205
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react128.useReducer)(
|
|
363184
363206
|
extensionUpdatesReducer,
|
|
363185
363207
|
initialExtensionUpdatesState
|
|
363186
363208
|
);
|
|
363187
363209
|
const [
|
|
363188
363210
|
confirmUpdateExtensionRequests,
|
|
363189
363211
|
dispatchConfirmUpdateExtensionRequests
|
|
363190
|
-
] = (0,
|
|
363191
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
363212
|
+
] = (0, import_react128.useReducer)(confirmationRequestsReducer, []);
|
|
363213
|
+
const addConfirmUpdateExtensionRequest = (0, import_react128.useCallback)(
|
|
363192
363214
|
(original) => {
|
|
363193
363215
|
const wrappedRequest = {
|
|
363194
363216
|
prompt: original.prompt,
|
|
@@ -363207,7 +363229,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
363207
363229
|
},
|
|
363208
363230
|
[dispatchConfirmUpdateExtensionRequests]
|
|
363209
363231
|
);
|
|
363210
|
-
(0,
|
|
363232
|
+
(0, import_react128.useEffect)(() => {
|
|
363211
363233
|
(async () => {
|
|
363212
363234
|
await checkForAllExtensionUpdates(
|
|
363213
363235
|
extensions,
|
|
@@ -363215,7 +363237,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
363215
363237
|
);
|
|
363216
363238
|
})();
|
|
363217
363239
|
}, [extensions, extensions.length, dispatchExtensionStateUpdate]);
|
|
363218
|
-
(0,
|
|
363240
|
+
(0, import_react128.useEffect)(() => {
|
|
363219
363241
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
363220
363242
|
return;
|
|
363221
363243
|
}
|
|
@@ -363280,7 +363302,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
363280
363302
|
addItem,
|
|
363281
363303
|
cwd7
|
|
363282
363304
|
]);
|
|
363283
|
-
const extensionsUpdateStateComputed = (0,
|
|
363305
|
+
const extensionsUpdateStateComputed = (0, import_react128.useMemo)(() => {
|
|
363284
363306
|
const result = /* @__PURE__ */ new Map();
|
|
363285
363307
|
for (const [
|
|
363286
363308
|
key,
|
|
@@ -363301,13 +363323,13 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
363301
363323
|
|
|
363302
363324
|
// packages/cli/src/ui/hooks/useQuitConfirmation.ts
|
|
363303
363325
|
init_esbuild_shims();
|
|
363304
|
-
var
|
|
363326
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
363305
363327
|
var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
363306
|
-
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0,
|
|
363307
|
-
const showQuitConfirmation = (0,
|
|
363328
|
+
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0, import_react129.useState)(false);
|
|
363329
|
+
const showQuitConfirmation = (0, import_react129.useCallback)(() => {
|
|
363308
363330
|
setIsQuitConfirmationOpen(true);
|
|
363309
363331
|
}, []);
|
|
363310
|
-
const handleQuitConfirmationSelect = (0,
|
|
363332
|
+
const handleQuitConfirmationSelect = (0, import_react129.useCallback)((choice2) => {
|
|
363311
363333
|
setIsQuitConfirmationOpen(false);
|
|
363312
363334
|
if (choice2 === "cancel" /* CANCEL */) {
|
|
363313
363335
|
return { shouldQuit: false, action: "cancel" };
|
|
@@ -363329,16 +363351,16 @@ var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
|
363329
363351
|
|
|
363330
363352
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
363331
363353
|
init_esbuild_shims();
|
|
363332
|
-
var
|
|
363354
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
363333
363355
|
init_core2();
|
|
363334
363356
|
init_settingsSchema();
|
|
363335
363357
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
363336
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
363337
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
363338
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
363339
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
363340
|
-
const [inputFillText, setInputFillText] = (0,
|
|
363341
|
-
const checkWelcomeBack = (0,
|
|
363358
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react130.useState)(null);
|
|
363359
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react130.useState)(false);
|
|
363360
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react130.useState)(null);
|
|
363361
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react130.useState)(false);
|
|
363362
|
+
const [inputFillText, setInputFillText] = (0, import_react130.useState)(null);
|
|
363363
|
+
const checkWelcomeBack = (0, import_react130.useCallback)(async () => {
|
|
363342
363364
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
363343
363365
|
return;
|
|
363344
363366
|
}
|
|
@@ -363352,7 +363374,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
363352
363374
|
console.debug("Welcome back check failed:", error);
|
|
363353
363375
|
}
|
|
363354
363376
|
}, [settings.ui?.enableWelcomeBack]);
|
|
363355
|
-
const handleWelcomeBackSelection = (0,
|
|
363377
|
+
const handleWelcomeBackSelection = (0, import_react130.useCallback)(
|
|
363356
363378
|
(choice2) => {
|
|
363357
363379
|
setWelcomeBackChoice(choice2);
|
|
363358
363380
|
setShowWelcomeBackDialog(false);
|
|
@@ -363364,21 +363386,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
363364
363386
|
},
|
|
363365
363387
|
[welcomeBackInfo]
|
|
363366
363388
|
);
|
|
363367
|
-
const handleWelcomeBackClose = (0,
|
|
363389
|
+
const handleWelcomeBackClose = (0, import_react130.useCallback)(() => {
|
|
363368
363390
|
setWelcomeBackChoice("restart");
|
|
363369
363391
|
setShowWelcomeBackDialog(false);
|
|
363370
363392
|
}, []);
|
|
363371
|
-
const clearInputFill = (0,
|
|
363393
|
+
const clearInputFill = (0, import_react130.useCallback)(() => {
|
|
363372
363394
|
setShouldFillInput(false);
|
|
363373
363395
|
setInputFillText(null);
|
|
363374
363396
|
}, []);
|
|
363375
|
-
(0,
|
|
363397
|
+
(0, import_react130.useEffect)(() => {
|
|
363376
363398
|
if (shouldFillInput && inputFillText) {
|
|
363377
363399
|
buffer.setText(inputFillText);
|
|
363378
363400
|
clearInputFill();
|
|
363379
363401
|
}
|
|
363380
363402
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
363381
|
-
(0,
|
|
363403
|
+
(0, import_react130.useEffect)(() => {
|
|
363382
363404
|
checkWelcomeBack();
|
|
363383
363405
|
}, [checkWelcomeBack]);
|
|
363384
363406
|
return {
|
|
@@ -363399,10 +363421,10 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
363399
363421
|
|
|
363400
363422
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
363401
363423
|
init_esbuild_shims();
|
|
363402
|
-
var
|
|
363424
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
363403
363425
|
init_settings();
|
|
363404
363426
|
function useDialogClose(options2) {
|
|
363405
|
-
const closeAnyOpenDialog = (0,
|
|
363427
|
+
const closeAnyOpenDialog = (0, import_react131.useCallback)(() => {
|
|
363406
363428
|
if (options2.isThemeDialogOpen) {
|
|
363407
363429
|
options2.handleThemeSelect(void 0, "User" /* User */);
|
|
363408
363430
|
return true;
|
|
@@ -363434,13 +363456,13 @@ __name(useDialogClose, "useDialogClose");
|
|
|
363434
363456
|
|
|
363435
363457
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
363436
363458
|
init_esbuild_shims();
|
|
363437
|
-
var
|
|
363459
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
363438
363460
|
function useSubagentCreateDialog() {
|
|
363439
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
363440
|
-
const openSubagentCreateDialog = (0,
|
|
363461
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react132.useState)(false);
|
|
363462
|
+
const openSubagentCreateDialog = (0, import_react132.useCallback)(() => {
|
|
363441
363463
|
setIsSubagentCreateDialogOpen(true);
|
|
363442
363464
|
}, []);
|
|
363443
|
-
const closeSubagentCreateDialog = (0,
|
|
363465
|
+
const closeSubagentCreateDialog = (0, import_react132.useCallback)(() => {
|
|
363444
363466
|
setIsSubagentCreateDialogOpen(false);
|
|
363445
363467
|
}, []);
|
|
363446
363468
|
return {
|
|
@@ -363453,13 +363475,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
363453
363475
|
|
|
363454
363476
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
363455
363477
|
init_esbuild_shims();
|
|
363456
|
-
var
|
|
363478
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
363457
363479
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
363458
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
363459
|
-
const openAgentsManagerDialog = (0,
|
|
363480
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react133.useState)(false);
|
|
363481
|
+
const openAgentsManagerDialog = (0, import_react133.useCallback)(() => {
|
|
363460
363482
|
setIsAgentsManagerDialogOpen(true);
|
|
363461
363483
|
}, []);
|
|
363462
|
-
const closeAgentsManagerDialog = (0,
|
|
363484
|
+
const closeAgentsManagerDialog = (0, import_react133.useCallback)(() => {
|
|
363463
363485
|
setIsAgentsManagerDialogOpen(false);
|
|
363464
363486
|
}, []);
|
|
363465
363487
|
return {
|
|
@@ -363471,7 +363493,7 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
363471
363493
|
|
|
363472
363494
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
363473
363495
|
init_esbuild_shims();
|
|
363474
|
-
var
|
|
363496
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
363475
363497
|
|
|
363476
363498
|
// packages/cli/src/utils/attentionNotification.ts
|
|
363477
363499
|
init_esbuild_shims();
|
|
@@ -363499,9 +363521,9 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
363499
363521
|
streamingState,
|
|
363500
363522
|
elapsedTime
|
|
363501
363523
|
}) => {
|
|
363502
|
-
const awaitingNotificationSentRef = (0,
|
|
363503
|
-
const respondingElapsedRef = (0,
|
|
363504
|
-
(0,
|
|
363524
|
+
const awaitingNotificationSentRef = (0, import_react134.useRef)(false);
|
|
363525
|
+
const respondingElapsedRef = (0, import_react134.useRef)(0);
|
|
363526
|
+
(0, import_react134.useEffect)(() => {
|
|
363505
363527
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
|
|
363506
363528
|
notifyTerminalAttention("tool_approval" /* ToolApproval */);
|
|
363507
363529
|
awaitingNotificationSentRef.current = true;
|
|
@@ -363510,7 +363532,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
363510
363532
|
awaitingNotificationSentRef.current = false;
|
|
363511
363533
|
}
|
|
363512
363534
|
}, [isFocused, streamingState]);
|
|
363513
|
-
(0,
|
|
363535
|
+
(0, import_react134.useEffect)(() => {
|
|
363514
363536
|
if (streamingState === "responding" /* Responding */) {
|
|
363515
363537
|
respondingElapsedRef.current = elapsedTime;
|
|
363516
363538
|
return;
|
|
@@ -363528,7 +363550,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
363528
363550
|
|
|
363529
363551
|
// packages/cli/src/ui/hooks/useWebSocket.ts
|
|
363530
363552
|
init_esbuild_shims();
|
|
363531
|
-
var
|
|
363553
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
363532
363554
|
|
|
363533
363555
|
// packages/cli/src/config/websocket.ts
|
|
363534
363556
|
init_esbuild_shims();
|
|
@@ -364082,8 +364104,8 @@ function getRdmindSsoId3() {
|
|
|
364082
364104
|
}
|
|
364083
364105
|
__name(getRdmindSsoId3, "getRdmindSsoId");
|
|
364084
364106
|
function useWebSocket({ onReloadCommands, debug: debug2 }) {
|
|
364085
|
-
const wsClientRef = (0,
|
|
364086
|
-
(0,
|
|
364107
|
+
const wsClientRef = (0, import_react135.useRef)(null);
|
|
364108
|
+
(0, import_react135.useEffect)(() => {
|
|
364087
364109
|
const wsRuntimeConfig = loadWebSocketRuntimeConfig(debug2);
|
|
364088
364110
|
if (!wsRuntimeConfig.enabled) {
|
|
364089
364111
|
if (debug2) {
|
|
@@ -364145,22 +364167,22 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364145
364167
|
const { settings, config, initializationResult } = props;
|
|
364146
364168
|
const historyManager = useHistory();
|
|
364147
364169
|
useMemoryMonitor(historyManager);
|
|
364148
|
-
const [corgiMode, setCorgiMode] = (0,
|
|
364149
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
364150
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
364151
|
-
const [themeError, setThemeError] = (0,
|
|
364170
|
+
const [corgiMode, setCorgiMode] = (0, import_react136.useState)(false);
|
|
364171
|
+
const [debugMessage, setDebugMessage] = (0, import_react136.useState)("");
|
|
364172
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react136.useState)(null);
|
|
364173
|
+
const [themeError, setThemeError] = (0, import_react136.useState)(
|
|
364152
364174
|
initializationResult.themeError
|
|
364153
364175
|
);
|
|
364154
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
364155
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
364156
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
364176
|
+
const [isProcessing, setIsProcessing] = (0, import_react136.useState)(false);
|
|
364177
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react136.useState)(false);
|
|
364178
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react136.useState)(
|
|
364157
364179
|
initializationResult.geminiMdFileCount
|
|
364158
364180
|
);
|
|
364159
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
364160
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
364161
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
364162
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
364163
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
364181
|
+
const [shellModeActive, setShellModeActive] = (0, import_react136.useState)(false);
|
|
364182
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react136.useState)(false);
|
|
364183
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react136.useState)(0);
|
|
364184
|
+
const [updateInfo, setUpdateInfo] = (0, import_react136.useState)(null);
|
|
364185
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react136.useState)(
|
|
364164
364186
|
config.isTrustedFolder()
|
|
364165
364187
|
);
|
|
364166
364188
|
const extensions = config.getExtensions();
|
|
@@ -364175,38 +364197,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364175
364197
|
historyManager.addItem,
|
|
364176
364198
|
config.getWorkingDir()
|
|
364177
364199
|
);
|
|
364178
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
364179
|
-
const openPermissionsDialog = (0,
|
|
364200
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react136.useState)(false);
|
|
364201
|
+
const openPermissionsDialog = (0, import_react136.useCallback)(
|
|
364180
364202
|
() => setPermissionsDialogOpen(true),
|
|
364181
364203
|
[]
|
|
364182
364204
|
);
|
|
364183
|
-
const closePermissionsDialog = (0,
|
|
364205
|
+
const closePermissionsDialog = (0, import_react136.useCallback)(
|
|
364184
364206
|
() => setPermissionsDialogOpen(false),
|
|
364185
364207
|
[]
|
|
364186
364208
|
);
|
|
364187
|
-
const getEffectiveModel2 = (0,
|
|
364209
|
+
const getEffectiveModel2 = (0, import_react136.useCallback)(() => {
|
|
364188
364210
|
if (config.isInFallbackMode()) {
|
|
364189
364211
|
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
364190
364212
|
}
|
|
364191
364213
|
return config.getModel();
|
|
364192
364214
|
}, [config]);
|
|
364193
|
-
const [currentModel, setCurrentModel] = (0,
|
|
364194
|
-
const [userTier] = (0,
|
|
364195
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
364215
|
+
const [currentModel, setCurrentModel] = (0, import_react136.useState)(getEffectiveModel2());
|
|
364216
|
+
const [userTier] = (0, import_react136.useState)(void 0);
|
|
364217
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react136.useState)(false);
|
|
364196
364218
|
const logger6 = useLogger(config.storage);
|
|
364197
|
-
const [userMessages, setUserMessages] = (0,
|
|
364219
|
+
const [userMessages, setUserMessages] = (0, import_react136.useState)([]);
|
|
364198
364220
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
364199
364221
|
const { stdin, setRawMode } = use_stdin_default();
|
|
364200
364222
|
const { stdout } = use_stdout_default();
|
|
364201
364223
|
const { stats: sessionStats } = useSessionStats();
|
|
364202
364224
|
const branchName = useGitBranchName(config.getTargetDir());
|
|
364203
|
-
const mainControlsRef = (0,
|
|
364204
|
-
const originalTitleRef = (0,
|
|
364225
|
+
const mainControlsRef = (0, import_react136.useRef)(null);
|
|
364226
|
+
const originalTitleRef = (0, import_react136.useRef)(
|
|
364205
364227
|
computeWindowTitle(basename16(config.getTargetDir()))
|
|
364206
364228
|
);
|
|
364207
|
-
const lastTitleRef = (0,
|
|
364229
|
+
const lastTitleRef = (0, import_react136.useRef)(null);
|
|
364208
364230
|
const staticExtraHeight = 3;
|
|
364209
|
-
(0,
|
|
364231
|
+
(0, import_react136.useEffect)(() => {
|
|
364210
364232
|
(async () => {
|
|
364211
364233
|
await config.initialize();
|
|
364212
364234
|
setConfigInitialized(true);
|
|
@@ -364216,11 +364238,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364216
364238
|
await ideClient.disconnect();
|
|
364217
364239
|
});
|
|
364218
364240
|
}, [config]);
|
|
364219
|
-
(0,
|
|
364241
|
+
(0, import_react136.useEffect)(
|
|
364220
364242
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
364221
364243
|
[historyManager.addItem]
|
|
364222
364244
|
);
|
|
364223
|
-
(0,
|
|
364245
|
+
(0, import_react136.useEffect)(() => {
|
|
364224
364246
|
const checkModelChange = /* @__PURE__ */ __name(() => {
|
|
364225
364247
|
const effectiveModel = getEffectiveModel2();
|
|
364226
364248
|
if (effectiveModel !== currentModel) {
|
|
@@ -364236,7 +364258,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364236
364258
|
handleNewMessage,
|
|
364237
364259
|
clearConsoleMessages: clearConsoleMessagesState
|
|
364238
364260
|
} = useConsoleMessages();
|
|
364239
|
-
(0,
|
|
364261
|
+
(0, import_react136.useEffect)(() => {
|
|
364240
364262
|
const consolePatcher = new ConsolePatcher({
|
|
364241
364263
|
onNewMessage: handleNewMessage,
|
|
364242
364264
|
debugMode: config.getDebugMode()
|
|
@@ -364244,13 +364266,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364244
364266
|
consolePatcher.patch();
|
|
364245
364267
|
registerCleanup(consolePatcher.cleanup);
|
|
364246
364268
|
}, [handleNewMessage, config]);
|
|
364247
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
364269
|
+
const { inputWidth, suggestionsWidth } = (0, import_react136.useMemo)(() => {
|
|
364248
364270
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
364249
364271
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
364250
364272
|
}, [terminalWidth]);
|
|
364251
364273
|
const mainAreaWidth = Math.floor(terminalWidth * 0.9);
|
|
364252
364274
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
364253
|
-
const isValidPath = (0,
|
|
364275
|
+
const isValidPath = (0, import_react136.useCallback)((filePath) => {
|
|
364254
364276
|
try {
|
|
364255
364277
|
return fs99.existsSync(filePath) && fs99.statSync(filePath).isFile();
|
|
364256
364278
|
} catch (_e) {
|
|
@@ -364265,7 +364287,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364265
364287
|
isValidPath,
|
|
364266
364288
|
shellModeActive
|
|
364267
364289
|
});
|
|
364268
|
-
(0,
|
|
364290
|
+
(0, import_react136.useEffect)(() => {
|
|
364269
364291
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
364270
364292
|
const pastMessagesRaw = await logger6?.getPreviousUserMessages() || [];
|
|
364271
364293
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -364288,7 +364310,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364288
364310
|
}, "fetchUserMessages");
|
|
364289
364311
|
fetchUserMessages();
|
|
364290
364312
|
}, [historyManager.history, logger6]);
|
|
364291
|
-
const refreshStatic = (0,
|
|
364313
|
+
const refreshStatic = (0, import_react136.useCallback)(() => {
|
|
364292
364314
|
stdout.write(base_exports.clearTerminal);
|
|
364293
364315
|
setHistoryRemountKey((prev) => prev + 1);
|
|
364294
364316
|
}, [setHistoryRemountKey, stdout]);
|
|
@@ -364320,7 +364342,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364320
364342
|
openAuthDialog,
|
|
364321
364343
|
cancelAuthentication
|
|
364322
364344
|
} = useAuthCommand(settings, config, historyManager.addItem);
|
|
364323
|
-
(0,
|
|
364345
|
+
(0, import_react136.useEffect)(() => {
|
|
364324
364346
|
if (!shouldTriggerAutoSSOAuth(settings)) {
|
|
364325
364347
|
return;
|
|
364326
364348
|
}
|
|
@@ -364499,17 +364521,17 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364499
364521
|
setAuthState,
|
|
364500
364522
|
setModelSwitchedFromQuotaError
|
|
364501
364523
|
});
|
|
364502
|
-
const handleQwenAuthTimeout = (0,
|
|
364524
|
+
const handleQwenAuthTimeout = (0, import_react136.useCallback)(() => {
|
|
364503
364525
|
onAuthError("Qwen OAuth authentication timed out. Please try again.");
|
|
364504
364526
|
cancelAuthentication();
|
|
364505
364527
|
setAuthState("updating" /* Updating */);
|
|
364506
364528
|
}, [onAuthError, cancelAuthentication, setAuthState]);
|
|
364507
|
-
const handleQwenAuthCancel = (0,
|
|
364529
|
+
const handleQwenAuthCancel = (0, import_react136.useCallback)(() => {
|
|
364508
364530
|
onAuthError("Qwen OAuth authentication cancelled.");
|
|
364509
364531
|
cancelAuthentication();
|
|
364510
364532
|
setAuthState("updating" /* Updating */);
|
|
364511
364533
|
}, [onAuthError, cancelAuthentication, setAuthState]);
|
|
364512
|
-
(0,
|
|
364534
|
+
(0, import_react136.useEffect)(() => {
|
|
364513
364535
|
if (settings.merged.security?.auth?.enforcedType && settings.merged.security?.auth.selectedType && settings.merged.security?.auth.enforcedType !== settings.merged.security?.auth.selectedType) {
|
|
364514
364536
|
onAuthError(
|
|
364515
364537
|
`Authentication is enforced to be ${settings.merged.security?.auth.enforcedType}, but you are currently using ${settings.merged.security?.auth.selectedType}.`
|
|
@@ -364528,7 +364550,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364528
364550
|
settings.merged.security?.auth?.useExternal,
|
|
364529
364551
|
onAuthError
|
|
364530
364552
|
]);
|
|
364531
|
-
const [editorError, setEditorError] = (0,
|
|
364553
|
+
const [editorError, setEditorError] = (0, import_react136.useState)(null);
|
|
364532
364554
|
const {
|
|
364533
364555
|
isEditorDialogOpen,
|
|
364534
364556
|
openEditorDialog,
|
|
@@ -364555,9 +364577,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364555
364577
|
openAgentsManagerDialog,
|
|
364556
364578
|
closeAgentsManagerDialog
|
|
364557
364579
|
} = useAgentsManagerDialog();
|
|
364558
|
-
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0,
|
|
364559
|
-
const [visionSwitchResolver, setVisionSwitchResolver] = (0,
|
|
364560
|
-
const slashCommandActions = (0,
|
|
364580
|
+
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0, import_react136.useState)(false);
|
|
364581
|
+
const [visionSwitchResolver, setVisionSwitchResolver] = (0, import_react136.useState)(null);
|
|
364582
|
+
const slashCommandActions = (0, import_react136.useMemo)(
|
|
364561
364583
|
() => ({
|
|
364562
364584
|
openAuthDialog,
|
|
364563
364585
|
openThemeDialog,
|
|
@@ -364625,14 +364647,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364625
364647
|
onReloadCommands: reloadCommands,
|
|
364626
364648
|
debug: config.getDebugMode()
|
|
364627
364649
|
});
|
|
364628
|
-
const handleVisionSwitchRequired = (0,
|
|
364650
|
+
const handleVisionSwitchRequired = (0, import_react136.useCallback)(
|
|
364629
364651
|
async (_query) => new Promise((resolve26, reject) => {
|
|
364630
364652
|
setVisionSwitchResolver({ resolve: resolve26, reject });
|
|
364631
364653
|
setIsVisionSwitchDialogOpen(true);
|
|
364632
364654
|
}),
|
|
364633
364655
|
[]
|
|
364634
364656
|
);
|
|
364635
|
-
const handleVisionSwitchSelect = (0,
|
|
364657
|
+
const handleVisionSwitchSelect = (0, import_react136.useCallback)(
|
|
364636
364658
|
(outcome) => {
|
|
364637
364659
|
setIsVisionSwitchDialogOpen(false);
|
|
364638
364660
|
if (visionSwitchResolver) {
|
|
@@ -364643,10 +364665,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364643
364665
|
},
|
|
364644
364666
|
[visionSwitchResolver]
|
|
364645
364667
|
);
|
|
364646
|
-
const onDebugMessage = (0,
|
|
364668
|
+
const onDebugMessage = (0, import_react136.useCallback)((message) => {
|
|
364647
364669
|
console.debug(message);
|
|
364648
364670
|
}, []);
|
|
364649
|
-
const performMemoryRefresh = (0,
|
|
364671
|
+
const performMemoryRefresh = (0, import_react136.useCallback)(async () => {
|
|
364650
364672
|
historyManager.addItem(
|
|
364651
364673
|
{
|
|
364652
364674
|
type: "info" /* INFO */,
|
|
@@ -364697,7 +364719,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364697
364719
|
console.error("Error refreshing memory:", error);
|
|
364698
364720
|
}
|
|
364699
364721
|
}, [config, historyManager, settings.merged]);
|
|
364700
|
-
const cancelHandlerRef = (0,
|
|
364722
|
+
const cancelHandlerRef = (0, import_react136.useRef)(() => {
|
|
364701
364723
|
});
|
|
364702
364724
|
const {
|
|
364703
364725
|
streamingState,
|
|
@@ -364744,7 +364766,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364744
364766
|
streamingState,
|
|
364745
364767
|
submitQuery
|
|
364746
364768
|
});
|
|
364747
|
-
const handleFinalSubmit = (0,
|
|
364769
|
+
const handleFinalSubmit = (0, import_react136.useCallback)(
|
|
364748
364770
|
(submittedValue) => {
|
|
364749
364771
|
addMessage(submittedValue);
|
|
364750
364772
|
},
|
|
@@ -364757,7 +364779,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364757
364779
|
handleWelcomeBackSelection,
|
|
364758
364780
|
handleWelcomeBackClose
|
|
364759
364781
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
364760
|
-
cancelHandlerRef.current = (0,
|
|
364782
|
+
cancelHandlerRef.current = (0, import_react136.useCallback)(() => {
|
|
364761
364783
|
const pendingHistoryItems2 = [
|
|
364762
364784
|
...pendingSlashCommandHistoryItems,
|
|
364763
364785
|
...pendingGeminiHistoryItems
|
|
@@ -364786,7 +364808,7 @@ ${queuedText}` : queuedText;
|
|
|
364786
364808
|
pendingSlashCommandHistoryItems,
|
|
364787
364809
|
pendingGeminiHistoryItems
|
|
364788
364810
|
]);
|
|
364789
|
-
const handleClearScreen = (0,
|
|
364811
|
+
const handleClearScreen = (0, import_react136.useCallback)(() => {
|
|
364790
364812
|
historyManager.clearItems();
|
|
364791
364813
|
clearConsoleMessagesState();
|
|
364792
364814
|
console.clear();
|
|
@@ -364794,8 +364816,8 @@ ${queuedText}` : queuedText;
|
|
|
364794
364816
|
}, [historyManager, clearConsoleMessagesState, refreshStatic]);
|
|
364795
364817
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
364796
364818
|
const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */) && !proQuotaRequest;
|
|
364797
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
364798
|
-
(0,
|
|
364819
|
+
const [controlsHeight, setControlsHeight] = (0, import_react136.useState)(0);
|
|
364820
|
+
(0, import_react136.useLayoutEffect)(() => {
|
|
364799
364821
|
if (mainControlsRef.current) {
|
|
364800
364822
|
const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
|
|
364801
364823
|
if (fullFooterMeasurement.height > 0) {
|
|
@@ -364818,14 +364840,14 @@ ${queuedText}` : queuedText;
|
|
|
364818
364840
|
});
|
|
364819
364841
|
const isFocused = useFocus();
|
|
364820
364842
|
useBracketedPaste();
|
|
364821
|
-
const contextFileNames = (0,
|
|
364843
|
+
const contextFileNames = (0, import_react136.useMemo)(() => {
|
|
364822
364844
|
const fromSettings = settings.merged.context?.fileName;
|
|
364823
364845
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
364824
364846
|
}, [settings.merged.context?.fileName]);
|
|
364825
|
-
const initialPrompt = (0,
|
|
364826
|
-
const initialPromptSubmitted = (0,
|
|
364847
|
+
const initialPrompt = (0, import_react136.useMemo)(() => config.getQuestion(), [config]);
|
|
364848
|
+
const initialPromptSubmitted = (0, import_react136.useRef)(false);
|
|
364827
364849
|
const geminiClient = config.getGeminiClient();
|
|
364828
|
-
(0,
|
|
364850
|
+
(0, import_react136.useEffect)(() => {
|
|
364829
364851
|
if (activePtyId) {
|
|
364830
364852
|
ShellExecutionService.resizePty(
|
|
364831
364853
|
activePtyId,
|
|
@@ -364834,7 +364856,7 @@ ${queuedText}` : queuedText;
|
|
|
364834
364856
|
);
|
|
364835
364857
|
}
|
|
364836
364858
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
364837
|
-
(0,
|
|
364859
|
+
(0, import_react136.useEffect)(() => {
|
|
364838
364860
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && !isVisionSwitchDialogOpen && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
364839
364861
|
handleFinalSubmit(initialPrompt);
|
|
364840
364862
|
initialPromptSubmitted.current = true;
|
|
@@ -364852,9 +364874,9 @@ ${queuedText}` : queuedText;
|
|
|
364852
364874
|
welcomeBackChoice,
|
|
364853
364875
|
geminiClient
|
|
364854
364876
|
]);
|
|
364855
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
364856
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
364857
|
-
(0,
|
|
364877
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react136.useState)(false);
|
|
364878
|
+
const [currentIDE, setCurrentIDE] = (0, import_react136.useState)(null);
|
|
364879
|
+
(0, import_react136.useEffect)(() => {
|
|
364858
364880
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
364859
364881
|
const ideClient = await IdeClient.getInstance();
|
|
364860
364882
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -364865,28 +364887,28 @@ ${queuedText}` : queuedText;
|
|
|
364865
364887
|
const shouldShowIdePrompt = Boolean(
|
|
364866
364888
|
currentIDE && !config.getIdeMode() && !settings.merged.ide?.hasSeenNudge && !idePromptAnswered
|
|
364867
364889
|
);
|
|
364868
|
-
const [showErrorDetails, setShowErrorDetails] = (0,
|
|
364869
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
364870
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
364871
|
-
const ctrlCTimerRef = (0,
|
|
364872
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
364873
|
-
const ctrlDTimerRef = (0,
|
|
364874
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
364875
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
364876
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
364877
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
364890
|
+
const [showErrorDetails, setShowErrorDetails] = (0, import_react136.useState)(false);
|
|
364891
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react136.useState)(false);
|
|
364892
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react136.useState)(false);
|
|
364893
|
+
const ctrlCTimerRef = (0, import_react136.useRef)(null);
|
|
364894
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react136.useState)(false);
|
|
364895
|
+
const ctrlDTimerRef = (0, import_react136.useRef)(null);
|
|
364896
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react136.useState)(true);
|
|
364897
|
+
const [ideContextState, setIdeContextState] = (0, import_react136.useState)();
|
|
364898
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react136.useState)(false);
|
|
364899
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react136.useState)(false);
|
|
364878
364900
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
364879
364901
|
const {
|
|
364880
364902
|
needsRestart: ideNeedsRestart,
|
|
364881
364903
|
restartReason: ideTrustRestartReason
|
|
364882
364904
|
} = useIdeTrustListener();
|
|
364883
|
-
const isInitialMount = (0,
|
|
364884
|
-
(0,
|
|
364905
|
+
const isInitialMount = (0, import_react136.useRef)(true);
|
|
364906
|
+
(0, import_react136.useEffect)(() => {
|
|
364885
364907
|
if (ideNeedsRestart) {
|
|
364886
364908
|
setShowIdeRestartPrompt(true);
|
|
364887
364909
|
}
|
|
364888
364910
|
}, [ideNeedsRestart]);
|
|
364889
|
-
(0,
|
|
364911
|
+
(0, import_react136.useEffect)(() => {
|
|
364890
364912
|
if (isInitialMount.current) {
|
|
364891
364913
|
isInitialMount.current = false;
|
|
364892
364914
|
return;
|
|
@@ -364898,12 +364920,12 @@ ${queuedText}` : queuedText;
|
|
|
364898
364920
|
clearTimeout(handler);
|
|
364899
364921
|
};
|
|
364900
364922
|
}, [terminalWidth, refreshStatic]);
|
|
364901
|
-
(0,
|
|
364923
|
+
(0, import_react136.useEffect)(() => {
|
|
364902
364924
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
364903
364925
|
setIdeContextState(ideContextStore.get());
|
|
364904
364926
|
return unsubscribe;
|
|
364905
364927
|
}, []);
|
|
364906
|
-
(0,
|
|
364928
|
+
(0, import_react136.useEffect)(() => {
|
|
364907
364929
|
const openDebugConsole = /* @__PURE__ */ __name(() => {
|
|
364908
364930
|
setShowErrorDetails(true);
|
|
364909
364931
|
setConstrainHeight(false);
|
|
@@ -364922,10 +364944,10 @@ ${queuedText}` : queuedText;
|
|
|
364922
364944
|
appEvents.off("log-error" /* LogError */, logErrorHandler);
|
|
364923
364945
|
};
|
|
364924
364946
|
}, [handleNewMessage]);
|
|
364925
|
-
const handleEscapePromptChange = (0,
|
|
364947
|
+
const handleEscapePromptChange = (0, import_react136.useCallback)((showPrompt) => {
|
|
364926
364948
|
setShowEscapePrompt(showPrompt);
|
|
364927
364949
|
}, []);
|
|
364928
|
-
const handleIdePromptComplete = (0,
|
|
364950
|
+
const handleIdePromptComplete = (0, import_react136.useCallback)(
|
|
364929
364951
|
(result) => {
|
|
364930
364952
|
if (result.userSelection === "yes") {
|
|
364931
364953
|
handleSlashCommand2("/ide install");
|
|
@@ -364963,7 +364985,7 @@ ${queuedText}` : queuedText;
|
|
|
364963
364985
|
handleWelcomeBackClose,
|
|
364964
364986
|
quitConfirmationRequest
|
|
364965
364987
|
});
|
|
364966
|
-
const handleExit = (0,
|
|
364988
|
+
const handleExit = (0, import_react136.useCallback)(
|
|
364967
364989
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
364968
364990
|
if (pressedOnce) {
|
|
364969
364991
|
if (timerRef.current) {
|
|
@@ -365006,7 +365028,7 @@ ${queuedText}` : queuedText;
|
|
|
365006
365028
|
buffer
|
|
365007
365029
|
]
|
|
365008
365030
|
);
|
|
365009
|
-
const handleGlobalKeypress = (0,
|
|
365031
|
+
const handleGlobalKeypress = (0, import_react136.useCallback)(
|
|
365010
365032
|
(key) => {
|
|
365011
365033
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
365012
365034
|
console.log("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -365079,7 +365101,7 @@ ${queuedText}` : queuedText;
|
|
|
365079
365101
|
]
|
|
365080
365102
|
);
|
|
365081
365103
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
365082
|
-
(0,
|
|
365104
|
+
(0, import_react136.useEffect)(() => {
|
|
365083
365105
|
if (!settings.merged.ui?.showStatusInTitle || settings.merged.ui?.hideWindowTitle)
|
|
365084
365106
|
return;
|
|
365085
365107
|
let title;
|
|
@@ -365101,23 +365123,23 @@ ${queuedText}` : queuedText;
|
|
|
365101
365123
|
settings.merged.ui?.hideWindowTitle,
|
|
365102
365124
|
stdout
|
|
365103
365125
|
]);
|
|
365104
|
-
const filteredConsoleMessages = (0,
|
|
365126
|
+
const filteredConsoleMessages = (0, import_react136.useMemo)(() => {
|
|
365105
365127
|
if (config.getDebugMode()) {
|
|
365106
365128
|
return consoleMessages;
|
|
365107
365129
|
}
|
|
365108
365130
|
return consoleMessages.filter((msg) => msg.type !== "debug");
|
|
365109
365131
|
}, [consoleMessages, config]);
|
|
365110
|
-
const errorCount = (0,
|
|
365132
|
+
const errorCount = (0, import_react136.useMemo)(
|
|
365111
365133
|
() => filteredConsoleMessages.filter((msg) => msg.type === "error").reduce((total, msg) => total + msg.count, 0),
|
|
365112
365134
|
[filteredConsoleMessages]
|
|
365113
365135
|
);
|
|
365114
365136
|
const nightly = props.version.includes("nightly");
|
|
365115
365137
|
const dialogsVisible = showWelcomeBackDialog || showWorkspaceMigrationDialog || shouldShowIdePrompt || isFolderTrustDialogOpen || !!shellConfirmationRequest || !!confirmationRequest || confirmUpdateExtensionRequests.length > 0 || !!loopDetectionConfirmationRequest || !!quitConfirmationRequest || isThemeDialogOpen || isSettingsDialogOpen || isModelDialogOpen || isVisionSwitchDialogOpen || isPermissionsDialogOpen || isAuthDialogOpen || isAuthenticating && isQwenAuthenticating || isEditorDialogOpen || showIdeRestartPrompt || !!proQuotaRequest || isSubagentCreateDialogOpen || isAgentsManagerDialogOpen || isApprovalModeDialogOpen;
|
|
365116
|
-
const pendingHistoryItems = (0,
|
|
365138
|
+
const pendingHistoryItems = (0, import_react136.useMemo)(
|
|
365117
365139
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
365118
365140
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
365119
365141
|
);
|
|
365120
|
-
const uiState = (0,
|
|
365142
|
+
const uiState = (0, import_react136.useMemo)(
|
|
365121
365143
|
() => ({
|
|
365122
365144
|
history: historyManager.history,
|
|
365123
365145
|
historyManager,
|
|
@@ -365316,7 +365338,7 @@ ${queuedText}` : queuedText;
|
|
|
365316
365338
|
isAgentsManagerDialogOpen
|
|
365317
365339
|
]
|
|
365318
365340
|
);
|
|
365319
|
-
const uiActions = (0,
|
|
365341
|
+
const uiActions = (0, import_react136.useMemo)(
|
|
365320
365342
|
() => ({
|
|
365321
365343
|
handleThemeSelect,
|
|
365322
365344
|
handleThemeHighlight,
|
|
@@ -366577,9 +366599,9 @@ init_core2();
|
|
|
366577
366599
|
|
|
366578
366600
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
366579
366601
|
init_esbuild_shims();
|
|
366580
|
-
var
|
|
366602
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
366581
366603
|
function useKittyKeyboardProtocol() {
|
|
366582
|
-
const [status] = (0,
|
|
366604
|
+
const [status] = (0, import_react137.useState)({
|
|
366583
366605
|
supported: isKittyProtocolSupported(),
|
|
366584
366606
|
enabled: isKittyProtocolEnabled(),
|
|
366585
366607
|
checking: false
|
|
@@ -368440,7 +368462,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
368440
368462
|
) });
|
|
368441
368463
|
}, "AppWrapper");
|
|
368442
368464
|
const instance = render_default(
|
|
368443
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
368465
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_react138.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(AppWrapper, {}),
|
|
368444
368466
|
{
|
|
368445
368467
|
exitOnCtrlC: false,
|
|
368446
368468
|
isScreenReaderEnabled: config.getScreenReader()
|